From b62b9d5b3dfd1dfacaf9111f85d40dd246d2b90e Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 8 Feb 2012 16:33:09 -0800 Subject: Adding a purge library method Added a delete libraries function to delete all libraries in Chrome sandbox (as in a force delete). Also updated descriptor files to go with new directory layout of files and relation to the relatives paths used by the packed app and it's manifest. --- js/io/system/coreioapi.js | 10 ++-------- js/io/system/ninjalibrary.js | 18 ++++++++++++++++++ js/io/system/ninjalibrary.json | 4 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index e2c2e4dd..0e721500 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -89,15 +89,9 @@ exports.CoreIoApi = Montage.create(Component, { 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.copyLibToCloud('Users/kgq387/Desktop/Ninja Cloud/Disk', 'montage0.6.0'); + //this.ninjaLibrary.deleteLibraries(); } }, //////////////////////////////////////////////////////////////////// diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index c85de3b0..fc943323 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -297,6 +297,24 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { }, //////////////////////////////////////////////////////////////////// // + deleteLibraries: { + enumerable: true, + value: function () { + function parseLibrary (contents) { + // + for(var i=0; contents[i]; i++) { + // + if (contents[i].isDirectory) { + this.chromeApi.directoryDelete(contents[i].name); + } + } + }; + // + this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, parseLibrary.bind(this)); + } + }, + //////////////////////////////////////////////////////////////////// + // _dispatchEvent: { enumerable: true, value: function () { diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index 87dff7f6..272cc2c7 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,6 @@ { "libraries": [ - {"name": "Montage", "path": "/ninja-internal/node_modules/descriptor.json", "version": "0.6.0"}, - {"name": "RDGE", "path": "/ninja-internal/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"}, + {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.6.0", "file": "rdge-compiled.js"} ] } \ No newline at end of file -- cgit v1.2.3