From f60d69dc87c7fbf14bf47cb2b80b199155338922 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 26 Mar 2014 13:30:43 -0700 Subject: [PATCH] Add jquery.arrowSteps to jsduck It's probably a doomed module, but we may as well document it. Change-Id: I5c28d1abc5364de839806ed21c2edc0d1d655f86 --- maintenance/jsduck/config.json | 1 + resources/jquery/jquery.arrowSteps.js | 75 +++++++++++++++------------ 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json index 837c00c372..cdaa45c645 100644 --- a/maintenance/jsduck/config.json +++ b/maintenance/jsduck/config.json @@ -17,6 +17,7 @@ "../../resources/mediawiki.page/mediawiki.page.watch.ajax.js", "../../resources/mediawiki.api", "../../resources/mediawiki.language", + "../../resources/jquery/jquery.arrowSteps.js", "../../resources/jquery/jquery.localize.js", "../../resources/jquery/jquery.spinner.js", "../../resources/oojs", diff --git a/resources/jquery/jquery.arrowSteps.js b/resources/jquery/jquery.arrowSteps.js index a1fd679d42..daa2fd76a8 100644 --- a/resources/jquery/jquery.arrowSteps.js +++ b/resources/jquery/jquery.arrowSteps.js @@ -1,4 +1,4 @@ -/** +/*! * jQuery arrowSteps plugin * Copyright Neil Kandalgaonkar, 2010 * @@ -7,40 +7,32 @@ * (see http://www.fsf.org/licensing/licenses/gpl.html). * Derivative works and later versions of the code must be free software * licensed under the same or a compatible license. - * - * - * DESCRIPTION - * - * Show users their progress through a series of steps, via a row of items that fit - * together like arrows. One item can be highlighted at a time. - * - * - * SYNOPSIS - * - * - * - * - * + */ + +/** + * @class jQuery.plugin.arrowSteps */ ( function ( $ ) { + /** + * Show users their progress through a series of steps, via a row of items that fit + * together like arrows. One item can be highlighted at a time. + * + * + * + * + * + * @chainable + */ $.fn.arrowSteps = function () { var $steps, width, arrowWidth, paddingSide = $( 'body' ).hasClass( 'rtl' ) ? 'padding-left' : 'padding-right'; @@ -62,6 +54,19 @@ return this; }; + /** + * Highlights the element selected by the selector. + * + * $( '#robin-hood-daffy' ).arrowStepsHighlight( '#guard' ); + * // 'Guard!' is highlighted. + * + * // ... user completes the 'guard' step ... + * + * $( '#robin-hood-daffy' ).arrowStepsHighlight( '#turn' ); + * // 'Turn!' is highlighted. + * + * @param {string} selector + */ $.fn.arrowStepsHighlight = function ( selector ) { var $previous, $steps = this.data( 'arrowSteps' ); @@ -79,4 +84,8 @@ } ); }; + /** + * @class jQuery + * @mixins jQuery.plugin.arrowSteps + */ }( jQuery ) ); -- 2.20.1