Difference between revisions of "MediaWiki:Common.js"

From MunichBeerGardens.com
Jump to: navigation, search
m
m
Line 47: Line 47:
  
 
function run_onload(){
 
function run_onload(){
 
 
GDPR_state_value = "undecided";
 
GDPR_state_value = "undecided";
 
if(document.cookie.indexOf("GDPR") != -1){
 
 
var state_pos = document.cookie.indexOf("GDPR=");
 
var state_start = state_pos + 5;
 
var state_end =  state_start + 8;
 
GDPR_state_value = document.cookie.substring(state_start,state_end);
 
console.log(GDPR_state_value);
 
console.log(document.cookie);
 
}
 
 
 
if (GDPR_state_value == "undecided"){
 
if (GDPR_state_value == "undecided"){
 
undecided();
 
undecided();
Line 67: Line 55:
  
 
function undecided(){
 
function undecided(){
 
 
alert('');
 
alert('');
 
 
}
 
}

Revision as of 09:23, 23 June 2023

/* Any JavaScript here will be loaded for all users on every page load. */

//setTimeout("alert('test')",10000);

//document.getElementsByTagName('body')[0].style.margin = '110px';

var RecaptchaOptions = {
    theme : 'white'
 };


/* emulate sticky CSS */
if (document.getElementById('p-Matched_content') !=null) {
window.onscroll = function() {  
var header_height = document.getElementById("p-Matched_content").scrollHeight;
if (window.scrollY + 330 > header_height){
document.getElementById("p-Matched_content").style.position="fixed";
document.getElementById("p-Matched_content").style.top="0px";
}
else{
document.getElementById("p-Matched_content").style.position="static";
}
}
}

if (document.getElementById('p-advertisement') !=null) {
window.onscroll = function() {  
var header_height = document.getElementById("p-advertisement").scrollHeight;
if (window.scrollY + 330 > header_height){
document.getElementById("p-advertisement").style.position="fixed";
document.getElementById("p-advertisement").style.top="0px";
}
else{
document.getElementById("p-advertisement").style.position="static";
}
}
}



/* GDPR */

if (window.addEventListener)
{
window.addEventListener('load', run_onload, false);
}

function run_onload(){
GDPR_state_value = "undecided";
if (GDPR_state_value == "undecided"){
undecided();
}

}

function undecided(){
alert('');
}