Cleanup whtespace and comments in mediawiki.api.edit.js
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sun, 13 Jul 2014 12:22:22 +0000 (15:22 +0300)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sun, 13 Jul 2014 12:22:22 +0000 (15:22 +0300)
Change-Id: I61419bae4286317dbd6ca3c2e0596184e7953392

resources/src/mediawiki.api/mediawiki.api.edit.js

index 403d372..e88ae5e 100644 (file)
                                mw.track( 'mw.deprecate', 'api.cbParam' );
                                mw.log.warn( msg );
                        }
+
                        return this.postWithToken( 'edit', params ).done( ok ).fail( err );
                },
 
                /**
-                * Api helper to grab an edit token.
+                * API helper to grab an edit token.
                 *
                 * @param {Function} [ok] Success callback (deprecated)
                 * @param {Function} [err] Error callback (deprecated)
                                mw.track( 'mw.deprecate', 'api.cbParam' );
                                mw.log.warn( msg );
                        }
+
                        return this.getToken( 'edit' ).done( ok ).fail( err );
                },
 
                /**
-                * Create a new section of the page.
+                * Post a new section to the page.
                 * @see #postWithEditToken
                 * @param {mw.Title|String} title Target page
                 * @param {string} header
                 * @return {jQuery.Promise}
                 */
                newSection: function ( title, header, message, additionalParams, ok, err ) {
-                       // Until we remove 'ok' and 'err' parameters, we have to support code that passes them but not
-                       // additionalParams...
+                       // Until we remove 'ok' and 'err' parameters, we have to support code that passes them,
+                       // but not additionalParams...
                        if ( $.isFunction( additionalParams ) ) {
                                err = ok;
                                ok = additionalParams;
                                additionalParams = undefined;
                        }
+
                        if ( ok || err ) {
                                mw.track( 'mw.deprecate', 'api.cbParam' );
                                mw.log.warn( msg );
                        }
+
                        return this.postWithEditToken( $.extend( {
                                action: 'edit',
                                section: 'new',