MDL-47736 editor_atto: added fix for IE 9 and 10

This commit is contained in:
Mark Nelson 2014-10-21 00:30:10 -07:00
parent 3c15d25bcf
commit 7b62567e85
4 changed files with 20 additions and 2 deletions

View File

@ -850,11 +850,17 @@ EditorAutosave.prototype = {
response_json = JSON.parse(o.responseText);
// Revert untouched editor contents to an empty string.
// Check for FF and Chrome.
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
response_json.result === '<br>') {
response_json.result = '';
}
// Check for IE 9 and 10.
if (response_json.result === '<p>&nbsp;</p>' || response_json.result === '<p><br>&nbsp;</p>') {
response_json.result = '';
}
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);

File diff suppressed because one or more lines are too long

View File

@ -845,11 +845,17 @@ EditorAutosave.prototype = {
response_json = JSON.parse(o.responseText);
// Revert untouched editor contents to an empty string.
// Check for FF and Chrome.
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
response_json.result === '<br>') {
response_json.result = '';
}
// Check for IE 9 and 10.
if (response_json.result === '<p>&nbsp;</p>' || response_json.result === '<p><br>&nbsp;</p>') {
response_json.result = '';
}
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.result !== this.textarea.get('value')) {

View File

@ -146,11 +146,17 @@ EditorAutosave.prototype = {
response_json = JSON.parse(o.responseText);
// Revert untouched editor contents to an empty string.
// Check for FF and Chrome.
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
response_json.result === '<br>') {
response_json.result = '';
}
// Check for IE 9 and 10.
if (response_json.result === '<p>&nbsp;</p>' || response_json.result === '<p><br>&nbsp;</p>') {
response_json.result = '';
}
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);