зеркало из https://github.com/mozilla/gecko-dev.git
Bug 282188: sync xpfe toolbar.xml with toolkit - delayed removal of now unused file
This commit is contained in:
Родитель
6960805494
Коммит
b41bcdfbd3
|
@ -1,299 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
XXX THIS FILE IS DEPRECATED AND NO LONGER USED!
|
||||
Per the SeaMonkey toolkit transition plan, jar.mn refers to
|
||||
/toolkit/content/widgets/toolbar.xml
|
||||
instead of this file.
|
||||
DO NOT MAKE ANY FURTHER CHANGES TO THIS FILE,
|
||||
AS IT WILL EVENTUALLY BE REMOVED FROM THE REPOSITORY!
|
||||
See bug 282188 for details.
|
||||
-->
|
||||
|
||||
<bindings id="toolbarBindings"
|
||||
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="toolbar-base">
|
||||
<resources>
|
||||
<stylesheet src="chrome://global/skin/toolbar.css"/>
|
||||
</resources>
|
||||
<implementation implements="nsIAccessibleProvider">
|
||||
<property name="accessibleType" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (this.localName == "toolbarseparator")
|
||||
return Components.interfaces.nsIAccessibleProvider.XULToolbar;
|
||||
else
|
||||
return Components.interfaces.nsIAccessibleProvider.XULToolbar;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="toolbox" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
|
||||
<content orient="vertical">
|
||||
<xul:vbox flex="1" class="toolbar-internal-box">
|
||||
<children/>
|
||||
</xul:vbox>
|
||||
<xul:hbox tbattr="collapsed-tray-holder" class="collapsed-tray-holder" moz-collapsed="true">
|
||||
<xul:hbox tbattr="collapsed-tray" class="collapsed-tray"/>
|
||||
<xul:spacer flex="1" class="collapsed-tray-spacer"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<method name="collapseToolbar">
|
||||
<parameter name="toolbar"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
try {
|
||||
this.createCollapsedGrippy(toolbar);
|
||||
toolbar.setAttribute("moz-collapsed", "true");
|
||||
document.persist(toolbar.id, "moz-collapsed");
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="expandToolbar">
|
||||
<parameter name="aGrippyID"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var idString = aGrippyID.substring("moz_tb_collapsed_".length, aGrippyID.length);
|
||||
var toolbar = document.getElementById(idString);
|
||||
toolbar.setAttribute("moz-collapsed", "false");
|
||||
var collapsedTray = document.getAnonymousElementByAttribute(this, "tbattr", "collapsed-tray");
|
||||
var collapsedToolbar = document.getElementById("moz_tb_collapsed_" + toolbar.id);
|
||||
collapsedTray.removeChild(collapsedToolbar);
|
||||
if (!collapsedTray.hasChildNodes())
|
||||
document.getAnonymousElementByAttribute(this, "tbattr", "collapsed-tray-holder").setAttribute("moz-collapsed", "true");
|
||||
document.persist(toolbar.id, "moz-collapsed");
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="createCollapsedGrippy">
|
||||
<parameter name="aToolbar"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
try {
|
||||
var grippy = document.getAnonymousElementByAttribute(aToolbar, "tbattr", "toolbar-grippy");
|
||||
var boxObject = grippy.boxObject.QueryInterface(Components.interfaces.nsIBoxObject);
|
||||
var collapsedGrippy = document.createElementNS(XUL_NS, "toolbargrippy");
|
||||
if (collapsedGrippy) {
|
||||
var width = boxObject.height > 20 ? boxObject.height : 23;
|
||||
var height = boxObject.width > 10 ? boxObject.width : 12;
|
||||
var styleString = "width: " + width + "px; height: " + height + "px;";
|
||||
collapsedGrippy.setAttribute("style", styleString);
|
||||
collapsedGrippy.setAttribute("tooltiptext", aToolbar.getAttribute("grippytooltiptext"));
|
||||
collapsedGrippy.setAttribute("id", "moz_tb_collapsed_" + aToolbar.id);
|
||||
collapsedGrippy.setAttribute("moz_grippy_collapsed", "true");
|
||||
collapsedGrippy.setAttribute("tbgrippy-collapsed", "true");
|
||||
var collapsedTrayHolder = document.getAnonymousElementByAttribute(this, "tbattr", "collapsed-tray-holder");
|
||||
if (collapsedTrayHolder.getAttribute("moz-collapsed") == "true")
|
||||
collapsedTrayHolder.removeAttribute("moz-collapsed");
|
||||
document.getAnonymousElementByAttribute(this, "tbattr", "collapsed-tray").appendChild(collapsedGrippy);
|
||||
collapsedGrippy = document.getElementById("moz_tb_collapsed_" + aToolbar.id);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<property name="deferAttached">
|
||||
<getter>
|
||||
return (this.hasAttribute("deferattached") ? "true" : "false");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val)
|
||||
this.setAttribute("deferattached", "true");
|
||||
else
|
||||
this.removeAttribute("deferattached");
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="toolbar" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
|
||||
<content>
|
||||
<xul:toolbargrippy xbl:inherits="last-toolbar,hidden=grippyhidden"
|
||||
tbattr="toolbar-grippy"
|
||||
class="toolbar-grippy"/>
|
||||
<xul:hbox class="toolbar-prefix"
|
||||
xbl:inherits="onclick=prefixonclick,tooltiptext=prefixtooltip,hidden=prefixhidden,prefixopen"/>
|
||||
<xul:hbox flex="1" class="toolbar-holder" align="center"
|
||||
xbl:inherits="collapsed,last-toolbar,orient=tborient,align=tbalign,pack=tbpack">
|
||||
<children/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
if (this.getAttribute("moz-collapsed") == "true" &&
|
||||
this.parentNode.localName == "toolbox")
|
||||
this.parentNode.createCollapsedGrippy(this);
|
||||
]]>
|
||||
</constructor>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="toolbar-primary" extends="chrome://global/content/bindings/toolbar.xml#toolbar">
|
||||
<implementation implements="nsIObserver">
|
||||
<field name="domain" readonly="true">
|
||||
"browser.chrome.toolbar_style"
|
||||
</field>
|
||||
|
||||
<field name="prefs" readonly="true">
|
||||
Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService).getBranch(null)
|
||||
.QueryInterface(Components.interfaces.nsIPrefBranch2)
|
||||
</field>
|
||||
|
||||
<method name="observe">
|
||||
<parameter name="subject"/>
|
||||
<parameter name="topic"/>
|
||||
<parameter name="name"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (topic == "nsPref:changed" && name == this.domain) {
|
||||
const styles = ["pictures", "text", null];
|
||||
const style = styles[this.prefs.getIntPref(name)];
|
||||
this.setAttribute("buttonstyle", style);
|
||||
this.update("toolbarbutton", style);
|
||||
this.update("button", style);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="update">
|
||||
<parameter name="tag"/>
|
||||
<parameter name="style"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var elements = this.getElementsByTagName(tag);
|
||||
for (var i = 0; i < elements.length; i++)
|
||||
elements[i].setAttribute("buttonstyle", style);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<constructor>
|
||||
this.prefs.addObserver(this.domain, this, false);
|
||||
if (this.prefs.getIntPref(this.domain) != 2)
|
||||
this.observe(this.prefs, "nsPref:changed", this.domain);
|
||||
</constructor>
|
||||
|
||||
<destructor>
|
||||
this.prefs.removeObserver(this.domain, this);
|
||||
</destructor>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="menubar" extends="xul:menubar">
|
||||
<resources>
|
||||
<stylesheet src="chrome://global/skin/toolbar.css"/>
|
||||
</resources>
|
||||
|
||||
<content>
|
||||
<xul:toolbargrippy xbl:inherits="last-toolbar,hidden=grippyhidden"
|
||||
tbattr="toolbar-grippy" class="toolbar-grippy"/>
|
||||
<xul:hbox flex="1" class="toolbar-holder" xbl:inherits="collapsed,last-toolbar" align="center">
|
||||
<children/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation implements="nsIAccessibleProvider">
|
||||
<property name="accessibleType" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
return Components.interfaces.nsIAccessibleProvider.XULMenubar;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
if (this.getAttribute("moz-collapsed") == "true" &&
|
||||
this.parentNode.localName == "toolbox")
|
||||
this.parentNode.createCollapsedGrippy(this);
|
||||
]]>
|
||||
</constructor>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="toolbargrippy" display="xul:button"
|
||||
extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
|
||||
<content>
|
||||
<xul:image class="toolbargrippy-arrow"/>
|
||||
<xul:spacer class="toolbargrippy-texture" flex="1"/>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<property name="collapsed">
|
||||
<getter>
|
||||
return this.hasAttribute("moz_grippy_collapsed");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val)
|
||||
this.setAttribute("moz_grippy_collapsed", "true");
|
||||
else
|
||||
this.removeAttribute("moz_grippy_collapsed");
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<method name="returnNode">
|
||||
<parameter name="aNodeA"/>
|
||||
<parameter name="aNodeB"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var node = this.parentNode;
|
||||
while (node && node.localName != "window" &&
|
||||
(node.localName != aNodeA && (node.localName != aNodeB))) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
return node;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="grippyTriggered">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var toolbox = this.returnNode("toolbox");
|
||||
var toolbar = this.returnNode("toolbar", "menubar");
|
||||
if (this.collapsed)
|
||||
toolbox.expandToolbar(this.id);
|
||||
else
|
||||
toolbox.collapseToolbar(toolbar);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="command">
|
||||
<![CDATA[
|
||||
this.grippyTriggered();
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="toolbarseparator" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base"/>
|
||||
|
||||
</bindings>
|
||||
|
Загрузка…
Ссылка в новой задаче