« MediaWiki:Common.js » : différence entre les versions

De Baripedia
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
importScriptPage('ShowHide/code.js', 'dev');
$( function ($) {
/**
* Rétablit l'accès clavier à la fonction de tri des tableaux
*/


function importScriptPage (page, server) {
$( '.sortable th' ).attr( 'tabindex', 0 ).keypress( function( event ) {
var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') + '&action=raw&ctype=text/javascript';
if ( event.which == 13 ) {
if (typeof server == "string") url = (server.indexOf('://') == -1)?'http://' + server + '.wikia.com' + url:server + url;
$( this ).click();
return importScriptURI(url);
}
}
} );
} );

Version du 12 septembre 2015 à 20:26

$( function ($) {
	/**
	* Rétablit l'accès clavier à la fonction de tri des tableaux
	*/

	$( '.sortable th' ).attr( 'tabindex', 0 ).keypress( function( event ) {
		if ( event.which == 13 ) {
			$( this ).click();
		}
	} );
} );