Start fixing up javascript function documentation
authorSam Reed <reedy@users.mediawiki.org>
Tue, 30 Nov 2010 18:19:27 +0000 (18:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 30 Nov 2010 18:19:27 +0000 (18:19 +0000)
Switching order, renaming parameters in documentation

resources/jquery/jquery.cookie.js
resources/jquery/jquery.expandableField.js
resources/jquery/jquery.suggestions.js
resources/jquery/jquery.textSelection.js
resources/mediawiki.language/mediawiki.language.js
resources/mediawiki.util/mediawiki.util.test.js
resources/mediawiki/mediawiki.js
skins/common/protect.js

index 7b3e701..eaa254e 100644 (file)
  * @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
  *
index 2054f4e..ebe29a4 100644 (file)
@@ -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
index 09214db..bc69101 100644 (file)
@@ -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
index 6a8b841..1e90297 100644 (file)
@@ -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 ) {
index 2101455..4d5a0a7 100644 (file)
@@ -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 ) {
index 3520db3..693f209 100644 (file)
@@ -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) {
index 5793dfc..57ac7f9 100644 (file)
@@ -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 ) {
index 459be7e..36450ec 100644 (file)
@@ -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();