Skip to content

Commit

Permalink
MDL-18014 Atto autosave: Change ajax script path to an attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Aug 14, 2014
1 parent e7a8977 commit 56579fb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,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
}
};

Expand Down Expand Up @@ -803,7 +816,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'),
Expand Down Expand Up @@ -849,7 +862,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'),
Expand Down Expand Up @@ -900,7 +913,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'),
Expand Down
Loading

0 comments on commit 56579fb

Please sign in to comment.