@CUBASE כתב:
בעז"ה אם יהיה לי זמן
תודה רבה, אשמח מאד!
עשיתי HTML למודול הזה, אשמח אם מישהו יוכל לבדוק לי אם הוא עושה את זה נכון
הקוד בספוילר:
Spoiler
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>מחולל הגדרות למודול הוספת ערך - ימות המשיח</title>
<style>
:root {
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--bg-color: #f8fafc;
--card-bg: #ffffff;
--text-color: #1e293b;
--border-color: #cbd5e1;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 15px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
margin: 0 0 5px 0;
color: var(--primary-color);
font-size: 1.5rem;
}
header p {
margin: 0;
color: #64748b;
font-size: 0.9rem;
}
.main-container {
display: flex;
gap: 20px;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.form-section {
flex: 1;
background: var(--card-bg);
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
max-height: 85vh;
overflow-y: auto;
}
.preview-section {
width: 45vw;
background: #1e293b;
color: #e2e8f0;
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
position: sticky;
top: 15px;
height: 85vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.preview-section h2 {
margin-top: 0;
color: #38bdf8;
font-size: 1.05rem;
border-bottom: 1px solid #334155;
padding-bottom: 8px;
}
.code-output {
background: #0f172a;
color: #38bdf8;
padding: 12px;
border-radius: 8px;
font-family: monospace;
white-space: pre-wrap;
direction: ltr;
text-align: left;
overflow-x: auto;
flex-grow: 1;
font-size: 0.85rem;
line-height: 1.4;
max-height: 35vh;
}
.file-line-output {
background: #0f172a;
color: #facc15;
padding: 10px;
border-radius: 8px;
font-family: monospace;
direction: ltr;
text-align: left;
font-size: 0.85rem;
margin-bottom: 10px;
white-space: pre-wrap;
}
.copy-btn {
background-color: #38bdf8;
color: #0f172a;
border: none;
padding: 10px;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
margin-top: 10px;
transition: background-color 0.2s;
font-size: 0.95rem;
}
.copy-btn:hover {
background-color: #7dd3fc;
}
.fieldset-group {
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
background: #fff;
}
.fieldset-group legend {
font-weight: bold;
color: var(--primary-color);
padding: 0 10px;
}
.form-group {
margin-bottom: 12px;
}
label {
display: block;
margin-bottom: 4px;
font-weight: 500;
font-size: 0.9rem;
}
.required::after {
content: " *";
color: #dc2626;
}
input[type="text"], select {
width: 100%;
padding: 8px 10px;
border: 1px solid var(--border-color);
border-radius: 6px;
box-sizing: border-box;
font-size: 0.95rem;
}
input[type="text"]:focus, select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.checkbox-group {
display: flex;
align-items: center;
gap: 8px;
}
.checkbox-group input {
width: 18px;
height: 18px;
}
.helper-text {
font-size: 0.75rem;
color: #64748b;
margin-top: 2px;
}
@media (max-width: 900px) {
.main-container {
flex-direction: column;
}
.preview-section {
width: 100%;
position: static;
height: auto;
}
}
</style>
</head>
<body>
<header>
<h1>מחולל הגדרות למודול הוספת ערך ב-API</h1>
<p>תודה ל-CUBASE על הפיתוח המטורף!!</p>
</header>
<div class="main-container">
<!-- אזור השאלות וההגדרות -->
<div class="form-section">
<!-- הגדרות תצוגה קוד -->
<div class="fieldset-group" style="background: #f1f5f9;">
<div class="checkbox-group">
<input type="checkbox" id="showComments" checked onchange="generateCode()">
<label for="showComments" style="margin-bottom:0; cursor:pointer;">הצג הערות הסבר בתוך הקוד (זה לא משפיע כלום)</label>
</div>
</div>
<!-- שלב 1: חיבור ובסיס -->
<fieldset class="fieldset-group">
<legend>שלב 1: חיבור ומיקום הפעלת המודול</legend>
<div class="form-group">
<label for="token" class="required">טוקן המערכת (Token):</label>
<input type="text" id="token" placeholder="הכנס את הטוקן שלך כאן" oninput="generateCode()">
</div>
<div class="form-group">
<label for="modulePlace">איך מפעילים את המודול?</label>
<select id="modulePlace" onchange="toggleModulePlace(); generateCode();">
<option value="standalone">שלוחה עצמאית בפני עצמה (type=api)</option>
<option value="control">בתוך השמעת קבצים - מקש שליטה (control_playX)</option>
<option value="after">בתוך השמעת קבצים - בסיום השמעה (after_play)</option>
</select>
</div>
<div class="form-group" id="keyNumberGroup" style="display: none;">
<label for="playKeyNumber" class="required">מספר המקש בהשמעת קבצים (לדוגמה 1):</label>
<input type="text" id="playKeyNumber" value="1" placeholder="מספר מקש" oninput="generateCode()">
</div>
</fieldset>
<!-- שלב 2: קובץ היעד -->
<fieldset class="fieldset-group">
<legend>שלב 2: הגדרת קובץ היעד לעריכה</legend>
<div class="form-group">
<label for="locationMode">איך לבחור את מיקום הקובץ?</label>
<select id="locationMode" onchange="toggleLocationMode(); generateCode();">
<option value="path">נתיב קבוע</option>
<option value="TFR">בחירת שלוחה ע"י המאזין</option>
</select>
</div>
<div class="form-group" id="staticPathGroup">
<label for="targetFolder">תיקייה (ריק = ראשי):</label>
<input type="text" id="targetFolder" placeholder="לדוגמה: 1/2 (ללא סלש בהתחלה) או השאר ריק" oninput="generateCode()">
</div>
<div class="form-group">
<label for="targetFileNameSelect">שם הקובץ (בחר מהרשימה):</label>
<select id="targetFileNameSelect" onchange="selectFileNamePreset(); generateCode();" style="margin-bottom: 6px;">
<option value="ext">ext</option>
<option value="ivr">ivr</option>
<option value="id">id</option>
<option value="WhiteList">WhiteList (רשימה לבנה)</option>
<option value="BlackList">BlackList (רשימה שחורה)</option>
<option value="custom">אחר...</option>
</select>
<input type="text" id="targetFileName" value="ext" placeholder="ext (הכנס כאן את שם הקובץ)" oninput="generateCode()">
</div>
<div class="form-group">
<label for="targetFileExt">סיומת הקובץ (אם ריק = ini):</label>
<input type="text" id="targetFileExt" value="ini" placeholder="ini, txt וכדו'" oninput="generateCode()">
</div>
</fieldset>
<!-- שלב 3: מפתח (Key) -->
<fieldset class="fieldset-group">
<legend>שלב 3: הגדרת המפתח (Key)</legend>
<div class="form-group">
<label for="keySourceType">סוג המפתח:</label>
<select id="keySourceType" onchange="toggleKeyInputs(); generateCode();">
<option value="fixed">מפתח קבוע מראש</option>
<option value="EnterID">זיהוי מאזין נכנס (EnterID)</option>
<option value="digits">הקשת ספרות ע"י המאזין</option>
<option value="keyboard">הקלדה במקלדת (אותיות/ספרות)</option>
<option value="file_phone">מספר טלפון של מקליט ההודעה (file_phone)</option>
</select>
</div>
<div class="form-group" id="fixedKeyGroup">
<label for="fixedKeyValue" class="required">ערך המפתח הקבוע:</label>
<input type="text" id="fixedKeyValue" placeholder="הכנס מפתח" oninput="generateCode()">
</div>
<div class="form-group">
<label for="keyFirst">קידומת לפני המפתח (אופציונלי):</label>
<input type="text" id="keyFirst" placeholder="לדוגמה: SIP-" oninput="generateCode()">
</div>
<div class="form-group">
<label for="keyLast">סיומת אחרי המפתח (אופציונלי):</label>
<input type="text" id="keyLast" placeholder="לדוגמה: -OK" oninput="generateCode()">
</div>
</fieldset>
<!-- שלב 4: ערך (Value) -->
<fieldset class="fieldset-group">
<legend>שלב 4: הגדרת הערך (Value) - ניתן להשאיר ללא ערך</legend>
<div class="form-group">
<label for="valueSourceType">סוג הערך:</label>
<select id="valueSourceType" onchange="toggleValueInputs(); generateCode();">
<option value="none">ללא ערך (רק מפתח)</option>
<option value="fixed">ערך קבוע מראש</option>
<option value="EnterID">זיהוי מאזין נכנס (EnterID)</option>
<option value="digits">הקשת ספרות ע"י המאזין</option>
<option value="keyboard">הקלדה במקלדת</option>
<option value="file_phone">מספר טלפון של מקליט ההודעה (file_phone)</option>
</select>
</div>
<div class="form-group" id="fixedValueGroup" style="display: none;">
<label for="fixedValueVal" class="required">ערך קבוע:</label>
<input type="text" id="fixedValueVal" placeholder="הכנס ערך" oninput="generateCode()">
</div>
<div class="form-group" id="valueModifiersGroup">
<label for="valueFirst">קידומת לפני הערך (אופציונלי):</label>
<input type="text" id="valueFirst" placeholder="לדוגמה: t-" oninput="generateCode()" style="margin-bottom: 8px;">
<label for="valueLast">סיומת אחרי הערך (אופציונלי):</label>
<input type="text" id="valueLast" placeholder="לדוגמה: -end" oninput="generateCode()">
</div>
</fieldset>
<!-- שלב 5: עדכון ופעולות חשבון -->
<fieldset class="fieldset-group">
<legend>שלב 5: עדכון ופעולות חשבון</legend>
<div class="form-group">
<label for="valueChange">עדכון ערך אם המפתח כבר קיים? (value_change):</label>
<select id="valueChange" onchange="generateCode()">
<option value="no">לא (ברירת מחדל - שגיאה אם קיים)</option>
<option value="yes">כן (החלף ערך קיים)</option>
</select>
</div>
<div class="form-group">
<label for="mathAction">פעולות חשבון על ערכים מספריים:</label>
<select id="mathAction" onchange="generateCode()">
<option value="none">ללא פעולת חשבון</option>
<option value="plus">הוספת 1 לערך הקיים (value_plus=yes)</option>
<option value="minus">הורדת 1 מהערך הקיים (value_minus=yes)</option>
</select>
</div>
</fieldset>
<!-- שלב 6: תוקף זמן -->
<fieldset class="fieldset-group">
<legend>שלב 6: תוקף זמן (אופציונלי)</legend>
<div class="form-group">
<label for="expiredMode">שיטת הגדרת תוקף:</label>
<select id="expiredMode" onchange="toggleExpiredMode(); generateCode();">
<option value="none">ללא תוקף</option>
<option value="manual">הגדרה ידנית (למשל 4h, 30s)</option>
<option value="tfr">בחירת מאזין (value_expired=tfr)</option>
</select>
</div>
<div class="form-group" id="expiredTimeGroup" style="display: none;">
<label for="expiredTime">משך תוקף (דורש מפתח וערך):</label>
<input type="text" id="expiredTime" placeholder="לדוגמה: 4h, 30s, 2026-12-31" oninput="generateCode()">
<div class="helper-text">פורמטים: s, m, h, d, M או תאריך/שעה.</div>
</div>
<div class="form-group" id="expiredChangeGroup" style="display: none;">
<label for="expiredChangeTo">ערך חלופי לאחר פקיעת התוקף (value_expired_change_to):</label>
<input type="text" id="expiredChangeTo" placeholder="לדוגמה: menu" oninput="generateCode()">
</div>
</fieldset>
<!-- שלב 7: בדיקות וניתובים -->
<fieldset class="fieldset-group">
<legend>שלב 7: בדיקות וניתובים בסיום</legend>
<div class="form-group">
<label for="checkBlock">בדיקה בקובץ חסימה נוסף (check_block_list):</label>
<select id="checkBlock" onchange="toggleBlockFile(); generateCode();">
<option value="no">לא</option>
<option value="yes">כן (בדוק בקובץ נוסף)</option>
</select>
</div>
<div class="form-group" id="blockFileGroup" style="display: none;">
<label for="blockFolder">נתיב קובץ החסימה (בלי סלש בהתחלה, ריק = ראשי):</label>
<input type="text" id="blockFolder" placeholder="לדוגמה: 1 (או השאר ריק)" oninput="generateCode()">
<label for="blockFileName" style="margin-top: 6px;">שם קובץ החסימה (בלי סיומת):</label>
<input type="text" id="blockFileName" value="WhiteList" oninput="generateCode()">
<label for="blockFileExt" style="margin-top: 6px;">סיומת קובץ החסימה (ריק = ini):</label>
<input type="text" id="blockFileExt" value="ini" oninput="generateCode()">
</div>
<div class="form-group">
<label for="endGoto">לאן לעבור בסיום בהצלחה (end_goto):</label>
<input type="text" id="endGoto" placeholder="לדוגמה: /1" oninput="generateCode()">
</div>
<div class="form-group">
<label for="errorEndGoto">לאן לעבור במקרה של שגיאה (error_end_goto):</label>
<input type="text" id="errorEndGoto" placeholder="לדוגמה: /2" oninput="generateCode()">
</div>
</fieldset>
</div>
<!-- תצוגה מקדימה -->
<div class="preview-section">
<h2 id="previewTitle">השורה שתתווסף (לאחר הכניסה לשלוחת ההוספה) בשלוחה: 'השלוחה' בקובץ 'ID.INI':</h2>
<div id="fileLineOutput" class="file-line-output"></div>
<h2>תצוגה מקדימה: קוד ההגדרות המלא לשלוחה</h2>
<div id="codeOutput" class="code-output"></div>
<button class="copy-btn" onclick="copyCode()">העתק קוד מלא ללוח</button>
</div>
</div>
<script>
function toggleModulePlace() {
const place = document.getElementById('modulePlace').value;
document.getElementById('keyNumberGroup').style.display = place === 'control' ? 'block' : 'none';
}
function toggleLocationMode() {
const mode = document.getElementById('locationMode').value;
document.getElementById('staticPathGroup').style.display = mode === 'path' ? 'block' : 'none';
}
function toggleKeyInputs() {
const type = document.getElementById('keySourceType').value;
document.getElementById('fixedKeyGroup').style.display = type === 'fixed' ? 'block' : 'none';
}
function toggleValueInputs() {
const type = document.getElementById('valueSourceType').value;
document.getElementById('fixedValueGroup').style.display = type === 'fixed' ? 'block' : 'none';
document.getElementById('valueModifiersGroup').style.display = type === 'none' ? 'none' : 'block';
}
function toggleBlockFile() {
const check = document.getElementById('checkBlock').value;
document.getElementById('blockFileGroup').style.display = check === 'yes' ? 'block' : 'none';
}
function toggleExpiredMode() {
const mode = document.getElementById('expiredMode').value;
document.getElementById('expiredTimeGroup').style.display = mode === 'manual' ? 'block' : 'none';
document.getElementById('expiredChangeGroup').style.display = mode !== 'none' ? 'block' : 'none';
}
function selectFileNamePreset() {
const sel = document.getElementById('targetFileNameSelect').value;
const input = document.getElementById('targetFileName');
if (sel !== 'custom') {
input.value = sel;
input.readOnly = true;
input.style.backgroundColor = '#f1f5f9';
} else {
input.readOnly = false;
input.style.backgroundColor = '#fff';
input.focus();
}
}
function addLine(lines, comment, codeLine, showComm) {
if (showComm && comment) {
lines.push(`; ${comment}`);
}
lines.push(codeLine);
}
function generateCode() {
let lines = [];
let index = 0;
const showComm = document.getElementById('showComments').checked;
const modulePlace = document.getElementById('modulePlace').value;
if (modulePlace === 'standalone') {
addLine(lines, "הגדרת שלוחה עצמאית כ-API", "type=api", showComm);
} else if (modulePlace === 'control') {
const keyNum = document.getElementById('playKeyNumber').value.trim() || '1';
addLine(lines, "הפעלה מתוך השמעת קבצים כמקש שליטה", `control_play${keyNum}=send_api`, showComm);
} else if (modulePlace === 'after') {
addLine(lines, "הפעלה מתוך השמעת קבצים בסיום השמעה", `after_play=send_to_api`, showComm);
}
addLine(lines, "קישור לשרת ה-API", "api_link=https://moduls.smartel.workers.dev/add_id_to_list.php", showComm);
const token = document.getElementById('token').value.trim();
addLine(lines, "הגדרת טוקן זיהוי", `api_add_${index++}=token=${token || 'הטוקן_שלכם'}`, showComm);
const locationMode = document.getElementById('locationMode').value;
let fileName = document.getElementById('targetFileName').value.trim() || 'id';
let fileExt = document.getElementById('targetFileExt').value.trim() || 'ini';
let folder = document.getElementById('targetFolder').value.trim();
let displayFolderText = folder ? `/${folder}` : 'הראשי';
let displayFileNameText = `${fileName}.${fileExt}`.toUpperCase();
document.getElementById('previewTitle').innerText = `השורה שתתווסף (לאחר הכניסה לשלוחת ההוספה) בשלוחה: '${displayFolderText}' בקובץ '${displayFileNameText}':`;
if (locationMode === 'path') {
let fullPath = "";
if (folder) {
if (folder.endsWith('/')) {
fullPath = `/${folder}`;
} else {
fullPath = `/${folder}/${fileName}.${fileExt}`;
}
} else {
fullPath = `/${fileName}.${fileExt}`;
}
addLine(lines, "קביעת נתיב קובץ היעד", `api_add_${index++}=location_list=${fullPath}`, showComm);
} else {
addLine(lines, "בחירת שלוחה ע\"י המאזין", `api_add_${index++}=location_list=TFR`, showComm);
let fullTfrName = `${fileName}.${fileExt}`;
addLine(lines, "שם הקובץ בתיקיה הנבחרת", `api_add_${index++}=location_tfr_file_name=${fullTfrName}`, showComm);
}
// חישוב המפתח הנקי לתצוגה המקדימה בקובץ
const keySource = document.getElementById('keySourceType').value;
let previewKey = "KEY";
if (keySource === 'fixed') {
previewKey = document.getElementById('fixedKeyValue').value.trim() || 'KEY';
} else if (keySource === 'file_phone') {
previewKey = 'מספר משאיר ההודעה';
} else {
previewKey = `[${keySource}]`;
}
const keyFirst = document.getElementById('keyFirst').value.trim();
const keyLast = document.getElementById('keyLast').value.trim();
let finalKey = keyFirst + previewKey + keyLast;
if (keySource === 'fixed') {
let val = document.getElementById('fixedKeyValue').value.trim();
addLine(lines, "הגדרת מפתח קבוע", `api_add_${index++}=key=${val || 'מפתח'}`, showComm);
} else {
addLine(lines, "הגדרת סוג מפתח", `api_add_${index++}=key_type=${keySource}`, showComm);
}
if (keyFirst) {
addLine(lines, "קידומת למפתח", `api_add_${index++}=key_first=${keyFirst}`, showComm);
}
if (keyLast) {
addLine(lines, "סיומת למפתח", `api_add_${index++}=key_last=${keyLast}`, showComm);
}
// חישוב הערך הנקי לתצוגה המקדימה בקובץ
const valueSource = document.getElementById('valueSourceType').value;
let finalOutputLine = "";
if (valueSource === 'none') {
addLine(lines, "הגדרת סוג מפתח בלבד (ללא ערך)", `api_add_${index++}=key_type=${keySource}`, showComm);
// נסיר את שורות הערך האוטומטיות אם ישנן, או נציג רק מפתח
finalOutputLine = finalKey;
} else {
let previewVal = "VALUE";
if (valueSource === 'fixed') {
previewVal = document.getElementById('fixedValueVal').value.trim() || 'VALUE';
} else if (valueSource === 'file_phone') {
previewVal = 'מספר משאיר ההודעה';
} else {
previewVal = `[${valueSource}]`;
}
const valueFirst = document.getElementById('valueFirst').value.trim();
const valueLast = document.getElementById('valueLast').value.trim();
let finalValue = valueFirst + previewVal + valueLast;
if (valueSource === 'fixed') {
let val = document.getElementById('fixedValueVal').value.trim();
addLine(lines, "הגדרת ערך קבוע", `api_add_${index++}=value=${val || 'ערך'}`, showComm);
} else {
addLine(lines, "הגדרת סוג ערך", `api_add_${index++}=value_type=${valueSource}`, showComm);
}
if (valueFirst) {
addLine(lines, "קידומת לערך", `api_add_${index++}=value_first=${valueFirst}`, showComm);
}
if (valueLast) {
addLine(lines, "סיומת לערך", `api_add_${index++}=value_last=${valueLast}`, showComm);
}
finalOutputLine = `${finalKey}=${finalValue}`;
}
const valueChange = document.getElementById('valueChange').value;
if (valueChange === 'yes' && valueSource !== 'none') {
addLine(lines, "עדכון ערך אם המפתח כבר קיים", `api_add_${index++}=value_change=yes`, showComm);
}
const mathAction = document.getElementById('mathAction').value;
if (mathAction === 'plus' && valueSource !== 'none') {
addLine(lines, "הוספת 1 לערך הקיים", `api_add_${index++}=value_plus=yes`, showComm);
} else if (mathAction === 'minus' && valueSource !== 'none') {
addLine(lines, "הורדת 1 מהערך הקיים", `api_add_${index++}=value_minus=yes`, showComm);
}
const expiredMode = document.getElementById('expiredMode').value;
if (expiredMode === 'tr') { // מטופל כ-tfr
// ...
}
if (expiredMode === 'tfr') {
addLine(lines, "תוקף זמן דינמי בבחירת מאזין", `api_add_${index++}=value_expired=tfr`, showComm);
const expiredChangeTo = document.getElementById('expiredChangeTo').value.trim();
if (expiredChangeTo) {
addLine(lines, "ערך חלופי לאחר פקיעת תוקף", `api_add_${index++}=value_expired_change_to=${expiredChangeTo}`, showComm);
}
} else if (expiredMode === 'manual') {
const expiredTime = document.getElementById('expiredTime').value.trim();
if (expiredTime) {
addLine(lines, "תוקף זמן ידני", `api_add_${index++}=value_expired=${expiredTime}`, showComm);
const expiredChangeTo = document.getElementById('expiredChangeTo').value.trim();
if (expiredChangeTo) {
addLine(lines, "ערך חלופי לאחר פקיעת תוקף", `api_add_${index++}=value_expired_change_to=${expiredChangeTo}`, showComm);
}
}
}
const checkBlock = document.getElementById('checkBlock').value;
if (checkBlock === 'yes') {
let bFolder = document.getElementById('blockFolder').value.trim();
let bName = document.getElementById('blockFileName').value.trim() || 'WhiteList';
let bExt = document.getElementById('blockFileExt').value.trim() || 'ini';
let bFullPath = bFolder ? `/${bFolder}/${bName}.${bExt}` : `/${bName}.${bExt}`;
addLine(lines, "בדיקת חסימה בקובץ נוסף", `api_add_${index++}=check_block_list=yes`, showComm);
addLine(lines, "נתיב קובץ החסימה", `api_add_${index++}=location_list_block=${bFullPath}`, showComm);
}
const endGoto = document.getElementById('endGoto').value.trim();
if (endGoto) {
addLine(lines, "יעד מעבר בסיום בהצלחה", `api_add_${index++}=end_goto=${endGoto}`, showComm);
}
const errorEndGoto = document.getElementById('errorEndGoto').value.trim();
if (errorEndGoto) {
addLine(lines, "יעד מעבר במקרה של שגיאה", `api_add_${index++}=error_end_goto=${errorEndGoto}`, showComm);
}
// הצגת השורה בקובץ בצורה נקייה
document.getElementById('fileLineOutput').innerText = finalOutputLine;
document.getElementById('codeOutput').innerText = lines.join('\n');
}
function copyCode() {
const codeText = document.getElementById('codeOutput').innerText;
navigator.clipboard.writeText(codeText).then(() => {
alert('הקוד הועתק בהצלחה ללוח!');
});
}
// אתחול מצב שדה שם הקובץ (נעול על id כברירת מחדל)
document.getElementById('targetFileName').readOnly = true;
document.getElementById('targetFileName').style.backgroundColor = '#f1f5f9';
generateCode();
</script>
</body>
</html>