From c7ef6951baff283266df7567e30c8074dda4ad01 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 15 Feb 2012 15:31:30 -0800 Subject: Setting up webGL local library (assets) --- js/io/system/ninjalibrary.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index 272cc2c7..05e0a427 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,7 @@ { "libraries": [ - {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0"}, - {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.6.0", "file": "rdge-compiled.js"} + {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0.0"}, + {"name": "Assets", "path": "/assets/descriptor.json", "version": "0.5.0.0"}, + {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.5.0.0", "file": "rdge-compiled.js"} ] } \ No newline at end of file -- cgit v1.2.3 From 075252ad893452df446566f01d0b26eeab08be3d Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 15 Feb 2012 23:07:00 -0800 Subject: Setting up webGL library copy on save --- js/io/system/coreioapi.js | 20 +++----------------- js/io/system/ninjalibrary.js | 25 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 20 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 507804fd..a75b59bb 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -40,6 +40,7 @@ exports.CoreIoApi = Montage.create(Component, { //////////////////////////////////////////////////////////// //Instance of ninja library this.ninjaLibrary = NinjaLibrary; + this.ninjaLibrary.coreApi = this; //Getting reference of chrome file system API this.chromeFileSystem = ChromeApi; //Sending size in MBs for file system storage @@ -62,6 +63,7 @@ exports.CoreIoApi = Montage.create(Component, { this.chromeFileSystem.removeEventListener('ready', this, false); //Listening for library to be copied event (builds list) this.chromeFileSystem.addEventListener('library', this, false); + //TODO: Add sync loading screen logic (Add screen here) } }, //////////////////////////////////////////////////////////////////// @@ -86,23 +88,7 @@ exports.CoreIoApi = Montage.create(Component, { console.log('Ninja Local Library: Ready'); //Removing events this.ninjaLibrary.removeEventListener('sync', this, false); - this.ninjaLibrary.coreApi = this; - //TODO: Add sync loading screen logic - - //TODO: Remove test - //this.ninjaLibrary.copyLibToCloud('Users/kgq387/Desktop/Ninja Cloud/Disk', 'montage0.6.0'); - //this.ninjaLibrary.deleteLibraries(); - /* -window.hack = function (name, type) { - this.application.ninja.ioMediator.fileNew('Users/kgq387/Desktop/Ninja Cloud/Disk/'+name+'.'+type, '/js/io/templates/files/'+type+'.txt', function (status) {console.log(status)}); - }.bind(this); -*/ - /* -window.hack = function (path) { - // - this.application.ninja.ioMediator.fileOpen('Users/kgq387/Desktop/Ninja Cloud/Disk/'+path, function (result) {console.log(result)}); - }.bind(this); -*/ + //TODO: Add sync loading screen logic (Remove screen here) } }, //////////////////////////////////////////////////////////////////// diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index fc943323..8c58883a 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -51,6 +51,23 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { }, //////////////////////////////////////////////////////////////////// // + _libs: { + enumerable: false, + value: null + }, + //////////////////////////////////////////////////////////////////// + // + libs: { + enumerable: false, + get: function() { + return this._libs; + }, + set: function(value) { + this._libs = value; + } + }, + //////////////////////////////////////////////////////////////////// + // _libsToSync: { enumerable: false, value: 0 @@ -67,14 +84,14 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { enumerable: false, value: function (path, libName) { // - if(this.coreApi.directoryExists({uri: '/'+path+'/'+libName+'/'}).status === 404) { + if(this.coreApi.directoryExists({uri: path+libName}).status === 404) { this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, function (contents) { for (var i in contents) { if (libName === contents[i].name) { //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, function (status) {console.log(status)}); }.bind(this)); break; } @@ -99,7 +116,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { dir = folder.name; } // - if (!this.coreApi.createDirectory({uri: '/'+dir+'/'})) { + if (!this.coreApi.createDirectory({uri: dir})) { //Error occured while creating folders return; } @@ -140,6 +157,8 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { //Parsing json libraries libs = JSON.parse(xhr.response); // + this.libs = libs.libraries; + // if (chromeLibs.length > 0) { // for (i=0; chromeLibs[i]; i++) { -- cgit v1.2.3 From 6bc07657c8ef58e6efddd383748ecf84d1c789ad Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 16 Feb 2012 15:58:26 -0800 Subject: Adding new RDGE library data --- js/io/system/ninjalibrary.js | 2 ++ js/io/system/ninjalibrary.json | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index 8c58883a..960bdef9 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -145,6 +145,8 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { synchronize: { enumerable: true, value: function(chromeLibs, chrome) { + //TODO: Remove + window.wipeLibrary = this.deleteLibraries.bind(this); // this.chromeApi = chrome; // diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index 05e0a427..a61c30d1 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,7 +1,6 @@ { "libraries": [ {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0.0"}, - {"name": "Assets", "path": "/assets/descriptor.json", "version": "0.5.0.0"}, - {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.5.0.0", "file": "rdge-compiled.js"} + {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.0.1"} ] } \ No newline at end of file -- cgit v1.2.3