Closed Bug 954363 Opened 9 years ago Closed 4 years ago

Add a link to "FAQ" on "help" menu item

Categories

(Instantbird :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bugzilla, Assigned: mmkmou)

Details

Attachments

(1 file, 3 obsolete files)

*** Original post on bio 930 by mmkmou <mmkmou AT mmkmou.net> at 2011-07-15 19:23:00 UTC ***

In menu "HELP" we have not a help item that link to "FAQ". It would be good for users who need help
*** Original post on bio 930 as attmnt 753 by mmkmou AT mmkmou.net at 2011-07-21 17:07:00 UTC ***

this patch add "Online menu item" on "Help Menu" link to FAQ on instantbird website and you can use "F1" as shortcut keyboard


--
mmkmou
Attachment #8352495 - Flags: review?
Comment on attachment 8352495 [details] [diff] [review]
Add Online Help menu item to Help Menu

*** Original change on bio 930 attmnt 753 at 2011-07-21 17:28:46 UTC ***

>+  openHelpLink: function menu_openHelpLink() {
>+	var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
>+                          .getService(Components.interfaces.nsIIOService);
>+
>+	var helpURI = ioservice.newURI("http://instantbird.com/faq.html", null, null);
You should try to use the Services from imServices.jsm (http://lxr.instantbird.org/instantbird/source/instantbird/modules/imServices.jsm) when possible. Note that this also includes Services from toolkit (https://developer.mozilla.org/en/JavaScript_code_modules/Services.jsm), so this can be simplified to:
var helpURI = Services.io.newURI("http://instantbird.com/faq.html", null, null);

Also, perhaps this URL be taken from a property file somewhere to use a translated version of the page?

>+	var extps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
>+                      .getService(Components.interfaces.nsIExternalProtocolService);extps.loadURI(helpURI, null);
>+  },

Use a new line after you finish a statement, so extps.loadURI(helpURI, null); should be on it's own line.

>diff -r 2825c6d440c4 instantbird/locales/en-US/chrome/instantbird/instantbird.dtd
>--- a/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Thu Jul 21 01:18:37 2011 +0200
>+++ b/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Thu Jul 21 17:02:32 2011 +0000
>@@ -37,6 +37,7 @@
> <!ENTITY addonManager       "Add-ons">
> <!ENTITY addonManager.key   "d">
> <!ENTITY checkForUpdates    "Check for Updates">
>+<!ENTITY helpMenuItem	    "Online Help">
> <!ENTITY help.menu          "Help">
> <!ENTITY help.accesskey     "H">
> <!-- LOCALIZATION NOTE (helpWin.menu):
Personally I think I'd prefer "Online FAQ", but flo might have an opinion on this (also I'm not sure if FAQ is too English-specific).

