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 / filA63CB7DEBCB4A3220ACC3F65584407C6 < prev    next >
Extensible Markup Language  |  2010-07-12  |  5KB  |  135 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE bindings [
  3. <!ENTITY % yasearchDTD SYSTEM "chrome://yasearch/locale/yasearch.dtd" >
  4. %yasearchDTD;
  5. ]>
  6. <bindings xmlns="http://www.mozilla.org/xbl"
  7.           xmlns:data="urn:data"
  8.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  9.   
  10.   <binding id="locale-dialog-button-labels"
  11.            extends="chrome://global/content/bindings/text.xml#text-label">
  12.     <implementation>
  13.       <field name="_mStrBundleYa">null</field>
  14.       
  15.       <property name="mStrBundleYa">
  16.         <getter>
  17.         <![CDATA[
  18.           if (!this._mStrBundleYa) {
  19.             var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
  20.                                   .getService(Components.interfaces.nsILocaleService);
  21.             var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
  22.                                   .getService(Components.interfaces.nsIStringBundleService);
  23.             var bundleURL = "chrome://yasearch/locale/yasearch.properties";
  24.             this._mStrBundleYa = stringBundleService.createBundle(bundleURL, localeService.getApplicationLocale());
  25.           }
  26.           return this._mStrBundleYa;
  27.         ]]></getter>
  28.       </property>
  29.       
  30.       <method name="setLabelValue">
  31.         <parameter name="aType"/>
  32.         <body><![CDATA[
  33.           var acceptButton = this.ownerDocument.documentElement.getButton("accept");
  34.           if (aType == "cancel" && acceptButton && acceptButton.hidden == true)
  35.             aType = "close";
  36.           
  37.           this.value = this.mStrBundleYa.GetStringFromName("dialog." + aType);
  38.         ]]></body>
  39.       </method>
  40.       
  41.       <constructor><![CDATA[
  42.         var button = this;
  43.         while (button && button.localName != "button")
  44.           button = button.parentNode;
  45.         
  46.         var t = button.getAttribute("dlgtype");
  47.         if (t == "accept" || t == "cancel" || t == "finish") {
  48.           setTimeout(function foo(o, t) {
  49.             if (o.setLabelValue)
  50.               o.setLabelValue(t);
  51.           }, 1, this, t);
  52.         }
  53.       ]]></constructor>
  54.     </implementation>
  55.   </binding>
  56.   
  57.   <binding id="toolbarbutton-statustext"
  58.            extends="chrome://global/content/bindings/toolbarbutton.xml#menu-button">
  59.     <handlers>
  60.       <handler event="mouseover"><![CDATA[
  61.         var statusbar = document.getElementById("statusbar-display");
  62.         if (statusbar)
  63.           statusbar.label = event.target.getAttribute("statustext");
  64.       ]]></handler>
  65.       <handler event="mouseout"><![CDATA[
  66.         var statusbar = document.getElementById("statusbar-display");
  67.         if (statusbar)
  68.           statusbar.label = "";
  69.       ]]></handler>
  70.     </handlers>
  71.   </binding>
  72.   
  73.   <binding id="menuitem-statustext"
  74.            extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
  75.     <handlers>
  76.       <handler event="DOMMenuItemActive"><![CDATA[
  77.       var statusbar = document.getElementById("statusbar-display");
  78.       if (statusbar)
  79.         statusbar.label = event.target.getAttribute("statustext");
  80.       ]]></handler>
  81.       
  82.       <handler event="DOMMenuItemInactive"><![CDATA[
  83.       var statusbar = document.getElementById("statusbar-display");
  84.       if (statusbar)
  85.         statusbar.label = "";
  86.       ]]></handler>
  87.     </handlers>
  88.   </binding>
  89.   
  90.   <binding id="menuitem-tooltiptext"
  91.            extends="chrome://global/content/bindings/menu.xml#menuitem">
  92.     <implementation>
  93.       <constructor><![CDATA[
  94.         if (!this.hasAttribute("tooltiptext") && !this.hasAttribute("tooltip") && this.hasAttribute("label"))
  95.           this.setAttribute("tooltiptext", this.getAttribute("label"));
  96.       ]]></constructor>
  97.     </implementation>
  98.   </binding>
  99.   
  100.   <binding id="menuitem-iconic-tooltiptext"
  101.            extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
  102.     <implementation>
  103.       <constructor><![CDATA[
  104.         if (!this.hasAttribute("tooltiptext") && this.hasAttribute("label"))
  105.           this.setAttribute("tooltiptext", this.getAttribute("label"));
  106.       ]]></constructor>
  107.     </implementation>
  108.   </binding>
  109.   
  110.   <binding id="mouse-middle-click">
  111.     <handlers>
  112.       <handler event="click" button="1"><![CDATA[
  113.         Ya.checkForClick(event);
  114.       ]]></handler>
  115.     </handlers>
  116.   </binding>
  117.   
  118.   <binding id="mouse-click-menu"
  119.            extends="chrome://global/content/bindings/menu.xml#menu-iconic">
  120.     <handlers>
  121.       <handler event="click"><![CDATA[
  122.         Ya.checkForClick(event);
  123.       ]]></handler>
  124.     </handlers>
  125.   </binding>
  126.   
  127.   <binding id="mouse-middle-click-menuitem"
  128.            extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
  129.     <handlers>
  130.       <handler event="click" button="1"><![CDATA[
  131.         Ya.checkForClick(event);
  132.       ]]></handler>
  133.     </handlers>
  134.   </binding>
  135. </bindings>