From 1c528b42f9b1c9be9197921586388c3a3bdc5c17 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 22 Feb 2012 23:16:23 -0800 Subject: CSS Panel Update - Adding montage objects for css panel --- .../style-sheets-view.reel/style-sheets-view.css | 0 .../style-sheets-view.reel/style-sheets-view.html | 68 ++++++++++++++++++++++ .../style-sheets-view.reel/style-sheets-view.js | 45 ++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css create mode 100644 js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html create mode 100644 js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js (limited to 'js/panels/css-panel/style-sheets-view.reel') diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css new file mode 100644 index 00000000..e69de29b 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 new file mode 100644 index 00000000..78836f21 --- /dev/null +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html @@ -0,0 +1,68 @@ + + + + + + + + +
+

No document loaded. Please Open or Create a new document.

+ +
+ + \ No newline at end of file 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 new file mode 100644 index 00000000..f93de830 --- /dev/null +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js @@ -0,0 +1,45 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.StyleSheetsView = Montage.create(Component, { + noDocumentCondition : { + value: true + }, + styleSheets : { + value: [] + }, + stylesController : { + value: null + }, + deserializedFromTemplate : { + value: function() { + console.log("style sheet view - deserialized"); + + this.stylesController = this.application.ninja.stylesController; + + this.eventManager.addEventListener("styleSheetsReady", this, false); + } + }, + handleStyleSheetsReady : { + value: function(e) { + //this.styleSheets = null; + this.styleSheets = this.stylesController.userStyleSheets; + } + }, + prepareForDraw : { + value: function() { + console.log("style sheet view - prepare for draw"); + } + }, + draw : { + value: function() { + console.log("styles sheet view - draw"); + } + } +}); \ No newline at end of file -- cgit v1.2.3 From a5ee11857f923d3e49b44c0a8c480e9d0b026d5b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 22 Feb 2012 23:18:12 -0800 Subject: CSS Panel Update --- .../style-sheets-view.reel/style-sheets-view.html | 25 +++++++++++++++------- .../style-sheets-view.reel/style-sheets-view.js | 8 +++++-- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'js/panels/css-panel/style-sheets-view.reel') 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 "element" : {"#" : "style-sheet-view-container"} } }, + "arrayController" : { + "module" : "montage/ui/controller/array-controller", + "name": "ArrayController", + "bindings": { + "content": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "styleSheets", + "oneway": true + } + } + }, "styleSheetList": { "module" : "montage/ui/list.reel", "name": "List", "properties": { - "element": {"#": "sheet-list" } - }, - "bindings": { - "content": { - "boundObject": {"@": "owner" }, - "boundObjectPropertyPath": "styleSheets" - } + "element": {"#": "sheet-list" }, + "contentController": {"@": "arrayController"} } }, "sheet": { "module": "js/panels/css-panel/style-sheet.reel", "name": "StyleSheet", + "properties": { + "element": {"#": "sheet-item"} + }, "bindings": { "source": { "boundObject": {"@": "styleSheetList"}, @@ -61,7 +70,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot

No document loaded. Please Open or Create a new document.

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, { }, handleStyleSheetsReady : { value: function(e) { - //this.styleSheets = null; - this.styleSheets = this.stylesController.userStyleSheets; + this.noDocumentCondition = false; + + this.stylesController.userStyleSheets.forEach(function(sheet) { + this.styleSheets.push(sheet); + }, this); + } }, prepareForDraw : { -- cgit v1.2.3 From 1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 2 Mar 2012 10:55:51 -0800 Subject: CSS Panel - Updating components, created toolbar components, and small changes to styles controller --- .../style-sheets-view.reel/style-sheets-view.css | 19 +++++++++++ .../style-sheets-view.reel/style-sheets-view.html | 38 ++++++++++++++++++---- .../style-sheets-view.reel/style-sheets-view.js | 27 ++++++++++++--- 3 files changed, 74 insertions(+), 10 deletions(-) (limited to 'js/panels/css-panel/style-sheets-view.reel') diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css index e69de29b..dfb67d13 100644 --- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css @@ -0,0 +1,19 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +.style-sheets-view-container ul { + margin: 0; + padding: 0; +} +.style-sheets-view-container li { + list-style-type: none; + margin: 0 8px; +} +.style-sheets-view-container li:first-child { + margin-top: 5px; +} +.style-sheets-view-container li:last-child { + margin-bottom: 5px; +} \ 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 d1dbfa2b..092b189f 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 @@ -7,13 +7,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot + -
-

No document loaded. Please Open or Create a new document.

+
+

No style sheets to display.

+
+
+
\ No newline at end of file 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 f8826b18..b1315311 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 @@ -11,6 +11,9 @@ exports.StyleSheetsView = Montage.create(Component, { noDocumentCondition : { value: true }, + showToolbar : { + value: false + }, styleSheets : { value: [] }, @@ -24,18 +27,27 @@ exports.StyleSheetsView = Montage.create(Component, { this.stylesController = this.application.ninja.stylesController; this.eventManager.addEventListener("styleSheetsReady", this, false); + this.eventManager.addEventListener("newStyleSheet", this, false); } }, + _initView : { + value: false + }, handleStyleSheetsReady : { value: function(e) { - this.noDocumentCondition = false; + this._initView = this.needsDraw = true; - this.stylesController.userStyleSheets.forEach(function(sheet) { - this.styleSheets.push(sheet); - }, this); +// this.noDocumentCondition = false; +// this.showToolbar = true; +// this.styleSheets = this.stylesController.userStyleSheets; } }, + handleNewStyleSheet : { + value: function(e) { + this.styleSheets.push(e._event.detail); + } + }, prepareForDraw : { value: function() { console.log("style sheet view - prepare for draw"); @@ -44,6 +56,13 @@ exports.StyleSheetsView = Montage.create(Component, { draw : { value: function() { console.log("styles sheet view - draw"); + + if(this._initView) { + this.noDocumentCondition = false; + this.showToolbar = true; + this.styleSheets = this.stylesController.userStyleSheets; + this._initView = false; + } } } }); \ No newline at end of file -- cgit v1.2.3 From 946fae3acf8ca9f384b662e40f406506e8b90ea7 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 23 Apr 2012 22:37:34 -0700 Subject: CSSPanel - Resizer --- .../style-sheets-view.reel/style-sheets-view.css | 30 +++++++++++ .../style-sheets-view.reel/style-sheets-view.html | 28 ++++++++++- .../style-sheets-view.reel/style-sheets-view.js | 58 ++++++++++++++++++++++ 3 files changed, 114 insertions(+), 2 deletions(-) (limited to 'js/panels/css-panel/style-sheets-view.reel') diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css index dfb67d13..7a46e387 100644 --- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css @@ -3,9 +3,16 @@ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ + +.style-sheets-view-container { + position: relative; + overflow: hidden; +} + .style-sheets-view-container ul { margin: 0; padding: 0; + min-height: 55px; } .style-sheets-view-container li { list-style-type: none; @@ -16,4 +23,27 @@ } .style-sheets-view-container li:last-child { margin-bottom: 5px; +} + +/* --------------- + Toolbar +------------------- */ + +.style-sheets-toolbar-container { + bottom: 0; + height: 24px; + position: absolute; + width: 100%; +} + +/* ------------------ + Resizer + ------------------ */ + +.sub-panel-resizer { + bottom: 0; + cursor: row-resize; + height: 4px; + position: absolute; + width: 100%; } \ 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 092b189f..09e2e3ce 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 @@ -14,7 +14,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "module" : "js/panels/css-panel/style-sheets-view.reel", "name" : "StyleSheetsView", "properties" : { - "element" : {"#" : "style-sheets-view-container"} + "element" : {"#" : "style-sheets-view-container"}, + "styleSheetList" : {"@" : "styleSheetList"} } }, "arrayController" : { @@ -85,6 +86,28 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "style-sheets-toolbar"} } + }, + "resizer": { + "module": "js/panels/resize-composer", + "name": "ResizeComposer", + "properties": { + "element": {"#": "resizeBar"}, + "component": {"@": "owner"} + }, + "listeners": [ + { + "type": "resizeStart", + "listener": {"@": "owner"} + }, + { + "type": "resizeMove", + "listener": {"@": "owner"} + }, + { + "type": "resizeEnd", + "listener": {"@": "owner"} + } + ] } } @@ -95,9 +118,10 @@ 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/style-sheets-view.reel/style-sheets-view.js b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js index b1315311..95adddd0 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 @@ -14,6 +14,27 @@ exports.StyleSheetsView = Montage.create(Component, { showToolbar : { value: false }, + _resizedHeight : { + value: null + }, + isResizing : { + value: null + }, + _height: { + value: null + }, + height: { + get: function() { + return this._height; + }, + set: function(val) { + if(this._height !== val) { + this._height = val; + this.needsDraw = true; + } + } + }, + styleSheets : { value: [] }, @@ -33,6 +54,7 @@ exports.StyleSheetsView = Montage.create(Component, { _initView : { value: false }, + handleStyleSheetsReady : { value: function(e) { this._initView = this.needsDraw = true; @@ -48,6 +70,30 @@ exports.StyleSheetsView = Montage.create(Component, { this.styleSheets.push(e._event.detail); } }, + handleResizeStart: { + value:function(e) { + this.isResizing = true; + this.needsDraw = true; + } + }, + + handleResizeMove: { + value:function(e) { + this._resizedHeight = e._event.dY; + this.needsDraw = true; + } + }, + + handleResizeEnd: { + value: function(e) { + this.height += this._resizedHeight; + this._resizedHeight = 0; + this.isResizing = false; + this.needsDraw = true; + } + }, + + prepareForDraw : { value: function() { console.log("style sheet view - prepare for draw"); @@ -63,6 +109,18 @@ exports.StyleSheetsView = Montage.create(Component, { this.styleSheets = this.stylesController.userStyleSheets; this._initView = false; } + + if(this.height) { + console.log("StyleSheetsView draw - resizing to", (this.height + this._resizedHeight) + "px"); + this.styleSheetList.element.style.height = (this.height + this._resizedHeight) + "px"; + } + } + }, + didDraw: { + value: function() { + if(!this.isResizing) { + this.height = this.styleSheetList.element.offsetHeight; + } } } }); \ No newline at end of file -- cgit v1.2.3 From 72ad2e9710adfccaab637fffdf6c82712aa85197 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 3 May 2012 11:50:03 -0700 Subject: Style sheets - Add stub for add stylesheet button --- .../css-panel/style-sheets-view.reel/style-sheets-view.css | 8 ++++---- .../css-panel/style-sheets-view.reel/style-sheets-view.html | 11 +++++++++-- .../css-panel/style-sheets-view.reel/style-sheets-view.js | 10 ++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'js/panels/css-panel/style-sheets-view.reel') diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css index 7a46e387..a3e13c77 100644 --- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css @@ -9,19 +9,19 @@ overflow: hidden; } -.style-sheets-view-container ul { +.style-sheets-view-container .sheet-list { margin: 0; padding: 0; min-height: 55px; } -.style-sheets-view-container li { +.style-sheets-view-container .sheet-list li { list-style-type: none; margin: 0 8px; } -.style-sheets-view-container li:first-child { +.style-sheets-view-container .sheet-list li:first-child { margin-top: 5px; } -.style-sheets-view-container li:last-child { +.style-sheets-view-container .sheet-list li:last-child { margin-bottom: 5px; } 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 09e2e3ce..484d3c04 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 @@ -84,7 +84,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "module": "js/components/toolbar.reel", "name": "Toolbar", "properties": { - "element": {"#": "style-sheets-toolbar"} + "element": {"#": "style-sheets-toolbar"}, + "delegate": {"@": "owner" }, + "buttons": [ + { + "title": "Add", + "identifier": "add" + } + ] } }, "resizer": { @@ -115,7 +122,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot

No style sheets to display.

-