Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -531,7 +531,7 @@ |
532 | 532 | TranslateUtils::convertWhiteSpaceToHTML( $en ) |
533 | 533 | ); |
534 | 534 | |
535 | | - $msg .= Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $en ); |
| 535 | + $msg .= $this->wrapInsert( $id, $en ); |
536 | 536 | |
537 | 537 | $class = array( 'class' => 'mw-sp-translate-edit-definition mw-translate-edit-definition' ); |
538 | 538 | |
— | — | @@ -608,9 +608,16 @@ |
609 | 609 | $label = self::ajaxEditLink( $target, htmlspecialchars( $label ) ); |
610 | 610 | } |
611 | 611 | |
612 | | - $text = TranslateUtils::convertWhiteSpaceToHTML( $text ); |
| 612 | + $dialogID = $this->dialogID(); |
| 613 | + $id = Sanitizer::escapeId( "other-$fbcode-$dialogID" ); |
| 614 | + |
613 | 615 | $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 ); |
615 | 622 | } |
616 | 623 | |
617 | 624 | if ( count( $boxes ) ) { |
— | — | @@ -883,6 +890,10 @@ |
884 | 891 | return Html::element( 'a', $params, '↓' ); |
885 | 892 | } |
886 | 893 | |
| 894 | + public function wrapInsert( $id, $text ) { |
| 895 | + return Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $text ); |
| 896 | + } |
| 897 | + |
887 | 898 | public function suggestionField( $text ) { |
888 | 899 | static $counter = 0; |
889 | 900 | |
— | — | @@ -890,7 +901,7 @@ |
891 | 902 | $dialogID = $this->dialogID(); |
892 | 903 | $id = Sanitizer::escapeId( "tmsug-$dialogID-$counter" ); |
893 | 904 | $contents = TranslateUtils::convertWhiteSpaceToHTML( $text ); |
894 | | - $contents .= Html::element( 'pre', array( 'id' => $id, 'style' => 'display: none;' ), $text ); |
| 905 | + $contents .= $this->wrapInsert( $id, $text ); |
895 | 906 | |
896 | 907 | return $this->adder( $id ) . "\n" . $contents; |
897 | 908 | } |