ES5 space-before-function-parens
This commit is contained in:
@@ -3,24 +3,24 @@ define([
|
||||
'jquery',
|
||||
'parsleyjs'
|
||||
],
|
||||
function(
|
||||
function (
|
||||
MailPoet,
|
||||
jQuery,
|
||||
Parsley
|
||||
) {
|
||||
jQuery(function($) {
|
||||
jQuery(function ($) {
|
||||
function isSameDomain(url) {
|
||||
var link = document.createElement('a');
|
||||
link.href = url;
|
||||
return (window.location.hostname === link.hostname);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
// setup form validation
|
||||
$('form.mailpoet_form').each(function() {
|
||||
$('form.mailpoet_form').each(function () {
|
||||
var form = $(this);
|
||||
|
||||
form.parsley().on('form:validated', function(parsley) {
|
||||
form.parsley().on('form:validated', function (parsley) {
|
||||
// clear messages
|
||||
form.find('.mailpoet_message > p').hide();
|
||||
|
||||
@@ -30,7 +30,7 @@ function(
|
||||
}
|
||||
});
|
||||
|
||||
form.parsley().on('form:submit', function(parsley) {
|
||||
form.parsley().on('form:submit', function (parsley) {
|
||||
var form_data = form.serializeObject() || {};
|
||||
// check if we're on the same domain
|
||||
if(isSameDomain(window.MailPoetForm.ajax_url) === false) {
|
||||
@@ -45,13 +45,13 @@ function(
|
||||
endpoint: 'subscribers',
|
||||
action: 'subscribe',
|
||||
data: form_data.data
|
||||
}).fail(function(response) {
|
||||
}).fail(function (response) {
|
||||
form.find('.mailpoet_validate_error').html(
|
||||
response.errors.map(function(error) {
|
||||
response.errors.map(function (error) {
|
||||
return error.message;
|
||||
}).join('<br />')
|
||||
).show();
|
||||
}).done(function(response) {
|
||||
}).done(function (response) {
|
||||
// successfully subscribed
|
||||
if (
|
||||
response.meta !== undefined
|
||||
|
Reference in New Issue
Block a user