| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | jQuery(function ($) { |
| 2 | 2 | |
| 3 | 3 | $(document).ready(function () { |
| 4 | 4 | var wpChatbotTabSections = { |
| @@ -13,21 +13,21 @@ | ||
| 13 | 13 | rpl: '#section-flip-9', |
| 14 | 14 | custom_css: '#section-flip-13' |
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | - function wpChatbotShowTabSection(tabData, fallbackIndex, sectionSelector) { | |
| 18 | - $(".content-wrap section").removeClass('content-current'); | |
| 19 | - | |
| 20 | - if (sectionSelector) { | |
| 21 | - $(sectionSelector).addClass('content-current'); | |
| 22 | - return; | |
| 23 | - } | |
| 24 | - | |
| 25 | - if (wpChatbotTabSections[tabData]) { | |
| 26 | - $(wpChatbotTabSections[tabData]).addClass('content-current'); | |
| 27 | - return; | |
| 28 | - } | |
| 17 | + function wpChatbotShowTabSection(tabData, fallbackIndex, sectionSelector) { | |
| 18 | + $(".content-wrap section").removeClass('content-current'); | |
| 29 | 19 | |
| 20 | + if (sectionSelector) { | |
| 21 | + $(sectionSelector).addClass('content-current'); | |
| 22 | + return; | |
| 23 | + } | |
| 24 | + | |
| 25 | + if (wpChatbotTabSections[tabData]) { | |
| 26 | + $(wpChatbotTabSections[tabData]).addClass('content-current'); | |
| 27 | + return; | |
| 28 | + } | |
| 29 | + | |
| 30 | 30 | $(".content-wrap section").eq(fallbackIndex).addClass('content-current'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | var sbdstoredNoticeId = localStorage.getItem('qcld_wpbot_Notice_set'); |
| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | if(localStorage.getItem('tabData')==$(this).attr('tab-data')){ |
| 61 | 61 | |
| 62 | 62 | $(this).addClass('tab-current'); |
| 63 | 63 | |
| 64 | - wpChatbotShowTabSection($(this).attr('tab-data'), index, $(this).attr('data-section')); | |
| 64 | + wpChatbotShowTabSection($(this).attr('tab-data'), index, $(this).attr('data-section')); | |
| 65 | 65 | |
| 66 | 66 | }else{ |
| 67 | 67 | |
| 68 | 68 | $(this).removeClass('tab-current'); |
| @@ -88,9 +88,9 @@ | ||
| 88 | 88 | // add current tab and contents |
| 89 | 89 | |
| 90 | 90 | $(this).parent().addClass('tab-current'); |
| 91 | 91 | |
| 92 | - wpChatbotShowTabSection($(this).parent().attr('tab-data'), $(".wp-chatbot-tabs nav ul li a ").index(this), $(this).parent().attr('data-section')); | |
| 92 | + wpChatbotShowTabSection($(this).parent().attr('tab-data'), $(".wp-chatbot-tabs nav ul li a ").index(this), $(this).parent().attr('data-section')); | |
| 93 | 93 | |
| 94 | 94 | //Change action url , set add localStorge and url change. |
| 95 | 95 | |
| 96 | 96 | $('#wp-chatbot-admin-form').attr('action',$(this).attr('href')); |
| @@ -1091,9 +1091,9 @@ | ||
| 1091 | 1091 | drop: function(event, ui) { |
| 1092 | 1092 | var droppable = $(this); |
| 1093 | 1093 | var draggable = ui.draggable; |
| 1094 | 1094 | // Move draggable into droppable |
| 1095 | - draggable.clone().removeClass("qc_draggable_item").addClass("qc_draggable_item_remove").appendTo(droppable); | |
| 1095 | + draggable.clone().removeClass("qc_draggable_item").addClass("qc_draggable_item_remove").removeAttr("style").appendTo(droppable); | |
| 1096 | 1096 | jQuery('#qc_wpbot_menu_order').val(jQuery('#qc_menu_area').html().trim()); |
| 1097 | 1097 | } |
| 1098 | 1098 | }); |
| 1099 | 1099 | $('#wp_chatbot_floatingiconbg_color, #wp_chatbot_text_color, #wp_chatbot_link_color,#wp_chatbot_link_hover_color,#wp_chatbot_bot_msg_bg_color,#wp_chatbot_bot_msg_text_color,#wp_chatbot_user_msg_bg_color,#wp_chatbot_header_background_color,#wp_chatbot_user_msg_text_color,#wp_chatbot_buttons_bg_color,#wp_chatbot_buttons_text_color,#wp_chatbot_theme_primary_color,#wp_chatbot_theme_secondary_color').wpColorPicker(); |
| @@ -1534,13 +1534,17 @@ | ||
| 1534 | 1534 | }) //Additional Code - 04-12-2023 ends here |
| 1535 | 1535 | } |
| 1536 | 1536 | var settingsRag = document.getElementById("save_rag_setting"); |
| 1537 | 1537 | if (settingsRag) { |
| 1538 | + $('.qcl-openai').on('change', '.rag_auto_sync_enabled', function () { | |
| 1539 | + $('.rag_auto_sync_enabled').prop('checked', this.checked); | |
| 1540 | + }); | |
| 1541 | + | |
| 1538 | 1542 | $('.qcl-openai').on('click', '#save_rag_setting', function () { |
| 1539 | 1543 | |
| 1540 | 1544 | var rag_embed_pages = $('#rag_embed_pages').is(':checked') ? 1 : 0; |
| 1541 | 1545 | var rag_embed_posts = $('#rag_embed_posts').is(':checked') ? 1 : 0; |
| 1542 | - var rag_auto_sync_enabled = $('#rag_auto_sync_enabled').is(':checked') ? 1 : 0; | |
| 1546 | + var rag_auto_sync_enabled = $('.rag_auto_sync_enabled').first().is(':checked') ? 1 : 0; | |
| 1543 | 1547 | var rag_embed_str = $('#rag_embed_str').is(':checked') ? 1 : 0; |
| 1544 | 1548 | |
| 1545 | 1549 | var rag_embed_cpts = []; |
| 1546 | 1550 | $('.rag_embed_cpts_checkbox:checked').each(function() { |
| @@ -1596,9 +1600,9 @@ | ||
| 1596 | 1600 | btn.text('Saving settings...'); |
| 1597 | 1601 | |
| 1598 | 1602 | var rag_embed_pages = $('#rag_embed_pages').is(':checked') ? 1 : 0; |
| 1599 | 1603 | var rag_embed_posts = $('#rag_embed_posts').is(':checked') ? 1 : 0; |
| 1600 | - var rag_auto_sync_enabled = $('#rag_auto_sync_enabled').is(':checked') ? 1 : 0; | |
| 1604 | + var rag_auto_sync_enabled = $('.rag_auto_sync_enabled').first().is(':checked') ? 1 : 0; | |
| 1601 | 1605 | var rag_embed_str = $('#rag_embed_str').is(':checked') ? 1 : 0; |
| 1602 | 1606 | |
| 1603 | 1607 | var rag_embed_cpts = []; |
| 1604 | 1608 | $('.rag_embed_cpts_checkbox:checked').each(function() { |