Bug 423486 - Remove help viewer from Firefox and point to SUMO, r=gavin, ui-r=beltzner, a1.9b5=beltzner

This commit is contained in:
mconnor@steelgryphon.com 2008-03-24 10:18:38 -07:00
Родитель a0347875d1
Коммит 6b1a312abe
22 изменённых файлов: 98 добавлений и 96 удалений

Просмотреть файл

@ -725,3 +725,6 @@ pref("editor.singleLine.pasteNewlines", 2);
// The breakpad report server to link to in about:crashes // The breakpad report server to link to in about:crashes
pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/"); pref("breakpad.reportURL", "http://crash-stats.mozilla.com/report/index/");
// base URL for web-based support pages
pref("app.support.baseURL", "http://support.mozilla.com/1/%APP%/%VERSION%/%OS%/%LOCALE%/");

Просмотреть файл

@ -49,7 +49,6 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<!-- nsMenuBarX hides these and uses them to build the Application menu. <!-- nsMenuBarX hides these and uses them to build the Application menu.
@ -77,8 +76,7 @@
accesskey="&helpMenu.accesskey;"> accesskey="&helpMenu.accesskey;">
#endif #endif
<menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();"> <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<menuitem id="menu_openHelp" <menuitem oncommand="openHelpLink('firefox-help')"
oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
#ifdef XP_MACOSX #ifdef XP_MACOSX
label="&helpContentsMac.label;" label="&helpContentsMac.label;"
key="key_openHelpMacFrontend"/> key="key_openHelpMacFrontend"/>
@ -91,7 +89,7 @@
#ifdef XP_WIN #ifdef XP_WIN
<menuitem label="&helpForIEUsers.label;" <menuitem label="&helpForIEUsers.label;"
accesskey="&helpForIEUsers.accesskey;" accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers', 'chrome://browser/locale/help/help.rdf');"/> oncommand="openHelpLink('ieusers');"/>
#endif #endif
<menuitem id="releaseNotes" <menuitem id="releaseNotes"
accesskey="&helpReleaseNotes.accesskey;" accesskey="&helpReleaseNotes.accesskey;"
@ -117,7 +115,7 @@
<!-- On mac, we map Cmd+Shift+/, but show Cmd+? <!-- On mac, we map Cmd+Shift+/, but show Cmd+?
(that's for en-US, it might be different for other keyboard layouts) --> (that's for en-US, it might be different for other keyboard layouts) -->
<key id="key_openHelpMac" <key id="key_openHelpMac"
oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');" oncommand="openHelpLink('firefox-help');"
key="&openHelpMac.commandkey;" key="&openHelpMac.commandkey;"
modifiers="&openHelpMac.modifiers;"/> modifiers="&openHelpMac.modifiers;"/>
<key id="key_openHelpMacFrontend" <key id="key_openHelpMacFrontend"
@ -135,7 +133,7 @@
modifiers="&hideOtherAppsCmdMac.modifiers;"/> modifiers="&hideOtherAppsCmdMac.modifiers;"/>
#else #else
<key id="key_openHelp" <key id="key_openHelp"
oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');" oncommand="openHelpLink('firefox-help');"
keycode="&openHelp.commandkey;"/> keycode="&openHelp.commandkey;"/>
#endif #endif
</keyset> </keyset>

Просмотреть файл

@ -392,7 +392,7 @@ function doHelpButton()
var deck = document.getElementById("mainDeck"); var deck = document.getElementById("mainDeck");
var helpdoc = helpTopics[deck.selectedPanel.id] || "pageinfo_general"; var helpdoc = helpTopics[deck.selectedPanel.id] || "pageinfo_general";
openHelp(helpdoc, 'chrome://browser/locale/help/help.rdf'); openHelpLink(helpdoc);
} }
function showTab(id) function showTab(id)

Просмотреть файл

@ -71,7 +71,6 @@
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/> <script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/>
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/> <script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/> <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<stringbundleset id="pageinfobundleset"> <stringbundleset id="pageinfobundleset">
@ -100,8 +99,9 @@
<key keycode="VK_ESCAPE" command="cmd_close"/> <key keycode="VK_ESCAPE" command="cmd_close"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<key key="." modifiers="meta" command="cmd_close"/> <key key="." modifiers="meta" command="cmd_close"/>
#endif #else
<key keycode="VK_F1" command="cmd_help"/> <key keycode="VK_F1" command="cmd_help"/>
#endif
<key key="&copy.key;" modifiers="accel" command="cmd_copy"/> <key key="&copy.key;" modifiers="accel" command="cmd_copy"/>
<key key="&selectall.key;" modifiers="accel" command="cmd_selectall"/> <key key="&selectall.key;" modifiers="accel" command="cmd_selectall"/>
<key key="&selectall.key;" modifiers="alt" command="cmd_selectall"/> <key key="&selectall.key;" modifiers="alt" command="cmd_selectall"/>

