From bb4da39a73cbd6fbe83f3b7c9ed5ae60fe58dd6b Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 15 Feb 2012 14:23:19 -0800 Subject: Tool Icons : New layout Signed-off-by: Armen Kesablyan --- .../layout/tool-button.reel/tool-button.html | 7 +-- .../layout/tool-button.reel/tool-button.js | 21 ++----- .../layout/tools-list.reel/tools-list.html | 17 +++++- js/data/tools-data.js | 66 +++++++++++----------- 4 files changed, 57 insertions(+), 54 deletions(-) (limited to 'js') diff --git a/js/components/layout/tool-button.reel/tool-button.html b/js/components/layout/tool-button.reel/tool-button.html index 81a9b927..476b66f3 100644 --- a/js/components/layout/tool-button.reel/tool-button.html +++ b/js/components/layout/tool-button.reel/tool-button.html @@ -16,8 +16,7 @@ "module": "js/components/layout/tool-button.reel", "name": "ToolButton", "properties": { - "element": {"#": "buttonBackground"}, - "button": {"#": "toolBarButton"} + "element": {"#": "toolBarButton"} } } } @@ -27,9 +26,7 @@ -
-
-
+
diff --git a/js/components/layout/tool-button.reel/tool-button.js b/js/components/layout/tool-button.reel/tool-button.js index 509512d0..5cb0e7fc 100644 --- a/js/components/layout/tool-button.reel/tool-button.js +++ b/js/components/layout/tool-button.reel/tool-button.js @@ -11,8 +11,6 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve exports.ToolButton = Montage.create(Component, { - button: { value: null }, - data: { value: null }, _selected: { value: null }, @@ -64,32 +62,25 @@ exports.ToolButton = Montage.create(Component, { oneway: true }); } + + this.element.classList.add(this.data.id) } }, draw: { enumerable: false, value: function() { - var buttonid; - if(this.data.container) { - buttonid = this.data.subtools[this._subselected].id; this.element.title = this.data.subtools[this._subselected].toolTip; - this.button.classList.remove( this.data.subtools[this._currentSubSelected].id + "Unpressed" ); - this.button.classList.remove( this.data.subtools[this._currentSubSelected].id + "Pressed" ); + this.element.classList.remove(this.data.subtools[this._currentSubSelected].id); + this.element.classList.add(this.data.subtools[this._subselected].id); this._currentSubSelected = this._subselected; - } else { - buttonid = this.data.id; } if(this._selected) { - this.element.classList.add( "buttonSelected" ); - this.button.classList.remove( buttonid + "Unpressed" ); - this.button.classList.add( buttonid + "Pressed" ); + this.element.classList.add("active"); } else { - this.element.classList.remove( "buttonSelected" ); - this.button.classList.remove( buttonid + "Pressed" ); - this.button.classList.add( buttonid + "Unpressed" ); + this.element.classList.remove("active"); } } }, diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index e12fd59b..c47359bf 100644 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -25,6 +25,21 @@ } }, + "groupLine": { + "module": "js/components/layout/tool-button.reel", + "name": "ToolButton", + "properties": { + "element": {"#": "groupLine"} + }, + "bindings": { + "data": { + "boundObject": {"@": "repetition1"}, + "boundObjectPropertyPath": "objectAtCurrentIteration", + "oneway": true + } + } + }, + "repetition1": { "module": "montage/ui/repetition.reel", "name": "Repetition", @@ -163,9 +178,9 @@
+
-
diff --git a/js/data/tools-data.js b/js/data/tools-data.js index de965dbc..8356c422 100644 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -157,39 +157,39 @@ exports.ToolsData = Montage.create(Montage, { "container": false, "selected": false }, - { - "id": "InkBottleTool", - "properties": "inkbottleProperties", - "spriteSheet": true, - "action": "InkBottleTool", - "toolTip": "Ink Bottle Tool", - "cursor": "url('images/tools/inkbottle_down.png'), default", - "lastInGroup": false, - "container": false, - "selected": false - }, - { - "id": "EyedropperTool", - "properties": "eyedropperProperties", - "spriteSheet": true, - "action": "EyedropperTool", - "toolTip": "Eyedropper Tool", - "cursor": "url('images/tools/eyedropper_down.png'), default", - "lastInGroup": false, - "container": false, - "selected": false - }, - { - "id": "EraserTool", - "properties": "eraserProperties", - "spriteSheet": true, - "action": "EraserTool", - "toolTip": "Eraser Tool", - "cursor": "auto", - "lastInGroup": false, - "container": false, - "selected": false - }, +// { +// "id": "InkBottleTool", +// "properties": "inkbottleProperties", +// "spriteSheet": true, +// "action": "InkBottleTool", +// "toolTip": "Ink Bottle Tool", +// "cursor": "url('images/tools/inkbottle_down.png'), default", +// "lastInGroup": false, +// "container": false, +// "selected": false +// }, +// { +// "id": "EyedropperTool", +// "properties": "eyedropperProperties", +// "spriteSheet": true, +// "action": "EyedropperTool", +// "toolTip": "Eyedropper Tool", +// "cursor": "url('images/tools/eyedropper_down.png'), default", +// "lastInGroup": false, +// "container": false, +// "selected": false +// }, +// { +// "id": "EraserTool", +// "properties": "eraserProperties", +// "spriteSheet": true, +// "action": "EraserTool", +// "toolTip": "Eraser Tool", +// "cursor": "auto", +// "lastInGroup": false, +// "container": false, +// "selected": false +// }, { "id": "RotateStageTool3D", "properties": "rotateStageProperties", -- cgit v1.2.3 From 92873714dd6ffb259e6c5a27da2ade773d7b00f9 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 15 Feb 2012 15:04:37 -0800 Subject: New Icons: Last set had imperfections Signed-off-by: Armen Kesablyan --- .../layout/tools-list.reel/tools-list.html | 12 ++++++---- js/data/tools-data.js | 28 +++++++++++----------- 2 files changed, 21 insertions(+), 19 deletions(-) (limited to 'js') diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index c47359bf..2c5617e5 100644 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -26,15 +26,15 @@ }, "groupLine": { - "module": "js/components/layout/tool-button.reel", - "name": "ToolButton", + "module": "montage/ui/condition.reel", + "name": "Condition", "properties": { "element": {"#": "groupLine"} }, "bindings": { - "data": { + "condition": { "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", + "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup", "oneway": true } } @@ -178,7 +178,9 @@
-
+
+
+
diff --git a/js/data/tools-data.js b/js/data/tools-data.js index 8356c422..4847fa7c 100644 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -28,7 +28,7 @@ exports.ToolsData = Montage.create(Montage, { "action": "SubselectionTool", "toolTip": "Subselect Tool", "cursor": "auto", - "lastInGroup": false, + "lastInGroup": true, "container": false, "selected": false }, @@ -153,7 +153,7 @@ exports.ToolsData = Montage.create(Montage, { "action": "FillTool", "toolTip": "Fill Tool", "cursor": "url('images/tools/bucket_down.png'), default", - "lastInGroup": false, + "lastInGroup": true, "container": false, "selected": false }, @@ -168,17 +168,17 @@ exports.ToolsData = Montage.create(Montage, { // "container": false, // "selected": false // }, -// { -// "id": "EyedropperTool", -// "properties": "eyedropperProperties", -// "spriteSheet": true, -// "action": "EyedropperTool", -// "toolTip": "Eyedropper Tool", -// "cursor": "url('images/tools/eyedropper_down.png'), default", -// "lastInGroup": false, -// "container": false, -// "selected": false -// }, + { + "id": "EyedropperTool", + "properties": "eyedropperProperties", + "spriteSheet": true, + "action": "EyedropperTool", + "toolTip": "Eyedropper Tool", + "cursor": "url('images/tools/eyedropper_down.png'), default", + "lastInGroup": false, + "container": false, + "selected": false + }, // { // "id": "EraserTool", // "properties": "eraserProperties", @@ -219,7 +219,7 @@ exports.ToolsData = Montage.create(Montage, { "action": "ZoomTool", "toolTip": "Zoom Tool (Z)", "cursor": "url('images/cursors/zoom.png'),default", - "lastInGroup": false, + "lastInGroup": true, "container": false, "selected": false } -- cgit v1.2.3 From 7e08bdbd9db21880783b56a31b480ba33f3b5327 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Thu, 16 Feb 2012 11:33:18 -0800 Subject: Tool Button Fixes Signed-off-by: Armen Kesablyan --- js/components/layout/subtool-button.reel/subtool-button.html | 7 ++----- js/components/layout/subtool-button.reel/subtool-button.js | 10 +++------- js/ninja.reel/ninja.html | 3 --- 3 files changed, 5 insertions(+), 15 deletions(-) (limited to 'js') diff --git a/js/components/layout/subtool-button.reel/subtool-button.html b/js/components/layout/subtool-button.reel/subtool-button.html index 9dad007d..24fce57c 100644 --- a/js/components/layout/subtool-button.reel/subtool-button.html +++ b/js/components/layout/subtool-button.reel/subtool-button.html @@ -16,8 +16,7 @@ "module": "js/components/layout/subtool-button.reel", "name": "SubToolButton", "properties": { - "element": {"#": "buttonBackground"}, - "button": {"#": "toolBarButton"} + "element": {"#": "toolButton"} } } } @@ -26,9 +25,7 @@ -
-
-
+
diff --git a/js/components/layout/subtool-button.reel/subtool-button.js b/js/components/layout/subtool-button.reel/subtool-button.js index d1adca43..2b066f24 100644 --- a/js/components/layout/subtool-button.reel/subtool-button.js +++ b/js/components/layout/subtool-button.reel/subtool-button.js @@ -35,7 +35,7 @@ exports.SubToolButton = Montage.create(Component, { boundObjectPropertyPath: "selected", oneway: false }); - + this.element.classList.add(this.data.id); } }, @@ -43,13 +43,9 @@ exports.SubToolButton = Montage.create(Component, { enumerable: false, value: function() { if(this._selected) { - this.element.classList.add( "buttonSelected" ); - this.button.classList.remove( this.data.id + "Unpressed" ); - this.button.classList.add( this.data.id + "Pressed" ); + this.element.classList.add("active"); } else { - this.element.classList.remove( "buttonSelected" ); - this.button.classList.remove( this.data.id + "Pressed" ); - this.button.classList.add( this.data.id + "Unpressed" ); + this.element.classList.remove("active"); } } }, diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index c8625159..1db5373e 100644 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -340,9 +340,6 @@
- - -
-- cgit v1.2.3 From 79da052891a3d8cfb70489edb71619f27bfe3939 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Wed, 22 Feb 2012 13:45:28 -0800 Subject: Fix for bug that keeps Ninja from launching over HTTP. We need to wrap any extension specific code in an if (window.chrome.app.isInstalled) check. --- js/controllers/document-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 7491ef9f..fa611de4 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -85,7 +85,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, handleAppLoaded: { value: function() { //Adding an intercept to resources loaded to ensure user assets load from cloud simulator - chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: [""]}, ["blocking"]); + if (window.chrome.app.isInstalled) { + chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: [""]}, ["blocking"]); + } } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3