1999-07-27 06:34:25 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://global/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 -->
|
|
|
|
<xul:window
|
|
|
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
|
|
|
xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
title = "Chrome Features Test">
|
|
|
|
|
|
|
|
<html:script>
|
|
|
|
<![CDATA[
|
1999-08-07 02:51:03 +00:00
|
|
|
var featureList = new Array("all",
|
|
|
|
"close", "titlebar", "resizable", "scrollbars",
|
1999-08-12 22:08:17 +00:00
|
|
|
"chrome", "dialog", "modal", "dependent",
|
1999-07-27 06:34:25 +00:00
|
|
|
"menubar", "toolbar", "status", "location");
|
|
|
|
|
|
|
|
function OpenWindow(extension) {
|
1999-08-07 02:51:03 +00:00
|
|
|
var features = CalculateFeatures();
|
1999-08-12 22:08:17 +00:00
|
|
|
dump("******* begin open window\n");
|
1999-08-07 02:51:03 +00:00
|
|
|
window.open("resource:/res/samples/dexparamdialog."+extension,
|
|
|
|
"New", features);
|
1999-08-12 22:08:17 +00:00
|
|
|
dump("******* end open window\n");
|
1999-08-07 02:51:03 +00:00
|
|
|
}
|
|
|
|
function OpenDialog(extension) {
|
|
|
|
var features = CalculateFeatures();
|
1999-08-12 22:08:17 +00:00
|
|
|
dump("******* begin opendialog\n");
|
1999-08-07 02:51:03 +00:00
|
|
|
window.openDialog("resource:/res/samples/dexparamdialog."+extension,
|
|
|
|
"New", features, {remind:true});
|
1999-08-12 22:08:17 +00:00
|
|
|
dump("******* end opendialog\n");
|
1999-08-07 02:51:03 +00:00
|
|
|
}
|
|
|
|
function CalculateFeatures() {
|
1999-07-27 06:34:25 +00:00
|
|
|
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 {
|
1999-08-07 02:51:03 +00:00
|
|
|
element = document.getElementById(featureList[ctr]+"-ex");
|
|
|
|
if (element && element.checked) { // titlebar, close, dialog
|
1999-07-27 06:34:25 +00:00
|
|
|
if (features.length > 0)
|
|
|
|
features = features + ",";
|
|
|
|
features = features + featureList[ctr] + "=no";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dump("******* " + features + "\n");
|
1999-08-07 02:51:03 +00:00
|
|
|
return features;
|
1999-07-27 06:34:25 +00:00
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</html:script>
|
|
|
|
|
1999-08-07 02:51:03 +00:00
|
|
|
<!-- <html:div> -->
|
|
|
|
|
|
|
|
<html:table>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="all"/>all
|
|
|
|
</html:td><html:td>
|
|
|
|
<html:input type="checkbox" id="all-ex"/>explicit
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="close"/>close
|
|
|
|
</html:td><html:td>
|
|
|
|
<html:input type="checkbox" id="close-ex"/>explicit
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="titlebar"/>titlebar
|
|
|
|
</html:td><html:td>
|
|
|
|
<html:input type="checkbox" id="titlebar-ex"/>explicit
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="resizable"/>resizable
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="scrollbars"/>scrollbars
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="chrome"/>chrome
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="dialog"/>dialog
|
|
|
|
</html:td><html:td>
|
|
|
|
<html:input type="checkbox" id="dialog-ex"/>explicit
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="modal"/>modal
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
1999-08-12 22:08:17 +00:00
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="dependent"/>dependent
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
1999-08-07 02:51:03 +00:00
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="menubar"/>menubar
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="toolbar"/>toolbar
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="status"/>status
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<html:input type="checkbox" id="location"/>location
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
1999-08-12 22:08:17 +00:00
|
|
|
</html:table>
|
|
|
|
<html:table>
|
1999-08-07 02:51:03 +00:00
|
|
|
<html:tr>
|
|
|
|
<html:td colspan="2">
|
|
|
|
<html:center>Open</html:center>
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<xul:titledbutton value="HTML Window" onclick="OpenWindow('html')"
|
|
|
|
style="background-color:rgb(192,192,192);"/>
|
|
|
|
</html:td>
|
|
|
|
<html:td>
|
|
|
|
<xul:titledbutton value="XUL Window" onclick="OpenWindow('xul')"
|
|
|
|
style="background-color:rgb(192,192,192);"/>
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
<html:tr>
|
|
|
|
<html:td>
|
|
|
|
<xul:titledbutton value="HTML Dialog" onclick="OpenDialog('html')"
|
|
|
|
style="background-color:rgb(192,192,192);"/>
|
|
|
|
</html:td>
|
|
|
|
<html:td>
|
|
|
|
<xul:titledbutton value="XUL Dialog" onclick="OpenDialog('xul')"
|
|
|
|
style="background-color:rgb(192,192,192);"/>
|
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
</html:table>
|
|
|
|
<!-- </html:div> -->
|
1999-07-27 06:34:25 +00:00
|
|
|
</xul:window>
|