File:  [mozdev] / mailredirect / src / content / xtooltip.xml
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Sep 19 07:57:52 2005 UTC (13 years, 11 months ago) by krzesniak
Branches: MAIN
CVS tags: mailredirect-0-7-1, mailredirect-0-7, HEAD
directory migration

<?xml version="1.0"?>

<bindings id="popupBindings"
  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="xtooltip" extends="chrome://global/content/bindings/popup.xml#tooltip">
    <content>
      <xul:vbox style="max-width: 40em;" anonid="xtooltipBox"/>
    </content>

    <implementation>

      <property name="label" onget="return this.getAttribute('label');">
        <setter><![CDATA[
          this.setAttribute('label', val);

          var xtooltipBox = document.getAnonymousElementByAttribute(this, "anonid", "xtooltipBox")
          while(xtooltipBox.hasChildNodes()) {
            xtooltipBox.removeChild(xtooltipBox.firstChild);
          }

          if (val == "") {
            return val;
          }

          var labelsArray = val.split("\\n");
          for (var l in labelsArray) {
            const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
            var xtooltipLabel = document.createElementNS( XUL_NS, "label" );
            xtooltipLabel.appendChild( document.createTextNode(labelsArray[l]) )
            xtooltipBox.appendChild( xtooltipLabel );
          }

          return val;
          ]]>
        </setter>
      </property>
    </implementation>

    <handlers>
      <handler event="popupshowing"><![CDATA[
        this.height = this.boxObject.height;
        ]]>
      </handler>
      <handler event="popuphiding"><![CDATA[
        this.height = "";
        ]]>
      </handler>

    </handlers>

  </binding>
</bindings>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>