MediaWiki:Common.js: Difference between revisions
From Zezenia Online Wiki
No edit summary |
No edit summary |
||
Line 55: | Line 55: | ||
if (embed.dataset.y) params += "y=" + embed.dataset.y + "&"; | if (embed.dataset.y) params += "y=" + embed.dataset.y + "&"; | ||
if (embed.dataset.z) params += "z=" + embed.dataset.z + "&"; | if (embed.dataset.z) params += "z=" + embed.dataset.z + "&"; | ||
if (embed.dataset.zoom) params += "zoom=" + embed.dataset.zoom + "&"; | if (embed.dataset.zoom) params += "zoom=" + embed.dataset.zoom + "&"; | ||
if (embed.dataset.center) params += "center=" + embed.dataset.center + "&"; | |||
iframe.src = "https://map.playzezenia.com?" + params; | iframe.src = "https://map.playzezenia.com?" + params; | ||
embed.appendChild(iframe); | embed.appendChild(iframe); | ||
}); | }); |
Revision as of 21:19, 5 March 2021
/* Any JavaScript here will be loaded for all users on every page load. */ var css = document.createElement("link"); css.rel = "stylesheet"; css.type = "text/css"; css.href = "https://www.playzezenia.com/cdn/styles/cookieconsent.css"; document.head.appendChild(css); var script = document.createElement("script"); script.src = "https://www.playzezenia.com/cdn/scripts/cookieconsent.js"; script.async = true; script.onload = function() { window.cookieconsent.initialise({ palette: { popup: { background: "#000", text: "#ececec" }, button: { background: "#fff", text: "#000" } }, content: { message: "Zezenia Online uses cookies to log you in and improve our services.", dismiss: "I agree", link: "Privacy Policy", href: "https://www.playzezenia.com/home/legal#2", }, cookie: { domain: "." + document.domain.split('.').reverse().splice(0, 2).reverse().join('.'), }, }); } document.body.appendChild(script); var gtm = document.createElement("script"); gtm.async = true; gtm.src = "https://www.googletagmanager.com/gtag/js?id=G-Z2TDHQE12Q"; document.body.appendChild(gtm); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Z2TDHQE12Q'); /* Embed maps */ var embeds = document.querySelectorAll(".zezenia-map-embed"); embeds.forEach(function(embed) { var iframe = document.createElement("iframe"); iframe.width = embed.dataset.width || 800; iframe.height = embed.dataset.height || 600; var params = "embed=true&"; if (embed.dataset.x) params += "x=" + embed.dataset.x + "&"; if (embed.dataset.y) params += "y=" + embed.dataset.y + "&"; if (embed.dataset.z) params += "z=" + embed.dataset.z + "&"; if (embed.dataset.zoom) params += "zoom=" + embed.dataset.zoom + "&"; if (embed.dataset.center) params += "center=" + embed.dataset.center + "&"; iframe.src = "https://map.playzezenia.com?" + params; embed.appendChild(iframe); });