-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix deploy task * Add npmrc * Update travis config * Support banners and youtube in readme, add video * Use hqdefault for video thumbnail * GoLF Automated checkin by kchien (2/21/2017 4:30:02 PM) * Update cssmin package ver * Fix makepot task * Update POT * Update mo * Bump tested up to 4.8 * Bump tested up to * Switch wp_nonce to _wpnonce. Fix failing check_admin_referer when action === 'refresh' * Update devDependencies * set dist: precise for 5.2 * set dist: precise for 5.2 * Temporarily disable PHP 5.2. See travis-ci/travis-ci#8072 * Update dev dependencies. Re-grunt * Update changelog with 1.2.1 changes * Change Text Domain to Match WordPress.org Plugin Slug (#26) * update text domain for interested translators on translation.wordpress.org to work on plugin strings. * change text domain to match plugin slug in comments * fixing according to travis ci warnings only the i18n warnings. * more fixes based on travis ci output * fixing other warnings * one more warning * renamed language files to match text domain https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#loading-text-domain * Add GDPR Support (#28) * Add support for GDPR fields. * Update gruntfile and npm dependencies * Add comment for tos_link * Resolve PHPCS warnings. Update phpcs.ruleset.xml. * Remove test filter * Add xmllint addon to travis build config * Double check for method before calling it. Update checkbox field value to match disply text. * Update gem-form-fields test to asset invalid_field_type returns empty. * Readd vendor dir to PHPCS exclusion * Add test for tos_link * Add test for tracking_option * Remove chrome from travis addons * Remove print * Add spacing for phpcs warnings * Add required checkboxes to error checking * Update update-pot grunt task. Regenerate translations after i18n function updates and updated i18n comments * Update read for 1.3.0 release * [dist] update packages * [dist] New package-lock * Introduce GEM Gutenberg block (#31) * Start to build out GEM gutenberg block * Save block output with proper shortcode * Add .babelrbs and webpack.config.js to .distignore * Resolve PHPCS warnings * Dynamically generate the GEM form in the GEM block * Bump tested up to version to 5.0 * Fix PHPCS spacing * Dynamic gem block * Update dynamic blocks * Add GEM block screenshots and update readme * Clean up UX during block addition/form selection. Cleanup JS file. * Add docblock to class prop * Update changelog, regenerate readme
- Loading branch information
Evan Herman
committed
Dec 13, 2018
1 parent
410420c
commit d8a8dee
Showing
31 changed files
with
10,078 additions
and
3,960 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "@wordpress/default" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ languages/*.po | |
node_modules/ | ||
tests/ | ||
vendor/ | ||
.babelrbc | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
margin: 10px 20px 0 2px; | ||
} | ||
|
||
.about-wrap img { | ||
width: 15px; | ||
} | ||
|
||
.intro { | ||
float: left; | ||
width: 100%; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.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; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
// Locale | ||
import './i18n.js'; | ||
import gemIcons from './icons'; | ||
|
||
/** | ||
* Internal block libraries | ||
*/ | ||
const { __ } = wp.i18n; | ||
|
||
const { | ||
registerBlockType | ||
} = wp.blocks; | ||
|
||
const { | ||
SelectControl | ||
} = wp.components; | ||
|
||
/** | ||
* Register block | ||
*/ | ||
export default registerBlockType( 'godaddy-email-marketing-sign-up-forms/gem-block', { | ||
title: __( 'GoDaddy Email Marketing', 'godaddy-email-marketing-sign-up-forms' ), | ||
description: __( 'Display a GoDaddy email marketing form.', 'godaddy-email-marketing-sign-up-forms' ), | ||
category: 'widgets', | ||
icon: gemIcons.mail, | ||
keywords: [ | ||
__( 'GoDaddy', 'godaddy-email-marketing-sign-up-forms' ), | ||
__( 'Email', 'godaddy-email-marketing-sign-up-forms' ), | ||
__( 'Form', 'godaddy-email-marketing-sign-up-forms' ), | ||
], | ||
|
||
attributes: { | ||
form: { | ||
type: 'string', | ||
sourece: 'text', | ||
default: gem.isConnected ? gem.forms[0].value : undefined, | ||
}, | ||
}, | ||
|
||
edit: props => { | ||
|
||
const { attributes: { form }, isSelected, className, setAttributes } = props; | ||
|
||
return [ | ||
|
||
// Admin Block Markup | ||
<div className={ className } key={ className }> | ||
<div className="gem-forms"> | ||
{ isSelected ? ( | ||
getFormSelect( form, setAttributes ) | ||
) : ( <div className="gem-form"><img src={ gem.preloaderUrl } className="preloader" />{ renderGemForm( form ) }</div> ) } | ||
</div> | ||
</div> | ||
|
||
]; | ||
}, | ||
|
||
save: props => { | ||
const { attributes: { form }, className } = props; | ||
|
||
if ( ! gem.isConnected ) { | ||
|
||
return; | ||
|
||
} | ||
|
||
return ( '[gem id=' + form + ']' ); | ||
}, | ||
} ); | ||
|
||
/** | ||
* Generate the GoDaddy Email Marketing form select field. | ||
* | ||
* @param {integer} form Form ID | ||
* @param {function} setAttributes Set attributes method. | ||
*/ | ||
function getFormSelect( form, setAttributes ) { | ||
|
||
if ( ! gem.isConnected ) { | ||
|
||
return notConnectedError(); | ||
|
||
} | ||
|
||
return <SelectControl | ||
className="form" | ||
label={ __( 'Gem Form', 'godaddy-email-marketing-sign-up-forms' ) } | ||
value={ form } | ||
options={ gem.forms } | ||
onChange={ ( form ) => { setAttributes( { form } ) } } | ||
/> | ||
|
||
} | ||
|
||
/** | ||
* Render the GoDaddy Email Marketing form markup | ||
* | ||
* @param {integer} formID Form ID | ||
*/ | ||
function renderGemForm( formID ) { | ||
|
||
if ( ! gem.isConnected ) { | ||
|
||
return notConnectedError(); | ||
|
||
} | ||
|
||
var data = { | ||
'action': 'get_gem_form', | ||
'formID': formID, | ||
}; | ||
|
||
$.post( ajaxurl, data, function( response ) { | ||
|
||
if ( ! response.success ) { | ||
|
||
$( '.gem-form' ).html( gem.getFormError ); | ||
|
||
return; | ||
|
||
} | ||
|
||
$( '.gem-form' ).html( response.data ); | ||
|
||
} ); | ||
|
||
} | ||
|
||
/** | ||
* Render the error message when not connected to the GoDaddy Email Marketing API | ||
* | ||
* @return {mixed} Markup for the Not connected error notice. | ||
*/ | ||
function notConnectedError() { | ||
|
||
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>; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
* Set Locale | ||
*/ | ||
wp.i18n.setLocaleData( { '': {} }, 'godaddy-email-marketing-sign-up-forms' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const gemIcons = {}; | ||
|
||
gemIcons.mail = <svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="20pt" | ||
height="22pt" | ||
viewBox="0 0 20 22" | ||
version="1.1" | ||
> | ||
<g id="surface1"> | ||
<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 "/> | ||
<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 "/> | ||
<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 "/> | ||
</g> | ||
</svg>; | ||
|
||
export default gemIcons; |
Oops, something went wrong.