r86692 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86691‎ | r86692 | r86693 >
Date:09:05, 22 April 2011
Author:nikola
Status:deferred (Comments)
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Interlanguage/Interlanguage.i18n.php (modified) (history)
  • /trunk/extensions/Interlanguage/Interlanguage.php (modified) (history)
  • /trunk/extensions/Interlanguage/InterlanguageExtension.php (modified) (history)
  • /trunk/extensions/Interlanguage/modules (added) (history)
  • /trunk/extensions/Interlanguage/modules/interlanguage.css (added) (history)

Diff [purge]

Index: trunk/extensions/Interlanguage/InterlanguageExtension.php
@@ -42,6 +42,7 @@
4343 global $wgMemc;
4444
4545 $this->addPageLink( $parser->getOutput(), $param );
 46+ $parser->getOutput()->addModules( 'ext.Interlanguage' );
4647
4748 $key = wfMemcKey( 'Interlanguage', md5( $param ) );
4849 $res = $wgMemc->get( $key );
@@ -297,11 +298,9 @@
298299 foreach( $pagelinktitles as $title ) {
299300 $template->data['language_urls'][] = array(
300301 'href' => $title->getFullURL( array( 'action' => 'edit' ) ),
301 - 'text' => wfMsg( 'editsection' ),
 302+ 'text' => wfMsg( 'interlanguage-editlinks' ),
302303 'title' => $title->getText(),
303304 'class' => "interwiki-interlanguage",
304 - 'before' => "[",
305 - 'after' => "]",
306305 );
307306 }
308307
Index: trunk/extensions/Interlanguage/modules/interlanguage.css
@@ -0,0 +1,22 @@
 2+.interwiki-interlanguage {
 3+ list-style-type: none;
 4+ list-style-image: none;
 5+ text-align: right;
 6+ padding-right: .5em !important;
 7+}
 8+
 9+.interwiki-interlanguage > a {
 10+ padding-left: 11px;
 11+ background-repeat: no-repeat;
 12+ background-position: left center;
 13+}
 14+
 15+.interwiki-interlanguage > a:link, .interwiki-interlanguage > a:visited {
 16+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKBAMAAAB/HNKOAAAAD1BMVEUZAAD///95eXmqqqrY2NjEIQ0cAAAAAXRSTlMAQObYZgAAACdJREFUCNdjYGBgYGIAASUFENNJCUiqmADZTM5OqExFFZAKRSG4YgBjcwODynSgDwAAAABJRU5ErkJggg==');
 17+ color: #797979 !important;
 18+}
 19+
 20+.interwiki-interlanguage > a:hover {
 21+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKBAMAAAB/HNKOAAAAD1BMVEWBAADY2Nj///8GRa0zZrtW2AECAAAAAXRSTlMAQObYZgAAACdJREFUCNdjYGBgYGYAAWMDEFPYGEgaOgLZzCLCqEwjQ5AKI2W4YgBg5QOTQPzBuAAAAABJRU5ErkJggg==");
 22+ color: #0645AD !important;
 23+}
Property changes on: trunk/extensions/Interlanguage/modules/interlanguage.css
___________________________________________________________________
Added: svn:eol-style
124 + native
Index: trunk/extensions/Interlanguage/Interlanguage.i18n.php
@@ -13,6 +13,7 @@
1414 $messages['en'] = array(
1515 'interlanguage-desc' => 'Grabs interlanguage links from another wiki',
1616 'interlanguage-pagelinksexplanation' => 'Pages with interlanguage links:',
 17+ 'interlanguage-editlinks' => 'Edit Links',
1718 );
1819
1920 /** Message documentation (Message documentation)
@@ -400,8 +401,9 @@
401402 * @author Михајло Анђелковић
402403 */
403404 $messages['sr-ec'] = array(
404 - 'interlanguage-desc' => 'Преузима међувики са другог пројекта',
 405+ 'interlanguage-desc' => 'Преузима међујезичке везе са другог пројекта',
405406 'interlanguage-pagelinksexplanation' => 'Странице са међујезичким везама:',
 407+ 'interlanguage-editlinks' => 'Уреди везе',
406408 );
407409
408410 /** Serbian Latin ekavian (‪Srpski (latinica)‬) */
Index: trunk/extensions/Interlanguage/Interlanguage.php
@@ -41,6 +41,11 @@
4242 $wgExtensionMessagesFiles['InterlanguageMagic'] = dirname(__FILE__) . '/Interlanguage.i18n.magic.php';
4343 $wgAutoloadClasses['InterlanguageExtension'] = dirname(__FILE__) . '/InterlanguageExtension.php';
4444 $wgHooks['ParserFirstCallInit'][] = 'wfInterlanguageExtension';
 45+$wgResourceModules['ext.Interlanguage'] = array(
 46+ 'styles' => 'modules/interlanguage.css',
 47+ 'localBasePath' => dirname( __FILE__ ),
 48+ 'remoteExtPath' => 'Interlanguage',
 49+);
4550
4651 function wfInterlanguageExtension( $parser ) {
4752 global $wgHooks, $wgInterlanguageExtension;

Follow-up revisions

RevisionCommit summaryAuthorDate
r87753- {{languagelink}} magic in InterlanguageCentral extension, to enable...nikola18:29, 9 May 2011

Comments

#Comment by Nikerabbit (talk | contribs)   11:34, 22 April 2011

Please document interlanguage-editlinks and don't use Title Case.

#Comment by Nikola Smolenski (talk | contribs)   19:34, 22 April 2011

You mean on TranslateWiki? Someone did that already :) Title Case is used in the design pass itself so that's why I used it.

#Comment by Nikerabbit (talk | contribs)   19:54, 22 April 2011

Mediawiki doesn't use title case regardless what the design docs have.

#Comment by Nikola Smolenski (talk | contribs)   18:30, 9 May 2011

Fixed in r87753.

#Comment by Catrope (talk | contribs)   10:13, 25 April 2011
+	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKBAMAAAB/HNKOAAAAD1BMVEUZAAD///95eXmqqqrY2NjEIQ0cAAAAAXRSTlMAQObYZgAAACdJREFUCNdjYGBgYGIAASUFENNJCUiqmADZTM5OqExFFZAKRSG4YgBjcwODynSgDwAAAABJRU5ErkJggg==');

Data URLs are not supported by IE6 and IE7. Instead of using do-it-yourself data URLs, you should use ResourceLoader's data URL embedding feature:

/* @embed */
background-image: url(foo.png);

which will automatically embed the image and add a fallback for IE7 and below.

#Comment by Nikola Smolenski (talk | contribs)   18:30, 9 May 2011

Fixed in r87753.

Status & tagging log