Add jquery.byteLimit to jsduck
authorMark Holmquist <mtraceur@member.fsf.org>
Wed, 26 Mar 2014 23:05:54 +0000 (16:05 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 27 Mar 2014 20:52:38 +0000 (13:52 -0700)
Change-Id: I1dd21fccd93fed03748d3a71e53e8d27e6a9a5dd

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

index cdaa45c..dd820fe 100644 (file)
@@ -18,6 +18,7 @@
                "../../resources/mediawiki.api",
                "../../resources/mediawiki.language",
                "../../resources/jquery/jquery.arrowSteps.js",
+               "../../resources/jquery/jquery.byteLimit.js",
                "../../resources/jquery/jquery.localize.js",
                "../../resources/jquery/jquery.spinner.js",
                "../../resources/oojs",
index b398fdd..17c1821 100644 (file)
@@ -1,8 +1,5 @@
 /**
- * jQuery byteLimit plugin.
- *
- * @author Jan Paul Posma, 2011
- * @author Timo Tijhof, 2011-2012
+ * @class jQuery.plugin.byteLimit
  */
 ( function ( $ ) {
 
         * "fobo", not "foba". Basically emulating the native maxlength by
         * reconstructing where the insertion occured.
         *
+        * @private
         * @param {string} safeVal Known value that was previously returned by this
         * function, if none, pass empty string.
         * @param {string} newVal New value that may have to be trimmed down.
         * @param {number} byteLimit Number of bytes the value may be in size.
-        * @param {Function} fn [optional] See $.fn.byteLimit.
-        * @return {Object} Object with:
-        *  - {string} newVal
-        *  - {boolean} trimmed
+        * @param {Function} [fn] See jQuery.byteLimit.
+        * @return {Object}
+        * @return {string} return.newVal
+        * @return {boolean} return.trimmed
         */
        function trimValForByteLength( safeVal, newVal, byteLimit, fn ) {
                var startMatches, endMatches, matchesLen, inpParts,
         * value), a filter function (in case the limit should apply to something other than the
         * exact input value), or both. Order of parameters is important!
         *
-        * @context {jQuery} Instance of jQuery for one or more input elements
-        * @param {Number} limit [optional] Limit to enforce, fallsback to maxLength-attribute,
+        * @param {number} [limit] Limit to enforce, fallsback to maxLength-attribute,
         *  called with fetched value as argument.
-        * @param {Function} fn [optional] Function to call on the string before assessing the length.
-        * @return {jQuery} The context
+        * @param {Function} [fn] Function to call on the string before assessing the length.
+        * @return {jQuery}
+        * @chainable
         */
        $.fn.byteLimit = function ( limit, fn ) {
                // If the first argument is the function,
                        } );
                } );
        };
+
+       /**
+        * @class jQuery
+        * @mixins jQuery.plugin.byteLimit
+        */
 }( jQuery ) );