home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
fil65A8441CECA427B67509E0E2033CD7C1
< prev
next >
Wrap
Extensible Markup Language
|
2010-07-12
|
10KB
|
238 lines
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="dialog"
inheritstyle="false">
<resources>
<stylesheet src="dialog.css"/>
</resources>
<content hidechrome="true">
<xul:vbox class="body">
<xul:hbox class="title">
<xul:label class="title-text" xbl:inherits="value=title"/>
<xul:hbox class="title-close" onclick="close();"></xul:hbox>
</xul:hbox>
<xul:vbox class="content">
<children/>
</xul:vbox>
</xul:vbox>
</content>
<implementation implements="nsIDOMEventListener">
<field name="nodeClose">document.getAnonymousElementByAttribute(this, "class", "title-close")</field>
<field name="nodeTitle">document.getAnonymousElementByAttribute(this, "class", "title-text")</field>
<field name="nodeBody">document.getAnonymousElementByAttribute(this, "class", "body")</field>
<field name="nodeContent">document.getAnonymousElementByAttribute(this, "class", "content")</field>
<field name="nodeDraggable">this.nodeTitle</field>
<field name="dragStartPoint">null</field>
<field name="parameters">window.parameters</field>
<field name="_logger">this._application.core.Log4Moz.repository.getLogger(this._application.name + ".Dialog")</field>
<field name="platform"><![CDATA[
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo)
.QueryInterface(Components.interfaces.nsIXULRuntime);
var os = "", version = "";
if (/^win/i.test(appInfo.OS))
os = "windows";
if (/^linux/i.test(appInfo.OS))
os = "linux";
if (/darwin/i.test(appInfo.OS))
os = "mac";
var platform = {
browser: {
name: "firefox",
version: version
},
os: {
name: os,
version: ""
}
};
platform
]]>
</field>
<constructor><![CDATA[
let shadow = false;
let transparent = true;
if (this.platform.os.name == "windows") {
if (!!Components.interfaces.nsIWorker)
shadow = true;
else {
transparent = false;
shadow = "pseudo";
}
} else if (this.platform.os.name == "linux") {
transparent = false;
//shadow = "pseudo";
}
this.setAttribute("ex-shadow", shadow);
this.setAttribute("ex-transparent", transparent);
window.addEventListener("load", this, false);
window.addEventListener("unload", this, false);
this.parameters = window.parameters;
if (window.parameters)
this.init(parameters);
]]></constructor>
<method name="init">
<body><![CDATA[
]]></body>
</method>
<method name="sizeToContent">
<body><![CDATA[
this._sizeToContent();
/*
if (this.platform.os.name == "mac") {
window.sizeToContent();
setTimeout(function(me) {
if (me && "_sizeToContent" in me)
me._sizeToContent();
}, 50, this);
} else {
this._sizeToContent();
}
*/
]]></body>
</method>
<method name="_sizeToContent">
<body><![CDATA[
var rect = this.nodeBody.getBoundingClientRect();
window.resizeTo(rect.left + rect.right, rect.top + rect.bottom);
]]></body>
</method>
<method name="centerWindowOnScreen">
<body><![CDATA[
var xOffset = screen.availWidth/2 - window.outerWidth/2;
var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10;
xOffset = xOffset > 0 ? xOffset : 0;
yOffset = yOffset > 0 ? yOffset : 0;
window.moveTo(xOffset, yOffset);
]]></body>
</method>
<method name="contains">
<parameter name="child"/>
<parameter name="parent"/>
<body><![CDATA[
try {
return parent && ((child == parent) ||
(parent.compareDocumentPosition(child) & Node.DOCUMENT_POSITION_CONTAINED_BY));
} catch (ex) {}
return false;
]]></body>
</method>
<method name="move">
<body><![CDATA[
this.centerWindowOnScreen();
]]></body>
</method>
<method name="close">
<body><![CDATA[
window.close();
]]></body>
</method>
<method name="load">
<parameter name="event"/>
<body><![CDATA[
this.sizeToContent();
this.move();
if (this.platform.os.name == "mac")
setTimeout(function(context) {
window.sizeToContent();
}, 10, this);
]]></body>
</method>
<method name="unload">
<parameter name="event"/>
<body><![CDATA[
]]></body>
</method>
<method name="dragMouseDown">
<parameter name="event"/>
<body><![CDATA[
if (this.contains(event.originalTarget, this.nodeDraggable)) {
this.dragStartPoint = {x: event.screenX - window.screenX, y: event.screenY - window.screenY};
window.addEventListener("mousemove", this, false);
}
]]></body>
</method>
<method name="dragMouseMove">
<parameter name="event"/>
<body><![CDATA[
if (this.dragStartPoint)
window.moveTo(event.screenX - this.dragStartPoint.x, event.screenY - this.dragStartPoint.y);
]]></body>
</method>
<method name="dragMouseUp">
<parameter name="event"/>
<body><![CDATA[
window.removeEventListener("mousemove", this, false);
this.dragStartPoint = null;
]]></body>
</method>
<method name="handleEvent">
<parameter name="event"/>
<body><![CDATA[
switch(event.type) {
case "mousemove":
this.dragMouseMove(event);
break;
case "load":
window.removeEventListener("load", this, false);
this.load(event);
break;
case "unload":
window.removeEventListener("unload", this, false);
this.unload(event);
break;
}
]]></body>
</method>
</implementation>
<handlers>
<handler event="mousedown"><![CDATA[
this.dragMouseDown(event);
]]></handler>
<handler event="mouseup"><![CDATA[
this.dragMouseUp(event);
]]></handler>
</handlers>
</binding>
</bindings>