Nischayn22 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/52628
Change subject: Hide the 'Next' button until a license is chosen.
......................................................................
Hide the 'Next' button until a license is chosen.
When uploading an image the 'Continue' button only appears after the
files have uploaded, it therefore makes sense to show the 'next' button in
the license step only after any deed is selected.
This removes the need for the NullDeed
Change-Id: Id9551311d833ace26abff4bec1ad136a84206168
---
M UploadWizard.i18n.php
M UploadWizardHooks.php
M includes/specials/SpecialUploadWizard.php
M resources/mw.UploadWizardDeed.js
4 files changed, 2 insertions(+), 25 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/28/52628/1
diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index 72ad625..f154a11 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -206,7 +206,6 @@
'mwe-upwiz-tooltip-location' => 'Coordinates of the location where this
media file was created.',
'mwe-upwiz-tooltip-more-info' => 'Learn more.',
'mwe-upwiz-file-need-file' => 'Please add an upload first.',
- 'mwe-upwiz-deeds-need-deed' => 'Please explain where you got
{{PLURAL:$1|this file|these files}} and how this site can use
{{PLURAL:$1|it|them}}, by selecting one of the options.',
'mwe-upwiz-deeds-need-license' => 'Please select a license.',
'mwe-upwiz-license-show-all' => 'Use a different license',
'mwe-upwiz-license-show-recommended' => 'Use the recommended license',
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index e12c89f..87b5fbe 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -317,7 +317,6 @@
'mwe-upwiz-tooltip-location',
'mwe-upwiz-tooltip-more-info',
'mwe-upwiz-file-need-file',
- 'mwe-upwiz-deeds-need-deed',
'mwe-upwiz-deeds-need-license',
'mwe-upwiz-license-show-all',
'mwe-upwiz-license-show-recommended',
diff --git a/includes/specials/SpecialUploadWizard.php
b/includes/specials/SpecialUploadWizard.php
index 30e9aaf..217ca29 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -452,7 +452,7 @@
. '<div id="mwe-upwiz-deeds"
class="ui-helper-clearfix"></div>'
. '<div id="mwe-upwiz-deeds-custom"
class="ui-helper-clearfix"></div>'
. '<div class="mwe-upwiz-buttons">'
- . '<button class="mwe-upwiz-button-next">' .
$this->msg( "mwe-upwiz-next-deeds" )->text() . '</button>'
+ . '<button class="mwe-upwiz-button-next"
style="display:none;">' . $this->msg( "mwe-upwiz-next-deeds" )->text() .
'</button>'
. '</div>'
. '</div>'
diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index c4a274d..698eaf6 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -34,14 +34,6 @@
};
-
-mw.UploadWizardNullDeed = $j.extend( new mw.UploadWizardDeed(), {
- valid: function() {
- return false;
- }
-} );
-
-
/**
* Set up the form and deed object for the deed option that says these uploads
are all the user's own work.
* @param {Number} integer count of uploads that this deed refers to (useful
for message pluralization)
@@ -416,10 +408,6 @@
// deselect all deeds
_this.deselectDeedInterface( this.$selector.find( '.mwe-upwiz-deed' ) );
-
- // set the "value" to be the null deed; which will cause an error if
the data is submitted.
- _this.choose( mw.UploadWizardNullDeed );
-
};
@@ -442,13 +430,6 @@
// otherwise, we can assume that the widgets have already added
error messages.
if (valid) {
_this.hideError();
- } else {
- if ( _this.deed === mw.UploadWizardNullDeed ) {
- _this.showError( gM(
'mwe-upwiz-deeds-need-deed', _this.uploads.length ) );
- $j( _this ).bind( 'chooseDeed', function() {
- _this.hideError();
- } );
- }
}
return valid;
},
@@ -472,9 +453,7 @@
choose: function( deed ) {
var _this = this;
_this.deed = deed;
- if ( deed !== mw.UploadWizardNullDeed ) {
- $j( _this ).trigger( 'chooseDeed' );
- }
+ $( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next' ).show();
},
/**
--
To view, visit https://gerrit.wikimedia.org/r/52628
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9551311d833ace26abff4bec1ad136a84206168
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits