[Pkg-mozext-commits] [compactheader] 49/441: First trails for toolbar in message header pane.
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 12:28:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository compactheader.
commit b59d4eaf04aab24a3498c55dd2f5287864e08d1f
Author: joachim.herb <none at none>
Date: Thu Sep 10 21:49:31 2009 +0000
First trails for toolbar in message header pane.
---
chrome/CompactHeader/content/cohe.xml | 264 +++++++++++++++++++++
.../CompactHeader/content/compactHeaderOverlay.js | 39 ++-
.../CompactHeader/content/compactHeaderOverlay.xul | 37 ++-
chrome/CompactHeader/skin/global/CompactHeader.css | 9 +
4 files changed, 345 insertions(+), 4 deletions(-)
diff --git a/chrome/CompactHeader/content/cohe.xml b/chrome/CompactHeader/content/cohe.xml
new file mode 100644
index 0000000..5a0618a
--- /dev/null
+++ b/chrome/CompactHeader/content/cohe.xml
@@ -0,0 +1,264 @@
+<?xml version="1.0"?>
+
+<bindings 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="CoHeToolbox" extends="chrome://global/content/bindings/toolbar.xml#toolbox">
+
+ <implementation>
+
+ <field name="anonymous">false</field>
+ <field name="palette">null</field>
+
+ <constructor>
+ <![CDATA[
+
+ var paletteId = "BrowserToolbarPalette";
+
+ var tt = (typeof document.toolbarpalettes == "object") ? true : false;
+
+ if(this.CoHePalette && !tt) return;
+
+ if(document.getElementById(paletteId)) {
+ document.CoHePalette = document.getElementById(paletteId).cloneNode(true);
+ }
+ else if(tt && document.toolbarpalettes[paletteId]){
+ document.CoHePalette = document.toolbarpalettes[paletteId];
+ }
+
+ this.palette = document.CoHePalette;
+ this.CoHePalette = true;
+
+ ]]>
+ </constructor>
+ </implementation>
+ </binding>
+
+
+ <binding id="CoHeToolbar">
+ <implementation implements="nsIAccessibleProvider">
+ <property name="accessibleType" readonly="true">
+ <getter>
+ return Components.interfaces.nsIAccessibleProvider.XULToolbar;
+ </getter>
+ </property>
+ <field name="firstPermanentChild">
+ null
+ </field>
+ <field name="lastPermanentChild">
+ null
+ </field>
+ <field name="palette">null</field>
+
+ <property name="toolbarName"
+ onget="return this.getAttribute('toolbarname');"
+ onset="this.setAttribute('toolbarname', val); return val;"/>
+
+ <constructor>
+ <![CDATA[
+
+ // Searching for the toolbox palette in the toolbar binding because
+ // toolbars are constructed first.
+ var toolbox = (this.localName == 'statusbar') ? this : this.parentNode;
+
+ if (!toolbox.palette) {
+ // Look to see if there is a toolbarpalette.
+ var node = toolbox.firstChild;
+ while (node) {
+ if (node.localName == "toolbarpalette")
+ break;
+ node = node.nextSibling;
+ }
+
+ if (!node)
+ return;
+
+ // Hold on to the palette but remove it from the document.
+ toolbox.palette = node;
+ toolbox.removeChild(node);
+ }
+
+ // Build up our contents from the palette.
+ var currentSet = this.getAttribute("currentset");
+ if (!currentSet)
+ currentSet = this.getAttribute("defaultset");
+ if (currentSet) {
+ this.currentSet = currentSet;
+
+ // Update attribute, items may have been uninstalled..
+ this.setAttribute("currentset", this.currentSet);
+ // Persist currentset only on fixed toolbars, not user defined toolbars..
+ if (!this.hasAttribute("customindex"))
+ document.persist(this.id, "currentset");
+ }
+
+ // If only one toolbar in toolbox and it's empty, set it..
+ var count = 0;
+ var child = toolbox.lastChild;
+ while(child) {
+ if (child.localName == "toolbar")
+ ++count;
+ child = child.previousSibling;
+ }
+
+ if (count <= 1 && this.currentSet == "__empty")
+ toolbox.setAttribute("empty", true);
+ ]]>
+ </constructor>
+
+ <property name="currentSet">
+ <getter>
+ <![CDATA[
+ var node = this.firstChild;
+ var currentSet = "";
+ while (node) {
+ if (node.id &&
+ (this.localName == "statusbar" && !node.hasAttribute("removed")) ||
+ node.localName == "toolbaritem" ||
+ node.localName == "toolbarbutton" ||
+ node.localName == "toolbarseparator" ||
+ node.localName == "toolbarspring" ||
+ node.localName == "toolbarspacer")
+ {
+ if (currentSet)
+ currentSet += ",";
+
+ if (node.localName == "toolbarseparator")
+ currentSet += "separator";
+ else if (node.localName == "toolbarspring")
+ currentSet += "spring";
+ else if (node.localName == "toolbarspacer")
+ currentSet += "spacer";
+ else
+ currentSet += node.id;
+ }
+ node = node.nextSibling;
+ }
+
+ return currentSet ? currentSet : "__empty";
+ ]]>
+ </getter>
+
+ <setter>
+ <![CDATA[
+
+ // Remove all items before the first permanent child and after the last permanent child.
+ while (this.lastChild) {
+ if (this.lastChild == this.lastPermanentChild ||
+ (this.lastChild.localName == "toolbarpaletteitem" &&
+ this.lastChild.firstChild == this.lastPermanentChild))
+ break;
+ this.removeChild(this.lastChild);
+ }
+
+ while (this.firstChild) {
+ if (this.firstChild == this.firstPermanentChild ||
+ (this.firstChild.localName == "toolbarpaletteitem" &&
+ this.firstChild.firstChild == this.firstPermanentChild))
+ break;
+ this.removeChild(this.firstChild);
+ }
+
+ var firstChildID = this.firstPermanentChild ? this.firstPermanentChild.id : "";
+ var lastChildID = this.lastPermanentChild ? this.lastPermanentChild.id : "";
+
+ if (val && val != "__empty") {
+ var itemIds = val.split(",");
+ var before = true;
+ for (var i = 0; i < itemIds.length; i++) {
+ if (itemIds[i] == firstChildID || itemIds[i] == lastChildID)
+ before = false;
+ else
+ this.insertItem(itemIds[i], null, null, before);
+ }
+ }
+ return val;
+ ]]>
+ </setter>
+ </property>
+
+ <method name="insertItem">
+ <parameter name="aId"/>
+ <parameter name="aBeforeElt"/>
+ <parameter name="aWrapper"/>
+ <parameter name="aBeforePermanent"/>
+ <body>
+ <![CDATA[
+ var newItem = null;
+
+ // Create special cases of palette items.
+ var uniqueId;
+ if (aId == "separator") {
+ newItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ "toolbarseparator");
+ uniqueId = (new Date()).getTime()+this.childNodes.length;
+ newItem.id = "separator" + uniqueId;
+ newItem.className = "chromeclass-toolbar-additional";
+ } else if (aId == "spring") {
+ newItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ "toolbarspring");
+ uniqueId = (new Date()).getTime()+this.childNodes.length;
+ newItem.flex = 1;
+ newItem.id = "spring" + uniqueId;
+ newItem.className = "chromeclass-toolbar-additional";
+ } else if (aId == "spacer") {
+ newItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ "toolbarspacer");
+ uniqueId = (new Date()).getTime()+this.childNodes.length;
+ newItem.id = "spacer" + uniqueId;
+ newItem.className = "chromeclass-toolbar-additional";
+ } else if (this.parentNode.localName == "toolbox" || this.localName == "statusbar") {
+
+ //if (document.getElementById(aId))
+ //return false;
+ // Attempt to locate an item with a matching id within palette.
+ var paletteItem = this.parentNode.palette.firstChild;
+ while (paletteItem) {
+ var paletteId = paletteItem.id;
+ if (paletteId == aId) {
+ newItem = paletteItem.cloneNode(true);
+ break;
+ }
+ paletteItem = paletteItem.nextSibling;
+ }
+ }
+
+ if (!newItem)
+ return false;
+
+ var insertItem = newItem;
+
+ // Wrap the item in another node if so inclined.
+ if (aWrapper) {
+ aWrapper.appendChild(newItem);
+ insertItem = aWrapper;
+ }
+
+ // Insert the palette item into the toolbar.
+ if (aBeforeElt)
+ this.insertBefore(insertItem, aBeforeElt);
+ else if (aBeforePermanent && this.firstPermanentChild)
+ this.insertBefore(insertItem, this.firstPermanentChild);
+ else
+ this.appendChild(insertItem);
+
+ return newItem;
+ ]]>
+ </body>
+ </method>
+ </implementation>
+ </binding>
+
+
+ <!-- like chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem, but with a vbox rather than hbox
+ <binding id="toolbarpaletteitem-vertical" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base" display="xul:button">
+ <content>
+ <xul:vbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
+ <children/>
+ </xul:vbox>
+ </content>
+ </binding>-->
+
+</bindings>
\ No newline at end of file
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.js b/chrome/CompactHeader/content/compactHeaderOverlay.js
index e7aec20..5802f8e 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.js
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.js
@@ -587,12 +587,12 @@ function updateHdrIconText() {
document.getElementById("tagMenuPopup"),
document.getElementById("otherActionsButton")];
if (prefBranch.getBoolPref("buttons.showonlyicon")) {
- for (i=0; i<myE.length; i++) {
+ for (var i=0; i<myE.length; i++) {
myE[i].removeAttribute("OnlyIcon");
myE[i].setAttribute("OnlyIcon", "Icon");
}
} else {
- for (i=0; i<myE.length; i++) {
+ for (var i=0; i<myE.length; i++) {
myE[i].removeAttribute("OnlyIcon");
myE[i].setAttribute("OnlyIcon", "Text");
}
@@ -819,3 +819,38 @@ var myPrefObserverIconText =
myPrefObserverView.register();
myPrefObserverHeaderSize.register();
myPrefObserverIconText.register();
+
+/*
+function CoHe_customizeToolbar(aWhich) {
+
+ // feststellen, welche Toolbar konfiguriert werden soll
+ var elem = aWhich;
+ while(elem.tagName != "popup") {
+ elem = elem.parentNode;
+ }
+
+ var tbar = document.getElementById("HeaderPaneToolbar");
+ var toolbox = document.getElementById(tbar.parentNode.id);
+
+ toolbox.customizeDone = CoHe_customizeToolbarDone;
+ document.getElementById('CoHe-customize-mitem').setAttribute("disabled", "true");
+
+ // l�st Reaktion auf �nderungen der Icongr��e/Symbolanzeige im Anpassen-Dialog aus
+ CoHeInterval = window.setInterval("CoHe_adjustToolboxWidth(true)", 100);
+
+ openDialog("chrome://global/content/customizeToolbar.xul", "CustomizeToolbar", "chrome,all,dependent", toolbox);
+}
+*/
+
+/*
+ Schlie�t die Symbolleisten-Konfiguration ab
+ => Aufruf durch CoHe_customizeToolbar()
+*/
+/*
+function CoHe_customizeToolbarDone(aToolboxChanged) {
+ if(document.getElementById('CoHe-customize-mitem'))
+ document.getElementById('CoHe-customize-mitem').removeAttribute("disabled");
+
+ window.focus();
+}
+*/
\ No newline at end of file
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.xul b/chrome/CompactHeader/content/compactHeaderOverlay.xul
index 375a8ad..6c68d76 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.xul
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.xul
@@ -33,7 +33,6 @@
<command id="cmd_viewNormalHeader" oncommand="alert('test2');goDoCommand('cmd_viewNormalHeader'); event.stopPropagation()"/>
</commandset>
-
<keyset>
<key id="hideDetailsKey"
modifiers="shift"
@@ -41,7 +40,6 @@
oncommand="coheToggleHeaderView();"/>
</keyset>
-
<deck id="msgHeaderViewDeck">
@@ -55,6 +53,41 @@
</vbox>
<hbox id="expandedHeaders" flex="1">
+<!--
+ <popup id="header-toolbar-contextmenu">
+ <menuitem id="CoHe-customize-mitem" label="TEST" oncommand="CoHe_customizeToolbar(this);" />
+ </popup>
+
+ <toolbarbox id="HeaderPaneToolbarBox"
+ iconsize="small"
+ mode="icons"
+ style="min-width: 29px; max-width: 29px; background-color: red; "
+ class="chromeclass-toolbar">
+ <toolbar id="HeaderPaneToolbar"
+ class="chromeclass-toolbar"
+ toolbarname="HeaderToolbar"
+ fullscreentoolbar="true"
+ mode="icons"
+ defaultmode="icons"
+ customizable="true"
+ context="header-toolbar-contextmenu"
+ persist="posMode mode iconsize flexbuttons hidden"
+ defaultset="button-reply,button-replyall,button-replylist,button-forward,button-tag,button-delete,button-junk,button-print"
+ currentset="button-reply,button-replyall,button-replylist,button-forward,button-tag,button-delete,button-junk,button-print"
+ iconsize="small">
+ <toolbarbutton id="button-reply2"
+ class="toolbarbutton-1"
+ label="Reply"
+ tooltiptext="Reply to the message"
+ observes="button_reply"
+ oncommand="MsgReplyMessage(event)"
+ chromedir="ltr"/>
+ </toolbar>
+
+
+ <toolbarset id="HeaderPaneToolbarSet" context="header-toolbar-contextmenu"/>
+ </toolbarbox>
+-->
<vbox id="otherHeadersAndButtonsBox" flex="1">
<vbox id="otherActionsBox">
<button type="menu" id="otherActionsButton"
diff --git a/chrome/CompactHeader/skin/global/CompactHeader.css b/chrome/CompactHeader/skin/global/CompactHeader.css
index 3d40fa5..17a5975 100644
--- a/chrome/CompactHeader/skin/global/CompactHeader.css
+++ b/chrome/CompactHeader/skin/global/CompactHeader.css
@@ -46,6 +46,15 @@
min-width: 1px;
}
+/*
+#HeaderPaneToolbarBox {
+ -moz-binding: url(chrome://CompactHeader/content/cohe.xml#CoHeToolbox);
+}
+
+#HeaderPaneToolbar{
+ -moz-binding: url(chrome://CompactHeader/content/cohe.xml#CoHeToolbar);
+}
+*/
#expandedButtonBox .button-menubutton-button,
#collapsedButtonBox .button-menubutton-button {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git
More information about the Pkg-mozext-commits
mailing list