HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/www.winghung.com/wp-content/plugins/mxchat-basic/js/embedding-check.js
document.addEventListener('DOMContentLoaded', function() {
    var urlParams = new URLSearchParams(window.location.search);
    if (urlParams.has('embedding_failed')) {
        alert('Failed to generate embedding for the content. Please try submitting again.');
    }

    // Sitemap Form Loader
    var sitemapForm = document.getElementById('mxchat-sitemap-form');
    
    if (sitemapForm) {
        var loadingSpinner = document.getElementById('mxchat-sitemap-loading');
        var loadingText = document.getElementById('mxchat-loading-text');
        var sitemapUrlField = document.getElementById('sitemap_url');
        var submitButton = sitemapForm.querySelector('input[type="submit"]');

        sitemapForm.addEventListener('submit', function() {
            sitemapUrlField.style.display = 'none';
            submitButton.style.display = 'none';

            loadingSpinner.style.display = 'flex';
            loadingText.style.display = 'block';
        });
    }

    // Submit Content Form Loader
    var contentForm = document.getElementById('mxchat-content-form');
    
    if (contentForm) {
        var contentLoadingSpinner = document.getElementById('mxchat-content-loading');
        var contentLoadingText = document.getElementById('mxchat-content-loading-text');
        var articleContentField = document.getElementById('article_content');
        var articleUrlField = document.getElementById('article_url');
        var contentSubmitButton = contentForm.querySelector('input[type="submit"]');

        contentForm.addEventListener('submit', function() {
            // Hide form fields
            articleContentField.style.display = 'none';
            articleUrlField.style.display = 'none';
            contentSubmitButton.style.display = 'none';

            // Show loading spinner and text
            contentLoadingSpinner.style.display = 'flex';
            contentLoadingText.style.display = 'block';
        });
    }
});