mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Merge branch 'MDL-47733-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
9b4a87f7e6
@ -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
@ -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();
|
||||
}
|
||||
|
12
lib/editor/atto/yui/src/editor/js/autosave.js
vendored
12
lib/editor/atto/yui/src/editor/js/autosave.js
vendored
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user