gecko/mobile/chrome/content/notification.xml

134 lines
4.6 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE bindings [
<!ENTITY % notificationDTD SYSTEM
"chrome://browser/locale/notification.dtd">
%notificationDTD;
]>
<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"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="stacked-notificationbox" extends="chrome://global/content/bindings/notification.xml#notificationbox">
<content>
<xul:stack xbl:inherits="hidden=notificationshidden">
<xul:spacer/>
<children includes="notification"/>
</xul:stack>
<xul:stack flex="1">
<children/>
<html:canvas anonid="content-overlay"/>
<html:div flex="1" class="input-overlay" anonid="input-overlay"/>
</xul:stack>
</content>
<implementation>
<property name="inputHandler">
<getter>
return document.getAnonymousElementByAttribute(this, "anonid", "input-overlay");
</getter>
</property>
<property name="overlay">
<getter>
return document.getAnonymousElementByAttribute(this, "anonid", "content-overlay");
</getter>
</property>
<property name="customDragger">
<getter>
return this.parentNode.customDragger;
</getter>
</property>
</implementation>
</binding>
<binding id="notification" extends="chrome://global/content/bindings/notification.xml#notification">
<resources>
<stylesheet src="chrome://browser/skin/notification.css"/>
</resources>
<content>
<xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type">
<xul:vbox flex="1">
<xul:hbox anonid="details" align="center" flex="1">
<xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
<xul:spacer flex="1"/>
<xul:toolbarbutton class="messageCloseButton tabbable" xbl:inherits="hidden=hideclose"
ondblclick="event.stopPropagation();"
oncommand="document.getBindingParent(this).close();"/>
</xul:hbox>
<xul:hbox pack="center" class="buttons"
oncommand="document.getBindingParent(this)._doButtonCommand(event);">
<children/>
</xul:hbox>
</xul:vbox>
</xul:hbox>
</content>
<implementation implements="nsIDOMEventListener">
// We need to override the close method here, otherwise the destructor
// is not called on removeChild (see bug 230086)
<method name="close">
<body>
<![CDATA[
var control = this.control;
if (control)
control.removeNotification(this);
// Fire an event when closing a notification
let event = document.createEvent("Events");
event.initEvent("AlertClose", true, true);
this.dispatchEvent(event);
]]>
</body>
</method>
</implementation>
</binding>
<binding id="geo-notification" extends="chrome://browser/content/notification.xml#notification">
<resources>
<stylesheet src="chrome://browser/skin/notification.css"/>
</resources>
<content>
<xul:vbox class="notification-inner outset" flex="1" xbl:inherits="type">
<xul:hbox anonid="details">
<xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
<xul:spacer flex="1"/>
<xul:label anonid="learnMore"
class="text-link"
value="&geolocation.learnMore;"
onclick="BrowserUI.newTab(this.href); return false;"/>
</xul:hbox>
<xul:hbox pack="center"
oncommand="document.getBindingParent(this)._doButtonCommand(event);">
<children/>
</xul:hbox>
</xul:vbox>
</content>
<implementation>
<constructor>
<![CDATA[
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
var href = formatter.formatURLPref("browser.geolocation.warning.infoURL");
document.getAnonymousElementByAttribute(this, "anonid", "learnMore").href = href;
]]>
</constructor>
<field name="_checkbox">
document.getAnonymousElementByAttribute(this, "anonid", "rememberChoice")
</field>
<property name="rememberChoice"
onget="return this._checkbox.checked;"
readonly="true"/>
</implementation>
</binding>
</bindings>