Changeset 692
- Timestamp:
- 03/16/08 05:27:37 (9 months ago)
- Files:
-
- trunk/src/chrome/chromeFiles/content/accelimation.js (modified) (1 diff)
- trunk/src/chrome/chromeFiles/content/browser.js (modified) (4 diffs)
- trunk/src/chrome/chromeFiles/content/config.js (modified) (4 diffs)
- trunk/src/chrome/chromeFiles/content/convert2RegExp.js (modified) (1 diff)
- trunk/src/chrome/chromeFiles/content/manage.js (modified) (5 diffs)
- trunk/src/chrome/chromeFiles/content/menucommander.js (modified) (2 diffs)
- trunk/src/chrome/chromeFiles/content/miscapis.js (modified) (5 diffs)
- trunk/src/chrome/chromeFiles/content/newscript.js (modified) (2 diffs)
- trunk/src/chrome/chromeFiles/content/pages-overlay.js (modified) (4 diffs)
- trunk/src/chrome/chromeFiles/content/prefmanager.js (modified) (1 diff)
- trunk/src/chrome/chromeFiles/content/scriptdownloader.js (modified) (3 diffs)
- trunk/src/chrome/chromeFiles/content/utils.js (modified) (19 diffs)
- trunk/src/chrome/chromeFiles/content/xmlhttprequester.js (modified) (1 diff)
- trunk/src/components/greasemonkey.js (modified) (3 diffs)
- trunk/src/install.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/chrome/chromeFiles/content/accelimation.js
r691 r692 35 35 this.id = Accelimation.instances.length; 36 36 this.onend = null; 37 } ;37 } 38 38 39 39 //===================================================================== trunk/src/chrome/chromeFiles/content/browser.js
r688 r692 418 418 // set the enabled/disabled state 419 419 GM_BrowserUI.generalMenuEnabledItem.setAttribute("checked", GM_getEnabled()); 420 } ;420 } 421 421 422 422 function GM_showPopup(aEvent) { … … 503 503 var foundInjectedScript = !!(runsFramed.length + runsOnTop.length); 504 504 document.getElementById("gm-status-no-scripts").collapsed = foundInjectedScript; 505 } ;505 } 506 506 507 507 /** … … 521 521 closeMenus(aEvent.target); 522 522 } 523 } ;523 } 524 524 525 525 /** … … 629 629 630 630 // necessary for webProgressListener implementation 631 GM_BrowserUI.onProgressChange = function(webProgress,b,c,d,e,f){} 632 GM_BrowserUI.onStateChange = function(a,b,c,d){} 633 GM_BrowserUI.onStatusChange = function(a,b,c,d){} 634 GM_BrowserUI.onSecurityChange = function(a,b,c){} 635 GM_BrowserUI.onLinkIconAvailable = function(a){} 631 GM_BrowserUI.onProgressChange = function(webProgress,b,c,d,e,f){}; 632 GM_BrowserUI.onStateChange = function(a,b,c,d){}; 633 GM_BrowserUI.onStatusChange = function(a,b,c,d){}; 634 GM_BrowserUI.onSecurityChange = function(a,b,c){}; 635 GM_BrowserUI.onLinkIconAvailable = function(a){}; 636 636 637 637 GM_BrowserUI.showHorrayMessage = function(scriptName) { trunk/src/chrome/chromeFiles/content/config.js
r690 r692 11 11 this._updateVersion(); 12 12 this._load(); 13 } ;13 } 14 14 15 15 Config.prototype = { … … 396 396 this._requires = []; 397 397 this._resources = []; 398 } ;398 } 399 399 400 400 Script.prototype = { … … 500 500 this._tempFile = null; // Only for scripts not installed 501 501 this._filename = null; 502 } ;502 } 503 503 504 504 ScriptRequire.prototype = { … … 545 545 546 546 this._name = null; 547 } ;547 } 548 548 549 549 ScriptResource.prototype = { trunk/src/chrome/chromeFiles/content/convert2RegExp.js
r691 r692 49 49 } 50 50 return new RegExp(res + '$', "i"); 51 } ;51 } trunk/src/chrome/chromeFiles/content/manage.js
r691 r692 74 74 selectedScript.enabled = chkEnabled.checked; 75 75 }, false); 76 } ;76 } 77 77 78 78 function updateDetails() { … … 104 104 pagesControl.populate(selectedScript); 105 105 } 106 } ;106 } 107 107 108 108 function handleEditButton() { 109 109 openInEditor(selectedScript); 110 } ;110 } 111 111 112 112 function handleUninstallButton() { 113 113 var uninstallPrefs = document.getElementById("chkUninstallPrefs").checked; 114 114 config.uninstall(selectedScript, uninstallPrefs); 115 } ;115 } 116 116 117 117 function populateChooser() { … … 119 119 for (var i = 0, script = null; (script = scripts[i]); i++) 120 120 addListitem(script, i); 121 } ;121 } 122 122 123 123 function addListitem(script, i) { … … 134 134 135 135 listbox.appendChild(listitem); 136 } ;136 } 137 137 138 138 function chooseScript(index) { 139 139 listbox.selectedIndex = index; 140 140 listbox.focus(); 141 } ;141 } 142 142 143 143 // allow reordering scripts with keyboard (alt- up and down) … … 153 153 else if (KeyEvent.DOM_VK_DOWN == event.keyCode) 154 154 move = config.move(listbox.selectedItem.script, 1); 155 } ;155 } 156 156 157 157 // allow reordering scripts with drag-and-drop trunk/src/chrome/chromeFiles/content/menucommander.js
r691 r692 1 2 1 function GM_MenuCommander() { 3 2 GM_log("> GM_MenuCommander") … … 16 15 17 16 GM_log("< GM_MenuCommander") 18 } ;17 } 19 18 20 19 GM_MenuCommander.prototype.registerMenuCommand = trunk/src/chrome/chromeFiles/content/miscapis.js
r688 r692 5 5 script.name, 6 6 "."].join("")); 7 } ;7 } 8 8 9 9 GM_ScriptStorage.prototype.setValue = function(name, val) { … … 25 25 function GM_Resources(script){ 26 26 this.script = script; 27 } ;27 } 28 28 29 29 GM_Resources.prototype.getResourceURL = function(name) { … … 59 59 60 60 this.prefix = [namespace, script.name, ": "].join(""); 61 } ;61 } 62 62 63 63 GM_ScriptLogger.prototype.log = function(message) { … … 77 77 style.innerHTML = css; 78 78 head.appendChild(style); 79 } ;79 } 80 80 81 81 function GM_console(script) { … … 99 99 ); 100 100 }; 101 } ;101 } 102 102 103 103 GM_console.prototype.log = function() { trunk/src/chrome/chromeFiles/content/newscript.js
r691 r692 52 52 53 53 return true; 54 } ;54 } 55 55 56 56 // assemble the XUL fields into a script template … … 98 98 99 99 return script; 100 } ;100 } trunk/src/chrome/chromeFiles/content/pages-overlay.js
r691 r692 67 67 selectedPage = self.listbox.getSelectedItem(0); 68 68 self.btnRemove.disabled = selectedPage == null; 69 } ;69 } 70 70 71 71 function promptForNewPage(ev) { … … 90 90 dirty = true; 91 91 } 92 } ;92 } 93 93 94 94 this.pageAdded = function(val) { … … 106 106 dirty = true; 107 107 } 108 } ;108 } 109 109 110 110 this.pageRemoved= function(index) { … … 116 116 listitem.setAttribute("label", pageSpec); 117 117 self.listbox.appendChild(listitem); 118 } ;118 } 119 119 } 120 } ;120 } trunk/src/chrome/chromeFiles/content/prefmanager.js
r691 r692 141 141 } 142 142 }; 143 } ;143 } trunk/src/chrome/chromeFiles/content/scriptdownloader.js
r691 r692 8 8 this.dependenciesLoaded_ = false; 9 9 this.installOnCompletion_ = false; 10 } ;10 } 11 11 12 12 ScriptDownloader.prototype.startInstall = function() { … … 222 222 }; 223 223 224 function NotificationCallbacks() { 225 }; 224 function NotificationCallbacks() {} 226 225 227 226 NotificationCallbacks.prototype.QueryInterface = function(aIID) { … … 242 241 243 242 244 function PersistProgressListener(persist) {243 function PersistProgressListener(persist) { 245 244 this.persist = persist; 246 245 this.onFinish = function(){}; 247 246 this.persiststate = ""; 248 } ;247 } 249 248 250 249 PersistProgressListener.prototype.QueryInterface = function(aIID) { trunk/src/chrome/chromeFiles/content/utils.js
r691 r692 9 9 function GM_isDef(thing) { 10 10 return typeof(thing) != "undefined"; 11 } ;11 } 12 12 13 13 function GM_getConfig() { … … 16 16 .getService(Components.interfaces.gmIGreasemonkeyService) 17 17 .wrappedJSObject.config; 18 } ;18 } 19 19 20 20 function GM_hitch(obj, meth) { … … 39 39 return obj[meth].apply(obj, args); 40 40 }; 41 } ;41 } 42 42 43 43 function GM_listen(source, event, listener, opt_capture) { 44 44 Components.lookupMethod(source, "addEventListener")( 45 45 event, listener, opt_capture); 46 } ;46 } 47 47 48 48 function GM_unlisten(source, event, listener, opt_capture) { 49 49 Components.lookupMethod(source, "removeEventListener")( 50 50 event, listener, opt_capture); 51 } ;51 } 52 52 53 53 /** … … 69 69 70 70 consoleService.logMessage(consoleError); 71 } ;71 } 72 72 73 73 function GM_log(message, force) { … … 75 75 GM_consoleService.logStringMessage(message); 76 76 } 77 } ;77 } 78 78 79 79 function GM_openUserScriptManager() { … … 197 197 name = name.substring(name.lastIndexOf("/") + 1); 198 198 return name; 199 } ;199 } 200 200 201 201 function getTempFile() { … … 210 210 211 211 return file; 212 } ;212 } 213 213 214 214 function getBinaryContents(file) { … … 226 226 227 227 return bytes; 228 } ;228 } 229 229 230 230 function getContents(file, charset) { … … 255 255 return str; 256 256 } 257 } ;257 } 258 258 259 259 function getWriteStream(file) { … … 264 264 265 265 return stream; 266 } ;266 } 267 267 268 268 function GM_getUriFromFile(file) { … … 287 287 288 288 return file 289 } ;289 } 290 290 291 291 /** … … 339 339 return null; 340 340 } 341 } ;341 } 342 342 343 343 function ge(id) { 344 344 return window.document.getElementById(id); 345 } ;345 } 346 346 347 347 … … 360 360 361 361 alert(s); 362 } ;362 } 363 363 364 364 function delaydbg(o) { 365 365 setTimeout(function() {dbg(o);}, 1000); 366 } ;366 } 367 367 368 368 function delayalert(s) { 369 369 setTimeout(function() {alert(s);}, 1000); 370 } ;370 } 371 371 372 372 function GM_isGreasemonkeyable(url) { … … 378 378 scheme == "ftp" || url.match(/^about:cache/)) && 379 379 !/hiddenWindow\.html$/.test(url); 380 } ;380 } 381 381 382 382 function GM_isFileScheme(url) { … … 386 386 387 387 return scheme == "file"; 388 } ;388 } 389 389 390 390 function GM_getEnabled() { 391 391 return GM_prefRoot.getValue("enabled", true); 392 } ;392 } 393 393 394 394 function GM_setEnabled(enabled) { 395 395 GM_prefRoot.setValue("enabled", enabled); 396 } ;396 } 397 397 398 398 … … 405 405 logf.apply(null, arguments); 406 406 } 407 } ;407 } 408 408 409 409 function logf(message) { … … 413 413 414 414 dump(message + "\n"); 415 } ;415 } 416 416 417 417 /** … … 425 425 } 426 426 } 427 } ;427 } 428 428 429 429 function gen_loggify_wrapper(meth, objName, methName) { … … 448 448 } 449 449 } 450 } ;450 } trunk/src/chrome/chromeFiles/content/xmlhttprequester.js
r691 r692 2 2 this.unsafeContentWin = unsafeContentWin; 3 3 this.chromeWindow = chromeWindow; 4 } ;4 } 5 5 6 6 // this function gets called by user scripts in content security scope to trunk/src/components/greasemonkey.js
r690 r692 15 15 .getService(Ci.nsIPromptService) 16 16 .alert(null, "Greasemonkey alert", msg); 17 } ;17 } 18 18 19 19 // Examines the stack to determine if an API should be callable. … … 41 41 42 42 return true; 43 } ;43 } 44 44 45 45 var greasemonkeyService = { … … 489 489 function NSGetModule(compMgr, fileSpec) { 490 490 return Module; 491 } ;491 } 492 492 493 493 //loggify(Module, "greasemonkeyService:Module"); trunk/src/install.js
r691 r692 129 129 return; 130 130 } 131 } ;131 } 132 132 133 133 var InstToProfile = true;
