Alex Monk has submitted this change and it was merged.
Change subject: (bug 42454) Show "add more files from flickr"
......................................................................
(bug 42454) Show "add more files from flickr"
Adds support to upload more images from flickr after the user has already
uploaded some files.
Change-Id: Ic955e27d1d999491f84a92d694c8c8d6632e59b6
TODO: refactor code as this shouldn't be under updateFileCounts()
---
M UploadWizard.i18n.php
M UploadWizardHooks.php
M resources/mw.UploadWizard.js
3 files changed, 14 insertions(+), 0 deletions(-)
Approvals:
Alex Monk: Verified; Looks good to me, approved
Siebrand: Looks good to me, but someone else must approve
diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index 5bd9f0f..f23e86b 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -49,6 +49,7 @@
'mwe-upwiz-add-file-0-free' => 'Select a media file to share',
'mwe-upwiz-upload-flickr' => 'Upload images from Flickr',
'mwe-upwiz-add-file-flickr' => 'Add images from Flickr',
+ 'mwe-upwiz-add-file-flickr-n' => 'Add more images from Flickr',
'mwe-upwiz-add-flickr-or' => 'Or' ,
'mwe-upwiz-add-flickr' => 'Get from Flickr',
'mwe-upwiz-flickr-input-placeholder' => 'Flickr image/photoset URL',
@@ -487,6 +488,7 @@
|} This is a button label, used in the "{{MediaWiki:mwe-upwiz-step-file/en}}"
page of the [[:mw:Extension:UploadWizard|MediaWiki Upload Wizard]].',
'mwe-upwiz-add-file-0-free' => 'This message appears on the big button
on the first page of the Upload Wizard. Files can be dragged to that button
from the operating system\'s file manager. Pressing the button will open a
"browse" window to choose a file. Note: when translating "share", remember that
you have to makee it clear to the user that they are sharing the media with the
public, making it freely available (technically, published and released under a
free license); if no equivalent is available, just translate as "upload".',
'mwe-upwiz-add-file-flickr' => 'Label of a button in the first view of
Special:UploadWizard, which is offered as an alternative to upload of local
files and brings to another step.',
+ 'mwe-upwiz-add-file-flickr-n' => 'Label of a button which is offered as
an alternative to upload of local files after few files have already been
uploaded.',
'mwe-upwiz-add-flickr-or' => 'Connecting word in upload wizard between
the following action elements:
* {{msg-mw|mwe-upwiz-add-file-0-free}}
* {{msg-mw|mwe-upwiz-add-file-flickr}}',
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 39a2bc0..172a081 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -169,6 +169,7 @@
'mwe-upwiz-flickr-input-placeholder',
'mwe-upwiz-add-flickr',
'mwe-upwiz-add-file-flickr',
+ 'mwe-upwiz-add-file-flickr-n',
'mwe-upwiz-select-flickr',
'mwe-upwiz-flickr-disclaimer',
'mwe-upwiz-browse',
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 1559e44..6e9bff7 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -920,6 +920,13 @@
_this.$addFileContainer.removeClass(
'mwe-upwiz-add-files-0' );
_this.$addFileContainer.addClass(
'mwe-upwiz-add-files-n' );
_this.$addFileContainer.show();
+ // changes the flickr add button to "add more
files from flickr"
+ $j( '#mwe-upwiz-upload-ctrl-flickr' ).button(
'option', 'label', mw.msg( 'mwe-upwiz-add-file-flickr-n' ) );
+ $j( '#mwe-upwiz-add-file-container,
#mwe-upwiz-upload-ctrl-flickr-container' ).show();
+ // empty the flickr lists
+ $j( '#mwe-upwiz-flickr-select-list' ).empty();
+ $j( '#mwe-upwiz-flickr-select-list-container'
).unbind();
+ $j( '#mwe-upwiz-select-flickr' ).unbind();
} else {
_this.$addFile = this.$addFile || $j(
'#mwe-upwiz-add-file' );
_this.$addFile.hide();
@@ -951,6 +958,8 @@
// changes the button back from "add another file" to
the initial centered invitation button
$j( '#mwe-upwiz-add-file' ).button( 'option', 'label',
gM( 'mwe-upwiz-add-file-0-free' ) );
$j( '#mwe-upwiz-upload-ctr-divide' ).show();
+ // changes the button back from "add more files from
flickr" to the initial text
+ $j( '#mwe-upwiz-upload-ctrl-flickr' ).button( 'option',
'label', mw.msg( 'mwe-upwiz-add-file-flickr' ) );
$j( '#mwe-upwiz-add-file,
#mwe-upwiz-upload-ctrl-flickr' ).removeClass( 'mwe-upwiz-add-files-n' );
$j( '#mwe-upwiz-add-file-container' ).addClass(
'mwe-upwiz-add-files-0' );
$j( '#mwe-upwiz-add-file-container,
#mwe-upwiz-upload-ctrl-flickr-container' ).show();
@@ -987,10 +996,12 @@
// allow an "add another upload" button only if we aren't at max
if ( _this.uploads.length < _this.maxUploads ) {
$j( '#mwe-upwiz-add-file' ).button( 'option',
'disabled', false );
+ $j( '#mwe-upwiz-upload-ctrl-flickr' ).button( 'option',
'disabled', false );
$j( _this.uploadToAdd.ui.div ).show();
_this.uploadToAdd.ui.moveFileInputToCover(
'#mwe-upwiz-add-file' );
} else {
$j( '#mwe-upwiz-add-file' ).button( 'option',
'disabled', true );
+ $j( '#mwe-upwiz-upload-ctrl-flickr' ).button( 'option',
'disabled', true );
$j( _this.uploadToAdd.ui.div ).hide();
_this.uploadToAdd.ui.hideFileInput();
}
--
To view, visit https://gerrit.wikimedia.org/r/45733
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic955e27d1d999491f84a92d694c8c8d6632e59b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Nischayn22 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits