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 / filB79581AD31CD0A3BE291F74387CC1B12 < prev    next >
Extensible Markup Language  |  2010-07-12  |  5KB  |  110 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="notification-update"
  13.              inheritstyle="false">
  14.         <resources>
  15.             <stylesheet src="notification-update.css"/>
  16.         </resources>
  17.         
  18.         <content>
  19.             <xul:image/>
  20.             <xul:vbox class="content">
  21.                 <xul:label class="title" value="¬ification.update.title;"/>
  22.                 <xul:label class="message" flex="1"/>
  23.                 
  24.                 <xul:hbox class="buttons">
  25.                     <xul:button class="button-custom" label="¬ification.update.custom;" oncommand="_install(false);" link="true"/>
  26.                     <xul:vbox flex="1"/>
  27.                     <xul:button label="¬ification.update.install;" oncommand="_install(true);"/>
  28.                 </xul:hbox>
  29.             </xul:vbox>
  30.         </content>
  31.         
  32.         <implementation>
  33.             <field name="dialog">document.documentElement</field>
  34.             <field name="parameters">window.parameters</field>
  35.             <field name="_application">this.parameters.application</field>
  36.             <field name="_widgetLibrary">this._application.widgetLibrary</field>
  37.             <field name="_packageManager">this._application.packageManager</field>
  38.             <field name="_overlayProvider">this._application.overlayProvider</field>
  39.             <field name="_XB">this._application.core.Lib.XB</field>
  40.             <field name="_misc">this._application.core.Lib.misc</field>
  41.             <field name="_sysutils">this._application.core.Lib.sysutils</field>
  42.             <field name="_logger">this._application.core.Log4Moz.repository.getLogger(this._application.name + ".PackageManagementDialog")</field>
  43.             <field name="_bundle">new this._misc.StringBundle("package-management/package-management.properties")</field>
  44.             <field name="_nodeMessage">document.getAnonymousElementByAttribute(this, "class", "message")</field>
  45.             
  46.             <constructor><![CDATA[
  47.                 var text = null,
  48.                     presets = this.parameters.presets,
  49.                     manifests = this.parameters.manifests;
  50.                 
  51.                 if (!text && presets.length == 0 && manifests.length > 0) {
  52.                     let widgets = [];
  53.                     for each (let manifest in manifests)
  54.                         for each (let prototype in this._widgetLibrary.getWidgetProtos(manifest.packageID))
  55.                             widgets.push(this._normalize(prototype.name));
  56.                     
  57.                     if (widgets.length > 0)
  58.                         if (widgets.length == 1)
  59.                             text = this._bundle.get("notification.update.message.widget", [widgets[0]]);
  60.                 }
  61.                 
  62.                 if (!text && presets.length == 1) {
  63.                     let preset = presets[0];
  64.                     let widgetsInfo = preset.widgetsInfo;
  65.                     let united = true;
  66.                     for each (let manifest in manifests) {
  67.                         let used = false;
  68.                         for each (let widgetInfo in widgetsInfo)
  69.                             if (widgetInfo.packageID == manifest.packageID) {
  70.                                 used = true;
  71.                                 break;
  72.                             }
  73.                         
  74.                         if (used)
  75.                             continue;
  76.                         united = false;
  77.                         break;
  78.                     }
  79.                     
  80.                     if (united)
  81.                         text = this._bundle.get("notification.update.message.preset", [this._normalize(preset.name)]);
  82.                 }
  83.                 
  84.                 if (!text)
  85.                     text = this._bundle.get("notification.update.message.combo");
  86.                 this._nodeMessage.textContent = text;
  87.             ]]></constructor>
  88.             
  89.             <method name="_normalize">
  90.                 <parameter name="text"/>
  91.                 <body><![CDATA[
  92.                     return this._sysutils.insertBreaksInString(text);
  93.                 ]]></body>
  94.             </method>
  95.             
  96.             <method name="_install">
  97.                 <parameter name="simple"/>
  98.                 <body><![CDATA[
  99.                     this.parameters.install(simple);
  100.                     this.dialog.close();
  101.                 ]]></body>
  102.             </method>
  103.         </implementation>
  104.         <handlers>
  105.             <handler event="click"><![CDATA[
  106.                 //this._install(false);
  107.             ]]></handler>
  108.         </handlers>
  109.     </binding>
  110. </bindings>