Index: trunk/extensions/Translate/js/translationdisplay.js |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +$(document).ready( function() { |
| 3 | + $(".translationdisplay").hover( |
| 4 | + function() { $(this).addClass("translationdisplay-hover"); }, |
| 5 | + function() { $(this).removeClass("translationdisplay-hover"); } |
| 6 | + ); |
| 7 | + $("#tt1").click( function() { |
| 8 | + $("#tt1").hide(); |
| 9 | + $("#tt2").show(); |
| 10 | + }); |
| 11 | + $("#tt2").click( function() { |
| 12 | + $("#tt2").hide(); |
| 13 | + $("#tt1").show(); |
| 14 | + }); |
| 15 | +}); |
Property changes on: trunk/extensions/Translate/js/translationdisplay.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -417,16 +417,28 @@ |
418 | 418 | { |
419 | 419 | list( $key, $code, $group ) = self::getKeyCodeGroup( $article->getTitle() ); |
420 | 420 | if ( !$group ) return true; |
421 | | - $def = $group->getMessage( $key, 'en' ); |
| 421 | + |
| 422 | + global $wgOut; |
| 423 | + $wgOut->addScriptFile( TranslateUtils::assetPath( 'js/translationdisplay.js' ) ); |
| 424 | + |
| 425 | + $def = self::preserveWhitespaces( $group->getMessage( $key, 'en' ) ); |
422 | 426 | $content = self::preserveWhitespaces( $content ); |
423 | | - $def = self::preserveWhitespaces( $def ); |
| 427 | + |
424 | 428 | $deftext = wfMsgNoTrans( 'translate-edit-show-def' ); |
425 | 429 | $trans = wfMsgNoTrans( 'translate-edit-show-trans' ); |
| 430 | + $click = htmlspecialchars( wfMsgNoTrans( 'translate-edit-show-click' ) ); |
| 431 | + |
426 | 432 | $content = <<<HTML |
427 | | -<table class=wikitable> |
| 433 | +<table class="wikitable translationdisplay" id=tt1 title="$click"> |
428 | 434 | <tr><th>$deftext</th><th>$trans</th></tr> |
429 | 435 | <tr><td style=vertical-align:top>$def</td><td style=vertical-align:top>$content</td></tr> |
430 | 436 | </table> |
| 437 | +<table class="wikitable translationdisplay" id=tt2 title="$click" style=display:none> |
| 438 | + <tr><th>$deftext</th></tr> |
| 439 | + <tr><td style=vertical-align:top>$def</td></tr> |
| 440 | + <tr><th>$trans</th></tr> |
| 441 | + <tr><td style=vertical-align:top>$content</td></tr> |
| 442 | +</table> |
431 | 443 | HTML; |
432 | 444 | } |
433 | 445 | return true; |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | |
91 | 91 | 'translate-edit-show-def' => 'Message definition', |
92 | 92 | 'translate-edit-show-trans' => 'Translation', |
| 93 | + 'translate-edit-show-click' => 'Click to switch layout', |
93 | 94 | |
94 | 95 | 'translate-magic-pagename' => 'Extended MediaWiki translation', |
95 | 96 | 'translate-magic-help' => 'You can translate special pages aliases, magic words and namespace names. |