r69049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69048‎ | r69049 | r69050 >
Date:09:42, 5 July 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Added insertion arrow for "in other languages" too
Modified paths:
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -531,7 +531,7 @@
532532 TranslateUtils::convertWhiteSpaceToHTML( $en )
533533 );
534534
535 - $msg .= Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $en );
 535+ $msg .= $this->wrapInsert( $id, $en );
536536
537537 $class = array( 'class' => 'mw-sp-translate-edit-definition mw-translate-edit-definition' );
538538
@@ -608,9 +608,16 @@
609609 $label = self::ajaxEditLink( $target, htmlspecialchars( $label ) );
610610 }
611611
612 - $text = TranslateUtils::convertWhiteSpaceToHTML( $text );
 612+ $dialogID = $this->dialogID();
 613+ $id = Sanitizer::escapeId( "other-$fbcode-$dialogID" );
 614+
613615 $params = array( 'class' => 'mw-translate-edit-item' );
614 - $boxes[] = Html::rawElement( 'div', $params, self::legend( $label ) . $text . self::clear() );
 616+
 617+ $contents = $this->adder( $id ) . "\n" . self::legend( $label ) .
 618+ TranslateUtils::convertWhiteSpaceToHTML( $text ) . self::clear();
 619+
 620+ $boxes[] = Html::rawElement( 'div', $params, $contents ) .
 621+ $this->wrapInsert( $id, $text );
615622 }
616623
617624 if ( count( $boxes ) ) {
@@ -883,6 +890,10 @@
884891 return Html::element( 'a', $params, '↓' );
885892 }
886893
 894+ public function wrapInsert( $id, $text ) {
 895+ return Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $text );
 896+ }
 897+
887898 public function suggestionField( $text ) {
888899 static $counter = 0;
889900
@@ -890,7 +901,7 @@
891902 $dialogID = $this->dialogID();
892903 $id = Sanitizer::escapeId( "tmsug-$dialogID-$counter" );
893904 $contents = TranslateUtils::convertWhiteSpaceToHTML( $text );
894 - $contents .= Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $text );
 905+ $contents .= $this->wrapInsert( $id, $text );
895906
896907 return $this->adder( $id ) . "\n" . $contents;
897908 }

Status & tagging log