Jump to content

MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:


// Add extra info to infobox's cost header to notify users to take it with a grain of salt
// Add extra info to infobox's cost header to notify users to take it with a grain of salt
const headers = document.querySelectorAll('.pi-header')
const headers = document.querySelectorAll('.pi-header');


if (headers) {
if (headers) {
     for (let header of Array.from(headers)) {
     for (var header of Array.from(headers)) {
         const paragraph = header.querySelector('p')
         const paragraph = header.querySelector('p');


         if (paragraph.textContent.includes('Cost')) {
         if (paragraph.textContent.includes('Cost')) {
             header.style.textDecoration = 'underline dashed'
             header.style.textDecoration = 'underline dashed';
             header.style.cursor = "help"
             header.style.cursor = "help";
             header.title = "The cost section is meant to be taken with a grain of salt. Price fluctuates based on the economy, and the cost section is meant to be a rough estimate of the price of the item."
             header.title = "The cost section is meant to be taken with a grain of salt. Price fluctuates based on the economy, and the cost section is meant to be a rough estimate of the price of the item.";
         console.log("Added styling to Cost section on infobox")
         console.log("Added styling to Cost section on infobox");
         }
         }
     }
     }
} else {
} else {
console.log("Did not find an infobox")
console.log("Did not find an infobox");
}
}
Hey there! The Galaxypedia uses cookies to enhance your user experience. Press "More information" to learn more. Thank you, we hope you enjoy your stay!