מדיה ויקי:Common.js: הבדלים בין גרסאות בדף

correct the search box jQuery selector
create search box .click events after the collapsible hook fires
שורה 228: שורה 228:
// search meta-commands: make the table display clickabe keywords.
// search meta-commands: make the table display clickabe keywords.
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ) {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ) {
$( function() {
mw.hook( 'he.wikipedia.collapsetables.loaded' ).add( function () {
$( 'span.mw-search-meta-string' ).wrap( $( '<a>' )
$( 'span.mw-search-meta-string' ).wrap( $( '<a>' )
.click( function( e ) {
.click( function( e ) {
e.preventDefault();
e.preventDefault();
var t = $( this ).text(),
var t = $( this ).text(),
searchBox = $( '#searchText input' ),  
searchBox = $( '#searchText input' ),
current = searchBox.val();
current = searchBox.val();


שורה 240: שורה 240:
);
);
mw.hook( 'he.wikipedia.collapsetables.loaded' ).add( function () {
// Make the table appear only after the collapsible styles are loaded,
// Make the table appear only after the collapsible styles are loaded,
// so that it won't delay showing the search results
// so that it won't delay showing the search results
$( '#mw-search-meta-strings' ).css( 'display', 'table' );
$( '#mw-search-meta-strings' ).css( 'display', 'table' );
} );
} );
} );
}
}