Просмотреть файл

@ -673,3 +673,25 @@ function getOfflineAppUsage(host)
return usage; return usage;
} }
// aCalledFromModal is optional
function openHelpLink(aHelpTopic, aCalledFromModal) {
var url = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("app.support.baseURL");
url += aHelpTopic;
var where = aCalledFromModal ? "window" : "tab";
openUILinkIn(url, where);
}
function openPrefsHelp() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch2);
// non-instant apply prefwindows are usually modal, so we can't open in the topmost window,
// since its probably behind the window.
var instantApply = prefs.getBoolPref("browser.preferences.instantApply");
var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
openHelpLink(helpTopic, !instantApply);
}

Просмотреть файл

@ -45,10 +45,13 @@
<prefwindow id="AdvancedJSDialog" type="child" <prefwindow id="AdvancedJSDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&advancedJSDialog.title;" title="&advancedJSDialog.title;"
dlgbuttons="accept,cancel,help"> dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="AdvancedJSDialogPane" <prefpane id="AdvancedJSDialogPane"
helpTopic="prefs-advanced-javascript" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-advanced-javascript">
<preferences> <preferences>
<preference id="dom.event.contextmenu.enabled" name="dom.event.contextmenu.enabled" type="bool"/> <preference id="dom.event.contextmenu.enabled" name="dom.event.contextmenu.enabled" type="bool"/>

Просмотреть файл

@ -52,8 +52,7 @@
<overlay id="AdvancedPaneOverlay" <overlay id="AdvancedPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();" <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">
helpURI="chrome://browser/locale/help/help.rdf">
<preferences id="advancedPreferences"> <preferences id="advancedPreferences">
<preference id="browser.preferences.advanced.selectedTabIndex" <preference id="browser.preferences.advanced.selectedTabIndex"

Просмотреть файл

@ -53,8 +53,10 @@
<overlay id="ApplicationsPaneOverlay" <overlay id="ApplicationsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneApplications" onpaneload="gApplicationsPane.init();" flex="1" <prefpane id="paneApplications"
helpTopic="prefs-applications" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gApplicationsPane.init();"
flex="1"
helpTopic="prefs-applications">
<preferences id="feedsPreferences"> <preferences id="feedsPreferences">
<preference id="browser.feeds.handler" <preference id="browser.feeds.handler"

Просмотреть файл

@ -49,14 +49,16 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&colorsDialog.title;" title="&colorsDialog.title;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
#else #else
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="ColorsDialogPane" <prefpane id="ColorsDialogPane"
helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-fonts-and-colors">
<preferences> <preferences>
<preference id="browser.display.use_document_colors" name="browser.display.use_document_colors" type="bool"/> <preference id="browser.display.use_document_colors" name="browser.display.use_document_colors" type="bool"/>

Просмотреть файл

@ -48,14 +48,17 @@
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
onbeforeaccept="return gConnectionsDialog.beforeAccept();" onbeforeaccept="return gConnectionsDialog.beforeAccept();"
onload="gConnectionsDialog.checkForSystemProxy();" onload="gConnectionsDialog.checkForSystemProxy();"
ondialoghelp="openPrefsHelp()"
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
#else #else
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="ConnectionsDialogPane" <prefpane id="ConnectionsDialogPane"
helpTopic="prefs-connection-settings" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-connection-settings">
<preferences> <preferences>
<preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/> <preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/>

Просмотреть файл

@ -49,8 +49,9 @@
<overlay id="ContentPaneOverlay" <overlay id="ContentPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneContent" onpaneload="gContentPane.init();" <prefpane id="paneContent"
helpTopic="prefs-content" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gContentPane.init();"
helpTopic="prefs-content">
<preferences id="contentPreferences"> <preferences id="contentPreferences">
<!--XXX buttons prefs --> <!--XXX buttons prefs -->

Просмотреть файл

@ -52,6 +52,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&fontsDialog.title;" title="&fontsDialog.title;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
#ifdef XP_UNIX #ifdef XP_UNIX
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="width: &window.macWidth; !important;"> style="width: &window.macWidth; !important;">
@ -62,8 +63,10 @@
style="width: &window.width; !important;"> style="width: &window.width; !important;">
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="FontsDialogPane" <prefpane id="FontsDialogPane"
helpTopic="prefs-fonts-and-colors" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-fonts-and-colors">
<preferences id="fontPreferences"> <preferences id="fontPreferences">
<preference id="font.language.group" name="font.language.group" type="wstring"/> <preference id="font.language.group" name="font.language.group" type="wstring"/>

Просмотреть файл

