Kaldari has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71581
Change subject: Changing 'cb' to 'callback'.
......................................................................
Changing 'cb' to 'callback'.
We use 'cb' for 'checkbox' with the same file. This is why using
short variable names is a bad idea. Keep them explicit and
unambiguous. Of course it's entirely possible that I created these
variables three years ago, but I've since learned the error of my
ways!
Change-Id: I639fcc94d7f83529e41c43a73446451979d140b6
---
M resources/mw.UploadWizardDetails.js
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/81/71581/1
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index 537e70e..05fb84d 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -659,7 +659,7 @@
// do callback if we are ready to go.
// side effect: add error text to the page for fields in an incorrect
state.
// we must call EVERY valid() function due to side effects; do not
short-circuit.
- valid: function(cb) {
+ valid: function( callback ) {
var _this = this;
// at least one description -- never mind, we are disallowing
removal of first description
// all the descriptions -- check min & max length
@@ -670,7 +670,7 @@
// make sure title is valid
var titleInputValid = $j( _this.titleInput ).data( 'valid' );
if ( titleInputValid === undefined ) {
- setTimeout( function () { _this.valid(cb); }, 200 );
+ setTimeout( function () { _this.valid( callback ); },
200 );
return;
}
@@ -681,7 +681,7 @@
var formValid = _this.$form.valid();
if ( titleInputValid && deedValid && formValid ) {
- cb();
+ callback();
}
},
@@ -691,10 +691,10 @@
* 1) Empty category
* 2) TODO
*/
- necessaryFilled: function( cb ) {
+ necessaryFilled: function( callback ) {
// check for empty category input
if ( this.div.find( '.categoryInput' ).val() !== '' ||
this.div.find( '.cat-list' ).find( 'li' ).length > 0 ) {
- cb();
+ callback();
}
},
@@ -1168,7 +1168,7 @@
* Convert entire details for this file into wikiText, which will then
be posted to the file
* @return wikitext representing all details
*/
- getWikiText: function(cb) {
+ getWikiText: function( callback ) {
var _this = this;
// if invalid, should produce side effects in the form
@@ -1268,7 +1268,7 @@
wikiText = TextCleaner.sanitizeWikiText(
wikiText, true );
}
- cb(wikiText);
+ callback(wikiText);
});
},
--
To view, visit https://gerrit.wikimedia.org/r/71581
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I639fcc94d7f83529e41c43a73446451979d140b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits