home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / toolkit.jar / content / global / bindings / text.xml < prev    next >
Extensible Markup Language  |  2002-04-13  |  3KB  |  60 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="textBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  6.   
  7.   <!-- bound to <description>s -->
  8.   <binding id="text-base">
  9.     <implementation implements="nsIDOMXULDescriptionElement, nsIAccessibleProvider">
  10.       <property name="accessible">
  11.         <getter>
  12.           <![CDATA[
  13.             var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService);
  14.             return accService.createXULTextAccessible(this);
  15.           ]]>
  16.         </getter>
  17.       </property>
  18.       <property name="disabled" onget="return this.hasAttribute('disabled');"
  19.                                 onset="if (val) this.setAttribute('disabled', 'true');
  20.                                        else this.removeAttribute('disabled'); 
  21.                                        return val;"/>
  22.       <property name="value" onget="return this.getAttribute('value');"
  23.                              onset="this.setAttribute('value', val); return val;"/>
  24.       <property name="crop" onget="return this.getAttribute('crop');"
  25.                             onset="this.setAttribute('crop', val); return val;"/>
  26.     </implementation>
  27.   </binding>
  28.  
  29.   <binding id="text-label" extends="chrome://global/content/bindings/text.xml#text-base">
  30.     <implementation implements="nsIDOMXULLabelElement">
  31.       <property name="accessKey" onget="return this.getAttribute('accesskey');"
  32.                                  onset="this.setAttribute('accesskey', val); return val;"/>
  33.       <property name="control" onget="return this.getAttribute('control');"
  34.                                onset="this.setAttribute('control', val); return val;"/>
  35.     </implementation>
  36.   </binding>
  37.  
  38.   <binding id="label-control" extends="chrome://global/content/bindings/text.xml#text-label">
  39.     <handlers>
  40.       <handler event="click" action="if (this.disabled) return;
  41.                                      var controlElementID = this.getAttribute('control');
  42.                                      var controlElement;
  43.                                      if (controlElementID)
  44.                                        controlElement = document.getElementById(controlElementID);
  45.                                      if(controlElement)
  46.                                        controlElementID.focus();
  47.                                     "/>
  48.     </handlers>
  49.   </binding>  
  50.  
  51.   <binding id="text-link" extends="chrome://global/content/bindings/text.xml#text-label">
  52.     <handlers>
  53.      <handler event="keypress" keycode="VK_ENTER" action="this.click()" />
  54.      <handler event="keypress" keycode="VK_RETURN" action="this.click()" />
  55.     </handlers>
  56.   </binding>
  57.  
  58. </bindings>
  59.  
  60.