Changeset 694

Show
Ignore:
Timestamp:
03/16/08 06:26:23 (9 months ago)
Author:
oyasu..@gmail.com
Message:

Changes '-surrounded strings to " instead.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/chrome/chromeFiles/content/browser.js

    r692 r694  
    171171      "chrome://greasemonkey/content/icon_small.png", 
    172172      greeting, 
    173       this.bundle.getString('greeting.btn'), 
     173      this.bundle.getString("greeting.btn"), 
    174174      null /* default doc shell */, 
    175175      "install-userscript", 
     
    197197      notificationBox.PRIORITY_WARNING_MEDIUM, 
    198198      [{ 
    199         label: this.bundle.getString('greeting.btn'), 
     199        label: this.bundle.getString("greeting.btn"), 
    200200        accessKey: "I", 
    201201        popup: null, 
     
    531531  if (GM_getEnabled()) { 
    532532    this.statusImage.src = "chrome://greasemonkey/content/icon_small.png"; 
    533     this.statusImage.tooltipText = this.bundle.getString('tooltip.enabled'); 
     533    this.statusImage.tooltipText = this.bundle.getString("tooltip.enabled"); 
    534534  } else { 
    535535    this.statusImage.src = "chrome://greasemonkey/content/icon_small_disabled.png"; 
    536     this.statusImage.tooltipText = this.bundle.getString('tooltip.disabled'); 
     536    this.statusImage.tooltipText = this.bundle.getString("tooltip.disabled"); 
    537537  } 
    538538 
     
    545545    .getService(Components.interfaces.nsIWindowWatcher); 
    546546  windowWatcher.openWindow( 
    547     window, 'chrome://greasemonkey/content/newscript.xul', null, 
    548     'chrome,dependent,centerscreen,resizable,dialog', null 
     547    window, "chrome://greasemonkey/content/newscript.xul", null, 
     548    "chrome,dependent,centerscreen,resizable,dialog", null 
    549549  ); 
    550550}; 
  • trunk/src/chrome/chromeFiles/content/config.js

    r693 r694  
    322322    if (from == -1) return; 
    323323 
    324     if (typeof destination == 'number') { // if destination is an offset 
     324    if (typeof destination == "number") { // if destination is an offset 
    325325      to = from + destination; 
    326326      to = Math.max(0, to); 
     
    334334    var tmp = this._scripts.splice(from, 1)[0]; 
    335335    this._scripts.splice(to, 0, tmp); 
    336     this._changed(script, 'move', to); 
     336    this._changed(script, "move", to); 
    337337  }, 
    338338 
     
    413413  get description() { return this._description; }, 
    414414  get enabled() { return this._enabled; }, 
    415   set enabled(enabled) { this._enabled = enabled; this._changed('edit-enabled', enabled); }, 
     415  set enabled(enabled) { this._enabled = enabled; this._changed("edit-enabled", enabled); }, 
    416416 
    417417  get includes() { return this._includes.concat(); }, 
    418418  get excludes() { return this._excludes.concat(); }, 
    419   addInclude: function(url) { this._includes.push(url); this._changed('edit-include-add', url); }, 
    420   removeIncludeAt: function(index) { this._includes.splice(index, 1); this._changed('edit-include-remove', index); }, 
    421   addExclude: function(url) { this._excludes.push(url); this._changed('edit-exclude-add', url); }, 
    422   removeExcludeAt: function(index) { this._excludes.splice(index, 1); this._changed('edit-exclude-remove', index); }, 
     419  addInclude: function(url) { this._includes.push(url); this._changed("edit-include-add", url); }, 
     420  removeIncludeAt: function(index) { this._includes.splice(index, 1); this._changed("edit-include-remove", index); }, 
     421  addExclude: function(url) { this._excludes.push(url); this._changed("edit-exclude-add", url); }, 
     422  removeExcludeAt: function(index) { this._excludes.splice(index, 1); this._changed("edit-exclude-remove", index); }, 
    423423 
    424424  get requires() { return this._requires.concat(); }, 
     
    452452    } 
    453453 
    454     name = name.replace(/\s+/g, '_').replace(/[^-_A-Z0-9]+/gi, ''); 
    455     ext = ext.replace(/\s+/g, '_').replace(/[^-_A-Z0-9]+/gi, ''); 
     454    name = name.replace(/\s+/g, "_").replace(/[^-_A-Z0-9]+/gi, ""); 
     455    ext = ext.replace(/\s+/g, "_").replace(/[^-_A-Z0-9]+/gi, ""); 
    456456 
    457457    // If no Latin characters found - use default 
  • trunk/src/chrome/chromeFiles/content/convert2RegExp.js

    r692 r694  
    77  for (var i = 0 ; i < s.length ; i++) { 
    88    switch(s[i]) { 
    9       case '*'
     9      case "*"
    1010        res += ".*"; 
    1111        break; 
    1212 
    13       case '.'
    14       case '?'
    15       case '^'
    16       case '$'
    17       case '+'
    18       case '{'
    19       case '['
    20       case '|'
    21       case '('
    22       case ')'
    23       case ']'
     13      case "."
     14      case "?"
     15      case "^"
     16      case "$"
     17      case "+"
     18      case "{"
     19      case "["
     20      case "|"
     21      case "("
     22      case ")"
     23      case "]"
    2424        res += "\\" + s[i]; 
    2525        break; 
    2626 
    27       case '\\'
     27      case "\\"
    2828        res += "\\\\"; 
    2929        break; 
    3030 
    31       case ' '
     31      case " "
    3232        // Remove spaces from URLs. 
    3333        break; 
     
    4848    res = tldRes[1] + tldStr + tldRes[3]; 
    4949  } 
    50   return new RegExp(res + '$', "i"); 
     50  return new RegExp(res + "$", "i"); 
    5151} 
  • trunk/src/chrome/chromeFiles/content/install.js

    r690 r694  
    2626    this.greetz = new Array(); 
    2727    for(var i = 0; i < 6; i++){ 
    28       this.greetz.push(this.bundle.getString('greetz.' + i)); 
     28      this.greetz.push(this.bundle.getString("greetz." + i)); 
    2929    } 
    3030 
  • trunk/src/chrome/chromeFiles/content/manage.js

    r693 r694  
    9494      if (desc[i].length > wordLen) { 
    9595        for (var j = desc[i].length; j > 0; j -= wordLen) { 
    96           desc[i] = desc[i].substr(0,j) + '\u200B' + desc[i].substr(j); 
     96          desc[i] = desc[i].substr(0,j) + "\u200B" + desc[i].substr(j); 
    9797        } 
    9898      } 
    9999    } 
    100     desc = desc.join(' '); 
     100    desc = desc.join(" "); 
    101101 
    102102    header.textContent = selectedScript.name; 
     
    167167 
    168168  onDragStart: function (event, transferData, action) { 
    169     if ('listitem' != event.target.tagName ) return false; 
     169    if ("listitem" != event.target.tagName ) return false; 
    170170 
    171171    transferData.data = new TransferData(); 
     
    218218    } else { 
    219219      if (0 == newIndex) { 
    220         listbox.firstChild.setAttribute('dragover', 'top'); 
     220        listbox.firstChild.setAttribute("dragover", "top"); 
    221221      } else if (newIndex >= listbox.childNodes.length) { 
    222         listbox.lastChild.setAttribute('dragover', 'bottom'); 
     222        listbox.lastChild.setAttribute("dragover", "bottom"); 
    223223      } else { 
    224         listbox.childNodes[newIndex - 1].setAttribute('dragover', 'bottom'); 
     224        listbox.childNodes[newIndex - 1].setAttribute("dragover", "bottom"); 
    225225      } 
    226226    } 
     
    230230 
    231231  clearFeedback: function() { 
    232     var box = document.getElementById('lstScripts'); 
     232    var box = document.getElementById("lstScripts"); 
    233233    for (var i = 0, el; el = box.childNodes[i]; i++) { 
    234       el.removeAttribute('dragover'); 
     234      el.removeAttribute("dragover"); 
    235235    } 
    236236  }, 
  • trunk/src/chrome/chromeFiles/content/menucommander.js

    r692 r694  
    2828    } 
    2929 
    30     GM_log('accelKey: ' + accelKey); 
    31     GM_log('modifiers: ' + accelModifiers); 
    32     GM_log('accessKey: ' + accessKey); 
     30    GM_log("accelKey: " + accelKey); 
     31    GM_log("modifiers: " + accelModifiers); 
     32    GM_log("accessKey: " + accessKey); 
    3333 
    3434    var menuItem = this.createMenuItem(commandName, commandFunc, accessKey); 
  • trunk/src/chrome/chromeFiles/content/miscapis.js

    r692 r694  
    7171function GM_addStyle(doc, css) { 
    7272  var head, style; 
    73   head = doc.getElementsByTagName('head')[0]; 
     73  head = doc.getElementsByTagName("head")[0]; 
    7474  if (!head) { return; } 
    75   style = doc.createElement('style'); 
    76   style.type = 'text/css'
     75  style = doc.createElement("style"); 
     76  style.type = "text/css"
    7777  style.innerHTML = css; 
    7878  head.appendChild(style); 
     
    9696  this.log = function() { 
    9797    logger.log( 
    98       Array.prototype.slice.apply(arguments).join('\n'
     98      Array.prototype.slice.apply(arguments).join("\n"
    9999    ); 
    100100  }; 
  • trunk/src/chrome/chromeFiles/content/pages-overlay.js

    r693 r694  
    1515  this.populate = function(script) { 
    1616    this.clear(); 
    17     includesBox.populate(script, 'includes', script.includes); 
    18     excludesBox.populate(script, 'excludes', script.excludes); 
     17    includesBox.populate(script, "includes", script.includes); 
     18    excludesBox.populate(script, "excludes", script.excludes); 
    1919    this.script = script; 
    2020    GM_getConfig().addObserver(this, this.script); 
     
    8585 
    8686      if (val && val != "") { 
    87         self.type == 'includes'
     87        self.type == "includes"
    8888          self.script.addInclude(val): 
    8989          self.script.addExclude(val); 
     
    9797 
    9898    function remove(ev) { 
    99       self.type == 'includes'
     99      self.type == "includes"
    100100        self.script.removeIncludeAt(self.listbox.selectedIndex): 
    101101        self.script.removeExcludeAt(self.listbox.selectedIndex); 
  • trunk/src/chrome/chromeFiles/content/scriptdownloader.js

    r692 r694  
    4545    if (this.req_.status != 200 && this.req_.status != 0) { 
    4646      // NOTE: Unlocalized string 
    47       alert('Error loading user script:\n'
     47      alert("Error loading user script:\n"
    4848      this.req_.status + ": " + 
    4949      this.req_.statusText); 
  • trunk/src/chrome/chromeFiles/content/updater.js

    r690 r694  
    147147                                 .replace(/%ITEM_VERSION%/g, 
    148148                                          this.currentVersion) 
    149                                  .replace(/%REQ_VERSION%/gi, '1'); 
     149                                 .replace(/%REQ_VERSION%/gi, "1"); 
    150150  GM_log("ExtensionUpdater: UpdateURL: " + this.updateURL); 
    151151  return true; 
     
    265265    var items = [this.updateLink]; 
    266266 
    267     // Figure out if extension should be updated (default to 'yes'
     267    // Figure out if extension should be updated (default to "yes"
    268268    var autoupdate = GM_prefRoot.getValue("enableUpdate", 
    269269                                          AUTOUPDATE_DEFAULT_VALUE); 
    270270    if (autoupdate == false) { 
    271       this.success('Would have updated, except update is disabled'); 
     271      this.success("Would have updated, except update is disabled"); 
    272272    } else { 
    273273      GM_log("ExtensionUpdater: Extension '" + this.name + "' updating..."); 
  • trunk/src/chrome/chromeFiles/content/utils.js

    r692 r694  
    5555 */ 
    5656function GM_logError(e, opt_warn, fileName, lineNumber) { 
    57   var consoleService = Components.classes['@mozilla.org/consoleservice;1'
     57  var consoleService = Components.classes["@mozilla.org/consoleservice;1"
    5858    .getService(Components.interfaces.nsIConsoleService); 
    5959 
    60   var consoleError = Components.classes['@mozilla.org/scripterror;1'
     60  var consoleError = Components.classes["@mozilla.org/scripterror;1"
    6161    .createInstance(Components.interfaces.nsIScriptError); 
    6262 
     
    305305 
    306306  for (var i = 0; i < numSubversions; i++) { 
    307     if (typeof v2[i] == 'undefined') { 
     307    if (typeof v2[i] == "undefined") { 
    308308      return 1; 
    309309    } 
    310310 
    311     if (typeof v1[i] == 'undefined') { 
     311    if (typeof v1[i] == "undefined") { 
    312312      return -1; 
    313313    } 
  • trunk/src/chrome/chromeFiles/content/xmlhttprequester.js

    r692 r694  
    9898        responseHeaders:(req.readyState == 4 ? 
    9999                         req.getAllResponseHeaders() : 
    100                          ''), 
     100                         ""), 
    101101        status:(req.readyState == 4 ? req.status : 0), 
    102         statusText:(req.readyState == 4 ? req.statusText : ''), 
    103         finalUrl:(req.readyState == 4 ? req.channel.URI.spec : ''
     102        statusText:(req.readyState == 4 ? req.statusText : ""), 
     103        finalUrl:(req.readyState == 4 ? req.channel.URI.spec : ""
    104104      } 
    105105 
  • trunk/src/components/greasemonkey.js

    r692 r694  
    3030      if (stack.filename != null && 
    3131          stack.filename != gmSvcFilename && 
    32           stack.filename.substr(0, 6) != 'chrome') { 
     32          stack.filename.substr(0, 6) != "chrome") { 
    3333        GM_logError(new Error("Greasemonkey access violation: unsafeWindow " + 
    3434                    "cannot call " + apiName + ".")); 
  • trunk/src/foo/foo.user.js

    r691 r694  
    1414(function() 
    1515{ 
    16   if ( confirm( 'Are you sure you want to run these tests?' ) ) { 
     16  if (confirm("Are you sure you want to run these tests?")) { 
    1717 
    1818    const scriptName = "foo.user.js"; 
    1919 
    20     alert('> ' + scriptName); 
    21     GM_log('> ' + scriptName); 
     20    alert("> " + scriptName); 
     21    GM_log("> " + scriptName); 
    2222 
    23       GM_setValue('test1', scriptName ); 
    24       GM_setValue('test2', 31415 ); 
    25       GM_setValue('test3', true ); 
     23      GM_setValue("test1", scriptName ); 
     24      GM_setValue("test2", 31415 ); 
     25      GM_setValue("test3", true ); 
    2626 
    27       GM_log('< test1: ' + GM_getValue('test1', "")); 
    28       GM_log('< test2: ' + GM_getValue('test2', 0)); 
    29       GM_log('< test3: ' + GM_getValue('test3', undefined)); 
     27      GM_log("< test1: " + GM_getValue("test1", "")); 
     28      GM_log("< test2: " + GM_getValue("test2", 0)); 
     29      GM_log("< test3: " + GM_getValue("test3", undefined)); 
    3030 
    31       GM_log('>< test4: ' + GM_getValue('test4', "nofoo")); 
    32       GM_log('>< test5: ' + GM_getValue('test5', 8675309)); 
    33       GM_log('>< test6: ' + GM_getValue('test6', false)); 
     31      GM_log(">< test4: " + GM_getValue("test4", "nofoo")); 
     32      GM_log(">< test5: " + GM_getValue("test5", 8675309)); 
     33      GM_log(">< test6: " + GM_getValue("test6", false)); 
    3434 
    35       GM_log('>< test7: ' + GM_getValue('test7', undefined)); 
    36       GM_log('>< test8: ' + GM_getValue('test8', null)); 
     35      GM_log(">< test7: " + GM_getValue("test7", undefined)); 
     36      GM_log(">< test8: " + GM_getValue("test8", null)); 
    3737 
    38       GM_openInTab( 'http://www.google.com/' ); 
    39       GM_log('>< test9: Enough google?'); 
     38      GM_openInTab("http://www.google.com/"); 
     39      GM_log(">< test9: Enough google?"); 
    4040 
    4141      GM_addStyle("body { color:white; background-color:black }"); 
    42       GM_log('>< test10: body inversion'); 
     42      GM_log(">< test10: body inversion"); 
    4343 
    4444      GM_registerMenuCommand( 
    4545        "Important Message (jJ)", 
    4646        function() { 
    47           alert( "BOO!" ); // And if you're reading this now, you're CHEATING!!! but good for you! ;D 
     47          alert("BOO!"); // And if you're reading this now, you're CHEATING!!! but good for you! ;D 
    4848        }, 
    4949        "j", 
     
    5151        "j" 
    5252      ); 
    53       alert( 'Please press ctrl-alt-shift + j to see an important message later' ); 
     53      alert("Please press ctrl-alt-shift + j to see an important message later"); 
    5454 
    55       alert( 'This next test you will need Live http headers add-on open\n'
    56             'to examine the headers after a brief message from the Monkey source.' ); 
     55      alert("This next test you will need Live http headers add-on open\n"
     56            "to examine the headers after a brief message from the Monkey source."); 
    5757 
    5858      GM_xmlhttpRequest({ 
     
    7474      }); 
    7575 
    76       alert( GM_getResourceText( "fooSource" ) ); 
     76      alert(GM_getResourceText("fooSource")); 
    7777 
    7878      var fooCon1 = GM_getResourceURL("fooCon1"); 
     
    8080      var fooCon3 = GM_getResourceURL("fooCon3"); 
    8181 
    82       if ( confirm( 'Are you sure you want to continue to run these tests?' ) ) { 
     82      if (confirm "Are you sure you want to continue to run these tests?")) { 
    8383        document.open(); 
    84         document.write( "<html>" + 
    85                           "<h1>It's as easy as</h1>" + 
    86                             "<body>" + 
    87                               "<img src=" + fooCon1 + " /><img src=" + fooCon2 + " /><img src=" + fooCon3 + " />" + 
    88                             "</body>" + 
    89                         "</html>" ); 
     84        document.write("<html>" + 
     85                         "<h1>It's as easy as</h1>" + 
     86                           "<body>" + 
     87                             "<img src=" + fooCon1 + " /><img src=" + fooCon2 + " /><img src=" + fooCon3 + " />" + 
     88                           "</body>" + 
     89                       "</html>"); 
    9090        document.close(); 
    9191      } 
    9292 
    93     GM_log( '< ' + scriptName ); 
    94     alert( '< ' + scriptName ); 
     93    GM_log("< " + scriptName); 
     94    alert("< " + scriptName); 
    9595  } 
    9696})(); 
  • trunk/src/install.js

    r692 r694  
    2020  en-US Localized strings 
    2121 ********************************************************************************/ 
    22 const MSG_ADDING = 'Adding ' + APP_PREFS_FILE + ' in '; 
    23 const MSG_ERRCODE = 'Error code:'; 
    24 const MSG_PROMPT = 'Do you wish to install ' + APP_DISPLAY_NAME + ' to your profile?\n' 
    25                    + 'If you are in doubt, this is the preferred option: Select OK.\n' 
    26                    + '(Select Cancel to install in the Mozilla directory.)'; 
    27 const MSG_RETRYING = 'Chrome registration problem. This maybe transient, trying again...'; 
    28 const MSG_SUCCESS = APP_DISPLAY_NAME + ' ' + APP_VERSION + ' has been succesfully installed.\n' 
    29                     + 'Please restart your browser before continuing.'; 
     22const MSG_ADDING = "Adding " + APP_PREFS_FILE + " in "; 
     23const MSG_ERRCODE = "Error code:"; 
     24const MSG_PROMPT = "Do you wish to install " + APP_DISPLAY_NAME + 
     25  " to your profile?\n" + 
     26  "If you are in doubt, this is the preferred option: Select OK.\n" + 
     27  "(Select Cancel to install in the Mozilla directory.)"; 
    3028 
    31 const MSG_FAILAPPNAME = 'Failed to create ' + APP_NAME + '\n' 
    32                         + 'You probably do not have appropriate permissions \n' 
    33                         + '(write access to profile or chrome directory). \n' 
    34                         + '_____________________________\nError code:'; 
     29const MSG_RETRYING = "Chrome registration problem. This maybe transient, " + 
     30  "trying again..."; 
    3531 
    36 const MSG_FAILWARNING = 'WARNING: PARTIAL INSTALLATION\n' 
    37                         + 'A component requiring write permissions failed in the SeaMonkey program directory.\n' 
    38                         + 'You will need to either reinstall ' + APP_DISPLAY_NAME + 'once as Adminstrator or root\n' 
    39                         + 'or install SeaMonkey in a user-writable location.'; 
     32const MSG_SUCCESS = APP_DISPLAY_NAME + " " + APP_VERSION + 
     33  " has been succesfully installed.\n" + 
     34  "Please restart your browser before continuing."; 
    4035 
    41 const MSG_FAILINST = 'Install failed! Error code:'; 
     36const MSG_FAILAPPNAME = "Failed to create " + APP_NAME + "\n" + 
     37  "You probably do not have appropriate permissions \n" + 
     38  "(write access to profile or chrome directory). \n" + 
     39  "_____________________________\nError code:"; 
    4240 
    43 const MSG_TRANSIENT = 'This specific error may be transient:' 
    44                       + '\nIf you retry the install again, it may go away.'; 
     41const MSG_FAILWARNING = "WARNING: PARTIAL INSTALLATION\n" + 
     42  "A component requiring write permissions failed in the SeaMonkey program directory.\n" + 
     43  "You will need to either reinstall " + APP_DISPLAY_NAME + 
     44  "once as Adminstrator or root\n" + 
     45  "or install SeaMonkey in a user-writable location."; 
     46 
     47const MSG_FAILINST = "Install failed! Error code:"; 
     48 
     49const MSG_TRANSIENT = "This specific error may be transient:\n" + 
     50  "If you retry the install again, it may go away."; 
    4551 
    4652/******************************************************************************** 
     
    120126      } 
    121127    } else { 
    122       alert(((err == -239) ? MSG_FAILINST + '\n'+ MSG_TRANSIENT : MSG_FAILINST) + err); 
     128      alert(((err == -239) ? MSG_FAILINST + "\n"+ MSG_TRANSIENT : MSG_FAILINST) + err); 
    123129        cancelInstall(err); 
    124130          return; 
  • trunk/src/perl/convert2RegExp.js

    r392 r694  
    88  for (var i = 0 ; i < s.length ; i++) { 
    99    switch(s[i]) { 
    10       case '*'
     10      case "*"
    1111        res += ".*"; 
    1212        break; 
    1313 
    14       case '.'
    15       case '?'
    16       case '^'
    17       case '$'
    18       case '+'
    19       case '{'
    20       case '['
    21       case '|'
    22       case '('
    23       case ')'
    24       case ']'
     14      case "."
     15      case "?"
     16      case "^"
     17      case "$"
     18      case "+"
     19      case "{"
     20      case "["
     21      case "|"
     22      case "("
     23      case ")"
     24      case "]"
    2525        res += "\\" + s[i]; 
    2626        break; 
    2727 
    28       case '\\'
     28      case "\\"
    2929        res += "\\\\"; 
    3030        break; 
    3131 
    32       case ' '
     32      case " "
    3333        // Remove spaces from URLs. 
    3434        break; 
     
    4949    res = tldRes[1] + tldStr + tldRes[3]; 
    5050  } 
    51   return new RegExp(res + '$', "i"); 
     51  return new RegExp(res + "$", "i"); 
    5252} 
  • trunk/src/perl/convert2RegExp_1.js

    r392 r694  
    88  for (var i = 0 ; i < s.length ; i++) { 
    99    switch(s[i]) { 
    10       case '*'
     10      case "*"
    1111        res += ".*"; 
    1212        break; 
    1313 
    14       case '.'
    15       case '?'
    16       case '^'
    17       case '$'
    18       case '+'
    19       case '{'
    20       case '['
    21       case '|'
    22       case '('
    23       case ')'
    24       case ']'
     14      case "."
     15      case "?"
     16      case "^"
     17      case "$"
     18      case "+"
     19      case "{"
     20      case "["
     21      case "|"
     22      case "("
     23      case ")"
     24      case "]"
    2525        res += "\\" + s[i]; 
    2626        break; 
    2727 
    28       case '\\'
     28      case "\\"
    2929        res += "\\\\"; 
    3030        break; 
    3131 
    32       case ' '
     32      case " "
    3333        // Remove spaces from URLs. 
    3434        break; 
  • trunk/src/perl/convert2RegExp_2.js

    r348 r694  
    33    res = tldRes[1] + tldStr + tldRes[3]; 
    44  } 
    5   return new RegExp(res + '$', "i"); 
     5  return new RegExp(res + "$", "i"); 
    66}