From 4c2948447482fe57110e7fd674e362bbbd5814b6 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 28 Mar 2012 14:00:28 -0700 Subject: IKNINJA-719 - removed Zoom In/Zoom Out under View menu in the Main menu Disabled cut, copy, paste, debug, since that functionality is not there yet Signed-off-by: Ananya Sen --- js/data/menu-data.js | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 12007f4a..3333d209 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -154,55 +154,23 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Cut", "hasSubMenu" : false, - "enabled": true + "enabled": false }, { "displayText" : "Copy", "hasSubMenu" : false, - "enabled": true + "enabled": false }, { "displayText" : "Paste", "hasSubMenu" : false, - "enabled": true + "enabled": false } ] }, { "header": "View", "entries": [ - { - "displayText" : "Zoom In", - "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "activeDocument", - "oneway": true, - "boundValueMutator": function(activeDocument){ - if((activeDocument !== null) && (activeDocument.currentView === "design")){return true;} - else{return false;} - } - } - }, - { - "displayText" : "Zoom Out", - "hasSubMenu" : false, - "enabled": { - "value": false, - "boundObj": "documentController", - "boundProperty": "activeDocument", - "oneway": true, - "boundValueMutator": function(activeDocument){ - if((activeDocument !== null) && (activeDocument.currentView === "design")){return true;} - else{return false;} - } - } - }, - { - "displayText" : "", - "separator": true - }, { "displayText" : "Live Preview", "hasSubMenu" : false, @@ -431,7 +399,7 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "Debug", "hasSubMenu" : false, - "enabled": true, + "enabled": false, "checked": { "value": true, "boundProperty": "debug" -- cgit v1.2.3 From 834086b91afc752745128a0c2be4730bf1c7858d Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 28 Mar 2012 14:02:57 -0700 Subject: detect paste from context menu for new file and save as dialog Signed-off-by: Ananya Sen Conflicts: js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js Signed-off-by: Ananya Sen --- .../ui/file-picker/file-input-field.reel/file-input-field.js | 10 ++++++++++ .../new-file-location.reel/new-file-location.js | 12 +++++++++++- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 10 ++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index ccb925b9..1ab268c5 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js @@ -20,6 +20,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { this.eventManager.addEventListener("pickerSelectionsDone", function(evt){that.handleFileInputPickerSelectionsDone(evt);}, false); this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false); + this.newFileDirectory.addEventListener("paste", this, false); } }, @@ -63,6 +64,15 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { } }, + handlePaste:{ + value:function(evt){ + var self=this; + setTimeout(function(){ + self.handleNewFileDirectoryOnkeyup(evt); + }, 1); + } + }, + handleNewFileDirectoryOnkeyup:{ value:function(evt){ if(this.newFileDirectory.value !== ""){ diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js index fac4c488..5dd1153d 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js @@ -23,11 +23,21 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { this.fileInputField.selectDirectory = true; this.newFileName.addEventListener("keyup", this, false); - this.newFileName.focus(); + this.newFileName.addEventListener("paste", this, false); + this.newFileName.focus(); this.newFileName.select(); } }, + handlePaste:{ + value:function(evt){ + var self=this; + setTimeout(function(){ + self.handleKeyup(evt); + }, 1); + } + }, + handleKeyup:{ value:function(evt){ if(this.newFileName.value !== "") { diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js index d59d5be1..2bc141f7 100644 --- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js @@ -55,6 +55,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { this.fileInputField.newFileDirectory.value = this.folderUri; this.newFileName.addEventListener("keyup", function(evt){self.handleNewFileNameOnkeyup(evt);}, false); + this.newFileName.addEventListener("paste", this, false); this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); @@ -98,6 +99,15 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { } }, + handlePaste:{ + value:function(evt){ + var self=this; + setTimeout(function(){ + self.handleNewFileNameOnkeyup(evt); + }, 1); + } + }, + handleNewFileNameOnkeyup:{ value:function(evt){ this.fileName = this.newFileName.value; -- cgit v1.2.3 From 32654e945c0d44e0c293ddb32c67122b64673fd1 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 29 Mar 2012 17:09:57 -0700 Subject: CSS Panel - Fix animation duration value updates from "infinite" to integer. --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index 0c950ffd..ecf0f9cd 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -1691,7 +1691,7 @@ NJCSSStyle.prototype.styleChange = function() { NJCSSStyle.prototype.getUnits = function(val) { if(val.split(/\s/).length > 1) { return false; - } else if(/px|em|pt|in|cm|mm|ex|pc|%/.test(val)) { + } else if(/(px|em|pt|in|cm|mm|ex|pc|%)$/.test(val)) { return val.replace(/^.*(px|em|pt|in|cm|mm|ex|pc|%).*/, '$1'); } return null; @@ -1771,7 +1771,7 @@ NJCSSStyle.prototype.updateValue = function(newValue, bypassUndo) { this.styleChange(); return true; } - + var IMPORTANT_FLAG = ' !important', dec = this.njRule.declaration, acceptAsValid = false, -- cgit v1.2.3 From d4a682ddca0248e0dd7d8871dddbd167bd020a18 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 30 Mar 2012 16:31:18 -0700 Subject: - using clipboard data directly to avoid using setTimeout - fixed logical error to trigger OK on Enter key pressed Signed-off-by: Ananya Sen --- .../ui/file-picker/file-input-field.reel/file-input-field.js | 7 +++---- .../new-file-location.reel/new-file-location.js | 7 +++---- .../new-file-options-navigator.js | 4 ++-- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 11 +++++------ 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index 1ab268c5..46e8b386 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js @@ -66,10 +66,9 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { handlePaste:{ value:function(evt){ - var self=this; - setTimeout(function(){ - self.handleNewFileDirectoryOnkeyup(evt); - }, 1); + evt.preventDefault(); + evt.target.value = evt.clipboardData.getData("Text"); + this.handleNewFileDirectoryOnkeyup(evt); } }, diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js index 5dd1153d..02579676 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js @@ -31,10 +31,9 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { handlePaste:{ value:function(evt){ - var self=this; - setTimeout(function(){ - self.handleKeyup(evt); - }, 1); + evt.preventDefault(); + evt.target.value = evt.clipboardData.getData("Text"); + this.handleKeyup(evt); } }, diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js index 18556bc5..c98955ca 100644 --- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js @@ -326,8 +326,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C handleNewFileDirectorySet:{ value:function(evt){ - if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){ - this.handleOkButtonAction(evt); + if(evt.keyCode === 13){ + if(!this.okButton.hasAttribute("disabled")) this.handleOkButtonAction(evt); }else if(evt.keyCode === 27){ this.handleCancelButtonAction(evt); } diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js index 2bc141f7..c5ed8d33 100644 --- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js @@ -85,8 +85,8 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { handleNewFileDirectorySet:{ value:function(evt){ - if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){ - this.handleOkButtonAction(evt); + if(evt.keyCode === 13){ + if(!this.okButton.hasAttribute("disabled")) this.handleOkButtonAction(evt); }else if(evt.keyCode === 27){ this.handleCancelButtonAction(evt); } @@ -101,10 +101,9 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { handlePaste:{ value:function(evt){ - var self=this; - setTimeout(function(){ - self.handleNewFileNameOnkeyup(evt); - }, 1); + evt.preventDefault(); + evt.target.value = evt.clipboardData.getData("Text"); + this.handleNewFileNameOnkeyup(evt); } }, -- cgit v1.2.3