MDL-18014 Atto autosave: Change ajax script path to an attribute
authorDamyon Wiese <damyon@moodle.com>
Tue, 5 Aug 2014 09:11:07 +0000 (17:11 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 14 Aug 2014 04:44:00 +0000 (12:44 +0800)
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/autosave.js

index 672c54e..ae82a44 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js differ
index fbd2eb6..25a0ce4 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js differ
index 8e172d0..46b9e7c 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js differ
index 9a1cab3..5b3202a 100644 (file)
@@ -53,6 +53,19 @@ EditorAutosave.ATTRS= {
     autosaveFrequency: {
         value: 60,
         writeOnce: true
+    },
+
+    /**
+     * The relative path to the ajax script.
+     *
+     * @attribute autosaveAjaxScript
+     * @type String
+     * @default '/lib/editor/atto/autosave-ajax.php'
+     * @readOnly
+     */
+    autosaveAjaxScript: {
+        value: '/lib/editor/atto/autosave-ajax.php',
+        readOnly: true
     }
 };
 
@@ -99,7 +112,7 @@ EditorAutosave.prototype = {
 
         // First see if there are any saved drafts.
         // Make an ajax request.
-        url = M.cfg.wwwroot + '/lib/editor/atto/autosave-ajax.php';
+        url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
         params = {
             sesskey: M.cfg.sesskey,
             contextid: this.get('contextid'),
@@ -145,7 +158,7 @@ EditorAutosave.prototype = {
      */
     resetAutosave: function() {
         // Make an ajax request to reset the autosaved text.
-        url = M.cfg.wwwroot + '/lib/editor/atto/autosave-ajax.php';
+        url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
         params = {
             sesskey: M.cfg.sesskey,
             contextid: this.get('contextid'),
@@ -196,7 +209,7 @@ EditorAutosave.prototype = {
             Y.log('Autosave text', 'debug', LOGNAME_AUTOSAVE);
 
             // Make an ajax request.
-            url = M.cfg.wwwroot + '/lib/editor/atto/autosave-ajax.php';
+            url = M.cfg.wwwroot + this.get('autosaveAjaxScript');
             params = {
                 sesskey: M.cfg.sesskey,
                 contextid: this.get('contextid'),