Difference between revisions of "MediaWiki:Common.js"
From MunichBeerGardens.com
m |
m |
||
Line 9: | Line 9: | ||
}; | }; | ||
− | |||
− | |||
− | |||
− | |||
− | /* | + | /* emulate sticky CSS |
− | + | if (document.getElementById('p-Matched_content') !=null) { | |
− | + | window.onscroll = function() { | |
− | var | + | 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"; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | document.getElementById(" | ||
− | |||
− | |||
} | } | ||
− | |||
− | |||
− | |||
} | } | ||
} | } | ||
− | + | if (document.getElementById('p-advertisement') !=null) { | |
− | + | window.onscroll = function() { | |
− | + | var header_height = document.getElementById("p-advertisement").scrollHeight; | |
− | document.getElementById(" | + | if (window.scrollY + 330 > header_height){ |
− | + | document.getElementById("p-advertisement").style.position="fixed"; | |
+ | document.getElementById("p-advertisement").style.top="0px"; | ||
} | } | ||
− | |||
else{ | 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(){ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | var GDPR_table_undecided = document.createElement("table"); | |
+ | GDPR_table_undecided.setAttribute("id","GDPR_table_undecided"); | ||
+ | var GDPR_row = document.createElement("tr"); | ||
+ | var GDPR_cell = document.createElement("td"); | ||
− | + | var GDPR_reject_button = document.createElement("span"); | |
+ | GDPR_reject_button.setAttribute("id","GDPR_reject_button"); | ||
+ | GDPR_reject_button.style.cursor="pointer"; | ||
+ | GDPR_reject_button.appendChild(document.createTextNode("REJECT COOKIES")); | ||
− | document. | + | var GDPR_accept_button = document.createElement("span"); |
+ | GDPR_accept_button.setAttribute("id","GDPR_accept_button"); | ||
+ | GDPR_accept_button.style.cursor="pointer"; | ||
+ | GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES")); | ||
− | + | GDPR_table_undecided.appendChild(GDPR_row); | |
+ | GDPR_row.appendChild(GDPR_cell); | ||
− | + | GDPR_cell.appendChild(GDPR_reject_button); | |
− | + | GDPR_cell.appendChild(GDPR_accept_button); | |
− | |||
− | |||
− | |||
− | + | document.body.appendChild(GDPR_table_undecided); | |
− | |||
− | |||
− | |||
− | |||
− | /* | + | GDPR_table_undecided.style.width="100%"; |
+ | GDPR_table_undecided.style.border="1px dashed blue"; | ||
+ | GDPR_table_undecided.style.textAlign="center"; | ||
+ | GDPR_table_undecided.style.position="fixed"; | ||
+ | GDPR_table_undecided.style.bottom="0"; | ||
+ | GDPR_reject_button.style.border="1px solid green"; | ||
+ | GDPR_accept_button.style.border="1px solid green"; | ||
+ | GDPR_table_undecided.style.verticalAlign="middle"; /* some old IE convention */ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } |
Revision as of 09:33, 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(){ var GDPR_table_undecided = document.createElement("table"); GDPR_table_undecided.setAttribute("id","GDPR_table_undecided"); var GDPR_row = document.createElement("tr"); var GDPR_cell = document.createElement("td"); var GDPR_reject_button = document.createElement("span"); GDPR_reject_button.setAttribute("id","GDPR_reject_button"); GDPR_reject_button.style.cursor="pointer"; GDPR_reject_button.appendChild(document.createTextNode("REJECT COOKIES")); var GDPR_accept_button = document.createElement("span"); GDPR_accept_button.setAttribute("id","GDPR_accept_button"); GDPR_accept_button.style.cursor="pointer"; GDPR_accept_button.appendChild(document.createTextNode("ACCEPT COOKIES")); GDPR_table_undecided.appendChild(GDPR_row); GDPR_row.appendChild(GDPR_cell); GDPR_cell.appendChild(GDPR_reject_button); GDPR_cell.appendChild(GDPR_accept_button); document.body.appendChild(GDPR_table_undecided); GDPR_table_undecided.style.width="100%"; GDPR_table_undecided.style.border="1px dashed blue"; GDPR_table_undecided.style.textAlign="center"; GDPR_table_undecided.style.position="fixed"; GDPR_table_undecided.style.bottom="0"; GDPR_reject_button.style.border="1px solid green"; GDPR_accept_button.style.border="1px solid green"; GDPR_table_undecided.style.verticalAlign="middle"; /* some old IE convention */ }