aboutsummaryrefslogtreecommitdiff
path: root/js
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
parentbd43ce383b050d03b0f92cc923c517febc66ca28 (diff)
downloadninja-4900f2e6e346df18b1b5a2ac89da5019644ac98a.tar.gz
adding a history panel
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js')
-rw-r--r--js/data/panels-data.js12
-rwxr-xr-xjs/panels/Panel.reel/Panel.js5
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.html11
-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
9 files changed, 253 insertions, 2 deletions
diff --git a/js/data/panels-data.js b/js/data/panels-data.js
index 7a2d817a..f613a3be 100644
--- a/js/data/panels-data.js
+++ b/js/data/panels-data.js
@@ -93,6 +93,18 @@ exports.PanelsData = Montage.create(Montage, {
93 open: true, 93 open: true,
94 modulePath: "js/panels/presets/content.reel", 94 modulePath: "js/panels/presets/content.reel",
95 moduleName: "content" 95 moduleName: "content"
96 },
97 {
98 name: "History",
99 minHeight: 100,
100 height: 100,
101 maxHeight: null,
102 flexible: true,
103 collapsed: true,
104 scrollable: true,
105 open: true,
106 modulePath: "js/panels/history-panel/history.reel",
107 moduleName: "History"
96 } 108 }
97 ] 109 ]
98 } 110 }
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js
index 33f9b3a7..613bef4b 100755
--- a/js/panels/Panel.reel/Panel.js
+++ b/js/panels/Panel.reel/Panel.js
@@ -125,7 +125,10 @@ exports.Panel = Montage.create(Component, {
125 require.async(this.modulePath) 125 require.async(this.modulePath)
126 .then(function(panelContent) { 126 .then(function(panelContent) {
127 var componentRequire = panelContent[that.moduleName]; 127 var componentRequire = panelContent[that.moduleName];
128 that.panelContent.content = componentRequire.create(); 128 var componentInstance = componentRequire.create();
129
130 componentInstance.ownerComponent = that.ownerComponent;
131 that.panelContent.content = componentInstance;
129 }) 132 })
130 .end(); 133 .end();
131 } 134 }
diff --git a/js/panels/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer.reel/PanelContainer.html
index 251e86e4..d3673105 100755
--- a/js/panels/PanelContainer.reel/PanelContainer.html
+++ b/js/panels/PanelContainer.reel/PanelContainer.html
@@ -62,6 +62,13 @@
62 } 62 }
63 }, 63 },
64 64
65 "panel_6": {
66 "prototype": "js/panels/Panel.reel",
67 "properties": {
68 "element": {"#": "panel_6"}
69 }
70 },
71
65 "owner": { 72 "owner": {
66 "module": "js/panels/PanelContainer.reel", 73 "module": "js/panels/PanelContainer.reel",
67 "name": "PanelContainer", 74 "name": "PanelContainer",
@@ -74,7 +81,8 @@
74 "panel_2": {"@": "panel_2"}, 81 "panel_2": {"@": "panel_2"},
75 "panel_3": {"@": "panel_3"}, 82 "panel_3": {"@": "panel_3"},
76 "panel_4": {"@": "panel_4"}, 83 "panel_4": {"@": "panel_4"},
77 "panel_5": {"@": "panel_5"} 84 "panel_5": {"@": "panel_5"},
85 "panel_6": {"@": "panel_6"}
78 }, 86 },
79 "listeners": [ 87 "listeners": [
80 { 88 {
@@ -104,6 +112,7 @@
104 <article data-montage-id="panel_3"></article> 112 <article data-montage-id="panel_3"></article>
105 <article data-montage-id="panel_4"></article> 113 <article data-montage-id="panel_4"></article>
106 <article data-montage-id="panel_5"></article> 114 <article data-montage-id="panel_5"></article>
115 <article data-montage-id="panel_6"></article>
107 </article> 116 </article>
108 </section> 117 </section>
109</body> 118</body>
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"