Files
vokspace/files/scripts.js
2026-01-02 21:00:45 +01:00

65 lines
2.8 KiB
JavaScript

function copyLink(link) {
var el = document.createElement('textarea');
el.value = link;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
alert("Link wurde kopiert");
}
function openWindow(window_name) {
document.getElementById("window-" + window_name).style.display = "block";
document.getElementById("window-" + window_name).style.opacity = "1";
document.getElementById("back-arrow").style.display = "none";
document.getElementById("back-arrow-window").style.display = "block";
document.getElementById("main").style.filter = "blur(8px)";
}
function closeWindow(site_name) {
if (site_name == "1") {
document.getElementById("window-1").style.display = "none";
document.getElementById("window-1").style.opacity = "0";
document.getElementById("window-2").style.display = "none";
document.getElementById("window-2").style.opacity = "0";
document.getElementById("window-3").style.display = "none";
document.getElementById("window-3").style.opacity = "0";
}
if (site_name == "2") {
document.getElementById("window-4").style.display = "none";
document.getElementById("window-4").style.opacity = "0";
}
if (site_name == "3") {
document.getElementById("window-5").style.display = "none";
document.getElementById("window-5").style.opacity = "0";
}
if (site_name == "4") {
document.getElementById("window-6").style.display = "none";
document.getElementById("window-6").style.opacity = "0";
}
document.getElementById("back-arrow").style.display = "block";
document.getElementById("back-arrow-window").style.display = "none";
document.getElementById("main").style.filter = "blur(0px)";
}
function addTo(from) {
var from = from;
var selectedValue = document.getElementById('add-to').value;
window.location = 'add-vokab?from=' + from + '&add-to' + selectedValue;
}
function openSchoolYear() {
var selectedValue = document.getElementById('openSchoolYear').value;
window.location = '?item=' + selectedValue;
}
function togglePassword(fieldNumber) {
var x = document.getElementById("toggle-password" + fieldNumber);
if (x.type === "password") {
x.type = "text";
document.getElementById("toggle-password-chb" + fieldNumber + "-eye").style.visibility = "hidden";
document.getElementById("toggle-password-chb" + fieldNumber + "-eye-slash").style.visibility = "visible";
} else {
x.type = "password";
document.getElementById("toggle-password-chb" + fieldNumber + "-eye").style.visibility = "visible";
document.getElementById("toggle-password-chb" + fieldNumber + "-eye-slash").style.visibility = "hidden";
}
}