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/ninjalibrary.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'js/io/system/ninjalibrary.js') 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 () { -- cgit v1.2.3