MediaWiki:Vector.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Vector skin */ | /* All JavaScript here will be loaded for users of the Vector skin */ | ||
// Google Analytics 4 tracking via MediaWiki:vector.js | |||
(function() { | |||
var gaScript = document.createElement('script'); | |||
gaScript.async = true; | |||
gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-01G5LMDW7X'; | |||
document.head.appendChild(gaScript); | |||
window.dataLayer = window.dataLayer || []; | |||
function gtag(){ dataLayer.push(arguments); } | |||
window.gtag = gtag; | |||
gtag('js', new Date()); | |||
gtag('config', 'G-01G5LMDW7X'); | |||
})(); | |||
/* Disable right-click on all images */ | |||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
document.addEventListener("contextmenu", function (event) { | document.addEventListener("contextmenu", function (event) { | ||
event.preventDefault(); | if (event.target.tagName === "IMG") { | ||
event.preventDefault(); | |||
} | |||
}); | }); | ||
}); | }); |
Revision as of 16:15, 7 August 2025
/* All JavaScript here will be loaded for users of the Vector skin */
// Google Analytics 4 tracking via MediaWiki:vector.js
(function() {
var gaScript = document.createElement('script');
gaScript.async = true;
gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-01G5LMDW7X';
document.head.appendChild(gaScript);
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
window.gtag = gtag;
gtag('js', new Date());
gtag('config', 'G-01G5LMDW7X');
})();
/* Disable right-click on all images */
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("contextmenu", function (event) {
if (event.target.tagName === "IMG") {
event.preventDefault();
}
});
});
By using this site, you agree to the Terms of Use. © 1996–2025 The Quincy Examiner / MTB. All rights reserved.