jenkins-bot has submitted this change and it was merged.
Change subject: Update code formatting and a few other nit picks
......................................................................
Update code formatting and a few other nit picks
Change-Id: If3ff1d5021c4285acfaa1a078c3a0aed48b56e38
---
M MainPage.alias.php
M MainPage.i18n.php
M MainPage.php
M resources/js/ext.translate.mainpage.js
M specials/SpecialTwnMainPage.php
5 files changed, 39 insertions(+), 18 deletions(-)
Approvals:
Amire80: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MainPage.alias.php b/MainPage.alias.php
index e626ce0..30d9e2d 100644
--- a/MainPage.alias.php
+++ b/MainPage.alias.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * Special page aliases for extension TwnMainPage.
+ *
+ * @file
+ * @ingroup Extensions
+ */
$specialPageAliases = array();
@@ -49,4 +55,4 @@
/** Traditional Chinese (中文(繁體)) */
$specialPageAliases['zh-hant'] = array(
'TwnMainPage' => array( '主頁' ),
-);
\ No newline at end of file
+);
diff --git a/MainPage.i18n.php b/MainPage.i18n.php
index df2a7c8..616ef9f 100644
--- a/MainPage.i18n.php
+++ b/MainPage.i18n.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * Internationalisation file for extension TwnMainPage.
+ *
+ * @file
+ * @ingroup Extensions
+ */
$messages = array();
diff --git a/MainPage.php b/MainPage.php
index f2ae020..c81be12 100644
--- a/MainPage.php
+++ b/MainPage.php
@@ -15,7 +15,7 @@
$wgExtensionCredits['specialpage'][] = array(
'path' => __FILE__,
'name' => 'Translatewiki.net main page',
- 'version' => '2013-03-20',
+ 'version' => '2013-05-10',
'author' => array( 'Niklas Laxström', 'Santhosh Thottingal' ),
'descriptionmsg' => 'twnmp-desc',
);
@@ -35,11 +35,12 @@
$wgMainPageImages = array();
// Example
-$wgExtensionFunctions[] = function () {
+$wgExtensionFunctions[] = function () {
global $wgMainPageImages, $wgExtensionAssetsPath;
$wgMainPageImages[] = array(
'url' =>
"$wgExtensionAssetsPath/TwnMainPage/resources/banners/dance.jpg",
'attribution' => '<a
href="http://www.flickr.com/photos/ldhendrix/7389351416/">CC-BY ldhendrix</a>',
);
+
return true;
};
diff --git a/resources/js/ext.translate.mainpage.js
b/resources/js/ext.translate.mainpage.js
index be43b63..ed28ecd 100644
--- a/resources/js/ext.translate.mainpage.js
+++ b/resources/js/ext.translate.mainpage.js
@@ -12,8 +12,12 @@
$tiles = $( '.project-tile' );
$tiles.hover(
- function () { $( this ).find( '.project-actions'
).removeClass( 'hide' ); },
- function () { $( this ).find( '.project-actions'
).addClass( 'hide' ); }
+ function () {
+ $( this ).find( '.project-actions'
).removeClass( 'hide' );
+ },
+ function () {
+ $( this ).find( '.project-actions' ).addClass(
'hide' );
+ }
);
if ( $tiles.length !== 8 ) {
@@ -72,7 +76,9 @@
};
req = api.post( options );
- req.fail( function () { window.alert( 'Failure' ); } );
+ req.fail( function () {
+ window.alert( 'Failure' );
+ } );
req.done( function () {
var options, req,
api = new mw.Api();
@@ -84,13 +90,15 @@
};
req = api.post( options );
- req.fail( function () { window.alert(
'Failure2' ); } );
+ req.fail( function () {
+ window.alert( 'Failure2' );
+ } );
req.done( function ( data ) {
var req,
api = new mw.Api();
req = api.post( $.extend( {}, {
lgtoken: data.login.token }, options ) );
- req.done( function ( ) {
+ req.done( function () {
window.location.reload();
} );
} );
diff --git a/specials/SpecialTwnMainPage.php b/specials/SpecialTwnMainPage.php
index 7cb2ed4..e6a472e 100644
--- a/specials/SpecialTwnMainPage.php
+++ b/specials/SpecialTwnMainPage.php
@@ -138,7 +138,6 @@
}
}
-
$out .= implode( "\n\n", $tiles );
$out .= Html::closeElement( 'div' );
@@ -156,7 +155,7 @@
}
$uiLanguage = $this->getLanguage();
- $stats = MessageGroupStats::forItem(
$group->getId(),$uiLanguage->getCode() );
+ $stats = MessageGroupStats::forItem( $group->getId(),
$uiLanguage->getCode() );
$statsbar = StatsBar::getNew( $group->getId(),
$uiLanguage->getCode(), $stats );
$translated = $stats[MessageGroupStats::TRANSLATED];
@@ -169,20 +168,21 @@
$image = Html::element( 'img', array( 'src' => $url, 'width' =>
'100%' ) );
$label = htmlspecialchars( $group->getLabel(
$this->getContext() ) );
$stats = $statsbar->getHtml( $this->getContext() );
+ // @todo FIXME i18n: Hard coded percentage character twice.
$acts =
Html::element( 'span', array( 'class' => 'translate' ),
"$translated%" ) .
- Html::element( 'span', array( 'class' => 'proofread' ),
"$proofread%" );
+ Html::element( 'span', array( 'class' =>
'proofread' ), "$proofread%" );
$title = SpecialPage::getTitleFor( 'Translate' );
$translate = Html::element( 'a', array(
- 'class' => 'translate',
- 'href' => $title->getLocalUrl( array( 'group'
=> $group->getId() ) )
- ), $this->msg( 'twnmp-translate-button' )->text() );
+ 'class' => 'translate',
+ 'href' => $title->getLocalUrl( array( 'group' =>
$group->getId() ) )
+ ), $this->msg( 'twnmp-translate-button' )->text() );
$proofread = Html::element( 'a', array(
- 'class' => 'proofread',
- 'href' => $title->getLocalUrl( array( 'group'
=> $group->getId(), 'action' => 'proofread' ) )
- ), $this->msg( 'twnmp-proofread-button' )->text() );
+ 'class' => 'proofread',
+ 'href' => $title->getLocalUrl( array( 'group' =>
$group->getId(), 'action' => 'proofread' ) )
+ ), $this->msg( 'twnmp-proofread-button' )->text() );
$out = <<<HTML
<div class="three columns twn-mainpage-project-tile">
@@ -241,7 +241,7 @@
$out = Html::openElement( 'div', array( 'class' => 'row
twn-mainpage-footer' ) );
$out .= Html::element( 'a', array(
'class' => 'three column',
- 'href' =>Title::newFromText(
'Special:MyLanguage/Project:About' )->getLocalUrl(),
+ 'href' => Title::newFromText(
'Special:MyLanguage/Project:About' )->getLocalUrl(),
), $this->msg( 'twnmp-bottom-about' )->text() );
$out .= Html::element( 'a', array(
'class' => 'three column',
--
To view, visit https://gerrit.wikimedia.org/r/63119
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If3ff1d5021c4285acfaa1a078c3a0aed48b56e38
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TwnMainPage
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits