function copyValue(elementId) { /* Get the text field */ var copyText = document.getElementById(elementId).innerText; /* Create a temporary input field */ var tempInput = document.createElement("input"); tempInput.value = copyText; document.body.appendChild(tempInput); /* Select the text field */ tempInput.select(); tempInput.setSelectionRange(0, 99999); /* For mobile devices */ console.log(copyText); /* Copy the text inside the text field */ navigator.clipboard.writeText(copyText); /* Remove the temporary input field */ document.body.removeChild(tempInput); /* Show a toast message */ var toast = document.createElement("div"); toast.innerText = "Copied to clipboard!"; toast.style.position = "fixed"; toast.style.bottom = "20px"; toast.style.left = "50%"; toast.style.transform = "translateX(-50%)"; toast.style.background = "#673AB7"; toast.style.color = "#ffffff"; toast.style.padding = "10px"; toast.style.borderRadius = "5px"; document.body.appendChild(toast); /* Remove the toast message after 3 seconds */ setTimeout(function () { document.body.removeChild(toast); }, 3000); } function showAndHide(elementId,liId){ let element = document.getElementById(elementId); let li = document.getElementById(liId); element.classList.contains('hiddencopy')? element.classList.remove('hiddencopy'):element.classList.add('hiddencopy'); element.classList.contains('hiddencopy')? li.classList.remove('clicked'):li.classList.add('clicked'); } function replaceHebrew(elementId, stff){ let element = document.getElementById(elementId); if (stff == 'Administrative staff'){ element.innerText = "מותר לשימוש בידי צוות מנהלי"; } else if(stff == 'Students') { element.innerText = "מותר לשימוש בידי סטודנטים"; } } function insertWarning(elementId, before, lang="en"){ if (elementId == true){ if(lang == "he"){ console.log('fuck'); let elem = document.createElement("div"); elem.id = "התראה"; elem.innerText = "הבהרה: המסך החכם של מיקרוסופט ימנע את ריצת התוכנה. יש ללחוץ על פרטים נוספים -> אפשר"; elem.style.color="#ffffff"; let nodebefore = document.getElementById(before); nodebefore.insertBefore(elem, nodebefore.children[7]) } else{ console.log('fuck'); let elem = document.createElement("div"); elem.id = "Warning"; elem.innerText = "Warning: Has Microsoft SmartScreen blue window of block from running. Press more details -> Allow Running"; elem.style.color="#ffffff"; let nodebefore = document.getElementById(before); nodebefore.insertBefore(elem, nodebefore.children[7]) } } } function downloadValue(elementId, filename){ let text = document.getElementById(elementId).innerText; var element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } function scriptPackage(rowid, extracommand, line){ let text = `winget install ${rowid} -s huji`; console.log(extracommand) let fub = extracommand.indexOf(' &&') console.log(`${rowid}, ${fub}`) console.log(`${rowid}, ${extracommand.length < 2}`) try{ console.log(text) if(fub == 0){ text += extracommand; } else if((extracommand.length > 2)){ text = extracommand + " && " + text; } else if ((fub == -1)) { text = text; } } catch{ text = text; } document.getElementById(`id-${line}`).innerHTML = text; } function convertHtml(dt){ return dt.replace("") }