HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wp-recipe-maker/assets/js/public/recipe.js
window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker;

window.WPRecipeMaker.recipe = {
	init: () => {
		window.addEventListener( 'wpupgInitReady', function (e) {
			const grid = e.detail;
			window.WPRecipeMaker.recipe.wpupgGridCompatibility( grid );
		} );
	},
	wpupgGridCompatibility: ( grid ) => {
		if ( grid ) {
			grid.on( 'itemsLoaded', () => {
				window.WPRecipeMaker.recipe.initFeatures();
			} );
		}
	},
	initFeatures: ( args = {} ) => {
		// If we're initting a specific recipe, reset it first.
		if ( args.hasOwnProperty( 'id' ) ) {
			window.WPRecipeMaker.manager.resetRecipe( args.id );
		}

		if ( window.WPRecipeMaker ) {
			if ( window.WPRecipeMaker.hasOwnProperty( 'advancedServings' ) ) {
				window.WPRecipeMaker.advancedServings.init();
			}
			if ( window.WPRecipeMaker.hasOwnProperty( 'quantities' ) ) {
				window.WPRecipeMaker.quantities.init();
	
				if ( args.hasOwnProperty( 'id' ) ) {	
					if ( args.hasOwnProperty( 'servings' ) ) {
						const servings = parseInt( args.servings );
	
						if ( servings ) {
							setTimeout( () => {
								window.WPRecipeMaker.quantities.setServings( args.id, servings );
							}, 100 );
						}
					}
				}
			}
	
			if ( window.WPRecipeMaker.hasOwnProperty( 'instacart' ) ) {
				window.WPRecipeMaker.instacart.init();
			}

			if ( window.WPRecipeMaker.hasOwnProperty( 'jumpToSection' ) ) {
				window.WPRecipeMaker.jumpToSection.init();
			}

			if ( window.WPRecipeMaker.hasOwnProperty( 'timer' ) ) {
				window.WPRecipeMaker.timer.init();
			}
	
			if ( window.WPRecipeMaker.hasOwnProperty( 'preventSleep' ) ) {
				window.WPRecipeMaker.preventSleep.init();
			}
	
			if ( window.WPRecipeMaker.hasOwnProperty( 'privateNotes' ) ) {
				window.WPRecipeMaker.privateNotes.init();
			}
	
			if ( window.WPRecipeMaker.hasOwnProperty( 'tooltip' ) ) {
				window.WPRecipeMaker.tooltip.init();
			}
			if ( window.WPRecipeMaker.hasOwnProperty( 'video' ) ) {
				if ( wprm_public.settings.video_force_ratio ) {
					window.WPRecipeMaker.video.init();
				}
			}
		}

		document.dispatchEvent( new CustomEvent( 'wprmRecipeInit', { detail: args } ) );
	},
};

// Don't wait for DOMContentLoaded. Listener needs to be added as soon as possible.
window.WPRecipeMaker.recipe.init();