r108804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108803‎ | r108804 | r108805 >
Date:11:11, 13 January 2012
Author:santhosh
Status:ok (Comments)
Tags:
Comment:
Add help links for special pages of Translate.
CSS cleanup.
Modified paths:
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)
  • /trunk/extensions/Translate/resources/ext.translate.helplink.css (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialLanguageStats.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialManageGroups.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslate.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslationStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/specials/SpecialManageGroups.php
@@ -92,6 +92,7 @@
9393
9494 $groups = MessageGroups::singleton()->getGroups();
9595
 96+ TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Help:Extension:Translate/Group_management' );
9697 $wgOut->wrapWikiMsg( '<h2>$1</h2>', 'translate-manage-listgroups' );
9798 $separator = wfMsg( 'word-separator' );
9899
Index: trunk/extensions/Translate/specials/SpecialTranslate.php
@@ -81,6 +81,7 @@
8282 $this->options['group'] = $this->defaults['group'];
8383 }
8484
 85+ TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate' );
8586 // Show errors nicely.
8687 $wgOut->addHTML( $this->settingsForm( $errors ) );
8788
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php
@@ -115,6 +115,7 @@
116116 global $wgOut, $wgScript;
117117
118118 $this->setHeaders();
 119+ TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting' );
119120 $wgOut->addWikiMsg( 'translate-statsf-intro' );
120121
121122 $wgOut->addHTML(
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php
@@ -120,6 +120,7 @@
121121 }
122122
123123 if ( !$this->including() ) {
 124+ TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting' );
124125 $wgOut->addHTML( $this->getForm() );
125126 }
126127
Index: trunk/extensions/Translate/TranslateUtils.php
@@ -316,12 +316,9 @@
317317 * @since 2012-01-12
318318 */
319319 public static function addSpecialHelpLink( OutputPage $out, /*string*/$to ) {
320 - global $wgExtensionAssetsPath;
321 -
322320 $out->addModules( 'ext.translate.helplink' );
323321 $text = wfMessage( 'translate-gethelp' )->escaped();
324 - $image = Html::element( 'img', array( 'src' => "$wgExtensionAssetsPath/Translate/resources/images/help.png" ) );
325 - $link = Html::rawElement( 'a', array( 'href' => "//www.mediawiki.org/wiki/Special:MyLanguage/$to" ), "$image$text" );
 322+ $link = Html::rawElement( 'a', array( 'href' => "//www.mediawiki.org/wiki/Special:MyLanguage/$to" ), "$text" );
326323 $wrapper = Html::rawElement( 'div', array( 'class' => 'mw-translate-helplink' ), $link );
327324 $out->addHtml( $wrapper );
328325 }
Index: trunk/extensions/Translate/resources/ext.translate.helplink.css
@@ -1,19 +1,14 @@
22 .mw-translate-helplink {
3 - position: relative;
 3+ position: absolute;
 4+ width: 100%;
 5+ display: block;
46 margin-top: -10px;
5 - float: right;
67 }
78
89 .mw-translate-helplink a {
9 - display: block;
10 - position: absolute;
11 - width: 150px;
12 - left: -150px;
13 - text-align: right;
14 - overflow: hidden;
 10+ /* @embed */
 11+ background: url(images/help.png) no-repeat scroll left center transparent;
 12+ padding-left: 20px;
 13+ float: right;
1514 }
1615
17 -.mw-translate-helplink img {
18 - vertical-align: middle;
19 - margin-right: 4px;
20 -}

Follow-up revisions

RevisionCommit summaryAuthorDate
r108805Add help link to the main page of Special:Translate too....santhosh11:25, 13 January 2012
r110310MFT 1.18wmf1 r108719 r108793 r108804 r108805 r109019 r109744 r109745 r109747 ...nikerabbit18:11, 30 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   11:28, 13 January 2012

Discussed on Skype about few minor things:

  • The target of the link in Special:Translate
  • The link comes after introduction text in some pages

Status & tagging log