h2. The Undo Plugin

The Undo plugin replaces native browser undo/redo functionality.

endprologue.

h3. Usage

The Undo Plugin allows you to undo changes to an editable by pressing
<notextile><code>Ctrl&#43;Z</code></notextile> (or
<notextile><code>Cmd&#43;Z</code></notextile> on Mac). You may also
reapply changes made undone by pressing <notextile><code>Ctrl&#43;Shift&#43;Z</code></notextile> or
<notextile><code>Cmd&#43;Shift&#43;Z</code></notextile> on Mac. The Undo Plugin has no UI and no
components.

h3. Configuration

This plugin does not provide any configuration settings itself.

However, the Undo plugin relies on the @aloha-smart-content-changed@
event for creating undo snapshots. All undo and redo actions will jump
from one undo snapshot to another.

The @aloha-smart-content-changed@ fires after content changes. The event
doesn't fire immediately, but only if the content didn't change again
for a certain amount of time. By default the timeout is 5 seconds (the
@idle@ setting). If the user types a character that is in the list
configured by the @delimiters@ settings, the timeout is drastically
shortened to half a second (the @delay@ setting).

The timeouts and delimiters can be configured as follows (timeouts are in milliseconds):

<javascript>
Aloha.settings.smartContentChange = {
    delimiters: [ ':', ';', '.', '!', '?', ',', unescape( '%u0009' ), unescape( '%u0020' ), 'Enter' ],
    idle: 5000,
    delay: 500
};
</javascript>

h3. References
* "http://www.whatwg.org/specs/web-apps/current-work":http://www.whatwg.org/specs/web-apps/current-work/#undo
* "Undo/Redo Stack Abstraction by Jörn Zaefferer from jQuery UI":https://github.com/jzaefferer/undo 
