From a78fe56d51973b32f41a55bc79a491725f944192 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 26 Mar 2014 13:59:08 -0700 Subject: [PATCH] Add jquery.autoEllipsis to jsduck Change-Id: I2c1c1eb3e0f92a78e50f8fe89f47d10e3a732325 --- maintenance/jsduck/config.json | 1 + resources/jquery/jquery.arrowSteps.js | 1 + resources/jquery/jquery.autoEllipsis.js | 23 +++++++++++++++++++++-- resources/jquery/jquery.localize.js | 2 +- resources/mediawiki/mediawiki.htmlform.js | 2 ++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json index 2059148d4b..c9736df0e5 100644 --- a/maintenance/jsduck/config.json +++ b/maintenance/jsduck/config.json @@ -18,6 +18,7 @@ "../../resources/mediawiki.api", "../../resources/mediawiki.language", "../../resources/jquery/jquery.arrowSteps.js", + "../../resources/jquery/jquery.autoEllipsis.js", "../../resources/jquery/jquery.badge.js", "../../resources/jquery/jquery.byteLimit.js", "../../resources/jquery/jquery.localize.js", diff --git a/resources/jquery/jquery.arrowSteps.js b/resources/jquery/jquery.arrowSteps.js index daa2fd76a8..c44e7c5209 100644 --- a/resources/jquery/jquery.arrowSteps.js +++ b/resources/jquery/jquery.arrowSteps.js @@ -31,6 +31,7 @@ * $( '#robin-hood-daffy' ).arrowSteps(); * * + * @return {jQuery} * @chainable */ $.fn.arrowSteps = function () { diff --git a/resources/jquery/jquery.autoEllipsis.js b/resources/jquery/jquery.autoEllipsis.js index a473f615a0..57d8f9455c 100644 --- a/resources/jquery/jquery.autoEllipsis.js +++ b/resources/jquery/jquery.autoEllipsis.js @@ -1,6 +1,5 @@ /** - * Plugin that automatically truncates the plain text contents of an element - * and adds an ellipsis. + * @class jQuery.plugin.autoEllipsis */ ( function ( $ ) { @@ -11,6 +10,21 @@ var // Use a separate cache when match highlighting is enabled matchTextCache = {}; +/** + * Automatically truncate the plain text contents of an element and add an ellipsis + * + * @param {Object} options + * @param {'center'|'left'|'right'} [options.position='center'] Where to remove text. + * @param {boolean} [options.tooltip=false] Whether to show a tooltip with the remainder + * of the text. + * @param {boolean} [options.restoreText=false] Whether to save the text for restoring + * later. + * @param {boolean} [options.hasSpan=false] Whether the element is already a container, + * or if the library should create a new container for it. + * @param {string|null} [options.matchText=null] Text to highlight, e.g. search terms. + * @return {jQuery} + * @chainable + */ $.fn.autoEllipsis = function ( options ) { options = $.extend( { position: 'center', @@ -146,4 +160,9 @@ $.fn.autoEllipsis = function ( options ) { } ); }; +/** + * @class jQuery + * @mixins jQuery.plugin.autoEllipsis + */ + }( jQuery ) ); diff --git a/resources/jquery/jquery.localize.js b/resources/jquery/jquery.localize.js index 8c8fb5626d..f499e10983 100644 --- a/resources/jquery/jquery.localize.js +++ b/resources/jquery/jquery.localize.js @@ -99,12 +99,12 @@ function msg( options, key ) { * Appends something like this to the body... *

You may not get there all in one piece.

* - * @method * @param {Object} options Map of options to be used while localizing * @param {string} options.prefix String to prepend to all message keys * @param {Object} options.keys Message key aliases, used for remapping keys to a template * @param {Object} options.params Lists of parameters to use with certain message keys * @return {jQuery} + * @chainable */ $.fn.localize = function ( options ) { var $target = this, diff --git a/resources/mediawiki/mediawiki.htmlform.js b/resources/mediawiki/mediawiki.htmlform.js index 0284e68a6c..5ba1a54dd6 100644 --- a/resources/mediawiki/mediawiki.htmlform.js +++ b/resources/mediawiki/mediawiki.htmlform.js @@ -10,6 +10,7 @@ * * @param {boolean} [instantToggle=false] * @return {jQuery} + * @chainable */ $.fn.goIn = function ( instantToggle ) { if ( instantToggle === true ) { @@ -23,6 +24,7 @@ * * @param {boolean} [instantToggle=false] * @return jQuery + * @chainable */ $.fn.goOut = function ( instantToggle ) { if ( instantToggle === true ) { -- 2.20.1