Commit 28320aa8 authored by Kevin Stover's avatar Kevin Stover

Merge branch 'develop'

parents 824bf58b a675bdb7
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
[Contributors](https://github.com/wpninjas/ninja-forms/graphs/contributors) [Contributors](https://github.com/wpninjas/ninja-forms/graphs/contributors)
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration, Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.4 Requires at least: 4.5
Tested up to: 4.6.1 Tested up to: 4.7
Stable tag: 3.0.18 Stable tag: 3.0.18
License: GPLv2 or later License: GPLv2 or later
......
...@@ -105,8 +105,6 @@ define([], function() { ...@@ -105,8 +105,6 @@ define([], function() {
} }
this.totalModel.set( 'value', newTotal.toFixed( 2 ) ); this.totalModel.set( 'value', newTotal.toFixed( 2 ) );
// this.totalModel.set( 'reRender', true );
// this.totalModel.set( 'reRender', false );
this.totalModel.trigger( 'reRender' ); this.totalModel.trigger( 'reRender' );
} }
}); });
......
...@@ -188,9 +188,20 @@ define( [], function() { ...@@ -188,9 +188,20 @@ define( [], function() {
} }
}, },
currencySymbol: function() { renderCurrencyFormatting: function( number ) {
/*
* Our number will have a . as a decimal point. We want to replace that with our locale decimal, nfi18n.decimal_point.
*/
var replacedDecimal = number.toString().replace( '.', '||' );
/*
* Add thousands separator. Our original number var won't have thousands separators.
*/
var replacedThousands = replacedDecimal.replace( /\B(?=(\d{3})+(?!\d))/g, nfi18n.thousands_sep );
var formattedNumber = replacedThousands.replace( '||', nfi18n.decimal_point );
var form = nfRadio.channel( 'app' ).request( 'get:form', that.model.get( 'formID' ) ); var form = nfRadio.channel( 'app' ).request( 'get:form', that.model.get( 'formID' ) );
return form.get( 'settings' ).currency_symbol; var currency_symbol = form.get( 'settings' ).currency_symbol;
return currency_symbol + formattedNumber;
} }
}; };
}, },
......
This diff is collapsed.
/*!
* modernizr v3.3.1
*/
!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,s,u;for(var a in h)if(h.hasOwnProperty(a)){if(e=[],t=h[a],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)s=e[i],u=s.split("."),1===u.length?g[u[0]]=o:(!g[u[0]]||g[u[0]]instanceof Boolean||(g[u[0]]=new Boolean(g[u[0]])),g[u[0]][u[1]]=o),C.push((o?"":"no-")+u.join("-"))}}function i(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):b?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function s(){var e=t.body;return e||(e=i(b?"svg":"body"),e.fake=!0),e}function u(e,n,r,o){var u,a,l,f,p="modernizr",d=i("div"),c=s();if(parseInt(r,10))for(;r--;)l=i("div"),l.id=o?o[r]:p+(r+1),d.appendChild(l);return u=i("style"),u.type="text/css",u.id="s"+p,(c.fake?c:d).appendChild(u),c.appendChild(d),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(t.createTextNode(e)),d.id=p,c.fake&&(c.style.background="",c.style.overflow="hidden",f=_.style.overflow,_.style.overflow="hidden",_.appendChild(c)),a=n(d,e),c.fake?(c.parentNode.removeChild(c),_.style.overflow=f,_.offsetHeight):d.parentNode.removeChild(d),!!a}function a(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function l(e,t){return function(){return e.apply(t,arguments)}}function f(e,t,n){var o;for(var i in e)if(e[i]in t)return n===!1?e[i]:(o=t[e[i]],r(o,"function")?l(o,n||t):o);return!1}function p(e,t){return!!~(""+e).indexOf(t)}function d(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(d(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+d(t[o])+":"+r+")");return i=i.join(" or "),u("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function m(e,t,o,s){function u(){f&&(delete N.style,delete N.modElem)}if(s=r(s,"undefined")?!1:s,!r(o,"undefined")){var l=c(e,o);if(!r(l,"undefined"))return l}for(var f,d,m,v,h,y=["modernizr","tspan","samp"];!N.style&&y.length;)f=!0,N.modElem=i(y.shift()),N.style=N.modElem.style;for(m=e.length,d=0;m>d;d++)if(v=e[d],h=N.style[v],p(v,"-")&&(v=a(v)),N.style[v]!==n){if(s||r(o,"undefined"))return u(),"pfx"==t?v:!0;try{N.style[v]=o}catch(g){}if(N.style[v]!=h)return u(),"pfx"==t?v:!0}return u(),!1}function v(e,t,n,o,i){var s=e.charAt(0).toUpperCase()+e.slice(1),u=(e+" "+z.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(u,t,o,i):(u=(e+" "+O.join(s+" ")+s).split(" "),f(u,t,n))}var h=[],y={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!1,enableJSClass:!1,usePrefixes:!1},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){h.push({name:e,fn:t,options:n})},addAsyncTest:function(e){h.push({name:null,fn:e})}},g=function(){};g.prototype=y,g=new g;var C=[],_=t.documentElement,w=y._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];y._prefixes=w;var b="svg"===_.nodeName.toLowerCase(),x=i("input"),S="search tel url email datetime date month week time datetime-local number range color".split(" "),E={};g.inputtypes=function(e){for(var r,o,i,s=e.length,u="1)",a=0;s>a;a++)x.setAttribute("type",r=e[a]),i="text"!==x.type&&"style"in x,i&&(x.value=u,x.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(r)&&x.style.WebkitAppearance!==n?(_.appendChild(x),o=t.defaultView,i=o.getComputedStyle&&"textfield"!==o.getComputedStyle(x,null).WebkitAppearance&&0!==x.offsetHeight,_.removeChild(x)):/^(search|tel)$/.test(r)||(i=/^(url|email)$/.test(r)?x.checkValidity&&x.checkValidity()===!1:x.value!=u)),E[e[a]]=!!i;return E}(S);var T=y.testStyles=u;g.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",w.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");T(r,function(e){n=9===e.offsetTop})}return n});var A=function(){function e(e,t){var o;return e?(t&&"string"!=typeof t||(t=i(t||"div")),e="on"+e,o=e in t,!o&&r&&(t.setAttribute||(t=i("div")),t.setAttribute(e,""),o="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),o):!1}var r=!("onblur"in t.documentElement);return e}();y.hasEvent=A;var k="Moz O ms Webkit",O=y._config.usePrefixes?k.toLowerCase().split(" "):[];y._domPrefixes=O;var z=y._config.usePrefixes?k.split(" "):[];y._cssomPrefixes=z;var P=function(t){var r,o=w.length,i=e.CSSRule;if("undefined"==typeof i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in i)return"@"+t;for(var s=0;o>s;s++){var u=w[s],a=u.toUpperCase()+"_"+r;if(a in i)return"@-"+u.toLowerCase()+"-"+t}return!1};y.atRule=P;var L={elem:i("modernizr")};g._q.push(function(){delete L.elem});var N={style:L.elem.style};g._q.unshift(function(){delete N.style}),y.testAllProps=v;var R=y.prefixed=function(e,t,n){return 0===e.indexOf("@")?P(e):(-1!=e.indexOf("-")&&(e=a(e)),t?v(e,t,n):v(e,"pfx"))};g.addTest("forcetouch",function(){return A(R("mouseforcewillbegin",e,!1),e)?MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN&&MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN:!1}),o(),delete y.addTest,delete y.addAsyncTest;for(var U=0;U<g._q.length;U++)g._q[U]();e.Modernizr=g}(window,document);
\ No newline at end of file
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* var $ = jQuery; has been added for jQuery no conflict mode. * var $ = jQuery; has been added for jQuery no conflict mode.
* $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div. * $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div.
* placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder. * placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder.
*
* Modernizr dependency has been removed.
*/ */
(function (root, factory) { (function (root, factory) {
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
format: "YYYY-MM-DD", format: "YYYY-MM-DD",
outputFormat: "YYYY-MM-DD", outputFormat: "YYYY-MM-DD",
checkIfNativeDate: function () { checkIfNativeDate: function () {
return Modernizr.inputtypes.date && (Modernizr.touch && navigator.appVersion.indexOf("Win") === -1); return false;
}, },
classes: "", classes: "",
placeholder: "", placeholder: "",
......
...@@ -4,5 +4,7 @@ ...@@ -4,5 +4,7 @@
* var $ = jQuery; has been added for jQuery no conflict mode. * var $ = jQuery; has been added for jQuery no conflict mode.
* $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div. * $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div.
* placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder. * placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder.
*
* Modernizr dependency has been removed.
*/ */
!function(e,a){"function"==typeof define?define("pikaday-responsive",["exports"],function(e){return e["default"]=a()}):"object"==typeof module?module.exports=a():e.pikadayResponsive=a()}(this,function(){var e=jQuery;if(!moment)return void console.error("You need to load moment.js in order to use pikaday-responsive.");if(!jQuery)return void console.error("You need to load jQuery in order to use pikaday-responsive.");if(!Pikaday)return void console.error("You need to load pikaday in order to use pikaday-responsive.");var a={format:"YYYY-MM-DD",outputFormat:"YYYY-MM-DD",checkIfNativeDate:function(){return Modernizr.inputtypes.date&&Modernizr.touch&&-1===navigator.appVersion.indexOf("Win")},classes:"",placeholder:"",pikadayOptions:{},dayOffset:0};return function(t,n){var o,i,r,d=e(t),l=e.extend({},a,n),p={pikaday:null,value:null,date:null,element:d[0]};if(!d.length||"INPUT"!==d[0].tagName)return console.error("pikadayResponsive expects an input-field as its first element.",d[0]),!1;if(d.attr("type","hidden"),d.wrap("<div class='pikaday__container'></div>"),o=d.parent(".pikaday__container"),l.checkIfNativeDate())i=e("<input type='date' class='pikaday__invisible' placeholder='"+l.placeholder+"' />"),o.append(i),r=e("<input type='text' readonly='readonly' class='pikaday__display pikaday__display--native "+l.classes+"' placeholder='"+l.placeholder+"' />"),o.append(r),i.on("change",function(){var a=e(this).val();r.removeClass("is-empty"),a?(p.date=moment(a,"YYYY-MM-DD"),p.value=p.date.format(l.outputFormat)):(p.date=null,p.value=null,r.addClass("is-empty")),1*p.value===parseInt(p.value,10)&&(p.value*=1),d.val(p.value),p.date?r.val(p.date.format(l.format)):r.val(null),d.trigger("change"),d.trigger("change-date",[p])});else{i=e("<input type='text' class='pikaday__display pikaday__display--pikaday "+l.classes+"' placeholder='"+l.placeholder+"' />"),o.append(i);var s=!1,u=null;p.pikaday=new Pikaday(e.extend({},l.pikadayOptions,{field:i[0],format:l.format})),i.on("change",function(){if(!s){s=!0,u=window.setTimeout(function(){s=!1},10);var a=e(this).val();i.removeClass("is-empty"),a?(p.date=moment(a,l.format),p.date.add(l.dayOffset,"day"),p.value=p.date.format(l.outputFormat),e(this).val(p.date.format(l.format))):(p.date=null,p.value=null,i.addClass("is-empty")),1*p.value===parseInt(p.value,10)&&(p.value*=1),d.val(p.value),setTimeout(function(){d.trigger("change"),d.trigger("change-date",[p])},1)}})}var y=function(e,a){return e?("object"==typeof e&&"function"!=typeof e.format&&(e=moment(e)),"string"==typeof e&&("undefined"!=typeof a&&a||(a=l.outputFormat),e=moment(e,a)),"number"==typeof e&&(e=moment(e)),p.pikaday?p.pikaday.setMoment(e):(i.val(e.format("YYYY-MM-DD")),i.trigger("change")),e):(p.pikaday?p.pikaday.setDate(null):(i.val(null),i.trigger("change")),null)};return d.val()&&y(d.val()),p.setDate=y,p}}); !function(a,b){"function"==typeof define?define("pikaday-responsive",["exports"],function(a){return a.default=b()}):"object"==typeof module?module.exports=b():a.pikadayResponsive=b()}(this,function(){var a=jQuery;if(!moment)return void console.error("You need to load moment.js in order to use pikaday-responsive.");if(!jQuery)return void console.error("You need to load jQuery in order to use pikaday-responsive.");if(!Pikaday)return void console.error("You need to load pikaday in order to use pikaday-responsive.");var b={format:"YYYY-MM-DD",outputFormat:"YYYY-MM-DD",checkIfNativeDate:function(){return!1},classes:"",placeholder:"",pikadayOptions:{},dayOffset:0};return function(c,d){var g,h,i,e=a(c),f=a.extend({},b,d),j={pikaday:null,value:null,date:null,element:e[0]};if(!e.length||"INPUT"!==e[0].tagName)return console.error("pikadayResponsive expects an input-field as its first element.",e[0]),!1;if(e.attr("type","hidden"),e.wrap("<div class='pikaday__container'></div>"),g=e.parent(".pikaday__container"),f.checkIfNativeDate())h=a("<input type='date' class='pikaday__invisible' placeholder='"+f.placeholder+"' />"),g.append(h),i=a("<input type='text' readonly='readonly' class='pikaday__display pikaday__display--native "+f.classes+"' placeholder='"+f.placeholder+"' />"),g.append(i),h.on("change",function(){var b=a(this).val();i.removeClass("is-empty"),b?(j.date=moment(b,"YYYY-MM-DD"),j.value=j.date.format(f.outputFormat)):(j.date=null,j.value=null,i.addClass("is-empty")),1*j.value===parseInt(j.value,10)&&(j.value*=1),e.val(j.value),j.date?i.val(j.date.format(f.format)):i.val(null),e.trigger("change"),e.trigger("change-date",[j])});else{h=a("<input type='text' class='pikaday__display pikaday__display--pikaday "+f.classes+"' placeholder='"+f.placeholder+"' />"),g.append(h);var k=!1,l=null;j.pikaday=new Pikaday(a.extend({},f.pikadayOptions,{field:h[0],format:f.format})),h.on("change",function(){if(!k){k=!0,l=window.setTimeout(function(){k=!1},10);var b=a(this).val();h.removeClass("is-empty"),b?(j.date=moment(b,f.format),j.date.add(f.dayOffset,"day"),j.value=j.date.format(f.outputFormat),a(this).val(j.date.format(f.format))):(j.date=null,j.value=null,h.addClass("is-empty")),1*j.value===parseInt(j.value,10)&&(j.value*=1),e.val(j.value),setTimeout(function(){e.trigger("change"),e.trigger("change-date",[j])},1)}})}var m=function(a,b){return a?("object"==typeof a&&"function"!=typeof a.format&&(a=moment(a)),"string"==typeof a&&("undefined"!=typeof b&&b||(b=f.outputFormat),a=moment(a,b)),"number"==typeof a&&(a=moment(a)),j.pikaday?j.pikaday.setMoment(a):(h.val(a.format("YYYY-MM-DD")),h.trigger("change")),a):(j.pikaday?j.pikaday.setDate(null):(h.val(null),h.trigger("change")),null)};return e.val()&&m(e.val()),j.setDate=m,j}});
\ No newline at end of file \ No newline at end of file
...@@ -90,5 +90,7 @@ llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[N ...@@ -90,5 +90,7 @@ llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[N
* var $ = jQuery; has been added for jQuery no conflict mode. * var $ = jQuery; has been added for jQuery no conflict mode.
* $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div. * $el.wrap("<span class='pikaday__container'></span>"); has been changed to $el.wrap("<div class='pikaday__container'></div>"); so that the container is a div.
* placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder. * placeholder: "Select a date", has been changed to placeholder: "", to remove the placeholder.
*
* Modernizr dependency has been removed.
*/ */
!function(e,a){"function"==typeof define?define("pikaday-responsive",["exports"],function(e){return e["default"]=a()}):"object"==typeof module?module.exports=a():e.pikadayResponsive=a()}(this,function(){var e=jQuery;if(!moment)return void console.error("You need to load moment.js in order to use pikaday-responsive.");if(!jQuery)return void console.error("You need to load jQuery in order to use pikaday-responsive.");if(!Pikaday)return void console.error("You need to load pikaday in order to use pikaday-responsive.");var a={format:"YYYY-MM-DD",outputFormat:"YYYY-MM-DD",checkIfNativeDate:function(){return Modernizr.inputtypes.date&&Modernizr.touch&&-1===navigator.appVersion.indexOf("Win")},classes:"",placeholder:"",pikadayOptions:{},dayOffset:0};return function(t,n){var o,i,r,d=e(t),l=e.extend({},a,n),p={pikaday:null,value:null,date:null,element:d[0]};if(!d.length||"INPUT"!==d[0].tagName)return console.error("pikadayResponsive expects an input-field as its first element.",d[0]),!1;if(d.attr("type","hidden"),d.wrap("<div class='pikaday__container'></div>"),o=d.parent(".pikaday__container"),l.checkIfNativeDate())i=e("<input type='date' class='pikaday__invisible' placeholder='"+l.placeholder+"' />"),o.append(i),r=e("<input type='text' readonly='readonly' class='pikaday__display pikaday__display--native "+l.classes+"' placeholder='"+l.placeholder+"' />"),o.append(r),i.on("change",function(){var a=e(this).val();r.removeClass("is-empty"),a?(p.date=moment(a,"YYYY-MM-DD"),p.value=p.date.format(l.outputFormat)):(p.date=null,p.value=null,r.addClass("is-empty")),1*p.value===parseInt(p.value,10)&&(p.value*=1),d.val(p.value),p.date?r.val(p.date.format(l.format)):r.val(null),d.trigger("change"),d.trigger("change-date",[p])});else{i=e("<input type='text' class='pikaday__display pikaday__display--pikaday "+l.classes+"' placeholder='"+l.placeholder+"' />"),o.append(i);var s=!1,u=null;p.pikaday=new Pikaday(e.extend({},l.pikadayOptions,{field:i[0],format:l.format})),i.on("change",function(){if(!s){s=!0,u=window.setTimeout(function(){s=!1},10);var a=e(this).val();i.removeClass("is-empty"),a?(p.date=moment(a,l.format),p.date.add(l.dayOffset,"day"),p.value=p.date.format(l.outputFormat),e(this).val(p.date.format(l.format))):(p.date=null,p.value=null,i.addClass("is-empty")),1*p.value===parseInt(p.value,10)&&(p.value*=1),d.val(p.value),setTimeout(function(){d.trigger("change"),d.trigger("change-date",[p])},1)}})}var y=function(e,a){return e?("object"==typeof e&&"function"!=typeof e.format&&(e=moment(e)),"string"==typeof e&&("undefined"!=typeof a&&a||(a=l.outputFormat),e=moment(e,a)),"number"==typeof e&&(e=moment(e)),p.pikaday?p.pikaday.setMoment(e):(i.val(e.format("YYYY-MM-DD")),i.trigger("change")),e):(p.pikaday?p.pikaday.setDate(null):(i.val(null),i.trigger("change")),null)};return d.val()&&y(d.val()),p.setDate=y,p}}); !function(a,b){"function"==typeof define?define("pikaday-responsive",["exports"],function(a){return a.default=b()}):"object"==typeof module?module.exports=b():a.pikadayResponsive=b()}(this,function(){var a=jQuery;if(!moment)return void console.error("You need to load moment.js in order to use pikaday-responsive.");if(!jQuery)return void console.error("You need to load jQuery in order to use pikaday-responsive.");if(!Pikaday)return void console.error("You need to load pikaday in order to use pikaday-responsive.");var b={format:"YYYY-MM-DD",outputFormat:"YYYY-MM-DD",checkIfNativeDate:function(){return!1},classes:"",placeholder:"",pikadayOptions:{},dayOffset:0};return function(c,d){var g,h,i,e=a(c),f=a.extend({},b,d),j={pikaday:null,value:null,date:null,element:e[0]};if(!e.length||"INPUT"!==e[0].tagName)return console.error("pikadayResponsive expects an input-field as its first element.",e[0]),!1;if(e.attr("type","hidden"),e.wrap("<div class='pikaday__container'></div>"),g=e.parent(".pikaday__container"),f.checkIfNativeDate())h=a("<input type='date' class='pikaday__invisible' placeholder='"+f.placeholder+"' />"),g.append(h),i=a("<input type='text' readonly='readonly' class='pikaday__display pikaday__display--native "+f.classes+"' placeholder='"+f.placeholder+"' />"),g.append(i),h.on("change",function(){var b=a(this).val();i.removeClass("is-empty"),b?(j.date=moment(b,"YYYY-MM-DD"),j.value=j.date.format(f.outputFormat)):(j.date=null,j.value=null,i.addClass("is-empty")),1*j.value===parseInt(j.value,10)&&(j.value*=1),e.val(j.value),j.date?i.val(j.date.format(f.format)):i.val(null),e.trigger("change"),e.trigger("change-date",[j])});else{h=a("<input type='text' class='pikaday__display pikaday__display--pikaday "+f.classes+"' placeholder='"+f.placeholder+"' />"),g.append(h);var k=!1,l=null;j.pikaday=new Pikaday(a.extend({},f.pikadayOptions,{field:h[0],format:f.format})),h.on("change",function(){if(!k){k=!0,l=window.setTimeout(function(){k=!1},10);var b=a(this).val();h.removeClass("is-empty"),b?(j.date=moment(b,f.format),j.date.add(f.dayOffset,"day"),j.value=j.date.format(f.outputFormat),a(this).val(j.date.format(f.format))):(j.date=null,j.value=null,h.addClass("is-empty")),1*j.value===parseInt(j.value,10)&&(j.value*=1),e.val(j.value),setTimeout(function(){e.trigger("change"),e.trigger("change-date",[j])},1)}})}var m=function(a,b){return a?("object"==typeof a&&"function"!=typeof a.format&&(a=moment(a)),"string"==typeof a&&("undefined"!=typeof b&&b||(b=f.outputFormat),a=moment(a,b)),"number"==typeof a&&(a=moment(a)),j.pikaday?j.pikaday.setMoment(a):(h.val(a.format("YYYY-MM-DD")),h.trigger("change")),a):(j.pikaday?j.pikaday.setDate(null):(h.val(null),h.trigger("change")),null)};return e.val()&&m(e.val()),j.setDate=m,j}});
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -265,7 +265,7 @@ class Ninja_Forms { ...@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version // Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) ) if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.18' ); define( 'NF_PLUGIN_VERSION', '3.0.19' );
// Plugin Folder Path // Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) ) if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
...@@ -80,7 +80,6 @@ gulp.task('js:frontend', function(){ ...@@ -80,7 +80,6 @@ gulp.task('js:frontend', function(){
gulp.src([ gulp.src([
'assets/js/lib/bootstrap.min.js', 'assets/js/lib/bootstrap.min.js',
'assets/js/lib/modernizr.min.js',
'assets/js/lib/codemirror.min.js', 'assets/js/lib/codemirror.min.js',
'assets/js/lib/codemirror-xml.min.js', 'assets/js/lib/codemirror-xml.min.js',
'assets/js/lib/codemirror-formatting.min.js', 'assets/js/lib/codemirror-formatting.min.js',
......
<?php if ( ! defined( 'ABSPATH' ) ) exit; <?php if ( ! defined( 'ABSPATH' ) ) exit;
global $wp_locale;
return apply_filters( 'ninja_forms_i18n_front_end', array( return apply_filters( 'ninja_forms_i18n_front_end', array(
'ninjaForms' => __( 'Ninja Forms', 'ninja-forms' ), 'ninjaForms' => __( 'Ninja Forms', 'ninja-forms' ),
'changeEmailErrorMsg' => __( 'Please enter a valid email address!', 'ninja-forms' ), 'changeEmailErrorMsg' => __( 'Please enter a valid email address!', 'ninja-forms' ),
'confirmFieldErrorMsg' => __( 'These fields must match!', 'ninja-forms' ), 'confirmFieldErrorMsg' => __( 'These fields must match!', 'ninja-forms' ),
'fieldNumberNumMinError' => __( 'Number Min Error', 'ninja-forms' ), 'fieldNumberNumMinError' => __( 'Number Min Error', 'ninja-forms' ),
'fieldNumberNumMaxError' => __( 'Number Max Error', 'ninja-forms' ), 'fieldNumberNumMaxError' => __( 'Number Max Error', 'ninja-forms' ),
'fieldNumberIncrementBy' => __( 'Please increment by ', 'ninja-forms' ), 'fieldNumberIncrementBy' => __( 'Please increment by ', 'ninja-forms' ),
'fieldTextareaRTEInsertLink' => __( 'Insert Link', 'ninja-forms' ), 'fieldTextareaRTEInsertLink' => __( 'Insert Link', 'ninja-forms' ),
'fieldTextareaRTEInsertMedia' => __( 'Insert Media', 'ninja-forms' ), 'fieldTextareaRTEInsertMedia' => __( 'Insert Media', 'ninja-forms' ),
'fieldTextareaRTESelectAFile' => __( 'Select a file', 'ninja-forms' ), 'fieldTextareaRTESelectAFile' => __( 'Select a file', 'ninja-forms' ),
'formErrorsCorrectErrors' => __( 'Please correct errors before submitting this form.', 'ninja-forms' ), 'formErrorsCorrectErrors' => __( 'Please correct errors before submitting this form.', 'ninja-forms' ),
'validateRequiredField' => __( 'This is a required field.', 'ninja-forms' ), 'validateRequiredField' => __( 'This is a required field.', 'ninja-forms' ),
'honeypotHoneypotError' => __( 'Honeypot Error', 'ninja-forms' ), 'honeypotHoneypotError' => __( 'Honeypot Error', 'ninja-forms' ),
'fileUploadOldCodeFileUploadInProgress' => __( 'File Upload in Progress.', 'ninja-forms' ), 'fileUploadOldCodeFileUploadInProgress' => __( 'File Upload in Progress.', 'ninja-forms' ),
'fileUploadOldCodeFileUpload' => __( 'FILE UPLOAD', 'ninja-forms' ), 'fileUploadOldCodeFileUpload' => __( 'FILE UPLOAD', 'ninja-forms' ),
'currencySymbol' => Ninja_Forms()->get_setting( 'currency_symbol' ), 'currencySymbol' => Ninja_Forms()->get_setting( 'currency_symbol' ),
'fieldsMarkedRequired' => sprintf( __( 'Fields marked with an %s*%s are required', 'ninja-forms' ), '<span class="ninja-forms-req-symbol">', '</span>' ) 'fieldsMarkedRequired' => sprintf( __( 'Fields marked with an %s*%s are required', 'ninja-forms' ), '<span class="ninja-forms-req-symbol">', '</span>' ),
'thousands_sep' => $wp_locale->number_format[ 'thousands_sep' ],
'decimal_point' => $wp_locale->number_format[ 'decimal_point' ],
)); ));
...@@ -37,6 +37,8 @@ final class NF_Display_Render ...@@ -37,6 +37,8 @@ final class NF_Display_Render
public static function localize( $form_id ) public static function localize( $form_id )
{ {
global $wp_locale;
$capability = apply_filters( 'ninja_forms_display_test_values_capabilities', 'read' ); $capability = apply_filters( 'ninja_forms_display_test_values_capabilities', 'read' );
if( isset( $_GET[ 'ninja_forms_test_values' ] ) && current_user_can( $capability ) ){ if( isset( $_GET[ 'ninja_forms_test_values' ] ) && current_user_can( $capability ) ){
self::$use_test_values = TRUE; self::$use_test_values = TRUE;
...@@ -253,15 +255,25 @@ final class NF_Display_Render ...@@ -253,15 +255,25 @@ final class NF_Display_Render
} }
} }
$thousands_sep = $wp_locale->number_format[ 'thousands_sep'];
$decimal_point = $wp_locale->number_format[ 'decimal_point' ];
// TODO: Find a better way to do this. // TODO: Find a better way to do this.
if ('shipping' == $settings['type']) { if ('shipping' == $settings['type']) {
$settings['shipping_cost'] = preg_replace ('/[^\d,\.]/', '', $settings['shipping_cost']); $settings[ 'shipping_cost' ] = preg_replace ('/[^\d,\.]/', '', $settings[ 'shipping_cost' ] );
$settings['shipping_cost'] = str_replace( Ninja_Forms()->get_setting( 'currency_symbol' ), '', $settings['shipping_cost']); $settings[ 'shipping_cost' ] = str_replace( Ninja_Forms()->get_setting( 'currency_symbol' ), '', $settings[ 'shipping_cost' ] );
$settings['shipping_cost'] = number_format($settings['shipping_cost'], 2);
$settings[ 'shipping_cost' ] = str_replace( $decimal_point, '||', $settings[ 'shipping_cost' ] );
$settings[ 'shipping_cost' ] = str_replace( $thousands_sep, '', $settings[ 'shipping_cost' ] );
$settings[ 'shipping_cost' ] = str_replace( '||', '.', $settings[ 'shipping_cost' ] );
} elseif ('product' == $settings['type']) { } elseif ('product' == $settings['type']) {
$settings['product_price'] = preg_replace ('/[^\d,\.]/', '', $settings[ 'product_price' ] ); $settings['product_price'] = preg_replace ('/[^\d,\.]/', '', $settings[ 'product_price' ] );
$settings['product_price'] = str_replace( Ninja_Forms()->get_setting( 'currency_symbol' ), '', $settings['product_price']); $settings['product_price'] = str_replace( Ninja_Forms()->get_setting( 'currency_symbol' ), '', $settings['product_price']);
$settings['product_price'] = number_format($settings['product_price'], 2);
$settings[ 'product_price' ] = str_replace( $decimal_point, '||', $settings[ 'product_price' ] );
$settings[ 'product_price' ] = str_replace( $thousands_sep, '', $settings[ 'product_price' ] );
$settings[ 'product_price' ] = str_replace( '||', '.', $settings[ 'product_price' ] );
} elseif ('total' == $settings['type'] && isset($settings['value'])) { } elseif ('total' == $settings['type'] && isset($settings['value'])) {
$settings['value'] = number_format($settings['value'], 2); $settings['value'] = number_format($settings['value'], 2);
} }
...@@ -498,6 +510,7 @@ final class NF_Display_Render ...@@ -498,6 +510,7 @@ final class NF_Display_Render
public static function enqueue_scripts( $form_id, $is_preview = false ) public static function enqueue_scripts( $form_id, $is_preview = false )
{ {
global $wp_locale;
$form = Ninja_Forms()->form( $form_id )->get(); $form = Ninja_Forms()->form( $form_id )->get();
$ver = Ninja_Forms::VERSION; $ver = Ninja_Forms::VERSION;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<script id="tmpl-nf-product-single" type="text/template"> <script id="tmpl-nf-product-single" type="text/template">
<span class="nf-product-price-label">{{{ nfi18n.fieldsProductsPrice }}}</span> <span class="nf-product-price-label">{{{ nfi18n.fieldsProductsPrice }}}</span>
<span class="nf-product-price">{{{ data.currencySymbol() }}}{{{ data.product_price }}}</span> <span class="nf-product-price">{{{ data.renderCurrencyFormatting( data.product_price ) }}}</span>
{{{ data.renderProductQuantity() }}} {{{ data.renderProductQuantity() }}}
</script> </script>
......
<script id="tmpl-nf-field-shipping" type="text/template"> <script id="tmpl-nf-field-shipping" type="text/template">
<span id="nf-field-{{{ data.id }}}" name="nf-field-{{{ data.id }}}" class="nf-static {{{ data.renderClasses() }}} nf-element">{{{ data.currencySymbol() }}} {{{ data.shipping_cost }}}</span> <span id="nf-field-{{{ data.id }}}" name="nf-field-{{{ data.id }}}" class="nf-static {{{ data.renderClasses() }}} nf-element">{{{ data.renderCurrencyFormatting( data.shipping_cost ) }}}</span>
</script> </script>
<script id="tmpl-nf-field-total" type="text/template"> <script id="tmpl-nf-field-total" type="text/template">
<span id="nf-field-{{{ data.id }}}" name="nf-field-{{{ data.id }}}" class="nf-static {{{ data.renderClasses() }}} nf-element">{{{ data.currencySymbol() }}}{{{ data.value }}}</span> <span id="nf-field-{{{ data.id }}}" name="nf-field-{{{ data.id }}}" class="nf-static {{{ data.renderClasses() }}} nf-element">{{{ data.renderCurrencyFormatting( data.value ) }}}</span>
</script> </script>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/ Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features. Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 3.0.18 Version: 3.0.19
Author: The WP Ninjas Author: The WP Ninjas
Author URI: http://ninjaforms.com Author URI: http://ninjaforms.com
Text Domain: ninja-forms Text Domain: ninja-forms
...@@ -51,7 +51,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf ...@@ -51,7 +51,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/** /**
* @since 3.0 * @since 3.0
*/ */
const VERSION = '3.0.18'; const VERSION = '3.0.19';
/** /**
* @var Ninja_Forms * @var Ninja_Forms
......
=== Ninja Forms === === Ninja Forms ===
Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach, aman086, daveshine, mordauk, bftrick, helgatheviking Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach, aman086, daveshine, mordauk, bftrick, helgatheviking
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration, Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.4 Requires at least: 4.5
Tested up to: 4.6.1 Tested up to: 4.7
Stable tag: 3.0.18 Stable tag: 3.0.19
License: GPLv2 or later License: GPLv2 or later
Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more! Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more!
...@@ -102,33 +102,21 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati ...@@ -102,33 +102,21 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice == == Upgrade Notice ==
= 3.0.18 (06 December 2016) = = 3.0.19 (07 December 2016) =
*Bugs:* *Bugs:*
* Fixed a bug with the deprecated code base and version 3.0.17. * Product, Shipping, and Total fields should now work in all locales.
* When using the RTE setting on the textarea field, the media button should show on all themes. * Fixed a major bug preventing forms with date fields from showing in some instances.
* The Modernizr library should only be loaded if you are using the RTE on the front-end.
* System date merge tag should respect the date format plugin setting.
* Exported submissions should always have correct order.
* Fixed a bug with list fields that caused the wrong one to be selected if calc values are used.
* HTML entered into field and list option labels should be rendered properly.
* Fixed a bug that caused the date picker to fail on the front-end.
* Filtering field values before display should now work properly in all instances.
* Help text should always render properly on the front-end.
* Fixed a bug with rendering the ReCaptcha field in the 2.9.x codebase.
* Error messages should work properly when displaying multiple forms on the same page.
*Changes:* == Changelog ==
* The browser should scroll to the success message after a form is submitted. = 3.0.19 (07 December 2016) =
* Added a label to the ReCaptcha field.
* Added decimal date seperators (MM.DD.YYYY, YYYY.MM.DD, etc.) to the date field setting.
* Sending initial data to api.ninjaforms.com for users who have opted in.
* Added the $sub_id data to the ninja_forms_custom_columns filter.
* Field selectors in the builder should always show the "nicename" of the field rather than the programmatic name.
== Changelog == *Bugs:*
* Product, Shipping, and Total fields should now work in all locales.
* Fixed a major bug preventing forms with date fields from showing in some instances.
= 3.0.18 (06 December 2016) = = 3.0.18 (06 December 2016) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment