home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / browser.jar / content / browser / downloads / download-bindings.xml next >
Text File  |  2002-11-18  |  2KB  |  47 lines

  1. <!DOCTYPE window [
  2.   <!ENTITY % downloadDTD SYSTEM "chrome://browser/locale/downloads/downloadmanager.dtd" >
  3.   %downloadDTD;
  4. ]>
  5.  
  6. <bindings id="downloadBindings"
  7.           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:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  11.  
  12.   <binding id="download">
  13.     <resources>
  14.       <stylesheet src="chrome://browser/skin/downloads/downloadmanager.css"/>
  15.     </resources>
  16.     <content>
  17.       <xul:hbox>
  18.         <xul:image style="width: 16px; max-width: 16px; height: 16px; max-height: 16px;" xbl:inherits="src=image"/>
  19.         <xul:label xbl:inherits="value=target"/>
  20.       </xul:hbox>
  21.       <xul:vbox flex="1"
  22.                 class="indented"
  23.       >
  24.         <xul:hbox flex="1">
  25.           <xul:progressmeter mode="normal" value="0"
  26.                              xbl:inherits="value=progress,mode=progressmode"/>
  27.           <xul:label xbl:inherits="value=progress"/>
  28.         </xul:hbox>
  29.         <xul:hbox align="start">
  30.           <xul:label value="&cancel.label;" class="link" onclick="this.parentNode.parentNode.parentNode.cancel();"/>
  31.         </xul:hbox>
  32.       </xul:vbox>
  33.     </content>
  34.     <implementation>           
  35.       <method name="cancel">
  36.         <body>
  37.         <![CDATA[
  38.           const dlmgrContractID = "@mozilla.org/download-manager;1";
  39.           const dlmgrIID = Components.interfaces.nsIDownloadManager;
  40.           var dlmgr = Components.classes[dlmgrContractID].getService(dlmgrIID);
  41.           dlmgr.cancelDownload(this.id);
  42.         ]]>
  43.         </body>
  44.       </method>
  45.     </implementation>
  46.   </binding>
  47. </bindings>