Version Description
- New feature: Checksum-based verification system against repeated spam submissions.
- New feature: Added "Headings" for Radio, Checkbox, and Dropdown field choices.
- Improvement: Happyforms block now displays a notice when a form published on page was trashed.
- Improvement: Re-arranged the position of "Require an Answer" control for better consistency.
- Improvement: Renamed "Limit submissions" control to "Max number of submissions" in all choice-type fields.
- Improvement: Improved usability of "Min number" and "Max number" controls in Number field.
- Improvement: In all choice-type fields, remaining submissions are now shown by default.
- Bugfix: Validation error on optional field with min/max requirements.
Download this release
Release Info
Developer | happyforms |
Plugin | Form builder to get in touch with visitors, grow your email list and collect payments — Happyforms |
Version | 1.15.1 |
Comparing to | |
See all releases |
Code changes from version 1.15.0 to 1.15.1
- bundles/js/frontend.js +1 -1
- core/assets/css/admin.css +8 -0
- core/assets/css/color.css +9 -0
- core/assets/css/customize.css +9 -0
- core/assets/css/layout.css +6 -1
- core/assets/js/lib/md5.min.js +2 -0
- core/assets/js/parts/part-checkbox.js +89 -69
- core/assets/js/parts/part-radio.js +90 -65
- core/assets/js/parts/part-select.js +90 -68
- core/assets/jsx/build/admin/block.asset.php +1 -1
- core/assets/jsx/build/admin/block.js +17 -10
- core/assets/jsx/build/admin/block.js.map +1 -1
- core/assets/jsx/src/admin/block.js +13 -6
- core/classes/class-form-assets.php +19 -0
- core/classes/class-form-controller.php +11 -3
- core/classes/class-form-option-limiter.php +52 -28
- core/classes/class-form-shuffle.php +22 -5
- core/classes/parts/class-part-checkbox.php +4 -3
- core/classes/parts/class-part-number.php +26 -10
- core/classes/parts/class-part-radio.php +3 -2
- core/classes/parts/class-part-select.php +4 -3
- core/helpers/helper-form-templates.php +1 -1
- core/helpers/helper-misc.php +10 -0
- core/helpers/helper-validation.php +16 -0
- core/templates/partials/happyforms-select.php +1 -1
- core/templates/parts/customize-checkbox.php +26 -19
- core/templates/parts/customize-email.php +5 -6
- core/templates/parts/customize-multi-line-text.php +6 -7
- core/templates/parts/customize-number.php +13 -15
- core/templates/parts/customize-radio.php +25 -18
- core/templates/parts/customize-select.php +25 -19
- core/templates/parts/customize-single-line-text.php +5 -6
- core/templates/parts/frontend-checkbox.php +14 -3
- core/templates/parts/frontend-radio.php +14 -3
- core/templates/parts/frontend-select.php +15 -2
- happyforms.php +2 -2
- inc/assets/css/admin.css +0 -4
- inc/assets/js/customize.js +1 -1
- inc/assets/js/frontend.js +13 -7
- inc/classes/class-answer-limiter-dummy.php +3 -4
- inc/classes/class-message-admin.php +0 -2
- inc/classes/class-message-controller.php +51 -19
- languages/happyforms.pot +135 -125
- readme.txt +15 -2
bundles/js/frontend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():e.Cleave=t()}(this,function(){return e=[function(e,t,r){!function(t){"use strict";function i(e,t){var r=this,n=!1;if("string"==typeof e?(r.element=document.querySelector(e),n=1<document.querySelectorAll(e).length):void 0!==e.length&&0<e.length?(r.element=e[0],n=1<e.length):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(a){}t.initValue=r.element.value,r.properties=i.DefaultProperties.assign({},t),r.init()}i.prototype={init:function(){var e=this,t=e.properties;return t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=i.Util.getMaxLength(t.blocks),e.isAndroid=i.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue))):void e.onInput(t.initValue)},initSwapHiddenInput:function(){var r,e=this;e.properties.swapHiddenInput&&(r=e.element.cloneNode(!0),e.element.parentNode.insertBefore(r,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=r,e.element.id="")},initNumeralFormatter:function(){var t=this.properties;t.numeral&&(t.numeralFormatter=new i.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.prefix,t.signBeforePrefix,t.tailPrefix,t.delimiter))},initTimeFormatter:function(){var t=this.properties;t.time&&(t.timeFormatter=new i.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new i.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new i.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(r){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,e=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=8===e},onChange:function(e){var t=this,r=t.properties,n=i.Util,e=(t.isBackward=t.isBackward||"deleteContentBackward"===e.inputType,n.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters));t.isBackward&&e?r.postDelimiterBackspace=e:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),i.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){i.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){i.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var r=this.properties,n=i.Util,a=this.element.value,n=r.copyDelimiter?a:n.stripDelimiters(a,r.delimiter,r.delimiters);try{(e.clipboardData?e:window).clipboardData.setData("Text",n),e.preventDefault()}catch(l){}},onInput:function(e){var t=this,r=t.properties,n=i.Util,a=n.getPostDelimiter(e,r.delimiter,r.delimiters);r.numeral||!r.postDelimiterBackspace||a||(e=n.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length):r.numeral?r.prefix&&r.noImmediatePrefix&&0===e.length?r.result="":r.result=r.numeralFormatter.format(e):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=n.stripDelimiters(e,r.delimiter,r.delimiters),e=n.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?n.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,0===r.blocksLength)?r.result=e:(r.creditCard&&t.updateCreditCardPropsByValue(e),e=n.headStr(e,r.maxLength),r.result=n.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow))),t.updateValueState()},updateCreditCardPropsByValue:function(e){var n=this.properties,a=i.Util;a.headStr(n.result,4)!==a.headStr(e,4)&&(e=i.CreditCardDetector.getInfo(e,n.creditCardStrictMode),n.blocks=e.blocks,n.blocksLength=n.blocks.length,n.maxLength=a.getMaxLength(n.blocks),n.creditCardType!==e.type&&(n.creditCardType=e.type,n.onCreditCardTypeChanged.call(this,n.creditCardType)))},updateValueState:function(){var n,a,o,e=this,t=i.Util,r=e.properties;e.element&&(n=e.element.selectionEnd,a=e.element.value,o=r.result,n=t.getNextCursorPosition(n,a,o,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()},1):(e.element.value=o,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()))},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=null!=e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var t=this.properties,r=i.Util,n=this.element.value;return t.rawValueTrimPrefix&&(n=r.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix)),t.numeral?t.numeralFormatter.getRawValue(n):r.stripDelimiters(n,t.delimiter,t.delimiters)},getISOFormatDate:function(){var t=this.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var t=this.properties;return t.time?t.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},i.NumeralFormatter=r(1),i.DateFormatter=r(2),i.TimeFormatter=r(3),i.PhoneFormatter=r(4),i.CreditCardDetector=r(5),i.Util=r(6),i.DefaultProperties=r(7),("object"==typeof t&&t?t:window).Cleave=i,e.exports=i}.call(t,function(){return this}())},function(e,t){"use strict";function r(e,t,i,n,a,o,l,s,c,u){var d=this;d.numeralDecimalMark=e||".",d.numeralIntegerScale=0<t?t:0,d.numeralDecimalScale=0<=i?i:2,d.numeralThousandsGroupStyle=n||r.groupStyle.thousand,d.numeralPositiveOnly=!!a,d.stripLeadingZeroes=!1!==o,d.prefix=l||""===l?l:"",d.signBeforePrefix=!!s,d.tailPrefix=!!c,d.delimiter=u||""===u?u:",",d.delimiterRE=u?new RegExp("\\"+u,"g"):""}r.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},r.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var i,n,a,o=this,l="";switch(e=e.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),i="-"===(e=o.stripLeadingZeroes?e.replace(/^(-)?0+(?=\d)/,"$1"):e).slice(0,1)?"-":"",n=void 0!==o.prefix?o.signBeforePrefix?i+o.prefix:o.prefix+i:i,0<=(a=e).indexOf(o.numeralDecimalMark)&&(a=(e=e.split(o.numeralDecimalMark))[0],l=o.numeralDecimalMark+e[1].slice(0,o.numeralDecimalScale)),"-"==i&&(a=a.slice(1)),0<o.numeralIntegerScale&&(a=a.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case r.groupStyle.lakh:a=a.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case r.groupStyle.wan:a=a.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case r.groupStyle.thousand:a=a.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?i+a.toString()+(0<o.numeralDecimalScale?l.toString():"")+o.prefix:n+a.toString()+(0<o.numeralDecimalScale?l.toString():"")}},e.exports=r},function(e,t){"use strict";function r(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMin.length&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMax.length&&i.dateMax.unshift(0),i.initBlocks()}r.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(0<e.length){var a=e.slice(0,i),o=a.slice(0,1),i=e.slice(i);switch(t.datePattern[n]){case"d":"00"===a?a="01":3<parseInt(o,10)?a="0"+o:31<parseInt(a,10)&&(a="31");break;case"m":"00"===a?a="01":1<parseInt(o,10)?a="0"+o:12<parseInt(a,10)&&(a="12")}r+=a,e=i}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0,p=!1;return 4===e.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(d=2-(u="d"===a[0]?0:2),t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,r,0)),8===e.length&&(a.forEach(function(e,t){switch(e){case"d":l=t;break;case"m":s=t;break;default:c=t}}),m=2*c,u=l<=c?2*l:2*l+2,d=s<=c?2*s:2*s+2,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=this.getFixedDate(t,r,i)),4!==e.length||"y"!==a[0]&&"y"!==a[1]||(m=2-(d="m"===a[0]?0:2),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),p=2===e.slice(m,m+2).length,o=[0,r,i]),6!==e.length||"Y"!==a[0]&&"Y"!==a[1]||(m=2-.5*(d="m"===a[0]?0:4),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=[0,r,i]),o=n.getRangeFixedDate(o),0===(n.date=o).length?e:a.reduce(function(e,t){switch(t){case"d":return e+(0===o[0]?"":n.addLeadingZero(o[0]));case"m":return e+(0===o[1]?"":n.addLeadingZero(o[1]));case"y":return e+(p?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return e+(p?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],t=t.dateMax||[];return!e.length||i.length<3&&t.length<3||r.find(function(e){return"y"===e.toLowerCase()})&&0===e[2]?e:t.length&&(t[2]<e[2]||t[2]===e[2]&&(t[1]<e[1]||t[1]===e[1]&&t[0]<e[0]))?t:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),[e=t<7&&t%2==0||8<t&&t%2==1?Math.min(e,2===t?this.isLeapYear(r)?29:28:30):e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";function r(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()}r.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="",i=(e=e.replace(/[^\d]/g,""),t.getTimeFormatOptions());return t.blocks.forEach(function(n,a){if(0<e.length){var o=e.slice(0,n),l=o.slice(0,1),n=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(l,10)>i.maxHourFirstDigit?o="0"+l:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(l,10)>i.maxMinutesFirstDigit?o="0"+l:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=n}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var r,i,u,n=this,a=n.timePattern,o=[],l=0,s=0,c=0,d=0,m=0;return 6===e.length&&(a.forEach(function(e,t){switch(e){case"s":l=2*t;break;case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=l,u=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,u)),4===e.length&&n.timePattern.indexOf("s")<0&&(a.forEach(function(e,t){switch(e){case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=0,r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,u)),0===(n.time=o).length?e:a.reduce(function(e,t){switch(t){case"s":return e+n.addLeadingZero(o[2]);case"m":return e+n.addLeadingZero(o[1]);case"h":return e+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";function r(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e}r.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}},e.exports=r},function(e,t){"use strict";var r={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var a,o,i=r.blocks,n=r.re;for(a in t=!!t,n)if(n[a].test(e))return o=i[a],{type:a,blocks:t?this.getStrictBlocks(o):o};return{type:"unknown",blocks:t?this.getStrictBlocks(i.general):i.general}}};e.exports=r},function(e,t){"use strict";e.exports={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(0===r.length)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(t){e.slice(-t.length)===t&&(i=t)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){t=this.stripDelimiters(t.slice(0,e),i,n),r=this.stripDelimiters(r.slice(0,e),i,n),e=t.length-r.length;return 0!=e?e/Math.abs(e):0},stripDelimiters:function(e,t,r){var i=this;return 0===r.length?(t=t?i.getDelimiterREByDelimiter(t):"",e.replace(t,"")):(r.forEach(function(t){t.split("").forEach(function(t){e=e.replace(i.getDelimiterREByDelimiter(t),"")})}),e)},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,l,s){if(0===r)return e;if(e===t&&""!==e)return"";if(s&&"-"==e.slice(0,1))return c="-"==i.slice(0,1)?i.slice(1):i,"-"+this.getPrefixStrippedValue(e.slice(1),t,r,c,n,a,o,l,s);if(i.slice(0,r)!==t&&!l)return o&&!i&&e?e:"";if(i.slice(-r)!==t&&l)return o&&!i&&e?e:"";var c=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||l?e.slice(-r)!==t&&l?c.slice(0,-r-1):l?e.slice(0,-r):e.slice(r):c.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",l=0<n.length,s="";return 0===r?e:(t.forEach(function(t,c){var u,d;0<e.length&&(u=e.slice(0,t),d=e.slice(t),s=l?n[a?c-1:c]||s:i,a?(0<c&&(o+=s),o+=u):(o+=u,u.length===t&&c<r-1&&(o+=s)),e=d)}),o)},fixPrefixCursor:function(e,t,r,i){var n,o;e&&(n=e.value,r=r||i[0]||" ",!e.setSelectionRange||!t||t.length+r.length<=n.length||(o=2*n.length,setTimeout(function(){e.setSelectionRange(o,o)},1)))},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch(r){}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){r=e.createTextRange();r.move("character",t),r.select()}else try{e.setSelectionRange(t,t)}catch(n){console.warn("The input element type does not support selection")}},getActiveElement:function(e){e=e.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}}},function(e,t){!function(t){"use strict";e.exports={assign:function(e,r){return(e=e||{}).creditCard=!!(r=r||{}).creditCard,e.creditCardStrictMode=!!r.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=r.onCreditCardTypeChanged||function(){},e.phone=!!r.phone,e.phoneRegionCode=r.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!r.time,e.timePattern=r.timePattern||["h","m","s"],e.timeFormat=r.timeFormat||"24",e.timeFormatter={},e.date=!!r.date,e.datePattern=r.datePattern||["d","m","Y"],e.dateMin=r.dateMin||"",e.dateMax=r.dateMax||"",e.dateFormatter={},e.numeral=!!r.numeral,e.numeralIntegerScale=0<r.numeralIntegerScale?r.numeralIntegerScale:0,e.numeralDecimalScale=0<=r.numeralDecimalScale?r.numeralDecimalScale:2,e.numeralDecimalMark=r.numeralDecimalMark||".",e.numeralThousandsGroupStyle=r.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!r.numeralPositiveOnly,e.stripLeadingZeroes=!1!==r.stripLeadingZeroes,e.signBeforePrefix=!!r.signBeforePrefix,e.tailPrefix=!!r.tailPrefix,e.swapHiddenInput=!!r.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!r.numericOnly,e.uppercase=!!r.uppercase,e.lowercase=!!r.lowercase,e.prefix=!e.creditCard&&!e.date&&r.prefix||"",e.noImmediatePrefix=!!r.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!r.rawValueTrimPrefix,e.copyDelimiter=!!r.copyDelimiter,e.initValue=void 0!==r.initValue&&null!==r.initValue?r.initValue.toString():"",e.delimiter=r.delimiter||""===r.delimiter?r.delimiter:r.date?"/":r.time?":":r.numeral?",":(r.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!r.delimiterLazyShow,e.delimiters=r.delimiters||[],e.blocks=r.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof t&&t?t:window,e.document=r.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=r.onValueChanged||function(){},e}}}.call(t,function(){return this}())}],r={},t.m=e,t.c=r,t.p="",t(0);function t(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e,r}),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.multi_line_text={init:function(options){this.$form=options.form,this.type=this.$el.data("happyforms-type"),this.$input=$("textarea",this.$el),this.$counter=$(".happyforms-part__char-counter span.counter",this.$el),this.$input.on("blur",this.onBlur.bind(this)),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$el.on("keyup",this.refreshCounter.bind(this)),this.refreshCounter(),$(".happyforms-part__char-counter").show()},getValueLength:function(){var mode=this.$input.attr("data-length-mode"),value=this.$input.val(),length=value.length;return length="word"===mode?(mode=value.match(/\w+/g))?mode.length:0:length},refreshCounter:function(){var length;parseInt(this.$input.attr("data-length"),10)<1||(length=this.getValueLength(),this.$counter.text(length))},onFocus:function(){this.$el.addClass("focus")},onBlur:function(){this.$el.removeClass("focus")},isFilled:function(){return""!==this.$input.val()},serialize:function(){return HappyForms.parts.base.serialize.apply(this,arguments)}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.email={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$visualInput=$("input[type=email]",this.$el),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.$visualInput.on("blur",this.onBlur.bind(this))}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.radio={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$visualInput=$("input[type=email]",this.$el),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("change",this.onRadioChange.bind(this)),this.$input.on("focus",this.onFocus.bind(this))},onRadioChange:function(e){var $otherRadio=$(".happyforms-part-option--other input[type=radio]",this.$el),$otherInput=$otherRadio.parent().nextAll("input"),$generalInput=$("input[type=text]",this.$el);$generalInput.prop("required",!1),$otherRadio.length&&$otherRadio.is(":checked")?($(e.target)[0]===$otherRadio[0]&&$otherInput.addClass("hf-show").trigger("focus"),""===this.$el.data("happyforms-required")&&$otherInput.prop("required",!0)):$generalInput.removeClass("hf-show")},onFocus:function(e){e=$(e.target);"text"===e.attr("type")&&e.prevAll("input[type=radio]").prop("checked",!0)},serialize:function(){var self=this;return this.$input.map(function(i,input){var input=$(input),$customInput=0;if("text"!==input.attr("type")){"text"===$(self.$input[i+1]).attr("type")&&($customInput=$(self.$input[i+1]));i={name:input.attr("name"),value:input.val()};if($customInput.length&&($customInput=$customInput.val(),i.value=[input.val(),$customInput],i.value=JSON.stringify(i.value)),input.is(":checked"))return i}}).toArray()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.checkbox={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("change",this.onCheckboxChange.bind(this)),this.$input.on("focus",this.onFocus.bind(this))},onCheckboxChange:function(e){var $otherCheckbox=$(".happyforms-part-option--other input[type=checkbox]",this.$el),$otherInput=$otherCheckbox.parent().nextAll("input"),$generalInput=$("input[type=text]",this.$el);$generalInput.prop("required",!1),$otherCheckbox.length&&$otherCheckbox.is(":checked")?($(e.target)[0]===$otherCheckbox[0]&&$otherInput.addClass("hf-show").trigger("focus"),""===this.$el.data("happyforms-required")&&$otherInput.prop("required",!0)):$generalInput.removeClass("hf-show")},serialize:function(){var self=this;return this.$input.map(function(i,input){var input=$(input),$customInput=0;if("text"!==input.attr("type")){"text"===$(self.$input[i+1]).attr("type")&&($customInput=$(self.$input[i+1]));i={name:input.attr("name"),value:input.val()};if($customInput.length&&($customInput=$customInput.val(),i.value=[input.val(),$customInput],i.value=JSON.stringify(i.value)),input.is(":checked"))return i}}).toArray()},onFocus:function(e){e=$(e.target);"text"===e.attr("type")&&e.prevAll("input[type=checkbox]").prop("checked",!0)}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.select={init:function(options){this.type=this.$el.data("happyforms-type"),this.$input=$("[data-serialize]",this.$el),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("blur",this.onBlur.bind(this))},onBlur:function(){var $otherinput=$(".happyforms-part-option--other input[type=text]",this.$el);"999"===this.$input.val()?($otherinput.addClass("hf-show"),$otherinput.focus()):$otherinput.removeClass("hf-show")},serialize:function(){var self=this;return this.$input.map(function(i,select){var select=$(select,self.$el),$customInput=0,value=(999==select.val()&&($customInput=$(" .happyforms-part-option--other input[type=text]",self.$el)),select.val()),value=(null==value&&(value=""),{name:select.attr("name"),value:value});return $customInput.length&&($customInput=$customInput.val(),value.value=[select.val(),$customInput],value.value=JSON.stringify(value.value)),value}).toArray()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.number={init:function(){this.type=this.$el.data("happyforms-type"),this.allowedKeys=["0","1","2","3","4","5","6","7","8","9","Meta","Delete","ArrowLeft","ArrowRight"];var self,decimalMark,delimiterMark,masked=this.$el.attr("data-mask");this.$input=$("input",this.$el),this.cleaveInstances=[],this.$input.on("keyup",this.onKeyUp.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.$input.on("blur",this.onBlur.bind(this)),this.numeralDecimalMark=this.$el.attr("data-decimal-mark")||"",this.delimiter=this.$el.attr("data-thousands-delimiter")||"",masked&&(decimalMark=(self=this).numeralDecimalMark,delimiterMark=this.delimiter,this.$input.each(function(){var $input=$(this),$input=new Cleave($input,{numeral:!0,numeralDecimalMark:decimalMark,delimiter:delimiterMark});self.cleaveInstances.push($input)})),this.onBlur()},onKeyUp:function(e){var value=$(e.target).val(),regex=new RegExp("[^0-9"+this.numeralDecimalMark+this.delimiter+"-]","g"),value=value.replace(regex,"");$(e.target).val(value),this.triggerChange()},reinit:function(){$.each(this.cleaveInstances,function(i,instance){var input=instance.element,rawValue=instance.getRawValue();instance.destroy(),input.value=rawValue}),this.init()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.base={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input, textarea, select",this.$el),this.$input.on("keyup change",this.triggerChange.bind(this)),this.$input.on("blur",this.onBlur.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.onBlur()},getType:function(){return this.type},onInputFocus:function(){this.$el.addClass("focus")},onBlur:function(){this.$el.is(".happyforms-part--label-as_placeholder")&&(this.isFilled()?this.$el.addClass("happyforms-part--filled"):this.$el.removeClass("happyforms-part--filled")),this.$el.removeClass("focus")},triggerChange:function(data){this.$el.trigger("happyforms-change",data)},isRequired:function(){return this.$el.is(":visible")&&this.$el.is("[data-happyforms-required]")},isFilled:function(){return 0<this.$input.filter(function(){var $input=$(this);return $input.is("[type=checkbox]")||$input.is("[type=radio]")?$input.is(":checked"):""!==$input.val()}).length},confirmationMatches:function(){var matches=!1,$input=this.$input,$input=($input=this.$visualInput?this.$visualInput:$input).map(function(){return $(this).val()}).toArray();return matches=2===$input.length?$input[0]===$input[1]:matches},requiresConfirmation:function(){return this.$el.is("[data-happyforms-require-confirmation]")},serialize:function(){return this.$input.map(function(i,input){var input=$(input),keyValue={name:input.attr("name"),value:input.val()};if(!input.is("[type=checkbox]")&&!input.is("[type=radio]")||input.is(":checked"))return keyValue}).toArray()},isValid:function(){var valid=!0;this.$el.data("happyforms-type");return this.$input?(this.isRequired()&&(valid=valid&&this.isFilled()),this.isRequired()&&this.requiresConfirmation()?valid&&this.confirmationMatches():valid):valid},destroy:function(){this.$el.data("HappyFormPart",!1)}},HappyForms.wrapPart=function($part,$form){var type=$part.data("happyforms-type"),partMethods=HappyForms.parts.base;HappyForms.parts[type]&&(partMethods=$.extend({},HappyForms.parts.base,HappyForms.parts[type])),$part.happyFormPart(partMethods,{form:$form})},HappyForms.Form=function(el){this.el=el,this.$el=$(this.el),this.$form=$("form",this.$el),this.$parts=$("[data-happyforms-type]",this.$form),this.$submits=$('[type="submit"], a.submit',this.$form),this.$submit=$('[type="submit"]',this.$form),this.$submitLinks=$("a.submit",this.$form),this.$step=$('[name="happyforms_step"]',this.$form),this.init()},HappyForms.Form.prototype={init:function(){var $form=this.$form;$("[data-happyforms-type]",this.$form).each(function(){var $part=$(this);$part.data("happyforms-type");HappyForms.wrapPart($part,$form)}),this.$el.trigger("happyforms-change"),this.$el.trigger("happyforms-init"),this.$form.off("submit"),this.$submit.off("click"),this.$submitLinks.off("click"),this.$form.on("submit",this.submit.bind(this)),this.$submit.on("click",this.buttonSubmit.bind(this)),this.$submitLinks.on("click",this.linkSubmit.bind(this)),this.$el.on("happyforms-scrolltop",this.onScrollTop.bind(this))},detach:function(){this.$el.off("happyforms-change"),this.$el.off("happyforms-scrolltop"),$("[data-happyforms-type]",this.$form).remove()},serialize:function(submitEl){for(var action=$("[name=action]",this.$form).val(),form_id=$("[name=happyforms_form_id]",this.$form).val(),referer=$("[name=_wp_http_referer]",this.$form).val(),formData=[{name:"action",value:action},{name:"happyforms_form_id",value:form_id},{name:"happyforms_step",value:this.$step.val()},{name:"referer",value:referer}],honeypotNames=["single_line_text","multi_line_text","number"],h=0;h<honeypotNames.length;h++){var inputName=form_id+"-"+honeypotNames[h],$input=$("[name="+inputName+"]");if($input.length){formData.push({name:inputName,value:$input.val()});break}}action=$("[data-happyforms-type]",this.$form).map(function(i,part){return $(part).happyFormPart("serialize")}).toArray().filter(function(entry){return null!==entry.name&&void 0!==entry.name});return formData.concat(action).map(function(part){return part.name+"="+encodeURIComponent(part.value)}).join("&")},buttonSubmit:function(e){e.target.hasAttribute("data-step")&&this.$step.val(e.target.getAttribute("data-step"))},linkSubmit:function(e){e.preventDefault(),e.stopImmediatePropagation(),e.target.hasAttribute("data-step")&&this.$step.val(e.target.getAttribute("data-step")),this.$form.trigger("submit")},submit:function(e){e.preventDefault(),this.$form.addClass("happyforms-form--submitting"),this.$submits.attr("disabled","disabled"),$.ajax({type:"post",data:this.serialize(e.target)}).done(this.onSubmitComplete.bind(this))},onSubmitComplete:function(response){if(this.$form.trigger("happyforms.submitted",response),!response.data)return!1;var elTopOffset,$notices;response.data.html&&(response=$(response.data.html),$("[data-happyforms-type]",this.$form).each(function(){$(this).trigger("happyforms.detach")}),this.detach(),this.$el.replaceWith(response),this.$el=response,this.$el.happyForm(),(response=$("form",this.$el)).attr("data-happyforms-scroll-disabled")||(this.$el.get(0).getBoundingClientRect().top<0&&(elTopOffset=this.$el.offset().top,$notices=$(".happyforms-message-notices",this.$el),response.is(".happyforms-form--notices-below")&&$notices.length&&(elTopOffset=$notices.offset().top),($notices=response.attr("data-happyforms-scroll-offset"))&&(elTopOffset+=$notices=parseInt($notices,10)),this.$el.trigger("happyforms-scrolltop",elTopOffset)),!$(".happyforms-message-notice.error",response).length&&this.$el.hasClass("happyforms-form--hide-on-submit")&&$(".happyforms-part",response).hide()))},onScrollTop:function(e,offset){e.isDefaultPrevented()||$("html, body").animate({scrollTop:offset+"px"},500)}},HappyForms.Part=function(el){this.el=el,this.$el=$(this.el)},$.fn.happyFormPart=function(method){if("object"==typeof method){var part=new HappyForms.Part(this);$.extend(part,method),$(this).data("HappyFormPart",part),part.init.apply(part,Array.prototype.slice.call(arguments,1))}else{part=$(this).data("HappyFormPart");if(part&&part[method])return part[method].apply(part,Array.prototype.slice.call(arguments,1))}},$.fn.happyForm=function(method){this.each(function(){if(method){var instance=$.data(this,"HappyForm");if(instance&&instance[method])return instance[method].apply(instance,Array.prototype.slice.call(arguments,1))}else $.data(this,"HappyForm",new HappyForms.Form(this,arguments))})},$(function(){$(".happyforms-form").happyForm()})}(jQuery);
|
1 |
+
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((u=d(d(t,n),d(e,u)))<<o|u>>>32-o,r)}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function c(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=g(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=g(a,c,f,i,n[h+6],9,-1069501632),i=g(i,a,c,f,n[h+11],14,643717713),f=g(f,i,a,c,n[h],20,-373897302),c=g(c,f,i,a,n[h+5],5,-701558691),a=g(a,c,f,i,n[h+10],9,38016083),i=g(i,a,c,f,n[h+15],14,-660478335),f=g(f,i,a,c,n[h+4],20,-405537848),c=g(c,f,i,a,n[h+9],5,568446438),a=g(a,c,f,i,n[h+14],9,-1019803690),i=g(i,a,c,f,n[h+3],14,-187363961),f=g(f,i,a,c,n[h+8],20,1163531501),c=g(c,f,i,a,n[h+13],5,-1444681467),a=g(a,c,f,i,n[h+2],9,-51403784),i=g(i,a,c,f,n[h+7],14,1735328473),c=v(c,f=g(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=v(a,c,f,i,n[h+8],11,-2022574463),i=v(i,a,c,f,n[h+11],16,1839030562),f=v(f,i,a,c,n[h+14],23,-35309556),c=v(c,f,i,a,n[h+1],4,-1530992060),a=v(a,c,f,i,n[h+4],11,1272893353),i=v(i,a,c,f,n[h+7],16,-155497632),f=v(f,i,a,c,n[h+10],23,-1094730640),c=v(c,f,i,a,n[h+13],4,681279174),a=v(a,c,f,i,n[h],11,-358537222),i=v(i,a,c,f,n[h+3],16,-722521979),f=v(f,i,a,c,n[h+6],23,76029189),c=v(c,f,i,a,n[h+9],4,-640364487),a=v(a,c,f,i,n[h+12],11,-421815835),i=v(i,a,c,f,n[h+15],16,530742520),c=m(c,f=v(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function i(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function a(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return i(c(a(n=r(n)),8*n.length))}function u(n,t){return function(n,t){var r,e=a(n),o=[],u=[];for(o[15]=u[15]=void 0,16<e.length&&(e=c(e,8*n.length)),r=0;r<16;r+=1)o[r]=909522486^e[r],u[r]=1549556828^e[r];return t=c(o.concat(a(t)),512+8*t.length),i(c(u.concat(t),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():e.Cleave=t()}(this,function(){return e=[function(e,t,r){!function(t){"use strict";function i(e,t){var r=this,n=!1;if("string"==typeof e?(r.element=document.querySelector(e),n=1<document.querySelectorAll(e).length):void 0!==e.length&&0<e.length?(r.element=e[0],n=1<e.length):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(a){}t.initValue=r.element.value,r.properties=i.DefaultProperties.assign({},t),r.init()}i.prototype={init:function(){var e=this,t=e.properties;return t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=i.Util.getMaxLength(t.blocks),e.isAndroid=i.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue))):void e.onInput(t.initValue)},initSwapHiddenInput:function(){var r,e=this;e.properties.swapHiddenInput&&(r=e.element.cloneNode(!0),e.element.parentNode.insertBefore(r,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=r,e.element.id="")},initNumeralFormatter:function(){var t=this.properties;t.numeral&&(t.numeralFormatter=new i.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.prefix,t.signBeforePrefix,t.tailPrefix,t.delimiter))},initTimeFormatter:function(){var t=this.properties;t.time&&(t.timeFormatter=new i.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new i.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new i.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(r){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,e=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=8===e},onChange:function(e){var t=this,r=t.properties,n=i.Util,e=(t.isBackward=t.isBackward||"deleteContentBackward"===e.inputType,n.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters));t.isBackward&&e?r.postDelimiterBackspace=e:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),i.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){i.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){i.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var r=this.properties,n=i.Util,a=this.element.value,n=r.copyDelimiter?a:n.stripDelimiters(a,r.delimiter,r.delimiters);try{(e.clipboardData?e:window).clipboardData.setData("Text",n),e.preventDefault()}catch(l){}},onInput:function(e){var t=this,r=t.properties,n=i.Util,a=n.getPostDelimiter(e,r.delimiter,r.delimiters);r.numeral||!r.postDelimiterBackspace||a||(e=n.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length):r.numeral?r.prefix&&r.noImmediatePrefix&&0===e.length?r.result="":r.result=r.numeralFormatter.format(e):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=n.stripDelimiters(e,r.delimiter,r.delimiters),e=n.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?n.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,0===r.blocksLength)?r.result=e:(r.creditCard&&t.updateCreditCardPropsByValue(e),e=n.headStr(e,r.maxLength),r.result=n.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow))),t.updateValueState()},updateCreditCardPropsByValue:function(e){var n=this.properties,a=i.Util;a.headStr(n.result,4)!==a.headStr(e,4)&&(e=i.CreditCardDetector.getInfo(e,n.creditCardStrictMode),n.blocks=e.blocks,n.blocksLength=n.blocks.length,n.maxLength=a.getMaxLength(n.blocks),n.creditCardType!==e.type&&(n.creditCardType=e.type,n.onCreditCardTypeChanged.call(this,n.creditCardType)))},updateValueState:function(){var n,a,o,e=this,t=i.Util,r=e.properties;e.element&&(n=e.element.selectionEnd,a=e.element.value,o=r.result,n=t.getNextCursorPosition(n,a,o,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()},1):(e.element.value=o,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()))},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=null!=e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var t=this.properties,r=i.Util,n=this.element.value;return t.rawValueTrimPrefix&&(n=r.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix)),t.numeral?t.numeralFormatter.getRawValue(n):r.stripDelimiters(n,t.delimiter,t.delimiters)},getISOFormatDate:function(){var t=this.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var t=this.properties;return t.time?t.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},i.NumeralFormatter=r(1),i.DateFormatter=r(2),i.TimeFormatter=r(3),i.PhoneFormatter=r(4),i.CreditCardDetector=r(5),i.Util=r(6),i.DefaultProperties=r(7),("object"==typeof t&&t?t:window).Cleave=i,e.exports=i}.call(t,function(){return this}())},function(e,t){"use strict";function r(e,t,i,n,a,o,l,s,c,u){var d=this;d.numeralDecimalMark=e||".",d.numeralIntegerScale=0<t?t:0,d.numeralDecimalScale=0<=i?i:2,d.numeralThousandsGroupStyle=n||r.groupStyle.thousand,d.numeralPositiveOnly=!!a,d.stripLeadingZeroes=!1!==o,d.prefix=l||""===l?l:"",d.signBeforePrefix=!!s,d.tailPrefix=!!c,d.delimiter=u||""===u?u:",",d.delimiterRE=u?new RegExp("\\"+u,"g"):""}r.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},r.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var i,n,a,o=this,l="";switch(e=e.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),i="-"===(e=o.stripLeadingZeroes?e.replace(/^(-)?0+(?=\d)/,"$1"):e).slice(0,1)?"-":"",n=void 0!==o.prefix?o.signBeforePrefix?i+o.prefix:o.prefix+i:i,0<=(a=e).indexOf(o.numeralDecimalMark)&&(a=(e=e.split(o.numeralDecimalMark))[0],l=o.numeralDecimalMark+e[1].slice(0,o.numeralDecimalScale)),"-"==i&&(a=a.slice(1)),0<o.numeralIntegerScale&&(a=a.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case r.groupStyle.lakh:a=a.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case r.groupStyle.wan:a=a.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case r.groupStyle.thousand:a=a.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?i+a.toString()+(0<o.numeralDecimalScale?l.toString():"")+o.prefix:n+a.toString()+(0<o.numeralDecimalScale?l.toString():"")}},e.exports=r},function(e,t){"use strict";function r(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMin.length&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMax.length&&i.dateMax.unshift(0),i.initBlocks()}r.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(0<e.length){var a=e.slice(0,i),o=a.slice(0,1),i=e.slice(i);switch(t.datePattern[n]){case"d":"00"===a?a="01":3<parseInt(o,10)?a="0"+o:31<parseInt(a,10)&&(a="31");break;case"m":"00"===a?a="01":1<parseInt(o,10)?a="0"+o:12<parseInt(a,10)&&(a="12")}r+=a,e=i}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0,p=!1;return 4===e.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(d=2-(u="d"===a[0]?0:2),t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,r,0)),8===e.length&&(a.forEach(function(e,t){switch(e){case"d":l=t;break;case"m":s=t;break;default:c=t}}),m=2*c,u=l<=c?2*l:2*l+2,d=s<=c?2*s:2*s+2,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=this.getFixedDate(t,r,i)),4!==e.length||"y"!==a[0]&&"y"!==a[1]||(m=2-(d="m"===a[0]?0:2),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),p=2===e.slice(m,m+2).length,o=[0,r,i]),6!==e.length||"Y"!==a[0]&&"Y"!==a[1]||(m=2-.5*(d="m"===a[0]?0:4),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=[0,r,i]),o=n.getRangeFixedDate(o),0===(n.date=o).length?e:a.reduce(function(e,t){switch(t){case"d":return e+(0===o[0]?"":n.addLeadingZero(o[0]));case"m":return e+(0===o[1]?"":n.addLeadingZero(o[1]));case"y":return e+(p?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return e+(p?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],t=t.dateMax||[];return!e.length||i.length<3&&t.length<3||r.find(function(e){return"y"===e.toLowerCase()})&&0===e[2]?e:t.length&&(t[2]<e[2]||t[2]===e[2]&&(t[1]<e[1]||t[1]===e[1]&&t[0]<e[0]))?t:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),[e=t<7&&t%2==0||8<t&&t%2==1?Math.min(e,2===t?this.isLeapYear(r)?29:28:30):e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";function r(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()}r.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="",i=(e=e.replace(/[^\d]/g,""),t.getTimeFormatOptions());return t.blocks.forEach(function(n,a){if(0<e.length){var o=e.slice(0,n),l=o.slice(0,1),n=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(l,10)>i.maxHourFirstDigit?o="0"+l:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(l,10)>i.maxMinutesFirstDigit?o="0"+l:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=n}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var r,i,u,n=this,a=n.timePattern,o=[],l=0,s=0,c=0,d=0,m=0;return 6===e.length&&(a.forEach(function(e,t){switch(e){case"s":l=2*t;break;case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=l,u=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,u)),4===e.length&&n.timePattern.indexOf("s")<0&&(a.forEach(function(e,t){switch(e){case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=0,r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,u)),0===(n.time=o).length?e:a.reduce(function(e,t){switch(t){case"s":return e+n.addLeadingZero(o[2]);case"m":return e+n.addLeadingZero(o[1]);case"h":return e+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";function r(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e}r.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}},e.exports=r},function(e,t){"use strict";var r={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var a,o,i=r.blocks,n=r.re;for(a in t=!!t,n)if(n[a].test(e))return o=i[a],{type:a,blocks:t?this.getStrictBlocks(o):o};return{type:"unknown",blocks:t?this.getStrictBlocks(i.general):i.general}}};e.exports=r},function(e,t){"use strict";e.exports={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(0===r.length)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(t){e.slice(-t.length)===t&&(i=t)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){t=this.stripDelimiters(t.slice(0,e),i,n),r=this.stripDelimiters(r.slice(0,e),i,n),e=t.length-r.length;return 0!=e?e/Math.abs(e):0},stripDelimiters:function(e,t,r){var i=this;return 0===r.length?(t=t?i.getDelimiterREByDelimiter(t):"",e.replace(t,"")):(r.forEach(function(t){t.split("").forEach(function(t){e=e.replace(i.getDelimiterREByDelimiter(t),"")})}),e)},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,l,s){if(0===r)return e;if(e===t&&""!==e)return"";if(s&&"-"==e.slice(0,1))return c="-"==i.slice(0,1)?i.slice(1):i,"-"+this.getPrefixStrippedValue(e.slice(1),t,r,c,n,a,o,l,s);if(i.slice(0,r)!==t&&!l)return o&&!i&&e?e:"";if(i.slice(-r)!==t&&l)return o&&!i&&e?e:"";var c=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||l?e.slice(-r)!==t&&l?c.slice(0,-r-1):l?e.slice(0,-r):e.slice(r):c.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",l=0<n.length,s="";return 0===r?e:(t.forEach(function(t,c){var u,d;0<e.length&&(u=e.slice(0,t),d=e.slice(t),s=l?n[a?c-1:c]||s:i,a?(0<c&&(o+=s),o+=u):(o+=u,u.length===t&&c<r-1&&(o+=s)),e=d)}),o)},fixPrefixCursor:function(e,t,r,i){var n,o;e&&(n=e.value,r=r||i[0]||" ",!e.setSelectionRange||!t||t.length+r.length<=n.length||(o=2*n.length,setTimeout(function(){e.setSelectionRange(o,o)},1)))},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch(r){}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){r=e.createTextRange();r.move("character",t),r.select()}else try{e.setSelectionRange(t,t)}catch(n){console.warn("The input element type does not support selection")}},getActiveElement:function(e){e=e.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}}},function(e,t){!function(t){"use strict";e.exports={assign:function(e,r){return(e=e||{}).creditCard=!!(r=r||{}).creditCard,e.creditCardStrictMode=!!r.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=r.onCreditCardTypeChanged||function(){},e.phone=!!r.phone,e.phoneRegionCode=r.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!r.time,e.timePattern=r.timePattern||["h","m","s"],e.timeFormat=r.timeFormat||"24",e.timeFormatter={},e.date=!!r.date,e.datePattern=r.datePattern||["d","m","Y"],e.dateMin=r.dateMin||"",e.dateMax=r.dateMax||"",e.dateFormatter={},e.numeral=!!r.numeral,e.numeralIntegerScale=0<r.numeralIntegerScale?r.numeralIntegerScale:0,e.numeralDecimalScale=0<=r.numeralDecimalScale?r.numeralDecimalScale:2,e.numeralDecimalMark=r.numeralDecimalMark||".",e.numeralThousandsGroupStyle=r.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!r.numeralPositiveOnly,e.stripLeadingZeroes=!1!==r.stripLeadingZeroes,e.signBeforePrefix=!!r.signBeforePrefix,e.tailPrefix=!!r.tailPrefix,e.swapHiddenInput=!!r.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!r.numericOnly,e.uppercase=!!r.uppercase,e.lowercase=!!r.lowercase,e.prefix=!e.creditCard&&!e.date&&r.prefix||"",e.noImmediatePrefix=!!r.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!r.rawValueTrimPrefix,e.copyDelimiter=!!r.copyDelimiter,e.initValue=void 0!==r.initValue&&null!==r.initValue?r.initValue.toString():"",e.delimiter=r.delimiter||""===r.delimiter?r.delimiter:r.date?"/":r.time?":":r.numeral?",":(r.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!r.delimiterLazyShow,e.delimiters=r.delimiters||[],e.blocks=r.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof t&&t?t:window,e.document=r.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=r.onValueChanged||function(){},e}}}.call(t,function(){return this}())}],r={},t.m=e,t.c=r,t.p="",t(0);function t(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e,r}),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.multi_line_text={init:function(options){this.$form=options.form,this.type=this.$el.data("happyforms-type"),this.$input=$("textarea",this.$el),this.$counter=$(".happyforms-part__char-counter span.counter",this.$el),this.$input.on("blur",this.onBlur.bind(this)),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$el.on("keyup",this.refreshCounter.bind(this)),this.refreshCounter(),$(".happyforms-part__char-counter").show()},getValueLength:function(){var mode=this.$input.attr("data-length-mode"),value=this.$input.val(),length=value.length;return length="word"===mode?(mode=value.match(/\w+/g))?mode.length:0:length},refreshCounter:function(){var length;parseInt(this.$input.attr("data-length"),10)<1||(length=this.getValueLength(),this.$counter.text(length))},onFocus:function(){this.$el.addClass("focus")},onBlur:function(){this.$el.removeClass("focus")},isFilled:function(){return""!==this.$input.val()},serialize:function(){return HappyForms.parts.base.serialize.apply(this,arguments)}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.email={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$visualInput=$("input[type=email]",this.$el),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.$visualInput.on("blur",this.onBlur.bind(this))}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.radio={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$visualInput=$("input[type=email]",this.$el),this.$input.on("keyup",this.triggerChange.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("change",this.onRadioChange.bind(this)),this.$input.on("focus",this.onFocus.bind(this))},onRadioChange:function(e){var $otherRadio=$(".happyforms-part-option--other input[type=radio]",this.$el),$otherInput=$otherRadio.parent().nextAll("input"),$generalInput=$("input[type=text]",this.$el);$generalInput.prop("required",!1),$otherRadio.length&&$otherRadio.is(":checked")?($(e.target)[0]===$otherRadio[0]&&$otherInput.addClass("hf-show").trigger("focus"),""===this.$el.data("happyforms-required")&&$otherInput.prop("required",!0)):$generalInput.removeClass("hf-show")},onFocus:function(e){e=$(e.target);"text"===e.attr("type")&&e.prevAll("input[type=radio]").prop("checked",!0)},serialize:function(){var self=this;return this.$input.map(function(i,input){var input=$(input),$customInput=0;if("text"!==input.attr("type")){"text"===$(self.$input[i+1]).attr("type")&&($customInput=$(self.$input[i+1]));i={name:input.attr("name"),value:input.val()};if($customInput.length&&($customInput=$customInput.val(),i.value=[input.val(),$customInput],i.value=JSON.stringify(i.value)),input.is(":checked"))return i}}).toArray()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.checkbox={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input",this.$el),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("change",this.onCheckboxChange.bind(this)),this.$input.on("focus",this.onFocus.bind(this))},onCheckboxChange:function(e){var $otherCheckbox=$(".happyforms-part-option--other input[type=checkbox]",this.$el),$otherInput=$otherCheckbox.parent().nextAll("input"),$generalInput=$("input[type=text]",this.$el);$generalInput.prop("required",!1),$otherCheckbox.length&&$otherCheckbox.is(":checked")?($(e.target)[0]===$otherCheckbox[0]&&$otherInput.addClass("hf-show").trigger("focus"),""===this.$el.data("happyforms-required")&&$otherInput.prop("required",!0)):$generalInput.removeClass("hf-show")},serialize:function(){var self=this;return this.$input.map(function(i,input){var input=$(input),$customInput=0;if("text"!==input.attr("type")){"text"===$(self.$input[i+1]).attr("type")&&($customInput=$(self.$input[i+1]));i={name:input.attr("name"),value:input.val()};if($customInput.length&&($customInput=$customInput.val(),i.value=[input.val(),$customInput],i.value=JSON.stringify(i.value)),input.is(":checked"))return i}}).toArray()},onFocus:function(e){e=$(e.target);"text"===e.attr("type")&&e.prevAll("input[type=checkbox]").prop("checked",!0)}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.select={init:function(options){this.type=this.$el.data("happyforms-type"),this.$input=$("[data-serialize]",this.$el),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("blur",this.onBlur.bind(this))},onBlur:function(){var $otherinput=$(".happyforms-part-option--other input[type=text]",this.$el);"999"===this.$input.val()?($otherinput.addClass("hf-show"),$otherinput.focus()):$otherinput.removeClass("hf-show")},serialize:function(){var self=this;return this.$input.map(function(i,select){var select=$(select,self.$el),$customInput=0,value=(999==select.val()&&($customInput=$(" .happyforms-part-option--other input[type=text]",self.$el)),select.val()),value=(null==value&&(value=""),{name:select.attr("name"),value:value});return $customInput.length&&($customInput=$customInput.val(),value.value=[select.val(),$customInput],value.value=JSON.stringify(value.value)),value}).toArray()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.number={init:function(){this.type=this.$el.data("happyforms-type"),this.allowedKeys=["0","1","2","3","4","5","6","7","8","9","Meta","Delete","ArrowLeft","ArrowRight"];var self,decimalMark,delimiterMark,masked=this.$el.attr("data-mask");this.$input=$("input",this.$el),this.cleaveInstances=[],this.$input.on("keyup",this.onKeyUp.bind(this)),this.$input.on("change",this.triggerChange.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.$input.on("blur",this.onBlur.bind(this)),this.numeralDecimalMark=this.$el.attr("data-decimal-mark")||"",this.delimiter=this.$el.attr("data-thousands-delimiter")||"",masked&&(decimalMark=(self=this).numeralDecimalMark,delimiterMark=this.delimiter,this.$input.each(function(){var $input=$(this),$input=new Cleave($input,{numeral:!0,numeralDecimalMark:decimalMark,delimiter:delimiterMark});self.cleaveInstances.push($input)})),this.onBlur()},onKeyUp:function(e){var value=$(e.target).val(),regex=new RegExp("[^0-9"+this.numeralDecimalMark+this.delimiter+"-]","g"),value=value.replace(regex,"");$(e.target).val(value),this.triggerChange()},reinit:function(){$.each(this.cleaveInstances,function(i,instance){var input=instance.element,rawValue=instance.getRawValue();instance.destroy(),input.value=rawValue}),this.init()}}}(jQuery),function($){HappyForms.parts=HappyForms.parts||{},HappyForms.parts.base={init:function(){this.type=this.$el.data("happyforms-type"),this.$input=$("input, textarea, select",this.$el),this.$input.on("keyup change",this.triggerChange.bind(this)),this.$input.on("blur",this.onBlur.bind(this)),this.$input.on("focus",this.onInputFocus.bind(this)),this.onBlur()},getType:function(){return this.type},onInputFocus:function(){this.$el.addClass("focus")},onBlur:function(){this.$el.is(".happyforms-part--label-as_placeholder")&&(this.isFilled()?this.$el.addClass("happyforms-part--filled"):this.$el.removeClass("happyforms-part--filled")),this.$el.removeClass("focus")},triggerChange:function(data){this.$el.trigger("happyforms-change",data)},isRequired:function(){return this.$el.is(":visible")&&this.$el.is("[data-happyforms-required]")},isFilled:function(){return 0<this.$input.filter(function(){var $input=$(this);return $input.is("[type=checkbox]")||$input.is("[type=radio]")?$input.is(":checked"):""!==$input.val()}).length},confirmationMatches:function(){var matches=!1,$input=this.$input,$input=($input=this.$visualInput?this.$visualInput:$input).map(function(){return $(this).val()}).toArray();return matches=2===$input.length?$input[0]===$input[1]:matches},requiresConfirmation:function(){return this.$el.is("[data-happyforms-require-confirmation]")},serialize:function(){return this.$input.map(function(i,input){var input=$(input),keyValue={name:input.attr("name"),value:input.val()};if(!input.is("[type=checkbox]")&&!input.is("[type=radio]")||input.is(":checked"))return keyValue}).toArray()},isValid:function(){var valid=!0;this.$el.data("happyforms-type");return this.$input?(this.isRequired()&&(valid=valid&&this.isFilled()),this.isRequired()&&this.requiresConfirmation()?valid&&this.confirmationMatches():valid):valid},destroy:function(){this.$el.data("HappyFormPart",!1)}},HappyForms.wrapPart=function($part,$form){var type=$part.data("happyforms-type"),partMethods=HappyForms.parts.base;HappyForms.parts[type]&&(partMethods=$.extend({},HappyForms.parts.base,HappyForms.parts[type])),$part.happyFormPart(partMethods,{form:$form})},HappyForms.Form=function(el){this.el=el,this.$el=$(this.el),this.$form=$("form",this.$el),this.$parts=$("[data-happyforms-type]",this.$form),this.$submits=$('[type="submit"], a.submit',this.$form),this.$submit=$('[type="submit"]',this.$form),this.$submitLinks=$("a.submit",this.$form),this.$step=$('[name="happyforms_step"]',this.$form),this.init()},HappyForms.Form.prototype={init:function(){var $form=this.$form;$("[data-happyforms-type]",this.$form).each(function(){var $part=$(this);$part.data("happyforms-type");HappyForms.wrapPart($part,$form)}),this.$el.trigger("happyforms-change"),this.$el.trigger("happyforms-init"),this.$form.off("submit"),this.$submit.off("click"),this.$submitLinks.off("click"),this.$form.on("submit",this.submit.bind(this)),this.$submit.on("click",this.buttonSubmit.bind(this)),this.$submitLinks.on("click",this.linkSubmit.bind(this)),this.$el.on("happyforms-scrolltop",this.onScrollTop.bind(this))},detach:function(){this.$el.off("happyforms-change"),this.$el.off("happyforms-scrolltop"),$("[data-happyforms-type]",this.$form).remove()},serialize:function(submitEl){for(var action=$("[name=action]",this.$form).val(),form_id=$("[name=happyforms_form_id]",this.$form).val(),formData=($("[name=_wp_http_referer]",this.$form).val(),[{name:"action",value:action},{name:"happyforms_form_id",value:form_id},{name:"happyforms_step",value:this.$step.val()}]),honeypotNames=["single_line_text","multi_line_text","number"],h=0;h<honeypotNames.length;h++){var inputName=form_id+"-"+honeypotNames[h],$input=$("[name="+inputName+"]");if($input.length){formData.push({name:inputName,value:$input.val()});break}}var action=$("[data-happyforms-type]",this.$form).map(function(i,part){return $(part).happyFormPart("serialize")}).toArray().filter(function(entry){return null!==entry.name&&void 0!==entry.name}),action=formData.concat(action),params=new URLSearchParams,hash=[];return action.forEach(function(entry){params.append(entry.name,entry.value),hash.push(entry.value)}),hash=hash.join("").replace(/[^\w\d]/gm,""),hash=md5(hash),params.append("hash",hash),params=params.toString()},buttonSubmit:function(e){e.target.hasAttribute("data-step")&&this.$step.val(e.target.getAttribute("data-step"))},linkSubmit:function(e){e.preventDefault(),e.stopImmediatePropagation(),e.target.hasAttribute("data-step")&&this.$step.val(e.target.getAttribute("data-step")),this.$form.trigger("submit")},submit:function(e){e.preventDefault(),this.$form.addClass("happyforms-form--submitting"),this.$submits.attr("disabled","disabled"),$.ajax({type:"post",data:this.serialize(e.target)}).done(this.onSubmitComplete.bind(this))},onSubmitComplete:function(response){if(this.$form.trigger("happyforms.submitted",response),!response.data)return!1;var elTopOffset,$notices;response.data.html&&(response=$(response.data.html),$("[data-happyforms-type]",this.$form).each(function(){$(this).trigger("happyforms.detach")}),this.detach(),this.$el.replaceWith(response),this.$el=response,this.$el.happyForm(),(response=$("form",this.$el)).attr("data-happyforms-scroll-disabled")||(this.$el.get(0).getBoundingClientRect().top<0&&(elTopOffset=this.$el.offset().top,$notices=$(".happyforms-message-notices",this.$el),response.is(".happyforms-form--notices-below")&&$notices.length&&(elTopOffset=$notices.offset().top),($notices=response.attr("data-happyforms-scroll-offset"))&&(elTopOffset+=$notices=parseInt($notices,10)),this.$el.trigger("happyforms-scrolltop",elTopOffset)),!$(".happyforms-message-notice.error",response).length&&this.$el.hasClass("happyforms-form--hide-on-submit")&&$(".happyforms-part",response).hide()))},onScrollTop:function(e,offset){e.isDefaultPrevented()||$("html, body").animate({scrollTop:offset+"px"},500)}},HappyForms.Part=function(el){this.el=el,this.$el=$(this.el)},$.fn.happyFormPart=function(method){if("object"==typeof method){var part=new HappyForms.Part(this);$.extend(part,method),$(this).data("HappyFormPart",part),part.init.apply(part,Array.prototype.slice.call(arguments,1))}else{part=$(this).data("HappyFormPart");if(part&&part[method])return part[method].apply(part,Array.prototype.slice.call(arguments,1))}},$.fn.happyForm=function(method){this.each(function(){if(method){var instance=$.data(this,"HappyForm");if(instance&&instance[method])return instance[method].apply(instance,Array.prototype.slice.call(arguments,1))}else $.data(this,"HappyForm",new HappyForms.Form(this,arguments))})},$(function(){$(".happyforms-form").happyForm()})}(jQuery);
|
core/assets/css/admin.css
CHANGED
@@ -225,6 +225,14 @@ p.happyforms-message-nav span.divider:last-child {
|
|
225 |
height: 36px !important;
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
.happyforms-buttongroup {
|
229 |
display: flex;
|
230 |
}
|
225 |
height: 36px !important;
|
226 |
}
|
227 |
|
228 |
+
.happyforms-block-form-selector-wrap .components-placeholder__instructions {
|
229 |
+
width: 100%;
|
230 |
+
}
|
231 |
+
|
232 |
+
.happyforms-block-form-selector-wrap .components-notice {
|
233 |
+
margin: 0 0 1em 0;
|
234 |
+
}
|
235 |
+
|
236 |
.happyforms-buttongroup {
|
237 |
display: flex;
|
238 |
}
|
core/assets/css/color.css
CHANGED
@@ -291,6 +291,15 @@
|
|
291 |
color: var(--happyforms-color-part-description);
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
/* parts - radio, checkbox */
|
295 |
|
296 |
.happyforms-styles .happyforms-part .checkmark {
|
291 |
color: var(--happyforms-color-part-description);
|
292 |
}
|
293 |
|
294 |
+
.happyforms-styles .happyforms-part .happyforms-part-option label.heading-label {
|
295 |
+
font-weight: normal;
|
296 |
+
font-style: normal;
|
297 |
+
font-size: 16px;
|
298 |
+
font-size: var(--happyforms-part-value-font-size);
|
299 |
+
color: #000;
|
300 |
+
color: var(--happyforms-color-part-title);
|
301 |
+
}
|
302 |
+
|
303 |
/* parts - radio, checkbox */
|
304 |
|
305 |
.happyforms-styles .happyforms-part .checkmark {
|
core/assets/css/customize.css
CHANGED
@@ -183,6 +183,14 @@ p.description a {
|
|
183 |
max-width: 100%;
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
.customize-control.customize-control-checkbox_dummy label a {
|
187 |
margin-left: 5px;
|
188 |
}
|
@@ -934,6 +942,7 @@ textarea.option-import-area {
|
|
934 |
}
|
935 |
|
936 |
.happyforms-part-widget .options .delete-option,
|
|
|
937 |
.happyforms-part-widget .columns .delete-column,
|
938 |
.happyforms-part-widget .rows .delete-row {
|
939 |
color: #d63638;
|
183 |
max-width: 100%;
|
184 |
}
|
185 |
|
186 |
+
.input_dummy input {
|
187 |
+
pointer-events: none !important;
|
188 |
+
}
|
189 |
+
|
190 |
+
.input_dummy input[type="number"] {
|
191 |
+
margin-top: 5px;
|
192 |
+
}
|
193 |
+
|
194 |
.customize-control.customize-control-checkbox_dummy label a {
|
195 |
margin-left: 5px;
|
196 |
}
|
942 |
}
|
943 |
|
944 |
.happyforms-part-widget .options .delete-option,
|
945 |
+
.happyforms-part-widget .options .delete-heading,
|
946 |
.happyforms-part-widget .columns .delete-column,
|
947 |
.happyforms-part-widget .rows .delete-row {
|
948 |
color: #d63638;
|
core/assets/css/layout.css
CHANGED
@@ -411,7 +411,8 @@ h3.happyforms-form__title {
|
|
411 |
align-items: flex-start;
|
412 |
}
|
413 |
|
414 |
-
.happyforms-styles .happyforms-part .happyforms-part-option.disabled-option .option-label
|
|
|
415 |
cursor: default;
|
416 |
}
|
417 |
|
@@ -463,6 +464,10 @@ h3.happyforms-form__title {
|
|
463 |
flex-wrap: wrap;
|
464 |
}
|
465 |
|
|
|
|
|
|
|
|
|
466 |
/* parts - radio, checkbox */
|
467 |
|
468 |
.happyforms-part--choice .happyforms-part__el {
|
411 |
align-items: flex-start;
|
412 |
}
|
413 |
|
414 |
+
.happyforms-styles .happyforms-part .happyforms-part-option.disabled-option .option-label,
|
415 |
+
.happyforms-styles .happyforms-part .happyforms-table__cell.disabled-option .option-label {
|
416 |
cursor: default;
|
417 |
}
|
418 |
|
464 |
flex-wrap: wrap;
|
465 |
}
|
466 |
|
467 |
+
.happyforms-part .happyforms-part-option.option-heading {
|
468 |
+
width: 100%;
|
469 |
+
}
|
470 |
+
|
471 |
/* parts - radio, checkbox */
|
472 |
|
473 |
.happyforms-part--choice .happyforms-part__el {
|
core/assets/js/lib/md5.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((u=d(d(t,n),d(e,u)))<<o|u>>>32-o,r)}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function c(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=g(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=g(a,c,f,i,n[h+6],9,-1069501632),i=g(i,a,c,f,n[h+11],14,643717713),f=g(f,i,a,c,n[h],20,-373897302),c=g(c,f,i,a,n[h+5],5,-701558691),a=g(a,c,f,i,n[h+10],9,38016083),i=g(i,a,c,f,n[h+15],14,-660478335),f=g(f,i,a,c,n[h+4],20,-405537848),c=g(c,f,i,a,n[h+9],5,568446438),a=g(a,c,f,i,n[h+14],9,-1019803690),i=g(i,a,c,f,n[h+3],14,-187363961),f=g(f,i,a,c,n[h+8],20,1163531501),c=g(c,f,i,a,n[h+13],5,-1444681467),a=g(a,c,f,i,n[h+2],9,-51403784),i=g(i,a,c,f,n[h+7],14,1735328473),c=v(c,f=g(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=v(a,c,f,i,n[h+8],11,-2022574463),i=v(i,a,c,f,n[h+11],16,1839030562),f=v(f,i,a,c,n[h+14],23,-35309556),c=v(c,f,i,a,n[h+1],4,-1530992060),a=v(a,c,f,i,n[h+4],11,1272893353),i=v(i,a,c,f,n[h+7],16,-155497632),f=v(f,i,a,c,n[h+10],23,-1094730640),c=v(c,f,i,a,n[h+13],4,681279174),a=v(a,c,f,i,n[h],11,-358537222),i=v(i,a,c,f,n[h+3],16,-722521979),f=v(f,i,a,c,n[h+6],23,76029189),c=v(c,f,i,a,n[h+9],4,-640364487),a=v(a,c,f,i,n[h+12],11,-421815835),i=v(i,a,c,f,n[h+15],16,530742520),c=m(c,f=v(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function i(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function a(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return i(c(a(n=r(n)),8*n.length))}function u(n,t){return function(n,t){var r,e=a(n),o=[],u=[];for(o[15]=u[15]=void 0,16<e.length&&(e=c(e,8*n.length)),r=0;r<16;r+=1)o[r]=909522486^e[r],u[r]=1549556828^e[r];return t=c(o.concat(a(t)),512+8*t.length),i(c(u.concat(t),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
|
2 |
+
//# sourceMappingURL=md5.min.js.map
|
core/assets/js/parts/part-checkbox.js
CHANGED
@@ -28,6 +28,7 @@
|
|
28 |
is_default: false,
|
29 |
label: '',
|
30 |
description: '',
|
|
|
31 |
},
|
32 |
} );
|
33 |
|
@@ -35,75 +36,81 @@
|
|
35 |
model: OptionModel,
|
36 |
} );
|
37 |
|
38 |
-
happyForms.classes.views.parts.
|
39 |
-
template: '#customize-happyforms-checkbox-item-template',
|
40 |
|
41 |
events: {
|
42 |
-
'click .
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'change [name=label]': 'onItemLabelChange',
|
46 |
-
'keyup [name=description]': 'onItemDescriptionChange',
|
47 |
-
'change [name=is_default]': 'onItemDefaultChange',
|
48 |
-
|
49 |
-
'change [name=limit_submissions]': 'onItemLimitSubmissionsChange',
|
50 |
-
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
51 |
-
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
52 |
-
'change [name=show_submissions_amount]': 'onItemLimitShowSubmissionsAmountChange',
|
53 |
},
|
54 |
|
55 |
initialize: function( options ) {
|
56 |
this.template = _.template( $( this.template ).text() );
|
57 |
this.part = options.part;
|
58 |
|
59 |
-
this.listenTo( this.model, 'change:show_submissions_amount', this.onChangeShowSubmissions );
|
60 |
-
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
61 |
this.listenTo( this, 'ready', this.onReady );
|
62 |
},
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
var model = this.part;
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
$( "input[name='show_submissions_amount']", this.$el ).prop('checked',false);;
|
71 |
-
}
|
72 |
|
73 |
-
|
74 |
-
$( '
|
|
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
id: model.get( 'id' ),
|
79 |
-
html: response,
|
80 |
-
};
|
81 |
|
82 |
-
|
|
|
83 |
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
},
|
|
|
86 |
|
87 |
-
|
|
|
88 |
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
html: response,
|
95 |
-
};
|
96 |
|
97 |
-
|
|
|
|
|
98 |
|
99 |
-
|
|
|
100 |
},
|
101 |
|
102 |
onChangeMaxSubmissionsAmount: function( e ) {
|
103 |
-
|
104 |
var model = this.part;
|
105 |
|
106 |
-
if (
|
107 |
return;
|
108 |
}
|
109 |
|
@@ -119,23 +126,17 @@
|
|
119 |
},
|
120 |
|
121 |
onItemLimitSubmissionsAmountChange: function( e ) {
|
122 |
-
|
123 |
-
this.part.trigger( 'change' );
|
124 |
-
},
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
onItemLimitShowSubmissionsAmountChange: function( e ) {
|
132 |
-
var isChecked = $( e.target ).is( ':checked' );
|
133 |
|
134 |
-
this.model.set( '
|
135 |
this.part.trigger( 'change' );
|
136 |
},
|
137 |
|
138 |
-
|
139 |
render: function() {
|
140 |
this.setElement( this.template( this.model.toJSON() ) );
|
141 |
|
@@ -231,12 +232,11 @@
|
|
231 |
|
232 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
233 |
'click .add-option': 'onAddOptionClick',
|
|
|
234 |
'click .import-option': 'onImportOptionClick',
|
235 |
'click .import-options': 'onImportOptionsClick',
|
236 |
'click .add-options': 'onAddOptionsClick',
|
237 |
'change [data-bind=display_type]': 'onDisplayTypeChange',
|
238 |
-
'keyup [name=label]': 'onEnterKey',
|
239 |
-
'keyup [name=description]': 'onEnterKey',
|
240 |
|
241 |
'change [data-bind=limit_choices_min]': 'refreshMinMaxChoices',
|
242 |
'change [data-bind=limit_choices_max]': 'refreshMinMaxChoices',
|
@@ -349,10 +349,21 @@
|
|
349 |
},
|
350 |
|
351 |
addOptionView: function( optionModel, options ) {
|
352 |
-
var optionView =
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
|
357 |
var optionViewModel = new Backbone.Model( {
|
358 |
id: optionModel.id,
|
@@ -411,6 +422,14 @@
|
|
411 |
this.model.get( 'options' ).add( itemModel );
|
412 |
},
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
onDisplayTypeChange: function(e) {
|
415 |
var $input = $( e.target );
|
416 |
var attribute = $input.data( 'bind' );
|
@@ -426,15 +445,6 @@
|
|
426 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
427 |
},
|
428 |
|
429 |
-
onEnterKey: function( e ) {
|
430 |
-
e.preventDefault();
|
431 |
-
|
432 |
-
if ( 'Enter' === e.key ) {
|
433 |
-
$( '.add-option', this.$el ).trigger( 'click' );
|
434 |
-
return;
|
435 |
-
}
|
436 |
-
},
|
437 |
-
|
438 |
onImportOptionsClick: function( e ) {
|
439 |
e.preventDefault();
|
440 |
|
@@ -612,6 +622,16 @@
|
|
612 |
|
613 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
614 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
615 |
} );
|
616 |
|
617 |
} ) ( jQuery, _, Backbone, wp.customize, _happyFormsSettings );
|
28 |
is_default: false,
|
29 |
label: '',
|
30 |
description: '',
|
31 |
+
is_heading: false,
|
32 |
},
|
33 |
} );
|
34 |
|
36 |
model: OptionModel,
|
37 |
} );
|
38 |
|
39 |
+
happyForms.classes.views.parts.checkboxOptionHeading = Backbone.View.extend( {
|
40 |
+
template: '#customize-happyforms-checkbox-item-heading-template',
|
41 |
|
42 |
events: {
|
43 |
+
'click .delete-heading': 'onDeleteHeadingClick',
|
44 |
+
'keyup [name=label]': 'onHeadingLabelChange',
|
45 |
+
'change [name=label]': 'onHeadingLabelChange',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
},
|
47 |
|
48 |
initialize: function( options ) {
|
49 |
this.template = _.template( $( this.template ).text() );
|
50 |
this.part = options.part;
|
51 |
|
|
|
|
|
52 |
this.listenTo( this, 'ready', this.onReady );
|
53 |
},
|
54 |
|
55 |
+
render: function() {
|
56 |
+
this.setElement( this.template( this.model.toJSON() ) );
|
|
|
57 |
|
58 |
+
return this;
|
59 |
+
},
|
|
|
|
|
60 |
|
61 |
+
onReady: function() {
|
62 |
+
$( '[name=label]', this.$el ).trigger( 'focus' );
|
63 |
+
},
|
64 |
|
65 |
+
onDeleteHeadingClick: function( e ) {
|
66 |
+
e.preventDefault();
|
|
|
|
|
|
|
67 |
|
68 |
+
this.model.collection.remove( this.model );
|
69 |
+
},
|
70 |
|
71 |
+
onHeadingLabelChange: function( e ) {
|
72 |
+
this.model.set( 'label', $( e.target ).val() );
|
73 |
+
this.part.trigger( 'change' );
|
74 |
+
|
75 |
+
var data = {
|
76 |
+
id: this.part.get( 'id' ),
|
77 |
+
callback: 'onCheckboxHeadingLabelChangeCallback',
|
78 |
+
options: {
|
79 |
+
itemID: this.model.get( 'id' ),
|
80 |
+
}
|
81 |
+
};
|
82 |
+
|
83 |
+
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
84 |
},
|
85 |
+
} );
|
86 |
|
87 |
+
happyForms.classes.views.parts.checkboxOption = Backbone.View.extend( {
|
88 |
+
template: '#customize-happyforms-checkbox-item-template',
|
89 |
|
90 |
+
events: {
|
91 |
+
'click .advanced-option': 'onAdvancedOptionClick',
|
92 |
+
'click .delete-option': 'onDeleteOptionClick',
|
93 |
+
'keyup [name=label]': 'onItemLabelChange',
|
94 |
+
'change [name=label]': 'onItemLabelChange',
|
95 |
+
'keyup [name=description]': 'onItemDescriptionChange',
|
96 |
+
'change [name=is_default]': 'onItemDefaultChange',
|
97 |
|
98 |
+
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
99 |
+
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
100 |
+
},
|
|
|
|
|
101 |
|
102 |
+
initialize: function( options ) {
|
103 |
+
this.template = _.template( $( this.template ).text() );
|
104 |
+
this.part = options.part;
|
105 |
|
106 |
+
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
107 |
+
this.listenTo( this, 'ready', this.onReady );
|
108 |
},
|
109 |
|
110 |
onChangeMaxSubmissionsAmount: function( e ) {
|
|
|
111 |
var model = this.part;
|
112 |
|
113 |
+
if ( '' == this.model.get('limit_submissions_amount') ) {
|
114 |
return;
|
115 |
}
|
116 |
|
126 |
},
|
127 |
|
128 |
onItemLimitSubmissionsAmountChange: function( e ) {
|
129 |
+
var value = $( '[name="limit_submissions_amount"]', this.$el ).val();
|
|
|
|
|
130 |
|
131 |
+
if ( 0 > value ) {
|
132 |
+
$( '[name="limit_submissions_amount"]', this.$el ).val( '' );
|
133 |
+
return;
|
134 |
+
}
|
|
|
|
|
|
|
135 |
|
136 |
+
this.model.set( 'limit_submissions_amount', $( e.target ).val() );
|
137 |
this.part.trigger( 'change' );
|
138 |
},
|
139 |
|
|
|
140 |
render: function() {
|
141 |
this.setElement( this.template( this.model.toJSON() ) );
|
142 |
|
232 |
|
233 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
234 |
'click .add-option': 'onAddOptionClick',
|
235 |
+
'click .add-heading': 'onAddHeadingClick',
|
236 |
'click .import-option': 'onImportOptionClick',
|
237 |
'click .import-options': 'onImportOptionsClick',
|
238 |
'click .add-options': 'onAddOptionsClick',
|
239 |
'change [data-bind=display_type]': 'onDisplayTypeChange',
|
|
|
|
|
240 |
|
241 |
'change [data-bind=limit_choices_min]': 'refreshMinMaxChoices',
|
242 |
'change [data-bind=limit_choices_max]': 'refreshMinMaxChoices',
|
349 |
},
|
350 |
|
351 |
addOptionView: function( optionModel, options ) {
|
352 |
+
var optionView = null;
|
353 |
+
var optionAttributes = optionModel.attributes;
|
354 |
+
var isHeading = 'undefined' !== typeof optionAttributes.is_heading && 1 == optionAttributes.is_heading;
|
355 |
+
|
356 |
+
if ( isHeading ) {
|
357 |
+
optionView = new happyForms.classes.views.parts.checkboxOptionHeading( _.extend( {
|
358 |
+
model: optionModel,
|
359 |
+
part: this.model,
|
360 |
+
}, options ) );
|
361 |
+
} else {
|
362 |
+
optionView = new happyForms.classes.views.parts.checkboxOption( _.extend( {
|
363 |
+
model: optionModel,
|
364 |
+
part: this.model,
|
365 |
+
}, options ) );
|
366 |
+
}
|
367 |
|
368 |
var optionViewModel = new Backbone.Model( {
|
369 |
id: optionModel.id,
|
422 |
this.model.get( 'options' ).add( itemModel );
|
423 |
},
|
424 |
|
425 |
+
onAddHeadingClick: function( e ) {
|
426 |
+
e.preventDefault();
|
427 |
+
|
428 |
+
var itemID = this.getOptionModelID();
|
429 |
+
var itemModel = new OptionModel( { id: itemID, is_heading: 1 } );
|
430 |
+
this.model.get( 'options' ).add( itemModel );
|
431 |
+
},
|
432 |
+
|
433 |
onDisplayTypeChange: function(e) {
|
434 |
var $input = $( e.target );
|
435 |
var attribute = $input.data( 'bind' );
|
445 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
446 |
},
|
447 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
onImportOptionsClick: function( e ) {
|
449 |
e.preventDefault();
|
450 |
|
622 |
|
623 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
624 |
},
|
625 |
+
|
626 |
+
onCheckboxHeadingLabelChangeCallback: function( id, html, options ) {
|
627 |
+
var part = this.getPartModel( id );
|
628 |
+
var $part = this.getPartElement( html );
|
629 |
+
var option = part.get( 'options' ).get( options.itemID );
|
630 |
+
var $option = $( '#' + options.itemID, $part );
|
631 |
+
|
632 |
+
this.$( 'label.heading-label', $option ).text( option.get( 'label' ) );
|
633 |
+
},
|
634 |
+
|
635 |
} );
|
636 |
|
637 |
} ) ( jQuery, _, Backbone, wp.customize, _happyFormsSettings );
|
core/assets/js/parts/part-radio.js
CHANGED
@@ -28,6 +28,7 @@
|
|
28 |
is_default: false,
|
29 |
label: '',
|
30 |
description: '',
|
|
|
31 |
},
|
32 |
} );
|
33 |
|
@@ -35,6 +36,54 @@
|
|
35 |
model: OptionModel,
|
36 |
} );
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
happyForms.classes.views.parts.radioOption = Backbone.View.extend( {
|
39 |
template: '#customize-happyforms-radio-item-template',
|
40 |
|
@@ -46,10 +95,8 @@
|
|
46 |
'keyup [name=description]': 'onItemDescriptionChange',
|
47 |
'change [name=is_default]': 'onItemDefaultChange',
|
48 |
|
49 |
-
'change [name=limit_submissions]': 'onItemLimitSubmissionsChange',
|
50 |
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
51 |
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
52 |
-
'change [name=show_submissions_amount]': 'onItemLimitShowSubmissionsAmountChange',
|
53 |
},
|
54 |
|
55 |
initialize: function( options ) {
|
@@ -57,8 +104,6 @@
|
|
57 |
this.part = options.part;
|
58 |
|
59 |
this.listenTo( this, 'ready', this.onReady );
|
60 |
-
|
61 |
-
this.listenTo( this.model, 'change:show_submissions_amount', this.onChangeShowSubmissions );
|
62 |
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
63 |
},
|
64 |
|
@@ -152,49 +197,11 @@
|
|
152 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
153 |
},
|
154 |
|
155 |
-
onItemLimitSubmissionsChange: function( e ) {
|
156 |
-
var isChecked = $( e.target ).is( ':checked' );
|
157 |
-
var model = this.part;
|
158 |
-
|
159 |
-
if ( ! isChecked ) {
|
160 |
-
this.model.set( 'show_submissions_amount', 0 );
|
161 |
-
$( "input[name='show_submissions_amount']", this.$el ).prop('checked',false);;
|
162 |
-
}
|
163 |
-
|
164 |
-
this.model.set( 'limit_submissions', isChecked ? 1 : 0 );
|
165 |
-
$( '.happyforms-part-item-limit-submission-settings', this.$el ).toggle();
|
166 |
-
|
167 |
-
this.part.fetchHtml( function( response ) {
|
168 |
-
var data = {
|
169 |
-
id: model.get( 'id' ),
|
170 |
-
html: response,
|
171 |
-
};
|
172 |
-
|
173 |
-
happyForms.previewSend( 'happyforms-form-part-refresh', data );
|
174 |
-
|
175 |
-
} );
|
176 |
-
},
|
177 |
-
|
178 |
-
onChangeShowSubmissions: function( e ) {
|
179 |
-
|
180 |
-
var model = this.part;
|
181 |
-
|
182 |
-
this.part.fetchHtml( function( response ) {
|
183 |
-
var data = {
|
184 |
-
id: model.get( 'id' ),
|
185 |
-
html: response,
|
186 |
-
};
|
187 |
-
|
188 |
-
happyForms.previewSend( 'happyforms-form-part-refresh', data );
|
189 |
-
|
190 |
-
} );
|
191 |
-
},
|
192 |
-
|
193 |
onChangeMaxSubmissionsAmount: function( e ) {
|
194 |
|
195 |
var model = this.part;
|
196 |
|
197 |
-
if (
|
198 |
return;
|
199 |
}
|
200 |
|
@@ -210,14 +217,14 @@
|
|
210 |
},
|
211 |
|
212 |
onItemLimitSubmissionsAmountChange: function( e ) {
|
213 |
-
|
214 |
-
this.part.trigger( 'change' );
|
215 |
-
},
|
216 |
|
217 |
-
|
218 |
-
|
|
|
|
|
219 |
|
220 |
-
this.model.set( '
|
221 |
this.part.trigger( 'change' );
|
222 |
},
|
223 |
|
@@ -228,12 +235,11 @@
|
|
228 |
|
229 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
230 |
'click .add-option': 'onAddOptionClick',
|
|
|
231 |
'click .import-option': 'onImportOptionClick',
|
232 |
'click .import-options': 'onImportOptionsClick',
|
233 |
'click .add-options': 'onAddOptionsClick',
|
234 |
'change [data-bind=display_type]': 'onDisplayTypeChange',
|
235 |
-
'keyup [name=label]': 'onEnterKey',
|
236 |
-
'keyup [name=description]': 'onEnterKey',
|
237 |
} ),
|
238 |
|
239 |
initialize: function() {
|
@@ -336,10 +342,21 @@
|
|
336 |
},
|
337 |
|
338 |
addOptionView: function( optionModel, options ) {
|
339 |
-
var optionView =
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
|
344 |
var optionViewModel = new Backbone.Model( {
|
345 |
id: optionModel.id,
|
@@ -398,6 +415,14 @@
|
|
398 |
this.model.get( 'options' ).add( itemModel );
|
399 |
},
|
400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
onDisplayTypeChange: function(e) {
|
402 |
var $input = $( e.target );
|
403 |
var attribute = $input.data( 'bind' );
|
@@ -413,15 +438,6 @@
|
|
413 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
414 |
},
|
415 |
|
416 |
-
onEnterKey: function( e ) {
|
417 |
-
e.preventDefault();
|
418 |
-
|
419 |
-
if ( 'Enter' === e.key ) {
|
420 |
-
$( '.add-option', this.$el ).trigger( 'click' );
|
421 |
-
return;
|
422 |
-
}
|
423 |
-
},
|
424 |
-
|
425 |
onImportOptionsClick: function( e ) {
|
426 |
e.preventDefault();
|
427 |
|
@@ -566,7 +582,16 @@
|
|
566 |
var $otherOptionInput = $( '.happyforms-part-option--other input[type=text]', $part );
|
567 |
|
568 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
569 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
570 |
} );
|
571 |
|
572 |
} ) ( jQuery, _, Backbone, wp.customize, _happyFormsSettings );
|
28 |
is_default: false,
|
29 |
label: '',
|
30 |
description: '',
|
31 |
+
is_heading: false,
|
32 |
},
|
33 |
} );
|
34 |
|
36 |
model: OptionModel,
|
37 |
} );
|
38 |
|
39 |
+
happyForms.classes.views.parts.radioOptionHeading = Backbone.View.extend( {
|
40 |
+
template: '#customize-happyforms-checkbox-item-heading-template',
|
41 |
+
|
42 |
+
events: {
|
43 |
+
'click .delete-heading': 'onDeleteHeadingClick',
|
44 |
+
'keyup [name=label]': 'onHeadingLabelChange',
|
45 |
+
'change [name=label]': 'onHeadingLabelChange',
|
46 |
+
},
|
47 |
+
|
48 |
+
initialize: function( options ) {
|
49 |
+
this.template = _.template( $( this.template ).text() );
|
50 |
+
this.part = options.part;
|
51 |
+
|
52 |
+
this.listenTo( this, 'ready', this.onReady );
|
53 |
+
},
|
54 |
+
|
55 |
+
render: function() {
|
56 |
+
this.setElement( this.template( this.model.toJSON() ) );
|
57 |
+
|
58 |
+
return this;
|
59 |
+
},
|
60 |
+
|
61 |
+
onReady: function() {
|
62 |
+
$( '[name=label]', this.$el ).trigger( 'focus' );
|
63 |
+
},
|
64 |
+
|
65 |
+
onDeleteHeadingClick: function( e ) {
|
66 |
+
e.preventDefault();
|
67 |
+
|
68 |
+
this.model.collection.remove( this.model );
|
69 |
+
},
|
70 |
+
|
71 |
+
onHeadingLabelChange: function( e ) {
|
72 |
+
this.model.set( 'label', $( e.target ).val() );
|
73 |
+
this.part.trigger( 'change' );
|
74 |
+
|
75 |
+
var data = {
|
76 |
+
id: this.part.get( 'id' ),
|
77 |
+
callback: 'onRadioHeadingLabelChangeCallback',
|
78 |
+
options: {
|
79 |
+
itemID: this.model.get( 'id' ),
|
80 |
+
}
|
81 |
+
};
|
82 |
+
|
83 |
+
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
84 |
+
},
|
85 |
+
} );
|
86 |
+
|
87 |
happyForms.classes.views.parts.radioOption = Backbone.View.extend( {
|
88 |
template: '#customize-happyforms-radio-item-template',
|
89 |
|
95 |
'keyup [name=description]': 'onItemDescriptionChange',
|
96 |
'change [name=is_default]': 'onItemDefaultChange',
|
97 |
|
|
|
98 |
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
99 |
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
|
|
100 |
},
|
101 |
|
102 |
initialize: function( options ) {
|
104 |
this.part = options.part;
|
105 |
|
106 |
this.listenTo( this, 'ready', this.onReady );
|
|
|
|
|
107 |
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
108 |
},
|
109 |
|
197 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
198 |
},
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
onChangeMaxSubmissionsAmount: function( e ) {
|
201 |
|
202 |
var model = this.part;
|
203 |
|
204 |
+
if ( '' == this.model.get('limit_submissions_amount') ) {
|
205 |
return;
|
206 |
}
|
207 |
|
217 |
},
|
218 |
|
219 |
onItemLimitSubmissionsAmountChange: function( e ) {
|
220 |
+
var value = $( '[name="limit_submissions_amount"]', this.$el ).val();
|
|
|
|
|
221 |
|
222 |
+
if ( 0 > value ) {
|
223 |
+
$( '[name="limit_submissions_amount"]', this.$el ).val( '' );
|
224 |
+
return;
|
225 |
+
}
|
226 |
|
227 |
+
this.model.set( 'limit_submissions_amount', $( e.target ).val() );
|
228 |
this.part.trigger( 'change' );
|
229 |
},
|
230 |
|
235 |
|
236 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
237 |
'click .add-option': 'onAddOptionClick',
|
238 |
+
'click .add-heading': 'onAddHeadingClick',
|
239 |
'click .import-option': 'onImportOptionClick',
|
240 |
'click .import-options': 'onImportOptionsClick',
|
241 |
'click .add-options': 'onAddOptionsClick',
|
242 |
'change [data-bind=display_type]': 'onDisplayTypeChange',
|
|
|
|
|
243 |
} ),
|
244 |
|
245 |
initialize: function() {
|
342 |
},
|
343 |
|
344 |
addOptionView: function( optionModel, options ) {
|
345 |
+
var optionView = null;
|
346 |
+
var optionAttributes = optionModel.attributes;
|
347 |
+
var isHeading = 'undefined' !== typeof optionAttributes.is_heading && 1 == optionAttributes.is_heading;
|
348 |
+
|
349 |
+
if ( isHeading ) {
|
350 |
+
optionView = new happyForms.classes.views.parts.radioOptionHeading( _.extend( {
|
351 |
+
model: optionModel,
|
352 |
+
part: this.model,
|
353 |
+
}, options ) );
|
354 |
+
} else {
|
355 |
+
optionView = new happyForms.classes.views.parts.radioOption( _.extend( {
|
356 |
+
model: optionModel,
|
357 |
+
part: this.model,
|
358 |
+
}, options ) );
|
359 |
+
}
|
360 |
|
361 |
var optionViewModel = new Backbone.Model( {
|
362 |
id: optionModel.id,
|
415 |
this.model.get( 'options' ).add( itemModel );
|
416 |
},
|
417 |
|
418 |
+
onAddHeadingClick: function( e ) {
|
419 |
+
e.preventDefault();
|
420 |
+
|
421 |
+
var itemID = this.getOptionModelID();
|
422 |
+
var itemModel = new OptionModel( { id: itemID, is_heading: 1 } );
|
423 |
+
this.model.get( 'options' ).add( itemModel );
|
424 |
+
},
|
425 |
+
|
426 |
onDisplayTypeChange: function(e) {
|
427 |
var $input = $( e.target );
|
428 |
var attribute = $input.data( 'bind' );
|
438 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
439 |
},
|
440 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
onImportOptionsClick: function( e ) {
|
442 |
e.preventDefault();
|
443 |
|
582 |
var $otherOptionInput = $( '.happyforms-part-option--other input[type=text]', $part );
|
583 |
|
584 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
585 |
+
},
|
586 |
+
|
587 |
+
onRadioHeadingLabelChangeCallback: function( id, html, options ) {
|
588 |
+
var part = this.getPartModel( id );
|
589 |
+
var $part = this.getPartElement( html );
|
590 |
+
var option = part.get( 'options' ).get( options.itemID );
|
591 |
+
var $option = $( '#' + options.itemID, $part );
|
592 |
+
|
593 |
+
this.$( 'label.heading-label', $option ).text( option.get( 'label' ) );
|
594 |
+
},
|
595 |
} );
|
596 |
|
597 |
} ) ( jQuery, _, Backbone, wp.customize, _happyFormsSettings );
|
core/assets/js/parts/part-select.js
CHANGED
@@ -27,6 +27,7 @@
|
|
27 |
defaults: {
|
28 |
is_default: false,
|
29 |
label: '',
|
|
|
30 |
},
|
31 |
} );
|
32 |
|
@@ -34,6 +35,53 @@
|
|
34 |
model: OptionModel,
|
35 |
} );
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
happyForms.classes.views.parts.selectOption = Backbone.View.extend( {
|
38 |
template: '#customize-happyforms-select-item-template',
|
39 |
|
@@ -43,12 +91,8 @@
|
|
43 |
'keyup [name=label]': 'onItemLabelKeyup',
|
44 |
'change [name=label]': 'onItemLabelChange',
|
45 |
'change [name=is_default]': 'onItemDefaultChange',
|
46 |
-
|
47 |
-
|
48 |
-
'change [name=limit_submissions]': 'onItemLimitSubmissionsChange',
|
49 |
-
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
50 |
-
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
51 |
-
'change [name=show_submissions_amount]': 'onItemLimitShowSubmissionsAmountChange',
|
52 |
},
|
53 |
|
54 |
initialize: function( options ) {
|
@@ -56,8 +100,6 @@
|
|
56 |
this.part = options.part;
|
57 |
|
58 |
this.listenTo( this, 'ready', this.onReady );
|
59 |
-
|
60 |
-
this.listenTo( this.model, 'change:show_submissions_amount', this.onChangeShowSubmissions );
|
61 |
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
62 |
},
|
63 |
|
@@ -131,61 +173,23 @@
|
|
131 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
132 |
},
|
133 |
|
134 |
-
|
135 |
-
var
|
136 |
-
var model = this.part;
|
137 |
|
138 |
-
if (
|
139 |
-
|
140 |
-
|
141 |
}
|
142 |
|
143 |
-
this.model.set( 'limit_submissions', isChecked ? 1 : 0 );
|
144 |
-
$( '.happyforms-part-item-limit-submission-settings', this.$el ).toggle();
|
145 |
-
|
146 |
-
this.part.fetchHtml( function( response ) {
|
147 |
-
var data = {
|
148 |
-
id: model.get( 'id' ),
|
149 |
-
html: response,
|
150 |
-
};
|
151 |
-
|
152 |
-
happyForms.previewSend( 'happyforms-form-part-refresh', data );
|
153 |
-
|
154 |
-
} );
|
155 |
-
},
|
156 |
-
|
157 |
-
onItemLimitSubmissionsAmountChange: function( e ) {
|
158 |
this.model.set( 'limit_submissions_amount', $( e.target ).val() );
|
159 |
this.part.trigger( 'change' );
|
160 |
},
|
161 |
|
162 |
-
onItemLimitShowSubmissionsAmountChange: function( e ) {
|
163 |
-
var isChecked = $( e.target ).is( ':checked' );
|
164 |
-
|
165 |
-
this.model.set( 'show_submissions_amount', isChecked ? "1" : 0 );
|
166 |
-
this.part.trigger( 'change' );
|
167 |
-
},
|
168 |
-
|
169 |
-
onChangeShowSubmissions: function( e ) {
|
170 |
-
|
171 |
-
var model = this.part;
|
172 |
-
|
173 |
-
this.part.fetchHtml( function( response ) {
|
174 |
-
var data = {
|
175 |
-
id: model.get( 'id' ),
|
176 |
-
html: response,
|
177 |
-
};
|
178 |
-
|
179 |
-
happyForms.previewSend( 'happyforms-form-part-refresh', data );
|
180 |
-
|
181 |
-
} );
|
182 |
-
},
|
183 |
-
|
184 |
onChangeMaxSubmissionsAmount: function( e ) {
|
185 |
|
186 |
var model = this.part;
|
187 |
|
188 |
-
if (
|
189 |
return;
|
190 |
}
|
191 |
|
@@ -206,12 +210,11 @@
|
|
206 |
|
207 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
208 |
'click .add-option': 'onAddOptionClick',
|
|
|
209 |
'click .import-option': 'onImportOptionClick',
|
210 |
'click .import-options': 'onImportOptionsClick',
|
211 |
'click .add-options': 'onAddOptionsClick',
|
212 |
'click .show-all-options': 'onShowAllOptionsClick',
|
213 |
-
'keyup [name=label]': 'onEnterKey',
|
214 |
-
'keyup [name=description]': 'onEnterKey',
|
215 |
|
216 |
'change [data-bind=other_option_label]': 'onOtherSelectOptionLabelChange',
|
217 |
} ),
|
@@ -327,10 +330,21 @@
|
|
327 |
},
|
328 |
|
329 |
addOptionView: function( optionModel, options ) {
|
330 |
-
var optionView =
|
331 |
-
|
332 |
-
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
|
335 |
var optionViewModel = new Backbone.Model( {
|
336 |
id: optionModel.id,
|
@@ -389,6 +403,14 @@
|
|
389 |
this.model.get( 'options' ).add( itemModel );
|
390 |
},
|
391 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
onShowAllOptionsClick: function(e) {
|
393 |
var $link = $(e.target);
|
394 |
this.$el.find('.happyforms-part-widget--sub').show();
|
@@ -418,15 +440,6 @@
|
|
418 |
} );
|
419 |
},
|
420 |
|
421 |
-
onEnterKey: function( e ) {
|
422 |
-
e.preventDefault();
|
423 |
-
|
424 |
-
if ( 'Enter' === e.key ) {
|
425 |
-
$( '.add-option', this.$el ).trigger( 'click' );
|
426 |
-
return;
|
427 |
-
}
|
428 |
-
},
|
429 |
-
|
430 |
onImportOptionsClick: function( e ) {
|
431 |
e.preventDefault();
|
432 |
|
@@ -595,7 +608,16 @@
|
|
595 |
var $otherOptionInput = $( '.happyforms-part-option--other input[type=text]', $part );
|
596 |
|
597 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
598 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
|
600 |
} );
|
601 |
|
27 |
defaults: {
|
28 |
is_default: false,
|
29 |
label: '',
|
30 |
+
is_heading: false,
|
31 |
},
|
32 |
} );
|
33 |
|
35 |
model: OptionModel,
|
36 |
} );
|
37 |
|
38 |
+
happyForms.classes.views.parts.selectOptionHeading = Backbone.View.extend( {
|
39 |
+
template: '#customize-happyforms-select-item-heading-template',
|
40 |
+
|
41 |
+
events: {
|
42 |
+
'click .delete-heading': 'onDeleteHeadingClick',
|
43 |
+
'keyup [name=label]': 'onHeadingLabelChange',
|
44 |
+
'change [name=label]': 'onHeadingLabelChange',
|
45 |
+
},
|
46 |
+
|
47 |
+
initialize: function( options ) {
|
48 |
+
this.template = _.template( $( this.template ).text() );
|
49 |
+
this.part = options.part;
|
50 |
+
|
51 |
+
this.listenTo( this, 'ready', this.onReady );
|
52 |
+
},
|
53 |
+
|
54 |
+
render: function() {
|
55 |
+
this.setElement( this.template( this.model.toJSON() ) );
|
56 |
+
|
57 |
+
return this;
|
58 |
+
},
|
59 |
+
|
60 |
+
onReady: function() {
|
61 |
+
$( '[name=label]', this.$el ).trigger( 'focus' );
|
62 |
+
},
|
63 |
+
|
64 |
+
onDeleteHeadingClick: function( e ) {
|
65 |
+
e.preventDefault();
|
66 |
+
|
67 |
+
this.model.collection.remove( this.model );
|
68 |
+
},
|
69 |
+
|
70 |
+
onHeadingLabelChange: function( e ) {
|
71 |
+
this.model.set( 'label', $( e.target ).val() );
|
72 |
+
var self = this;
|
73 |
+
|
74 |
+
this.part.fetchHtml( function( response ) {
|
75 |
+
var data = {
|
76 |
+
id: self.part.id,
|
77 |
+
html: response,
|
78 |
+
};
|
79 |
+
|
80 |
+
happyForms.previewSend( 'happyforms-form-part-refresh', data );
|
81 |
+
} );
|
82 |
+
},
|
83 |
+
} );
|
84 |
+
|
85 |
happyForms.classes.views.parts.selectOption = Backbone.View.extend( {
|
86 |
template: '#customize-happyforms-select-item-template',
|
87 |
|
91 |
'keyup [name=label]': 'onItemLabelKeyup',
|
92 |
'change [name=label]': 'onItemLabelChange',
|
93 |
'change [name=is_default]': 'onItemDefaultChange',
|
94 |
+
'keyup [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
95 |
+
'change [name=limit_submissions_amount]': 'onItemLimitSubmissionsAmountChange',
|
|
|
|
|
|
|
|
|
96 |
},
|
97 |
|
98 |
initialize: function( options ) {
|
100 |
this.part = options.part;
|
101 |
|
102 |
this.listenTo( this, 'ready', this.onReady );
|
|
|
|
|
103 |
this.listenTo( this.model, 'change:limit_submissions_amount', this.onChangeMaxSubmissionsAmount );
|
104 |
},
|
105 |
|
173 |
happyForms.previewSend( 'happyforms-part-dom-update', data );
|
174 |
},
|
175 |
|
176 |
+
onItemLimitSubmissionsAmountChange: function( e ) {
|
177 |
+
var value = $( '[name="limit_submissions_amount"]', this.$el ).val();
|
|
|
178 |
|
179 |
+
if ( 0 > value ) {
|
180 |
+
$( '[name="limit_submissions_amount"]', this.$el ).val( '' );
|
181 |
+
return;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
this.model.set( 'limit_submissions_amount', $( e.target ).val() );
|
185 |
this.part.trigger( 'change' );
|
186 |
},
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
onChangeMaxSubmissionsAmount: function( e ) {
|
189 |
|
190 |
var model = this.part;
|
191 |
|
192 |
+
if ( '' == this.model.get('limit_submissions_amount') ) {
|
193 |
return;
|
194 |
}
|
195 |
|
210 |
|
211 |
events: _.extend( {}, happyForms.classes.views.Part.prototype.events, {
|
212 |
'click .add-option': 'onAddOptionClick',
|
213 |
+
'click .add-heading': 'onAddHeadingClick',
|
214 |
'click .import-option': 'onImportOptionClick',
|
215 |
'click .import-options': 'onImportOptionsClick',
|
216 |
'click .add-options': 'onAddOptionsClick',
|
217 |
'click .show-all-options': 'onShowAllOptionsClick',
|
|
|
|
|
218 |
|
219 |
'change [data-bind=other_option_label]': 'onOtherSelectOptionLabelChange',
|
220 |
} ),
|
330 |
},
|
331 |
|
332 |
addOptionView: function( optionModel, options ) {
|
333 |
+
var optionView = null;
|
334 |
+
var optionAttributes = optionModel.attributes;
|
335 |
+
var isHeading = 'undefined' !== typeof optionAttributes.is_heading && 1 == optionAttributes.is_heading;
|
336 |
+
|
337 |
+
if ( isHeading ) {
|
338 |
+
optionView = new happyForms.classes.views.parts.selectOptionHeading( _.extend( {
|
339 |
+
model: optionModel,
|
340 |
+
part: this.model,
|
341 |
+
}, options ) );
|
342 |
+
} else {
|
343 |
+
optionView = new happyForms.classes.views.parts.selectOption( _.extend( {
|
344 |
+
model: optionModel,
|
345 |
+
part: this.model,
|
346 |
+
}, options ) );
|
347 |
+
}
|
348 |
|
349 |
var optionViewModel = new Backbone.Model( {
|
350 |
id: optionModel.id,
|
403 |
this.model.get( 'options' ).add( itemModel );
|
404 |
},
|
405 |
|
406 |
+
onAddHeadingClick: function( e ) {
|
407 |
+
e.preventDefault();
|
408 |
+
|
409 |
+
var itemID = this.getOptionModelID();
|
410 |
+
var itemModel = new OptionModel( { id: itemID, is_heading: 1 } );
|
411 |
+
this.model.get( 'options' ).add( itemModel );
|
412 |
+
},
|
413 |
+
|
414 |
onShowAllOptionsClick: function(e) {
|
415 |
var $link = $(e.target);
|
416 |
this.$el.find('.happyforms-part-widget--sub').show();
|
440 |
} );
|
441 |
},
|
442 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
onImportOptionsClick: function( e ) {
|
444 |
e.preventDefault();
|
445 |
|
608 |
var $otherOptionInput = $( '.happyforms-part-option--other input[type=text]', $part );
|
609 |
|
610 |
$otherOptionInput.attr( 'placeholder', part.get( 'other_option_placeholder' ) );
|
611 |
+
},
|
612 |
+
|
613 |
+
onSelectHeadingLabelChangeCallback: function( id, html, options ) {
|
614 |
+
var part = this.getPartModel( id );
|
615 |
+
var $part = this.getPartElement( html );
|
616 |
+
var option = part.get( 'options' ).get( options.itemID );
|
617 |
+
var $option = $( '#' + options.itemID, $part );
|
618 |
+
|
619 |
+
this.$( 'label.heading-label', $option ).text( option.get( 'label' ) );
|
620 |
+
},
|
621 |
|
622 |
} );
|
623 |
|
core/assets/jsx/build/admin/block.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-server-side-render'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-server-side-render'), 'version' => '48ad6f4aa7cf37add254ef98cb28c597');
|
core/assets/jsx/build/admin/block.js
CHANGED
@@ -123,7 +123,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
123 |
value: form.ID
|
124 |
};
|
125 |
});
|
126 |
-
options.
|
127 |
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Choose', 'happyforms'),
|
128 |
value: ''
|
129 |
});
|
@@ -138,7 +138,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
138 |
}
|
139 |
}),
|
140 |
label: settings.block.title,
|
141 |
-
instructions:
|
|
|
|
|
|
|
142 |
className: "happyforms-block-form-selector-wrap",
|
143 |
key: "happyforms-component-placeholder"
|
144 |
}, settings.forms.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
@@ -192,19 +195,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
192 |
from: [{
|
193 |
type: 'block',
|
194 |
blocks: ['core/legacy-widget'],
|
195 |
-
isMatch:
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
199 |
if (!(instance !== null && instance !== void 0 && instance.raw)) {
|
200 |
return false;
|
201 |
}
|
202 |
|
203 |
return idBase === 'happyforms_widget';
|
204 |
},
|
205 |
-
transform:
|
206 |
-
|
207 |
-
|
|
|
208 |
return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["createBlock"])(blockID, {
|
209 |
id: instance.raw.form_id
|
210 |
});
|
@@ -216,7 +222,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
216 |
props.attributes.id = String(settings.forms[0].ID);
|
217 |
}
|
218 |
|
219 |
-
|
|
|
220 |
let inspectorComponent = settings.forms.length > 1 ? ComponentInspector(props) : false;
|
221 |
let component = inspectorComponent ? [blockComponent, inspectorComponent] : [blockComponent];
|
222 |
return component;
|
123 |
value: form.ID
|
124 |
};
|
125 |
});
|
126 |
+
options.unshift({
|
127 |
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Choose', 'happyforms'),
|
128 |
value: ''
|
129 |
});
|
138 |
}
|
139 |
}),
|
140 |
label: settings.block.title,
|
141 |
+
instructions: [props.attributes.id && !props.attributes.exists && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Notice"], {
|
142 |
+
status: "warning",
|
143 |
+
isDismissible: false
|
144 |
+
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('The form previously added has been trashed or deleted.', 'happyforms')), settings.forms.length > 0 ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Pick a form to display on your site.', 'happyforms') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('No forms found.', 'happyforms')],
|
145 |
className: "happyforms-block-form-selector-wrap",
|
146 |
key: "happyforms-component-placeholder"
|
147 |
}, settings.forms.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
195 |
from: [{
|
196 |
type: 'block',
|
197 |
blocks: ['core/legacy-widget'],
|
198 |
+
isMatch: _ref => {
|
199 |
+
let {
|
200 |
+
idBase,
|
201 |
+
instance
|
202 |
+
} = _ref;
|
203 |
+
|
204 |
if (!(instance !== null && instance !== void 0 && instance.raw)) {
|
205 |
return false;
|
206 |
}
|
207 |
|
208 |
return idBase === 'happyforms_widget';
|
209 |
},
|
210 |
+
transform: _ref2 => {
|
211 |
+
let {
|
212 |
+
instance
|
213 |
+
} = _ref2;
|
214 |
return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__["createBlock"])(blockID, {
|
215 |
id: instance.raw.form_id
|
216 |
});
|
222 |
props.attributes.id = String(settings.forms[0].ID);
|
223 |
}
|
224 |
|
225 |
+
props.attributes.exists = settings.forms.find(form => form.ID == props.attributes.id);
|
226 |
+
let blockComponent = props.attributes.id && props.attributes.exists ? ComponentForm(props) : ComponentPlaceholder(props);
|
227 |
let inspectorComponent = settings.forms.length > 1 ? ComponentInspector(props) : false;
|
228 |
let component = inspectorComponent ? [blockComponent, inspectorComponent] : [blockComponent];
|
229 |
return component;
|
core/assets/jsx/build/admin/block.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./build/core/assets/jsx/src/admin/block.js","webpack:///external [\"wp\",\"blockEditor\"]","webpack:///external [\"wp\",\"blocks\"]","webpack:///external [\"wp\",\"components\"]","webpack:///external [\"wp\",\"element\"]","webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"serverSideRender\"]"],"names":["settings","blockID","options","forms","map","form","label","post_title","value","ID","reverse","unshift","__","ComponentPlaceholder","props","setForm","useState","block","icon","marginRight","title","length","v","setAttributes","id","ComponentForm","attributes","ComponentInspector","registerBlockType","description","category","keywords","supports","anchor","html","transforms","from","type","blocks","isMatch","idBase","instance","raw","transform","createBlock","form_id","edit","String","blockComponent","inspectorComponent","component","save","_happyFormsBlockSettings"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAE,UAAUA,QAAV,EAAqB;AAEtB,MAAIC,OAAO,GAAG,4BAAd;AACA,MAAIC,OAAO,GAAGF,QAAQ,CAACG,KAAT,CACZC,GADY,CACP,UAAUC,IAAV,EAAiB;AACtB,WAAO;AAAEC,WAAK,EAAED,IAAI,CAACE,UAAd;AAA0BC,WAAK,EAAEH,IAAI,CAACI;AAAtC,KAAP;AACA,GAHY,CAAd;AAIAP,SAAO,CAACQ,OAAR,GAAkBC,OAAlB,CAA2B;AAAEL,SAAK,EAAEM,0DAAE,CAAE,QAAF,EAAY,YAAZ,CAAX;AAAuCJ,SAAK,EAAE;AAA9C,GAA3B;;AAEA,MAAIK,oBAAoB,GAAG,UAAUC,KAAV,EAAkB;AAC5C,UAAM,CAAET,IAAF,EAAQU,OAAR,IAAoBC,mEAAQ,CAAE,EAAF,CAAlC;AAEA,WACC,yEAAC,iEAAD;AACC,UAAI,EAAG,yEAAC,0DAAD;AAAM,YAAI,EAAGhB,QAAQ,CAACiB,KAAT,CAAeC,IAA5B;AAAmC,aAAK,EAAE;AAAEC,qBAAW,EAAE;AAAf;AAA1C,QADR;AAEC,WAAK,EAAGnB,QAAQ,CAACiB,KAAT,CAAeG,KAFxB;AAGC,kBAAY,EACXpB,QAAQ,CAACG,KAAT,CAAekB,MAAf,GAAwB,CAAxB,GACAT,0DAAE,CAAE,sCAAF,EAA0C,YAA1C,CADF,GAEAA,0DAAE,CAAE,iBAAF,EAAqB,YAArB,CANJ;AAQC,eAAS,EAAC,qCARX;AASC,SAAG,EAAC;AATL,OAYEZ,QAAQ,CAACG,KAAT,CAAekB,MAAf,GAAwB,CAAxB,IACA;AAAK,eAAS,EAAC;AAAf,OACC,yEAAC,mEAAD;AAAe,WAAK,EAAGhB,IAAvB;AAA8B,aAAO,EAAGH,OAAxC;AAAkD,cAAQ,EAAKoB,CAAF,IAASP,OAAO,CAAEO,CAAF;AAA7E,MADD,EAEC,yEAAC,4DAAD;AAAQ,eAAS,EAAC,MAAlB;AAAyB,aAAO,EAAKA,CAAF,IAASR,KAAK,CAACS,aAAN,CAAqB;AAAEC,UAAE,EAAEnB;AAAN,OAArB;AAA5C,OAAoFO,0DAAE,CAAE,QAAF,EAAY,YAAZ,CAAtF,CAFD,CAbF,CADD;AAsBA,GAzBD;;AA2BA,MAAIa,aAAa,GAAG,UAAUX,KAAV,EAAkB;AACrC,WAAO,CACN,yEAAC,oEAAD;AACC,WAAK,EAAGb,OADT;AAEC,gBAAU,EAAGa,KAAK,CAACY,UAFpB;AAGC,SAAG,EAAC;AAHL,MADM,CAAP;AAMA,GAPD;;AASA,MAAIC,kBAAkB,GAAG,UAAUb,KAAV,EAAkB;AAC1C,WACC,yEAAC,yEAAD;AAAmB,SAAG,EAAC;AAAvB,OACC,yEAAC,+DAAD;AAAW,WAAK,EAAGF,0DAAE,CAAE,UAAF,EAAc,YAAd;AAArB,OACC,yEAAC,mEAAD;AACC,WAAK,EAAGA,0DAAE,CAAE,aAAF,EAAiB,YAAjB,CADX;AAEC,WAAK,EAAGE,KAAK,CAACY,UAAN,CAAiBF,EAF1B;AAGC,aAAO,EAAGtB,OAHX;AAIC,cAAQ,EAAKoB,CAAF,IAASR,KAAK,CAACS,aAAN,CAAqB;AAAEC,UAAE,EAAGF;AAAP,OAArB;AAJrB,MADD,CADD,CADD;AAWA,GAZD;;AAcAM,6EAAiB,CAAE3B,OAAF,EAAW;AAC3BmB,SAAK,EAAEpB,QAAQ,CAACiB,KAAT,CAAeG,KADK;AAE3BS,eAAW,EAAE7B,QAAQ,CAACiB,KAAT,CAAeY,WAFD;AAG3BC,YAAQ,EAAE9B,QAAQ,CAACiB,KAAT,CAAea,QAHE;AAI3BZ,QAAI,EAAElB,QAAQ,CAACiB,KAAT,CAAeC,IAJM;AAK3Ba,YAAQ,EAAE/B,QAAQ,CAACiB,KAAT,CAAec,QALE;AAM3BC,YAAQ,EAAE;AACTC,YAAM,EAAE,IADC;AAETC,UAAI,EAAE;AAFG,KANiB;AAW3BC,cAAU,EAAE;AACXC,UAAI,EAAE,CAAE;AACPC,YAAI,EAAE,OADC;AAEPC,cAAM,EAAE,CAAE,oBAAF,CAFD;AAIPC,eAAO,EAAE,CAAE;AAAEC,gBAAF;AAAUC;AAAV,SAAF,KAA4B;AACpC,cAAK,EAAEA,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEC,GAAZ,CAAL,EAAuB;AACtB,mBAAO,KAAP;AACA;;AAED,iBAAOF,MAAM,KAAK,mBAAlB;AACA,SAVM;AAYPG,iBAAS,EAAE,CAAE;AAAEF;AAAF,SAAF,KAAoB;AAC9B,iBAAOG,qEAAW,CAAE3C,OAAF,EAAW;AAC5BuB,cAAE,EAAEiB,QAAQ,CAACC,GAAT,CAAaG;AADW,WAAX,CAAlB;AAGA;AAhBM,OAAF;AADK,KAXe;AAgC3BC,QAAI,EAAE,UAAUhC,KAAV,EAAkB;AACvB,UAAK,CAAEA,KAAK,CAACY,UAAN,CAAiBF,EAAnB,IAAyBxB,QAAQ,CAACG,KAAT,CAAekB,MAAf,KAA0B,CAAxD,EAA4D;AAC3DP,aAAK,CAACY,UAAN,CAAiBF,EAAjB,GAAsBuB,MAAM,CAAE/C,QAAQ,CAACG,KAAT,CAAe,CAAf,EAAkBM,EAApB,CAA5B;AACA;;AAED,UAAIuC,cAAc,GACjBlC,KAAK,CAACY,UAAN,CAAiBF,EAAjB,GACAC,aAAa,CAAEX,KAAF,CADb,GAEAD,oBAAoB,CAAEC,KAAF,CAHrB;AAMA,UAAImC,kBAAkB,GACrBjD,QAAQ,CAACG,KAAT,CAAekB,MAAf,GAAwB,CAAxB,GACAM,kBAAkB,CAAEb,KAAF,CADlB,GAEA,KAHD;AAMA,UAAIoC,SAAS,GACZD,kBAAkB,GAClB,CAAED,cAAF,EAAkBC,kBAAlB,CADkB,GAElB,CAAED,cAAF,CAHD;AAMA,aAAOE,SAAP;AACA,KAxD0B;AA0D3BC,QAAI,EAAE,YAAW;AAChB,aAAO,IAAP;AACA;AA5D0B,GAAX,CAAjB;AA+DA,CA1HD,EA2HCC,wBA3HD,E;;;;;;;;;;;ACPA,aAAa,8CAA8C,EAAE,I;;;;;;;;;;;ACA7D,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,0CAA0C,EAAE,I;;;;;;;;;;;ACAzD,aAAa,uCAAuC,EAAE,I;;;;;;;;;;;ACAtD,aAAa,mDAAmD,EAAE,I","file":"block.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./build/core/assets/jsx/src/admin/block.js\");\n","import { Placeholder, SelectControl, PanelBody, Icon, Button } from '@wordpress/components';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { registerBlockType, createBlock } from '@wordpress/blocks';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n( function( settings ) {\n\n\tvar blockID = 'thethemefoundry/happyforms';\n\tvar options = settings.forms\n\t\t.map( function( form ) {\n\t\t\treturn { label: form.post_title, value: form.ID };\n\t\t} )\n\toptions.reverse().unshift( { label: __( 'Choose', 'happyforms' ), value: '' } );\n\n\tvar ComponentPlaceholder = function( props ) {\n\t\tconst [ form, setForm ] = useState( '' );\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon={ <Icon icon={ settings.block.icon } style={{ marginRight: \"14.66px\" }} /> }\n\t\t\t\tlabel={ settings.block.title }\n\t\t\t\tinstructions={\n\t\t\t\t\tsettings.forms.length > 0 ?\n\t\t\t\t\t__( 'Pick a form to display on your site.', 'happyforms' ) :\n\t\t\t\t\t__( 'No forms found.', 'happyforms' )\n\t\t\t\t}\n\t\t\t\tclassName=\"happyforms-block-form-selector-wrap\"\n\t\t\t\tkey=\"happyforms-component-placeholder\">\n\n\t\t\t\t{\n\t\t\t\t\tsettings.forms.length > 0 &&\n\t\t\t\t\t<div className=\"happyforms-block-placeholder__control-group\">\n\t\t\t\t\t\t<SelectControl value={ form } options={ options } onChange={ ( v ) => setForm( v ) } />\n\t\t\t\t\t\t<Button isPrimary=\"true\" onClick={ ( v ) => props.setAttributes( { id: form } ) }>{ __( 'Insert', 'happyforms' ) }</Button>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tvar ComponentForm = function( props ) {\n\t\treturn [\n\t\t\t<ServerSideRender\n\t\t\t\tblock={ blockID }\n\t\t\t\tattributes={ props.attributes }\n\t\t\t\tkey=\"happyforms-component-form\" />\n\t\t];\n\t};\n\n\tvar ComponentInspector = function( props ) {\n\t\treturn (\n\t\t\t<InspectorControls key=\"happyforms-inspector-controls\">\n\t\t\t\t<PanelBody title={ __( 'Settings', 'happyforms' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Pick a form', 'happyforms' ) }\n\t\t\t\t\t\tvalue={ props.attributes.id }\n\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\tonChange={ ( v ) => props.setAttributes( { id : v } ) } />\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\t};\n\n\tregisterBlockType( blockID, {\n\t\ttitle: settings.block.title,\n\t\tdescription: settings.block.description,\n\t\tcategory: settings.block.category,\n\t\ticon: settings.block.icon,\n\t\tkeywords: settings.block.keywords,\n\t\tsupports: {\n\t\t\tanchor: true,\n\t\t\thtml: false\n\t\t},\n\n\t\ttransforms: {\n\t\t\tfrom: [ {\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/legacy-widget' ],\n\n\t\t\t\tisMatch: ( { idBase, instance } ) => {\n\t\t\t\t\tif ( ! instance?.raw ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn idBase === 'happyforms_widget';\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\ttransform: ( { instance } ) => {\n\t\t\t\t\treturn createBlock( blockID, {\n\t\t\t\t\t\tid: instance.raw.form_id,\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ],\n\t\t},\n\n\t\tedit: function( props ) {\n\t\t\tif ( ! props.attributes.id && settings.forms.length === 1 ) {\n\t\t\t\tprops.attributes.id = String( settings.forms[0].ID );\n\t\t\t}\n\n\t\t\tlet blockComponent = (\n\t\t\t\tprops.attributes.id ?\n\t\t\t\tComponentForm( props ) :\n\t\t\t\tComponentPlaceholder( props )\n\t\t\t);\n\n\t\t\tlet inspectorComponent = (\n\t\t\t\tsettings.forms.length > 1 ?\n\t\t\t\tComponentInspector( props ) :\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tlet component = (\n\t\t\t\tinspectorComponent ?\n\t\t\t\t[ blockComponent, inspectorComponent ] :\n\t\t\t\t[ blockComponent ]\n\t\t\t);\n\n\t\t\treturn component;\n\t\t},\n\n\t\tsave: function() {\n\t\t\treturn null;\n\t\t},\n\t} );\n\n} )(\n\t_happyFormsBlockSettings,\n);\n","(function() { module.exports = window[\"wp\"][\"blockEditor\"]; }());","(function() { module.exports = window[\"wp\"][\"blocks\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","(function() { module.exports = window[\"wp\"][\"element\"]; }());","(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"serverSideRender\"]; }());"],"sourceRoot":""}
|
1 |
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./build/core/assets/jsx/src/admin/block.js","webpack:///external [\"wp\",\"blockEditor\"]","webpack:///external [\"wp\",\"blocks\"]","webpack:///external [\"wp\",\"components\"]","webpack:///external [\"wp\",\"element\"]","webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"serverSideRender\"]"],"names":["settings","blockID","options","forms","map","form","label","post_title","value","ID","unshift","__","ComponentPlaceholder","props","setForm","useState","block","icon","marginRight","title","attributes","id","exists","length","v","setAttributes","ComponentForm","ComponentInspector","registerBlockType","description","category","keywords","supports","anchor","html","transforms","from","type","blocks","isMatch","idBase","instance","raw","transform","createBlock","form_id","edit","String","find","blockComponent","inspectorComponent","component","save","_happyFormsBlockSettings"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAE,UAAUA,QAAV,EAAqB;AAEtB,MAAIC,OAAO,GAAG,4BAAd;AACA,MAAIC,OAAO,GAAGF,QAAQ,CAACG,KAAT,CACZC,GADY,CACP,UAAUC,IAAV,EAAiB;AACtB,WAAO;AAAEC,WAAK,EAAED,IAAI,CAACE,UAAd;AAA0BC,WAAK,EAAEH,IAAI,CAACI;AAAtC,KAAP;AACA,GAHY,CAAd;AAIAP,SAAO,CAACQ,OAAR,CAAiB;AAAEJ,SAAK,EAAEK,0DAAE,CAAE,QAAF,EAAY,YAAZ,CAAX;AAAuCH,SAAK,EAAE;AAA9C,GAAjB;;AAEA,MAAII,oBAAoB,GAAG,UAAUC,KAAV,EAAkB;AAC5C,UAAM,CAAER,IAAF,EAAQS,OAAR,IAAoBC,mEAAQ,CAAE,EAAF,CAAlC;AAEA,WACC,yEAAC,iEAAD;AACC,UAAI,EAAG,yEAAC,0DAAD;AAAM,YAAI,EAAGf,QAAQ,CAACgB,KAAT,CAAeC,IAA5B;AAAmC,aAAK,EAAE;AAAEC,qBAAW,EAAE;AAAf;AAA1C,QADR;AAEC,WAAK,EAAGlB,QAAQ,CAACgB,KAAT,CAAeG,KAFxB;AAGC,kBAAY,EAAG,CACZN,KAAK,CAACO,UAAN,CAAiBC,EAAjB,IAAuB,CAAER,KAAK,CAACO,UAAN,CAAiBE,MAA5C,IACC,yEAAC,4DAAD;AAAQ,cAAM,EAAC,SAAf;AAAyB,qBAAa,EAAG;AAAzC,SACGX,0DAAE,CAAE,wDAAF,EAA4D,YAA5D,CADL,CAFa,EAMdX,QAAQ,CAACG,KAAT,CAAeoB,MAAf,GAAwB,CAAxB,GACAZ,0DAAE,CAAE,sCAAF,EAA0C,YAA1C,CADF,GAEAA,0DAAE,CAAE,iBAAF,EAAqB,YAArB,CARY,CAHhB;AAaC,eAAS,EAAC,qCAbX;AAcC,SAAG,EAAC;AAdL,OAiBEX,QAAQ,CAACG,KAAT,CAAeoB,MAAf,GAAwB,CAAxB,IACA;AAAK,eAAS,EAAC;AAAf,OACC,yEAAC,mEAAD;AAAe,WAAK,EAAGlB,IAAvB;AAA8B,aAAO,EAAGH,OAAxC;AAAkD,cAAQ,EAAKsB,CAAF,IAASV,OAAO,CAAEU,CAAF;AAA7E,MADD,EAEC,yEAAC,4DAAD;AAAQ,eAAS,EAAC,MAAlB;AAAyB,aAAO,EAAKA,CAAF,IAASX,KAAK,CAACY,aAAN,CAAqB;AAAEJ,UAAE,EAAEhB;AAAN,OAArB;AAA5C,OAAoFM,0DAAE,CAAE,QAAF,EAAY,YAAZ,CAAtF,CAFD,CAlBF,CADD;AA2BA,GA9BD;;AAgCA,MAAIe,aAAa,GAAG,UAAUb,KAAV,EAAkB;AACrC,WAAO,CACN,yEAAC,oEAAD;AACC,WAAK,EAAGZ,OADT;AAEC,gBAAU,EAAGY,KAAK,CAACO,UAFpB;AAGC,SAAG,EAAC;AAHL,MADM,CAAP;AAMA,GAPD;;AASA,MAAIO,kBAAkB,GAAG,UAAUd,KAAV,EAAkB;AAC1C,WACC,yEAAC,yEAAD;AAAmB,SAAG,EAAC;AAAvB,OACC,yEAAC,+DAAD;AAAW,WAAK,EAAGF,0DAAE,CAAE,UAAF,EAAc,YAAd;AAArB,OACC,yEAAC,mEAAD;AACC,WAAK,EAAGA,0DAAE,CAAE,aAAF,EAAiB,YAAjB,CADX;AAEC,WAAK,EAAGE,KAAK,CAACO,UAAN,CAAiBC,EAF1B;AAGC,aAAO,EAAGnB,OAHX;AAIC,cAAQ,EAAKsB,CAAF,IAASX,KAAK,CAACY,aAAN,CAAqB;AAAEJ,UAAE,EAAGG;AAAP,OAArB;AAJrB,MADD,CADD,CADD;AAWA,GAZD;;AAcAI,6EAAiB,CAAE3B,OAAF,EAAW;AAC3BkB,SAAK,EAAEnB,QAAQ,CAACgB,KAAT,CAAeG,KADK;AAE3BU,eAAW,EAAE7B,QAAQ,CAACgB,KAAT,CAAea,WAFD;AAG3BC,YAAQ,EAAE9B,QAAQ,CAACgB,KAAT,CAAec,QAHE;AAI3Bb,QAAI,EAAEjB,QAAQ,CAACgB,KAAT,CAAeC,IAJM;AAK3Bc,YAAQ,EAAE/B,QAAQ,CAACgB,KAAT,CAAee,QALE;AAM3BC,YAAQ,EAAE;AACTC,YAAM,EAAE,IADC;AAETC,UAAI,EAAE;AAFG,KANiB;AAW3BC,cAAU,EAAE;AACXC,UAAI,EAAE,CAAE;AACPC,YAAI,EAAE,OADC;AAEPC,cAAM,EAAE,CAAE,oBAAF,CAFD;AAIPC,eAAO,EAAE,QAA4B;AAAA,cAA1B;AAAEC,kBAAF;AAAUC;AAAV,WAA0B;;AACpC,cAAK,EAAEA,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEC,GAAZ,CAAL,EAAuB;AACtB,mBAAO,KAAP;AACA;;AAED,iBAAOF,MAAM,KAAK,mBAAlB;AACA,SAVM;AAYPG,iBAAS,EAAE,SAAoB;AAAA,cAAlB;AAAEF;AAAF,WAAkB;AAC9B,iBAAOG,qEAAW,CAAE3C,OAAF,EAAW;AAC5BoB,cAAE,EAAEoB,QAAQ,CAACC,GAAT,CAAaG;AADW,WAAX,CAAlB;AAGA;AAhBM,OAAF;AADK,KAXe;AAgC3BC,QAAI,EAAE,UAAUjC,KAAV,EAAkB;AACvB,UAAK,CAAEA,KAAK,CAACO,UAAN,CAAiBC,EAAnB,IAAyBrB,QAAQ,CAACG,KAAT,CAAeoB,MAAf,KAA0B,CAAxD,EAA4D;AAC3DV,aAAK,CAACO,UAAN,CAAiBC,EAAjB,GAAsB0B,MAAM,CAAE/C,QAAQ,CAACG,KAAT,CAAe,CAAf,EAAkBM,EAApB,CAA5B;AACA;;AAEDI,WAAK,CAACO,UAAN,CAAiBE,MAAjB,GAA0BtB,QAAQ,CAACG,KAAT,CAAe6C,IAAf,CAAqB3C,IAAI,IAAIA,IAAI,CAACI,EAAL,IAAWI,KAAK,CAACO,UAAN,CAAiBC,EAAzD,CAA1B;AAEA,UAAI4B,cAAc,GACjBpC,KAAK,CAACO,UAAN,CAAiBC,EAAjB,IAAuBR,KAAK,CAACO,UAAN,CAAiBE,MAAxC,GACAI,aAAa,CAAEb,KAAF,CADb,GAEAD,oBAAoB,CAAEC,KAAF,CAHrB;AAMA,UAAIqC,kBAAkB,GACrBlD,QAAQ,CAACG,KAAT,CAAeoB,MAAf,GAAwB,CAAxB,GACAI,kBAAkB,CAAEd,KAAF,CADlB,GAEA,KAHD;AAMA,UAAIsC,SAAS,GACZD,kBAAkB,GAClB,CAAED,cAAF,EAAkBC,kBAAlB,CADkB,GAElB,CAAED,cAAF,CAHD;AAMA,aAAOE,SAAP;AACA,KA1D0B;AA4D3BC,QAAI,EAAE,YAAW;AAChB,aAAO,IAAP;AACA;AA9D0B,GAAX,CAAjB;AAiEA,CAjID,EAkICC,wBAlID,E;;;;;;;;;;;ACPA,aAAa,8CAA8C,EAAE,I;;;;;;;;;;;ACA7D,aAAa,yCAAyC,EAAE,I;;;;;;;;;;;ACAxD,aAAa,6CAA6C,EAAE,I;;;;;;;;;;;ACA5D,aAAa,0CAA0C,EAAE,I;;;;;;;;;;;ACAzD,aAAa,uCAAuC,EAAE,I;;;;;;;;;;;ACAtD,aAAa,mDAAmD,EAAE,I","file":"block.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./build/core/assets/jsx/src/admin/block.js\");\n","import { Placeholder, SelectControl, PanelBody, Icon, Button, Notice } from '@wordpress/components';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { registerBlockType, createBlock } from '@wordpress/blocks';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n( function( settings ) {\n\n\tvar blockID = 'thethemefoundry/happyforms';\n\tvar options = settings.forms\n\t\t.map( function( form ) {\n\t\t\treturn { label: form.post_title, value: form.ID };\n\t\t} )\n\toptions.unshift( { label: __( 'Choose', 'happyforms' ), value: '' } );\n\n\tvar ComponentPlaceholder = function( props ) {\n\t\tconst [ form, setForm ] = useState( '' );\n\t\t\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon={ <Icon icon={ settings.block.icon } style={{ marginRight: \"14.66px\" }} /> }\n\t\t\t\tlabel={ settings.block.title }\n\t\t\t\tinstructions={ [\n\t\t\t\t\t( props.attributes.id && ! props.attributes.exists ) && (\n\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t{ __( 'The form previously added has been trashed or deleted.', 'happyforms' ) }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t),\n\t\t\t\t\tsettings.forms.length > 0 ?\n\t\t\t\t\t__( 'Pick a form to display on your site.', 'happyforms' ) :\n\t\t\t\t\t__( 'No forms found.', 'happyforms' )\n\t\t\t\t] }\n\t\t\t\tclassName=\"happyforms-block-form-selector-wrap\"\n\t\t\t\tkey=\"happyforms-component-placeholder\">\n\n\t\t\t\t{\n\t\t\t\t\tsettings.forms.length > 0 &&\n\t\t\t\t\t<div className=\"happyforms-block-placeholder__control-group\">\n\t\t\t\t\t\t<SelectControl value={ form } options={ options } onChange={ ( v ) => setForm( v ) } />\n\t\t\t\t\t\t<Button isPrimary=\"true\" onClick={ ( v ) => props.setAttributes( { id: form } ) }>{ __( 'Insert', 'happyforms' ) }</Button>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tvar ComponentForm = function( props ) {\n\t\treturn [\n\t\t\t<ServerSideRender\n\t\t\t\tblock={ blockID }\n\t\t\t\tattributes={ props.attributes }\n\t\t\t\tkey=\"happyforms-component-form\" />\n\t\t];\n\t};\n\n\tvar ComponentInspector = function( props ) {\n\t\treturn (\n\t\t\t<InspectorControls key=\"happyforms-inspector-controls\">\n\t\t\t\t<PanelBody title={ __( 'Settings', 'happyforms' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Pick a form', 'happyforms' ) }\n\t\t\t\t\t\tvalue={ props.attributes.id }\n\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\tonChange={ ( v ) => props.setAttributes( { id : v } ) } />\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t);\n\t};\n\n\tregisterBlockType( blockID, {\n\t\ttitle: settings.block.title,\n\t\tdescription: settings.block.description,\n\t\tcategory: settings.block.category,\n\t\ticon: settings.block.icon,\n\t\tkeywords: settings.block.keywords,\n\t\tsupports: {\n\t\t\tanchor: true,\n\t\t\thtml: false\n\t\t},\n\n\t\ttransforms: {\n\t\t\tfrom: [ {\n\t\t\t\ttype: 'block',\n\t\t\t\tblocks: [ 'core/legacy-widget' ],\n\n\t\t\t\tisMatch: ( { idBase, instance } ) => {\n\t\t\t\t\tif ( ! instance?.raw ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn idBase === 'happyforms_widget';\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\ttransform: ( { instance } ) => {\n\t\t\t\t\treturn createBlock( blockID, {\n\t\t\t\t\t\tid: instance.raw.form_id,\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ],\n\t\t},\n\n\t\tedit: function( props ) {\n\t\t\tif ( ! props.attributes.id && settings.forms.length === 1 ) {\n\t\t\t\tprops.attributes.id = String( settings.forms[0].ID );\n\t\t\t}\n\n\t\t\tprops.attributes.exists = settings.forms.find( form => form.ID == props.attributes.id );\n\n\t\t\tlet blockComponent = (\n\t\t\t\tprops.attributes.id && props.attributes.exists ?\n\t\t\t\tComponentForm( props ) :\n\t\t\t\tComponentPlaceholder( props )\n\t\t\t);\n\n\t\t\tlet inspectorComponent = (\n\t\t\t\tsettings.forms.length > 1 ?\n\t\t\t\tComponentInspector( props ) :\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tlet component = (\n\t\t\t\tinspectorComponent ?\n\t\t\t\t[ blockComponent, inspectorComponent ] :\n\t\t\t\t[ blockComponent ]\n\t\t\t);\n\n\t\t\treturn component;\n\t\t},\n\n\t\tsave: function() {\n\t\t\treturn null;\n\t\t},\n\t} );\n\n} )(\n\t_happyFormsBlockSettings,\n);\n","(function() { module.exports = window[\"wp\"][\"blockEditor\"]; }());","(function() { module.exports = window[\"wp\"][\"blocks\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","(function() { module.exports = window[\"wp\"][\"element\"]; }());","(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"serverSideRender\"]; }());"],"sourceRoot":""}
|
core/assets/jsx/src/admin/block.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { Placeholder, SelectControl, PanelBody, Icon, Button } from '@wordpress/components';
|
2 |
import ServerSideRender from '@wordpress/server-side-render';
|
3 |
import { InspectorControls } from '@wordpress/block-editor';
|
4 |
import { registerBlockType, createBlock } from '@wordpress/blocks';
|
@@ -12,20 +12,25 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
12 |
.map( function( form ) {
|
13 |
return { label: form.post_title, value: form.ID };
|
14 |
} )
|
15 |
-
options.
|
16 |
|
17 |
var ComponentPlaceholder = function( props ) {
|
18 |
const [ form, setForm ] = useState( '' );
|
19 |
-
|
20 |
return (
|
21 |
<Placeholder
|
22 |
icon={ <Icon icon={ settings.block.icon } style={{ marginRight: "14.66px" }} /> }
|
23 |
label={ settings.block.title }
|
24 |
-
instructions={
|
|
|
|
|
|
|
|
|
|
|
25 |
settings.forms.length > 0 ?
|
26 |
__( 'Pick a form to display on your site.', 'happyforms' ) :
|
27 |
__( 'No forms found.', 'happyforms' )
|
28 |
-
}
|
29 |
className="happyforms-block-form-selector-wrap"
|
30 |
key="happyforms-component-placeholder">
|
31 |
|
@@ -101,8 +106,10 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
101 |
props.attributes.id = String( settings.forms[0].ID );
|
102 |
}
|
103 |
|
|
|
|
|
104 |
let blockComponent = (
|
105 |
-
props.attributes.id ?
|
106 |
ComponentForm( props ) :
|
107 |
ComponentPlaceholder( props )
|
108 |
);
|
1 |
+
import { Placeholder, SelectControl, PanelBody, Icon, Button, Notice } from '@wordpress/components';
|
2 |
import ServerSideRender from '@wordpress/server-side-render';
|
3 |
import { InspectorControls } from '@wordpress/block-editor';
|
4 |
import { registerBlockType, createBlock } from '@wordpress/blocks';
|
12 |
.map( function( form ) {
|
13 |
return { label: form.post_title, value: form.ID };
|
14 |
} )
|
15 |
+
options.unshift( { label: __( 'Choose', 'happyforms' ), value: '' } );
|
16 |
|
17 |
var ComponentPlaceholder = function( props ) {
|
18 |
const [ form, setForm ] = useState( '' );
|
19 |
+
|
20 |
return (
|
21 |
<Placeholder
|
22 |
icon={ <Icon icon={ settings.block.icon } style={{ marginRight: "14.66px" }} /> }
|
23 |
label={ settings.block.title }
|
24 |
+
instructions={ [
|
25 |
+
( props.attributes.id && ! props.attributes.exists ) && (
|
26 |
+
<Notice status="warning" isDismissible={ false }>
|
27 |
+
{ __( 'The form previously added has been trashed or deleted.', 'happyforms' ) }
|
28 |
+
</Notice>
|
29 |
+
),
|
30 |
settings.forms.length > 0 ?
|
31 |
__( 'Pick a form to display on your site.', 'happyforms' ) :
|
32 |
__( 'No forms found.', 'happyforms' )
|
33 |
+
] }
|
34 |
className="happyforms-block-form-selector-wrap"
|
35 |
key="happyforms-component-placeholder">
|
36 |
|
106 |
props.attributes.id = String( settings.forms[0].ID );
|
107 |
}
|
108 |
|
109 |
+
props.attributes.exists = settings.forms.find( form => form.ID == props.attributes.id );
|
110 |
+
|
111 |
let blockComponent = (
|
112 |
+
props.attributes.id && props.attributes.exists ?
|
113 |
ComponentForm( props ) :
|
114 |
ComponentPlaceholder( props )
|
115 |
);
|
core/classes/class-form-assets.php
CHANGED
@@ -28,6 +28,7 @@ class HappyForms_Form_Assets {
|
|
28 |
return;
|
29 |
}
|
30 |
|
|
|
31 |
add_action( 'wp_print_footer_scripts', array( $this, 'wp_print_footer_scripts' ), 0 );
|
32 |
add_action( 'elementor/theme/after_do_popup', array( $this, 'elementor_popup_compatibility' ) );
|
33 |
}
|
@@ -68,6 +69,12 @@ class HappyForms_Form_Assets {
|
|
68 |
|
69 |
wp_localize_script( 'happyforms-settings', '_happyFormsSettings', $settings );
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$dependencies = array( 'jquery', 'happyforms-settings' );
|
72 |
|
73 |
if ( ! happyforms_concatenate_scripts() ) {
|
@@ -209,6 +216,18 @@ class HappyForms_Form_Assets {
|
|
209 |
do_action( 'happyforms_print_frontend_styles', $form );
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
public function wp_print_footer_scripts() {
|
213 |
if ( empty( $this->forms ) ) {
|
214 |
return;
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
+
add_filter( 'happyforms_frontend_dependencies', array( $this, 'frontend_dependencies' ) );
|
32 |
add_action( 'wp_print_footer_scripts', array( $this, 'wp_print_footer_scripts' ), 0 );
|
33 |
add_action( 'elementor/theme/after_do_popup', array( $this, 'elementor_popup_compatibility' ) );
|
34 |
}
|
69 |
|
70 |
wp_localize_script( 'happyforms-settings', '_happyFormsSettings', $settings );
|
71 |
|
72 |
+
wp_register_script(
|
73 |
+
'happyforms-md5',
|
74 |
+
happyforms_get_plugin_url() . 'core/assets/js/lib/md5.min.js',
|
75 |
+
array(), happyforms_get_version(), true
|
76 |
+
);
|
77 |
+
|
78 |
$dependencies = array( 'jquery', 'happyforms-settings' );
|
79 |
|
80 |
if ( ! happyforms_concatenate_scripts() ) {
|
216 |
do_action( 'happyforms_print_frontend_styles', $form );
|
217 |
}
|
218 |
|
219 |
+
public function frontend_dependencies( $deps ) {
|
220 |
+
wp_register_script(
|
221 |
+
'happyforms-md5',
|
222 |
+
happyforms_get_plugin_url() . 'core/assets/js/lib/md5.min.js',
|
223 |
+
array(), happyforms_get_version(), true
|
224 |
+
);
|
225 |
+
|
226 |
+
$deps[] = 'happyforms-md5';
|
227 |
+
|
228 |
+
return $deps;
|
229 |
+
}
|
230 |
+
|
231 |
public function wp_print_footer_scripts() {
|
232 |
if ( empty( $this->forms ) ) {
|
233 |
return;
|
core/classes/class-form-controller.php
CHANGED
@@ -439,6 +439,8 @@ class HappyForms_Form_Controller {
|
|
439 |
'post_type' => happyforms_get_form_controller()->post_type,
|
440 |
'post_status' => array( 'publish', 'archive', 'trash' ),
|
441 |
'posts_per_page' => -1,
|
|
|
|
|
442 |
);
|
443 |
|
444 |
$query_params['post__in'] = is_array( $post_ids ) ? $post_ids : array( $post_ids );
|
@@ -768,10 +770,16 @@ class HappyForms_Form_Controller {
|
|
768 |
*
|
769 |
* @return int
|
770 |
*/
|
771 |
-
public function
|
772 |
-
$
|
773 |
|
774 |
-
return $
|
|
|
|
|
|
|
|
|
|
|
|
|
775 |
}
|
776 |
|
777 |
/**
|
439 |
'post_type' => happyforms_get_form_controller()->post_type,
|
440 |
'post_status' => array( 'publish', 'archive', 'trash' ),
|
441 |
'posts_per_page' => -1,
|
442 |
+
'orderby' => 'modified',
|
443 |
+
'order' => 'desc',
|
444 |
);
|
445 |
|
446 |
$query_params['post__in'] = is_array( $post_ids ) ? $post_ids : array( $post_ids );
|
770 |
*
|
771 |
* @return int
|
772 |
*/
|
773 |
+
public function has_honeypot_protection( $form_data ) {
|
774 |
+
$has_honeypot_protection = apply_filters( 'happyforms_use_honeypot', true, $form_data );
|
775 |
|
776 |
+
return $has_honeypot_protection;
|
777 |
+
}
|
778 |
+
|
779 |
+
public function has_hash_protection( $form_data ) {
|
780 |
+
$has_hash_protection = apply_filters( 'happyforms_use_hash_protection', true, $form_data );
|
781 |
+
|
782 |
+
return $has_hash_protection;
|
783 |
}
|
784 |
|
785 |
/**
|
core/classes/class-form-option-limiter.php
CHANGED
@@ -19,13 +19,40 @@ class HappyForms_Form_Option_Limiter {
|
|
19 |
add_filter( 'happyforms_part_options', array( $this, 'get_part_options' ), 10, 3 );
|
20 |
add_action( 'happyforms_submission_success', array( $this, 'submission_success' ), 10, 3 );
|
21 |
add_action( 'happyforms_form_duplicated', array( $this, 'form_duplicated' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
public function get_option_fields() {
|
25 |
$defaults = array(
|
26 |
-
'
|
27 |
-
'limit_submissions_amount' => 1,
|
28 |
-
'show_submissions_amount' => 0,
|
29 |
'submissions_left' => 0,
|
30 |
'submissions_left_label' => '',
|
31 |
);
|
@@ -42,35 +69,30 @@ class HappyForms_Form_Option_Limiter {
|
|
42 |
$options = array_map( function( $option ) use( $option_defaults, $form, $part_id ) {
|
43 |
$option = wp_parse_args( $option, $option_defaults );
|
44 |
|
45 |
-
if (
|
46 |
-
|
47 |
-
$count = $this->count_by_option( $form['ID'], $part_id, $option['id'] );
|
48 |
-
$option['submissions_left'] = $limit - $count;
|
49 |
}
|
50 |
|
51 |
-
|
52 |
-
|
|
|
53 |
|
54 |
-
|
55 |
-
$options = array_map( function( $option ) use( $form ) {
|
56 |
-
if ( 1 == $option['show_submissions_amount'] || ( ( 0 == $option['submissions_left'] ) && ( 1 == $option['limit_submissions'] ) ) ) {
|
57 |
-
$submissions_left_label = $form['submissions_left_label'];
|
58 |
-
|
59 |
-
if ( happyforms_is_preview() ) {
|
60 |
-
$submissions_left_label = sprintf(
|
61 |
-
'<span class="happyforms-submissions-left">%s</span>',
|
62 |
-
$submissions_left_label
|
63 |
-
);
|
64 |
-
}
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
69 |
);
|
70 |
-
|
71 |
-
$option['submissions_left_label'] = $submissions_left;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
return $option;
|
75 |
}, $options );
|
76 |
|
@@ -79,6 +101,7 @@ class HappyForms_Form_Option_Limiter {
|
|
79 |
|
80 |
public function submission_success( $submission, $form, $message ) {
|
81 |
$meta_counters = happyforms_get_meta( $form['ID'], $this->counter_key, true );
|
|
|
82 |
if ( empty( $meta_counters ) ) {
|
83 |
$meta_counters = [];
|
84 |
}
|
@@ -97,7 +120,7 @@ class HappyForms_Form_Option_Limiter {
|
|
97 |
foreach( $part[$options_key] as $o => $option ) {
|
98 |
$option = wp_parse_args( $option, $this->get_option_fields() );
|
99 |
|
100 |
-
if (
|
101 |
continue;
|
102 |
}
|
103 |
|
@@ -199,10 +222,12 @@ class HappyForms_Form_Option_Limiter {
|
|
199 |
foreach( $part[$options_key] as $o => $option ) {
|
200 |
$option = wp_parse_args( $option, $this->get_option_fields() );
|
201 |
|
202 |
-
if (
|
203 |
continue;
|
204 |
}
|
|
|
205 |
$part_name = happyforms_get_part_name( $part, $form );
|
|
|
206 |
if ( ! isset( $parts_with_limits[ $part_name ] ) ) {
|
207 |
$parts_with_limits[ $part_name ] = [
|
208 |
'id' => $part['id'],
|
@@ -238,7 +263,6 @@ class HappyForms_Form_Option_Limiter {
|
|
238 |
}
|
239 |
|
240 |
foreach( $part['options'] as $option_id => $o ) {
|
241 |
-
|
242 |
foreach( $request_value as $submitted_value ) {
|
243 |
if ( ! is_array( $submitted_value ) ) {
|
244 |
$submitted_value = array( $submitted_value );
|
19 |
add_filter( 'happyforms_part_options', array( $this, 'get_part_options' ), 10, 3 );
|
20 |
add_action( 'happyforms_submission_success', array( $this, 'submission_success' ), 10, 3 );
|
21 |
add_action( 'happyforms_form_duplicated', array( $this, 'form_duplicated' ) );
|
22 |
+
add_filter( 'happyforms_get_form_data', array( $this, 'transition_deprecated_limit_submissions' ), 99 );
|
23 |
+
}
|
24 |
+
|
25 |
+
public function transition_deprecated_limit_submissions( $form ) {
|
26 |
+
// Transition to meta-based counters.
|
27 |
+
$this->try_migrate_limit_count_options( $form );
|
28 |
+
|
29 |
+
// Zero-out limits if deprecated limit_submissions control is off.
|
30 |
+
$supported_parts = $this->get_supported_parts();
|
31 |
+
|
32 |
+
foreach( $form['parts'] as $p => $part ) {
|
33 |
+
if ( ! in_array( $part['type'], $supported_parts ) ) {
|
34 |
+
continue;
|
35 |
+
}
|
36 |
+
|
37 |
+
$options_key = 'options';
|
38 |
+
|
39 |
+
if ( 'table' === $part['type'] ) {
|
40 |
+
$options_key = 'columns';
|
41 |
+
}
|
42 |
+
|
43 |
+
foreach( $part[$options_key] as $o => $option ) {
|
44 |
+
if ( isset( $option['limit_submissions'] ) && '' == $option['limit_submissions'] ) {
|
45 |
+
$form['parts'][$p][$options_key][$o]['limit_submissions_amount'] = '';
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
return $form;
|
51 |
}
|
52 |
|
53 |
public function get_option_fields() {
|
54 |
$defaults = array(
|
55 |
+
'limit_submissions_amount' => '',
|
|
|
|
|
56 |
'submissions_left' => 0,
|
57 |
'submissions_left_label' => '',
|
58 |
);
|
69 |
$options = array_map( function( $option ) use( $option_defaults, $form, $part_id ) {
|
70 |
$option = wp_parse_args( $option, $option_defaults );
|
71 |
|
72 |
+
if ( '' == $option['limit_submissions_amount'] || $option['limit_submissions_amount'] < 0 ) {
|
73 |
+
return $option;
|
|
|
|
|
74 |
}
|
75 |
|
76 |
+
$limit = intval( $option['limit_submissions_amount'] );
|
77 |
+
$count = $this->count_by_option( $form['ID'], $part_id, $option['id'] );
|
78 |
+
$option['submissions_left'] = $limit - $count;
|
79 |
|
80 |
+
$submissions_left_label = $form['submissions_left_label'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
+
if ( happyforms_is_preview() ) {
|
83 |
+
$submissions_left_label = sprintf(
|
84 |
+
'<span class="happyforms-submissions-left">%s</span>',
|
85 |
+
$submissions_left_label
|
86 |
);
|
|
|
|
|
87 |
}
|
88 |
|
89 |
+
$submissions_left = sprintf(
|
90 |
+
' <span class="happyforms-remaining-choice">(%1$s %2$s)</span>',
|
91 |
+
$option['submissions_left'], $submissions_left_label
|
92 |
+
);
|
93 |
+
|
94 |
+
$option['submissions_left_label'] = $submissions_left;
|
95 |
+
|
96 |
return $option;
|
97 |
}, $options );
|
98 |
|
101 |
|
102 |
public function submission_success( $submission, $form, $message ) {
|
103 |
$meta_counters = happyforms_get_meta( $form['ID'], $this->counter_key, true );
|
104 |
+
|
105 |
if ( empty( $meta_counters ) ) {
|
106 |
$meta_counters = [];
|
107 |
}
|
120 |
foreach( $part[$options_key] as $o => $option ) {
|
121 |
$option = wp_parse_args( $option, $this->get_option_fields() );
|
122 |
|
123 |
+
if ( '' == $option['limit_submissions_amount'] ) {
|
124 |
continue;
|
125 |
}
|
126 |
|
222 |
foreach( $part[$options_key] as $o => $option ) {
|
223 |
$option = wp_parse_args( $option, $this->get_option_fields() );
|
224 |
|
225 |
+
if ( '' == $option['limit_submissions_amount'] ) {
|
226 |
continue;
|
227 |
}
|
228 |
+
|
229 |
$part_name = happyforms_get_part_name( $part, $form );
|
230 |
+
|
231 |
if ( ! isset( $parts_with_limits[ $part_name ] ) ) {
|
232 |
$parts_with_limits[ $part_name ] = [
|
233 |
'id' => $part['id'],
|
263 |
}
|
264 |
|
265 |
foreach( $part['options'] as $option_id => $o ) {
|
|
|
266 |
foreach( $request_value as $submitted_value ) {
|
267 |
if ( ! is_array( $submitted_value ) ) {
|
268 |
$submitted_value = array( $submitted_value );
|
core/classes/class-form-shuffle.php
CHANGED
@@ -100,12 +100,29 @@ class HappyForms_Form_Shuffle_Parts {
|
|
100 |
return $options;
|
101 |
}
|
102 |
|
103 |
-
$
|
104 |
-
|
105 |
-
$
|
106 |
|
107 |
-
foreach ( $
|
108 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
$options = $shuffled;
|
100 |
return $options;
|
101 |
}
|
102 |
|
103 |
+
$shuffled = [];
|
104 |
+
$option_groups = [];
|
105 |
+
$current_group_key = '';
|
106 |
|
107 |
+
foreach ( $options as $key => $option ) {
|
108 |
+
if ( isset( $option['is_heading'] ) && happyforms_is_truthy( $option['is_heading'] ) ) {
|
109 |
+
$current_group_key = $key;
|
110 |
+
continue;
|
111 |
+
}
|
112 |
+
|
113 |
+
$option_groups[ $current_group_key ][] = $key;
|
114 |
+
}
|
115 |
+
|
116 |
+
foreach ( $option_groups as $group_key => $options_keys ) {
|
117 |
+
if ( '' !== $group_key ) {
|
118 |
+
$shuffled[ $group_key ] = $options[ $group_key ];
|
119 |
+
}
|
120 |
+
|
121 |
+
shuffle( $options_keys );
|
122 |
+
|
123 |
+
foreach ( $options_keys as $key ) {
|
124 |
+
$shuffled[ $key ] = $options[ $key ];
|
125 |
+
}
|
126 |
}
|
127 |
|
128 |
$options = $shuffled;
|
core/classes/parts/class-part-checkbox.php
CHANGED
@@ -116,7 +116,8 @@ class HappyForms_Part_Checkbox extends HappyForms_Form_Part {
|
|
116 |
return array(
|
117 |
'is_default' => 0,
|
118 |
'label' => '',
|
119 |
-
'description' => ''
|
|
|
120 |
);
|
121 |
}
|
122 |
|
@@ -241,7 +242,7 @@ class HappyForms_Part_Checkbox extends HappyForms_Form_Part {
|
|
241 |
return $validated_value;
|
242 |
}
|
243 |
|
244 |
-
if ( 1 === $part['limit_choices'] ) {
|
245 |
if ( count( $validated_value ) < $part['limit_choices_min'] ) {
|
246 |
return new WP_Error( 'error', happyforms_get_validation_message( 'select_more_choices' ) );
|
247 |
}
|
@@ -390,7 +391,7 @@ class HappyForms_Part_Checkbox extends HappyForms_Form_Part {
|
|
390 |
foreach( $part['options'] as $o => $option ) {
|
391 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
392 |
|
393 |
-
if (
|
394 |
continue;
|
395 |
}
|
396 |
|
116 |
return array(
|
117 |
'is_default' => 0,
|
118 |
'label' => '',
|
119 |
+
'description' => '',
|
120 |
+
'is_heading' => 0
|
121 |
);
|
122 |
}
|
123 |
|
242 |
return $validated_value;
|
243 |
}
|
244 |
|
245 |
+
if ( ! empty( $validated_value ) && 1 === $part['limit_choices'] ) {
|
246 |
if ( count( $validated_value ) < $part['limit_choices_min'] ) {
|
247 |
return new WP_Error( 'error', happyforms_get_validation_message( 'select_more_choices' ) );
|
248 |
}
|
391 |
foreach( $part['options'] as $o => $option ) {
|
392 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
393 |
|
394 |
+
if ( '' == $option['limit_submissions_amount'] || $o !== intval( $value ) || $value !== $o ) {
|
395 |
continue;
|
396 |
}
|
397 |
|
core/classes/parts/class-part-number.php
CHANGED
@@ -60,12 +60,12 @@ class HappyForms_Part_Number extends HappyForms_Form_Part {
|
|
60 |
'sanitize' => 'sanitize_text_field'
|
61 |
),
|
62 |
'min_value' => array(
|
63 |
-
'default' =>
|
64 |
-
'sanitize' => '
|
65 |
),
|
66 |
'max_value' => array(
|
67 |
-
'default' =>
|
68 |
-
'sanitize' => '
|
69 |
),
|
70 |
'step' => array(
|
71 |
'default' => 1,
|
@@ -123,6 +123,10 @@ class HappyForms_Part_Number extends HappyForms_Form_Part {
|
|
123 |
return $part_data;
|
124 |
}
|
125 |
|
|
|
|
|
|
|
|
|
126 |
$min_value = $part_data['min_value'];
|
127 |
$max_value = $part_data['max_value'];
|
128 |
|
@@ -220,6 +224,10 @@ class HappyForms_Part_Number extends HappyForms_Form_Part {
|
|
220 |
return $error;
|
221 |
}
|
222 |
|
|
|
|
|
|
|
|
|
223 |
$validation_number = $validated_values;
|
224 |
|
225 |
if ( $part['masked'] ) {
|
@@ -231,13 +239,21 @@ class HappyForms_Part_Number extends HappyForms_Form_Part {
|
|
231 |
|
232 |
// Bounds check
|
233 |
$validation_number = floatval( $validation_number );
|
234 |
-
$min_value = intval( $part['min_value'] );
|
235 |
-
$max_value = intval( $part['max_value'] );
|
236 |
|
237 |
-
if (
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
|
243 |
return $validated_values;
|
60 |
'sanitize' => 'sanitize_text_field'
|
61 |
),
|
62 |
'min_value' => array(
|
63 |
+
'default' => '',
|
64 |
+
'sanitize' => 'happyforms_sanitize_intval_empty'
|
65 |
),
|
66 |
'max_value' => array(
|
67 |
+
'default' => '',
|
68 |
+
'sanitize' => 'happyforms_sanitize_intval_empty'
|
69 |
),
|
70 |
'step' => array(
|
71 |
'default' => 1,
|
123 |
return $part_data;
|
124 |
}
|
125 |
|
126 |
+
if ( '' === $part_data['min_value'] || '' === $part_data['max_value'] ) {
|
127 |
+
return $part_data;
|
128 |
+
}
|
129 |
+
|
130 |
$min_value = $part_data['min_value'];
|
131 |
$max_value = $part_data['max_value'];
|
132 |
|
224 |
return $error;
|
225 |
}
|
226 |
|
227 |
+
if ( '' === $validated_values ) {
|
228 |
+
return $validated_values;
|
229 |
+
}
|
230 |
+
|
231 |
$validation_number = $validated_values;
|
232 |
|
233 |
if ( $part['masked'] ) {
|
239 |
|
240 |
// Bounds check
|
241 |
$validation_number = floatval( $validation_number );
|
|
|
|
|
242 |
|
243 |
+
if ( '' !== $part['min_value'] ) {
|
244 |
+
$min_value = intval( $part['min_value'] );
|
245 |
+
|
246 |
+
if ( $validation_number < $min_value ) {
|
247 |
+
return new WP_Error( 'error', happyforms_get_validation_message( 'number_min_invalid' ) );
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
if ( '' !== $part['max_value'] ) {
|
252 |
+
$max_value = intval( $part['max_value'] );
|
253 |
+
|
254 |
+
if ( $validation_number > $max_value ) {
|
255 |
+
return new WP_Error( 'error', happyforms_get_validation_message( 'number_max_invalid' ) );
|
256 |
+
}
|
257 |
}
|
258 |
|
259 |
return $validated_values;
|
core/classes/parts/class-part-radio.php
CHANGED
@@ -102,7 +102,8 @@ class HappyForms_Part_Radio extends HappyForms_Form_Part {
|
|
102 |
return array(
|
103 |
'is_default' => 0,
|
104 |
'label' => '',
|
105 |
-
'description' => ''
|
|
|
106 |
);
|
107 |
}
|
108 |
|
@@ -251,7 +252,7 @@ class HappyForms_Part_Radio extends HappyForms_Form_Part {
|
|
251 |
foreach( $part['options'] as $o => $option ) {
|
252 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
253 |
|
254 |
-
if (
|
255 |
continue;
|
256 |
}
|
257 |
|
102 |
return array(
|
103 |
'is_default' => 0,
|
104 |
'label' => '',
|
105 |
+
'description' => '',
|
106 |
+
'is_heading' => 0
|
107 |
);
|
108 |
}
|
109 |
|
252 |
foreach( $part['options'] as $o => $option ) {
|
253 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
254 |
|
255 |
+
if ( '' == $option['limit_submissions_amount'] || $o !== intval( $value ) || $value !== $o ) {
|
256 |
continue;
|
257 |
}
|
258 |
|
core/classes/parts/class-part-select.php
CHANGED
@@ -99,7 +99,8 @@ class HappyForms_Part_Select extends HappyForms_Form_Part {
|
|
99 |
protected function get_option_defaults() {
|
100 |
return array(
|
101 |
'is_default' => 0,
|
102 |
-
'label' => ''
|
|
|
103 |
);
|
104 |
}
|
105 |
|
@@ -264,7 +265,7 @@ class HappyForms_Part_Select extends HappyForms_Form_Part {
|
|
264 |
foreach( $part['options'] as $o => $option ) {
|
265 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
266 |
|
267 |
-
if (
|
268 |
continue;
|
269 |
}
|
270 |
|
@@ -305,7 +306,7 @@ class HappyForms_Part_Select extends HappyForms_Form_Part {
|
|
305 |
$options = array_filter( $options, function( $option ) use( $part, $form ) {
|
306 |
$option = wp_parse_args( $option, $this->get_option_defaults() );
|
307 |
|
308 |
-
if (
|
309 |
return true;
|
310 |
}
|
311 |
|
99 |
protected function get_option_defaults() {
|
100 |
return array(
|
101 |
'is_default' => 0,
|
102 |
+
'label' => '',
|
103 |
+
'is_heading' => 0
|
104 |
);
|
105 |
}
|
106 |
|
265 |
foreach( $part['options'] as $o => $option ) {
|
266 |
$option = wp_parse_args( $option, happyforms_upgrade_get_option_limiter()->get_option_fields() );
|
267 |
|
268 |
+
if ( '' == $option['limit_submissions_amount'] || $o !== intval( $value ) || $value !== $o ) {
|
269 |
continue;
|
270 |
}
|
271 |
|
306 |
$options = array_filter( $options, function( $option ) use( $part, $form ) {
|
307 |
$option = wp_parse_args( $option, $this->get_option_defaults() );
|
308 |
|
309 |
+
if ( '' == $option['limit_submissions_amount'] ) {
|
310 |
return true;
|
311 |
}
|
312 |
|
core/helpers/helper-form-templates.php
CHANGED
@@ -42,7 +42,7 @@ function happyforms_honeypot( $form ) {
|
|
42 |
$key = array_rand( $names, 1 );
|
43 |
$name = $names[$key];
|
44 |
|
45 |
-
if ( $controller->
|
46 |
<input type="text" name="<?php echo $form['ID']; ?>-<?php echo $name; ?>" style="position:absolute;left:-5000px;" tabindex="-1" autocomplete="off"> <span class="screen-reader-text"><?php _e( 'Leave this field blank', 'happyforms' ); ?></span>
|
47 |
<?php endif;
|
48 |
}
|
42 |
$key = array_rand( $names, 1 );
|
43 |
$name = $names[$key];
|
44 |
|
45 |
+
if ( $controller->has_honeypot_protection( $form ) ) : ?>
|
46 |
<input type="text" name="<?php echo $form['ID']; ?>-<?php echo $name; ?>" style="position:absolute;left:-5000px;" tabindex="-1" autocomplete="off"> <span class="screen-reader-text"><?php _e( 'Leave this field blank', 'happyforms' ); ?></span>
|
47 |
<?php endif;
|
48 |
}
|
core/helpers/helper-misc.php
CHANGED
@@ -1053,4 +1053,14 @@ function happyforms_concatenate_scripts() {
|
|
1053 |
return $concatenate;
|
1054 |
}
|
1055 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1056 |
endif;
|
1053 |
return $concatenate;
|
1054 |
}
|
1055 |
|
1056 |
+
endif;
|
1057 |
+
|
1058 |
+
if ( ! function_exists( 'happyforms_is_spambot' ) ) :
|
1059 |
+
|
1060 |
+
function happyforms_is_spambot() {
|
1061 |
+
$is_spambot = ( defined( 'HAPPYFORMS_IS_SPAMBOT' ) && HAPPYFORMS_IS_SPAMBOT );
|
1062 |
+
|
1063 |
+
return $is_spambot;
|
1064 |
+
}
|
1065 |
+
|
1066 |
endif;
|
core/helpers/helper-validation.php
CHANGED
@@ -166,4 +166,20 @@ function happyforms_sanitize_list( $value, $choices = array() ) {
|
|
166 |
return $value;
|
167 |
}
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
endif;
|
166 |
return $value;
|
167 |
}
|
168 |
|
169 |
+
endif;
|
170 |
+
|
171 |
+
if ( ! function_exists( 'happyforms_sanitize_intval_empty' ) ):
|
172 |
+
|
173 |
+
function happyforms_sanitize_intval_empty( $value ) {
|
174 |
+
$value = trim( $value );
|
175 |
+
|
176 |
+
if ( '' == $value ) {
|
177 |
+
return $value;
|
178 |
+
}
|
179 |
+
|
180 |
+
$value = intval( $value );
|
181 |
+
|
182 |
+
return $value;
|
183 |
+
}
|
184 |
+
|
185 |
endif;
|
core/templates/partials/happyforms-select.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<ul class="happyforms-custom-select-dropdown">
|
2 |
<li class="happyforms-custom-select-dropdown__placeholder" data-value="" data-label=""><?php echo $placeholder_value; ?></li>
|
3 |
<?php foreach ( $options as $index => $option ) : ?>
|
4 |
-
<li <?php echo ( isset( $option['id'] ) ) ? 'data-option-id="'. esc_attr( $option['id'] ) .'" ' : ''; ?>data-value="<?php echo ( isset( $option['value'] ) ) ? $option['value'] : $index; ?>" data-label="<?php echo esc_attr( $option['label'] ); ?>" class="happyforms-dropdown-item happyforms-custom-select-dropdown__item" <?php echo ( empty( $option['submissions_left'] ) &&
|
5 |
<?php endforeach; ?>
|
6 |
<?php if ( count( $options ) > 5 ) : ?>
|
7 |
<li class="happyforms-custom-select-dropdown__not-found"><?php echo esc_attr( $form['no_results_label'] ); ?></li>
|
1 |
<ul class="happyforms-custom-select-dropdown">
|
2 |
<li class="happyforms-custom-select-dropdown__placeholder" data-value="" data-label=""><?php echo $placeholder_value; ?></li>
|
3 |
<?php foreach ( $options as $index => $option ) : ?>
|
4 |
+
<li <?php echo ( isset( $option['id'] ) ) ? 'data-option-id="'. esc_attr( $option['id'] ) .'" ' : ''; ?>data-value="<?php echo ( isset( $option['value'] ) ) ? $option['value'] : $index; ?>" data-label="<?php echo esc_attr( $option['label'] ); ?>" class="happyforms-dropdown-item happyforms-custom-select-dropdown__item" <?php echo ( empty( $option['submissions_left'] ) && '' != $option['limit_submissions_amount'] ) ? 'data-select-disabled="1"' : ''; ?>><?php echo esc_attr( $option['label'] ); ?> <?php echo ( isset( $option['submissions_left_label'] ) ) ? $option['submissions_left_label'] : ''; ?></li>
|
5 |
<?php endforeach; ?>
|
6 |
<?php if ( count( $options ) > 5 ) : ?>
|
7 |
<li class="happyforms-custom-select-dropdown__not-found"><?php echo esc_attr( $form['no_results_label'] ); ?></li>
|
core/templates/parts/customize-checkbox.php
CHANGED
@@ -33,7 +33,8 @@
|
|
33 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
34 |
</div>
|
35 |
<p class="links mode-manual">
|
36 |
-
<a href="#" class="button add-
|
|
|
37 |
<span class="centered">
|
38 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
39 |
</span>
|
@@ -44,11 +45,6 @@
|
|
44 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
45 |
</span>
|
46 |
</p>
|
47 |
-
<p>
|
48 |
-
<label>
|
49 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
50 |
-
</label>
|
51 |
-
</p>
|
52 |
|
53 |
<?php do_action( 'happyforms_part_customize_checkbox_after_options' ); ?>
|
54 |
|
@@ -104,7 +100,12 @@
|
|
104 |
</label>
|
105 |
</span>
|
106 |
</p>
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
108 |
<?php happyforms_customize_part_width_control(); ?>
|
109 |
|
110 |
<?php do_action( 'happyforms_part_customize_checkbox_after_advanced_options' ); ?>
|
@@ -135,21 +136,13 @@
|
|
135 |
<?php _e( 'Hint', 'happyforms' ); ?>:
|
136 |
<textarea name="description" data-option-attribute="description"><%= description %></textarea>
|
137 |
</label><br>
|
|
|
|
|
|
|
|
|
138 |
<label>
|
139 |
<input type="checkbox" name="is_default" value="1" <% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
140 |
</label><br>
|
141 |
-
<label>
|
142 |
-
<input type="checkbox" name="limit_submissions" value="1" class="default-option-switch"<% if ( typeof limit_submissions !== 'undefined' && limit_submissions == 1) { %> checked="checked"<% } %>> <?php _e( 'Limit how many times this choice can be submitted', 'happyforms' ); ?>
|
143 |
-
</label>
|
144 |
-
<div class="happyforms-nested-settings happyforms-part-item-limit-submission-settings" <% if ( typeof limit_submissions === 'undefined' || limit_submissions != 1 ) { %>style="display: none;"<% } %>>
|
145 |
-
<label>
|
146 |
-
<?php _e( 'Max submissions', 'happyforms' ); ?>:
|
147 |
-
<input type="number" class="widefat" name="limit_submissions_amount" min="1" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '1' %>">
|
148 |
-
</label>
|
149 |
-
<label>
|
150 |
-
<input type="checkbox" name="show_submissions_amount" class="" <% if ( typeof show_submissions_amount !== 'undefined' && show_submissions_amount == 1) { %> checked="checked"<% } %>> <?php _e( 'Show respondents how many remain', 'happyforms' ); ?>
|
151 |
-
</label><br>
|
152 |
-
</div>
|
153 |
</div>
|
154 |
<div class="option-actions">
|
155 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
@@ -158,3 +151,17 @@
|
|
158 |
</div>
|
159 |
</li>
|
160 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
34 |
</div>
|
35 |
<p class="links mode-manual">
|
36 |
+
<a href="#" class="button add-heading"><?php _e( 'Add heading', 'happyforms' ); ?></a>
|
37 |
+
<a href="#" class="button add-option centered"><?php _e( 'Add choice', 'happyforms' ); ?></a>
|
38 |
<span class="centered">
|
39 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
40 |
</span>
|
45 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
46 |
</span>
|
47 |
</p>
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
<?php do_action( 'happyforms_part_customize_checkbox_after_options' ); ?>
|
50 |
|
100 |
</label>
|
101 |
</span>
|
102 |
</p>
|
103 |
+
<p>
|
104 |
+
<label>
|
105 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
106 |
+
</label>
|
107 |
+
</p>
|
108 |
+
|
109 |
<?php happyforms_customize_part_width_control(); ?>
|
110 |
|
111 |
<?php do_action( 'happyforms_part_customize_checkbox_after_advanced_options' ); ?>
|
136 |
<?php _e( 'Hint', 'happyforms' ); ?>:
|
137 |
<textarea name="description" data-option-attribute="description"><%= description %></textarea>
|
138 |
</label><br>
|
139 |
+
<label>
|
140 |
+
<?php _e( 'Max submissions', 'happyforms' ); ?>:
|
141 |
+
<input type="number" class="widefat" name="limit_submissions_amount" min="0" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '' %>">
|
142 |
+
</label>
|
143 |
<label>
|
144 |
<input type="checkbox" name="is_default" value="1" <% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
145 |
</label><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
</div>
|
147 |
<div class="option-actions">
|
148 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
151 |
</div>
|
152 |
</li>
|
153 |
</script>
|
154 |
+
<script type="text/template" id="customize-happyforms-checkbox-item-heading-template">
|
155 |
+
<li data-option-id="<%= id %>" data-is-heading="yes">
|
156 |
+
<div class="happyforms-part-item-body">
|
157 |
+
<div class="happyforms-part-item-handle"></div>
|
158 |
+
<label>
|
159 |
+
<?php _e( 'Heading', 'happyforms' ); ?>:
|
160 |
+
<input type="text" class="widefat" name="label" value="<%= label %>">
|
161 |
+
</label>
|
162 |
+
<div class="option-actions">
|
163 |
+
<a href="#" class="delete-heading"><?php _e( 'Delete', 'happyforms' ); ?></a>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
</li>
|
167 |
+
</script>
|
core/templates/parts/customize-email.php
CHANGED
@@ -31,12 +31,6 @@
|
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_email_before_options' ); ?>
|
33 |
|
34 |
-
<p>
|
35 |
-
<label>
|
36 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
37 |
-
</label>
|
38 |
-
</p>
|
39 |
-
|
40 |
<?php do_action( 'happyforms_part_customize_email_after_options' ); ?>
|
41 |
|
42 |
<?php do_action( 'happyforms_part_customize_email_before_advanced_options' ); ?>
|
@@ -49,6 +43,11 @@
|
|
49 |
<label for="<%= instance.id %>_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
50 |
<input type="text" id="<%= instance.id %>_suffix" class="widefat title" value="<%= instance.suffix %>" data-bind="suffix" maxlength="50" />
|
51 |
</p>
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
<?php happyforms_customize_part_width_control(); ?>
|
54 |
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_email_before_options' ); ?>
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<?php do_action( 'happyforms_part_customize_email_after_options' ); ?>
|
35 |
|
36 |
<?php do_action( 'happyforms_part_customize_email_before_advanced_options' ); ?>
|
43 |
<label for="<%= instance.id %>_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
44 |
<input type="text" id="<%= instance.id %>_suffix" class="widefat title" value="<%= instance.suffix %>" data-bind="suffix" maxlength="50" />
|
45 |
</p>
|
46 |
+
<p>
|
47 |
+
<label>
|
48 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
49 |
+
</label>
|
50 |
+
</p>
|
51 |
|
52 |
<?php happyforms_customize_part_width_control(); ?>
|
53 |
|
core/templates/parts/customize-multi-line-text.php
CHANGED
@@ -31,12 +31,6 @@
|
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_multi_line_text_before_options' ); ?>
|
33 |
|
34 |
-
<p>
|
35 |
-
<label>
|
36 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
37 |
-
</label>
|
38 |
-
</p>
|
39 |
-
|
40 |
<?php do_action( 'happyforms_part_customize_multi_line_text_after_options' ); ?>
|
41 |
|
42 |
<?php do_action( 'happyforms_part_customize_multi_line_text_before_advanced_options' ); ?>
|
@@ -62,7 +56,12 @@
|
|
62 |
</select>
|
63 |
</p>
|
64 |
</div>
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
66 |
<?php happyforms_customize_part_width_control(); ?>
|
67 |
|
68 |
<?php do_action( 'happyforms_part_customize_multi_line_text_after_advanced_options' ); ?>
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_multi_line_text_before_options' ); ?>
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<?php do_action( 'happyforms_part_customize_multi_line_text_after_options' ); ?>
|
35 |
|
36 |
<?php do_action( 'happyforms_part_customize_multi_line_text_before_advanced_options' ); ?>
|
56 |
</select>
|
57 |
</p>
|
58 |
</div>
|
59 |
+
<p>
|
60 |
+
<label>
|
61 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
62 |
+
</label>
|
63 |
+
</p>
|
64 |
+
|
65 |
<?php happyforms_customize_part_width_control(); ?>
|
66 |
|
67 |
<?php do_action( 'happyforms_part_customize_multi_line_text_after_advanced_options' ); ?>
|
core/templates/parts/customize-number.php
CHANGED
@@ -31,24 +31,17 @@
|
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_number_before_options' ); ?>
|
33 |
|
34 |
-
<div class="min-max-wrapper">
|
35 |
-
<p>
|
36 |
-
<label for="<%= instance.id %>_min_value"><?php _e( 'Min number', 'happyforms' ); ?></label>
|
37 |
-
<input type="number" id="<%= instance.id %>_min_value" class="widefat title" value="<%= instance.min_value %>" data-bind="min_value" />
|
38 |
-
</p>
|
39 |
-
<p>
|
40 |
-
<label for="<%= instance.id %>_max_value"><?php _e( 'Max number', 'happyforms' ); ?></label>
|
41 |
-
<input type="number" id="<%= instance.id %>_max_value" class="widefat title" value="<%= instance.max_value %>" data-bind="max_value" />
|
42 |
-
</p>
|
43 |
-
</div>
|
44 |
<p>
|
45 |
-
<label for="<%= instance.id %>
|
46 |
-
<input type="number" id="<%= instance.id %>
|
47 |
</p>
|
48 |
<p>
|
49 |
-
<label>
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
52 |
</p>
|
53 |
|
54 |
<?php do_action( 'happyforms_part_customize_number_after_options' ); ?>
|
@@ -78,6 +71,11 @@
|
|
78 |
<label for="<%= instance.id %>_mask_numeric_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
79 |
<input type="text" id="<%= instance.id %>_mask_numeric_suffix" class="widefat title" value="<%= instance.mask_numeric_suffix %>" data-bind="mask_numeric_suffix" maxlength="50" />
|
80 |
</p>
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
<?php happyforms_customize_part_width_control(); ?>
|
83 |
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_number_before_options' ); ?>
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<p>
|
35 |
+
<label for="<%= instance.id %>_min_value"><?php _e( 'Min number', 'happyforms' ); ?></label>
|
36 |
+
<input type="number" id="<%= instance.id %>_min_value" class="widefat title" value="<%= instance.min_value %>" data-bind="min_value" />
|
37 |
</p>
|
38 |
<p>
|
39 |
+
<label for="<%= instance.id %>_max_value"><?php _e( 'Max number', 'happyforms' ); ?></label>
|
40 |
+
<input type="number" id="<%= instance.id %>_max_value" class="widefat title" value="<%= instance.max_value %>" data-bind="max_value" />
|
41 |
+
</p>
|
42 |
+
<p>
|
43 |
+
<label for="<%= instance.id %>_step"><?php _e( 'Step Interval', 'happyforms' ); ?></label>
|
44 |
+
<input type="number" id="<%= instance.id %>_step" class="widefat title" value="<%= instance.step %>" data-bind="step" />
|
45 |
</p>
|
46 |
|
47 |
<?php do_action( 'happyforms_part_customize_number_after_options' ); ?>
|
71 |
<label for="<%= instance.id %>_mask_numeric_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
72 |
<input type="text" id="<%= instance.id %>_mask_numeric_suffix" class="widefat title" value="<%= instance.mask_numeric_suffix %>" data-bind="mask_numeric_suffix" maxlength="50" />
|
73 |
</p>
|
74 |
+
<p>
|
75 |
+
<label>
|
76 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
77 |
+
</label>
|
78 |
+
</p>
|
79 |
|
80 |
<?php happyforms_customize_part_width_control(); ?>
|
81 |
|
core/templates/parts/customize-radio.php
CHANGED
@@ -33,7 +33,8 @@
|
|
33 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
34 |
</div>
|
35 |
<p class="links mode-manual">
|
36 |
-
<a href="#" class="button add-
|
|
|
37 |
<span class="centered">
|
38 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
39 |
</span>
|
@@ -44,11 +45,6 @@
|
|
44 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
45 |
</span>
|
46 |
</p>
|
47 |
-
<p>
|
48 |
-
<label>
|
49 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
50 |
-
</label>
|
51 |
-
</p>
|
52 |
|
53 |
<?php do_action( 'happyforms_part_customize_radio_after_options' ); ?>
|
54 |
|
@@ -89,6 +85,11 @@
|
|
89 |
</label>
|
90 |
</span>
|
91 |
</p>
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
<?php happyforms_customize_part_width_control(); ?>
|
94 |
|
@@ -120,21 +121,13 @@
|
|
120 |
<?php _e( 'Hint', 'happyforms' ); ?>:
|
121 |
<textarea name="description" data-option-attribute="description"><%= description %></textarea>
|
122 |
</label><br>
|
|
|
|
|
|
|
|
|
123 |
<label>
|
124 |
<input type="checkbox" name="is_default" value="1" class="default-option-switch"<% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
125 |
</label><br>
|
126 |
-
<label>
|
127 |
-
<input type="checkbox" name="limit_submissions" value="1" class="default-option-switch"<% if ( typeof limit_submissions !== 'undefined' && limit_submissions == 1) { %> checked="checked"<% } %>> <?php _e( 'Limit how many times this choice can be submitted', 'happyforms' ); ?>
|
128 |
-
</label>
|
129 |
-
<div class="happyforms-nested-settings happyforms-part-item-limit-submission-settings" <% if ( typeof limit_submissions === 'undefined' || limit_submissions != 1 ) { %>style="display: none;"<% } %>>
|
130 |
-
<label>
|
131 |
-
<?php _e( 'Max submissions', 'happyforms' ); ?>:
|
132 |
-
<input type="number" class="widefat" name="limit_submissions_amount" min="1" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '1' %>">
|
133 |
-
</label>
|
134 |
-
<label>
|
135 |
-
<input type="checkbox" name="show_submissions_amount" class="" <% if ( typeof show_submissions_amount !== 'undefined' && show_submissions_amount == 1) { %> checked="checked"<% } %>> <?php _e( 'Show respondents how many remain', 'happyforms' ); ?>
|
136 |
-
</label><br>
|
137 |
-
</div>
|
138 |
</div>
|
139 |
<div class="option-actions">
|
140 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
@@ -143,3 +136,17 @@
|
|
143 |
</div>
|
144 |
</li>
|
145 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
34 |
</div>
|
35 |
<p class="links mode-manual">
|
36 |
+
<a href="#" class="button add-heading"><?php _e( 'Add heading', 'happyforms' ); ?></a>
|
37 |
+
<a href="#" class="button add-option centered"><?php _e( 'Add choice', 'happyforms' ); ?></a>
|
38 |
<span class="centered">
|
39 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
40 |
</span>
|
45 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
46 |
</span>
|
47 |
</p>
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
<?php do_action( 'happyforms_part_customize_radio_after_options' ); ?>
|
50 |
|
85 |
</label>
|
86 |
</span>
|
87 |
</p>
|
88 |
+
<p>
|
89 |
+
<label>
|
90 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
91 |
+
</label>
|
92 |
+
</p>
|
93 |
|
94 |
<?php happyforms_customize_part_width_control(); ?>
|
95 |
|
121 |
<?php _e( 'Hint', 'happyforms' ); ?>:
|
122 |
<textarea name="description" data-option-attribute="description"><%= description %></textarea>
|
123 |
</label><br>
|
124 |
+
<label>
|
125 |
+
<?php _e( 'Max number of submissions', 'happyforms' ); ?>:
|
126 |
+
<input type="number" class="widefat" name="limit_submissions_amount" min="0" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '' %>">
|
127 |
+
</label>
|
128 |
<label>
|
129 |
<input type="checkbox" name="is_default" value="1" class="default-option-switch"<% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
130 |
</label><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</div>
|
132 |
<div class="option-actions">
|
133 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
136 |
</div>
|
137 |
</li>
|
138 |
</script>
|
139 |
+
<script type="text/template" id="customize-happyforms-radio-item-heading-template">
|
140 |
+
<li data-option-id="<%= id %>" data-is-heading="yes">
|
141 |
+
<div class="happyforms-part-item-body">
|
142 |
+
<div class="happyforms-part-item-handle"></div>
|
143 |
+
<label>
|
144 |
+
<?php _e( 'Heading', 'happyforms' ); ?>:
|
145 |
+
<input type="text" class="widefat" name="label" value="<%= label %>">
|
146 |
+
</label>
|
147 |
+
<div class="option-actions">
|
148 |
+
<a href="#" class="delete-heading"><?php _e( 'Delete', 'happyforms' ); ?></a>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
</li>
|
152 |
+
</script>
|
core/templates/parts/customize-select.php
CHANGED
@@ -37,7 +37,8 @@
|
|
37 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
38 |
</div>
|
39 |
<p class="links mode-manual">
|
40 |
-
<a href="#" class="button add-
|
|
|
41 |
<span class="centered">
|
42 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
43 |
</span>
|
@@ -48,11 +49,6 @@
|
|
48 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
49 |
</span>
|
50 |
</p>
|
51 |
-
<p>
|
52 |
-
<label>
|
53 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
54 |
-
</label>
|
55 |
-
</p>
|
56 |
|
57 |
<% if ( instance.other_option ) { %>
|
58 |
<p>
|
@@ -82,7 +78,11 @@
|
|
82 |
<input type="checkbox" class="checkbox" value="1" <% if ( instance.shuffle_options ) { %>checked="checked"<% } %> data-bind="shuffle_options" /> <?php _e( 'Shuffle order of choices', 'happyforms' ); ?>
|
83 |
</label>
|
84 |
</p>
|
85 |
-
|
|
|
|
|
|
|
|
|
86 |
<?php happyforms_customize_part_width_control(); ?>
|
87 |
|
88 |
<p>
|
@@ -109,21 +109,13 @@
|
|
109 |
<input type="text" class="widefat" name="label" value="<%= label %>" data-option-attribute="label">
|
110 |
</label>
|
111 |
<div class="happyforms-part-item-advanced">
|
|
|
|
|
|
|
|
|
112 |
<label>
|
113 |
<input type="checkbox" name="is_default" value="1" class="default-option-switch"<% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
114 |
</label><br>
|
115 |
-
<label>
|
116 |
-
<input type="checkbox" name="limit_submissions" value="1" class="default-option-switch"<% if ( typeof limit_submissions !== 'undefined' && limit_submissions == 1) { %> checked="checked"<% } %>> <?php _e( 'Limit how many times this choice can be submitted', 'happyforms' ); ?>
|
117 |
-
</label>
|
118 |
-
<div class="happyforms-nested-settings happyforms-part-item-limit-submission-settings" <% if ( typeof limit_submissions === 'undefined' || limit_submissions != 1 ) { %>style="display: none;"<% } %>>
|
119 |
-
<label>
|
120 |
-
<?php _e( 'Max submissions', 'happyforms' ); ?>:
|
121 |
-
<input type="number" class="widefat" name="limit_submissions_amount" min="1" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '1' %>">
|
122 |
-
</label>
|
123 |
-
<label>
|
124 |
-
<input type="checkbox" name="show_submissions_amount" class="" <% if ( typeof show_submissions_amount !== 'undefined' && show_submissions_amount == 1) { %> checked="checked"<% } %>> <?php _e( 'Show respondents how many remain', 'happyforms' ); ?>
|
125 |
-
</label><br>
|
126 |
-
</div>
|
127 |
</div>
|
128 |
<div class="option-actions">
|
129 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
@@ -132,3 +124,17 @@
|
|
132 |
</div>
|
133 |
</li>
|
134 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
<textarea class="option-import-area" cols="30" rows="10" placeholder="<?php _e( 'Type or paste your choices here, adding each on a new line.' ); ?>"></textarea>
|
38 |
</div>
|
39 |
<p class="links mode-manual">
|
40 |
+
<a href="#" class="button add-heading"><?php _e( 'Add heading', 'happyforms' ); ?></a>
|
41 |
+
<a href="#" class="button add-option centered"><?php _e( 'Add choice', 'happyforms' ); ?></a>
|
42 |
<span class="centered">
|
43 |
<a href="#" class="import-options"><?php _e( 'Or, bulk add choices', 'happyforms' ); ?></a>
|
44 |
</span>
|
49 |
<a href="#" class="add-options"><?php _e( 'Cancel', 'happyforms' ); ?></a>
|
50 |
</span>
|
51 |
</p>
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
<% if ( instance.other_option ) { %>
|
54 |
<p>
|
78 |
<input type="checkbox" class="checkbox" value="1" <% if ( instance.shuffle_options ) { %>checked="checked"<% } %> data-bind="shuffle_options" /> <?php _e( 'Shuffle order of choices', 'happyforms' ); ?>
|
79 |
</label>
|
80 |
</p>
|
81 |
+
<p>
|
82 |
+
<label>
|
83 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
84 |
+
</label>
|
85 |
+
</p>
|
86 |
<?php happyforms_customize_part_width_control(); ?>
|
87 |
|
88 |
<p>
|
109 |
<input type="text" class="widefat" name="label" value="<%= label %>" data-option-attribute="label">
|
110 |
</label>
|
111 |
<div class="happyforms-part-item-advanced">
|
112 |
+
<label>
|
113 |
+
<?php _e( 'Max number of submissions', 'happyforms' ); ?>:
|
114 |
+
<input type="number" class="widefat" name="limit_submissions_amount" min="0" value="<%= typeof limit_submissions_amount !== 'undefined' ? limit_submissions_amount : '' %>">
|
115 |
+
</label>
|
116 |
<label>
|
117 |
<input type="checkbox" name="is_default" value="1" class="default-option-switch"<% if (is_default == 1) { %> checked="checked"<% } %>> <?php _e( 'Make this choice default', 'happyforms' ); ?>
|
118 |
</label><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
</div>
|
120 |
<div class="option-actions">
|
121 |
<a href="#" class="delete-option"><?php _e( 'Delete', 'happyforms' ); ?></a> |
|
124 |
</div>
|
125 |
</li>
|
126 |
</script>
|
127 |
+
<script type="text/template" id="customize-happyforms-select-item-heading-template">
|
128 |
+
<li data-option-id="<%= id %>" data-is-heading="yes">
|
129 |
+
<div class="happyforms-part-item-body">
|
130 |
+
<div class="happyforms-part-item-handle"></div>
|
131 |
+
<label>
|
132 |
+
<?php _e( 'Heading', 'happyforms' ); ?>:
|
133 |
+
<input type="text" class="widefat" name="label" value="<%= label %>">
|
134 |
+
</label>
|
135 |
+
<div class="option-actions">
|
136 |
+
<a href="#" class="delete-heading"><?php _e( 'Delete', 'happyforms' ); ?></a>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
</li>
|
140 |
+
</script>
|
core/templates/parts/customize-single-line-text.php
CHANGED
@@ -31,12 +31,6 @@
|
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_single_line_text_before_options' ); ?>
|
33 |
|
34 |
-
<p>
|
35 |
-
<label>
|
36 |
-
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
37 |
-
</label>
|
38 |
-
</p>
|
39 |
-
|
40 |
<?php do_action( 'happyforms_part_customize_single_line_text_after_options' ); ?>
|
41 |
|
42 |
<?php do_action( 'happyforms_part_customize_single_line_text_before_advanced_options' ); ?>
|
@@ -48,6 +42,11 @@
|
|
48 |
<label for="<%= instance.id %>_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
49 |
<input type="text" id="<%= instance.id %>_suffix" class="widefat title" value="<%= instance.suffix %>" data-bind="suffix" maxlength="50" />
|
50 |
</p>
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
<?php happyforms_customize_part_width_control(); ?>
|
53 |
|
31 |
|
32 |
<?php do_action( 'happyforms_part_customize_single_line_text_before_options' ); ?>
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<?php do_action( 'happyforms_part_customize_single_line_text_after_options' ); ?>
|
35 |
|
36 |
<?php do_action( 'happyforms_part_customize_single_line_text_before_advanced_options' ); ?>
|
42 |
<label for="<%= instance.id %>_suffix"><?php _e( 'Suffix', 'happyforms' ); ?></label>
|
43 |
<input type="text" id="<%= instance.id %>_suffix" class="widefat title" value="<%= instance.suffix %>" data-bind="suffix" maxlength="50" />
|
44 |
</p>
|
45 |
+
<p>
|
46 |
+
<label>
|
47 |
+
<input type="checkbox" class="checkbox" value="1" <% if ( instance.required ) { %>checked="checked"<% } %> data-bind="required" /> <?php _e( 'Require an answer', 'happyforms' ); ?>
|
48 |
+
</label>
|
49 |
+
</p>
|
50 |
|
51 |
<?php happyforms_customize_part_width_control(); ?>
|
52 |
|
core/templates/parts/frontend-checkbox.php
CHANGED
@@ -17,17 +17,28 @@
|
|
17 |
|
18 |
foreach( $options as $o => $option ) : ?>
|
19 |
<?php
|
20 |
-
$checked = in_array( $o, $value ) ? 'checked="checked"' : '';
|
21 |
$option_classes = 'happyforms-part__option happyforms-part-option';
|
22 |
|
23 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
$option_classes .= ' disabled-option';
|
25 |
}
|
26 |
|
27 |
?>
|
28 |
<div class="<?php echo $option_classes; ?>" id="<?php echo esc_attr( $option['id'] ); ?>">
|
29 |
<label class="option-label">
|
30 |
-
<input type="checkbox" class="happyforms-visuallyhidden happyforms-checkbox" name="<?php happyforms_the_part_name( $part, $form ); ?>[]" value="<?php echo $o; ?>" data-serialize <?php echo $checked; ?> <?php happyforms_the_part_attributes( $part, $form ); ?> <?php echo ( empty( $option['submissions_left'] ) && $option['
|
31 |
<span class="checkmark"><?php echo $checkmark_content; ?></span>
|
32 |
<span class="label-wrap">
|
33 |
<span class="label"><?php echo esc_attr( $option['label'] ); ?></span><?php echo $option['submissions_left_label']; ?>
|
17 |
|
18 |
foreach( $options as $o => $option ) : ?>
|
19 |
<?php
|
|
|
20 |
$option_classes = 'happyforms-part__option happyforms-part-option';
|
21 |
|
22 |
+
if ( happyforms_is_truthy( $option['is_heading'] ) ) {
|
23 |
+
$option_classes .= ' option-heading';
|
24 |
+
?>
|
25 |
+
<div class="<?php echo $option_classes; ?>" id="<?php echo happyforms_is_preview() ? esc_attr( $option['id'] ) : ''; ?>">
|
26 |
+
<label class="heading-label"><?php echo esc_attr( $option['label'] ); ?></label>
|
27 |
+
</div>
|
28 |
+
<?php
|
29 |
+
continue;
|
30 |
+
}
|
31 |
+
|
32 |
+
$checked = in_array( $o, $value ) ? 'checked="checked"' : '';
|
33 |
+
|
34 |
+
if ( '' != $option['limit_submissions_amount'] && 0 == $option['submissions_left'] ) {
|
35 |
$option_classes .= ' disabled-option';
|
36 |
}
|
37 |
|
38 |
?>
|
39 |
<div class="<?php echo $option_classes; ?>" id="<?php echo esc_attr( $option['id'] ); ?>">
|
40 |
<label class="option-label">
|
41 |
+
<input type="checkbox" class="happyforms-visuallyhidden happyforms-checkbox" name="<?php happyforms_the_part_name( $part, $form ); ?>[]" value="<?php echo $o; ?>" data-serialize <?php echo $checked; ?> <?php happyforms_the_part_attributes( $part, $form ); ?> <?php echo ( empty( $option['submissions_left'] ) && '' != $option['limit_submissions_amount'] ) ? 'disabled' : '' ?> >
|
42 |
<span class="checkmark"><?php echo $checkmark_content; ?></span>
|
43 |
<span class="label-wrap">
|
44 |
<span class="label"><?php echo esc_attr( $option['label'] ); ?></span><?php echo $option['submissions_left_label']; ?>
|
core/templates/parts/frontend-radio.php
CHANGED
@@ -14,21 +14,32 @@
|
|
14 |
|
15 |
foreach( $options as $o => $option ) : ?>
|
16 |
<?php
|
17 |
-
$checked = ( $o === $value ) ? 'checked="checked"' : '';
|
18 |
$option_classes = 'happyforms-part__option happyforms-part-option';
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
if ( is_string( $value ) ) {
|
21 |
$checked = checked( $value, $o, false );
|
22 |
}
|
23 |
|
24 |
-
if (
|
25 |
$option_classes .= ' disabled-option';
|
26 |
}
|
27 |
|
28 |
?>
|
29 |
<div class="<?php echo $option_classes; ?>" id="<?php echo esc_attr( $option['id'] ); ?>">
|
30 |
<label class="option-label">
|
31 |
-
<input type="radio" class="happyforms-visuallyhidden" name="<?php happyforms_the_part_name( $part, $form ); ?>" value="<?php echo $o; ?>" <?php echo $checked; ?> <?php happyforms_the_part_attributes( $part, $form ); ?> <?php echo ( empty( $option['submissions_left'] ) && $option['
|
32 |
<span class="checkmark"><?php echo $checkmark_content; ?></span>
|
33 |
<span class="label-wrap">
|
34 |
<span class="label"><?php echo esc_attr( $option['label'] ); ?></span><?php echo $option['submissions_left_label']; ?>
|
14 |
|
15 |
foreach( $options as $o => $option ) : ?>
|
16 |
<?php
|
|
|
17 |
$option_classes = 'happyforms-part__option happyforms-part-option';
|
18 |
|
19 |
+
if ( happyforms_is_truthy( $option['is_heading'] ) ) {
|
20 |
+
$option_classes .= ' option-heading';
|
21 |
+
?>
|
22 |
+
<div class="<?php echo $option_classes; ?>" id="<?php echo happyforms_is_preview() ? esc_attr( $option['id'] ) : ''; ?>">
|
23 |
+
<label class="heading-label"><?php echo esc_attr( $option['label'] ); ?></label>
|
24 |
+
</div>
|
25 |
+
<?php
|
26 |
+
continue;
|
27 |
+
}
|
28 |
+
$checked = ( $o === $value ) ? 'checked="checked"' : '';
|
29 |
+
|
30 |
+
|
31 |
if ( is_string( $value ) ) {
|
32 |
$checked = checked( $value, $o, false );
|
33 |
}
|
34 |
|
35 |
+
if ( '' != $option['limit_submissions_amount'] && 0 == $option['submissions_left'] ) {
|
36 |
$option_classes .= ' disabled-option';
|
37 |
}
|
38 |
|
39 |
?>
|
40 |
<div class="<?php echo $option_classes; ?>" id="<?php echo esc_attr( $option['id'] ); ?>">
|
41 |
<label class="option-label">
|
42 |
+
<input type="radio" class="happyforms-visuallyhidden" name="<?php happyforms_the_part_name( $part, $form ); ?>" value="<?php echo $o; ?>" <?php echo $checked; ?> <?php happyforms_the_part_attributes( $part, $form ); ?> <?php echo ( empty( $option['submissions_left'] ) && '' != $option['limit_submissions_amount'] ) ? 'disabled' : '' ?>>
|
43 |
<span class="checkmark"><?php echo $checkmark_content; ?></span>
|
44 |
<span class="label-wrap">
|
45 |
<span class="label"><?php echo esc_attr( $option['label'] ); ?></span><?php echo $option['submissions_left_label']; ?>
|
core/templates/parts/frontend-select.php
CHANGED
@@ -36,19 +36,32 @@
|
|
36 |
'label' => $other_select,
|
37 |
);
|
38 |
}
|
39 |
-
|
40 |
?>
|
41 |
<select name="<?php happyforms_the_part_name( $part, $form ); ?>" data-serialize class='happyforms-select' required>
|
42 |
<option disabled hidden <?php echo ( $value === '' ) ? ' selected' : ''; ?> value='' class="happyforms-placeholder-option"><?php echo $placeholder_text; ?></option>
|
|
|
43 |
<?php foreach ( $options as $index => $option ) : ?>
|
44 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
$option_value = isset( $option['value'] ) ? $option['value'] : $index;
|
46 |
$submissions_left_label = isset( $option['submissions_left_label'] ) ? ' ' . $option['submissions_left_label'] : '';
|
47 |
$selected = ( $value != '' && $value == $option_value ) ? ' selected' : '';
|
48 |
-
$disabled = ( $option['
|
49 |
?>
|
50 |
<option value="<?php echo $option_value; ?>" <?php echo $selected; ?> <?php echo $disabled; ?>><?php echo esc_attr( $option['label'] ); ?><?php echo $submissions_left_label; ?></option>
|
51 |
<?php endforeach; ?>
|
|
|
|
|
|
|
52 |
</select>
|
53 |
</div>
|
54 |
</div>
|
36 |
'label' => $other_select,
|
37 |
);
|
38 |
}
|
|
|
39 |
?>
|
40 |
<select name="<?php happyforms_the_part_name( $part, $form ); ?>" data-serialize class='happyforms-select' required>
|
41 |
<option disabled hidden <?php echo ( $value === '' ) ? ' selected' : ''; ?> value='' class="happyforms-placeholder-option"><?php echo $placeholder_text; ?></option>
|
42 |
+
<?php $is_grouped = false; ?>
|
43 |
<?php foreach ( $options as $index => $option ) : ?>
|
44 |
<?php
|
45 |
+
if ( happyforms_is_truthy( $option['is_heading'] ) ) {
|
46 |
+
if ( $is_grouped ) : ?>
|
47 |
+
</optgroup>
|
48 |
+
<?php endif; ?>
|
49 |
+
<optgroup label="<?php echo esc_attr( $option['label'] ); ?>">
|
50 |
+
<?php
|
51 |
+
$is_grouped = true;
|
52 |
+
continue;
|
53 |
+
}
|
54 |
+
|
55 |
$option_value = isset( $option['value'] ) ? $option['value'] : $index;
|
56 |
$submissions_left_label = isset( $option['submissions_left_label'] ) ? ' ' . $option['submissions_left_label'] : '';
|
57 |
$selected = ( $value != '' && $value == $option_value ) ? ' selected' : '';
|
58 |
+
$disabled = ( '' != $option['limit_submissions_amount'] && $option['submissions_left'] == 0 ) ? ' disabled' : '';
|
59 |
?>
|
60 |
<option value="<?php echo $option_value; ?>" <?php echo $selected; ?> <?php echo $disabled; ?>><?php echo esc_attr( $option['label'] ); ?><?php echo $submissions_left_label; ?></option>
|
61 |
<?php endforeach; ?>
|
62 |
+
<?php if ( $is_grouped ) : ?>
|
63 |
+
</optgroup>
|
64 |
+
<?php endif; ?>
|
65 |
</select>
|
66 |
</div>
|
67 |
</div>
|
happyforms.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin URI: https://happyforms.io
|
6 |
* Description: We're changin' WordPress forms.
|
7 |
* Author: Happyforms
|
8 |
-
* Version: 1.15.
|
9 |
* Author URI: https://happyforms.io
|
10 |
* Upgrade URI: https://happyforms.io/upgrade
|
11 |
*/
|
@@ -22,7 +22,7 @@ if ( defined( 'HAPPYFORMS_UPGRADE_VERSION' ) ) {
|
|
22 |
/**
|
23 |
* The current version of the plugin.
|
24 |
*/
|
25 |
-
define( 'HAPPYFORMS_VERSION', '1.15.
|
26 |
|
27 |
if ( ! function_exists( 'happyforms_get_version' ) ):
|
28 |
|
5 |
* Plugin URI: https://happyforms.io
|
6 |
* Description: We're changin' WordPress forms.
|
7 |
* Author: Happyforms
|
8 |
+
* Version: 1.15.1
|
9 |
* Author URI: https://happyforms.io
|
10 |
* Upgrade URI: https://happyforms.io/upgrade
|
11 |
*/
|
22 |
/**
|
23 |
* The current version of the plugin.
|
24 |
*/
|
25 |
+
define( 'HAPPYFORMS_VERSION', '1.15.1' );
|
26 |
|
27 |
if ( ! function_exists( 'happyforms_get_version' ) ):
|
28 |
|
inc/assets/css/admin.css
CHANGED
@@ -143,10 +143,6 @@ a.happyforms-modal__dismiss {
|
|
143 |
display: none;
|
144 |
}
|
145 |
|
146 |
-
body.post-type-happyforms-activity .fixed .column-contact {
|
147 |
-
width: 20%;
|
148 |
-
}
|
149 |
-
|
150 |
.fixed .column-form {
|
151 |
width: 15%;
|
152 |
}
|
143 |
display: none;
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
146 |
.fixed .column-form {
|
147 |
width: 15%;
|
148 |
}
|
inc/assets/js/customize.js
CHANGED
@@ -1042,7 +1042,7 @@
|
|
1042 |
'click .apply-all-check': 'applyOptionGlobally',
|
1043 |
'click .happyforms-form-part-advanced-settings': 'onAdvancedSettingsClick',
|
1044 |
'click .happyforms-form-part-logic': 'openUpgradeModal',
|
1045 |
-
'click .
|
1046 |
},
|
1047 |
|
1048 |
initialize: function( options ) {
|
1042 |
'click .apply-all-check': 'applyOptionGlobally',
|
1043 |
'click .happyforms-form-part-advanced-settings': 'onAdvancedSettingsClick',
|
1044 |
'click .happyforms-form-part-logic': 'openUpgradeModal',
|
1045 |
+
'click .input_dummy': 'openUpgradeModal',
|
1046 |
},
|
1047 |
|
1048 |
initialize: function( options ) {
|
inc/assets/js/frontend.js
CHANGED
@@ -202,7 +202,6 @@
|
|
202 |
{ name: 'action', value: action },
|
203 |
{ name: 'happyforms_form_id', value: form_id },
|
204 |
{ name: 'happyforms_step', value: step },
|
205 |
-
{ name: 'referer', value: referer },
|
206 |
];
|
207 |
|
208 |
var honeypotNames = [ 'single_line_text', 'multi_line_text', 'number' ];
|
@@ -231,14 +230,21 @@
|
|
231 |
} );
|
232 |
|
233 |
var data = formData.concat( partData );
|
|
|
|
|
234 |
|
235 |
-
|
236 |
-
.
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
-
return
|
242 |
},
|
243 |
|
244 |
buttonSubmit: function( e ) {
|
202 |
{ name: 'action', value: action },
|
203 |
{ name: 'happyforms_form_id', value: form_id },
|
204 |
{ name: 'happyforms_step', value: step },
|
|
|
205 |
];
|
206 |
|
207 |
var honeypotNames = [ 'single_line_text', 'multi_line_text', 'number' ];
|
230 |
} );
|
231 |
|
232 |
var data = formData.concat( partData );
|
233 |
+
var params = new URLSearchParams();
|
234 |
+
var hash = [];
|
235 |
|
236 |
+
data.forEach( function( entry ) {
|
237 |
+
params.append( entry.name, entry.value );
|
238 |
+
hash.push( entry.value );
|
239 |
+
} );
|
240 |
+
|
241 |
+
hash = hash.join( '' ).replace( /[^\w\d]/gm, '' );
|
242 |
+
hash = md5( hash );
|
243 |
+
|
244 |
+
params.append( 'hash', hash );
|
245 |
+
params = params.toString();
|
246 |
|
247 |
+
return params;
|
248 |
},
|
249 |
|
250 |
buttonSubmit: function( e ) {
|
inc/classes/class-answer-limiter-dummy.php
CHANGED
@@ -34,11 +34,10 @@ class HappyForms_Answer_Limiter_Dummy {
|
|
34 |
|
35 |
public function add_part_controls() {
|
36 |
?>
|
37 |
-
<p class="
|
38 |
-
<label>
|
39 |
-
<input type="checkbox"/> <?php _e( 'Limit how many times the same answer can be submitted', 'happyforms' ); ?>
|
40 |
-
</label>
|
41 |
<span class="members-only"><?php _e( 'Members Only', 'happyforms') ?></span>
|
|
|
42 |
</p>
|
43 |
<?php
|
44 |
}
|
34 |
|
35 |
public function add_part_controls() {
|
36 |
?>
|
37 |
+
<p class="input_dummy">
|
38 |
+
<label><?php _e( 'Max times the same answer is allowed', 'happyforms' ); ?>:</label>
|
|
|
|
|
39 |
<span class="members-only"><?php _e( 'Members Only', 'happyforms') ?></span>
|
40 |
+
<input type="number" />
|
41 |
</p>
|
42 |
<?php
|
43 |
}
|
inc/classes/class-message-admin.php
CHANGED
@@ -56,7 +56,6 @@ class HappyForms_Message_Admin {
|
|
56 |
$cb_column = $columns['cb'];
|
57 |
$columns = array( 'cb' => $cb_column );
|
58 |
|
59 |
-
$columns['contact'] = __( 'Contact', 'happyforms' );
|
60 |
$columns['submission'] = __( 'Submission', 'happyforms' );
|
61 |
$columns['form'] = __( 'In Response to', 'happyforms' );
|
62 |
$columns['datetime'] = __( 'Submitted on', 'happyforms' );
|
@@ -65,7 +64,6 @@ class HappyForms_Message_Admin {
|
|
65 |
}
|
66 |
|
67 |
public function sortable_columns( $columns ) {
|
68 |
-
$columns['contact'] = 'contact';
|
69 |
$columns['form'] = 'form';
|
70 |
$columns['datetime'] = 'datetime';
|
71 |
|
56 |
$cb_column = $columns['cb'];
|
57 |
$columns = array( 'cb' => $cb_column );
|
58 |
|
|
|
59 |
$columns['submission'] = __( 'Submission', 'happyforms' );
|
60 |
$columns['form'] = __( 'In Response to', 'happyforms' );
|
61 |
$columns['datetime'] = __( 'Submitted on', 'happyforms' );
|
64 |
}
|
65 |
|
66 |
public function sortable_columns( $columns ) {
|
|
|
67 |
$columns['form'] = 'form';
|
68 |
$columns['datetime'] = 'datetime';
|
69 |
|
inc/classes/class-message-controller.php
CHANGED
@@ -169,9 +169,16 @@ class HappyForms_Message_Controller {
|
|
169 |
happyforms_get_session()->set_step( $step );
|
170 |
|
171 |
// Validate honeypot
|
172 |
-
if ( happyforms_get_form_controller()->
|
173 |
if ( ! $this->validate_honeypot( $form ) ) {
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
}
|
177 |
|
@@ -224,25 +231,27 @@ class HappyForms_Message_Controller {
|
|
224 |
// Empty submitted values
|
225 |
$session->clear_values();
|
226 |
|
227 |
-
if (
|
228 |
-
|
229 |
-
|
|
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
246 |
|
247 |
// Render the form
|
248 |
$response['html'] = $form_controller->render( $form );
|
@@ -283,6 +292,29 @@ class HappyForms_Message_Controller {
|
|
283 |
return $validated;
|
284 |
}
|
285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
public function validate_part( $form, $part, $request ) {
|
287 |
$part_class = happyforms_get_part_library()->get_part( $part['type'] );
|
288 |
|
169 |
happyforms_get_session()->set_step( $step );
|
170 |
|
171 |
// Validate honeypot
|
172 |
+
if ( happyforms_get_form_controller()->has_honeypot_protection( $form ) ) {
|
173 |
if ( ! $this->validate_honeypot( $form ) ) {
|
174 |
+
define( 'HAPPYFORMS_IS_SPAMBOT', true );
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
// Validate hash
|
179 |
+
if ( happyforms_get_form_controller()->has_hash_protection( $form ) ) {
|
180 |
+
if ( ! $this->validate_hash( $form ) ) {
|
181 |
+
define( 'HAPPYFORMS_IS_SPAMBOT', true );
|
182 |
}
|
183 |
}
|
184 |
|
231 |
// Empty submitted values
|
232 |
$session->clear_values();
|
233 |
|
234 |
+
if ( ! happyforms_is_spambot() ) {
|
235 |
+
if ( 1 === intval( $form['receive_email_alerts'] ) ) {
|
236 |
+
$this->email_owner_confirmation( $form, $submission );
|
237 |
+
}
|
238 |
|
239 |
+
if ( 1 === intval( $form['send_confirmation_email'] ) ) {
|
240 |
+
$this->email_user_confirmation( $form, $submission );
|
241 |
+
}
|
242 |
|
243 |
+
/**
|
244 |
+
* This action fires once a message is succesfully submitted.
|
245 |
+
*
|
246 |
+
* @since 1.4
|
247 |
+
*
|
248 |
+
* @param array $submission Submission data.
|
249 |
+
* @param array $form Current form data.
|
250 |
+
*
|
251 |
+
* @return void
|
252 |
+
*/
|
253 |
+
do_action( 'happyforms_submission_success', $submission, $form, array() );
|
254 |
+
}
|
255 |
|
256 |
// Render the form
|
257 |
$response['html'] = $form_controller->render( $form );
|
292 |
return $validated;
|
293 |
}
|
294 |
|
295 |
+
private function validate_hash( $form ) {
|
296 |
+
$validated = true;
|
297 |
+
|
298 |
+
if ( ! isset( $_POST['hash'] ) ) {
|
299 |
+
$validated = false;
|
300 |
+
}
|
301 |
+
|
302 |
+
array_walk_recursive( $_POST, function( $value, $key ) use( &$hash ) {
|
303 |
+
if ( 'hash' !== $key ) {
|
304 |
+
$hash .= $value;
|
305 |
+
}
|
306 |
+
} );
|
307 |
+
|
308 |
+
$hash = preg_replace( '/[^\w\d]/m', '', $hash );
|
309 |
+
$hash = md5( $hash );
|
310 |
+
|
311 |
+
if ( $hash !== $_POST['hash'] ) {
|
312 |
+
$validated = false;
|
313 |
+
}
|
314 |
+
|
315 |
+
return $validated;
|
316 |
+
}
|
317 |
+
|
318 |
public function validate_part( $form, $part, $request ) {
|
319 |
$part_class = happyforms_get_part_library()->get_part( $part['type'] );
|
320 |
|
languages/happyforms.pot
CHANGED
@@ -2,16 +2,16 @@
|
|
2 |
# This file is distributed under the same license as the Happyforms (free) plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Happyforms (free) 1.15.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/happyforms/\n"
|
7 |
"Last-Translator: The Theme Foundry\n"
|
8 |
"Language-Team: The Theme Foundry\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-04-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
-
"X-Generator: WP-CLI 2.
|
15 |
"X-Domain: happyforms\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
@@ -84,7 +84,7 @@ msgid "Duplicate"
|
|
84 |
msgstr ""
|
85 |
|
86 |
#: core/classes/class-form-admin.php:458
|
87 |
-
#: inc/classes/class-message-admin.php:
|
88 |
msgid "Trash"
|
89 |
msgstr ""
|
90 |
|
@@ -128,7 +128,8 @@ msgid "Search Forms"
|
|
128 |
msgstr ""
|
129 |
|
130 |
#: core/classes/class-form-controller.php:82
|
131 |
-
#: core/assets/jsx/build/admin/block.js:
|
|
|
132 |
msgid "No forms found."
|
133 |
msgstr ""
|
134 |
|
@@ -143,11 +144,11 @@ msgstr ""
|
|
143 |
msgid "All Forms"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: core/classes/class-form-controller.php:
|
147 |
msgid "(no title)"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: core/classes/class-form-controller.php:
|
151 |
msgid " Copy"
|
152 |
msgstr ""
|
153 |
|
@@ -208,24 +209,24 @@ msgid "Include submitted values"
|
|
208 |
msgstr ""
|
209 |
|
210 |
#: core/classes/class-form-messages.php:31
|
211 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
212 |
msgid "Min words"
|
213 |
msgstr ""
|
214 |
|
215 |
#: core/classes/class-form-messages.php:35
|
216 |
#: core/classes/parts/class-part-multi-line-text.php:74
|
217 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
218 |
msgid "Max words"
|
219 |
msgstr ""
|
220 |
|
221 |
#: core/classes/class-form-messages.php:39
|
222 |
#: core/classes/parts/class-part-multi-line-text.php:70
|
223 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
224 |
msgid "Min characters"
|
225 |
msgstr ""
|
226 |
|
227 |
#: core/classes/class-form-messages.php:43
|
228 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
229 |
msgid "Max characters"
|
230 |
msgstr ""
|
231 |
|
@@ -689,12 +690,12 @@ msgstr ""
|
|
689 |
|
690 |
#: core/classes/class-form-styles.php:716
|
691 |
#: core/templates/parts/customize-checkbox.php:4
|
692 |
-
#: core/templates/parts/customize-checkbox.php:
|
693 |
#: core/templates/parts/customize-email.php:4
|
694 |
#: core/templates/parts/customize-multi-line-text.php:4
|
695 |
#: core/templates/parts/customize-number.php:4
|
696 |
#: core/templates/parts/customize-radio.php:4
|
697 |
-
#: core/templates/parts/customize-radio.php:
|
698 |
#: core/templates/parts/customize-select.php:4
|
699 |
#: core/templates/parts/customize-select.php:108
|
700 |
#: core/templates/parts/customize-single-line-text.php:4
|
@@ -716,12 +717,12 @@ msgstr ""
|
|
716 |
|
717 |
#: core/classes/class-form-styles.php:731
|
718 |
#: core/templates/parts/customize-checkbox.php:20
|
719 |
-
#: core/templates/parts/customize-checkbox.php:
|
720 |
#: core/templates/parts/customize-email.php:28
|
721 |
#: core/templates/parts/customize-multi-line-text.php:28
|
722 |
#: core/templates/parts/customize-number.php:28
|
723 |
#: core/templates/parts/customize-radio.php:20
|
724 |
-
#: core/templates/parts/customize-radio.php:
|
725 |
#: core/templates/parts/customize-select.php:24
|
726 |
#: core/templates/parts/customize-single-line-text.php:28
|
727 |
msgid "Hint"
|
@@ -828,8 +829,8 @@ msgstr ""
|
|
828 |
|
829 |
#: core/classes/class-happyforms-core.php:209
|
830 |
#: core/classes/class-happyforms-core.php:210
|
831 |
-
#: inc/classes/class-message-controller.php:
|
832 |
-
#: inc/classes/class-message-controller.php:
|
833 |
msgid "Activity"
|
834 |
msgstr ""
|
835 |
|
@@ -841,7 +842,8 @@ msgstr ""
|
|
841 |
|
842 |
#: core/classes/class-happyforms-core.php:227
|
843 |
#: core/classes/class-happyforms-core.php:228
|
844 |
-
#: core/assets/jsx/build/admin/block.js:
|
|
|
845 |
msgid "Settings"
|
846 |
msgstr ""
|
847 |
|
@@ -2986,7 +2988,8 @@ msgid "Choose a form"
|
|
2986 |
msgstr ""
|
2987 |
|
2988 |
#: core/templates/admin-form-modal.php:12
|
2989 |
-
#: core/assets/jsx/build/admin/block.js:
|
|
|
2990 |
msgid "Insert"
|
2991 |
msgstr ""
|
2992 |
|
@@ -3001,7 +3004,7 @@ msgstr ""
|
|
3001 |
#: core/templates/customize-controls/setup/upsell.php:2
|
3002 |
#: core/templates/customize-form-part-footer.php:5
|
3003 |
#: core/templates/customize-form-parts-drawer.php:37
|
3004 |
-
#: inc/classes/class-answer-limiter-dummy.php:
|
3005 |
#: inc/templates/customize-controls/checkbox_dummy.php:7
|
3006 |
#: inc/templates/customize-controls/email-parts-list-dummy.php:2
|
3007 |
msgid "Members Only"
|
@@ -3043,9 +3046,12 @@ msgstr ""
|
|
3043 |
|
3044 |
#: core/templates/customize-form-item.php:33
|
3045 |
#: core/templates/customize-form-part-footer.php:3
|
3046 |
-
#: core/templates/parts/customize-checkbox.php:
|
3047 |
-
#: core/templates/parts/customize-
|
3048 |
-
#: core/templates/parts/customize-
|
|
|
|
|
|
|
3049 |
msgid "Delete"
|
3050 |
msgstr ""
|
3051 |
|
@@ -3148,128 +3154,127 @@ msgstr ""
|
|
3148 |
#: core/templates/parts/customize-checkbox.php:36
|
3149 |
#: core/templates/parts/customize-radio.php:36
|
3150 |
#: core/templates/parts/customize-select.php:40
|
|
|
|
|
|
|
|
|
|
|
|
|
3151 |
msgid "Add choice"
|
3152 |
msgstr ""
|
3153 |
|
3154 |
-
#: core/templates/parts/customize-checkbox.php:
|
3155 |
-
#: core/templates/parts/customize-radio.php:
|
3156 |
-
#: core/templates/parts/customize-select.php:
|
3157 |
msgid "Or, bulk add choices"
|
3158 |
msgstr ""
|
3159 |
|
3160 |
-
#: core/templates/parts/customize-checkbox.php:
|
3161 |
-
#: core/templates/parts/customize-radio.php:
|
3162 |
-
#: core/templates/parts/customize-select.php:
|
3163 |
msgid "Add choices"
|
3164 |
msgstr ""
|
3165 |
|
3166 |
-
#: core/templates/parts/customize-checkbox.php:
|
3167 |
-
#: core/templates/parts/customize-radio.php:
|
3168 |
-
#: core/templates/parts/customize-select.php:
|
3169 |
msgid "Cancel"
|
3170 |
msgstr ""
|
3171 |
|
3172 |
-
#: core/templates/parts/customize-checkbox.php:
|
3173 |
-
#: core/templates/parts/customize-
|
3174 |
-
#: core/templates/parts/customize-
|
3175 |
-
|
3176 |
-
#: core/templates/parts/customize-radio.php:49
|
3177 |
-
#: core/templates/parts/customize-select.php:53
|
3178 |
-
#: core/templates/parts/customize-single-line-text.php:36
|
3179 |
-
msgid "Require an answer"
|
3180 |
msgstr ""
|
3181 |
|
3182 |
-
#: core/templates/parts/customize-checkbox.php:
|
3183 |
-
#: core/templates/parts/customize-radio.php:
|
3184 |
-
#: core/templates/parts/customize-select.php:
|
3185 |
-
msgid "
|
3186 |
msgstr ""
|
3187 |
|
3188 |
#: core/templates/parts/customize-checkbox.php:65
|
3189 |
#: core/templates/parts/customize-radio.php:65
|
3190 |
#: core/templates/parts/customize-select.php:66
|
3191 |
-
msgid "'Other' label"
|
3192 |
-
msgstr ""
|
3193 |
-
|
3194 |
-
#: core/templates/parts/customize-checkbox.php:69
|
3195 |
-
#: core/templates/parts/customize-radio.php:69
|
3196 |
-
#: core/templates/parts/customize-select.php:70
|
3197 |
msgid "'Other' placeholder"
|
3198 |
msgstr ""
|
3199 |
|
3200 |
-
#: core/templates/parts/customize-checkbox.php:
|
3201 |
-
#: core/templates/parts/customize-radio.php:
|
3202 |
-
#: core/templates/parts/customize-select.php:
|
3203 |
msgid "Shuffle order of choices"
|
3204 |
msgstr ""
|
3205 |
|
3206 |
-
#: core/templates/parts/customize-checkbox.php:
|
3207 |
msgid "Limit choices"
|
3208 |
msgstr ""
|
3209 |
|
3210 |
-
#: core/templates/parts/customize-checkbox.php:
|
3211 |
msgid "Min choices"
|
3212 |
msgstr ""
|
3213 |
|
3214 |
-
#: core/templates/parts/customize-checkbox.php:
|
3215 |
msgid "Max choices"
|
3216 |
msgstr ""
|
3217 |
|
|
|
|
|
|
|
|
|
|
|
3218 |
#: core/templates/parts/customize-checkbox.php:95
|
3219 |
#: core/templates/parts/customize-radio.php:80
|
3220 |
-
msgid "
|
3221 |
msgstr ""
|
3222 |
|
3223 |
#: core/templates/parts/customize-checkbox.php:99
|
3224 |
#: core/templates/parts/customize-radio.php:84
|
3225 |
-
msgid "
|
3226 |
msgstr ""
|
3227 |
|
3228 |
-
#: core/templates/parts/customize-checkbox.php:
|
3229 |
-
#: core/templates/parts/customize-
|
3230 |
-
|
|
|
|
|
|
|
|
|
|
|
3231 |
msgstr ""
|
3232 |
|
3233 |
-
#: core/templates/parts/customize-checkbox.php:
|
3234 |
-
#: core/templates/parts/customize-email.php:
|
3235 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
3236 |
-
#: core/templates/parts/customize-number.php:
|
3237 |
-
#: core/templates/parts/customize-radio.php:
|
3238 |
#: core/templates/parts/customize-select.php:89
|
3239 |
-
#: core/templates/parts/customize-single-line-text.php:
|
3240 |
msgid "Additional CSS class(es)"
|
3241 |
msgstr ""
|
3242 |
|
3243 |
-
#: core/templates/parts/customize-checkbox.php:
|
3244 |
-
#: core/templates/parts/customize-radio.php:124
|
3245 |
-
#: core/templates/parts/customize-select.php:113
|
3246 |
-
msgid "Make this choice default"
|
3247 |
-
msgstr ""
|
3248 |
-
|
3249 |
-
#: core/templates/parts/customize-checkbox.php:142
|
3250 |
-
#: core/templates/parts/customize-radio.php:127
|
3251 |
-
#: core/templates/parts/customize-select.php:116
|
3252 |
-
msgid "Limit how many times this choice can be submitted"
|
3253 |
-
msgstr ""
|
3254 |
-
|
3255 |
-
#: core/templates/parts/customize-checkbox.php:146
|
3256 |
-
#: core/templates/parts/customize-radio.php:131
|
3257 |
-
#: core/templates/parts/customize-select.php:120
|
3258 |
msgid "Max submissions"
|
3259 |
msgstr ""
|
3260 |
|
3261 |
-
#: core/templates/parts/customize-checkbox.php:
|
3262 |
-
#: core/templates/parts/customize-radio.php:
|
3263 |
-
#: core/templates/parts/customize-select.php:
|
3264 |
-
msgid "
|
3265 |
msgstr ""
|
3266 |
|
3267 |
-
#: core/templates/parts/customize-checkbox.php:
|
3268 |
-
#: core/templates/parts/customize-radio.php:
|
3269 |
-
#: core/templates/parts/customize-select.php:
|
3270 |
msgid "More"
|
3271 |
msgstr ""
|
3272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3273 |
#: core/templates/parts/customize-email.php:24
|
3274 |
#: core/templates/parts/customize-multi-line-text.php:24
|
3275 |
#: core/templates/parts/customize-number.php:24
|
@@ -3277,60 +3282,65 @@ msgstr ""
|
|
3277 |
msgid "Prefill"
|
3278 |
msgstr ""
|
3279 |
|
3280 |
-
#: core/templates/parts/customize-email.php:
|
3281 |
-
#: core/templates/parts/customize-number.php:
|
3282 |
-
#: core/templates/parts/customize-single-line-text.php:
|
3283 |
msgid "Prefix"
|
3284 |
msgstr ""
|
3285 |
|
3286 |
-
#: core/templates/parts/customize-email.php:
|
3287 |
-
#: core/templates/parts/customize-number.php:
|
3288 |
-
#: core/templates/parts/customize-single-line-text.php:
|
3289 |
msgid "Suffix"
|
3290 |
msgstr ""
|
3291 |
|
3292 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
3293 |
msgid "Limit words/characters"
|
3294 |
msgstr ""
|
3295 |
|
3296 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
3297 |
msgid "Limit"
|
3298 |
msgstr ""
|
3299 |
|
3300 |
-
#: core/templates/parts/customize-multi-line-text.php:
|
3301 |
msgid "Count"
|
3302 |
msgstr ""
|
3303 |
|
3304 |
-
#: core/templates/parts/customize-number.php:
|
3305 |
msgid "Min number"
|
3306 |
msgstr ""
|
3307 |
|
3308 |
-
#: core/templates/parts/customize-number.php:
|
3309 |
msgid "Max number"
|
3310 |
msgstr ""
|
3311 |
|
3312 |
-
#: core/templates/parts/customize-number.php:
|
3313 |
msgid "Step Interval"
|
3314 |
msgstr ""
|
3315 |
|
3316 |
-
#: core/templates/parts/customize-number.php:
|
3317 |
msgid "Use number separators"
|
3318 |
msgstr ""
|
3319 |
|
3320 |
-
#: core/templates/parts/customize-number.php:
|
3321 |
msgid "Grouping"
|
3322 |
msgstr ""
|
3323 |
|
3324 |
-
#: core/templates/parts/customize-number.php:
|
3325 |
msgid "Decimal"
|
3326 |
msgstr ""
|
3327 |
|
|
|
|
|
|
|
|
|
|
|
3328 |
#: core/templates/preview-form-pencil.php:3
|
3329 |
msgid "Click to edit this part."
|
3330 |
msgstr ""
|
3331 |
|
3332 |
-
#: inc/classes/class-answer-limiter-dummy.php:
|
3333 |
-
msgid "
|
3334 |
msgstr ""
|
3335 |
|
3336 |
#: inc/classes/class-happyforms.php:104
|
@@ -3386,43 +3396,39 @@ msgid "Send abandonment email"
|
|
3386 |
msgstr ""
|
3387 |
|
3388 |
#: inc/classes/class-message-admin.php:59
|
3389 |
-
msgid "Contact"
|
3390 |
-
msgstr ""
|
3391 |
-
|
3392 |
-
#: inc/classes/class-message-admin.php:60
|
3393 |
msgid "Submission"
|
3394 |
msgstr ""
|
3395 |
|
3396 |
-
#: inc/classes/class-message-admin.php:
|
3397 |
msgid "In Response to"
|
3398 |
msgstr ""
|
3399 |
|
3400 |
-
#: inc/classes/class-message-admin.php:
|
3401 |
msgid "Submitted on"
|
3402 |
msgstr ""
|
3403 |
|
3404 |
-
#: inc/classes/class-message-admin.php:
|
3405 |
msgid "All"
|
3406 |
msgstr ""
|
3407 |
|
3408 |
-
#: inc/classes/class-message-admin.php:
|
3409 |
msgid "Unread"
|
3410 |
msgstr ""
|
3411 |
|
3412 |
-
#: inc/classes/class-message-admin.php:
|
3413 |
msgid "Read"
|
3414 |
msgstr ""
|
3415 |
|
3416 |
-
#: inc/classes/class-message-admin.php:
|
3417 |
msgid "Spam"
|
3418 |
msgstr ""
|
3419 |
|
3420 |
-
#: inc/classes/class-message-controller.php:
|
3421 |
-
#: inc/classes/class-message-controller.php:
|
3422 |
msgid "All Activity"
|
3423 |
msgstr ""
|
3424 |
|
3425 |
-
#: inc/classes/class-message-controller.php:
|
3426 |
msgid "No activity found."
|
3427 |
msgstr ""
|
3428 |
|
@@ -3462,10 +3468,6 @@ msgstr ""
|
|
3462 |
msgid "Design"
|
3463 |
msgstr ""
|
3464 |
|
3465 |
-
#: inc/classes/parts/class-part-layout-title-dummy.php:8
|
3466 |
-
msgid "Heading"
|
3467 |
-
msgstr ""
|
3468 |
-
|
3469 |
#: inc/classes/parts/class-part-layout-title-dummy.php:9
|
3470 |
msgid "For adding titles to visually separate fields."
|
3471 |
msgstr ""
|
@@ -3828,14 +3830,22 @@ msgid "Publishable key"
|
|
3828 |
msgstr ""
|
3829 |
|
3830 |
#: core/assets/jsx/build/admin/block.js:127
|
|
|
3831 |
msgid "Choose"
|
3832 |
msgstr ""
|
3833 |
|
3834 |
-
#: core/assets/jsx/build/admin/block.js:
|
|
|
|
|
|
|
|
|
|
|
|
|
3835 |
msgid "Pick a form to display on your site."
|
3836 |
msgstr ""
|
3837 |
|
3838 |
-
#: core/assets/jsx/build/admin/block.js:
|
|
|
3839 |
msgid "Pick a form"
|
3840 |
msgstr ""
|
3841 |
|
2 |
# This file is distributed under the same license as the Happyforms (free) plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Happyforms (free) 1.15.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/happyforms/\n"
|
7 |
"Last-Translator: The Theme Foundry\n"
|
8 |
"Language-Team: The Theme Foundry\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-04-25T07:12:32+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
+
"X-Generator: WP-CLI 2.5.0\n"
|
15 |
"X-Domain: happyforms\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
84 |
msgstr ""
|
85 |
|
86 |
#: core/classes/class-form-admin.php:458
|
87 |
+
#: inc/classes/class-message-admin.php:81
|
88 |
msgid "Trash"
|
89 |
msgstr ""
|
90 |
|
128 |
msgstr ""
|
129 |
|
130 |
#: core/classes/class-form-controller.php:82
|
131 |
+
#: core/assets/jsx/build/admin/block.js:144
|
132 |
+
#: core/assets/jsx/src/admin/block.js:32
|
133 |
msgid "No forms found."
|
134 |
msgstr ""
|
135 |
|
144 |
msgid "All Forms"
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: core/classes/class-form-controller.php:534
|
148 |
msgid "(no title)"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: core/classes/class-form-controller.php:640
|
152 |
msgid " Copy"
|
153 |
msgstr ""
|
154 |
|
209 |
msgstr ""
|
210 |
|
211 |
#: core/classes/class-form-messages.php:31
|
212 |
+
#: core/templates/parts/customize-multi-line-text.php:53
|
213 |
msgid "Min words"
|
214 |
msgstr ""
|
215 |
|
216 |
#: core/classes/class-form-messages.php:35
|
217 |
#: core/classes/parts/class-part-multi-line-text.php:74
|
218 |
+
#: core/templates/parts/customize-multi-line-text.php:52
|
219 |
msgid "Max words"
|
220 |
msgstr ""
|
221 |
|
222 |
#: core/classes/class-form-messages.php:39
|
223 |
#: core/classes/parts/class-part-multi-line-text.php:70
|
224 |
+
#: core/templates/parts/customize-multi-line-text.php:55
|
225 |
msgid "Min characters"
|
226 |
msgstr ""
|
227 |
|
228 |
#: core/classes/class-form-messages.php:43
|
229 |
+
#: core/templates/parts/customize-multi-line-text.php:54
|
230 |
msgid "Max characters"
|
231 |
msgstr ""
|
232 |
|
690 |
|
691 |
#: core/classes/class-form-styles.php:716
|
692 |
#: core/templates/parts/customize-checkbox.php:4
|
693 |
+
#: core/templates/parts/customize-checkbox.php:131
|
694 |
#: core/templates/parts/customize-email.php:4
|
695 |
#: core/templates/parts/customize-multi-line-text.php:4
|
696 |
#: core/templates/parts/customize-number.php:4
|
697 |
#: core/templates/parts/customize-radio.php:4
|
698 |
+
#: core/templates/parts/customize-radio.php:116
|
699 |
#: core/templates/parts/customize-select.php:4
|
700 |
#: core/templates/parts/customize-select.php:108
|
701 |
#: core/templates/parts/customize-single-line-text.php:4
|
717 |
|
718 |
#: core/classes/class-form-styles.php:731
|
719 |
#: core/templates/parts/customize-checkbox.php:20
|
720 |
+
#: core/templates/parts/customize-checkbox.php:136
|
721 |
#: core/templates/parts/customize-email.php:28
|
722 |
#: core/templates/parts/customize-multi-line-text.php:28
|
723 |
#: core/templates/parts/customize-number.php:28
|
724 |
#: core/templates/parts/customize-radio.php:20
|
725 |
+
#: core/templates/parts/customize-radio.php:121
|
726 |
#: core/templates/parts/customize-select.php:24
|
727 |
#: core/templates/parts/customize-single-line-text.php:28
|
728 |
msgid "Hint"
|
829 |
|
830 |
#: core/classes/class-happyforms-core.php:209
|
831 |
#: core/classes/class-happyforms-core.php:210
|
832 |
+
#: inc/classes/class-message-controller.php:576
|
833 |
+
#: inc/classes/class-message-controller.php:577
|
834 |
msgid "Activity"
|
835 |
msgstr ""
|
836 |
|
842 |
|
843 |
#: core/classes/class-happyforms-core.php:227
|
844 |
#: core/classes/class-happyforms-core.php:228
|
845 |
+
#: core/assets/jsx/build/admin/block.js:173
|
846 |
+
#: core/assets/jsx/src/admin/block.js:61
|
847 |
msgid "Settings"
|
848 |
msgstr ""
|
849 |
|
2988 |
msgstr ""
|
2989 |
|
2990 |
#: core/templates/admin-form-modal.php:12
|
2991 |
+
#: core/assets/jsx/build/admin/block.js:158
|
2992 |
+
#: core/assets/jsx/src/admin/block.js:41
|
2993 |
msgid "Insert"
|
2994 |
msgstr ""
|
2995 |
|
3004 |
#: core/templates/customize-controls/setup/upsell.php:2
|
3005 |
#: core/templates/customize-form-part-footer.php:5
|
3006 |
#: core/templates/customize-form-parts-drawer.php:37
|
3007 |
+
#: inc/classes/class-answer-limiter-dummy.php:39
|
3008 |
#: inc/templates/customize-controls/checkbox_dummy.php:7
|
3009 |
#: inc/templates/customize-controls/email-parts-list-dummy.php:2
|
3010 |
msgid "Members Only"
|
3046 |
|
3047 |
#: core/templates/customize-form-item.php:33
|
3048 |
#: core/templates/customize-form-part-footer.php:3
|
3049 |
+
#: core/templates/parts/customize-checkbox.php:148
|
3050 |
+
#: core/templates/parts/customize-checkbox.php:163
|
3051 |
+
#: core/templates/parts/customize-radio.php:133
|
3052 |
+
#: core/templates/parts/customize-radio.php:148
|
3053 |
+
#: core/templates/parts/customize-select.php:121
|
3054 |
+
#: core/templates/parts/customize-select.php:136
|
3055 |
msgid "Delete"
|
3056 |
msgstr ""
|
3057 |
|
3154 |
#: core/templates/parts/customize-checkbox.php:36
|
3155 |
#: core/templates/parts/customize-radio.php:36
|
3156 |
#: core/templates/parts/customize-select.php:40
|
3157 |
+
msgid "Add heading"
|
3158 |
+
msgstr ""
|
3159 |
+
|
3160 |
+
#: core/templates/parts/customize-checkbox.php:37
|
3161 |
+
#: core/templates/parts/customize-radio.php:37
|
3162 |
+
#: core/templates/parts/customize-select.php:41
|
3163 |
msgid "Add choice"
|
3164 |
msgstr ""
|
3165 |
|
3166 |
+
#: core/templates/parts/customize-checkbox.php:39
|
3167 |
+
#: core/templates/parts/customize-radio.php:39
|
3168 |
+
#: core/templates/parts/customize-select.php:43
|
3169 |
msgid "Or, bulk add choices"
|
3170 |
msgstr ""
|
3171 |
|
3172 |
+
#: core/templates/parts/customize-checkbox.php:43
|
3173 |
+
#: core/templates/parts/customize-radio.php:43
|
3174 |
+
#: core/templates/parts/customize-select.php:47
|
3175 |
msgid "Add choices"
|
3176 |
msgstr ""
|
3177 |
|
3178 |
+
#: core/templates/parts/customize-checkbox.php:45
|
3179 |
+
#: core/templates/parts/customize-radio.php:45
|
3180 |
+
#: core/templates/parts/customize-select.php:49
|
3181 |
msgid "Cancel"
|
3182 |
msgstr ""
|
3183 |
|
3184 |
+
#: core/templates/parts/customize-checkbox.php:56
|
3185 |
+
#: core/templates/parts/customize-radio.php:56
|
3186 |
+
#: core/templates/parts/customize-select.php:56
|
3187 |
+
msgid "Add 'other' choice"
|
|
|
|
|
|
|
|
|
3188 |
msgstr ""
|
3189 |
|
3190 |
+
#: core/templates/parts/customize-checkbox.php:61
|
3191 |
+
#: core/templates/parts/customize-radio.php:61
|
3192 |
+
#: core/templates/parts/customize-select.php:62
|
3193 |
+
msgid "'Other' label"
|
3194 |
msgstr ""
|
3195 |
|
3196 |
#: core/templates/parts/customize-checkbox.php:65
|
3197 |
#: core/templates/parts/customize-radio.php:65
|
3198 |
#: core/templates/parts/customize-select.php:66
|
|
|
|
|
|
|
|
|
|
|
|
|
3199 |
msgid "'Other' placeholder"
|
3200 |
msgstr ""
|
3201 |
|
3202 |
+
#: core/templates/parts/customize-checkbox.php:72
|
3203 |
+
#: core/templates/parts/customize-radio.php:72
|
3204 |
+
#: core/templates/parts/customize-select.php:78
|
3205 |
msgid "Shuffle order of choices"
|
3206 |
msgstr ""
|
3207 |
|
3208 |
+
#: core/templates/parts/customize-checkbox.php:77
|
3209 |
msgid "Limit choices"
|
3210 |
msgstr ""
|
3211 |
|
3212 |
+
#: core/templates/parts/customize-checkbox.php:82
|
3213 |
msgid "Min choices"
|
3214 |
msgstr ""
|
3215 |
|
3216 |
+
#: core/templates/parts/customize-checkbox.php:86
|
3217 |
msgid "Max choices"
|
3218 |
msgstr ""
|
3219 |
|
3220 |
+
#: core/templates/parts/customize-checkbox.php:91
|
3221 |
+
#: core/templates/parts/customize-radio.php:76
|
3222 |
+
msgid "Align choices"
|
3223 |
+
msgstr ""
|
3224 |
+
|
3225 |
#: core/templates/parts/customize-checkbox.php:95
|
3226 |
#: core/templates/parts/customize-radio.php:80
|
3227 |
+
msgid "Vertically"
|
3228 |
msgstr ""
|
3229 |
|
3230 |
#: core/templates/parts/customize-checkbox.php:99
|
3231 |
#: core/templates/parts/customize-radio.php:84
|
3232 |
+
msgid "Horizontally"
|
3233 |
msgstr ""
|
3234 |
|
3235 |
+
#: core/templates/parts/customize-checkbox.php:105
|
3236 |
+
#: core/templates/parts/customize-email.php:48
|
3237 |
+
#: core/templates/parts/customize-multi-line-text.php:61
|
3238 |
+
#: core/templates/parts/customize-number.php:76
|
3239 |
+
#: core/templates/parts/customize-radio.php:90
|
3240 |
+
#: core/templates/parts/customize-select.php:83
|
3241 |
+
#: core/templates/parts/customize-single-line-text.php:47
|
3242 |
+
msgid "Require an answer"
|
3243 |
msgstr ""
|
3244 |
|
3245 |
+
#: core/templates/parts/customize-checkbox.php:114
|
3246 |
+
#: core/templates/parts/customize-email.php:57
|
3247 |
+
#: core/templates/parts/customize-multi-line-text.php:70
|
3248 |
+
#: core/templates/parts/customize-number.php:83
|
3249 |
+
#: core/templates/parts/customize-radio.php:97
|
3250 |
#: core/templates/parts/customize-select.php:89
|
3251 |
+
#: core/templates/parts/customize-single-line-text.php:56
|
3252 |
msgid "Additional CSS class(es)"
|
3253 |
msgstr ""
|
3254 |
|
3255 |
+
#: core/templates/parts/customize-checkbox.php:140
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3256 |
msgid "Max submissions"
|
3257 |
msgstr ""
|
3258 |
|
3259 |
+
#: core/templates/parts/customize-checkbox.php:144
|
3260 |
+
#: core/templates/parts/customize-radio.php:129
|
3261 |
+
#: core/templates/parts/customize-select.php:117
|
3262 |
+
msgid "Make this choice default"
|
3263 |
msgstr ""
|
3264 |
|
3265 |
+
#: core/templates/parts/customize-checkbox.php:149
|
3266 |
+
#: core/templates/parts/customize-radio.php:134
|
3267 |
+
#: core/templates/parts/customize-select.php:122
|
3268 |
msgid "More"
|
3269 |
msgstr ""
|
3270 |
|
3271 |
+
#: core/templates/parts/customize-checkbox.php:159
|
3272 |
+
#: core/templates/parts/customize-radio.php:144
|
3273 |
+
#: core/templates/parts/customize-select.php:132
|
3274 |
+
#: inc/classes/parts/class-part-layout-title-dummy.php:8
|
3275 |
+
msgid "Heading"
|
3276 |
+
msgstr ""
|
3277 |
+
|
3278 |
#: core/templates/parts/customize-email.php:24
|
3279 |
#: core/templates/parts/customize-multi-line-text.php:24
|
3280 |
#: core/templates/parts/customize-number.php:24
|
3282 |
msgid "Prefill"
|
3283 |
msgstr ""
|
3284 |
|
3285 |
+
#: core/templates/parts/customize-email.php:39
|
3286 |
+
#: core/templates/parts/customize-number.php:67
|
3287 |
+
#: core/templates/parts/customize-single-line-text.php:38
|
3288 |
msgid "Prefix"
|
3289 |
msgstr ""
|
3290 |
|
3291 |
+
#: core/templates/parts/customize-email.php:43
|
3292 |
+
#: core/templates/parts/customize-number.php:71
|
3293 |
+
#: core/templates/parts/customize-single-line-text.php:42
|
3294 |
msgid "Suffix"
|
3295 |
msgstr ""
|
3296 |
|
3297 |
+
#: core/templates/parts/customize-multi-line-text.php:40
|
3298 |
msgid "Limit words/characters"
|
3299 |
msgstr ""
|
3300 |
|
3301 |
+
#: core/templates/parts/customize-multi-line-text.php:46
|
3302 |
msgid "Limit"
|
3303 |
msgstr ""
|
3304 |
|
3305 |
+
#: core/templates/parts/customize-multi-line-text.php:50
|
3306 |
msgid "Count"
|
3307 |
msgstr ""
|
3308 |
|
3309 |
+
#: core/templates/parts/customize-number.php:35
|
3310 |
msgid "Min number"
|
3311 |
msgstr ""
|
3312 |
|
3313 |
+
#: core/templates/parts/customize-number.php:39
|
3314 |
msgid "Max number"
|
3315 |
msgstr ""
|
3316 |
|
3317 |
+
#: core/templates/parts/customize-number.php:43
|
3318 |
msgid "Step Interval"
|
3319 |
msgstr ""
|
3320 |
|
3321 |
+
#: core/templates/parts/customize-number.php:53
|
3322 |
msgid "Use number separators"
|
3323 |
msgstr ""
|
3324 |
|
3325 |
+
#: core/templates/parts/customize-number.php:58
|
3326 |
msgid "Grouping"
|
3327 |
msgstr ""
|
3328 |
|
3329 |
+
#: core/templates/parts/customize-number.php:62
|
3330 |
msgid "Decimal"
|
3331 |
msgstr ""
|
3332 |
|
3333 |
+
#: core/templates/parts/customize-radio.php:125
|
3334 |
+
#: core/templates/parts/customize-select.php:113
|
3335 |
+
msgid "Max number of submissions"
|
3336 |
+
msgstr ""
|
3337 |
+
|
3338 |
#: core/templates/preview-form-pencil.php:3
|
3339 |
msgid "Click to edit this part."
|
3340 |
msgstr ""
|
3341 |
|
3342 |
+
#: inc/classes/class-answer-limiter-dummy.php:38
|
3343 |
+
msgid "Max times the same answer is allowed"
|
3344 |
msgstr ""
|
3345 |
|
3346 |
#: inc/classes/class-happyforms.php:104
|
3396 |
msgstr ""
|
3397 |
|
3398 |
#: inc/classes/class-message-admin.php:59
|
|
|
|
|
|
|
|
|
3399 |
msgid "Submission"
|
3400 |
msgstr ""
|
3401 |
|
3402 |
+
#: inc/classes/class-message-admin.php:60
|
3403 |
msgid "In Response to"
|
3404 |
msgstr ""
|
3405 |
|
3406 |
+
#: inc/classes/class-message-admin.php:61
|
3407 |
msgid "Submitted on"
|
3408 |
msgstr ""
|
3409 |
|
3410 |
+
#: inc/classes/class-message-admin.php:77
|
3411 |
msgid "All"
|
3412 |
msgstr ""
|
3413 |
|
3414 |
+
#: inc/classes/class-message-admin.php:78
|
3415 |
msgid "Unread"
|
3416 |
msgstr ""
|
3417 |
|
3418 |
+
#: inc/classes/class-message-admin.php:79
|
3419 |
msgid "Read"
|
3420 |
msgstr ""
|
3421 |
|
3422 |
+
#: inc/classes/class-message-admin.php:80
|
3423 |
msgid "Spam"
|
3424 |
msgstr ""
|
3425 |
|
3426 |
+
#: inc/classes/class-message-controller.php:578
|
3427 |
+
#: inc/classes/class-message-controller.php:579
|
3428 |
msgid "All Activity"
|
3429 |
msgstr ""
|
3430 |
|
3431 |
+
#: inc/classes/class-message-controller.php:580
|
3432 |
msgid "No activity found."
|
3433 |
msgstr ""
|
3434 |
|
3468 |
msgid "Design"
|
3469 |
msgstr ""
|
3470 |
|
|
|
|
|
|
|
|
|
3471 |
#: inc/classes/parts/class-part-layout-title-dummy.php:9
|
3472 |
msgid "For adding titles to visually separate fields."
|
3473 |
msgstr ""
|
3830 |
msgstr ""
|
3831 |
|
3832 |
#: core/assets/jsx/build/admin/block.js:127
|
3833 |
+
#: core/assets/jsx/src/admin/block.js:15
|
3834 |
msgid "Choose"
|
3835 |
msgstr ""
|
3836 |
|
3837 |
+
#: core/assets/jsx/build/admin/block.js:144
|
3838 |
+
#: core/assets/jsx/src/admin/block.js:27
|
3839 |
+
msgid "The form previously added has been trashed or deleted."
|
3840 |
+
msgstr ""
|
3841 |
+
|
3842 |
+
#: core/assets/jsx/build/admin/block.js:144
|
3843 |
+
#: core/assets/jsx/src/admin/block.js:31
|
3844 |
msgid "Pick a form to display on your site."
|
3845 |
msgstr ""
|
3846 |
|
3847 |
+
#: core/assets/jsx/build/admin/block.js:175
|
3848 |
+
#: core/assets/jsx/src/admin/block.js:63
|
3849 |
msgid "Pick a form"
|
3850 |
msgstr ""
|
3851 |
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Contributors: happyforms
|
4 |
Tags: contact form, contact form plugin, forms, form builder, custom form, intake form, registration form, survey form, quiz form, payment form, newsletter form, giveaway form, fundraising form, donation form, nomination form, order form, questionnaire form, onboarding form, contract form, estimate form, research form, qualitative form, quantitative form, membership form, mobile form, feedback form, release form, inquiry form, request form, evaluation form, RSVP form, reservation form, sales lead form, popup form, quote form, event form, booking form, application form, agreement form, safety form, compliance form, assessment form, sponsorship form, report form, file upload form, satisfaction form
|
5 |
Requires at least: 5.0
|
6 |
-
Tested up to: 5.9.
|
7 |
Requires PHP: 7.0
|
8 |
-
Stable tag: 1.15.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -151,6 +151,16 @@ Aw, honestly, the thought that you're writing about our contact form builder is
|
|
151 |
|
152 |
== Changelog ==
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= 1.15.0 =
|
155 |
* Improvement: All frontend scripts are now bundled in a single file for better performance and cache friendliness.
|
156 |
* Bugfix: Duplicating a form would throw an error on PHP 8.0.
|
@@ -923,6 +933,9 @@ Aw, honestly, the thought that you're writing about our contact form builder is
|
|
923 |
|
924 |
== Upgrade Notice ==
|
925 |
|
|
|
|
|
|
|
926 |
= 1.15.0 =
|
927 |
* Single-bundle frontend scripts for better performance, form duplication bugfixes.
|
928 |
|
3 |
Contributors: happyforms
|
4 |
Tags: contact form, contact form plugin, forms, form builder, custom form, intake form, registration form, survey form, quiz form, payment form, newsletter form, giveaway form, fundraising form, donation form, nomination form, order form, questionnaire form, onboarding form, contract form, estimate form, research form, qualitative form, quantitative form, membership form, mobile form, feedback form, release form, inquiry form, request form, evaluation form, RSVP form, reservation form, sales lead form, popup form, quote form, event form, booking form, application form, agreement form, safety form, compliance form, assessment form, sponsorship form, report form, file upload form, satisfaction form
|
5 |
Requires at least: 5.0
|
6 |
+
Tested up to: 5.9.3
|
7 |
Requires PHP: 7.0
|
8 |
+
Stable tag: 1.15.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
151 |
|
152 |
== Changelog ==
|
153 |
|
154 |
+
= 1.15.1 =
|
155 |
+
* New feature: Checksum-based verification system against repeated spam submissions.
|
156 |
+
* New feature: Added "Headings" for Radio, Checkbox, and Dropdown field choices.
|
157 |
+
* Improvement: Happyforms block now displays a notice when a form published on page was trashed.
|
158 |
+
* Improvement: Re-arranged the position of "Require an Answer" control for better consistency.
|
159 |
+
* Improvement: Renamed "Limit submissions" control to "Max number of submissions" in all choice-type fields.
|
160 |
+
* Improvement: Improved usability of "Min number" and "Max number" controls in Number field.
|
161 |
+
* Improvement: In all choice-type fields, remaining submissions are now shown by default.
|
162 |
+
* Bugfix: Validation error on optional field with min/max requirements.
|
163 |
+
|
164 |
= 1.15.0 =
|
165 |
* Improvement: All frontend scripts are now bundled in a single file for better performance and cache friendliness.
|
166 |
* Bugfix: Duplicating a form would throw an error on PHP 8.0.
|
933 |
|
934 |
== Upgrade Notice ==
|
935 |
|
936 |
+
= 1.15.1 =
|
937 |
+
* New checksum-based verification system against spam, headings for choice-based fields, miscellaneous improvements and bugfixes
|
938 |
+
|
939 |
= 1.15.0 =
|
940 |
* Single-bundle frontend scripts for better performance, form duplication bugfixes.
|
941 |
|