Add jquery.badge to the jsduck config
authorMark Holmquist <mtraceur@member.fsf.org>
Wed, 26 Mar 2014 22:46:10 +0000 (15:46 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 27 Mar 2014 21:10:54 +0000 (14:10 -0700)
Imported examples from https://www.mediawiki.org/wiki/ResourceLoader/Default_modules#jquery.badge

Change-Id: I6ddd4b836fd8fd459bf803baab8fc26bac9fbe55

maintenance/jsduck/config.json
resources/jquery/jquery.badge.js

index dd820fe..2059148 100644 (file)
@@ -18,6 +18,7 @@
                "../../resources/mediawiki.api",
                "../../resources/mediawiki.language",
                "../../resources/jquery/jquery.arrowSteps.js",
+               "../../resources/jquery/jquery.badge.js",
                "../../resources/jquery/jquery.byteLimit.js",
                "../../resources/jquery/jquery.localize.js",
                "../../resources/jquery/jquery.spinner.js",
index 9404e81..023b6e2 100644 (file)
@@ -1,10 +1,8 @@
-/**
+/*!
  * jQuery Badge plugin
  *
  * @license MIT
- */
-
-/**
+ *
  * @author Ryan Kaldari <rkaldari@wikimedia.org>, 2012
  * @author Andrew Garrett <agarrett@wikimedia.org>, 2012
  * @author Marius Hoch <hoo@online.de>, 2012
  *
  * This program is distributed WITHOUT ANY WARRANTY.
  */
+
+/**
+ * @class jQuery.plugin.badge
+ */
 ( function ( $, mw ) {
        /**
-        * Allows you to put a "badge" on an item on the page. The badge container
-        * will be appended to the selected element(s).
-        * See mediawiki.org/wiki/ResourceLoader/Default_modules#jQuery.badge
+        * Put a badge on an item on the page. The badge container will be appended to the selected element(s).
+        *
+        *     $element.badge( text );
+        *     $element.badge( 5 );
+        *     $element.badge( '100+' );
+        *     $element.badge( text, inline );
+        *     $element.badge( 'New', true );
         *
         * @param {number|string} text The value to display in the badge. If the value is falsey (0,
         *  null, false, '', etc.), any existing badge will be removed.
-        * @param {boolean} inline True if the badge should be displayed inline, false
-        *  if the badge should overlay the parent element (default is inline)
-        * @param {boolean} displayZero True if the number zero should be displayed,
+        * @param {boolean} [inline=true] True if the badge should be displayed inline, false
+        *  if the badge should overlay the parent element.
+        * @param {boolean} [displayZero=false] True if the number zero should be displayed,
         *  false if the number zero should result in the badge being hidden
-        *  (default is zero will result in the badge being hidden)
+        * @return {jQuery}
+        * @chainable
         */
        $.fn.badge = function ( text, inline, displayZero ) {
                var $badge = this.find( '.mw-badge' ),
@@ -73,4 +80,9 @@
                }
                return this;
        };
+
+       /**
+        * @class jQuery
+        * @mixins jQuery.plugin.badge
+        */
 }( jQuery, mediaWiki ) );