# convertkit/2.0.1/resources/backend/js/setup-wizard.js

Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages, version 2.0.1. 52 lines.

- Page: https://pluginprobe.com/plugins/convertkit/2.0.1/code/resources/backend/js/setup-wizard.js
- Raw: https://pluginprobe.com/plugins/convertkit/2.0.1/raw/resources/backend/js/setup-wizard.js
- Modified: 2022-10-03T14:21:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/convertkit/2.0.1/code/resources/backend/js/setup-wizard.js#L10-L20`.

```javascript
/**
 * Setup Wizard
 *
 * @package ConvertKit
 * @author ConvertKit
 */

/**
 * Conditionally shows and hides elements when a button or link is clicked, based on that
 * button/link's configuration.
 *
 * @since 	1.9.8.4
 */
jQuery( document ).ready(
	function( $ ) {

		// Redirect parent screen to a given URL after clicking a link that opens
		// the href URL in a new tab.
		$( 'a.convertkit-redirect' ).on(
			'click',
			function( e ) {

				var link = this;

				// Delay the redirect, otherwise browsers will block opening the href attribute
				// thinking it's a popup.
				setTimeout(
					function() {
						// Redirect the parent screen to the link's data-convertkit-redirect-url property.
						window.location.href = $( link ).data( 'convertkit-redirect-url' );
					},
					1000
				);

			}
		);

		// Show a confirmation dialog for specific links.
		$( 'a.convertkit-confirm' ).on(
			'click',
			function( e ) {

				if ( ! confirm( $( this ).data( 'message' ) ) ) {
					e.preventDefault();
				}

			}
		);

	}
);

```
