MDL-18014 Atto autosave: When text is recovered, force it into the undo stack
authorDamyon Wiese <damyon@moodle.com>
Tue, 19 Aug 2014 04:13:41 +0000 (12:13 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 19 Aug 2014 04:13:41 +0000 (12:13 +0800)
This allows you to use "Undo" to go back to the unaltered text in the form.

lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-debug.js
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button.js
lib/editor/atto/plugins/undo/yui/src/button/js/button.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/autosave.js

index 9236504..6fd8654 100644 (file)
Binary files a/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-debug.js and b/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-debug.js differ
index 818481e..95c2b3e 100644 (file)
Binary files a/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js and b/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js differ
index 9236504..6fd8654 100644 (file)
Binary files a/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button.js and b/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button.js differ
index 0a5baf5..983d746 100644 (file)
@@ -278,7 +278,7 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
      * @private
      */
     _changeListener: function(e) {
-        if (e.event.type.indexOf('key') !== -1) {
+        if (e.event && e.event.type.indexOf('key') !== -1) {
             // These are the 4 arrow keys.
             if ((e.event.keyCode !== 39) &&
                     (e.event.keyCode !== 37) &&
index 15eaa2e..40cc593 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js differ
index 9d67580..068aab8 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js differ
index 153d5de..cb7326d 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js and b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js differ
index 24347e7..33b0b88 100644 (file)
@@ -145,8 +145,9 @@ EditorAutosave.prototype = {
                     if (typeof o.responseText !== "undefined" &&
                             o.responseText !== "" &&
                             o.responseText !== this.textarea.get('value')) {
-                        Y.log('Autosave text found - confirm recovery.', 'debug', LOGNAME_AUTOSAVE);
+                        Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
                         this.recoverText(o.responseText);
+                        this._fireSelectionChanged();
                     }
                 }
             }