Manager_wev8.js
2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
Copyright (c) 2004-2005, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.undo.Manager");
dojo.undo.Manager = function () {
this._undoStack = [];
this._redoStack = [];
this._undoRegistrationLevel = 0;
}
dojo.undo.Manager.prototype = {
//Registering undo operations
//registerUndoWithTarget:selector:object:
prepareWithInvocationTarget: function () {},
forwardInvocation: function () {},
//Checking undo ability
canUndo: false,
canRedo: false,
//Performing undo and redo
undo: function () {},
undoNestedGroup: function () {},
redo: function () {},
//Limiting the undo stack
setLevelsOfUndo: function (levels) {
this.levelsOfUndo = levels;
if (levels != 0 && this._undoStack.length > levels) {
this._undoStack.splice(levels, this._undoStack.length - levels);
}
},
levelsOfUndo: 0,
//Creating undo groups
beginUndoGrouping: function () {},
endUndoGrouping: function () {},
enableUndoRegistration: function () {
if (++this._undoRegistrationLevel >= 0) {
this._undoRegistrationLevel = 0;
this.isUndoRegistrationEnabled = true;
}
},
groupsByEvent: true,
setGroupsByEvent: function (bool) { this.groupsByEvent = bool; },
groupingLevel: 0,
//Disabling undo
disableUndoRegistration = function () {
this.isUndoRegistrationEnabled = false;
this._undoRegistrationLevel--;
},
isUndoRegistrationEnabled: true,
//Checking whether undo or redo is being performed
isUndoing: false,
isRedoing: false,
//Clearing undo operations
removeAllActions: function () {
this._undoStack = [];
this._redoStack = [];
},
removeAllActionsWithTarget: function (target) {},
//Setting and getting the action name
setActionName: function () {},
redoActionName: null,
undoActionName: null,
//Getting and localizing menu item title
redoMenuItemTitle: null,
undoMenuItemTitle: null,
redoMenuTitleForUndoActionName: function () {},
undoMenuTitleForUndoActionName: function () {},
//Working with run loops
runLoopModes: [],
setRunLoopModes: function () {}
}