From 0a3a8989a9daecf8c771b68e0b64b1b1b8f40075 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 5 Feb 2014 14:36:24 -0800 Subject: [PATCH] Include all of /resources/mediawiki/* in jsduck index Not all classes/methods in these files have documention yet (the only effective change is adding of mw.Debug), but at least the other files are now in conforming syntax. mw.Debug: * Made method descriptions more consistent (a few of the "build" method didn't start the description with "Build"). mw.Feedback: * There was no @class anywhere. Worked because @class was implied for the method name starting with a capital. It was still ignoring the @param tags signature for the constructor though. Fixed now. Co-Authored-By: Mark Holmquist Co-Authored-By: Timo Tijhof Change-Id: I74c8dcfeac9754e38f9dec23873081e8fb6d51d4 --- maintenance/jsduck/categories.json | 12 +++- maintenance/jsduck/config.json | 13 +--- resources/mediawiki/mediawiki.debug.js | 70 ++++++++++++------- resources/mediawiki/mediawiki.feedback.js | 2 + resources/mediawiki/mediawiki.hlist.css | 6 +- resources/mediawiki/mediawiki.hlist.js | 8 +-- .../mediawiki/mediawiki.notification.css | 4 -- .../mediawiki/mediawiki.searchSuggest.js | 2 +- resources/mediawiki/mediawiki.toc.js | 5 ++ 9 files changed, 69 insertions(+), 53 deletions(-) diff --git a/maintenance/jsduck/categories.json b/maintenance/jsduck/categories.json index aa138bd326..adaf114423 100644 --- a/maintenance/jsduck/categories.json +++ b/maintenance/jsduck/categories.json @@ -10,7 +10,6 @@ "mw.Message", "mw.loader", "mw.loader.store", - "mw.log", "mw.html", "mw.html.Cdata", "mw.html.Raw", @@ -22,8 +21,6 @@ "classes": [ "mw.Title", "mw.Uri", - "mw.inspect", - "mw.inspect.reports", "mw.notification", "mw.Notification_", "mw.user", @@ -58,6 +55,15 @@ "classes": [ "mw.Feedback" ] + }, + { + "name": "Development", + "classes": [ + "mw.log", + "mw.inspect", + "mw.inspect.reports", + "mw.Debug" + ] } ] }, diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json index 7326ed256d..837c00c372 100644 --- a/maintenance/jsduck/config.json +++ b/maintenance/jsduck/config.json @@ -10,18 +10,7 @@ "--external": "HTMLElement,HTMLDocument,Window", "--": [ "./external.js", - "../../resources/mediawiki/mediawiki.js", - "../../resources/mediawiki/mediawiki.htmlform.js", - "../../resources/mediawiki/mediawiki.feedback.js", - "../../resources/mediawiki/mediawiki.log.js", - "../../resources/mediawiki/mediawiki.util.js", - "../../resources/mediawiki/mediawiki.Title.js", - "../../resources/mediawiki/mediawiki.Uri.js", - "../../resources/mediawiki/mediawiki.inspect.js", - "../../resources/mediawiki/mediawiki.jqueryMsg.js", - "../../resources/mediawiki/mediawiki.notify.js", - "../../resources/mediawiki/mediawiki.notification.js", - "../../resources/mediawiki/mediawiki.user.js", + "../../resources/mediawiki", "../../resources/mediawiki.action/mediawiki.action.edit.js", "../../resources/mediawiki.action/mediawiki.action.view.postEdit.js", "../../resources/mediawiki.page/mediawiki.page.startup.js", diff --git a/resources/mediawiki/mediawiki.debug.js b/resources/mediawiki/mediawiki.debug.js index 04cfbb0462..b6cc2b76fa 100644 --- a/resources/mediawiki/mediawiki.debug.js +++ b/resources/mediawiki/mediawiki.debug.js @@ -1,37 +1,41 @@ -/** - * JavaScript for the new debug toolbar, enabled through $wgDebugToolbar. - * - * @author John Du Hart - * @since 1.19 - */ - ( function ( mw, $ ) { 'use strict'; var debug, hovzer = $.getFootHovzer(); + /** + * Debug toolbar. + * + * Enabled server-side through `$wgDebugToolbar`. + * + * @class mw.Debug + * @singleton + * @author John Du Hart + * @since 1.19 + */ debug = mw.Debug = { /** * Toolbar container element * - * @var {jQuery} + * @property {jQuery} */ $container: null, /** * Object containing data for the debug toolbar * - * @var {Object} + * @property {Object} */ data: {}, /** - * Initializes the debugging pane. + * Initialize the debugging pane + * * Shouldn't be called before the document is ready * (since it binds to elements on the page). * - * @param {Object} data, defaults to 'debugInfo' from mw.config + * @param {Object} [data] Defaults to 'debugInfo' from mw.config */ init: function ( data ) { @@ -46,10 +50,13 @@ }, /** - * Switches between panes + * Switch between panes + * + * Should be called with an HTMLElement as its thisArg, + * because it's meant to be an event handler. + * + * TODO: Store cookie for last pane open. * - * @todo Store cookie for last pane open - * @context {Element} * @param {jQuery.Event} e */ switchPane: function ( e ) { @@ -91,7 +98,7 @@ }, /** - * Constructs the HTML for the debugging toolbar + * Construct the HTML for the debugging toolbar */ buildHtml: function () { var $container, $bits, panes, id, gitInfo; @@ -103,7 +110,8 @@ /** * Returns a jQuery element for a debug-bit div * - * @param id + * @ignore + * @param {string} id * @return {jQuery} */ function bitDiv( id ) { @@ -117,8 +125,9 @@ /** * Returns a jQuery element for a pane link * - * @param id - * @param text + * @ignore + * @param {string} id + * @param {string} text * @return {jQuery} */ function paneLabel( id, text ) { @@ -133,9 +142,10 @@ /** * Returns a jQuery element for a debug-bit div with a for a pane link * - * @param id CSS id snippet. Will be prefixed with 'mw-debug-' - * @param text Text to show - * @param count Optional count to show + * @ignore + * @param {string} id CSS id snippet. Will be prefixed with 'mw-debug-' + * @param {string} text Text to show + * @param {string} count Optional count to show * @return {jQuery} */ function paneTriggerBitDiv( id, text, count ) { @@ -217,7 +227,7 @@ }, /** - * Builds the console panel + * Build the console panel */ buildConsoleTable: function () { var $table, entryTypeText, i, length, entry; @@ -260,7 +270,9 @@ }, /** - * Query list pane + * Build query list pane + * + * @return {jQuery} */ buildQueryTable: function () { var $table, i, length, query; @@ -290,7 +302,9 @@ }, /** - * Legacy debug log pane + * Build legacy debug log pane + * + * @return {jQuery} */ buildDebugLogTable: function () { var $list, i, length, line; @@ -307,7 +321,9 @@ }, /** - * Request information pane + * Build request information pane + * + * @return {jQuery} */ buildRequestPane: function () { @@ -343,7 +359,9 @@ }, /** - * Included files pane + * Build included files pane + * + * @return {jQuery} */ buildIncludesPane: function () { var $table, i, length, file; diff --git a/resources/mediawiki/mediawiki.feedback.js b/resources/mediawiki/mediawiki.feedback.js index a4984846cc..6dd4f88d7a 100644 --- a/resources/mediawiki/mediawiki.feedback.js +++ b/resources/mediawiki/mediawiki.feedback.js @@ -29,6 +29,8 @@ * You can also launch the feedback form with a prefilled subject and body. * See the docs for the #launch() method. * + * @class + * @constructor * @param {Object} [options] * @param {mw.Api} [options.api] if omitted, will just create a standard API * @param {mw.Title} [options.title="Feedback"] The title of the page where you collect diff --git a/resources/mediawiki/mediawiki.hlist.css b/resources/mediawiki/mediawiki.hlist.css index c21dfecf9c..adcb81040b 100644 --- a/resources/mediawiki/mediawiki.hlist.css +++ b/resources/mediawiki/mediawiki.hlist.css @@ -1,6 +1,6 @@ -/** - Stylesheet for mediawiki.hlist module - @author [[User:Edokter]] +/*! + * Stylesheet for mediawiki.hlist module + * @author [[User:Edokter]] */ .hlist dl, .hlist ol, diff --git a/resources/mediawiki/mediawiki.hlist.js b/resources/mediawiki/mediawiki.hlist.js index 77d8fdcd57..0bbf8fadbf 100644 --- a/resources/mediawiki/mediawiki.hlist.js +++ b/resources/mediawiki/mediawiki.hlist.js @@ -1,7 +1,7 @@ -/** - .hlist fallbacks for IE 6, 7 and 8. - @author [[User:Edokter]] -*/ +/*! + * .hlist fallbacks for IE 6, 7 and 8. + * @author [[User:Edokter]] + */ ( function ( mw, $ ) { var profile = $.client.profile(); diff --git a/resources/mediawiki/mediawiki.notification.css b/resources/mediawiki/mediawiki.notification.css index 3aa358acbc..0c8152e967 100644 --- a/resources/mediawiki/mediawiki.notification.css +++ b/resources/mediawiki/mediawiki.notification.css @@ -1,7 +1,3 @@ -/** - * Stylesheet for mediawiki.notification module - */ - .mw-notification-area { position: absolute; top: 0; diff --git a/resources/mediawiki/mediawiki.searchSuggest.js b/resources/mediawiki/mediawiki.searchSuggest.js index e22a3d311a..6999610756 100644 --- a/resources/mediawiki/mediawiki.searchSuggest.js +++ b/resources/mediawiki/mediawiki.searchSuggest.js @@ -1,4 +1,4 @@ -/** +/*! * Add search suggestions to the search form. */ ( function ( mw, $ ) { diff --git a/resources/mediawiki/mediawiki.toc.js b/resources/mediawiki/mediawiki.toc.js index 3279900850..6eb855284e 100644 --- a/resources/mediawiki/mediawiki.toc.js +++ b/resources/mediawiki/mediawiki.toc.js @@ -1,3 +1,8 @@ +/** + * @private + * @singleton + * @class mw.toc + */ ( function ( mw, $ ) { 'use strict'; -- 2.20.1