jQuery( document ).ready( function( $ ) {
	// ADD RESET MENU BUTTON
	if ( $( '.nav-menus-php' )[0] ) {
		$('<a onclick="if ( confirm( \'Are you sure you want to reset the menus to their original content?\' ) ) { return true; } else { event.stopPropagation(); event.preventDefault(); };" title="Reset the menus to their original content" href="' + wpj_vars.admin_url + 'nav-menus.php?reset-menus=true" class="nav-tab" aria-current="page">Reset WPJ Menus</a>').appendTo('.nav-tab-wrapper');
	}

	// ADD RESET PAGES BUTTON
	if ( $( '.edit-php' )[0] ) {
		$('<a onclick="if ( confirm( \'Are you sure you want to delete all pages and create new ones with their original content?\' ) ) { return true; } else { event.stopPropagation(); event.preventDefault(); };" title="Reset the pages to their original content" href="' + wpj_vars.admin_url + 'edit.php?post_type=page&reset-pages=true" class="page-title-action">Reset WPJ Pages</a>').insertAfter('.post-type-page .page-title-action');
	}

	// ADD RESET WIDGETS BUTTON
	if ( $( '.widgets-php' )[0] ) {
		$( '<a onclick="if ( confirm( \'Are you sure you want to reset the widgets to their original content?\' ) ) { return true; } else { event.stopPropagation(); event.preventDefault(); };" title="Reset the menus to their original content" href="' + wpj_vars.admin_url + '?reset-widgets=true" class="button-secondary reset-widgets-button">Reset WPJ Widgets</a>' ).prependTo( '.edit-widgets-main-block-list' );
	}
});