Index: trunk/phase3/skins/common/IE70Fixes.css |
— | — | @@ -1,12 +0,0 @@ |
2 | | -/** |
3 | | - * Fixes sister projects box moving down the extract |
4 | | - * of the first result (bug #16886). |
5 | | - * It only happens when the window is small and |
6 | | - * This changes slightly the layout for big screens |
7 | | - * where there was space for the extracts and the |
8 | | - * sister projects and thus it showed like in any |
9 | | - * other browser. |
10 | | - */ |
11 | | -.searchresult { |
12 | | - display: inline; |
13 | | -} |
Index: trunk/phase3/skins/common/search.css |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +/** |
| 3 | + * Fixes sister projects box moving down the extract |
| 4 | + * of the first result (bug #16886). |
| 5 | + * It only happens when the window is small and |
| 6 | + * This changes slightly the layout for big screens |
| 7 | + * where there was space for the extracts and the |
| 8 | + * sister projects and thus it showed like in any |
| 9 | + * other browser. |
| 10 | + * |
| 11 | + * This will only affect IE 7 and lower |
| 12 | + */ |
| 13 | +html > body .searchresult { |
| 14 | + display: inline; |
| 15 | +} |
Property changes on: trunk/phase3/skins/common/search.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -221,7 +221,6 @@ |
222 | 222 | |
223 | 223 | $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':'; |
224 | 224 | if( trim( $term ) === '' || $filePrefix === trim( $term ) ) { |
225 | | - $wgOut->addHTML( $this->searchFocus() ); |
226 | 225 | $wgOut->addHTML( $this->formHeader($term, 0, 0)); |
227 | 226 | if( $this->searchAdvanced ) { |
228 | 227 | $wgOut->addHTML( $this->powerSearchBox( $term ) ); |
— | — | @@ -307,9 +306,6 @@ |
308 | 307 | $this->showCreateLink( $t ); |
309 | 308 | } |
310 | 309 | $wgOut->addHtml( "</div>" ); |
311 | | - if( $num === 0 ) { |
312 | | - $wgOut->addHTML( $this->searchFocus() ); |
313 | | - } |
314 | 310 | |
315 | 311 | if( $num || $this->offset ) { |
316 | 312 | $wgOut->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" ); |
— | — | @@ -367,9 +363,7 @@ |
368 | 364 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
369 | 365 | // add javascript specific to special:search |
370 | 366 | $wgOut->addModules( 'mediawiki.legacy.search' ); |
371 | | - |
372 | | - // Bug #16886: Sister projects box moves down the first extract on IE7 |
373 | | - $wgOut->addStyle( 'common/IE70Fixes.css', 'screen', 'IE 7' ); |
| 367 | + $wgOut->addModules( 'mediawiki.specials.search' ); |
374 | 368 | } |
375 | 369 | |
376 | 370 | /** |
— | — | @@ -832,14 +826,6 @@ |
833 | 827 | Xml::hidden( 'fulltext', 'Advanced search' ) . |
834 | 828 | Xml::closeElement( 'fieldset' ); |
835 | 829 | } |
836 | | - |
837 | | - protected function searchFocus() { |
838 | | - $id = $this->searchAdvanced ? 'powerSearchText' : 'searchText'; |
839 | | - return Html::inlineScript( |
840 | | - "hookEvent(\"load\", function() {" . |
841 | | - "document.getElementById('$id').focus();" . |
842 | | - "});" ); |
843 | | - } |
844 | 830 | |
845 | 831 | protected function getSearchProfiles() { |
846 | 832 | // Builds list of Search Types (profiles) |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -310,6 +310,9 @@ |
311 | 311 | 'mediawiki.specials.preferences' => new ResourceLoaderFileModule( array( |
312 | 312 | 'scripts' => 'resources/mediawiki/mediawiki.specials.preferences.js', |
313 | 313 | ) ), |
| 314 | + 'mediawiki.specials.search' => new ResourceLoaderFileModule( array( |
| 315 | + 'scripts' => 'resources/mediawiki/mediawiki.specials.search.js', |
| 316 | + ) ), |
314 | 317 | |
315 | 318 | /* MediaWiki Legacy */ |
316 | 319 | |
— | — | @@ -395,6 +398,7 @@ |
396 | 399 | ) ), |
397 | 400 | 'mediawiki.legacy.search' => new ResourceLoaderFileModule( array( |
398 | 401 | 'scripts' => 'skins/common/search.js', |
| 402 | + 'styles' => 'skins/common/search.css', |
399 | 403 | 'dependencies' => 'mediawiki.legacy.wikibits', |
400 | 404 | ) ), |
401 | 405 | 'mediawiki.legacy.shared' => new ResourceLoaderFileModule( array( |
Index: trunk/phase3/resources/mediawiki/mediawiki.specials.search.js |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +/* |
| 3 | + * JavaScript for Specical:Search |
| 4 | + */ |
| 5 | + |
| 6 | +// Emulate HTML5 autofocus behavior in non HTML5 compliant browsers |
| 7 | +if ( !( 'autofocus' in document.createElement( 'input' ) ) ) { |
| 8 | + $( 'input[autofocus]' ).focus(); |
| 9 | +} |
Property changes on: trunk/phase3/resources/mediawiki/mediawiki.specials.search.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 10 | + native |