subdialog.xhtml (1328B)
1 <?xml version="1.0"?> 2 3 <!-- Any copyright is dedicated to the Public Domain. 4 - http://creativecommons.org/publicdomain/zero/1.0/ --> 5 6 <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> 7 8 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 9 xmlns:html="http://www.w3.org/1999/xhtml" 10 title="Sample sub-dialog"> 11 <dialog id="subDialog"> 12 <script> 13 document.addEventListener("dialogaccept", acceptSubdialog); 14 function acceptSubdialog() { 15 window.arguments[0].acceptCount++; 16 } 17 document.addEventListener("DOMContentLoaded", () => { 18 if (!window.arguments) { 19 return; 20 } 21 let [options] = window.arguments; 22 if (options?.testCustomFocusHandler) { 23 document.subDialogSetDefaultFocus = () => { 24 document.getElementById("custom-focus-el").focus(); 25 } 26 } 27 }, {once: true}) 28 </script> 29 30 <description id="desc">A sample sub-dialog for testing</description> 31 32 <html:input id="textbox" value="Default text" /> 33 34 <html:select id="select"> 35 <html:option>Foo</html:option> 36 <html:option>Bar</html:option> 37 </html:select> 38 39 <html:input id="custom-focus-el" value="Custom Focus Test" /> 40 41 <separator class="thin"/> 42 43 <button oncommand="window.close();" label="Close" /> 44 45 </dialog> 46 </window>