DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (47b55c578f95)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE bindings>

<bindings id="badgebuttonBindings"
          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="badgebutton"
           extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton"
           display="xul:button" role="xul:toolbarbutton">
    <content>
      <children includes="observes|template|menupopup|panel|tooltip"/>
      <xul:stack>
        <xul:hbox>
          <xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
        </xul:hbox>
        <xul:label class="badgeButton-badge" anonid="badge"/>
      </xul:stack>
      <xul:label class="toolbarbutton-text" crop="right" flex="1"
                 xbl:inherits="value=label,accesskey,crop"/>
    </content>
    <implementation>
      <field name="_badgeCount">
      0
      </field>

      <property name="badgeCount" onget="return this._badgeCount;"
                                  onset="return this._setBadgeCount(val);">
      </property>

      <method name="_setBadgeCount">
        <parameter name="aNewCount"/>
        <body>
        <![CDATA[
          this._badgeCount = aNewCount;
          let badge = document.getAnonymousElementByAttribute(this, "anonid", "badge");
          badge.value = this._badgeCount;

          if (this._badgeCount > 0)
            this.setAttribute("showingBadge", "true");
          else
            this.removeAttribute("showingBadge");
        ]]>
        </body>
      </method>
    </implementation>

  </binding>
</bindings>