Changeset 650
- Timestamp:
- 01/22/08 12:53:16 (10 months ago)
- Files:
-
- branches/jk1/src/chrome/chromeFiles/content/browser.js (modified) (1 diff)
- branches/jk1/src/chrome/chromeFiles/content/manage.js (modified) (1 diff)
- branches/jk1/src/chrome/chromeFiles/content/newscript.js (modified) (1 diff)
- branches/jk1/src/chrome/chromeFiles/content/utils.js (modified) (4 diffs)
- branches/jk1/src/chrome/chromeFiles/locale/en-US/gm-manage.properties (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/jk1/src/chrome/chromeFiles/content/browser.js
r629 r650 493 493 } else { 494 494 // right-click: open in editor 495 openInEditor(getScriptFile(config.scripts[scriptNum]), 496 document.getElementById("gm-browser-bundle")); 495 openInEditor(config.scripts[scriptNum]); 497 496 } 498 497 branches/jk1/src/chrome/chromeFiles/content/manage.js
r629 r650 106 106 107 107 function handleEditButton() { 108 openInEditor(getScriptFile(selectedScript), 109 document.getElementById("gm-manage-bundle")); 108 openInEditor(selectedScript); 110 109 }; 111 110 branches/jk1/src/chrome/chromeFiles/content/newscript.js
r629 r650 52 52 53 53 // and fire up the editor! 54 openInEditor(getScriptFile(script), 55 document.getElementById("gm-browser-bundle")); 54 openInEditor(script); 56 55 57 56 // persist namespace value branches/jk1/src/chrome/chromeFiles/content/utils.js
r629 r650 73 73 // the UI and Config rely on it. Needs rethinking. 74 74 75 function openInEditor(aFile, stringBundle) { 75 function 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"); 76 81 var editor = getEditor(stringBundle); 77 82 if (!editor) { … … 81 86 82 87 try { 83 launchApplicationWithDoc(editor, aFile);88 launchApplicationWithDoc(editor, file); 84 89 } catch (e) { 85 90 // Something may be wrong with the editor the user selected. Remove so that 86 91 // 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); 88 93 GM_prefRoot.remove("editor"); 89 94 throw e; … … 120 125 .createInstance(nsIFilePicker); 121 126 122 filePicker.init(window, stringBundle. getString("editor.prompt"),127 filePicker.init(window, stringBundle.GetStringFromName("editor.prompt"), 123 128 nsIFilePicker.modeOpen); 124 129 filePicker.appendFilters(nsIFilePicker.filterApplication); … … 137 142 return filePicker.file; 138 143 } else { 139 alert(stringBundle. getString("editor.please_pick_executable"));144 alert(stringBundle.GetStringFromName("editor.please_pick_executable")); 140 145 } 141 146 } branches/jk1/src/chrome/chromeFiles/locale/en-US/gm-manage.properties
r357 r650 5 5 promptForEdit.msg=Modify the URL of the page below. You can specify multiple pages using the wildcard (*) character. 6 6 promptForEdit.title=Edit Page 7 8 editor.prompt=Choose an Executable Text Editor (e.g. "c:\\windows\\notepad.exe")
