Changeset 656
- Timestamp:
- 02/10/08 03:17:29 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/config-service/src/chrome/chromeFiles/content/config.js
r655 r656 258 258 }; 259 259 260 Config.prototype.uninstall = function(script, uninstallPrefs) 261 { 262 var idx = this.find(script.namespace, script.name); 263 this.scripts.splice(idx, 1); 264 265 if (script.basedir) // if script has its own dir, remove the dir + contents 266 script.basedirFile.remove(true); 267 else // if script is in the root, just remove the file 268 script.file.remove(false); 269 270 if (uninstallPrefs) // Remove saved preferences 271 GM_prefRoot.remove("scriptvals." + script.namespace + "/" + script.name + "."); 272 } 273 260 274 Config.prototype.installDependency = function(script, req){ 261 275 GM_log("Installing dependency: " + req.url + " from " + req.tempFile.path); branches/config-service/src/chrome/chromeFiles/content/manage.js
r655 r656 13 13 14 14 function handleOkButton() { 15 var uninstallPrefs = document.getElementById('chkUninstallPrefs').checked; 16 15 17 for (var i = 0, script = null; (script = uninstallList[i]); i++) { 16 var idx = config.find(script.namespace, script.name); 17 config.scripts.splice(idx, 1); 18 config.uninstall(script, uninstallPrefs); 18 19 } 19 20 config.save(); 20 21 var chkUninstallPrefs = document.getElementById('chkUninstallPrefs');22 for (var i = 0, script = null; (script = uninstallList[i]); i++) {23 file = script.basedirFile;24 file.normalize();25 if (!file.equals(config.scriptDir)) {26 if (file.exists()) {27 file.remove(true); // file==base directory recursive delete28 }29 } else {30 file = script.file;31 if (file.exists()) {32 file.remove(false);33 }34 }35 if (chkUninstallPrefs.checked) {36 // Remove saved preferences37 var scriptPrefRoot = ["scriptvals.",38 script.namespace,39 "/",40 script.name,41 "."].join("");42 GM_prefRoot.remove(scriptPrefRoot);43 }44 }45 21 return true; 46 22 };
