PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.2.21
MxChat – AI Chatbot & Content Generation for WordPress v3.2.21
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
mxchat-basic / js / embedding-check.js

embedding-check.js in MxChat – AI Chatbot & Content Generation for WordPress 3.2.21, at js/embedding-check.js

47 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 document.addEventListener('DOMContentLoaded', function() {
2 var urlParams = new URLSearchParams(window.location.search);
3 if (urlParams.has('embedding_failed')) {
4 alert('Failed to generate embedding for the content. Please try submitting again.');
5 }
6
7 // Sitemap Form Loader
8 var sitemapForm = document.getElementById('mxchat-sitemap-form');
9
10 if (sitemapForm) {
11 var loadingSpinner = document.getElementById('mxchat-sitemap-loading');
12 var loadingText = document.getElementById('mxchat-loading-text');
13 var sitemapUrlField = document.getElementById('sitemap_url');
14 var submitButton = sitemapForm.querySelector('input[type="submit"]');
15
16 sitemapForm.addEventListener('submit', function() {
17 sitemapUrlField.style.display = 'none';
18 submitButton.style.display = 'none';
19
20 loadingSpinner.style.display = 'flex';
21 loadingText.style.display = 'block';
22 });
23 }
24
25 // Submit Content Form Loader
26 var contentForm = document.getElementById('mxchat-content-form');
27
28 if (contentForm) {
29 var contentLoadingSpinner = document.getElementById('mxchat-content-loading');
30 var contentLoadingText = document.getElementById('mxchat-content-loading-text');
31 var articleContentField = document.getElementById('article_content');
32 var articleUrlField = document.getElementById('article_url');
33 var contentSubmitButton = contentForm.querySelector('input[type="submit"]');
34
35 contentForm.addEventListener('submit', function() {
36 // Hide form fields
37 articleContentField.style.display = 'none';
38 articleUrlField.style.display = 'none';
39 contentSubmitButton.style.display = 'none';
40
41 // Show loading spinner and text
42 contentLoadingSpinner.style.display = 'flex';
43 contentLoadingText.style.display = 'block';
44 });
45 }
46 });
47