Also please use "let" where appropriate instead of "var" (that means pretty much if it's ever in a function, use "let"). See https://developer.mozilla.org/en/JavaScript/Reference/Statements/let for more information.

Thanks for taking a look at this! Should definitely help our support situation!
Attachment #8352495 - Flags: review? → review-
*** Original post on bio 930 at 2011-07-21 17:31:08 UTC ***

Assigning to mmkmou.
Assignee: nobody → bugzilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
*** Original post on bio 930 at 2011-07-21 17:41:42 UTC ***

(In reply to comment #2)
> (From update of attachment 8352495 [details] [diff] [review] (bio-attmnt 753) [details])
> >+  openHelpLink: function menu_openHelpLink() {
> >+	var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
> >+                          .getService(Components.interfaces.nsIIOService);
> >+
> >+	var helpURI = ioservice.newURI("http://instantbird.com/faq.html", null, null);

Please do NOT use tabs for the indentation.

> Also, perhaps this URL be taken from a property file somewhere to use a
> translated version of the page?

I don't think so. If no locale is specified in the URL, the website autodetects the visitor's locale based on his browser preference, I think it's enough.

> 
> >+	var extps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
> >+                      .getService(Components.interfaces.nsIExternalProtocolService);extps.loadURI(helpURI, null);

I don't think you need the extps service here.

> >diff -r 2825c6d440c4 instantbird/locales/en-US/chrome/instantbird/instantbird.dtd
> >--- a/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Thu Jul 21 01:18:37 2011 +0200
> >+++ b/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Thu Jul 21 17:02:32 2011 +0000
> >@@ -37,6 +37,7 @@
> > <!ENTITY addonManager       "Add-ons">
> > <!ENTITY addonManager.key   "d">
> > <!ENTITY checkForUpdates    "Check for Updates">
> >+<!ENTITY helpMenuItem	    "Online Help">

Please replace the tab character here too.

> > <!ENTITY help.menu          "Help">
> > <!ENTITY help.accesskey     "H">
> > <!-- LOCALIZATION NOTE (helpWin.menu):
> Personally I think I'd prefer "Online FAQ", but flo might have an opinion on
> this (also I'm not sure if FAQ is too English-specific).

"English-specific" doesn't matter as it's a localized string. Using acronyms doesn't sound good, especially for people needing Help ;).

I agree with all other comments from clokep :).
*** Original post on bio 930 at 2011-07-21 17:42:56 UTC ***

(In reply to comment #4)
 
> I don't think you need the extps service here.

I meant "I don't think you need the extps variable here." Sorry for the confusion :(.
*** Original post on bio 930 by mmkmou <mmkmou AT mmkmou.net> at 2011-07-21 23:13:18 UTC ***

ok thank for your feedback, i'm going  to solve them this week-end, if i've some time for me
*** Original post on bio 930 as attmnt 756 by mmkmou AT mmkmou.net at 2011-07-24 16:50:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352498 - Flags: review?
Comment on attachment 8352495 [details] [diff] [review]
Add Online Help menu item to Help Menu

*** Original change on bio 930 attmnt 753 by mmkmou AT mmkmou.net at 2011-07-24 16:50:11 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352495 - Attachment is obsolete: true
*** Original post on bio 930 at 2011-07-24 18:09:57 UTC ***

Comment on attachment 8352498 [details] [diff] [review] (bio-attmnt 756)
Add Online Help menu item to Help Menu V2

>diff -r 2825c6d440c4 instantbird/content/menus.js
>@@ -51,6 +52,15 @@
>     Core.showWindow("Messenger:About", aboutWindow, "About",
>                     "chrome,resizable=no,minimizable=no,centerscreen");
>   },
>+  
>+  openHelpLink: function menu_openHelpLink() {
>+
>+	let helpURI = Services.ioService.newURI("http://instantbird.com/faq.html", null, null);

Patrick pointed out that you can use "Services.io" here. It is already defined in Services.jsm which is included from imServices.jsm. In short: it's defined, you only need to use it. (Also see end of the comment about the newly defined service getter!)


>diff -r 2825c6d440c4 instantbird/content/menus.xul
>--- a/instantbird/content/menus.xul	Thu Jul 21 01:18:37 2011 +0200
>+++ b/instantbird/content/menus.xul	Sun Jul 24 16:48:27 2011 +0000
>@@ -63,6 +63,7 @@
>     <command id="cmd_joinchat" oncommand="menus.joinChat()"/>
>     <command id="cmd_addbuddy" oncommand="menus.addBuddy()"/>
>     <command id="cmd_addons" oncommand="menus.addons()"/>
>+    <command id="cmd_help" oncommand="menus.openHelpLink();"/>
>   </commandset>
> 
>   <keyset id="mainkeyset">
>@@ -72,6 +73,7 @@
>     <key id="joinChatkey" key="&joinChat.commandkey;" command="cmd_joinchat" modifiers="accel"/>
>     <key id="addBuddykey" key="&addBuddy.commandkey;" command="cmd_addbuddy" modifiers="accel"/>
>     <key id="addonskey" key="&addonManager.key;" command="cmd_addons" modifiers="accel"/>
>+    <key id="helpkey" keycode="VK_F1" command="cmd_help"/>

I checked the web (look for "command-?" here: http://support.apple.com/kb/ht1343) and it seems that "F1" isn't used to open the help on Mac's. That means that Mac's will need special treatment here. You can define a different key for mac by conditionally inserting a key definition or another ("#ifdef XP_MACOSX" ... "#else" ...).
Additionally the help menu isn't shown on Macs at the moment (see https://bugzilla.mozilla.org/show_bug.cgi?id=953964 (bio 526)#c11), so you better wait for other feedback how to handle the Mac case. I'm out of ideas here (except for "show the menu and put the help item there").

>   </keyset>
> 
>   <menubar id="blistMenubar">
>@@ -115,11 +117,15 @@
>     <menu label="&help.menu;" id="helpMenu" accesskey="&help.accesskey;">
> #ifdef MOZ_UPDATER
>       <menupopup id="helpMenuPopup" onpopupshowing="menus.displayUpdateStatus();">
>-        <menuitem id="updatesMenuItem" label="&checkForUpdates;" oncommand="menus.updates()"/>
>-        <menuseparator id="updatesSep"/>
> #else
>       <menupopup id="helpMenuPopup">
>+#endif      
>+		<menuitem id="helpMenuItem" label="&helpMenuItem;" command="cmd_help" key="helpkey"/>

The whole menu is called "help" at the moment, maybe use a more different id with "FAQ" or "online" again.

>+#ifdef MOZ_UPDATER
>+        <menuitem id="updatesMenuItem" label="&checkForUpdates;" oncommand="menus.updates()"/>
> #endif
>+        <menuseparator id="updatesSep"/>

The previous line ended on the wrong side of the #endif as it seems.


>diff -r 2825c6d440c4 instantbird/locales/en-US/chrome/instantbird/instantbird.dtd
>--- a/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Thu Jul 21 01:18:37 2011 +0200
>+++ b/instantbird/locales/en-US/chrome/instantbird/instantbird.dtd	Sun Jul 24 16:48:27 2011 +0000
>@@ -37,6 +37,7 @@
> <!ENTITY addonManager       "Add-ons">
> <!ENTITY addonManager.key   "d">
> <!ENTITY checkForUpdates    "Check for Updates">
>+<!ENTITY helpMenuItem       "Online FAQ">

"helpMenuItem" is rather ambiguous, what about "onlineFAQ". "onlineFAQ.accesskey" would be suitable for the key assigned to the action? onlineFAQMac.(access?)key would be the one for the key used on Mac's (they don't use F1 as it seems).


>diff -r 2825c6d440c4 instantbird/modules/imServices.jsm
>--- a/instantbird/modules/imServices.jsm	Thu Jul 21 01:18:37 2011 +0200
>+++ b/instantbird/modules/imServices.jsm	Sun Jul 24 16:48:27 2011 +0000
>@@ -20,6 +20,7 @@
>  * the Initial Developer. All Rights Reserved.
>  *
>  * Contributor(s):
>+ *   Mouhamadou Moustapha CAMARA <mmkmou@mmkmou.net>
>  *
>  * Alternatively, the contents of this file may be used under the terms of
>  * either the GNU General Public License Version 2 or later (the "GPL"), or
>@@ -58,3 +59,6 @@
> XPCOMUtils.defineLazyServiceGetter(Services, "logs",
>                                    "@instantbird.org/logger;1",
>                                    "ibILogger");
>+XPCOMUtils.defineLazyServiceGetter(Services, "ioService",
>+                                   "@mozilla.org/network/io-service;1",
>+                                   "nsIIOService");

This service is already defined as "Services.io" -> you don't need to edit this file.
Comment on attachment 8352498 [details] [diff] [review]
Add Online Help menu item to Help Menu V2

*** Original change on bio 930 attmnt 756 at 2011-07-24 18:10:55 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352498 - Flags: review? → review-
*** Original post on bio 930 at 2011-07-24 18:15:26 UTC ***

(In reply to comment #8)
> >diff -r 2825c6d440c4 instantbird/content/menus.xul
> >--- a/instantbird/content/menus.xul	Thu Jul 21 01:18:37 2011 +0200
> >+++ b/instantbird/content/menus.xul	Sun Jul 24 16:48:27 2011 +0000
> >@@ -63,6 +63,7 @@
> >     <command id="cmd_joinchat" oncommand="menus.joinChat()"/>
> >     <command id="cmd_addbuddy" oncommand="menus.addBuddy()"/>
> >     <command id="cmd_addons" oncommand="menus.addons()"/>
> >+    <command id="cmd_help" oncommand="menus.openHelpLink();"/>
> >   </commandset>
> > 
> >   <keyset id="mainkeyset">
> >@@ -72,6 +73,7 @@
> >     <key id="joinChatkey" key="&joinChat.commandkey;" command="cmd_joinchat" modifiers="accel"/>
> >     <key id="addBuddykey" key="&addBuddy.commandkey;" command="cmd_addbuddy" modifiers="accel"/>
> >     <key id="addonskey" key="&addonManager.key;" command="cmd_addons" modifiers="accel"/>
> >+    <key id="helpkey" keycode="VK_F1" command="cmd_help"/>
> 
> I checked the web (look for "command-?" here:
> http://support.apple.com/kb/ht1343) and it seems that "F1" isn't used to open
> the help on Mac's. That means that Mac's will need special treatment here. You
> can define a different key for mac by conditionally inserting a key definition
> or another ("#ifdef XP_MACOSX" ... "#else" ...).

Oh, sorry. I think it should rather go into the different platform specific menu files instead (see menus-win.xul, menus-mac.xul, ..).
*** Original post on bio 930 as attmnt 757 by mmkmou AT mmkmou.net at 2011-07-25 01:29:00 UTC ***

I don't know if the change in menus-mac.xul is good, i've not a Mac with me
Attachment #8352499 - Flags: review?
Comment on attachment 8352498 [details] [diff] [review]
Add Online Help menu item to Help Menu V2

*** Original change on bio 930 attmnt 756 by mmkmou AT mmkmou.net at 2011-07-25 01:29:28 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352498 - Attachment is obsolete: true
*** Original post on bio 930 as attmnt 758 by mmkmou AT mmkmou.net at 2011-07-26 00:27:00 UTC ***

After a discussion in IRC, i did some modification in the patch: 
17:07:24 <clokep_work> mmkmou: One problem I do see is that you have tabs in some of your files, we almost always use spaces.
17:08:18 <-- gerard-majax has quit (Quit: Ex-Chat)
17:08:47 <mmkmou> a ok where exactly 
17:12:07 <clokep_work> menus-mac.xul, menus.js, menus.xul all have them.
17:12:25 <clokep_work> If you have an editor that can do regex find replace you can just find "\t" and replace it with "  " (that's two spaces).
17:12:29 --> gerard-majax has joined #instantbird
17:14:26 <mmkmou> ok thank 
17:16:22 <mmkmou> ok i going to fix this night 
17:16:29 <mmkmou> to night
17:21:44 <clokep_work> mmkmou: Also you have two menuseperators with the same ID now in menus.xul
17:22:18 <clokep_work> Both with id="updatesSep", the id must be unique.
17:28:43 <clokep_work> Thanks for sticking w/ this. :)
17:30:23 <mmkmou> ok thanks I would look
Attachment #8352500 - Flags: review?
Comment on attachment 8352499 [details] [diff] [review]
Add Online Help menu item to Help Menu V3

*** Original change on bio 930 attmnt 757 by mmkmou AT mmkmou.net at 2011-07-26 00:27:22 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352499 - Attachment is obsolete: true
Attachment #8352499 - Flags: review?
*** Original post on bio 930 at 2011-07-26 00:43:59 UTC ***

(In reply to comment #11)
> Created an attachment (id=758) [details]
> Add Online Help menu item to Help Menu V3-1

Looks good! Just built it locally and it worked as advertised on Windows 7. :) I'll let this drop on to flo (or someone with a Mac) to r+ though! :)
Comment on attachment 8352500 [details] [diff] [review]
Add Online Help menu item to Help Menu V3-1

*** Original change on bio 930 attmnt 758 at 2011-08-02 16:03:15 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8352500 - Flags: review? → review?(florian)
There was missing email mapping information for this bug during the BIO to BMO merge, manually assigning this bug.
Assignee: bugzilla → mmkmou
Comment on attachment 8352500 [details] [diff] [review]
Add Online Help menu item to Help Menu V3-1

I'm removing the review request here because:
- the patch has bitrotted (the instantbird/ folder is named im/ in comm-central, the switch to MPL2 changed all license headers, ...)
- while the code here seems like it would do what the patch intends to do, I'm not sure the website is actually ready to receive users with useful information (and the website isn't translated to all locales that Instantbird is translated into). I'm sorry I haven't voiced this concern earlier.
Attachment #8352500 - Flags: review?(florian)
On the behalf of Florian:
Closing bugs related to the Instantbird UI as WONTFIX, as the development of the standalone chat client Instantbird has stopped. Instantbird users are encouraged to migrate to Thunderbird. The user interface of instant messaging in Thunderbird will feel familiar, as the Thunderbird IM support started as a fork of Instantbird.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.