Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php |
— | — | @@ -78,11 +78,12 @@ |
79 | 79 | && $article->exists() |
80 | 80 | && ( count( $egLiveTranslateLanguages ) > 1 || ( count( $egLiveTranslateLanguages ) == 1 && $egLiveTranslateLanguages[0] != $currentLang ) ) ) { |
81 | 81 | $wgOut->addHTML( |
82 | | - '<span class="notranslate" id="livetranslatespan" style="display:inline; float:right">' . |
83 | 82 | Html::rawElement( |
84 | 83 | 'div', |
85 | 84 | array( |
86 | | - 'id' => 'livetranslatediv' |
| 85 | + 'id' => 'livetranslatediv', |
| 86 | + 'style' => 'display:inline; float:right', |
| 87 | + 'class' => 'notranslate' |
87 | 88 | ), |
88 | 89 | htmlspecialchars( wfMsg( 'livetranslate-translate-to' ) ) . |
89 | 90 | ' ' . |
— | — | @@ -100,7 +101,7 @@ |
101 | 102 | wfMsg( 'livetranslate-button-revert' ) |
102 | 103 | ) |
103 | 104 | ) . |
104 | | - '<br /><div id="googlebranding" style="display:inline; float:right"></div></span>' |
| 105 | + '<br /><br /><div id="googlebranding" style="display:inline; float:right"></div>' |
105 | 106 | ); |
106 | 107 | |
107 | 108 | $wgOut->addScript( |
Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js |
— | — | @@ -158,10 +158,8 @@ |
159 | 159 | function getSpecialWords() { |
160 | 160 | var words = []; |
161 | 161 | |
162 | | - $.each($( '.notranslate' ), function( i, v ) { |
163 | | - if ( $(v).attr( 'id' ) != 'livetranslatespan' ) { |
164 | | - words.push( $(v).text() ); |
165 | | - } |
| 162 | + $.each($( 'span.notranslate' ), function( i, v ) { |
| 163 | + words.push( $(v).text() ); |
166 | 164 | }); |
167 | 165 | |
168 | 166 | return words; |
— | — | @@ -174,7 +172,7 @@ |
175 | 173 | * @param {object} translations |
176 | 174 | */ |
177 | 175 | function replaceSpecialWords( translations ) { |
178 | | - $.each($(".notranslate"), function(i,v) { |
| 176 | + $.each($("span.notranslate"), function(i,v) { |
179 | 177 | var currentText = $(v).text(); |
180 | 178 | if ( translations[currentText] ) { |
181 | 179 | $(v).text( translations[currentText] ); |
— | — | @@ -221,7 +219,7 @@ |
222 | 220 | ); |
223 | 221 | } |
224 | 222 | // If it's an html element, check to see if it should be ignored, and if not, apply function again. |
225 | | - else if ( $.inArray( $( this ).attr( 'id' ), [ 'livetranslatediv', 'siteSub', 'jump-to-nav' ] ) == -1 |
| 223 | + else if ( $.inArray( $( this ).attr( 'id' ), [ 'siteSub', 'jump-to-nav' ] ) == -1 |
226 | 224 | && !$( this ).hasClass( 'notranslate' ) && !$( this ).hasClass( 'printfooter' ) |
227 | 225 | && $( this ).text().length > 0 ) { |
228 | 226 | |