| @@ -3,44 +3,23 @@ | ||
| 3 | 3 | if (urlParams.has('embedding_failed')) { |
| 4 | 4 | alert('Failed to generate embedding for the content. Please try submitting again.'); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | - // Sitemap Form Loader | |
| 8 | 7 | 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"]'); | |
| 8 | + var loadingSpinner = document.getElementById('mxchat-sitemap-loading'); | |
| 9 | + var loadingText = document.getElementById('mxchat-loading-text'); | |
| 10 | + var sitemapUrlField = document.getElementById('sitemap_url'); | |
| 11 | + var submitButton = sitemapForm.querySelector('input[type="submit"]'); | |
| 15 | 12 | |
| 16 | - sitemapForm.addEventListener('submit', function() { | |
| 17 | - sitemapUrlField.style.display = 'none'; | |
| 18 | - submitButton.style.display = 'none'; | |
| 13 | + sitemapForm.addEventListener('submit', function() { | |
| 14 | + // Hide the form fields | |
| 15 | + sitemapUrlField.style.display = 'none'; | |
| 16 | + submitButton.style.display = 'none'; | |
| 19 | 17 | |
| 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'); | |
| 18 | + // Show the loading spinner and text | |
| 19 | + loadingSpinner.style.display = 'flex'; | |
| 20 | + loadingText.style.display = 'block'; | |
| 21 | + }); | |
| 27 | 22 | |
| 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 | - } | |
| 23 | + | |
| 24 | + | |
| 46 | 25 | }); |