aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel
diff options
context:
space:
mode:
authorEric Guzman2012-02-22 23:18:12 -0800
committerEric Guzman2012-02-22 23:18:12 -0800
commita5ee11857f923d3e49b44c0a8c480e9d0b026d5b (patch)
tree55bb6d0dc2ee710290ac5af0bb46ec66a6b2e381 /js/panels/css-panel
parent1c528b42f9b1c9be9197921586388c3a3bdc5c17 (diff)
downloadninja-a5ee11857f923d3e49b44c0a8c480e9d0b026d5b.tar.gz
CSS Panel Update
Diffstat (limited to 'js/panels/css-panel')
-rw-r--r--js/panels/css-panel/css-panel.reel/css-panel.html4
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.html3
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.js8
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html25
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js8
-rw-r--r--js/panels/css-panel/styles-view-container.reel/styles-view-container.html8
6 files changed, 37 insertions, 19 deletions
diff --git a/js/panels/css-panel/css-panel.reel/css-panel.html b/js/panels/css-panel/css-panel.reel/css-panel.html
index cc1876c3..86bfbbb7 100644
--- a/js/panels/css-panel/css-panel.reel/css-panel.html
+++ b/js/panels/css-panel/css-panel.reel/css-panel.html
@@ -26,9 +26,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
26 }, 26 },
27 "stylesViewContainer": { 27 "stylesViewContainer": {
28 "module" : "js/panels/css-panel/styles-view-container.reel", 28 "module" : "js/panels/css-panel/styles-view-container.reel",
29 "name": "StyleSheetView", 29 "name": "StylesViewContainer",
30 "properties": { 30 "properties": {
31 "element": {"#": "css-styles-view" } 31 "element": {"#": "styles-view-container" }
32 } 32 }
33 } 33 }
34 } 34 }
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html
index 4fb94335..43ffec6f 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.html
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html
@@ -20,7 +20,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
20 "module": "montage/ui/dynamic-text.reel", 20 "module": "montage/ui/dynamic-text.reel",
21 "name": "DynamicText", 21 "name": "DynamicText",
22 "properties": { 22 "properties": {
23 "element": {"#": "sheet-name"} 23 "element": {"#": "sheet-name"},
24 "defaultText": "Style sheet"
24 }, 25 },
25 "bindings": { 26 "bindings": {
26 "value": { 27 "value": {
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js
index daa614c2..a4fe5960 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -34,19 +34,21 @@ exports.StyleSheet = Montage.create(Component, {
34 this._name = text; 34 this._name = text;
35 } 35 }
36 }, 36 },
37 _styleSheet : { 37 _source : {
38 value: null 38 value: null
39 }, 39 },
40 styleSheet : { 40 source : {
41 get: function() { 41 get: function() {
42 return this._styleSheet; 42 return this._source;
43 }, 43 },
44 set: function(sheet) { 44 set: function(sheet) {
45 console.log('sheet being set');
45 if(sheet.href) { 46 if(sheet.href) {
46 this.name = sheet.href.substring(sheet.href.lastIndexOf('/')); 47 this.name = sheet.href.substring(sheet.href.lastIndexOf('/'));
47 } else { 48 } else {
48 this.name = 'Style Tag'; 49 this.name = 'Style Tag';
49 } 50 }
51 this._source = sheet;
50 } 52 }
51 } 53 }
52}); \ No newline at end of file 54}); \ No newline at end of file
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
index 78836f21..d1dbfa2b 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -16,22 +16,31 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
16 "element" : {"#" : "style-sheet-view-container"} 16 "element" : {"#" : "style-sheet-view-container"}
17 } 17 }
18 }, 18 },
19 "arrayController" : {
20 "module" : "montage/ui/controller/array-controller",
21 "name": "ArrayController",
22 "bindings": {
23 "content": {
24 "boundObject": {"@": "owner"},
25 "boundObjectPropertyPath": "styleSheets",
26 "oneway": true
27 }
28 }
29 },
19 "styleSheetList": { 30 "styleSheetList": {
20 "module" : "montage/ui/list.reel", 31 "module" : "montage/ui/list.reel",
21 "name": "List", 32 "name": "List",
22 "properties": { 33 "properties": {
23 "element": {"#": "sheet-list" } 34 "element": {"#": "sheet-list" },
24 }, 35 "contentController": {"@": "arrayController"}
25 "bindings": {
26 "content": {
27 "boundObject": {"@": "owner" },
28 "boundObjectPropertyPath": "styleSheets"
29 }
30 } 36 }
31 }, 37 },
32 "sheet": { 38 "sheet": {
33 "module": "js/panels/css-panel/style-sheet.reel", 39 "module": "js/panels/css-panel/style-sheet.reel",
34 "name": "StyleSheet", 40 "name": "StyleSheet",
41 "properties": {
42 "element": {"#": "sheet-item"}
43 },
35 "bindings": { 44 "bindings": {
36 "source": { 45 "source": {
37 "boundObject": {"@": "styleSheetList"}, 46 "boundObject": {"@": "styleSheetList"},
@@ -61,7 +70,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
61<div id="style-sheet-view-container" class="style-sheet-view-container"> 70<div id="style-sheet-view-container" class="style-sheet-view-container">
62 <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3> 71 <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3>
63 <ul id="sheet-list"> 72 <ul id="sheet-list">
64 <li id="sheet-item"></li> 73 <li><div id="sheet-item"></div></li>
65 </ul> 74 </ul>
66</div> 75</div>
67</body> 76</body>
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
index f93de830..f8826b18 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
@@ -28,8 +28,12 @@ exports.StyleSheetsView = Montage.create(Component, {
28 }, 28 },
29 handleStyleSheetsReady : { 29 handleStyleSheetsReady : {
30 value: function(e) { 30 value: function(e) {
31 //this.styleSheets = null; 31 this.noDocumentCondition = false;
32 this.styleSheets = this.stylesController.userStyleSheets; 32
33 this.stylesController.userStyleSheets.forEach(function(sheet) {
34 this.styleSheets.push(sheet);
35 }, this);
36
33 } 37 }
34 }, 38 },
35 prepareForDraw : { 39 prepareForDraw : {
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.html b/js/panels/css-panel/styles-view-container.reel/styles-view-container.html
index 4b2bf60a..17ba6326 100644
--- a/js/panels/css-panel/styles-view-container.reel/styles-view-container.html
+++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.html
@@ -10,7 +10,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
10 <script type="text/montage-serialization"> 10 <script type="text/montage-serialization">
11 { 11 {
12 "owner": { 12 "owner": {
13 "module" : "js/panels/css-panel/styles-view-container.reel/styles-view-container.reel", 13 "module" : "js/panels/css-panel/styles-view-container.reel",
14 "name" : "StylesViewContainer", 14 "name" : "StylesViewContainer",
15 "properties" : { 15 "properties" : {
16 "element" : {"#" : "container"} 16 "element" : {"#" : "container"}
@@ -68,8 +68,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
68 </script> 68 </script>
69</head> 69</head>
70<body> 70<body>
71<div id="sub-panel-slot" class="styles-view-container"> 71<div id="container" class="styles-view-container">
72 <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3> 72 <div id="sub-panel-slot">
73 <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3>
74 </div>
73</div> 75</div>
74</body> 76</body>
75</html> \ No newline at end of file 77</html> \ No newline at end of file