Bug 537275 - Add some element IDs to navigator to assist porting of Firefox extensions.

r+sr=neil.
This commit is contained in:
Philip Chee 2010-01-04 01:21:43 +01:00
Родитель efa81243e1
Коммит cc33a3eace
3 изменённых файлов: 82 добавлений и 27 удалений

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

@ -323,8 +323,16 @@
<menuitem id="menu_newEditor" command="cmd_newEditor"/>
</menupopup>
</menu>
<menuitem label="&openCmd.label;" accesskey="&openCmd.accesskey;" key="openLocationKb" command="Browser:Open"/>
<menuitem label="&openFileCmd.label;" accesskey="&openFileCmd.accesskey;" key="openFileKb" command="Browser:OpenFile"/>
<menuitem id="menu_openLocation"
label="&openCmd.label;"
accesskey="&openCmd.accesskey;"
key="openLocationKb"
command="Browser:Open"/>
<menuitem id="menu_openFile"
label="&openFileCmd.label;"
accesskey="&openFileCmd.accesskey;"
key="openFileKb"
command="Browser:OpenFile"/>
<menu label="&recentTabs.label;" accesskey="&recentTabs.accesskey;" id="menu_recentTabs">
<menupopup id="menu_recentTabsPopup" onpopupshowing="updateRecentTabs(this);" oncommand="gBrowser.restoreTab(event.target.value);"/>
</menu>
@ -404,8 +412,15 @@
<menu id="menu_UseStyleSheet" label="&useStyleSheetMenu.label;" accesskey="&useStyleSheetMenu.accesskey;" disabled="false" observes="isImage">
<menupopup onpopupshowing="stylesheetFillPopup(this);"
oncommand="stylesheetSwitchAll(window.content, event.target.getAttribute('data')); setStyleDisabled(false);" type="radio">
<menuitem label="&useStyleSheetNone.label;" accesskey="&useStyleSheetNone.accesskey;" oncommand="setStyleDisabled(true); event.stopPropagation();" type="radio"/>
<menuitem label="&useStyleSheetPersistentOnly.label;" accesskey="&useStyleSheetPersistentOnly.accesskey;" type="radio"/>
<menuitem id="menu_pageStyleNoStyle"
label="&useStyleSheetNone.label;"
accesskey="&useStyleSheetNone.accesskey;"
oncommand="setStyleDisabled(true); event.stopPropagation();"
type="radio"/>
<menuitem id="menu_pageStylePersistentOnly"
label="&useStyleSheetPersistentOnly.label;"
accesskey="&useStyleSheetPersistentOnly.accesskey;"
type="radio"/>
</menupopup>
</menu>
<menu id="charsetMenu" observes="isImage"/>
@ -441,15 +456,40 @@
</menupopup>
</menu>
<menu accesskey="&goMenu.accesskey;" label="&goMenu.label;" oncommand="gotoHistoryIndex(event);">
<menupopup id="goPopup" onpopupshowing="updateGoMenu(event);">
<menuitem label="&goBackCmd.label;" accesskey="&goBackCmd.accesskey;" key="goBackKb" command="Browser:Back"/>
<menuitem label="&goForwardCmd.label;" accesskey="&goForwardCmd.accesskey;" key="goForwardKb" command="Browser:Forward"/>
<menuitem label="&goUpCmd.label;" accesskey="&goUpCmd.accesskey;" key="goUpKb" command="Browser:Up"/>
<menuitem label="&goHomeCmd.label;" accesskey="&goHomeCmd.accesskey;" command="Browser:Home" key="goHome"/>
<menu id="history-menu"
label="&goMenu.label;"
accesskey="&goMenu.accesskey;"
oncommand="gotoHistoryIndex(event);">
<menupopup id="goPopup"
onpopupshowing="updateGoMenu(event);">
<menuitem id="historyMenuBack"
label="&goBackCmd.label;"
accesskey="&goBackCmd.accesskey;"
key="goBackKb"
command="Browser:Back"/>
<menuitem id="historyMenuForward"
label="&goForwardCmd.label;"
accesskey="&goForwardCmd.accesskey;"
key="goForwardKb"
command="Browser:Forward"/>
<menuitem id="historyMenuUp"
label="&goUpCmd.label;"
accesskey="&goUpCmd.accesskey;"
key="goUpKb"
command="Browser:Up"/>
<menuitem id="historyMenuHome"
label="&goHomeCmd.label;"
accesskey="&goHomeCmd.accesskey;"
command="Browser:Home"
key="goHome"/>
<menuseparator/>
<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"/>
</menupopup>
</menu>

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

