aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
authorValerio Virgillito2012-03-28 11:56:54 -0700
committerValerio Virgillito2012-03-28 11:56:54 -0700
commit3fd2cdb59027b3f973b9165db9db4fdd22026941 (patch)
tree88c96e3f87729a873af7fc88379f4935e83306ed /js/io
parenta25e50a429dfa87522ed7616dcae7b472f3c785c (diff)
parent3571253acb831860d4bc12466b663655bdac652e (diff)
downloadninja-3fd2cdb59027b3f973b9165db9db4fdd22026941.tar.gz
Merge pull request #131 from ananyasen/integration-candidate
Pull request IKNINJA-1302, IKNINJA-1367, IKNINJA-1361, IKNINJA-1364, IKNINJA-1302, IKNINJA-1266
Diffstat (limited to 'js/io')
-rwxr-xr-xjs/io/system/coreioapi.js2
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js1
-rwxr-xr-xjs/io/ui/file-picker/file-picker-controller.js9
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js13
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js3
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js80
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js14
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js50
8 files changed, 140 insertions, 32 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index ae249480..b0ffe2d8 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -217,7 +217,7 @@ exports.CoreIoApi = Montage.create(Component, {
217 value: function(serviceURL, path) { 217 value: function(serviceURL, path) {
218 var urlOut = path.replace(/\\/g,"/"); 218 var urlOut = path.replace(/\\/g,"/");
219 urlOut = urlOut.replace(/:/g,""); 219 urlOut = urlOut.replace(/:/g,"");
220 urlOut = encodeURI(urlOut); 220 urlOut = encodeURIComponent(urlOut);
221 //add leading / if not already there 221 //add leading / if not already there
222 if((urlOut.length > 0) && (urlOut.charAt(0) !== "/")){ 222 if((urlOut.length > 0) && (urlOut.charAt(0) !== "/")){
223 urlOut = "/" + urlOut; 223 urlOut = "/" + urlOut;
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 651fd7fa..ccb925b9 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
@@ -69,6 +69,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
69 var newFileDirectorySetEvent = document.createEvent("Events"); 69 var newFileDirectorySetEvent = document.createEvent("Events");
70 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 70 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
71 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; 71 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value;
72 newFileDirectorySetEvent.keyCode = evt.keyCode;
72 this.eventManager.dispatchEvent(newFileDirectorySetEvent); 73 this.eventManager.dispatchEvent(newFileDirectorySetEvent);
73 } 74 }
74 } 75 }
diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js
index 105dc223..436a50f3 100755
--- a/js/io/ui/file-picker/file-picker-controller.js
+++ b/js/io/ui/file-picker/file-picker-controller.js
@@ -23,6 +23,11 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
23 } 23 }
24 }, 24 },
25 25
26 pickerNavChoices:{
27 enumerable: true,
28 value: null
29 },
30
26 filePickerPopupType:{ 31 filePickerPopupType:{
27 enumerable: false, 32 enumerable: false,
28 value: "filePicker" 33 value: "filePicker"
@@ -125,8 +130,6 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
125 } 130 }
126 131
127 if(!!storedUri){ 132 if(!!storedUri){
128 // This is depracated -- use decodeURI instead
129 //aModel.currentRoot = unescape(storedUri);
130 aModel.currentRoot = decodeURI(storedUri); 133 aModel.currentRoot = decodeURI(storedUri);
131 } 134 }
132 135
@@ -149,7 +152,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require
149 writable:false, 152 writable:false,
150 enumerable:true, 153 enumerable:true,
151 value:function(callback, aModel){ 154 value:function(callback, aModel){
152 var pickerNavChoices = Montage.create(pickerNavigatorReel); 155 var pickerNavChoices = this.pickerNavChoices = Montage.create(pickerNavigatorReel);
153 var initUri = aModel.currentRoot; 156 var initUri = aModel.currentRoot;
154 157
155 //remove extra / at the end 158 //remove extra / at the end
diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
index 7a9d90b4..945b0301 100644
--- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
+++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
@@ -258,12 +258,20 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
258 this.element.addEventListener("refreshTreeSegment", function(evt){that.handlePickerNavRefreshTreeSegment(evt);}, false); 258 this.element.addEventListener("refreshTreeSegment", function(evt){that.handlePickerNavRefreshTreeSegment(evt);}, false);
259 this.resultsArea.addEventListener("click", function(evt){that.handleResultsAreaClick(evt);}, false); 259 this.resultsArea.addEventListener("click", function(evt){that.handleResultsAreaClick(evt);}, false);
260 this.element.addEventListener("click", function(evt){that.handlePickerNavClick(evt);}, false); 260 this.element.addEventListener("click", function(evt){that.handlePickerNavClick(evt);}, false);
261
262 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); 261 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
263 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); 262 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
264 263
264 this.element.addEventListener("keyup", function(evt){
265 if(evt.keyCode == 27) {
266 if(that.application.ninja.filePickerController.pickerNavChoices !== null){
267 that.handleCancelButtonAction();
268 }
269 }
270 }, true);
271
265 //ready to show picker now 272 //ready to show picker now
266 this.element.style.visibility = "visible"; 273 this.element.style.visibility = "visible";
274 this.element.focus();
267 } 275 }
268 }, 276 },
269 277
@@ -501,7 +509,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
501 metadata = "Name: "+data.name; 509 metadata = "Name: "+data.name;
502 } 510 }
503 metadata = metadata + "<br />" + "Type: "+data.type; 511 metadata = metadata + "<br />" + "Type: "+data.type;
504 if(data.size){metadata = metadata + "<br />" + "Size: "+data.size;} 512 if(data.size){metadata = metadata + "<br />" + "Size: "+data.size+" bytes";}
505 if(data.creationDate){metadata = metadata + "<br />" + "Creation date: "+ this.formatTimestamp(data.creationDate);} 513 if(data.creationDate){metadata = metadata + "<br />" + "Creation date: "+ this.formatTimestamp(data.creationDate);}
506 if(data.modifiedDate){metadata = metadata + "<br />" + "Modified date: "+ this.formatTimestamp(data.modifiedDate);} 514 if(data.modifiedDate){metadata = metadata + "<br />" + "Modified date: "+ this.formatTimestamp(data.modifiedDate);}
507 } 515 }
@@ -1071,6 +1079,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
1071 //clear memory - TODO:check for more memory leaks 1079 //clear memory - TODO:check for more memory leaks
1072 this.pickerModel = null; 1080 this.pickerModel = null;
1073 this.application.ninja.filePickerController._directoryContentCache = {}; 1081 this.application.ninja.filePickerController._directoryContentCache = {};
1082 this.application.ninja.filePickerController.pickerNavChoices = null;
1074 //remove listeners 1083 //remove listeners
1075 this.element.removeEventListener("openFolder", this, false);//add icon double click event listener to reload iconList with new set of data 1084 this.element.removeEventListener("openFolder", this, false);//add icon double click event listener to reload iconList with new set of data
1076 this.element.removeEventListener("selectedItem", this, false);//for single selection only 1085 this.element.removeEventListener("selectedItem", this, false);//for single selection only
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..fac4c488 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,8 @@ 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.focus();
27 this.newFileName.select();
26 } 28 }
27 }, 29 },
28 30
@@ -32,6 +34,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
32 var newFileNameSetEvent = document.createEvent("Events"); 34 var newFileNameSetEvent = document.createEvent("Events");
33 newFileNameSetEvent.initEvent("newFileNameSet", false, false); 35 newFileNameSetEvent.initEvent("newFileNameSet", false, false);
34 newFileNameSetEvent.newFileName = this.newFileName.value; 36 newFileNameSetEvent.newFileName = this.newFileName.value;
37 newFileNameSetEvent.keyCode = evt.keyCode;
35 this.eventManager.dispatchEvent(newFileNameSetEvent); 38 this.eventManager.dispatchEvent(newFileNameSetEvent);
36 } 39 }
37 } 40 }
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..18556bc5 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 }