Bug 201177: Need to add pref UI to control new tab/window behaviour. r=Neil, sr=jag/hewitt, a=Asa

This commit is contained in:
jaggernaut%netscape.com 2003-04-25 01:25:56 +00:00
parent c229503ea5
commit bd58e58412
3 changed files with 63 additions and 11 deletions

View File

@ -248,6 +248,8 @@ function init()
gData.navigatorData = navigatorData;
setPageAccessKeys(document.getElementById("behaviourDeck").firstChild);
prefWindow.registerOKCallbackFunc(doOnOk);
}
@ -293,3 +295,24 @@ function doOnOk()
prefWindow.setPref("int", countPref, URIs.length);
}
function setPageAccessKeys(group)
{
var nodes = group.childNodes;
for (var i = 0; i < nodes.length; ++i)
nodes[i].setAttribute("accesskey", nodes[i].getAttribute("ak"));
}
function removePageAccessKeys(group)
{
var nodes = group.childNodes;
for (var i = 0; i < nodes.length; ++i)
nodes[i].removeAttribute("accesskey");
}
function switchPage(index)
{
var deck = document.getElementById("behaviourDeck");
removePageAccessKeys(deck.selectedPanel);
deck.selectedIndex = index;
setPageAccessKeys(deck.selectedPanel);
}

View File

@ -37,21 +37,44 @@
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["startupPage", "bookmarksButton",
"goButton", "homeButton",
var _elementIDs = ["startupPage", "newWinPage", "newTabPage",
"bookmarksButton", "goButton", "homeButton",
"printButton", "searchButton" ];
]]>
</script>
<hbox id="pref-nav-platform-extensions">
<!-- navigator starts with -->
<!-- navigator startup / new window / new tab behaviour -->
<groupbox flex="1">
<caption label="&navRadio;"/>
<radiogroup id="startupPage" prefstring="browser.startup.page">
<radio value="0" label="&blankPageRadio.label;" accesskey="&blankPageRadio.accesskey;"/>
<radio value="1" label="&homePageRadio.label;" accesskey="&homePageRadio.accesskey;"/>
<radio value="2" label="&lastPageRadio.label;" accesskey="&lastPageRadio.accesskey;"/>
</radiogroup>
<caption align="center">
<label value="&navRadio;" control="selectDisplayOn"/>
<menulist id="selectDisplayOn" oncommand="switchPage(this.selectedIndex);">
<menupopup>
<menuitem label="&navStartPageMenu.label;"/>
<menuitem label="&newWinPageMenu.label;"/>
<menuitem label="&newTabPageMenu.label;"/>
</menupopup>
</menulist>
</caption>
<deck id="behaviourDeck" flex="1">
<radiogroup id="startupPage" prefstring="browser.startup.page">
<radio value="0" label="&blankPageRadio.label;" ak="&blankPageRadio.accesskey;"/>
<radio value="1" label="&homePageRadio.label;" ak="&homePageRadio.accesskey;"/>
<radio value="2" label="&lastPageRadio.label;" ak="&lastPageRadio.accesskey;"/>
</radiogroup>
<radiogroup id="newWinPage" prefstring="browser.windows.loadOnNewWindow">
<radio value="0" label="&blankPageRadio.label;" ak="&blankPageRadio.accesskey;"/>
<radio value="1" label="&homePageRadio.label;" ak="&homePageRadio.accesskey;"/>
<radio value="2" label="&lastPageRadio.label;" ak="&lastPageRadio.accesskey;"/>
<radio value="-1" label="&startPageRadio.label;" ak="&startPageRadio.accesskey;"/>
</radiogroup>
<radiogroup id="newTabPage" prefstring="browser.tabs.loadOnNewTab">
<radio value="0" label="&blankPageRadio.label;" ak="&blankPageRadio.accesskey;"/>
<radio value="1" label="&homePageRadio.label;" ak="&homePageRadio.accesskey;"/>
<radio value="2" label="&lastPageRadio.label;" ak="&lastPageRadio.accesskey;"/>
<radio value="-1" label="&startPageRadio.label;" ak="&startPageRadio.accesskey;"/>
</radiogroup>
</deck>
</groupbox>
</hbox>

View File

@ -1,12 +1,18 @@
<!ENTITY lHeader "Navigator">
<!ENTITY navRadio "When Navigator starts up, display">
<!ENTITY navRadio "Display on">
<!ENTITY navStartPageMenu.label "Navigator Startup">
<!ENTITY newWinPageMenu.label "New Window">
<!ENTITY newTabPageMenu.label "New Tab">
<!ENTITY blankPageRadio.label "Blank page">
<!ENTITY blankPageRadio.accesskey "n">
<!ENTITY blankPageRadio.accesskey "B">
<!ENTITY homePageRadio.label "Home page">
<!ENTITY homePageRadio.accesskey "H">
<!ENTITY lastPageRadio.label "Last page visited">
<!ENTITY lastPageRadio.accesskey "L">
<!ENTITY startPageRadio.label "Navigator startup page">
<!ENTITY startPageRadio.accesskey "N">
<!ENTITY header2.label "Home Page">
<!ENTITY homePageIntro.label "Clicking the Home button takes you to this page or group of pages.">