r77486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77485‎ | r77486 | r77487 >
Date:18:19, 30 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Start fixing up javascript function documentation

Switching order, renaming parameters in documentation
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.cookie.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.expandableField.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.suggestions.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.textSelection.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.language/mediawiki.language.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/protect.js
@@ -6,7 +6,7 @@
77 * Set up the protection chaining interface (i.e. "unlock move permissions" checkbox)
88 * on the protection form
99 *
10 - * @param Object opts : parameters with members:
 10+ * @param opts Object : parameters with members:
1111 * tableId Identifier of the table containing UI bits
1212 * labelText Text to use for the checkbox label
1313 * numTypes The number of protection types
@@ -76,7 +76,7 @@
7777
7878 /**
7979 * Is this protection level cascadeable?
80 - * @param String level
 80+ * @param level String
8181 *
8282 * @return boolean
8383 *
@@ -94,7 +94,7 @@
9595 * When protection levels are locked together, update the rest
9696 * when one action's level changes
9797 *
98 - * @param Element source Level selector that changed
 98+ * @param source Element Level selector that changed
9999 */
100100 'updateLevels': function(source) {
101101 if( !this.isUnchained() )
@@ -106,7 +106,7 @@
107107 * When protection levels are locked together, update the
108108 * expiries when one changes
109109 *
110 - * @param Element source expiry input that changed
 110+ * @param source Element expiry input that changed
111111 */
112112
113113 'updateExpiry': function(source) {
@@ -133,7 +133,7 @@
134134 * When protection levels are locked together, update the
135135 * expiry lists when one changes and clear the custom inputs
136136 *
137 - * @param Element source expiry selector that changed
 137+ * @param source Element expiry selector that changed
138138 */
139139 'updateExpiryList': function(source) {
140140 if( !this.isUnchained() ) {
@@ -221,7 +221,7 @@
222222 /**
223223 * Protect all actions at the specified level
224224 *
225 - * @param int index Protection level
 225+ * @param index int Protection level
226226 */
227227 'setAllSelectors': function(index) {
228228 this.forEachLevelSelector(function(element) {
@@ -234,7 +234,7 @@
235235 /**
236236 * Apply a callback to each protection selector
237237 *
238 - * @param callable func Callback function
 238+ * @param func callable Callback function
239239 */
240240 'forEachLevelSelector': function(func) {
241241 var selectors = this.getLevelSelectors();
Index: trunk/phase3/resources/jquery/jquery.textSelection.js
@@ -256,7 +256,7 @@
257257 *
258258 * Scroll a textarea to the current cursor position. You can set the cursor
259259 * position with setSelection()
260 - * @param force boolean Whether to force a scroll even if the caret position
 260+ * @param options boolean Whether to force a scroll even if the caret position
261261 * is already visible. Defaults to false
262262 */
263263 scrollToCaretPosition: function( options ) {
Index: trunk/phase3/resources/jquery/jquery.expandableField.js
@@ -39,8 +39,8 @@
4040 },
4141 /**
4242 * Sets the value of a property, and updates the widget accordingly
43 - * @param {String} property Name of property
44 - * @param {Mixed} value Value to set property with
 43+ * @param property String Name of property
 44+ * @param value Mixed Value to set property with
4545 */
4646 configure: function( context, property, value ) {
4747 // Validate creation using fallback values
Index: trunk/phase3/resources/jquery/jquery.cookie.js
@@ -25,16 +25,16 @@
2626 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
2727 * used when the cookie was set.
2828 *
29 - * @param String key The key of the cookie.
30 - * @param String value The value of the cookie.
31 - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
32 - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 29+ * @param key String The key of the cookie.
 30+ * @param value String The value of the cookie.
 31+ * @param options Object An object literal containing key/value pairs to provide optional cookie attributes.
 32+ * @option expires Number|Date Either an integer specifying the expiration date from now on in days or a Date object.
3333 * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
3434 * If set to null or omitted, the cookie will be a session cookie and will not be retained
3535 * when the the browser exits.
36 - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
37 - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
38 - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 36+ * @option path String The value of the path atribute of the cookie (default: path of page that created the cookie).
 37+ * @option domain String The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 38+ * @option secure Boolean If true, the secure attribute of the cookie will be set and the cookie transmission will
3939 * require a secure protocol (like HTTPS).
4040 * @type undefined
4141 *
@@ -49,7 +49,7 @@
5050 * @example $.cookie('the_cookie');
5151 * @desc Get the value of a cookie.
5252 *
53 - * @param String key The key of the cookie.
 53+ * @param key String The key of the cookie.
5454 * @return The value of the cookie.
5555 * @type String
5656 *
Index: trunk/phase3/resources/jquery/jquery.suggestions.js
@@ -105,8 +105,8 @@
106106 },
107107 /**
108108 * Sets the value of a property, and updates the widget accordingly
109 - * @param {String} property Name of property
110 - * @param {Mixed} value Value to set property with
 109+ * @param property String Name of property
 110+ * @param value Mixed Value to set property with
111111 */
112112 configure: function( context, property, value ) {
113113 // Validate creation using fallback values
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js
@@ -19,9 +19,9 @@
2020 /**
2121 * Adds a row to the test-table
2222 *
23 - * @param String code Code of the test to be executed
24 - * @param String result Expected result in 'var (vartype)' form
25 - * @param String contain Important part of the result, if result is different but does contain this it will not return ERROR but PARTIALLY
 23+ * @param code String Code of the test to be executed
 24+ * @param result String Expected result in 'var (vartype)' form
 25+ * @param contain String Important part of the result, if result is different but does contain this it will not return ERROR but PARTIALLY
2626 */
2727 'addTest' : function( code, result, contain ) {
2828 if (!contain) {
Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -88,8 +88,8 @@
8989 *
9090 * If called with no arguments, all values will be returned.
9191 *
92 - * @param {mixed} selection Key or array of keys to get values for
93 - * @param {mixed} fallback Value to use in case key(s) do not exist (optional)
 92+ * @param selection mixed Key or array of keys to get values for
 93+ * @param fallback mixed Value to use in case key(s) do not exist (optional)
9494 */
9595 Map.prototype.get = function( selection, fallback ) {
9696 if ( typeof selection === 'object' ) {
@@ -114,8 +114,8 @@
115115 /**
116116 * Sets one or multiple key/value pairs.
117117 *
118 - * @param {mixed} selection Key or object of key/value pairs to set
119 - * @param {mixed} value Value to set (optional, only in use when key is a string)
 118+ * @param selection mixed Key or object of key/value pairs to set
 119+ * @param value mixed Value to set (optional, only in use when key is a string)
120120 */
121121 Map.prototype.set = function( selection, value ) {
122122 if ( typeof selection === 'object' ) {
@@ -130,8 +130,8 @@
131131 /**
132132 * Checks if one or multiple keys exist.
133133 *
134 - * @param {mixed} key Key or array of keys to check
135 - * @return {boolean} Existence of key(s)
 134+ * @param selection mixed Key or array of keys to check
 135+ * @return boolean Existence of key(s)
136136 */
137137 Map.prototype.exists = function( selection ) {
138138 if ( typeof keys === 'object' ) {
@@ -159,7 +159,7 @@
160160 /**
161161 * Appends parameters for replacement
162162 *
163 - * @param {mixed} args First in a list of variadic arguments to append as message parameters
 163+ * @param parameters mixed First in a list of variadic arguments to append as message parameters
164164 */
165165 Message.prototype.params = function( parameters ) {
166166 for ( var i = 0; i < parameters.length; i++ ) {
@@ -258,8 +258,8 @@
259259 /**
260260 * Gets a message object, similar to wfMessage()
261261 *
262 - * @param {string} key Key of message to get
263 - * @param {mixed} params First argument in a list of variadic arguments, each a parameter for $
 262+ * @param key string Key of message to get
 263+ * @param parameters mixed First argument in a list of variadic arguments, each a parameter for $
264264 * replacement
265265 */
266266 this.message = function( key, parameters ) {
Index: trunk/phase3/resources/mediawiki.language/mediawiki.language.js
@@ -38,9 +38,9 @@
3939 /**
4040 * Plural form transformations, needed for some languages.
4141 *
42 - * @param {integer} count Non-localized quantifier
43 - * @param {array} forms List of plural forms
44 - * @return {string} Correct form for quantifier in this language
 42+ * @param count integer Non-localized quantifier
 43+ * @param forms array List of plural forms
 44+ * @return string Correct form for quantifier in this language
4545 */
4646 'convertPlural': function( count, forms ){
4747 if ( !forms || forms.length == 0 ) {
@@ -51,9 +51,9 @@
5252 /**
5353 * Pads an array to a specific length by copying the last one element.
5454 *
55 - * @param {array} forms Number of forms given to convertPlural
56 - * @param {integer} count Number of forms required
57 - * @return {array} Padded array of forms
 55+ * @param forms array Number of forms given to convertPlural
 56+ * @param count integer Number of forms required
 57+ * @return array Padded array of forms
5858 */
5959 'preConvertPlural': function( forms, count ) {
6060 while ( forms.length < count ) {

Status & tagging log