From 1c3da2901f454ad2c18e20216bb2517740a1c080 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 22 May 2012 14:28:00 -0700 Subject: CSS Panel - Update components to use new serialization format --- js/components/toolbar.reel/toolbar.html | 24 ++----------- js/components/toolbar.reel/toolbar.js | 20 +++++++++-- js/data/panels-data.js | 2 +- js/panels/css-panel/css-panel-container.js | 2 +- js/panels/css-panel/css-panel.reel/css-panel.html | 21 ++++-------- js/panels/css-panel/css-panel.reel/css-panel.js | 2 +- js/panels/css-panel/css-style.reel/css-style.html | 32 +++++------------ .../css-style-rule.reel/css-style-rule.html | 40 ++++++---------------- .../rule-list-container.html | 11 +++--- js/panels/css-panel/rule-list.reel/rule-list.html | 3 +- .../style-declaration.reel/style-declaration.html | 35 ++++--------------- .../css-panel/style-sheet.reel/style-sheet.html | 24 ++++--------- .../style-sheets-view.reel/style-sheets-view.html | 18 ++-------- .../styles-view-container.html | 24 ++++--------- js/panels/css-panel/styles-view-delegate.js | 2 +- 15 files changed, 78 insertions(+), 182 deletions(-) diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html index b33c4665..d2c5972a 100644 --- a/js/components/toolbar.reel/toolbar.html +++ b/js/components/toolbar.reel/toolbar.html @@ -25,12 +25,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "element": {"#": "repetition"} }, "bindings": { - "objects" : { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "buttons", - "oneway": true - } - + "objects": {"<-": "@owner.buttons"} } }, @@ -41,21 +36,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "label": " " }, "bindings": { - "label" : { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.title", - "oneway": true - }, - "identifier": { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.identifier", - "oneway": true - }, - "sourceObject": { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "label": {"<-": "@buttonList.objectAtCurrentIteration.title"}, + "sourceObject": {"<-": "@buttonList.objectAtCurrentIteration"} } } } diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index 8f93aa2b..2ccdb2c5 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -11,17 +11,31 @@ exports.Toolbar = Montage.create(Component, { _needsButtonProperties : { value: null }, + _sourceObject : { + value: null + }, + sourceObject : { + get: function() { + return this._sourceObject; + }, + set: function(value) { + if(value === this._sourceObject) { return; } + this._sourceObject = value; + }, + serializable: true + }, leftAlignClass : { value: "left-button" }, hideButtonClass : { value: "hide-button" }, - _buttons : { value: null }, + _buttons : { value: [], distinct: true }, buttons : { get: function() { return this._buttons; }, set: function(btns) { this._buttons = btns; - this._needsButtonProperties = this.needsDraw = true;; - } + this._needsButtonProperties = this.needsDraw = true; + }, + serializable: true }, _buttonToHide : { diff --git a/js/data/panels-data.js b/js/data/panels-data.js index ed346196..ffc76782 100644 --- a/js/data/panels-data.js +++ b/js/data/panels-data.js @@ -80,7 +80,7 @@ exports.PanelsData = Montage.create(Montage, { collapsed: false, open: true, modulePath: "js/panels/css-panel/css-panel.reel", - moduleName: "CSSPanelNew" + moduleName: "CssPanel" }, { name: "Presets", diff --git a/js/panels/css-panel/css-panel-container.js b/js/panels/css-panel/css-panel-container.js index 6110c999..08673309 100644 --- a/js/panels/css-panel/css-panel-container.js +++ b/js/panels/css-panel/css-panel-container.js @@ -6,7 +6,7 @@ var Montage = require("montage/core/core").Montage; var PanelBase = require("js/panels/PanelBase").PanelBase; -var Content = require("js/panels/css-panel/css-panel.reel").CSSPanelNew; +var Content = require("js/panels/css-panel/css-panel.reel").CssPanel; exports.CSSPanelContainer = Montage.create(PanelBase, { panelName : { value: "CSS Panel" }, 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 54bb1fae..42dca8a2 100644 --- a/js/panels/css-panel/css-panel.reel/css-panel.html +++ b/js/panels/css-panel/css-panel.reel/css-panel.html @@ -11,8 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot -
+

Style Sheets

-
+

Styles

-
+
\ No newline at end of file diff --git a/js/panels/css-panel/css-panel.reel/css-panel.js b/js/panels/css-panel/css-panel.reel/css-panel.js index 4a2062af..a117787e 100644 --- a/js/panels/css-panel/css-panel.reel/css-panel.js +++ b/js/panels/css-panel/css-panel.reel/css-panel.js @@ -7,7 +7,7 @@ var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; -exports.CSSPanelNew = Montage.create(Component, { +exports.CssPanel = Montage.create(Component, { prepareForDraw : { value: function() { } diff --git a/js/panels/css-panel/css-style.reel/css-style.html b/js/panels/css-panel/css-style.reel/css-style.html index c4b6dd59..00cebf39 100644 --- a/js/panels/css-panel/css-style.reel/css-style.html +++ b/js/panels/css-panel/css-style.reel/css-style.html @@ -11,8 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot -
+
diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html index 05ea669f..f203b61f 100644 --- a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html @@ -11,8 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot @@ -46,6 +43,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot -
+
\ No newline at end of file diff --git a/js/panels/css-panel/rule-list.reel/rule-list.html b/js/panels/css-panel/rule-list.reel/rule-list.html index c11e488d..67b17f48 100644 --- a/js/panels/css-panel/rule-list.reel/rule-list.html +++ b/js/panels/css-panel/rule-list.reel/rule-list.html @@ -11,8 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot