Jdlrobson has submitted this change and it was merged.
Change subject: bug 45465: Increment upload count on successful upload page
upload
......................................................................
bug 45465: Increment upload count on successful upload page upload
wrap number of uploads in a span
increment it on successful upload
Change-Id: I0b87ea2e156f7507db24a18d0f03a63df9281050
---
M MobileFrontend.i18n.php
M MobileFrontend.php
M includes/specials/SpecialDonateImage.php
M javascripts/specials/donateimage.js
4 files changed, 10 insertions(+), 4 deletions(-)
Approvals:
Siebrand: Looks good to me, but someone else must approve
JGonera: Looks good to me, but someone else must approve
Jdlrobson: Verified; Looks good to me, approved
jenkins-bot: Checked
diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 2e5587b..f344669 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -237,7 +237,7 @@
'mobile-frontend-photo-license' => 'By clicking "Submit", you agree to
our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to
release your photo under the [//creativecommons.org/licenses/by-sa/3.0/
Creative Commons Attribution-ShareAlike 3.0 License].',
'mobile-frontend-photo-submit' => 'Submit',
'mobile-frontend-photo-cancel' => 'Cancel',
- 'mobile-frontend-photo-upload-user-count' => '{{PLURAL:$1|1 upload|$1
uploads}}',
+ 'mobile-frontend-photo-upload-user-count' =>
'{{PLURAL:$1|<span>1</span> upload|<span>$1</span> uploads}}',
'mobile-frontend-photo-upload-user-count-over-limit' => '500+ uploads',
// Change tags
@@ -583,7 +583,7 @@
{{Identical|Submit}}',
'mobile-frontend-photo-cancel' => 'Caption for the cancel button on the
photo upload form.
{{Identical|Cancel}}',
- 'mobile-frontend-photo-upload-user-count' => 'Displays the number of
images the user has uploaded. Parameter is number of images.',
+ 'mobile-frontend-photo-upload-user-count' => 'Displays the number of
images the user has uploaded. Parameter is number of images. Wrap the number in
a span tag to allow the number to be incremented programatically',
'mobile-frontend-photo-upload-user-count-over-limit' => 'Displayed in
place of mobile-frontend-photo-upload-user-count when user has uploaded more
than 500 images.',
'tag-mobile_edit' => 'Short change tag name that appears e.g. in
[[Special:RecentChanges]].
diff --git a/MobileFrontend.php b/MobileFrontend.php
index a231846..41dcb91 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -496,6 +496,7 @@
'mobile-frontend-donate-photo-first-upload-success',
'mobile-frontend-donate-image-summary',
'mobile-frontend-listed-image-no-description',
+ 'mobile-frontend-photo-upload-user-count',
),
'scripts' => array(
'javascripts/specials/donateimage.js',
diff --git a/includes/specials/SpecialDonateImage.php
b/includes/specials/SpecialDonateImage.php
index dad873f..7cc4ee5 100644
--- a/includes/specials/SpecialDonateImage.php
+++ b/includes/specials/SpecialDonateImage.php
@@ -35,9 +35,9 @@
} else {
$msg = $this->msg(
'mobile-frontend-photo-upload-user-count'
- )->numParams( $uploadCount )->text();
+ )->numParams( $uploadCount )->parse();
}
- $html .= Html::element( 'h2', array(), $msg );
+ $html .= Html::openElement( 'h2', array() ) .
$msg . Html::closeElement( 'h2' );
$html .= '</div>';
}
$html .= '<ul class="mobileUserGallery"></ul>';
diff --git a/javascripts/specials/donateimage.js
b/javascripts/specials/donateimage.js
index 82378f1..02dbd63 100644
--- a/javascripts/specials/donateimage.js
+++ b/javascripts/specials/donateimage.js
@@ -159,8 +159,13 @@
} ).
appendTo( $container ).
on( 'success', function( image ) {
+ var $counter = $container.find( 'h2
span' ), newCount;
image.width = IMAGE_WIDTH;
userGallery.addPhoto( image, true );
+ if ( $counter[ 0 ] ) {
+ newCount = parseInt(
$counter.text(), 10 ) + 1;
+ $counter.parent().text( mw.msg(
'mobile-frontend-photo-upload-user-count', newCount ) );
+ }
} );
}
if ( username ) {
--
To view, visit https://gerrit.wikimedia.org/r/51205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0b87ea2e156f7507db24a18d0f03a63df9281050
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits