From fbde30a4651d34ac569bf6750db5dd017ccc8d6e Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 16:18:56 -0800 Subject: fixed picker address dropdown to backtrace till the logical drive Signed-off-by: Ananya Sen --- js/io/ui/file-picker/file-picker-controller.js | 2 +- js/io/ui/file-picker/file-picker-model.js | 6 ++++++ js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'js/io') diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js index 3b19de83..105dc223 100755 --- a/js/io/ui/file-picker/file-picker-controller.js +++ b/js/io/ui/file-picker/file-picker-controller.js @@ -104,7 +104,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require aModel.topLevelDirectories = topLevelDirectories; if(!!topLevelDirectories && !!topLevelDirectories[0]){ - aModel.currentRoot = topLevelDirectories[0].uri; + aModel.currentRoot = aModel.currentLogicalDrive = topLevelDirectories[0].uri; } //populate the last opened folder first, if none then populate default root diff --git a/js/io/ui/file-picker/file-picker-model.js b/js/io/ui/file-picker/file-picker-model.js index 09c3ae9c..c92ec586 100755 --- a/js/io/ui/file-picker/file-picker-model.js +++ b/js/io/ui/file-picker/file-picker-model.js @@ -73,6 +73,12 @@ exports.FilePickerModel = (require("montage/core/core").Montage).create(require( value:"" }, + currentLogicalDrive:{ + writable:true, + enumerable:true, + value:"" + }, + callback:{ writable:true, enumerable:true, 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 3d99ae4d..1e3cb1b9 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 @@ -346,6 +346,11 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { var arr = []; var temp = new String(uri); while(temp.indexOf("/") != -1){ + + if(temp === this.pickerModel.currentLogicalDrive){//stop at the logical drive + break; + } + temp = temp.substring(0, temp.lastIndexOf("/")); //populate dropdown irrespective of validity @@ -560,7 +565,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { enumerable: true, writable: false, value : function(evt, dirObj){ - this.currentURI = dirObj.uri; + this.currentURI = this.pickerModel.currentLogicalDrive = dirObj.uri; var status = this.pickerViews()[this.selectedPickerView].call(this, dirObj.uri);//dynamically calls the update function of the current picker view -- cgit v1.2.3 From b00a0da52ae29eefb45c8b28f7c782c7ebfa4b57 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 16:33:58 -0800 Subject: IKNINJA-1256 fix - needed to convert String object to string Signed-off-by: Ananya Sen --- js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/io') 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 1e3cb1b9..7a9d90b4 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 @@ -347,7 +347,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { var temp = new String(uri); while(temp.indexOf("/") != -1){ - if(temp === this.pickerModel.currentLogicalDrive){//stop at the logical drive + if(""+temp === this.pickerModel.currentLogicalDrive){//stop at the logical drive break; } -- cgit v1.2.3 From 92c311c527b864f35aa98dba950da677746d4708 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 16:42:10 -0800 Subject: - detect document style edit [with Eric's input for styles-controller.js] - integrated save as Signed-off-by: Ananya Sen --- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/io') 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 0a322b99..c60a92f9 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 @@ -111,7 +111,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { handleOkButtonAction:{ value: function(evt){ var filename = this.fileName, - newFileDirectory = this.newFileDirectory, + newFileDirectory = this.folderUri, success = true; if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ try{ @@ -128,7 +128,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { } }catch(e){ success = false; - console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ this.newFileDirectory); + console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ newFileDirectory); console.log(e.stack); } -- cgit v1.2.3 From 4bdb951f2dab6d132ed28ab17888cc819ed811ee Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 8 Mar 2012 16:07:02 -0800 Subject: Adding I/O functionality to RDGE Added webGL/Canvas file I/O for Ninja, it also created routine for saving data for runtime, however, the runtime RDGE library needs an update for runtime to work, so right now I/O will only work for Ninja. --- js/io/system/ninjalibrary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/io') diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index a61c30d1..00ee7ed2 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,6 @@ { "libraries": [ {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0.0"}, - {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.0.1"} + {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.1.0"} ] } \ No newline at end of file -- cgit v1.2.3 From bd454f4f2f693e30b0468cf92f6e47da73b6e0ec Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 9 Mar 2012 15:47:35 -0800 Subject: Fixing Issues for Windows Lib --- js/io/system/ninjalibrary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/io') diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index 960bdef9..ff949613 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -116,7 +116,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { dir = folder.name; } // - if (!this.coreApi.createDirectory({uri: dir})) { + if (!this.coreApi.createDirectory({uri: dir.replace(/\/\//gi, '/')})) { //Error occured while creating folders return; } @@ -132,7 +132,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { this.chromeApi.fileContent(contents[i].fullPath, function (result) { // //this.coreApi.createFile({uri: fileRoot+result.file.fullPath, contents: blob.getBlob(result.data.type), contentType: result.data.type}); - this.coreApi.createFile({uri: fileRoot+result.file.fullPath, contents: result.content}); + this.coreApi.createFile({uri: (fileRoot+result.file.fullPath).replace(/\/\//gi, '/'), contents: result.content}); }.bind(this)); } } -- cgit v1.2.3 From 615be47750fb86c07acd9354da12a76abe6c24e0 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sat, 10 Mar 2012 16:27:48 -0800 Subject: Temp Runtime WebGL Fix Added a temporary fix to allow for webGL runtime functionality. Copying the desired folder name into a static name. There is a lag in doing this, so obviously now ideal. Need to discuss adding dynamic path-ing during author and runtime. --- js/io/system/ninjalibrary.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/io') diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index ff949613..201598fc 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -82,7 +82,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { // copyLibToCloud: { enumerable: false, - value: function (path, libName) { + value: function (path, libName, callback) { // if(this.coreApi.directoryExists({uri: path+libName}).status === 404) { this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, function (contents) { @@ -91,7 +91,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { //Getting contents of library to be copied this.chromeApi.directoryContents(contents[i], function (lib) { //Creating directory structure from subfolders - this.copyDirectoryToCloud(path, contents[i], path, function (status) {console.log(status)}); + this.copyDirectoryToCloud(path, contents[i], path, callback); }.bind(this)); break; } @@ -138,6 +138,8 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { } }.bind(this)); } + //TODO Add logic for proper callback status(es) + if (callback) callback(true); } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3