From: Sam Reed Date: Tue, 30 Nov 2010 18:19:27 +0000 (+0000) Subject: Start fixing up javascript function documentation X-Git-Tag: 1.31.0-rc.0~33682 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=a1d9af3a06539610bb8852e448cf48931bbd99a7;p=lhc%2Fweb%2Fwiklou.git Start fixing up javascript function documentation Switching order, renaming parameters in documentation --- diff --git a/resources/jquery/jquery.cookie.js b/resources/jquery/jquery.cookie.js index 7b3e701251..eaa254e54e 100644 --- a/resources/jquery/jquery.cookie.js +++ b/resources/jquery/jquery.cookie.js @@ -25,16 +25,16 @@ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain * used when the cookie was set. * - * @param String key The key of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * @param key String The key of the cookie. + * @param value String The value of the cookie. + * @param options Object An object literal containing key/value pairs to provide optional cookie attributes. + * @option expires Number|Date Either an integer specifying the expiration date from now on in days or a Date object. * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. * If set to null or omitted, the cookie will be a session cookie and will not be retained * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * @option path String The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option domain String The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option secure Boolean If true, the secure attribute of the cookie will be set and the cookie transmission will * require a secure protocol (like HTTPS). * @type undefined * @@ -49,7 +49,7 @@ * @example $.cookie('the_cookie'); * @desc Get the value of a cookie. * - * @param String key The key of the cookie. + * @param key String The key of the cookie. * @return The value of the cookie. * @type String * diff --git a/resources/jquery/jquery.expandableField.js b/resources/jquery/jquery.expandableField.js index 2054f4ef51..ebe29a41d5 100644 --- a/resources/jquery/jquery.expandableField.js +++ b/resources/jquery/jquery.expandableField.js @@ -39,8 +39,8 @@ $.expandableField = { }, /** * Sets the value of a property, and updates the widget accordingly - * @param {String} property Name of property - * @param {Mixed} value Value to set property with + * @param property String Name of property + * @param value Mixed Value to set property with */ configure: function( context, property, value ) { // Validate creation using fallback values diff --git a/resources/jquery/jquery.suggestions.js b/resources/jquery/jquery.suggestions.js index 09214dbbea..bc69101fed 100644 --- a/resources/jquery/jquery.suggestions.js +++ b/resources/jquery/jquery.suggestions.js @@ -105,8 +105,8 @@ $.suggestions = { }, /** * Sets the value of a property, and updates the widget accordingly - * @param {String} property Name of property - * @param {Mixed} value Value to set property with + * @param property String Name of property + * @param value Mixed Value to set property with */ configure: function( context, property, value ) { // Validate creation using fallback values diff --git a/resources/jquery/jquery.textSelection.js b/resources/jquery/jquery.textSelection.js index 6a8b841e4f..1e90297cc2 100644 --- a/resources/jquery/jquery.textSelection.js +++ b/resources/jquery/jquery.textSelection.js @@ -256,7 +256,7 @@ setSelection: function( options ) { * * Scroll a textarea to the current cursor position. You can set the cursor * position with setSelection() - * @param force boolean Whether to force a scroll even if the caret position + * @param options boolean Whether to force a scroll even if the caret position * is already visible. Defaults to false */ scrollToCaretPosition: function( options ) { diff --git a/resources/mediawiki.language/mediawiki.language.js b/resources/mediawiki.language/mediawiki.language.js index 2101455e36..4d5a0a796c 100644 --- a/resources/mediawiki.language/mediawiki.language.js +++ b/resources/mediawiki.language/mediawiki.language.js @@ -38,9 +38,9 @@ mediaWiki.language = { /** * Plural form transformations, needed for some languages. * - * @param {integer} count Non-localized quantifier - * @param {array} forms List of plural forms - * @return {string} Correct form for quantifier in this language + * @param count integer Non-localized quantifier + * @param forms array List of plural forms + * @return string Correct form for quantifier in this language */ 'convertPlural': function( count, forms ){ if ( !forms || forms.length == 0 ) { @@ -51,9 +51,9 @@ mediaWiki.language = { /** * Pads an array to a specific length by copying the last one element. * - * @param {array} forms Number of forms given to convertPlural - * @param {integer} count Number of forms required - * @return {array} Padded array of forms + * @param forms array Number of forms given to convertPlural + * @param count integer Number of forms required + * @return array Padded array of forms */ 'preConvertPlural': function( forms, count ) { while ( forms.length < count ) { diff --git a/resources/mediawiki.util/mediawiki.util.test.js b/resources/mediawiki.util/mediawiki.util.test.js index 3520db3892..693f209a34 100644 --- a/resources/mediawiki.util/mediawiki.util.test.js +++ b/resources/mediawiki.util/mediawiki.util.test.js @@ -19,9 +19,9 @@ /** * Adds a row to the test-table * - * @param String code Code of the test to be executed - * @param String result Expected result in 'var (vartype)' form - * @param String contain Important part of the result, if result is different but does contain this it will not return ERROR but PARTIALLY + * @param code String Code of the test to be executed + * @param result String Expected result in 'var (vartype)' form + * @param contain String Important part of the result, if result is different but does contain this it will not return ERROR but PARTIALLY */ 'addTest' : function( code, result, contain ) { if (!contain) { diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 5793dfc4a8..57ac7f9af4 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -88,8 +88,8 @@ window.mediaWiki = new ( function( $ ) { * * If called with no arguments, all values will be returned. * - * @param {mixed} selection Key or array of keys to get values for - * @param {mixed} fallback Value to use in case key(s) do not exist (optional) + * @param selection mixed Key or array of keys to get values for + * @param fallback mixed Value to use in case key(s) do not exist (optional) */ Map.prototype.get = function( selection, fallback ) { if ( typeof selection === 'object' ) { @@ -114,8 +114,8 @@ window.mediaWiki = new ( function( $ ) { /** * Sets one or multiple key/value pairs. * - * @param {mixed} selection Key or object of key/value pairs to set - * @param {mixed} value Value to set (optional, only in use when key is a string) + * @param selection mixed Key or object of key/value pairs to set + * @param value mixed Value to set (optional, only in use when key is a string) */ Map.prototype.set = function( selection, value ) { if ( typeof selection === 'object' ) { @@ -130,8 +130,8 @@ window.mediaWiki = new ( function( $ ) { /** * Checks if one or multiple keys exist. * - * @param {mixed} key Key or array of keys to check - * @return {boolean} Existence of key(s) + * @param selection mixed Key or array of keys to check + * @return boolean Existence of key(s) */ Map.prototype.exists = function( selection ) { if ( typeof keys === 'object' ) { @@ -159,7 +159,7 @@ window.mediaWiki = new ( function( $ ) { /** * Appends parameters for replacement * - * @param {mixed} args First in a list of variadic arguments to append as message parameters + * @param parameters mixed First in a list of variadic arguments to append as message parameters */ Message.prototype.params = function( parameters ) { for ( var i = 0; i < parameters.length; i++ ) { @@ -258,8 +258,8 @@ window.mediaWiki = new ( function( $ ) { /** * Gets a message object, similar to wfMessage() * - * @param {string} key Key of message to get - * @param {mixed} params First argument in a list of variadic arguments, each a parameter for $ + * @param key string Key of message to get + * @param parameters mixed First argument in a list of variadic arguments, each a parameter for $ * replacement */ this.message = function( key, parameters ) { diff --git a/skins/common/protect.js b/skins/common/protect.js index 459be7e9bb..36450ec313 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -6,7 +6,7 @@ window.ProtectionForm = { * Set up the protection chaining interface (i.e. "unlock move permissions" checkbox) * on the protection form * - * @param Object opts : parameters with members: + * @param opts Object : parameters with members: * tableId Identifier of the table containing UI bits * labelText Text to use for the checkbox label * numTypes The number of protection types @@ -76,7 +76,7 @@ window.ProtectionForm = { /** * Is this protection level cascadeable? - * @param String level + * @param level String * * @return boolean * @@ -94,7 +94,7 @@ window.ProtectionForm = { * When protection levels are locked together, update the rest * when one action's level changes * - * @param Element source Level selector that changed + * @param source Element Level selector that changed */ 'updateLevels': function(source) { if( !this.isUnchained() ) @@ -106,7 +106,7 @@ window.ProtectionForm = { * When protection levels are locked together, update the * expiries when one changes * - * @param Element source expiry input that changed + * @param source Element expiry input that changed */ 'updateExpiry': function(source) { @@ -133,7 +133,7 @@ window.ProtectionForm = { * When protection levels are locked together, update the * expiry lists when one changes and clear the custom inputs * - * @param Element source expiry selector that changed + * @param source Element expiry selector that changed */ 'updateExpiryList': function(source) { if( !this.isUnchained() ) { @@ -221,7 +221,7 @@ window.ProtectionForm = { /** * Protect all actions at the specified level * - * @param int index Protection level + * @param index int Protection level */ 'setAllSelectors': function(index) { this.forEachLevelSelector(function(element) { @@ -234,7 +234,7 @@ window.ProtectionForm = { /** * Apply a callback to each protection selector * - * @param callable func Callback function + * @param func callable Callback function */ 'forEachLevelSelector': function(func) { var selectors = this.getLevelSelectors();