function closePopup() { document.getElementById("popup").style.display = "none"; } function openPopup(uid) { /*const AJAX_URI = "https://www.swag.ibp-dresden.de/wp-content/plugins/cvapi/ajax_zirk.php" + "?uid=" + uid;*/ document.getElementById("popup").style.display = "block"; document.getElementById("popup_close").addEventListener("click", closePopup); resizePopup(); /*const xhttp = new XMLHttpRequest(); xhttp.onload = function() { document.getElementById("popup_content").innerHTML = this.responseText; var i = -1; do { i++; } while(treffdaten[i].uid != uid); document.getElementById("treffdata_hl").innerHTML = treffdaten[i].hl; document.getElementById("treffdata_txt").innerHTML = treffdaten[i].treff; } xhttp.open("GET", AJAX_URI, true); xhttp.send();*/ } function resizePopup() { var screenX = window.innerWidth; var screenY = window.innerHeight; var scrollX = window.pageXOffset; var scrollY = window.pageYOffset; if(screenX < 780-50) document.getElementById("popup").style.width = (screenX-50) + "px"; else document.getElementById("popup").style.width = "320" + "px"; if(screenY < 400-40) { document.getElementById("popup").style.height = (screenY-40) + "px"; } else { document.getElementById("popup").style.height = "400" + "px"; } var popupY = parseInt(document.getElementById("popup").offsetHeight); var popupX = parseInt(document.getElementById("popup").offsetWidth); document.getElementById("popup").style.top = ((screenY-popupY)/2 + scrollY + -100) + "px"; document.getElementById("popup").style.left = ((screenX-popupX)/2 + scrollX) + "px"; } function positioningPopup() { //document.getElementById("popup").style.top = window.scrollY + "px"; var screenY = window.innerHeight; var scrollY = window.pageYOffset; var popupY = parseInt(document.getElementById("popup").offsetHeight); document.getElementById("popup").style.top = ((screenY-popupY)/2 + scrollY + -100) + "px"; } window.addEventListener("resize", resizePopup); document.addEventListener("scroll", positioningPopup); function copy2cb(idlist) { var i = -1; var el_txt = ''; while(++i < idlist.length) { el_txt += document.getElementById(idlist[i]).innerHTML + '\n'; //el.select(); //el.setSelectionRange(0, 99999); // for mobile dev navigator.clipboard.writeText(el_txt); } alert("Die Adresse wurde in die Zwischenablage kopiert: \n" + el_txt); }