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 ++-- node_modules/descriptor.json | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) 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 diff --git a/node_modules/descriptor.json b/node_modules/descriptor.json index 29273403..c460066c 100644 --- a/node_modules/descriptor.json +++ b/node_modules/descriptor.json @@ -1,7 +1,7 @@ { "copyright": "This file contains proprietary software owned by Motorola Mobility, Inc. No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder. (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.", "version": "0.0.0.0", - "root": "/ninja-internal/node_modules/montage/", + "root": "/node_modules/montage/", "directories": [{"name": "core", "children": [{"name": "converter"}, {"name": "event"}, {"name": "geometry"}, {"name": "shim"}] }, -- cgit v1.2.3