MediaWiki

ArticleOverviewScript.js: Difference between revisions

From Mark Twain in the German Language Press

Created page with "mw.hook( 'wikipage.content' ).add( ( $content ) => { const $target = $content.find( '#articleOverview' ); if ( $target.length ) { var $table = $target; $table.find('td.type').forEach(td => { if (td.textContent.trim() === 'N') td.parentElement.style.color ='red'; }); } });"
 
mNo edit summary
 
(28 intermediate revisions by the same user not shown)
Line 2: Line 2:
const $target = $content.find( '#articleOverview' );
const $target = $content.find( '#articleOverview' );
if ( $target.length ) {
if ( $target.length ) {
var $table = $target;
$('.type').each(function(index) {
$table.find('td.type').forEach(td => {
var tdContent = $(this).text();
if (td.textContent.trim() === 'N') td.parentElement.style.color ='red';
if (tdContent === 'N\n') {
});
$(this).addClass('n');
}
        });
}
}
});
});

Latest revision as of 14:23, 11 August 2025

mw.hook( 'wikipage.content' ).add( ( $content ) => {
	const $target = $content.find( '#articleOverview' );
	if ( $target.length ) {
		$('.type').each(function(index) {
			var tdContent = $(this).text();
			if (tdContent === 'N\n') {
				$(this).addClass('n');
			}
        });
	}
});