@ -78,13 +78,16 @@ function FillHistoryMenu(aParent, aMenu)
}
break;
case "go":
aParent.lastChild.hidden = (count == 0);
var startHistory = document.getElementById("startHistorySeparator");
var endHistory = document.getElementById("endHistorySeparator");
startHistory.hidden = (count == 0);
endHistory.hidden = (endHistory == aParent.lastChild);
end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0;
for (j = count - 1; j >= end; j--)
{
entry = sessionHistory.getEntryAtIndex(j, false);
if (entry)
createRadioMenuItem(aParent, j, entry.title, j==index);
createRadioMenuItem(aParent, endHistory, j, entry.title, j == index);
}
break;
}
@ -142,23 +145,23 @@ function createUBHistoryMenu( aParent )
na.setAttribute("disabled", "true");
}
function createMenuItem( aParent, aIndex, aLabel)
function createMenuItem(aParent, aIndex, aLabel)
{
var menuitem = document.createElement( "menuitem" );
menuitem.setAttribute( "label", aLabel );
menuitem.setAttribute( "index", aIndex );
aParent.appendChild( menuitem );
aParent.appendChild(menuitem);
}
function createRadioMenuItem( aParent, aIndex, aLabel, aChecked)
function createRadioMenuItem(aParent, aAnchor, aIndex, aLabel, aChecked)
{
var menuitem = document.createElement( "menuitem" );
menuitem.setAttribute( "type", "radio" );
menuitem.setAttribute( "label", aLabel );
menuitem.setAttribute( "index", aIndex );
if (aChecked==true)
menuitem.setAttribute( "checked", "true" );
aParent.appendChild( menuitem );
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("type", "radio");
menuitem.setAttribute("label", aLabel);
menuitem.setAttribute("index", aIndex);
if (aChecked)
menuitem.setAttribute("checked", "true");
aParent.insertBefore(menuitem, aAnchor);
}
function deleteHistoryItems(aParent)

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

@ -64,11 +64,23 @@
<menu id="menu_zoom" accesskey="&zoomMenu.accesskey;">
<menupopup id="menu_zoomPopup" onpopupshowing="updateZoomMenu();" oncommand="ZoomManager.prototype.getInstance().currentZoom = event.target.value;">
<menuitem key="key_zoomReduce" label="&zoomReduceCmd.label;" accesskey="&zoomReduceCmd.accesskey;" command="cmd_zoomReduce"/>
<menuitem key="key_zoomEnlarge" label="&zoomEnlargeCmd.label;" accesskey="&zoomEnlargeCmd.accesskey;" command="cmd_zoomEnlarge"/>
<menuitem id="menu_zoomReduce"
key="key_zoomReduce"
label="&zoomReduceCmd.label;"
accesskey="&zoomReduceCmd.accesskey;"
command="cmd_zoomReduce"/>
<menuitem id="menu_zoomEnlarge"
key="key_zoomEnlarge"
label="&zoomEnlargeCmd.label;"
accesskey="&zoomEnlargeCmd.accesskey;"
command="cmd_zoomEnlarge"/>
<menuseparator/>
<menuseparator id="menu_zoomInsertBefore"/>
<menuitem id="menu_zoomOther" type="radio" name="zoom" accesskey="&zoomOtherCmd.accesskey;" command="cmd_zoomOther"/>
<menuitem id="menu_zoomOther"
type="radio"
name="zoom"
accesskey="&zoomOtherCmd.accesskey;"
command="cmd_zoomOther"/>
</menupopup>
</menu>