MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 11: Line 11:
         console.log('Found all cards:', cards);
         console.log('Found all cards:', cards);


         // Separate function to show the modal
         // Attach a click event listener to each card
         function showModal(card) {
         cards.on('click', function (event) {
             // Show the fixed column
             // Show the fixed column
             showArticleWrapper.css('display', 'block');
             showArticleWrapper.css('display', 'block');


             // Update the fixed column content with card information
             // Update the fixed column content with card information
             var entryNumber = card.find('.entry-number').text();
             var entryNumber = $(this).find('.entry-number').text();
             var title = card.find('.title').text();
             var title = $(this).find('.title').text();
             var people = card.find('.people').text();
             var people = $(this).find('.people').text();
             var type = card.find('.type').text();
             var type = $(this).find('.type').text();
             var entity = card.find('.entity').text();
             var entity = $(this).find('.entity').text();
             var discipline = card.find('.discipline').text();
             var discipline = $(this).find('.discipline').text();
             var subject = card.find('.subject').text();
             var subject = $(this).find('.subject').text();
             var description = card.find('.description').html();
             var description = $(this).find('.description').html();
             var reflection = card.find('.reflection').html();
             var reflection = $(this).find('.reflection').html();
             var quote = card.find('.quote').text();
             var quote = $(this).find('.quote').text();
             var modificationDate = card.find('.modification-date').text();
             var modificationDate = $(this).find('.modification-date').text();
             var imageCount = 5; // Change this value based on the maximum number of images
             var imageCount = 5; // Change this value based on the maximum number of images


Line 35: Line 35:
             // Loop through possible image containers
             // Loop through possible image containers
             for (var i = 1; i <= imageCount; i++) {
             for (var i = 1; i <= imageCount; i++) {
                 var imageContainer = card.find('.image' + i);
                 var imageContainer = $(this).find('.image' + i);


                 // Check if the image container exists
                 // Check if the image container exists
Line 130: Line 130:
             // Apply the fade-out effect to the #list element
             // Apply the fade-out effect to the #list element
             $('#list').addClass('fade-out');
             $('#list').addClass('fade-out');
        }
        // Attach a click event listener to each card
        cards.on('click', function (event) {
            // Call the showModal function
            showModal($(this));


             // Prevent further propagation to the document
             // Prevent further propagation to the document

Navigation menu