Changeset 663

Show
Ignore:
Timestamp:
02/16/08 05:31:56 (10 months ago)
Author:
ma..@jesperkristensen.dk
Message:

Fix GM_showPopup

Files:

Legend:

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

    r661 r663  
    429429  // remove all the scripts from the list 
    430430  for (var i = popup.childNodes.length - 1; i >= 0; i--) { 
    431     if (popup.childNodes[i].hasAttribute("value")) { 
     431    if (popup.childNodes[i].script) { 
    432432      popup.removeChild(popup.childNodes[i]); 
    433433    } 
     
    439439        var mi = document.createElement('menuitem'); 
    440440        mi.setAttribute('label', script.name); 
    441         mi.setAttribute('value', i)
     441        mi.script = script
    442442        mi.setAttribute('type', 'checkbox'); 
    443443        mi.setAttribute('checked', script.enabled.toString()); 
     
    455455function GM_popupClicked(aEvent) { 
    456456  if (aEvent.button == 0 || aEvent.button == 2) { 
    457     var scriptNum=aEvent.target.value; 
    458     var script = GM_getConfig().scripts[scriptNum]; 
     457    var script = aEvent.target.script; 
    459458    if (!script) return; 
    460459 
  • branches/config-service/src/chrome/chromeFiles/content/config.js

    r662 r663  
    393393  }, 
    394394 
    395   getScriptsForUrl: function(url, onlyEnabled) 
     395  getScriptsForUrl: function(url, includeDisabled) 
    396396  { 
    397397    var scripts = []; 
     
    399399    scriptLoop: 
    400400    for (var i = 0, script; script = this._scripts[i]; i++) { 
    401       if (script.enabled || !onlyEnabled) { 
     401      if (script.enabled || includeDisabled) { 
    402402        for (var j = 0, include; include = script._includes[j]; j++) { 
    403403          if (convert2RegExp(include).test(url)) { 
  • branches/config-service/src/components/greasemonkey.js

    r661 r663  
    232232 
    233233  initScripts: function(url) { 
    234     var scripts = GM_getConfig().getScriptsForUrl(url, true); 
     234    var scripts = GM_getConfig().getScriptsForUrl(url, false); 
    235235    log("* number of matching scripts: " + scripts.length); 
    236236    return scripts;