Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.217.137
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/wp-content/plugins/popup-builder/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/popup-builder/public/js/Newsletter.js
function SGPBNewsletter()
{
	this.init();
}

SGPBNewsletter.prototype.getTinymceContent = function()
{
	if (jQuery('.wp-editor-wrap').hasClass('tmce-active')) {
		return tinyMCE.activeEditor.getContent();
	}

	return jQuery('#sgpb-newsletter-text').val();
};

SGPBNewsletter.prototype.init = function ()
{
	var sendButton = jQuery('.js-send-newsletter');

	if (!sendButton.length) {
		return false;
	}
	var that = this;

	sendButton.bind('click', function(e) {
		e.preventDefault();
		var validationStatus = true;
		var fromEmail = jQuery('.sgpb-newsletter-from-email').val();
		var subscriptionFormId = jQuery('.js-sg-newsletter-forms option:selected').val();
		subscriptionFormId = parseInt(subscriptionFormId);
		var validateEmail =  fromEmail.search(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,10})+$/);

		if (isNaN(subscriptionFormId)) {
			jQuery('.sgpb-newsletter-popup-error').removeClass('sg-hide-element');
			validationStatus = false;
		}

		/*When the sent email isn't valid or the user hasn't selected any subscription form.*/
		if (validateEmail == -1 ) {
			validationStatus = false;
			jQuery('.sgpb-newsletter-from-email-error').removeClass('sg-hide-element');
			return false;
		}

		if (!validationStatus) {
			return false;
		}
		jQuery('.sgpb-newsletter-validation').addClass('sg-hide-element');

		var emailsInFlow = jQuery('.sgpb-emails-in-flow').val();
			emailsInFlow = parseInt(emailsInFlow);
		var newsletterSubject = jQuery('.sgpb-newsletter-subject').val();
		var messageBody = that.getTinymceContent();

		var data = {
			nonce: SGPB_JS_PARAMS.nonce,
			action: 'sgpb_send_newsletter',
			newsletterData: {
				subscriptionFormId: subscriptionFormId,
				beforeSend: function() {
					jQuery('.sgpb-js-newsletter-spinner').removeClass('sgpb-hide');
					jQuery('.sgpb-newsletter-notice').addClass('sgpb-hide');
				},
				fromEmail: fromEmail,
				emailsInFlow: emailsInFlow,
				newsletterSubject: newsletterSubject,
				messageBody: messageBody
			}
		};

		jQuery.post(ajaxurl, data, function() {
			jQuery('.sgpb-newsletter-notice').removeClass('sgpb-hide');
			jQuery('.sgpb-js-newsletter-spinner').addClass('sgpb-hide');
		});
	});
};

jQuery(document).ready(function () {
   new SGPBNewsletter();
});

Youez - 2016 - github.com/yon3zu
LinuXploit