diff --git a/.eslintrc.es5.json b/.eslintrc.es5.json index 9d0ce5f413..399dee4fb8 100644 --- a/.eslintrc.es5.json +++ b/.eslintrc.es5.json @@ -77,7 +77,6 @@ "keyword-spacing": 0, "eol-last": 0, "dot-notation": 0, - "linebreak-style": 0, "indent": 0, "prefer-template": 0, "func-names": 0 diff --git a/assets/js/src/admin.js b/assets/js/src/admin.js index 07a2752df9..854f7757aa 100644 --- a/assets/js/src/admin.js +++ b/assets/js/src/admin.js @@ -1,12 +1,12 @@ -define('admin', [ - 'jquery' - ], - function(jQuery) { - jQuery(function($) { - // dom ready - $(function() { - - }); - }); - } -); +define('admin', [ + 'jquery' + ], + function(jQuery) { + jQuery(function($) { + // dom ready + $(function() { + + }); + }); + } +); diff --git a/assets/js/src/public.js b/assets/js/src/public.js index 4b3d570603..84f686b608 100644 --- a/assets/js/src/public.js +++ b/assets/js/src/public.js @@ -1,87 +1,87 @@ -define([ - 'mailpoet', - 'jquery', - 'parsleyjs' -], -function( - MailPoet, - jQuery, - Parsley -) { - jQuery(function($) { - function isSameDomain(url) { - var link = document.createElement('a'); - link.href = url; - return (window.location.hostname === link.hostname); - } - - $(function() { - // setup form validation - $('form.mailpoet_form').each(function() { - var form = $(this); - - form.parsley().on('form:validated', function(parsley) { - // clear messages - form.find('.mailpoet_message > p').hide(); - - // resize iframe - if(window.frameElement !== null) { - MailPoet.Iframe.autoSize(window.frameElement); - } - }); - - form.parsley().on('form:submit', function(parsley) { - var form_data = form.serializeObject() || {}; - // check if we're on the same domain - if(isSameDomain(MailPoetForm.ajax_url) === false) { - // non ajax post request - return true; - } else { - // ajax request - MailPoet.Ajax.post({ - url: MailPoetForm.ajax_url, - token: form_data.token, - api_version: form_data.api_version, - endpoint: 'subscribers', - action: 'subscribe', - data: form_data.data - }).fail(function(response) { - form.find('.mailpoet_validate_error').html( - response.errors.map(function(error) { - return error.message; - }).join('
') - ).show(); - }).done(function(response) { - // successfully subscribed - if ( - response.meta !== undefined - && response.meta.redirect_url !== undefined - ) { - // go to page - window.location.href = response.meta.redirect_url; - } else { - // display success message - form.find('.mailpoet_validate_success').show(); - } - - // reset form - form.trigger('reset'); - // reset validation - parsley.reset(); - - // resize iframe - if ( - window.frameElement !== null - && MailPoet !== undefined - && MailPoet['Iframe'] - ) { - MailPoet.Iframe.autoSize(window.frameElement); - } - }); - } - return false; - }); - }); - }); - }); +define([ + 'mailpoet', + 'jquery', + 'parsleyjs' +], +function( + MailPoet, + jQuery, + Parsley +) { + jQuery(function($) { + function isSameDomain(url) { + var link = document.createElement('a'); + link.href = url; + return (window.location.hostname === link.hostname); + } + + $(function() { + // setup form validation + $('form.mailpoet_form').each(function() { + var form = $(this); + + form.parsley().on('form:validated', function(parsley) { + // clear messages + form.find('.mailpoet_message > p').hide(); + + // resize iframe + if(window.frameElement !== null) { + MailPoet.Iframe.autoSize(window.frameElement); + } + }); + + form.parsley().on('form:submit', function(parsley) { + var form_data = form.serializeObject() || {}; + // check if we're on the same domain + if(isSameDomain(MailPoetForm.ajax_url) === false) { + // non ajax post request + return true; + } else { + // ajax request + MailPoet.Ajax.post({ + url: MailPoetForm.ajax_url, + token: form_data.token, + api_version: form_data.api_version, + endpoint: 'subscribers', + action: 'subscribe', + data: form_data.data + }).fail(function(response) { + form.find('.mailpoet_validate_error').html( + response.errors.map(function(error) { + return error.message; + }).join('
') + ).show(); + }).done(function(response) { + // successfully subscribed + if ( + response.meta !== undefined + && response.meta.redirect_url !== undefined + ) { + // go to page + window.location.href = response.meta.redirect_url; + } else { + // display success message + form.find('.mailpoet_validate_success').show(); + } + + // reset form + form.trigger('reset'); + // reset validation + parsley.reset(); + + // resize iframe + if ( + window.frameElement !== null + && MailPoet !== undefined + && MailPoet['Iframe'] + ) { + MailPoet.Iframe.autoSize(window.frameElement); + } + }); + } + return false; + }); + }); + }); + }); }); \ No newline at end of file