91 lines
3.8 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE bindings SYSTEM "chrome://mozapps/locale/update/updates.dtd">
<bindings id="updatesBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="link" extends="chrome://global/content/bindings/text.xml#text-base">
<content>
<xul:label xbl:inherits="value=label,crop" class="linkLabel" flex="1"/>
</content>
<implementation>
<property name="href"
onget="return this.getAttribute('href');"
onset="this.setAttribute('href', val); return val;"/>
</implementation>
<handlers>
<handler event="keypress" keycode="VK_ENTER" action="this.click()" />
<handler event="keypress" keycode="VK_RETURN" action="this.click()" />
<handler event="click">
<![CDATA[
if (event.button != 0)
return;
# If we're not a browser, use the external protocol service to load the URI.
#ifndef MOZ_PHOENIX
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService)
.newURI(this.getAttribute("href"), null, null);
var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
if (protocolSvc.isExposedProtocol(uri.scheme))
protocolSvc.loadUrl(uri);
# If we're a browser, open a new browser window instead.
#else
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
var ary = Components.classes["@mozilla.org/supports-array;1"]
.createInstance(Components.interfaces.nsISupportsArray);
var url = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
url.data = this.getAttribute("href")
ary.AppendElement(url);
ww.openWindow(null, "chrome://browser/content/browser.xul",
"_blank", "chrome,all,dialog=no", ary);
#endif
]]>
</handler>
</handlers>
</binding>
<binding id="update" extends="chrome://mozapps/content/shared/richview.xml#richview-item">
<resources>
<stylesheet src="chrome://mozapps/content/update/updates.css"/>
</resources>
<content>
<xul:hbox pack="start">
<xul:label class="update-item-name" xbl:inherits="value=name" crop="right" flex="1"/>
<xul:link class="update-item-details" xbl:inherits="href=url">&details.link;</xul:link>
</xul:hbox>
<xul:label class="update-item-status" xbl:inherits="xbl:text=status" flex="1"/>
</content>
</binding>
<binding id="update-downloading" extends="chrome://mozapps/content/shared/richview.xml#richview-item">
<resources>
<stylesheet src="chrome://mozapps/content/update/updates.css"/>
</resources>
<content>
<xul:hbox pack="start">
<xul:label class="update-item-name" xbl:inherits="value=name" crop="right" flex="1"/>
<xul:link class="update-item-details" xbl:inherits="href=url" label="&details.link;"/>
</xul:hbox>
<xul:progressmeter class="update-item-progress" xbl:inherits="value=progress"/>
<xul:hbox align="center">
<xul:label class="update-item-status" xbl:inherits="value=status" flex="1" crop="right"/>
<xul:button class="update-item-pause" label="&pause.label;" accesskey="&pause.accesskey;"/>
</xul:hbox>
</content>
<implementation>
<field name="eventPrefix">"update-"</field>
</implementation>
</binding>
</bindings>