From 9d05642ab3b8063b652a8d1919fb3b2fd0812fe9 Mon Sep 17 00:00:00 2001 From: Frank-Rainer Grahl Date: Sat, 6 Apr 2019 16:33:50 +0200 Subject: [PATCH] Bug 1540440 - Copy and restore common bindings for suite. r=IanN --HG-- rename : common/bindings/toolbar.xml => suite/components/bindings/toolbar.xml --- suite/components/bindings/jar.mn | 8 +- suite/components/bindings/numberbox.xml | 217 ++++++++ suite/components/bindings/spinbuttons.xml | 92 ++++ suite/components/bindings/textbox.xml | 252 ++++++++++ suite/components/bindings/toolbar.xml | 579 ++++++++++++++++++++++ 5 files changed, 1144 insertions(+), 4 deletions(-) create mode 100644 suite/components/bindings/numberbox.xml create mode 100644 suite/components/bindings/spinbuttons.xml create mode 100644 suite/components/bindings/textbox.xml create mode 100644 suite/components/bindings/toolbar.xml diff --git a/suite/components/bindings/jar.mn b/suite/components/bindings/jar.mn index 8f94fed03c..098fcef1bb 100644 --- a/suite/components/bindings/jar.mn +++ b/suite/components/bindings/jar.mn @@ -11,10 +11,10 @@ comm.jar: content/communicator/bindings/general.xml (general.xml) content/communicator/bindings/generalBindings.xml (../../../common/bindings/generalBindings.xml) content/communicator/bindings/notification.xml (notification.xml) - content/communicator/bindings/numberbox.xml (../../../common/bindings/numberbox.xml) + content/communicator/bindings/numberbox.xml (numberbox.xml) content/communicator/bindings/preferences.xml (preferences.xml) - content/communicator/bindings/spinbuttons.xml (../../../common/bindings/spinbuttons.xml) -* content/communicator/bindings/textbox.xml (../../../common/bindings/textbox.xml) -* content/communicator/bindings/toolbar.xml (../../../common/bindings/toolbar.xml) + content/communicator/bindings/spinbuttons.xml (spinbuttons.xml) +* content/communicator/bindings/textbox.xml (textbox.xml) + content/communicator/bindings/toolbar.xml (toolbar.xml) content/communicator/bindings/toolbar-xpfe.xml (toolbar-xpfe.xml) * content/communicator/bindings/prefwindow.xml (prefwindow.xml) diff --git a/suite/components/bindings/numberbox.xml b/suite/components/bindings/numberbox.xml new file mode 100644 index 0000000000..8f18bcbcdd --- /dev/null +++ b/suite/components/bindings/numberbox.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + false + null + 0 + + + + + + + + + + + + if (this._valueEntered) { + var newval = this.inputField.value; + this._validateValue(newval); + } + return this._value; + + + this._validateValue(val); + return val; + + + + + var min = this.getAttribute("min"); + return min ? Number(min) : 0; + + + + + + + + + var max = this.getAttribute("max"); + return max ? Number(max) : Infinity; + + + val) + this._validateValue(val); + return val; + ]]> + + + + + + + + + + + + + + + + + = this.max); + } + ]]> + + + + + + + max) + aValue = max; + + this._valueEntered = false; + this._value = Number(aValue); + this.inputField.value = aValue; + + this._enableDisableButtons(); + + return aValue; + ]]> + + + + + + var evt = document.createEvent("Events"); + evt.initEvent("change", true, true); + this.dispatchEvent(evt); + + + + + + + + + + this._valueEntered = true; + + + + 57) + event.preventDefault(); + } + ]]> + + + + this._modifyUp(); + + + + this._modifyDown(); + + + + this._modifyUp(); + + + + this._modifyDown(); + + + + if (event.originalTarget == this.inputField) { + var newval = this.inputField.value; + this._validateValue(newval); + } + + + + + diff --git a/suite/components/bindings/spinbuttons.xml b/suite/components/bindings/spinbuttons.xml new file mode 100644 index 0000000000..90c249c9b2 --- /dev/null +++ b/suite/components/bindings/spinbuttons.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + return document.getAnonymousElementByAttribute(this, "anonid", "increaseButton"); + + + + + return document.getAnonymousElementByAttribute(this, "anonid", "decreaseButton"); + + + + + + + + + + + + + + this.removeAttribute("state"); + + + this.removeAttribute("state"); + + + + + + + + + + \ No newline at end of file diff --git a/suite/components/bindings/textbox.xml b/suite/components/bindings/textbox.xml new file mode 100644 index 0000000000..720944a94e --- /dev/null +++ b/suite/components/bindings/textbox.xml @@ -0,0 +1,252 @@ + + + + + + + + %textcontextDTD; +]> + + + + + + + + + + + + + + + "" + "" + "" + "" + + null + false + false + null + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this.inputField.select(); + + + + + + + + + + + + + this.inputField.setSelectionRange(aSelectionStart, aSelectionEnd); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ifndef XP_WIN + + // Only care about context clicks on the textbox itself. + if (event.target != this) + return; + + if (!event.button) // context menu opened via keyboard shortcut + return; + this._maybeSelectAll(); + // see bug 576135 comment 4 + let box = this.inputField.parentNode; + box._doPopupItemEnabling(box.menupopup); + +#endif + + + diff --git a/suite/components/bindings/toolbar.xml b/suite/components/bindings/toolbar.xml new file mode 100644 index 0000000000..cf36b421ad --- /dev/null +++ b/suite/components/bindings/toolbar.xml @@ -0,0 +1,579 @@ + + + + + + + + + + null + + + + null + + + + 0 + + + + [] + + + + + + + + + + + + + + + + + + + + + + + + + + + null + + + + + + + + + + + + + + + + + + + + + + + + + + + + = nodeidx; i--) { + let curNode = children[i]; + + let curNodeId = this._idFromNode(curNode); + // skip over fixed items + if (curNodeId && curNode.getAttribute("removable") == "true") { + if (palette) + palette.appendChild(curNode); + else + this.removeChild(curNode); + } + } + + return val; + ]]> + + + + 0 + + + + + + + + + + + + + + + + + + + !defaultOrNoninteractive.includes(item)); + ]]> + + + + + + + + this._setInactive(); + + + this._setActive(); + + + null + + + + + + + + + + + + + + + + + + + + + + + + + + + false + null + null + + + + + + + + + + + + + + + + this._updateStatusText(event.target.statusText); + this._updateStatusText(""); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +