home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / browser.xpi / bin / chrome / toolkit.jar / content / global / bindings / text.xml < prev    next >
Encoding:
Extensible Markup Language  |  2001-08-21  |  2.5 KB  |  55 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="textBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:html="http://www.w3.org/1999/xhtml"
  6.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  7.   
  8.   <binding id="text-base">
  9.     <implementation>
  10.       <property name="disabled" onget="if (this.getAttribute('disabled') == 'true') return true; return false;"
  11.                                 onset="if (val) this.setAttribute('disabled', 'true');
  12.                                        else this.removeAttribute('disabled'); 
  13.                                        return val;"/>
  14.       <property name="value" onget="return this.getAttribute('value');"
  15.                              onset="this.setAttribute('value', val); return val;"/>
  16.       <property name="crop" onget="return this.getAttribute('crop');"
  17.                             onset="this.setAttribute('crop', val); return val;"/>
  18.     </implementation>
  19.   </binding>
  20.  
  21.   <binding id="text-label" extends="chrome://global/content/bindings/text.xml#text-base">
  22.     <implementation>
  23.       <property name="accessKey" onget="return this.getAttribute('accesskey');"
  24.                                  onset="this.setAttribute('accesskey', val); return val;"/>
  25.       <property name="control" onget="return this.getAttribute('control');"
  26.                                onset="this.setAttribute('control', val); return val;"/>
  27.     </implementation>
  28.   </binding>
  29.  
  30.   <binding id="label-control" extends="chrome://global/content/bindings/text.xml#text-label">
  31.     <handlers>
  32.       <handler event="click" action="if (this.disabled) return;
  33.                                      var forElementID = this.getAttribute('control');
  34.                                      if (forElementID)
  35.                                        var forElement = document.getElementById(forElementID);
  36.                                      if(forElement)
  37.                                        forElement.focus();
  38.                                     "/>
  39.     </handlers>
  40.   </binding>
  41.  
  42.   <binding id="text-for" extends="chrome://global/content/bindings/text.xml#text-base">
  43.     <handlers>
  44.       <handler event="click" action="var forElementID = this.getAttribute('for');
  45.                                      if (forElementID)
  46.                                        var forElement = document.getElementById(forElementID);
  47.                                      if(forElement)
  48.                                        forElement.focus();
  49.                                     "/>
  50.     </handlers>
  51.   </binding>
  52.   
  53. </bindings>
  54.  
  55.