RetroZilla/xpfe/browser/samples/dexopenchrome.xul

154 lines
4.2 KiB
Plaintext
Raw Normal View History

2015-10-21 05:03:22 +02:00
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<!DOCTYPE window>
<!-- DO NOT LOCALIZE: this file is source documentation; not part of the build -->
<!-- Sample interface for bringing up and passing parameters to a dialog -->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
orient="horizontal"
title = "Chrome Features Test">
<script>
<![CDATA[
var featureList = new Array("all",
"close", "titlebar", "resizable", "scrollbars",
"menubar", "toolbar", "status", "location",
"chrome", "dialog", "modal", "dependent",
"centerscreen",
"alwaysLowered", "alwaysRaised");
function OpenWindow(extension) {
var features = CalculateFeatures();
dump("******* begin open window\n");
window.open("dexparamdialog."+extension, "_blank", features);
dump("******* end open window\n");
}
function OpenDialog(extension) {
var features = CalculateFeatures();
dump("******* begin opendialog\n");
window.openDialog("dexparamdialog."+extension, "_blank", features,
{remind:true});
dump("******* end opendialog\n");
}
function CalculateFeatures() {
var ctr;
var features;
var element;
features = "";
// read checkboxes
for (ctr = 0; ctr < featureList.length; ctr++) {
element = document.getElementById(featureList[ctr]);
if (element.checked) {
if (features.length > 0)
features = features + ",";
features = features + featureList[ctr];
} else {
element = document.getElementById(featureList[ctr]+"-ex");
if (element && element.checked) { // titlebar, close, dialog
if (features.length > 0)
features = features + ",";
features = features + featureList[ctr] + "=no";
}
}
}
dump("******* " + features + "\n");
return features;
}
]]>
</script>
<vbox>
<grid>
<columns><column/><column/></columns>
<rows>
<row>
<checkbox id="all" label="all"/>
<checkbox id="all-ex" label="explicit"/>
</row>
<row>
<checkbox id="close" label="close"/>
<checkbox id="close-ex" label="explicit"/>
</row>
<row>
<checkbox id="titlebar" label="titlebar"/>
<checkbox id="titlebar-ex" label="explicit"/>
</row>
<row>
<checkbox id="resizable" label="resizable"/>
<spacer/>
</row>
<row>
<checkbox id="scrollbars" label="scrollbars"/>
<spacer/>
</row>
<row>
<checkbox id="alwaysRaised" label="raised"/>
<spacer/>
</row>
<row>
<checkbox id="alwaysLowered" label="lowered"/>
<spacer/>
</row>
<row>
<checkbox id="menubar" label="menubar"/>
<spacer/>
</row>
<row>
<checkbox id="toolbar" label="toolbar"/>
<spacer/>
</row>
<row>
<checkbox id="status" label="status"/>
<spacer/>
</row>
<row>
<checkbox id="location" label="location"/>
<spacer/>
</row>
<row>
<checkbox id="chrome" label="chrome"/>
<spacer/>
</row>
<row>
<checkbox id="dialog" label="dialog"/>
<checkbox id="dialog-ex" label="explicit"/>
</row>
<row>
<checkbox id="modal" label="modal"/>
<spacer/>
</row>
<row>
<checkbox id="dependent" label="dependent"/>
<spacer/>
</row>
<row>
<checkbox id="centerscreen" label="centered"/>
<spacer/>
</row>
</rows>
</grid>
</vbox>
<spacer style="width: 8px"/>
<vbox>
<hbox>
<spacer flex="1"/>
<text value="Open"/>
<spacer flex="1"/>
</hbox>
<grid>
<columns><column/><column/></columns>
<rows>
<row>
<button label="HTML Window" onclick="OpenWindow('html')"/>
<button label="XUL Window" onclick="OpenWindow('xul')"/>
</row>
<row>
<button label="HTML Dialog" onclick="OpenDialog('html')"/>
<button label="XUL Dialog" onclick="OpenDialog('xul')"/>
</row>
</rows>
</grid>
</vbox>
</window>