gecko-dev/toolkit/content/widgets/toolbar.xml

100 строки
3.0 KiB
XML
Исходник Обычный вид История

2002-08-05 08:19:42 +04:00
<?xml version="1.0"?>
<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>
</binding>
2002-08-05 11:21:57 +04:00
<binding id="toolbar" extends="chrome://global/content/widgets/toolbar.xml#toolbar-base">
<implementation>
<field name="palette">
null
</field>
<field name="afterPalette">
null
</field>
<method name="buildItemsFromPalette">
<body>
<![CDATA[
2002-08-06 11:03:36 +04:00
var currentSet = this.getAttribute("currentset");
if (!currentSet)
currentSet = this.getAttribute("defaultset");
if (!currentSet)
return;
2002-08-05 11:21:57 +04:00
var node = this.firstChild;
while (node) {
if (node.localName == "toolbarpalette")
break;
node = node.nextSibling;
}
if (!node)
return;
this.afterPalette = node.nextSibling;
this.palette = node;
this.removeChild(node);
2002-08-06 05:52:11 +04:00
2002-08-05 11:21:57 +04:00
var items = currentSet.split(",");
for (var i = 0; i < items.length; i++) {
var item = items[i];
2002-08-05 11:37:56 +04:00
if (!item) continue;
2002-08-05 11:21:57 +04:00
// Attempt to locate the item within the palette's list of children.
var paletteItem = node.firstChild;
while (paletteItem) {
var paletteID = paletteItem.getAttribute("id");
if (paletteID == item) {
var newItem = paletteItem.cloneNode(true);
2002-08-05 12:50:45 +04:00
newItem.hidden = true;
2002-08-05 11:21:57 +04:00
this.insertBefore(newItem, this.afterPalette);
2002-08-05 12:50:45 +04:00
newItem.hidden = false;
2002-08-05 11:37:56 +04:00
break;
2002-08-05 11:21:57 +04:00
}
paletteItem = paletteItem.nextSibling;
}
}
]]>
</body>
</method>
<constructor>
<![CDATA[
this.buildItemsFromPalette();
]]>
</constructor>
</implementation>
</binding>
2002-08-05 11:12:36 +04:00
<binding id="toolbox" extends="chrome://global/content/widgets/toolbar.xml#toolbar-base"/>
2002-08-05 08:19:42 +04:00
<binding id="menubar" extends="xul:menubar">
<resources>
<stylesheet src="chrome://global/skin/toolbar.css"/>
</resources>
<implementation implements="nsIAccessibleProvider">
<property name="accessible">
<getter>
<![CDATA[
var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
return accService.createXULMenubarAccessible(this);
]]>
</getter>
</property>
</implementation>
</binding>
2002-08-05 11:12:53 +04:00
<binding id="toolbarseparator" extends="chrome://global/content/widgets/toolbar.xml#toolbar-base"/>
2002-08-05 08:19:42 +04:00
<binding id="toolbarpaletteitem" extends="xul:button"/>
2002-08-05 08:19:42 +04:00
</bindings>