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 / filC9B603045C16BD1AB4243133B5E3F7D2 < prev    next >
Extensible Markup Language  |  2010-07-12  |  2KB  |  42 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE bindings [
  3. <!ENTITY % yasearchDTD SYSTEM "chrome://yasearch/locale/yasearch.dtd" >
  4. %yasearchDTD;
  5. ]>
  6. <bindings id="YaSearchPartnerBindings"
  7.           xmlns="http://www.mozilla.org/xbl"
  8.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  9.   <binding id="extend-partner-toolbaritem">
  10.     <implementation>
  11.       <field name="_isInited">null</field>
  12.       
  13.       <constructor><![CDATA[
  14.         if (this._isInited || this.childNodes.length)
  15.           return;
  16.         
  17.         this._isInited = true;
  18.         
  19.         const yaPartner = Components.classes["@yandex.ru/yasearch;1"]
  20.                                     .getService(Components.interfaces.nsIYaSearch)
  21.                                     .wrappedJSObject
  22.                                     .yaPartner;
  23.         
  24.         var toolbaritemContent = yaPartner ? yaPartner.toolbaritemContent(this.ownerDocument) : null;
  25.         
  26.         if (!toolbaritemContent) {
  27.           if (this.parentNode)
  28.             this.parentNode.removeChild(this);
  29.           return;
  30.         }
  31.         
  32.         ["title", "label", "image"].forEach(function(aAttrName) {
  33.           if (toolbaritemContent.hasAttribute(aAttrName))
  34.             this.setAttribute(aAttrName, toolbaritemContent.getAttribute(aAttrName));
  35.         }, this)
  36.         
  37.         while (toolbaritemContent.firstChild)
  38.           this.appendChild(toolbaritemContent.firstChild);
  39.       ]]></constructor>
  40.     </implementation>
  41.   </binding>
  42. </bindings>