home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 December / PCWorld_2000-12_cd.bin / Komunikace / mozilla / mozilla-win32-M18-mathml-svg-xslt.exe / res / samples / dexopenchrome.xul < prev    next >
Extensible Markup Language  |  2000-06-15  |  6KB  |  182 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE window>
  3. <!-- DO NOT LOCALIZE: this file is source documentation; not part of the build -->
  4. <!-- Sample interface for bringing up and passing parameters to a dialog -->
  5. <xul:window
  6.     xmlns:html="http://www.w3.org/1999/xhtml"
  7.     xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  8.     title = "Chrome Features Test">
  9.  
  10.   <html:script>
  11.     <![CDATA[
  12.     var featureList = new Array("all",
  13.                         "close", "titlebar", "resizable", "scrollbars",
  14.                         "menubar", "toolbar", "status", "location",
  15.                         "chrome", "dialog", "modal", "dependent",
  16.                         "centerscreen",
  17.                         "alwaysLowered", "alwaysRaised");
  18.  
  19.     function OpenWindow(extension) {
  20.       var features = CalculateFeatures();
  21.       dump("******* begin open window\n");
  22.       window.open("dexparamdialog."+extension, "_blank", features);
  23.       dump("******* end open window\n");
  24.     }
  25.     function OpenDialog(extension) {
  26.       var features = CalculateFeatures();
  27.       dump("******* begin opendialog\n");
  28.       window.openDialog("dexparamdialog."+extension, "_blank", features,
  29.                         {remind:true});
  30.       dump("******* end opendialog\n");
  31.     }
  32.     function CalculateFeatures() {
  33.       var ctr;
  34.       var features;
  35.       var element;
  36.  
  37.       features = "";
  38.  
  39.       // read checkboxes
  40.       for (ctr = 0; ctr < featureList.length; ctr++) {
  41.         element = document.getElementById(featureList[ctr]);
  42.         if (element.checked) {
  43.           if (features.length > 0)
  44.             features = features + ",";
  45.           features = features + featureList[ctr];
  46.         } else {
  47.           element = document.getElementById(featureList[ctr]+"-ex");
  48.           if (element && element.checked) { // titlebar, close, dialog
  49.             if (features.length > 0)
  50.               features = features + ",";
  51.             features = features + featureList[ctr] + "=no";
  52.           }
  53.         }
  54.       }
  55.       dump("******* " + features + "\n");
  56.       return features;
  57.     }
  58.     ]]>
  59.   </html:script>
  60.  
  61. <!--  <html:div> -->
  62.  
  63.   <html:table>
  64.     <html:tr>
  65.       <html:td>
  66.         <html:input type="checkbox" id="all"/>all
  67.       </html:td><html:td>
  68.         <html:input type="checkbox" id="all-ex"/>explicit
  69.       </html:td>
  70.     </html:tr>
  71.     <html:tr>
  72.       <html:td>
  73.         <html:input type="checkbox" id="close"/>close
  74.       </html:td><html:td>
  75.         <html:input type="checkbox" id="close-ex"/>explicit
  76.       </html:td>
  77.     </html:tr>
  78.     <html:tr>
  79.       <html:td>
  80.         <html:input type="checkbox" id="titlebar"/>titlebar
  81.       </html:td><html:td>
  82.         <html:input type="checkbox" id="titlebar-ex"/>explicit
  83.       </html:td>
  84.     </html:tr>
  85.     <html:tr>
  86.       <html:td>
  87.         <html:input type="checkbox" id="resizable"/>resizable
  88.       </html:td>
  89.     </html:tr>
  90.     <html:tr>
  91.       <html:td>
  92.         <html:input type="checkbox" id="scrollbars"/>scrollbars
  93.       </html:td>
  94.     </html:tr>
  95.     <html:tr>
  96.       <html:td>
  97.         <html:input type="checkbox" id="alwaysRaised"/>raised
  98.       </html:td>
  99.     </html:tr>
  100.     <html:tr>
  101.       <html:td>
  102.         <html:input type="checkbox" id="alwaysLowered"/>lowered
  103.       </html:td>
  104.     </html:tr>
  105.     <html:tr>
  106.       <html:td>
  107.         <html:input type="checkbox" id="menubar"/>menubar
  108.       </html:td>
  109.     </html:tr>
  110.     <html:tr>
  111.       <html:td>
  112.         <html:input type="checkbox" id="toolbar"/>toolbar
  113.       </html:td>
  114.     </html:tr>
  115.     <html:tr>
  116.       <html:td>
  117.         <html:input type="checkbox" id="status"/>status
  118.       </html:td>
  119.     </html:tr>
  120.     <html:tr>
  121.       <html:td>
  122.         <html:input type="checkbox" id="location"/>location
  123.       </html:td>
  124.     </html:tr>
  125.     <html:tr>
  126.       <html:td>
  127.         <html:input type="checkbox" id="chrome"/>chrome
  128.       </html:td>
  129.     </html:tr>
  130.     <html:tr>
  131.       <html:td>
  132.         <html:input type="checkbox" id="dialog"/>dialog
  133.       </html:td><html:td>
  134.         <html:input type="checkbox" id="dialog-ex"/>explicit
  135.       </html:td>
  136.     </html:tr>
  137.     <html:tr>
  138.       <html:td>
  139.         <html:input type="checkbox" id="modal"/>modal
  140.       </html:td>
  141.     </html:tr>
  142.     <html:tr>
  143.       <html:td>
  144.         <html:input type="checkbox" id="dependent"/>dependent
  145.       </html:td>
  146.     </html:tr>
  147.     <html:tr>
  148.       <html:td>
  149.         <html:input type="checkbox" id="centerscreen"/>centered
  150.       </html:td>
  151.     </html:tr>
  152.   </html:table>
  153.   <html:table>
  154.     <html:tr>
  155.       <html:td colspan="2">
  156.         <html:center>Open</html:center>
  157.       </html:td>
  158.     </html:tr>
  159.     <html:tr>
  160.       <html:td>
  161.         <xul:titledbutton value="HTML Window" onclick="OpenWindow('html')"
  162.                           style="background-color:rgb(192,192,192);"/>
  163.       </html:td>
  164.       <html:td>
  165.         <xul:titledbutton value="XUL Window" onclick="OpenWindow('xul')"
  166.                           style="background-color:rgb(192,192,192);"/>
  167.       </html:td>
  168.     </html:tr>
  169.     <html:tr>
  170.       <html:td>
  171.         <xul:titledbutton value="HTML Dialog" onclick="OpenDialog('html')"
  172.                           style="background-color:rgb(192,192,192);"/>
  173.       </html:td>
  174.       <html:td>
  175.         <xul:titledbutton value="XUL Dialog" onclick="OpenDialog('xul')"
  176.                           style="background-color:rgb(192,192,192);"/>
  177.       </html:td>
  178.     </html:tr>
  179.   </html:table>
  180. <!--  </html:div> -->
  181. </xul:window>
  182.