home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1998 April
/
VPR9804B.ISO
/
Netscape
/
NETCAST.Z
/
ncjs10.jar
/
layout.js
< prev
next >
Wrap
Text File
|
1997-09-03
|
2KB
|
75 lines
/*
* layout.js
*
* Copyright (c) 1997 Netscape Communications Corporation, All Rights Reserved
*
* Functions that manage the options->layout preference panel
*/
function fillDefaultList(theForm, category, selector) {
var channelArray = selector.parent.titlebar.document.demo.getData(category);
var curOption;
var channelArrayLength;
var chanPrefsName;
var defaultChannelName = depth.GetNetscapePref("netcaster.defaultChannel", "", false);
var defaultChannelIndex = -1;
if ( null == channelArray ) {
channelArrayLength = 0;
for (i = 0; i < theForm.defaultChannel.length; i++) {
if (i==0) {
theForm.defaultChannel.options[i].text = "(No channels)";
defaultChannelIndex = -1;
} else {
theForm.defaultChannel.options[i] = null;
}
}
} else
channelArrayLength = channelArray.length;
for (i = 0; i < channelArrayLength; i++)
{
chanPrefsName = channelArray[i].getPrefsName();
if ((defaultChannelName != "") && (chanPrefsName == defaultChannelName)) {
defaultChannelIndex = i;
}
curOption = new Option(channelArray[i].getItemName());
curOption.prototype = channelArray[i];
theForm.defaultChannel.options[i] = curOption;
}
if (defaultChannelIndex == -1) {
theForm.onDefault[0].checked = true;
theForm.defaultChannel.selectedIndex = 0;
} else {
theForm.onDefault[1].checked = true;
theForm.defaultChannel.selectedIndex = defaultChannelIndex;
}
}
function loadValues()
{
var drawerDock = depth.GetNetscapePref("netcaster.drawer.dock", "right", false);
if (drawerDock == "left") {
document.layout_form.drawerPos.selectedIndex = 1;
} else {
document.layout_form.drawerPos.selectedIndex = 0;
}
var drawerHide = depth.GetNetscapePref("netcaster.drawer.autoHide", "true", false);
if (drawerHide == "false") {
document.layout_form.autoHide.checked = false;
} else {
document.layout_form.autoHide.checked = true;
}
fillDefaultList(document.layout_form, depth.getDefaultContainer(), opener);
window.layoutLoaded = true;
}
void(0);