"disallowQuotedKeysInObjects": "allButReserved",
"requireDotNotation": { "allExcept": [ "keywords" ] },
"jsDoc": {
+ "checkAnnotations": {
+ "preset": "jsduck5",
+ "extra": {
+ "context": true,
+ "source": true,
+ "see": true,
+ "private": true
+ }
+ },
"checkParamNames": true,
+ "checkRedundantAccess": true,
"checkRedundantReturns": true,
"checkTypes": "strictNativeCase",
"requireNewlineAfterDescription": true,
-/**
+/*!
* HTML5 placeholder emulation for jQuery plugin
*
* This will automatically use the HTML5 placeholder attribute if supported, or emulate this behavior if not.
* @version 2.1.0
* @license MIT
*/
+
( function ( $ ) {
var isInputSupported = 'placeholder' in document.createElement( 'input' ),
-/**
+/*!
* TableSorter for MediaWiki
*
* Written 2011 Leo Koppelkamm
* and mw.language.months.
*
* Uses 'tableSorterCollation' in mw.config (if available)
- */
-/**
*
- * @description Create a sortable table with multi-column sorting capabilities
+ * Create a sortable table with multi-column sorting capabilities
*
- * @example $( 'table' ).tablesorter();
- * @desc Create a simple tablesorter interface.
+ * // Create a simple tablesorter interface
+ * $( 'table' ).tablesorter();
*
- * @example $( 'table' ).tablesorter( { sortList: [ { 0: 'desc' }, { 1: 'asc' } ] } );
- * @desc Create a tablesorter interface initially sorting on the first and second column.
+ * // Create a tablesorter interface, initially sorting on the first and second column
+ * $( 'table' ).tablesorter( { sortList: [ { 0: 'desc' }, { 1: 'asc' } ] } );
*
- * @option String cssHeader ( optional ) A string of the class name to be appended
- * to sortable tr elements in the thead of the table. Default value:
- * "header"
+ * @param {string} [cssHeader="header"] A string of the class name to be appended to sortable
+ * tr elements in the thead of the table.
*
- * @option String cssAsc ( optional ) A string of the class name to be appended to
- * sortable tr elements in the thead on a ascending sort. Default value:
- * "headerSortUp"
+ * @param {string} [cssAsc="headerSortUp"] A string of the class name to be appended to
+ * sortable tr elements in the thead on a ascending sort.
*
- * @option String cssDesc ( optional ) A string of the class name to be appended
- * to sortable tr elements in the thead on a descending sort. Default
- * value: "headerSortDown"
+ * @param {string} [cssDesc="headerSortDown"] A string of the class name to be appended to
+ * sortable tr elements in the thead on a descending sort.
*
- * @option String sortMultisortKey ( optional ) A string of the multi-column sort
- * key. Default value: "shiftKey"
+ * @param {string} [sortMultisortKey="shiftKey"] A string of the multi-column sort key.
*
- * @option Boolean cancelSelection ( optional ) Boolean flag indicating if
- * tablesorter should cancel selection of the table headers text.
- * Default value: true
+ * @param {boolean} [cancelSelection=true] Boolean flag indicating iftablesorter should cancel
+ * selection of the table headers text.
*
- * @option Array sortList ( optional ) An array containing objects specifying sorting.
- * By passing more than one object, multi-sorting will be applied. Object structure:
+ * @param {Array} [sortList] An array containing objects specifying sorting. By passing more
+ * than one object, multi-sorting will be applied. Object structure:
* { <Integer column index>: <String 'asc' or 'desc'> }
- * Default value: []
*
* @event sortEnd.tablesorter: Triggered as soon as any sorting has been applied.
*
- * @type jQuery
- *
- * @name tablesorter
- *
- * @cat Plugins/Tablesorter
- *
* @author Christian Bach/christian.bach@polyester.se
*/
-
( function ( $, mw ) {
var ts,
parsers = [];
* Inserts text at the beginning and end of a text selection, optionally
* inserting text at the caret when selection is empty.
*
- * @fixme document the options parameters
+ * FIXME document the options parameters
*/
encapsulateSelection: function ( options ) {
return this.each( function () {
*
* Will focus the textarea in some browsers (IE/Opera)
*
- * @fixme document the options parameters
+ * FIXME document the options parameters
*/
getCaretPosition: function ( options ) {
function getCaret( e ) {
return getCaret( this.get( 0 ) );
},
/**
- * @fixme document the options parameters
+ * FIXME document the options parameters
*/
setSelection: function ( options ) {
return this.each( function () {
* @param {boolean} options Whether to force a scroll even if the caret position
* is already visible. Defaults to false
*
- * @fixme document the options parameters (function body suggests options.force is a boolean, not options itself)
+ * FIXME document the options parameters (function body suggests options.force is a boolean, not options itself)
*/
scrollToCaretPosition: function ( options ) {
function getLineLength( e ) {
* internally and for dates accepted by #setDate and returned by #getDate.
*
* @private
- * @returns {string} Format
+ * @return {string} Format
*/
mw.widgets.CalendarWidget.prototype.getDateFormat = function () {
return {
* Get the date precision this calendar uses, 'day' or 'month'.
*
* @private
- * @returns {string} Precision, 'day' or 'month'
+ * @return {string} Precision, 'day' or 'month'
*/
mw.widgets.CalendarWidget.prototype.getPrecision = function () {
return this.precision;
* Get list of possible display layers.
*
* @private
- * @returns {string[]} Layers
+ * @return {string[]} Layers
*/
mw.widgets.CalendarWidget.prototype.getDisplayLayers = function () {
return [ 'month', 'year', 'duodecade' ].slice( this.precision === 'month' ? 1 : 0 );
* Get current date, in the format 'YYYY-MM-DD' or 'YYYY-MM', depending on precision. Digits will
* not be localised.
*
- * @returns {string|null} Date string
+ * @return {string|null} Date string
*/
mw.widgets.CalendarWidget.prototype.getDate = function () {
return this.date;
* @private
* @param {string} date Date string, to be valid, must be in 'YYYY-MM-DD' or 'YYYY-MM' format or
* (unless the field is required) empty
- * @returns {boolean}
+ * @return {boolean}
*/
mw.widgets.DateInputWidget.prototype.validateDate = function ( date ) {
var isValid;
/**
* @private
* @param {string} date Date string, to be valid, must be in 'YYYY-MM-DD' or 'YYYY-MM' format
- * @returns {boolean}
+ * @return {boolean}
*/
mw.widgets.DateInputWidget.prototype.isValidDate = function ( date ) {
// "Half-strict mode": for example, for the format 'YYYY-MM-DD', 2015-1-3 instead of 2015-01-03
* @private
* @param {string} date Date string, to be valid, must be empty (no date selected) or in
* 'YYYY-MM-DD' or 'YYYY-MM' format to be valid
- * @returns {boolean}
+ * @return {boolean}
*/
mw.widgets.DateInputWidget.prototype.isInRange = function ( date ) {
var momentDate = moment( date, 'YYYY-MM-DD' ),
* Get option widgets from the server response
*
* @param {Object} data Query result
- * @returns {OO.ui.OptionWidget[]} Menu items
+ * @return {OO.ui.OptionWidget[]} Menu items
*/
mw.widgets.TitleWidget.prototype.getOptionsFromData = function ( data ) {
var i, len, index, pageExists, pageExistsExact, suggestionPage, page, redirect, redirects,
* Get title object corresponding to given value, or #getQueryValue if not given.
*
* @param {string} [value] Value to get a title for
- * @returns {mw.Title|null} Title object, or null if value is invalid
+ * @return {mw.Title|null} Title object, or null if value is invalid
*/
mw.widgets.TitleWidget.prototype.getTitle = function ( value ) {
var title = value !== undefined ? value : this.getQueryValue(),
* Get list of menu items from a server response.
*
* @param {Object} data Query result
- * @returns {OO.ui.MenuOptionWidget[]} Menu items
+ * @return {OO.ui.MenuOptionWidget[]} Menu items
*/
mw.widgets.UserInputWidget.prototype.getLookupMenuOptionsFromData = function ( data ) {
var len, i, user,
*
* @protected
* @fires fileSaved
- * @returns {jQuery.Promise} Rejects the promise with an
+ * @return {jQuery.Promise} Rejects the promise with an
* {@link OO.ui.Error error}, or resolves if the upload was successful.
*/
mw.Upload.BookletLayout.prototype.saveFile = function () {
* state and state details.
*
* @protected
- * @returns {OO.ui.Error} Error to display for given state and details.
+ * @return {OO.ui.Error} Error to display for given state and details.
*/
mw.Upload.BookletLayout.prototype.getErrorMessageForStateDetails = function () {
var message,
*
* @protected
* @fires selectFile
- * @returns {OO.ui.FormLayout}
+ * @return {OO.ui.FormLayout}
*/
mw.Upload.BookletLayout.prototype.renderUploadForm = function () {
var fieldset;
* property.
*
* @protected
- * @returns {OO.ui.FormLayout}
+ * @return {OO.ui.FormLayout}
*/
mw.Upload.BookletLayout.prototype.renderInfoForm = function () {
var fieldset;
* sets the {@link #insertForm insertForm} property.
*
* @protected
- * @returns {OO.ui.FormLayout}
+ * @return {OO.ui.FormLayout}
*/
mw.Upload.BookletLayout.prototype.renderInsertForm = function () {
var fieldset;
* {@link #uploadForm upload form}.
*
* @protected
- * @returns {File|null}
+ * @return {File|null}
*/
mw.Upload.BookletLayout.prototype.getFile = function () {
return this.selectFileWidget.getValue();
* {@link #infoForm information form}.
*
* @protected
- * @returns {string}
+ * @return {string}
*/
mw.Upload.BookletLayout.prototype.getFilename = function () {
return this.filenameWidget.getValue();
* {@link #infoForm information form}.
*
* @protected
- * @returns {string}
+ * @return {string}
*/
mw.Upload.BookletLayout.prototype.getText = function () {
return this.descriptionWidget.getValue();
this.uploadBooklet.clear();
}, this );
};
-
}( jQuery, mediaWiki ) );
}() );
/**
- * @class mw.Uri
- * @constructor
- *
* Construct a new URI object. Throws error if arguments are illegal/impossible, or
* otherwise don't parse.
*
+ * @class mw.Uri
+ * @constructor
* @param {Object|string} [uri] URI string, or an Object with appropriate properties (especially
* another URI object to clone). Object must have non-blank `protocol`, `host`, and `path`
* properties. If omitted (or set to `undefined`, `null` or empty string), then an object
* that the user will be assigned to that bucket
* @param {string} token A token that uniquely identifies the user for the
* duration of the experiment
- * @returns {string} The bucket
+ * @return {string} The bucket
*/
getBucket: function ( experiment, token ) {
var buckets = experiment.buckets,
/**
* Get the bug report link
*
- * @returns {string} Link to the external bug report form
+ * @return {string} Link to the external bug report form
*/
mw.Feedback.Dialog.prototype.getBugReportLink = function () {
return this.bugReportLink;
* The underscore in the name is to avoid a bug <https://github.com/senchalabs/jsduck/issues/304>.
* It is not part of the actual class name.
*
+ * The constructor is not publicly accessible; use mw.notification#notify instead.
+ * This does not insert anything into the document (see #start).
+ *
* @class mw.Notification_
* @alternateClassName mw.Notification
- *
- * @constructor The constructor is not publicly accessible; use mw.notification#notify instead.
- * This does not insert anything into the document (see #start).
+ * @constructor
* @private
*/
function Notification( message, options ) {