mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
63 lines
2.1 KiB
XML
63 lines
2.1 KiB
XML
|
<?xml version="1.0"?>
|
||
|
<bindings
|
||
|
xmlns="http://www.mozilla.org/xbl"
|
||
|
xmlns:xbl="http://www.mozilla.org/xbl"
|
||
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||
|
|
||
|
<binding id="dialog">
|
||
|
<content>
|
||
|
<xul:stack>
|
||
|
<xul:box xbl:inherits="orient" class="dialog-dark" align="center">
|
||
|
<children/>
|
||
|
</xul:box>
|
||
|
<xul:image collapsed="true" top="-10" anonid="close" class="close-button"
|
||
|
onclick="document.getBindingParent(this).close()"/>
|
||
|
</xul:stack>
|
||
|
</content>
|
||
|
|
||
|
<implementation>
|
||
|
<field name="arguments"/>
|
||
|
|
||
|
<constructor><![CDATA[
|
||
|
if (!this.hasAttribute("orient"))
|
||
|
this.setAttribute("orient", "vertical");
|
||
|
if (this.hasAttribute("closebutton") && (this.getAttribute("closebutton") == "true"))
|
||
|
document.getAnonymousElementByAttribute(this, "anonid", "close").removeAttribute("collapsed");
|
||
|
this._closed = false;
|
||
|
if (this.hasAttribute("script")) {
|
||
|
try {
|
||
|
let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
||
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||
|
loader.loadSubScript(this.getAttribute("script"), this);
|
||
|
} catch(e) {
|
||
|
throw("Dialog : Unable to load script : " + this.getAttribute("script") + "\n");
|
||
|
}
|
||
|
}
|
||
|
]]>
|
||
|
</constructor>
|
||
|
|
||
|
<method name="close">
|
||
|
<body>
|
||
|
if (this.hasAttribute("onclose")) {
|
||
|
var f = new Function(this.getAttribute("onclose"));
|
||
|
f.call(this);
|
||
|
}
|
||
|
this.parentNode.parentNode.removeChild(this.parentNode);
|
||
|
this._closed = true;
|
||
|
</body>
|
||
|
</method>
|
||
|
|
||
|
<method name="waitForClose">
|
||
|
<body>
|
||
|
let thread = Components.classes["@mozilla.org/thread-manager;1"]
|
||
|
.getService(Components.interfaces.nsIThreadManager)
|
||
|
.currentThread;
|
||
|
while (!this._closed)
|
||
|
thread.processNextEvent(true);
|
||
|
</body>
|
||
|
</method>
|
||
|
</implementation>
|
||
|
</binding>
|
||
|
|
||
|
</bindings>
|