aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-17 11:08:29 -0700
committerValerio Virgillito2012-04-17 11:08:29 -0700
commit2292a35f545a161c0d19b26a8640b9421afce792 (patch)
treec9a64c50dd4c42cdbd221e35548418fe883c2d13 /js/panels
parent4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff)
parent7ed5215332123d16f819a7a26c651af520a68669 (diff)
downloadninja-2292a35f545a161c0d19b26a8640b9421afce792.tar.gz
Merge pull request #163 from mencio/undo-manager
Undo manager - Fixing a couple undo bugs and architecture work to support undo/redo
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/Panel.reel/Panel.js5
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.html11
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js1
-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
-rwxr-xr-xjs/panels/properties.reel/properties.js5
10 files changed, 245 insertions, 4 deletions
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/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js
index c40bbc21..8d1d6a5e 100755
--- a/js/panels/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer.reel/PanelContainer.js
@@ -45,6 +45,7 @@ exports.PanelContainer = Montage.create(Component, {
45 this['panel_'+i].minHeight= p.minHeight; 45 this['panel_'+i].minHeight= p.minHeight;
46 this['panel_'+i].maxHeight = p.maxHeight; 46 this['panel_'+i].maxHeight = p.maxHeight;
47 this['panel_'+i].flexible = p.flexible; 47 this['panel_'+i].flexible = p.flexible;
48 this['panel_'+i].collapsed = p.collapsed;
48 this['panel_'+i].modulePath = p.modulePath; 49 this['panel_'+i].modulePath = p.modulePath;
49 this['panel_'+i].moduleName = p.moduleName; 50 this['panel_'+i].moduleName = p.moduleName;
50 this['panel_'+i].disabled = true; 51 this['panel_'+i].disabled = true;
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