undo.js is part of Aloha Editor project http://www.alohaeditor.org
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
Methods
-
Enter/leave a frame before/after calling the given function.
Name Type Description context
Undo opts
Object.<string, *> given as the opts argument to enter() given
function as the result argument to leave() Returns:
captured frame
-
This function is missing documentation.
- TODO
-
- Complete documentation.
-
Creates a new undo context.
The undo context holds an assortment of data items used across
many of the undo functions.
Should be treated as a black box.Name Type Description elem
Element The element whose mutations are to be observed and made undoable/redoable. opts
Object.<string, *> A map of options: noMutationObserver - whether or not to use the MutationObserver API to observe changes, maxCombineChars - how many character to combine to a single change (default 20). maxHistory - how many items to keep in the history (default 1000). -
Enters a new frame in the given undo context.
Name Type Description context
Undo opts
Object.<string, *> A map of options: noObserve - whether to observe changes. If true, changes must be supplied via the result argument of leave(). Applies recursively to all nested frames. partitionRecords - whether to split up changes happening inside this frame and frames direcly below this frame (but not deeper). oldRange - a range to record that reflects the range before any changes in this frame happen. -
Leave a frame in the given undo context.
Name Type Description context
Undo result
Object.<...string> -
Redoes a previously undone changeSet in the history and
increments the history index.Name Type Description context
Undo range
Range will be set to the recorded range after the changes in the changeSet occurred. ranges
Array.<Range> will be preserved. -
Undoes the last changeSet in the history and decreases the
history index.Name Type Description context
Undo range
Range will be set to the recorded range before the changes in the changeSet occurred. ranges
Array.<Range> will be preserved.