Changeset 683
- Timestamp:
- 03/15/08 09:12:59 (9 months ago)
- Files:
-
- branches/config-service/src/chrome/chromeFiles/content/browser.js (modified) (2 diffs)
- branches/config-service/src/chrome/chromeFiles/content/config.js (modified) (14 diffs)
- branches/config-service/src/chrome/chromeFiles/content/manage.js (modified) (5 diffs)
- branches/config-service/src/chrome/chromeFiles/content/pages-overlay.js (modified) (3 diffs)
- branches/config-service/src/chrome/chromeFiles/content/utils.js (modified) (2 diffs)
- branches/config-service/src/chrome/chromeFiles/content/versioning.js (modified) (1 diff)
- branches/config-service/src/components/greasemonkey.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/config-service/src/chrome/chromeFiles/content/browser.js
r682 r683 231 231 this.scriptDownloader_ = scriptDownloader; 232 232 233 var tab = this.tabBrowser.addTab(scriptDownloader.script.previewU rl);233 var tab = this.tabBrowser.addTab(scriptDownloader.script.previewURL); 234 234 var browser = this.tabBrowser.getBrowserForTab(tab); 235 235 … … 515 515 516 516 if (aEvent.button == 0) // left-click: toggle enabled state 517 script.enabled =!script.enabled;517 script.enabled =! script.enabled; 518 518 else // right-click: open in editor 519 519 openInEditor(script); branches/config-service/src/chrome/chromeFiles/content/config.js
r682 r683 48 48 for (var i = 0, script; script = this._scripts[i]; i++) { 49 49 if (script._namespace.toLowerCase() == namespace 50 && script._name.toLowerCase() == name 51 ) { 50 && script._name.toLowerCase() == name) { 52 51 return i; 53 52 } … … 179 178 180 179 var script = new Script(this); 181 script._downloadU rl= uri.spec;180 script._downloadURL = uri.spec; 182 181 script._enabled = true; 183 182 … … 222 221 var reqUri = ioservice.newURI(match[2], null, uri); 223 222 var scriptRequire = new ScriptRequire(script); 224 scriptRequire._downloadU rl= reqUri.spec;223 scriptRequire._downloadURL = reqUri.spec; 225 224 script._requires.push(scriptRequire); 226 225 break; … … 246 245 var scriptResource = new ScriptResource(script); 247 246 scriptResource._name = resName; 248 scriptResource._downloadU rl= resUri.spec;247 scriptResource._downloadURL = resUri.spec; 249 248 script._resources.push(scriptResource); 250 249 break; … … 302 301 } 303 302 304 if (uninstallPrefs) {303 if (uninstallPrefs) { 305 304 // Remove saved preferences 306 305 GM_prefRoot.remove("scriptvals." + script._namespace + "/" + script._name + "."); … … 384 383 this._observers = []; 385 384 386 this._downloadU rl= null; // Only for scripts not installed385 this._downloadURL = null; // Only for scripts not installed 387 386 this._tempFile = null; // Only for scripts not installed 388 387 this._basedir = null; … … 440 439 }, 441 440 442 get fileU rl() { return GM_getUriFromFile(this._file).spec; },441 get fileURL() { return GM_getUriFromFile(this._file).spec; }, 443 442 get textContent() { return getContents(this._file); }, 444 443 … … 485 484 }, 486 485 487 get urlToDownload() { return this._downloadU rl; },486 get urlToDownload() { return this._downloadURL; }, 488 487 setDownloadedFile: function(file) { this._tempFile = file; }, 489 488 490 get previewU rl() {489 get previewURL() { 491 490 return Components.classes["@mozilla.org/network/io-service;1"] 492 491 .getService(Components.interfaces.nsIIOService) … … 498 497 this._script = script; 499 498 500 this._downloadU rl= null; // Only for scripts not installed499 this._downloadURL = null; // Only for scripts not installed 501 500 this._tempFile = null; // Only for scripts not installed 502 501 this._filename = null; … … 510 509 }, 511 510 512 get fileU rl() { return GM_getUriFromFile(this._file).spec; },511 get fileURL() { return GM_getUriFromFile(this._file).spec; }, 513 512 get textContent() { return getContents(this._file); }, 514 513 515 514 _initFile: function() { 516 var name = this._downloadU rl.substr(this._downloadUrl.lastIndexOf("/") + 1);515 var name = this._downloadURL.substr(this._downloadURL.lastIndexOf("/") + 1); 517 516 if(name.indexOf("?") > 0) { 518 517 name = name.substr(0, name.indexOf("?")); … … 532 531 }, 533 532 534 get urlToDownload() { return this._downloadU rl; },533 get urlToDownload() { return this._downloadURL; }, 535 534 setDownloadedFile: function(file) { this._tempFile = file; } 536 535 }; … … 539 538 this._script = script; 540 539 541 this._downloadU rl= null; // Only for scripts not installed540 this._downloadURL = null; // Only for scripts not installed 542 541 this._tempFile = null; // Only for scripts not installed 543 542 this._filename = null; … … 567 566 568 567 var mimetype = this._mimetype; 569 if (this._charset && this._charset.length > 0){568 if (this._charset && this._charset.length > 0) { 570 569 mimetype += ";charset=" + this._charset; 571 570 } … … 577 576 _initFile: ScriptRequire.prototype._initFile, 578 577 579 get urlToDownload() { return this._downloadU rl; },578 get urlToDownload() { return this._downloadURL; }, 580 579 setDownloadedFile: function(tempFile, mimetype, charset) { 581 580 this._tempFile = tempFile; branches/config-service/src/chrome/chromeFiles/content/manage.js
r661 r683 18 18 19 19 var observer = { 20 notifyEvent: function(script, event, data) 21 { 20 notifyEvent: function(script, event, data) { 22 21 var node = null; 23 22 for (var i = 0; node = listbox.childNodes[i]; i++) … … 27 26 switch (event) { 28 27 case "edit-enabled": 29 node.style.color = data ? '' : 'gray';28 node.style.color = data ? "" : "gray"; 30 29 if (script == selectedScript) 31 30 chkEnabled.checked = data; … … 51 50 52 51 // fix the listbox indexes 53 for (var i =0, n=null; n=listbox.childNodes[i]; i++) n.index=i;52 for (var i = 0, n = null; n = listbox.childNodes[i]; i++) n.index=i; 54 53 } 55 54 }; … … 112 111 113 112 function handleUninstallButton() { 114 var uninstallPrefs = document.getElementById( 'chkUninstallPrefs').checked;113 var uninstallPrefs = document.getElementById("chkUninstallPrefs").checked; 115 114 config.uninstall(selectedScript, uninstallPrefs); 116 115 }; … … 131 130 132 131 if (!script.enabled) { 133 listitem.style.color = 'gray';132 listitem.style.color = "gray"; 134 133 } 135 134 branches/config-service/src/chrome/chromeFiles/content/pages-overlay.js
r661 r683 3 3 var excludesBox = new PagesBox(document.getElementById("grpExcluded")); 4 4 5 this.notifyEvent = function(script, event, data) 6 { 5 this.notifyEvent = function(script, event, data) { 7 6 switch (event) { 8 7 case "edit-include-add": includesBox.pageAdded(data); break; … … 93 92 }; 94 93 95 this.pageAdded = function(val) 96 { 94 this.pageAdded = function(val) { 97 95 addPage(val); 98 96 }; … … 110 108 }; 111 109 112 this.pageRemoved= function(index) 113 { 110 this.pageRemoved= function(index) { 114 111 self.listbox.removeChild(self.listbox.childNodes[index]); 115 112 }; branches/config-service/src/chrome/chromeFiles/content/utils.js
r668 r683 212 212 }; 213 213 214 function getBinaryContents(file) {214 function getBinaryContents(file) { 215 215 var ioService = Components.classes["@mozilla.org/network/io-service;1"] 216 216 .getService(Components.interfaces.nsIIOService); … … 228 228 }; 229 229 230 function getContents(file, charset) {230 function getContents(file, charset) { 231 231 if( !charset ) { 232 232 charset = "UTF-8" branches/config-service/src/chrome/chromeFiles/content/versioning.js
r667 r683 50 50 log("> GM_pointFourMigrate"); 51 51 52 // Create a scripts dir if it does not exist 53 this._scriptDir; 52 this._scriptDir; // Create a scripts dir if it does not exist 54 53 55 54 log("< GM_pointFourMigrate"); branches/config-service/src/components/greasemonkey.js
r682 r683 373 373 e, // error obj 374 374 0, // 0 = error (1 = warning) 375 script.fileU rl,375 script.fileURL, 376 376 0 377 377 ); … … 389 389 if (lineNumber < end) { 390 390 return { 391 uri: script.requires[i].fileU rl,391 uri: script.requires[i].fileURL, 392 392 lineNumber: (lineNumber - start) 393 393 }; … … 397 397 398 398 return { 399 uri: script.fileU rl,399 uri: script.fileURL, 400 400 lineNumber: (lineNumber - end) 401 401 };
