Changeset 650

Show
Ignore:
Timestamp:
01/22/08 12:53:16 (10 months ago)
Author:
ma..@jesperkristensen.dk
Message:

simplify parameters for openInEditor, and remove use of duplicate entries in gm-manage.properties, which are not up to date

Files:

Legend:

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

    r629 r650  
    493493    } else { 
    494494      // right-click: open in editor 
    495       openInEditor(getScriptFile(config.scripts[scriptNum]), 
    496                    document.getElementById("gm-browser-bundle")); 
     495      openInEditor(config.scripts[scriptNum]); 
    497496    } 
    498497 
  • branches/jk1/src/chrome/chromeFiles/content/manage.js

    r629 r650  
    106106 
    107107function handleEditButton() { 
    108   openInEditor(getScriptFile(selectedScript), 
    109                document.getElementById("gm-manage-bundle")); 
     108  openInEditor(selectedScript); 
    110109}; 
    111110 
  • branches/jk1/src/chrome/chromeFiles/content/newscript.js

    r629 r650  
    5252 
    5353  // and fire up the editor! 
    54   openInEditor(getScriptFile(script), 
    55                document.getElementById("gm-browser-bundle")); 
     54  openInEditor(script); 
    5655 
    5756  // persist namespace value 
  • branches/jk1/src/chrome/chromeFiles/content/utils.js

    r629 r650  
    7373// the UI and Config rely on it. Needs rethinking. 
    7474 
    75 function openInEditor(aFile, stringBundle) { 
     75function openInEditor(script) { 
     76  var file = getScriptFile(script); 
     77  var stringBundle = Components 
     78    .classes["@mozilla.org/intl/stringbundle;1"] 
     79    .getService(Components.interfaces.nsIStringBundleService) 
     80    .createBundle("chrome://greasemonkey/locale/gm-browser.properties"); 
    7681  var editor = getEditor(stringBundle); 
    7782  if (!editor) { 
     
    8186 
    8287  try { 
    83     launchApplicationWithDoc(editor, aFile); 
     88    launchApplicationWithDoc(editor, file); 
    8489  } catch (e) { 
    8590    // Something may be wrong with the editor the user selected. Remove so that 
    8691    // next time they can pick a different one. 
    87     alert(stringBundle.getString("editor.could_not_launch") + "\n" + e); 
     92    alert(stringBundle.GetStringFromName("editor.could_not_launch") + "\n" + e); 
    8893    GM_prefRoot.remove("editor"); 
    8994    throw e; 
     
    120125                               .createInstance(nsIFilePicker); 
    121126 
    122     filePicker.init(window, stringBundle.getString("editor.prompt"), 
     127    filePicker.init(window, stringBundle.GetStringFromName("editor.prompt"), 
    123128                    nsIFilePicker.modeOpen); 
    124129    filePicker.appendFilters(nsIFilePicker.filterApplication); 
     
    137142      return filePicker.file; 
    138143    } else { 
    139       alert(stringBundle.getString("editor.please_pick_executable")); 
     144      alert(stringBundle.GetStringFromName("editor.please_pick_executable")); 
    140145    } 
    141146  } 
  • branches/jk1/src/chrome/chromeFiles/locale/en-US/gm-manage.properties

    r357 r650  
    55promptForEdit.msg=Modify the URL of the page below. You can specify multiple pages using the wildcard (*) character. 
    66promptForEdit.title=Edit Page 
    7  
    8 editor.prompt=Choose an Executable Text Editor (e.g. "c:\\windows\\notepad.exe")