Version Description
- fixed next url to support external urls.
Download this release
Release Info
Developer | webheadllc |
Plugin | Contact Form 7 Multi-Step Forms |
Version | 4.1.7 |
Comparing to | |
See all releases |
Code changes from version 4.1.6 to 4.1.7
- contact-form-7-multi-step-module.php +3 -3
- js_src/cf7msm.js +5 -1
- readme.txt +4 -1
- resources/cf7msm.min.js +1 -1
contact-form-7-multi-step-module.php
CHANGED
@@ -6,10 +6,10 @@ Plugin URI: http://www.mymonkeydo.com/contact-form-7-multi-step-module/
|
|
6 |
Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
|
7 |
Author: Webhead LLC.
|
8 |
Author URI: http://webheadcoder.com
|
9 |
-
Version: 4.1.
|
10 |
Text Domain: contact-form-7-multi-step-module
|
11 |
*/
|
12 |
-
/* Copyright
|
13 |
|
14 |
This program is free software; you can redistribute it and/or
|
15 |
modify it under the terms of the GNU General Public License
|
@@ -68,7 +68,7 @@ if ( function_exists( 'cf7msm_fs' ) ) {
|
|
68 |
cf7msm_fs();
|
69 |
// Signal that SDK was initiated.
|
70 |
do_action( 'cf7msm_fs_loaded' );
|
71 |
-
define( 'CF7MSM_VERSION', '4.1.
|
72 |
define( 'CF7MSM_PLUGIN', __FILE__ );
|
73 |
define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
|
74 |
define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
|
6 |
Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
|
7 |
Author: Webhead LLC.
|
8 |
Author URI: http://webheadcoder.com
|
9 |
+
Version: 4.1.7
|
10 |
Text Domain: contact-form-7-multi-step-module
|
11 |
*/
|
12 |
+
/* Copyright 2021 Webhead LLC (email: info at webheadcoder.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or
|
15 |
modify it under the terms of the GNU General Public License
|
68 |
cf7msm_fs();
|
69 |
// Signal that SDK was initiated.
|
70 |
do_action( 'cf7msm_fs_loaded' );
|
71 |
+
define( 'CF7MSM_VERSION', '4.1.7' );
|
72 |
define( 'CF7MSM_PLUGIN', __FILE__ );
|
73 |
define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
|
74 |
define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
|
js_src/cf7msm.js
CHANGED
@@ -319,12 +319,16 @@ var cf7msm_ss;
|
|
319 |
}
|
320 |
|
321 |
if (nextUrl && nextUrl != '') {
|
|
|
|
|
|
|
|
|
322 |
var steps_prev_urls = {};
|
323 |
if ( cf7msm_ss && cf7msm_ss.cf7msm_prev_urls ) {
|
324 |
steps_prev_urls = cf7msm_ss.cf7msm_prev_urls;
|
325 |
}
|
326 |
var startOfUrl = window.location.protocol + "//" + window.location.host;
|
327 |
-
if ( nextUrl.indexOf( startOfUrl ) !== 0 ) {
|
328 |
if (nextUrl.indexOf('/') !== 0 ) {
|
329 |
startOfUrl += '/';
|
330 |
}
|
319 |
}
|
320 |
|
321 |
if (nextUrl && nextUrl != '') {
|
322 |
+
var parser = document.createElement('a');
|
323 |
+
parser.href = nextUrl;
|
324 |
+
var nextUrlHostName = parser.hostname ? parser.hostname : '';
|
325 |
+
|
326 |
var steps_prev_urls = {};
|
327 |
if ( cf7msm_ss && cf7msm_ss.cf7msm_prev_urls ) {
|
328 |
steps_prev_urls = cf7msm_ss.cf7msm_prev_urls;
|
329 |
}
|
330 |
var startOfUrl = window.location.protocol + "//" + window.location.host;
|
331 |
+
if ( nextUrl.indexOf( startOfUrl ) !== 0 && (nextUrlHostName == '' || nextUrlHostName == window.location.host)) {
|
332 |
if (nextUrl.indexOf('/') !== 0 ) {
|
333 |
startOfUrl += '/';
|
334 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate Link: https://webheadcoder.com/donate-cf7-multi-step-forms
|
|
4 |
Tags: contact form 7, multistep form, form, multiple pages, contact, multi, step
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 4.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -135,6 +135,9 @@ When checkboxes are not checked they aren't submitted through the form so the la
|
|
135 |
|
136 |
== Changelog ==
|
137 |
|
|
|
|
|
|
|
138 |
= 4.1.6 =
|
139 |
* fixed conditional fields not trigerring after form population.
|
140 |
* fixed 500 error due to conflict with Conditional Fields plugin expecting an array in cookie values.
|
4 |
Tags: contact form 7, multistep form, form, multiple pages, contact, multi, step
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 4.1.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
135 |
|
136 |
== Changelog ==
|
137 |
|
138 |
+
= 4.1.7 =
|
139 |
+
* fixed next url to support external urls.
|
140 |
+
|
141 |
= 4.1.6 =
|
142 |
* fixed conditional fields not trigerring after form population.
|
143 |
* fixed 500 error due to conflict with Conditional Fields plugin expecting an array in cookie values.
|
resources/cf7msm.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var
|
1 |
+
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}({6:function(e,t,n){e.exports=n(7)},7:function(e,t,n){"use strict";n.r(t);var r,o;n(8);function i(){try{return sessionStorage.setItem("test","test"),sessionStorage.removeItem("test"),!0}catch(e){return!1}}o=jQuery,document.addEventListener("DOMContentLoaded",e=>{var t=cf7msm_posted_data,n=o("input[name='_cf7msm_multistep_tag']"),s=n.length>0;if(s||(s=(n=o("input[name='cf7msm-step']")).length>0),s){var a=n.closest("form"),f=a.find('input[name="_wpcf7"]').val();i()?null!=(r=sessionStorage.getObject("cf7msm"))&&o.each(r,(function(e,t){if("cf7msm_prev_urls"==e){var n=a.find(".wpcf7-back, .wpcf7-previous"),r=window.location.href,o=r.replace(/\/$/,""),i=!t.hasOwnProperty(r)||""==t[r];i&&(i=!t.hasOwnProperty(o)||""==t[o]),i&&(r=r.split("?")[0],o=r.replace(/\/$/,""),(i=!t.hasOwnProperty(r)||""==t[r])&&(i=!t.hasOwnProperty(o)||""==t[o])),i?n.hide():n.click((function(e){t.hasOwnProperty(r)&&""!=t[r]?window.location.href=t[r]:t.hasOwnProperty(o)&&""!=t[o]?window.location.href=t[o]:window.history.go(-1),e.preventDefault()}))}})):(o("input[name='cf7msm-no-ss']").val(1),o(".wpcf7-previous").hide());var c=wpcf7.submit;wpcf7.submit=function(e,t){!function(e){!function(e){var t=e;t instanceof jQuery||(t=o(e));var n=t.find("input[name='_cf7msm_multistep_tag']");0!=n.length&&(n.length>1&&(n=n.last()),o("<input />",{type:"hidden",name:"cf7msm_options",value:n.val()}).appendTo(t))}(e)}(e),c(e,t)},window.addEventListener("load",(function(){t&&(o.each(t,(function(e,t){if(e.indexOf("[]")===e.length-2&&(e=e.substring(0,e.length-2)),(0!=e.indexOf("_")||0==e.indexOf("_wpcf7_radio_free_text_")||0==e.indexOf("_wpcf7_checkbox_free_text_"))&&"cf7msm-step"!=e&&"cf7msm_options"!=e){var n=a.find('*[name="'+e+'"]:not([data-cf7msm-previous])'),r=a.find('input[name="'+e+'[]"]:not([data-cf7msm-previous])'),i=a.find('select[name="'+e+'[]"]:not([data-cf7msm-previous])');n.length>0?"radio"==n.prop("type")||"checkbox"==n.prop("type")?n.filter((function(){return o(this).val()==t})).prop("checked",!0):n.is("select")?n.find("option").filter((function(){return this.value==t})).attr("selected","selected"):n.val(t):r.length>0&&t.constructor===Array?""!=t&&t.length>0&&o.each(t,(function(e,t){r.filter((function(){return o(this).val()==t})).prop("checked",!0)})):i.length>0&&t.constructor===Array&&""!=t&&t.length>0&&o.each(t,(function(e,t){i.find("option").filter((function(){return this.value==t})).attr("selected","selected")}))}})),a.find('input[name="_wpcf7cf_options"]').trigger("change"))})),document.addEventListener("wpcf7mailsent",(function(e){if(i()){var t=0,n=0,s=[],a={};(r=sessionStorage.getObject("cf7msm"))||(r={});var c=!1,u=!1,p=!0,l=!1,d=null,m=!1;if(o.each(e.detail.inputs,(function(r){var i=e.detail.inputs[r].name,h=e.detail.inputs[r].value;if(i.indexOf("[]")===i.length-2?(-1===o.inArray(i,s)&&(a[i]=[]),a[i].push(h)):a[i]=h,"cf7msm-step"===i){if(-1!==h.indexOf("-")){c=!0,u=!1;var v=h.split("-");t=parseInt(v[0]),n=parseInt(v[1]),void 0!==cf7msm_redirect_urls[f]&&(d=cf7msm_redirect_urls[f]),t<n?p=!1:t===n&&(l=!0)}}else if("cf7msm_options"===i){c=!0,u=!0,p=!1;var w=JSON.parse(h);w.hasOwnProperty("next_url")&&(d=w.next_url),w.hasOwnProperty("last_step")&&(m=!0,d&&""!==d||(l=!0,p=!0))}else s.push(i)})),!c)return;if(!p){var h=o("#"+e.detail.unitTag).find("div.wpcf7-mail-sent-ok");0==h.length&&(h=o("#"+e.detail.unitTag).find(".wpcf7-response-output")),h.remove()}if(l){var v=o("#"+e.detail.unitTag+" form");v.find("*").not("div.wpcf7-response-output").hide(),v.find("div.wpcf7-response-output").parentsUntil("form").show()}if(u?m&&(r={}):0!=t&&t===n&&(r={}),d&&""!=d){var w=document.createElement("a");w.href=d;var _=w.hostname?w.hostname:"",g={};r&&r.cf7msm_prev_urls&&(g=r.cf7msm_prev_urls);var y=window.location.protocol+"//"+window.location.host;0===d.indexOf(y)||""!=_&&_!=window.location.host||(0!==d.indexOf("/")&&(y+="/"),d=y+d),g[d]=window.location.href;var O=d.split("?")[0];d!=O&&(g[O]=window.location.href),r.cf7msm_prev_urls=g}sessionStorage.setObject("cf7msm",r),d&&""!=d&&(window.location.href=d)}}),!1)}}),Storage.prototype.setObject=function(e,t){this.setItem(e,JSON.stringify(t))},Storage.prototype.getObject=function(e){var t=this.getItem(e);return t&&JSON.parse(t)}},8:function(e,t,n){}}));
|