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-display.xul < prev    next >
Extensible Markup Language  |  2007-04-23  |  6KB  |  131 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-javascript.xul"?>
  4. <!DOCTYPE page SYSTEM "chrome://kmprefs/locale/pref-display.dtd">
  5. <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
  6. id="prefDisplay" onload="init()">
  7.  
  8. <stringbundle id="pref_bundle" src="chrome://kmprefs/locale/pref.properties"/>
  9. <stringbundle id="dspl_bundle" src="chrome://kmprefs/locale/pref-display.properties"/>
  10.  
  11. <script type="application/x-javascript" src="chrome://kmprefs/content/pref.js"/>
  12. <script type="application/x-javascript">
  13. <![CDATA[
  14. function init() {
  15.     kLayers.init();
  16.     document.getElementById("browser.frames.enabled").label = document.getElementById("dspl_bundle").getString((kLayers.load)?((kLayers.only)?"layers":"windows_layers"):"windows");
  17.  
  18.     for(var j=0,b=document.getElementsByTagName("checkbox");j<b.length;j++)
  19.         if(b[j].getAttribute("id") == "CSS")
  20.             b[j].checked = testMultiline(getFileContents(getFile(getFolder("UChrm"),UserStyle)),brokenRegExp);
  21.         else
  22.         if(b[j].getAttribute("id") == "Marquee")
  23.             b[j].checked = testMultiline(getFileContents(getFile(getFolder("UChrm"),UserStyle)),marqueeRegExp);
  24.         else
  25.             initCheckbox(b[j].getAttribute("id"));
  26.     for(var j=0,r=document.getElementsByTagName("radiogroup");j<r.length-1;j++)
  27.         initRadiogroup(r[j].getAttribute("id"));
  28.     setInterval("initCheckbox('browser.frames.enabled');initRadiogroup('image.animation_mode');initRadiogroup('permissions.default.image')",100);
  29. }
  30.  
  31. // handle Marquee
  32. const marqueeImport = "marquee { -moz-binding: none; }";
  33. const marqueeRegExp = "marquee[\\s]*\\{[\\s]*-moz-binding:[\\s]*none[\\s]*;[\\s]*\\}";
  34. function toggleMarquee(elem) {
  35.     if(elem.checked)
  36.         addToUserStyle(marqueeImport);
  37.     else
  38.         removeFromFile(getFile(getFolder("UChrm"),UserStyle),marqueeRegExp);
  39. }
  40.  
  41. // handle Broken Images
  42. const brokenImport = "img { -moz-force-broken-image-icon: 1; }";
  43. const brokenRegExp = "img[\\s]*\\{[\\s]*-moz-force-broken-image-icon:[\\s]*1[\\s]*;[\\s]*\\}";
  44. const brokenElmnts = [    "browser.display.show_image_placeholders",
  45.             "browser.display.force_inline_alttext",
  46.             "CSS"];
  47. function toggleBroken(elem) {
  48.     switch(elem.id) {
  49.         case brokenElmnts[0] :    toggleCheckbox(brokenElmnts[0]); if(document.getElementById(brokenElmnts[1]).checked) toggleCheckbox(brokenElmnts[1]); init(); break;
  50.         case brokenElmnts[1] :    toggleCheckbox(brokenElmnts[1]); if(document.getElementById(brokenElmnts[0]).checked) toggleCheckbox(brokenElmnts[0]);
  51.                     removeFromFile(getFile(getFolder("UChrm"),UserStyle),brokenRegExp); init(); break;
  52.         case brokenElmnts[2] :    if(document.getElementById(brokenElmnts[2]).checked) {
  53.                         if(document.getElementById(brokenElmnts[1]).checked) toggleCheckbox(brokenElmnts[1]);
  54.                         addToUserStyle(brokenImport);
  55.                     } else
  56.                         removeFromFile(getFile(getFolder("UChrm"),UserStyle),brokenRegExp);
  57.                     init(); break;
  58.     }
  59. }
  60. ]]>
  61. </script>
  62.  
  63. <vbox flex="1" style="overflow:auto">
  64.   <dialogheader title="&display.header;"/>
  65.   <separator class="thin"/>
  66.   <tabcontrol flex="1">
  67.     <tabbox flex="1">
  68.       <tabs>
  69.         <tab label="&general;"/>
  70.         <tab label="&images.label;"/>
  71.       </tabs>
  72.       <tabpanels flex="1">
  73.         <tabpanel flex="1" orient="vertical" style="overflow:auto">
  74. <!-- General Display -->
  75. <separator class="thin"/>
  76. <groupbox>
  77.   <caption label="&frames.label;"/>
  78.   <checkbox oncommand="toggleCheckbox(this.id)" id="browser.frames.enabled"/>
  79.   <checkbox oncommand="toggleCheckbox(this.id)" id="layout.frames.force_resizability" label="&frames.resizable;"/>
  80. </groupbox>
  81. <separator class="thin"/>
  82. <groupbox>
  83.   <caption label="&text.label;"/>
  84.   <checkbox oncommand="toggleCheckbox(this.id)" id="browser.blink_allowed" label="&text.blink;"/>
  85.   <checkbox oncommand="toggleMarquee(this)" id="Marquee" label="&text.marquee;"/>
  86.   <description>&marquee.note;</description>
  87. </groupbox>
  88. <!-- General Display -->
  89.     </tabpanel>
  90.         <tabpanel flex="1" orient="vertical" style="overflow:auto">
  91. <!-- Images Display -->
  92. <separator class="thin"/>
  93. <hbox>
  94.   <groupbox flex="1">
  95.     <caption label="&images.load;"/>
  96.     <radiogroup oncommand="toggleRadiogroup(this.id)" id="permissions.default.image">
  97.       <radio disabled="true" value="2" label="&images.load.never;"/>
  98.       <radio disabled="true" value="1" label="&images.load.always;"/>
  99.       <radio disabled="true" value="3" label="&images.load.noForeign;"/>
  100.     </radiogroup>
  101.   </groupbox>
  102.   <groupbox flex="1">
  103.     <caption label="&images.loop;"/>
  104.     <radiogroup oncommand="toggleRadiogroup(this.id)" id="image.animation_mode">
  105.       <radio value="none" label="&images.loop.none;"/>
  106.       <radio value="normal" label="&images.loop.normal;"/>
  107.       <radio value="once" label="&images.loop.once;"/>
  108.     </radiogroup>
  109.   </groupbox>
  110. </hbox>
  111. <separator class="thin"/>
  112. <checkbox oncommand="toggleCheckbox(this.id)" id="browser.enable_automatic_image_resizing" label="&images.resizing;"/>
  113. <separator class="thin"/>
  114. <vbox id="domDISS"/>
  115. <separator class="thin"/>
  116. <groupbox>
  117.   <caption label="&images.missing;"/>
  118.   <checkbox oncommand="toggleBroken(this)" id="browser.display.show_image_placeholders" label="&images.placeholders;"/>
  119.   <checkbox oncommand="toggleBroken(this)" id="browser.display.force_inline_alttext" label="&images.inline.force;"/>
  120.   <description>&images.inline.note;</description>
  121.   <checkbox oncommand="toggleBroken(this)" id="CSS" label="&images.block.force;"/>
  122.   <description>&restartNote1;</description>
  123. </groupbox>
  124. <!-- Images Display -->
  125.     </tabpanel>
  126.       </tabpanels>
  127.     </tabbox>
  128.   </tabcontrol>
  129. </vbox>
  130.  
  131. </page>