From b15d0bec8db42feaba38a2bf3e800d1678e82d2b Mon Sep 17 00:00:00 2001 From: Lee Houghton Date: Tue, 8 Apr 2014 15:17:54 +0100 Subject: [PATCH 1/3] Fix accidental base-8 parseInt with leading zeroes When a number field has leading zeroes and can be interpreted as an octal number, (e.g. 08), getValue interprets it as an octal number. In the android browser in particular, this parseInt("08"), even more oddly, returns zero! This causes odd "wrapping" behaviour. Always specify a radix when using parseInt! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#Octal_interpretations_with_no_radix --- js/bootstrap-formhelpers-number.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-formhelpers-number.js b/js/bootstrap-formhelpers-number.js index 1aa5c6a..085d93f 100644 --- a/js/bootstrap-formhelpers-number.js +++ b/js/bootstrap-formhelpers-number.js @@ -192,7 +192,7 @@ value = this.options.min; } - return parseInt(value); + return parseInt(value, 10); }, formatNumber: function() { From df1ca0d0db079ffd914d5c9a7e08925b13b5ef5b Mon Sep 17 00:00:00 2001 From: Lee Houghton Date: Fri, 31 Jul 2015 13:10:14 +0100 Subject: [PATCH 2/3] Fix unhandled exception in timepicker valHooks Don't know what the cause is... just want the error reports to stop. --- js/bootstrap-formhelpers-timepicker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/bootstrap-formhelpers-timepicker.js b/js/bootstrap-formhelpers-timepicker.js index 6cfe097..c654454 100644 --- a/js/bootstrap-formhelpers-timepicker.js +++ b/js/bootstrap-formhelpers-timepicker.js @@ -360,9 +360,11 @@ var $timepicker; if ($(el).hasClass('bfh-timepicker')) { $timepicker = $(el).data('bfhtimepicker'); - $timepicker.options.time = val; - $timepicker.setTime(); - $timepicker.updatePopover(); + if ($timepicker) { + $timepicker.options.time = val; + $timepicker.setTime(); + $timepicker.updatePopover(); + } } else if (origHook) { return origHook.set(el,val); } From 3e3d8daa26474e02e425694b025616c045de7922 Mon Sep 17 00:00:00 2001 From: Lewis Barnes Date: Wed, 4 Nov 2015 11:22:54 +0000 Subject: [PATCH 3/3] Removed window reference allowing imports-loader to inject jQuery. --- js/bootstrap-formhelpers-colorpicker.js | 2 +- js/bootstrap-formhelpers-countries.js | 2 +- js/bootstrap-formhelpers-currencies.js | 2 +- js/bootstrap-formhelpers-datepicker.js | 2 +- js/bootstrap-formhelpers-fonts.js | 2 +- js/bootstrap-formhelpers-fontsizes.js | 2 +- js/bootstrap-formhelpers-googlefonts.js | 2 +- js/bootstrap-formhelpers-languages.js | 2 +- js/bootstrap-formhelpers-number.js | 2 +- js/bootstrap-formhelpers-phone.js | 2 +- js/bootstrap-formhelpers-selectbox.js | 2 +- js/bootstrap-formhelpers-slider.js | 2 +- js/bootstrap-formhelpers-states.js | 2 +- js/bootstrap-formhelpers-timepicker.js | 2 +- js/bootstrap-formhelpers-timezones.js | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/js/bootstrap-formhelpers-colorpicker.js b/js/bootstrap-formhelpers-colorpicker.js index 030e6d7..b730291 100644 --- a/js/bootstrap-formhelpers-colorpicker.js +++ b/js/bootstrap-formhelpers-colorpicker.js @@ -343,4 +343,4 @@ $(document) .on('click.bfhcolorpicker.data-api', clearMenus); -}(window.jQuery); \ No newline at end of file +}(jQuery); diff --git a/js/bootstrap-formhelpers-countries.js b/js/bootstrap-formhelpers-countries.js index f43df22..b5eb65e 100644 --- a/js/bootstrap-formhelpers-countries.js +++ b/js/bootstrap-formhelpers-countries.js @@ -203,4 +203,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-currencies.js b/js/bootstrap-formhelpers-currencies.js index 2475205..0cdfae7 100644 --- a/js/bootstrap-formhelpers-currencies.js +++ b/js/bootstrap-formhelpers-currencies.js @@ -213,4 +213,4 @@ }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-datepicker.js b/js/bootstrap-formhelpers-datepicker.js index a5f6403..6dc80b1 100644 --- a/js/bootstrap-formhelpers-datepicker.js +++ b/js/bootstrap-formhelpers-datepicker.js @@ -581,4 +581,4 @@ $(document) .on('click.bfhdatepicker.data-api', clearMenus); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-fonts.js b/js/bootstrap-formhelpers-fonts.js index d5b98e1..d948af2 100644 --- a/js/bootstrap-formhelpers-fonts.js +++ b/js/bootstrap-formhelpers-fonts.js @@ -179,4 +179,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-fontsizes.js b/js/bootstrap-formhelpers-fontsizes.js index 317fc30..f810342 100644 --- a/js/bootstrap-formhelpers-fontsizes.js +++ b/js/bootstrap-formhelpers-fontsizes.js @@ -179,4 +179,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-googlefonts.js b/js/bootstrap-formhelpers-googlefonts.js index d227403..0e1efc6 100644 --- a/js/bootstrap-formhelpers-googlefonts.js +++ b/js/bootstrap-formhelpers-googlefonts.js @@ -201,4 +201,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-languages.js b/js/bootstrap-formhelpers-languages.js index 98a6708..b10e183 100644 --- a/js/bootstrap-formhelpers-languages.js +++ b/js/bootstrap-formhelpers-languages.js @@ -227,4 +227,4 @@ return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); }; -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-number.js b/js/bootstrap-formhelpers-number.js index 085d93f..69e63f3 100644 --- a/js/bootstrap-formhelpers-number.js +++ b/js/bootstrap-formhelpers-number.js @@ -297,4 +297,4 @@ * =================================== */ -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-phone.js b/js/bootstrap-formhelpers-phone.js index 7a860c9..18db978 100644 --- a/js/bootstrap-formhelpers-phone.js +++ b/js/bootstrap-formhelpers-phone.js @@ -265,4 +265,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-selectbox.js b/js/bootstrap-formhelpers-selectbox.js index 61bca8e..a978318 100644 --- a/js/bootstrap-formhelpers-selectbox.js +++ b/js/bootstrap-formhelpers-selectbox.js @@ -344,4 +344,4 @@ $(document) .on('click.bfhselectbox.data-api', clearMenus); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-slider.js b/js/bootstrap-formhelpers-slider.js index ac6ff8a..55eaeb8 100644 --- a/js/bootstrap-formhelpers-slider.js +++ b/js/bootstrap-formhelpers-slider.js @@ -217,4 +217,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-states.js b/js/bootstrap-formhelpers-states.js index a8403c8..1a46431 100644 --- a/js/bootstrap-formhelpers-states.js +++ b/js/bootstrap-formhelpers-states.js @@ -242,4 +242,4 @@ }); }); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-timepicker.js b/js/bootstrap-formhelpers-timepicker.js index c654454..afd3015 100644 --- a/js/bootstrap-formhelpers-timepicker.js +++ b/js/bootstrap-formhelpers-timepicker.js @@ -392,4 +392,4 @@ $(document) .on('click.bfhtimepicker.data-api', clearMenus); -}(window.jQuery); +}(jQuery); diff --git a/js/bootstrap-formhelpers-timezones.js b/js/bootstrap-formhelpers-timezones.js index ae0dc1c..ea024f4 100644 --- a/js/bootstrap-formhelpers-timezones.js +++ b/js/bootstrap-formhelpers-timezones.js @@ -211,4 +211,4 @@ }); }); -}(window.jQuery); +}(jQuery);