window.languageEvents = { 'click .edit_btn': function (e, value, row) { $('.filepond').filepond('removeFile'); $("#edit_name").val(row.name); $("#edit_name_in_english").val(row.name_in_english); $("#edit_code").val(row.code); $("#edit_country_code").val(row.country_code); $("#edit_rtl_switch").prop('checked', row.rtl); $("#edit_rtl").val(row.rtl ? 1 : 0); // ✅ Update download links dynamically $("#download_panel_file").attr("href", "/language/" + row.id + "/download/panel"); $("#download_app_file").attr("href", "/language/" + row.id + "/download/app"); $("#download_web_file").attr("href", "/language/" + row.id + "/download/web"); }, 'click .delete_btn': function (e, value, row) { e.preventDefault(); showDeleteLanguagePopupModal($(this).attr('href'), { successCallBack: function () { $('#table_list').bootstrapTable('refresh'); } }); } }; // window.SeoSettingEvents = { // 'click .edit_btn': function (e, value, row) { // $('.filepond').filepond('removeFile') // $("#edit_page").val(row.page); // $("#edit_title").val(row.title); // $("#edit_description").val(row.description); // $("#edit_keywords").val(row.keywords); // } // }; window.SeoSettingEvents = { 'click .edit_btn': function (e, value, row) { $("#edit_page").val(row.page); $('.filepond').filepond('removeFile'); if (row.image) { $('.filepond').filepond('addFile', row.image); } $("#edit_title_1").val(row.title ?? ''); $("#edit_description_1").val(row.description ?? ''); $("#edit_keywords_1").val(row.keywords ?? ''); let translations = row.translations ?? []; translations.forEach(function (translation) { const langId = translation.language_id; $("#edit_title_" + langId).val(translation.title); $("#edit_description_" + langId).val(translation.description); $("#edit_keywords_" + langId).val(translation.keywords); }); } }; window.customFieldValueEvents = { 'click .edit_btn': function (e, value, row) { $("#new_custom_field_value").val(row.value); $("#old_custom_field_value").val(row.value); } } window.verificationFieldValueEvents = { 'click .edit_btn': function (e, value, row) { $("#new_verification_field_value").val(row.value); $("#old_verification_field_value").val(row.value); } } window.itemEvents = { 'click .editdata': function (e, value, row) { let html = `
| ${trans("No.")} | ${trans("Image")} | ${trans("Name")} | ${trans("Value")} | |||
|---|---|---|---|---|---|---|
| ${key + 1} |
|
${value.name} | `; if (value.type == "fileinput") { if (value.value != undefined) { if (value.value?.value.match(/\.(jpg|jpeg|png|svg)$/i)) { html += `View File | ` } } else { html += `` } } else { html += ` | ${value.value?.value || ''} | ` } html += `