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 / fil4FDA3003746B79085B48571B43F94826 < prev    next >
Extensible Markup Language  |  2010-07-12  |  4KB  |  104 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings xmlns="http://www.mozilla.org/xbl"
  4.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  5.           xmlns:xbl="http://www.mozilla.org/xbl"
  6.           xmlns:html="http://www.w3.org/1999/xhtml">
  7.  
  8.     <binding id="notification"
  9.              extends="../dialog/dialog.xml#dialog"
  10.              inheritstyle="false">
  11.         <resources>
  12.             <stylesheet src="notification.css"/>
  13.         </resources>
  14.         
  15.         <implementation implements="nsIDOMEventListener">
  16.             <field name="nodeDraggable">null</field>
  17.             
  18.             <field name="mAnimateWindowClose">true</field>
  19.             <field name="mAnimateWindowOpacity">true</field>
  20.             
  21.             <constructor><![CDATA[
  22.             ]]></constructor>
  23.             
  24.             <method name="init">
  25.                 <parameter name="aParameters"/>
  26.                 <body><![CDATA[
  27.                     if (aParameters) {
  28.                         if ("animateWindowClose" in aParameters)
  29.                             this.mAnimateWindowClose = aParameters.animateWindowClose;
  30.                         
  31.                         if ("animateWindowOpacity" in aParameters)
  32.                             this.mAnimateWindowOpacity = aParameters.animateWindowOpacity;
  33.                     }
  34.                     
  35.                     if (this.platform.os.name == "linux")
  36.                         this.mAnimateWindowOpacity = false;
  37.                 ]]></body>
  38.             </method>
  39.             
  40.             <method name="close">
  41.                 <body><![CDATA[
  42.                     if (this.mAnimateWindowClose)
  43.                         this.move(-1);
  44.                     else
  45.                         window.close();
  46.                 ]]></body>
  47.             </method>
  48.             
  49.             <method name="transition">
  50.                 <parameter name="stage"/>
  51.                 <body><![CDATA[
  52.                     let src = screen;
  53.                     
  54.                     window.moveTo(
  55.                         src.availLeft + src.availWidth - window.outerWidth,
  56.                         src.availTop + src.availHeight - stage * window.outerHeight
  57.                     );
  58.                     
  59.                     if (this.mAnimateWindowOpacity)
  60.                         this.style.opacity = stage;
  61.                 ]]></body>
  62.             </method>
  63.             
  64.             <method name="move">
  65.                 <parameter name="direction"/>
  66.                 <body><![CDATA[
  67.                     direction = direction == undefined ? 1 : direction;
  68.                     
  69.                     var context = this,
  70.                         stage = direction > 0 ? 0 : 1,
  71.                         step = 0.1 * direction,
  72.                         delay = 10;
  73.                     
  74.                     stage += step;
  75.                     this.transition(stage);
  76.                     
  77.                     var interval = setInterval(function(me) {
  78.                         stage += step;
  79.                         
  80.                         if (stage > 0.99)
  81.                             clearInterval(interval);
  82.                         
  83.                         if (stage < 0.01)
  84.                             window.close();
  85.                         
  86.                         me.transition(stage);
  87.                     }, delay, this);
  88.                 ]]></body>
  89.             </method>
  90.         
  91.         </implementation>
  92.         
  93.         <handlers>
  94.             <handler event="command"><![CDATA[
  95.                 if (event.originalTarget.data) {
  96.                     var data = event.originalTarget.data;
  97.                     if (data.command)
  98.                         data.command.call(data.context || null);
  99.                     //this.close();
  100.                 }
  101.             ]]></handler>
  102.         </handlers>
  103.     </binding>
  104. </bindings>