🎵 מחולל אלבומי YouTube

חיפוש → בחירת סרטון → הטמעה → יצירת אתר

`; } /* ======================================================== העתקת קוד ======================================================== */ async function copyCode(){ const code = document .getElementById( "generatedCode" ) .value; try{ await navigator.clipboard.writeText( code ); showStatus( "✓ הקוד המלא הועתק." ); }catch(e){ const textarea = document.getElementById( "generatedCode" ); textarea.select(); document.execCommand( "copy" ); showStatus( "✓ הקוד המלא הועתק." ); } } /* ======================================================== הורדת האתר שנוצר ======================================================== */ function downloadHTML(){ const code = document .getElementById( "generatedCode" ) .value; if(!code){ return; } const blob = new Blob( [code], { type:"text/html;charset=utf-8" } ); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = "youtube-album.html"; document .body .appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); } /* ======================================================== סטטוס ======================================================== */ function showStatus(message){ const status = document.getElementById( "status" ); status.innerHTML = message; status.classList.remove( "hidden" ); } /* ======================================================== HTML בטוח ======================================================== */ function escapeHTML(text){ return String(text) .replace( /&/g, "&" ) .replace( //g, ">" ) .replace( /"/g, """ ) .replace( /'/g, "'" ); }