- Add Android Chrome mobile (version 57) support (note: so far, not all android browsers are supported)
- Fix issue #404 On the Android browser, inserted numbers are doubled if the user press the keys quickly on the virtual keyboard
- Fix issue #250 The
maximumValue
andminimumValue
options are not taken into account on Android - Fix issue #264 Entering the
decimalCharacterAlternative
is not taken into account on Android Chrome - Add the special keyCode 229 used by Android browsers as
keyCode.AndroidDefault
- Fix the
onPaste
handler throwing an error for uninitialized variables - Complete the
arabicToLatinNumbers()
function to return more quickly if not arabic numbers are found
- Fix issue #248 Create the
autoNumeric
organization, and move the repository to it
- Fix issue #417 Error thrown in PhantomJS 2.1.1 on Linux under CI Environment
- Fix the end-to-end tests for issue #403
- Fix the webdriver.io configuration for the links to jQuery and AutoNumeric libraries
- Fix issue #401 autoNumeric 2.0.8 prevents IE11 from entering the decimal character from the numpad
- Fix issue #403 autoNumeric 2.0.8 scaling option when the divisor is less than zero and the input receives focus multiple times
- Fix issue #389 autoNumeric 2.0.7 npm packages causes build error with typescriptify + browserify
- Fix issue #384
npm install
for version 2.0.4 does not work on Windows machines
- Fix issue #377 The
dist
files in the last publish to npmjs were not rebuilt with the fixes pushed to 2.0.1 - Fix issue #373 The
dist
files are not included when publishing to npmjs - Fix issue #371 The currency symbol is not removed on blur with the default
emptyInputBehavior
valuefocus
- Fix issue #367 The package.json "postinstall" task does not find the target file when not using the dev dependencies
- Fix issue #373 The
dist
files are not included when publishing to npmjs
- Release autoNumeric version
2.0.0
, enjoy! (¬‿¬) 🎉 - The old options names are being deprecated, and will be removed soon ; update your scripts with the new ones!
- Please be sure to read the updated readme in order to know what else has changed.
- Fix issue #310 Setup Webdriver.io for end-to-end (e2e) testing
- Fix issue #326 Pasting a single decimal character into an input that has none does not work
- Fix issue #322 Pasting a string containing a comma set the caret position at the wrong position
- Fix issue #354 Setup automated coverage tests (with Coveralls)
- Fix issue #345 Setup continuous integration testing (with Travis CI)
- Fix issue #346 Add a
showPositiveSign
option to display the positive sign wherever needed
- Fix issue #341 Add some default options in the
languageOption
object - Fix issue #328 Switch from
npm
toyarn
- Allow using
set
with Arabic and Persian numbers (ie.aNInput.autoNumeric('set', '١٠٢٣٤٥٦٧.٨٩');
) - Allow using Arabic and Persian numbers (used in Arabic languages) in the html
value
attribute - Allow pasting Arabic and Persian numbers (that will get converted to latin numbers on the fly)
- Fix issue #330 The
negativePositiveSignPlacement
option can be ignored in some cases - Fix issue #339
get
returns'0'
when the input is empty even ifemptyInputBehavior
is not equal to'zero'
- Fix issue #317 allow jumping over the decimal character when the caret is just left of the decimal character and the user enters the decimal character
- Fix issue #319 so the 'get' method returns a negative value when there is a trailing negative sign.
- Fix issue #327 so the entire content is selected when tabbing in.
- Fix issue #321 Allows more international decimal characters and grouping separators :
- Allowed grouping separator :
','
,'.'
,'٬'
,'˙'
,"'"
,' '
,'\u2009'
,'\u202f'
,'\u00a0'
and''
- Allowed decimal characters :
'.'
,','
,'·'
,'⎖'
and'٫'
- Fix FireFox on issue #306 that allows the caret to move right when all zero present in the decimals
- Fix issue #318
this.selection
can be uninitialized if you focus on an input via theTab
key. - Add the
keyName
object that list the key values as defined is the KeyboardEvent Key_Values. - Rename the
key()
function tokeyCodeNumber()
. - Split
_updateFieldProperties()
into_updateAutoNumericHolderProperties()
and_updateAutoNumericHolderEventKeycode()
. _updateAutoNumericHolderProperties()
only update the value and selection in each event handler, and resets the 'processed' and 'formatted' states._updateAutoNumericHolderEventKeycode()
is called only once onkeypress
, and set the event keyCode into the AutoNumericHolder object.- Remove the need to save
this.ctrlKey
,this.cmdKey
andthis.shiftKey
three times on each key stroke. - Rename
this.kdCode
intothis.eventKeyCode
, and use that variable globally in the AutoNumericHolder object. - Fix
_normalizeParts()
so that a '0' entered via the numpad is managed as well. - Complete the substitution of magic numbers with
keyCode
values. - Modify
_processCharacterInsertion()
so that it take the event as an argument, and therefore can directly usee.key
. - Simplify
_formatValue()
tests.
- Fix issue #306 when { leadingZero: 'deny' } and proper caret placement
- Fix issue #228 Do not modify the current selection when trying to input an invalid character
- Mass rename functions to gives them a more explicit name :
Old name | New name | |
---|---|---|
autoCheck() | -> | checkIfInRangeWithOverrideOption() |
autoRound() | -> | roundValue() |
autoGroup() | -> | addGroupSeparators() |
fixNumber() | -> | modifyNegativeSignAndDecimalCharacterForRawValue() |
presentNumber() | -> | modifyNegativeSignAndDecimalCharacterForFormattedValue() |
negativeBracket() | -> | toggleNegativeBracket() |
autoGet() | -> | getCurrentElement() |
getHolder() | -> | getAutoNumericHolder() |
autoSave() | -> | saveValueToPersistentStorage() |
_setPosition() | -> | _setCaretPosition() |
_signPosition() | -> | _getSignPosition() |
_formatQuick() | -> | _formatValue() |
- Modify the
validate()
function to show a warning whendecimalPlacesOverride
is greater thandecimalPlacesShownOnFocus
. - Implement feature request #183 that manage invalid results when trying to paste any number. This adds the
onInvalidPaste
option that can accept theerror
,ignore
,clamp
,truncate
andreplace
value. - Rename
autoStrip()
tostripAllNonNumberCharacters()
. - Upgrade the
setElementSelection()
function so that it can accept only one caret position. - Add a
failOnUnknownOption
option which allows autoNumeric to strictly analyse the options passed, and fails if an unknown options is used in the settings object.
- Fix typos and missing characters that prevented building the library.
- Fix issue #302
leadingZero
optiondeny
does not function correctly and deletes some of the zero to the right of the caret - Fix issue #303 When focusing on an input having
currencySymbolPlacement
set asp
(prefix)
- Rename the old options name to more explicit ones :
Old name | New name | |
---|---|---|
aSep | -> | digitGroupSeparator |
nSep | -> | noSeparatorOnFocus |
dGroup | -> | digitalGroupSpacing |
aDec | -> | decimalCharacter |
altDec | -> | decimalCharacterAlternative |
aSign | -> | currencySymbol |
pSign | -> | currencySymbolPlacement |
pNeg | -> | negativePositiveSignPlacement |
aSuffix | -> | suffixText |
oLimits | -> | overrideMinMaxLimits |
vMax | -> | maximumValue |
vMin | -> | minimumValue |
mDec | -> | decimalPlacesOverride |
eDec | -> | decimalPlacesShownOnFocus |
scaleDecimal | -> | scaleDecimalPlaces |
aStor | -> | saveValueToSessionStorage |
mRound | -> | roundingMethod |
aPad | -> | allowDecimalPadding |
nBracket | -> | negativeBracketsTypeOnBlur |
wEmpty | -> | emptyInputBehavior |
lZero | -> | leadingZero |
aForm | -> | formatOnPageLoad |
sNumber | -> | selectNumberOnly |
anDefault | -> | defaultValueOverride |
unSetOnSubmit | -> | unformatOnSubmit |
outputType | -> | outputFormat |
debug | -> | showWarnings |
- Add a
convertOldOptionsToNewOnes()
function that automatically convert old options to new ones, to ease the evolution to v2.*. - Update
typings.d.ts
accordingly - Update
README.md
accordingly - Complete the tests to make sure using old option names will output a warning about them being deprecated
- Fix issue #292 where native input and change events are not sent correctly.
- Add a
isNumber()
helper function to test if a value is a number, or a string representing a number. - Add a
isInt()
helper function to test if a value is a 'real' integer. - Modify
decimalPlaces()
so that it always return the number of decimal places (ie.0
instead ofnull
if there is none). - Add a
key()
helper function to retrieve an event keyCode. - Complete and improve some JSDoc.
- Rename
runCallbacks()
intorunCallbacksFoundInTheSettingsObject()
. - Simplify
decLength()
function, as well as removing unnecessary code before each call to this function. - Rename
decLength()
tomaximumVMinAndVMaxDecimalLength()
. - Drastically improve performance by removing duplicated function calls.
- Improve
autoCode()
call hierarchy. - Merge
autoCode()
intogetInitialSettings()
. - Caches an additional regex.
- Rename some functions and variables to make them more explicit.
- Refactor
autoGroup()
to use switch statements. - Refactor how
dPos
was used to make it more understandable. - Rename
keepOriginalSettings
intokeepAnOriginalSettingsCopy()
. - Simplify
autoSave()
so that it directly uses the element as an argument, instead of a jQuery reference. - Create an AutoNumericHolder ES6 class to store the field properties of an autoNumeric element.
- Rename the AutoNumericHolder
init()
function to_updateFieldProperties()
. - Rename the AutoNumericHolder functions that should be private.
- Fix issue #283.
- Rename
processAlways()
into_processCharacterDeletion()
, and simplify it so that if does not do two things at the same time. - Rename
processKeypress()
into_processCharacterInsertion()
, and simplify it so that if does not do two things at the same time. - Merge some conditions in
_formatQuick()
. - Remove the need for a jQuery dependency in the events listeners.
- Convert some jQuery event listeners to pure JS event listeners.
- Convert some jQuery-specific functions to native JS ones (ie.
$this.val()
toe.target.value
). - Simplify the event listeners by removing any unused returns.
- Remove unnecessary
getHolder()
calls in the event listeners. - Make the 'enter' key send a
change
event when used and the value has been changed. - Add an
onBlur
event listener, allowing us to triggerchange
events as needed. - Reduce
getInitialSettings()
length by a great deal, making it easier to read and understand. - The
getInitialSettings()
functions now calls thecalculateVMinAndVMaxIntegerSizes()
,correctMDecOption()
,setsAlternativeDecimalSeparatorCharacter()
,cachesUsualRegularExpressions()
andtransformOptionsValuesToDefaultTypes()
functions. - Refactor the
update()
code intogetInitialSettings()
, which allows to remove theautoCode()
calls from the AutoNumericHolder constructor and the_updateFieldProperties()
function. - Remove the need for jQuery in
getSettings()
. - Modify the
validate()
test on themDec
option to allow for a positive integer too. - Allow the
autoFormat()
function to format numbers represented as a string. - Complete the
autoFormat()
tests and check for the value validity. - Remove the
sendCustomEvent()
function and replace it by thetriggerEvent()
one (and removecreateCustomEvent()
as well). - Complete the
autoUnFormat()
tests and check for the value validity. - Modify the
autoUnFormat()
behavior so that when given a number (a real one or a string representing one), the function always return a 'real' number, whatever the options passed. - Modify the eslint 'radix' rule to allow for always specifying a radix for the
parseInt
function. - Comment out the default Jasmine test in order to see a 100% success without any skipped tests.
- Fix the
clean:build
npm script so that it does not try to remove an inexistant folder.
- Add "mouseenter" & "mouseleave" handlers to enable viewing the extended values for "eDec", "scaleDivisor" & "nSep" options.
- Add third parameter to the "autoGet" call in "onFocusOutAndMouseLeave" function
- Rename the
localOutput
setting tooutputType
, and add an option 'number' that makesgetLocalized
always return a Number, instead of a string. - Modify the
get
function so that it always returns a valid Number or string representing a number that Javascript can interpret. - Add a
getLocalized
function that return the raw value of the input, but can also return the value localized with a decimal point and negative sign placement chosen by the user (basically, it replace the oldget
behavior if any user wants it back). - Modify the
pNeg
default value based on theaSign
andpSign
values. This leads to better user experience when setting a currency symbol without settingpNeg
. - Errors are now always thrown. The
debug
option now only affects the warning messages (used for non-critical errors).
- Add a
validate()
method that checks if the given options object is valid. - Reorganize the
init
function code to check for critical error first, before doing other calculus. - Add a
areSettingsValid()
method that return true if the options object is valid. - Add multiple helper functions
isBoolean
,isNull
,isTrueOrFalseString
,isObject
,isEmptyObj
,hasDecimals
,decimalsPlaces
. - Add a
warning()
method that output warning message to the console. - Rename
originalSettings
tokeepOriginalSettings
to better convey what this function is doing.
- Removed the index.html file
- Additional mods/fixes to the scaling options
- Additional mods/fixes to the "nSep" to also handle the "aSuffix"
- Fixed the "mRound" default
- fixed nSep option which removes the Currency symbom and thousand seperator on focusin
- changed the defaulys of scaleDivisor, scaleDecimal & scaleSymbol to null
- modified the scaling o[tiona and seperated the options
- aScale - removed
- scaleDivisor added
- scaleDecimal added
- scaleSymbol added
- Prepare the code base for future Jasmine tests
- Add initial babel support
- Add uglify and npm-build-process support
- Merge the 2.0 changes into master
- Add npm support for building the minified version
- Multiple small fixes
- Fixed paste event on both context menu and
ctrl-v
// issue #251 special thanks to @rhyek - Fixed tab in key select all and deletion // issue #246
- Fixed issue with Vue.js 2.0 // issue #247
- Fixed context menu paste event // issue #251
- switch from jsLint to jsHint
- Fixed tab in key // thanks movalz issue #212
- Fixed the cursor position when tabbing in Chrome // thanks Dennis Smith issue #221
- Fixed the destroy method // thanks brunoporto & Mabusto issue #225
- Fixed the readme file to show correct
$.extend
defaults // thanks gayan85 issue #229 - Fixed bug in unSetOnSubmit option to handle non autoNumeric controlled inputs
- Fixed bug in
get
method - Mods to the trailing minus sign code
- Added UMD support
- Modified & improved the shim for throwing the
input
event - Added option
unSetOnSubmit
to unformat input on the submit event - Added option
debug
to turn on and off error being thrown - Added support for arbitrary-precision decimal arithmetic. This was adapted from Big.js https://github.com/MikeMcl/big.js/ Many thanks to Mike
- Added support for trailing minus signs
- Added rounding methods for currencies with smallest coin being $0.05
- Added modified
sNumber
option that selects only numbers ctr & a keys thanks Zayter - Added support for return values to have locale formats
- Added debug option to turn off errors
- Added option
anDefault
to help ASP.NETR postback errors - Modified the
wEmpty
option - Modified the
init
&&set
methods - General code clean up
- Modified the
set
,getString
&getArray
methods - Modified the
nBracket
function - Fixed the
update
method when it is called during theonfocus
event - Fixed the
getString
&getArray
methods when multiple inputs share the same name - Thanks Retromax - Fixed bug in
ctrl + v
paste event to properly round - Merged a mod that makes the defaults public and overridable - Thanks Peter Boccia
- Fixed page reload when the thousand separator is a period
.
- Fixed tab in key // thanks movalz issue #212
- Fixed the cusor position when tabbing in Chrome // thanks Dennis Smith issue #221
- Fixed the destroy method // thanks brunoporto & Mabusto issue #225
- Fixed the readme file to show correct $.extend defaults // thanks gayan85 issue #229
- Modified the "set" method to handle NaN
- Fixed destroy method
- Added Typings support - thanks bcherny
- UMD support
- Fixed bug when pasting using ctrl & v keys
- Fixed bug that allowed two currency symbols - thanks Mic Biert
- Fixed bug when pasting value and the decimal seperator is a comma ","
- Modified the "destroy" method so that an error is not thrown if the "init" method has not been called previously
- Fixed 'aForm'option.
- Updated the readme file
- Added / fixed option to address asp.Net WebForm postback.
- please see the readme section on default settings & options
- Added / fixed support for asp.Net WebForm postback.
- During postback the default value is re-rendered showing the updated value
- Because autoNumeric cannot distinguish between a page re-load and asp.net form postback, the following HTML data attribute is REQUIRED (data-an-default="same value as the value attribute") to prevent errors on postback
- Example:
<input type="text" id="someID" value="1234.56" data-an-default="1234.56">
- Rewrote the "getString" & "getArray" methods to index successful elements and inputs that are controlled by autoNumeric. This ensures the proper input index is used when replacing the formatted value.
- Added support for FireFox for Mac meta key "keycode 224" - Thanks Ney Estrabelli
- Revert 'set' back to version 1.9.34
- Modified the 'set', 'getString' & 'getArray' methods
- Modified the 'nBracket' function
- General code clean up
- Fixed bug in "ctrl + v" paste event introduced in 1.9.32
- Fixed bug when the "update" method is called in the "onfocus" event
- Fixed the "getString" & "getArray" methods when multiple inputs share the same name - Thanks Retromax
- Fixed bug in "ctrl + v" paste event to properly round
- never officially release
- Fixed bug introduced 1.9.29 too interested in Ohio State vs. Oregon
- Fixed bug introduced in 1.9.27
- Fixed focusout event when the thousand separator is a period "." and only one is present "x.xxx" with not other alpha characters.
- Merged a mod that makes the defaults public and over ridable - Thanks Peter Boccia
- Fixed page reload when the thousand separator is a period "."
- Fixed "getString" & "getArray" methods when multiple forms having some shared named inputs
- Fixed mRound option "round-half-even"
- Modified the "set" method to not throw an error when trying to "set" a null value
- Changed the case on the supported elements
- This was required because jQuery.prop('tagName') returns upper-case on html5 pages and returns lower-case on xmhtl pages
- Merged mod on the "getString" method
- Fixed a bug when a negative value uses brackets and currency sign on page reload thanks to Allen Dumaine
- Additional mods to the "set" method.
- Eliminated lastSetValue setting
- Mod to checkValue function to handle empty string - thanks to jedichenbin.
- If CHF rounding is used decimal is automatically set to 2 places
- Fixed issue for very small numbers - thanks to jedichenbin.
- Added input type="tel" support.
- Added support for Swiss currency rounding to the nearest ".00 or .05"
- Fixed bug in Round-Half-Even "Bankers Rounding"
- Fixed formatting on page load for text elements.
- Fixed leading zero on page load when option lZero is set to 'keep'.
- Fixed the checkValue function when vary small numbers in scientific notation are passed via the set method.
- Modified the rounding method so zero value is not returned with a negative sign
- Fixed bug introduced in version 1.9.14
- Added additional supported tags ('b', 'caption', 'cite', 'code', 'dd', 'del', 'div', 'dfn', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ins', 'kdb', 'label', 'li', 'output', 'p', 'q', 's', 'sample', 'span', 'strong', 'td', 'th', 'u', 'var')
- Moved the routine that tests for supported tags
- General code clean-up
- Fixed the "get" method when the input receives focus for a second time.
- Fixed brackets on page load when the decimal character is a comma.
- Another mod to the 'set' method.
- Fixed the 'set' method to handle page reload using the back button.
- Fixed how non-input tags default value is handled. When the default is an empty string and aSign is not empty the return value is now and empty string.
- Modified how default values are handled when the decimal character equals ',' comma. Your default value can now use either a a period '.' or comma ',' as the decimal separator
- Modified the caret placement on focusin (tab in). If only the currency sign is visible the caret is placed in the proper location depending on the sign placement (prefix or suffix).
- Changed bind / unbind to on / off.
- added lastSetValue to settings - this saves the unrounded value from the set method - $('selector').data('autoNumeric').lastSetValue; - helpful when you need to change the rounding accuracy
- Modified /fixed the format default values on page ready.
- Fixed the caret position when jumping over the thousand separator with back arrow.
- Fixed bug introduced in 1.9.3 with shift key.
- additional modification to the processKeypress function that automatically inserts a negative sign when vMax less tham or equal to 0 and vMin is less tham vMax.
- Modified processKeypress function to automatically insert a negative sign when vMax <=0 and vMin < 0.
- Changed the getSting and getArray functions to use decodeURIComponent() instead of unescape() which is depreciated
- Merged issue #11 - Both getString and getArray were using escaped versions of the name from jQuery's serialization. So this change wraps the name finder with quotes and unescapes the name.Fixed a bug in autoCode that corrects the pasted values and page re-load - Thanks Cory.
- Merged issue #12 - If a input is readonly during "init", autocomplete won't work if the input is enabled later. This commit should fix the Problem - Thanks Sven.
- Fixed a bug in autoCode function that corrects pasted values and page re-load
- Added support for "shift" + "insert" paste key combination
- Modified the "checkValue" function - eliminated redundant code
- Modified the "update" method include calling the "getHolder" function which updates the regular expressions
- Modified the "getHolder function so the regular expressions are updated
- Modified the "set" method to convert value from number to string
- Modified the checkValue function to handle values as text with the exception of values less than "0.000001 and greater than -1"
- Fixed a rounding error when the integers were 15 or more digits in length
- Added "use strict";
- Fixed the "get" and "set" methods by moving the settings.oEvent property to ensure the error message would be thrown if the element had not been inialized prior to calling the "get" and "set" methods
- Fixed the "init" when there is a default and value aForm=true and the aSep and aDec are not the defaults
- Fixed the "getSting" method - it use to returned an error when no values were entered
- Modified the "init" method to better handle default and pre-existing values
- Modified the "set" method - removed the routine that checked for values less than .000001 and greater than -1 and placed it in a separate function named checkValue()
- Modified the "get" method:
- Added a call to the checkValue() function - this corrects returned values example - when the input value was "12." the returned value was "12." - it now returns "12"
- When no numeric character is entered the returned value is an empty string "".
- Removed the error message when calling the 'init' methods multiple times. This was done when using the class selector for the 'init' method and then dynamically adding input(s) it allows you to use the same selector to init autoNumeric. Please note: if the input is already been initialized no changes to the option will occur you still need to use the update method to change exisiting options.
- Added support for brackets '[,]', parentheses '(,)', braces '{,}' and '<,>' to the nBracket setting. Please note: the following format nBracket: '(,)' that the left and right symbol used to represent negative numbers must be enclosed in quote marks and separated by a comma to function properly.
- Fixed readonly - this occured when you toggle the readonly attribute
- Fixed the getString and getArray methods under jQuery-1.9.1
- Added input[type=hidden] support - this was done mainly for backward compatibility.
- The "get" method now returns a numeric string - this also was done for backward compatibility.
- Allowed dGroup settings to be passed as a numeric value or text representing a numeric value
- Allows input fields without type that defaults to type text - Thanks Mathieu DEMONT
- Modified the 'get' method so when a field is blank and the setting wEmpty:'empty' a empty string('') is returned.
- autoNumeric() 1.8.0 is not compatible with earlier versions but I believe you will find version 1.8.0's new functionality and ease of use worth the effort to convert.
- Changed autoNumeric structure to conform to jQuery's recommended plugin development.
- Created a single namespace and added multiple methods.
- Added HTML 5 data support and eliminated the metadata plugin dependency.
- Added support for the following elements: 'DD', 'DT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'input', 'LABEL', 'P', 'SPAN', 'TD', 'TH'.
- Changed the settings loading order to defaults, HTML5 data then options. Now the defaults settings are overridden by HTML5 data and options overrides both defaults & HTML5 data.
- Added "lZero" to the settings to control leading zero behavior.
- Added "nBracket" to the settings which controls if negative values are display with brackets.
- Changed the callback feature to accept functions only.
- Improved the 'aForm' behavior that allows values to be automatically formatted on page ready.
- Fixed the issue for numbers that are less than 1 and greater than -1 and have six or more decimal places.
- Fixed 'crtl' + 'a' (select all) and 'ctrl' + 'c' (copy) combined key events.
- Fixed a IE & FF bug on readonly attribute.
- General code clean up