ArticleOverviewScript.js: Difference between revisions
From Mark Twain in the German Language Press
mNo edit summary |
mNo edit summary |
||
| Line 5: | Line 5: | ||
console.log('loading'); | console.log('loading'); | ||
$('td.type').each(function(index, element) { | $('td.type').each(function(index, element) { | ||
var $td = $(element); | |||
if ($td.textContent === 'N') { | |||
$td.addClass('highlight'); | |||
} | |||
}); | }); | ||
/*$('td.type').each(function(index, element) { | /*$('td.type').each(function(index, element) { | ||
console.log($(element).innerText); | console.log($(element).innerText); | ||
Revision as of 13:24, 11 August 2025
mw.hook( 'wikipage.content' ).add( ( $content ) => {
const $target = $content.find( '#articleOverview' );
if ( $target.length ) {
var $table = $target;
console.log('loading');
$('td.type').each(function(index, element) {
var $td = $(element);
if ($td.textContent === 'N') {
$td.addClass('highlight');
}
});
/*$('td.type').each(function(index, element) {
console.log($(element).innerText);
console.log($(element).parentElement.innerText);
if ($(element).innerText === 'N') $(element).parentElement.style.color ='red';
});
*/
}
});