/**
* @fileoverview: UndoManager plugin is a naive implementation to manage undo/redo information from a text area
* TODO: Evaluate https://code.google.com/p/google-diff-match-patch/ for computing diffs.
*/
(function(pluginManager) {
/**
* Apply undo/redo commands
* param {bool} isUndo Whether to perform undo command
*/
var applyUndoCommand = function(isUndo) {
var hasInfo = isUndo ? this.hasUndo() : this.hasRedo();
if (!hasInfo) {
return;
}
var eventNames = $.Arte.constants.eventNames;
var data = {
execute: true
};
this.triggerEvent(isUndo ? eventNames.onbeforeundo : eventNames.onbeforeredo, data);
if (data.execute) {