Class type Goog.​Geditor.​Plugins.​undoRedo

class type undoRedo = object..end

Inherits


method clearHistory : unit Js.meth

Clear the undo/redo stack.

method disable : Goog.Geditor.field Js.t -> unit Js.meth

Disables this plugin for the specified, registered field object.

method disposeInternal : unit Js.meth
method enable : Goog.Geditor.field Js.t -> unit Js.meth

Enables this plugin for the specified, registered field object. A field object should only be enabled when it is loaded.

method getCurrentEventTarget : Goog.Geditor.field Js.t Js.meth

This is so subclasses can deal with multifield undo-redo.

Returns Target for COMMAND_VALUE_CHANGE events.

method getCurrentFieldObject : Goog.Geditor.field Js.t Js.meth

This is so subclasses can deal with multifield undo-redo.

Returns The active field object for this field. This is the one registered field object for the single-plugin case and the focused field for the multi-field plugin case.

method getFieldObject : 
Js.js_string Js.t -> Goog.Geditor.field Js.t Js.meth

This is so subclasses can deal with multifield undo-redo.

Returns The field object with the hashcode.

method getTrogClassId : Js.js_string Js.t Js.meth

Returns The ID unique to this plugin class. Note that different instances off the plugin share the same classId.

method handleKeyboardShortcut : 
'a.
(#Goog.Events.browserEvent as 'a) Js.t ->
Js.js_string Js.t -> bool Js.t -> bool Js.t Js.meth

Handles keyboard shortcuts. Preferred to using handleKey* as it will use the proper event based on browser and will be more performant. If handleKeyPress/handleKeyDown returns true, this will not be called. If the plugin handles the shortcut, it is responsible for dispatching appropriate events (change, selection change at the time of this comment). If the plugin calls execCommand on the editable field, then execCommand already takes care of dispatching events. NOTE: For performance reasons this is only called when any key is pressed in conjunction with ctrl/meta keys OR when a small subset of keys (defined in goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_) are pressed without ctrl/meta keys. We specifically don't invoke it when altKey is pressed since alt key is used in many i8n UIs to enter certain characters.

Returns Whether the event was handled and thus should *not* be propagated to other plugins. We also call preventDefault on the event if the return value is true.

method isEnabled : Goog.Geditor.field Js.t -> bool Js.t Js.meth

Returns whether this plugin is enabled for the field object.

Returns Whether this plugin is enabled for the field object.

method isSupportedCommand : Js.js_string Js.t -> bool Js.t Js.meth

Whether the string corresponds to a command this plugin handles.

Returns Whether the string corresponds to a command this plugin handles.

method refreshCurrentState : Goog.Geditor.field Js.t -> unit Js.meth

Refreshes the current state of the editable field as maintained by undo-redo, without adding any undo-redo states to the stack.

method registerFieldObject : Goog.Geditor.field Js.t -> unit Js.meth

Registers the field object for use with this plugin.

method setMaxUndoDepth : int -> unit Js.meth

Set the max undo stack depth (not the real memory usage).

method setUndoRedoManager : undoRedoManager Js.t -> unit Js.meth

Set the undo-redo manager used by this plugin. Any state on a previous undo-redo manager is lost.

method unregisterFieldObject : Goog.Geditor.field Js.t -> unit Js.meth

Unregisters and disables the fieldObject with this plugin. Thie does *not* clobber the undo stack for the fieldObject though. TODO(user): For the multifield version, we really should add a way to ignore undo actions on field's that have been made uneditable. This is probably as simple as skipping over entries in the undo stack that have a hashcode of an uneditable field.