Last Comment Bug 537275 - Add some element IDs to navigator to assist porting of Firefox extensions.
: Add some element IDs to navigator to assist porting of Firefox extensions.
Status: RESOLVED FIXED
compat-fx
:
Product: SeaMonkey
Classification: Client Software
Component: UI Design (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: seamonkey2.1a1
Assigned To: Philip Chee
:
Mentors:
: 528814 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-30 07:52 PST by Philip Chee
Modified: 2010-01-03 19:55 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch v1.0 (11.39 KB, patch)
2009-12-30 08:06 PST, Philip Chee
neil: review+
neil: superreview+
Details | Diff | Review
Patch v1.1 Fix whitespace nits. r=neil sr=neil [Checkin: Comment 8] (11.64 KB, patch)
2010-01-03 11:40 PST, Philip Chee
philip.chee: review+
philip.chee: superreview+
Details | Diff | Review

Description Philip Chee 2009-12-30 07:52:25 PST
Sync some element IDs from browser.xul to make it easier for Firefox extensions to overlay SeaMonkey.
Comment 1 Philip Chee 2009-12-30 08:06:31 PST
Created attachment 419575 [details] [diff] [review]
Patch v1.0

+        <menuitem id="historyMenuUp" 
Firefox doesn't have this menu item, but for consistency I'm adding one to all the menu items in this area.

-        <menuitem label="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/>
-        <menuseparator hidden="true"/>
+        <menuitem id="menu_showAllHistory"
+                  label="&historyCmd.label;"
+                  accesskey="&historyCmd.accesskey;"
+                  oncommand="toHistory()"
+                  key="key_gotoHistory"/>

+        <menuseparator id="startHistorySeparator" hidden="true"/>
+        <menuseparator id="endHistorySeparator" hidden="true"/>
Several Firefox extensions use insertbefore/insertafter these menuseparators in their overlays.

-          aParent.lastChild.hidden = (count == 0);
If an extension appends a menu item to the Go menu, this logic hides the wrong menu item.

+          var startHistory = document.getElementById("startHistorySeparator");
+          var endHistory = document.getElementById("endHistorySeparator");
+          startHistory.hidden = (count == 0);
+          endHistory.hidden = (endHistory == aParent.lastChild);
Comment 2 Philip Chee 2009-12-30 08:11:29 PST
-function createMenuItem( aParent, aIndex, aLabel)
+function createMenuItem(aParent, aIndex, aLabel)

-function createRadioMenuItem( aParent, aIndex, aLabel, aChecked)
+function createRadioMenuItem( aParent, aAnchor, aIndex, aLabel, aChecked)

Aargh. I'll fix these whitespace nits in the next patch after reviews.
Comment 3 Philip Chee 2010-01-02 03:06:30 PST
*** Bug 528814 has been marked as a duplicate of this bug. ***
Comment 4 neil@parkwaycc.co.uk 2010-01-02 14:15:10 PST
Comment on attachment 419575 [details] [diff] [review]
Patch v1.0

>+                createRadioMenuItem(aParent, endHistory, j, entry.title, j==index);
Speaking of spacing nits, might as well fix the spacing around the ==

>     if (aChecked==true)
And if you're fixing all the spacing anyway, then this can be improved!
Comment 5 neil@parkwaycc.co.uk 2010-01-03 07:10:42 PST
Comment on attachment 419575 [details] [diff] [review]
Patch v1.0

Bah, after all that, I forgot to tick the boxes...
Comment 6 Philip Chee 2010-01-03 11:40:18 PST
Created attachment 419830 [details] [diff] [review]
Patch v1.1 Fix whitespace nits. r=neil sr=neil
[Checkin: Comment 8]

> (From update of attachment 419575 [details] [diff] [review])
>>+                createRadioMenuItem(aParent, endHistory, j, entry.title, j==index);
> Speaking of spacing nits, might as well fix the spacing around the ==
Fixed.

>>     if (aChecked==true)
> And if you're fixing all the spacing anyway, then this can be improved!
Fixed. Plus a few more whitespace nits around this line.
Comment 8 Serge Gautherie (:sgautherie) 2010-01-03 16:26:28 PST
Comment on attachment 419830 [details] [diff] [review]
Patch v1.1 Fix whitespace nits. r=neil sr=neil
[Checkin: Comment 8]


http://hg.mozilla.org/comm-central/rev/78e022d07edc

Note You need to log in before you can comment on or make changes to this bug.