PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.3.0
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.3.0
3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 All 195 releases
convertkit / resources / backend / js / setup-wizard.js

setup-wizard.js in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.3.0, at resources/backend/js/setup-wizard.js

41 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Setup Wizard
3 *
4 * @author ConvertKit
5 */
6
7 /**
8 * Conditionally shows and hides elements when a button or link is clicked, based on that
9 * button/link's configuration.
10 *
11 * @since 1.9.8.4
12 */
13 document.addEventListener('DOMContentLoaded', function () {
14 // Redirect parent screen to a given URL after clicking a link that opens
15 // the href URL in a new tab.
16 document
17 .querySelectorAll('a.convertkit-redirect')
18 .forEach(function (element) {
19 element.addEventListener('click', function () {
20 // Delay the redirect, otherwise browsers will block opening the href attribute
21 // thinking it's a popup.
22 setTimeout(function () {
23 // Redirect the parent screen to the link's data-convertkit-redirect-url property.
24 window.location.href =
25 element.dataset.convertkitRedirectUrl;
26 }, 1000);
27 });
28 });
29
30 // Show a confirmation dialog for specific links.
31 document
32 .querySelectorAll('a.convertkit-confirm')
33 .forEach(function (element) {
34 element.addEventListener('click', function (e) {
35 if (!confirm(element.dataset.message)) {
36 e.preventDefault();
37 }
38 });
39 });
40 });
41