2002-10-13 22:44:10 +00:00
|
|
|
<?xml version="1.0"?>
|
2012-05-21 11:12:37 +00:00
|
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
|
|
|
|
<bindings id="dialogBindings"
|
|
|
|
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">
|
2009-09-04 10:58:18 +00:00
|
|
|
|
|
|
|
<binding id="dialog" extends="chrome://global/content/bindings/general.xml#root-element">
|
2002-10-13 22:44:10 +00:00
|
|
|
<resources>
|
|
|
|
<stylesheet src="chrome://global/skin/dialog.css"/>
|
|
|
|
</resources>
|
|
|
|
<content>
|
|
|
|
<xul:vbox class="box-inherit dialog-content-box" flex="1">
|
|
|
|
<children/>
|
|
|
|
</xul:vbox>
|
|
|
|
|
2003-08-12 01:19:58 +00:00
|
|
|
<xul:hbox class="dialog-button-box" anonid="buttons"
|
2003-12-17 14:52:48 +00:00
|
|
|
xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"
|
2003-12-14 08:43:04 +00:00
|
|
|
#ifdef XP_UNIX
|
2003-12-17 14:52:48 +00:00
|
|
|
>
|
2003-08-12 01:19:58 +00:00
|
|
|
<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
|
|
|
|
<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
|
2003-12-14 08:43:04 +00:00
|
|
|
<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
|
|
|
|
<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
|
2003-12-17 14:52:48 +00:00
|
|
|
<xul:spacer anonid="spacer" flex="1"/>
|
2003-08-12 01:19:58 +00:00
|
|
|
<xul:button dlgtype="cancel" class="dialog-button"/>
|
2006-04-06 01:47:25 +00:00
|
|
|
<xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
|
2003-08-12 01:19:58 +00:00
|
|
|
#else
|
2003-12-17 14:52:48 +00:00
|
|
|
pack="end">
|
2003-12-14 08:43:04 +00:00
|
|
|
<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
|
2003-12-17 14:52:48 +00:00
|
|
|
<xul:spacer anonid="spacer" flex="1" hidden="true"/>
|
2006-04-06 01:47:25 +00:00
|
|
|
<xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
|
2003-12-14 08:43:04 +00:00
|
|
|
<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
|
2002-10-13 22:44:10 +00:00
|
|
|
<xul:button dlgtype="cancel" class="dialog-button"/>
|
|
|
|
<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
|
|
|
|
<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
|
2003-08-12 01:19:58 +00:00
|
|
|
#endif
|
2002-10-13 22:44:10 +00:00
|
|
|
</xul:hbox>
|
|
|
|
</content>
|
|
|
|
|
|
|
|
<implementation>
|
|
|
|
<field name="_mStrBundle">null</field>
|
|
|
|
<field name="_closeHandler">(function(event) {
|
|
|
|
if (!document.documentElement.cancelDialog())
|
|
|
|
event.preventDefault();
|
|
|
|
})</field>
|
|
|
|
|
|
|
|
<property name="buttons"
|
|
|
|
onget="return this.getAttribute('buttons');"
|
|
|
|
onset="this._configureButtons(val); return val;"/>
|
|
|
|
|
2005-06-18 10:21:49 +00:00
|
|
|
<property name="defaultButton">
|
|
|
|
<getter>
|
|
|
|
<![CDATA[
|
|
|
|
if (this.hasAttribute("defaultButton"))
|
|
|
|
return this.getAttribute("defaultButton");
|
|
|
|
else // default to the accept button
|
|
|
|
return "accept";
|
|
|
|
]]>
|
|
|
|
</getter>
|
|
|
|
<setter>
|
|
|
|
<![CDATA[
|
|
|
|
this._setDefaultButton(val);
|
|
|
|
return val;
|
|
|
|
]]>
|
|
|
|
</setter>
|
|
|
|
</property>
|
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
<method name="acceptDialog">
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
return this._doButtonCommand("accept");
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="cancelDialog">
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
return this._doButtonCommand("cancel");
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="getButton">
|
|
|
|
<parameter name="aDlgType"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
return this._buttons[aDlgType];
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="moveToAlertPosition">
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
// hack. we need this so the window has something like its final size
|
|
|
|
if (window.outerWidth == 1) {
|
|
|
|
dump("Trying to position a sizeless window; caller should have called sizeToContent() or sizeTo(). See bug 75649.\n");
|
|
|
|
sizeToContent();
|
|
|
|
}
|
|
|
|
|
|
|
|
var xOffset = (opener.outerWidth - window.outerWidth) / 2;
|
|
|
|
var yOffset = opener.outerHeight / 5;
|
|
|
|
|
|
|
|
var newX = opener.screenX + xOffset;
|
|
|
|
var newY = opener.screenY + yOffset;
|
|
|
|
|
|
|
|
// ensure the window is fully onscreen (if smaller than the screen)
|
|
|
|
if (newX < screen.availLeft)
|
|
|
|
newX = screen.availLeft + 20;
|
|
|
|
if ((newX + window.outerWidth) > (screen.availLeft + screen.availWidth))
|
|
|
|
newX = (screen.availLeft + screen.availWidth) - window.outerWidth - 20;
|
|
|
|
|
|
|
|
if (newY < screen.availTop)
|
|
|
|
newY = screen.availTop + 20;
|
|
|
|
if ((newY + window.outerHeight) > (screen.availTop + screen.availHeight))
|
|
|
|
newY = (screen.availTop + screen.availHeight) - window.outerHeight - 60;
|
|
|
|
|
|
|
|
window.moveTo( newX, newY );
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="centerWindowOnScreen">
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
var xOffset = screen.availWidth/2 - window.outerWidth/2;
|
|
|
|
var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10;
|
|
|
|
|
|
|
|
xOffset = xOffset > 0 ? xOffset : 0;
|
|
|
|
yOffset = yOffset > 0 ? yOffset : 0;
|
|
|
|
window.moveTo(xOffset, yOffset);
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<constructor>
|
|
|
|
<![CDATA[
|
2003-11-15 07:31:01 +00:00
|
|
|
this._configureButtons(this.buttons);
|
2002-10-13 22:44:10 +00:00
|
|
|
|
|
|
|
// listen for when window is closed via native close buttons
|
|
|
|
window.addEventListener("close", this._closeHandler, false);
|
|
|
|
|
|
|
|
// for things that we need to initialize after onload fires
|
|
|
|
window.addEventListener("load", this.postLoadInit, false);
|
|
|
|
|
|
|
|
window.moveToAlertPosition = this.moveToAlertPosition;
|
|
|
|
window.centerWindowOnScreen = this.centerWindowOnScreen;
|
|
|
|
]]>
|
|
|
|
</constructor>
|
|
|
|
|
|
|
|
<method name="postLoadInit">
|
|
|
|
<parameter name="aEvent"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
2006-03-29 21:33:41 +00:00
|
|
|
function focusInit() {
|
2009-07-15 09:54:30 +00:00
|
|
|
const dialog = document.documentElement;
|
|
|
|
const defaultButton = dialog.getButton(dialog.defaultButton);
|
2006-03-29 21:33:41 +00:00
|
|
|
// give focus to the first focusable element in the dialog
|
|
|
|
if (!document.commandDispatcher.focusedElement) {
|
2009-07-15 09:54:30 +00:00
|
|
|
document.commandDispatcher.advanceFocusIntoSubtree(dialog);
|
2009-10-05 14:00:09 +00:00
|
|
|
|
2006-03-29 21:33:41 +00:00
|
|
|
var focusedElt = document.commandDispatcher.focusedElement;
|
|
|
|
if (focusedElt) {
|
2009-10-05 14:00:09 +00:00
|
|
|
var initialFocusedElt = focusedElt;
|
|
|
|
while (focusedElt.localName == "tab" ||
|
|
|
|
focusedElt.getAttribute("noinitialfocus") == "true") {
|
2004-12-02 21:14:49 +00:00
|
|
|
document.commandDispatcher.advanceFocusIntoSubtree(focusedElt);
|
2009-10-05 14:00:09 +00:00
|
|
|
focusedElt = document.commandDispatcher.focusedElement;
|
|
|
|
if (focusedElt == initialFocusedElt)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (initialFocusedElt.localName == "tab") {
|
|
|
|
if (focusedElt.hasAttribute("dlgtype")) {
|
2006-03-29 21:33:41 +00:00
|
|
|
// We don't want to focus on anonymous OK, Cancel, etc. buttons,
|
|
|
|
// so return focus to the tab itself
|
2009-10-05 14:00:09 +00:00
|
|
|
initialFocusedElt.focus();
|
2004-12-02 21:14:49 +00:00
|
|
|
}
|
2006-05-17 08:54:27 +00:00
|
|
|
}
|
|
|
|
#ifndef XP_MACOSX
|
2009-10-05 14:00:09 +00:00
|
|
|
else if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
|
|
|
|
defaultButton.focus();
|
2004-12-02 21:14:49 +00:00
|
|
|
}
|
2006-05-17 08:54:27 +00:00
|
|
|
#endif
|
2004-12-02 21:14:49 +00:00
|
|
|
}
|
2006-03-29 21:33:41 +00:00
|
|
|
}
|
2009-07-15 09:54:30 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
if (defaultButton)
|
|
|
|
window.notifyDefaultButtonLoaded(defaultButton);
|
|
|
|
} catch (e) { }
|
2006-03-29 21:33:41 +00:00
|
|
|
}
|
2002-10-13 22:44:10 +00:00
|
|
|
|
|
|
|
// Give focus after onload completes, see bug 103197.
|
|
|
|
setTimeout(focusInit, 0);
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<property name="mStrBundle">
|
|
|
|
<getter>
|
|
|
|
<![CDATA[
|
|
|
|
if (!this._mStrBundle) {
|
|
|
|
// need to create string bundle manually instead of using <xul:stringbundle/>
|
|
|
|
// see bug 63370 for details
|
2008-07-12 09:56:02 +00:00
|
|
|
this._mStrBundle = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
|
|
|
.getService(Components.interfaces.nsIStringBundleService)
|
|
|
|
.createBundle("chrome://global/locale/dialog.properties");
|
2002-10-13 22:44:10 +00:00
|
|
|
}
|
|
|
|
return this._mStrBundle;
|
|
|
|
]]></getter>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<method name="_configureButtons">
|
|
|
|
<parameter name="aButtons"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
// by default, get all the anonymous button elements
|
|
|
|
var buttons = {};
|
|
|
|
this._buttons = buttons;
|
|
|
|
buttons.accept = document.getAnonymousElementByAttribute(this, "dlgtype", "accept");
|
|
|
|
buttons.cancel = document.getAnonymousElementByAttribute(this, "dlgtype", "cancel");
|
|
|
|
buttons.extra1 = document.getAnonymousElementByAttribute(this, "dlgtype", "extra1");
|
|
|
|
buttons.extra2 = document.getAnonymousElementByAttribute(this, "dlgtype", "extra2");
|
|
|
|
buttons.help = document.getAnonymousElementByAttribute(this, "dlgtype", "help");
|
|
|
|
buttons.disclosure = document.getAnonymousElementByAttribute(this, "dlgtype", "disclosure");
|
|
|
|
|
|
|
|
// look for any overriding explicit button elements
|
|
|
|
var exBtns = this.getElementsByAttribute("dlgtype", "*");
|
|
|
|
var dlgtype;
|
|
|
|
var i;
|
|
|
|
for (i = 0; i < exBtns.length; ++i) {
|
|
|
|
dlgtype = exBtns[i].getAttribute("dlgtype");
|
|
|
|
buttons[dlgtype].hidden = true; // hide the anonymous button
|
|
|
|
buttons[dlgtype] = exBtns[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// add the label and oncommand handler to each button
|
|
|
|
for (dlgtype in buttons) {
|
|
|
|
var button = buttons[dlgtype];
|
2003-12-14 08:43:04 +00:00
|
|
|
button.addEventListener("command", this._handleButtonCommand, true);
|
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
// don't override custom labels with pre-defined labels on explicit buttons
|
2002-11-11 01:51:50 +00:00
|
|
|
if (!button.hasAttribute("label")) {
|
2003-12-15 01:17:29 +00:00
|
|
|
// dialog attributes override the default labels in dialog.properties
|
|
|
|
if (this.hasAttribute("buttonlabel"+dlgtype)) {
|
|
|
|
button.setAttribute("label", this.getAttribute("buttonlabel"+dlgtype));
|
|
|
|
if (this.hasAttribute("buttonaccesskey"+dlgtype))
|
|
|
|
button.setAttribute("accesskey", this.getAttribute("buttonaccesskey"+dlgtype));
|
|
|
|
} else if (dlgtype != "extra1" && dlgtype != "extra2") {
|
2003-12-14 08:43:04 +00:00
|
|
|
button.setAttribute("label", this.mStrBundle.GetStringFromName("button-"+dlgtype));
|
|
|
|
var accessKey = this.mStrBundle.GetStringFromName("accesskey-"+dlgtype);
|
|
|
|
if (accessKey)
|
|
|
|
button.setAttribute("accesskey", accessKey);
|
|
|
|
}
|
2002-11-11 01:51:50 +00:00
|
|
|
}
|
2005-03-02 10:53:06 +00:00
|
|
|
// allow specifying alternate icons in the dialog header
|
|
|
|
if (!button.hasAttribute("icon")) {
|
|
|
|
// if there's an icon specified, use that
|
|
|
|
if (this.hasAttribute("buttonicon"+dlgtype))
|
|
|
|
button.setAttribute("icon", this.getAttribute("buttonicon"+dlgtype));
|
|
|
|
// otherwise set defaults
|
|
|
|
else
|
|
|
|
switch (dlgtype) {
|
|
|
|
case "accept":
|
|
|
|
button.setAttribute("icon","accept");
|
|
|
|
break;
|
|
|
|
case "cancel":
|
|
|
|
button.setAttribute("icon","cancel");
|
|
|
|
break;
|
2010-08-18 06:51:34 +00:00
|
|
|
case "disclosure":
|
2005-03-02 10:53:06 +00:00
|
|
|
button.setAttribute("icon","properties");
|
|
|
|
break;
|
|
|
|
case "help":
|
|
|
|
button.setAttribute("icon","help");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2002-10-13 22:44:10 +00:00
|
|
|
}
|
2003-12-14 08:43:04 +00:00
|
|
|
|
2005-06-18 10:21:49 +00:00
|
|
|
// ensure that hitting enter triggers the default button command
|
|
|
|
this.defaultButton = this.defaultButton;
|
2002-10-13 22:44:10 +00:00
|
|
|
|
|
|
|
// if there is a special button configuration, use it
|
|
|
|
if (aButtons) {
|
2003-12-14 08:43:04 +00:00
|
|
|
// expect a comma delimited list of dlgtype values
|
2002-10-13 22:44:10 +00:00
|
|
|
var list = aButtons.split(",");
|
2006-03-29 21:33:41 +00:00
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
// mark shown dlgtypes as true
|
|
|
|
var shown = { accept: false, cancel: false, help: false,
|
|
|
|
disclosure: false, extra1: false, extra2: false };
|
|
|
|
for (i = 0; i < list.length; ++i)
|
|
|
|
shown[list[i].replace(/ /g, "")] = true;
|
2006-10-24 15:36:27 +00:00
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
// hide/show the buttons we want
|
2003-11-15 07:31:01 +00:00
|
|
|
for (dlgtype in buttons)
|
|
|
|
buttons[dlgtype].hidden = !shown[dlgtype];
|
2003-12-17 14:52:48 +00:00
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
# show the spacer on Windows only when the extra2 button is present
|
|
|
|
var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
|
2004-02-11 00:56:17 +00:00
|
|
|
spacer.removeAttribute("hidden");
|
2003-12-17 14:52:48 +00:00
|
|
|
spacer.setAttribute("flex", shown["extra2"]?"1":"0");
|
|
|
|
#endif
|
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
2005-06-18 10:21:49 +00:00
|
|
|
|
|
|
|
<method name="_setDefaultButton">
|
|
|
|
<parameter name="aNewDefault"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
// remove the default attribute from the previous default button, if any
|
|
|
|
var oldDefaultButton = this.getButton(this.defaultButton);
|
|
|
|
if (oldDefaultButton)
|
|
|
|
oldDefaultButton.removeAttribute("default");
|
|
|
|
|
|
|
|
var newDefaultButton = this.getButton(aNewDefault);
|
|
|
|
if (newDefaultButton) {
|
|
|
|
this.setAttribute("defaultButton", aNewDefault);
|
|
|
|
newDefaultButton.setAttribute("default", "true");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.setAttribute("defaultButton", "none");
|
|
|
|
if (aNewDefault != "none")
|
|
|
|
dump("invalid new default button: " + aNewDefault + ", assuming: none\n");
|
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
2002-10-13 22:44:10 +00:00
|
|
|
<method name="_handleButtonCommand">
|
|
|
|
<parameter name="aEvent"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
return document.documentElement._doButtonCommand(
|
|
|
|
aEvent.target.getAttribute("dlgtype"));
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_doButtonCommand">
|
|
|
|
<parameter name="aDlgType"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
var button = this.getButton(aDlgType);
|
|
|
|
if (!button.disabled) {
|
|
|
|
var noCancel = this._fireButtonEvent(aDlgType);
|
|
|
|
if (noCancel) {
|
2014-06-26 17:17:17 +00:00
|
|
|
if (aDlgType == "accept" || aDlgType == "cancel") {
|
|
|
|
var closingEvent = new CustomEvent("dialogclosing", {
|
|
|
|
bubbles: true,
|
|
|
|
detail: { button: aDlgType },
|
|
|
|
});
|
|
|
|
this.dispatchEvent(closingEvent);
|
2002-10-13 22:44:10 +00:00
|
|
|
window.close();
|
2014-06-26 17:17:17 +00:00
|
|
|
}
|
2002-10-13 22:44:10 +00:00
|
|
|
}
|
|
|
|
return noCancel;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_fireButtonEvent">
|
|
|
|
<parameter name="aDlgType"/>
|
|
|
|
<body>
|
|
|
|
<![CDATA[
|
|
|
|
var event = document.createEvent("Events");
|
2006-03-12 21:04:39 +00:00
|
|
|
event.initEvent("dialog"+aDlgType, true, true);
|
2002-10-13 22:44:10 +00:00
|
|
|
|
|
|
|
// handle dom event handlers
|
|
|
|
var noCancel = this.dispatchEvent(event);
|
|
|
|
|
|
|
|
// handle any xml attribute event handlers
|
|
|
|
var handler = this.getAttribute("ondialog"+aDlgType);
|
|
|
|
if (handler != "") {
|
|
|
|
var fn = new Function("event", handler);
|
|
|
|
var returned = fn(event);
|
|
|
|
if (returned == false)
|
|
|
|
noCancel = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return noCancel;
|
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method name="_hitEnter">
|
2003-08-12 01:19:58 +00:00
|
|
|
<parameter name="evt"/>
|
2002-10-13 22:44:10 +00:00
|
|
|
<body>
|
|
|
|
<![CDATA[
|
2011-12-08 09:21:32 +00:00
|
|
|
if (evt.defaultPrevented)
|
2003-08-12 01:19:58 +00:00
|
|
|
return;
|
2002-10-13 22:44:10 +00:00
|
|
|
|
2005-06-18 10:21:49 +00:00
|
|
|
var btn = this.getButton(this.defaultButton);
|
|
|
|
if (btn)
|
|
|
|
this._doButtonCommand(this.defaultButton);
|
2002-10-13 22:44:10 +00:00
|
|
|
]]>
|
|
|
|
</body>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
</implementation>
|
|
|
|
|
|
|
|
<handlers>
|
2005-05-17 18:02:04 +00:00
|
|
|
<handler event="keypress" keycode="VK_RETURN"
|
|
|
|
group="system" action="this._hitEnter(event);"/>
|
|
|
|
<handler event="keypress" keycode="VK_ESCAPE" group="system">
|
2011-12-08 09:21:32 +00:00
|
|
|
if (!event.defaultPrevented)
|
2005-05-17 18:02:04 +00:00
|
|
|
this.cancelDialog();
|
|
|
|
</handler>
|
2003-08-12 01:19:58 +00:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
<handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
|
2005-09-20 16:22:39 +00:00
|
|
|
#else
|
|
|
|
<handler event="focus" phase="capturing">
|
|
|
|
var btn = this.getButton(this.defaultButton);
|
|
|
|
if (btn)
|
|
|
|
btn.setAttribute("default", event.originalTarget == btn || !(event.originalTarget instanceof Components.interfaces.nsIDOMXULButtonElement));
|
|
|
|
</handler>
|
2003-08-12 01:19:58 +00:00
|
|
|
#endif
|
2002-10-13 22:44:10 +00:00
|
|
|
</handlers>
|
|
|
|
|
|
|
|
</binding>
|
|
|
|
|
2009-09-04 10:58:18 +00:00
|
|
|
<binding id="dialogheader">
|
|
|
|
<resources>
|
|
|
|
<stylesheet src="chrome://global/skin/dialog.css"/>
|
|
|
|
</resources>
|
2002-10-13 22:44:10 +00:00
|
|
|
<content>
|
2003-10-17 21:27:28 +00:00
|
|
|
<xul:label class="dialogheader-title" xbl:inherits="value=title,crop" crop="right" flex="1"/>
|
2002-10-13 22:44:10 +00:00
|
|
|
<xul:label class="dialogheader-description" xbl:inherits="value=description"/>
|
|
|
|
</content>
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
</bindings>
|