Changeset 663
- Timestamp:
- 02/16/08 05:31:56 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/config-service/src/chrome/chromeFiles/content/browser.js
r661 r663 429 429 // remove all the scripts from the list 430 430 for (var i = popup.childNodes.length - 1; i >= 0; i--) { 431 if (popup.childNodes[i]. hasAttribute("value")) {431 if (popup.childNodes[i].script) { 432 432 popup.removeChild(popup.childNodes[i]); 433 433 } … … 439 439 var mi = document.createElement('menuitem'); 440 440 mi.setAttribute('label', script.name); 441 mi.s etAttribute('value', i);441 mi.script = script; 442 442 mi.setAttribute('type', 'checkbox'); 443 443 mi.setAttribute('checked', script.enabled.toString()); … … 455 455 function GM_popupClicked(aEvent) { 456 456 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; 459 458 if (!script) return; 460 459 branches/config-service/src/chrome/chromeFiles/content/config.js
r662 r663 393 393 }, 394 394 395 getScriptsForUrl: function(url, onlyEnabled)395 getScriptsForUrl: function(url, includeDisabled) 396 396 { 397 397 var scripts = []; … … 399 399 scriptLoop: 400 400 for (var i = 0, script; script = this._scripts[i]; i++) { 401 if (script.enabled || !onlyEnabled) {401 if (script.enabled || includeDisabled) { 402 402 for (var j = 0, include; include = script._includes[j]; j++) { 403 403 if (convert2RegExp(include).test(url)) { branches/config-service/src/components/greasemonkey.js
r661 r663 232 232 233 233 initScripts: function(url) { 234 var scripts = GM_getConfig().getScriptsForUrl(url, true);234 var scripts = GM_getConfig().getScriptsForUrl(url, false); 235 235 log("* number of matching scripts: " + scripts.length); 236 236 return scripts;
