Changeset 683

Show
Ignore:
Timestamp:
03/15/08 09:12:59 (9 months ago)
Author:
ma..@jesperkristensen.dk
Message:

more code style cleanup

Files:

Legend:

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

    r682 r683  
    231231  this.scriptDownloader_ = scriptDownloader; 
    232232 
    233   var tab = this.tabBrowser.addTab(scriptDownloader.script.previewUrl); 
     233  var tab = this.tabBrowser.addTab(scriptDownloader.script.previewURL); 
    234234  var browser = this.tabBrowser.getBrowserForTab(tab); 
    235235 
     
    515515 
    516516    if (aEvent.button == 0) // left-click: toggle enabled state 
    517       script.enabled=!script.enabled; 
     517      script.enabled =! script.enabled; 
    518518    else // right-click: open in editor 
    519519      openInEditor(script); 
  • branches/config-service/src/chrome/chromeFiles/content/config.js

    r682 r683  
    4848    for (var i = 0, script; script = this._scripts[i]; i++) { 
    4949      if (script._namespace.toLowerCase() == namespace  
    50         && script._name.toLowerCase() == name 
    51       ) { 
     50        && script._name.toLowerCase() == name) { 
    5251        return i; 
    5352      } 
     
    179178 
    180179    var script = new Script(this); 
    181     script._downloadUrl = uri.spec; 
     180    script._downloadURL = uri.spec; 
    182181    script._enabled = true; 
    183182 
     
    222221              var reqUri = ioservice.newURI(match[2], null, uri); 
    223222              var scriptRequire = new ScriptRequire(script); 
    224               scriptRequire._downloadUrl = reqUri.spec; 
     223              scriptRequire._downloadURL = reqUri.spec; 
    225224              script._requires.push(scriptRequire); 
    226225              break; 
     
    246245              var scriptResource = new ScriptResource(script); 
    247246              scriptResource._name = resName; 
    248               scriptResource._downloadUrl = resUri.spec; 
     247              scriptResource._downloadURL = resUri.spec; 
    249248              script._resources.push(scriptResource); 
    250249              break; 
     
    302301    } 
    303302 
    304     if (uninstallPrefs)
     303    if (uninstallPrefs)
    305304      // Remove saved preferences 
    306305      GM_prefRoot.remove("scriptvals." + script._namespace + "/" + script._name + "."); 
     
    384383  this._observers = []; 
    385384 
    386   this._downloadUrl = null; // Only for scripts not installed 
     385  this._downloadURL = null; // Only for scripts not installed 
    387386  this._tempFile = null; // Only for scripts not installed 
    388387  this._basedir = null; 
     
    440439  }, 
    441440 
    442   get fileUrl() { return GM_getUriFromFile(this._file).spec; }, 
     441  get fileURL() { return GM_getUriFromFile(this._file).spec; }, 
    443442  get textContent() { return getContents(this._file); }, 
    444443 
     
    485484  }, 
    486485 
    487   get urlToDownload() { return this._downloadUrl; }, 
     486  get urlToDownload() { return this._downloadURL; }, 
    488487  setDownloadedFile: function(file) { this._tempFile = file; }, 
    489488   
    490   get previewUrl() { 
     489  get previewURL() { 
    491490    return Components.classes["@mozilla.org/network/io-service;1"] 
    492491                     .getService(Components.interfaces.nsIIOService) 
     
    498497  this._script = script; 
    499498 
    500   this._downloadUrl = null; // Only for scripts not installed 
     499  this._downloadURL = null; // Only for scripts not installed 
    501500  this._tempFile = null; // Only for scripts not installed 
    502501  this._filename = null; 
     
    510509  }, 
    511510 
    512   get fileUrl() { return GM_getUriFromFile(this._file).spec; }, 
     511  get fileURL() { return GM_getUriFromFile(this._file).spec; }, 
    513512  get textContent() { return getContents(this._file); }, 
    514513 
    515514  _initFile: function() { 
    516     var name = this._downloadUrl.substr(this._downloadUrl.lastIndexOf("/") + 1); 
     515    var name = this._downloadURL.substr(this._downloadURL.lastIndexOf("/") + 1); 
    517516    if(name.indexOf("?") > 0) { 
    518517      name = name.substr(0, name.indexOf("?")); 
     
    532531  }, 
    533532 
    534   get urlToDownload() { return this._downloadUrl; }, 
     533  get urlToDownload() { return this._downloadURL; }, 
    535534  setDownloadedFile: function(file) { this._tempFile = file; } 
    536535}; 
     
    539538  this._script = script; 
    540539 
    541   this._downloadUrl = null; // Only for scripts not installed 
     540  this._downloadURL = null; // Only for scripts not installed 
    542541  this._tempFile = null; // Only for scripts not installed 
    543542  this._filename = null; 
     
    567566 
    568567    var mimetype = this._mimetype; 
    569     if(this._charset && this._charset.length > 0)
     568    if (this._charset && this._charset.length > 0)
    570569      mimetype += ";charset=" + this._charset; 
    571570    } 
     
    577576  _initFile: ScriptRequire.prototype._initFile, 
    578577 
    579   get urlToDownload() { return this._downloadUrl; }, 
     578  get urlToDownload() { return this._downloadURL; }, 
    580579  setDownloadedFile: function(tempFile, mimetype, charset) { 
    581580    this._tempFile = tempFile; 
  • branches/config-service/src/chrome/chromeFiles/content/manage.js

    r661 r683  
    1818 
    1919var observer = { 
    20   notifyEvent: function(script, event, data) 
    21   { 
     20  notifyEvent: function(script, event, data) { 
    2221    var node = null; 
    2322    for (var i = 0; node = listbox.childNodes[i]; i++) 
     
    2726    switch (event) { 
    2827    case "edit-enabled": 
    29       node.style.color = data ? '' : 'gray'
     28      node.style.color = data ? "" : "gray"
    3029      if (script == selectedScript) 
    3130        chkEnabled.checked = data; 
     
    5150 
    5251    // 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; 
    5453  } 
    5554}; 
     
    112111 
    113112function handleUninstallButton() { 
    114   var uninstallPrefs = document.getElementById('chkUninstallPrefs').checked; 
     113  var uninstallPrefs = document.getElementById("chkUninstallPrefs").checked; 
    115114  config.uninstall(selectedScript, uninstallPrefs); 
    116115}; 
     
    131130 
    132131  if (!script.enabled) { 
    133     listitem.style.color = 'gray'
     132    listitem.style.color = "gray"
    134133  } 
    135134 
  • branches/config-service/src/chrome/chromeFiles/content/pages-overlay.js

    r661 r683  
    33  var excludesBox = new PagesBox(document.getElementById("grpExcluded")); 
    44 
    5   this.notifyEvent = function(script, event, data) 
    6   { 
     5  this.notifyEvent = function(script, event, data) { 
    76    switch (event) { 
    87    case "edit-include-add": includesBox.pageAdded(data); break; 
     
    9392    }; 
    9493 
    95     this.pageAdded = function(val) 
    96     { 
     94    this.pageAdded = function(val) { 
    9795      addPage(val); 
    9896    }; 
     
    110108    }; 
    111109 
    112     this.pageRemoved= function(index) 
    113     { 
     110    this.pageRemoved= function(index) { 
    114111      self.listbox.removeChild(self.listbox.childNodes[index]); 
    115112    }; 
  • branches/config-service/src/chrome/chromeFiles/content/utils.js

    r668 r683  
    212212}; 
    213213 
    214 function getBinaryContents(file)
     214function getBinaryContents(file)
    215215    var ioService = Components.classes["@mozilla.org/network/io-service;1"] 
    216216                              .getService(Components.interfaces.nsIIOService); 
     
    228228}; 
    229229 
    230 function getContents(file, charset)
     230function getContents(file, charset)
    231231  if( !charset ) { 
    232232    charset = "UTF-8" 
  • branches/config-service/src/chrome/chromeFiles/content/versioning.js

    r667 r683  
    5050  log("> GM_pointFourMigrate"); 
    5151 
    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 
    5453 
    5554  log("< GM_pointFourMigrate"); 
  • branches/config-service/src/components/greasemonkey.js

    r682 r683  
    373373            e, // error obj 
    374374            0, // 0 = error (1 = warning) 
    375             script.fileUrl
     375            script.fileURL
    376376            0 
    377377          ); 
     
    389389      if (lineNumber < end) { 
    390390        return { 
    391           uri: script.requires[i].fileUrl
     391          uri: script.requires[i].fileURL
    392392          lineNumber: (lineNumber - start) 
    393393        }; 
     
    397397 
    398398    return { 
    399       uri: script.fileUrl
     399      uri: script.fileURL
    400400      lineNumber: (lineNumber - end) 
    401401    };