@ -50,10 +50,14 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&languages.customize.Header;" title="&languages.customize.Header;"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
style="width: &window.width;;"> style="width: &window.width;;">
<prefpane id="LanguagesDialogPane" onpaneload="gLanguagesDialog.init();" <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
helpTopic="prefs-languages" helpURI="chrome://browser/locale/help/help.rdf">
<prefpane id="LanguagesDialogPane"
onpaneload="gLanguagesDialog.init();"
helpTopic="prefs-languages">
<preferences> <preferences>
<preference id="intl.accept_languages" name="intl.accept_languages" type="wstring"/> <preference id="intl.accept_languages" name="intl.accept_languages" type="wstring"/>

Просмотреть файл

@ -50,8 +50,9 @@
<overlay id="MainPaneOverlay" <overlay id="MainPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneMain" onpaneload="gMainPane.init();" <prefpane id="paneMain"
helpTopic="prefs-main" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gMainPane.init();"
helpTopic="prefs-main">
<script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/> <script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/>

Просмотреть файл

@ -72,6 +72,7 @@
<prefwindow type="prefwindow" <prefwindow type="prefwindow"
id="BrowserPreferences" id="BrowserPreferences"
windowtype="Browser:Preferences" windowtype="Browser:Preferences"
ondialoghelp="openPrefsHelp()"
#ifdef USE_WIN_TITLE_STYLE #ifdef USE_WIN_TITLE_STYLE
title="&prefWindow.titleWin;" title="&prefWindow.titleWin;"
#else #else
@ -92,6 +93,8 @@
#endif #endif
#endif #endif
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/> <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="bundlePreferences" <stringbundle id="bundlePreferences"
src="chrome://browser/locale/preferences/preferences.properties"/> src="chrome://browser/locale/preferences/preferences.properties"/>

Просмотреть файл

@ -49,9 +49,9 @@
<overlay id="PrivacyPaneOverlay" <overlay id="PrivacyPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="panePrivacy" onpaneload="gPrivacyPane.init();" <prefpane id="panePrivacy"
helpTopic="prefs-privacy" onpaneload="gPrivacyPane.init();"
helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-privacy">
<preferences id="privacyPreferences"> <preferences id="privacyPreferences">

Просмотреть файл

@ -50,10 +50,13 @@
<prefwindow id="SanitizeDialog" type="child" <prefwindow id="SanitizeDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()"
title="&sanitizeDialog.title;"> title="&sanitizeDialog.title;">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
<prefpane id="SanitizeDialogPane" <prefpane id="SanitizeDialogPane"
helpTopic="prefs-clear-private-data" helpURI="chrome://browser/locale/help/help.rdf"> helpTopic="prefs-clear-private-data">
<preferences> <preferences>
<preference id="privacy.item.history" name="privacy.item.history" type="bool"/> <preference id="privacy.item.history" name="privacy.item.history" type="bool"/>

Просмотреть файл

@ -47,8 +47,9 @@
<overlay id="SecurityPaneOverlay" <overlay id="SecurityPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneSecurity" onpaneload="gSecurityPane.init();" <prefpane id="paneSecurity"
helpTopic="prefs-security" helpURI="chrome://browser/locale/help/help.rdf"> onpaneload="gSecurityPane.init();"
helpTopic="prefs-security">
<preferences id="securityPreferences"> <preferences id="securityPreferences">
<!-- XXX buttons --> <!-- XXX buttons -->

Просмотреть файл

@ -49,7 +49,8 @@
<overlay id="TabsPaneOverlay" <overlay id="TabsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneTabs" helpTopic="prefs-tabs" helpURI="chrome://browser/locale/help/help.rdf"> <prefpane id="paneTabs"
helpTopic="prefs-tabs">
<preferences id="tabsPreferences"> <preferences id="tabsPreferences">
<preference id="browser.link.open_external" name="browser.link.open_external" type="int"/> <preference id="browser.link.open_external" name="browser.link.open_external" type="int"/>

Просмотреть файл

