Version Description
- New: Introduce GoDaddy Email Marketing content block.
Download this release
Release Info
Developer | Godaddy |
Plugin | GoDaddy Email Marketing |
Version | 1.4.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.0 to 1.4.0
- css/admin.css +4 -0
- css/admin.min.css +1 -1
- css/blocks.css +8 -0
- css/blocks.min.css +1 -0
- css/gem.css +7 -0
- css/gem.min.css +1 -1
- godaddy-email-marketing.php +27 -10
- includes/blocks/blocks.js +138 -0
- includes/blocks/i18n.js +4 -0
- includes/blocks/icons.js +17 -0
- includes/class-blocks.php +110 -0
- includes/class-dispatcher.php +29 -18
- includes/class-shortcode.php +6 -3
- includes/render.php +1 -1
- includes/settings.php +53 -36
- includes/widget.php +8 -5
- js/admin.min.js +1 -1
- js/blocks.js +87 -0
- js/blocks.min.js +1 -0
- js/gem.min.js +1 -1
- readme.txt +8 -2
css/admin.css
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
margin: 10px 20px 0 2px;
|
3 |
}
|
4 |
|
|
|
|
|
|
|
|
|
5 |
.intro {
|
6 |
float: left;
|
7 |
width: 100%;
|
2 |
margin: 10px 20px 0 2px;
|
3 |
}
|
4 |
|
5 |
+
.about-wrap img {
|
6 |
+
width: 15px;
|
7 |
+
}
|
8 |
+
|
9 |
.intro {
|
10 |
float: left;
|
11 |
width: 100%;
|
css/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.about-wrap{margin:10px 20px 0 2px}.intro{float:left;width:100%}div.updated.updated.gem-identity{background-image:url( '../images/gem.svg' );background-repeat:no-repeat;background-position:15px 15px;background-size:80px;display:block!important;padding-left:110px!important}div.updated.gem-identity p:first-child{color:#23282d;font-size:1.1em;font-weight:700}.description .button{margin:5px}.description .button+.button{margin-left:0}.col{float:left}.col.banner{outline:1px solid #ccc}.col.banner img{margin-bottom:0}.panel{display:none;float:left;width:100%}.intro h1{margin-right:0;font-size:1.53333em;margin:0 0 15px 0;padding:9px 15px 4px 0}.intro h1 sup{background:#fff;color:#666;font-size:12px;font-weight:700;padding:5px 10px;white-space:nowrap;vertical-align:top}#help iframe{width:100%;min-height:800px;margin-top:20px}@media screen and (min-width:783px){#settings .form-table th{width:30%}#help iframe{margin-top:10px}}#setting-errors{float:left;width:100%}.notice,div.error,div.updated{display:none!important}#setting-errors>.notice,#setting-errors>div.error,#setting-errors>div.updated{clear:both;display:block!important;margin-top:1.25em}code.gem-form-id{display:inline-block;margin-top:1px;padding:6px 10px 5px}input.copied,input.copied:focus{border-color:#46b450;box-shadow:0 0 2px rgba(70,180,80,.8)}input.copied::selection{background-color:#d5f4d8}input.copied::-moz-selection{background-color:#d5f4d8}.button.copy-to-clipboard{display:inline-block;height:30px;margin-top:1px}.mobile .button.copy-to-clipboard{display:none}@media screen and (max-width:782px){.button.copy-to-clipboard{height:38px;margin:1px 1px 10px 1px;position:relative}}
|
1 |
+
.about-wrap{margin:10px 20px 0 2px}.about-wrap img{width:15px}.intro{float:left;width:100%}div.updated.updated.gem-identity{background-image:url( '../images/gem.svg' );background-repeat:no-repeat;background-position:15px 15px;background-size:80px;display:block!important;padding-left:110px!important}div.updated.gem-identity p:first-child{color:#23282d;font-size:1.1em;font-weight:700}.description .button{margin:5px}.description .button+.button{margin-left:0}.col{float:left}.col.banner{outline:1px solid #ccc}.col.banner img{margin-bottom:0}.panel{display:none;float:left;width:100%}.intro h1{margin-right:0;font-size:1.53333em;margin:0 0 15px 0;padding:9px 15px 4px 0}.intro h1 sup{background:#fff;color:#666;font-size:12px;font-weight:700;padding:5px 10px;white-space:nowrap;vertical-align:top}#help iframe{width:100%;min-height:800px;margin-top:20px}@media screen and (min-width:783px){#settings .form-table th{width:30%}#help iframe{margin-top:10px}}#setting-errors{float:left;width:100%}.notice,div.error,div.updated{display:none!important}#setting-errors>.notice,#setting-errors>div.error,#setting-errors>div.updated{clear:both;display:block!important;margin-top:1.25em}code.gem-form-id{display:inline-block;margin-top:1px;padding:6px 10px 5px}input.copied,input.copied:focus{border-color:#46b450;box-shadow:0 0 2px rgba(70,180,80,.8)}input.copied::selection{background-color:#d5f4d8}input.copied::-moz-selection{background-color:#d5f4d8}.button.copy-to-clipboard{display:inline-block;height:30px;margin-top:1px}.mobile .button.copy-to-clipboard{display:none}@media screen and (max-width:782px){.button.copy-to-clipboard{height:38px;margin:1px 1px 10px 1px;position:relative}}
|
css/blocks.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wp-block-godaddy-email-marketing-sign-up-forms-gem-block input:not([type="submit"]) {
|
2 |
+
width: 100%;
|
3 |
+
}
|
4 |
+
|
5 |
+
.wp-block-godaddy-email-marketing-sign-up-forms-gem-block .preloader {
|
6 |
+
display: block;
|
7 |
+
margin: 2em auto;
|
8 |
+
}
|
css/blocks.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wp-block-godaddy-email-marketing-sign-up-forms-gem-block input:not([type=submit]){width:100%}.wp-block-godaddy-email-marketing-sign-up-forms-gem-block .preloader{display:block;margin:2em auto}
|
css/gem.css
CHANGED
@@ -56,3 +56,10 @@ form.gem-form p.gem-error {
|
|
56 |
background-image: url( '../images/spinner-2x.gif' );
|
57 |
}
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
background-image: url( '../images/spinner-2x.gif' );
|
57 |
}
|
58 |
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Block Styles
|
62 |
+
*/
|
63 |
+
.gem-form-wrapper input:not([type="submit"]) {
|
64 |
+
width: 100%;
|
65 |
+
}
|
css/gem.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
form.gem-form p{padding:0}input.gem-invalid{border:1px solid red}.gem-field{display:block}form.gem-form label{display:inline!important}.gem-spinner{display:none;background:url( '../images/spinner.gif' ) no-repeat;background-size:20px 20px;width:20px;height:20px}.gem-submit{cursor:pointer}form.gem-form p.gem-error{background-color:#ffebe8;border:1px solid #c00;padding:.25em .5em;margin:.6em 0;border-radius:3px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.gem-spinner{background-image:url( '../images/spinner-2x.gif' )}}
|
1 |
+
form.gem-form p{padding:0}input.gem-invalid{border:1px solid red}.gem-field{display:block}form.gem-form label{display:inline!important}.gem-spinner{display:none;background:url( '../images/spinner.gif' ) no-repeat;background-size:20px 20px;width:20px;height:20px}.gem-submit{cursor:pointer}form.gem-form p.gem-error{background-color:#ffebe8;border:1px solid #c00;padding:.25em .5em;margin:.6em 0;border-radius:3px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.gem-spinner{background-image:url( '../images/spinner-2x.gif' )}}.gem-form-wrapper input:not([type=submit]){width:100%}
|
godaddy-email-marketing.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: GoDaddy Email Marketing
|
4 |
* Plugin URI: https://gem.godaddy.com/
|
5 |
* Description: Add the GoDaddy Email Marketing signup form to your WordPress site! Easy to set up, the plugin allows your site visitors to subscribe to your email lists.
|
6 |
-
* Version: 1.
|
7 |
* Author: GoDaddy
|
8 |
* Author URI: https://gem.godaddy.com/
|
9 |
* License: GPL-2.0
|
@@ -79,6 +79,7 @@ class GEM_Official {
|
|
79 |
add_action( 'init', array( $this, 'init' ) );
|
80 |
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
81 |
add_action( 'init', array( $this, 'register_shortcode' ), 20 );
|
|
|
82 |
add_action( 'admin_notices', array( $this, 'action_admin_notices' ) );
|
83 |
|
84 |
add_filter( 'plugin_action_links_' . self::$basename, array( $this, 'action_links' ), 10 );
|
@@ -108,7 +109,7 @@ class GEM_Official {
|
|
108 |
|
109 |
// Plugin's main directory.
|
110 |
defined( 'GEM_VERSION' )
|
111 |
-
or define( 'GEM_VERSION', '1.
|
112 |
|
113 |
// Set up the base name.
|
114 |
self::$basename = isset( self::$basename ) ? self::$basename : plugin_basename( __FILE__ );
|
@@ -128,6 +129,9 @@ class GEM_Official {
|
|
128 |
// The shortcode.
|
129 |
require_once GEM_PLUGIN_DIR . 'includes/class-shortcode.php';
|
130 |
|
|
|
|
|
|
|
131 |
// The file renders the form.
|
132 |
require_once GEM_PLUGIN_DIR . 'includes/render.php';
|
133 |
|
@@ -176,6 +180,15 @@ class GEM_Official {
|
|
176 |
add_action( 'register_shortcode_ui', array( $shortcode, 'shortcode_ui' ) );
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
/**
|
180 |
* Registers the widget.
|
181 |
*/
|
@@ -197,14 +210,18 @@ class GEM_Official {
|
|
197 |
wp_enqueue_style( 'gem-base', plugins_url( "css/gem{$suffix}.css", __FILE__ ), false, GEM_VERSION );
|
198 |
|
199 |
// Help strings.
|
200 |
-
wp_localize_script(
|
201 |
-
'
|
202 |
-
'
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
208 |
}
|
209 |
|
210 |
/**
|
3 |
* Plugin Name: GoDaddy Email Marketing
|
4 |
* Plugin URI: https://gem.godaddy.com/
|
5 |
* Description: Add the GoDaddy Email Marketing signup form to your WordPress site! Easy to set up, the plugin allows your site visitors to subscribe to your email lists.
|
6 |
+
* Version: 1.4.0
|
7 |
* Author: GoDaddy
|
8 |
* Author URI: https://gem.godaddy.com/
|
9 |
* License: GPL-2.0
|
79 |
add_action( 'init', array( $this, 'init' ) );
|
80 |
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
81 |
add_action( 'init', array( $this, 'register_shortcode' ), 20 );
|
82 |
+
add_action( 'init', array( $this, 'load_content_blocks' ) );
|
83 |
add_action( 'admin_notices', array( $this, 'action_admin_notices' ) );
|
84 |
|
85 |
add_filter( 'plugin_action_links_' . self::$basename, array( $this, 'action_links' ), 10 );
|
109 |
|
110 |
// Plugin's main directory.
|
111 |
defined( 'GEM_VERSION' )
|
112 |
+
or define( 'GEM_VERSION', '1.4.0' );
|
113 |
|
114 |
// Set up the base name.
|
115 |
self::$basename = isset( self::$basename ) ? self::$basename : plugin_basename( __FILE__ );
|
129 |
// The shortcode.
|
130 |
require_once GEM_PLUGIN_DIR . 'includes/class-shortcode.php';
|
131 |
|
132 |
+
// Content blocks.
|
133 |
+
require_once GEM_PLUGIN_DIR . 'includes/class-blocks.php';
|
134 |
+
|
135 |
// The file renders the form.
|
136 |
require_once GEM_PLUGIN_DIR . 'includes/render.php';
|
137 |
|
180 |
add_action( 'register_shortcode_ui', array( $shortcode, 'shortcode_ui' ) );
|
181 |
}
|
182 |
|
183 |
+
/**
|
184 |
+
* Load content blocks.
|
185 |
+
*/
|
186 |
+
public function load_content_blocks() {
|
187 |
+
|
188 |
+
new GEM_Blocks();
|
189 |
+
|
190 |
+
}
|
191 |
+
|
192 |
/**
|
193 |
* Registers the widget.
|
194 |
*/
|
210 |
wp_enqueue_style( 'gem-base', plugins_url( "css/gem{$suffix}.css", __FILE__ ), false, GEM_VERSION );
|
211 |
|
212 |
// Help strings.
|
213 |
+
wp_localize_script(
|
214 |
+
'gem-main',
|
215 |
+
'GEM',
|
216 |
+
array(
|
217 |
+
'thankyou' => __( 'Thank you for signing up!', 'godaddy-email-marketing-sign-up-forms' ),
|
218 |
+
'thankyou_suppressed' => __( 'Thank you for signing up! Please check your email to confirm your subscription.', 'godaddy-email-marketing-sign-up-forms' ),
|
219 |
+
'oops' => __( 'Oops! There was a problem. Please try again.', 'godaddy-email-marketing-sign-up-forms' ),
|
220 |
+
'email' => __( 'Please enter a valid email address.', 'godaddy-email-marketing-sign-up-forms' ),
|
221 |
+
/* translators: %s: Name of required field */
|
222 |
+
'required' => __( '%s is a required field.', 'godaddy-email-marketing-sign-up-forms' ),
|
223 |
+
)
|
224 |
+
);
|
225 |
}
|
226 |
|
227 |
/**
|
includes/blocks/blocks.js
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Locale
|
2 |
+
import './i18n.js';
|
3 |
+
import gemIcons from './icons';
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Internal block libraries
|
7 |
+
*/
|
8 |
+
const { __ } = wp.i18n;
|
9 |
+
|
10 |
+
const {
|
11 |
+
registerBlockType
|
12 |
+
} = wp.blocks;
|
13 |
+
|
14 |
+
const {
|
15 |
+
SelectControl
|
16 |
+
} = wp.components;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Register block
|
20 |
+
*/
|
21 |
+
export default registerBlockType( 'godaddy-email-marketing-sign-up-forms/gem-block', {
|
22 |
+
title: __( 'GoDaddy Email Marketing', 'godaddy-email-marketing-sign-up-forms' ),
|
23 |
+
description: __( 'Display a GoDaddy email marketing form.', 'godaddy-email-marketing-sign-up-forms' ),
|
24 |
+
category: 'widgets',
|
25 |
+
icon: gemIcons.mail,
|
26 |
+
keywords: [
|
27 |
+
__( 'GoDaddy', 'godaddy-email-marketing-sign-up-forms' ),
|
28 |
+
__( 'Email', 'godaddy-email-marketing-sign-up-forms' ),
|
29 |
+
__( 'Form', 'godaddy-email-marketing-sign-up-forms' ),
|
30 |
+
],
|
31 |
+
|
32 |
+
attributes: {
|
33 |
+
form: {
|
34 |
+
type: 'string',
|
35 |
+
sourece: 'text',
|
36 |
+
default: gem.isConnected ? gem.forms[0].value : undefined,
|
37 |
+
},
|
38 |
+
},
|
39 |
+
|
40 |
+
edit: props => {
|
41 |
+
|
42 |
+
const { attributes: { form }, isSelected, className, setAttributes } = props;
|
43 |
+
|
44 |
+
return [
|
45 |
+
|
46 |
+
// Admin Block Markup
|
47 |
+
<div className={ className } key={ className }>
|
48 |
+
<div className="gem-forms">
|
49 |
+
{ isSelected ? (
|
50 |
+
getFormSelect( form, setAttributes )
|
51 |
+
) : ( <div className="gem-form"><img src={ gem.preloaderUrl } className="preloader" />{ renderGemForm( form ) }</div> ) }
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
];
|
56 |
+
},
|
57 |
+
|
58 |
+
save: props => {
|
59 |
+
const { attributes: { form }, className } = props;
|
60 |
+
|
61 |
+
if ( ! gem.isConnected ) {
|
62 |
+
|
63 |
+
return;
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
return ( '[gem id=' + form + ']' );
|
68 |
+
},
|
69 |
+
} );
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Generate the GoDaddy Email Marketing form select field.
|
73 |
+
*
|
74 |
+
* @param {integer} form Form ID
|
75 |
+
* @param {function} setAttributes Set attributes method.
|
76 |
+
*/
|
77 |
+
function getFormSelect( form, setAttributes ) {
|
78 |
+
|
79 |
+
if ( ! gem.isConnected ) {
|
80 |
+
|
81 |
+
return notConnectedError();
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
return <SelectControl
|
86 |
+
className="form"
|
87 |
+
label={ __( 'GoDaddy Email Marketing Form', 'godaddy-email-marketing-sign-up-forms' ) }
|
88 |
+
value={ form }
|
89 |
+
options={ gem.forms }
|
90 |
+
onChange={ ( form ) => { setAttributes( { form } ) } }
|
91 |
+
/>
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Render the GoDaddy Email Marketing form markup
|
97 |
+
*
|
98 |
+
* @param {integer} formID Form ID
|
99 |
+
*/
|
100 |
+
function renderGemForm( formID ) {
|
101 |
+
|
102 |
+
if ( ! gem.isConnected ) {
|
103 |
+
|
104 |
+
return notConnectedError();
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
var data = {
|
109 |
+
'action': 'get_gem_form',
|
110 |
+
'formID': formID,
|
111 |
+
};
|
112 |
+
|
113 |
+
$.post( ajaxurl, data, function( response ) {
|
114 |
+
|
115 |
+
if ( ! response.success ) {
|
116 |
+
|
117 |
+
$( '.gem-form' ).html( gem.getFormError );
|
118 |
+
|
119 |
+
return;
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
$( '.gem-form' ).html( response.data );
|
124 |
+
|
125 |
+
} );
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Render the error message when not connected to the GoDaddy Email Marketing API
|
131 |
+
*
|
132 |
+
* @return {mixed} Markup for the Not connected error notice.
|
133 |
+
*/
|
134 |
+
function notConnectedError() {
|
135 |
+
|
136 |
+
return <div>{ __( 'GoDaddy Email Marketing is not connected.', 'godaddy-email-marketing-sign-up-forms' ) } <p><a class="button button-secondary" href={ gem.settingsURL }> {__( 'Connect Now', 'godaddy-email-marketing-sign-up-forms' ) }</a></p></div>;
|
137 |
+
|
138 |
+
}
|
includes/blocks/i18n.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Set Locale
|
3 |
+
*/
|
4 |
+
wp.i18n.setLocaleData( { '': {} }, 'godaddy-email-marketing-sign-up-forms' );
|
includes/blocks/icons.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const gemIcons = {};
|
2 |
+
|
3 |
+
gemIcons.mail = <svg
|
4 |
+
xmlns="http://www.w3.org/2000/svg"
|
5 |
+
width="20pt"
|
6 |
+
height="22pt"
|
7 |
+
viewBox="0 0 20 22"
|
8 |
+
version="1.1"
|
9 |
+
>
|
10 |
+
<g id="surface1">
|
11 |
+
<path style={{ stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }} d="M 0.0390625, 11.097656 L 1.925781, 22 L 19.960938, 18.109375, L 19.960938, 6.890625, L 11.371094, 15.828125, Z M 0.0390625, 11.097656 "/>
|
12 |
+
<path style={{ stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }} d="M 9.882812, 6.632812 C 6.785156, 7.230469, 0.164062, 9.597656, 0.164062, 9.597656, L 11.171875, 14.9375, L 19.289062, 5.828125, C 19.289062, 5.816406, 13.042969, 6.011719, 9.882812, 6.632812, Z M 9.882812, 6.632812 "/>
|
13 |
+
<path style={{ stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,66.27451%,16.470588%)', fillOpacity: '1' }} d="M 0.164062, 9.597656 C 0.164062, 9.597656, 6.472656, 8.304688, 9.484375, 7.71875, L 19.277344, 5.816406, L 8.628906, 0 Z M 0.164062, 9.597656 "/>
|
14 |
+
</g>
|
15 |
+
</svg>;
|
16 |
+
|
17 |
+
export default gemIcons;
|
includes/class-blocks.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dispatcher class
|
4 |
+
*
|
5 |
+
* @package GEM
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* GoDaddy Email Marketing Dispatcher.
|
10 |
+
*
|
11 |
+
* @since 1.4.0
|
12 |
+
*/
|
13 |
+
class GEM_Blocks {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* GoDaddy Email Marketing available forms
|
17 |
+
*
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
private $forms;
|
21 |
+
|
22 |
+
public function __construct() {
|
23 |
+
|
24 |
+
$this->forms = $this->get_forms();
|
25 |
+
|
26 |
+
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_scripts' ) );
|
27 |
+
|
28 |
+
add_action( 'wp_ajax_get_gem_form', [ $this, 'get_gem_form' ] );
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Enqueue GEM block scripts
|
34 |
+
*
|
35 |
+
* @since 1.4.0
|
36 |
+
*/
|
37 |
+
public function enqueue_block_scripts() {
|
38 |
+
|
39 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
40 |
+
|
41 |
+
wp_enqueue_style( 'gem-blocks', plugins_url( "../css/blocks{$suffix}.css", __FILE__ ), array(), GEM_VERSION, 'all' );
|
42 |
+
wp_enqueue_script( 'gem-blocks', plugins_url( "../js/blocks{$suffix}.js", __FILE__ ), array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components' ), GEM_VERSION, true );
|
43 |
+
|
44 |
+
wp_localize_script(
|
45 |
+
'gem-blocks',
|
46 |
+
'gem',
|
47 |
+
[
|
48 |
+
'forms' => $this->forms,
|
49 |
+
'settingsURL' => admin_url( 'options-general.php?page=gem-settings' ),
|
50 |
+
'getFormError' => esc_html__( 'There was an error retreiving the GEM form. Please try again.', 'godaddy-email-marketing-sign-up-forms' ),
|
51 |
+
'isConnected' => ! empty( $this->forms ),
|
52 |
+
'preloaderUrl' => admin_url( 'images/wpspin_light-2x.gif' ),
|
53 |
+
]
|
54 |
+
);
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Render the GEM form in the block
|
60 |
+
*
|
61 |
+
* @since 1.4.0
|
62 |
+
*
|
63 |
+
* @return mixed Markup for the GEM form
|
64 |
+
*/
|
65 |
+
public function get_gem_form() {
|
66 |
+
|
67 |
+
$form_id = filter_input( INPUT_POST, 'formID', FILTER_SANITIZE_NUMBER_INT );
|
68 |
+
|
69 |
+
if ( ! $form_id ) {
|
70 |
+
|
71 |
+
wp_send_json_error();
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
wp_send_json_success( gem_form( $form_id, false ) );
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Retreive the GEM forms.
|
81 |
+
*
|
82 |
+
* @since 1.4.0
|
83 |
+
*
|
84 |
+
* @return array GEM forms array.
|
85 |
+
*/
|
86 |
+
private function get_forms() {
|
87 |
+
|
88 |
+
$forms = GEM_Dispatcher::fetch_forms();
|
89 |
+
|
90 |
+
if ( empty( $forms->signups ) ) {
|
91 |
+
|
92 |
+
return [];
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
$forms_array = [];
|
97 |
+
|
98 |
+
foreach ( $forms->signups as $form ) {
|
99 |
+
|
100 |
+
$forms_array[] = [
|
101 |
+
'label' => $form->name,
|
102 |
+
'value' => $form->id,
|
103 |
+
];
|
104 |
+
|
105 |
+
}
|
106 |
+
|
107 |
+
return $forms_array;
|
108 |
+
|
109 |
+
}
|
110 |
+
}
|
includes/class-dispatcher.php
CHANGED
@@ -50,9 +50,12 @@ class GEM_Dispatcher {
|
|
50 |
);
|
51 |
|
52 |
// Prepare the URL that includes our credentials.
|
53 |
-
$response = wp_remote_get(
|
54 |
-
'
|
55 |
-
|
|
|
|
|
|
|
56 |
|
57 |
// Delete all existing transients for this user.
|
58 |
delete_transient( 'gem-' . $username . '-lists' );
|
@@ -82,18 +85,21 @@ class GEM_Dispatcher {
|
|
82 |
}
|
83 |
|
84 |
// Prepare the URL that includes our credentials.
|
85 |
-
$response = wp_remote_post(
|
86 |
-
'
|
87 |
-
|
88 |
-
|
89 |
-
'
|
90 |
-
'
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
97 |
|
98 |
// Credentials are correct.
|
99 |
if ( self::is_response_ok( $response ) ) {
|
@@ -133,9 +139,14 @@ class GEM_Dispatcher {
|
|
133 |
if ( false === $data ) {
|
134 |
|
135 |
// Fields are not cached. fetch and cache.
|
136 |
-
$response = wp_remote_get(
|
137 |
-
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
// Was there an error, connection is down? bail and try again later.
|
141 |
if ( ! self::is_response_ok( $response ) ) {
|
50 |
);
|
51 |
|
52 |
// Prepare the URL that includes our credentials.
|
53 |
+
$response = wp_remote_get(
|
54 |
+
self::get_method_url( 'forms', false, $auth ),
|
55 |
+
array(
|
56 |
+
'timeout' => 10,
|
57 |
+
)
|
58 |
+
);
|
59 |
|
60 |
// Delete all existing transients for this user.
|
61 |
delete_transient( 'gem-' . $username . '-lists' );
|
85 |
}
|
86 |
|
87 |
// Prepare the URL that includes our credentials.
|
88 |
+
$response = wp_remote_post(
|
89 |
+
self::get_api_base_url( 'api/v3/signupForms' ),
|
90 |
+
array(
|
91 |
+
'method' => 'POST',
|
92 |
+
'timeout' => 10,
|
93 |
+
'body' => array(
|
94 |
+
'username' => $username,
|
95 |
+
'api_key' => $api_key,
|
96 |
+
'name' => 'Signup Form',
|
97 |
+
'integration' => 'WordPress',
|
98 |
+
'hidden' => false,
|
99 |
+
'subscriberListName' => 'WordPress',
|
100 |
+
),
|
101 |
+
)
|
102 |
+
);
|
103 |
|
104 |
// Credentials are correct.
|
105 |
if ( self::is_response_ok( $response ) ) {
|
139 |
if ( false === $data ) {
|
140 |
|
141 |
// Fields are not cached. fetch and cache.
|
142 |
+
$response = wp_remote_get(
|
143 |
+
self::get_method_url(
|
144 |
+
'fields',
|
145 |
+
array(
|
146 |
+
'id' => $form_id,
|
147 |
+
)
|
148 |
+
)
|
149 |
+
);
|
150 |
|
151 |
// Was there an error, connection is down? bail and try again later.
|
152 |
if ( ! self::is_response_ok( $response ) ) {
|
includes/class-shortcode.php
CHANGED
@@ -20,9 +20,12 @@ class GEM_Shortcode {
|
|
20 |
* @return string|void
|
21 |
*/
|
22 |
public function render( $atts ) {
|
23 |
-
$atts = shortcode_atts(
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
if ( ! $atts['id'] ) {
|
28 |
return;
|
20 |
* @return string|void
|
21 |
*/
|
22 |
public function render( $atts ) {
|
23 |
+
$atts = shortcode_atts(
|
24 |
+
array(
|
25 |
+
'id' => false,
|
26 |
+
),
|
27 |
+
$atts
|
28 |
+
);
|
29 |
|
30 |
if ( ! $atts['id'] ) {
|
31 |
return;
|
includes/render.php
CHANGED
@@ -366,7 +366,7 @@ class GEM_Form_Fields {
|
|
366 |
<span class="third">
|
367 |
<select fingerprint="date" data-id="<?php echo esc_attr( self::get_form_id( $args->name ) ); ?>" data-name="<?php echo esc_attr( $args->name ); ?>">
|
368 |
<option value=""> <?php esc_html_e( 'Year', 'godaddy-email-marketing-sign-up-forms' ); ?> </option>
|
369 |
-
<?php for ( $x = $current_year + 5
|
370 |
<option value="<?php echo absint( $x ); ?>"> <?php echo absint( $x ); ?> </option>
|
371 |
<?php endfor; ?>
|
372 |
</select>
|
366 |
<span class="third">
|
367 |
<select fingerprint="date" data-id="<?php echo esc_attr( self::get_form_id( $args->name ) ); ?>" data-name="<?php echo esc_attr( $args->name ); ?>">
|
368 |
<option value=""> <?php esc_html_e( 'Year', 'godaddy-email-marketing-sign-up-forms' ); ?> </option>
|
369 |
+
<?php for ( $x = $current_year + 5; $x > $current_year - 81; $x-- ) : ?>
|
370 |
<option value="<?php echo absint( $x ); ?>"> <?php echo absint( $x ); ?> </option>
|
371 |
<?php endfor; ?>
|
372 |
</select>
|
includes/settings.php
CHANGED
@@ -93,9 +93,13 @@ class GEM_Settings {
|
|
93 |
wp_enqueue_script( 'gem-admin', plugins_url( "js/admin{$suffix}.js", GEM_PLUGIN_BASE ), array( 'jquery' ), GEM_VERSION, true );
|
94 |
|
95 |
// Strings.
|
96 |
-
wp_localize_script(
|
97 |
-
'
|
98 |
-
|
|
|
|
|
|
|
|
|
99 |
|
100 |
wp_enqueue_script(
|
101 |
'gem-iframeresizer',
|
@@ -297,27 +301,29 @@ class GEM_Settings {
|
|
297 |
$screen = get_current_screen();
|
298 |
|
299 |
// @todo Remove HTML from the translation strings.
|
300 |
-
$screen->add_help_tab(
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
'
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
),
|
311 |
-
|
312 |
-
|
313 |
-
sprintf(
|
314 |
-
/* translators: %1$s: <?php gem_form( $form_id ); ?>, %2$s: <?php gem_form( 91 ); ?> */
|
315 |
-
__( '<strong>Template Tag:</strong> You can add the following template tag into any WordPress file: <code>%1$s</code>. Ex. <code>%2$s</code>', 'godaddy-email-marketing-sign-up-forms' ),
|
316 |
-
'<?php gem_form( $form_id ); ?>',
|
317 |
-
'<?php gem_form( 91 ); ?>'
|
318 |
-
)
|
319 |
-
),
|
320 |
-
) );
|
321 |
|
322 |
$screen->set_help_sidebar(
|
323 |
sprintf(
|
@@ -339,10 +345,16 @@ class GEM_Settings {
|
|
339 |
|
340 |
// If no options exist, create them.
|
341 |
if ( ! get_option( $this->slug ) ) {
|
342 |
-
update_option(
|
343 |
-
|
344 |
-
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
}
|
347 |
|
348 |
register_setting( 'gem-options', $this->slug, array( $this, 'validate' ) );
|
@@ -426,10 +438,12 @@ class GEM_Settings {
|
|
426 |
$this->slug,
|
427 |
'debugging_section',
|
428 |
array(
|
429 |
-
'url' => add_query_arg(
|
430 |
-
|
431 |
-
|
432 |
-
|
|
|
|
|
433 |
'label' => __( 'Erase Transients', 'godaddy-email-marketing-sign-up-forms' ),
|
434 |
'description' => __( 'Purges only the cached data associated with this plugin, and should be attempted before a hard reset.', 'godaddy-email-marketing-sign-up-forms' ),
|
435 |
)
|
@@ -442,10 +456,12 @@ class GEM_Settings {
|
|
442 |
$this->slug,
|
443 |
'debugging_section',
|
444 |
array(
|
445 |
-
'url' => add_query_arg(
|
446 |
-
|
447 |
-
|
448 |
-
|
|
|
|
|
449 |
'label' => __( 'Erase All Data', 'godaddy-email-marketing-sign-up-forms' ),
|
450 |
'description' => __( 'Purges all saved data associated with this plugin.', 'godaddy-email-marketing-sign-up-forms' ),
|
451 |
)
|
@@ -617,7 +633,8 @@ class GEM_Settings {
|
|
617 |
<?php if ( ! empty( $forms->signups ) ) : ?>
|
618 |
<div id="forms" class="panel">
|
619 |
<h3><?php esc_html_e( 'Reach Your Fans', 'godaddy-email-marketing-sign-up-forms' ); ?></h3>
|
620 |
-
<p
|
|
|
621 |
printf(
|
622 |
/* translators: %1$s: <a href="https://gem.godaddy.com">, %2$s: </a> */
|
623 |
esc_html__( 'Email marketing makes it easier than ever to turn casual visits into lasting relationship. You\'re already collecting subscribers, now you just need to start emailing them. It only takes a few moments to %1$screate an email marketing campaign%2$s.', 'godaddy-email-marketing-sign-up-forms' ),
|
93 |
wp_enqueue_script( 'gem-admin', plugins_url( "js/admin{$suffix}.js", GEM_PLUGIN_BASE ), array( 'jquery' ), GEM_VERSION, true );
|
94 |
|
95 |
// Strings.
|
96 |
+
wp_localize_script(
|
97 |
+
'gem-admin',
|
98 |
+
'GEMAdmin',
|
99 |
+
array(
|
100 |
+
'copyFailed' => _x( 'Please press Ctrl/Cmd+C to copy.', 'failed copy response', 'godaddy-email-marketing-sign-up-forms' ),
|
101 |
+
)
|
102 |
+
);
|
103 |
|
104 |
wp_enqueue_script(
|
105 |
'gem-iframeresizer',
|
301 |
$screen = get_current_screen();
|
302 |
|
303 |
// @todo Remove HTML from the translation strings.
|
304 |
+
$screen->add_help_tab(
|
305 |
+
array(
|
306 |
+
'title' => __( 'Overview', 'godaddy-email-marketing-sign-up-forms' ),
|
307 |
+
'id' => 'gem-overview',
|
308 |
+
'content' => sprintf(
|
309 |
+
'<h3>%s</h3><p>%s</p><ul><li>%s</li><li>%s</li><li>%s</li></ul>',
|
310 |
+
esc_html__( 'Instructions', 'godaddy-email-marketing-sign-up-forms' ),
|
311 |
+
sprintf(
|
312 |
+
/* translators: %s: link to GoDaddy Email Marketing account page */
|
313 |
+
esc_html__( 'Once the plugin is activated, you will be able to select and insert any of your GoDaddy Email Marketing webforms right into your site. Setup is easy. Below, simply enter your account email address and API key (found in your GoDaddy Email Marketing account [%s] area). Here are the 3 ways you can display a webform on your site:', 'godaddy-email-marketing-sign-up-forms' ),
|
314 |
+
'<a href="https://gem.godaddy.com/user/edit" target="_blank">https://gem.godaddy.com/user/edit</a>'
|
315 |
+
),
|
316 |
+
__( '<strong>Widget:</strong> Go to Appearance → widgets and find the widget called “GoDaddy Email Marketing Form” and drag it into the widget area of your choice. You can then add a title and select a form!', 'godaddy-email-marketing-sign-up-forms' ),
|
317 |
+
__( '<strong>Shortcode:</strong> You can add a form to any post or page by adding the shortcode (ex. <code>[gem id=80326]</code>) in the page/post editor.', 'godaddy-email-marketing-sign-up-forms' ),
|
318 |
+
sprintf(
|
319 |
+
/* translators: %1$s: <?php gem_form( $form_id ); ?>, %2$s: <?php gem_form( 91 ); ?> */
|
320 |
+
__( '<strong>Template Tag:</strong> You can add the following template tag into any WordPress file: <code>%1$s</code>. Ex. <code>%2$s</code>', 'godaddy-email-marketing-sign-up-forms' ),
|
321 |
+
'<?php gem_form( $form_id ); ?>',
|
322 |
+
'<?php gem_form( 91 ); ?>'
|
323 |
+
)
|
324 |
),
|
325 |
+
)
|
326 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
|
328 |
$screen->set_help_sidebar(
|
329 |
sprintf(
|
345 |
|
346 |
// If no options exist, create them.
|
347 |
if ( ! get_option( $this->slug ) ) {
|
348 |
+
update_option(
|
349 |
+
$this->slug,
|
350 |
+
apply_filters(
|
351 |
+
'gem_default_options',
|
352 |
+
array(
|
353 |
+
'username' => '',
|
354 |
+
'api-key' => '',
|
355 |
+
)
|
356 |
+
)
|
357 |
+
);
|
358 |
}
|
359 |
|
360 |
register_setting( 'gem-options', $this->slug, array( $this, 'validate' ) );
|
438 |
$this->slug,
|
439 |
'debugging_section',
|
440 |
array(
|
441 |
+
'url' => add_query_arg(
|
442 |
+
array(
|
443 |
+
'action' => 'debug-reset-transients',
|
444 |
+
'_wpnonce' => wp_create_nonce( 'gem_settings_reset_transients_nonce' ),
|
445 |
+
)
|
446 |
+
),
|
447 |
'label' => __( 'Erase Transients', 'godaddy-email-marketing-sign-up-forms' ),
|
448 |
'description' => __( 'Purges only the cached data associated with this plugin, and should be attempted before a hard reset.', 'godaddy-email-marketing-sign-up-forms' ),
|
449 |
)
|
456 |
$this->slug,
|
457 |
'debugging_section',
|
458 |
array(
|
459 |
+
'url' => add_query_arg(
|
460 |
+
array(
|
461 |
+
'action' => 'debug-reset',
|
462 |
+
'_wpnonce' => wp_create_nonce( 'gem_settings_hard_reset_nonce' ),
|
463 |
+
)
|
464 |
+
),
|
465 |
'label' => __( 'Erase All Data', 'godaddy-email-marketing-sign-up-forms' ),
|
466 |
'description' => __( 'Purges all saved data associated with this plugin.', 'godaddy-email-marketing-sign-up-forms' ),
|
467 |
)
|
633 |
<?php if ( ! empty( $forms->signups ) ) : ?>
|
634 |
<div id="forms" class="panel">
|
635 |
<h3><?php esc_html_e( 'Reach Your Fans', 'godaddy-email-marketing-sign-up-forms' ); ?></h3>
|
636 |
+
<p>
|
637 |
+
<?php
|
638 |
printf(
|
639 |
/* translators: %1$s: <a href="https://gem.godaddy.com">, %2$s: </a> */
|
640 |
esc_html__( 'Email marketing makes it easier than ever to turn casual visits into lasting relationship. You\'re already collecting subscribers, now you just need to start emailing them. It only takes a few moments to %1$screate an email marketing campaign%2$s.', 'godaddy-email-marketing-sign-up-forms' ),
|
includes/widget.php
CHANGED
@@ -108,11 +108,14 @@ class GEM_Form_Widget extends WP_Widget {
|
|
108 |
public function form( $instance ) {
|
109 |
|
110 |
// Set defaults.
|
111 |
-
$instance = wp_parse_args(
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
|
117 |
$forms = GEM_Dispatcher::get_forms();
|
118 |
$valid_creds = (bool) get_option( 'gem-valid-creds' );
|
108 |
public function form( $instance ) {
|
109 |
|
110 |
// Set defaults.
|
111 |
+
$instance = wp_parse_args(
|
112 |
+
(array) $instance,
|
113 |
+
array(
|
114 |
+
'title' => '',
|
115 |
+
'text' => '',
|
116 |
+
'form' => 0,
|
117 |
+
)
|
118 |
+
);
|
119 |
|
120 |
$forms = GEM_Dispatcher::get_forms();
|
121 |
$valid_creds = (bool) get_option( 'gem-valid-creds' );
|
js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(i){"use strict";var a=window.GEMAdmin||{};a.init=function(){a.tabbedNav(),a.copyToClipboard()},a.tabbedNav=function(){var a=this,n=i(".about-wrap");i("div.panel",n).hide(),i(window).on("load",function(){var e=a.getParameterByName("tab"),t=window.location.hash.substr(1);i("div.updated, div.error, div.notice").not(".gem-identity").appendTo("#setting-errors"),e?i('.nav-tab-wrapper a[href="#'+e+'"]',n).click():t?i('.nav-tab-wrapper a[href="#'+t+'"]',n).click():i("div.panel:not(.hidden)",n).first().show()}),i(".nav-tab-wrapper a",n).on("click",function(){return i(".nav-tab-wrapper a",n).removeClass("nav-tab-active"),i("div.panel",n).hide(),i(this).addClass("nav-tab-active"),i("div"+i(this).attr("href"),n).show(),!1})},a.getParameterByName=function(e){var t;return e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),null===(t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search))?"":decodeURIComponent(t[1].replace(/\+/g," "))},a.copyToClipboard=function(){i(".clipboard-value").on("click",function(){this.select()}),i(".copy-to-clipboard").on("click",function(e){var t=i(i(this).data("copytarget"));if(e.preventDefault(),t&&t.select){t.click();try{document.execCommand("copy"),t.addClass("copied"),setTimeout(function(){t.blur().removeClass("copied"),document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()},1500)}catch(e){alert(a.copyFailed)}}})},i(document).ready(a.init)}(jQuery);
|
js/blocks.js
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */
|
68 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
69 |
+
|
70 |
+
"use strict";
|
71 |
+
eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__i18n_js__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icons__ = __webpack_require__(2);\n// Locale\n\n\n\n/**\n * Internal block libraries\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar SelectControl = wp.components.SelectControl;\n\n/**\n * Register block\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (registerBlockType('godaddy-email-marketing-sign-up-forms/gem-block', {\n title: __('GoDaddy Email Marketing', 'godaddy-email-marketing-sign-up-forms'),\n description: __('Display a GoDaddy email marketing form.', 'godaddy-email-marketing-sign-up-forms'),\n category: 'widgets',\n icon: __WEBPACK_IMPORTED_MODULE_1__icons__[\"a\" /* default */].mail,\n keywords: [__('GoDaddy', 'godaddy-email-marketing-sign-up-forms'), __('Email', 'godaddy-email-marketing-sign-up-forms'), __('Form', 'godaddy-email-marketing-sign-up-forms')],\n\n attributes: {\n form: {\n type: 'string',\n sourece: 'text',\n default: gem.isConnected ? gem.forms[0].value : undefined\n }\n },\n\n edit: function edit(props) {\n var form = props.attributes.form,\n isSelected = props.isSelected,\n className = props.className,\n setAttributes = props.setAttributes;\n\n\n return [\n\n // Admin Block Markup\n wp.element.createElement(\n 'div',\n { className: className, key: className },\n wp.element.createElement(\n 'div',\n { className: 'gem-forms' },\n isSelected ? getFormSelect(form, setAttributes) : wp.element.createElement(\n 'div',\n { className: 'gem-form' },\n wp.element.createElement('img', { src: gem.preloaderUrl, className: 'preloader' }),\n renderGemForm(form)\n )\n )\n )];\n },\n\n save: function save(props) {\n var form = props.attributes.form,\n className = props.className;\n\n\n if (!gem.isConnected) {\n\n return;\n }\n\n return '[gem id=' + form + ']';\n }\n}));\n\n/**\n * Generate the GoDaddy Email Marketing form select field.\n *\n * @param {integer} form Form ID\n * @param {function} setAttributes Set attributes method.\n */\nfunction getFormSelect(form, setAttributes) {\n\n if (!gem.isConnected) {\n\n return notConnectedError();\n }\n\n return wp.element.createElement(SelectControl, {\n className: 'form',\n label: __('GoDaddy Email Marketing Form', 'godaddy-email-marketing-sign-up-forms'),\n value: form,\n options: gem.forms,\n onChange: function onChange(form) {\n setAttributes({ form: form });\n }\n });\n}\n\n/**\n * Render the GoDaddy Email Marketing form markup\n *\n * @param {integer} formID Form ID\n */\nfunction renderGemForm(formID) {\n\n if (!gem.isConnected) {\n\n return notConnectedError();\n }\n\n var data = {\n 'action': 'get_gem_form',\n 'formID': formID\n };\n\n $.post(ajaxurl, data, function (response) {\n\n if (!response.success) {\n\n $('.gem-form').html(gem.getFormError);\n\n return;\n }\n\n $('.gem-form').html(response.data);\n });\n}\n\n/**\n * Render the error message when not connected to the GoDaddy Email Marketing API\n *\n * @return {mixed} Markup for the Not connected error notice.\n */\nfunction notConnectedError() {\n\n return wp.element.createElement(\n 'div',\n null,\n __('GoDaddy Email Marketing is not connected.', 'godaddy-email-marketing-sign-up-forms'),\n ' ',\n wp.element.createElement(\n 'p',\n null,\n wp.element.createElement(\n 'a',\n { 'class': 'button button-secondary', href: gem.settingsURL },\n ' ',\n __('Connect Now', 'godaddy-email-marketing-sign-up-forms')\n )\n )\n );\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9ibG9ja3MuanM/MzUxMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBMb2NhbGVcbmltcG9ydCAnLi9pMThuLmpzJztcbmltcG9ydCBnZW1JY29ucyBmcm9tICcuL2ljb25zJztcblxuLyoqXG4gKiBJbnRlcm5hbCBibG9jayBsaWJyYXJpZXNcbiAqL1xudmFyIF9fID0gd3AuaTE4bi5fXztcbnZhciByZWdpc3RlckJsb2NrVHlwZSA9IHdwLmJsb2Nrcy5yZWdpc3RlckJsb2NrVHlwZTtcbnZhciBTZWxlY3RDb250cm9sID0gd3AuY29tcG9uZW50cy5TZWxlY3RDb250cm9sO1xuXG4vKipcbiAqIFJlZ2lzdGVyIGJsb2NrXG4gKi9cblxuZXhwb3J0IGRlZmF1bHQgcmVnaXN0ZXJCbG9ja1R5cGUoJ2dvZGFkZHktZW1haWwtbWFya2V0aW5nLXNpZ24tdXAtZm9ybXMvZ2VtLWJsb2NrJywge1xuICB0aXRsZTogX18oJ0dvRGFkZHkgRW1haWwgTWFya2V0aW5nJywgJ2dvZGFkZHktZW1haWwtbWFya2V0aW5nLXNpZ24tdXAtZm9ybXMnKSxcbiAgZGVzY3JpcHRpb246IF9fKCdEaXNwbGF5IGEgR29EYWRkeSBlbWFpbCBtYXJrZXRpbmcgZm9ybS4nLCAnZ29kYWRkeS1lbWFpbC1tYXJrZXRpbmctc2lnbi11cC1mb3JtcycpLFxuICBjYXRlZ29yeTogJ3dpZGdldHMnLFxuICBpY29uOiBnZW1JY29ucy5tYWlsLFxuICBrZXl3b3JkczogW19fKCdHb0RhZGR5JywgJ2dvZGFkZHktZW1haWwtbWFya2V0aW5nLXNpZ24tdXAtZm9ybXMnKSwgX18oJ0V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charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pMThuLmpzP2YyMDIiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFNldCBMb2NhbGVcbiAqL1xud3AuaTE4bi5zZXRMb2NhbGVEYXRhKHsgJyc6IHt9IH0sICdnb2RhZGR5LWVtYWlsLW1hcmtldGluZy1zaWduLXVwLWZvcm1zJyk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9pbmNsdWRlcy9ibG9ja3MvaTE4bi5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n");
|
78 |
+
|
79 |
+
/***/ }),
|
80 |
+
/* 2 */
|
81 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
82 |
+
|
83 |
+
"use strict";
|
84 |
+
eval("var gemIcons = {};\n\ngemIcons.mail = wp.element.createElement(\n \"svg\",\n {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"20pt\",\n height: \"22pt\",\n viewBox: \"0 0 20 22\",\n version: \"1.1\"\n },\n wp.element.createElement(\n \"g\",\n { id: \"surface1\" },\n wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }, d: \"M 0.0390625, 11.097656 L 1.925781, 22 L 19.960938, 18.109375, L 19.960938, 6.890625, L 11.371094, 15.828125, Z M 0.0390625, 11.097656 \" }),\n wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }, d: \"M 9.882812, 6.632812 C 6.785156, 7.230469, 0.164062, 9.597656, 0.164062, 9.597656, L 11.171875, 14.9375, L 19.289062, 5.828125, C 19.289062, 5.816406, 13.042969, 6.011719, 9.882812, 6.632812, Z M 9.882812, 6.632812 \" }),\n wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,66.27451%,16.470588%)', fillOpacity: '1' }, d: \"M 0.164062, 9.597656 C 0.164062, 9.597656, 6.472656, 8.304688, 9.484375, 7.71875, L 19.277344, 5.816406, L 8.628906, 0 Z M 0.164062, 9.597656 \" })\n )\n);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (gemIcons);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pY29ucy5qcz9hZjhkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnZW1JY29ucyA9IHt9O1xuXG5nZW1JY29ucy5tYWlsID0gd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICBcInN2Z1wiLFxuICB7XG4gICAgeG1sbnM6IFwiaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmdcIixcbiAgICB3aWR0aDogXCIyMHB0XCIsXG4gICAgaGVpZ2h0OiBcIjIycHRcIixcbiAgICB2aWV3Qm94OiBcIjAgMCAyMCAyMlwiLFxuICAgIHZlcnNpb246IFwiMS4xXCJcbiAgfSxcbiAgd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICAgIFwiZ1wiLFxuICAgIHsgaWQ6IFwic3VyZmFjZTFcIiB9LFxuICAgIHdwLmVsZW1lbnQuY3JlYXRlRWxlbWVudChcInBhdGhcIiwgeyBzdHlsZTogeyBzdHJva2U6ICdub25lJywgZmlsbFJ1bGU6ICdub256ZXJvJywgZmlsbDogJ3JnYigyMy4xMzcyNTUlLDc2LjA3ODQ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kuNDg0Mzc1LCA3LjcxODc1LCBMIDE5LjI3NzM0NCwgNS44MTY0MDYsIEwgOC42Mjg5MDYsIDAgWiBNIDAuMTY0MDYyLCA5LjU5NzY1NiBcIiB9KVxuICApXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBnZW1JY29ucztcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2luY2x1ZGVzL2Jsb2Nrcy9pY29ucy5qc1xuLy8gbW9kdWxlIGlkID0gMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n");
|
85 |
+
|
86 |
+
/***/ })
|
87 |
+
/******/ ]);
|
js/blocks.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){var c={};function g(n){if(c[n])return c[n].exports;var e=c[n]={i:n,l:!1,exports:{}};return t[n].call(e.exports,e,e.exports,g),e.l=!0,e.exports}g.m=t,g.c=c,g.d=function(n,e,t){g.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},g.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return g.d(e,"a",e),e},g.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},g.p="",g(g.s=0)}([function(module,__webpack_exports__,__webpack_require__){"use strict";eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__i18n_js__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icons__ = __webpack_require__(2);\n// Locale\n\n\n\n/**\n * Internal block libraries\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar SelectControl = wp.components.SelectControl;\n\n/**\n * Register block\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (registerBlockType('godaddy-email-marketing-sign-up-forms/gem-block', {\n title: __('GoDaddy Email Marketing', 'godaddy-email-marketing-sign-up-forms'),\n description: __('Display a GoDaddy email marketing form.', 'godaddy-email-marketing-sign-up-forms'),\n category: 'widgets',\n icon: __WEBPACK_IMPORTED_MODULE_1__icons__[\"a\" /* default */].mail,\n keywords: [__('GoDaddy', 'godaddy-email-marketing-sign-up-forms'), __('Email', 'godaddy-email-marketing-sign-up-forms'), __('Form', 'godaddy-email-marketing-sign-up-forms')],\n\n attributes: {\n form: {\n type: 'string',\n sourece: 'text',\n default: gem.isConnected ? gem.forms[0].value : undefined\n }\n },\n\n edit: function edit(props) {\n var form = props.attributes.form,\n isSelected = props.isSelected,\n className = props.className,\n setAttributes = props.setAttributes;\n\n\n return [\n\n // Admin Block Markup\n wp.element.createElement(\n 'div',\n { className: className, key: className },\n wp.element.createElement(\n 'div',\n { className: 'gem-forms' },\n isSelected ? getFormSelect(form, setAttributes) : wp.element.createElement(\n 'div',\n { className: 'gem-form' },\n wp.element.createElement('img', { src: gem.preloaderUrl, className: 'preloader' }),\n renderGemForm(form)\n )\n )\n )];\n },\n\n save: function save(props) {\n var form = props.attributes.form,\n className = props.className;\n\n\n if (!gem.isConnected) {\n\n return;\n }\n\n return '[gem id=' + form + ']';\n }\n}));\n\n/**\n * Generate the GoDaddy Email Marketing form select field.\n *\n * @param {integer} form Form ID\n * @param {function} setAttributes Set attributes method.\n */\nfunction getFormSelect(form, setAttributes) {\n\n if (!gem.isConnected) {\n\n return notConnectedError();\n }\n\n return wp.element.createElement(SelectControl, {\n className: 'form',\n label: __('GoDaddy Email Marketing Form', 'godaddy-email-marketing-sign-up-forms'),\n value: form,\n options: gem.forms,\n onChange: function onChange(form) {\n setAttributes({ form: form });\n }\n });\n}\n\n/**\n * Render the GoDaddy Email Marketing form markup\n *\n * @param {integer} formID Form ID\n */\nfunction renderGemForm(formID) {\n\n if (!gem.isConnected) {\n\n return notConnectedError();\n }\n\n var data = {\n 'action': 'get_gem_form',\n 'formID': formID\n };\n\n $.post(ajaxurl, data, function (response) {\n\n if (!response.success) {\n\n $('.gem-form').html(gem.getFormError);\n\n return;\n }\n\n $('.gem-form').html(response.data);\n });\n}\n\n/**\n * Render the error message when not connected to the GoDaddy Email Marketing API\n *\n * @return {mixed} Markup for the Not connected error notice.\n */\nfunction notConnectedError() {\n\n return wp.element.createElement(\n 'div',\n null,\n __('GoDaddy Email Marketing is not connected.', 'godaddy-email-marketing-sign-up-forms'),\n ' ',\n wp.element.createElement(\n 'p',\n null,\n wp.element.createElement(\n 'a',\n { 'class': 'button button-secondary', href: gem.settingsURL },\n ' ',\n __('Connect Now', 'godaddy-email-marketing-sign-up-forms')\n )\n )\n );\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9ibG9ja3MuanM/MzUxMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBMb2NhbGVcbmltcG9ydCAnLi9pMThuLmpzJztcbmltcG9ydCBnZW1JY29ucyBmcm9tICcuL2ljb25zJztcblxuLyoqXG4gKiBJbnRlcm5hbCBibG9jayBsaWJyYXJpZXNcbiAqL1xudmFyIF9fID0gd3AuaTE4bi5fXztcbnZhciByZWdpc3RlckJsb2NrVHlwZSA9IHdwLmJsb2Nrcy5yZWdpc3RlckJsb2NrVHlwZTtcbnZhciBTZWxlY3RDb250cm9sID0gd3AuY29tcG9uZW50cy5TZWxlY3RDb250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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("/*\n * Set Locale\n */\nwp.i18n.setLocaleData({ '': {} }, 'godaddy-email-marketing-sign-up-forms');//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pMThuLmpzP2YyMDIiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFNldCBMb2NhbGVcbiAqL1xud3AuaTE4bi5zZXRMb2NhbGVEYXRhKHsgJyc6IHt9IH0sICdnb2RhZGR5LWVtYWlsLW1hcmtldGluZy1zaWduLXVwLWZvcm1zJyk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9pbmNsdWRlcy9ibG9ja3MvaTE4bi5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('var gemIcons = {};\n\ngemIcons.mail = wp.element.createElement(\n "svg",\n {\n xmlns: "http://www.w3.org/2000/svg",\n width: "20pt",\n height: "22pt",\n viewBox: "0 0 20 22",\n version: "1.1"\n },\n wp.element.createElement(\n "g",\n { id: "surface1" },\n wp.element.createElement("path", { style: { stroke: \'none\', fillRule: \'nonzero\', fill: \'rgb(23.137255%,76.078431%,18.039216%)\', fillOpacity: \'1\' }, d: "M 0.0390625, 11.097656 L 1.925781, 22 L 19.960938, 18.109375, L 19.960938, 6.890625, L 11.371094, 15.828125, Z M 0.0390625, 11.097656 " }),\n wp.element.createElement("path", { style: { stroke: \'none\', fillRule: \'nonzero\', fill: \'rgb(23.137255%,76.078431%,18.039216%)\', fillOpacity: \'1\' }, d: "M 9.882812, 6.632812 C 6.785156, 7.230469, 0.164062, 9.597656, 0.164062, 9.597656, L 11.171875, 14.9375, L 19.289062, 5.828125, C 19.289062, 5.816406, 13.042969, 6.011719, 9.882812, 6.632812, Z M 9.882812, 6.632812 " }),\n wp.element.createElement("path", { style: { stroke: \'none\', fillRule: \'nonzero\', fill: \'rgb(23.137255%,66.27451%,16.470588%)\', fillOpacity: \'1\' }, d: "M 0.164062, 9.597656 C 0.164062, 9.597656, 6.472656, 8.304688, 9.484375, 7.71875, L 19.277344, 5.816406, L 8.628906, 0 Z M 0.164062, 9.597656 " })\n )\n);\n\n/* harmony default export */ __webpack_exports__["a"] = (gemIcons);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pY29ucy5qcz9hZjhkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnZW1JY29ucyA9IHt9O1xuXG5nZW1JY29ucy5tYWlsID0gd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICBcInN2Z1wiLFxuICB7XG4gICAgeG1sbnM6IFwiaHR0cDovL3d3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A2LCAxMy4wNDI5NjksIDYuMDExNzE5LCA5Ljg4MjgxMiwgNi42MzI4MTIsIFogTSA5Ljg4MjgxMiwgNi42MzI4MTIgXCIgfSksXG4gICAgd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFwicGF0aFwiLCB7IHN0eWxlOiB7IHN0cm9rZTogJ25vbmUnLCBmaWxsUnVsZTogJ25vbnplcm8nLCBmaWxsOiAncmdiKDIzLjEzNzI1NSUsNjYuMjc0NTElLDE2LjQ3MDU4OCUpJywgZmlsbE9wYWNpdHk6ICcxJyB9LCBkOiBcIk0gMC4xNjQwNjIsIDkuNTk3NjU2IEMgMC4xNjQwNjIsIDkuNTk3NjU2LCA2LjQ3MjY1NiwgOC4zMDQ2ODgsIDkuNDg0Mzc1LCA3LjcxODc1LCBMIDE5LjI3NzM0NCwgNS44MTY0MDYsIEwgOC42Mjg5MDYsIDAgWiBNIDAuMTY0MDYyLCA5LjU5NzY1NiBcIiB9KVxuICApXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBnZW1JY29ucztcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL2luY2x1ZGVzL2Jsb2Nrcy9pY29ucy5qc1xuLy8gbW9kdWxlIGlkID0gMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n')}]);
|
js/gem.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(o){"use strict";var l=window.GEM||{};l.DEBUG_FLAG=!0,l.init=function(){o("form.gem-form").submit(function(e){var i,t,a,s,n,r=o(this),u=o(".gem-spinner",r),h=r.find(".gem-error, .gem-info"),c=[],d=[];e.preventDefault(),o(this).find("input[type=checkbox]").each(function(){var e=o(this).data("name");t!==e&&(a=o('input:checkbox[data-name="'+(t=e)+'"]:checked').map(function(){return this.value}).get().join(", "),o('input[name="'+e+'"]').val(a))}),o(this).find("[fingerprint=date]").each(function(){var e=o(this).data("name");s!==e&&(o('select[data-name="'+(s=e)+'"]').each(function(){var e=o(this).val();e&&d.push(e)}),3===d.length&&(n=d[0]+" "+d[1]+", "+d[2],o('input[name="'+e+'"]').val(n)))}),i=o(this).serialize(),r.find("input.gem-invalid").removeClass("gem-invalid"),o(this).find(".gem-required").each(function(){var e=o(this).val();"signup[email]"!==o(this).attr("name")||l.isEmail(e)?""===e&&o(this).is("input")?c.push(o(this)):o(this).is('input[type="checkbox"]')&&!o(this).is(":checked")?c.push(o(this)):o(this).is("label")&&void 0===o('input:radio[name="'+o(this).data("name")+'"]:checked').val()&&c.push(o(this)):c.push(o(this))}),0===c.length?(u.css("display","inline-block"),o.post(r.attr("action")+".json",i,function(i){r.fadeOut("fast",function(){var e;i.success?(e=i.result.audience_member.suppressed,i.result.has_redirect&&(window.location.href=i.result.redirect),r.html(l.addMessage(e?["suppressed","success"]:["info","success"],e?l.thankyou_suppressed:l.thankyou)).fadeIn("fast")):r.html(l.addMessage("info",l.oops)).fadeIn("fast")})},"jsonp")):(0!==h.length&&h.remove(),o(c.reverse()).each(function(){var e="";o(this).addClass("gem-invalid"),"signup[email]"===o(this).attr("name")?e=""===o(this).val()?l.required.replace("%s",o(this).data("label")):l.email:o(this).data("label")&&(e=l.required.replace("%s",o(this).data("label"))),e&&r.prepend(l.addMessage("error",e))}))})},l.addMessage=function(e,i){var t=[];return o.isArray(e)?o.each(e,function(e,i){t.push("gem-"+i)}):t.push("gem-"+e.toString()),o("<p/>",{class:t.join(" ")}).text(i)},l.isEmail=function(e){return/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)},o(document).ready(l.init)}(jQuery);
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: godaddy, fjarrett, jonathanbardo, eherman24, susanygodaddy, madmimi
|
3 |
Tags: email, forms, godaddy, mailing list, marketing, newsletter, opt-in, signup, subscribe, widget, contacts
|
4 |
Requires at least: 3.8
|
5 |
-
Tested up to:
|
6 |
-
Stable tag: 1.
|
7 |
License: GPL-2.0
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -112,9 +112,15 @@ You can find your **Secret API Key** in the [Settings section](https://gem.godad
|
|
112 |
2. A full list of your GoDaddy Email Marketing Webforms, with ready shortcodes.
|
113 |
3. The widget, on the widgets page.
|
114 |
4. The widget, on the front-end.
|
|
|
|
|
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
118 |
= 1.3.0 =
|
119 |
* New: Add support for GDPR fields (Age consent, terms of service and tracking option)
|
120 |
* Fix: Update text domain to match plugin slug.
|
2 |
Contributors: godaddy, fjarrett, jonathanbardo, eherman24, susanygodaddy, madmimi
|
3 |
Tags: email, forms, godaddy, mailing list, marketing, newsletter, opt-in, signup, subscribe, widget, contacts
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 5.0
|
6 |
+
Stable tag: 1.4.0
|
7 |
License: GPL-2.0
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
112 |
2. A full list of your GoDaddy Email Marketing Webforms, with ready shortcodes.
|
113 |
3. The widget, on the widgets page.
|
114 |
4. The widget, on the front-end.
|
115 |
+
5. GoDaddy Email Marketing widget block.
|
116 |
+
6. GoDaddy Email Marketing widget preview, in the block editor.
|
117 |
+
7. GoDaddy Email Marketing widget, on the block front-end.
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
= 1.4.0 =
|
122 |
+
* New: Introduce GoDaddy Email Marketing content block.
|
123 |
+
|
124 |
= 1.3.0 =
|
125 |
* New: Add support for GDPR fields (Age consent, terms of service and tracking option)
|
126 |
* Fix: Update text domain to match plugin slug.
|