ArticleOverviewScript.js: Difference between revisions
From Mark Twain in the German Language Press
mNo edit summary |
mNo edit summary |
||
| Line 2: | Line 2: | ||
const $target = $content.find( '#articleOverview' ); | const $target = $content.find( '#articleOverview' ); | ||
if ( $target.length ) { | if ( $target.length ) { | ||
console.log('loading'); | console.log('loading'); | ||
$(' | $('.type').each(function(index) { | ||
var | var tdContent = $(this).innerText; | ||
console.log( | console.log(tdContent); | ||
if ( | if (tdContent === 'N') { | ||
console.log($(this).parentElement.innerText); | console.log($(this).parentElement.innerText); | ||
console.log($(this).tagName); | console.log($(this).tagName); | ||
Revision as of 14:07, 11 August 2025
mw.hook( 'wikipage.content' ).add( ( $content ) => {
const $target = $content.find( '#articleOverview' );
if ( $target.length ) {
console.log('loading');
$('.type').each(function(index) {
var tdContent = $(this).innerText;
console.log(tdContent);
if (tdContent === 'N') {
console.log($(this).parentElement.innerText);
console.log($(this).tagName);
$(this).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';
});
*/
}
});