home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!DOCTYPE bindings [
- <!ENTITY % locale SYSTEM "chrome://yasearch/locale/package-management/package-management.dtd">
- %locale;
- ]>
-
- <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"
- xmlns:html="http://www.w3.org/1999/xhtml">
-
- <binding id="head"
- inheritstyle="false">
- <resources>
- <stylesheet src="head.css"/>
- <image src="exclamation.png"/>
- </resources>
-
- <content>
- <xul:hbox class="box">
- <xul:vbox class="image">
- <xul:image xbl:inherits="src=image" onerror="this.removeAttribute('src');"/>
- </xul:vbox>
- <xul:vbox class="content">
- <xul:label class="title" xbl:inherits="crop"/>
- <xul:label class="description" xbl:inherits="crop"/>
- </xul:vbox>
- </xul:hbox>
- </content>
-
- <implementation>
- <field name="_nodeTitle">document.getAnonymousElementByAttribute(this, "class", "title")</field>
- <field name="_nodeDescription">document.getAnonymousElementByAttribute(this, "class", "description")</field>
-
- <constructor><![CDATA[
- this.crop = this.getAttribute("crop") || null;
- this.title = this.getAttribute("title") || "";
- this.description = this.getAttribute("description") || "";
- ]]></constructor>
-
- <property name="image">
- <getter><![CDATA[
- return this.getAttribute("image");
- ]]></getter>
- <setter><![CDATA[
- if (val)
- this.setAttribute("image", val);
- else
- this.removeAttribute("image");
- return val;
- ]]></setter>
- </property>
-
- <property name="title">
- <getter><![CDATA[
- return this._title;
- ]]></getter>
- <setter><![CDATA[
- this.set(this._nodeTitle, this._title = val);
- return val;
- ]]></setter>
- </property>
-
- <property name="description">
- <getter><![CDATA[
- return this._description;
- ]]></getter>
- <setter><![CDATA[
- this.set(this._nodeDescription, this._description = val);
- return val;
- ]]></setter>
- </property>
-
- <property name="crop">
- <getter><![CDATA[
- return this.getAttribute("crop") || null;
- ]]></getter>
- <setter><![CDATA[
- if (val)
- this.setAttribute("crop", val);
- else
- this.removeAttribute("crop");
- return val;
- ]]></setter>
- </property>
-
- <property name="info">
- <getter><![CDATA[
- return this._info;
- ]]></getter>
- <setter><![CDATA[
- this._info = val;
- this.image = this._info.image;
- this.title = this._info.title;
- this.description = this._info.description;
- return val;
- ]]></setter>
- </property>
-
- <method name="set">
- <parameter name="node"/>
- <parameter name="value"/>
- <body><![CDATA[
- if (this.crop) {
- node.textContent = "";
- node.setAttribute("value", value);
- }
- else {
- node.textContent = value;
- node.removeAttribute("value");
- }
- ]]></body>
- </method>
- </implementation>
- </binding>
- </bindings>
-