зеркало из https://github.com/mozilla/gecko-dev.git
159 строки
6.9 KiB
XML
159 строки
6.9 KiB
XML
|
<?xml version="1.0"?>
|
||
|
|
||
|
<!DOCTYPE bindings [
|
||
|
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
|
||
|
%browserDTD;
|
||
|
]>
|
||
|
|
||
|
<bindings
|
||
|
xmlns="http://www.mozilla.org/xbl"
|
||
|
xmlns:xbl="http://www.mozilla.org/xbl"
|
||
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||
|
|
||
|
<binding id="download-base" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
||
|
<implementation>
|
||
|
<field name="nsIDLMgr">Components.interfaces.nsIDownloadManager</field>
|
||
|
|
||
|
<property name="paused">
|
||
|
<getter>
|
||
|
<![CDATA[
|
||
|
return parseInt(this.getAttribute("state")) == this.nsIDLMgr.DOWNLOAD_PAUSED;
|
||
|
]]>
|
||
|
</getter>
|
||
|
</property>
|
||
|
<property name="openable">
|
||
|
<getter>
|
||
|
<![CDATA[
|
||
|
return parseInt(this.getAttribute("state")) == this.nsIDLMgr.DOWNLOAD_FINISHED;
|
||
|
]]>
|
||
|
</getter>
|
||
|
</property>
|
||
|
<property name="inProgress">
|
||
|
<getter>
|
||
|
<![CDATA[
|
||
|
var state = parseInt(this.getAttribute("state"));
|
||
|
return state == this.nsIDLMgr.DOWNLOAD_NOTSTARTED ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_QUEUED ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_DOWNLOADING ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_PAUSED ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_SCANNING;
|
||
|
]]>
|
||
|
</getter>
|
||
|
</property>
|
||
|
<property name="removable">
|
||
|
<getter>
|
||
|
<![CDATA[
|
||
|
var state = parseInt(this.getAttribute("state"));
|
||
|
return state == this.nsIDLMgr.DOWNLOAD_FINISHED ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_CANCELED ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_BLOCKED_PARENTAL ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_BLOCKED_POLICY ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_DIRTY ||
|
||
|
state == this.nsIDLMgr.DOWNLOAD_FAILED;
|
||
|
]]>
|
||
|
</getter>
|
||
|
</property>
|
||
|
</implementation>
|
||
|
</binding>
|
||
|
|
||
|
<binding id="download-downloading" extends="chrome://browser/content/bindings/downloads.xml#download-base">
|
||
|
<content orient="horizontal" align="start">
|
||
|
<xul:image validate="always" xbl:inherits="src=iconURL"/>
|
||
|
<xul:vbox flex="1">
|
||
|
<xul:hbox align="center">
|
||
|
<xul:label class="title" xbl:inherits="value=target" crop="center" flex="1"/>
|
||
|
<xul:label class="normal" xbl:inherits="value=datetime"/>
|
||
|
</xul:hbox>
|
||
|
<xul:hbox align="center">
|
||
|
<xul:progressmeter anonid="progressmeter" mode="normal" value="0" flex="1" xbl:inherits="value=progress,mode=progressmode"/>
|
||
|
<xul:button class="download-pause" label="&downloadPause.label;"
|
||
|
oncommand="DownloadsView.pauseDownload(document.getBindingParent(this));"/>
|
||
|
<xul:button class="download-cancel" label="&downloadCancel.label;"
|
||
|
oncommand="DownloadsView.cancelDownload(document.getBindingParent(this));"/>
|
||
|
</xul:hbox>
|
||
|
<xul:label class="normal" xbl:inherits="value=status" crop="end"/>
|
||
|
</xul:vbox>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
<binding id="download-paused" extends="chrome://browser/content/bindings/downloads.xml#download-base">
|
||
|
<content orient="horizontal" align="start">
|
||
|
<xul:image validate="always" xbl:inherits="src=iconURL"/>
|
||
|
<xul:vbox flex="1">
|
||
|
<xul:hbox align="center">
|
||
|
<xul:label class="title" xbl:inherits="value=target" crop="center" flex="1"/>
|
||
|
<xul:label class="normal" xbl:inherits="value=datetime"/>
|
||
|
</xul:hbox>
|
||
|
<xul:hbox align="center">
|
||
|
<xul:progressmeter anonid="progressmeter" mode="normal" value="0" flex="1" xbl:inherits="value=progress,mode=progressmode"/>
|
||
|
<xul:button class="download-resume" label="&downloadResume.label;"
|
||
|
oncommand="DownloadsView.resumeDownload(document.getBindingParent(this));"/>
|
||
|
<xul:button class="download-cancel" label="&downloadCancel.label;"
|
||
|
oncommand="DownloadsView.cancelDownload(document.getBindingParent(this));"/>
|
||
|
</xul:hbox>
|
||
|
<xul:label class="normal" xbl:inherits="value=status" crop="end"/>
|
||
|
</xul:vbox>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
<binding id="download-retry" extends="chrome://browser/content/bindings/downloads.xml#download-base">
|
||
|
<content orient="horizontal" align="start">
|
||
|
<xul:image validate="always" xbl:inherits="src=iconURL"/>
|
||
|
<xul:vbox flex="1">
|
||
|
<xul:hbox align="center">
|
||
|
<xul:label class="title" xbl:inherits="value=target" crop="center" flex="1"/>
|
||
|
<xul:label class="normal" xbl:inherits="value=datetime"/>
|
||
|
</xul:hbox>
|
||
|
<xul:hbox>
|
||
|
<xul:label class="normal" xbl:inherits="value=status" crop="end" flex="1"/>
|
||
|
<xul:button class="download-retry" label="&downloadRetry.label;"
|
||
|
oncommand="DownloadsView.retryDownload(document.getBindingParent(this));"/>
|
||
|
</xul:hbox>
|
||
|
</xul:vbox>
|
||
|
</content>
|
||
|
</binding>
|
||
|
|
||
|
<binding id="download-done" extends="chrome://browser/content/bindings/downloads.xml#download-base">
|
||
|
<content orient="horizontal" align="start">
|
||
|
<xul:image validate="always" xbl:inherits="src=iconURL"/>
|
||
|
<xul:vbox flex="1">
|
||
|
<xul:hbox align="center">
|
||
|
<xul:label class="title" xbl:inherits="value=target" crop="center" flex="1"/>
|
||
|
<xul:label class="normal" xbl:inherits="value=datetime"/>
|
||
|
</xul:hbox>
|
||
|
<xul:hbox>
|
||
|
<xul:label class="normal" xbl:inherits="value=status"/>
|
||
|
</xul:hbox>
|
||
|
<xul:hbox class="show-on-select" align="center">
|
||
|
<xul:button anonid="showpage-button" label="&downloadShowPage.label;"
|
||
|
oncommand="DownloadsView.showPage(document.getBindingParent(this));"/>
|
||
|
<xul:spacer flex="1"/>
|
||
|
<xul:button anonid="show-button" label="&downloadShow.label;"
|
||
|
oncommand="DownloadsView.showDownload(document.getBindingParent(this));"/>
|
||
|
<xul:button anonid="open-button" label="&downloadOpen.label;"
|
||
|
oncommand="DownloadsView.openDownload(document.getBindingParent(this));"/>
|
||
|
<xul:image anonid="remove-button" class="close-button"
|
||
|
onmousedown="DownloadsView.removeDownload(document.getBindingParent(this))"/>
|
||
|
</xul:hbox>
|
||
|
</xul:vbox>
|
||
|
</content>
|
||
|
|
||
|
<implementation>
|
||
|
<constructor>
|
||
|
<![CDATA[
|
||
|
let referrer = this.hasAttribute("referrer");
|
||
|
if (!referrer)
|
||
|
document.getAnonymousElementByAttribute(this, "anonid", "showpage-button").setAttribute("disabled", "true");
|
||
|
|
||
|
let file = DownloadsView._getLocalFile(this.getAttribute("file"));
|
||
|
if (!file.exists()) {
|
||
|
document.getAnonymousElementByAttribute(this, "anonid", "open-button").setAttribute("disabled", "true");
|
||
|
document.getAnonymousElementByAttribute(this, "anonid", "show-button").setAttribute("disabled", "true");
|
||
|
}
|
||
|
]]>
|
||
|
</constructor>
|
||
|
</implementation>
|
||
|
</binding>
|
||
|
|
||
|
</bindings>
|