`; } /* העתקה ללוח */ document.getElementById("copyButton").addEventListener("click", async function() { const code = generateExportCode(); try { await navigator.clipboard.writeText(code); } catch (e) { const textarea = document.createElement("textarea"); textarea.value = code; textarea.style.position = "fixed"; textarea.style.opacity = "0"; document.body.appendChild(textarea); textarea.select(); document.execCommand("copy"); textarea.remove(); } this.textContent = "✓ הקוד הועתק בהצלחה!"; setTimeout(() => { this.textContent = "העתק קוד"; }, 2500); }); /* אירועים */ document.getElementById("addButton").addEventListener("click", addVideos); input.addEventListener("keydown", function(e) { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); addVideos(); } });