From a30d76ff641ce89686cf5fbd9f04ac9ab4e9c830 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 10 Feb 2012 17:21:28 -0800 Subject: initial color chip for the stage Signed-off-by: Valerio Virgillito --- js/components/ui/color-chip.reel/color-chip.js | 80 +++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 8 deletions(-) (limited to 'js/components') diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js index 5bef7020..4c288084 100644 --- a/js/components/ui/color-chip.reel/color-chip.js +++ b/js/components/ui/color-chip.reel/color-chip.js @@ -9,32 +9,96 @@ var Montage = require("montage/core/core").Montage, var ColorChip = exports.ColorChip = Montage.create(Component, { + chip: { + value: false + }, + hasIcon: { value: true }, + iconType: { + value: null + }, + mode: { value: "stroke" }, - prepareForDraw: { - value: function() { -// this.colorButton.props = {side: 'right', align: 'bottom', wheel: true, palette: true, gradient: true, image: true, offset: 20}; -// this.application.ninja.colorController.addButton('chip', this.colorButton); + offset: { + value: 20 + }, + initialColor: { + value: false + }, + + changeDelegate: { + value: null + }, + prepareForDraw: { + value: function() { this.addEventListener("firstDraw", this, false); } }, draw: { value: function() { + if(this.hasIcon) { + var icon = this.iconType || this.mode + "Icon"; + this.application.ninja.colorController.addButton(icon, this.icon); + } - if(this.hasIcon) this.application.ninja.colorController.addButton(this.mode + 'Icon', this.icon); - -// this.application.ninja.colorController.addButton(this.mode, this.chipBtn); - this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 20}; + this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: this.offset}; this.application.ninja.colorController.addButton(this.mode, this.chipBtn); + + /* + if(this.chip) { + //this.application.ninja.colorController.addButton('fillIcon', this.icon); + this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 0}; + this.application.ninja.colorController.addButton(this.mode, this.chipBtn); + } else { + //if(this.hasIcon) this.application.ninja.colorController.addButton(this.mode + 'Icon', this.icon); + this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 20}; + this.application.ninja.colorController.addButton(this.mode, this.chipBtn); + } + */ + + + } + }, + + handleFirstDraw: { + value: function(evt) { + if(this.chip) { + // This is a single chip - Not related to the color panel -- Set the initial color if found + var mode = "rgb", r = 0, g = 0, b = 0, a = 1, css = "rgb(255,0,0)"; + + if(this.initialColor) { + console.log(this.initialColor); + var colorObj = this.application.ninja.colorController.getColorObjFromCss(this.initialColor); + mode = colorObj.mode; + r = colorObj.value.r; + g = colorObj.value.g; + b = colorObj.value.b; + a = colorObj.value.a; + css = colorObj.css; + } + + this.chipBtn.color(mode, {wasSetByCode: true, type: 'change', color: {r: r, g: g, b: b}, css: css}); + //this.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); + + this.chipBtn.addEventListener("change", this, false); + } + } + }, + + handleChange: { + value: function(evt) { + if(this.changeDelegate && typeof(this.changeDelegate === "function")) { + this.changeDelegate(evt); + } } } -- cgit v1.2.3 From ef032412216d437ce1c7dfc9050ab41adf0594c0 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 13 Feb 2012 10:28:44 -0800 Subject: Tree Components - Change the way delegate methods are called --- .../treeview/ninja-branch.reel/ninja-branch.html | 3 +- .../treeview/ninja-branch.reel/ninja-branch.js | 1 - .../treeview/ninja-leaf.reel/ninja-leaf.html | 2 +- .../treeview/ninja-leaf.reel/ninja-leaf.js | 43 ++++++++++++++++++---- 4 files changed, 39 insertions(+), 10 deletions(-) (limited to 'js/components') diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.html b/js/components/treeview/ninja-branch.reel/ninja-branch.html index 4d557a94..13f1c575 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.html +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.html @@ -110,7 +110,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "name": "Repetition", "properties": { "element": { "#": "branchList" }, - "contentController": {"@": "arrayController" } + "contentController": {"@": "arrayController" }, + "selectionEnabled": true } }, diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.js b/js/components/treeview/ninja-branch.reel/ninja-branch.js index 6b9ebb10..0d1a1d0e 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.js +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.js @@ -5,7 +5,6 @@ */ var Montage = require("montage").Montage, - Component = require("montage/ui/component").Component, TreeNode = require("js/components/treeview/tree-node").TreeNode; var Branch = exports.Branch = Montage.create(TreeNode, { diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.html b/js/components/treeview/ninja-leaf.reel/ninja-leaf.html index bd8e8acd..310274bc 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.html +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.html @@ -37,7 +37,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
-
+
\ No newline at end of file diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js index bd566b26..749df3cd 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js @@ -5,7 +5,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot */ var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; TreeNode = require("js/components/treeview/tree-node").TreeNode; exports.Leaf = Montage.create(TreeNode, { @@ -14,19 +13,39 @@ exports.Leaf = Montage.create(TreeNode, { }, templateDidLoad : { value: function() { - this.needsDraw = true; + var event = this.treeView.activationEvent; + + ///// Re-set the activation event + if(event && event !== this.activationEvent) { + this.delegateEventMap[event] = this.delegateEventMap[this.activationEvent]; + delete this.delegateEventMap[this.activationEvent]; + this.activationEvent = this.treeView.activationEvent; + } } }, prepareForDraw: { value : function() { - this.activationEvent = this.activationEvent || 'click'; - this.label._element.addEventListener(this.activationEvent, this.handleNodeActivation.bind(this), false); + var el = this.label._element; + + Object.keys(this.delegateEventMap).forEach(function(event) { + el.addEventListener(event, this, false); + }, this); + } }, - handleNodeActivation: { + handleEvent : { value: function(e) { - console.log(this.sourceObject); - this.treeView.contentController.delegate.applyPresetSelection(this.sourceObject); + var delegateMethod = this.delegateEventMap[e._event.type]; + this.callDelegateMethod(delegateMethod); + } + }, + callDelegateMethod : { + value: function(methodName) { + console.log("Delegate method name: ", methodName); + var delegate = this.treeView.contentController.delegate; + if(delegate && typeof delegate[methodName] === 'function') { + delegate[methodName](this.sourceObject); + } } }, draw : { @@ -35,6 +54,16 @@ exports.Leaf = Montage.create(TreeNode, { this._labelText = this.sourceObject[this.labelKey]; } } + }, + activationEvent : { + value : 'click' + }, + delegateEventMap : { + value: { + 'click' : 'handleNodeActivation', + 'dragstart' : 'handleDragStart', + 'dragend' : 'handleDragEnd' + } } -- cgit v1.2.3 From 85afed8ed707ce20cd28c3139680dfef6fd4b23d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 13 Feb 2012 11:42:09 -0800 Subject: Ninja leaf - remove console lot --- js/components/treeview/ninja-leaf.reel/ninja-leaf.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/components') diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js index 749df3cd..0b7a171e 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js @@ -41,7 +41,6 @@ exports.Leaf = Montage.create(TreeNode, { }, callDelegateMethod : { value: function(methodName) { - console.log("Delegate method name: ", methodName); var delegate = this.treeView.contentController.delegate; if(delegate && typeof delegate[methodName] === 'function') { delegate[methodName](this.sourceObject); -- cgit v1.2.3 From 0d7d6d4d98437a93f31ededa14ca6eb5382c9e58 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 13 Feb 2012 14:05:10 -0800 Subject: Cleaning up the stage background color chip. Signed-off-by: Valerio Virgillito --- js/components/ui/color-chip.reel/color-chip.js | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'js/components') diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js index 4c288084..e51bdd8a 100644 --- a/js/components/ui/color-chip.reel/color-chip.js +++ b/js/components/ui/color-chip.reel/color-chip.js @@ -53,19 +53,6 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: this.offset}; this.application.ninja.colorController.addButton(this.mode, this.chipBtn); - /* - if(this.chip) { - //this.application.ninja.colorController.addButton('fillIcon', this.icon); - this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 0}; - this.application.ninja.colorController.addButton(this.mode, this.chipBtn); - } else { - //if(this.hasIcon) this.application.ninja.colorController.addButton(this.mode + 'Icon', this.icon); - this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 20}; - this.application.ninja.colorController.addButton(this.mode, this.chipBtn); - } - */ - - } }, @@ -76,7 +63,6 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { var mode = "rgb", r = 0, g = 0, b = 0, a = 1, css = "rgb(255,0,0)"; if(this.initialColor) { - console.log(this.initialColor); var colorObj = this.application.ninja.colorController.getColorObjFromCss(this.initialColor); mode = colorObj.mode; r = colorObj.value.r; @@ -87,8 +73,6 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { } this.chipBtn.color(mode, {wasSetByCode: true, type: 'change', color: {r: r, g: g, b: b}, css: css}); - //this.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); - this.chipBtn.addEventListener("change", this, false); } } -- cgit v1.2.3 From 7b0910720a6979bf41c216c5072d5c7a91e6d0b7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sat, 11 Feb 2012 23:04:36 -0800 Subject: Bug Fixes IKNINJA-1101 IKNINJA-1079 IKNINJA-1144 --- js/components/colorwheel.reel/compass_app_log.txt | 3 -- js/components/popup.reel/compass_app_log.txt | 48 ----------------------- 2 files changed, 51 deletions(-) delete mode 100644 js/components/colorwheel.reel/compass_app_log.txt delete mode 100644 js/components/popup.reel/compass_app_log.txt (limited to 'js/components') diff --git a/js/components/colorwheel.reel/compass_app_log.txt b/js/components/colorwheel.reel/compass_app_log.txt deleted file mode 100644 index 815feb02..00000000 --- a/js/components/colorwheel.reel/compass_app_log.txt +++ /dev/null @@ -1,3 +0,0 @@ -2011-11-23 01:07:12 create css/colorwheel.css -2011-11-23 01:07:25 overwrite css/colorwheel.css -2011-12-20 17:04:05 overwrite css/colorwheel.css diff --git a/js/components/popup.reel/compass_app_log.txt b/js/components/popup.reel/compass_app_log.txt deleted file mode 100644 index 8a3fb984..00000000 --- a/js/components/popup.reel/compass_app_log.txt +++ /dev/null @@ -1,48 +0,0 @@ -2011-06-28 18:13:06 create css/popup.css -2011-06-28 18:13:12 identical css/popup.css -2011-06-28 18:14:08 overwrite css/popup.css -2011-06-28 18:14:20 overwrite css/popup.css -2011-06-28 18:14:29 overwrite css/popup.css -2011-06-28 18:17:23 overwrite css/popup.css -2011-06-28 18:17:27 overwrite css/popup.css -2011-06-28 18:17:56 overwrite css/popup.css -2011-06-28 18:18:09 overwrite css/popup.css -2011-06-28 18:20:30 overwrite css/popup.css -2011-06-28 18:22:35 overwrite css/popup.css -2011-06-28 18:24:12 overwrite css/popup.css -2011-06-28 18:24:23 overwrite css/popup.css -2011-06-28 18:24:33 overwrite css/popup.css -2011-06-28 18:25:17 overwrite css/popup.css -2011-06-28 18:26:21 overwrite css/popup.css -2011-06-28 18:26:33 overwrite css/popup.css -2011-06-28 18:26:42 overwrite css/popup.css -2011-06-28 18:26:57 overwrite css/popup.css -2011-06-28 18:29:57 overwrite css/popup.css -2011-06-28 18:30:14 overwrite css/popup.css -2011-06-28 18:30:23 overwrite css/popup.css -2011-06-28 18:30:48 overwrite css/popup.css -2011-06-28 18:31:03 overwrite css/popup.css -2011-06-29 10:18:31 overwrite css/popup.css -2011-06-29 10:18:47 overwrite css/popup.css -2011-06-29 10:37:19 overwrite css/popup.css -2011-06-29 10:40:29 overwrite css/popup.css -2011-06-29 10:45:37 overwrite css/popup.css -2011-06-29 10:45:53 identical css/popup.css -2011-06-29 10:46:52 overwrite css/popup.css -2011-06-29 10:47:02 identical css/popup.css -2011-06-29 13:30:47 overwrite css/popup.css -2011-06-29 13:31:14 overwrite css/popup.css -2011-12-20 17:06:48 overwrite css/popup.css -2011-12-22 11:29:15 overwrite css/popup.css -2011-12-22 11:29:24 identical css/popup.css -2011-12-22 11:30:05 overwrite css/popup.css -2011-12-22 11:30:33 overwrite css/popup.css -2011-12-22 11:30:51 overwrite css/popup.css -2011-12-22 11:32:30 overwrite css/popup.css -2011-12-22 11:33:06 overwrite css/popup.css -2011-12-22 11:33:12 overwrite css/popup.css -2011-12-22 11:33:32 identical css/popup.css -2011-12-22 11:33:36 overwrite css/popup.css -2011-12-22 11:34:48 overwrite css/popup.css -2012-01-26 11:42:18 overwrite css/popup.css -2012-01-26 11:42:20 overwrite css/popup.css -- cgit v1.2.3