MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 582: Line 582:
     });
     });


function logTitlesForEntity(entityValue) {
function logCardsWithTypeAndSubject(typeValue, subjectValue) {
        $('.card').each(function() {
$('.card').each(function() {
            var entityText = $(this).find('.entity').text().trim();
var typeText = $(this).find('.type').text().trim();
   
var subjectText = $(this).find('.subject').text().trim();
            if (entityText === entityValue) {
                var titleText = $(this).find('.title').text().trim();
if (typeText === typeValue && subjectText === subjectValue) {
                console.log('Title: ' + titleText);
// Log the card or perform any action. Here we log the card's details.
            }
var titleText = $(this).find('.title').text().trim();
        });
console.log('Card with type "Book" and subject "Activism": ' + titleText);
    }
}
   
});
    // Call the function to log titles for cards with the entity "Collective"
}
    logTitlesForEntity('Collective');
// Call the function to log cards with the type "Book" and subject "Activism"
logCardsWithTypeAndSubject('Book', 'Activism');
});
});

Navigation menu