Uživatel:Shlomo/common.js: Porovnání verzí

Z Wikizdrojů, volně dostupné knihovny
Smazaný obsah Přidaný obsah
Shlomo (diskuse | příspěvky)
vymazání
Shlomo (diskuse | příspěvky)
uživatelské udělátko na automatizované zobrazení odkazů na transkludované stránky; inspirováno skriptem Dannyho B.
Řádek 1: Řádek 1:
( function ( $ ) {
'use strict';
$( document ).ready( function () {
$( 'span.pagenum' ).each( function ( index ) {
var displayed = $( this ).attr( 'id' );
var linked = $( this ).attr( 'title' );
$( this )
.append(
$( '<a>' )
.attr({
href: '/wiki/' + linked,
title: linked
})
.text( '[' + displayed + ']' )
)
.after( '&nbsp;' );
});
});
}( jQuery ) );

Verze z 4. 7. 2016, 12:30

( function ( $ ) {
	'use strict';
	$( document ).ready( function () {
		$( 'span.pagenum' ).each( function ( index ) {
			var displayed = $( this ).attr( 'id' );
			var linked = $( this ).attr( 'title' );
			$( this )
				.append(
					$( '<a>' )
						.attr({
							href: '/wiki/' + linked,
							title: linked
						})
						.text( '[' + displayed + ']' )
				)
				.after( '&nbsp;' );
		});
	});
}( jQuery ) );