home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 May
/
PCWorld_2003-05_cd.bin
/
Komunik
/
phoenix
/
chrome
/
toolkit.jar
/
content
/
global
/
bindings
/
toolbar.xml
< prev
next >
Wrap
Extensible Markup Language
|
2002-11-05
|
4KB
|
116 lines
<?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>
<implementation implements="nsIAccessibleProvider">
<property name="accessible">
<getter>
<![CDATA[
var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
if (this.localName == "toolbarseparator")
return accService.createXULToolbarSeparatorAccessible(this);
else
return accService.createXULToolbarAccessible(this);
]]>
</getter>
</property>
</implementation>
</binding>
<binding id="toolbar" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base">
<content>
<xul:hbox flex="1" class="toolbar-holder" align="center"
xbl:inherits="collapsed,last-toolbar,orient=tborient,align=tbalign,pack=tbpack">
<children/>
</xul:hbox>
</content>
</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.nsIPrefBranchInternal)
</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:hbox flex="1" class="toolbar-holder" xbl:inherits="collapsed,last-toolbar" align="center">
<children/>
</xul:hbox>
</content>
<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>
<binding id="toolbarseparator" extends="chrome://global/content/bindings/toolbar.xml#toolbar-base"/>
</bindings>