Merge branch 'MDL-47733-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Dan Poltawski 2014-10-17 11:44:58 +01:00
commit 9b4a87f7e6
4 changed files with 16 additions and 22 deletions

View File

@ -846,16 +846,14 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
if (typeof o.responseText !== "undefined" &&
o.responseText !== "" &&
o.responseText !== this.textarea.get('value')) {
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
if (!response_json.error && response_json.result) {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
this.recoverText(response_json.result);
} else {
if (response_json.error || typeof response_json.result === 'undefined') {
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json !== this.textarea.get('value')) {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
this.recoverText(response_json.result);
}
this._fireSelectionChanged();
}

File diff suppressed because one or more lines are too long

View File

@ -841,14 +841,12 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
if (typeof o.responseText !== "undefined" &&
o.responseText !== "" &&
o.responseText !== this.textarea.get('value')) {
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
if (!response_json.error && response_json.result) {
this.recoverText(response_json.result);
} else {
if (response_json.error || typeof response_json.result === 'undefined') {
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json !== this.textarea.get('value')) {
this.recoverText(response_json.result);
}
this._fireSelectionChanged();
}

View File

@ -142,16 +142,14 @@ EditorAutosave.prototype = {
context: this,
on: {
success: function(id,o) {
if (typeof o.responseText !== "undefined" &&
o.responseText !== "" &&
o.responseText !== this.textarea.get('value')) {
if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
if (!response_json.error && response_json.result) {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
this.recoverText(response_json.result);
} else {
if (response_json.error || typeof response_json.result === 'undefined') {
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
} else if (response_json !== this.textarea.get('value')) {
Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
this.recoverText(response_json.result);
}
this._fireSelectionChanged();
}