403Webshell
Server IP : 207.135.97.11  /  Your IP : 172.19.0.1
Web Server : LiteSpeed
System : Linux 6d372a2d2e33 5.14.0-611.24.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 23 11:42:43 UTC 2026 x86_64
User : nobody ( 65534)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/ed.net.au/wp-content/plugins/newsletter/composer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/ed.net.au/wp-content/plugins/newsletter/composer/composer-ai.js
jQuery(function ($) {

    jQuery('#tnpc-subject-ai-button').on('click', function (ev) {
        ev.preventDefault();
        // Composer v2 and v3
        let el = document.getElementById('options-subject');
        if (el === null) {
            return;
        }
        $subject = $(el);
        if ($subject.val().length < 20) {
            alert('Some more words are required to generate ideas for your subject');
        } else {
            jQuery('#tnpc-subject-ai-content').html('Creating...<div class="tnp-ellipsis"><div></div><div></div><div></div><div></div></div>');
            jQuery('#tnpc-subject-ai-modal').modal({
                clickClose: false,
                fadeDuration: 500
            });
            $.post(ajaxurl, {
                subject: $subject.val(),
                action: 'newsletter_ai_subjects',
                _ajax_nonce: tnp_ai_nonce
            }).done(function (response) {
                if (response.success) {
                    data = response.data;
                    let html = '';
                    for (subject of data) {
                        html += '<a href="#">' + subject + '</a><br>';
                    }
                    $('#tnpc-subject-ai-content').html(html);
                } else {
                    alert(response.data.message);
                    $.modal.close();
                }
                //$('#tnpc-subject-ai-content').html(marked.parse(data));
            }).fail(function () {
                $.modal.close();
                alert('Failed to contact the Newsletter Assistant, check to have your license set on the Newsletter main settings');
            });
        }

    });

    $('#tnpc-subject-ai-content').on('click', 'a', function (ev) {
        ev.preventDefault();
        let el = document.getElementById('options-subject');
        el.value = this.innerText;
        $.modal.close();
    });
});

var tnp_ai_generating = false;
function tnp_ai_generate(button) {
    if (tnp_ai_generating)
        return;
    tnp_ai_generating = true;
    button.innerHTML = '...';
    button.disabled = true;
    aprompt = document.getElementById('options-prompt').value;
    jQuery.post(ajaxurl, {
        prompt: aprompt,
        action: 'newsletter_composer_ai_generate',
        _ajax_nonce: tnp_ai_nonce
    }).done(function (response) {
        console.log(response);
        if (!response.success) {
            alert(response.data.message);
            $.modal.close();
        } else {
            document.getElementById('options-html').value = marked.parse(response.data.message);
            tinymce.activeEditor.load();
        }
        button.innerHTML = '<i class="far fa-smile"></i>';
        tnp_ai_generating = false;
        button.disabled = false;
    }).fail(function (response) {
        $.modal.close();
        alert('Failed');

    });
}

Youez - 2016 - github.com/yon3zu
LinuXploit