@ -69,6 +69,7 @@
locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties) locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties)
% locale browser-region @AB_CD@ %locale/browser-region/ % locale browser-region @AB_CD@ %locale/browser-region/
locale/browser-region/region.properties (%chrome/browser-region/region.properties) locale/browser-region/region.properties (%chrome/browser-region/region.properties)
#ifdef MOZ_HELP_VIEWER
locale/browser/help/help.rdf (%chrome/help/firebirdhelp.rdf) locale/browser/help/help.rdf (%chrome/help/firebirdhelp.rdf)
locale/browser/help/firebird-toc.rdf (%chrome/help/firebird-toc.rdf) locale/browser/help/firebird-toc.rdf (%chrome/help/firebird-toc.rdf)
locale/browser/help/search-db.rdf (%chrome/help/search-db.rdf) locale/browser/help/search-db.rdf (%chrome/help/search-db.rdf)
@ -87,6 +88,7 @@
locale/browser/help/platformStrings.dtd (%chrome/help/platformStrings.dtd) locale/browser/help/platformStrings.dtd (%chrome/help/platformStrings.dtd)
locale/browser/help/tabbed_browsing.xhtml (%chrome/help/tabbed_browsing.xhtml) locale/browser/help/tabbed_browsing.xhtml (%chrome/help/tabbed_browsing.xhtml)
locale/browser/help/glossary.xhtml (%chrome/help/glossary.xhtml) locale/browser/help/glossary.xhtml (%chrome/help/glossary.xhtml)
#endif
# the following files are browser-specific overrides # the following files are browser-specific overrides
* locale/browser/netError.dtd (%chrome/overrides/netError.dtd) * locale/browser/netError.dtd (%chrome/overrides/netError.dtd)
* locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) * locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties)

Просмотреть файл

@ -75,6 +75,10 @@ ifdef MOZ_FEEDS
DIRS += feeds DIRS += feeds
endif endif
ifdef MOZ_HELP_VIEWER
DIRS += help
endif
ifdef MOZ_PLACES ifdef MOZ_PLACES
DIRS += places DIRS += places
endif endif
@ -112,10 +116,6 @@ endif # MOZ_PLACES
endif # MOZ_SUITE endif # MOZ_SUITE
endif # MOZ_THUNDERBIRD endif # MOZ_THUNDERBIRD
ifdef MOZ_XUL
DIRS += help
endif
ifndef MOZ_SUITE ifndef MOZ_SUITE
# XXX Suite doesn't want these just yet # XXX Suite doesn't want these just yet
ifdef MOZ_RDF ifdef MOZ_RDF

Просмотреть файл

@ -655,7 +655,17 @@
return val; return val;
</setter> </setter>
</property> </property>
<field name="currentPane">null</field> <property name="currentPane"
onset="return this._currentPane = val;">
<getter>
if (!this._currentPane)
this._currentPane = this.preferencePanes[0];
return this._currentPane;
</getter>
</property>
<field name="_currentPane">null</field>
<method name="_makePaneButton"> <method name="_makePaneButton">
<parameter name="aPaneElement"/> <parameter name="aPaneElement"/>
@ -744,7 +754,7 @@
document.title = paneTitle; document.title = paneTitle;
#endif #endif
var helpButton = document.documentElement.getButton("help"); var helpButton = document.documentElement.getButton("help");
if (aPaneElement.hasAttribute("helpURI")) if (aPaneElement.helpTopic)
helpButton.hidden = false; helpButton.hidden = false;
else else
helpButton.hidden = true; helpButton.hidden = true;
@ -981,67 +991,8 @@
]]> ]]>
</body> </body>
</method> </method>
// copied from contextHelp.js
// Locate existing help window for this helpFileURI.
<method name="locateHelpWindow">
<parameter name="helpFileURI"/>
<body>
<![CDATA[
const wm = Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
const iterator = wm.getEnumerator("mozilla:help");
var topWindow = null;
var aWindow;
// Loop through help windows looking for one with selected helpFileURI
while (iterator.hasMoreElements()) {
aWindow = iterator.getNext();
if (aWindow.getHelpFileURI() == helpFileURI)
topWindow = aWindow;
}
return topWindow;
]]>
</body>
</method>
// copied from contextHelp.js
// Opens up the Help Viewer with the specified topic and helpFileURI.
<method name="openHelp">
<parameter name="topic"/>
<parameter name="helpFileURI"/>
<body>
<![CDATA[
// Try to find previously opened help.
var topWindow = this.locateHelpWindow(helpFileURI);
if (topWindow) {
// Open topic in existing window.
topWindow.focus();
topWindow.displayTopic(topic);
}
else {
// Open topic in new window.
const params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"]
.createInstance(Components.interfaces.nsIDialogParamBlock);
params.SetNumberStrings(2);
params.SetString(0, helpFileURI);
params.SetString(1, topic);
const ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(null, "chrome://help/content/help.xul", "_blank", "chrome,all,alwaysRaised,dialog=no", params);
}
]]>
</body>
</method>
</implementation> </implementation>
<handlers> <handlers>
<handler event="dialoghelp">
// currentPane is set in _selectPane for prefwindows which aren't childs.
// So if there's no currentPane, just use the first pane.
var pane = this.currentPane ? this.currentPane : this.preferencePanes[0];
this.openHelp(pane.helpTopic, pane.getAttribute("helpURI"));
</handler>
<handler event="dialogaccept"> <handler event="dialogaccept">
<![CDATA[ <![CDATA[
if (!this._fireEvent("beforeaccept", this)) if (!this._fireEvent("beforeaccept", this))