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-toolbars.xul < prev    next >
Extensible Markup Language  |  2007-04-23  |  4KB  |  115 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
  3. <?xul-overlay href="chrome://kmprefs/content/kmprefs/ovrl-urlbar.xul"?>
  4. <?xul-overlay href="chrome://kmprefs/content/kplugins/layersbar.xul"?>
  5. <?xul-overlay href="chrome://kmprefs/content/kplugins/bookmarksbar.xul"?>
  6. <?xul-overlay href="chrome://kmprefs/content/kplugins/favoritesbar.xul"?>
  7. <?xul-overlay href="chrome://kmprefs/content/kplugins/hotlistbar.xul"?>
  8. <!DOCTYPE page SYSTEM "chrome://kmprefs/locale/pref-toolbars.dtd">
  9. <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
  10. id="prefToolbars" onload="init()">
  11.  
  12. <stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
  13.  
  14. <script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
  15. <script type="application/x-javascript">
  16. <![CDATA[
  17. function init() {
  18.     var kplugins = new Array("toolbars","rebarmenu");
  19.  
  20.     for(var j=0;j<kplugins.length;j++) {
  21.         document.getElementById("kmeleon.plugins."+kplugins[j]+".load").checked  = kPlugin.load(kplugins[j]);
  22.         document.getElementById("kmeleon.plugins."+kplugins[j]+".load").disabled = kPlugin.absent(kplugins[j]);
  23.     }
  24.     initTitle();
  25.     initMenu();
  26.     URLBarHeight.init();
  27.     kLayersBar.init();
  28.     kBookmarksBar.init();
  29.     kFavoritesBar.init();
  30.     kHotlistBar.init();
  31. }
  32. function initTitle() {
  33.     initTextbox("kmeleon.display.URLbarTitle",document.getElementById("pref_bundle").getString("toolbar_title_none"));
  34. }
  35.  
  36. // handle Menu Bar Visibility
  37. const menuImport1 = "user_pref(\"kmeleon.toolband.Menu.visibility\", ";
  38. const menuImport2 = ");";
  39. const menuRegExp1 = "user_pref[\\s]*\\([\\s]*.kmeleon.toolband.Menu.visibility.[\\s]*,[\\s]*";
  40. const menuRegExp2 = "[\\s]*\\)[\\s]*;";
  41. var menuImport = new Array(menuImport1+"false"+menuImport2,menuImport1+"true"+menuImport2);
  42. var menuRegExp = new Array(menuRegExp1+"false"+menuRegExp2,menuRegExp1+"true"+menuRegExp2);
  43. function initMenu() {
  44.     var txt = getFileContents(getFile(getFolder("ProfD"),UserPrefs));
  45.     var box = document.getElementById("kmeleon.toolband.Menu.visibility");
  46.  
  47.     if(testMultiline(txt,menuRegExp[0]))
  48.         box.checked = true;
  49.     else
  50.         if(testMultiline(txt,menuRegExp[1]))
  51.             box.checked = false;
  52.         else {
  53.             initCheckbox("kmeleon.toolband.Menu.visibility");
  54.             box.checked = !box.checked;
  55.         }
  56.     box.disabled = !kPlugin.load("rebarmenu");
  57. }
  58. function toggleMenu(elem) {
  59.     var fil = getFile(getFolder("ProfD"),UserPrefs);
  60.  
  61.     removeFromFile(fil,menuRegExp[0]);
  62.     removeFromFile(fil,menuRegExp[1]);
  63.  
  64.     if(elem.checked)
  65.         addToUserPrefs(menuImport[0]);
  66.     else
  67.         pref.setBoolPref(elem.id,true);
  68.     initMenu();
  69. }
  70. ]]>
  71. </script>
  72.  
  73. <vbox flex="1" style="overflow:auto">
  74.   <dialogheader title="&toolbars.header;"/>
  75.   <separator class="thin"/>
  76.   <tabcontrol flex="1">
  77.     <tabbox flex="1">
  78.       <tabs>
  79.         <tab label="&toolbars.general;"/>
  80.         <tab id="kLayersTBarTab"/>
  81.         <tab id="kBookmarksTBarTab"/>
  82.         <tab id="kFavoritesTBarTab"/>
  83.         <tab id="kHotlistTBarTab"/>
  84.       </tabs>
  85.       <tabpanels flex="1">
  86.         <tabpanel flex="1" orient="vertical" style="overflow:auto">
  87. <!-- Main Toolbar -->
  88. <separator class="thin"/>
  89. <checkbox oncommand="toggleCheckbox(this.id)" id="kmeleon.plugins.toolbars.load" label="&toolbars.enable;"/>
  90. <separator class="thin"/>
  91. <hbox align="center">
  92.   <description>&toolbars.URLBarTitle;</description>
  93.   <textbox id="kmeleon.display.URLbarTitle" flex="1" class="uri-element" oninput="setCharPref(this.id,this.value)"/>
  94.   <button label="&clear;" oncommand="pref.setCharPref(this.previousSibling.id,'');initTitle()"/>
  95.   <button label="&restoreDefault;" oncommand="restoreDefault(this.previousSibling.previousSibling.id);initTitle()"/>
  96. </hbox>
  97. <separator class="thin"/>
  98. <hbox id="urlbarheight"/>
  99. <separator class="thin"/>
  100. <checkbox oncommand="toggleCheckbox(this.id);this.nextSibling.disabled=!this.checked" id="kmeleon.plugins.rebarmenu.load" label="&toolbars.menuAsToolbar;"/>
  101. <checkbox oncommand="toggleMenu(this)" id="kmeleon.toolband.Menu.visibility" label="&toolbars.menuHide;" style="margin-left:2em"/>
  102. <separator class="thick"/>
  103. <description>&restartNote1;</description>
  104. <!-- Main Toolbar -->
  105.     </tabpanel>
  106.         <tabpanel id="kLayersTBar"/>
  107.         <tabpanel id="kBookmarksTBar"/>
  108.         <tabpanel id="kFavoritesTBar"/>
  109.         <tabpanel id="kHotlistTBar"/>
  110.       </tabpanels>
  111.     </tabbox>
  112.   </tabcontrol>
  113. </vbox>
  114.  
  115. </page>