[TASK] Optimize FormEngineValidation, Part I 48/45348/8
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 18 Dec 2015 09:20:53 +0000 (10:20 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 30 Dec 2015 18:02:20 +0000 (19:02 +0100)
commit003f99038a36c5d9e71ba44bd527246aa2d14fcd
tree57b1aad4f78465ea0b16e86e8c9e502e3a95db0a
parent50ef549cfbe38d1caebf16bf40b56c40155e8849
[TASK] Optimize FormEngineValidation, Part I

The implementation of FormEngineValidation has been improved at some parts:

- The parsed integer value in FormEngineValidation.formatValue is now
stored in a variable to prevent parsing the same value multiple times.

- The `nospace` evaluation has been improved: Instead of checking each
character, a regex is applied.

- The `ltrim` and `btrim` implementations are now regex based. There are
already native JavaScript implementations, but not supported by every
browser.

- parseInt does now really a parseInt() call and checks for NaN.

- The dirty state of the form is now stored in a variable after changing
a field, the DOM is not traversed after clicking "Close" anymore.

Resolves: #72485
Releases: master
Change-Id: I3f166e65a949138595c9828684ea6c15a0deefc7
Reviewed-on: https://review.typo3.org/45348
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js