Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | MailChimp for WordPress |
Version | 4.1.10 |
Comparing to | |
See all releases |
Code changes from version 4.1.9 to 4.1.10
- CHANGELOG.md +12 -0
- assets/js/forms-api.js +3 -5
- assets/js/forms-api.min.js +1 -1
- assets/js/forms-api.min.js.map +1 -1
- includes/forms/class-admin.php +1 -3
- integrations/bootstrap.php +4 -3
- integrations/gravity-forms/admin-before.php +3 -0
- integrations/gravity-forms/bootstrap.php +9 -0
- integrations/gravity-forms/class-field.php +114 -0
- integrations/gravity-forms/class-gravity-forms.php +137 -0
- integrations/ninja-forms/class-action.php +24 -33
- integrations/ninja-forms/class-ninja-forms.php +28 -1
- integrations/wpforms/class-wpforms.php +8 -2
- languages/mailchimp-for-wp-ca_ES.mo +0 -0
- languages/mailchimp-for-wp-ca_ES.po +1 -1
- languages/mailchimp-for-wp-cs_CZ.mo +0 -0
- languages/mailchimp-for-wp-cs_CZ.po +716 -503
- languages/mailchimp-for-wp-da_DK.mo +0 -0
- languages/mailchimp-for-wp-da_DK.po +1 -1
- languages/mailchimp-for-wp-de_CH.mo +0 -0
- languages/mailchimp-for-wp-de_CH.po +716 -503
- languages/mailchimp-for-wp-de_DE.mo +0 -0
- languages/mailchimp-for-wp-de_DE.po +1 -1
- languages/mailchimp-for-wp-el_GR.mo +0 -0
- languages/mailchimp-for-wp-el_GR.po +716 -503
- languages/mailchimp-for-wp-es_ES.mo +0 -0
- languages/mailchimp-for-wp-es_ES.po +1 -1
- languages/mailchimp-for-wp-fa_IR.mo +0 -0
- languages/mailchimp-for-wp-fa_IR.po +57 -56
- languages/mailchimp-for-wp-fi_FI.mo +0 -0
- languages/mailchimp-for-wp-fi_FI.po +717 -504
- languages/mailchimp-for-wp-fr_FR.mo +0 -0
- languages/mailchimp-for-wp-fr_FR.po +2 -2
- languages/mailchimp-for-wp-hu_HU.mo +0 -0
- languages/mailchimp-for-wp-hu_HU.po +731 -517
- languages/mailchimp-for-wp-it_IT.mo +0 -0
- languages/mailchimp-for-wp-it_IT.po +1 -1
- languages/mailchimp-for-wp-ja_JP.mo +0 -0
- languages/mailchimp-for-wp-ja_JP.po +1 -1
- languages/mailchimp-for-wp-nl_NL.mo +0 -0
- languages/mailchimp-for-wp-nl_NL.po +1 -1
- languages/mailchimp-for-wp-pl_PL.mo +0 -0
- languages/mailchimp-for-wp-pl_PL.po +2 -2
- languages/mailchimp-for-wp-pt_BR.mo +0 -0
- languages/mailchimp-for-wp-pt_BR.po +1 -1
- languages/mailchimp-for-wp-ru_RU.mo +0 -0
- languages/mailchimp-for-wp-ru_RU.po +1 -1
- languages/mailchimp-for-wp-sv_SE.mo +0 -0
- languages/mailchimp-for-wp-sv_SE.po +1 -1
- languages/mailchimp-for-wp-tr_TR.mo +0 -0
- languages/mailchimp-for-wp-tr_TR.po +1 -1
- languages/mailchimp-for-wp-vi_VN.mo +0 -0
- languages/mailchimp-for-wp-vi_VN.po +716 -503
- languages/mailchimp-for-wp.pot +47 -47
- mailchimp-for-wp.php +3 -2
- readme.txt +16 -3
- vendor/autoload_52.php +1 -1
- vendor/composer/autoload_classmap.php +2 -0
- vendor/composer/autoload_psr4.php +0 -1
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/autoload_static.php +2 -16
CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1 |
Changelog
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
#### 4.1.9 - September 19, 2017
|
5 |
|
6 |
**Improvements**
|
1 |
Changelog
|
2 |
=========
|
3 |
|
4 |
+
#### 4.1.10 - October 19, 2017
|
5 |
+
|
6 |
+
**Improvements**
|
7 |
+
|
8 |
+
- Remove unused options from Ninja Forms integration.
|
9 |
+
- Now logging all sign-ups from Ninja Forms integrations when using [MailChimp for WordPress Premium](https://mc4wp.com/premium-features/).
|
10 |
+
|
11 |
+
**Additions**
|
12 |
+
|
13 |
+
- Added Gravity Forms integration. You can now integrate with Gravity Forms by adding the "MailChimp" field to your forms.
|
14 |
+
|
15 |
+
|
16 |
#### 4.1.9 - September 19, 2017
|
17 |
|
18 |
**Improvements**
|
assets/js/forms-api.js
CHANGED
@@ -12,9 +12,7 @@ var config = window.mc4wp_forms_config || {};
|
|
12 |
function scrollToForm(form) {
|
13 |
var animate = config.auto_scroll === 'animated';
|
14 |
var args = {
|
15 |
-
behavior: animate ? "smooth" : "instant"
|
16 |
-
block: "center",
|
17 |
-
inline: "center"
|
18 |
};
|
19 |
form.element.scrollIntoView(args);
|
20 |
}
|
@@ -174,11 +172,11 @@ Form.prototype.setData = function (data) {
|
|
174 |
};
|
175 |
|
176 |
Form.prototype.getData = function () {
|
177 |
-
return serialize(this.element, { hash: true });
|
178 |
};
|
179 |
|
180 |
Form.prototype.getSerializedData = function () {
|
181 |
-
return serialize(this.element);
|
182 |
};
|
183 |
|
184 |
Form.prototype.setResponse = function (msg) {
|
12 |
function scrollToForm(form) {
|
13 |
var animate = config.auto_scroll === 'animated';
|
14 |
var args = {
|
15 |
+
behavior: animate ? "smooth" : "instant"
|
|
|
|
|
16 |
};
|
17 |
form.element.scrollIntoView(args);
|
18 |
}
|
172 |
};
|
173 |
|
174 |
Form.prototype.getData = function () {
|
175 |
+
return serialize(this.element, { hash: true, empty: true });
|
176 |
};
|
177 |
|
178 |
Form.prototype.getSerializedData = function () {
|
179 |
+
return serialize(this.element, { hash: false, empty: true });
|
180 |
};
|
181 |
|
182 |
Form.prototype.setResponse = function (msg) {
|
assets/js/forms-api.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){var e=void 0,t=void 0;!function t(n,r,i){function o(c,a){if(!r[c]){if(!n[c]){var u="function"==typeof e&&e;if(!a&&u)return u(c,!0);if(s)return s(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[c]={exports:{}};n[c][0].call(l.exports,function(e){var t=n[c][1][e];return o(t||e)},l,l.exports,t,n,r,i)}return r[c].exports}for(var s="function"==typeof e&&e,c=0;c<i.length;c++)o(i[c]);return o}({1:[function(e,t,n){"use strict";function r(e){var t="animated"===u.auto_scroll,n={behavior:t?"smooth":"instant",block:"center",inline:"center"};e.element.scrollIntoView(n)}function i(e,t,n){return function(){var r=this.value.trim(),i="radio"!==this.getAttribute("type")&&"checked"!==this.getAttribute("type")||this.checked,o=i&&(r===t&&""!==t||""===t&&r.length>0);e.style.display=n?o?"":"none":o?"none":""}}function o(){var e=this,t=e.form.querySelectorAll("[data-show-if], [data-hide-if]"),n=(e.getAttribute("name")||"").toLowerCase();[].forEach.call(t,function(t){var r=!!t.getAttribute("data-show-if"),o=r?t.getAttribute("data-show-if").split(":"):t.getAttribute("data-hide-if").split(":"),s=o[0],c=o[1]||"";if(n===s.toLowerCase()){i(t,c,r).call(e)}})}var s=window.mc4wp||{},c=e("gator"),a=e("./forms/forms.js"),u=window.mc4wp_forms_config||{};if(c(document.body).on("keyup",".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select",o),c(document.body).on("change",".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select",o),window.addEventListener("load",function(){[].forEach.call(document.querySelectorAll(".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select"),function(e){o.call(e)})}),c(document.body).on("submit",".mc4wp-form",function(e){var t=a.getByElement(e.target||e.srcElement);a.trigger("submit",[t,e]),a.trigger(t.id+".submit",[t,e])}),c(document.body).on("focus",".mc4wp-form",function(e){var t=a.getByElement(e.target||e.srcElement);t.started||(a.trigger("started",[t,e]),a.trigger(t.id+".started",[t,e]),t.started=!0)}),c(document.body).on("change",".mc4wp-form",function(e){var t=a.getByElement(e.target||e.srcElement);a.trigger("change",[t,e]),a.trigger(t.id+".change",[t,e])}),s.listeners){for(var f=s.listeners,l=0;l<f.length;l++)a.on(f[l].event,f[l].callback);delete s.listeners}if(s.forms=a,u.submitted_form){var h=u.submitted_form,d=document.getElementById(h.element_id),m=a.getByElement(d);!function(e,t,n,i){var o=document.body.clientHeight,s=Date.now();n&&e.setData(i),u.auto_scroll&&r(e),window.addEventListener("load",function(){var c=Date.now()-s;u.auto_scroll&&c<800&&document.body.clientHeight!==o&&r(e),a.trigger("submitted",[e]),a.trigger(e.id+".submitted",[e]),n?(a.trigger("error",[e,n]),a.trigger(e.id+".error",[e,n])):(a.trigger("success",[e,i]),a.trigger(e.id+".success",[e,i]),a.trigger(t+"d",[e,i]),a.trigger(e.id+"."+t+"d",[e,i]))})}(m,h.action,h.errors,h.data)}window.mc4wp=s},{"./forms/forms.js":3,gator:5}],2:[function(e,t,n){"use strict";var r=e("form-serialize"),i=e("populate.js"),o=function(e,t){this.id=e,this.element=t||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};o.prototype.setData=function(e){try{i(this.element,e)}catch(e){console.error(e)}},o.prototype.getData=function(){return r(this.element,{hash:!0})},o.prototype.getSerializedData=function(){return r(this.element)},o.prototype.setResponse=function(e){this.element.querySelector(".mc4wp-response").innerHTML=e},o.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},t.exports=o},{"form-serialize":4,"populate.js":6}],3:[function(e,t,n){"use strict";function r(e){for(var t=0;t<f.length;t++)if(f[t].id==e)return f[t];return o(document.querySelector(".mc4wp-form-"+e),e)}function i(e){for(var t=e.form||e,n=0;n<f.length;n++)if(f[n].element==t)return f[n];return o(t)}function o(e,t){t=t||parseInt(e.getAttribute("data-id"))||0;var n=new a(t,e);return f.push(n),n}function s(){return f}var c=e("wolfy87-eventemitter"),a=e("./form.js"),u=new c,f=[];t.exports={all:s,get:r,getByElement:i,on:u.on.bind(u),trigger:u.trigger.bind(u),off:u.off.bind(u)}},{"./form.js":2,"wolfy87-eventemitter":7}],4:[function(e,t,n){function r(e,t){"object"!=typeof t?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var n=t.hash?{}:"",r=t.serializer||(t.hash?s:c),i=e&&e.elements?e.elements:[],o=Object.create(null),f=0;f<i.length;++f){var l=i[f];if((t.disabled||!l.disabled)&&l.name&&(u.test(l.nodeName)&&!a.test(l.type))){var h=l.name,d=l.value;if("checkbox"!==l.type&&"radio"!==l.type||l.checked||(d=void 0),t.empty){if("checkbox"!==l.type||l.checked||(d=""),"radio"===l.type&&(o[l.name]||l.checked?l.checked&&(o[l.name]=!0):o[l.name]=!1),void 0==d&&"radio"==l.type)continue}else if(!d)continue;if("select-multiple"!==l.type)n=r(n,h,d);else{d=[];for(var m=l.options,p=!1,v=0;v<m.length;++v){var g=m[v],y=t.empty&&!g.value,w=g.value||y;g.selected&&w&&(p=!0,n=t.hash&&"[]"!==h.slice(h.length-2)?r(n,h+"[]",g.value):r(n,h,g.value))}!p&&t.empty&&(n=r(n,h,""))}}}if(t.empty)for(var h in o)o[h]||(n=r(n,h,""));return n}function i(e){var t=[],n=/^([^\[\]]*)/,r=new RegExp(f),i=n.exec(e);for(i[1]&&t.push(i[1]);null!==(i=r.exec(e));)t.push(i[1]);return t}function o(e,t,n){if(0===t.length)return e=n;var r=t.shift(),i=r.match(/^\[(.+?)\]$/);if("[]"===r)return e=e||[],Array.isArray(e)?e.push(o(null,t,n)):(e._values=e._values||[],e._values.push(o(null,t,n))),e;if(i){var s=i[1],c=+s;isNaN(c)?(e=e||{},e[s]=o(e[s],t,n)):(e=e||[],e[c]=o(e[c],t,n))}else e[r]=o(e[r],t,n);return e}function s(e,t,n){if(t.match(f))o(e,i(t),n);else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function c(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=encodeURIComponent(n),n=n.replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}var a=/^(?:submit|button|image|reset|file)$/i,u=/^(?:input|select|textarea|keygen)/i,f=/(\[[^\[\]]*\])/g;t.exports=r},{}],5:[function(e,t,n){!function(){function e(e,t,n){var r="blur"==t||"focus"==t;e.element.addEventListener(t,n,r)}function n(e){e.preventDefault(),e.stopPropagation()}function r(e){return f||(f=e.matches?e.matches:e.webkitMatchesSelector?e.webkitMatchesSelector:e.mozMatchesSelector?e.mozMatchesSelector:e.msMatchesSelector?e.msMatchesSelector:e.oMatchesSelector?e.oMatchesSelector:u.matchesSelector)}function i(e,t,n){if("_root"==t)return n;if(e!==n)return r(e).call(e,t)?e:e.parentNode?(l++,i(e.parentNode,t,n)):void 0}function o(e,t,n,r){d[e.id]||(d[e.id]={}),d[e.id][t]||(d[e.id][t]={}),d[e.id][t][n]||(d[e.id][t][n]=[]),d[e.id][t][n].push(r)}function s(e,t,n,r){if(d[e.id])if(t){if(!r&&!n)return void(d[e.id][t]={});if(!r)return void delete d[e.id][t][n];if(d[e.id][t][n])for(var i=0;i<d[e.id][t][n].length;i++)if(d[e.id][t][n][i]===r){d[e.id][t][n].splice(i,1);break}}else for(var o in d[e.id])d[e.id].hasOwnProperty(o)&&(d[e.id][o]={})}function c(e,t,n){if(d[e][n]){var r,o,s=t.target||t.srcElement,c={},a=0,f=0;l=0;for(r in d[e][n])d[e][n].hasOwnProperty(r)&&(o=i(s,r,m[e].element))&&u.matchesEvent(n,m[e].element,o,"_root"==r,t)&&(l++,d[e][n][r].match=o,c[l]=d[e][n][r]);for(t.stopPropagation=function(){t.cancelBubble=!0},a=0;a<=l;a++)if(c[a])for(f=0;f<c[a].length;f++){if(!1===c[a][f].call(c[a].match,t))return void u.cancel(t);if(t.cancelBubble)return}}}function a(e,t,n,r){if(this.element){e instanceof Array||(e=[e]),n||"function"!=typeof t||(n=t,t="_root");var i,a=this.id;for(i=0;i<e.length;i++)r?s(this,e[i],t,n):(d[a]&&d[a][e[i]]||u.addEvent(this,e[i],function(e){return function(t){c(a,t,e)}}(e[i])),o(this,e[i],t,n));return this}}function u(e,t){if(!(this instanceof u)){for(var n in m)if(m[n].element===e)return m[n];return h++,m[h]=new u(e,h),m[h]}this.element=e,this.id=t}var f,l=0,h=0,d={},m={};u.prototype.on=function(e,t,n){return a.call(this,e,t,n)},u.prototype.off=function(e,t,n){return a.call(this,e,t,n,!0)},u.matchesSelector=function(){},u.cancel=n,u.addEvent=e,u.matchesEvent=function(){return!0},void 0!==t&&t.exports&&(t.exports=u),window.Gator=u}()},{}],6:[function(e,n,r){!function(e){var r=function(e,t,n){for(var i in t)if(t.hasOwnProperty(i)){var o=i,s=t[i];if(void 0===s&&(s=""),null===s&&(s=""),void 0!==n&&(o=n+"["+i+"]"),s.constructor===Array)o+="[]";else if("object"==typeof s){r(e,s,o);continue}var c=e.elements.namedItem(o);if(c){var a=c.type||c[0].type;switch(a){default:c.value=s;break;case"radio":case"checkbox":for(var u=0;u<c.length;u++)c[u].checked=s.indexOf(c[u].value)>-1;break;case"select-multiple":for(var f=s.constructor==Array?s:[s],l=0;l<c.options.length;l++)c.options[l].selected|=f.indexOf(c.options[l].value)>-1;break;case"select":case"select-one":c.value=s.toString()||s;break;case"date":c.value=new Date(s).toISOString().split("T")[0]}}}};"function"==typeof t&&"object"==typeof t.amd&&t.amd?t(function(){return r}):void 0!==n&&n.exports?n.exports=r:e.populate=r}(this)},{}],7:[function(e,n,r){!function(e){"use strict";function r(){}function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}function s(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&s(e.listener)}var c=r.prototype,a=e.EventEmitter;c.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},c.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},c.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},c.addListener=function(e,t){if(!s(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===i(r[n],t)&&r[n].push(o?t:{listener:t,once:!1});return this},c.on=o("addListener"),c.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},c.once=o("addOnceListener"),c.defineEvent=function(e){return this.getListeners(e),this},c.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},c.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&-1!==(n=i(o[r],t))&&o[r].splice(n,1);return this},c.off=o("removeListener"),c.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},c.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},c.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):s.call(this,r,i));return this},c.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},c.removeAllListeners=o("removeEvent"),c.emitEvent=function(e,t){var n,r,i,o,s=this.getListenersAsObject(e);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},c.trigger=o("emitEvent"),c.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},c.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},c._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},c._getEvents=function(){return this._events||(this._events={})},r.noConflict=function(){return e.EventEmitter=a,r},"function"==typeof t&&t.amd?t(function(){return r}):"object"==typeof n&&n.exports?n.exports=r:e.EventEmitter=r}(this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=forms-api.min.js.map
|
1 |
+
!function(){var e=void 0,t=void 0;!function t(n,r,i){function o(a,c){if(!r[a]){if(!n[a]){var u="function"==typeof e&&e;if(!c&&u)return u(a,!0);if(s)return s(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[a]={exports:{}};n[a][0].call(l.exports,function(e){var t=n[a][1][e];return o(t||e)},l,l.exports,t,n,r,i)}return r[a].exports}for(var s="function"==typeof e&&e,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){"use strict";function r(e){var t="animated"===u.auto_scroll,n={behavior:t?"smooth":"instant"};e.element.scrollIntoView(n)}function i(e,t,n){return function(){var r=this.value.trim(),i="radio"!==this.getAttribute("type")&&"checked"!==this.getAttribute("type")||this.checked,o=i&&(r===t&&""!==t||""===t&&r.length>0);e.style.display=n?o?"":"none":o?"none":""}}function o(){var e=this,t=e.form.querySelectorAll("[data-show-if], [data-hide-if]"),n=(e.getAttribute("name")||"").toLowerCase();[].forEach.call(t,function(t){var r=!!t.getAttribute("data-show-if"),o=r?t.getAttribute("data-show-if").split(":"):t.getAttribute("data-hide-if").split(":"),s=o[0],a=o[1]||"";if(n===s.toLowerCase()){i(t,a,r).call(e)}})}var s=window.mc4wp||{},a=e("gator"),c=e("./forms/forms.js"),u=window.mc4wp_forms_config||{};if(a(document.body).on("keyup",".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select",o),a(document.body).on("change",".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select",o),window.addEventListener("load",function(){[].forEach.call(document.querySelectorAll(".mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select"),function(e){o.call(e)})}),a(document.body).on("submit",".mc4wp-form",function(e){var t=c.getByElement(e.target||e.srcElement);c.trigger("submit",[t,e]),c.trigger(t.id+".submit",[t,e])}),a(document.body).on("focus",".mc4wp-form",function(e){var t=c.getByElement(e.target||e.srcElement);t.started||(c.trigger("started",[t,e]),c.trigger(t.id+".started",[t,e]),t.started=!0)}),a(document.body).on("change",".mc4wp-form",function(e){var t=c.getByElement(e.target||e.srcElement);c.trigger("change",[t,e]),c.trigger(t.id+".change",[t,e])}),s.listeners){for(var f=s.listeners,l=0;l<f.length;l++)c.on(f[l].event,f[l].callback);delete s.listeners}if(s.forms=c,u.submitted_form){var h=u.submitted_form,d=document.getElementById(h.element_id),m=c.getByElement(d);!function(e,t,n,i){var o=document.body.clientHeight,s=Date.now();n&&e.setData(i),u.auto_scroll&&r(e),window.addEventListener("load",function(){var a=Date.now()-s;u.auto_scroll&&a<800&&document.body.clientHeight!==o&&r(e),c.trigger("submitted",[e]),c.trigger(e.id+".submitted",[e]),n?(c.trigger("error",[e,n]),c.trigger(e.id+".error",[e,n])):(c.trigger("success",[e,i]),c.trigger(e.id+".success",[e,i]),c.trigger(t+"d",[e,i]),c.trigger(e.id+"."+t+"d",[e,i]))})}(m,h.action,h.errors,h.data)}window.mc4wp=s},{"./forms/forms.js":3,gator:5}],2:[function(e,t,n){"use strict";var r=e("form-serialize"),i=e("populate.js"),o=function(e,t){this.id=e,this.element=t||document.createElement("form"),this.name=this.element.getAttribute("data-name")||"Form #"+this.id,this.errors=[],this.started=!1};o.prototype.setData=function(e){try{i(this.element,e)}catch(e){console.error(e)}},o.prototype.getData=function(){return r(this.element,{hash:!0,empty:!0})},o.prototype.getSerializedData=function(){return r(this.element,{hash:!1,empty:!0})},o.prototype.setResponse=function(e){this.element.querySelector(".mc4wp-response").innerHTML=e},o.prototype.reset=function(){this.setResponse(""),this.element.querySelector(".mc4wp-form-fields").style.display="",this.element.reset()},t.exports=o},{"form-serialize":4,"populate.js":6}],3:[function(e,t,n){"use strict";function r(e){for(var t=0;t<f.length;t++)if(f[t].id==e)return f[t];return o(document.querySelector(".mc4wp-form-"+e),e)}function i(e){for(var t=e.form||e,n=0;n<f.length;n++)if(f[n].element==t)return f[n];return o(t)}function o(e,t){t=t||parseInt(e.getAttribute("data-id"))||0;var n=new c(t,e);return f.push(n),n}function s(){return f}var a=e("wolfy87-eventemitter"),c=e("./form.js"),u=new a,f=[];t.exports={all:s,get:r,getByElement:i,on:u.on.bind(u),trigger:u.trigger.bind(u),off:u.off.bind(u)}},{"./form.js":2,"wolfy87-eventemitter":7}],4:[function(e,t,n){function r(e,t){"object"!=typeof t?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var n=t.hash?{}:"",r=t.serializer||(t.hash?s:a),i=e&&e.elements?e.elements:[],o=Object.create(null),f=0;f<i.length;++f){var l=i[f];if((t.disabled||!l.disabled)&&l.name&&(u.test(l.nodeName)&&!c.test(l.type))){var h=l.name,d=l.value;if("checkbox"!==l.type&&"radio"!==l.type||l.checked||(d=void 0),t.empty){if("checkbox"!==l.type||l.checked||(d=""),"radio"===l.type&&(o[l.name]||l.checked?l.checked&&(o[l.name]=!0):o[l.name]=!1),void 0==d&&"radio"==l.type)continue}else if(!d)continue;if("select-multiple"!==l.type)n=r(n,h,d);else{d=[];for(var m=l.options,p=!1,v=0;v<m.length;++v){var g=m[v],y=t.empty&&!g.value,w=g.value||y;g.selected&&w&&(p=!0,n=t.hash&&"[]"!==h.slice(h.length-2)?r(n,h+"[]",g.value):r(n,h,g.value))}!p&&t.empty&&(n=r(n,h,""))}}}if(t.empty)for(var h in o)o[h]||(n=r(n,h,""));return n}function i(e){var t=[],n=/^([^\[\]]*)/,r=new RegExp(f),i=n.exec(e);for(i[1]&&t.push(i[1]);null!==(i=r.exec(e));)t.push(i[1]);return t}function o(e,t,n){if(0===t.length)return e=n;var r=t.shift(),i=r.match(/^\[(.+?)\]$/);if("[]"===r)return e=e||[],Array.isArray(e)?e.push(o(null,t,n)):(e._values=e._values||[],e._values.push(o(null,t,n))),e;if(i){var s=i[1],a=+s;isNaN(a)?(e=e||{},e[s]=o(e[s],t,n)):(e=e||[],e[a]=o(e[a],t,n))}else e[r]=o(e[r],t,n);return e}function s(e,t,n){if(t.match(f))o(e,i(t),n);else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function a(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=encodeURIComponent(n),n=n.replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}var c=/^(?:submit|button|image|reset|file)$/i,u=/^(?:input|select|textarea|keygen)/i,f=/(\[[^\[\]]*\])/g;t.exports=r},{}],5:[function(e,t,n){!function(){function e(e,t,n){var r="blur"==t||"focus"==t;e.element.addEventListener(t,n,r)}function n(e){e.preventDefault(),e.stopPropagation()}function r(e){return f||(f=e.matches?e.matches:e.webkitMatchesSelector?e.webkitMatchesSelector:e.mozMatchesSelector?e.mozMatchesSelector:e.msMatchesSelector?e.msMatchesSelector:e.oMatchesSelector?e.oMatchesSelector:u.matchesSelector)}function i(e,t,n){if("_root"==t)return n;if(e!==n)return r(e).call(e,t)?e:e.parentNode?(l++,i(e.parentNode,t,n)):void 0}function o(e,t,n,r){d[e.id]||(d[e.id]={}),d[e.id][t]||(d[e.id][t]={}),d[e.id][t][n]||(d[e.id][t][n]=[]),d[e.id][t][n].push(r)}function s(e,t,n,r){if(d[e.id])if(t){if(!r&&!n)return void(d[e.id][t]={});if(!r)return void delete d[e.id][t][n];if(d[e.id][t][n])for(var i=0;i<d[e.id][t][n].length;i++)if(d[e.id][t][n][i]===r){d[e.id][t][n].splice(i,1);break}}else for(var o in d[e.id])d[e.id].hasOwnProperty(o)&&(d[e.id][o]={})}function a(e,t,n){if(d[e][n]){var r,o,s=t.target||t.srcElement,a={},c=0,f=0;l=0;for(r in d[e][n])d[e][n].hasOwnProperty(r)&&(o=i(s,r,m[e].element))&&u.matchesEvent(n,m[e].element,o,"_root"==r,t)&&(l++,d[e][n][r].match=o,a[l]=d[e][n][r]);for(t.stopPropagation=function(){t.cancelBubble=!0},c=0;c<=l;c++)if(a[c])for(f=0;f<a[c].length;f++){if(!1===a[c][f].call(a[c].match,t))return void u.cancel(t);if(t.cancelBubble)return}}}function c(e,t,n,r){if(this.element){e instanceof Array||(e=[e]),n||"function"!=typeof t||(n=t,t="_root");var i,c=this.id;for(i=0;i<e.length;i++)r?s(this,e[i],t,n):(d[c]&&d[c][e[i]]||u.addEvent(this,e[i],function(e){return function(t){a(c,t,e)}}(e[i])),o(this,e[i],t,n));return this}}function u(e,t){if(!(this instanceof u)){for(var n in m)if(m[n].element===e)return m[n];return h++,m[h]=new u(e,h),m[h]}this.element=e,this.id=t}var f,l=0,h=0,d={},m={};u.prototype.on=function(e,t,n){return c.call(this,e,t,n)},u.prototype.off=function(e,t,n){return c.call(this,e,t,n,!0)},u.matchesSelector=function(){},u.cancel=n,u.addEvent=e,u.matchesEvent=function(){return!0},void 0!==t&&t.exports&&(t.exports=u),window.Gator=u}()},{}],6:[function(e,n,r){!function(e){var r=function(e,t,n){for(var i in t)if(t.hasOwnProperty(i)){var o=i,s=t[i];if(void 0===s&&(s=""),null===s&&(s=""),void 0!==n&&(o=n+"["+i+"]"),s.constructor===Array)o+="[]";else if("object"==typeof s){r(e,s,o);continue}var a=e.elements.namedItem(o);if(a){var c=a.type||a[0].type;switch(c){default:a.value=s;break;case"radio":case"checkbox":for(var u=0;u<a.length;u++)a[u].checked=s.indexOf(a[u].value)>-1;break;case"select-multiple":for(var f=s.constructor==Array?s:[s],l=0;l<a.options.length;l++)a.options[l].selected|=f.indexOf(a.options[l].value)>-1;break;case"select":case"select-one":a.value=s.toString()||s;break;case"date":a.value=new Date(s).toISOString().split("T")[0]}}}};"function"==typeof t&&"object"==typeof t.amd&&t.amd?t(function(){return r}):void 0!==n&&n.exports?n.exports=r:e.populate=r}(this)},{}],7:[function(e,n,r){!function(e){"use strict";function r(){}function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}function s(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&s(e.listener)}var a=r.prototype,c=e.EventEmitter;a.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},a.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},a.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},a.addListener=function(e,t){if(!s(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===i(r[n],t)&&r[n].push(o?t:{listener:t,once:!1});return this},a.on=o("addListener"),a.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},a.once=o("addOnceListener"),a.defineEvent=function(e){return this.getListeners(e),this},a.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},a.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&-1!==(n=i(o[r],t))&&o[r].splice(n,1);return this},a.off=o("removeListener"),a.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},a.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},a.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):s.call(this,r,i));return this},a.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},a.removeAllListeners=o("removeEvent"),a.emitEvent=function(e,t){var n,r,i,o,s=this.getListenersAsObject(e);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},a.trigger=o("emitEvent"),a.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},a.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},a._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},a._getEvents=function(){return this._events||(this._events={})},r.noConflict=function(){return e.EventEmitter=c,r},"function"==typeof t&&t.amd?t(function(){return r}):"object"==typeof n&&n.exports?n.exports=r:e.EventEmitter=r}(this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=forms-api.min.js.map
|
assets/js/forms-api.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["forms-api.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","scrollToForm","form","animate","config","auto_scroll","args","behavior","block","inline","element","scrollIntoView","toggleElement","el","expectedValue","show","value","this","trim","checked","getAttribute","conditionMet","style","display","toggleConditionalElements","input","elements","querySelectorAll","inputName","toLowerCase","forEach","conditions","split","nameCondition","valueCondition","mc4wp","window","Gator","forms","mc4wp_forms_config","document","body","on","addEventListener","event","getByElement","target","srcElement","trigger","id","started","listeners","callback","submitted_form","formConfig","getElementById","element_id","action","errors","data","pageHeight","clientHeight","timeStart","Date","now","setData","timeElapsed","./forms/forms.js","gator","2","serialize","populate","Form","createElement","name","prototype","console","error","getData","hash","getSerializedData","setResponse","msg","querySelector","innerHTML","reset","form-serialize","populate.js","3","get","formId","createFromElement","formElement","parseInt","push","all","EventEmitter","events","bind","off","./form.js","wolfy87-eventemitter","4","options","result","serializer","hash_serializer","str_serialize","radio_store","Object","create","disabled","k_r_success_contrls","test","nodeName","k_r_submitter","type","key","val","empty","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","parse_keys","string","keys","prefix","children","RegExp","brackets","match","exec","hash_assign","shift","between","Array","isArray","_values","index","isNaN","existing","replace","encodeURIComponent","5","_addEvent","useCapture","_cancel","preventDefault","stopPropagation","_getMatcher","_matcher","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","matchesSelector","_matchesSelector","selector","boundElement","parentNode","_level","_addHandler","_handlers","_removeHandler","splice","hasOwnProperty","_handleEvent","_gatorInstances","matchesEvent","cancelBubble","cancel","_bind","remove","addEvent","_id","6","root","basename","constructor","namedItem","indexOf","values","k","toString","toISOString","amd","7","indexOfListener","listener","alias","apply","arguments","isValidListener","proto","originalGlobalValue","getListeners","evt","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","addListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","addListeners","manipulateListeners","removeListeners","single","multiple","removeEvent","_events","removeAllListeners","emitEvent","listenersMap","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict"],"mappings":"CAAA,WAAe,GAAIA,OAAUC,GAAeC,MAASD,IAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,GAAIF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGQ,QAAkD,IAAI,GAA1CL,GAAkB,kBAATX,IAAqBA,EAAgBQ,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EA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Y,SAAmBvB,EAAKpM,GACtC,GACI6C,GACA+I,EACA3M,EACA8H,EAJA6G,EAAejN,KAAK8L,qBAAqBL,EAO7C,KAAKrF,IAAO6G,GACR,GAAIA,EAAavD,eAAetD,GAG5B,IAFAlE,EAAY+K,EAAa7G,GAAKU,MAAM,GAE/BxI,EAAI,EAAGA,EAAI4D,EAAUrD,OAAQP,IAG9B2M,EAAW/I,EAAU5D,IAEC,IAAlB2M,EAASiB,MACTlM,KAAKuM,eAAed,EAAKR,EAASA,UAG3BA,EAASA,SAASE,MAAMnL,KAAMX,SAExBW,KAAKkN,uBAClBlN,KAAKuM,eAAed,EAAKR,EAASA,SAMlD,OAAOjL,OAMXsL,EAAMvJ,QAAUmJ,EAAM,aAUtBI,EAAM6B,KAAO,SAAc1B,GACvB,GAAIpM,GAAOsI,MAAMjE,UAAUoD,MAAMlI,KAAKwM,UAAW,EACjD,OAAOpL,MAAKgN,UAAUvB,EAAKpM,IAW/BiM,EAAM8B,mBAAqB,SAA4BrN,GAEnD,MADAC,MAAKqN,iBAAmBtN,EACjBC,MAWXsL,EAAM4B,oBAAsB,WACxB,OAAIlN,KAAK0J,eAAe,qBACb1J,KAAKqN,kBAapB/B,EAAMK,WAAa,WACf,MAAO3L,MAAK8M,UAAY9M,KAAK8M,aAQjC/H,EAAauI,WAAa,WAEtB,MADA3O,GAAQoG,aAAewG,EAChBxG,GAIW,kBAAXlH,IAAyBA,EAAOiN,IACvCjN,EAAO,WACH,MAAOkH,KAGY,gBAAXhG,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUoG,EAGjBpG,EAAQoG,aAAeA,GAE7B/E,oBAES","file":"forms-api.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\n// deps & vars\n\nvar mc4wp = window.mc4wp || {};\nvar Gator = require('gator');\nvar forms = require('./forms/forms.js');\nvar config = window.mc4wp_forms_config || {};\n\n// funcs\nfunction scrollToForm(form) {\n\tvar animate = config.auto_scroll === 'animated';\n\tvar args = {\n\t\tbehavior: animate ? \"smooth\" : \"instant\",\n\t\tblock: \"center\",\n\t\tinline: \"center\"\n\t};\n\tform.element.scrollIntoView(args);\n}\n\nfunction handleFormRequest(form, action, errors, data) {\n\tvar pageHeight = document.body.clientHeight;\n\tvar timeStart = Date.now();\n\n\t// re-populate form\n\tif (errors) {\n\t\tform.setData(data);\n\t}\n\n\tif (config.auto_scroll) {\n\t\tscrollToForm(form);\n\t}\n\n\t// trigger events on window.load so all other scripts have loaded\n\twindow.addEventListener('load', function () {\n\t\tvar timeElapsed = Date.now() - timeStart;\n\n\t\t// scroll to form again if page height changed since last scroll\n\t\t// (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)\n\t\tif (config.auto_scroll && timeElapsed < 800 && document.body.clientHeight !== pageHeight) {\n\t\t\tscrollToForm(form);\n\t\t}\n\n\t\t// trigger events\n\t\tforms.trigger('submitted', [form]);\n\t\tforms.trigger(form.id + '.submitted', [form]);\n\n\t\tif (errors) {\n\t\t\tforms.trigger('error', [form, errors]);\n\t\t\tforms.trigger(form.id + '.error', [form, errors]);\n\t\t} else {\n\t\t\t// form was successfully submitted\n\t\t\tforms.trigger('success', [form, data]);\n\t\t\tforms.trigger(form.id + '.success', [form, data]);\n\n\t\t\t// subscribed / unsubscribed\n\t\t\tforms.trigger(action + \"d\", [form, data]);\n\t\t\tforms.trigger(form.id + \".\" + action + \"d\", [form, data]);\n\t\t}\n\t});\n}\n\nfunction toggleElement(el, expectedValue, show) {\n\treturn function () {\n\t\tvar value = this.value.trim();\n\t\tvar checked = this.getAttribute('type') !== 'radio' && this.getAttribute('type') !== 'checked' || this.checked;\n\t\tvar conditionMet = checked && (value === expectedValue && expectedValue !== \"\" || expectedValue === \"\" && value.length > 0);\n\t\tif (show) {\n\t\t\tel.style.display = conditionMet ? '' : 'none';\n\t\t} else {\n\t\t\tel.style.display = conditionMet ? 'none' : '';\n\t\t}\n\t};\n}\n\nfunction toggleConditionalElements() {\n\tvar input = this;\n\tvar elements = input.form.querySelectorAll('[data-show-if], [data-hide-if]');\n\tvar inputName = (input.getAttribute('name') || '').toLowerCase();\n\n\t[].forEach.call(elements, function (el) {\n\t\tvar show = !!el.getAttribute('data-show-if');\n\t\tvar conditions = show ? el.getAttribute('data-show-if').split(':') : el.getAttribute('data-hide-if').split(':');\n\t\tvar nameCondition = conditions[0];\n\t\tvar valueCondition = conditions[1] || \"\";\n\n\t\tif (inputName !== nameCondition.toLowerCase()) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar callback = toggleElement(el, valueCondition, show);\n\t\tcallback.call(input);\n\t});\n}\n\nGator(document.body).on('keyup', '.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select', toggleConditionalElements);\nGator(document.body).on('change', '.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select', toggleConditionalElements);\nwindow.addEventListener('load', function () {\n\t[].forEach.call(document.querySelectorAll('.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select'), function (el) {\n\t\ttoggleConditionalElements.call(el);\n\t});\n});\n\n// Bind browser events to form events (using delegation)\nGator(document.body).on('submit', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('submit', [form, event]);\n\tforms.trigger(form.id + '.submit', [form, event]);\n});\n\nGator(document.body).on('focus', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\n\tif (!form.started) {\n\t\tforms.trigger('started', [form, event]);\n\t\tforms.trigger(form.id + '.started', [form, event]);\n\t\tform.started = true;\n\t}\n});\n\nGator(document.body).on('change', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('change', [form, event]);\n\tforms.trigger(form.id + '.change', [form, event]);\n});\n\n// register early listeners\nif (mc4wp.listeners) {\n\tvar listeners = mc4wp.listeners;\n\tfor (var i = 0; i < listeners.length; i++) {\n\t\tforms.on(listeners[i].event, listeners[i].callback);\n\t}\n\n\t// delete temp listeners array, so we don't bind twice\n\tdelete mc4wp[\"listeners\"];\n}\n\n// expose forms object\nmc4wp.forms = forms;\n\n// handle submitted form\nif (config.submitted_form) {\n\tvar formConfig = config.submitted_form,\n\t element = document.getElementById(formConfig.element_id),\n\t form = forms.getByElement(element);\n\n\thandleFormRequest(form, formConfig.action, formConfig.errors, formConfig.data);\n}\n\n// expose mc4wp object globally\nwindow.mc4wp = mc4wp;\n\n},{\"./forms/forms.js\":3,\"gator\":5}],2:[function(require,module,exports){\n'use strict';\n\nvar serialize = require('form-serialize');\nvar populate = require('populate.js');\n\nvar Form = function Form(id, element) {\n\tthis.id = id;\n\tthis.element = element || document.createElement('form');\n\tthis.name = this.element.getAttribute('data-name') || \"Form #\" + this.id;\n\tthis.errors = [];\n\tthis.started = false;\n};\n\nForm.prototype.setData = function (data) {\n\ttry {\n\t\tpopulate(this.element, data);\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n};\n\nForm.prototype.getData = function () {\n\treturn serialize(this.element, { hash: true });\n};\n\nForm.prototype.getSerializedData = function () {\n\treturn serialize(this.element);\n};\n\nForm.prototype.setResponse = function (msg) {\n\tthis.element.querySelector('.mc4wp-response').innerHTML = msg;\n};\n\n// revert back to original state\nForm.prototype.reset = function () {\n\tthis.setResponse('');\n\tthis.element.querySelector('.mc4wp-form-fields').style.display = '';\n\tthis.element.reset();\n};\n\nmodule.exports = Form;\n\n},{\"form-serialize\":4,\"populate.js\":6}],3:[function(require,module,exports){\n'use strict';\n\n// deps\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar Form = require('./form.js');\n\n// variables\nvar events = new EventEmitter();\nvar forms = [];\n\n// get form by its id\n// please note that this will get the FIRST occurence of the form with that ID on the page\nfunction get(formId) {\n\n\t// do we have form for this one already?\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].id == formId) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\t// try to create from first occurence of this element\n\tvar formElement = document.querySelector('.mc4wp-form-' + formId);\n\treturn createFromElement(formElement, formId);\n}\n\n// get form by <form> element (or any input in form)\nfunction getByElement(element) {\n\tvar formElement = element.form || element;\n\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].element == formElement) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\treturn createFromElement(formElement);\n}\n\n// create form object from <form> element\nfunction createFromElement(formElement, id) {\n\tid = id || parseInt(formElement.getAttribute('data-id')) || 0;\n\tvar form = new Form(id, formElement);\n\tforms.push(form);\n\treturn form;\n}\n\nfunction all() {\n\treturn forms;\n}\n\nmodule.exports = {\n\t\"all\": all,\n\t\"get\": get,\n\t\"getByElement\": getByElement,\n\t\"on\": events.on.bind(events),\n\t\"trigger\": events.trigger.bind(events),\n\t\"off\": events.off.bind(events)\n};\n\n},{\"./form.js\":2,\"wolfy87-eventemitter\":7}],4:[function(require,module,exports){\n// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i<elements.length ; ++i) {\n var element = elements[i];\n\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n // for checkbox\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j<selectOptions.length ; ++j) {\n var option = selectOptions[j];\n var allowedEmpty = options.empty && !option.value;\n var hasValue = (option.value || allowedEmpty);\n if (option.selected && hasValue) {\n isSelectedOptions = true;\n\n // If using a hash serializer be sure to add the\n // correct notation for an array in the multi-select\n // context. Here the name attribute on the select element\n // might be missing the trailing bracket pair. Both names\n // \"foo\" and \"foo[]\" should be arrays.\n if (options.hash && key.slice(key.length - 2) !== '[]') {\n result = serializer(result, key + '[]', option.value);\n }\n else {\n result = serializer(result, key, option.value);\n }\n }\n }\n\n // Serialize if no selected options and options.empty is true\n if (!isSelectedOptions && options.empty) {\n result = serializer(result, key, '');\n }\n\n continue;\n }\n\n result = serializer(result, key, val);\n }\n\n // Check for all empty radio buttons and serialize them with key=\"\"\n if (options.empty) {\n for (var key in radio_store) {\n if (!radio_store[key]) {\n result = serializer(result, key, '');\n }\n }\n }\n\n return result;\n}\n\nfunction parse_keys(string) {\n var keys = [];\n var prefix = /^([^\\[\\]]*)/;\n var children = new RegExp(brackets);\n var match = prefix.exec(string);\n\n if (match[1]) {\n keys.push(match[1]);\n }\n\n while ((match = children.exec(string)) !== null) {\n keys.push(match[1]);\n }\n\n return keys;\n}\n\nfunction hash_assign(result, keys, value) {\n if (keys.length === 0) {\n result = value;\n return result;\n }\n\n var key = keys.shift();\n var between = key.match(/^\\[(.+?)\\]$/);\n\n if (key === '[]') {\n result = result || [];\n\n if (Array.isArray(result)) {\n result.push(hash_assign(null, keys, value));\n }\n else {\n // This might be the result of bad name attributes like \"[][foo]\",\n // in this case the original `result` object will already be\n // assigned to an object literal. Rather than coerce the object to\n // an array, or cause an exception the attribute \"_values\" is\n // assigned as an array.\n result._values = result._values || [];\n result._values.push(hash_assign(null, keys, value));\n }\n\n return result;\n }\n\n // Key is an attribute name and can be assigned directly.\n if (!between) {\n result[key] = hash_assign(result[key], keys, value);\n }\n else {\n var string = between[1];\n // +var converts the variable into a number\n // better than parseInt because it doesn't truncate away trailing\n // letters and actually fails if whole thing is not a number\n var index = +string;\n\n // If the characters between the brackets is not a number it is an\n // attribute name and can be assigned directly.\n if (isNaN(index)) {\n result = result || {};\n result[string] = hash_assign(result[string], keys, value);\n }\n else {\n result = result || [];\n result[index] = hash_assign(result[index], keys, value);\n }\n }\n\n return result;\n}\n\n// Object/hash encoding serializer.\nfunction hash_serializer(result, key, value) {\n var matches = key.match(brackets);\n\n // Has brackets? Use the recursive assignment function to walk the keys,\n // construct any missing objects in the result tree and make the assignment\n // at the end of the chain.\n if (matches) {\n var keys = parse_keys(key);\n hash_assign(result, keys, value);\n }\n else {\n // Non bracket notation can make assignments directly.\n var existing = result[key];\n\n // If the value has been assigned already (for instance when a radio and\n // a checkbox have the same name attribute) convert the previous value\n // into an array before pushing into it.\n //\n // NOTE: If this requirement were removed all hash creation and\n // assignment could go through `hash_assign`.\n if (existing) {\n if (!Array.isArray(existing)) {\n result[key] = [ existing ];\n }\n\n result[key].push(value);\n }\n else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n// urlform encoding serializer\nfunction str_serialize(result, key, value) {\n // encode newlines as \\r\\n cause the html spec says so\n value = value.replace(/(\\r)?\\n/g, '\\r\\n');\n value = encodeURIComponent(value);\n\n // spaces should be '+' rather than '%20'.\n value = value.replace(/%20/g, '+');\n return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value;\n}\n\nmodule.exports = serialize;\n\n},{}],5:[function(require,module,exports){\n/**\n * Copyright 2014 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * GATOR.JS\n * Simple Event Delegation\n *\n * @version 1.2.4\n *\n * Compatible with IE 9+, FF 3.6+, Safari 5+, Chrome\n *\n * Include legacy.js for compatibility with older browsers\n *\n * .-._ _ _ _ _ _ _ _ _\n * .-''-.__.-'00 '-' ' ' ' ' ' ' ' '-.\n * '.___ ' . .--_'-' '-' '-' _'-' '._\n * V: V 'vv-' '_ '. .' _..' '.'.\n * '=.____.=_.--' :_.__.__:_ '. : :\n * (((____.-' '-. / : :\n * (((-'\\ .' /\n * _____..' .'\n * '-._____.-'\n */\n(function() {\n var _matcher,\n _level = 0,\n _id = 0,\n _handlers = {},\n _gatorInstances = {};\n\n function _addEvent(gator, type, callback) {\n\n // blur and focus do not bubble up but if you use event capturing\n // then you will get them\n var useCapture = type == 'blur' || type == 'focus';\n gator.element.addEventListener(type, callback, useCapture);\n }\n\n function _cancel(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n /**\n * returns function to use for determining if an element\n * matches a query selector\n *\n * @returns {Function}\n */\n function _getMatcher(element) {\n if (_matcher) {\n return _matcher;\n }\n\n if (element.matches) {\n _matcher = element.matches;\n return _matcher;\n }\n\n if (element.webkitMatchesSelector) {\n _matcher = element.webkitMatchesSelector;\n return _matcher;\n }\n\n if (element.mozMatchesSelector) {\n _matcher = element.mozMatchesSelector;\n return _matcher;\n }\n\n if (element.msMatchesSelector) {\n _matcher = element.msMatchesSelector;\n return _matcher;\n }\n\n if (element.oMatchesSelector) {\n _matcher = element.oMatchesSelector;\n return _matcher;\n }\n\n // if it doesn't match a native browser method\n // fall back to the gator function\n _matcher = Gator.matchesSelector;\n return _matcher;\n }\n\n /**\n * determines if the specified element matches a given selector\n *\n * @param {Node} element - the element to compare against the selector\n * @param {string} selector\n * @param {Node} boundElement - the element the listener was attached to\n * @returns {void|Node}\n */\n function _matchesSelector(element, selector, boundElement) {\n\n // no selector means this event was bound directly to this element\n if (selector == '_root') {\n return boundElement;\n }\n\n // if we have moved up to the element you bound the event to\n // then we have come too far\n if (element === boundElement) {\n return;\n }\n\n // if this is a match then we are done!\n if (_getMatcher(element).call(element, selector)) {\n return element;\n }\n\n // if this element did not match but has a parent we should try\n // going up the tree to see if any of the parent elements match\n // for example if you are looking for a click on an <a> tag but there\n // is a <span> inside of the a tag that it is the target,\n // it should still work\n if (element.parentNode) {\n _level++;\n return _matchesSelector(element.parentNode, selector, boundElement);\n }\n }\n\n function _addHandler(gator, event, selector, callback) {\n if (!_handlers[gator.id]) {\n _handlers[gator.id] = {};\n }\n\n if (!_handlers[gator.id][event]) {\n _handlers[gator.id][event] = {};\n }\n\n if (!_handlers[gator.id][event][selector]) {\n _handlers[gator.id][event][selector] = [];\n }\n\n _handlers[gator.id][event][selector].push(callback);\n }\n\n function _removeHandler(gator, event, selector, callback) {\n\n // if there are no events tied to this element at all\n // then don't do anything\n if (!_handlers[gator.id]) {\n return;\n }\n\n // if there is no event type specified then remove all events\n // example: Gator(element).off()\n if (!event) {\n for (var type in _handlers[gator.id]) {\n if (_handlers[gator.id].hasOwnProperty(type)) {\n _handlers[gator.id][type] = {};\n }\n }\n return;\n }\n\n // if no callback or selector is specified remove all events of this type\n // example: Gator(element).off('click')\n if (!callback && !selector) {\n _handlers[gator.id][event] = {};\n return;\n }\n\n // if a selector is specified but no callback remove all events\n // for this selector\n // example: Gator(element).off('click', '.sub-element')\n if (!callback) {\n delete _handlers[gator.id][event][selector];\n return;\n }\n\n // if we have specified an event type, selector, and callback then we\n // need to make sure there are callbacks tied to this selector to\n // begin with. if there aren't then we can stop here\n if (!_handlers[gator.id][event][selector]) {\n return;\n }\n\n // if there are then loop through all the callbacks and if we find\n // one that matches remove it from the array\n for (var i = 0; i < _handlers[gator.id][event][selector].length; i++) {\n if (_handlers[gator.id][event][selector][i] === callback) {\n _handlers[gator.id][event][selector].splice(i, 1);\n break;\n }\n }\n }\n\n function _handleEvent(id, e, type) {\n if (!_handlers[id][type]) {\n return;\n }\n\n var target = e.target || e.srcElement,\n selector,\n match,\n matches = {},\n i = 0,\n j = 0;\n\n // find all events that match\n _level = 0;\n for (selector in _handlers[id][type]) {\n if (_handlers[id][type].hasOwnProperty(selector)) {\n match = _matchesSelector(target, selector, _gatorInstances[id].element);\n\n if (match && Gator.matchesEvent(type, _gatorInstances[id].element, match, selector == '_root', e)) {\n _level++;\n _handlers[id][type][selector].match = match;\n matches[_level] = _handlers[id][type][selector];\n }\n }\n }\n\n // stopPropagation() fails to set cancelBubble to true in Webkit\n // @see http://code.google.com/p/chromium/issues/detail?id=162270\n e.stopPropagation = function() {\n e.cancelBubble = true;\n };\n\n for (i = 0; i <= _level; i++) {\n if (matches[i]) {\n for (j = 0; j < matches[i].length; j++) {\n if (matches[i][j].call(matches[i].match, e) === false) {\n Gator.cancel(e);\n return;\n }\n\n if (e.cancelBubble) {\n return;\n }\n }\n }\n }\n }\n\n /**\n * binds the specified events to the element\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @param {boolean=} remove\n * @returns {Object}\n */\n function _bind(events, selector, callback, remove) {\n\n // fail silently if you pass null or undefined as an alement\n // in the Gator constructor\n if (!this.element) {\n return;\n }\n\n if (!(events instanceof Array)) {\n events = [events];\n }\n\n if (!callback && typeof(selector) == 'function') {\n callback = selector;\n selector = '_root';\n }\n\n var id = this.id,\n i;\n\n function _getGlobalCallback(type) {\n return function(e) {\n _handleEvent(id, e, type);\n };\n }\n\n for (i = 0; i < events.length; i++) {\n if (remove) {\n _removeHandler(this, events[i], selector, callback);\n continue;\n }\n\n if (!_handlers[id] || !_handlers[id][events[i]]) {\n Gator.addEvent(this, events[i], _getGlobalCallback(events[i]));\n }\n\n _addHandler(this, events[i], selector, callback);\n }\n\n return this;\n }\n\n /**\n * Gator object constructor\n *\n * @param {Node} element\n */\n function Gator(element, id) {\n\n // called as function\n if (!(this instanceof Gator)) {\n // only keep one Gator instance per node to make sure that\n // we don't create a ton of new objects if you want to delegate\n // multiple events from the same node\n //\n // for example: Gator(document).on(...\n for (var key in _gatorInstances) {\n if (_gatorInstances[key].element === element) {\n return _gatorInstances[key];\n }\n }\n\n _id++;\n _gatorInstances[_id] = new Gator(element, _id);\n\n return _gatorInstances[_id];\n }\n\n this.element = element;\n this.id = id;\n }\n\n /**\n * adds an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.on = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback);\n };\n\n /**\n * removes an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.off = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback, true);\n };\n\n Gator.matchesSelector = function() {};\n Gator.cancel = _cancel;\n Gator.addEvent = _addEvent;\n Gator.matchesEvent = function() {\n return true;\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Gator;\n }\n\n window.Gator = Gator;\n}) ();\n\n},{}],6:[function(require,module,exports){\n/*! populate.js v1.0.2 by @dannyvankooten | MIT license */\n;(function(root) {\n\n\t/**\n\t * Populate form fields from a JSON object.\n\t *\n\t * @param form object The form element containing your input fields.\n\t * @param data array JSON data to populate the fields with.\n\t * @param basename string Optional basename which is added to `name` attributes\n\t */\n\tvar populate = function( form, data, basename) {\n\n\t\tfor(var key in data) {\n\n\t\t\tif( ! data.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = key;\n\t\t\tvar value = data[key];\n\n if ('undefined' === typeof value) {\n value = '';\n }\n\n if (null === value) {\n value = '';\n }\n\n\t\t\t// handle array name attributes\n\t\t\tif(typeof(basename) !== \"undefined\") {\n\t\t\t\tname = basename + \"[\" + key + \"]\";\n\t\t\t}\n\n\t\t\tif(value.constructor === Array) {\n\t\t\t\tname += '[]';\n\t\t\t} else if(typeof value == \"object\") {\n\t\t\t\tpopulate( form, value, name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only proceed if element is set\n\t\t\tvar element = form.elements.namedItem( name );\n\t\t\tif( ! element ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar type = element.type || element[0].type;\n\n\t\t\tswitch(type ) {\n\t\t\t\tdefault:\n\t\t\t\t\telement.value = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\tfor( var j=0; j < element.length; j++ ) {\n\t\t\t\t\t\telement[j].checked = ( value.indexOf(element[j].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select-multiple':\n\t\t\t\t\tvar values = value.constructor == Array ? value : [value];\n\n\t\t\t\t\tfor(var k = 0; k < element.options.length; k++) {\n\t\t\t\t\t\telement.options[k].selected |= (values.indexOf(element.options[k].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'select-one':\n\t\t\t\t\telement.value = value.toString() || value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n \t\t\t\telement.value = new Date(value).toISOString().split('T')[0];\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Play nice with AMD, CommonJS or a plain global object.\n\tif ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn populate;\n\t\t});\n\t}\telse if ( typeof module !== 'undefined' && module.exports ) {\n\t\tmodule.exports = populate;\n\t} else {\n\t\troot.populate = populate;\n\t}\n\n}(this));\n\n},{}],7:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.2 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n })();"]}
|
1 |
+
{"version":3,"sources":["forms-api.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","scrollToForm","form","animate","config","auto_scroll","args","behavior","element","scrollIntoView","toggleElement","el","expectedValue","show","value","this","trim","checked","getAttribute","conditionMet","style","display","toggleConditionalElements","input","elements","querySelectorAll","inputName","toLowerCase","forEach","conditions","split","nameCondition","valueCondition","mc4wp","window","Gator","forms","mc4wp_forms_config","document","body","on","addEventListener","event","getByElement","target","srcElement","trigger","id","started","listeners","callback","submitted_form","formConfig","getElementById","element_id","action","errors","data","pageHeight","clientHeight","timeStart","Date","now","setData","timeElapsed","./forms/forms.js","gator","2","serialize","populate","Form","createElement","name","prototype","console","error","getData","hash","empty","getSerializedData","setResponse","msg","querySelector","innerHTML","reset","form-serialize","populate.js","3","get","formId","createFromElement","formElement","parseInt","push","all","EventEmitter","events","bind","off","./form.js","wolfy87-eventemitter","4","options","result","serializer","hash_serializer","str_serialize","radio_store","Object","create","disabled","k_r_success_contrls","test","nodeName","k_r_submitter","type","key","val","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","parse_keys","string","keys","prefix","children","RegExp","brackets","match","exec","hash_assign","shift","between","Array","isArray","_values","index","isNaN","existing","replace","encodeURIComponent","5","_addEvent","useCapture","_cancel","preventDefault","stopPropagation","_getMatcher","_matcher","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","matchesSelector","_matchesSelector","selector","boundElement","parentNode","_level","_addHandler","_handlers","_removeHandler","splice","hasOwnProperty","_handleEvent","_gatorInstances","matchesEvent","cancelBubble","cancel","_bind","remove","addEvent","_id","6","root","basename","constructor","namedItem","indexOf","values","k","toString","toISOString","amd","7","indexOfListener","listener","alias","apply","arguments","isValidListener","proto","originalGlobalValue","getListeners","evt","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","addListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","addListeners","manipulateListeners","removeListeners","single","multiple","removeEvent","_events","removeAllListeners","emitEvent","listenersMap","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict"],"mappings":"CAAA,WAAe,GAAIA,OAAUC,GAAeC,MAASD,IAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAA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file":"forms-api.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\n// deps & vars\n\nvar mc4wp = window.mc4wp || {};\nvar Gator = require('gator');\nvar forms = require('./forms/forms.js');\nvar config = window.mc4wp_forms_config || {};\n\n// funcs\nfunction scrollToForm(form) {\n\tvar animate = config.auto_scroll === 'animated';\n\tvar args = {\n\t\tbehavior: animate ? \"smooth\" : \"instant\"\n\t};\n\tform.element.scrollIntoView(args);\n}\n\nfunction handleFormRequest(form, action, errors, data) {\n\tvar pageHeight = document.body.clientHeight;\n\tvar timeStart = Date.now();\n\n\t// re-populate form\n\tif (errors) {\n\t\tform.setData(data);\n\t}\n\n\tif (config.auto_scroll) {\n\t\tscrollToForm(form);\n\t}\n\n\t// trigger events on window.load so all other scripts have loaded\n\twindow.addEventListener('load', function () {\n\t\tvar timeElapsed = Date.now() - timeStart;\n\n\t\t// scroll to form again if page height changed since last scroll\n\t\t// (only if load didn't take more than 0.8 seconds to prevent overtaking user scroll)\n\t\tif (config.auto_scroll && timeElapsed < 800 && document.body.clientHeight !== pageHeight) {\n\t\t\tscrollToForm(form);\n\t\t}\n\n\t\t// trigger events\n\t\tforms.trigger('submitted', [form]);\n\t\tforms.trigger(form.id + '.submitted', [form]);\n\n\t\tif (errors) {\n\t\t\tforms.trigger('error', [form, errors]);\n\t\t\tforms.trigger(form.id + '.error', [form, errors]);\n\t\t} else {\n\t\t\t// form was successfully submitted\n\t\t\tforms.trigger('success', [form, data]);\n\t\t\tforms.trigger(form.id + '.success', [form, data]);\n\n\t\t\t// subscribed / unsubscribed\n\t\t\tforms.trigger(action + \"d\", [form, data]);\n\t\t\tforms.trigger(form.id + \".\" + action + \"d\", [form, data]);\n\t\t}\n\t});\n}\n\nfunction toggleElement(el, expectedValue, show) {\n\treturn function () {\n\t\tvar value = this.value.trim();\n\t\tvar checked = this.getAttribute('type') !== 'radio' && this.getAttribute('type') !== 'checked' || this.checked;\n\t\tvar conditionMet = checked && (value === expectedValue && expectedValue !== \"\" || expectedValue === \"\" && value.length > 0);\n\t\tif (show) {\n\t\t\tel.style.display = conditionMet ? '' : 'none';\n\t\t} else {\n\t\t\tel.style.display = conditionMet ? 'none' : '';\n\t\t}\n\t};\n}\n\nfunction toggleConditionalElements() {\n\tvar input = this;\n\tvar elements = input.form.querySelectorAll('[data-show-if], [data-hide-if]');\n\tvar inputName = (input.getAttribute('name') || '').toLowerCase();\n\n\t[].forEach.call(elements, function (el) {\n\t\tvar show = !!el.getAttribute('data-show-if');\n\t\tvar conditions = show ? el.getAttribute('data-show-if').split(':') : el.getAttribute('data-hide-if').split(':');\n\t\tvar nameCondition = conditions[0];\n\t\tvar valueCondition = conditions[1] || \"\";\n\n\t\tif (inputName !== nameCondition.toLowerCase()) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar callback = toggleElement(el, valueCondition, show);\n\t\tcallback.call(input);\n\t});\n}\n\nGator(document.body).on('keyup', '.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select', toggleConditionalElements);\nGator(document.body).on('change', '.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select', toggleConditionalElements);\nwindow.addEventListener('load', function () {\n\t[].forEach.call(document.querySelectorAll('.mc4wp-form input, .mc4wp-form textarea, .mc4wp-form select'), function (el) {\n\t\ttoggleConditionalElements.call(el);\n\t});\n});\n\n// Bind browser events to form events (using delegation)\nGator(document.body).on('submit', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('submit', [form, event]);\n\tforms.trigger(form.id + '.submit', [form, event]);\n});\n\nGator(document.body).on('focus', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\n\tif (!form.started) {\n\t\tforms.trigger('started', [form, event]);\n\t\tforms.trigger(form.id + '.started', [form, event]);\n\t\tform.started = true;\n\t}\n});\n\nGator(document.body).on('change', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('change', [form, event]);\n\tforms.trigger(form.id + '.change', [form, event]);\n});\n\n// register early listeners\nif (mc4wp.listeners) {\n\tvar listeners = mc4wp.listeners;\n\tfor (var i = 0; i < listeners.length; i++) {\n\t\tforms.on(listeners[i].event, listeners[i].callback);\n\t}\n\n\t// delete temp listeners array, so we don't bind twice\n\tdelete mc4wp[\"listeners\"];\n}\n\n// expose forms object\nmc4wp.forms = forms;\n\n// handle submitted form\nif (config.submitted_form) {\n\tvar formConfig = config.submitted_form,\n\t element = document.getElementById(formConfig.element_id),\n\t form = forms.getByElement(element);\n\n\thandleFormRequest(form, formConfig.action, formConfig.errors, formConfig.data);\n}\n\n// expose mc4wp object globally\nwindow.mc4wp = mc4wp;\n\n},{\"./forms/forms.js\":3,\"gator\":5}],2:[function(require,module,exports){\n'use strict';\n\nvar serialize = require('form-serialize');\nvar populate = require('populate.js');\n\nvar Form = function Form(id, element) {\n\tthis.id = id;\n\tthis.element = element || document.createElement('form');\n\tthis.name = this.element.getAttribute('data-name') || \"Form #\" + this.id;\n\tthis.errors = [];\n\tthis.started = false;\n};\n\nForm.prototype.setData = function (data) {\n\ttry {\n\t\tpopulate(this.element, data);\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n};\n\nForm.prototype.getData = function () {\n\treturn serialize(this.element, { hash: true, empty: true });\n};\n\nForm.prototype.getSerializedData = function () {\n\treturn serialize(this.element, { hash: false, empty: true });\n};\n\nForm.prototype.setResponse = function (msg) {\n\tthis.element.querySelector('.mc4wp-response').innerHTML = msg;\n};\n\n// revert back to original state\nForm.prototype.reset = function () {\n\tthis.setResponse('');\n\tthis.element.querySelector('.mc4wp-form-fields').style.display = '';\n\tthis.element.reset();\n};\n\nmodule.exports = Form;\n\n},{\"form-serialize\":4,\"populate.js\":6}],3:[function(require,module,exports){\n'use strict';\n\n// deps\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar Form = require('./form.js');\n\n// variables\nvar events = new EventEmitter();\nvar forms = [];\n\n// get form by its id\n// please note that this will get the FIRST occurence of the form with that ID on the page\nfunction get(formId) {\n\n\t// do we have form for this one already?\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].id == formId) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\t// try to create from first occurence of this element\n\tvar formElement = document.querySelector('.mc4wp-form-' + formId);\n\treturn createFromElement(formElement, formId);\n}\n\n// get form by <form> element (or any input in form)\nfunction getByElement(element) {\n\tvar formElement = element.form || element;\n\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].element == formElement) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\treturn createFromElement(formElement);\n}\n\n// create form object from <form> element\nfunction createFromElement(formElement, id) {\n\tid = id || parseInt(formElement.getAttribute('data-id')) || 0;\n\tvar form = new Form(id, formElement);\n\tforms.push(form);\n\treturn form;\n}\n\nfunction all() {\n\treturn forms;\n}\n\nmodule.exports = {\n\t\"all\": all,\n\t\"get\": get,\n\t\"getByElement\": getByElement,\n\t\"on\": events.on.bind(events),\n\t\"trigger\": events.trigger.bind(events),\n\t\"off\": events.off.bind(events)\n};\n\n},{\"./form.js\":2,\"wolfy87-eventemitter\":7}],4:[function(require,module,exports){\n// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i<elements.length ; ++i) {\n var element = elements[i];\n\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n // for checkbox\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j<selectOptions.length ; ++j) {\n var option = selectOptions[j];\n var allowedEmpty = options.empty && !option.value;\n var hasValue = (option.value || allowedEmpty);\n if (option.selected && hasValue) {\n isSelectedOptions = true;\n\n // If using a hash serializer be sure to add the\n // correct notation for an array in the multi-select\n // context. Here the name attribute on the select element\n // might be missing the trailing bracket pair. Both names\n // \"foo\" and \"foo[]\" should be arrays.\n if (options.hash && key.slice(key.length - 2) !== '[]') {\n result = serializer(result, key + '[]', option.value);\n }\n else {\n result = serializer(result, key, option.value);\n }\n }\n }\n\n // Serialize if no selected options and options.empty is true\n if (!isSelectedOptions && options.empty) {\n result = serializer(result, key, '');\n }\n\n continue;\n }\n\n result = serializer(result, key, val);\n }\n\n // Check for all empty radio buttons and serialize them with key=\"\"\n if (options.empty) {\n for (var key in radio_store) {\n if (!radio_store[key]) {\n result = serializer(result, key, '');\n }\n }\n }\n\n return result;\n}\n\nfunction parse_keys(string) {\n var keys = [];\n var prefix = /^([^\\[\\]]*)/;\n var children = new RegExp(brackets);\n var match = prefix.exec(string);\n\n if (match[1]) {\n keys.push(match[1]);\n }\n\n while ((match = children.exec(string)) !== null) {\n keys.push(match[1]);\n }\n\n return keys;\n}\n\nfunction hash_assign(result, keys, value) {\n if (keys.length === 0) {\n result = value;\n return result;\n }\n\n var key = keys.shift();\n var between = key.match(/^\\[(.+?)\\]$/);\n\n if (key === '[]') {\n result = result || [];\n\n if (Array.isArray(result)) {\n result.push(hash_assign(null, keys, value));\n }\n else {\n // This might be the result of bad name attributes like \"[][foo]\",\n // in this case the original `result` object will already be\n // assigned to an object literal. Rather than coerce the object to\n // an array, or cause an exception the attribute \"_values\" is\n // assigned as an array.\n result._values = result._values || [];\n result._values.push(hash_assign(null, keys, value));\n }\n\n return result;\n }\n\n // Key is an attribute name and can be assigned directly.\n if (!between) {\n result[key] = hash_assign(result[key], keys, value);\n }\n else {\n var string = between[1];\n // +var converts the variable into a number\n // better than parseInt because it doesn't truncate away trailing\n // letters and actually fails if whole thing is not a number\n var index = +string;\n\n // If the characters between the brackets is not a number it is an\n // attribute name and can be assigned directly.\n if (isNaN(index)) {\n result = result || {};\n result[string] = hash_assign(result[string], keys, value);\n }\n else {\n result = result || [];\n result[index] = hash_assign(result[index], keys, value);\n }\n }\n\n return result;\n}\n\n// Object/hash encoding serializer.\nfunction hash_serializer(result, key, value) {\n var matches = key.match(brackets);\n\n // Has brackets? Use the recursive assignment function to walk the keys,\n // construct any missing objects in the result tree and make the assignment\n // at the end of the chain.\n if (matches) {\n var keys = parse_keys(key);\n hash_assign(result, keys, value);\n }\n else {\n // Non bracket notation can make assignments directly.\n var existing = result[key];\n\n // If the value has been assigned already (for instance when a radio and\n // a checkbox have the same name attribute) convert the previous value\n // into an array before pushing into it.\n //\n // NOTE: If this requirement were removed all hash creation and\n // assignment could go through `hash_assign`.\n if (existing) {\n if (!Array.isArray(existing)) {\n result[key] = [ existing ];\n }\n\n result[key].push(value);\n }\n else {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n// urlform encoding serializer\nfunction str_serialize(result, key, value) {\n // encode newlines as \\r\\n cause the html spec says so\n value = value.replace(/(\\r)?\\n/g, '\\r\\n');\n value = encodeURIComponent(value);\n\n // spaces should be '+' rather than '%20'.\n value = value.replace(/%20/g, '+');\n return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value;\n}\n\nmodule.exports = serialize;\n\n},{}],5:[function(require,module,exports){\n/**\n * Copyright 2014 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * GATOR.JS\n * Simple Event Delegation\n *\n * @version 1.2.4\n *\n * Compatible with IE 9+, FF 3.6+, Safari 5+, Chrome\n *\n * Include legacy.js for compatibility with older browsers\n *\n * .-._ _ _ _ _ _ _ _ _\n * .-''-.__.-'00 '-' ' ' ' ' ' ' ' '-.\n * '.___ ' . .--_'-' '-' '-' _'-' '._\n * V: V 'vv-' '_ '. .' _..' '.'.\n * '=.____.=_.--' :_.__.__:_ '. : :\n * (((____.-' '-. / : :\n * (((-'\\ .' /\n * _____..' .'\n * '-._____.-'\n */\n(function() {\n var _matcher,\n _level = 0,\n _id = 0,\n _handlers = {},\n _gatorInstances = {};\n\n function _addEvent(gator, type, callback) {\n\n // blur and focus do not bubble up but if you use event capturing\n // then you will get them\n var useCapture = type == 'blur' || type == 'focus';\n gator.element.addEventListener(type, callback, useCapture);\n }\n\n function _cancel(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n /**\n * returns function to use for determining if an element\n * matches a query selector\n *\n * @returns {Function}\n */\n function _getMatcher(element) {\n if (_matcher) {\n return _matcher;\n }\n\n if (element.matches) {\n _matcher = element.matches;\n return _matcher;\n }\n\n if (element.webkitMatchesSelector) {\n _matcher = element.webkitMatchesSelector;\n return _matcher;\n }\n\n if (element.mozMatchesSelector) {\n _matcher = element.mozMatchesSelector;\n return _matcher;\n }\n\n if (element.msMatchesSelector) {\n _matcher = element.msMatchesSelector;\n return _matcher;\n }\n\n if (element.oMatchesSelector) {\n _matcher = element.oMatchesSelector;\n return _matcher;\n }\n\n // if it doesn't match a native browser method\n // fall back to the gator function\n _matcher = Gator.matchesSelector;\n return _matcher;\n }\n\n /**\n * determines if the specified element matches a given selector\n *\n * @param {Node} element - the element to compare against the selector\n * @param {string} selector\n * @param {Node} boundElement - the element the listener was attached to\n * @returns {void|Node}\n */\n function _matchesSelector(element, selector, boundElement) {\n\n // no selector means this event was bound directly to this element\n if (selector == '_root') {\n return boundElement;\n }\n\n // if we have moved up to the element you bound the event to\n // then we have come too far\n if (element === boundElement) {\n return;\n }\n\n // if this is a match then we are done!\n if (_getMatcher(element).call(element, selector)) {\n return element;\n }\n\n // if this element did not match but has a parent we should try\n // going up the tree to see if any of the parent elements match\n // for example if you are looking for a click on an <a> tag but there\n // is a <span> inside of the a tag that it is the target,\n // it should still work\n if (element.parentNode) {\n _level++;\n return _matchesSelector(element.parentNode, selector, boundElement);\n }\n }\n\n function _addHandler(gator, event, selector, callback) {\n if (!_handlers[gator.id]) {\n _handlers[gator.id] = {};\n }\n\n if (!_handlers[gator.id][event]) {\n _handlers[gator.id][event] = {};\n }\n\n if (!_handlers[gator.id][event][selector]) {\n _handlers[gator.id][event][selector] = [];\n }\n\n _handlers[gator.id][event][selector].push(callback);\n }\n\n function _removeHandler(gator, event, selector, callback) {\n\n // if there are no events tied to this element at all\n // then don't do anything\n if (!_handlers[gator.id]) {\n return;\n }\n\n // if there is no event type specified then remove all events\n // example: Gator(element).off()\n if (!event) {\n for (var type in _handlers[gator.id]) {\n if (_handlers[gator.id].hasOwnProperty(type)) {\n _handlers[gator.id][type] = {};\n }\n }\n return;\n }\n\n // if no callback or selector is specified remove all events of this type\n // example: Gator(element).off('click')\n if (!callback && !selector) {\n _handlers[gator.id][event] = {};\n return;\n }\n\n // if a selector is specified but no callback remove all events\n // for this selector\n // example: Gator(element).off('click', '.sub-element')\n if (!callback) {\n delete _handlers[gator.id][event][selector];\n return;\n }\n\n // if we have specified an event type, selector, and callback then we\n // need to make sure there are callbacks tied to this selector to\n // begin with. if there aren't then we can stop here\n if (!_handlers[gator.id][event][selector]) {\n return;\n }\n\n // if there are then loop through all the callbacks and if we find\n // one that matches remove it from the array\n for (var i = 0; i < _handlers[gator.id][event][selector].length; i++) {\n if (_handlers[gator.id][event][selector][i] === callback) {\n _handlers[gator.id][event][selector].splice(i, 1);\n break;\n }\n }\n }\n\n function _handleEvent(id, e, type) {\n if (!_handlers[id][type]) {\n return;\n }\n\n var target = e.target || e.srcElement,\n selector,\n match,\n matches = {},\n i = 0,\n j = 0;\n\n // find all events that match\n _level = 0;\n for (selector in _handlers[id][type]) {\n if (_handlers[id][type].hasOwnProperty(selector)) {\n match = _matchesSelector(target, selector, _gatorInstances[id].element);\n\n if (match && Gator.matchesEvent(type, _gatorInstances[id].element, match, selector == '_root', e)) {\n _level++;\n _handlers[id][type][selector].match = match;\n matches[_level] = _handlers[id][type][selector];\n }\n }\n }\n\n // stopPropagation() fails to set cancelBubble to true in Webkit\n // @see http://code.google.com/p/chromium/issues/detail?id=162270\n e.stopPropagation = function() {\n e.cancelBubble = true;\n };\n\n for (i = 0; i <= _level; i++) {\n if (matches[i]) {\n for (j = 0; j < matches[i].length; j++) {\n if (matches[i][j].call(matches[i].match, e) === false) {\n Gator.cancel(e);\n return;\n }\n\n if (e.cancelBubble) {\n return;\n }\n }\n }\n }\n }\n\n /**\n * binds the specified events to the element\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @param {boolean=} remove\n * @returns {Object}\n */\n function _bind(events, selector, callback, remove) {\n\n // fail silently if you pass null or undefined as an alement\n // in the Gator constructor\n if (!this.element) {\n return;\n }\n\n if (!(events instanceof Array)) {\n events = [events];\n }\n\n if (!callback && typeof(selector) == 'function') {\n callback = selector;\n selector = '_root';\n }\n\n var id = this.id,\n i;\n\n function _getGlobalCallback(type) {\n return function(e) {\n _handleEvent(id, e, type);\n };\n }\n\n for (i = 0; i < events.length; i++) {\n if (remove) {\n _removeHandler(this, events[i], selector, callback);\n continue;\n }\n\n if (!_handlers[id] || !_handlers[id][events[i]]) {\n Gator.addEvent(this, events[i], _getGlobalCallback(events[i]));\n }\n\n _addHandler(this, events[i], selector, callback);\n }\n\n return this;\n }\n\n /**\n * Gator object constructor\n *\n * @param {Node} element\n */\n function Gator(element, id) {\n\n // called as function\n if (!(this instanceof Gator)) {\n // only keep one Gator instance per node to make sure that\n // we don't create a ton of new objects if you want to delegate\n // multiple events from the same node\n //\n // for example: Gator(document).on(...\n for (var key in _gatorInstances) {\n if (_gatorInstances[key].element === element) {\n return _gatorInstances[key];\n }\n }\n\n _id++;\n _gatorInstances[_id] = new Gator(element, _id);\n\n return _gatorInstances[_id];\n }\n\n this.element = element;\n this.id = id;\n }\n\n /**\n * adds an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.on = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback);\n };\n\n /**\n * removes an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.off = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback, true);\n };\n\n Gator.matchesSelector = function() {};\n Gator.cancel = _cancel;\n Gator.addEvent = _addEvent;\n Gator.matchesEvent = function() {\n return true;\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Gator;\n }\n\n window.Gator = Gator;\n}) ();\n\n},{}],6:[function(require,module,exports){\n/*! populate.js v1.0.2 by @dannyvankooten | MIT license */\n;(function(root) {\n\n\t/**\n\t * Populate form fields from a JSON object.\n\t *\n\t * @param form object The form element containing your input fields.\n\t * @param data array JSON data to populate the fields with.\n\t * @param basename string Optional basename which is added to `name` attributes\n\t */\n\tvar populate = function( form, data, basename) {\n\n\t\tfor(var key in data) {\n\n\t\t\tif( ! data.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = key;\n\t\t\tvar value = data[key];\n\n if ('undefined' === typeof value) {\n value = '';\n }\n\n if (null === value) {\n value = '';\n }\n\n\t\t\t// handle array name attributes\n\t\t\tif(typeof(basename) !== \"undefined\") {\n\t\t\t\tname = basename + \"[\" + key + \"]\";\n\t\t\t}\n\n\t\t\tif(value.constructor === Array) {\n\t\t\t\tname += '[]';\n\t\t\t} else if(typeof value == \"object\") {\n\t\t\t\tpopulate( form, value, name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only proceed if element is set\n\t\t\tvar element = form.elements.namedItem( name );\n\t\t\tif( ! element ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar type = element.type || element[0].type;\n\n\t\t\tswitch(type ) {\n\t\t\t\tdefault:\n\t\t\t\t\telement.value = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\tfor( var j=0; j < element.length; j++ ) {\n\t\t\t\t\t\telement[j].checked = ( value.indexOf(element[j].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select-multiple':\n\t\t\t\t\tvar values = value.constructor == Array ? value : [value];\n\n\t\t\t\t\tfor(var k = 0; k < element.options.length; k++) {\n\t\t\t\t\t\telement.options[k].selected |= (values.indexOf(element.options[k].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'select-one':\n\t\t\t\t\telement.value = value.toString() || value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n \t\t\t\telement.value = new Date(value).toISOString().split('T')[0];\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Play nice with AMD, CommonJS or a plain global object.\n\tif ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn populate;\n\t\t});\n\t}\telse if ( typeof module !== 'undefined' && module.exports ) {\n\t\tmodule.exports = populate;\n\t} else {\n\t\troot.populate = populate;\n\t}\n\n}(this));\n\n},{}],7:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.2 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n })();"]}
|
includes/forms/class-admin.php
CHANGED
@@ -39,10 +39,8 @@ class MC4WP_Forms_Admin {
|
|
39 |
add_action( 'mc4wp_admin_edit_form', array( $this, 'process_save_form' ) );
|
40 |
add_action( 'mc4wp_admin_add_form', array( $this, 'process_add_form' ) );
|
41 |
add_filter( 'mc4wp_admin_menu_items', array( $this, 'add_menu_item' ), 5 );
|
42 |
-
|
43 |
add_action( 'mc4wp_admin_show_forms_page-edit-form', array( $this, 'show_edit_page' ) );
|
44 |
add_action( 'mc4wp_admin_show_forms_page-add-form', array( $this, 'show_add_page' ) );
|
45 |
-
|
46 |
add_action( 'mc4wp_admin_enqueue_assets', array( $this, 'enqueue_assets' ), 10, 2 );
|
47 |
}
|
48 |
|
@@ -109,7 +107,7 @@ class MC4WP_Forms_Admin {
|
|
109 |
|
110 |
$items['forms'] = array(
|
111 |
'title' => __( 'Forms', 'mailchimp-for-wp' ),
|
112 |
-
'text' => __( '
|
113 |
'slug' => 'forms',
|
114 |
'callback' => array( $this, 'show_forms_page' ),
|
115 |
'load_callback' => array( $this, 'redirect_to_form_action' ),
|
39 |
add_action( 'mc4wp_admin_edit_form', array( $this, 'process_save_form' ) );
|
40 |
add_action( 'mc4wp_admin_add_form', array( $this, 'process_add_form' ) );
|
41 |
add_filter( 'mc4wp_admin_menu_items', array( $this, 'add_menu_item' ), 5 );
|
|
|
42 |
add_action( 'mc4wp_admin_show_forms_page-edit-form', array( $this, 'show_edit_page' ) );
|
43 |
add_action( 'mc4wp_admin_show_forms_page-add-form', array( $this, 'show_add_page' ) );
|
|
|
44 |
add_action( 'mc4wp_admin_enqueue_assets', array( $this, 'enqueue_assets' ), 10, 2 );
|
45 |
}
|
46 |
|
107 |
|
108 |
$items['forms'] = array(
|
109 |
'title' => __( 'Forms', 'mailchimp-for-wp' ),
|
110 |
+
'text' => __( 'Form', 'mailchimp-for-wp' ),
|
111 |
'slug' => 'forms',
|
112 |
'callback' => array( $this, 'show_forms_page' ),
|
113 |
'load_callback' => array( $this, 'redirect_to_form_action' ),
|
integrations/bootstrap.php
CHANGED
@@ -45,7 +45,8 @@ mc4wp_register_integration( 'contact-form-7', 'MC4WP_Contact_Form_7_Integration'
|
|
45 |
mc4wp_register_integration( 'events-manager', 'MC4WP_Events_Manager_Integration' );
|
46 |
mc4wp_register_integration( 'memberpress', 'MC4WP_MemberPress_Integration' );
|
47 |
mc4wp_register_integration( 'custom', 'MC4WP_Custom_Integration', true );
|
48 |
-
|
49 |
-
require
|
50 |
-
|
|
|
51 |
|
45 |
mc4wp_register_integration( 'events-manager', 'MC4WP_Events_Manager_Integration' );
|
46 |
mc4wp_register_integration( 'memberpress', 'MC4WP_MemberPress_Integration' );
|
47 |
mc4wp_register_integration( 'custom', 'MC4WP_Custom_Integration', true );
|
48 |
+
$dir = dirname( __FILE__ );
|
49 |
+
require $dir . '/ninja-forms/bootstrap.php';
|
50 |
+
require $dir . '/wpforms/bootstrap.php';
|
51 |
+
require $dir . '/gravity-forms/bootstrap.php';
|
52 |
|
integrations/gravity-forms/admin-before.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<p>
|
2 |
+
<?php echo sprintf( __( 'To integrate with Gravity Forms, add the "MailChimp" field to <a href="%s">one of your Gravity Forms forms</a>.', 'mailchimp-for-wp' ), admin_url( 'admin.php?page=gf_edit_forms' ) ); ?>
|
3 |
+
</p>
|
integrations/gravity-forms/bootstrap.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) or exit;
|
4 |
+
|
5 |
+
mc4wp_register_integration( 'gravity-forms', 'MC4WP_Gravity_Forms_Integration', true );
|
6 |
+
|
7 |
+
if ( class_exists( 'GFForms' ) ) {
|
8 |
+
GF_Fields::register( new MC4WP_Gravity_Forms_Field() );
|
9 |
+
}
|
integrations/gravity-forms/class-field.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class MC4WP_Gravity_Forms_Field extends GF_Field {
|
4 |
+
|
5 |
+
public $type = 'mailchimp';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Returns the field markup; including field label, description, validation, and the form editor admin buttons.
|
9 |
+
*
|
10 |
+
* The {FIELD} placeholder will be replaced in GFFormDisplay::get_field_content with the markup returned by GF_Field::get_field_input().
|
11 |
+
*
|
12 |
+
* @param string|array $value The field value. From default/dynamic population, $_POST, or a resumed incomplete submission.
|
13 |
+
* @param bool $force_frontend_label Should the frontend label be displayed in the admin even if an admin label is configured.
|
14 |
+
* @param array $form The Form Object currently being processed.
|
15 |
+
*
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
public function get_field_content( $value, $force_frontend_label, $form ) {
|
19 |
+
|
20 |
+
$validation_message = ( $this->failed_validation && ! empty( $this->validation_message ) ) ? sprintf( "<div class='gfield_description validation_message'>%s</div>", $this->validation_message ) : '';
|
21 |
+
$is_form_editor = $this->is_form_editor();
|
22 |
+
$is_entry_detail = $this->is_entry_detail();
|
23 |
+
$is_admin = $is_form_editor || $is_entry_detail;
|
24 |
+
|
25 |
+
$admin_buttons = $this->get_admin_buttons();
|
26 |
+
|
27 |
+
$description = $this->get_description( $this->description, 'gfield_description' );
|
28 |
+
if ( $this->is_description_above( $form ) ) {
|
29 |
+
$clear = $is_admin ? "<div class='gf_clear'></div>" : '';
|
30 |
+
$field_content = sprintf( "%s%s{FIELD}%s$clear", $admin_buttons, $description, $validation_message );
|
31 |
+
} else {
|
32 |
+
$field_content = sprintf( "%s{FIELD}%s%s", $admin_buttons, $description, $validation_message );
|
33 |
+
}
|
34 |
+
|
35 |
+
return $field_content;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function get_form_editor_field_title() {
|
39 |
+
return esc_attr__( 'MailChimp', 'mailchimp-for-wp' );
|
40 |
+
}
|
41 |
+
|
42 |
+
public function get_form_editor_field_settings() {
|
43 |
+
return array(
|
44 |
+
'label_setting',
|
45 |
+
'description_setting',
|
46 |
+
'css_class_setting',
|
47 |
+
'mailchimp_list_setting',
|
48 |
+
'mailchimp_double_optin'
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function get_field_input( $form, $value = '', $entry = null ) {
|
53 |
+
|
54 |
+
$form_id = absint( $form['id'] );
|
55 |
+
$is_entry_detail = $this->is_entry_detail();
|
56 |
+
$is_form_editor = $this->is_form_editor();
|
57 |
+
|
58 |
+
$id = $this->id;
|
59 |
+
$field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_$id" : 'input_' . $form_id . "_$id";
|
60 |
+
$disabled_text = $is_form_editor ? 'disabled="disabled"' : '';
|
61 |
+
|
62 |
+
return sprintf( "<div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='%s'>%s</ul></div>", esc_attr( $field_id ), $this->get_checkbox_choices( $value, $disabled_text, $form_id ) );
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
public function get_checkbox_choices( $value, $disabled_text, $form_id = 0 ) {
|
67 |
+
$choices = '';
|
68 |
+
$is_entry_detail = $this->is_entry_detail();
|
69 |
+
$is_form_editor = $this->is_form_editor();
|
70 |
+
|
71 |
+
$choice = array(
|
72 |
+
'text' => $this->get_field_label( false, $value ),
|
73 |
+
'value' => "1",
|
74 |
+
'isSelected' => false,
|
75 |
+
);
|
76 |
+
|
77 |
+
$input_id = $this->id;
|
78 |
+
if ( $is_entry_detail || $is_form_editor || $form_id == 0 ){
|
79 |
+
$id = $this->id;
|
80 |
+
} else {
|
81 |
+
$id = $form_id . '_' . $this->id;
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( ! isset( $_GET['gf_token'] ) && empty( $_POST ) && rgar( $choice, 'isSelected' ) ) {
|
85 |
+
$checked = "checked='checked'";
|
86 |
+
} elseif ( is_array( $value ) && RGFormsModel::choice_value_match( $this, $choice, rgget( $input_id, $value ) ) ) {
|
87 |
+
$checked = "checked='checked'";
|
88 |
+
} elseif ( ! is_array( $value ) && RGFormsModel::choice_value_match( $this, $choice, $value ) ) {
|
89 |
+
$checked = "checked='checked'";
|
90 |
+
} else {
|
91 |
+
$checked = '';
|
92 |
+
}
|
93 |
+
|
94 |
+
$logic_event = $this->get_conditional_logic_event( 'click' );
|
95 |
+
|
96 |
+
$tabindex = $this->get_tabindex();
|
97 |
+
$choice_value = $choice['value'];
|
98 |
+
$choice_value = esc_attr( $choice_value );
|
99 |
+
$choice_markup = "<li class='gchoice_{$id}'>
|
100 |
+
<input name='input_{$input_id}' type='checkbox' $logic_event value='{$choice_value}' {$checked} id='choice_{$id}' {$tabindex} {$disabled_text} />
|
101 |
+
<label for='choice_{$id}' id='label_{$id}'>{$choice['text']}</label>
|
102 |
+
</li>";
|
103 |
+
|
104 |
+
$choices .= gf_apply_filters( array(
|
105 |
+
'gform_field_choice_markup_pre_render',
|
106 |
+
$this->formId,
|
107 |
+
$this->id
|
108 |
+
), $choice_markup, $choice, $this, $value );
|
109 |
+
|
110 |
+
return gf_apply_filters( array( 'gform_field_choices', $this->formId, $this->id ), $choices, $this );
|
111 |
+
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
integrations/gravity-forms/class-gravity-forms.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) or exit;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class MC4WP_Ninja_Forms_Integration
|
7 |
+
*
|
8 |
+
* @ignore
|
9 |
+
*/
|
10 |
+
class MC4WP_Gravity_Forms_Integration extends MC4WP_Integration {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var string
|
14 |
+
*/
|
15 |
+
public $name = "Gravity Forms";
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
public $description = "Subscribe visitors from your Gravity Forms forms.";
|
21 |
+
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Add hooks
|
25 |
+
*/
|
26 |
+
public function add_hooks() {
|
27 |
+
add_action( 'gform_field_standard_settings', array( $this, 'settings_fields' ), 10, 2);
|
28 |
+
add_action( 'gform_editor_js', array( $this, 'editor_js' ) );
|
29 |
+
add_action( 'gform_after_submission', array( $this, 'after_submission' ), 10, 2 );
|
30 |
+
}
|
31 |
+
|
32 |
+
public function after_submission( $submission, $form ) {
|
33 |
+
|
34 |
+
$subscribe = false;
|
35 |
+
$email_address = '';
|
36 |
+
$mailchimp_list_id = '';
|
37 |
+
$double_optin = $this->options['double_optin'];
|
38 |
+
|
39 |
+
// find email field & checkbox value
|
40 |
+
foreach( $form['fields'] as $field ) {
|
41 |
+
if( $field->type === 'email' && empty( $email_address ) && ! empty( $submission[ $field->id ] ) ) {
|
42 |
+
$email_address = $submission[ $field->id ];
|
43 |
+
}
|
44 |
+
|
45 |
+
if( $field->type === 'mailchimp' && ! empty( $submission[ $field->id ] ) ) {
|
46 |
+
$subscribe = true;
|
47 |
+
$mailchimp_list_id = $field->mailchimp_list;
|
48 |
+
|
49 |
+
if( isset( $field->mailchimp_double_optin ) ) {
|
50 |
+
$double_optin = $field->mailchimp_double_optin;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
if( ! $subscribe || empty( $email_address ) || empty( $mailchimp_list_id ) ) {
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
|
59 |
+
// override integration settings with field options
|
60 |
+
$orig_options = $this->options;
|
61 |
+
$this->options['lists'] = array( $mailchimp_list_id );
|
62 |
+
$this->options['double_optin'] = $double_optin;
|
63 |
+
|
64 |
+
// perform the sign-up
|
65 |
+
$this->subscribe( array( 'EMAIL' => $email_address ), $submission['form_id'] );
|
66 |
+
|
67 |
+
// revert back to original options in case request lives on
|
68 |
+
$this->options = $orig_options;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function editor_js() {
|
72 |
+
?>
|
73 |
+
<script type="text/javascript">
|
74 |
+
/*
|
75 |
+
* When the field settings are initialized, populate
|
76 |
+
* the custom field setting.
|
77 |
+
*/
|
78 |
+
jQuery(document).on('gform_load_field_settings', function(ev, field) {
|
79 |
+
jQuery('#field_mailchimp_list').val(field.mailchimp_list || '');
|
80 |
+
jQuery('#field_mailchimp_double_optin').val(field.mailchimp_double_optin || "1");
|
81 |
+
});
|
82 |
+
</script>
|
83 |
+
<?php
|
84 |
+
}
|
85 |
+
|
86 |
+
public function settings_fields( $pos, $form_id ) {
|
87 |
+
if( $pos !== 0 ) { return; }
|
88 |
+
$mailchimp = new MC4WP_MailChimp();
|
89 |
+
$lists = $mailchimp->get_cached_lists();
|
90 |
+
?>
|
91 |
+
<li class="mailchimp_list_setting field_setting">
|
92 |
+
<label for="field_mailchimp_list" class="section_label">
|
93 |
+
<?php esc_html_e( 'MailChimp list', 'mailchimp-for-wp' ); ?>
|
94 |
+
</label>
|
95 |
+
<select id="field_mailchimp_list" onchange="SetFieldProperty('mailchimp_list', this.value)">
|
96 |
+
<option value="" disabled><?php _e( 'Select a MailChimp list', 'mailchimp-for-wp' ); ?></option>
|
97 |
+
<?php foreach( $lists as $list ) {
|
98 |
+
echo sprintf( '<option value="%s">%s</option>', $list->id, $list->name );
|
99 |
+
} ?>
|
100 |
+
</select>
|
101 |
+
</li>
|
102 |
+
<li class="mailchimp_double_optin field_setting">
|
103 |
+
<label for="field_mailchimp_double_optin" class="section_label">
|
104 |
+
<?php esc_html_e( 'Double opt-in?', 'mailchimp-for-wp' ); ?>
|
105 |
+
</label>
|
106 |
+
<select id="field_mailchimp_double_optin" onchange="SetFieldProperty('mailchimp_double_optin', this.value)">
|
107 |
+
<option value="1"><?php echo __( 'Yes' ); ?></option>
|
108 |
+
<option value="0"><?php echo __( 'No' ); ?></option>
|
109 |
+
</select>
|
110 |
+
</li>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* @return bool
|
116 |
+
*/
|
117 |
+
public function is_installed() {
|
118 |
+
return class_exists( 'GF_Field' );
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* @since 3.0
|
123 |
+
* @return array
|
124 |
+
*/
|
125 |
+
public function get_ui_elements() {
|
126 |
+
return array();
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @param int $form_id
|
131 |
+
* @return string
|
132 |
+
*/
|
133 |
+
public function get_object_link( $form_id ) {
|
134 |
+
return '<a href="'. admin_url( sprintf( 'admin.php?page=gf_edit_forms&id=%d', $form_id ) ) . '">Gravity Forms</a>';
|
135 |
+
}
|
136 |
+
|
137 |
+
}
|
integrations/ninja-forms/class-action.php
CHANGED
@@ -18,6 +18,9 @@ final class MC4WP_Ninja_Forms_Action extends NF_Abstracts_ActionNewsletter
|
|
18 |
parent::__construct();
|
19 |
|
20 |
$this->_nicename = __( 'MailChimp', 'mailchimp-for-wp' );
|
|
|
|
|
|
|
21 |
|
22 |
$this->_settings[ 'double_optin' ] = array(
|
23 |
'name' => 'double_optin',
|
@@ -57,24 +60,24 @@ final class MC4WP_Ninja_Forms_Action extends NF_Abstracts_ActionNewsletter
|
|
57 |
),
|
58 |
);
|
59 |
|
60 |
-
$this->_settings[ 'replace_interests' ] = array(
|
61 |
-
'name' => 'replace_interests',
|
62 |
-
'type' => 'select',
|
63 |
-
'label' => __( 'Replace existing interest groups?', 'mailchimp-for-wp'),
|
64 |
-
'width' => 'full',
|
65 |
-
'group' => 'primary',
|
66 |
-
'value' => 0,
|
67 |
-
'options' => array(
|
68 |
-
array(
|
69 |
-
'value' => 1,
|
70 |
-
'label' => 'Yes',
|
71 |
-
),
|
72 |
-
array(
|
73 |
-
'value' => 0,
|
74 |
-
'label' => 'No',
|
75 |
-
),
|
76 |
-
),
|
77 |
-
);
|
78 |
}
|
79 |
|
80 |
/*
|
@@ -111,23 +114,11 @@ final class MC4WP_Ninja_Forms_Action extends NF_Abstracts_ActionNewsletter
|
|
111 |
}
|
112 |
}
|
113 |
|
114 |
-
$
|
115 |
-
'email_address' => $email_address,
|
116 |
-
'merge_fields' => $merge_fields,
|
117 |
-
'status' => $action_settings['double_optin'] == '0' ? 'subscribed' : 'pending',
|
118 |
-
);
|
119 |
-
|
120 |
$update_existing = $action_settings['update_existing'] == '1';
|
121 |
-
$replace_interests = $action_settings['replace_interests'] == '1';
|
122 |
|
123 |
-
|
124 |
-
$subscriber = $mailchimp->list_subscribe( $list_id, $email_address, $args, $update_existing, $replace_interests );
|
125 |
-
|
126 |
-
// log errors
|
127 |
-
if( ! $subscriber && $mailchimp->has_error() ) {
|
128 |
-
$log = mc4wp('log');
|
129 |
-
$log->error( sprintf( 'Ninja Forms > MailChimp API error: %s %s', $mailchimp->get_error_code(), $mailchimp->get_error_message() ) );
|
130 |
-
}
|
131 |
}
|
132 |
|
133 |
protected function get_lists()
|
18 |
parent::__construct();
|
19 |
|
20 |
$this->_nicename = __( 'MailChimp', 'mailchimp-for-wp' );
|
21 |
+
$prefix = $this->get_name();
|
22 |
+
|
23 |
+
unset( $this->_settings[ $prefix . 'newsletter_list_groups' ] );
|
24 |
|
25 |
$this->_settings[ 'double_optin' ] = array(
|
26 |
'name' => 'double_optin',
|
60 |
),
|
61 |
);
|
62 |
|
63 |
+
// $this->_settings[ 'replace_interests' ] = array(
|
64 |
+
// 'name' => 'replace_interests',
|
65 |
+
// 'type' => 'select',
|
66 |
+
// 'label' => __( 'Replace existing interest groups?', 'mailchimp-for-wp'),
|
67 |
+
// 'width' => 'full',
|
68 |
+
// 'group' => 'primary',
|
69 |
+
// 'value' => 0,
|
70 |
+
// 'options' => array(
|
71 |
+
// array(
|
72 |
+
// 'value' => 1,
|
73 |
+
// 'label' => 'Yes',
|
74 |
+
// ),
|
75 |
+
// array(
|
76 |
+
// 'value' => 0,
|
77 |
+
// 'label' => 'No',
|
78 |
+
// ),
|
79 |
+
// ),
|
80 |
+
// );
|
81 |
}
|
82 |
|
83 |
/*
|
114 |
}
|
115 |
}
|
116 |
|
117 |
+
$double_optin = $action_settings['double_optin'] == '0';
|
|
|
|
|
|
|
|
|
|
|
118 |
$update_existing = $action_settings['update_existing'] == '1';
|
119 |
+
$replace_interests = isset( $action_settings['replace_interests'] ) && $action_settings['replace_interests'] == '1';
|
120 |
|
121 |
+
do_action( 'mc4wp_integration_ninja_forms_subscribe', $email_address, $merge_fields, $list_id, $double_optin, $update_existing, $replace_interests, $form_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
|
124 |
protected function get_lists()
|
integrations/ninja-forms/class-ninja-forms.php
CHANGED
@@ -23,7 +23,26 @@ class MC4WP_Ninja_Forms_Integration extends MC4WP_Integration {
|
|
23 |
/**
|
24 |
* Add hooks
|
25 |
*/
|
26 |
-
public function add_hooks() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
/**
|
29 |
* @return bool
|
@@ -40,4 +59,12 @@ class MC4WP_Ninja_Forms_Integration extends MC4WP_Integration {
|
|
40 |
return array();
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
23 |
/**
|
24 |
* Add hooks
|
25 |
*/
|
26 |
+
public function add_hooks() {
|
27 |
+
add_action( 'mc4wp_integration_ninja_forms_subscribe', array( $this, 'subscribe_from_ninja_forms' ), 10, 7 );
|
28 |
+
}
|
29 |
+
|
30 |
+
public function subscribe_from_ninja_forms( $email_address, $merge_fields, $list_id, $double_optin = true, $update_existing = false, $replace_interests = false, $form_id = 0 ) {
|
31 |
+
// set options from parameters (coming from action)
|
32 |
+
$orig_options = $this->options;
|
33 |
+
$this->options['double_optin'] = $double_optin;
|
34 |
+
$this->options['update_existing'] = $update_existing;
|
35 |
+
$this->options['replace_interests'] = $replace_interests;
|
36 |
+
$this->options['lists'] = array( $list_id );
|
37 |
+
|
38 |
+
$data = $merge_fields;
|
39 |
+
$data['EMAIL'] = $email_address;
|
40 |
+
|
41 |
+
$this->subscribe( $data, $form_id );
|
42 |
+
|
43 |
+
// revert to original options
|
44 |
+
$this->options = $orig_options;
|
45 |
+
}
|
46 |
|
47 |
/**
|
48 |
* @return bool
|
59 |
return array();
|
60 |
}
|
61 |
|
62 |
+
/**
|
63 |
+
* @param int $form_id
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function get_object_link( $form_id ) {
|
67 |
+
return '<a href="' . admin_url( sprintf( 'admin.php?page=ninja-forms&form_id=%d', $form_id ) ) . '">Ninja Forms</a>';
|
68 |
+
}
|
69 |
+
|
70 |
}
|
integrations/wpforms/class-wpforms.php
CHANGED
@@ -58,8 +58,6 @@ class MC4WP_WPForms_Integration extends MC4WP_Integration {
|
|
58 |
}
|
59 |
}
|
60 |
|
61 |
-
|
62 |
-
|
63 |
$mailchimp_list_id = $form_data['fields'][$checkbox_field_id]['mailchimp_list'];
|
64 |
$this->options['lists'] = array( $mailchimp_list_id );
|
65 |
|
@@ -68,4 +66,12 @@ class MC4WP_WPForms_Integration extends MC4WP_Integration {
|
|
68 |
}
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
58 |
}
|
59 |
}
|
60 |
|
|
|
|
|
61 |
$mailchimp_list_id = $form_data['fields'][$checkbox_field_id]['mailchimp_list'];
|
62 |
$this->options['lists'] = array( $mailchimp_list_id );
|
63 |
|
66 |
}
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* @param int $form_id
|
71 |
+
* @return string
|
72 |
+
*/
|
73 |
+
public function get_object_link( $form_id ) {
|
74 |
+
return '<a href="' . admin_url( sprintf( 'admin.php?page=wpforms-builder&view=fields&form_id=%d', $form_id ) ) . '">WPForms</a>';
|
75 |
+
}
|
76 |
+
|
77 |
}
|
languages/mailchimp-for-wp-ca_ES.mo
CHANGED
Binary file
|
languages/mailchimp-for-wp-ca_ES.po
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
msgid ""
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: MailChimp for WordPress\n"
|
9 |
-
"PO-Revision-Date: 2017-
|
10 |
"Last-Translator: Xavier Gimeno Torrent\n"
|
11 |
"Language-Team: Catalan (Spain) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/ca_ES/)\n"
|
12 |
"MIME-Version: 1.0\n"
|
6 |
msgid ""
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: MailChimp for WordPress\n"
|
9 |
+
"PO-Revision-Date: 2017-09-23 20:54+0000\n"
|
10 |
"Last-Translator: Xavier Gimeno Torrent\n"
|
11 |
"Language-Team: Catalan (Spain) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/ca_ES/)\n"
|
12 |
"MIME-Version: 1.0\n"
|
languages/mailchimp-for-wp-cs_CZ.mo
CHANGED
Binary file
|
languages/mailchimp-for-wp-cs_CZ.po
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
# Copyright (C)
|
2 |
-
# This file is distributed under the same license as the
|
3 |
# Translators:
|
4 |
# Dušan Marcinko <prectusi@gmail.com>, 2016
|
5 |
# Jan Toman <toman.jan@gmail.com>, 2014-2015
|
@@ -9,68 +9,21 @@
|
|
9 |
msgid ""
|
10 |
msgstr ""
|
11 |
"Project-Id-Version: MailChimp for WordPress\n"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"PO-Revision-Date: 2016-11-29 21:44+0000\n"
|
15 |
-
"Last-Translator: Dušan Marcinko <prectusi@gmail.com>\n"
|
16 |
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/cs_CZ/)\n"
|
17 |
"MIME-Version: 1.0\n"
|
18 |
"Content-Type: text/plain; charset=UTF-8\n"
|
19 |
"Content-Transfer-Encoding: 8bit\n"
|
20 |
"Language: cs_CZ\n"
|
21 |
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
#:
|
24 |
-
msgid "Email address"
|
25 |
-
msgstr "E-mailová adresa:"
|
26 |
-
|
27 |
-
#: config/default-form-content.php:4
|
28 |
-
msgid "Your email address"
|
29 |
-
msgstr "Vaše e-mailová adresa:"
|
30 |
-
|
31 |
-
#: config/default-form-content.php:5
|
32 |
-
msgid "Sign up"
|
33 |
-
msgstr "Registrovat se"
|
34 |
-
|
35 |
-
#: config/default-form-messages.php:5
|
36 |
-
msgid ""
|
37 |
-
"Thank you, your sign-up request was successful! Please check your email "
|
38 |
-
"inbox to confirm."
|
39 |
-
msgstr "Děkujeme, vaše registrace byla úspěšná. Prosím, zkontrolujte váš emailový účet a dokončete registraci."
|
40 |
-
|
41 |
-
#: config/default-form-messages.php:9
|
42 |
-
msgid "Oops. Something went wrong. Please try again later."
|
43 |
-
msgstr "Něco se pokazilo. Vyzkoušejte to prosím znovu."
|
44 |
-
|
45 |
-
#: config/default-form-messages.php:13
|
46 |
-
msgid "Please provide a valid email address."
|
47 |
-
msgstr "Vyplňte prosím validní tvar e-mailu."
|
48 |
-
|
49 |
-
#: config/default-form-messages.php:17
|
50 |
-
msgid "Given email address is already subscribed, thank you!"
|
51 |
-
msgstr "Zadaná adresa je již na našem seznamu odběratelů. Děkujeme!"
|
52 |
-
|
53 |
-
#: config/default-form-messages.php:21
|
54 |
-
msgid "Please fill in the required fields."
|
55 |
-
msgstr "Vyplňte prosím všechna povinná políčka."
|
56 |
-
|
57 |
-
#: config/default-form-messages.php:25
|
58 |
-
msgid "You were successfully unsubscribed."
|
59 |
-
msgstr "Byli jste úspěšně odhlášení."
|
60 |
-
|
61 |
-
#: config/default-form-messages.php:29
|
62 |
-
msgid "Given email address is not subscribed."
|
63 |
-
msgstr "Zadaná e-mailová adresa není registrována k odběru."
|
64 |
-
|
65 |
-
#: config/default-form-messages.php:33
|
66 |
-
msgid "Please select at least one list."
|
67 |
-
msgstr "Vyberte prosím alespoň jednu položku"
|
68 |
-
|
69 |
-
#: config/default-integration-options.php:5
|
70 |
-
msgid "Sign me up for the newsletter!"
|
71 |
-
msgstr "Přihlásit se k odběru novinek!"
|
72 |
-
|
73 |
-
#: includes/admin/class-admin-texts.php:62
|
74 |
#: includes/forms/views/edit-form.php:6
|
75 |
msgid "Settings"
|
76 |
msgstr "Nastavení"
|
@@ -79,141 +32,388 @@ msgstr "Nastavení"
|
|
79 |
msgid "Documentation"
|
80 |
msgstr "Dokumentace"
|
81 |
|
82 |
-
#: includes/admin/class-admin.php:
|
83 |
msgid ""
|
84 |
"Success! The cached configuration for your MailChimp lists has been renewed."
|
85 |
msgstr "Dostu"
|
86 |
|
87 |
-
#: includes/admin/class-admin.php:
|
88 |
msgid ""
|
89 |
"This is a pro-only feature. Please upgrade to the premium version to be able"
|
90 |
" to use it."
|
91 |
msgstr "Dostupné pouze v PRO verzi. Pro použití musíte přejít na premiovou PRO verzi."
|
92 |
|
93 |
-
#: includes/admin/class-admin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
msgid "MailChimp API Settings"
|
95 |
msgstr "Nastavení API MailChimpu"
|
96 |
|
97 |
-
#: includes/admin/class-admin.php:
|
98 |
-
#: integrations/ninja-forms/class-ninja-forms.php:34
|
99 |
msgid "MailChimp"
|
100 |
msgstr "MailChimp"
|
101 |
|
102 |
-
#: includes/admin/class-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
#: includes/admin/class-
|
107 |
msgid ""
|
108 |
-
"
|
109 |
-
"
|
110 |
-
msgstr "
|
111 |
|
112 |
-
#: includes/admin/class-ads.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
msgid "More subscribers, better newsletters."
|
114 |
msgstr "Více registrovaných, přinese úspěšnější newslettery."
|
115 |
|
116 |
-
#: includes/admin/class-ads.php:
|
117 |
msgid ""
|
118 |
"Learn how to best grow your lists & write better emails by subscribing to "
|
119 |
"our monthly tips."
|
120 |
msgstr "Naučte se jak více rozšířit Váš seznam a jak psát lepší emaily odběrem našich typů každý měsíčních."
|
121 |
|
122 |
-
#: includes/admin/class-ads.php:
|
123 |
msgid "Email Address"
|
124 |
msgstr "E-mailová adresa:"
|
125 |
|
126 |
-
#: includes/admin/class-ads.php:
|
127 |
msgid "First Name"
|
128 |
msgstr "Křestní jméno"
|
129 |
|
130 |
-
#: includes/admin/class-ads.php:
|
131 |
msgid "Subscribe"
|
132 |
msgstr "Přihlásit se k odběru"
|
133 |
|
134 |
-
#: includes/admin/class-
|
135 |
-
msgid "
|
136 |
-
|
|
|
|
|
137 |
|
138 |
-
#: includes/admin/
|
139 |
-
msgid "
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
-
#: includes/class-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
msgid "Read more about common connectivity issues."
|
144 |
msgstr "Více informací o běžných problémech s připojením."
|
145 |
|
146 |
-
#: includes/forms/class-admin.php:
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
msgid "Forms"
|
149 |
msgstr "Formuláře"
|
150 |
|
151 |
-
#: includes/forms/class-admin.
|
152 |
msgid "<strong>Success!</strong> Form successfully saved."
|
153 |
msgstr "<strong>Hotovo!</strong> Formulář úspěšně uložen."
|
154 |
|
155 |
-
#: includes/forms/class-admin.php:
|
156 |
msgid "Preview form"
|
157 |
msgstr "Náhledový formulář"
|
158 |
|
159 |
-
#: includes/forms/class-admin.php:
|
160 |
-
msgid "
|
161 |
-
msgstr "
|
162 |
|
163 |
-
#: includes/forms/class-admin.php:
|
164 |
-
msgid "
|
165 |
-
msgstr "
|
166 |
|
167 |
-
#: includes/forms/class-form-previewer.php:
|
168 |
msgid "Form preview"
|
169 |
msgstr "Náhled formuláře"
|
170 |
|
171 |
-
#: includes/forms/class-form-tags.php:
|
172 |
msgid "Replaced with the form response (error or success messages)."
|
173 |
msgstr "Bude nahrazeno potvrzovací, chybovou či jinou hláškou."
|
174 |
|
175 |
-
#: includes/forms/class-form-tags.php:
|
176 |
msgid "Data from the URL or a submitted form."
|
177 |
msgstr "Data z URL adresy nebo z potvrzovacího pole."
|
178 |
|
179 |
-
#: includes/forms/class-form-tags.php:
|
|
|
|
|
|
|
|
|
180 |
#: includes/integrations/class-integration-tags.php:45
|
181 |
msgid "Replaced with the number of subscribers on the selected list(s)"
|
182 |
msgstr "Bude nahrazeno počtem odběratelů na vybraném seznamu adres."
|
183 |
|
184 |
-
#: includes/forms/class-form-tags.php:
|
185 |
msgid "The email address of the current visitor (if known)."
|
186 |
msgstr "Emailová adresa aktuálního návštěvníka (pokud je známa)."
|
187 |
|
188 |
-
#: includes/forms/class-form-tags.php:
|
189 |
msgid "The URL of the page."
|
190 |
msgstr "URL webové stránky"
|
191 |
|
192 |
-
#: includes/forms/class-form-tags.php:
|
193 |
msgid "The path of the page."
|
194 |
msgstr "Cesta k webové stránce."
|
195 |
|
196 |
-
#: includes/forms/class-form-tags.php:
|
197 |
msgid "The current date. Example: %s."
|
198 |
msgstr "Aktuální datum. Příklad: %s."
|
199 |
|
200 |
-
#: includes/forms/class-form-tags.php:
|
201 |
msgid "The current time. Example: %s."
|
202 |
msgstr "Aktuální čas. Příklad: %s."
|
203 |
|
204 |
-
#: includes/forms/class-form-tags.php:
|
205 |
msgid "The site's language. Example: %s."
|
206 |
msgstr "Jazyk stránek. Příklad: %s."
|
207 |
|
208 |
-
#: includes/forms/class-form-tags.php:
|
209 |
msgid "The visitor's IP address. Example: %s."
|
210 |
msgstr "Návštěvníkova IP adresa. Příklad: %s."
|
211 |
|
212 |
-
#: includes/forms/class-form-tags.php:
|
213 |
msgid "The property of the currently logged-in user."
|
214 |
msgstr "Majetkem aktuálně přihlášeného uživatele."
|
215 |
|
216 |
-
#: includes/forms/class-form.php:
|
|
|
|
|
|
|
|
|
217 |
msgid "There is no form with ID %d, perhaps it was deleted?"
|
218 |
msgstr "Žádné pole s ID %d, pravděpodobně bylo smazáno."
|
219 |
|
@@ -221,10 +421,6 @@ msgstr "Žádné pole s ID %d, pravděpodobně bylo smazáno."
|
|
221 |
msgid "Newsletter"
|
222 |
msgstr "Newsletter"
|
223 |
|
224 |
-
#: includes/forms/class-widget.php:30
|
225 |
-
msgid "MailChimp Sign-Up Form"
|
226 |
-
msgstr "Registrační formulář MailChimpu"
|
227 |
-
|
228 |
#: includes/forms/class-widget.php:32
|
229 |
msgid "Displays your MailChimp for WordPress sign-up form"
|
230 |
msgstr "Zobrazuje váš formulář pro odběratele"
|
@@ -239,7 +435,114 @@ msgid ""
|
|
239 |
" form settings</a>."
|
240 |
msgstr "Editovat nastavení přihlašovacích formulářů pluginu \"Mailchimp for Wordpress\" můžete <a href=\"%s\">zde</a>."
|
241 |
|
242 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
msgid "Add new form"
|
244 |
msgstr "Přidat nový formulář"
|
245 |
|
@@ -267,38 +570,266 @@ msgstr "Pole"
|
|
267 |
msgid "Messages"
|
268 |
msgstr "Hlášky"
|
269 |
|
270 |
-
#: includes/forms/views/edit-form.php:7
|
271 |
-
msgid "Appearance"
|
272 |
-
msgstr "Vzhled"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
#: includes/
|
275 |
-
|
276 |
-
|
277 |
-
#: includes/views/general-settings.php:7
|
278 |
-
msgid "You are here: "
|
279 |
-
msgstr "Tady jsi:"
|
280 |
|
281 |
-
#: includes/
|
282 |
-
msgid "
|
283 |
-
msgstr "
|
284 |
|
285 |
-
#: includes/
|
286 |
-
msgid "
|
287 |
-
msgstr "
|
288 |
|
289 |
-
#: includes/
|
290 |
-
msgid "
|
291 |
-
msgstr "
|
292 |
|
293 |
-
#: includes/
|
294 |
-
msgid "
|
295 |
-
msgstr "
|
296 |
|
297 |
-
#: includes/
|
298 |
-
msgid "
|
299 |
-
msgstr "
|
300 |
|
301 |
-
#: includes/forms/views/parts/add-fields-help.
|
302 |
#: includes/forms/views/tabs/form-fields.php:10
|
303 |
msgid "Add more fields"
|
304 |
msgstr "Přidat další pole"
|
@@ -335,11 +866,6 @@ msgid ""
|
|
335 |
"changes."
|
336 |
msgstr "Klikněte na následující tlačítko aby MailChimp mohl WordPressu odeslat Vaše změny."
|
337 |
|
338 |
-
#: includes/forms/views/parts/add-fields-help.php:43
|
339 |
-
#: includes/views/parts/lists-overview.php:8
|
340 |
-
msgid "Renew MailChimp lists"
|
341 |
-
msgstr "Aktualizovat seznamy adres"
|
342 |
-
|
343 |
#: includes/forms/views/parts/dynamic-content-tags.php:6
|
344 |
msgid "Add dynamic form variable"
|
345 |
msgstr "Přidat dynamické proměné formuláře"
|
@@ -412,87 +938,101 @@ msgstr "Pole formuláře"
|
|
412 |
msgid "Enter the HTML code for your form fields.."
|
413 |
msgstr "Vložte HTML kód Vašich formulářových polí."
|
414 |
|
415 |
-
#: includes/forms/views/tabs/form-fields.php:
|
416 |
-
msgid "Your form is missing the following (required) form fields:"
|
417 |
-
msgstr "Ve vašem formuláři chybí tato (povinná) formulářová políčka:"
|
418 |
-
|
419 |
-
#: includes/forms/views/tabs/form-fields.php:34
|
420 |
msgid ""
|
421 |
"Use the shortcode %s to display this form inside a post, page or text "
|
422 |
"widget."
|
423 |
msgstr "Pro zobrazení tohoto formuláře v příspěvku, stránce nebo ve textovém widgetu použijte zkratku %s."
|
424 |
|
425 |
-
#: includes/forms/views/tabs/form-messages.php:
|
426 |
msgid "Form Messages"
|
427 |
msgstr "Zprávy formuláře"
|
428 |
|
429 |
-
#: includes/forms/views/tabs/form-messages.php:
|
430 |
msgid "Successfully subscribed"
|
431 |
msgstr "Úspešně přihlášen"
|
432 |
|
433 |
-
#: includes/forms/views/tabs/form-messages.php:
|
434 |
msgid ""
|
435 |
"The text that shows when an email address is successfully subscribed to the "
|
436 |
"selected list(s)."
|
437 |
msgstr "Text zobrazující se po úspěšném odeslaní emailu do vybraného seznamu(ů). "
|
438 |
|
439 |
-
#: includes/forms/views/tabs/form-messages.php:
|
440 |
msgid "Invalid email address"
|
441 |
msgstr "Neplatná emailová adresa"
|
442 |
|
443 |
-
#: includes/forms/views/tabs/form-messages.php:
|
444 |
msgid "The text that shows when an invalid email address is given."
|
445 |
msgstr "Text zobrazovaný při špatném vyplnění emailové adresy."
|
446 |
|
447 |
-
#: includes/forms/views/tabs/form-messages.php:
|
448 |
msgid "Required field missing"
|
449 |
msgstr "Chybí požadované pole"
|
450 |
|
451 |
-
#: includes/forms/views/tabs/form-messages.php:
|
452 |
msgid ""
|
453 |
"The text that shows when a required field for the selected list(s) is "
|
454 |
"missing."
|
455 |
msgstr "Text zobrazený pokud chybí požadované pole vybraného seznamu(ů)."
|
456 |
|
457 |
-
#: includes/forms/views/tabs/form-messages.php:
|
458 |
msgid "Already subscribed"
|
459 |
msgstr "Jste již přihlášen"
|
460 |
|
461 |
-
#: includes/forms/views/tabs/form-messages.php:
|
462 |
msgid ""
|
463 |
"The text that shows when the given email is already subscribed to the "
|
464 |
"selected list(s)."
|
465 |
msgstr "Text zobrazený pokud odeslaný email již je v seznamu(ech)."
|
466 |
|
467 |
-
#: includes/forms/views/tabs/form-messages.php:
|
468 |
msgid "General error"
|
469 |
msgstr "Obecná chyba"
|
470 |
|
471 |
-
#: includes/forms/views/tabs/form-messages.php:
|
472 |
msgid "The text that shows when a general error occured."
|
473 |
msgstr "Text zobrazující se pokud nastane obecná chyba."
|
474 |
|
475 |
-
#: includes/forms/views/tabs/form-messages.php:
|
476 |
msgid "Unsubscribed"
|
477 |
msgstr "Odhlášen z odběru"
|
478 |
|
479 |
-
#: includes/forms/views/tabs/form-messages.php:
|
480 |
msgid ""
|
481 |
"When using the unsubscribe method, this is the text that shows when the "
|
482 |
"given email address is successfully unsubscribed from the selected list(s)."
|
483 |
msgstr "Pokud používáte metodu k odjlášení z odběru, bude tento text zobrazen, když odeslaná emailová adresa bude úspěšně odhlášena z vybraného seznamu(ů)."
|
484 |
|
485 |
-
#: includes/forms/views/tabs/form-messages.php:
|
486 |
msgid "Not subscribed"
|
487 |
msgstr "Nepřihlášen k odběru"
|
488 |
|
489 |
-
#: includes/forms/views/tabs/form-messages.php:
|
490 |
msgid ""
|
491 |
"When using the unsubscribe method, this is the text that shows when the "
|
492 |
"given email address is not on the selected list(s)."
|
493 |
msgstr "Pokud používáte metodu k odhlášení z odběru, bude tento text zobrazen vpřípadě, že odeslaná emailová adresa nebude na vybraném seznamu(ech)."
|
494 |
|
495 |
-
#: includes/forms/views/tabs/form-messages.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
496 |
msgid "HTML tags like %s are allowed in the message fields."
|
497 |
msgstr "HTML tagy %s jsou v zobrazovaných hláškách povoleny."
|
498 |
|
@@ -504,379 +1044,52 @@ msgstr "Nastavení formuláře"
|
|
504 |
msgid "MailChimp specific settings"
|
505 |
msgstr "Specifická nastavení MailChimp"
|
506 |
|
507 |
-
#: includes/forms/views/tabs/form-settings.php:
|
508 |
msgid "Lists this form subscribes to"
|
509 |
msgstr "Na který seznam adres chcete uživatele přidávat?"
|
510 |
|
511 |
-
#: includes/forms/views/tabs/form-settings.php:
|
512 |
-
#: includes/integrations/views/integration-settings.php:93
|
513 |
-
msgid "No lists found, <a href=\"%s\">are you connected to MailChimp</a>?"
|
514 |
-
msgstr "Žádné seznamy odběratelů (listy) nebyly nalezeny. %sOpravdu jste přihlášení k MailChimpu?%s"
|
515 |
-
|
516 |
-
#: includes/forms/views/tabs/form-settings.php:29
|
517 |
msgid ""
|
518 |
"Select the list(s) to which people who submit this form should be "
|
519 |
"subscribed."
|
520 |
msgstr "Vyberte jeden či více seznamů adres, do kterých budou zařazeni všichni uživatelé, kteří se přihlásí k odběru novinek."
|
521 |
|
522 |
-
#: includes/forms/views/tabs/form-settings.php:
|
523 |
msgid "Use double opt-in?"
|
524 |
msgstr "Používat dvojí opt-in?"
|
525 |
|
526 |
-
#: includes/forms/views/tabs/form-settings.php:
|
527 |
-
|
528 |
-
|
529 |
-
#: includes/forms/views/tabs/form-settings.php:85
|
530 |
-
#: includes/forms/views/tabs/form-settings.php:115
|
531 |
-
#: includes/integrations/views/integration-settings.php:53
|
532 |
-
#: includes/integrations/views/integration-settings.php:66
|
533 |
-
#: includes/integrations/views/integration-settings.php:117
|
534 |
-
#: includes/integrations/views/integration-settings.php:129
|
535 |
-
#: includes/integrations/views/integration-settings.php:142
|
536 |
-
#: includes/integrations/views/integration-settings.php:163
|
537 |
-
#: includes/integrations/views/integration-settings.php:180
|
538 |
-
#: includes/integrations/views/integration-settings.php:199
|
539 |
-
#: integrations/contact-form-7/class-contact-form-7.php:69
|
540 |
-
msgid "Yes"
|
541 |
-
msgstr "Ano"
|
542 |
-
|
543 |
-
#: includes/forms/views/tabs/form-settings.php:43
|
544 |
-
#: includes/forms/views/tabs/form-settings.php:58
|
545 |
-
#: includes/forms/views/tabs/form-settings.php:73
|
546 |
-
#: includes/forms/views/tabs/form-settings.php:89
|
547 |
-
#: includes/forms/views/tabs/form-settings.php:119
|
548 |
-
#: includes/integrations/views/integration-settings.php:54
|
549 |
-
#: includes/integrations/views/integration-settings.php:67
|
550 |
-
#: includes/integrations/views/integration-settings.php:118
|
551 |
-
#: includes/integrations/views/integration-settings.php:130
|
552 |
-
#: includes/integrations/views/integration-settings.php:146
|
553 |
-
#: includes/integrations/views/integration-settings.php:167
|
554 |
-
#: includes/integrations/views/integration-settings.php:184
|
555 |
-
#: includes/integrations/views/integration-settings.php:203
|
556 |
-
#: integrations/contact-form-7/class-contact-form-7.php:69
|
557 |
-
msgid "No"
|
558 |
-
msgstr "Ne"
|
559 |
-
|
560 |
-
#: includes/forms/views/tabs/form-settings.php:45
|
561 |
-
#: includes/integrations/views/integration-settings.php:149
|
562 |
-
msgid ""
|
563 |
-
"Select \"yes\" if you want people to confirm their email address before "
|
564 |
-
"being subscribed (recommended)"
|
565 |
-
msgstr "Pokud chcete, aby uživatelé museli potvrdit zadanou e-mailovou adresu předtím než budou zařazeni na seznam adres, vyberte \"Ano\" (doporučeno!)."
|
566 |
-
|
567 |
-
#: includes/forms/views/tabs/form-settings.php:50
|
568 |
-
msgid "Send final welcome email?"
|
569 |
-
msgstr "Zaslat finální uvítací mail?"
|
570 |
-
|
571 |
-
#: includes/forms/views/tabs/form-settings.php:60
|
572 |
-
#: includes/integrations/views/integration-settings.php:169
|
573 |
-
msgid ""
|
574 |
-
"Select \"yes\" if you want to send your lists Welcome Email if a subscribe "
|
575 |
-
"succeeds (only when double opt-in is disabled)."
|
576 |
-
msgstr "Pokud chcete, aby uživateli, který se nově přidá na seznam adres, přišel uvítací e-mail, vyberte \"Ano\". Tato možnost je dostupná pouze v případě, že nevyžadujete ověření e-mailu."
|
577 |
-
|
578 |
-
#: includes/forms/views/tabs/form-settings.php:65
|
579 |
-
#: includes/integrations/views/integration-settings.php:176
|
580 |
-
msgid "Update existing subscribers?"
|
581 |
-
msgstr "Chcete upravovat již existující uživatele?"
|
582 |
-
|
583 |
-
#: includes/forms/views/tabs/form-settings.php:75
|
584 |
-
#: includes/integrations/views/integration-settings.php:186
|
585 |
-
msgid ""
|
586 |
-
"Select \"yes\" if you want to update existing subscribers with the data that"
|
587 |
-
" is sent."
|
588 |
-
msgstr "Vyberte \"ano\" pokud chcete aktualizovat stávající odběratele s daty které se posílají."
|
589 |
-
|
590 |
-
#: includes/forms/views/tabs/form-settings.php:81
|
591 |
-
#: includes/integrations/views/integration-settings.php:195
|
592 |
-
msgid "Replace interest groups?"
|
593 |
-
msgstr "Vyměnit zájmové skupiny?"
|
594 |
|
595 |
-
#: includes/forms/views/tabs/form-settings.php:
|
596 |
-
#: includes/integrations/views/integration-settings.php:206
|
597 |
msgid ""
|
598 |
-
"
|
599 |
-
"
|
600 |
-
msgstr "
|
601 |
-
|
602 |
-
#: includes/forms/views/tabs/form-settings.php:93
|
603 |
-
#: includes/integrations/views/integration-settings.php:207
|
604 |
-
msgid "What does this do?"
|
605 |
-
msgstr "K čemu to slouží?"
|
606 |
|
607 |
-
#: includes/forms/views/tabs/form-settings.php:
|
608 |
msgid "Form behaviour"
|
609 |
msgstr "Chování formuláře"
|
610 |
|
611 |
-
#: includes/forms/views/tabs/form-settings.php:
|
612 |
msgid "Hide form after a successful sign-up?"
|
613 |
msgstr "Chcete skrývat formulář po úspěšné registraci?"
|
614 |
|
615 |
-
#: includes/forms/views/tabs/form-settings.php:
|
616 |
msgid "Select \"yes\" to hide the form fields after a successful sign-up."
|
617 |
msgstr "Pokud chcete skrýt formulář pro odebírání novinek skrýt po úspěšné registraci na seznam adres, vyberte \"Ano\"."
|
618 |
|
619 |
-
#: includes/forms/views/tabs/form-settings.php:
|
620 |
msgid "Redirect to URL after successful sign-ups"
|
621 |
msgstr "Na kterou adresu chcete přesměrovat uživatele po registraci?"
|
622 |
|
623 |
-
#: includes/forms/views/tabs/form-settings.php:
|
624 |
msgid "Example: %s"
|
625 |
msgstr "Příklad: %s"
|
626 |
|
627 |
-
#: includes/forms/views/tabs/form-settings.php:
|
628 |
msgid ""
|
629 |
"Leave empty or enter <code>0</code> for no redirect. Otherwise, use complete"
|
630 |
" (absolute) URLs, including <code>http://</code>."
|
631 |
msgstr "Nechte prázdné nebo vložte <code>0</code> pro nepřesměrování. Jinak, použijte plnou (absolutní) URLs, obsahující <code>http://</code>."
|
632 |
-
|
633 |
-
#: includes/integrations/class-admin.php:79
|
634 |
-
#: includes/integrations/class-admin.php:80
|
635 |
-
#: includes/integrations/views/integration-settings.php:10
|
636 |
-
#: includes/integrations/views/integrations.php:9
|
637 |
-
#: includes/integrations/views/integrations.php:17
|
638 |
-
msgid "Integrations"
|
639 |
-
msgstr "Integrace"
|
640 |
-
|
641 |
-
#: includes/integrations/views/integration-settings.php:20
|
642 |
-
msgid "%s integration"
|
643 |
-
msgstr "%s vložení"
|
644 |
-
|
645 |
-
#: includes/integrations/views/integration-settings.php:51
|
646 |
-
msgid "Enabled?"
|
647 |
-
msgstr "Povolit?"
|
648 |
-
|
649 |
-
#: includes/integrations/views/integration-settings.php:55
|
650 |
-
msgid ""
|
651 |
-
"Enable the %s integration? This will add a sign-up checkbox to the form."
|
652 |
-
msgstr "Povolit %s vložení? Tímto přidáte do formuláře zaškrtávací pole pro odběr novinek."
|
653 |
-
|
654 |
-
#: includes/integrations/views/integration-settings.php:64
|
655 |
-
msgid "Implicit?"
|
656 |
-
msgstr "Určitě?"
|
657 |
-
|
658 |
-
#: includes/integrations/views/integration-settings.php:68
|
659 |
-
msgid ""
|
660 |
-
"Select \"no\" if you want to ask your visitors before they are subscribed "
|
661 |
-
"(recommended)."
|
662 |
-
msgstr "Vyberte \"ne\" pokud chcte aby návštěvníci potvrzovali přihlášení k odběru (doporučeno)."
|
663 |
-
|
664 |
-
#: includes/integrations/views/integration-settings.php:78
|
665 |
-
msgid "MailChimp Lists"
|
666 |
-
msgstr "Seznam adres z MailChimpu"
|
667 |
-
|
668 |
-
#: includes/integrations/views/integration-settings.php:89
|
669 |
-
msgid ""
|
670 |
-
"Select the list(s) to which people who check the checkbox should be "
|
671 |
-
"subscribed."
|
672 |
-
msgstr "Vyberte jeden či více seznamů adres, do kterých budou zařazeni všichni uživatelé, kteří se přihlásí k odběru novinek."
|
673 |
-
|
674 |
-
#: includes/integrations/views/integration-settings.php:102
|
675 |
-
msgid "Checkbox label text"
|
676 |
-
msgstr "Popisek u zaškrtávacího políčka"
|
677 |
-
|
678 |
-
#: includes/integrations/views/integration-settings.php:105
|
679 |
-
msgid "HTML tags like %s are allowed in the label text."
|
680 |
-
msgstr "HTML tagy %s jsou v popisku povoleny."
|
681 |
-
|
682 |
-
#: includes/integrations/views/integration-settings.php:115
|
683 |
-
msgid "Pre-check the checkbox?"
|
684 |
-
msgstr "Chcete zaškrtávat políčko jako výchozí stav?"
|
685 |
-
|
686 |
-
#: includes/integrations/views/integration-settings.php:119
|
687 |
-
msgid "Select \"yes\" if the checkbox should be pre-checked."
|
688 |
-
msgstr "Zvolte \"ano\" pokud má týt checkbox zaškrtnutý."
|
689 |
-
|
690 |
-
#: includes/integrations/views/integration-settings.php:127
|
691 |
-
msgid "Load some default CSS?"
|
692 |
-
msgstr "Chcete načíst výchozí CSS styly?"
|
693 |
-
|
694 |
-
#: includes/integrations/views/integration-settings.php:131
|
695 |
-
msgid "Select \"yes\" if the checkbox appears in a weird place."
|
696 |
-
msgstr "Pokud se vám zaškrtávací políčko nezobrazuje dobře, vyberte \"Ano\"."
|
697 |
-
|
698 |
-
#: includes/integrations/views/integration-settings.php:138
|
699 |
-
msgid "Double opt-in?"
|
700 |
-
msgstr "Vyžadujete po uživatelích potvrzení e-mailu?"
|
701 |
-
|
702 |
-
#: includes/integrations/views/integration-settings.php:159
|
703 |
-
msgid "Send Welcome Email?"
|
704 |
-
msgstr "Chcete posílat uvítací e-mail?"
|
705 |
-
|
706 |
-
#: includes/integrations/views/integration-settings.php:244
|
707 |
-
msgid ""
|
708 |
-
"The selected MailChimp lists require non-default fields, which may prevent "
|
709 |
-
"this integration from working."
|
710 |
-
msgstr "Vybrané MailChimpové seznamy požadují nestandardní pole. To může způsobit nefunkčnost integrace."
|
711 |
-
|
712 |
-
#: includes/integrations/views/integration-settings.php:245
|
713 |
-
msgid ""
|
714 |
-
"Please ensure you <a href=\"%s\">configure the plugin to send all required "
|
715 |
-
"fields</a> or <a href=\"%s\">log into your MailChimp account</a> and make "
|
716 |
-
"sure only the email & name fields are marked as required fields for the "
|
717 |
-
"selected list(s)."
|
718 |
-
msgstr "Ujistěte se prosím <a href=\"%s\"> že jste nastavili plugin k odeslání všech požadovaných polí </a> nebo <a href=\"%s\"> přihlášte se do svého účtu MailChimp </a> a ujistěte se, že jen pole e-mailová a název jsou označena jako povinná pole pro vybraný seznam(y)."
|
719 |
-
|
720 |
-
#: includes/integrations/views/integrations.php:30
|
721 |
-
msgid "Enabled"
|
722 |
-
msgstr "Povoleno"
|
723 |
-
|
724 |
-
#: includes/integrations/views/integrations.php:31
|
725 |
-
msgid "Name"
|
726 |
-
msgstr "Jméno"
|
727 |
-
|
728 |
-
#: includes/integrations/views/integrations.php:32
|
729 |
-
msgid "Description"
|
730 |
-
msgstr "Popis"
|
731 |
-
|
732 |
-
#: includes/integrations/views/integrations.php:50
|
733 |
-
msgid ""
|
734 |
-
"This integration is enabled by default as it requires manual actions to "
|
735 |
-
"work."
|
736 |
-
msgstr "Toto spojení je ve výchozím nastavení povoleno jako vyžadující další uživatelský zásah."
|
737 |
-
|
738 |
-
#: includes/integrations/views/integrations.php:57
|
739 |
-
msgid "Configure this integration"
|
740 |
|