MediaWiki:Common.js: Difference between revisions
mNo edit summary Tag: Reverted |
mNo edit summary Tag: Reverted |
||
Line 18: | Line 18: | ||
} | } | ||
$(document).ready(function () { | |||
// Create a wrapper div | |||
var bmcContainer = document.createElement("div"); | |||
bmcContainer.style.textAlign = "center"; | |||
bmcContainer.style.marginTop = "10px"; | |||
bmcContainer.style.marginBottom = "10px"; | |||
// Create the script element dynamically | |||
var bmcScript = document.createElement("script"); | |||
bmcScript.type = "text/javascript"; | |||
bmcScript.src = "https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js"; | |||
bmcScript.setAttribute("data-name", "bmc-button"); | |||
bmcScript.setAttribute("data-slug", "rajanyaofficial"); | |||
bmcScript.setAttribute("data-color", "#FFDD00"); | |||
bmcScript.setAttribute("data-emoji", "🛡️"); | |||
bmcScript.setAttribute("data-font", "Poppins"); | |||
bmcScript.setAttribute("data-text", "Subscribe Monthly"); | |||
bmcScript.setAttribute("data-outline-color", "#000000"); | |||
bmcScript.setAttribute("data-font-color", "#000000"); | |||
bmcScript.setAttribute("data-coffee-color", "#ffffff"); | |||
// Append and insert into the top of the page | |||
bmcContainer.appendChild(bmcScript); | |||
document.body.insertBefore(bmcContainer, document.body.firstChild); | |||
}); |
Revision as of 12:54, 10 July 2025
/* Any JavaScript here will be loaded for all users on every page load. */ // Google Analytics for GA4 (G-5MQXEFVQBE) var gtagScript = document.createElement("script"); gtagScript.src = "https://www.googletagmanager.com/gtag/js?id=G-5MQXEFVQBE"; gtagScript.async = true; document.head.appendChild(gtagScript); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-5MQXEFVQBE'); // Remove View History tab & Recent Changes link for anonymous users if (!mw.config.get('wgUserName')) { $('#ca-history').remove(); // Removes history tab $('#n-recentchanges').remove(); // Removes recent changes link $('a[title="Special:RecentChanges"]').remove(); // Extra check } $(document).ready(function () { // Create a wrapper div var bmcContainer = document.createElement("div"); bmcContainer.style.textAlign = "center"; bmcContainer.style.marginTop = "10px"; bmcContainer.style.marginBottom = "10px"; // Create the script element dynamically var bmcScript = document.createElement("script"); bmcScript.type = "text/javascript"; bmcScript.src = "https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js"; bmcScript.setAttribute("data-name", "bmc-button"); bmcScript.setAttribute("data-slug", "rajanyaofficial"); bmcScript.setAttribute("data-color", "#FFDD00"); bmcScript.setAttribute("data-emoji", "🛡️"); bmcScript.setAttribute("data-font", "Poppins"); bmcScript.setAttribute("data-text", "Subscribe Monthly"); bmcScript.setAttribute("data-outline-color", "#000000"); bmcScript.setAttribute("data-font-color", "#000000"); bmcScript.setAttribute("data-coffee-color", "#ffffff"); // Append and insert into the top of the page bmcContainer.appendChild(bmcScript); document.body.insertBefore(bmcContainer, document.body.firstChild); });