2020-06-12 20:13:43 +02:00
|
|
|
<script>
|
|
|
|
const STATIC_ROOT = '<?= $_ENV['STATIC_ROOT'] ?>';
|
|
|
|
const REVISION = '<?= REVISION ?>';
|
2020-06-13 22:39:17 +02:00
|
|
|
const ANTI_CSRF_TOKEN = '<?= $_SESSION['anti_csrf_token'] ?>';
|
2020-06-12 20:13:43 +02:00
|
|
|
</script>
|
2020-06-13 22:39:17 +02:00
|
|
|
<script src="<?= $_ENV['STATIC_ROOT'] ?>/js/mapguesser.js?rev=<?= REVISION ?>"></script>
|
2020-06-12 19:17:41 +02:00
|
|
|
<?php if (isset($jsFiles)) : ?>
|
|
|
|
<?php foreach ($jsFiles as $jsFile) : ?>
|
|
|
|
<?php
|
|
|
|
if (!preg_match('/^http(s)?/', $jsFile)) {
|
|
|
|
$jsFile = $_ENV['STATIC_ROOT'] . '/' . $jsFile . '?rev=' . REVISION;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<script src="<?= $jsFile ?>"></script>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endif; ?>
|
2020-06-24 21:57:34 +02:00
|
|
|
<?php if (!isset($_COOKIE['COOKIES_CONSENT'])): ?>
|
|
|
|
<script>
|
|
|
|
(function () {
|
|
|
|
MapGuesser = {
|
|
|
|
cookiesAgreed: false,
|
|
|
|
|
|
|
|
agreeCookies: function () {
|
|
|
|
if (MapGuesser.cookiesAgreed) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var expirationDate = new Date(new Date().getTime() + 20 * 365 * 24 * 60 * 60 * 1000).toUTCString();
|
|
|
|
document.cookie = 'COOKIES_CONSENT=1; expires=' + expirationDate + '; path=/';
|
|
|
|
|
|
|
|
MapGuesser.cookiesAgreed = true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-06-24 23:00:26 +02:00
|
|
|
document.getElementById('agreeCookies').onclick = function () {
|
|
|
|
document.getElementById('cookiesNotice').style.display = 'none';
|
|
|
|
};
|
|
|
|
|
2020-06-24 21:57:34 +02:00
|
|
|
window.onclick = function () {
|
|
|
|
MapGuesser.agreeCookies();
|
|
|
|
};
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
<?php endif; ?>
|
2020-05-31 00:21:29 +02:00
|
|
|
</body>
|
|
|
|
</html>
|