From: Alan Knowles Date: Thu, 21 Jun 2018 02:26:59 +0000 (+0800) Subject: roojs-core.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=658d20ab568d0cce4e1dc49b6a5bea8bd1c594c1 roojs-core.js roojs-core-debug.js roojs-all.js roojs-debug.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index 7f117d4e68..a764b0d38b 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -565,7 +565,7 @@ Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if( },uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var B=Array.prototype.slice.call(arguments,2);B.unshift(value); return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFixed:function(v,n){if(!n){return Math.round(v-0);}var B=Math.pow(10,n+1);v=(Math.round((v-0)*B))/B;var z=(''+B).substring(2);if(v==Math.floor(v)){return Math.floor(v)+'.'+z;}var ps=String(v).split('.'); var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B,C){B=typeof(B)=='undefined'?2:B; -C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;while(r.test(F)){F=F.replace(r,'$1'+C+'$2');}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):''); +C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):''); return F+G;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,""); }};}();Roo.util.Format.defaults={date:'d/M/Y'}; // Roo/MasterTemplate.js diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index ad8ffcfa5f..858b5aa374 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -7557,6 +7557,7 @@ Roo.form.Action.ACTION_TYPES = { Roo.bootstrap.Form = function(config){ + Roo.bootstrap.Form.superclass.constructor.call(this, config); Roo.bootstrap.Form.popover.apply(); @@ -7591,7 +7592,6 @@ Roo.bootstrap.Form = function(config){ */ actioncomplete : true }); - }; Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, { @@ -8099,13 +8099,10 @@ clientValidation Boolean Applies to submit only. Pass true to call fo Roo.each(el.items,function(e) { iter(e); }); - - }; iter(this); return r; - } }); diff --git a/roojs-core-debug.js b/roojs-core-debug.js index f3d38ca5a1..eb23157645 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -13790,10 +13790,10 @@ Roo.util.Format = function(){ var r = /(\d+)(\d{3})/; // add comma's - while (r.test(whole)) { - whole = whole.replace(r, '$1' + thousandsDelimiter + '$2'); - } + if(thousandsDelimiter.length != 0) { + whole = whole.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsDelimiter ); + } var sub = ps[1] ? // has decimals.. diff --git a/roojs-core.js b/roojs-core.js index b7a89ef512..2d01b955d3 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -565,7 +565,7 @@ Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if( },uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var B=Array.prototype.slice.call(arguments,2);B.unshift(value); return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFixed:function(v,n){if(!n){return Math.round(v-0);}var B=Math.pow(10,n+1);v=(Math.round((v-0)*B))/B;var z=(''+B).substring(2);if(v==Math.floor(v)){return Math.floor(v)+'.'+z;}var ps=String(v).split('.'); var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B,C){B=typeof(B)=='undefined'?2:B; -C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;while(r.test(F)){F=F.replace(r,'$1'+C+'$2');}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):''); +C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):''); return F+G;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,""); }};}();Roo.util.Format.defaults={date:'d/M/Y'}; // Roo/MasterTemplate.js diff --git a/roojs-debug.js b/roojs-debug.js index 0b41f1194c..49065fada2 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -13790,10 +13790,10 @@ Roo.util.Format = function(){ var r = /(\d+)(\d{3})/; // add comma's - while (r.test(whole)) { - whole = whole.replace(r, '$1' + thousandsDelimiter + '$2'); - } + if(thousandsDelimiter.length != 0) { + whole = whole.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsDelimiter ); + } var sub = ps[1] ? // has decimals..