Difference between revisions of "MediaWiki:Common.js"

From COPTR
Jump to navigation Jump to search
(Adding anonymous analytics support 2025-09-09)
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
/* ANJ Adding anonymous analytics support 2025-09-09 */
+
/* ANJ Adding anonymous analytics support 2025-09-09  
var templateLiteral = [`
+
var umami = document.createElement('script');
    <script defer src="https://cloud.umami.is/script.js" data-website-id="ecc13e7c-09d2-4236-a597-c3c570bfc411"></script>
+
umami.setAttribute('src','https://cloud.umami.is/script.js');
`]
+
umami.setAttribute('data-website-id','ecc13e7c-09d2-4236-a597-c3c570bfc411');
 
+
document.head.appendChild(umami);
var head = document.querySelector("head");
+
2025-12-09 Switching this out because the robots are burning through the Umami free tier. */
head.appendChild(templateLiteral);
 

Latest revision as of 11:00, 9 December 2025

/* Any JavaScript here will be loaded for all users on every page load. */
/* ANJ Adding anonymous analytics support 2025-09-09 
var umami = document.createElement('script');
umami.setAttribute('src','https://cloud.umami.is/script.js');
umami.setAttribute('data-website-id','ecc13e7c-09d2-4236-a597-c3c570bfc411');
document.head.appendChild(umami);
2025-12-09 Switching this out because the robots are burning through the Umami free tier. */