home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
komunikace
/
kmeleon
/
K-Meleon1.1.3en-US.exe
/
chrome
/
embed.jar
/
kmprefs
/
content
/
pref-kbookmarks.xul
< prev
next >
Wrap
Extensible Markup Language
|
2007-04-23
|
9KB
|
225 lines
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<?xul-overlay href="chrome://kmprefs/content/kplugins/bookmarksbar.xul"?>
<?xul-overlay href="chrome://kmprefs/content/kplugins/booklistmanager.xul"?>
<!DOCTYPE page SYSTEM "chrome://kmprefs/locale/pref-kbookmarks.dtd">
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="prefBookmarks" onload="kBookmarks.init()">
<stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
<stringbundle id="brws_bundle" src="chrome://kmprefs/locale/pref-browsing.properties"/>
<script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
<script type="application/x-javascript">
<![CDATA[
var kBookmarks = {
_base: null,
_pref: null,
_bndl: null,
_url: null,
_mAD: null,
_mML: null,
load : null,
init : function() {
kLayers.init();
this.load = kPlugin.load("bookmarks");
this._base = "kmeleon.plugins.bookmarks.";
this._pref = new Array( "load",
"askforFolder");
this._url = this._base + "openurl";
this._mAD = this._base + "menuAutoDetect";
this._mML = this._base + "maxMenuLength";
this._bndl = document.getElementById("brws_bundle");
this._setControls();
document.getElementById("openURLInCurrent").label = this._bndl.getString(kLayers.load?"layer_current":"window_current");
document.getElementById("openURLInLayer" ).label = this._bndl.getString("layer_new");
document.getElementById("openURLInWindow" ).label = this._bndl.getString("window_new");
for(var j=0;j<this._pref.length;j++) initCheckbox(this._base+this._pref[j]);
kBookmarksBar.init();
kBooklistManager.init("bookmarks");
},
setLength: function(elemID,prefVal) {
var val = parseInt(prefVal);
if(prefVal)
if(isNaN(val) || val<0)
alert(document.getElementById("pref_bundle").getString("positive_integer_expected"));
else {
pref.setBoolPref(this._mAD,false);
// bug: Bookmarks menu disappears when kmeleon.plugins.bookmarks.maxMenuLength is in [1,7]
pref.setIntPref(this._mML,(val<8)?8:val);
}
else restoreDefault(elemID);
},
setOpen: function() {
pref.setCharPref(this._url,document.getElementById(this._url).value);
this._initOpen();
},
toggle: function() {
toggleCheckbox(this._base+this._pref[0]);
this.load = !this.load;
this._setControls();
kBookmarksBar._setControls();
kBooklistManager._setControls();
},
toggleForce: function(elem) {
pref.setBoolPref(this._mAD,!elem.checked);
elem.nextSibling.disabled = !elem.checked;
if(elem.nextSibling.value == 9999) elem.nextSibling.value = "";
elem.nextSibling.focus();
},
toggleOpen: function(chkBox) {
if(chkBox.checked)
pref.setCharPref(this._url,chkBox.id);
else
pref.setCharPref(this._url,chkBox.previousSibling.value);
this._initOpen();
},
toggleSpillover: function() {
var val = document.getElementById(this._mAD).value;
val = (val == "true") ? true : false;
pref.setBoolPref(this._mAD,val);
if(!val) pref.setIntPref(this._mML,9999);
this._initSpillover();
},
_initOpen: function() {
var grp = document.getElementById(this._url), val;
try {
val = pref.getCharPref(this._url);
} catch(e) {
if(this.load) for(var j=0,c=document.getElementById(this._url).childNodes;j<c.length;j++) c[j].setAttribute("disabled",true);
}
document.getElementById("layers(OpenURLBg)").checked = false;
document.getElementById("ID_OPEN_LINK_IN_BACKGROUND").checked = false;
switch(val) {
case "ID_OPEN_LINK" : grp.selectedIndex = 0; break;
case "layers(OpenURL)" : grp.selectedIndex = 1; break;
case "layers(OpenURLBg)" : grp.selectedIndex = 1; document.getElementById("layers(OpenURLBg)").checked = true; break;
case "ID_OPEN_LINK_IN_NEW_WINDOW": grp.selectedIndex = 2; break;
case "ID_OPEN_LINK_IN_BACKGROUND": grp.selectedIndex = 2; document.getElementById("ID_OPEN_LINK_IN_BACKGROUND").checked = true; break;
default : grp.selectedIndex =-1;
}
},
_initSpillover: function() {
var auto, grp = document.getElementById(this._mAD), val;
try {
auto = pref.getBoolPref(this._mAD);
} catch(e) {
grp.selectedIndex = -1;
for(var j=0,c=grp.childNodes;j<2;j++) c[j].setAttribute("disabled",true);
document.getElementById("force").disabled = true;
document.getElementById(this._mML).disabled = true;
return;
}
try {
val = pref.getIntPref(this._mML);
} catch(e) {
val = "";
}
document.getElementById(this._mML).value = val;
if(isNaN(val)) val = 0;
if(auto) {
grp.selectedIndex = 1;
document.getElementById("force").checked = false;
document.getElementById("force").disabled = false;
document.getElementById(this._mML).disabled = true;
} else {
grp.selectedIndex = (val == 9999) ? 0 : 1;
document.getElementById("force").checked = (val>7 && val<9999) ? true : false;
document.getElementById("force").disabled = (grp.selectedIndex == 0) ? true : false;
document.getElementById(this._mML).disabled = !document.getElementById("force").checked;
}
},
_setControls: function() {
if(this.load) {
disableAll(false);
this._initOpen();
this._initSpillover();
document.getElementById("openURLInLayer" ).disabled = !kLayers.load;
document.getElementById("layers(OpenURLBg)" ).disabled = !kLayers.load;
document.getElementById("openURLInWindow" ).disabled = kLayers.only;
document.getElementById("ID_OPEN_LINK_IN_BACKGROUND").disabled = kLayers.only;
} else {
this._initOpen();
this._initSpillover();
disableAll(true);
document.getElementById("force").disabled = true;
document.getElementById(this._mML).disabled = true;
}
document.getElementById(this._base+this._pref[0]).disabled = kPlugin.absent("bookmarks");
}
};
]]>
</script>
<vbox flex="1" style="overflow:auto">
<dialogheader title="&bookmarks.header;"/>
<separator class="thin"/>
<checkbox oncommand="kBookmarks.toggle()" id="kmeleon.plugins.bookmarks.load" label="&bookmarks.enable;"/>
<separator class="thin"/>
<checkbox oncommand="toggleCheckbox(this.id)" id="kmeleon.plugins.bookmarks.askforFolder" label="&bookmarks.askforFolder;"/>
<vbox id="kBookmarksLoad"/>
<separator class="thick"/>
<tabcontrol flex="1">
<tabbox flex="1">
<tabs>
<tab id="kBookmarksMenuTab" label="&bookmarks.menu;"/>
<tab id="kBookmarksTBarTab"/>
<tab id="kBooklistManagTab" label="&bookmarks.manager;"/>
</tabs>
<tabpanels flex="1">
<tabpanel flex="1" orient="vertical" style="overflow:auto">
<separator class="thin"/>
<!-- Bookmarks Menu -->
<hbox>
<groupbox flex="1">
<caption label="&bookmarks.open;"/>
<separator class="thin"/>
<radiogroup id="kmeleon.plugins.bookmarks.openurl">
<radio oncommand="kBookmarks.setOpen()" value="ID_OPEN_LINK" id="openURLInCurrent"/>
<radio oncommand="kBookmarks.setOpen()" value="layers(OpenURL)" id="openURLInLayer"/>
<checkbox oncommand="kBookmarks.toggleOpen(this)" id="layers(OpenURLBg)" label="&inBackground;" style="margin-left:2em"/>
<radio oncommand="kBookmarks.setOpen()" value="ID_OPEN_LINK_IN_NEW_WINDOW" id="openURLInWindow"/>
<checkbox oncommand="kBookmarks.toggleOpen(this)" id="ID_OPEN_LINK_IN_BACKGROUND" label="&inBackground;" style="margin-left:2em"/>
</radiogroup>
<separator class="thin"/>
</groupbox>
<groupbox flex="1">
<caption label="&spillover.label;"/>
<separator class="thin"/>
<description>&spillover.descr;</description>
<radiogroup id="kmeleon.plugins.bookmarks.menuAutoDetect">
<radio oncommand="kBookmarks.toggleSpillover()" value="false" label="&spillover.arrows;"/>
<radio oncommand="kBookmarks.toggleSpillover()" value="true" label="&spillover.submenu;"/>
<hbox align="center">
<checkbox oncommand="kBookmarks.toggleForce(this)" id="force" label="&spillover.forceBefore;" style="margin-left:2em"/>
<textbox id="kmeleon.plugins.bookmarks.maxMenuLength" size="4" class="uri-element" oninput="kBookmarks.setLength(this.id,this.value)"/>
<label value="&spillover.forceAfter;"/>
</hbox>
</radiogroup>
</groupbox>
</hbox>
<separator class="thick"/>
<description>&restartNote2;</description>
<!-- Bookmarks Menu -->
</tabpanel>
<tabpanel id="kBookmarksTBar"/>
<tabpanel id="kBooklistManag"/>
</tabpanels>
</tabbox>
</tabcontrol>
</vbox>
</page>