AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 18.218.17.14   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/wp-content/mu-plugins/gd-system-plugin/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/wp-content/mu-plugins/gd-system-plugin/assets/js//themes-tab.js
/* global jQuery, gdThemesTab, ajaxurl, */

jQuery( document ).ready( function( $ ) {

	var themesTab = {

		init: function() {

			var link_markup = '<li><a href="" data-sort="gd-recommended" class="js-gd-recommended">' + gdThemesTab.tab + '</a></li>';

			$( '.wp-filter > .filter-links' ).prepend( link_markup );

			$( '.page-title-action' ).attr( 'aria-expanded', true );

		},

		shiftAddNewTheme: function() {

			var $add_new_container = $( '.add-new-theme' );

			$add_new_container.remove();

			$( '.theme-browser .themes' ).prepend( $add_new_container );

		}

	};

	var coreThemeInstaller = wp.themes.view.Installer.prototype,
	    $body              = $( 'body' );

	wp.themes.view.Installer = wp.themes.view.Installer.extend( {

		events: function() {

			var events = _.extend( {}, coreThemeInstaller.events, {
				'click .filter-links li > a.js-gd-recommended': 'gdThemes'
			} );

			delete events['click .filter-links li > a'];

			events['click .filter-links li > a:not( .js-gd-recommended )'] = 'onSort';

			return events;

		},

		browse: function( section ) {

			if ( 'gd-recommended' === section ) {

				this.loadThemes();

				return;

			}

			this.collection.query( { browse: section } );

		},


		gdThemes: function( event ) {

			event.preventDefault();

			this.clearSearch();

			var $target = $( event.target ),
			    sort    = $target.data( 'sort' );

			if ( $target.hasClass( this.activeClass ) ) {

				return;

			}

			$body.removeClass( 'filters-applied show-filters' );
			$( '.drawer-toggle' ).attr( 'aria-expanded', 'false' );
			$body.removeClass( 'show-favorites-form' );
			$( '.filter-links li > a, .theme-filter' ).removeClass( this.activeClass );
			$( '[data-sort="' + sort + '"]' ).addClass( this.activeClass );

			this.loadThemes();

			wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.browsePath + sort ) );

		},

		loadThemes: function() {

			$body.addClass( 'loading-content' ).removeClass( 'no-results' );

			$.post( ajaxurl, { action: 'gd_render_themes' }, function( response ) {

				if ( ! response.success ) {

					return;

				}

				$body.removeClass( 'loading-content' );

				$( '.theme-browser .themes' ).empty().append( response.data );

				$( '.theme-count' ).text( $( '.theme-browser .themes > div.theme' ).length );

			} );

			if ( $( '#gd-theme-install' ).length ) {

				return;

			}

			$( '.theme-browser .themes' ).after( '<div id="gd-theme-install" style="display:none;"></div>' );

		},

		/**
		 * Overrides wp.themes.view.Appearance.scroller
		 */
		scroller: function() {

			if ( $( '.js-gd-recommended' ).hasClass( 'current' ) ) {

				return;

			}

			coreThemeInstaller.scroller.apply( this, arguments );

		}

	} );

	var installTheme = {

		init: function( button ) {

			var data = {
				action: 'gd_install_theme',
				slug: button.data( 'slug' ),
				gd_package: button.data( 'package' ),
				_ajax_nonce: button.data( 'nonce' )
			};

			$.post( ajaxurl, data, function( response ) {

				if ( ! response.success ) {

					$( 'div[data-slug="' + button.data( 'slug' ) + '"]' )
						.append( '<div class="notice notice-error notice-alt update-message"><p>' + gdThemesTab.error + '</p></div>' );

					button.removeClass( 'updating-message' );

					return;

				}

				$( 'div[data-slug="' + button.data( 'slug' ) + '"]' )
					.append( '<div class="notice notice-success notice-alt"><p>' + gdThemesTab.installed + '</p></div>' )
					.removeClass( 'focus' )
					.find( '.theme-actions > .theme-install' )
					.removeClass( 'updating-message' )
					.text( gdThemesTab.installed )
					.addClass( 'disabled' )
					.delay( 1500 )
					.replaceWith(
						'<a class="button button-primary activate-theme" href="' + response.data.activateUrl + '">' + gdThemesTab.activate + '</a>' +
						'<a class="button button-secondary live-preview-theme" href="' + response.data.customizeUrl + '">' + gdThemesTab.live_preview + '</a>'
					);

			} );

		}

	};

	themesTab.init();

	$( window ).on( 'load', themesTab.shiftAddNewTheme );

	$( document ).on( 'click', '.theme.godaddy .theme-screenshot, .theme.godaddy .more-details', function() {

		var url = $( this ).closest( '.theme.godaddy' ).attr( 'data-demo-url' );

		window.open( url, '_blank' );

	} );

	$( document ).on( 'click', '.theme.godaddy .button.theme-install', function( e ) {

		e.preventDefault();
		e.stopPropagation();

		$( this ).addClass( 'updating-message' ).parents( 'div.theme' ).addClass( 'focus' );

		installTheme.init( $( this ) );

	} );

} );

Anon7 - 2022
AnonSec Team