403Webshell
Server IP : 104.21.93.192  /  Your IP : 216.73.216.84
Web Server : LiteSpeed
System : Linux premium900.web-hosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : redwjova ( 1790)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/redwjova/fyntric.com/wp-content/plugins/bunyad-demo-import/assets/js/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/redwjova/fyntric.com/wp-content/plugins/bunyad-demo-import/assets/js/main.js
"use strict";

jQuery(function($) {
	var ajaxRun = 0;

	function ajaxCall(data) {
		
		ajaxRun++;
		
		// Been almost 15 minutes, that's enough
		if (ajaxRun > 30) {
			$('.bunyad-import .ajax-response').append('<div class="error  below-h2"><p>Could not complete the import. Please contact support.</p></div>');
			$('.bunyad-import .ajax-loader').remove();
			
			return;
		}
		
		$.ajax({
			method:     'POST',
			url:        Bunyad_Import.ajax_url,
			data:       data,
			beforeSend: function() {
				$('.bunyad-import .ajax-response').append(
					'<div class="notice ajax-loader"><p><span class="spinner"></span> Importing...</p></div>'
				);
			}
		})
		.done(function(response) {
			if ( 'undefined' !== typeof response.status && 'newAJAX' === response.status ) {
				ajaxCall(data);
			}
			else if ( 'undefined' !== typeof response.message ) {
				$('.bunyad-import .ajax-response').append( '<p>' + response.message + '</p>' );
				$('.bunyad-import .ajax-loader').remove();
			}
			else {
				$('.bunyad-import .ajax-response').append('<div class="error  below-h2"><p>' + response + '</p></div>');
				$('.bunyad-import .ajax-loader').remove();
			}

		})
		.fail(function(error) {
			$('.bunyad-import .ajax-response').append('<div class="error  below-h2"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '. You may try the process again a few times. Refresh the page, select your demo and click Import.</p></div>');
			$('.bunyad-import .ajax-loader').remove();

			// Server has possibly hit the execution time, restart
			// ajaxCall(data);
		});
	}

	function handleDependencies(depends, srcBtn) {
		if (!depends || !Object.keys(depends).length) {
			return true;
		}

		const modal = $('#bunyad-missing-plugins');
		const form  = modal.find('form');
		const required = [];
		Object.keys(depends).forEach(key => {
			const plugin = depends[key];
			required.push(`<li>${plugin}</li>`);
			form.append(`<input type="hidden" name="plugin[]" value="${key}" />`);
		});

		modal.find('.plugin-names').html(required.join(''));

		// Handle plugin activation.
		form.find('input[type=submit]').on('click', function(e) {
			$(this).attr('disabled', true);
			$(this).val('Installing...');

			e.preventDefault();
			form.submit();
		});

		// Show modal.
		modal.dialog({
			title: 'Required Plugins',
			dialogClass: 'wp-dialog',
			autoOpen: false,
			draggable: false,
			width: 'auto',
			modal: true,
			resizable: false,
			closeOnEscape: true,
			position: {
				my: "center",
				at: "center",
				of: window
			},
			open: function () {
				// Close dialog by clicking the overlay behind it
				$('.ui-widget-overlay').bind('click', function() {
					modal.dialog('close');
				})
			},
			create: function () {
				$('.ui-dialog-titlebar-close').addClass('ui-button');
			},
		});

		modal.dialog('open');

		// Close the dialog, and restart import once plugins installed.
		setTimeout(() => {
			const iframe = modal.find('iframe');
			iframe.on('load', function() {
				modal.dialog('close');
				srcBtn.data('depends', []);
				srcBtn.click();
			});
		}, 50);

		return false;
	}

	
	// Run the importer
	$('.button.import').click(function() {

		// Ensure dependencies are met.
		// .data() will parse it.
		var data = $(this).data('depends');
		if (!handleDependencies(data, $(this))) {
			return;
		}
		
		ajaxCall({
			action: 'bunyad_import_demo',
			demo_id: $(this).data('id'),
			import_type: $(this).parent().find('[name=import_type]').val(),
			security: Bunyad_Import.ajax_nonce
		});
		
		// Scroll to response area if needed
		var scrollTo = $(".bunyad-import .ajax-response").offset().top - 75
		if ($(window).scrollTop() > scrollTo) {
			$('html, body').animate({
				scrollTop: scrollTo
			}, 100);
		}
		
		// disable all
		$('.button.import').attr('disabled', true).unbind('click');
	});
	
	// Remove
	$('.bunyad-import').on('click', 'a.cleanup', function() {
		var links = ($(this).data('remove')).split(','),
			current;
		
		var recursive = function() {
			current = links.shift();
			
			if (!current) {
				return;
			}
			
			$.get(current, function() {
				recursive();
			});
		};
		
		recursive();
		
	});
	
});

Youez - 2016 - github.com/yon3zu
LinuXploit