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
/
fil854979D9DD762A00EF7AFD9213745C58
< prev
next >
Wrap
Extensible Markup Language
|
2010-07-12
|
7KB
|
170 lines
<?xml version="1.0"?>
<!DOCTYPE bindings [
<!ENTITY % locale SYSTEM "chrome://yasearch/locale/package-management/package-management.dtd">
%locale;
]>
<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="base"
inheritstyle="false">
<resources>
<stylesheet src="component.css"/>
</resources>
<implementation>
<field name="_nodeCheckbox">document.getAnonymousElementByAttribute(this, "class", "checkbox")</field>
<field name="_bundle">document.documentElement.firstChild._bundle</field>
<constructor><![CDATA[
var item = this.item;
if (this._nodeCheckbox)
this._nodeCheckbox.checked = !!item.checked;
]]></constructor>
</implementation>
<handlers>
<handler event="command"><![CDATA[
if (event.originalTarget == this._nodeCheckbox)
this.item.checked = this._nodeCheckbox.checked;
]]></handler>
</handlers>
</binding>
<binding id="package"
extends="#base"
inheritstyle="false">
<content>
<xul:vbox class="center">
<xul:vbox class="widgets"/>
<xul:label class="version" flex="1"/>
</xul:vbox>
<xul:vbox class="right">
<xul:checkbox class="checkbox" label="&component.update;" checked="true"/>
</xul:vbox>
</content>
<implementation>
<field name="_nodeWidgets">document.getAnonymousElementByAttribute(this, "class", "widgets")</field>
<field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
<constructor><![CDATA[
var item = this.item;
this._nodeVersion.value = this._bundle.get("component.version", [item.version || "1"]);
var ns = this.namespaceURI;
for each (let widget in item.widgets) {
let nodeWidget = document.createElementNS(ns, "hbox");
nodeWidget.className = "widget";
let nodeIcon = document.createElementNS(ns, "image");
nodeIcon.className = "icon";
let nodeTitle = document.createElementNS(ns, "label");
nodeTitle.className = "title";
nodeWidget.appendChild(nodeIcon);
nodeWidget.appendChild(nodeTitle);
this._nodeWidgets.appendChild(nodeWidget);
nodeTitle.value = widget.name;
if (widget.iconURI)
nodeIcon.src = widget.iconURI;
}
if (item.widgets.length == 0)
this.parentNode.removeChild(this);
]]></constructor>
</implementation>
</binding>
<binding id="package-remove"
extends="#base"
inheritstyle="false">
<content>
<xul:vbox class="widgets"/>
<xul:checkbox label="&component.save;" class="checkbox"/>
</content>
<implementation>
<field name="_nodeWidgets">document.getAnonymousElementByAttribute(this, "class", "widgets")</field>
<field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
<constructor><![CDATA[
var item = this.item;
var ns = this.namespaceURI;
for each (let widget in item.widgets) {
let nodeWidget = document.createElementNS(ns, "hbox");
nodeWidget.className = "widget";
let nodeIcon = document.createElementNS(ns, "image");
nodeIcon.className = "icon";
let nodeTitle = document.createElementNS(ns, "label");
nodeTitle.className = "title";
nodeWidget.appendChild(nodeIcon);
nodeWidget.appendChild(nodeTitle);
this._nodeWidgets.appendChild(nodeWidget);
nodeTitle.value = widget.name;
if (widget.iconURI)
nodeIcon.src = widget.iconURI;
}
]]></constructor>
</implementation>
</binding>
<binding id="preset"
extends="#base"
inheritstyle="false">
<content>
<xul:hbox class="center">
<xul:vbox class="icon-container">
<xul:image class="icon"/>
</xul:vbox>
<xul:vbox class="info" flex="1">
<xul:label class="title" flex="1"/>
<xul:label class="version" flex="1"/>
</xul:vbox>
</xul:hbox>
<xul:vbox class="right">
<xul:checkbox label="&component.update;" class="checkbox"/>
</xul:vbox>
</content>
<implementation>
<field name="_nodeIcon">document.getAnonymousElementByAttribute(this, "class", "icon")</field>
<field name="_nodeTitle">document.getAnonymousElementByAttribute(this, "class", "title")</field>
<field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
<constructor><![CDATA[
var item = this.item;
this._nodeVersion.value = this._bundle.get("component.version", [item.preset.version || "1"]);
this._nodeTitle.value = item.preset.name;
if (item.preset.icon)
this._nodeIcon.src = item.preset.icon;
]]></constructor>
</implementation>
</binding>
<binding id="widget"
extends="#base"
inheritstyle="false">
<content>
<xul:checkbox class="checkbox" flex="1"/>
</content>
<implementation>
<constructor><![CDATA[
var item = this.item;
this._nodeCheckbox.label = item.widget.name;
//this._nodeCheckbox.src = item.widget.iconURI;
this._nodeCheckbox.setAttribute("src", item.widget.iconURI);
]]></constructor>
</implementation>
</binding>
</bindings>