Merge branch 'MDL-47733-master' of git://github.com/FMCorz/moodle
This commit is contained in:
+5
-7
@@ -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();
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+4
-6
@@ -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();
|
||||
}
|
||||
|
||||
+5
-7
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user