SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > jetpack > > modules > shortcodes > js


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/jetpack//modules/shortcodes/js

NameTypeSizeLast ModifiedActions
brightcove.js File 893 bytes July 28 2020 21:06:48.
jmpress.js File 80748 bytes July 28 2020 21:06:48.
jquery.cycle.min.js File 26761 bytes January 12 2017 06:10:36.
main.js File 7699 bytes December 16 2024 19:21:56.
quiz.js File 2830 bytes August 31 2021 22:39:50.
recipes-printthis.js File 9590 bytes December 07 2021 21:56:48.
recipes.js File 377 bytes July 28 2020 21:06:48.
slideshow-shortcode.js File 6580 bytes September 02 2024 18:34:18.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/jetpack//modules/shortcodes/js/quiz.js

( function ( $ ) {
	$.fn.shuffleQuiz = function () {
		var allElems = this.get(),
			getRandom = function ( max ) {
				return Math.floor( Math.random() * max );
			},
			shuffled = $.map( allElems, function () {
				var random = getRandom( allElems.length ),
					randEl = $( allElems[ random ] ).clone( true )[ 0 ];
				allElems.splice( random, 1 );
				return randEl;
			} );

		this.each( function ( i ) {
			$( this ).replaceWith( $( shuffled[ i ] ) );
		} );

		return $( shuffled );
	};
} )( jQuery );

jQuery( function ( $ ) {
	$( '.jetpack-quiz' ).each( function () {
		var quiz = $( this );
		quiz.find( 'div.jetpack-quiz-answer' ).shuffleQuiz();
		quiz.find( 'div[data-correct]' ).removeAttr( 'data-correct' ).data( 'correct', 1 );
		quiz.find( 'div.jetpack-quiz-answer:last' ).addClass( 'last' );
	} );

	$( 'div.jetpack-quiz' ).on( 'click', 'div.jetpack-quiz-answer', function () {
		var trackid,
			answer = $( this ),
			quiz = answer.closest( 'div.jetpack-quiz' );

		if ( quiz.data( 'a8ctraining' ) ) {
			new Image().src =
				'//pixel.wp.com/b.gif?v=wpcom-no-pv&x_trainingchaos-' +
				quiz.data( 'username' ) +
				'=' +
				quiz.data( 'a8ctraining' ) +
				'&rand=' +
				Math.random();
			quiz.data( 'a8ctraining', false );
			quiz.data( 'trackid', false );
		}

		trackid = quiz.data( 'trackid' );
		if ( answer.data( 'correct' ) ) {
			answer.addClass( 'correct' );
			if ( trackid ) {
				new Image().src =
					'//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-' + trackid + '=correct&rand=' + Math.random();
			}
		} else {
			answer.addClass( 'wrong' );
			if ( trackid ) {
				new Image().src =
					'//pixel.wp.com/b.gif?v=wpcom-no-pv&x_quiz-' + trackid + '=wrong&rand=' + Math.random();
			}
		}
		// only track the first answer
		quiz.data( 'trackid', false );
	} );
} );

document.querySelectorAll( '.jetpack-quiz-wrapper' ).forEach( function ( quiz ) {
	quiz.childNodes.forEach( function ( element, number ) {
		element.style.display = 'none';
		element.setAttribute( 'quiz-number', number );
		element.querySelector( '.jetpack-quiz-count' ).innerHTML =
			number + 1 + '/' + quiz.childElementCount;
	} );

	quiz.childNodes[ 0 ].style.display = 'block';
} );

document.querySelectorAll( '.jetpack-quiz-option-button' ).forEach( function ( element ) {
	element.addEventListener( 'click', function () {
		var currentQuiz = element.parentElement.parentElement;
		currentQuiz.style.display = 'none';
		var switchNumber = element.getAttribute( 'data-quiz-option' ) === 'next' ? 1 : -1;
		var newQuiz =
			currentQuiz.parentElement.childNodes[
				parseInt( currentQuiz.getAttribute( 'quiz-number' ) ) + switchNumber
			];
		newQuiz.style.display = 'block';
		var newQuizQuestionEl = newQuiz.querySelector( '.jetpack-quiz-question' );
		if ( newQuizQuestionEl ) {
			newQuizQuestionEl.focus();
		}
	} );
} );

SILENT KILLER Tool