- Mar 31, 2017
-
-
Alexandre Bonneau authored
Modify `AutoNumeric.unformat()` so that 'real' javascript number are always directly returned, without taking into account the options passed (as it was supposed to do previously). Correctly take into account the number of decimal places, the negative brackets, rounding and the suffix text options when unformatting with `AutoNumeric.unformat()`. Complete the `AutoNumeric.unformat()` unit tests. Modify `_removeBrackets()` so that we can only remove the brackets, without reordering the negative sign, currency symbol and value according to the settings. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #414 Changing the value of an element from negative to positive is not possible for some specific configuration of brackets, for the second time. Remove the need to keep an ambiguous `settings.trailingNegative` variable, that was used for other things that its names suggests. Extract the `_isTrailingNegative` test to its own function. Fix `_convertToNumericString()` to make it remove the `suffixText` as well. Use array destructuring to simplify the `_setValueParts()` function. Remove the attribute `newValue` polluting `this`, which allow to explicitly pass the needed information. Merge `this.settings.hasFocus` into `this.isFocused`. Remove the need for the `this.settings.strip` variable. Modify the event listener from `'focusin'` to `'focus'`, in order to prepare for the merge of `_onFocusInAndMouseEnter()` and `_onFocus()` handlers. Modify `_cleanLeadingTrailingZeros()` so that the trailing zeroes if correctly done, even if `leadingZero` is set to `keep`. Rename `_cleanLeadingTrailingZeros()` to `_trimLeadingAndTrailingZeros()`. Change the `_addGroupSeparators()` signature so that the focused state is explicitly passed as a parameter, instead of piggy-backing on the settings object. Add a `_setTrailingNegativeSignInfo()` function that parse the settings and initialize once the `this.isTrailingNegative` property if the negative sign should be trailing for negative values. Rename the `leftOrAll` parameter from `_stripAllNonNumberCharacters()` to a more meaningful `stripZeros`. Simplify a test in `_truncateDecimalPlaces()`. Rename `_skipAlways()` to `_processNonPrintableKeysAndShortcuts()`. Add cases to the helper function `isNegative()` to make it more efficient. Add a new `isNegativeWithBrackets()` helper function that tests if the given value is a negative with brackets. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 28, 2017
-
-
Alexandre Bonneau authored
Add the `styleRules` option that allows to modify the element style based on the raw value, but also to call any callbacks whenever this raw value change Reorganize the `set()` function so that the formatted value is set before setting the `rawValue` That way if a callback invoked by a `styleRules` modify the raw value, it'll be set correctly, since the previous `set()` call would have already changed the element value via `setElementValue()` Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 26, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 25, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix an issue when you have `allowDecimalPadding` set to `never`, then if you delete the decimal places leaving the decimal character, it would not drop that dangling decimal character on focus out Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 24, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Rename the old `autoFormat.autoNumeric` event to the already used `autoNumeric:formatted` to keep the names consistent Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Add a new `historySize` option that allows to set how many undo states each AutoNumeric object should keep in memory. Always use the `_setRawValue()` function to set the `rawValue` ; directly setting `this.settings.rawValue = 'foo'` is not allowed anymore. Modify the `set()` function signature by allowing to pass a third parameter to prevent saving the changed state to the history table. Update the `keyName` enumeration with the capitalized letters. Upgrade the `getElementSelection()` helper function in order to support contenteditable-enabled elements and hidden inputs. Add an `arrayTrim()` helper function that trim the start of an array. Create undo/redo end-to-end tests. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 19, 2017
-
-
Alexandre Bonneau authored
Fix a case where the rounding method `toNearest05Alt` would behave differently than `upToNext05` while it should not Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 18, 2017
-
-
Alexandre Bonneau authored
Also add some links to ease the navigation Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #414 Changing the value of an element from negative to positive is not possible for some specific configuration of brackets Modify the jasmine default timeout in order to allow for longer end-to-end tests. Simplify `_addGroupSeparators` and `_onFocusOutAndMouseLeave` by using `this.settings.rawValue` instead of `this.settings.trailingNegative`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 17, 2017
-
-
Alexandre Bonneau authored
Fix issue #413 Manage the drag 'n drop event so that the text dropped in the AutoNumeric element gets formatted accordingly Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix the issue where having `emptyInputBehavior` equal to `always` would not reformat the AutoNumeric element correctly if its value is set to the empty string `''`. Fix the issue where having `emptyInputBehavior` equal to `zero` would not reformat the AutoNumeric element correctly if its value is set to the empty string `''`. Fix the `_mergeCurrencySignNegativePositiveSignAndValue()` function that did not manage all `negativePositiveSignPlacement` combinations. Simplify the `_mergeCurrencySignNegativePositiveSignAndValue()` function. Add function chaining to the `options.*` methods. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 16, 2017
-
-
Alexandre Bonneau authored
Fix issue #412 Using `set('')` does not respect the `emptyInputBehavior` option when it's set to `'always'` Add a `createLocalList` option which allow to control whether a local list of AutoNumeric objects should be saved on initializations. Add a `global.update()` function to update the settings on a local list. Modify the `global.clear()` function to be able to force a `clear` call. Add a `global.nuke()` function to `remove` then delete the local list DOM element from the DOM. Update the `global.clear()` function signature with the `clear()` one. Fix the `global.addObject()` function that did not update the local list of the added element. Fix the `global.addObject()` function so that if it add an AutoNumeric object that already has a local list with multiple other AutoNumeric objects, it merges the list. Fix the `global.removeObject()` function to make it update all the objects local list. Also add special behaviors when an AutoNumeric element removes itself or another one. Fix the `global.empty()` function to match the `removeObject` behavior. Simplify the `init()` method by removing a negation in one of its parameter. Fix the `init()` method initialization process by preventing creating a local list, then removing it immediately if the user wanted a detached element. Now, the local list is just not created (Using the `createLocalList` option set to `false`). Add an end-to-end test for the `remove()` method. Add a `_hasLocalList()` method that tests if the AutoNumeric element has a local list and that it has at least one element in it (itself usually). Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 14, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #320 Use `event.key` instead of `event.keyCode` and `event.which` since those two attributes are deprecated Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 10, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Update the Contributing help file. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Correct the test for the `<input>` of type `tel`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Those options are `dotDecimalCharCommaSeparator`, `commaDecimalCharDotSeparator`, `integer`, `integerPos`, `integerNeg`, `float`, `floatPos`, `floatNeg`, `numeric`, `numericPos`, `numericNeg`, `euro`, `euroPos`, `euroNeg`, `euroSpace`, `euroSpacePos`, `euroSpaceNeg`, `percentageEU2dec`, `percentageEU2decPos`, `percentageEU2decNeg`, `percentageEU3dec`, `percentageEU3decPos`, `percentageEU3decNeg`, `dollar`, `dollarPos`, `dollarNeg`, `percentageUS2dec`, `percentageUS2decPos`, `percentageUS2decNeg`, `percentageUS3dec`, `percentageUS3decPos` and `percentageUS3decNeg`. Add the unit tests for those pre-defined options. Update the readme accordingly, doing a distinction between the 'Predefined language options' and the 'Predefined common options'. Rename `getLanguages()` to `getPredefinedOptions()`. Add the percentage, permille and basis point sign to the default `suffixText` options. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 09, 2017
-
-
Alexandre Bonneau authored
Add the 'dot' character to the `decimalCharacterAlternative` option enumeration. Update the end-to-end tests that test the element value selection on focus, to reflect the change to the default value for `selectNumberOnly`. Update the unit tests to correct the rounding on some values that used the previous default one defined in `AutoNumeric.languageOptions.French`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 08, 2017
-
-
Alexandre Bonneau authored
Replace the hard-coded default option values with references to the `AutoNumeric.options` object values. Re-order alphabetically the options enumeration. Add more choices for some options. Rename default options value names to more meaningful descriptions. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix the initialization problem when searching for a parent <form> on an element that has no parentNode. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Add a test to warn the user when the given CSS selector does not select any element during initialization. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 07, 2017
-
-
Alexandre Bonneau authored
Remove some debug messages. Remove the need to initialize the `savedCancellableValue` variable when unneeded. Check and remove the unnecessary `hasFocus` calls and sets. Add regex caching to the static `format()` function, since this used the `_addGroupSeparators` function that calls the `_stripAllNonNumberCharacters` one that extensively uses those. Rename the temporary settings copy, and move those out of the `this.settings` object. Prevent setting the value with `set()` if the value hasn't changed when calling the 'cancellable' event. Rename `_setsAlternativeDecimalSeparatorCharacter()` to `_setAlternativeDecimalSeparatorCharacter()`. Remove the unused and deprecated `aScale` reference from a test. Move away from the `this.settings` object the following variables : `caretFix`, `throwInput`, `tagList`, `originalDecimalPlacesOverride`, `originalAllowDecimalPadding`, `originalNegativeBracketsTypeOnBlur`, `originalDigitGroupSeparator`, `originalCurrencySymbol`, `originalSuffixText` and `aNegRegAutoStrip`. Refactor some tests in `_formatValue()`. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
Alexandre Bonneau authored
Fix issue #408 Allow brackets and parenthesis to be added for negative numbers on any combination of `currencySymbolPlacement` and `negativePositiveSignPlacement` values Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 06, 2017
-
-
Alexandre Bonneau authored
Remove the jQuery reference from the dependencies in the readme. Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-
- Mar 03, 2017
-
-
Alexandre Bonneau authored
Signed-off-by:
Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
-