backing out earlier changes to fix 121054, to address pageload spike

This commit is contained in:
ben%netscape.com 2006-07-29 05:40:14 +00:00
Родитель 4cfcf9b20b
Коммит 33fbd826c4
3 изменённых файлов: 36 добавлений и 2 удалений

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

@ -48,6 +48,35 @@ function enableHistory() {
gDisableHistory = false;
}
function toHistory()
{
// Use a single sidebar history dialog
var cwindowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var iwindowManager = Components.interfaces.nsIWindowMediator;
var windowManager = cwindowManager.QueryInterface(iwindowManager);
var historyWindow = windowManager.getMostRecentWindow('history:manager');
if (historyWindow) {
//debug("Reuse existing history window");
historyWindow.focus();
} else {
//debug("Open a new history dialog");
if (true == gDisableHistory) {
//debug("Recently opened one. Wait a little bit.");
return;
}
gDisableHistory = true;
window.open( "chrome://communicator/content/history/history.xul", "_blank",
"chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar" );
setTimeout(enableHistory, 2000);
}
}
function toJavaScriptConsole()
{
toOpenWindowByType("global:console", "chrome://global/content/console.xul");

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

@ -19,6 +19,8 @@
<key id="key_navigator" key="&navigatorCmd.commandkey;" command="Tasks:Navigator" modifiers="accel"/>
<key id="key_editor" key="&editorCmd.commandkey;" command="Tasks:Editor" modifiers="accel"/>
<!-- Tools Menu -->
<key id="key_gotoHistory" key="&history.commandKey;" oncommand="toHistory();" modifiers="accel"/>
</keyset>
<commandset id="tasksCommands">
<command id="Tasks:Navigator" oncommand="toNavigator();"/>
@ -31,8 +33,7 @@
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#KeyIndex rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="ShowWindowFromResource(event.target)" accesskey="rdf:http://home.netscape.com/NC-rdf#KeyIndex"/>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
@ -54,6 +55,7 @@
<menu label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menupopup id="toolsPopup" onpopupshowing="javaItemEnabling();">
<menuitem label="&historyCmd.label;" accesskey="&historyCmd.accesskey;" oncommand="toHistory()" key="key_gotoHistory"/>
<menuitem label="&importUtilCmd.label;" accesskey="&importUtilCmd.accesskey;" oncommand="toImport()"/>
<menuitem id="java" label="&javaConsoleCmd.label;" accesskey="&javaConsoleCmd.accesskey;" oncommand="toJavaConsole()"/>
<menuitem label="&javaScriptConsoleCmd.label;" accesskey="&javaScriptConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>

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

@ -12,6 +12,9 @@
<!ENTITY toolsMenu.label "Tools">
<!ENTITY toolsMenu.accesskey "t">
<!ENTITY historyCmd.label "History">
<!ENTITY historyCmd.accesskey "h">
<!ENTITY history.commandKey "h">
<!ENTITY securityInfoCmd.label ".Security Info">
<!ENTITY securityInfoCmd.accesskey "s">
<!ENTITY importUtilCmd.label "Import Utility">