commit 1b1af48be08651759135fd9d454ab258a777d9ed
parent 3ce92c3690e877299ccfd3bea5e0998985af42fd
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 31 May 2011 06:34:21 +0000
add Help menu items and About dialog
Diffstat:
7 files changed, 58 insertions(+), 50 deletions(-)
diff --git a/chrome/content/zotero-platform/mac/standalone/baseMenuOverlay.xul b/chrome/content/zotero-platform/mac/standalone/baseMenuOverlay.xul
@@ -88,38 +88,34 @@
</menupopup>
</menu>
- <!--<menu id="helpMenu"
+ <menu id="helpMenu"
label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
- <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
+ <menupopup id="menu_HelpPopup">
<menuitem id="menu_openHelp"
- oncommand="openHelpLink('firefox-help')"
- onclick="checkForMiddleClick(this, event);"
+ oncommand="ZoteroStandalone.openHelp();"
label="&productHelp.label;"
accesskey="&productHelp.accesskey;"
key="key_openHelpMac"/>
<menuitem id="troubleShooting"
accesskey="&helpTroubleshootingInfo.accesskey;"
label="&helpTroubleshootingInfo.label;"
- oncommand="openTroubleshootingPage()"
- onclick="checkForMiddleClick(this, event);"/>
+ oncommand="ZoteroStandalone.openHelp('troubleshooting');"/>
<menuitem id="feedbackPage"
accesskey="&helpFeedbackPage.accesskey;"
label="&helpFeedbackPage.label;"
- oncommand="openFeedbackPage()"
- onclick="checkForMiddleClick(this, event);"/>
- <menuitem id="helpSafeMode"
- accesskey="&helpSafeMode.accesskey;"
- label="&helpSafeMode.label;"
- oncommand="safeModeRestart();"/>
+ oncommand="ZoteroStandalone.openHelp('feedback');"/>
<menuseparator/>
- <menuseparator id="aboutSeparator"/>
+ <menuitem id="reportErrors"
+ accesskey="&helpReportErrors.accesskey;"
+ label="&helpReportErrors.label;"
+ command="cmd_zotero_reportErrors"/>
<menuitem id="aboutName"
accesskey="&aboutProduct.accesskey;"
label="&aboutProduct.label;"
- oncommand="openAboutDialog();"/>
+ oncommand="ZoteroPane.openAboutDialog();"/>
</menupopup>
- </menu>-->
+ </menu>
<keyset id="baseMenuKeyset">
<key id="key_minimizeWindow"
@@ -127,7 +123,7 @@
key="&minimizeWindow.key;"
modifiers="accel"/>
<key id="key_openHelpMac"
- oncommand="openHelpLink('firefox-osxkey');"
+ oncommand="ZoteroStandalone.openHelp();"
key="&helpMac.commandkey;"
modifiers="accel"/>
<!-- These are used to build the Application menu under Cocoa widgets -->
diff --git a/chrome/content/zotero-platform/unix/standalone/baseMenuOverlay.xul b/chrome/content/zotero-platform/unix/standalone/baseMenuOverlay.xul
@@ -42,38 +42,34 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <!--<menu id="helpMenu"
+ <menu id="helpMenu"
label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
<menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<menuitem id="menu_openHelp"
- oncommand="openHelpLink('firefox-help')"
- onclick="checkForMiddleClick(this, event);"
+ oncommand="ZoteroStandalone.openHelp();"
label="&productHelp.label;"
- accesskey="&productHelp.accesskey;"
- />
+ accesskey="&productHelp.accesskey;"/>
<menuitem id="troubleShooting"
accesskey="&helpTroubleshootingInfo.accesskey;"
label="&helpTroubleshootingInfo.label;"
- oncommand="openTroubleshootingPage()"
- onclick="checkForMiddleClick(this, event);"/>
+ oncommand="ZoteroStandalone.openHelp("troubleshooting")"/>
<menuitem id="feedbackPage"
accesskey="&helpFeedbackPage.accesskey;"
label="&helpFeedbackPage.label;"
- oncommand="openFeedbackPage()"
- onclick="checkForMiddleClick(this, event);"/>
- <menuitem id="helpSafeMode"
- accesskey="&helpSafeMode.accesskey;"
- label="&helpSafeMode.label;"
- oncommand="safeModeRestart();"/>
+ oncommand="ZoteroStandalone.openHelp("feedback")"/>
<menuseparator/>
+ <menuitem id="reportErrors"
+ accesskey="&helpReportErrors.accesskey;"
+ label="&helpReportErrors.label;"
+ command="cmd_zotero_reportErrors"/>
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"
accesskey="&aboutProduct.accesskey;"
label="&aboutProduct.label;"
oncommand="openAboutDialog();"/>
</menupopup>
- </menu>-->
+ </menu>
<keyset id="baseMenuKeyset">
</keyset>
diff --git a/chrome/content/zotero-platform/win/standalone/baseMenuOverlay.xul b/chrome/content/zotero-platform/win/standalone/baseMenuOverlay.xul
@@ -42,38 +42,34 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <!--<menu id="helpMenu"
- label="&helpMenuWin.label;"
- accesskey="&helpMenuWin.accesskey;">
+ <menu id="helpMenu"
+ label="&helpMenu.label;"
+ accesskey="&helpMenu.accesskey;">
<menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<menuitem id="menu_openHelp"
- oncommand="openHelpLink('firefox-help')"
- onclick="checkForMiddleClick(this, event);"
+ oncommand="ZoteroStandalone.openHelp();"
label="&productHelp.label;"
- accesskey="&productHelp.accesskey;"
- />
+ accesskey="&productHelp.accesskey;"/>
<menuitem id="troubleShooting"
accesskey="&helpTroubleshootingInfo.accesskey;"
label="&helpTroubleshootingInfo.label;"
- oncommand="openTroubleshootingPage()"
- onclick="checkForMiddleClick(this, event);"/>
+ oncommand="ZoteroStandalone.openHelp('troubleshooting');"/>
<menuitem id="feedbackPage"
accesskey="&helpFeedbackPage.accesskey;"
label="&helpFeedbackPage.label;"
- oncommand="openFeedbackPage()"
- onclick="checkForMiddleClick(this, event);"/>
- <menuitem id="helpSafeMode"
- accesskey="&helpSafeMode.accesskey;"
- label="&helpSafeMode.label;"
- oncommand="safeModeRestart();"/>
+ oncommand="ZoteroStandalone.openHelp('feedback');"/>
<menuseparator/>
+ <menuitem id="reportErrors"
+ accesskey="&helpReportErrors.accesskey;"
+ label="&helpReportErrors.label;"
+ command="cmd_zotero_reportErrors"/>
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"
accesskey="&aboutProduct.accesskey;"
label="&aboutProduct.label;"
oncommand="openAboutDialog();"/>
</menupopup>
- </menu>-->
+ </menu>
<keyset id="baseMenuKeyset">
</keyset>
diff --git a/chrome/content/zotero/standalone.js b/chrome/content/zotero/standalone.js
@@ -53,6 +53,16 @@ var ZoteroStandalone = new function()
}
+ this.openHelp = function(type) {
+ if(type === "troubleshooting") {
+ ZoteroPane.loadURI("http://www.zotero.org/support/getting_help");
+ } else if(type === "feedback") {
+ ZoteroPane.loadURI("http://forums.zotero.org/categories/");
+ } else {
+ ZoteroPane.loadURI("http://www.zotero.org/support/");
+ }
+ }
+
this.onUnload = function() {
ZoteroPane.destroy();
}
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -204,7 +204,7 @@ var ZoteroPane = new function()
// -- this way the page won't be displayed when they sync their DB to
// another profile or if the DB is initialized erroneously (e.g. while
// switching data directory locations)
- else if (Zotero.Prefs.get('firstRun2')) {
+ else if (Zotero.Prefs.get('firstRun2') && !Zotero.isStandalone) {
if (Zotero.Schema.dbInitialized || !Zotero.Sync.Server.enabled) {
setTimeout(function () {
var url = "http://zotero.org/start";
@@ -3604,7 +3604,7 @@ var ZoteroPane = new function()
* Moves around the toolbar when the user moves around the pane
*/
this.updateToolbarPosition = function() {
- const PANES = ["collections", "items"];
+ const PANES = ["collections", "items"];
for each(var paneName in PANES) {
var pane = document.getElementById("zotero-"+paneName+"-pane");
var toolbar = document.getElementById("zotero-"+paneName+"-toolbar");
@@ -3613,6 +3613,13 @@ var ZoteroPane = new function()
toolbar.style.width = computedStyle.getPropertyValue("width");
}
}
+
+ /**
+ * Opens the about dialog
+ */
+ this.openAboutDialog = function() {
+ window.openDialog('chrome://zotero/content/about.xul', 'about', 'chrome');
+ }
}
/**
diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul
@@ -106,7 +106,7 @@
oncommand="ZoteroPane_Local.openPreferences()"/>
<menuitem id="zotero-tb-actions-reportErrors" command="cmd_zotero_reportErrors" disabled="true"/>
<menuitem id="zotero-tb-actions-support" label="&zotero.toolbar.supportAndDocumentation;" oncommand="gBrowser.selectedTab = gBrowser.addTab('http://www.zotero.org/support/')"/>
- <menuitem id="zotero-tb-actions-about" label="&zotero.toolbar.about.label;" oncommand="window.openDialog('chrome://zotero/content/about.xul', 'about', 'chrome')"/>
+ <menuitem id="zotero-tb-actions-about" label="&zotero.toolbar.about.label;" oncommand="ZoteroPane_Local.openAboutDialog()"/>
</menupopup>
</toolbarbutton>
</hbox>
diff --git a/chrome/locale/en-US/zotero/standalone/baseMenuOverlay.dtd b/chrome/locale/en-US/zotero/standalone/baseMenuOverlay.dtd
@@ -12,7 +12,7 @@
<!ENTITY helpMenuWin.accesskey "H">
<!ENTITY aboutProduct.label "About &brandShortName;">
<!ENTITY aboutProduct.accesskey "A">
-<!ENTITY productHelp.label "&brandShortName; Help">
+<!ENTITY productHelp.label "Support and Documentation">
<!ENTITY productHelp.accesskey "H">
<!ENTITY helpMac.commandkey "?">
<!ENTITY helpSafeMode.label "Restart with Add-ons Disabled…">
@@ -24,6 +24,9 @@
<!ENTITY helpFeedbackPage.label "Submit Feedback…">
<!ENTITY helpFeedbackPage.accesskey "S">
+<!ENTITY helpReportErrors.label "Report Errors…">
+<!ENTITY helpReportErrors.accesskey "R">
+
<!ENTITY preferencesCmdMac.label "Preferences…">
<!ENTITY preferencesCmdMac.commandkey ",">