PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.2.0
MxChat – AI Chatbot & Content Generation for WordPress v3.2.0
3.2.21 3.2.20 3.2.19 3.2.18 3.2.17 3.2.16 3.2.15 3.2.14 3.2.12 3.2.13 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 3.2.6 3.2.5 3.2.4 3.2.3 3.2.2 3.2.1 2.0.3 2.0.4 2.0.5 2.0.6 All 152 releases
← All changes | js/content-selector.js +5 -44 3.2.213.2.0 View file →
@@ -8,13 +8,11 @@
8 8 const $pagination = $('.mxchat-kb-pagination');
9 9 const $processButton = $('#mxchat-kb-process-selected');
10 10 const $selectAll = $('#mxchat-kb-select-all');
11 11 const $selectionCount = $('.mxchat-kb-selection-count');
12 - // ACF→PDF extraction is an install-level setting (Knowledge → ACF Fields);
13 - // the server reads the stored option — nothing to collect in this modal.
14 -
12 +
15 13 // Filter elements
16 - const $searchInput = $('#mxchat-kb-content-search');
14 + const $searchInput = $('#mxchat-kb-content-search');1
17 15 const $typeFilter = $('#mxchat-kb-content-type-filter');
18 16 const $statusFilter = $('#mxchat-kb-content-status-filter');
19 17 const $processedFilter = $('#mxchat-kb-processed-filter');
20 18
@@ -50,9 +48,9 @@
50 48 $('.mxchat-import-box').removeClass('active');
51 49 $box.addClass('active');
52 50
53 51 // Hide all input areas
54 - $('#mxchat-url-input-area, #mxchat-content-input-area, #mxchat-pdf-upload-area, #mxchat-document-upload-area, #mxchat-youtube-input-area').hide();
52 + $('#mxchat-url-input-area, #mxchat-content-input-area, #mxchat-pdf-upload-area').hide();
55 53
56 54 // Hide sitemap-specific sections (but NOT for sitemap option - let detection logic handle it)
57 55 if (option !== 'sitemap') {
58 56 $('#mxchat-detected-sitemaps, #mxchat-no-sitemaps, #mxchat-sitemaps-loading').hide();
@@ -107,43 +105,11 @@
107 105
108 106 // Add or update bot_id hidden field for PDF upload form
109 107 updateBotIdInForm('#mxchat-pdf-upload-form');
110 108 break;
111 -
112 - case 'document-upload':
113 - // Show document (.docx/.txt/.md) upload area
114 - $('#mxchat-document-upload-area').show();
115 -
116 - // Add or update bot_id hidden field for the document upload form
117 - updateBotIdInForm('#mxchat-document-upload-form');
118 - break;
119 -
120 - case 'youtube':
121 - // Show YouTube import area
122 - $('#mxchat-youtube-input-area').show();
123 -
124 - // Add or update bot_id hidden field for YouTube form
125 - updateBotIdInForm('#mxchat-youtube-form');
126 - break;
127 109 }
128 110 });
129 111
130 -// YouTube import: toggle the manual-description box with the mode radios, and
131 -// only require the textarea when "Write my own" is selected.
132 -$(document).on('change', 'input[name="youtube_description_mode"]', function() {
133 - const manual = $('input[name="youtube_description_mode"]:checked').val() === 'manual';
134 - $('#mxchat-youtube-description-field').toggle(manual);
135 - $('#mxchat-youtube-description').prop('required', manual);
136 -});
137 -
138 -// If the server bounced back with prefill state (auto-import found no
139 -// transcript), reopen the YouTube form in manual mode ready to augment.
140 -if ($('#mxchat-youtube-form').data('yt-prefill')) {
141 - $('.mxchat-import-box[data-option="youtube"]').trigger('click');
142 - $('input[name="youtube_description_mode"]').trigger('change');
143 - $('#mxchat-youtube-description').trigger('focus');
144 -}
145 -
146 112 // Helper function to add/update bot_id hidden field in forms
147 113 function updateBotIdInForm(formSelector) {
148 114 const $form = $(formSelector);
149 115 if ($form.length === 0) return;
@@ -568,15 +534,10 @@
568 534 title: response.data.title || ('ID: ' + postId)
569 535 });
570 536 }
571 537
572 - let successText = 'Successfully ' + (isUpdate ? 'updated' : 'processed') + ': ' + response.data.title;
573 - const pdfCount = parseInt(response.data.pdf_extracted_count, 10) || 0;
574 - if (pdfCount > 0) {
575 - const suffixTpl = (mxchatSelector.i18n && mxchatSelector.i18n.pdfExtractedSuffix) || ' (%d PDF(s) extracted)';
576 - successText += suffixTpl.replace('%d', pdfCount);
577 - }
578 - $progressModal.find('.mxchat-kb-current-item').text(successText);
538 + $progressModal.find('.mxchat-kb-current-item')
539 + .text('Successfully ' + (isUpdate ? 'updated' : 'processed') + ': ' + response.data.title);
579 540 } else {
580 541 failed++;
581 542 results.failed.push({
582 543 id: postId,