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

  1. <?xml version="1.0"?>
  2. <!DOCTYPE bindings SYSTEM "chrome://yasearch/locale/dialogs/welcome.dtd">
  3.  
  4. <bindings xmlns="http://www.mozilla.org/xbl"
  5.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  6.           xmlns:xbl="http://www.mozilla.org/xbl"
  7.           xmlns:html="http://www.w3.org/1999/xhtml">
  8.   
  9.   <binding id="scrollbar" extends="chrome://global/content/bindings/scrollbar.xml#scrollbar">
  10.     <resources>
  11.       <stylesheet src="chrome://yasearch/skin/dialogs/scrollbar.css"/>
  12.     </resources>
  13.     
  14.     <implementation>
  15.  
  16.       <field name="friend">document.getElementById("ya-status-textarea")</field>
  17.  
  18.       <property name="maxpos" onset="this.setAttribute('maxpos', val);" onget="return this.getAttribute('maxpos');"/>
  19.       <property name="curpos" onset="this.setAttribute('curpos', val);" onget="return this.getAttribute('curpos');"/>
  20.  
  21.       <constructor><![CDATA[
  22.         this.setAttribute("hidden", "true");
  23.         
  24.         this.friend.style.marginRight = "-" + (this.friend.offsetWidth - this.friend.clientWidth) + "px";
  25.         
  26.         function bind(handler, context) {
  27.             var __arguments__ = arguments;
  28.             return function() { return handler.call(context, Array.slice.call(__arguments__, 2)); };
  29.         }
  30.         
  31.         var events = ["scroll", "change", "keydown", "keypress", "cut", "paste"];
  32.         for (var i = events.length; i--;)
  33.           this.friend.addEventListener(events[i], bind(this.update, this), true);
  34.  
  35.         this.friend.addEventListener("overflow", bind(this.onOverflow, this), true);
  36.         this.friend.addEventListener("underflow", bind(this.onUnderflow, this), true);
  37.         
  38.         this.update();
  39.       ]]></constructor>    
  40.  
  41.       <method name="update">
  42.         <body><![CDATA[
  43.           this.maxpos = this.friend.scrollHeight - this.friend.clientHeight;
  44.           this.curpos = this.friend.scrollTop;
  45.         ]]></body>
  46.       </method>
  47.  
  48.       <method name="onOverflow">
  49.         <body><![CDATA[
  50.           this.removeAttribute("hidden");
  51.           this.update();
  52.         ]]></body>
  53.       </method>
  54.  
  55.       <method name="onUnderflow">
  56.         <body><![CDATA[
  57.           this.setAttribute("hidden", "true");
  58.         ]]></body>
  59.       </method>
  60.     
  61.     </implementation>
  62.     
  63.     <handlers>
  64.       <handler event="DOMAttrModified"><![CDATA[
  65.         this.friend.scrollTop = this.curpos;
  66.       ]]></handler>
  67.     </handlers>
  68.   </binding>
  69. </bindings>