סימניה לעזרה בהגדרות מתקדמות
-
בניתי איזה רעיון לסימנייה שטוענת את ההגדרות בשלוחה, ומראה את ההגדרות הקיימות, ונותנת לשינוי בצורה קלה, כרגע אין שם כמעט הגדרות אבל כל אחד יכול להוסיף לעצמו עם קצת הבנה
אשמח לתוגובתיכם והאם כדאי להשקיע בהגדרות של זה
יש להעלות בשלוחה הראשית קובץ בשםSIMANIA.iniולשים בו את התוכן שמופיע בספויילר{ "types": { "playfile": "שלוחת השמעת קבצים", "meun": "שלוחת תפריט", "global": "הגדרות כלליות (גלובליות)", "nitoviya": "ניתוביה", "add_id_to_list": "מודל הוספת ערך", "template_add_number": "הוספת המחייג לרשי\"ת", "template_remove_number": "הסרת המחייג לרשי\"ת", "go_to_folder": "מעבר לשלוחה אחרת" }, "settings": [ { "ivr_type": "playfile", "key": "folder_to_play", "question": "מיקום הקבצים שיושמעו", "field_type": "text", "options": [] }, { "ivr_type": "playfile", "key": "start", "question": "מאיזה קובץ יתחילו לשמוע", "field_type": "select", "options": [ { "label": "הקטן ביותר", "value": "min", "is_free": true }, { "label": "הגדול ביותר", "value": "", "is_free": false }, { "label": "מספר מסויים", "value": "[FREE_INPUT]", "is_free": false } ] }, { "ivr_type": "playfile", "key": "play_beep", "question": "האם לבטל את השמעת הביפ בין ההודעות", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "play_beep", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "play_beep:yes:say_current", "question": "האם ישמיע את מספר הקובץ", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "say_current", "meta_is_conditional": "yes", "meta_parent_key": "play_beep", "meta_parent_val": "yes" }, { "ivr_type": "playfile", "key": "say_details_message_skip_menu", "question": "האם אחרי שמיעת פרטי המשתמש ישאל האם לשמוע פעם נוספת", "field_type": "select", "options": [ { "label": "לא", "value": "yes", "is_free": false }, { "label": "כן", "value": "", "is_free": false } ], "meta_pure_key": "say_details_message_skip_menu", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "nitoviya", "key": "nitoviya_dial_to", "question": "מספר לניתוב", "field_type": "text", "options": [], "meta_pure_key": "nitoviya_dial_to", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "say_details_message_say_name_by_enter_id", "question": "האם ישמעו את השם לפי המוגדר עכשיו או לפי זמן ההקלטה", "field_type": "select", "options": [ { "label": "זמן ההקלטה", "value": "", "is_free": false }, { "label": "עכשיו", "value": "val_name", "is_free": false } ], "meta_pure_key": "say_details_message_say_name_by_enter_id", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "details_message_date", "question": "איזה סוג תאריך ישמעו בפרטי ההודעה", "field_type": "select", "options": [ { "label": "עברי", "value": "heb", "is_free": false }, { "label": "לועזי", "value": "", "is_free": false } ], "meta_pure_key": "details_message_date", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "say_details_message_say_phone_skip_if_name_exists", "question": "בפרטי הודעה: האם מי שיש לו שם ישמעו גם את הטלפון", "field_type": "select", "options": [ { "label": "כן", "value": "", "is_free": false }, { "label": "לא", "value": "yes", "is_free": false } ], "meta_pure_key": "say_details_message_say_phone_skip_if_name_exists", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "save_listening_data", "question": "האם ישמור פרטי האזנה", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "save_listening_data", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "admin_options_file", "question": "מי שברשי\"ת יוכל למחוק קבצים", "field_type": "select", "options": [ { "label": "כן", "value": "template", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "admin_options_file", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "admin_options_file:template:check_template", "question": "איזה רשי\"ת", "field_type": "text", "options": [], "meta_pure_key": "check_template", "meta_is_conditional": "yes", "meta_parent_key": "admin_options_file", "meta_parent_val": "template" }, { "ivr_type": "global", "key": "enter_id", "question": "האם יהיה כניסה לפי זיהוי אישי", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "enter_id", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "global", "key": "enter_id:yes:enter_id_type", "question": "לפי איזה זיהוי יכנס", "field_type": "select", "options": [ { "label": "טלפון", "value": "phone", "is_free": false }, { "label": "מספר זהות", "value": "teudat_zehut", "is_free": false } ], "meta_pure_key": "enter_id_type", "meta_is_conditional": "yes", "meta_parent_key": "enter_id", "meta_parent_val": "yes" }, { "ivr_type": "global", "key": "enter_id:yes:record_name", "question": "האם יקליט את השם", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "no", "is_free": false } ], "meta_pure_key": "record_name", "meta_is_conditional": "yes", "meta_parent_key": "enter_id", "meta_parent_val": "yes" }, { "ivr_type": "global", "key": "enter_id:yes:say_name", "question": "האם ישמיע את השם", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "no", "is_free": false }, { "label": "ישמיע את הההמרה לטקסט", "value": "val_name", "is_free": false } ], "meta_pure_key": "say_name", "meta_is_conditional": "yes", "meta_parent_key": "enter_id", "meta_parent_val": "yes" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_location_list", "question": "מיקום הקובץ", "field_type": "select", "options": [ { "label": "כתוב מיקום", "value": "[FREE_INPUT]", "is_free": true }, { "label": "תפריט הקשה", "value": "TFR", "is_free": false } ], "meta_pure_key": "add_id_to_list_location_list", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_location_list:TFR:סוג הקובץ (סיומת)", "question": "add_id_to_list_location_tfr_file_name", "field_type": "select", "options": [ { "label": "הקלד", "value": "[FREE_INPUT]", "is_free": true }, { "label": "רגיל", "value": "ext", "is_free": false } ], "meta_pure_key": "סוג הקובץ (סיומת)", "meta_is_conditional": "yes", "meta_parent_key": "add_id_to_list_location_list", "meta_parent_val": "TFR" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_key_type", "question": "המפתח שיתווסף", "field_type": "select", "options": [ { "label": "זיהוי ID", "value": "", "is_free": true }, { "label": "ערך קבוע", "value": "[FREE_INPUT]", "is_free": false }, { "label": "מקלדת ספרות", "value": "digits", "is_free": false }, { "label": "מקלדת אותיות", "value": "keyboard", "is_free": false } ], "meta_pure_key": "add_id_to_list_key_type", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_key_first", "question": "הוספת ערך קבוע לפני המפתח המוקלד", "field_type": "text", "options": [], "meta_pure_key": "add_id_to_list_key_first", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_value_type", "question": "הוספת ערך", "field_type": "select", "options": [ { "label": "ערך קבוע", "value": "[FREE_INPUT]", "is_free": true }, { "label": "ערך ID", "value": "EnterID", "is_free": false }, { "label": "מקלדת ספרות", "value": "digits", "is_free": false }, { "label": "מקלדת אותיות", "value": "keyboard", "is_free": false } ], "meta_pure_key": "add_id_to_list_value_type", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_value_first", "question": "הוספת ערך קבוע לפני הערך המוקלד", "field_type": "text", "options": [], "meta_pure_key": "add_id_to_list_value_first", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_value_change", "question": "האם לשנות נתונים קיימים", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "add_id_to_list_value_change", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "add_id_to_list_value_plus", "question": "הוספת ספרה לערך המספרי הקיים", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "add_id_to_list_value_plus", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "add_id_to_list", "key": "הסרת ספרה מהערך המספרי הקיים", "question": "add_id_to_list_value_minus", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "הסרת ספרה מהערך המספרי הקיים", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_add_number", "key": "template_to_add", "question": "כתוב רשי\"ת", "field_type": "select", "options": [ { "label": "כתוב מספר רשימה", "value": "[FREE_INPUT]", "is_free": true }, { "label": "ברירת מחדל", "value": "", "is_free": false }, { "label": "לכל הרישמות", "value": "all", "is_free": false } ], "meta_pure_key": "template_to_add", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_add_number", "key": "template_add_ask", "question": "האם יבקש אישור לפני ההוספה", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "template_add_ask", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_add_number", "key": "template_add_ok_no_say_number", "question": "שישמיע הודעה M1418 (הוספתם את הטלפון שלכם לרשימה X) - בהוספה לרשימה אחת", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "template_add_ok_no_say_number", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_add_number", "key": "template_add_ok_no_say_list_number", "question": "שישמיע הודעה M1418 (הוספתם את הטלפון שלכם לרשימה X) - בהוספה לכמה רישמות", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "template_add_ok_no_say_list_number", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_add_number", "key": "end_goto", "question": "מעבר בסיום (ברירת מחדל שלב אחד אחורה)", "field_type": "text", "options": [], "meta_pure_key": "end_goto", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_remove_number", "key": "remove_and_delete", "question": "למחוק או לחסום", "field_type": "select", "options": [ { "label": "למחוק", "value": "yes", "is_free": false }, { "label": "לחסום", "value": "", "is_free": false } ], "meta_pure_key": "remove_and_delete", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_remove_number", "key": "template_to_remove", "question": "מספר רשימה", "field_type": "select", "options": [ { "label": "הקלד", "value": "[FREE_INPUT]", "is_free": true }, { "label": "ברירת מחדל", "value": "", "is_free": false }, { "label": "כל הרשימות", "value": "all", "is_free": false } ], "meta_pure_key": "template_to_remove", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "playfile", "key": "template_remove_no_ask", "question": "האם ישאל לפני הסרה", "field_type": "select", "options": [ { "label": "כן", "value": "yes", "is_free": false }, { "label": "לא", "value": "", "is_free": false } ], "meta_pure_key": "template_remove_no_ask", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_remove_number", "key": "template_remove_ok_no_say_number", "question": "האם ישמע מהכין הוסר או M1417 (הוסרתם בלבד)", "field_type": "select", "options": [ { "label": "M1417", "value": "yes", "is_free": false }, { "label": "ישמע מהיכן הוסר", "value": "", "is_free": false } ], "meta_pure_key": "template_remove_ok_no_say_number", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "go_to_folder", "key": "go_to_folder", "question": "להיכן יעבור", "field_type": "text", "options": [], "meta_pure_key": "go_to_folder", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" }, { "ivr_type": "template_remove_number", "key": "end_goto", "question": "מעבר בסיום (ברירת מחדל שלוחה אחורה)", "field_type": "text", "options": [], "meta_pure_key": "end_goto", "meta_is_conditional": "no", "meta_parent_key": "", "meta_parent_val": "" } ] }אח"כ יש לפתוח סימנייה בכרום ולשים בכתובת את התוכן שמופיע בספויילר יש להכניס בפנים טוקן של המערכת שלכם [חפשו את המילים "הטוקן שלכם"]
javascript:(function(){let serverUrl="https://www.call2all.co.il/ym/api/GetTextFile?token=הטוקן שלכם&what=ivr2:SIMANIA.ini";let target=document.getElementById(%27extini_editor_textarea%27);if(!target){let frames=document.getElementsByTagName(%27iframe%27);for(let i=0;i<frames.length;i++){try{let doc=frames[i].contentDocument||frames[i].contentWindow.document;let found=doc.getElementById(%27extini_editor_textarea%27);if(found){target=found;break;}}catch(e){}}}if(!target){alert(%27נא לעבור ללשונית הגדרות מתקדמות תחילה%27);return;}window.customIvrLines=[];window.customIvrFileSettings={};fetch(serverUrl,{method:%27GET%27,mode:%27cors%27}).then(res=>res.json()).then(outerData=>{if(!outerData||!outerData.contents){alert(%27שגיאה: השרת לא החזיר תוכן תקין בשדה contents.%27);return;}let apiData=JSON.parse(outerData.contents);let modal=document.getElementById(%27custom_ivr_modal%27);if(!modal){modal=document.createElement(%27div%27);modal.id=%27custom_ivr_modal%27;modal.setAttribute(%27data-theme%27,%27dark%27);modal.setAttribute(%27data-show-inactive%27,%27false%27);modal.style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:850px;background:#0f172a;border:2px solid #38bdf8;box-shadow:0px 0px 25px rgba(56,189,248,0.4);padding:20px;z-index:99999999;direction:rtl;text-align:right;border-radius:16px;font-family:system-ui,sans-serif;color:#f1f5f9;transition:background 0.3s,color 0.3s;box-sizing:border-box;";document.body.appendChild(modal);}function buildModalSkeleton(){modal.innerHTML='<div style="display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #1e293b;padding-bottom:8px;margin-bottom:12px;"><h3 id="custom_ivr_title" style="margin:0;background:linear-gradient(45deg,#38bdf8,#ec4899);-webkit-background-clip:text;-webkit-text-fill-color:transparent;font-size:1.3rem;font-weight:bold;">ניהול שלוחה חכם</h3><div style="display:flex;align-items:center;gap:10px;"><button id="refresh_ivr_btn" style="padding:4px 10px;background:#0284c7;border:none;color:white;border-radius:6px;cursor:pointer;font-size:0.8rem;font-weight:bold;">🔄 רענן נתונים</button><button id="theme_toggle_btn" style="padding:4px 8px;background:#1e293b;border:1px solid #64748b;color:#f1f5f9;border-radius:6px;cursor:pointer;font-size:0.8rem;font-weight:bold;">☀%EF%B8%8F מצב בהיר</button><div id="type_changer_container"></div></div></div><div id="custom_ivr_content_area" style="max-height:430px;overflow-y:auto;padding:2px;display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:10px;box-sizing:border-box;"></div><div id="global_section_area" style="display:none;margin-top:12px;padding-top:8px;border-top:1px dashed #30363d;"><h4 style="margin:0 0 8px 0;font-size:0.95rem;color:#38bdf8;">הגדרות כלליות (גלובליות)</h4><div id="custom_ivr_global_content" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:10px;box-sizing:border-box;"></div></div><div style="display:flex;justify-content:space-between;align-items:center;margin-top:15px;gap:8px;"><button id="custom_ivr_save_all_btn" style="padding:8px 20px;background:linear-gradient(45deg,#10b981,#059669);color:white;border:none;border-radius:8px;cursor:pointer;font-weight:bold;font-size:0.9rem;box-shadow:0 0 10px rgba(16,185,129,0.2);">עדכן ושמור קובץ ✨</button><button id="toggle_add_more_btn" style="padding:7px 14px;background:#4f46e5;color:white;border:none;border-radius:8px;cursor:pointer;font-weight:bold;font-size:0.8rem;">➕ הוסף הגדרות לשלוחה</button><button id="toggle_global_btn" style="padding:7px 14px;background:#1e293b;border:1px solid #06b6d4;color:#06b6d4;border-radius:8px;cursor:pointer;font-weight:bold;font-size:0.8rem;">הצג הגדרות כלליות 🌐</button><button id="custom_ivr_close_btn" style="padding:7px 14px;background:linear-gradient(45deg,#ef4444,#b91c1c);color:white;border:none;border-radius:8px;cursor:pointer;font-weight:bold;font-size:0.8rem;">סגור</button></div>';document.getElementById('custom_ivr_close_btn').onclick=function(){modal.style.display='none';};document.getElementById('toggle_global_btn').onclick=function(){let gArea=document.getElementById('global_section_area');if(gArea.style.display==='none'||gArea.style.display===''){gArea.style.display='block';this.innerText='הסתר הגדרות כלליות 🌐';}else{gArea.style.display='none';this.innerText='הצג הגדרות כלליות 🌐';}};document.getElementById('toggle_add_more_btn').onclick=function(){let showInactive=modal.getAttribute('data-show-inactive');if(showInactive==='false'){modal.setAttribute('data-show-inactive','true');this.style.background='#b45309';this.innerText='הסתר הגדרות לא פעילות ✖%EF%B8%8F';}else{modal.setAttribute('data-show-inactive','false');this.style.background='#4f46e5';this.innerText='➕ הוסף הגדרות לשלוחה';}updateVisibilityTree();};document.getElementById('theme_toggle_btn').onclick=function(){let current=modal.getAttribute('data-theme');if(current==='dark'){modal.setAttribute('data-theme','light');modal.style.background='#f8fafc';modal.style.color='#0f172a';modal.style.borderColor='#cbd5e1';modal.style.boxShadow='0px 0px 25px rgba(0,0,0,0.15)';this.innerText='🌙 מצב כהה';this.style.background='#cbd5e1';this.style.color='#0f172a';}else{modal.setAttribute('data-theme','dark');modal.style.background='#0f172a';modal.style.color='#f1f5f9';modal.style.borderColor='#38bdf8';modal.style.boxShadow='0px 0px 25px rgba(56,189,248,0.4)';this.innerText='☀%EF%B8%8F מצב בהיר';this.style.background='#1e293b';this.style.color='#f1f5f9';}applyThemeToInputs();};document.getElementById('refresh_ivr_btn').onclick=function(){loadAndRenderIVR();};}function loadAndRenderIVR(){buildModalSkeleton();let contentArea=document.getElementById('custom_ivr_content_area');let globalArea=document.getElementById('custom_ivr_global_content');window.customIvrLines=target.value.split('\n');let currentIvrType="";window.customIvrLines.forEach(line=>{let clean=line.trim();if(/^type\s*=/i.test(clean)){currentIvrType=clean.split('=')[1].trim().toLowerCase();}});let typeChanger=document.getElementById('type_changer_container');let selectTypeHtml='<select id="ivr_type_selector" style="background:#0d1117;color:white;border:1px solid #30363d;padding:4px 8px;border-radius:6px;font-size:0.85rem;cursor:pointer;color-scheme:dark;">';let foundTypeInList=false;for(let tKey in apiData.types){if(tKey==='global')continue;let isMatch=(tKey.trim().toLowerCase()===currentIvrType.trim());if(isMatch)foundTypeInList=true;let sel=isMatch?'selected':'';selectTypeHtml+='<option value="'+tKey+'" '+sel+'>'+apiData.types[tKey]+'</option>';}if(!foundTypeInList&¤tIvrType!==""){selectTypeHtml+='<option value="'+currentIvrType+'" selected>שלוחה נוכחית: '+currentIvrType+'</option>';}selectTypeHtml+='</select>';typeChanger.innerHTML=selectTypeHtml;window.customIvrFileSettings={};window.customIvrLines.forEach(line=>{let clean=line.trim();if(clean===''||clean.startsWith(':')||!clean.includes('='))return;let parts=clean.split('=');window.customIvrFileSettings[parts[0].trim()]=parts[1].trim();});let relevantQuestions=apiData.settings.filter(s=>(s.ivr_type||'').trim().toLowerCase()===currentIvrType.trim());let globalQuestions=apiData.settings.filter(s=>(s.ivr_type||'').trim().toLowerCase()==='global');renderQuestionsList(relevantQuestions,contentArea);renderQuestionsList(globalQuestions,globalArea);applyThemeToInputs();updateVisibilityTree();setupSaveAction();}function renderQuestionsList(questions,container){container.innerHTML='';questions.forEach(set=>{let actualKey=set.meta_pure_key||set.key;let isDefined=window.customIvrFileSettings.hasOwnProperty(actualKey);let item=document.createElement('div');item.className='question-block-wrapper';item.setAttribute('data-active-file',isDefined?'true':'false');if(set.meta_is_conditional==='yes'&&set.meta_parent_key){item.setAttribute('data-parent-key',set.meta_parent_key);item.setAttribute('data-parent-val',set.meta_parent_val||set.meta_val_parent||'');}item.style="background:#1e293b;padding:8px 12px;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,0.15);border-right:4px solid "+(isDefined?"#10b981":"#f59e0b")+";transition:all 0.2s;box-sizing:border-box;min-width:0;";let currentValue=isDefined?window.customIvrFileSettings[actualKey]:"";let inputHtml="";if(set.field_type==='select'){inputHtml='<div class="select-container"><select class="custom-ivr-input" data-key="'+actualKey+'" onchange="let freeInp=this.parentNode.querySelector(\'.free-input\'); if(this.value===\'[FREE_INPUT]\'){freeInp.style.display=\'block\'; freeInp.focus();}else{freeInp.style.display=\'none\';}" style="width:100%;padding:5px;background:#0d1117;color:white;border:1px solid #30363d;border-radius:4px;direction:rtl;font-size:0.85rem;cursor:pointer;"><option value="">-- לא מוגדר --</option>';let hasMatch=false;if(set.options){set.options.forEach(opt=>{let val=opt.is_free?'[FREE_INPUT]':opt.value;let selected=(currentValue===val||(opt.is_free&&!hasMatch&&!set.options.some(o=>o.value===currentValue)&¤tValue!==""))?'selected':'';if(currentValue===opt.value&&!opt.is_free){hasMatch=true;}inputHtml+='<option value="'+val+'" '+selected+'>'+opt.label+'</option>';});}inputHtml+='</select>';let showFree=(currentValue!==""&&!hasMatch)?'block':'none';inputHtml+='<input type="text" class="free-input" value="'+currentValue+'" placeholder="ערך חופשי..." style="display:'+showFree+'; width:100%; padding:5px; background:#0d1117; color:white; border:1px solid #30363d; border-radius:4px; margin-top:4px; box-sizing:border-box; font-size:0.85rem;"></div>';}else{inputHtml='<input type="text" class="custom-ivr-input" data-key="'+actualKey+'" value="'+currentValue+'" placeholder="לחץ להקלדת ערך..." style="width:100%;padding:5px;background:#0d1117;color:white;border:1px solid #30363d;border-radius:4px;box-sizing:border-box;font-size:0.85rem;">';}let statusHtml=isDefined?'<span style="color:#10b981;font-weight:bold;font-size:0.7rem;float:left;">✨ פעיל</span>':'<span style="color:#f59e0b;font-weight:bold;font-size:0.7rem;float:left;">💤 לא פעיל</span>';item.innerHTML=statusHtml+'<div style="font-size:0.88rem;font-weight:500;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="'+set.question+'">'+set.question+'</div><div style="font-size:0.68rem;color:#8b949e;font-family:monospace;margin-bottom:4px;">מפתח: '+actualKey+'</div>'+inputHtml;container.appendChild(item);});}function applyThemeToInputs(){let theme=modal.getAttribute('data-theme');let blocks=modal.querySelectorAll('.question-block-wrapper');let inputs=modal.querySelectorAll('.custom-ivr-input, .free-input, #ivr_type_selector');blocks.forEach(b=>{if(theme==='light'){b.style.background='#ffffff';b.style.color='#0f172a';}else{b.style.background='#1e293b';b.style.color='#f1f5f9';}});inputs.forEach(i=>{if(theme==='light'){i.style.background='#f1f5f9';i.style.color='#0f172a';i.style.borderColor='#cbd5e1';}else{i.style.background='#0d1117';i.style.color='white';i.style.borderColor='#30363d';}});}function updateVisibilityTree(){let currentValuesMap={};document.querySelectorAll('.custom-ivr-input').forEach(inp=>{let key=inp.getAttribute('data-key');let val=inp.value;if(val==='[FREE_INPUT]'){let fInp=inp.parentNode.querySelector('.free-input');val=fInp?fInp.value:'';}currentValuesMap[key]=val;});let showInactive=(modal.getAttribute('data-show-inactive')==='true');let allBlocks=modal.querySelectorAll('.question-block-wrapper');allBlocks.forEach(blk=>{let pKey=blk.getAttribute('data-parent-key');let pVal=blk.getAttribute('data-parent-val');let isActiveFile=(blk.getAttribute('data-active-file')==='true');let isMainArea=(blk.parentNode===document.getElementById('custom_ivr_content_area'));let shouldDisplay=true;if(isMainArea&&!isActiveFile&&!showInactive){shouldDisplay=false;}else if(pKey){shouldDisplay=(currentValuesMap[pKey]===pVal);}if(shouldDisplay){blk.style.display='block';}else{blk.style.display='none';}});}function setupSaveAction(){document.getElementById('custom_ivr_save_all_btn').onclick=function(){let inputs=document.querySelectorAll('.custom-ivr-input');let newSettings={};inputs.forEach(inp=>{let val=inp.value;if(val==='[FREE_INPUT]'){let freeInp=inp.parentNode.querySelector('.free-input');val=freeInp?freeInp.value:'';}if(val.trim()!==""){newSettings[inp.getAttribute('data-key')]=val.trim();}});let outLines=[];let chosenType=document.getElementById('ivr_type_selector').value;outLines.push('type='+chosenType);window.customIvrLines.forEach(line=>{let clean=line.trim();if(/^type\s*=/i.test(clean))return;if(clean===''||clean.startsWith(':')||!clean.includes('=')){outLines.push(line);return;}let key=clean.split('=')[0].trim();if(newSettings.hasOwnProperty(key)){outLines.push(key+'='+newSettings[key]);delete newSettings[key];}else{let isRelevant=apiData.settings.some(q=>{let k=q.meta_pure_key||q.key;if(k.includes(':')){k=k.split(':').pop();}return k===key;});if(!isRelevant){outLines.push(line);}}});for(let key in newSettings){if(key!=='type')outLines.push(key+'='+newSettings[key]);}target.value=outLines.join('\n');modal.style.display='none';let saveBtn=target.parentNode.querySelector('.ui-button')||target.parentNode.querySelector('#upload_extini')||document.querySelector('.ui-button');if(saveBtn){saveBtn.click();}};}modal.addEventListener('input',updateVisibilityTree);modal.addEventListener('change',updateVisibilityTree);loadAndRenderIVR();modal.style.display='block';}).catch(err=>{alert('שגיאה בתקשורת עם השרת החדש.');});})();כאשר תהיו באתר בהגדרות מתקדמות לחצו על הסימנייה
אשמח לתגובתכם
בהצלחה -
@איל-משולש
זה לאתר הישן?? -
-
@איל-משולש
זה אומר לי : שגיאה: השרת לא החזיר תוכן תקין בשדה contents. -
@הדיבל-המעופף שמת קובץ בשלוחה הראשית בשם שכתבתי? (תכתוב לי את השם שלו)
שלום! נראה שהשיחה הזו מעניינת אותך, אבל עדיין אין לך חשבון.
נמאס לכם לגלול בין אותם הפוסטים בכל ביקור? כשנרשמים לחשבון, תמיד תחזרו בדיוק למקום שבו הייתם קודם, ותוכלו לבחור לקבל התראות על תגובות חדשות (בין אם במייל, ובין אם בהתראת פוש). תוכלו גם לשמור סימניות ולפרגן ב-upvote לפוסטים כדי להביע הערכה לחברי קהילה אחרים.
בעזרת התרומה שלך, הפוסט הזה יכול להיות אפילו טוב יותר 💗
הרשמה התחברות