root / trunk / tests / undo / test_Manager.html

Revision 7395, 1.4 kB (checked in by jburke, 21 months ago)

(merge from 0.4 branch) References #2366. Converting more tests to use dojo.addOnLoad()

  • Property svn:eol-style set to native
Line 
1<html>
2        <head>
3                <title>dojo.undo.Manager Tests</title>
4                <script type="text/javascript">
5                        // Dojo configuration
6                        djConfig = {
7                                isDebug: true
8                        };
9                </script>
10                <script type="text/javascript" src="../../dojo.js"></script>
11                <script type="text/javascript">
12                        dojo.require("dojo.undo.Manager");
13                        function foo(n) {
14                                return function() {
15                                        dojo.debug(n);
16                                }
17                        }
18
19                        function init(){
20                                x = new dojo.undo.Manager();
21                                x.push(foo(1), foo(-1));
22                                x.push(foo(2), foo(-2));
23                                x.beginTransaction();
24                                x.push(foo(3), foo(-3));
25                                x.push(foo(4), foo(-4));
26                                x.push(foo(5), foo(-5));
27                                x.beginTransaction();
28                                x.push(foo("a"), foo("-a"));
29                                x.push(foo("b"), foo("-b"));
30                                x.endTransaction();
31                                x.push(foo(6), foo(-6));
32                                x.endTransaction();
33
34                                x.undo();
35                                dojo.debug("more to undo?", x.canUndo);
36                                x.redo();
37                                dojo.debug("more to undo?", x.canUndo);
38                                x.undo();
39                                dojo.debug("more to undo?", x.canUndo);
40                                x.redo();
41                                dojo.debug("more to undo?", x.canUndo);
42                                x.undo();
43                                dojo.debug("more to undo?", x.canUndo);
44                                x.undo();
45                                dojo.debug("more to undo?", x.canUndo);
46                                x.redo();
47                                dojo.debug("more to undo?", x.canUndo);
48                                x.undo();
49                                x.undo();
50                                dojo.debug("more to undo?", x.canUndo);
51                                x.redo();
52                                x.undo();
53                                x.undo();
54                                dojo.debug("more to undo?", x.canUndo);
55                        }
56
57                        dojo.addOnLoad(init);
58                </script>
59        </head>
60        <body>
61        </body>
62</html>
Note: See TracBrowser for help on using the browser.