diff options
author | John Mayhew | 2012-04-02 16:28:39 -0700 |
---|---|---|
committer | John Mayhew | 2012-04-02 16:28:39 -0700 |
commit | b4155fb4c33675a8a7cd37473513718043fdf0ba (patch) | |
tree | 3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/io/ui/new-file-dialog | |
parent | 5ba9aeac94c86049423fd5d4b37b277263939c13 (diff) | |
parent | c6de22bf42be90b403491b5f87b1818d9020310c (diff) | |
download | ninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/helper-classes/RDGE/rdge-compiled.js
js/helper-classes/RDGE/runtime/GLRuntime.js
js/helper-classes/RDGE/src/core/script/MeshManager.js
js/helper-classes/RDGE/src/core/script/engine.js
js/helper-classes/RDGE/src/core/script/fx/ssao.js
js/helper-classes/RDGE/src/core/script/init_state.js
js/helper-classes/RDGE/src/core/script/run_state.js
js/helper-classes/RDGE/src/core/script/scenegraphNodes.js
js/helper-classes/RDGE/src/core/script/utilities.js
js/helper-classes/RDGE/src/tools/compile-rdge-core.bat
js/helper-classes/RDGE/src/tools/compile-rdge-core.sh
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/lib/drawing/world.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/linear-gradient-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-blur-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
js/preloader/Preloader.js
Diffstat (limited to 'js/io/ui/new-file-dialog')
3 files changed, 83 insertions, 34 deletions
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 0e1e09a4..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 | |||
@@ -23,6 +23,17 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { | |||
23 | this.fileInputField.selectDirectory = true; | 23 | this.fileInputField.selectDirectory = true; |
24 | 24 | ||
25 | this.newFileName.addEventListener("keyup", this, false); | 25 | this.newFileName.addEventListener("keyup", this, false); |
26 | this.newFileName.addEventListener("paste", this, false); | ||
27 | this.newFileName.focus(); | ||
28 | this.newFileName.select(); | ||
29 | } | ||
30 | }, | ||
31 | |||
32 | handlePaste:{ | ||
33 | value:function(evt){ | ||
34 | evt.preventDefault(); | ||
35 | evt.target.value = evt.clipboardData.getData("Text"); | ||
36 | this.handleKeyup(evt); | ||
26 | } | 37 | } |
27 | }, | 38 | }, |
28 | 39 | ||
@@ -32,6 +43,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { | |||
32 | var newFileNameSetEvent = document.createEvent("Events"); | 43 | var newFileNameSetEvent = document.createEvent("Events"); |
33 | newFileNameSetEvent.initEvent("newFileNameSet", false, false); | 44 | newFileNameSetEvent.initEvent("newFileNameSet", false, false); |
34 | newFileNameSetEvent.newFileName = this.newFileName.value; | 45 | newFileNameSetEvent.newFileName = this.newFileName.value; |
46 | newFileNameSetEvent.keyCode = evt.keyCode; | ||
35 | this.eventManager.dispatchEvent(newFileNameSetEvent); | 47 | this.eventManager.dispatchEvent(newFileNameSetEvent); |
36 | } | 48 | } |
37 | } | 49 | } |
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 aaf39005..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 | |||
@@ -98,14 +98,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
98 | 98 | ||
99 | this.addIdentifiers(); | 99 | this.addIdentifiers(); |
100 | 100 | ||
101 | this.element.addEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false); | ||
102 | this.element.addEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only | ||
103 | this.eventManager.addEventListener("newFileDirectorySet", function(evt){that.handleNewFileDirectorySet(evt);}, false); | ||
104 | this.eventManager.addEventListener("newFileNameSet", function(evt){that.handleNewFileNameSet(evt);}, false); | ||
105 | |||
106 | this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); | ||
107 | this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); | ||
108 | |||
109 | if(!!this.newFileModel.defaultProjectType){ | 101 | if(!!this.newFileModel.defaultProjectType){ |
110 | var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType); | 102 | var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType); |
111 | this.templateList = iconsListModule.IconsList.create(); | 103 | this.templateList = iconsListModule.IconsList.create(); |
@@ -116,7 +108,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
116 | this.templateList.element = this.templateIcons; | 108 | this.templateList.element = this.templateIcons; |
117 | this.templateList.needsDraw = true; | 109 | this.templateList.needsDraw = true; |
118 | 110 | ||
119 | |||
120 | this.selectedProjectType = {"uri":this.newFileModel.defaultProjectType, "element":null}; | 111 | this.selectedProjectType = {"uri":this.newFileModel.defaultProjectType, "element":null}; |
121 | } | 112 | } |
122 | 113 | ||
@@ -127,6 +118,33 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
127 | fileExtensionEl.innerHTML = ""+this.newFileModel.projectTypeData[this.newFileModel.defaultProjectType].fileExtension; | 118 | fileExtensionEl.innerHTML = ""+this.newFileModel.projectTypeData[this.newFileModel.defaultProjectType].fileExtension; |
128 | } | 119 | } |
129 | } | 120 | } |
121 | |||
122 | this.element.addEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false); | ||
123 | this.element.addEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only | ||
124 | this.eventManager.addEventListener("newFileDirectorySet", function(evt){ | ||
125 | that.handleNewFileDirectorySet(evt); | ||
126 | }, false); | ||
127 | this.eventManager.addEventListener("newFileNameSet", function(evt){ | ||
128 | that.handleNewFileNameSet(evt); | ||
129 | }, false); | ||
130 | |||
131 | this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); | ||
132 | this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); | ||
133 | |||
134 | this.element.addEventListener("keyup", function(evt){ | ||
135 | if(evt.keyCode == 27) {//ESC key | ||
136 | if(that.application.ninja.newFileController.newFileOptionsNav !== null){ | ||
137 | that.handleCancelButtonAction(); | ||
138 | } | ||
139 | }else if((evt.keyCode == 13) && !(evt.ctrlKey || evt.metaKey)){//ENTER key | ||
140 | if((that.application.ninja.newFileController.newFileOptionsNav !== null) | ||
141 | && !that.okButton.hasAttribute("disabled")){ | ||
142 | |||
143 | that.handleOkButtonAction(); | ||
144 | } | ||
145 | } | ||
146 | }, true); | ||
147 | |||
130 | } | 148 | } |
131 | 149 | ||
132 | }, | 150 | }, |
@@ -291,10 +309,16 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
291 | }else{ | 309 | }else{ |
292 | if(this.error.innerHTML === ""){ | 310 | if(this.error.innerHTML === ""){ |
293 | this.showError("! Project Template, Name and Directory should be valid."); | 311 | this.showError("! Project Template, Name and Directory should be valid."); |
294 | } | 312 | //disable ok |
295 | //disable ok | 313 | if(!this.okButton.hasAttribute("disabled")){ |
296 | if(!this.okButton.hasAttribute("disabled")){ | 314 | this.okButton.setAttribute("disabled", "true"); |
297 | this.okButton.setAttribute("disabled", "true"); | 315 | } |
316 | }else if(!this.selectedProjectType || !this.selectedTemplate){ | ||
317 | this.showError("! Project Template should be selected."); | ||
318 | //disable ok | ||
319 | if(!this.okButton.hasAttribute("disabled")){ | ||
320 | this.okButton.setAttribute("disabled", "true"); | ||
321 | } | ||
298 | } | 322 | } |
299 | } | 323 | } |
300 | } | 324 | } |
@@ -302,7 +326,12 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
302 | 326 | ||
303 | handleNewFileDirectorySet:{ | 327 | handleNewFileDirectorySet:{ |
304 | value:function(evt){ | 328 | value:function(evt){ |
305 | if(!!evt._event.newFileDirectory){ | 329 | if(evt.keyCode === 13){ |
330 | if(!this.okButton.hasAttribute("disabled")) this.handleOkButtonAction(evt); | ||
331 | }else if(evt.keyCode === 27){ | ||
332 | this.handleCancelButtonAction(evt); | ||
333 | } | ||
334 | else if(!!evt._event.newFileDirectory){ | ||
306 | this.newFileDirectory = evt._event.newFileDirectory; | 335 | this.newFileDirectory = evt._event.newFileDirectory; |
307 | if(this.isValidUri(this.newFileDirectory)){ | 336 | if(this.isValidUri(this.newFileDirectory)){ |
308 | this.enableOk(); | 337 | this.enableOk(); |
@@ -313,7 +342,12 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
313 | 342 | ||
314 | handleNewFileNameSet:{ | 343 | handleNewFileNameSet:{ |
315 | value:function(evt){ | 344 | value:function(evt){ |
316 | if(!!evt._event.newFileName){ | 345 | if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){ |
346 | this.handleOkButtonAction(evt); | ||
347 | }else if(evt.keyCode === 27){ | ||
348 | this.handleCancelButtonAction(evt); | ||
349 | } | ||
350 | else if(!!evt._event.newFileName){ | ||
317 | this.newFileName = evt._event.newFileName; | 351 | this.newFileName = evt._event.newFileName; |
318 | if(this.isValidFileName(this.newFileName)){ | 352 | if(this.isValidFileName(this.newFileName)){ |
319 | this.enableOk(); | 353 | this.enableOk(); |
@@ -374,14 +408,14 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
374 | 408 | ||
375 | this.newFileName = ""; | 409 | this.newFileName = ""; |
376 | this.newFileDirectory = ""; | 410 | this.newFileDirectory = ""; |
377 | this.selectedProjectType = null; | ||
378 | this.selectedTemplate = null; | ||
379 | 411 | ||
380 | //remove event listeners | 412 | //remove event listeners |
381 | this.element.removeEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false); | 413 | this.element.removeEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false); |
382 | this.element.removeEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only | 414 | this.element.removeEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only |
383 | this.eventManager.removeEventListener("newFileDirectorySet", function(evt){that.handleNewFileDirectorySet(evt);}, false); | 415 | this.eventManager.removeEv |