r95793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95792‎ | r95793 | r95794 >
Date:16:41, 30 August 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
fix point 3 from bug 30620
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -1170,31 +1170,44 @@
11711171
11721172 },
11731173
1174 -
1175 - // do some last minute prep before advancing to the DEEDS page
1176 - prepareAndMoveToDeeds: function() {
1177 - var _this = this;
 1174+
 1175+ /**
 1176+ * Get the own work and third party licensing deeds if they are needed.
 1177+ *
 1178+ * @since 1.2
 1179+ * @param {int|false} uploadsLength
 1180+ * @return {Array}
 1181+ */
 1182+ getLicensingDeeds: function( uploadsLength ) {
11781183 var deeds = [];
1179 - var hasChoice = mw.UploadWizard.config.ownWorkOption == 'choice';
11801184
1181 - if ( hasChoice ) {
 1185+ if ( mw.UploadWizard.config.ownWorkOption == 'choice' ) {
11821186 // these deeds are standard
1183 - deeds.push( new mw.UploadWizardDeedOwnWork( _this.uploads.length ) );
1184 - deeds.push( new mw.UploadWizardDeedThirdParty( _this.uploads.length ) );
 1187+ deeds.push( new mw.UploadWizardDeedOwnWork( uploadsLength ) );
 1188+ deeds.push( new mw.UploadWizardDeedThirdParty( uploadsLength ) );
11851189 }
11861190 else {
11871191 if ( mw.UploadWizard.config.ownWorkOption == 'own' ) {
1188 - deeds.push( new mw.UploadWizardDeedOwnWork( _this.uploads.length ) );
 1192+ deeds.push( new mw.UploadWizardDeedOwnWork( uploadsLength ) );
11891193 }
11901194 else {
1191 - deeds.push( new mw.UploadWizardDeedThirdParty( _this.uploads.length ) );
 1195+ deeds.push( new mw.UploadWizardDeedThirdParty( uploadsLength ) );
11921196 }
11931197 }
 1198+
 1199+ return deeds;
 1200+ },
11941201
 1202+ // do some last minute prep before advancing to the DEEDS page
 1203+ prepareAndMoveToDeeds: function() {
 1204+ var _this = this;
 1205+ var deeds = _this.getLicensingDeeds( _this.uploads.length );
 1206+
11951207 this.shouldShowIndividualDeed = function() {
1196 - if ( hasChoice ) return true;
1197 -
1198 - if ( mw.UploadWizard.config.ownWorkOption == 'own' ) {
 1208+ if ( mw.UploadWizard.config.ownWorkOption == 'choice' ) {
 1209+ return true;
 1210+ }
 1211+ else if ( mw.UploadWizard.config.ownWorkOption == 'own' ) {
11991212 var ownWork = mw.UploadWizard.config.licensesOwnWork;
12001213 var licenseIsNotDefault = ( ownWork.licenses.length === 1 && ownWork.licenses[0] !== ownWork.defaults[0] );
12011214 return ownWork.licenses.length > 1 || licenseIsNotDefault;
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -350,12 +350,14 @@
351351 var _this = this;
352352 _this.copyrightInfoFieldset.show();
353353 _this.upload.wizardDeedChooser = _this.upload.deedChooser;
 354+
354355 _this.upload.deedChooser = new mw.UploadWizardDeedChooser(
355356 _this.deedDiv,
356 - [ new mw.UploadWizardDeedOwnWork(),
357 - new mw.UploadWizardDeedThirdParty() ],
 357+ mw.UploadWizard.prototype.getLicensingDeeds(),
358358 [ _this.upload ]
359359 );
 360+
 361+ _this.upload.deedChooser.onLayoutReady();
360362 },
361363
362364 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r958871.17wmf1: MFT UploadWizard fixes r95691, r95726, r95727, r95793, r95815, r958...catrope17:10, 31 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95726address point 2 from bug 30620jeroendedauw23:25, 29 August 2011

Status & tagging log