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 >
Extensible Markup Language  |  2010-07-12  |  7KB  |  170 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE bindings [
  3.     <!ENTITY % locale SYSTEM "chrome://yasearch/locale/package-management/package-management.dtd">
  4.     %locale;
  5. ]>
  6.  
  7. <bindings xmlns="http://www.mozilla.org/xbl"
  8.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9.           xmlns:xbl="http://www.mozilla.org/xbl"
  10.           xmlns:html="http://www.w3.org/1999/xhtml">
  11.     
  12.     <binding id="base"
  13.              inheritstyle="false">
  14.         <resources>
  15.             <stylesheet src="component.css"/>
  16.         </resources>
  17.         
  18.         <implementation>
  19.             <field name="_nodeCheckbox">document.getAnonymousElementByAttribute(this, "class", "checkbox")</field>
  20.             <field name="_bundle">document.documentElement.firstChild._bundle</field>
  21.             
  22.             <constructor><![CDATA[
  23.                 var item = this.item;
  24.                 if (this._nodeCheckbox)
  25.                     this._nodeCheckbox.checked = !!item.checked;
  26.             ]]></constructor>
  27.         </implementation>
  28.         <handlers>
  29.             <handler event="command"><![CDATA[
  30.                 if (event.originalTarget == this._nodeCheckbox)
  31.                     this.item.checked = this._nodeCheckbox.checked; 
  32.             ]]></handler>
  33.         </handlers>
  34.     </binding>
  35.     
  36.     <binding id="package"
  37.              extends="#base"
  38.              inheritstyle="false">
  39.         
  40.         <content>
  41.             <xul:vbox class="center">
  42.                 <xul:vbox class="widgets"/>
  43.                 <xul:label class="version" flex="1"/>
  44.             </xul:vbox>
  45.             <xul:vbox class="right">
  46.                 <xul:checkbox class="checkbox" label="&component.update;" checked="true"/>
  47.             </xul:vbox>
  48.         </content>
  49.         
  50.         <implementation>
  51.             <field name="_nodeWidgets">document.getAnonymousElementByAttribute(this, "class", "widgets")</field>
  52.             <field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
  53.             
  54.             <constructor><![CDATA[
  55.                 var item = this.item;
  56.                 this._nodeVersion.value = this._bundle.get("component.version", [item.version || "1"]);
  57.                 
  58.                 var ns = this.namespaceURI;
  59.                 
  60.                 for each (let widget in item.widgets) {
  61.                     let nodeWidget = document.createElementNS(ns, "hbox");
  62.                     nodeWidget.className = "widget";
  63.                     let nodeIcon = document.createElementNS(ns, "image");
  64.                     nodeIcon.className = "icon";
  65.                     let nodeTitle = document.createElementNS(ns, "label");
  66.                     nodeTitle.className = "title";
  67.                     nodeWidget.appendChild(nodeIcon);
  68.                     nodeWidget.appendChild(nodeTitle);
  69.                     this._nodeWidgets.appendChild(nodeWidget);
  70.                     
  71.                     nodeTitle.value = widget.name;
  72.                     if (widget.iconURI)
  73.                         nodeIcon.src = widget.iconURI;
  74.                 }
  75.                 
  76.                 if (item.widgets.length == 0)
  77.                     this.parentNode.removeChild(this);
  78.             ]]></constructor>
  79.         </implementation>
  80.         
  81.     </binding>
  82.     
  83.     <binding id="package-remove"
  84.              extends="#base"
  85.              inheritstyle="false">
  86.         
  87.         <content>
  88.             <xul:vbox class="widgets"/>
  89.             <xul:checkbox label="&component.save;" class="checkbox"/>
  90.         </content>
  91.         
  92.         <implementation>
  93.             <field name="_nodeWidgets">document.getAnonymousElementByAttribute(this, "class", "widgets")</field>
  94.             <field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
  95.             <constructor><![CDATA[
  96.                 var item = this.item;
  97.                 var ns = this.namespaceURI;
  98.                 
  99.                 for each (let widget in item.widgets) {
  100.                     let nodeWidget = document.createElementNS(ns, "hbox");
  101.                     nodeWidget.className = "widget";
  102.                     let nodeIcon = document.createElementNS(ns, "image");
  103.                     nodeIcon.className = "icon";
  104.                     let nodeTitle = document.createElementNS(ns, "label");
  105.                     nodeTitle.className = "title";
  106.                     nodeWidget.appendChild(nodeIcon);
  107.                     nodeWidget.appendChild(nodeTitle);
  108.                     this._nodeWidgets.appendChild(nodeWidget);
  109.                     
  110.                     nodeTitle.value = widget.name;
  111.                     if (widget.iconURI)
  112.                         nodeIcon.src = widget.iconURI;
  113.                 }
  114.             ]]></constructor>
  115.         </implementation>
  116.     </binding>
  117.     
  118.     <binding id="preset"
  119.              extends="#base"
  120.              inheritstyle="false">
  121.         
  122.         <content>
  123.             <xul:hbox class="center">
  124.                 <xul:vbox class="icon-container">
  125.                     <xul:image class="icon"/>
  126.                 </xul:vbox>
  127.                 <xul:vbox class="info" flex="1">
  128.                     <xul:label class="title" flex="1"/>
  129.                     <xul:label class="version" flex="1"/>
  130.                 </xul:vbox>
  131.             </xul:hbox>
  132.             <xul:vbox class="right">
  133.                 <xul:checkbox label="&component.update;" class="checkbox"/>
  134.             </xul:vbox>
  135.         </content>
  136.         
  137.         
  138.         <implementation>
  139.             <field name="_nodeIcon">document.getAnonymousElementByAttribute(this, "class", "icon")</field>
  140.             <field name="_nodeTitle">document.getAnonymousElementByAttribute(this, "class", "title")</field>
  141.             <field name="_nodeVersion">document.getAnonymousElementByAttribute(this, "class", "version")</field>
  142.             
  143.             <constructor><![CDATA[
  144.                 var item = this.item;
  145.                 this._nodeVersion.value = this._bundle.get("component.version", [item.preset.version || "1"]);
  146.                 this._nodeTitle.value = item.preset.name;
  147.                 if (item.preset.icon)
  148.                     this._nodeIcon.src = item.preset.icon;
  149.             ]]></constructor>
  150.         </implementation>
  151.     </binding>
  152.     
  153.     <binding id="widget"
  154.              extends="#base"
  155.              inheritstyle="false">
  156.         
  157.         <content>
  158.             <xul:checkbox class="checkbox" flex="1"/>
  159.         </content>
  160.         
  161.         <implementation>
  162.             <constructor><![CDATA[
  163.                 var item = this.item;
  164.                 this._nodeCheckbox.label = item.widget.name;
  165.                 //this._nodeCheckbox.src = item.widget.iconURI;
  166.                 this._nodeCheckbox.setAttribute("src", item.widget.iconURI);
  167.             ]]></constructor>
  168.         </implementation>
  169.     </binding>
  170. </bindings>