Changeset 700

Show
Ignore:
Timestamp:
03/28/08 06:15:10 (8 months ago)
Author:
ma..@jesperkristensen.dk
Message:

streamline script preference handling

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/manage-ui2/src/chrome/chromeFiles/content/config.js

    r699 r700  
    265265    var existingIndex = this._find(script); 
    266266    if (existingIndex > -1) { 
    267       this.uninstall(this._scripts[existingIndex], false); 
     267      this.uninstall(this._scripts[existingIndex]); 
    268268    } 
    269269 
     
    285285  }, 
    286286 
    287   uninstall: function(script, uninstallPrefs) { 
     287  uninstall: function(script) { 
    288288    var idx = this._find(script); 
    289289    this._scripts.splice(idx, 1); 
     
    297297      // if script is in the root, just remove the file 
    298298      script._file.remove(false); 
    299     } 
    300  
    301     if (uninstallPrefs) { 
    302       // Remove saved preferences 
    303       GM_prefRoot.remove("scriptvals." + script._namespace + "/" + script._name + "."); 
    304299    } 
    305300  }, 
     
    415410  get enabled() { return this._enabled; }, 
    416411  set enabled(enabled) { this._enabled = enabled; this._changed("edit-enabled", enabled); }, 
     412  get prefBranch() { return "scriptvals." + this._namespace + "/" + this._name + "."; }, 
    417413 
    418414  get includes() { return this._includes.concat(); }, 
  • branches/manage-ui2/src/chrome/chromeFiles/content/manage.js

    r695 r700  
    111111 
    112112function handleUninstallButton() { 
    113   var uninstallPrefs = document.getElementById("chkUninstallPrefs").checked; 
    114   config.uninstall(selectedScript, uninstallPrefs); 
     113  if (document.getElementById("chkUninstallPrefs").checked) { 
     114    // Remove saved preferences 
     115    GM_prefRoot.remove(selectedScript.prefBranch); 
     116  } 
     117 
     118  config.uninstall(selectedScript); 
    115119} 
    116120 
  • branches/manage-ui2/src/chrome/chromeFiles/content/miscapis.js

    r694 r700  
    11function GM_ScriptStorage(script) { 
    2   this.prefMan = new GM_PrefManager(["scriptvals.", 
    3                                      script.namespace, 
    4                                      "/", 
    5                                      script.name, 
    6                                      "."].join("")); 
     2  this.prefMan = new GM_PrefManager(script.prefBranch); 
    73} 
    84