Bug 1365889 - Stop using preprocessing in Scratchpad. r=jdescottes draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 18 May 2017 14:02:48 +0200
changeset 581109 1584d93ee115f38602ab342b0bd5795bf704b7d8
parent 579653 85e5d15c31691c89b82d6068c26260416493071f
child 629489 9180ad29fd69d58ccb9f388be287bfe26812af7f
push id59772
push userbmo:poirot.alex@gmail.com
push dateFri, 19 May 2017 09:18:56 +0000
reviewersjdescottes
bugs1365889
milestone55.0a1
Bug 1365889 - Stop using preprocessing in Scratchpad. r=jdescottes MozReview-Commit-ID: HRGsWZwbvvp
devtools/client/jar.mn
devtools/client/scratchpad/scratchpad.js
devtools/client/scratchpad/scratchpad.xul
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -7,17 +7,17 @@ devtools.jar:
     content/shared/vendor/d3.js (shared/vendor/d3.js)
     content/shared/vendor/dagre-d3.js (shared/vendor/dagre-d3.js)
     content/shared/widgets/widgets.css (shared/widgets/widgets.css)
     content/shared/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
     content/projecteditor/chrome/content/projecteditor.xul (projecteditor/chrome/content/projecteditor.xul)
     content/projecteditor/lib/helpers/readdir.js (projecteditor/lib/helpers/readdir.js)
     content/netmonitor/index.html (netmonitor/index.html)
     content/webconsole/webconsole.xul (webconsole/webconsole.xul)
-*   content/scratchpad/scratchpad.xul (scratchpad/scratchpad.xul)
+    content/scratchpad/scratchpad.xul (scratchpad/scratchpad.xul)
     content/scratchpad/scratchpad.js (scratchpad/scratchpad.js)
     content/shared/splitview.css (shared/splitview.css)
     content/shared/theme-switching.js (shared/theme-switching.js)
     content/shared/frame-script-utils.js (shared/frame-script-utils.js)
     content/styleeditor/styleeditor.xul (styleeditor/styleeditor.xul)
     content/storage/storage.xul (storage/storage.xul)
     content/inspector/inspector.js (inspector/inspector.js)
     content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml)
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -1734,16 +1734,24 @@ var Scratchpad = {
       this._triggerObservers("Ready");
       this.populateRecentFilesMenu();
       PreferenceObserver.init();
       CloseObserver.init();
     }).then(null, (err) => console.error(err));
     this._setupCommandListeners();
     this._updateViewMenuItems();
     this._setupPopupShowingListeners();
+
+    // Change the accesskey for the help menu as it can be specific on Windows
+    // some localizations of Windows (ex:french, german) use "?"
+    //  for the help button in the menubar but Gnome does not.
+    if (Services.appinfo.OS == "WINNT") {
+      let helpMenu = document.getElementById("sp-help-menu");
+      helpMenu.setAttribute("accesskey", helpMenu.getAttribute("accesskeywindows"));
+    }
   },
 
   /**
    * The Source Editor "change" event handler. This function updates the
    * Scratchpad window title to show an asterisk when there are unsaved changes.
    *
    * @private
    */
--- a/devtools/client/scratchpad/scratchpad.xul
+++ b/devtools/client/scratchpad/scratchpad.xul
@@ -298,25 +298,20 @@
       <menuitem id="sp-menu-browser"
                 command="sp-cmd-browserContext"
                 label="&browserContext.label;"
                 accesskey="&browserContext.accesskey;"
                 type="radio"/>
     </menupopup>
   </menu>
 
-#ifdef XP_WIN
   <menu id="sp-help-menu"
         label="&helpMenu.label;"
-        accesskey="&helpMenuWin.accesskey;">
-#else
-  <menu id="sp-help-menu"
-        label="&helpMenu.label;"
-        accesskey="&helpMenu.accesskey;">
-#endif
+        accesskey="&helpMenu.accesskey;"
+        accesskeywindows="&helpMenuWin.accesskey;">
     <menupopup id="sp-menu-help">
       <menuitem id="sp-menu-documentation"
                 label="&documentationLink.label;"
                 accesskey="&documentationLink.accesskey;"
                 command="sp-cmd-documentationLink"
                 key="key_openHelp"/>
     </menupopup>
   </menu>