HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/OneDrive/Desktop/wordpress/wp-content/pluginsBK/wp-to-twitter/js/ajax.js
(function ($) {
    $(function () {
        $('.wpt_log, #jts').hide();
        $('button.time').on("click", function (e) {
                e.preventDefault();
                if ($('#jts').is(":visible")) {
                    $('#jts').hide(250);
                    $('button.schedule').attr('disabled', 'disabled');
                } else {
                    $('#jts').show(250);
                    $('#wpt_date').focus();
                    $('button.schedule').removeAttr('disabled');
                }
            }
        );
        $('button.tweet').on('click', function (e) {
            e.preventDefault();
            var text = $('#jtw').val();
            var date = $('#jts .date').val();
            var time = $('#jts .time').val();
			var auth = $('#jts #wpt_authorized_users').val();
            var tweet_action = ( $(this).attr('data-action') === 'tweet' ) ? 'tweet' : 'schedule'
            var data = {
                'action': wpt_data.action,
                'tweet_post_id': wpt_data.post_ID,
                'tweet_text': text,
                'tweet_schedule': date + ' ' + time,
                'tweet_action': tweet_action,
				'tweet_auth': auth,
                'security': wpt_data.security
            };
            $.post(ajaxurl, data, function (response) {
                $('.wpt_log').text(response).show(500);
            });
        });
    });
}(jQuery));