3 (C) Copyright 2012 David Kettler
5 Use, modification, and distribution are subject to the terms specified in the
9 xmlns="http://www.mozilla.org/xbl"
10 xmlns:html="http://www.w3.org/1999/xhtml"
11 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
12 xmlns:xbl="http://www.mozilla.org/xbl">
14 <binding id="annotated-textbox"
15 extends="chrome://global/content/bindings/textbox.xml#textbox">
20 <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
21 <html:input class="textbox-input" flex="1" anonid="input"
22 xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint,spellcheck"/>
24 <xul:hbox style="overflow: hidden">
25 <xul:label class="plain" anonid="strut"/>
28 <xul:label class="plain" anonid="annotation"
29 xbl:inherits="value=annotation"
30 flex="1000" crop="right" collapsed="true"/>
35 <field name="_annotate"> false </field>
36 <field name="_annot" readonly="true">
37 document.getAnonymousElementByAttribute(this, "anonid", "annotation");
39 <field name="_strut" readonly="true">
40 document.getAnonymousElementByAttribute(this, "anonid", "strut");
43 <property name="annotate">
45 return this._annotate;
48 this._annotate = !!val;
50 this._strut.setAttribute("value", "");
51 this._annot.setAttribute("collapsed",
52 this._annotate ? "false" : "true");
53 return this._annotate;
57 <property name="annotation"
58 onset="this.setAttribute('annotation', val); return val;"
59 onget="return this.getAttribute('annotation');"/>
64 <handler event="input">
66 this._strut.setAttribute("value", this.value);