MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus ageofempires-wiki.de
Zur Navigation springen Zur Suche springen
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: // Imported from http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js as of June 4, 2009 if...")
 
Zeile 9: Zeile 9:
 
document.getElementById( 'searchInput' ).focus();
 
document.getElementById( 'searchInput' ).focus();
 
});
 
});
 +
}
 +
if ( mw.config.get( 'wgIsMainPage' ) ) {
 +
  $( function () {
 +
    $( '#searchInput' ).focus();
 +
  } );
 
}
 
}

Version vom 6. Mai 2020, 03:15 Uhr

/* Any JavaScript here will be loaded for all users on every page load. */
// Imported from http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js as of June 4, 2009
if (
	wgPageName == 'Main_Page' ||
	typeof( wgMainPageTitle ) != 'undefined' && wgPageName == wgMainPageTitle
)
{
	addOnloadHook( function() {
		document.getElementById( 'searchInput' ).focus();
	});
}
if ( mw.config.get( 'wgIsMainPage' ) ) {
  $( function () {
    $( '#searchInput' ).focus();
  } );
}