diff options
Diffstat (limited to 'js/panels')
7 files changed, 40 insertions, 20 deletions
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js index b8223471..db0f494b 100755 --- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js | |||
@@ -16,6 +16,7 @@ var ComponentsPanel = require("js/panels/Components/ComponentsPanel").Components | |||
16 | var ProjectPanel = require("js/panels/Project/ProjectPanel").ProjectPanel; | 16 | var ProjectPanel = require("js/panels/Project/ProjectPanel").ProjectPanel; |
17 | var MaterialsPanel = require("js/panels/Materials/MaterialsPanel").MaterialsPanel; | 17 | var MaterialsPanel = require("js/panels/Materials/MaterialsPanel").MaterialsPanel; |
18 | var PresetsPanel = require("js/panels/presets/presets-panel").PresetsPanel; | 18 | var PresetsPanel = require("js/panels/presets/presets-panel").PresetsPanel; |
19 | var CSSPanelNew = require("js/panels/css-panel/css-panel-container").CSSPanelContainer; | ||
19 | 20 | ||
20 | exports.PanelContainer = Montage.create(Component, { | 21 | exports.PanelContainer = Montage.create(Component, { |
21 | lastOffset: { | 22 | lastOffset: { |
@@ -45,7 +46,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
45 | }, | 46 | }, |
46 | 47 | ||
47 | initPanelOrder: { | 48 | initPanelOrder: { |
48 | value: ['PropertiesPanel','ColorPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel'] | 49 | value: ['CSSPanelNew','PropertiesPanel','ColorPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel'] |
49 | }, | 50 | }, |
50 | 51 | ||
51 | panelOrder: { | 52 | panelOrder: { |
@@ -101,6 +102,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
101 | this.addEventListener("change@appModel.CSSPanel", this, false); | 102 | this.addEventListener("change@appModel.CSSPanel", this, false); |
102 | this.addEventListener("change@appModel.MaterialsPanel", this, false); | 103 | this.addEventListener("change@appModel.MaterialsPanel", this, false); |
103 | this.addEventListener("change@appModel.PresetsPanel", this, false); | 104 | this.addEventListener("change@appModel.PresetsPanel", this, false); |
105 | this.addEventListener("change@appModel.CSSPanelNew", this, false); | ||
104 | } | 106 | } |
105 | }, | 107 | }, |
106 | 108 | ||
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> |