MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1,102: Line 1,102:
      
      
     // NRS ENTRIES  ---------------------  SECTION //
     // NRS ENTRIES  ---------------------  SECTION //
    console.log("Document ready!"); // Check if document ready event is triggered
   
     if ($("#show-article-wrapper-entry").length) {
     if ($("#show-article-wrapper-entry").length) {
        console.log("Element with id 'show-article-wrapper-entry' found!"); // Check if the target element exists
       
         // Your existing formatParagraphs function
         // Your existing formatParagraphs function
         function formatParagraphs(text) {
         function formatParagraphs(text) {
Line 1,111: Line 1,115:
         // Check if ".article-description" exists and format its text
         // Check if ".article-description" exists and format its text
         if ($(".article-description").length) {
         if ($(".article-description").length) {
            console.log("Element with class 'article-description' found!"); // Check if the target element exists
             var descriptionText = $(".article-description").text();
             var descriptionText = $(".article-description").text();
             $(".article-description").html(formatParagraphs(descriptionText));
            console.log("Original description text:", descriptionText); // Log the original text
            var formattedDescription = formatParagraphs(descriptionText);
            console.log("Formatted description text:", formattedDescription); // Log the formatted text
             $(".article-description").html(formattedDescription); // Set the formatted text
         }
         }


         // Check if ".article-reflection" exists and format its text
         // Check if ".article-reflection" exists and format its text
         if ($(".article-reflection").length) {
         if ($(".article-reflection").length) {
            console.log("Element with class 'article-reflection' found!"); // Check if the target element exists
             var reflectionText = $(".article-reflection").text();
             var reflectionText = $(".article-reflection").text();
             $(".article-reflection").html(formatParagraphs(reflectionText));
            console.log("Original reflection text:", reflectionText); // Log the original text
            var formattedReflection = formatParagraphs(reflectionText);
            console.log("Formatted reflection text:", formattedReflection); // Log the formatted text
             $(".article-reflection").html(formattedReflection); // Set the formatted text
         }
         }
     }
     }

Navigation menu