aboutsummaryrefslogtreecommitdiff
path: root/js/panels/history-panel
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-09 16:47:35 -0700
committerValerio Virgillito2012-04-09 16:47:35 -0700
commit4900f2e6e346df18b1b5a2ac89da5019644ac98a (patch)
tree573b0490e440f71dae407f0e4667a1b78697179c /js/panels/history-panel
parentbd43ce383b050d03b0f92cc923c517febc66ca28 (diff)
downloadninja-4900f2e6e346df18b1b5a2ac89da5019644ac98a.tar.gz
adding a history panel
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels/history-panel')
-rw-r--r--js/panels/history-panel/history-item.reel/history-item.css0
-rw-r--r--js/panels/history-panel/history-item.reel/history-item.html29
-rw-r--r--js/panels/history-panel/history-item.reel/history-item.js32
-rw-r--r--js/panels/history-panel/history.reel/history.css34
-rw-r--r--js/panels/history-panel/history.reel/history.html106
-rw-r--r--js/panels/history-panel/history.reel/history.js26
6 files changed, 227 insertions, 0 deletions
diff --git a/js/panels/history-panel/history-item.reel/history-item.css b/js/panels/history-panel/history-item.reel/history-item.css
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/js/panels/history-panel/history-item.reel/history-item.css
diff --git a/js/panels/history-panel/history-item.reel/history-item.html b/js/panels/history-panel/history-item.reel/history-item.html
new file mode 100644
index 00000000..2db27846
--- /dev/null
+++ b/js/panels/history-panel/history-item.reel/history-item.html
@@ -0,0 +1,29 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html lang="en">
8 <head>
9 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="history-item.css">
11
12 <script type="text/montage-serialization">
13 {
14 "owner": {
15 "prototype": "js/panels/history-panel/history-item.reel",
16 "properties": {
17 "element": {"#": "history_item"}
18 }
19 }
20 }
21 </script>
22
23 </head>
24 <body>
25
26 <li data-montage-id="history_item"></li>
27
28 </body>
29</html> \ No newline at end of file
diff --git a/js/panels/history-panel/history-item.reel/history-item.js b/js/panels/history-panel/history-item.reel/history-item.js
new file mode 100644
index 00000000..8a6e7654
--- /dev/null
+++ b/js/panels/history-panel/history-item.reel/history-item.js
@@ -0,0 +1,32 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.HistoryItem = Montage.create(Component, {
11 _title: {
12 value: null
13 },
14
15 title: {
16 get: function() {
17 return this._title;
18 },
19 set: function(value) {
20 if(value !== this._title) {
21 this._title = value;
22 this.needsDraw = true;
23 }
24 }
25 },
26
27 draw: {
28 value: function() {
29 this.element.innerHTML = this.title;
30 }
31 }
32}); \ No newline at end of file
diff --git a/js/panels/history-panel/history.reel/history.css b/js/panels/history-panel/history.reel/history.css
new file mode 100644
index 00000000..44c4c74b
--- /dev/null
+++ b/js/panels/history-panel/history.reel/history.css
@@ -0,0 +1,34 @@
1.history_panel {
2 height: 100%;
3 overflow: hidden;
4}
5
6.scroller {
7 position: absolute;
8 top: 0;
9 left: 0;
10 right: 0;
11 bottom: 0;
12}
13
14.history_panel ul {
15 padding: 0;
16 margin: 0;
17}
18
19.history_panel li {
20 padding: 10px 15px;
21 list-style: none;
22}
23
24.undo_list li {
25 background-color: hsl(0, 0%, 94%);
26 border-top: 1px solid hsl(0, 0%, 100%);
27 border-bottom: 1px solid hsl(0, 0%, 85%);
28}
29
30.redo_list li {
31 background-color: hsl(199, 71%, 79%);
32 border-top: 1px solid hsl(0, 0%, 100%);
33 border-bottom: 1px solid hsl(0, 0%, 85%);
34} \ No newline at end of file
diff --git a/js/panels/history-panel/history.reel/history.html b/js/panels/history-panel/history.reel/history.html
new file mode 100644
index 00000000..f2e3c6ae
--- /dev/null
+++ b/js/panels/history-panel/history.reel/history.html
@@ -0,0 +1,106 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html lang="en">
8 <head>
9 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="history.css">
11
12 <script type="text/montage-serialization">
13 {
14 "owner": {
15 "prototype": "js/panels/history-panel/history.reel",
16 "properties": {
17 "element": {"#": "history_panel"}
18 }
19 },
20
21 "defaultUndoManager": {
22 "object": "montage/core/undo-manager"
23 },
24
25 "scroller": {
26 "prototype": "montage/ui/scroller.reel",
27 "properties": {
28 "element": {"#": "scroller"},
29 "axis": "vertical"
30 }
31 },
32
33 "undoList": {
34 "prototype": "montage/ui/repetition.reel",
35 "properties": {
36 "element": {"#": "undo_list"}
37 },
38 "bindings": {
39 "objects": {
40 "boundObject": {"@": "defaultUndoManager"},
41 "boundObjectPropertyPath": "undoStack",
42 "oneway": true
43 }
44 }
45 },
46
47 "undoItem": {
48 "prototype": "js/panels/history-panel/history-item.reel",
49 "properties": {
50 "element": {"#": "undo_item"}
51 },
52 "bindings": {
53 "title": {
54 "boundObject": {"@": "undoList"},
55 "boundObjectPropertyPath": "objectAtCurrentIteration.label",
56 "oneway": true
57 }
58 }
59 },
60
61 "redoList": {
62 "prototype": "montage/ui/repetition.reel",
63 "properties": {
64 "element": {"#": "redo_list"}
65 },
66 "bindings": {
67 "objects": {
68 "boundObject": {"@": "defaultUndoManager"},
69 "boundObjectPropertyPath": "redoStack",
70 "oneway": true
71 }
72 }
73 },
74
75 "redoItem": {
76 "prototype": "js/panels/history-panel/history-item.reel",
77 "properties": {
78 "element": {"#": "redo_item"}
79 },
80 "bindings": {
81 "title": {
82 "boundObject": {"@": "redoList"},
83 "boundObjectPropertyPath": "objectAtCurrentIteration.label",
84 "oneway": true
85 }
86 }
87 }
88 }
89 </script>
90
91 </head>
92 <body>
93
94 <div data-montage-id="history_panel" class="history_panel">
95 <div data-montage-id="scroller" class="scroller">
96 <ul data-montage-id="undo_list" class="undo_list">
97 <li data-montage-id="undo_item"></li>
98 </ul>
99 <ul data-montage-id="redo_list" class="redo_list">
100 <li data-montage-id="redo_item"></li>
101 </ul>
102 </div>
103 </div>
104
105 </body>
106</html> \ No newline at end of file