https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114400
Revision: 114400 Author: catrope Date: 2012-03-21 20:21:34 +0000 (Wed, 21 Mar 2012) Log Message: ----------- Revert r112166, r112229, r112248, r113584, r113591, r114349: unreviewed revisions in UploadWizard. All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html Modified Paths: -------------- trunk/extensions/UploadWizard/UploadWizard.config.php trunk/extensions/UploadWizard/UploadWizard.i18n.php trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php trunk/extensions/UploadWizard/resources/mw.UploadWizard.js trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js Modified: trunk/extensions/UploadWizard/UploadWizard.config.php =================================================================== --- trunk/extensions/UploadWizard/UploadWizard.config.php 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/UploadWizard.config.php 2012-03-21 20:21:34 UTC (rev 114400) @@ -75,21 +75,6 @@ // The maximum length of the id field. 'idFieldMaxLength' => 25, - // Initial value for the id field. - 'idFieldInitialValue' => '', - - // Initial value for the description field. - 'defaultDescription' => '', - - // Initial value for the latitude field. - 'defaultLat' => '', - - // Initial value for the longitude field. - 'defaultLon' => '', - - // Initial value for the altitude field. - 'defaultAlt' => '', - // 'licenses' is a list of licenses you could possibly use elsewhere, for instance in // licensesOwnWork or licensesThirdParty. // It just describes what licenses go with what wikitext, and how to display them in Modified: trunk/extensions/UploadWizard/UploadWizard.i18n.php =================================================================== --- trunk/extensions/UploadWizard/UploadWizard.i18n.php 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/UploadWizard.i18n.php 2012-03-21 20:21:34 UTC (rev 114400) @@ -323,14 +323,9 @@ 'mwe-upwiz-campaign-conf-idField' => 'ID field wikitext. Example: <nowiki>{{Rijksmonument|$1}}</nowiki>. Blank to not display field:', 'mwe-upwiz-campaign-conf-idFieldLabel' => 'ID field label text:', 'mwe-upwiz-campaign-conf-idFieldLabelPage' => 'Page name with text for the ID field label. $1 is replaced with the language code:', - 'mwe-upwiz-campaign-conf-idFieldInitialValue' => 'Initial value for the ID field.', 'mwe-upwiz-campaign-conf-headerLabelPage' => 'Page containing text to display above the UploadWizard interface. $1 is replaced with the language code:', 'mwe-upwiz-campaign-conf-thanksLabelPage' => 'Page containing text to display on top of the "Use" page. $1 is replaced with the language code:', 'mwe-upwiz-campaign-conf-idFieldMaxLength' => 'Maximum length of the text in the ID field', - 'mwe-upwiz-campaign-conf-defaultLat' => 'Default latitude', - 'mwe-upwiz-campaign-conf-defaultLon' => 'Default longitude', - 'mwe-upwiz-campaign-conf-defaultAlt' => 'Default altitude', - 'mwe-upwiz-campaign-conf-defaultDescription' => 'Default description', // Coolcats 'mw-coolcats-confirm-new-title' => 'Confirm new category', Modified: trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php =================================================================== --- trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php 2012-03-21 20:21:34 UTC (rev 114400) @@ -180,9 +180,6 @@ 'idFieldMaxLength' => array( 'type' => 'int', ), - 'idFieldInitialValue' => array( - 'type' => 'text', - ), 'ownWorkOption' => array( 'type' => 'radio', 'options' => array( @@ -214,18 +211,6 @@ 'thanksLabelPage' => array( 'type' => 'text' ), - 'defaultLat' => array( - 'type' => 'text' - ), - 'defaultLon' => array( - 'type' => 'text' - ), - 'defaultAlt' => array( - 'type' => 'text' - ), - 'defaultDescription' => array( - 'type' => 'text' - ), ); foreach ( $globalConfig['licenses'] as $licenseName => $licenseDate ) { Modified: trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php =================================================================== --- trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php 2012-03-21 20:21:34 UTC (rev 114400) @@ -53,32 +53,11 @@ $this->outputHeader(); // if query string includes 'skiptutorial=true' set config variable to true - $skipTutorial = $wgRequest->getCheck( 'skiptutorial' ); - if ( $skipTutorial ) { - $skip = in_array( $skipTutorial, array( '1', 'true' ) ); + if ( $wgRequest->getCheck( 'skiptutorial' ) ) { + $skip = in_array( $wgRequest->getText( 'skiptutorial' ), array( '1', 'true' ) ); UploadWizardConfig::setUrlSetting( 'skipTutorial', $skip ); } - - $categories = $wgRequest->getText( 'categories' ); - if ( $categories ) { - UploadWizardConfig::setUrlSetting( 'defaultCategories', explode( '|', $categories ) ); - } - - $ulrArgs = array( - 'id' => 'idFieldInitialValue', - 'description' => 'defaultDescription', - 'lat' => 'defaultLat', - 'lon' => 'defaultLon', - 'alt' => 'defaultAlt', - ); - - foreach ( $ulrArgs as $arg => $setting ) { - $value = $wgRequest->getText( $arg ); - if ( $value ) { - UploadWizardConfig::setUrlSetting( $setting, $value ); - } - } - + $this->handleCampaign(); $out = $this->getOutput(); @@ -94,7 +73,6 @@ $this->addJsVars( $subPage ); // dependencies (css, js) - $out->addModuleStyles( 'ext.uploadWizard' ); $out->addModules( 'ext.uploadWizard' ); // where the uploadwizard will go Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js =================================================================== --- trunk/extensions/UploadWizard/resources/mw.UploadWizard.js 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/resources/mw.UploadWizard.js 2012-03-21 20:21:34 UTC (rev 114400) @@ -746,7 +746,6 @@ } else { $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', true ); $j( _this.uploadToAdd.ui.div ).hide(); - _this.uploadToAdd.ui.hideFileInput(); } Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js =================================================================== --- trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js 2012-03-21 20:21:34 UTC (rev 114400) @@ -4,7 +4,7 @@ * @param languageCode -- string * @param firstRequired -- boolean -- the first description is required and should be validated and displayed a bit differently */ -mw.UploadWizardDescription = function( languageCode, required, initialValue ) { +mw.UploadWizardDescription = function( languageCode, required ) { var _this = this; mw.UploadWizardDescription.prototype.count++; _this.id = 'description' + mw.UploadWizardDescription.prototype.count; @@ -37,10 +37,6 @@ .attr( 'title', gM( 'mwe-upwiz-tooltip-description' ) ) .growTextArea(); - if ( initialValue !== undefined ) { - _this.input.val( initialValue ); - } - // descriptions _this.div = $j('<div class="mwe-upwiz-details-descriptions-container ui-helper-clearfix"></div>' ) .append( errorLabelDiv, fieldnameDiv, _this.languageMenu, _this.input ); Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js =================================================================== --- trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js 2012-03-21 20:21:34 UTC (rev 114400) @@ -170,11 +170,7 @@ _this.latInput = $j( '<input type="text" id="' + latId + '" name="' + latId + '" class="mwe-loc-lat" size="10"/>' ); _this.lonInput = $j( '<input type="text" id="' + lonId + '" name="' + lonId + '" class="mwe-loc-lon" size="10"/>' ); _this.altInput = $j( '<input type="text" id="' + altId + '" name="' + altId + '" class="mwe-loc-alt" size="10"/>' ); - - _this.latInput.val( mw.UploadWizard.config.defaultLat ); - _this.lonInput.val( mw.UploadWizard.config.defaultLon ); - _this.altInput.val( mw.UploadWizard.config.defaultAlt ); - + var latDiv = $j( '<div class="mwe-location-lat"></div>' ) .append( $j ( '<div class="mwe-location-lat-label"></div>' ).append( gM( 'mwe-upwiz-location-lat' ) ) ) .append( _this.latInput ); @@ -221,9 +217,7 @@ 'name': idFieldId, 'class': 'mwe-idfield', 'maxlength': mw.UploadWizard.config.idFieldMaxLength - } ); - - _this.idFieldInput.val( mw.UploadWizard.config.idFieldInitialValue ); + } ); _this.$form.append( $j( '<div class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' + idFieldId + '" generated="true"/></div>' ), @@ -335,13 +329,7 @@ mw.UploadWizardUtil.makeToggler( moreDetailsCtrlDiv, moreDetailsDiv ); - _this.addDescription( - !mw.UploadWizard.config.idField, - mw.config.get( 'wgUserLanguage' ), - false, - mw.UploadWizard.config.defaultDescription - ); - + _this.addDescription( !mw.UploadWizard.config.idField, mw.config.get( 'wgUserLanguage' ), false ); $j( containerDiv ).append( _this.div ); if ( mw.config.get( 'UploadWizardConfig' ).useTitleBlacklistApi ) { @@ -554,7 +542,7 @@ /** * Add a new description */ - addDescription: function( required, languageCode, allowRemove, initialValue ) { + addDescription: function( required, languageCode, allowRemove ) { var _this = this; if ( required === undefined ) { required = false; @@ -568,7 +556,7 @@ allowRemove = true; } - var description = new mw.UploadWizardDescription( languageCode, required, initialValue ); + var description = new mw.UploadWizardDescription( languageCode, required ); if ( !required && allowRemove ) { $j( description.div ).append( Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js =================================================================== --- trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js 2012-03-21 19:56:21 UTC (rev 114399) +++ trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js 2012-03-21 20:21:34 UTC (rev 114400) @@ -460,45 +460,28 @@ * @param selector jquery-compatible selector, for a single element */ moveFileInputToCover: function( selector ) { - var _this = this; - var update = function() { - var $covered = $j( selector ); + var $covered = $j( selector ); - _this.fileCtrlContainer - .css( $covered.position() ) - .css( 'marginTop', $covered.css( 'marginTop' ) ) - .css( 'marginRight', $covered.css( 'marginRight' ) ) - .css( 'marginBottom', $covered.css( 'marginBottom' ) ) - .css( 'marginLeft', $covered.css( 'marginLeft' ) ) - .width( $covered.outerWidth() ) - .height( $covered.outerHeight() ); + this.fileCtrlContainer + .css( $covered.position() ) + .css( 'marginTop', $covered.css( 'marginTop' ) ) + .css( 'marginRight', $covered.css( 'marginRight' ) ) + .css( 'marginBottom', $covered.css( 'marginBottom' ) ) + .css( 'marginLeft', $covered.css( 'marginLeft' ) ) + .width( $covered.outerWidth() ) + .height( $covered.outerHeight() ); - _this.fileCtrlContainer.css( { 'z-index': 1 } ); + this.fileCtrlContainer.css( { 'z-index': 1 } ); - // shift the file input over with negative margins, - // internal to the overflow-containing div, so the div shows all button - // and none of the textfield-like input - _this.$fileInputCtrl.css( { - 'margin-left': '-' + ~~( _this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px', - 'margin-top' : '-' + ~~( _this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px' - } ); - } + // shift the file input over with negative margins, + // internal to the overflow-containing div, so the div shows all button + // and none of the textfield-like input + this.$fileInputCtrl.css( { + 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px', + 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px' + } ); - if (this.moveFileInputInterval) { - window.clearInterval(this.moveFileInputInterval); - } - this.moveFileInputInterval = window.setInterval(function() { - update(); - }, 500); - update(); - }, - hideFileInput: function() { - if (this.moveFileInputInterval) { - window.clearInterval(this.moveFileInputInterval); - } - this.moveFileInputInterval = null; - // Should we actually hide it? }, /** _______________________________________________ MediaWiki-CVS mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
