MarkTraceur has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315974

Change subject: Fix a weird ghost "or" for non-Flickr users
......................................................................

Fix a weird ghost "or" for non-Flickr users

Just a confusing UI element that got included for non-upload_by_url users,
missed in the tests because I usually have that option turned on...

Change-Id: I05fa7f6dccf4031b18c3dd14cee7c69b7309d5bd
---
M resources/ui/steps/uw.ui.Upload.js
1 file changed, 35 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/74/315974/1

diff --git a/resources/ui/steps/uw.ui.Upload.js 
b/resources/ui/steps/uw.ui.Upload.js
index a9706c7..ae6489c 100644
--- a/resources/ui/steps/uw.ui.Upload.js
+++ b/resources/ui/steps/uw.ui.Upload.js
@@ -34,38 +34,14 @@
                        'file'
                );
 
-               this.$uploadCenterDivide = $( '<p>' )
-                       .attr( 'id', 'mwe-upwiz-upload-ctr-divide' )
-                       .text( mw.message( 'mwe-upwiz-add-flickr-or' ).text() );
-
-               this.$flickrAddFileContainer = $( '<div>' )
-                       .attr( 'id', 'mwe-upwiz-upload-ctrl-flickr-container' )
-                       .append( this.$uploadCenterDivide );
-
                this.$addFileContainer = $( '<div>' )
                        .attr( 'id', 'mwe-upwiz-add-file-container' )
-                       .addClass( 'mwe-upwiz-add-files-0' )
-                       .append( this.$flickrAddFileContainer );
+                       .addClass( 'mwe-upwiz-add-files-0' );
 
                this.$uploadCtrl = $( '<div>' )
                        .attr( 'id', 'mwe-upwiz-upload-ctrls' )
                        .addClass( 'mwe-upwiz-file ui-helper-clearfix' )
                        .append( this.$addFileContainer );
-
-               this.$flickrSelectList = $( '<div>' )
-                       .attr( 'id', 'mwe-upwiz-flickr-select-list' );
-
-               this.$flickrSelectListContainer = $( '<div>' )
-                       .attr( 'id', 'mwe-upwiz-flickr-select-list-container' )
-                       .addClass( 'ui-corner-all' )
-                       .append(
-                               $( '<div>' )
-                                       .text( mw.message(
-                                               'mwe-upwiz-multi-file-select2',
-                                               config.maxUploads
-                                       ) ),
-                               this.$flickrSelectList
-                       );
 
                this.addFile = new OO.ui.ButtonWidget( {
                        id: 'mwe-upwiz-add-file',
@@ -73,9 +49,16 @@
                        flags: [ 'constructive', 'primary' ]
                } );
 
-               this.$addFileContainer.prepend( this.addFile.$element );
+               this.$addFileContainer.append( this.addFile.$element );
 
                if ( this.isFlickrImportEnabled() ) {
+                       this.$flickrAddFileContainer = $( '<div>' )
+                               .attr( 'id', 
'mwe-upwiz-upload-ctrl-flickr-container' );
+
+                       this.$uploadCenterDivide = $( '<p>' )
+                               .attr( 'id', 'mwe-upwiz-upload-ctr-divide' )
+                               .text( mw.message( 'mwe-upwiz-add-flickr-or' 
).text() );
+
                        this.addFlickrFile = new OO.ui.ButtonWidget( {
                                id: 'mwe-upwiz-add-flickr-file',
                                label: mw.message( 'mwe-upwiz-add-file-flickr' 
).text(),
@@ -84,7 +67,28 @@
                                upload.emit( 'flickr-ui-init' );
                        } );
 
-                       this.$flickrAddFileContainer.append( 
this.addFlickrFile.$element );
+                       this.$flickrAddFileContainer.append(
+                               this.$uploadCenterDivide,
+                               this.addFlickrFile.$element
+                       );
+
+                       this.$addFileContainer
+                               .append( this.$flickrAddFileContainer );
+
+                       this.$flickrSelectList = $( '<div>' )
+                               .attr( 'id', 'mwe-upwiz-flickr-select-list' );
+
+                       this.$flickrSelectListContainer = $( '<div>' )
+                               .attr( 'id', 
'mwe-upwiz-flickr-select-list-container' )
+                               .addClass( 'ui-corner-all' )
+                               .append(
+                                       $( '<div>' )
+                                               .text( mw.message(
+                                                       
'mwe-upwiz-multi-file-select2',
+                                                       config.maxUploads
+                                               ) ),
+                                       this.$flickrSelectList
+                               );
 
                        this.$flickrSelect = $( '#mwe-upwiz-select-flickr' );
                }
@@ -173,7 +177,10 @@
                if ( haveUploads ) {
                        // we have uploads ready to go, so allow us to proceed
                        this.$addFileContainer.add( this.$buttons ).show();
-                       this.$uploadCenterDivide.hide();
+
+                       if ( this.isFlickrImportEnabled() ) {
+                               this.$uploadCenterDivide.hide();
+                       }
 
                        // fix the rounded corners on file elements.
                        // we want them to be rounded only when their edge 
touched the top or bottom of the filelist.

-- 
To view, visit https://gerrit.wikimedia.org/r/315974
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05fa7f6dccf4031b18c3dd14cee7c69b7309d5bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <mholmqu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to