first commit

This commit is contained in:
2024-04-19 14:04:41 +07:00
commit 014283036f
7282 changed files with 1324127 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
[*]
charset=utf-8
end_of_line=crlf
insert_final_newline=false
indent_style=space
indent_size=4
[{.eslintrc,.babelrc,.stylelintrc,jest.config,*.json,*.jsb3,*.jsb2,*.bowerrc}]
indent_style=space
indent_size=2
[*.coffee]
indent_style=space
indent_size=2
[{.analysis_options,*.yml,*.yaml}]
indent_style=space
indent_size=2
+73
View File
@@ -0,0 +1,73 @@
{
"rules": {
"consistent-return": [
1
],
"curly": [
2,
"multi-line"
],
"eol-last": [
0
],
"eqeqeq": [
2,
"smart"
],
"indent": [
0
],
"quotes": [
1,
"double",
"avoid-escape"
],
"no-cond-assign": [
1,
"except-parens"
],
"new-cap": [
0
],
"no-empty": [
0
],
"no-loop-func": [
0
],
"no-underscore-dangle": [
0
],
"no-unused-vars": [
2,
{
"vars": "all",
"args": "none"
}
],
"no-use-before-define": [
2,
"nofunc"
],
"no-shadow": [
0
],
"semi-spacing": [
1
],
"strict": [
0
]
},
"env": {
"browser": true
},
"globals": {
"Inputmask": true,
"jQuery": false,
"module": false,
"require": false,
"requirejs": false,
"define": false
}
}
+39
View File
@@ -0,0 +1,39 @@
# These settings are for any web project
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
*.js text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
.htaccess text
# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
+35
View File
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Live example**
Add a link to a codepen, jsfiddle or other example page which shows the problem
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+11
View File
@@ -0,0 +1,11 @@
build/
test.html
jquery-1.10.2.js
dist/jQuery.InputMask.*.nupkg
node_modules/
bower_components/
npm-debug.log
.idea/
*.iml
qunit/qunit.js
qunit/qunit.js.map
+605
View File
@@ -0,0 +1,605 @@
# Change Log
## [UNRELEASED]
### Addition
- numeric.extensions - add inputType option to specify the type of initial value
- README_numeric.md => Setting initial values
### Updates
### Fixed
- digits: 3 - error on transform #2022
- "Can not read property 'join' of undefined" when using Inputmask.format #2019
- Inputmask numeric does no round up when digits is 0 #2018
- Strange Calendar popup issue in IE Only when used with Daterangepicker #1965
- incorrect work min max date - #2011, #2013
## [4.0.2 - 2018-09-14]
(4.0.1 => 4.0.2 rebuild dist with newer version of uglify #2000)
### Updates
- <strong>remove phone alias</strong> (~ use https://github.com/RobinHerbots/inputmask.phone or https://github.com/andr-04/inputmask-multi instead) #1981
- enhance gettests for jit enabled quantifiers
- pass initial validation position to postvalidation, to allow prefills in the datetime alias
- remove caret selection for insertMode => use inputmask.css for visualization
- update nuget package
- update dependencies
### Fixed
- When blur input, inputmask adds attr placeholder to input - #1992
- Fix endless loop for quantifiers (see tests_dynamic.js - latest unittests) #1983
- Element keeps the focus to itself in ie11 #1846
- Changes for min/max options do not get picked up. #1931
- Behaviour of v3 with hours not possible anymore #1918
- Multiple alternators #1553
- jquery.inputmask: clearIncomplete and placeholder don't appear to do anything when array of masks used #1892
- Problem with delete masked date on iOS #1899
- Autofill corrupts input on email mask #1908(gl)
## [4.0.0 - 2018-05-26]
### Addition
- add support for beforeInput event with inputType (Input Events Level 2 - https://w3c.github.io/input-events/)
- extend positionCaretOnClick with "ignore" to ignore the click in the input
- jit enabled dynamic masks
- add support for input type search
- new datetime alias
- extend positionCaretOnClick with "select" to select the whole input on focus
- add regex option (replaces the Regex alias)
- CSS Unit Mask #1843
### Updates
- make behavior of [] an {0,1} consistent
- change default value from greedy option to false
- fix unmatched alternations in gettests. ("[0-9]{2}|[0-9]{3}" like masks)
- code cleanup and refactoring
- enhance determineTestTemplate
- oncomplete calls
- merge setValidPosition and stripValidPositions => revalidateMask
- remove canClearPosition hook
- change notation of optionalmarker, quantifiermarker, groupmarker
- drop prevalidator and cardinality support in definitions
- drop Regex alias
- drop all date/time related aliases => replaced by new datetime alias
- improve alternation logic
- improve inputfallback (Android)
- better caret handling in colormask
- disable autocorrect on safari when disablePredictiveText is used
- rename androidHack option to disablePredictiveText. Make it available for other platforms.
### Fixed
- Both date and time in same masked textbox #1888
- time input mask min and max #1674
- Bug: Using backspace when caret is not at the end messes up static placeholders #1525
- Fast typing text #1872
- jitMasking + disablePredictiveText causes android browser tab to stuck when clicked on "backspase" #1862
- Android 6 issue - Samsung device keyboard #1818
- Method oncomplete doesn't work correctly with jitMasking #1845
- isComplete in numeric extensions doesn't take into account negationSymbol #1844
- Email alias - retype @ removes last . #1324
- When "clearIncomplete: true" and pressing Enter to Submit Form #1839
- Hang on combination of optional mask and repeat #698
- Can't remove inputmask on focus? #1820
- Not able to input 31.12. in DD.MM date input in v4.x #1803
- problem with two separate alternations #1722
- colorMask + Remask = Duplicate im-colormask element #1709
### Note
Be aware when upgrading from 3.3.11, that the regex alias is removed
and that the datetime alias has totally changed.
So expect you need todo some changes to your date-masks and regex masks.
Also some defaults has changed, so have a read through the changes for this release.
There are still many open issues but postponing the release to resolve all issues will take like another year,
while there are already many enhancements available.
## [3.3.9 - 2017-10-10]
### Updates
- enhance inputfallback (Android)
### Fixes
- On Android with date mask input mashing up #1708
- Currency mask works incorrectly on Android Chrome v58 #1617
- Can't input character at the end if it's also a placeholder on Android #1648
## [3.3.8 - 2017-08-24]
### Addition
- Addition \uFF11-\uFF19 character range to 9 definition #1606
- importDataAttributes option #1633
- add dot support in regex #1651
### Updates
- pass inputmask object in the callbacks
- colorMask enhancement: better positioning and more controllable via inputmask.css
- remove maxLength attribute on android #1490
- enhance inputfallback (Android)
### Fixes
- Mask appear when I press TAB & showMaskOnFocus: false, showMaskOnHover: false #1198
- DependencyLib.Event CustomEvent #1642
- Wrong initial cursor position with Numeric and Prefix #1578
- Currency mask works incorrectly on Android Chrome v58 #1617
- Can't input character at the end if it's also a placeholder on Android #1648
- colorMask - incorrect positioning #1421
- Object doesn't support property or method '_valueGet' in version 3.3.7 #1645
- Usage of numericInput in data-inputmask causes reversed value #1640
- Numeric suffix makes radixPoint disappear on preset value #1638
- Cannot delete after fill up all the mask Android Chrome browser Jsfiddle #1637
## [3.3.7 - 2017-06-09]
### Addition
- allow custom operation in casing option by callback #1565
### Updates
- put back Regex alias extension for legacy support #1611
- postvalidation cannot set pos of undefined
- fix undoValue initialization
### Fixed
- Major issue with regex #1611
- React onChange event doesn't work with Inputmask #1377
- Currency digits and delete #1351
- Decimal editing problems #1603
- UX problem with email mask #1600
- Force numeric to empty (on blur) with '0' as value #215
- ndxInitializer.shift is not a function
## [3.3.6 - 2017-05-11]
### Addition
- noValuePatching option #1276
### Updates
- drop Regex alias => use the inputmask regex option instead
- alternator syntax update - regex like alternations is now supported (aa|99|AA) ~ aa or 99 or AA
### Fixed
- NaN with negationSymbol and unmaskAsNumber #1581
- A dot (.) in Regex Causes Errors #647
- variable "undoValue" isn't initialized correctly #1519
- on submit change event is triggered #1392
- Change Event Problems for Masked Input #1583
- integer backspace bug when set maxLength attr. #1546
- Regex with placeholder, not working? #798
- Visualize regular expressions #1040
- Mobile phone code update needed for Malaysia #1571
- suffix bug (regression) #1558
- 29 february of non leap-year #1567
## [3.3.5 - 2017-04-10]
### Addition
- add example webpack setup (thx to Kevin Suen)
- build-in regex support without extension (WIP)
### Updates
- Change package name to Inputmask to better reflect that Inputmask doesn't require jQuery
- make removing the inputmask take the autoUnmask option into account
- enhance inputfallback event (android)
- restructure project
- performance updates
- initialization
### Fixed
- Changes are not reflected back to model when using with Vue2 (mobile) #1468
- Multiple alternators #1553
- Weird Issue with decimal masking when value is like 0.55 #1512
- IE 8 problems with currency and jquery.inputmask.bundle.js #1545
- Rounding error for numeric aliases #1300
- Currency InputMask Input Value issue with numericInput: true #1269
- onCleared event doesn't fire with 'numeric' alias in some case #1495
- Currency InputMask Input Value issue with numericInput: true #1269
- Rounding numeric values #1540
- Casing lower/upper as extend aliases? #1529
- This line of code returns an unexpected value when unmasking as number #1527
- Phone Mask Cursor Issue on Chrome on some Androids.. #1490
- min value issue fix #1177
- static is a reserved keyword #1479
- hasOwnProperty check missing in reverseTokens (numericInput) #1486
- Per-element radixPoint overwrites defaults #1454
- Form not cleaning correctly when AutoUnmask option is set to true #1442
- Form can`t submitted with input[name=disabled] #1473
## [3.3.4 - 2016-12-22]
### Addition
- extra extension points: analyseMask
- colorMask option ~ css styleable mask
### Updates
- remove tooltip option
- remove h,s,d,m,y definitions => use the date/time aliases
- phone-alias - fine-tune mask sorting
- make data-inputmask attribute naming configurable (dataAttribute on Inputmask)
- numeric alias move negation symbols to the edges
- handle android predictive text enabled
- rename js/inputmask.dependencyLib.jquery.js to js/inputmask.dependencyLib.js
- rename dist/inputmask.dependencyLib.jquery.js to dist/inputmask.dependencyLib.js
- commonjs dep to inputmask.dependencyLib instead to inputmask.dependencyLib.jquery => can be symlinked to another dependencyLib
- improve inputfallback (Android support)
### Fixed
- IE11 : SCRIPT438: Object doesn't support property or method 'isFinite' #1472
- () as literal followed by an optional, doubles the optional template #1453
- Decimal mask excluding zero with custom RadixPoint and GroupSeparator #1418
- Can't remove dot from the middle of a word #1439
- Invalid Leap Year dates can be entered #1368
- jquery.val returns empty value (when using an unsupported input type) #1415
- Losing the decimal part when the maximum number of digits is reached #1257
- Not allowing to change existing number to 0 #1381
- Numbers get swapped when cursor near suffix. #1278
- androidHack: Caret positioning needs some fine tuning #1412
- How can I get "-$123.45", not "$-123.45"? #1360
- Placeholder color #972
- Other color on placeholder (wrap placeholder in span, using contenteditable?) #873
- Error on 3.3.3: Uncaught TypeError: Cannot set property 'generatedInput' of undefined #1399
- ios 8, safari, on first visit unable to enter any characters #826
- Numerica mask not run in Galaxy S5 + Chrome + Android #1357
## [3.3.3 - 2016-09-09] - hotfix
### Updates
- revert moving jquery dependencyLib
- correct caret positioning - radixFocus & placeholder: ""
### Fixed
- Build failure in heroku after release of 3.3.2 #1384
- Error with inputMask any case (v3.3.2) #1383
## [3.3.2 - 2016-09-09]
### Addition
- mask-level casing => #1352
- 'casing': 'title' #1277
- add quantifier syntax for digits option in numeric alias. #1374
### Updates
- add bundle in nuget package
- change default of positionCaretOnTab to true
- include min files in nuspecs
- better filter for input targets in inputmask.binder.js
- improve alternation selection
- removed nojumps option
- update phone alias implementation
- add unit tests for phonecodes
- replaced radixFocus option by positionCaretOnClick. Allows choice for behavior of the caret on click. (none, lvp (default), radixFocus)
- performance updates
- getmasklength
- use selective caching in getTests
### Fixed
- Problems with greedy dynamic masks in current version 3.x #1375
- Croatian phone mask only supports city of Zagreb #1359
- Pasting to masked input not working on Android #1061
- Unable to get property 'forwardPosition' of undefined or null reference IE11 #1342
- Input event doesn't fire in IE #1287
- Dynamically changing mask based on number of entered characters #1336
- change addEventListener not fired in IE11 #1310 - inputmask.dependencyLib.js
- Hide mask's items that have multiple options #678
- Bug when typing after a fixed character #1299
- onUnMask is not being called #1291
- How Can I have caret position on decimal digit(after decimal point) for currency inputmask ? #1282
- How to implement mask for these numbers? #840 (alternator)
- 'setvalue' on mask with a suffix results in suffix being doubled, while `$.fn.val` works fine #1267
## [3.3.1] - 2016-04-20
### Updates
- better handle alternator logic by merging the locators
- patchValueProperty - enable native value property patch on IE8/IE9
- speedup insert and delete from characters
- adding extra options through option method => auto apply the mask + add noremask option
### Fixed
- Safari date mask - Context switch when jquery.valhook fallback is used #1255
- Email alias _@_ => _@_._ #1245
- Safari Error: RangeError: Maximum call stack size exceeded #1241
- Safari Maximum call stack size exceeded when inputmask bound twice #1226
## [3.3.0] - 2016-04-05
### Addition
- nullable option => switch to return the placeholder or null when nothing is entered
- VIN mask #1199
### Updates
- also escape []{}() in the prefix and suffix for decimals
- Can not change integer part when it is "0" #1192
- change funtionality of postValidation => result may be true|false
- improve getmetadata
- patchValueProperty - enable native value property patch on IE10/IE11
### Fixed
- PostValidation function fails when using placeholder and digitsOptional is false #1240
- min value issue #1177
- min value for decimal isn't working #1178
- InputMask remove a 0 in left side. (numericInput: true) #1238
- validate regular expression for indian vehicle registration number #1223
- Distinguish empty value and '$ 0.00' value for currency alias #1053
- 'alias': 'numeric', zero value #1221
- Clicking on a highlighted masked field does not set the caret to the first valid position (Chrome) #1218
- Caret Positioned After Last Decimal Digit Disallows Sign Input When digits Option Set #1139
- numeric alias produces "0.00" instead of null when cleared out. #902
- IE8 error: Object doesn't support this property or method #1217
- update negation handling for numeric alias
- NumericInput option can't handle 100.00 #1162
- "0.00" not displayed if "clearMaskOnLostFocus: true" #1171
- Lost zero while replacing a digit in group #1202
- RadixFocus problem #686
- Can not change integer part when it is "0" #1192
- "[object Object]" value after `$element.inputmask('setvalue', '')` call #1208
- Paste does not work properly when using numericInput #1195
- error occurs in safari 9.0.3 (11601.4.4) #1191
- Can not clear value when select all and press BACKSPACE in some circumstance #1179
- Email mask incorrectly including underscore #868 => allowed as not typed => result invalid
- AutoUnmask not working on IE11 #1187
- Email mask not accepting valid emails #971
- Deleting character from input with 'email' alias shifts all data #1052
- Fix some events like paste & cut for Vanilla dependencyLib #1072
## [3.2.7] - 2016-01-28
### Updates
- favor inputfallback for android
- enable IEMobile
### Fixed
- Firefox, Android - cursor jumps to the left in numeric mask #1138
- Issue in Android (Samsung GALAXY S5) #825
- time mask, backspace behavior on android chrome #817
- Android Chrome Browser #867
- Mask issue in Android with Swype Keyboard #692
- Pasting to masked input not working on Android #1061
- Decimal point/comma not working on Android 4.4 #1041
- Doesn't work on Android #1073
- numeric input in mobile #897
- Support for Android default browser #368
- Repeating a character and a number On Mobile #898
- Inputs are ignored on FF 39 on Android 5.0.2 #982
- Phone input mask duplicates each character on Samsung Android tablet #834
- Support for Android default browser #368
- fixed "valids is not defined" error #1166
## [3.2.6] - 2016-01-25
### Addition
- add jitMasking option
- supportsInputType option
- staticDefinitionSymbol (see readme)
- include textarea as a valid masking element
### Updates
- enhance inputfallback ~ merge mobileinputevent
- caching with cache-dependency check in the getTests fn
- implement missing parts in the jqlite DependencyLib
- Remove namespaces for events (simplifies implementing other dependencyLibs, besides jquery)
- update alternation logic
### Fixed
- Windows Phone User unable to set Date #993
- '405 not allowed' error on loading phone-codes.js on certain Ajax configuration. #1156
- Issue with reset of inputmask field #1157
- IE11 clear not working in emulated IE9 mode #1144
- Show placeholder as user types #1141
- Initial value like VAA gets truncated to V-__ with mask like "I{1,3}-ZZ" #1134
- Input mask can't be applied on other HTML5 input types #828
- IE9 SCRIPT445: Object does not support this action #1135
- Multiple Mask Click Focus Error #1133
- Double enter for submit #1131
- Multiple masks #760
- Cursor shifted to the RIGHT align any way. #1088
- No-strict mask #1084
- Inputmask not work with textarea #1128
## [3.2.5] - 2015-11-27
### Updates
- improve cursor positioning and placeholder handling
- remove $("selector").inputmask("mask", { mask: "99-999 ..." }) format from plugin
### Fixed
- Currency validator gives false negative if number of digits in integer part is not multiplier of groupSize #1122
- data-inputmask => mask with optionals not parsed correctly #1119
- Email mask doesn't allow to go to the domain part by mouse #885
- alias options from 'data-inputmask' is not used anymore #1113
- Numeric extensions don't supported with vanilla DependencyLib #1116
## [3.2.4] - 2015-11-20
### Updates
- allow passing an element id to the mask function
- allow passing a selector to the mask function
- fix for bower package
### Fixed
- get the pressed key onKeyValidation #1114
- write a global function for onKeyValidation #1111 => update readme
- NumericInput Causes err #856
- Certain phones not inputable #758
- I have a problems with mask input, I can't input Ukraine phone +380(XX)XXX-XX-XX #1050
- you can't write ukraine number to phone field +380999999999 #1019
- autoUnmask not work in newest release #1109
- Definition {_} throws an exception #1106 => update readme
- Uncaught TypeError for "percentage" alias #1108
- Wrong behavior for symbol delete in ip alias #1092
- fix element validation for the vanilla dependencyLib #1104
## [3.2.3] - 2015-11-09
### Addition
- Inputmask.remove
- inputmask.binding => automated inputmask binding for html attributes
- Add tooltip option
### Updates
- fix bug in maskscache - context mixing
- allow passing multiple inputs to mask function
- Improve handling of compositionevents
- improve extendAliases, extendDefinitions, extendDefaults
### Fixed
- Cannot erase input value throw mask symbols (Android 4.4, Android 4.2) #1090
- CTRL-x / Cut issue #948
- Double "Change" action when pressing Enter in Firefox #1070
- upper/lower case handling in data-inputmask-* #1079
- IE8 Null values after submit #1076
- Each character repeats on Mobile #912
- extra tooltip property #1071
- Numeric aliases insert '0' in input after clearing if there was fraction part #1067
- Clear optional tail in getvalue. See #1055 #1065
## [3.2.2] - 2015-10-07
### Fixed
- Missing comma in bower.json and component.json #1064
## [3.2.1] - 2015-10-07
### Addition
- inputmask.dependencyLib.jquery
- inputmask.dependencyLib.jqlite
### Updates
- namespace dependencyLib => inputmask.dependencyLib
- fix jquery.inputmask.bundle.js
- fix dependency paths for browserify
- update files to be included for package.json, bower.json, component.json
### Fixed
- oncomplete not called when set with option function #1033
- oncompleate set value incorrect action #1039
- JQuery dependency #517
- IsValid on Optional Mask returning false #1055
- Focus loop on IE9 with numeric.extensions #989
- Currency with autogroup and no digits not working #1062
- field input width characters cropped while writing #1060 (regression fix)
- DependencyLib error in Internet Explorer #1047
- Dynamically switching mask in same input box not functioning as expected #1016
- 3.2.0 Error extendDefinitions and extendAliases not functions #1024
- Browserify error: `Error: Cannot find module 'inputmask' from '/Users/.../node_modules/jquery.inputmask/dist/inputmask` #1030
- Invalid JSON phone-uk.js #1025
## [3.2.0] - 2015-09-04
### Addition
- add option command to set and retrieve options on an inputmask
- dependencyLib wrapper around needed jQuery functionality
- mac address alias #986
- tabThrough option - Tab and autoselect mask parts #433
- eslint testing in grunt validate task
- $.fn.inputmask("setvalue", value)
- jquery.clone support (also see $.fn.inputmask("setvalue", value))
- hexadecimal definition (# in inputmask.extensions.js)
- positionCaretOnTab option
- Inputmask.unmask
- numeric alias - increment/decrement by ctrl-up/ctrl-down
- numeric alias - round values
- percentage alias
- Inputmask class
- setting defaults / definitions / aliases
- Inputmask.extendDefaults
- Inputmask.extendDefinitions
- Inputmask.extendAliases
### Updates
- enhance caret positioning behavior & radicFocus
- change alfanumeric uppercase definition from # to &
- numericInput option also possible on dynamic-masks
- remove $.inputmask in favor of Inputmask class
- remove "jquery." in the naming of the extensions to better reflect their denpendency
- separate jquery plugin code from the inputmask core (first step to remove jquery dependency from the inputmask core)
- Update placeholder handling
### Fixed
- Mask cleared on ajax submit or jquery unobtrusive validation error #1020
- Update readme for numerics #994
- extra zeros in currency alias #1008
- masks parsing generate a Maximum call stack size exceeded #1007
- Issue using datamask-input attributes and event handlers #992
- Set specific inputmask option on already initialized control #949
- Money question #644
- Decimal numbers with fixed decimal part #990
- Focus loop on IE9 with numeric.extensions #989
- Numeric inputs with default value are setted to blank when submit the form #983
- Default Enter key function getting lost on an input mask text field #938
- Add JSHint and JSCS #879 => used eslint instead
- On google chrome, cannot use jquery to clone the inputmask control with data and events #713
- Cannot overwrite characters when highlighting the characters to the right of the decimal #974
- Decimal mask accepts "123,456." (RadixPoint with no number after it) #973
- Make numericInput work with complex masks #963
- Auto position cursor at end of data on focus #965
- Decimal separator conversion #919
- Entering a period on a blank 'numeric' alias input not allowed #888
- Typing 1000 becomes 1.00 using groupSeparator="." #959
- phone-codes.js is missing when installing with bower #937
- Repeat function doesn't work for dynamic masks #960
- Provide convenient method to unmask value #929
- Min value doesn't work with allowMinus #951
- Escape value is inconsistent after mask #935
- Escape optional marker, quantifiable marker, alternator marker and backslash not working #930
- Is numeric carret position broken? #928
- Decimal looses digits #924
- Firefox: cursor jumps to the right when clicking anywhere on the value #921
- Numeric inputMask doesn't rounds value #754
- <strike>Chinese / Japanese characters are unable to mask #198</strike>
- <strike>Infinite Loop on IE (v11) when using Japanese IME Keyboard #749</strike>
- Delete key not working properly #799
- Selecting and overwriting text will delete the character to the immediate right #914
- Can't delete digits after decimal point on negative numbers #892
- decimal : extra number after delete and typing new numbers #904
- Dynamic masks with {*} and zero repeats #875
- Mask does not alternate back after deleting digit #905
- never trigger 'input' event when paste after invoke inputmask #776
- Script looping start when add '.' between decimal values #870 ('.' part)
## [3.1.63] - 2015-05-04
### Addition
- Support for CommonJS (Browserify)
### Updates
- Allow masking the text content of other html-elements (other then div)
- Make alternators correctly handle alternations with different lengths
- better determine the last required position with multiple masks
### Fixed
- Script looping start when add '.' between decimal values #870 (script loop)
- Static masks fails when we set value="2015" for an input field where data-inputmask was "2999" #903
- contenteditable decimal #882
- Tab out does not work when element is readonly #884
- Change mask default for allowPlus and allowMinus #896
- Browser hangs after trying to type some additional digits at the start of a date field #876
- inputmask decimal with integerDigits or digits with maxlength can cause Browser freezed #889
- masking a password field #821 (reenable type=password)
- email inputmask "isComplete" always returns true #855
- When two masks specified backspace clears the whole input instead of last char #780
- Phone extention backspace problem #454
## [3.1.62] - 2015-03-26
### Addition
- Numeric alias: add unmaskAsNumber option
- import russian phone codes from inputmask-multi
- enable masking the text content in a div
- enable contenteditable elements for inputmask
- Update Command object to handle inserts and allow for multiple removes
- Add a change log
- Add Component package manager support - component.json
### Fixed
- updating a value on onincomplete event doesn't work #955
- $.inputmask.isValid("1A", { mask : "1A" }) returns false #858
- IE8 doesn't support window.getSelection js error #853
- Email with dot - paste not working #847
- Standard phone numbers in Brazil #836 (Part 1)
- Sequentional optional parts do not fully match #699
- How i fix that number problem? #835
- Form reset doesn't get same value as initial mask #842
- Numeric extension doesn't seem to support min/max values #830
- Numeric max filter #837
- Mask cache - 2 definitions for same mask #831
- Adding parentheses as a negative format for Decimal and Integer aliases (100) #451
- Should not allow "-" or "+" as numbers #815
- isComplete erroneously returning false when backspacing with an optional mask #824
## [3.1.61] - 2015-02-05
Initial start of a changelog
See commits for previous history.
+171
View File
@@ -0,0 +1,171 @@
const webpackConfig = require('./webpack.config');
const buildWebpackConfig = require('./webpackbuild.config');
const qunitWebpackConfig = require('./qunit/webpack.config');
module.exports = function (grunt) {
function createBanner(fileName) {
return "/*!\n" +
"* " + fileName + "\n" +
"* <%= pkg.homepage %>\n" +
"* Copyright (c) 2010 - <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" +
"* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n" +
"* Version: <%= pkg.version %>\n" +
"*/\n";
}
function createUglifyConfig(path) {
var uglifyConfig = {};
var srcFiles = grunt.file.expand(path + "/**/*.js");
for (var srcNdx in srcFiles) {
var dstFile = srcFiles[srcNdx].replace("js/", ""),
dstFileMin = dstFile.replace(".js", ".min.js");
uglifyConfig[dstFile] = {
dest: 'dist/inputmask/' + dstFile,
src: srcFiles[srcNdx],
options: {
banner: createBanner(dstFile),
beautify: true,
mangle: false,
compress: false,
output: {
ascii_only : true,
comments: false
}
}
};
uglifyConfig[dstFileMin] = {
dest: "dist/min/inputmask/" + dstFileMin,
src: srcFiles[srcNdx],
options: {
banner: createBanner(dstFileMin),
mangle: false,
compress: false,
output: {
ascii_only : true,
comments: false
}
}
};
}
uglifyConfig["bundle"] = {
dest: "dist/jquery.inputmask.bundle.js",
src: "build/bundle.js",
options: {
banner: createBanner("jquery.inputmask.bundle.js"),
beautify: true,
mangle: false,
compress: false,
output: {
ascii_only : true,
comments: false
}
}
};
uglifyConfig["bundlemin"] = {
dest: "dist/min/jquery.inputmask.bundle.min.js",
src: "build/bundle.js",
options: {
banner: createBanner("jquery.inputmask.bundle.js"),
mangle: false,
compress: false,
output: {
ascii_only : true,
comments: false
}
}
};
return uglifyConfig;
}
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
uglify: createUglifyConfig("js"),
clean: ["dist"],
bump: {
options: {
files: ['package.json', 'bower.json', 'composer.json'],
updateConfigs: ['pkg'],
commit: false,
createTag: false,
push: false,
prereleaseName: "beta"
}
},
release: {
options: {
bump: false,
commit: false,
add: false
}
},
nugetpack: {
dist: {
src: function () {
return 'nuspecs/Inputmask.nuspec';
}(),
dest: 'build/',
options: {
version: '<%= pkg.version %>'
}
},
dist2: {
src: function () {
return 'nuspecs/jquery.inputmask.nuspec';
}(),
dest: 'build/',
options: {
version: '<%= pkg.version %>'
}
}
},
nugetpush: {
dist: {
src: 'build/InputMask.<%= pkg.version %>.nupkg',
options: {
source: "https://www.nuget.org"
}
},
dist2: {
src: 'build/jquery.inputMask.<%= pkg.version %>.nupkg',
options: {
source: "https://www.nuget.org"
}
}
},
eslint: {
target: "{extra/*,js}/*.js"
},
availabletasks: {
tasks: {
options: {
filter: 'exclude',
tasks: ['availabletasks', 'default', 'updateDistConfig'],
showTasks: ['user']
}
}
},
webpack: {
main: webpackConfig,
build: buildWebpackConfig,
qunit: qunitWebpackConfig
}
});
// Load the plugin that provides the tasks.
require('load-grunt-tasks')(grunt);
grunt.registerTask('publish', ['release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publishnext', function () {
grunt.config('release.options.npmtag', "next");
grunt.task.run('release');
});
grunt.registerTask('validate', ['webpack:qunit', 'eslint']);
grunt.registerTask('build', ['bump:prerelease', 'clean', 'webpack:build', 'uglify']);
grunt.registerTask('build:patch', ['bump:patch', 'clean', 'webpack:build', 'uglify']);
grunt.registerTask('build:minor', ['bump:minor', 'clean', 'webpack:build', 'uglify']);
grunt.registerTask('build:major', ['bump:major', 'clean', 'webpack:build', 'uglify']);
grunt.registerTask('default', ["availabletasks"]);
};
+7
View File
@@ -0,0 +1,7 @@
Copyright (c) 2010 - 2018 Robin Herbots
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
#Android support
Have a read thought the different android issues. (Android Information #465)
Bottomline, the problem is the predictive text functionality. There is no way to prevent or control the input, which gives undesired results
and side effects in the inputmask. I tried several ways multiple times. Compositionevents, inputevent only masking, all with partial success.
The behavior also changes with the keyboard used. (google keyboard, samsung keyboard, ...)
In general, masks which only accepts numeric input tend to work even with predictive text enabled. Inputmasks with alphanumeric input will all fail.
The solution would be a way to control (or hint) the predictive text or to disable it.
When browsers would implement the inputmode attribute, disabling will be possible.
[Inputmode html spec](https://html.spec.whatwg.org/multipage/forms.html#input-modalities:-the-inputmode-attribute)
[Inputmode chromestatus](https://www.chromestatus.com/feature/6225984592281600)
##Update 18/01/2017
It seems that the GBoard keyboard fires the keydown event only with 229 as keycode. This behavior is not considered a bug as other means should be used to handle input.
See https://github.com/w3c/input-events
##Update 10/10/2017
Masking on mobile devices is currently implemented solely based on the input event. The beforeinput event isn't common in the browsers yet and so cannot be used.
I renamed the androidHack option to disablePredictiveText, so the option is now also available for other platforms.
This can be enabled by passing true for the option.
<strike>
##The workaround, the patchwork, the bad and ugly ;-)
This is not enabled by default, because I find that the developer should be aware of what it does and what you need to take into account when using this hack.
What it does.
- changes the input type to password => disabled predictive text
- enables the colorMask option which creates a div, which surrounds the input.
So we type in the hidden password input and render the mask in the a created div.
To use the colorMask, you need to include the inputmask.css you might need to add some css-tweaks to make it all visually correct in your page.
To enable the workaround add the androidHack option to your individual masks or globally by setting defaults.
You should set the option to "rtfm".
```
Inputmask("myfancymask", {androidHack: "rtfm"}).mask(selector);
Inputmask.extendDefaults({ androidHack: "rtfm" });
```
</strike>
##Reporting android related issues
Before you submit an issue related to Android. Test the issue with and without predictive text enabled.
If the issue also occurs with predictive text disabled you may create an issue for it on Github.
Otherwise, retry the issue on a desktop browser and add the inputEventOnly: true and colorMask: true option.
If the problem is still there you may submit an issue.
Always include a jsfiddle or alike to ease reproducing the problem.
When the issue only occurs due to predictive text I cannot solve it, until browsers start implementing the inputmode attribute on inputs.
+93
View File
@@ -0,0 +1,93 @@
# datetime extensions
Date and Time masks.
# Aliases
- datetime
# Options
## inputFormat
Format used to input the date
ex:
- dd/mm/yyyy
- mm/dd/yyyy
- dd.mm.yyyy HH:MM:ss
###Supported symbols
- d
Day of the month as digits; no leading zero for single-digit days.
- dd
Day of the month as digits; leading zero for single-digit days.
- ddd
Day of the week as a three-letter abbreviation.
- dddd
Day of the week as its full name.
- m
Month as digits; no leading zero for single-digit months.
- mm
Month as digits; leading zero for single-digit months.
- mmm
Month as a three-letter abbreviation.
- mmmm
Month as its full name.
-yy
Year as last two digits; leading zero for years less than 10.
- yyyy
Year as 4 digits.
- h
Hours; no leading zero for single-digit hours (12-hour clock).
- hh
Hours; leading zero for single-digit hours (12-hour clock).
- hhh
Hours; no limit
-H
Hours; no leading zero for single-digit hours (24-hour clock).
- HH
Hours; leading zero for single-digit hours (24-hour clock).
- HHH
Hours; no limit
- M
Minutes; no leading zero for single-digit minutes. Uppercase M unlike CF timeFormat's m to avoid conflict with months.
- MM
Minutes; leading zero for single-digit minutes. Uppercase MM unlike CF timeFormat's mm to avoid conflict with months.
- s
Seconds; no leading zero for single-digit seconds.
- ss
Seconds; leading zero for single-digit seconds.
- l
Milliseconds. 3 digits.
- L
Milliseconds. 2 digits.
- t
Lowercase, single-character time marker string: a or p.
- tt
Two-character time marker string: am or pm.
- T
Single-character time marker string: A or P.
- TT
Two-character time marker string: AM or PM.
- Z
US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the GMT/UTC offset is returned, e.g. GMT-0500
- o
GMT/UTC timezone offset, e.g. -0500 or +0230.
- S
The date's ordinal suffix (st, nd, rd, or th). Works well with d.
### Optional parts
To mark a part of the inputFormat as optional, use the [] as you would for other masks.
Ex.
inputFormat: "dd/mm/yyyy [HH]"
## displayFormat
Visual format when the input looses focus
## outputFormat
Unmasking format
## min
Minimum value. This needs to be in the same format as the inputfornat
## max
Maximum value. This needs to be in the same format as the inputfornat,
+119
View File
@@ -0,0 +1,119 @@
# numeric extensions
## Aliases
- numeric
- currency
- decimal
- integer
- percentage
## Options
### digits
Number of fractionalDigits
Default: "*"
The value can be a number, *, or a quantifier syntax like 2,4
When the quantifier syntax is used, the digitsOptional option is ignored
### digitsOptional
Specify wheter the digits are optional.
Default: true
### enforceDigitsOnBlur
Enforces the decimal part when leaving the input field.
### groupSize
Define the grouping of the integer part.
Default: 3
### autoGroup
Enable grouping of the integer part.
Default: false
### allowMinus
Allow to enter -.
Default: true
### negationSymbol
Define your negationSymbol.
Default: {
front: "-", //"("
back: "" //")"
}
### integerDigits
Number of integerDigits
Default: "+"
### integerOptional
Specify wheter the integerdigits are optional.
Default: true
### prefix
Define a prefix.
Default: ""
### suffix
Define a suffix.
Default: ""
### decimalProtect
Do not allow assumption of decimals input without entering the radixpoint.
Default: true
### min
Minimum value
Default: undefined
### max
Maximum value
Default: undefined
### step
Define the step the ctrl-up & ctrl-down must take.
Default: 1
### unmaskAsNumber
Make unmasking returning a number instead of a string.
Default: false
Be warned that using the unmaskAsNumber option together with jQuery.serialize will fail as serialize expects a string. (See issue [#1288])
[#1288]: https://github.com/RobinHerbots/jquery.inputmask/issues/1288
### inputType
Indicates whether the value passed for initialization is text or a number
Default: "text"
### Setting initial values
When initializing the mask with a value, you need to take some rules into account.
Depending of the option inputType the value will be interpreted as text or as a number.
When inputType is text, the symbol of the radixPoint must be correct. When using number the . (dot) is used as radixpoint.
Setting a number will always work when using vanilla javascript setters.
Example with komma (,) as radixpoint
```
/html
<input name="npt" value="123456,789"/>
//js
Inputmask("decimal", {
radixPoint: ',',
inputtype: "text"
}).mask("input");
$("input").val("123456,789");
$("input").val(123456.789); //this doesn't work because jQuery converts the number to a string
before passing it along to the Inputmask.
document.getElementsByName("npt")[0].value = "123456,789";
document.getElementsByName("npt")[0].value = 123456.789; //type number
```
+43
View File
@@ -0,0 +1,43 @@
# other extensions
## Definitions
- A : alphabetical uppercasing
- & : alfanumeric uppercasing
- \# : hexadecimal
## Aliases
### URL
An URL mask for entering valid FTP, HTTP or HTTPS addresses.
```javascript
Inputmask("url").mask(selector);
```
### IP address
An IP address alias for entering valid IP addresses.
```javascript
Inputmask("ip").mask(selector);
```
### Email
An email mask for entering valid email addresses.
```javascript
Inputmask("email").mask(selector);
```
### MAC
An MAC mask for entering valid MAC addresses.
```javascript
Inputmask("mac").mask(selector);
```
### VIN (Vehicle identification number)
An VIN mask for entering valid VIN codes.
```javascript
Inputmask("vin").mask(selector);
```
You can find/modify/extend these aliases in the inputmask.extensions.js
+24
View File
@@ -0,0 +1,24 @@
{
"name": "inputmask",
"version": "4.0.3-beta.4",
"main": [
"./index.js",
"./css/inputmask.css"
],
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"license": "http://opensource.org/licenses/mit-license.php",
"ignore": [
"**/*",
"!index.js",
"!css/**/*",
"!dist/**/*"
],
"dependencies": {
"jquery": ">=1.7"
},
"authors": [{
"name": "Robin Herbots"
}],
"homepage": "http://robinherbots.github.io/Inputmask"
}
+15
View File
@@ -0,0 +1,15 @@
// import "./css/inputmask.css";
import "./js/inputmask.extensions";
import "./js/inputmask.date.extensions";
import "./js/inputmask.numeric.extensions";
import im from "./js/inputmask.js";
import dependencyLib from "./js/dependencyLibs/inputmask.dependencyLib";
import jQuery from "jquery";
if (dependencyLib === jQuery) {
require("./js/jquery.inputmask");
}
window.Inputmask = im;
+12
View File
@@ -0,0 +1,12 @@
{
"name": "robinherbots/inputmask",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"version": "4.0.3-beta.4",
"type": "library",
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
"homepage": "http://robinherbots.github.io/Inputmask",
"license": "MIT",
"authors": [{
"name": "Robin Herbots"
}]
}
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
+69
View File
@@ -0,0 +1,69 @@
mark.im-caret {
animation: 1s blink step-end infinite !important;
}
mark.im-caret-select {
background-color: rgba(0, 0, 0, 0.25);
}
@keyframes blink {
from, to {
border-right-color: black;
}
50% {
border-right-color: transparent;
}
}
span.im-static {
color: grey;
}
div.im-colormask {
display: inline-block;
border-style: inset;
border-width: 2px;
appearance: textfield;
cursor: text;
}
div.im-colormask > input, div.im-colormask > input:-webkit-autofill {
position: absolute !important;
display: inline-block;
background-color: transparent;
color: transparent;
-webkit-text-fill-color: transparent;
transition: background-color 5000s ease-in-out 0s;
caret-color: transparent;
text-shadow: none;
appearance: caret;
border-style: none;
left: 0; /*calculated*/
}
div.im-colormask > input:focus {
outline: none;
}
div.im-colormask > input::selection {
background: none;
}
div.im-colormask > input::-moz-selection {
background: none;
}
div.im-colormask > input:-webkit-autofill ~ div {
background-color: rgb(250, 255, 189);
}
div.im-colormask > div {
color: black;
display: inline-block;
width: 100px; /*calculated*/
}
[im-insert="false"] {
caret-color: red;
caret-shape: block;
}
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
@@ -0,0 +1,33 @@
/*!
* bindings/inputmask.binding.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "jquery", "../inputmask", "../global/document" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("../inputmask"), require("../global/document"));
} else {
factory(jQuery, window.Inputmask, document);
}
})(function($, Inputmask, document) {
$(document).ajaxComplete(function(event, xmlHttpRequest, ajaxOptions) {
if ($.inArray("html", ajaxOptions.dataTypes) !== -1) {
$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
}
}).ready(function() {
$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
});
});
@@ -0,0 +1,129 @@
/*!
* dependencyLibs/inputmask.dependencyLib.jqlite.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "jqlite", "../global/window" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jqlite"), require("../global/window"));
} else {
window.dependencyLib = factory(jqlite, window);
}
})(function($, window) {
var document = window.document;
function indexOf(list, elem) {
var i = 0, len = list.length;
for (;i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
var length = "length" in obj && obj.length, ltype = typeof obj;
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
}
$.inArray = function(elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
$.isFunction = function(obj) {
return typeof obj === "function";
};
$.isArray = Array.isArray;
$.isPlainObject = function(obj) {
if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
return true;
};
$.extend = function() {
var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
if (typeof target === "boolean") {
deep = target;
target = arguments[i] || {};
i++;
}
if (typeof target !== "object" && !$.isFunction(target)) {
target = {};
}
if (i === length) {
target = this;
i--;
}
for (;i < length; i++) {
if ((options = arguments[i]) != null) {
for (name in options) {
src = target[name];
copy = options[name];
if (target === copy) {
continue;
}
if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && $.isArray(src) ? src : [];
} else {
clone = src && $.isPlainObject(src) ? src : {};
}
target[name] = $.extend(deep, clone, copy);
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
return target;
};
$.each = function(obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
$.data = function(elem, name, data) {
return $(elem).data(name, data);
};
$.Event = $.Event || function CustomEvent(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
$.Event.prototype = window.Event.prototype;
return $;
});
@@ -0,0 +1,19 @@
/*!
* dependencyLibs/inputmask.dependencyLib.jquery.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "jquery" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"));
} else {
window.dependencyLib = factory(jQuery);
}
})(function($) {
return $;
});
@@ -0,0 +1,301 @@
/*!
* dependencyLibs/inputmask.dependencyLib.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "../global/window" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("../global/window"));
} else {
window.dependencyLib = factory(window);
}
})(function(window) {
var document = window.document;
function indexOf(list, elem) {
var i = 0, len = list.length;
for (;i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
var length = "length" in obj && obj.length, ltype = typeof obj;
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
}
function isValidElement(elem) {
return elem instanceof Element;
}
function DependencyLib(elem) {
if (elem instanceof DependencyLib) {
return elem;
}
if (!(this instanceof DependencyLib)) {
return new DependencyLib(elem);
}
if (elem !== undefined && elem !== null && elem !== window) {
this[0] = elem.nodeName ? elem : elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem);
if (this[0] !== undefined && this[0] !== null) {
this[0].eventRegistry = this[0].eventRegistry || {};
}
}
}
function getWindow(elem) {
return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;
}
DependencyLib.prototype = {
on: function(events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry, elem = this[0];
function addEvent(ev, namespace) {
if (elem.addEventListener) {
elem.addEventListener(ev, handler, false);
} else if (elem.attachEvent) {
elem.attachEvent("on" + ev, handler);
}
eventRegistry[ev] = eventRegistry[ev] || {};
eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];
eventRegistry[ev][namespace].push(handler);
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."), ev = nsEvent[0], namespace = nsEvent[1] || "global";
addEvent(ev, namespace);
}
}
return this;
},
off: function(events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry, elem = this[0];
function removeEvent(ev, namespace, handler) {
if (ev in eventRegistry === true) {
if (elem.removeEventListener) {
elem.removeEventListener(ev, handler, false);
} else if (elem.detachEvent) {
elem.detachEvent("on" + ev, handler);
}
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);
}
} else {
eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
}
}
}
function resolveNamespace(ev, namespace) {
var evts = [], hndx, hndL;
if (ev.length > 0) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: eventRegistry[ev][namespace][hndx]
});
}
} else {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: handler
});
}
} else if (namespace.length > 0) {
for (var evNdx in eventRegistry) {
for (var nmsp in eventRegistry[evNdx]) {
if (nmsp === namespace) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: eventRegistry[evNdx][nmsp][hndx]
});
}
} else {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: handler
});
}
}
}
}
}
return evts;
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);
for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {
removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
}
}
}
return this;
},
trigger: function(events) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry, elem = this[0];
var _events = typeof events === "string" ? events.split(" ") : [ events.type ];
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."), ev = nsEvent[0], namespace = nsEvent[1] || "global";
if (document !== undefined && namespace === "global") {
var evnt, i, params = {
bubbles: true,
cancelable: true,
detail: arguments[1]
};
if (document.createEvent) {
try {
evnt = new CustomEvent(ev, params);
} catch (e) {
evnt = document.createEvent("CustomEvent");
evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);
}
if (events.type) DependencyLib.extend(evnt, events);
elem.dispatchEvent(evnt);
} else {
evnt = document.createEventObject();
evnt.eventType = ev;
evnt.detail = arguments[1];
if (events.type) DependencyLib.extend(evnt, events);
elem.fireEvent("on" + evnt.eventType, evnt);
}
} else if (eventRegistry[ev] !== undefined) {
arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {
eventRegistry[ev][nmsp][i].apply(elem, arguments);
}
}
} else {
for (i = 0; i < eventRegistry[ev][namespace].length; i++) {
eventRegistry[ev][namespace][i].apply(elem, arguments);
}
}
}
}
}
return this;
}
};
DependencyLib.isFunction = function(obj) {
return typeof obj === "function";
};
DependencyLib.noop = function() {};
DependencyLib.isArray = Array.isArray;
DependencyLib.inArray = function(elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
DependencyLib.valHooks = undefined;
DependencyLib.isPlainObject = function(obj) {
if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
return true;
};
DependencyLib.extend = function() {
var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
if (typeof target === "boolean") {
deep = target;
target = arguments[i] || {};
i++;
}
if (typeof target !== "object" && !DependencyLib.isFunction(target)) {
target = {};
}
if (i === length) {
target = this;
i--;
}
for (;i < length; i++) {
if ((options = arguments[i]) != null) {
for (name in options) {
src = target[name];
copy = options[name];
if (target === copy) {
continue;
}
if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && DependencyLib.isArray(src) ? src : [];
} else {
clone = src && DependencyLib.isPlainObject(src) ? src : {};
}
target[name] = DependencyLib.extend(deep, clone, copy);
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
return target;
};
DependencyLib.each = function(obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
DependencyLib.data = function(owner, key, value) {
if (value === undefined) {
return owner.__data ? owner.__data[key] : null;
} else {
owner.__data = owner.__data || {};
owner.__data[key] = value;
}
};
if (typeof window.CustomEvent === "function") {
DependencyLib.Event = window.CustomEvent;
} else {
DependencyLib.Event = function(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
DependencyLib.Event.prototype = window.Event.prototype;
}
return DependencyLib;
});
+11
View File
@@ -0,0 +1,11 @@
/*!
* global/window.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
if (typeof define === "function" && define.amd) define(function() {
return window || new (eval("require('jsdom')")("").window)();
}); else if (typeof exports === "object") module.exports = window || new (eval("require('jsdom')")("").window)();
@@ -0,0 +1,253 @@
/*!
* inputmask.date.extensions.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "./inputmask" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
})(function(Inputmask) {
var $ = Inputmask.dependencyLib;
var formatCode = {
d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ],
dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
return pad(Date.prototype.getDate.call(this), 2);
} ],
ddd: [ "" ],
dddd: [ "" ],
m: [ "[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
return Date.prototype.getMonth.call(this) + 1;
} ],
mm: [ "0[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
return pad(Date.prototype.getMonth.call(this) + 1, 2);
} ],
mmm: [ "" ],
mmmm: [ "" ],
yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() {
return pad(Date.prototype.getFullYear.call(this), 2);
} ],
yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() {
return pad(Date.prototype.getFullYear.call(this), 4);
} ],
h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() {
return pad(Date.prototype.getHours.call(this), 2);
} ],
hhh: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
HH: [ "[01][0-9]|2[0-3]", Date.prototype.setHours, "hours", function() {
return pad(Date.prototype.getHours.call(this), 2);
} ],
HHH: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ],
MM: [ "[0-5][0-9]", Date.prototype.setMinutes, "minutes", function() {
return pad(Date.prototype.getMinutes.call(this), 2);
} ],
s: [ "[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds ],
ss: [ "[0-5][0-9]", Date.prototype.setSeconds, "seconds", function() {
return pad(Date.prototype.getSeconds.call(this), 2);
} ],
l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() {
return pad(Date.prototype.getMilliseconds.call(this), 3);
} ],
L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() {
return pad(Date.prototype.getMilliseconds.call(this), 2);
} ],
t: [ "[ap]" ],
tt: [ "[ap]m" ],
T: [ "[AP]" ],
TT: [ "[AP]M" ],
Z: [ "" ],
o: [ "" ],
S: [ "" ]
}, formatAlias = {
isoDate: "yyyy-mm-dd",
isoTime: "HH:MM:ss",
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};
function getTokenizer(opts) {
if (!opts.tokenizer) {
var tokens = [];
for (var ndx in formatCode) {
if (tokens.indexOf(ndx[0]) === -1) tokens.push(ndx[0]);
}
opts.tokenizer = "(" + tokens.join("+|") + ")+?|.";
opts.tokenizer = new RegExp(opts.tokenizer, "g");
}
return opts.tokenizer;
}
function isValidDate(dateParts, currentResult) {
return !isFinite(dateParts.rawday) || dateParts.day == "29" && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day ? currentResult : false;
}
function isDateInRange(dateParts, opts) {
var result = true;
if (opts.min) {
if (dateParts["rawyear"]) {
var rawYear = dateParts["rawyear"].replace(/[^0-9]/g, ""), minYear = opts.min.year.substr(0, rawYear.length);
result = minYear <= rawYear;
}
if (dateParts["year"] === dateParts["rawyear"]) {
if (opts.min.date.getTime() === opts.min.date.getTime()) {
result = opts.min.date.getTime() <= dateParts.date.getTime();
}
}
}
if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {
result = opts.max.date.getTime() >= dateParts.date.getTime();
}
return result;
}
function parse(format, dateObjValue, opts, raw) {
var mask = "", match;
while (match = getTokenizer(opts).exec(format)) {
if (dateObjValue === undefined) {
if (formatCode[match[0]]) {
mask += "(" + formatCode[match[0]][0] + ")";
} else {
switch (match[0]) {
case "[":
mask += "(";
break;
case "]":
mask += ")?";
break;
default:
mask += Inputmask.escapeRegex(match[0]);
}
}
} else {
if (formatCode[match[0]]) {
if (raw !== true && formatCode[match[0]][3]) {
var getFn = formatCode[match[0]][3];
mask += getFn.call(dateObjValue.date);
} else if (formatCode[match[0]][2]) mask += dateObjValue["raw" + formatCode[match[0]][2]]; else mask += match[0];
} else mask += match[0];
}
}
return mask;
}
function pad(val, len) {
val = String(val);
len = len || 2;
while (val.length < len) val = "0" + val;
return val;
}
function analyseMask(maskString, format, opts) {
var dateObj = {
date: new Date(1, 0, 1)
}, targetProp, mask = maskString, match, dateOperation, targetValidator;
function extendProperty(value) {
var correctedValue = value.replace(/[^0-9]/g, "0");
if (correctedValue != value) {
var enteredPart = value.replace(/[^0-9]/g, ""), min = (opts.min && opts.min[targetProp] || value).toString(), max = (opts.max && opts.max[targetProp] || value).toString();
correctedValue = enteredPart + (enteredPart < min.slice(0, enteredPart.length) ? min.slice(enteredPart.length) : enteredPart > max.slice(0, enteredPart.length) ? max.slice(enteredPart.length) : correctedValue.toString().slice(enteredPart.length));
}
return correctedValue;
}
function setValue(dateObj, value, opts) {
dateObj[targetProp] = extendProperty(value);
dateObj["raw" + targetProp] = value;
if (dateOperation !== undefined) dateOperation.call(dateObj.date, targetProp == "month" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
}
if (typeof mask === "string") {
while (match = getTokenizer(opts).exec(format)) {
var value = mask.slice(0, match[0].length);
if (formatCode.hasOwnProperty(match[0])) {
targetValidator = formatCode[match[0]][0];
targetProp = formatCode[match[0]][2];
dateOperation = formatCode[match[0]][1];
setValue(dateObj, value, opts);
}
mask = mask.slice(value.length);
}
return dateObj;
} else if (mask && typeof mask === "object" && mask.hasOwnProperty("date")) {
return mask;
}
return undefined;
}
Inputmask.extendAliases({
datetime: {
mask: function(opts) {
formatCode.S = opts.i18n.ordinalSuffix.join("|");
opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat;
opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat;
opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat;
opts.placeholder = opts.placeholder !== "" ? opts.placeholder : opts.inputFormat.replace(/[\[\]]/, "");
opts.regex = parse(opts.inputFormat, undefined, opts);
return null;
},
placeholder: "",
inputFormat: "isoDateTime",
displayFormat: undefined,
outputFormat: undefined,
min: null,
max: null,
i18n: {
dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],
monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
ordinalSuffix: [ "st", "nd", "rd", "th" ]
},
postValidation: function(buffer, pos, currentResult, opts) {
opts.min = analyseMask(opts.min, opts.inputFormat, opts);
opts.max = analyseMask(opts.max, opts.inputFormat, opts);
var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts);
if (result && dateParts.date.getTime() === dateParts.date.getTime()) {
result = isValidDate(dateParts, result);
result = result && isDateInRange(dateParts, opts);
}
if (pos && result && currentResult.pos !== pos) {
return {
buffer: parse(opts.inputFormat, dateParts, opts),
refreshFromBuffer: {
start: pos,
end: currentResult.pos
}
};
}
return result;
},
onKeyDown: function(e, buffer, caretPos, opts) {
var input = this;
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date(), match, date = "";
while (match = getTokenizer(opts).exec(opts.inputFormat)) {
if (match[0].charAt(0) === "d") {
date += pad(today.getDate(), match[0].length);
} else if (match[0].charAt(0) === "m") {
date += pad(today.getMonth() + 1, match[0].length);
} else if (match[0] === "yyyy") {
date += today.getFullYear().toString();
} else if (match[0].charAt(0) === "y") {
date += pad(today.getYear(), match[0].length);
}
}
input.inputmask._valueSet(date);
$(input).trigger("setvalue");
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);
},
casing: function(elem, test, pos, validPositions) {
if (test.nativeDef.indexOf("[ap]") == 0) return elem.toLowerCase();
if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
return elem;
},
insertMode: false,
shiftPositions: false
}
});
return Inputmask;
});
@@ -0,0 +1,97 @@
/*!
* inputmask.extensions.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "./inputmask" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
})(function(Inputmask) {
Inputmask.extendDefinitions({
A: {
validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
casing: "upper"
},
"&": {
validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
casing: "upper"
},
"#": {
validator: "[0-9A-Fa-f]",
casing: "upper"
}
});
Inputmask.extendAliases({
cssunit: {
regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"
},
url: {
regex: "(https?|ftp)//.*",
autoUnmask: false
},
ip: {
mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
definitions: {
i: {
validator: function(chrs, maskset, pos, strict, opts) {
if (pos - 1 > -1 && maskset.buffer[pos - 1] !== ".") {
chrs = maskset.buffer[pos - 1] + chrs;
if (pos - 2 > -1 && maskset.buffer[pos - 2] !== ".") {
chrs = maskset.buffer[pos - 2] + chrs;
} else chrs = "0" + chrs;
} else chrs = "00" + chrs;
return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
}
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
},
inputmode: "numeric"
},
email: {
mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
greedy: false,
casing: "lower",
onBeforePaste: function(pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]"
},
"-": {
validator: "[0-9A-Za-z-]"
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
},
inputmode: "email"
},
mac: {
mask: "##:##:##:##:##:##"
},
vin: {
mask: "V{13}9{4}",
definitions: {
V: {
validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
casing: "upper"
}
},
clearIncomplete: true,
autoUnmask: true
}
});
return Inputmask;
});
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,553 @@
/*!
* inputmask.numeric.extensions.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "./inputmask" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
})(function(Inputmask) {
var $ = Inputmask.dependencyLib;
function autoEscape(txt, opts) {
var escapedTxt = "";
for (var i = 0; i < txt.length; i++) {
if (Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i)) {
escapedTxt += "\\" + txt.charAt(i);
} else escapedTxt += txt.charAt(i);
}
return escapedTxt;
}
function alignDigits(buffer, digits, opts) {
if (digits > 0) {
var radixPosition = $.inArray(opts.radixPoint, buffer);
if (radixPosition === -1) {
buffer.push(opts.radixPoint);
radixPosition = buffer.length - 1;
}
for (var i = 1; i <= digits; i++) {
buffer[radixPosition + i] = buffer[radixPosition + i] || "0";
}
}
return buffer;
}
Inputmask.extendAliases({
numeric: {
mask: function(opts) {
if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {
opts.integerDigits = opts.repeat;
}
opts.repeat = 0;
if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== "0") {
if (opts.radixPoint === ".") {
opts.groupSeparator = ",";
} else if (opts.radixPoint === ",") {
opts.groupSeparator = ".";
} else opts.groupSeparator = "";
}
if (opts.groupSeparator === " ") {
opts.skipOptionalPartCharacter = undefined;
}
opts.autoGroup = opts.autoGroup && opts.groupSeparator !== "";
if (opts.autoGroup) {
if (typeof opts.groupSize == "string" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);
if (isFinite(opts.integerDigits)) {
var seps = Math.floor(opts.integerDigits / opts.groupSize);
var mod = opts.integerDigits % opts.groupSize;
opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);
if (opts.integerDigits < 1) {
opts.integerDigits = "*";
}
}
}
if (opts.placeholder.length > 1) {
opts.placeholder = opts.placeholder.charAt(0);
}
if (opts.positionCaretOnClick === "radixFocus" && (opts.placeholder === "" && opts.integerOptional === false)) {
opts.positionCaretOnClick = "lvp";
}
opts.definitions[";"] = opts.definitions["~"];
opts.definitions[";"].definitionSymbol = "~";
if (opts.numericInput === true) {
opts.positionCaretOnClick = opts.positionCaretOnClick === "radixFocus" ? "lvp" : opts.positionCaretOnClick;
opts.digitsOptional = false;
if (isNaN(opts.digits)) opts.digits = 2;
opts.decimalProtect = false;
}
var mask = "[+]";
mask += autoEscape(opts.prefix, opts);
if (opts.integerOptional === true) {
mask += "~{1," + opts.integerDigits + "}";
} else mask += "~{" + opts.integerDigits + "}";
if (opts.digits !== undefined) {
var radixDef = opts.decimalProtect ? ":" : opts.radixPoint;
var dq = opts.digits.toString().split(",");
if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {
mask += radixDef + ";{" + opts.digits + "}";
} else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {
if (opts.digitsOptional) {
mask += "[" + radixDef + ";{1," + opts.digits + "}]";
} else mask += radixDef + ";{" + opts.digits + "}";
}
}
mask += autoEscape(opts.suffix, opts);
mask += "[-]";
opts.greedy = false;
return mask;
},
placeholder: "",
greedy: false,
digits: "*",
digitsOptional: true,
enforceDigitsOnBlur: false,
radixPoint: ".",
positionCaretOnClick: "radixFocus",
groupSize: 3,
groupSeparator: "",
autoGroup: false,
allowMinus: true,
negationSymbol: {
front: "-",
back: ""
},
integerDigits: "+",
integerOptional: true,
prefix: "",
suffix: "",
rightAlign: true,
decimalProtect: true,
min: null,
max: null,
step: 1,
insertMode: true,
autoUnmask: false,
unmaskAsNumber: false,
inputType: "text",
inputmode: "numeric",
preValidation: function(buffer, pos, c, isSelection, opts, maskset) {
if (c === "-" || c === opts.negationSymbol.front) {
if (opts.allowMinus !== true) return false;
opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;
if (buffer.join("") === "") return true;
return {
caret: maskset.validPositions[pos] ? pos : undefined,
dopost: true
};
}
if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
var radixPos = $.inArray(opts.radixPoint, buffer);
if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {
if (opts.numericInput === true) {
return pos === radixPos;
}
return {
caret: radixPos + 1
};
}
}
return true;
},
postValidation: function(buffer, pos, currentResult, opts) {
function buildPostMask(buffer, opts) {
var postMask = "";
postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}";
if (opts.radixPoint !== "") {
var radixSplit = buffer.join("").split(opts.radixPoint);
if (radixSplit[1]) {
postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}";
}
}
return postMask;
}
var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;
var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;
var maskedValue = buffer.slice();
if (opts.numericInput) {
caretPos = maskedValue.length - caretPos - 1;
maskedValue = maskedValue.reverse();
}
var charAtPos = maskedValue[caretPos];
if (charAtPos === opts.groupSeparator) {
caretPos += 1;
charAtPos = maskedValue[caretPos];
}
if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
if (charAtPos !== undefined) {
if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
maskedValue[caretPos] = "?";
if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {
prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = "?";
} else if (opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0)) {
suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = "?";
}
}
}
prefix = prefix.join("");
suffix = suffix.join("");
var processValue = maskedValue.join("").replace(prefix, "");
processValue = processValue.replace(suffix, "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
if (isNaN(opts.placeholder)) {
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "");
}
if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {
if (charAtPos === "0") {
processValue = processValue.replace(/^\?/g, "");
}
processValue = processValue.replace(/^0/g, "");
}
if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== "" && opts.numericInput !== true) {
processValue = "0" + processValue;
}
if (processValue !== "") {
processValue = processValue.split("");
if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === "blur") && isFinite(opts.digits)) {
var radixPosition = $.inArray(opts.radixPoint, processValue);
var rpb = $.inArray(opts.radixPoint, maskedValue);
if (radixPosition === -1) {
processValue.push(opts.radixPoint);
radixPosition = processValue.length - 1;
}
for (var i = 1; i <= opts.digits; i++) {
if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === "blur") && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {
processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
} else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {
processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];
}
}
}
if (opts.autoGroup === true && opts.groupSeparator !== "" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {
var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;
processValue = Inputmask(buildPostMask(processValue, opts), {
numericInput: true,
jitMasking: true,
definitions: {
"*": {
validator: "[0-9?]",
cardinality: 1
}
}
}).format(processValue.join(""));
if (addRadix) processValue += opts.radixPoint;
if (processValue.charAt(0) === opts.groupSeparator) {
processValue.substr(1);
}
} else processValue = processValue.join("");
}
if (opts.isNegative && currentResult.event === "blur") {
opts.isNegative = processValue !== "0";
}
processValue = prefix + processValue;
processValue += suffix;
if (opts.isNegative) {
processValue = opts.negationSymbol.front + processValue;
processValue += opts.negationSymbol.back;
}
processValue = processValue.split("");
if (charAtPos !== undefined) {
if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
caretPos = $.inArray("?", processValue);
if (caretPos > -1) {
processValue[caretPos] = charAtPos;
} else caretPos = currentResult.caret || 0;
} else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {
var newCaretPos = $.inArray(charAtPos, processValue);
if (newCaretPos !== -1) caretPos = newCaretPos;
}
}
if (opts.numericInput) {
caretPos = processValue.length - caretPos - 1;
processValue = processValue.reverse();
}
var rslt = {
caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
buffer: processValue,
refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
};
return rslt.refreshFromBuffer ? rslt : currentResult;
},
onBeforeWrite: function(e, buffer, caretPos, opts) {
function parseMinMaxOptions(opts) {
if (opts.parseMinMaxOptions === undefined) {
if (opts.min !== null) {
opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.radixPoint === ",") opts.min = opts.min.replace(opts.radixPoint, ".");
opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;
if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;
}
if (opts.max !== null) {
opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.radixPoint === ",") opts.max = opts.max.replace(opts.radixPoint, ".");
opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;
if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;
}
opts.parseMinMaxOptions = "done";
}
}
if (e) {
switch (e.type) {
case "keydown":
return opts.postValidation(buffer, caretPos, {
caret: caretPos,
dopost: true
}, opts);
case "blur":
case "checkval":
var unmasked;
parseMinMaxOptions(opts);
if (opts.min !== null || opts.max !== null) {
unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
unmaskAsNumber: true
}));
if (opts.min !== null && unmasked < opts.min) {
opts.isNegative = opts.min < 0;
return opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), caretPos, {
caret: caretPos,
dopost: true,
placeholder: "0"
}, opts);
} else if (opts.max !== null && unmasked > opts.max) {
opts.isNegative = opts.max < 0;
return opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), caretPos, {
caret: caretPos,
dopost: true,
placeholder: "0"
}, opts);
}
}
return opts.postValidation(buffer, caretPos, {
caret: caretPos,
placeholder: "0",
event: "blur"
}, opts);
case "_checkval":
return {
caret: caretPos
};
default:
break;
}
}
},
regex: {
integerPart: function(opts, emptyCheck) {
return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
},
integerNPart: function(opts) {
return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
}
},
definitions: {
"~": {
validator: function(chrs, maskset, pos, strict, opts, isSelection) {
var isValid, l;
if (chrs === "k" || chrs === "m") {
isValid = {
insert: [],
c: 0
};
for (var i = 0, l = chrs === "k" ? 2 : 5; i < l; i++) {
isValid.insert.push({
pos: pos + i,
c: 0
});
}
isValid.pos = pos + l;
return isValid;
}
isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
if (isValid === true) {
if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === "~" && !isSelection) {
var processValue = maskset.buffer.join("");
processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
var pvRadixSplit = processValue.split(opts.radixPoint);
if (pvRadixSplit.length > 1) {
pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));
}
if (pvRadixSplit[0] === "0") {
pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));
}
processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
var bufferTemplate = maskset._buffer.join("");
if (processValue === opts.radixPoint) {
processValue = bufferTemplate;
}
while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$") === null) {
bufferTemplate = bufferTemplate.slice(1);
}
processValue = processValue.replace(bufferTemplate, "");
processValue = processValue.split("");
if (processValue[pos] === undefined) {
isValid = {
pos: pos,
remove: pos
};
} else {
isValid = {
pos: pos
};
}
}
} else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {
isValid = {
insert: {
pos: pos,
c: 0
},
pos: pos + 1
};
}
return isValid;
},
cardinality: 1
},
"+": {
validator: function(chrs, maskset, pos, strict, opts) {
return opts.allowMinus && (chrs === "-" || chrs === opts.negationSymbol.front);
},
cardinality: 1,
placeholder: ""
},
"-": {
validator: function(chrs, maskset, pos, strict, opts) {
return opts.allowMinus && chrs === opts.negationSymbol.back;
},
cardinality: 1,
placeholder: ""
},
":": {
validator: function(chrs, maskset, pos, strict, opts) {
var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
var isValid = new RegExp(radix).test(chrs);
if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {
isValid = {
caret: pos + 1
};
}
return isValid;
},
cardinality: 1,
placeholder: function(opts) {
return opts.radixPoint;
}
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
if (unmaskedValue === "" && opts.nullable === true) {
return unmaskedValue;
}
var processValue = maskedValue.replace(opts.prefix, "");
processValue = processValue.replace(opts.suffix, "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.placeholder.charAt(0) !== "") {
processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0");
}
if (opts.unmaskAsNumber) {
if (opts.radixPoint !== "" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".");
processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
return Number(processValue);
}
return processValue;
},
isComplete: function(buffer, opts) {
var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join("");
maskedValue = maskedValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
maskedValue = maskedValue.replace(opts.prefix, "");
maskedValue = maskedValue.replace(opts.suffix, "");
maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1");
if (opts.radixPoint === ",") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".");
return isFinite(maskedValue);
},
onBeforeMask: function(initialValue, opts) {
opts.isNegative = undefined;
var radixPoint = opts.radixPoint || ",";
if ((typeof initialValue == "number" || opts.inputType === "number") && radixPoint !== "") {
initialValue = initialValue.toString().replace(".", radixPoint);
}
var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\-0-9]/g, ""), decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, "") : "";
initialValue = integerPart + (decimalPart !== "" ? radixPoint + decimalPart : decimalPart);
var digits = 0;
if (radixPoint !== "") {
digits = decimalPart.length;
if (decimalPart !== "") {
var digitsFactor = Math.pow(10, digits || 1);
if (isFinite(opts.digits)) {
digits = parseInt(opts.digits);
digitsFactor = Math.pow(10, digits);
}
initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), ".");
if (isFinite(initialValue)) initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;
initialValue = initialValue.toString().replace(".", radixPoint);
}
}
if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {
initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));
}
return alignDigits(initialValue.toString().split(""), digits, opts).join("");
},
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey) {
switch (e.keyCode) {
case Inputmask.keyCode.UP:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
$input.trigger("setvalue");
break;
case Inputmask.keyCode.DOWN:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
$input.trigger("setvalue");
break;
}
}
}
},
currency: {
prefix: "$ ",
groupSeparator: ",",
alias: "numeric",
placeholder: "0",
autoGroup: true,
digits: 2,
digitsOptional: false,
clearMaskOnLostFocus: false
},
decimal: {
alias: "numeric"
},
integer: {
alias: "numeric",
digits: 0,
radixPoint: ""
},
percentage: {
alias: "numeric",
digits: 2,
digitsOptional: true,
radixPoint: ".",
placeholder: "0",
autoGroup: false,
min: 0,
max: 100,
suffix: " %",
allowMinus: false
}
});
return Inputmask;
});
+97
View File
@@ -0,0 +1,97 @@
/*!
* jquery.inputmask.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define([ "jquery", "./inputmask" ], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("./inputmask"));
} else {
factory(jQuery, window.Inputmask);
}
})(function($, Inputmask) {
if ($.fn.inputmask === undefined) {
$.fn.inputmask = function(fn, options) {
var nptmask, input = this[0];
if (options === undefined) options = {};
if (typeof fn === "string") {
switch (fn) {
case "unmaskedvalue":
return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
case "remove":
return this.each(function() {
if (this.inputmask) this.inputmask.remove();
});
case "getemptymask":
return input && input.inputmask ? input.inputmask.getemptymask() : "";
case "hasMaskedValue":
return input && input.inputmask ? input.inputmask.hasMaskedValue() : false;
case "isComplete":
return input && input.inputmask ? input.inputmask.isComplete() : true;
case "getmetadata":
return input && input.inputmask ? input.inputmask.getmetadata() : undefined;
case "setvalue":
Inputmask.setValue(input, options);
break;
case "option":
if (typeof options === "string") {
if (input && input.inputmask !== undefined) {
return input.inputmask.option(options);
}
} else {
return this.each(function() {
if (this.inputmask !== undefined) {
return this.inputmask.option(options);
}
});
}
break;
default:
options.alias = fn;
nptmask = new Inputmask(options);
return this.each(function() {
nptmask.mask(this);
});
}
} else if (Array.isArray(fn)) {
options.alias = fn;
nptmask = new Inputmask(options);
return this.each(function() {
nptmask.mask(this);
});
} else if (typeof fn == "object") {
nptmask = new Inputmask(fn);
if (fn.mask === undefined && fn.alias === undefined) {
return this.each(function() {
if (this.inputmask !== undefined) {
return this.inputmask.option(fn);
} else nptmask.mask(this);
});
} else {
return this.each(function() {
nptmask.mask(this);
});
}
} else if (fn === undefined) {
return this.each(function() {
nptmask = new Inputmask(options);
nptmask.mask(this);
});
}
};
}
return $.fn.inputmask;
});
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
/*!
* bindings/inputmask.binding.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","../inputmask","../global/document"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"),require("../inputmask"),require("../global/document"))}else{factory(jQuery,window.Inputmask,document)}})(function($,Inputmask,document){$(document).ajaxComplete(function(event,xmlHttpRequest,ajaxOptions){if($.inArray("html",ajaxOptions.dataTypes)!==-1){$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx,lmnt){if(lmnt.inputmask===undefined){Inputmask().mask(lmnt)}})}}).ready(function(){$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(ndx,lmnt){if(lmnt.inputmask===undefined){Inputmask().mask(lmnt)}})})});
@@ -0,0 +1,9 @@
/*!
* dependencyLibs/inputmask.dependencyLib.jqlite.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["jqlite","../global/window"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jqlite"),require("../global/window"))}else{window.dependencyLib=factory(jqlite,window)}})(function($,window){var document=window.document;function indexOf(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i}}return-1}function isWindow(obj){return obj!=null&&obj===obj.window}function isArraylike(obj){var length="length"in obj&&obj.length,ltype=typeof obj;if(ltype==="function"||isWindow(obj)){return false}if(obj.nodeType===1&&length){return true}return ltype==="array"||length===0||typeof length==="number"&&length>0&&length-1 in obj}$.inArray=function(elem,arr,i){return arr==null?-1:indexOf(arr,elem,i)};$.isFunction=function(obj){return typeof obj==="function"};$.isArray=Array.isArray;$.isPlainObject=function(obj){if(typeof obj!=="object"||obj.nodeType||isWindow(obj)){return false}if(obj.constructor&&!Object.hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false}return true};$.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++}if(typeof target!=="object"&&!$.isFunction(target)){target={}}if(i===length){target=this;i--}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&($.isPlainObject(copy)||(copyIsArray=$.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&$.isArray(src)?src:[]}else{clone=src&&$.isPlainObject(src)?src:{}}target[name]=$.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target};$.each=function(obj,callback){var value,i=0;if(isArraylike(obj)){for(var length=obj.length;i<length;i++){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}else{for(i in obj){value=callback.call(obj[i],i,obj[i]);if(value===false){break}}}return obj};$.data=function(elem,name,data){return $(elem).data(name,data)};$.Event=$.Event||function CustomEvent(event,params){params=params||{bubbles:false,cancelable:false,detail:undefined};var evt=document.createEvent("CustomEvent");evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail);return evt};$.Event.prototype=window.Event.prototype;return $});
@@ -0,0 +1,9 @@
/*!
* dependencyLibs/inputmask.dependencyLib.jquery.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{window.dependencyLib=factory(jQuery)}})(function($){return $});
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
/*!
* global/window.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
if(typeof define==="function"&&define.amd)define(function(){return window||new(eval("require('jsdom')")("").window)});else if(typeof exports==="object")module.exports=window||new(eval("require('jsdom')")("").window);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
/*!
* inputmask.extensions.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["./inputmask"],factory)}else if(typeof exports==="object"){module.exports=factory(require("./inputmask"))}else{factory(window.Inputmask)}})(function(Inputmask){Inputmask.extendDefinitions({A:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",casing:"upper"},"&":{validator:"[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",casing:"upper"},"#":{validator:"[0-9A-Fa-f]",casing:"upper"}});Inputmask.extendAliases({cssunit:{regex:"[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"},url:{regex:"(https?|ftp)//.*",autoUnmask:false},ip:{mask:"i[i[i]].i[i[i]].i[i[i]].i[i[i]]",definitions:{i:{validator:function(chrs,maskset,pos,strict,opts){if(pos-1>-1&&maskset.buffer[pos-1]!=="."){chrs=maskset.buffer[pos-1]+chrs;if(pos-2>-1&&maskset.buffer[pos-2]!=="."){chrs=maskset.buffer[pos-2]+chrs}else chrs="0"+chrs}else chrs="00"+chrs;return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs)}}},onUnMask:function(maskedValue,unmaskedValue,opts){return maskedValue},inputmode:"numeric"},email:{mask:"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",greedy:false,casing:"lower",onBeforePaste:function(pastedValue,opts){pastedValue=pastedValue.toLowerCase();return pastedValue.replace("mailto:","")},definitions:{"*":{validator:"[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]"},"-":{validator:"[0-9A-Za-z-]"}},onUnMask:function(maskedValue,unmaskedValue,opts){return maskedValue},inputmode:"email"},mac:{mask:"##:##:##:##:##:##"},vin:{mask:"V{13}9{4}",definitions:{V:{validator:"[A-HJ-NPR-Za-hj-npr-z\\d]",casing:"upper"}},clearIncomplete:true,autoUnmask:true}});return Inputmask});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
/*!
* jquery.inputmask.min.js
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.3-beta.4
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","./inputmask"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"),require("./inputmask"))}else{factory(jQuery,window.Inputmask)}})(function($,Inputmask){if($.fn.inputmask===undefined){$.fn.inputmask=function(fn,options){var nptmask,input=this[0];if(options===undefined)options={};if(typeof fn==="string"){switch(fn){case"unmaskedvalue":return input&&input.inputmask?input.inputmask.unmaskedvalue():$(input).val();case"remove":return this.each(function(){if(this.inputmask)this.inputmask.remove()});case"getemptymask":return input&&input.inputmask?input.inputmask.getemptymask():"";case"hasMaskedValue":return input&&input.inputmask?input.inputmask.hasMaskedValue():false;case"isComplete":return input&&input.inputmask?input.inputmask.isComplete():true;case"getmetadata":return input&&input.inputmask?input.inputmask.getmetadata():undefined;case"setvalue":Inputmask.setValue(input,options);break;case"option":if(typeof options==="string"){if(input&&input.inputmask!==undefined){return input.inputmask.option(options)}}else{return this.each(function(){if(this.inputmask!==undefined){return this.inputmask.option(options)}})}break;default:options.alias=fn;nptmask=new Inputmask(options);return this.each(function(){nptmask.mask(this)})}}else if(Array.isArray(fn)){options.alias=fn;nptmask=new Inputmask(options);return this.each(function(){nptmask.mask(this)})}else if(typeof fn=="object"){nptmask=new Inputmask(fn);if(fn.mask===undefined&&fn.alias===undefined){return this.each(function(){if(this.inputmask!==undefined){return this.inputmask.option(fn)}else nptmask.mask(this)})}else{return this.each(function(){nptmask.mask(this)})}}else if(fn===undefined){return this.each(function(){nptmask=new Inputmask(options);nptmask.mask(this)})}}}return $.fn.inputmask});
File diff suppressed because one or more lines are too long
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
+5
View File
@@ -0,0 +1,5 @@
require("./dist/inputmask/inputmask.extensions");
require("./dist/inputmask/inputmask.date.extensions");
require("./dist/inputmask/inputmask.numeric.extensions");
module.exports = require("./dist/inputmask/inputmask.js");
@@ -0,0 +1,32 @@
/*
Input Mask plugin binding
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "../inputmask", "../global/document"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("../inputmask"), require("../global/document"));
} else {
factory(jQuery, window.Inputmask, document);
}
}
(function ($, Inputmask, document) {
$(document).ajaxComplete(function (event, xmlHttpRequest, ajaxOptions) {
if ($.inArray("html", ajaxOptions.dataTypes) !== -1) {
$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function (ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
}
}).ready(function () {
$(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function (ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
});
}));
@@ -0,0 +1,181 @@
/*
Input Mask plugin dependencyLib
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jqlite", "../global/window"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jqlite"), require("../global/window"));
} else {
window.dependencyLib = factory(jqlite, window);
}
}
(function ($, window) {
var document = window.document;
// Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5
function indexOf(list, elem) {
var i = 0,
len = list.length;
for (; i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
// Support: iOS 8.2 (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = "length" in obj && obj.length,
ltype = typeof obj;
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 ||
typeof length === "number" && length > 0 && (length - 1) in obj;
}
$.inArray = function (elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
$.isFunction = function (obj) {
return typeof obj === "function";
};
$.isArray = Array.isArray;
$.isPlainObject = function (obj) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
};
$.extend = function () {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
// Skip the boolean and the target
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !$.isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if (i === length) {
target = this;
i--;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && $.isArray(src) ? src : [];
} else {
clone = src && $.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = $.extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
// Return the modified object
return target;
};
$.each = function (obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
$.data = function (elem, name, data) {
return $(elem).data(name, data);
};
$.Event = $.Event || function CustomEvent(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
$.Event.prototype = window.Event.prototype;
return $;
}));
@@ -0,0 +1,12 @@
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jquery"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"));
} else {
window.dependencyLib = factory(jQuery);
}
}
(function ($) {
return $;
}));
@@ -0,0 +1,386 @@
/*
Input Mask plugin dependencyLib
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["../global/window"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("../global/window"));
} else {
window.dependencyLib = factory(window);
}
}
(function (window) {
var document = window.document;
//helper functions
// Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5
function indexOf(list, elem) {
var i = 0,
len = list.length;
for (; i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
// Support: iOS 8.2 (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = "length" in obj && obj.length,
ltype = typeof obj;
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 ||
typeof length === "number" && length > 0 && (length - 1) in obj;
}
function isValidElement(elem) {
return elem instanceof Element;
}
function DependencyLib(elem) {
if (elem instanceof DependencyLib) {
return elem;
}
if (!(this instanceof DependencyLib)) {
return new DependencyLib(elem);
}
if (elem !== undefined && elem !== null && elem !== window) {
this[0] = elem.nodeName ? elem : (elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem));
if (this[0] !== undefined && this[0] !== null) {
this[0].eventRegistry = this[0].eventRegistry || {};
}
}
}
function getWindow(elem) {
return isWindow(elem) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
DependencyLib.prototype = {
on: function (events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
function addEvent(ev, namespace) {
//register domevent
if (elem.addEventListener) { // all browsers except IE before version 9
elem.addEventListener(ev, handler, false);
} else if (elem.attachEvent) { // IE before version 9
elem.attachEvent("on" + ev, handler);
}
eventRegistry[ev] = eventRegistry[ev] || {};
eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];
eventRegistry[ev][namespace].push(handler);
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
ev = nsEvent[0],
namespace = nsEvent[1] || "global";
addEvent(ev, namespace);
}
}
return this;
},
off: function (events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
function removeEvent(ev, namespace, handler) {
if (ev in eventRegistry === true) {
//unbind to dom events
if (elem.removeEventListener) { // all browsers except IE before version 9
elem.removeEventListener(ev, handler, false);
} else if (elem.detachEvent) { // IE before version 9
elem.detachEvent("on" + ev, handler);
}
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);
}
} else {
eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
}
}
}
function resolveNamespace(ev, namespace) {
var evts = [],
hndx, hndL;
if (ev.length > 0) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: eventRegistry[ev][namespace][hndx]
});
}
} else {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: handler
});
}
} else if (namespace.length > 0) {
for (var evNdx in eventRegistry) {
for (var nmsp in eventRegistry[evNdx]) {
if (nmsp === namespace) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: eventRegistry[evNdx][nmsp][hndx]
});
}
} else {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: handler
});
}
}
}
}
}
return evts;
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);
for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {
removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
}
}
}
return this;
},
trigger: function (events /* , args... */) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
var _events = typeof events === "string" ? events.split(" ") : [events.type];
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
ev = nsEvent[0],
namespace = nsEvent[1] || "global";
if (document !== undefined && namespace === "global") {
//trigger domevent
var evnt, i, params = {
bubbles: true,
cancelable: true,
detail: arguments[1]
};
// The custom event that will be created
if (document.createEvent) {
try {
evnt = new CustomEvent(ev, params);
} catch (e) {
evnt = document.createEvent("CustomEvent");
evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);
}
if (events.type) DependencyLib.extend(evnt, events);
elem.dispatchEvent(evnt);
} else {
evnt = document.createEventObject();
evnt.eventType = ev;
evnt.detail = arguments[1];
if (events.type) DependencyLib.extend(evnt, events);
elem.fireEvent("on" + evnt.eventType, evnt);
}
} else if (eventRegistry[ev] !== undefined) {
arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {
eventRegistry[ev][nmsp][i].apply(elem, arguments);
}
}
} else {
for (i = 0; i < eventRegistry[ev][namespace].length; i++) {
eventRegistry[ev][namespace][i].apply(elem, arguments);
}
}
}
}
}
return this;
}
};
//static
DependencyLib.isFunction = function (obj) {
return typeof obj === "function";
};
DependencyLib.noop = function () {
};
DependencyLib.isArray = Array.isArray;
DependencyLib.inArray = function (elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
DependencyLib.valHooks = undefined;
DependencyLib.isPlainObject = function (obj) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
};
DependencyLib.extend = function () {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
// Skip the boolean and the target
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !DependencyLib.isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if (i === length) {
target = this;
i--;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && DependencyLib.isArray(src) ? src : [];
} else {
clone = src && DependencyLib.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = DependencyLib.extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
// Return the modified object
return target;
};
DependencyLib.each = function (obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
DependencyLib.data = function (owner, key, value) {
if (value === undefined) {
return owner.__data ? owner.__data[key] : null;
} else {
owner.__data = owner.__data || {};
owner.__data[key] = value;
}
};
if (typeof window.CustomEvent === "function") {
DependencyLib.Event = window.CustomEvent;
}
else {
DependencyLib.Event = function (event, params) {
params = params || {bubbles: false, cancelable: false, detail: undefined};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
DependencyLib.Event.prototype = window.Event.prototype;
}
return DependencyLib;
}));
+7
View File
@@ -0,0 +1,7 @@
if (typeof define === "function" && define.amd)
define(function () {
return window || new (eval("require('jsdom')")('')).window;
});
else if (typeof exports === "object")
module.exports = window || new (eval("require('jsdom')")('')).window;
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
@@ -0,0 +1,303 @@
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Optional extensions on the jquery.inputmask base
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["./inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
}
(function (Inputmask) {
var $ = Inputmask.dependencyLib;
var //supported codes for formatting
//http://blog.stevenlevithan.com/archives/date-time-format
//https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings?view=netframework-4.7
formatCode = { //regex, valueSetter, type, displayformatter
d: ["[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate], //Day of the month as digits; no leading zero for single-digit days.
dd: ["0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function () {
return pad(Date.prototype.getDate.call(this), 2);
}], //Day of the month as digits; leading zero for single-digit days.
ddd: [""], //Day of the week as a three-letter abbreviation.
dddd: [""], //Day of the week as its full name.
m: ["[1-9]|1[012]", Date.prototype.setMonth, "month", function () {
return Date.prototype.getMonth.call(this) + 1;
}], //Month as digits; no leading zero for single-digit months.
mm: ["0[1-9]|1[012]", Date.prototype.setMonth, "month", function () {
return pad(Date.prototype.getMonth.call(this) + 1, 2);
}], //Month as digits; leading zero for single-digit months.
mmm: [""], //Month as a three-letter abbreviation.
mmmm: [""], //Month as its full name.
yy: ["[0-9]{2}", Date.prototype.setFullYear, "year", function () {
return pad(Date.prototype.getFullYear.call(this), 2);
}], //Year as last two digits; leading zero for years less than 10.
yyyy: ["[0-9]{4}", Date.prototype.setFullYear, "year", function () {
return pad(Date.prototype.getFullYear.call(this), 4);
}],
h: ["[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours], //Hours; no leading zero for single-digit hours (12-hour clock).
hh: ["0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function () {
return pad(Date.prototype.getHours.call(this), 2);
}], //Hours; leading zero for single-digit hours (12-hour clock).
hhh: ["[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours], //Hours; no limit
H: ["1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours], //Hours; no leading zero for single-digit hours (24-hour clock).
HH: ["[01][0-9]|2[0-3]", Date.prototype.setHours, "hours", function () {
return pad(Date.prototype.getHours.call(this), 2);
}], //Hours; leading zero for single-digit hours (24-hour clock).
HHH: ["[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours], //Hours; no limit
M: ["[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes], //Minutes; no leading zero for single-digit minutes. Uppercase M unlike CF timeFormat's m to avoid conflict with months.
MM: ["[0-5][0-9]", Date.prototype.setMinutes, "minutes", function () {
return pad(Date.prototype.getMinutes.call(this), 2);
}], //Minutes; leading zero for single-digit minutes. Uppercase MM unlike CF timeFormat's mm to avoid conflict with months.
s: ["[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds], //Seconds; no leading zero for single-digit seconds.
ss: ["[0-5][0-9]", Date.prototype.setSeconds, "seconds", function () {
return pad(Date.prototype.getSeconds.call(this), 2);
}], //Seconds; leading zero for single-digit seconds.
l: ["[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function () {
return pad(Date.prototype.getMilliseconds.call(this), 3);
}], //Milliseconds. 3 digits.
L: ["[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function () {
return pad(Date.prototype.getMilliseconds.call(this), 2);
}], //Milliseconds. 2 digits.
t: ["[ap]"], //Lowercase, single-character time marker string: a or p.
tt: ["[ap]m"], //two-character time marker string: am or pm.
T: ["[AP]"], //single-character time marker string: A or P.
TT: ["[AP]M"], //two-character time marker string: AM or PM.
Z: [""], //US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the GMT/UTC offset is returned, e.g. GMT-0500
o: [""], //GMT/UTC timezone offset, e.g. -0500 or +0230.
S: [""] //The date's ordinal suffix (st, nd, rd, or th).
},
formatAlias = {
isoDate: "yyyy-mm-dd", //2007-06-09
isoTime: "HH:MM:ss", //17:46:21
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", //2007-06-09T17:46:21
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" //2007-06-09T22:46:21Z
};
function getTokenizer(opts) {
if (!opts.tokenizer) {
var tokens = [];
for (var ndx in formatCode) {
if (tokens.indexOf(ndx[0]) === -1)
tokens.push(ndx[0]);
}
opts.tokenizer = "(" + tokens.join("+|") + ")+?|.";
opts.tokenizer = new RegExp(opts.tokenizer, "g");
}
return opts.tokenizer;
}
function isValidDate(dateParts, currentResult) {
return !isFinite(dateParts.rawday)
|| (dateParts.day == "29" && !isFinite(dateParts.rawyear))
|| new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day
? currentResult
: false; //take corrective action if possible
}
function isDateInRange(dateParts, opts) {
var result = true;
if (opts.min) {
if (dateParts["rawyear"]) {
var rawYear = dateParts["rawyear"].replace(/[^0-9]/g, ""),
minYear = opts.min.year.substr(0, rawYear.length);
result = minYear <= rawYear;
}
if (dateParts["year"] === dateParts["rawyear"]) {
if (opts.min.date.getTime() === opts.min.date.getTime()) {
result = opts.min.date.getTime() <= dateParts.date.getTime();
}
}
}
if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {
result = opts.max.date.getTime() >= dateParts.date.getTime();
}
return result;
}
//parse the given format and return a mask pattern
//when a dateObjValue is passed a datestring in the requested format is returned
function parse(format, dateObjValue, opts, raw) {
//parse format to regex string
var mask = "", match;
while (match = getTokenizer(opts).exec(format)) {
if (dateObjValue === undefined) {
if (formatCode[match[0]]) {
mask += "(" + formatCode[match[0]][0] + ")";
} else {
switch (match[0]) {
case "[":
mask += "(";
break;
case "]":
mask += ")?";
break;
default:
mask += Inputmask.escapeRegex(match[0]);
}
}
}
else {
if (formatCode[match[0]]) {
if (raw !== true && formatCode[match[0]][3]) {
var getFn = formatCode[match[0]][3];
mask += getFn.call(dateObjValue.date);
}
else if (formatCode[match[0]][2]) mask += dateObjValue["raw" + formatCode[match[0]][2]];
else mask += match[0];
}
else mask += match[0];
}
}
return mask;
}
//padding function
function pad(val, len) {
val = String(val);
len = len || 2;
while (val.length < len) val = "0" + val;
return val;
}
function analyseMask(maskString, format, opts) {
var dateObj = {"date": new Date(1, 0, 1)}, targetProp, mask = maskString, match, dateOperation, targetValidator;
function extendProperty(value) {
var correctedValue = value.replace(/[^0-9]/g, "0");
if (correctedValue != value) { //only do correction on incomplete values
//determine best validation match
var enteredPart = value.replace(/[^0-9]/g, ""),
min = (opts.min && opts.min[targetProp] || value).toString(),
max = (opts.max && opts.max[targetProp] || value).toString();
correctedValue = enteredPart + (enteredPart < min.slice(0, enteredPart.length) ? min.slice(enteredPart.length) : (enteredPart > max.slice(0, enteredPart.length) ? max.slice(enteredPart.length) : correctedValue.toString().slice(enteredPart.length)));
}
return correctedValue;
}
function setValue(dateObj, value, opts) {
dateObj[targetProp] = extendProperty(value);
dateObj["raw" + targetProp] = value;
if (dateOperation !== undefined)
dateOperation.call(dateObj.date, targetProp == "month" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
}
if (typeof mask === "string") {
while (match = getTokenizer(opts).exec(format)) {
var value = mask.slice(0, match[0].length);
if (formatCode.hasOwnProperty(match[0])) {
targetValidator = formatCode[match[0]][0];
targetProp = formatCode[match[0]][2];
dateOperation = formatCode[match[0]][1];
setValue(dateObj, value, opts);
}
mask = mask.slice(value.length);
}
return dateObj;
} else if (mask && typeof mask === "object" && mask.hasOwnProperty("date")) {
return mask;
}
return undefined;
}
Inputmask.extendAliases({
"datetime": {
mask: function (opts) {
//localize
formatCode.S = opts.i18n.ordinalSuffix.join("|");
opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat; //resolve possible formatAlias
opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat; //resolve possible formatAlias
opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat; //resolve possible formatAlias
opts.placeholder = opts.placeholder !== "" ? opts.placeholder : opts.inputFormat.replace(/[\[\]]/, "");
opts.regex = parse(opts.inputFormat, undefined, opts);
// console.log(opts.regex);
return null; //migrate to regex mask
},
placeholder: "", //set default as none (~ auto); when a custom placeholder is passed it will be used
inputFormat: "isoDateTime", //format used to input the date
displayFormat: undefined, //visual format when the input looses focus
outputFormat: undefined, //unmasking format
min: null, //needs to be in the same format as the inputfornat
max: null, //needs to be in the same format as the inputfornat,
// Internationalization strings
i18n: {
dayNames: [
"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
ordinalSuffix: ["st", "nd", "rd", "th"]
},
postValidation: function (buffer, pos, currentResult, opts) {
opts.min = analyseMask(opts.min, opts.inputFormat, opts);
opts.max = analyseMask(opts.max, opts.inputFormat, opts);
var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts);
if (result && dateParts.date.getTime() === dateParts.date.getTime()) { //check for a valid date ~ an invalid date returns NaN which isn't equal
result = isValidDate(dateParts, result);
result = result && isDateInRange(dateParts, opts);
}
if (pos && result && currentResult.pos !== pos) {
return {
buffer: parse(opts.inputFormat, dateParts, opts),
refreshFromBuffer: {start: pos, end: currentResult.pos}
};
}
return result;
},
onKeyDown: function (e, buffer, caretPos, opts) {
var input = this;
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date(), match, date = "";
while (match = getTokenizer(opts).exec(opts.inputFormat)) {
if (match[0].charAt(0) === "d") {
date += pad(today.getDate(), match[0].length);
} else if (match[0].charAt(0) === "m") {
date += pad((today.getMonth() + 1), match[0].length);
} else if (match[0] === "yyyy") {
date += today.getFullYear().toString();
} else if (match[0].charAt(0) === "y") {
date += pad(today.getYear(), match[0].length);
}
}
input.inputmask._valueSet(date);
$(input).trigger("setvalue");
}
},
onUnMask: function (maskedValue, unmaskedValue, opts) {
return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);
},
casing: function (elem, test, pos, validPositions) {
if (test.nativeDef.indexOf("[ap]") == 0) return elem.toLowerCase();
if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
return elem;
},
insertMode: false,
shiftPositions: false
}
});
return Inputmask;
}
))
;
@@ -0,0 +1,105 @@
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Optional extensions on the jquery.inputmask base
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["./inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
}
(function (Inputmask) {
//extra definitions
Inputmask.extendDefinitions({
"A": {
validator: "[A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",
casing: "upper" //auto uppercasing
},
"&": { //alfanumeric uppercasing
validator: "[0-9A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",
casing: "upper"
},
"#": { //hexadecimal
validator: "[0-9A-Fa-f]",
casing: "upper"
}
});
Inputmask.extendAliases({
"cssunit": {
regex: '[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)'
},
"url": { //needs update => https://en.wikipedia.org/wiki/URL
regex: "(https?|ftp)//.*",
autoUnmask: false
},
"ip": { //ip-address mask
mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
definitions: {
"i": {
validator: function (chrs, maskset, pos, strict, opts) {
if (pos - 1 > -1 && maskset.buffer[pos - 1] !== ".") {
chrs = maskset.buffer[pos - 1] + chrs;
if (pos - 2 > -1 && maskset.buffer[pos - 2] !== ".") {
chrs = maskset.buffer[pos - 2] + chrs;
} else chrs = "0" + chrs;
} else chrs = "00" + chrs;
return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
}
}
},
onUnMask: function (maskedValue, unmaskedValue, opts) {
return maskedValue;
},
inputmode: "numeric",
},
"email": {
//https://en.wikipedia.org/wiki/Domain_name#Domain_name_space
//https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
//should be extended with the toplevel domains at the end
mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
greedy: false,
casing: "lower",
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: "[0-9\uFF11-\uFF19A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5!#$%&'*+/=?^_`{|}~\-]"
},
"-": {
validator: "[0-9A-Za-z\-]"
}
},
onUnMask: function (maskedValue, unmaskedValue, opts) {
return maskedValue;
},
inputmode: "email"
},
"mac": {
mask: "##:##:##:##:##:##"
},
//https://en.wikipedia.org/wiki/Vehicle_identification_number
// see issue #1199
"vin": {
mask: "V{13}9{4}",
definitions: {
'V': {
validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
casing: "upper"
}
},
clearIncomplete: true,
autoUnmask: true
}
});
return Inputmask;
}));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,627 @@
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Optional extensions on the jquery.inputmask base
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["./inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask"));
} else {
factory(window.Inputmask);
}
}
(function (Inputmask) {
var $ = Inputmask.dependencyLib;
function autoEscape(txt, opts) {
var escapedTxt = "";
for (var i = 0; i < txt.length; i++) {
if (Inputmask.prototype.definitions[txt.charAt(i)] ||
opts.definitions[txt.charAt(i)] ||
opts.optionalmarker.start === txt.charAt(i) ||
opts.optionalmarker.end === txt.charAt(i) ||
opts.quantifiermarker.start === txt.charAt(i) ||
opts.quantifiermarker.end === txt.charAt(i) ||
opts.groupmarker.start === txt.charAt(i) ||
opts.groupmarker.end === txt.charAt(i) ||
opts.alternatormarker === txt.charAt(i)) {
escapedTxt += "\\" + txt.charAt(i)
} else escapedTxt += txt.charAt(i);
}
return escapedTxt;
}
function alignDigits(buffer, digits, opts) {
if (digits > 0) {
var radixPosition = $.inArray(opts.radixPoint, buffer);
if (radixPosition === -1) {
buffer.push(opts.radixPoint);
radixPosition = buffer.length - 1;
}
for (var i = 1; i <= digits; i++) {
buffer[radixPosition + i] = buffer[radixPosition + i] || "0";
}
}
return buffer;
}
//number aliases
Inputmask.extendAliases({
"numeric": {
mask: function (opts) {
if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {
opts.integerDigits = opts.repeat;
}
opts.repeat = 0;
if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== "0") { //treat equal separator and radixpoint
if (opts.radixPoint === ".") {
opts.groupSeparator = ",";
} else if (opts.radixPoint === ",") {
opts.groupSeparator = ".";
} else opts.groupSeparator = "";
}
if (opts.groupSeparator === " ") { //prevent conflict with default skipOptionalPartCharacter
opts.skipOptionalPartCharacter = undefined;
}
opts.autoGroup = opts.autoGroup && opts.groupSeparator !== "";
if (opts.autoGroup) {
if (typeof opts.groupSize == "string" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);
if (isFinite(opts.integerDigits)) {
var seps = Math.floor(opts.integerDigits / opts.groupSize);
var mod = opts.integerDigits % opts.groupSize;
opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);
if (opts.integerDigits < 1) {
opts.integerDigits = "*";
}
}
}
//enforce placeholder to single
if (opts.placeholder.length > 1) {
opts.placeholder = opts.placeholder.charAt(0);
}
//only allow radixfocus when placeholder = 0
if (opts.positionCaretOnClick === "radixFocus" && (opts.placeholder === "" && opts.integerOptional === false)) {
opts.positionCaretOnClick = "lvp";
}
opts.definitions[";"] = opts.definitions["~"]; //clone integer def for decimals
opts.definitions[";"].definitionSymbol = "~";
if (opts.numericInput === true) { //finance people input style
opts.positionCaretOnClick = opts.positionCaretOnClick === "radixFocus" ? "lvp" : opts.positionCaretOnClick;
opts.digitsOptional = false;
if (isNaN(opts.digits)) opts.digits = 2;
opts.decimalProtect = false;
}
var mask = "[+]";
mask += autoEscape(opts.prefix, opts);
if (opts.integerOptional === true) {
mask += "~{1," + opts.integerDigits + "}";
} else mask += "~{" + opts.integerDigits + "}";
if (opts.digits !== undefined) {
var radixDef = opts.decimalProtect ? ":" : opts.radixPoint;
var dq = opts.digits.toString().split(",");
if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {
mask += radixDef + ";{" + opts.digits + "}";
} else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {
if (opts.digitsOptional) {
mask += "[" + radixDef + ";{1," + opts.digits + "}]";
} else mask += radixDef + ";{" + opts.digits + "}";
}
}
mask += autoEscape(opts.suffix, opts);
mask += "[-]";
opts.greedy = false; //enforce greedy false
// console.log(mask);
return mask;
},
placeholder: "",
greedy: false,
digits: "*", //number of fractionalDigits
digitsOptional: true,
enforceDigitsOnBlur: false,
radixPoint: ".",
positionCaretOnClick: "radixFocus",
groupSize: 3,
groupSeparator: "",
autoGroup: false,
allowMinus: true,
negationSymbol: {
front: "-", //"("
back: "" //")"
},
integerDigits: "+", //number of integerDigits
integerOptional: true,
prefix: "",
suffix: "",
rightAlign: true,
decimalProtect: true, //do not allow assumption of decimals input without entering the radixpoint
min: null, //minimum value
max: null, //maximum value
step: 1,
insertMode: true,
autoUnmask: false,
unmaskAsNumber: false,
inputType: "text", //number ~ indicates whether the value passed for initialization is text or a number
inputmode: "numeric",
preValidation: function (buffer, pos, c, isSelection, opts, maskset) {
if (c === "-" || c === opts.negationSymbol.front) {
if (opts.allowMinus !== true) return false;
opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;
if (buffer.join("") === "") return true;
return {
caret: maskset.validPositions[pos] ? pos : undefined,
dopost: true
};
}
if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
var radixPos = $.inArray(opts.radixPoint, buffer);
if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {
if (opts.numericInput === true) {
return pos === radixPos;
}
return {
"caret": radixPos + 1
};
}
}
return true;
},
postValidation: function (buffer, pos, currentResult, opts) {
function buildPostMask(buffer, opts) {
//define base for formatter
var postMask = "";
postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}";
if (opts.radixPoint !== "") {
var radixSplit = buffer.join("").split(opts.radixPoint);
if (radixSplit[1]) {
postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}";
}
}
return postMask;
}
var suffix = opts.suffix.split(""),
prefix = opts.prefix.split("");
if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;
var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;
var maskedValue = buffer.slice();
if (opts.numericInput) {
caretPos = maskedValue.length - caretPos - 1;
maskedValue = maskedValue.reverse();
}
//mark caretPos
var charAtPos = maskedValue[caretPos];
if (charAtPos === opts.groupSeparator) {
caretPos += 1;
charAtPos = maskedValue[caretPos];
}
if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
if (charAtPos !== undefined) {
if (charAtPos !== opts.radixPoint &&
charAtPos !== opts.negationSymbol.front &&
(charAtPos !== opts.negationSymbol.back)
) {
maskedValue[caretPos] = "?";
if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {
prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = "?";
} else if (opts.suffix.length > 0 && caretPos >= (maskedValue.length - opts.suffix.length) - (opts.isNegative === false ? 1 : 0)) {
suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = "?";
}
}
}
//make numeric
prefix = prefix.join("");
suffix = suffix.join("");
var processValue = maskedValue.join("").replace(prefix, "");
processValue = processValue.replace(suffix, "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
//strip negation symbol
processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
//strip placeholder at the end
if (isNaN(opts.placeholder)) {
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "");
}
//strip leading zeroes
if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {
if (charAtPos === "0") {
processValue = processValue.replace(/^\?/g, "");
}
processValue = processValue.replace(/^0/g, "");
}
if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== "" && opts.numericInput !== true) {
processValue = "0" + processValue;
}
if (processValue !== "") {
processValue = processValue.split("");
//handle digits
if ((!opts.digitsOptional || (opts.enforceDigitsOnBlur && currentResult.event === "blur")) && isFinite(opts.digits)) {
var radixPosition = $.inArray(opts.radixPoint, processValue);
var rpb = $.inArray(opts.radixPoint, maskedValue);
if (radixPosition === -1) {
processValue.push(opts.radixPoint);
radixPosition = processValue.length - 1;
}
for (var i = 1; i <= opts.digits; i++) {
if ((!opts.digitsOptional || (opts.enforceDigitsOnBlur && currentResult.event === "blur")) && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {
processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
} else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {
processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];
}
}
}
if (opts.autoGroup === true && opts.groupSeparator !== "" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {
var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;
processValue = Inputmask(buildPostMask(processValue, opts), {
numericInput: true,
jitMasking: true,
definitions: {
"*": {
validator: "[0-9?]",
cardinality: 1
}
}
}).format(processValue.join(""));
if (addRadix) processValue += opts.radixPoint;
if (processValue.charAt(0) === opts.groupSeparator) {
processValue.substr(1);
}
} else processValue = processValue.join("");
}
if (opts.isNegative && currentResult.event === "blur") {
opts.isNegative = processValue !== "0"
}
processValue = prefix + processValue;
processValue += suffix;
if (opts.isNegative) {
processValue = opts.negationSymbol.front + processValue;
processValue += opts.negationSymbol.back;
}
processValue = processValue.split("");
//unmark position
if (charAtPos !== undefined) {
if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
caretPos = $.inArray("?", processValue);
if (caretPos > -1) {
processValue[caretPos] = charAtPos;
} else caretPos = currentResult.caret || 0;
} else if (charAtPos === opts.radixPoint ||
charAtPos === opts.negationSymbol.front ||
charAtPos === opts.negationSymbol.back) {
var newCaretPos = $.inArray(charAtPos, processValue);
if (newCaretPos !== -1) caretPos = newCaretPos;
// else charAtPos = undefined;
}
}
if (opts.numericInput) {
caretPos = processValue.length - caretPos - 1;
processValue = processValue.reverse();
}
var rslt = {
caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
buffer: processValue,
refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
};
return rslt.refreshFromBuffer ? rslt : currentResult;
},
onBeforeWrite: function (e, buffer, caretPos, opts) {
function parseMinMaxOptions(opts) {
if (opts.parseMinMaxOptions === undefined) {
//convert min and max options
if (opts.min !== null) {
opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.radixPoint === ",") opts.min = opts.min.replace(opts.radixPoint, ".");
opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;
if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;
}
if (opts.max !== null) {
opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.radixPoint === ",") opts.max = opts.max.replace(opts.radixPoint, ".");
opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;
if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;
}
opts.parseMinMaxOptions = "done";
}
}
if (e) {
switch (e.type) {
case "keydown":
return opts.postValidation(buffer, caretPos, {
caret: caretPos,
dopost: true
}, opts);
case "blur":
case "checkval":
var unmasked;
parseMinMaxOptions(opts);
if (opts.min !== null || opts.max !== null) {
unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
unmaskAsNumber: true
}));
if (opts.min !== null && unmasked < opts.min) {
opts.isNegative = opts.min < 0;
return opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), caretPos, { //TODO needs fix for MIN_VALUE & MAX_VALUE
caret: caretPos,
dopost: true,
placeholder: "0"
}, opts);
} else if (opts.max !== null && unmasked > opts.max) {
opts.isNegative = opts.max < 0;
return opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), caretPos, { //TODO needs fix for MIN_VALUE & MAX_VALUE
caret: caretPos,
dopost: true,
placeholder: "0"
}, opts);
}
}
return opts.postValidation(buffer, caretPos, {
caret: caretPos,
// dopost: true,
placeholder: "0",
event: "blur"
}, opts);
case "_checkval":
return {
caret: caretPos
};
default:
break;
}
}
},
regex: {
integerPart: function (opts, emptyCheck) {
return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "\+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "\+]?\\d+");
},
integerNPart: function (opts) {
return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
}
},
definitions: {
"~": {
validator: function (chrs, maskset, pos, strict, opts, isSelection) {
var isValid, l;
if (chrs === "k" || chrs === "m") {
isValid = {
insert: [],
c: 0
};
for (var i = 0, l = chrs === "k" ? 2 : 5; i < l; i++) {
isValid.insert.push({pos: pos + i, c: 0});
}
isValid.pos = pos + l;
return isValid;
}
isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
if (isValid === true) {
if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === "~" && !isSelection) {
var processValue = maskset.buffer.join("");
//strip negation symbol
processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
//filter 0 after radixpoint
var pvRadixSplit = processValue.split(opts.radixPoint);
if (pvRadixSplit.length > 1) {
pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));
}
//filter 0 before radixpoint
if (pvRadixSplit[0] === "0") {
pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));
}
processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
var bufferTemplate = maskset._buffer.join(""); //getBuffer().slice(lvp).join('');
if (processValue === opts.radixPoint) {
processValue = bufferTemplate;
}
while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$") === null) {
bufferTemplate = bufferTemplate.slice(1);
}
// if (processValue !== opts.radixPoint) {
processValue = processValue.replace(bufferTemplate, "");
// }
processValue = processValue.split("");
if (processValue[pos] === undefined) {
isValid = {
"pos": pos,
"remove": pos
};
} else {
isValid = {
pos: pos
};
}
}
} else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {
isValid = {
insert: {
pos: pos,
c: 0
},
pos: pos + 1
}
}
return isValid;
},
cardinality: 1
},
"+": {
validator: function (chrs, maskset, pos, strict, opts) {
return (opts.allowMinus && (chrs === "-" || chrs === opts.negationSymbol.front));
},
cardinality: 1,
placeholder: ""
},
"-": {
validator: function (chrs, maskset, pos, strict, opts) {
return (opts.allowMinus && chrs === opts.negationSymbol.back);
},
cardinality: 1,
placeholder: ""
},
":": {
validator: function (chrs, maskset, pos, strict, opts) {
var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
var isValid = new RegExp(radix).test(chrs);
if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {
isValid = {
"caret": pos + 1
};
}
return isValid;
},
cardinality: 1,
placeholder: function (opts) {
return opts.radixPoint;
}
}
},
onUnMask: function (maskedValue, unmaskedValue, opts) {
if (unmaskedValue === "" && opts.nullable === true) {
return unmaskedValue;
}
var processValue = maskedValue.replace(opts.prefix, "");
processValue = processValue.replace(opts.suffix, "");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
if (opts.placeholder.charAt(0) !== "") {
processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0");
}
if (opts.unmaskAsNumber) {
if (opts.radixPoint !== "" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".");
processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
return Number(processValue);
}
return processValue;
},
isComplete: function (buffer, opts) {
var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join("");
maskedValue = maskedValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
maskedValue = maskedValue.replace(opts.prefix, "");
maskedValue = maskedValue.replace(opts.suffix, "");
maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1");
if (opts.radixPoint === ",") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".");
return isFinite(maskedValue);
},
onBeforeMask: function (initialValue, opts) {
opts.isNegative = undefined;
var radixPoint = opts.radixPoint || ",";
if ((typeof initialValue == "number" || opts.inputType === "number") && radixPoint !== "") {
initialValue = initialValue.toString().replace(".", radixPoint);
}
var valueParts = initialValue.split(radixPoint),
integerPart = valueParts[0].replace(/[^\-0-9]/g, ""),
decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, "") : "";
initialValue = integerPart + (decimalPart !== "" ? radixPoint + decimalPart : decimalPart);
var digits = 0;
if (radixPoint !== "") {
digits = decimalPart.length;
if (decimalPart !== "") {
var digitsFactor = Math.pow(10, digits || 1);
if (isFinite(opts.digits)) {
digits = parseInt(opts.digits);
digitsFactor = Math.pow(10, digits);
}
//make the initialValue a valid javascript number for the parsefloat
initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), ".");
if (isFinite(initialValue))
initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;
initialValue = initialValue.toString().replace(".", radixPoint);
}
}
//this needs to be in a separate part and not directly in decimalPart to allow rounding
if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {
initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));
}
return alignDigits(initialValue.toString().split(""), digits, opts).join("");
},
onKeyDown: function (e, buffer, caretPos, opts) {
//TODO FIXME
var $input = $(this);
if (e.ctrlKey) {
switch (e.keyCode) {
case Inputmask.keyCode.UP:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
$input.trigger("setvalue");
break;
case Inputmask.keyCode.DOWN:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
$input.trigger("setvalue");
break;
}
}
}
},
"currency": {
prefix: "$ ",
groupSeparator: ",",
alias: "numeric",
placeholder: "0",
autoGroup: true,
digits: 2,
digitsOptional: false,
clearMaskOnLostFocus: false
},
"decimal": {
alias: "numeric"
},
"integer": {
alias: "numeric",
digits: 0,
radixPoint: ""
},
"percentage": {
alias: "numeric",
digits: 2,
digitsOptional: true,
radixPoint: ".",
placeholder: "0",
autoGroup: false,
min: 0,
max: 100,
suffix: " %",
allowMinus: false
}
});
return Inputmask;
}));
+92
View File
@@ -0,0 +1,92 @@
/*
* Input Mask plugin for jquery
* http://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 0.0.0-dev
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "./inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("./inputmask"));
} else {
factory(jQuery, window.Inputmask);
}
}
(function ($, Inputmask) {
if ($.fn.inputmask === undefined) {
//jquery plugin
$.fn.inputmask = function (fn, options) {
var nptmask, input = this[0];
if (options === undefined) options = {};
if (typeof fn === "string") {
switch (fn) {
case "unmaskedvalue":
return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
case "remove":
return this.each(function () {
if (this.inputmask) this.inputmask.remove();
});
case "getemptymask":
return input && input.inputmask ? input.inputmask.getemptymask() : "";
case "hasMaskedValue": //check whether the returned value is masked or not; currently only works reliable when using jquery.val fn to retrieve the value
return input && input.inputmask ? input.inputmask.hasMaskedValue() : false;
case "isComplete":
return input && input.inputmask ? input.inputmask.isComplete() : true;
case "getmetadata": //return mask metadata if exists
return input && input.inputmask ? input.inputmask.getmetadata() : undefined;
case "setvalue":
Inputmask.setValue(input, options);
break;
case "option":
if (typeof options === "string") {
if (input && input.inputmask !== undefined) {
return input.inputmask.option(options);
}
} else {
return this.each(function () {
if (this.inputmask !== undefined) {
return this.inputmask.option(options);
}
});
}
break;
default:
options.alias = fn;
nptmask = new Inputmask(options);
return this.each(function () {
nptmask.mask(this);
});
}
} else if (Array.isArray(fn)) {
options.alias = fn;
nptmask = new Inputmask(options);
return this.each(function () {
nptmask.mask(this);
});
} else if (typeof fn == "object") {
nptmask = new Inputmask(fn);
if (fn.mask === undefined && fn.alias === undefined) {
return this.each(function () {
if (this.inputmask !== undefined) {
return this.inputmask.option(fn);
} else nptmask.mask(this);
});
} else {
return this.each(function () {
nptmask.mask(this);
});
}
} else if (fn === undefined) {
//look for data-inputmask atributes
return this.each(function () {
nptmask = new Inputmask(options);
nptmask.mask(this);
});
}
};
}
return $.fn.inputmask;
}));
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>inputmask</id>
<version>0.0.0</version>
<title>Inputmask</title>
<authors>Robin Herbots</authors>
<owners>Robin Herbots</owners>
<licenseUrl>https://github.com/RobinHerbots/Inputmask/blob/4.x/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/RobinHerbots/Inputmask</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.</description>
<summary>Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.</summary>
<tags>jQuery, plugins, input, form, inputmask, mask</tags>
</metadata>
<files>
<file src="..\dist\inputmask\**\*" target="content\Scripts\inputmask" />
<file src="..\dist\min\inputmask\**\*" target="content\Scripts\inputmask\min" />
<file src="Readme.txt" target="Readme.txt" />
</files>
</package>
+18
View File
@@ -0,0 +1,18 @@
## .NET Nuget Package Install
PM> Install-Package InputMask
In App_Start, BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/inputmask").Include(
//~/Scripts/inputmask/dependencyLibs/inputmask.dependencyLib.js", //if not using jquery
"~/Scripts/inputmask/inputmask.js",
"~/Scripts/inputmask/jquery.inputmask.js",
"~/Scripts/inputmask/inputmask.extensions.js",
"~/Scripts/inputmask/inputmask.date.extensions.js",
//and other extensions you want to include
"~/Scripts/inputmask/inputmask.numeric.extensions.js"));
In Layout
@Scripts.Render("~/bundles/inputmask")
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>jQuery.InputMask</id>
<version>0.0.0</version>
<title>Inputmask</title>
<authors>Robin Herbots</authors>
<owners>Robin Herbots</owners>
<licenseUrl>https://github.com/RobinHerbots/Inputmask/blob/4.x/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/RobinHerbots/Inputmask</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.</description>
<summary>Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.</summary>
<tags>jQuery, plugins, input, form, inputmask, mask</tags>
</metadata>
<files>
<file src="..\dist\inputmask\**\*" target="content\Scripts\inputmask" />
<file src="..\dist\min\inputmask\**\*" target="content\Scripts\inputmask\min" />
<file src="Readme.txt" target="Readme.txt" />
</files>
</package>
+10349
View File
File diff suppressed because it is too large Load Diff
+69
View File
@@ -0,0 +1,69 @@
{
"name": "inputmask",
"version": "4.0.3-beta.4",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"main": "index.js",
"files": [
"dist/",
"css/",
"misc/"
],
"scripts": {
"start": "webpack --progress --watch --config webpack.config.js",
"test": "grunt validate",
"qunitpack": "webpack --progress --watch --config qunit/webpack.config.js"
},
"repository": {
"type": "git",
"url": "https://github.com/RobinHerbots/Inputmask.git"
},
"keywords": [
"form",
"input",
"inputmask",
"jquery",
"jquery-plugin",
"mask",
"plugins"
],
"author": {
"name": "Robin Herbots",
"url": "https://github.com/RobinHerbots"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/RobinHerbots/Inputmask/issues"
},
"homepage": "https://github.com/RobinHerbots/Inputmask",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-helpers": "^6.24.1",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"caniuse-db": "^1.0.30000885",
"css-loader": "^1.0.0",
"grunt": "^1.0.3",
"grunt-available-tasks": "^0.6.3",
"grunt-bump": "^0.8.0",
"grunt-cli": "^1.3.1",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-eslint": "^21.0.0",
"grunt-nuget": "^0.3.0",
"grunt-release": "^0.14.0",
"grunt-webpack": "^3.1.3",
"jqlite": "^0.2.42",
"jquery": "^3.3.1",
"load-grunt-tasks": "^4.0.0",
"loader-utils": "^1.1.0",
"postcss": "^7.0.2",
"postcss-cssnext": "^3.1.0",
"postcss-loader": "^2.1.6",
"qunit": "^2.6.2",
"source-map-loader": "^0.2.4",
"style-loader": "^0.23.0",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0",
"jsdom": "^12.0.0"
}
}
+416
View File
@@ -0,0 +1,416 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page not found</title>
<style>
html {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body {margin:0}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {display:block}
audio,
canvas,
progress,
video {display:inline-block;vertical-align:baseline}
audio:not([controls]) {display:none;height:0}
[hidden],
template {display:none}
a {background:transparent}
a:active,
a:hover {outline:0}
abbr[title] {border-bottom:1px dotted}
b,
strong {font-weight:bold}
dfn {font-style:italic}
h1 {font-size:2em;margin:0.67em 0}
mark {background:#ff0;color:#000}
small {font-size:80%}
sub,
sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup {top:-0.5em}
sub {bottom:-0.25em}
img {border:0}
svg:not(:root) {overflow:hidden}
figure {margin:1em 40px}
hr {-moz-box-sizing:content-box;box-sizing:content-box;height:0}
pre {overflow:auto}
code,
kbd,
pre,
samp {font-family:monospace,monospace;font-size:1em}
button,
input,
optgroup,
select,
textarea {color:inherit;font:inherit;margin:0}
button {overflow:visible}
button,
select {text-transform:none}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {-webkit-appearance:button;cursor:pointer}
button[disabled],
html input[disabled] {cursor:default}
button::-moz-focus-inner,
input::-moz-focus-inner {border:0;padding:0}
input {line-height:normal}
input[type="checkbox"],
input[type="radio"] {box-sizing:border-box;padding:0}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {height:auto}
input[type="search"] {-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {-webkit-appearance:none}
fieldset {border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}
legend {border:0;padding:0}
textarea {overflow:auto}
optgroup {font-weight:bold}
table {border-collapse:collapse;border-spacing:0;table-layout:auto;word-wrap:break-word;word-break:break-all}
td,
th {padding:0}
*,
*:before,
*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
html {font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.42857143;color:#333;background-color:#f9f9f9}
input,
button,
select,
textarea {font-family:inherit;font-size:inherit;line-height:inherit}
button,
input,
select[multiple],
textarea {background-image:none}
a {color:#0181b9;text-decoration:none}
a:hover,
a:focus {color:#001721;text-decoration:underline}
a:focus {outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}
img {vertical-align:middle}
.img-responsive {display:block;max-width:100%;height:auto}
.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}
.img-circle {border-radius:50%}
hr {margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}
.sr-only {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@media print {* {text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important }a,a:visited {text-decoration:underline }a[href]:after {content:" (" attr(href) ")" }abbr[title]:after {content:" (" attr(title) ")" }a[href^="javascript:"]:after,a[href^="#"]:after {content:"" }pre,blockquote {border:1px solid #999;page-break-inside:avoid }thead {display:table-header-group }tr,img {page-break-inside:avoid }img {max-width:100% !important }p,h2,h3 {orphans:3;widows:3 }h2,h3 {page-break-after:avoid }select {background:#fff !important }.navbar {display:none }.table td,.table th {background-color:#fff !important }.btn >.caret,.dropup >.btn >.caret {border-top-color:#000 !important }.label {border:1px solid #000 }.table {border-collapse:collapse !important }.table-bordered th,.table-bordered td {border:1px solid #ddd !important }}
.container {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
@media (min-width:768px) {.container {width:750px }}
@media (min-width:992px) {.container {width:970px }}
@media (min-width:1200px) {.container {width:1170px }}
.container-fluid {margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}
.row {margin-left:-15px;margin-right:-15px}
.row-flush {margin-left:0;margin-right:0}
.row-flush [class*="col-"] {padding-left:0 !important;padding-right:0 !important}
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {position:relative;min-height:1px;padding-left:15px;padding-right:15px}
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 {float:left}
.col-xs-12 {width:100%}
.col-xs-11 {width:91.66666667%}
.col-xs-10 {width:83.33333333%}
.col-xs-9 {width:75%}
.col-xs-8 {width:66.66666667%}
.col-xs-7 {width:58.33333333%}
.col-xs-6 {width:50%}
.col-xs-5 {width:41.66666667%}
.col-xs-4 {width:33.33333333%}
.col-xs-3 {width:25%}
.col-xs-2 {width:16.66666667%}
.col-xs-1 {width:8.33333333%}
.col-xs-pull-12 {right:100%}
.col-xs-pull-11 {right:91.66666667%}
.col-xs-pull-10 {right:83.33333333%}
.col-xs-pull-9 {right:75%}
.col-xs-pull-8 {right:66.66666667%}
.col-xs-pull-7 {right:58.33333333%}
.col-xs-pull-6 {right:50%}
.col-xs-pull-5 {right:41.66666667%}
.col-xs-pull-4 {right:33.33333333%}
.col-xs-pull-3 {right:25%}
.col-xs-pull-2 {right:16.66666667%}
.col-xs-pull-1 {right:8.33333333%}
.col-xs-pull-0 {right:0%}
.col-xs-push-12 {left:100%}
.col-xs-push-11 {left:91.66666667%}
.col-xs-push-10 {left:83.33333333%}
.col-xs-push-9 {left:75%}
.col-xs-push-8 {left:66.66666667%}
.col-xs-push-7 {left:58.33333333%}
.col-xs-push-6 {left:50%}
.col-xs-push-5 {left:41.66666667%}
.col-xs-push-4 {left:33.33333333%}
.col-xs-push-3 {left:25%}
.col-xs-push-2 {left:16.66666667%}
.col-xs-push-1 {left:8.33333333%}
.col-xs-push-0 {left:0%}
.col-xs-offset-12 {margin-left:100%}
.col-xs-offset-11 {margin-left:91.66666667%}
.col-xs-offset-10 {margin-left:83.33333333%}
.col-xs-offset-9 {margin-left:75%}
.col-xs-offset-8 {margin-left:66.66666667%}
.col-xs-offset-7 {margin-left:58.33333333%}
.col-xs-offset-6 {margin-left:50%}
.col-xs-offset-5 {margin-left:41.66666667%}
.col-xs-offset-4 {margin-left:33.33333333%}
.col-xs-offset-3 {margin-left:25%}
.col-xs-offset-2 {margin-left:16.66666667%}
.col-xs-offset-1 {margin-left:8.33333333%}
.col-xs-offset-0 {margin-left:0%}
@media (min-width:768px) {.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 {float:left }.col-sm-12 {width:100% }.col-sm-11 {width:91.66666667% }.col-sm-10 {width:83.33333333% }.col-sm-9 {width:75% }.col-sm-8 {width:66.66666667% }.col-sm-7 {width:58.33333333% }.col-sm-6 {width:50% }.col-sm-5 {width:41.66666667% }.col-sm-4 {width:33.33333333% }.col-sm-3 {width:25% }.col-sm-2 {width:16.66666667% }.col-sm-1 {width:8.33333333% }.col-sm-pull-12 {right:100% }.col-sm-pull-11 {right:91.66666667% }.col-sm-pull-10 {right:83.33333333% }.col-sm-pull-9 {right:75% }.col-sm-pull-8 {right:66.66666667% }.col-sm-pull-7 {right:58.33333333% }.col-sm-pull-6 {right:50% }.col-sm-pull-5 {right:41.66666667% }.col-sm-pull-4 {right:33.33333333% }.col-sm-pull-3 {right:25% }.col-sm-pull-2 {right:16.66666667% }.col-sm-pull-1 {right:8.33333333% }.col-sm-pull-0 {right:0% }.col-sm-push-12 {left:100% }.col-sm-push-11 {left:91.66666667% }.col-sm-push-10 {left:83.33333333% }.col-sm-push-9 {left:75% }.col-sm-push-8 {left:66.66666667% }.col-sm-push-7 {left:58.33333333% }.col-sm-push-6 {left:50% }.col-sm-push-5 {left:41.66666667% }.col-sm-push-4 {left:33.33333333% }.col-sm-push-3 {left:25% }.col-sm-push-2 {left:16.66666667% }.col-sm-push-1 {left:8.33333333% }.col-sm-push-0 {left:0% }.col-sm-offset-12 {margin-left:100% }.col-sm-offset-11 {margin-left:91.66666667% }.col-sm-offset-10 {margin-left:83.33333333% }.col-sm-offset-9 {margin-left:75% }.col-sm-offset-8 {margin-left:66.66666667% }.col-sm-offset-7 {margin-left:58.33333333% }.col-sm-offset-6 {margin-left:50% }.col-sm-offset-5 {margin-left:41.66666667% }.col-sm-offset-4 {margin-left:33.33333333% }.col-sm-offset-3 {margin-left:25% }.col-sm-offset-2 {margin-left:16.66666667% }.col-sm-offset-1 {margin-left:8.33333333% }.col-sm-offset-0 {margin-left:0% }}
@media (min-width:992px) {.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12 {float:left }.col-md-12 {width:100% }.col-md-11 {width:91.66666667% }.col-md-10 {width:83.33333333% }.col-md-9 {width:75% }.col-md-8 {width:66.66666667% }.col-md-7 {width:58.33333333% }.col-md-6 {width:50% }.col-md-5 {width:41.66666667% }.col-md-4 {width:33.33333333% }.col-md-3 {width:25% }.col-md-2 {width:16.66666667% }.col-md-1 {width:8.33333333% }.col-md-pull-12 {right:100% }.col-md-pull-11 {right:91.66666667% }.col-md-pull-10 {right:83.33333333% }.col-md-pull-9 {right:75% }.col-md-pull-8 {right:66.66666667% }.col-md-pull-7 {right:58.33333333% }.col-md-pull-6 {right:50% }.col-md-pull-5 {right:41.66666667% }.col-md-pull-4 {right:33.33333333% }.col-md-pull-3 {right:25% }.col-md-pull-2 {right:16.66666667% }.col-md-pull-1 {right:8.33333333% }.col-md-pull-0 {right:0% }.col-md-push-12 {left:100% }.col-md-push-11 {left:91.66666667% }.col-md-push-10 {left:83.33333333% }.col-md-push-9 {left:75% }.col-md-push-8 {left:66.66666667% }.col-md-push-7 {left:58.33333333% }.col-md-push-6 {left:50% }.col-md-push-5 {left:41.66666667% }.col-md-push-4 {left:33.33333333% }.col-md-push-3 {left:25% }.col-md-push-2 {left:16.66666667% }.col-md-push-1 {left:8.33333333% }.col-md-push-0 {left:0% }.col-md-offset-12 {margin-left:100% }.col-md-offset-11 {margin-left:91.66666667% }.col-md-offset-10 {margin-left:83.33333333% }.col-md-offset-9 {margin-left:75% }.col-md-offset-8 {margin-left:66.66666667% }.col-md-offset-7 {margin-left:58.33333333% }.col-md-offset-6 {margin-left:50% }.col-md-offset-5 {margin-left:41.66666667% }.col-md-offset-4 {margin-left:33.33333333% }.col-md-offset-3 {margin-left:25% }.col-md-offset-2 {margin-left:16.66666667% }.col-md-offset-1 {margin-left:8.33333333% }.col-md-offset-0 {margin-left:0% }}
@media (min-width:1200px) {.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {float:left }.col-lg-12 {width:100% }.col-lg-11 {width:91.66666667% }.col-lg-10 {width:83.33333333% }.col-lg-9 {width:75% }.col-lg-8 {width:66.66666667% }.col-lg-7 {width:58.33333333% }.col-lg-6 {width:50% }.col-lg-5 {width:41.66666667% }.col-lg-4 {width:33.33333333% }.col-lg-3 {width:25% }.col-lg-2 {width:16.66666667% }.col-lg-1 {width:8.33333333% }.col-lg-pull-12 {right:100% }.col-lg-pull-11 {right:91.66666667% }.col-lg-pull-10 {right:83.33333333% }.col-lg-pull-9 {right:75% }.col-lg-pull-8 {right:66.66666667% }.col-lg-pull-7 {right:58.33333333% }.col-lg-pull-6 {right:50% }.col-lg-pull-5 {right:41.66666667% }.col-lg-pull-4 {right:33.33333333% }.col-lg-pull-3 {right:25% }.col-lg-pull-2 {right:16.66666667% }.col-lg-pull-1 {right:8.33333333% }.col-lg-pull-0 {right:0% }.col-lg-push-12 {left:100% }.col-lg-push-11 {left:91.66666667% }.col-lg-push-10 {left:83.33333333% }.col-lg-push-9 {left:75% }.col-lg-push-8 {left:66.66666667% }.col-lg-push-7 {left:58.33333333% }.col-lg-push-6 {left:50% }.col-lg-push-5 {left:41.66666667% }.col-lg-push-4 {left:33.33333333% }.col-lg-push-3 {left:25% }.col-lg-push-2 {left:16.66666667% }.col-lg-push-1 {left:8.33333333% }.col-lg-push-0 {left:0% }.col-lg-offset-12 {margin-left:100% }.col-lg-offset-11 {margin-left:91.66666667% }.col-lg-offset-10 {margin-left:83.33333333% }.col-lg-offset-9 {margin-left:75% }.col-lg-offset-8 {margin-left:66.66666667% }.col-lg-offset-7 {margin-left:58.33333333% }.col-lg-offset-6 {margin-left:50% }.col-lg-offset-5 {margin-left:41.66666667% }.col-lg-offset-4 {margin-left:33.33333333% }.col-lg-offset-3 {margin-left:25% }.col-lg-offset-2 {margin-left:16.66666667% }.col-lg-offset-1 {margin-left:8.33333333% }.col-lg-offset-0 {margin-left:0% }}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {content:" ";display:table}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {clear:both}
.center-block {display:block;margin-left:auto;margin-right:auto}
.pull-right {float:right !important}
.pull-left {float:left !important}
.hide {display:none !important}
.show {display:block !important}
.invisible {visibility:hidden}
.text-hide {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}
.hidden {display:none !important;visibility:hidden !important}
.affix {position:fixed}
@-ms-viewport {width:device-width}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {display:none !important}
@media (max-width:767px) {.visible-xs {display:block !important }table.visible-xs {display:table }tr.visible-xs {display:table-row !important }th.visible-xs,td.visible-xs {display:table-cell !important }}
@media (min-width:768px) and (max-width:991px) {.visible-sm {display:block !important }table.visible-sm {display:table }tr.visible-sm {display:table-row !important }th.visible-sm,td.visible-sm {display:table-cell !important }}
@media (min-width:992px) and (max-width:1199px) {.visible-md {display:block !important }table.visible-md {display:table }tr.visible-md {display:table-row !important }th.visible-md,td.visible-md {display:table-cell !important }}
@media (min-width:1200px) {.visible-lg {display:block !important }table.visible-lg {display:table }tr.visible-lg {display:table-row !important }th.visible-lg,td.visible-lg {display:table-cell !important }}
@media (max-width:767px) {.hidden-xs {display:none !important }}
@media (min-width:768px) and (max-width:991px) {.hidden-sm {display:none !important }}
@media (min-width:992px) and (max-width:1199px) {.hidden-md {display:none !important }}
@media (min-width:1200px) {.hidden-lg {display:none !important }}
.visible-print {display:none !important}
@media print {.visible-print {display:block !important }table.visible-print {display:table }tr.visible-print {display:table-row !important }th.visible-print,td.visible-print {display:table-cell !important }}
@media print {.hidden-print {display:none !important }}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {font-family:inherit;font-weight:400;line-height:1.1;color:inherit}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {font-weight:normal;line-height:1;color:#999}
h1,
.h1,
h2,
.h2,
h3,
.h3 {margin-top:20px;margin-bottom:10px}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {font-size:65%}
h4,
.h4,
h5,
.h5,
h6,
.h6 {margin-top:10px;margin-bottom:10px}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {font-size:75%}
h1,
.h1 {font-size:36px}
h2,
.h2 {font-size:30px}
h3,
.h3 {font-size:24px}
h4,
.h4 {font-size:18px}
h5,
.h5 {font-size:14px}
h6,
.h6 {font-size:12px}
p {margin:0 0 10px}
.lead {margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}
@media (min-width:768px) {.lead {font-size:21px }}
small,
.small {font-size:85%}
cite {font-style:normal}
.text-left {text-align:left}
.text-right {text-align:right}
.text-center {text-align:center}
.text-justify {text-align:justify}
.text-muted {color:#999}
.text-primary {color:#34495e}
a.text-primary:hover {color:#222f3d}
.text-success {color:#3c763d}
a.text-success:hover {color:#2b542c}
.text-info {color:#31708f}
a.text-info:hover {color:#245269}
.text-warning {color:#8a6d3b}
a.text-warning:hover {color:#66512c}
.text-danger {color:#a94442}
a.text-danger:hover {color:#843534}
.bg-primary {color:#fff;background-color:#34495e}
a.bg-primary:hover {background-color:#222f3d}
.bg-success {background-color:#dff0d8}
a.bg-success:hover {background-color:#c1e2b3}
.bg-info {background-color:#d9edf7}
a.bg-info:hover {background-color:#afd9ee}
.bg-warning {background-color:#fcf8e3}
a.bg-warning:hover {background-color:#f7ecb5}
.bg-danger {background-color:#f2dede}
a.bg-danger:hover {background-color:#e4b9b9}
.page-header {padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}
ul,
ol {margin-top:0;margin-bottom:10px}
ul ul,
ol ul,
ul ol,
ol ol {margin-bottom:0}
.list-unstyled {padding-left:0;list-style:none}
.list-inline {padding-left:0;list-style:none;margin-left:-5px}
.list-inline >li {display:inline-block;padding-left:5px;padding-right:5px}
dl {margin-top:0;margin-bottom:20px}
dt,
dd {line-height:1.42857143}
dt {font-weight:bold}
dd {margin-left:0}
@media (min-width:768px) {.dl-horizontal dt {float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap }.dl-horizontal dd {margin-left:180px }}
abbr[title],
abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}
.initialism {font-size:90%;text-transform:uppercase}
blockquote {padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {margin-bottom:0}
blockquote footer,
blockquote small,
blockquote .small {display:block;font-size:80%;line-height:1.42857143;color:#999}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {content:'\2014 \00A0'}
.blockquote-reverse,
blockquote.pull-right {padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {content:''}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {content:'\00A0 \2014'}
blockquote:before,
blockquote:after {content:""}
address {margin-bottom:20px;font-style:normal;line-height:1.42857143}
.oc-icon-chain:before,
.icon-chain:before,
.oc-icon-chain-broken:before,
.icon-chain-broken:before {content:"\f127"}
.close {float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;font-family:sans-serif;opacity:0.2;filter:alpha(opacity=20)}
.close:hover,
.close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}
button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}
@font-face {font-family:'FontAwesome';src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=1.0.1');src:url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=1.0.1') format('embedded-opentype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=1.0.1') format('woff'),url('../ui/font/fontawesome-webfont.ttf?v=1.0.1') format('truetype'),url('../library/font-awesome-4.7.0/fonts/fontawesome-webfont.svg#fontawesomeregular?v=1.0.1') format('svg');font-weight:normal;font-style:normal}
[class^="icon-"],
[class*=" icon-"] {font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}
[class^="icon-"]:before,
[class*=" icon-"]:before {text-decoration:inherit;display:inline-block;speak:none}
[class^="icon-"].pull-left,
[class*=" icon-"].pull-left {margin-right:.3em}
[class^="icon-"].pull-right,
[class*=" icon-"].pull-right {margin-left:.3em}
[class^="oc-icon-"]:before,
[class*=" oc-icon-"]:before {display:inline-block;margin-right:8px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;vertical-align:baseline}
[class^="oc-icon-"].empty:before,
[class*=" oc-icon-"].empty:before {margin-right:0}
.icon-lg {font-size:1.33333333em;line-height:0.75em;vertical-align:-15%}
.icon-2x {font-size:2em}
.icon-3x {font-size:3em}
.icon-4x {font-size:4em}
.icon-5x {font-size:5em}
body {padding-top:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f3f3f3;color:#405261}
h1,
h2,
h3,
h4,
h5 {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-transform:uppercase}
h1 {font-weight:300;font-size:50px;margin-bottom:15px}
h1 i[class^="icon-"]:before {font-size:46px}
i[class^="icon-"].warning {color:#c84530}
h3 {font-size:24px;font-weight:300}
p.lead {font-size:16px;font-weight:300}
</style>
</head>
<body>
<div class="container">
<h1><i class="icon-chain-broken warning"></i> Page not found</h1>
<p class="lead">The requested page cannot be found.</p>
</div>
</body>
</html>
+86
View File
@@ -0,0 +1,86 @@
import "../node_modules/qunit/qunit/qunit.css";
import "../css/inputmask.css";
//extensions
import "../js/inputmask.date.extensions";
import "../js/inputmask.extensions";
import "../js/inputmask.numeric.extensions";
import "../js/jquery.inputmask";
import Inputmask from "../js/inputmask";
// import "../dist/inputmask/inputmask.date.extensions";
// import "../dist/inputmask/inputmask.extensions";
// import "../dist/inputmask/inputmask.numeric.extensions";
// import "../dist/inputmask/jquery.inputmask";
//
// import Inputmask from "../dist/inputmask/inputmask";
import jQuery from "jquery";
if (Inputmask.dependencyLib === jQuery)
window.jQuery = Inputmask.dependencyLib;
import qunit from "qunit";
import "./prototypeExtensions.js";
import simulator from "./simulator.js";
// android testing
Inputmask.extendDefaults({
inputEventOnly: false
});
window.Inputmask = Inputmask; //inject globally for the simulator to detect inputeventonly
import tests_alternations from "./tests_alternations";
import tests_attributes from "./tests_attributes";
import tests_base from "./tests_base";
import tests_date from "./tests_date";
import tests_dynamic from "./tests_dynamic";
import tests_escape from "./tests_escape";
import tests_formatvalidate from "./tests_formatvalidate";
import tests_initialvalue from "./tests_initialvalue";
import tests_inputeventonly from "./tests_inputeventonly";
import tests_ip from "./tests_ip";
import tests_jitmasking from "./tests_jitmasking";
import tests_jquery_inputmask from "./tests_jquery_inputmask";
import tests_keepStatic from "./tests_keepStatic";
import tests_multi from "./tests_multi";
import tests_numeric from "./tests_numeric";
import tests_numericinput from "./tests_numericinput";
import tests_option from "./tests_option";
import tests_optional from "./tests_optional";
import tests_paste from "./tests_paste";
import tests_regex from "./tests_regex";
import tests_setvalue from "./tests_setvalue";
//inject simulater code in the dependencies
simulator(Inputmask.dependencyLib, Inputmask);
simulator(jQuery, Inputmask);
//load tests
tests_alternations(qunit, Inputmask);
tests_attributes(qunit, Inputmask);
tests_base(qunit, Inputmask);
tests_date(qunit, Inputmask);
tests_dynamic(qunit, Inputmask);
tests_escape(qunit, Inputmask);
tests_formatvalidate(qunit, Inputmask);
tests_initialvalue(qunit, Inputmask);
tests_inputeventonly(qunit, Inputmask);
tests_ip(qunit, Inputmask);
tests_jitmasking(qunit, Inputmask);
tests_jquery_inputmask(qunit, jQuery, Inputmask);
tests_keepStatic(qunit, Inputmask);
tests_multi(qunit, Inputmask);
tests_numeric(qunit, Inputmask);
tests_numericinput(qunit, Inputmask);
tests_option(qunit, Inputmask);
tests_optional(qunit, Inputmask);
tests_paste(qunit, Inputmask);
tests_regex(qunit, Inputmask);
tests_setvalue(qunit, Inputmask);
qunit.load();
// qunit.start();
+13
View File
@@ -0,0 +1,13 @@
/*
These are dummy prototype extensions to test that the inputmask code can deal with an extension
*/
Array.prototype.dummy = function(){
return false;
}
String.prototype.dummy = function(){
return false;
}
+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inputmask - QUnit</title>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>²
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<script src="qunit.js" charset="utf-8"></script>
</body>
</html>
+223
View File
@@ -0,0 +1,223 @@
export default function ($, Inputmask) {
$.caret = function (input, begin, end) {
input = input.nodeName ? input : input[0];
input.focus();
var range;
if (typeof begin === "number") {
end = (typeof end == "number") ? end : begin;
// if (!$(input).is(":visible")) {
// return;
// }
if (input.setSelectionRange) {
input.selectionStart = begin;
input.selectionEnd = end;
} else if (window.getSelection) {
range = document.createRange();
if (input.firstChild === undefined) {
var textNode = document.createTextNode("");
input.appendChild(textNode);
}
range.setStart(input.firstChild, begin < input.value.length ? begin : input.value.length);
range.setEnd(input.firstChild, end < input.value.length ? end : input.value.length);
range.collapse(true);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
//input.focus();
} else if (input.createTextRange) {
range = input.createTextRange();
range.collapse(true);
range.moveEnd("character", end);
range.moveStart("character", begin);
range.select();
}
} else {
if (input.setSelectionRange) {
begin = input.selectionStart;
end = input.selectionEnd;
} else if (window.getSelection) {
range = window.getSelection().getRangeAt(0);
if (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) {
begin = range.startOffset;
end = range.endOffset;
}
} else if (document.selection && document.selection.createRange) {
range = document.selection.createRange();
begin = 0 - range.duplicate().moveStart("character", -100000);
end = begin + range.text.length;
}
/*eslint-disable consistent-return */
return {
"begin": begin,
"end": end
};
/*eslint-enable consistent-return */
}
};
$.fn = $.fn || $.prototype;
$.fn.SendKey = function (keyCode, modifier) {
var elem = this.nodeName ? this : this[0], origCode = keyCode;
elem.type = "text"; //force textinput to support caret fn
function trigger(elem, evnt) {
elem.focus();
if ($ === window.jQuery) {
$(elem).trigger(evnt);
} else {
if (document.createEvent) {
elem.dispatchEvent(evnt);
} else {
elem.fireEvent("on" + evnt.eventType, evnt);
}
}
}
var sendDummyKeydown = false;
if (Object.prototype.toString.call(keyCode) == '[object String]') {
keyCode = keyCode.charCodeAt(0);
sendDummyKeydown = true;
}
switch (keyCode) {
case Inputmask.keyCode.LEFT:
if (modifier == undefined) {
var pos = $.caret(this);
$.caret(this, pos.begin - 1);
break;
}
case Inputmask.keyCode.RIGHT:
if (modifier == undefined) {
var pos = $.caret(this);
$.caret(this, pos.begin + 1);
break;
}
default:
if ((window.Inputmask && window.Inputmask.prototype.defaults.inputEventOnly === true) ||
(elem.inputmask && elem.inputmask.opts.inputEventOnly === true)) {
var input = new $.Event("input"),
currentValue = (elem.inputmask && elem.inputmask.__valueGet) ? elem.inputmask.__valueGet.call(elem) : elem.value,
caretPos = $.caret(elem), caretOffset = 0;
// console.log("initial " + currentValue);
// console.log(caretPos);
var front = currentValue.substring(0, caretPos.begin),
back = currentValue.substring(caretPos.end),
newValue = currentValue;
switch (keyCode) {
case Inputmask.keyCode.BACKSPACE:
if (caretPos.begin === caretPos.end)
front = front.substr(0, front.length - 1)
newValue = front + back;
break;
case Inputmask.keyCode.DELETE:
if (origCode !== ".") {
if (caretPos.begin === caretPos.end)
back = back.slice(1);
newValue = front + back;
break;
}
default:
newValue = front + String.fromCharCode(keyCode) + back;
caretOffset = front.length > 0 ? 1 : 0;
break;
}
if (elem.inputmask && elem.inputmask.__valueSet)
elem.inputmask.__valueSet.call(elem, newValue);
else elem.value = newValue;
$.caret(elem, (newValue.length - back.length));
trigger(elem, input);
} else {
var keydown = new $.Event("keydown"),
keypress = new $.Event("keypress"),
keyup = new $.Event("keyup");
if (!sendDummyKeydown) {
keydown.keyCode = keyCode;
if (modifier == Inputmask.keyCode.CONTROL)
keydown.ctrlKey = true;
}
trigger(elem, keydown);
if (!keydown.defaultPrevented) {
keypress.keyCode = keyCode;
if (modifier == Inputmask.keyCode.CONTROL)
keypress.ctrlKey = true;
trigger(elem, keypress);
//if (!keypress.isDefaultPrevented()) {
keyup.keyCode = keyCode;
if (modifier == Inputmask.keyCode.CONTROL)
keyup.ctrlKey = true;
trigger(elem, keyup);
//}
}
}
}
}
if (!('append' in $.fn)) {
$.fn.append = function (child) {
var input = this.nodeName ? this : this[0];
input.insertAdjacentHTML('beforeend', child);
};
}
if (!('remove' in $.fn)) {
$.fn.remove = function () {
var input = this.nodeName ? this : this[0];
if (input !== undefined && input !== null) {
input.parentElement.removeChild(input);
input = undefined;
}
};
}
if (!('val' in $.fn)) {
$.fn.val = function (value) {
var input = this.nodeName ? this : this[0];
if (value !== undefined) {
if (input.inputmask) {
input.inputmask._valueSet(value, true);
$(input).trigger("setvalue");
} else input.value = value;
}
return input.value;
};
}
$.fn.Type = function (inputStr) {
var input = this.nodeName ? this : this[0],
$input = $(input);
$.each(inputStr.split(''), function (ndx, lmnt) {
$input.SendKey(lmnt);
});
}
$.fn.paste = function (inputStr) {
var input = this.nodeName ? this : this[0],
$input = $(input);
if (window.clipboardData) {
window.clipboardData.setData('Text', inputStr);
} else {
$.data($input, "clipboard", inputStr);
window.clipboardData = {
getData: function () {
window.clipboardData = undefined;
return $.data($input, "clipboard");
}
}
}
$input.trigger('paste');
}
$.fn.input = function (inputStr, caretBegin, caretEnd) {
var input = this.nodeName ? this : this[0];
input.inputmask.__valueSet.call(input, inputStr);
if (caretBegin !== undefined)
$.caret(input, caretBegin, caretEnd);
$(input).trigger("input");
}
};
@@ -0,0 +1,398 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Alternations");
qunit.test("\"9{1,2}C|S A{1,3} 9{4}\" - ankitajain32", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9{1,2}C|S A{1,3} 9{4}").mask(testmask);
$("#testmask").Type("12Cabc1234");
assert.equal(testmask.inputmask._valueGet(), "12C ABC 1234", "Result " + testmask.inputmask._valueGet());
});
qunit.test("\"9{1,2}C|S A{1,3} 9{4}\" replace C with S - ankitajain32", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9{1,2}C|S A{1,3} 9{4}").mask(testmask);
$("#testmask").Type("12Cabc1234");
$.caret(testmask, 2, 3);
$("#testmask").Type("S");
assert.equal(testmask.inputmask._valueGet(), "12S ABC 1234", "Result " + testmask.inputmask._valueGet());
});
qunit.test("nested alternations 1", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("0<2)##-##-##>|<3<4)#-##-##>|<5)#-##-##>|<6)#-##-##>>", {
groupmarker: ["<", ">"]
}).mask(testmask);
$("#testmask").Type("02121212");
assert.equal(testmask.inputmask._valueGet(), "02)12-12-12", "Result " + testmask.inputmask._valueGet());
});
qunit.test("nested alternations 2", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("0<2)##-##-##>|<3<4)#-##-##>|<5)#-##-##>|<6)#-##-##>>", {
groupmarker: ["<", ">"]
}).mask(testmask);
$("#testmask").Type("03411212");
assert.equal(testmask.inputmask._valueGet(), "034)1-12-12", "Result " + testmask.inputmask._valueGet());
});
qunit.test("nested alternations 3", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("0<2)##-##-##>|<3<4)#-##-##>|<5)#-##-##>|<6)#-##-##>>", {
groupmarker: ["<", ">"]
}).mask(testmask);
$("#testmask").Type("03511212");
assert.equal(testmask.inputmask._valueGet(), "035)1-12-12", "Result " + testmask.inputmask._valueGet());
});
qunit.test("nested alternations 4", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("0<2)##-##-##>|<3<4)#-##-##>|<5)#-##-##>|<6)#-##-##>>", {
groupmarker: ["<", ">"]
}).mask(testmask);
$("#testmask").Type("03611212");
assert.equal(testmask.inputmask._valueGet(), "036)1-12-12", "Result " + testmask.inputmask._valueGet());
});
qunit.test("alternations W|XY|Z", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("W|XY|Z").mask(testmask);
$("#testmask").Type("WZ");
assert.equal(testmask.inputmask._valueGet(), "WZ", "Result " + testmask.inputmask._valueGet());
});
qunit.test("alternations (W)|(X)(Y)|(Z)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(W)|(X)(Y)|(Z)").mask(testmask);
$("#testmask").Type("WZ");
assert.equal(testmask.inputmask._valueGet(), "WZ", "Result " + testmask.inputmask._valueGet());
});
qunit.test("alternations (9{1,3}|SE|NE|SW|NW)-9{1,3} - yesman85", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9{1,3}|SE|NE|SW|NW)-9{1,3}").mask(testmask);
$("#testmask").Type("(NE123");
assert.equal(testmask.inputmask._valueGet(), "NE-123", "Result " + testmask.inputmask._valueGet());
});
qunit.test("((S))", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("((S))").mask(testmask);
testmask.focus();
assert.equal(testmask.inputmask._valueGet(), "((S))", "Result " + testmask.inputmask._valueGet());
});
qunit.test("((S)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("((S)").mask(testmask);
testmask.focus();
assert.equal(testmask.inputmask._valueGet(), "((S)", "Result " + testmask.inputmask._valueGet());
});
qunit.test("+371-99-999-999 - artemkaint", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask([
"+371-99-999-999",
"+370(999)99-999",
"+375(99)999-99-99",
"+374-99-999-999",
"+380(99)999-99-99",
"+358(999)999-99-99",
"+373-9999-9999",
"+381-99-999-9999"
]).mask(testmask);
testmask.focus();
$("#testmask").Type("112123123");
assert.equal(testmask.inputmask._valueGet(), "+371-12-123-123", "Result " + testmask.inputmask._valueGet());
});
qunit.test("+371-99-999-999 - artemkaint", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask([
"+371-99-999-999",
"+370(999)99-999",
"+375(99)999-99-99",
"+374-99-999-999",
"+380(99)999-99-99",
"+358(999)999-99-99",
"+373-9999-9999",
"+381-99-999-9999"
]).mask(testmask);
testmask.focus();
$("#testmask").Type("412123123");
assert.equal(testmask.inputmask._valueGet(), "+374-12-123-123", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(a9) - type 1 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(a9)").mask(testmask);
testmask.focus();
$("#testmask").Type("12");
assert.equal(testmask.inputmask._valueGet(), "1", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(a9) - type a1 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(a9)").mask(testmask);
testmask.focus();
$("#testmask").Type("a1");
assert.equal(testmask.inputmask._valueGet(), "a1", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(999)|(0aa) - type 0ab - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999)|(0aa)").mask(testmask);
testmask.focus();
$("#testmask").Type("0ab");
assert.equal(testmask.inputmask._valueGet(), "0ab", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(999)|(0aa) - type 1ab - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999)|(0aa)").mask(testmask);
testmask.focus();
$("#testmask").Type("1ab");
assert.equal(testmask.inputmask._valueGet(), "1__", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(09)|(19)|(2f) - type 41 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(09)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("41");
assert.equal(testmask.inputmask._valueGet(), "4", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(09)|(19)|(2f) - type 01 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(09)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("01");
assert.equal(testmask.inputmask._valueGet(), "01", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(09)|(19)|(2f) - type 11 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(09)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("11");
assert.equal(testmask.inputmask._valueGet(), "11", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9)|(09)|(19)|(2f) - type 23 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9)|(09)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.inputmask._valueGet(), "23", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9|09|19|2f) - type 24 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9|09|19|2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("24");
assert.equal(testmask.inputmask._valueGet(), "2", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(1|2|3)/(4|5)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(1|2|3)/(4|5)").mask(testmask);
testmask.focus();
$("#testmask").Type("34");
assert.equal(testmask.inputmask._valueGet(), "3/4", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(99)|(*a)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99)|(*a)").mask(testmask);
testmask.focus();
$("#testmask").Type("12");
assert.equal(testmask.inputmask._valueGet(), "12", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(99)|(*a)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99)|(*a)").mask(testmask);
testmask.focus();
$("#testmask").Type("1a");
assert.equal(testmask.inputmask._valueGet(), "1a", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(99)|(*a)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99)|(*a)").mask(testmask);
testmask.focus();
$("#testmask").Type("ab");
assert.equal(testmask.inputmask._valueGet(), "ab", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(99)|(*a)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99)|(*a)").mask(testmask);
testmask.focus();
$("#testmask").Type("a2");
assert.equal(testmask.inputmask._valueGet(), "a_", "Result " + testmask.inputmask._valueGet());
});
qunit.test("regex: \"([0-9]{2})|([a-z0-9][a-z])\"", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({ regex: "([0-9]{2})|([a-z0-9][a-z])"}).mask(testmask);
testmask.focus();
$("#testmask").Type("a2");
assert.equal(testmask.inputmask._valueGet(), "a_", "Result " + testmask.inputmask._valueGet());
});
qunit.test("9|(9a)", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9|(9a)").mask(testmask);
testmask.focus();
$("#testmask").Type("1");
assert.equal(testmask.inputmask._valueGet(), "1", "Result " + testmask.inputmask._valueGet());
});
qunit.test("([0]9)|(19)|(2f) - type 26 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("([0]9)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("26");
assert.equal(testmask.inputmask._valueGet(), "2", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(0{0,1}9)|(19)|(2f) - type 26 - ivaninDarpatov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(0{0,1}9)|(19)|(2f)", {
definitions: {
"f": {validator: "[0-3]"}
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("26");
assert.equal(testmask.inputmask._valueGet(), "2", "Result " + testmask.inputmask._valueGet());
});
};
@@ -0,0 +1,24 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Attribute options");
qunit.test("data-inputmask=\"'alias':'integer', 'integerDigits': 3, 'allowMinus': false, 'allowPlus': false\" - StennikovDmitriy", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" data-inputmask="\'alias\':\'integer\', \'integerDigits\': 3, \'allowMinus\': false, \'allowPlus\': false" />');
var testmask = document.getElementById("testmask");
Inputmask().mask(testmask);
$("#testmask").Type("1234.56");
assert.equal(testmask.value, "123", "Result " + testmask.value);
});
qunit.test("data-inputmask=\"'mask':'[9-]AAA-999'\" - airomero", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" data-inputmask="\'mask\':\'[9-]AAA-999\'" />');
var testmask = document.getElementById("testmask");
Inputmask().mask(testmask);
$("#testmask").Type("abc123");
assert.equal(testmask.value, "ABC-123", "Result " + testmask.value);
});
};
+539
View File
@@ -0,0 +1,539 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Simple masking");
qunit.test("inputmask(\"99-99-99\", { clearMaskOnLostFocus: false}", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99-99-99",
clearMaskOnLostFocus: false
}).mask(testmask);
assert.equal(testmask.inputmask._valueGet(), "__-__-__", "Result " + testmask.inputmask._valueGet());
});
qunit.test("inputmask(\"99-99-99\", { clearMaskOnLostFocus: true}", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99-99-99",
clearMaskOnLostFocus: false
}).mask(testmask);
testmask.blur();
setTimeout(function () {
assert.equal(testmask.value, "", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999.999.999\")", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.value, "123.___.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\") + backspace", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "12_.___.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\", { oncomplete: ... })", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999", {
oncomplete: function () {
assert.equal(testmask.value, "123.456.789", "Result " + testmask.value);
testmask.inputmask.remove();
done();
}
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456789");
});
// qunit.test("inputmask(\"9-AAA.999\") - change event", function (assert) {
// var done = assert.async(),
// $fixture = $("#qunit-fixture");
// $fixture.append('<input type="text" id="testmask" />');
// var testmask = document.getElementById("testmask");
//
// $("#testmask").on("change", function () {
// assert.ok(true, "Change triggered");
// done();
// });
//
// Inputmask("9-AAA.999").mask(testmask);
//
// testmask.focus();
// setTimeout(function () {
// $("#testmask").Type("1abc12");
// testmask.blur();
// }, 0);
// });
qunit.test("inputmask(\"9-AAA.999\", { onincomplete: ... })", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9-AAA.999", {
onincomplete: function () {
assert.equal(testmask.value, "1-ABC.12_", "Result " + testmask.value);
testmask.inputmask.remove();
done();
}
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("1abc12");
testmask.blur();
}, 0);
});
qunit.test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123");
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").Type("4");
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").Type("56");
assert.equal(testmask.value, "143.56_.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\") - delete 2nd with delete, continue the mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123");
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").Type("4");
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").Type("56");
assert.equal(testmask.value, "143.56_.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\") - delete selection start with nomask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123456789");
$.caret(testmask, 3, 7);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "123.789.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\") - backspace selection start with nomask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123456789");
$.caret(testmask, 3, 7);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "123.789.___", "Result " + testmask.value);
});
qunit.test("inputmask(\"999.999.999\") - overtype selection start with nomask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
$("#testmask").Type("123456789");
$.caret(testmask, 3, 7);
$("#testmask").Type("1");
assert.equal(testmask.value, "123.178.9__", "Result " + testmask.value);
});
qunit.test("inputmask(\"*****\")", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("*****").mask(testmask);
testmask.focus();
$("#testmask").Type("abe");
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").Type("cd");
assert.equal(testmask.value, "abcde", "Result " + testmask.value);
});
qunit.test("inputmask(\"(999)999-9999\") - ruslanfedoseenko mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999)999-9999").mask(testmask);
testmask.focus();
testmask.value = "9999999999";
$.caret(testmask, 4);
$("#testmask").Type("7");
assert.equal(testmask.value, "(999)999-9999", "Result " + testmask.value);
});
qunit.test("inputmask(\"(999)999-9999\") - insert false - ruslanfedoseenko mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999)999-9999", {
insertMode: false
}).mask(testmask);
testmask.focus();
testmask.value = "9999999999";
$.caret(testmask, 4);
$("#testmask").Type("7");
assert.equal(testmask.value, "(999)999-9999", "Result " + testmask.value);
});
qunit.test("inputmask(\"\") - empty mask - andywolk", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("").mask(testmask);
testmask.focus();
$("#testmask").val("123");
assert.equal(testmask.value, "123", "Result " + testmask.value);
});
qunit.test("Delete selection with non-masks", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999)999-9999").mask(testmask);
testmask.focus();
$("#testmask").Type("9999999999");
$.caret(testmask, 8, 11);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "(999)999-99__", "Result " + testmask.value);
});
qunit.test("Selection and backspace also deletes previous - kenaku", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("999 99 99 999").mask(testmask);
testmask.focus();
$("#testmask").Type("1234567890");
$.caret(testmask, 2, 3);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "124 56 78 90_", "Result " + testmask.value);
});
qunit.module("Non-greedy masks");
qunit.test("inputmask(\"*\", { greedy: false, repeat: \"*\" }) - replace cd with 1", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("*", {
greedy: false,
repeat: "*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdef");
$.caret(testmask, 2, 4);
$("#testmask").SendKey("1");
assert.equal(testmask.value, "ab1ef", "Result " + testmask.value);
});
qunit.test("inputmask(\"*\", { greedy: false, repeat: \"*\" }) - type abcdef", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("*", {
greedy: false,
repeat: "*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdef");
assert.equal(testmask.value, "abcdef", "Result " + testmask.value);
});
qunit.test("inputmask(\"A.\", { repeat: \"*\" }) - type abc - joostburg", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("A.", {
repeat: "*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abc");
assert.equal(testmask.value, "A.B.C.", "Result " + testmask.value);
});
qunit.test("{ mask: \"A\", placeholder: \"\", repeat: 16 }) - type testtest - glosswordteam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "A",
placeholder: "",
repeat: 16
}).mask(testmask);
testmask.focus();
$("#testmask").Type("testtest");
assert.equal(testmask.value, "TESTTEST", "Result " + testmask.value);
});
qunit.test("{ mask: \"A\", repeat: 16, greedy: false }) - type testtest - glosswordteam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "A",
repeat: 16,
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("testtest");
assert.equal(testmask.value, "TESTTEST", "Result " + testmask.value);
});
qunit.module("greedy masks");
qunit.test("inputmask(\"*\", { greedy: true, repeat: 10, clearMaskOnLostFocus: false })", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("*", {
greedy: true,
repeat: 10,
clearMaskOnLostFocus: false
}).mask(testmask);
testmask.focus();
assert.equal($("#testmask")[0].inputmask._valueGet(), "__________", "Result " + $("#testmask")[0].inputmask._valueGet());
});
qunit.test("inputmask(\"*\", { greedy: true, repeat: 10 }) - type 12345678901234567890", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("*", {
greedy: true,
repeat: 10
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345678901234567890");
assert.equal(testmask.value, "1234567890", "Result " + testmask.value);
});
qunit.test("inputmask(\"9,99\", { greedy: true, repeat: 5 }) - type 12345678901234567890", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9,99", {
greedy: true,
repeat: 5
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345678901234567890");
assert.equal(testmask.value, "1,234,567,890,123,45", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"9\", repeat: 10, placeholder: \"\", numericInput: true }) - greedy true with empty placeholder - type 12345", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "9",
repeat: 10,
placeholder: "",
numericInput: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345");
assert.equal(testmask.value, "12345", "Result " + testmask.value);
});
qunit.test("creditcard switch - pchelailya", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9999 9999 9999 9999").mask(testmask);
$("#testmask").on("keyup input", function (event) {
var value = this.inputmask.unmaskedvalue();
if (value != null && value.length === 2 && value === "37") {
Inputmask("9999 999999 99999").mask(this);
}
});
testmask.focus();
$("#testmask").Type("37");
setTimeout(function () {
$("#testmask").Type("12");
assert.equal(testmask.value, "3712 ______ _____", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("maskscache - same mask diff definitions - StonesEditeurs", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "Z{1,*}",
definitions: {
'Z': {
validator: function (chrs, buffer, pos, strict, opts) {
return {
pos: pos,
c: 'A'
};
},
}
}
}).mask(testmask);
Inputmask({
mask: "Z{1,*}", // <= Same mask
definitions: {
'Z': {
validator: function (chrs, buffer, pos, strict, opts) {
return {
pos: pos,
c: 'B'
}; // <= another definition
},
}
}
}).mask(testmask);
$("#testmask").Type("abcdef");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "BBBBBB", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("autoUnmask not work in newest release #1109 - danilG", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "+7 999 999-99-99",
autoUnmask: true
}).mask(testmask);
$(testmask).val("9226845186");
//Let's get value exact immediate - this crack's
$(testmask).val();
$(testmask).trigger("mouseenter");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "+7 922 684-51-86", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("Title Case - Especially", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("p{1,10}", {
definitions: {
"p": {
validator: "[A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5 ]",
cardinality: 1,
casing: "title" //auto uppercasing
}
},
}).mask(testmask);
$(testmask).val("title case");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "Title Case", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("Bug when typing after a fixed character #1299 - gayanj", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("AaaBAaaVaa").mask(testmask);
testmask.focus();
$.caret(testmask, 4);
$("#testmask").Type("a");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "___BA__V__", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
};
+610
View File
@@ -0,0 +1,610 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
function pad(val, len) {
val = String(val);
len = len || 2;
while (val.length < len) val = "0" + val;
return val;
}
qunit.module("Date.Extensions - dd/mm/yyyy");
qunit.test("valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
assert.equal(testmask.value, "23/03/1973", "Result " + testmask.value);
});
qunit.test("invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "", "Result " + testmask.value);
});
qunit.test("overtype valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, 0, "23/03/1973".length);
$("#testmask").Type("04102017");
assert.equal(testmask.value, "04/10/2017", "Result " + testmask.value);
});
qunit.test("overtype invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, 0, "23/03/1973".length);
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "23/03/1973", "Result " + testmask.value);
});
qunit.test("insert current date", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").SendKey(Inputmask.keyCode.RIGHT, Inputmask.keyCode.CONTROL);
var today = new Date();
today = pad(today.getDate(), 2) + "/" + pad(parseInt(today.getMonth()) + 1, 2) + "/" + today.getFullYear();
assert.equal(testmask.value, today, "Result " + testmask.value);
});
qunit.test("backspace year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "23/03/yyyy", "Result " + testmask.value);
});
qunit.test("delete year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, "23/03/".length);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "23/03/yyyy", "Result " + testmask.value);
});
qunit.test("set date 592017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").val("592017");
assert.equal(testmask.value, "05/09/2017", "Result " + testmask.value);
});
qunit.test("set date 01/01/1800 min date 01/01/1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy",
min: "01/01/1900",
max: "31/12/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011800");
assert.equal(testmask.value, "01/01/1yyy", "Result " + testmask.value);
});
qunit.test("set date 01/01/2018 max date 31/12/2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy",
min: "01/01/1900",
max: "31/12/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01012018");
assert.equal(testmask.value, "01/01/201y", "Result " + testmask.value);
});
qunit.test("set date 01/01/1900 min date 01/01/1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy",
min: "01/01/1900",
max: "31/12/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011900");
assert.equal(testmask.value, "01/01/1900", "Result " + testmask.value);
});
qunit.test("set date 31/12/2017 max date 31/12/2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy",
min: "01/01/1900",
max: "31/12/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("31122017");
assert.equal(testmask.value, "31/12/2017", "Result " + testmask.value);
});
qunit.test("min 14/02/1938 max 14/02/2038 enter 01011939", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd/mm/yyyy",
min: "14/02/1938",
max: "14/02/2038"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011939");
assert.equal(testmask.value, "01/01/1939", "Result " + testmask.value);
});
qunit.module("Date.Extensions - mm/dd/yyyy");
qunit.test("valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("3231973");
assert.equal(testmask.value, "03/23/1973", "Result " + testmask.value);
});
qunit.test("invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "", "Result " + testmask.value);
});
qunit.test("overtype valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("3231973");
$.caret(testmask, 0, "03/23/1973".length);
$("#testmask").Type("10042017");
assert.equal(testmask.value, "10/04/2017", "Result " + testmask.value);
});
qunit.test("overtype invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("3231973");
$.caret(testmask, 0, "03/23/1973".length);
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "03/23/1973", "Result " + testmask.value);
});
qunit.test("insert current date", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").SendKey(Inputmask.keyCode.RIGHT, Inputmask.keyCode.CONTROL);
var today = new Date();
today = pad(parseInt(today.getMonth()) + 1, 2) + "/" + pad(today.getDate(), 2) + "/" + today.getFullYear();
assert.equal(testmask.value, today, "Result " + testmask.value);
});
qunit.test("backspace year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("3231973");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "03/23/yyyy", "Result " + testmask.value);
});
qunit.test("delete year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("3231973");
$.caret(testmask, "03/23/".length);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "03/23/yyyy", "Result " + testmask.value);
});
qunit.test("set date 952017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").val("952017");
assert.equal(testmask.value, "09/05/2017", "Result " + testmask.value);
});
qunit.test("set date 01/01/1800 min date 01/01/1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy",
min: "01/01/1900",
max: "12/31/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011800");
assert.equal(testmask.value, "01/01/1yyy", "Result " + testmask.value);
});
qunit.test("set date 01/01/2018 max date 12/31/2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy",
min: "01/01/1900",
max: "12/31/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01012018");
assert.equal(testmask.value, "01/01/201y", "Result " + testmask.value);
});
qunit.test("set date 01/01/1900 min date 01/01/1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy",
min: "01/01/1900",
max: "12/31/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011900");
assert.equal(testmask.value, "01/01/1900", "Result " + testmask.value);
});
qunit.test("set date 12/31/2017 max date 12/31/2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy",
min: "01/01/1900",
max: "12/31/2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("12312017");
assert.equal(testmask.value, "12/31/2017", "Result " + testmask.value);
});
qunit.test("min 02/14/1938 max 02/14/2038 enter 01011939", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/dd/yyyy",
min: "02/14/1938",
max: "02/14/2038"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011939");
assert.equal(testmask.value, "01/01/1939", "Result " + testmask.value);
});
qunit.module("Date.Extensions - dd.mm.yyyy");
qunit.test("valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
assert.equal(testmask.value, "23.03.1973", "Result " + testmask.value);
});
qunit.test("invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "", "Result " + testmask.value);
});
qunit.test("overtype valid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, 0, "23.03.1973".length);
$("#testmask").Type("04102017");
assert.equal(testmask.value, "04.10.2017", "Result " + testmask.value);
});
qunit.test("overtype invalid entry", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, 0, "23.03.1973".length);
$("#testmask").Type("abcdefghijklmnop");
assert.equal(testmask.value, "23.03.1973", "Result " + testmask.value);
});
qunit.test("insert current date", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").SendKey(Inputmask.keyCode.RIGHT, Inputmask.keyCode.CONTROL);
var today = new Date();
today = pad(today.getDate(), 2) + "." + pad(parseInt(today.getMonth()) + 1, 2) + "." + today.getFullYear();
assert.equal(testmask.value, today, "Result " + testmask.value);
});
qunit.test("backspace year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "23.03.yyyy", "Result " + testmask.value);
});
qunit.test("delete year", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("2331973");
$.caret(testmask, "23.03.".length);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "23.03.yyyy", "Result " + testmask.value);
});
qunit.test("set date 592017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy"
}).mask(testmask);
testmask.focus();
$("#testmask").val("592017");
assert.equal(testmask.value, "05.09.2017", "Result " + testmask.value);
});
qunit.test("set date 01.01.1800 min date 01.01.1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy",
min: "01.01.1900",
max: "31.12.2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011800");
assert.equal(testmask.value, "01.01.1yyy", "Result " + testmask.value);
});
qunit.test("set date 01.01.2018 max date 31.12.2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy",
min: "01.01.1900",
max: "31.12.2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01012018");
assert.equal(testmask.value, "01.01.201y", "Result " + testmask.value);
});
qunit.test("set date 01/01/1900 min date 01/01/1900", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy",
min: "01.01.1900",
max: "31.12.2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011900");
assert.equal(testmask.value, "01.01.1900", "Result " + testmask.value);
});
qunit.test("set date 31.12.2017 max date 31.12.2017", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy",
min: "01.01.1900",
max: "31.12.2017"
}).mask(testmask);
testmask.focus();
$("#testmask").val("31122017");
assert.equal(testmask.value, "31.12.2017", "Result " + testmask.value);
});
qunit.test("min 14.02.1938 max 14.02.2038 enter 01011939", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "dd.mm.yyyy",
min: "14.02.1938",
max: "14.02.2038"
}).mask(testmask);
testmask.focus();
$("#testmask").val("01011939");
assert.equal(testmask.value, "01.01.1939", "Result " + testmask.value);
});
qunit.module("Date.Extensions - misc");
qunit.test("HH:MM minmax 10:00 - 11:10 enter 1059", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "HH:MM",
min: "10:00",
max: "11:10"
}).mask(testmask);
testmask.focus();
$("#testmask").val("1059");
assert.equal(testmask.value, "10:59", "Result " + testmask.value);
});
qunit.test("HH:MM minmax 10:00 - 11:10 enter 1230", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "HH:MM",
min: "10:00",
max: "11:10"
}).mask(testmask);
testmask.focus();
$("#testmask").val("1230");
assert.equal(testmask.value, "10:MM", "Result " + testmask.value);
});
};
+444
View File
@@ -0,0 +1,444 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Dynamic Masks");
qunit.test("inputmask(\"9-a{3}9{3}\" - simple dynamic mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9-a{3}9{3}").mask(testmask);
testmask.focus();
$("#testmask").Type("1abc123");
assert.equal(testmask.value, "1-abc123", "Result " + testmask.value);
});
qunit.test("inputmask(\"9-a{1,3}9{1,3}\" - simple dynamic mask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9-a{1,3}9{1,3}").mask(testmask);
testmask.focus();
$("#testmask").Type("1a1");
assert.equal(testmask.value, "1-a1", "Result " + testmask.value);
});
qunit.test("inputmask(\"9-a{1,3}9{1,3}\" - simple dynamic mask - greedy false", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9-a{1,3}9{1,3}", {
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1a1");
assert.equal(testmask.value, "1-a1", "Result " + testmask.value);
});
qunit.test("inputmask(\"9-a{1,3}/9{2,3}\" - simple dynamic mask - greedy true", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9-a{1,3}/9{2,3}", {
greedy: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1a/123");
assert.equal(testmask.value, "1-a/123", "Result " + testmask.value);
});
qunit.test("email mask greedy false", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email", {
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("some.body@mail.com");
testmask.blur();
assert.equal(testmask.value, "some.body@mail.com", "Result " + testmask.value);
});
qunit.test("email mask greedy true", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email", {
greedy: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("some.body@mail.com");
testmask.blur();
setTimeout(function () {
assert.equal(testmask.value, "some.body@mail.com", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("email mask - partial input", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("some.");
testmask.blur();
assert.equal(testmask.value, "some.@_._", "Result " + testmask.value);
});
qunit.test("email mask - partial input 2", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("some@mail.com");
$.caret(testmask, 4);
$("#testmask").Type(".body");
assert.equal(testmask.value, "some.body@mail.com", "Result " + testmask.value);
});
qunit.test("email mask - babu@us.lufthansa.com - babupca", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("babu@us.lufthansa.com");
assert.equal(testmask.value, "babu@us.lufthansa.com", "Result " + testmask.value);
});
qunit.test("email mask - email@subdomain.domain.com - babupca", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("email@subdomain.domain.com");
assert.equal(testmask.value, "email@subdomain.domain.com", "Result " + testmask.value);
});
qunit.test("email mask - paste test.test@test.com - Kurumas", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").paste("test.test@test.com");
setTimeout(function () {
assert.equal(testmask.value, "test.test@test.com", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("quantifier mask greedy false - FairSite2C", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9{0,4}", {
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.value, "123", "Result " + testmask.value);
});
qunit.test("quantifier mask greedy true - FairSite2C", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9{0,4}", {
greedy: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.value, "123", "Result " + testmask.value);
});
qunit.test("email mask - clearIncomplete - hiddenman", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email", {
clearIncomplete: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("akornilov");
testmask.blur();
setTimeout(function () {
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "", "Result " + document.getElementById("testmask").inputmask._valueGet());
done();
}, 0);
});
qunit.test("email mask - clearIncomplete - hiddenman", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email", {
clearIncomplete: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("akornilov@");
testmask.blur();
setTimeout(function () {
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "", "Result " + document.getElementById("testmask").inputmask._valueGet());
done();
}, 0);
});
qunit.test("email mask - clearIncomplete - hiddenman", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email", {
clearIncomplete: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("akornilov@gmail.com");
testmask.blur();
setTimeout(function () {
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "akornilov@gmail.com", "Result " + document.getElementById("testmask").inputmask._valueGet());
done();
}, 0);
});
qunit.test("mask: '\\\\a{*}', repeat: 5 - voidmain02", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: '\\\\a{*}',
repeat: 5
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcd abcd abcd abcd abcd");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "\\abcd\\abcd\\abcd\\abcd\\abcd", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("[a{1,3}-]9999 - type abc1234 => delete c - ivodopyanov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("[a{1,3}-]9999").mask(testmask);
$("#testmask").Type("abc1234");
$.caret(testmask, 2);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "ab-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("email mask - mouseclick to domain part - hiddenman", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("akornilov");
//fake click in position
$.caret(testmask, 10);
$("#testmask").trigger("click");
$("#testmask").Type("gmail.com");
setTimeout(function () {
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "akornilov@gmail.com", "Result " + document.getElementById("testmask").inputmask._valueGet());
done();
}, 0);
});
qunit.test("I{1,3}-ZZ - rgafaric", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="VAA" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "I{1,3}-ZZ",
definitions: {
'Z': {
"validator": "[A-Za-z]",
cardinality: 1
},
'I': {
"validator": "[ivxlcdmIVXLCDM]",
cardinality: 1
}
}
}).mask(testmask);
testmask.blur();
setTimeout(function () {
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "V-AA", "Result " + document.getElementById("testmask").inputmask._valueGet());
done();
}, 0);
});
qunit.test("email mask - some.body@mail.com - delete before @", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("some.body@mail.com");
$.caret(testmask, 9);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
assert.equal(testmask.value, "some.body@ail.com", "Result " + testmask.value);
});
qunit.test("email mask -123@mail.com - 123 => info", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("email").mask(testmask);
testmask.focus();
$("#testmask").Type("123@mail.com");
$.caret(testmask, 0, 3);
$("#testmask").Type("info");
assert.equal(testmask.value, "info@mail.com", "Result " + testmask.value);
});
qunit.test("(aa)|(a.a.)|(aaa)|(aa.a.)|(a.aa.) - incomplete - danielpiterak", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(aa)|(a.a.)|(aaa)|(aa.a.)|(a.aa.)", {
clearMaskOnLostFocus: true,
showMaskOnHover: false,
placeholder: " ",
casing: "upper"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("p.p");
testmask.blur();
assert.equal(testmask.value, "P.P.", "Result " + testmask.value);
});
qunit.test("(aa)|(a.a.)|(aaa)|(aa.a.)|(a.aa.) - complete - danielpiterak", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(aa)|(a.a.)|(aaa)|(aa.a.)|(a.aa.)", {
clearMaskOnLostFocus: true,
showMaskOnHover: false,
placeholder: " ",
casing: "upper"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("p.p.");
testmask.blur();
assert.equal(testmask.value, "P.P.", "Result " + testmask.value);
});
qunit.test("(99){+|1}a - dynamic jit offset", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99){+|1}a").mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
$("#testmask").Type("1a");
assert.equal(testmask.value, "1a", "Result " + testmask.value);
});
qunit.test("(.999){+|1},00 - Loop trigger in revalidateMask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(.999){+|1},00", {
radixPoint: ",",
numericInput: true,
placeholder: "0",
definitions: {
"0": {
validator: "[0-9\uFF11-\uFF19]"
}
}
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
$("#testmask").Type("123333333333333333333333");
assert.equal(testmask.value, "0,12", "Result " + testmask.value);
});
qunit.test("a9{+} - Loop trigger in revalidateMask", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("a9{+}").mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
$("#testmask").Type("a");
$.caret(testmask, 0);
$("#testmask").Type("a");
assert.equal(testmask.value, "a_", "Result " + testmask.value);
});
qunit.test("Loop trigger in gettests", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "(99) 99999-9999[ ]",
"repeat": "*"
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
$("#testmask").Type("12123451234");
assert.equal(testmask.value, "(12) 12345-1234", "Result " + testmask.value);
});
};
+105
View File
@@ -0,0 +1,105 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Escape character");
qunit.test("inputmask(\"9\\|9\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
var input = $("#testmask");
Inputmask("9\\|9").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2|3", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\\[9\\]\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
var input = $("#testmask");
Inputmask("9\\[9\\]").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2[3]", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\\\\9\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
var input = $("#testmask");
Inputmask("9\\\\9").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2\\3", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\\{9\\}\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9\\{9\\}").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2{3}", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\\(9\\)\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9\\(9\\)").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2(3)", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\\?9\")", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9\\?9").mask(testmask);
testmask.focus();
$("#testmask").Type("23");
assert.equal(testmask.value, "2?3", "Result " + testmask.value);
});
qunit.test("inputmask(\"\\9999\") value not mask", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" value="999" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("\\9999", {
autoUnmask: true
}).mask(testmask);
testmask.focus();
assert.equal(testmask.inputmask._valueGet(), "9999", "Result " + testmask.inputmask._valueGet());
});
};
@@ -0,0 +1,233 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Value formatting");
qunit.test("Inputmask.format(\"2331973\", { alias: \"datetime\"})", function (assert) {
var formattedValue = Inputmask.format("2331973", {
alias: "datetime",
inputFormat: "dd/mm/yyyy"
});
assert.equal(formattedValue, "23/03/1973", "Result " + formattedValue);
});
qunit.test("Inputmask.format(\"016501030020001DE1015170\", { mask: \"99 999 999 999 9999 \\D\\E*** 9999\"})", function (assert) {
var formattedValue = Inputmask.format("016501030020001DE1015170", {
mask: "99 999 999 999 9999 \\D\\E*** 9999"
});
assert.equal(formattedValue, "01 650 103 002 0001 DE101 5170", "Result " + formattedValue);
});
qunit.test("Inputmask.format(\"12\", { mask: \"$ 999999\", numericInput: true, placeholder: \"0\" }); - gigermocas", function (assert) {
var formattedValue = Inputmask.format("12", {
mask: "$ 999999",
numericInput: true,
placeholder: "0"
});
assert.equal(formattedValue, "$ 000012", "Result " + formattedValue);
});
qunit.test("Inputmask.format(\"1111111.11\" - ... autoGroup: true - swd120", function (assert) {
var formattedValue = Inputmask.format("1111111.11", {
alias: "decimal",
radixPoint: ".",
digits: 2,
autoGroup: true,
groupSeparator: ",",
groupSize: 3,
allowMinus: true
});
assert.equal(formattedValue, "1,111,111.11", "Result " + formattedValue);
});
qunit.test("Inputmask.format(phone, { mask: '(999) 999-9999' })); - krivaten", function (assert) {
var phone = '5551112222';
var formattedValue = Inputmask.format(phone, {
mask: '(999) 999-9999'
});
assert.equal(formattedValue, "(555) 111-2222", "Result " + formattedValue);
});
qunit.test("format(62.91, { alias: 'numeric' } - penihel", function (assert) {
var formattedValue = Inputmask.format(62.91, {alias: 'numeric'});
assert.equal(formattedValue, "62.91", "Result " + formattedValue);
});
qunit.module("Value Validating");
qunit.test("Inputmask.isValid(\"23/03/1973\", { alias: \"datetime\"})", function (assert) {
var isValid = Inputmask.isValid("23/03/1973", {
alias: "datetime",
inputFormat: "dd/mm/yyyy"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask.isValid(\"01 650 103 002 0001 DE101 5170\", { mask: \"99 999 999 999 9999 \\D\\E*** 9999\"})", function (assert) {
var isValid = Inputmask.isValid("01 650 103 002 0001 DE101 5170", {
mask: "99 999 999 999 9999 \\D\\E*** 9999"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask.isValid email => false", function (assert) {
var isValid = Inputmask.isValid("some.body@mail.c", {
alias: "email"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask.isValid email => true", function (assert) {
var isValid = Inputmask.isValid("some.body@mail.com", {
alias: "email"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask.isValid email greedy => false", function (assert) {
var isValid = Inputmask.isValid("some.body@mail.c", {
alias: "email",
greedy: true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask.isValid email greedy => true", function (assert) {
var isValid = Inputmask.isValid("some.body@mail.com", {
alias: "email",
greedy: true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"100\", { alias: \"integer\" }", function (assert) {
var isValid = Inputmask.isValid("100", {
alias: "integer"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"100.00\", { alias: \"integer\" }", function (assert) {
var isValid = Inputmask.isValid("100.00", {
alias: "integer"
});
assert.equal(isValid, false, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"123\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("123", {
alias: "decimal"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"123.45\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("123.45", {
alias: "decimal"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"123456.78\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("123456.78", {
alias: "decimal"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"123,456.78\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("123,456.78", {
alias: "decimal",
radixPoint: ".",
groupSeparator: ",",
groupSize: 3,
autoGroup: true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"12,\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("12,", {
alias: "decimal",
radixPoint: ".",
groupSeparator: ",",
groupSize: 3
});
assert.equal(isValid, false, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"12,1.45\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("12,1.45", {
alias: "decimal",
radixPoint: ".",
groupSeparator: ",",
groupSize: 3
});
assert.equal(isValid, false, "Result " + isValid);
});
qunit.test("YoussefTaghlabi isValid(\"12,345.67\", { alias: \"decimal\" }", function (assert) {
var isValid = Inputmask.isValid("12,345.67", {
alias: "decimal",
radixPoint: ".",
groupSeparator: ",",
groupSize: 3,
autoGroup: true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("thomstark isValid(\"12lbs\", {mask:\"99[9]lb\\s\", greedy:false, skipOptionalPartCharacter: \"\", \"clearIncomplete\":true}", function (assert) {
var isValid = Inputmask.isValid("12lbs", {
mask: "99[9]lb\\s",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("thomstark isValid(\"1'2\"\", {mask:\"9'9[9]\"\", greedy:false, skipOptionalPartCharacter: \"\", \"clearIncomplete\":true}", function (assert) {
var isValid = Inputmask.isValid("1'2\"", {
mask: "9'9[9]\"",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("thomstark isValid(\"12lbs\", {mask:\"99{1,2}lb\\s\", greedy:false, skipOptionalPartCharacter: \"\", \"clearIncomplete\":true}", function (assert) {
var isValid = Inputmask.isValid("12lbs", {
mask: "99{1,2}lb\\s",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("thomstark isValid(\"9'9{1,2}\", {mask:\"9'9[9]\"\", greedy:false, skipOptionalPartCharacter: \"\", \"clearIncomplete\":true}", function (assert) {
var isValid = Inputmask.isValid("1'2\"", {
mask: "9'9{1,2}\"",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("a13x3y isValid(\"some_body@mail.com\", {alias:\"email\"}", function (assert) {
var isValid = Inputmask.isValid("some_body@mail.com", {
alias: "email"
});
assert.equal(isValid, true, "Result " + isValid);
});
qunit.test("Inputmask(\"99-99[ 99/99]\").isValid(\"03-11\") - pricejt", function (assert) {
var isValid = Inputmask("99-99[ 99/99]").isValid("03-11");
assert.equal(isValid, true, "Result " + isValid);
});
qunit.module("Value unmasking");
qunit.test("inputmask.unmask(\"23/03/1973\", { alias: \"datetime dd/mm/yyyy\" })", function (assert) {
var unmasked = Inputmask.unmask("23/03/1973", {
alias: "datetime",
inputFormat: "dd/mm/yyyy",
outputFormat: "ddmmyyyy"
});
assert.equal(unmasked, "23031973", "Result " + unmasked);
});
};
@@ -0,0 +1,144 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Initial value setting");
qunit.test("inputmask(\"999:99\", { placeholder: \"0\"}) value=\"007:20\"", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="007:20" />');
var testmask = document.getElementById("testmask");
Inputmask("999:99", {
placeholder: "0"
}).mask(testmask);
assert.equal(testmask.value, "007:20", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"01 650 103 002 0001 DE101 5170\" - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="01 650 103 002 0001 DE101 5170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999").mask(testmask);
assert.equal(testmask.value, "01 650 103 002 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999").mask(testmask);
assert.equal(testmask.value, "01 650 103 002 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" replace 2 with 3 - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999").mask(testmask);
$.caret(testmask, 13, 14);
$("#testmask").Type("3");
assert.equal(testmask.value, "01 650 103 003 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" replace 002 with 003 - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999").mask(testmask);
$.caret(testmask, 11, 14);
$("#testmask").Type("003");
assert.equal(testmask.value, "01 650 103 003 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\") ~ value=\"016501030020001DE1015170\" replace 02 with 01 - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999").mask(testmask);
$.caret(testmask, 12, 14);
$("#testmask").Type("01");
assert.equal(testmask.value, "01 650 103 001 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"99 999 999 999 9999 \\D\\E*** 9999\", { greedy: false }) ~ value=\"016501030020001DE1015170\" replace 02 with 01 - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="016501030020001DE1015170" />');
var testmask = document.getElementById("testmask");
Inputmask("99 999 999 999 9999 \\D\\E*** 9999", {
greedy: false
}).mask(testmask);
$.caret(testmask, 12, 14);
$("#testmask").Type("01");
assert.equal(testmask.value, "01 650 103 001 0001 DE101 5170", "Result " + testmask.value);
});
qunit.test("inputmask(\"\\D\\E***\") ~ value=\"DE001\" - wuSam", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="DE001" />');
var testmask = document.getElementById("testmask");
Inputmask("\\D\\E***").mask(testmask);
assert.equal(testmask.value, "DE001", "Result " + testmask.value);
});
qunit.test("inputmask(\"decimal\") ~ value=\"123.45\"", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="123.45" />');
var testmask = document.getElementById("testmask");
Inputmask("decimal").mask(testmask);
assert.equal(testmask.value, "123.45", "Result " + testmask.value);
});
qunit.test("inputmask(\"decimal\") ~ value=\"123.45\" - disabled input", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="123.45" disabled="disabled" />');
var testmask = document.getElementById("testmask");
Inputmask("decimal").mask(testmask);
assert.equal(testmask.value, "123.45", "Result " + testmask.value);
});
qunit.test("datetime inputformat mm/yyyy ~ value=\"031973\" - disabled input", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="031973" disabled="disabled" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {
inputFormat: "mm/yyyy"
}).mask(testmask);
assert.equal(testmask.value, "03/1973", "Result " + testmask.value);
});
qunit.test("inputmask(\"6703 9999 9999 9999 9\") ~ value=\"6703 1234 5678 9012 3\" - FransVdb", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="6703 1234 5678 9012 3" />');
Inputmask("6703 9999 9999 9999 9");
assert.equal(testmask.value, "6703 1234 5678 9012 3", "Result " + testmask.value);
});
qunit.test("inputmask(\"6703 9999 9999 9999 9\") ~ type \"6703 1234 5678 9012 3\" + backspace - FransVdb", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("6703 9999 9999 9999 9").mask(testmask);
testmask.focus();
$("#testmask").Type("1234567890123");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "6703 1234 5678 9012 _", "Result " + testmask.value);
});
qunit.test("inputmask(\"6703 9999 9999 9999 9\") ~ type \"6703670367036\" + backspace - FransVdb", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("6703 9999 9999 9999 9").mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
setTimeout(function () {
$("#testmask").Type("6703670367036");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "6703 6703 6703 6703 _", "Result " + testmask.value);
done();
}, 0);
});
};
@@ -0,0 +1,122 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("inputEventOnly: true");
qunit.test("XXX-9999-9999-XXX-XXX - gersteba", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
inputEventOnly: true,
mask: "XXX-9999-9999-XXX-XXX",
definitions: {
"X": {
validator: "[A-Ha-hJ-Nj-nPpR-Zr-z2-9]",
cardinality: 1,
casing: "upper"
}
}
}).mask(testmask);
testmask.focus();
//simulate input
$(testmask).input("abc12341234abcabc");
assert.equal(testmask.value, "ABC-1234-1234-ABC-ABC", "Result " + testmask.value);
});
qunit.test("(999) 999-9999", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999) 999-9999", {inputEventOnly: true}).mask(testmask);
testmask.focus();
//simulate input
$(testmask).input("1231231234");
assert.equal(testmask.value, "(123) 123-1234", "Result " + testmask.value);
});
qunit.test("(999) 999-9999 - type 123 + backspace", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(999) 999-9999", {inputEventOnly: true}).mask(testmask);
testmask.focus();
//simulate input
$(testmask).input("123");
//simulate backspace
$(testmask).input("(12) ___-____", 3);
assert.ok($.caret(testmask).begin == 3, "Caret " + $.caret(testmask).begin);
});
qunit.test("9999\\9\\9 - type 1234 + backspace - NightsDream", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "9999\\9\\9",
clearMaskOnLostFocus: false,
placeholder: "X",
colorMask: true,
inputEventOnly: true
}).mask(testmask);
testmask.focus();
//simulate input
$(testmask).input("123499");
//simulate backspace
$(testmask).input("12349", 5);
assert.ok($.caret(testmask).begin == 3, "Caret " + $.caret(testmask).begin);
});
qunit.test("numeric placeholder 0 - alexey-m-ukolov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
alias: 'numeric',
placeholder: '0',
inputEventOnly: true,
colorMask: true,
androidHack: "rtfm"
}, {inputEventOnly: true}).mask(testmask);
testmask.focus();
$(testmask).Type("10");
assert.equal(testmask.value, "10", "Result " + testmask.value);
});
qunit.test("numeric 1 - #1617", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("numeric", {
groupSeparator: ".",
radixPoint: ",",
placeholder: "0",
autoGroup: true,
integerDigits: 16,
digits: 2,
digitsOptional: false,
clearMaskOnLostFocus: false,
inputEventOnly: true
}).mask(testmask);
testmask.focus();
$.caret(testmask, 0);
$(testmask).Type("56,03");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$(testmask).Type("0,03");
assert.equal(testmask.value, "50,03", "Result " + testmask.value);
});
};
+96
View File
@@ -0,0 +1,96 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("IP - masks");
qunit.test("inputmask(\"ip\" - 10.10.10.10", function(assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
$fixture.append('<input type="text" id="testmask2" />');
var testmask2 = document.getElementById("testmask2");
Inputmask("ip").mask(testmask);
testmask.focus();
$("#testmask").Type("10.10.10.10");
testmask2.focus();
setTimeout(function() {
assert.equal(testmask.value, "10.10.10.10", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"ip\" - 1.1.1.1", function(assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
$fixture.append('<input type="text" id="testmask2" />');
var testmask2 = document.getElementById("testmask2");
Inputmask("ip").mask(testmask);
testmask.focus();
$("#testmask").Type("1.1.1.1");
testmask2.focus();
setTimeout(function() {
assert.equal(testmask.value, "1.1.1.1", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"ip\" - 255.255.255.255", function(assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
$fixture.append('<input type="text" id="testmask2" />');
var testmask2 = document.getElementById("testmask2");
Inputmask("ip").mask(testmask);
testmask.focus();
$("#testmask").Type("255.255.255.255");
setTimeout(function() {
testmask2.focus();
assert.equal(testmask.value, "255.255.255.255", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"ip\" - 192.168.1.100", function(assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
$fixture.append('<input type="text" id="testmask2" />');
var testmask2 = document.getElementById("testmask2");
Inputmask("ip").mask(testmask);
testmask.focus();
$("#testmask").Type("192.168.1.100");
testmask2.focus();
setTimeout(function() {
assert.equal(testmask.value, "192.168.1.100", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"ip\" - 123123123123 - delete 2nd 1 - ", function(assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
$fixture.append('<input type="text" id="testmask2" />');
var testmask2 = document.getElementById("testmask2");
Inputmask("ip").mask(testmask);
testmask.focus();
$("#testmask").Type("123123123123");
testmask2.focus();
$.caret(testmask, 4);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
setTimeout(function() {
assert.equal(testmask.value, "123.23.123.123", "Result " + testmask.value);
done();
}, 0);
});
};
@@ -0,0 +1,14 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("JIT Masking");
qunit.test("'(.999){*}', { jitMasking: true, numericInput: true }", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('(.999){*}', { jitMasking: true, numericInput: true }).mask(testmask);
$("#testmask").Type("123456");
assert.equal($(testmask).val(), "123.456", "Result " + $(testmask).val());
});
};
@@ -0,0 +1,11 @@
export default function (qunit, $, Inputmask) {
qunit.module("jquery.inputmask plugin");
qunit.test("", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
$("#testmask").inputmask({"mask": "99-9999-99"});
$("#testmask").focus();
assert.equal($("#testmask")[0].inputmask._valueGet(), "__-____-__", "Result " + $("#testmask")[0].inputmask._valueGet());
});
};
+359
View File
@@ -0,0 +1,359 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("keepStatic mask switching");
qunit.test("{ mask: [\"+55-99-9999-9999\", \"+55-99-99999-9999\", ], keepStatic: true }", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["+55-99-9999-9999", "+55-99-99999-9999"],
keepStatic: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123451234");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "+55-12-12345-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: \"+55-99-9999|(99)-9999\", keepStatic: true } - type 12123451234", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "+55-99-9999|(99)-9999",
keepStatic: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123451234");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "+55-12-12345-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: ['(99) 9999-9999', '(99) 99999-9999'] } - val('1212341234')", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ['(99) 9999-9999', '(99) 99999-9999']
}).mask(testmask);
$("#testmask").val("1212341234");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "(12) 1234-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: \"+55-99-9999|(99)-9999\", keepStatic: false } type 12123451234", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "+55-99-9999|(99)-9999",
keepStatic: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123451234");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "+55-12-12345-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: [\"+55-99-9999-9999\", \"+55-99-99999-9999\", ], keepStatic: true } - type 12123451234 + backspace", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["+55-99-9999-9999", "+55-99-99999-9999"],
keepStatic: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123451234");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "+55-12-1234-5123", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: [\"99-9999-99\",\"99-99999-99\"] } - type 12123412 + add 1 upfront", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99-9999-99", "99-99999-99"]
}).mask(testmask);
$("#testmask").Type("12123412");
$.caret(testmask, 0);
$("#testmask").Type("1");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "11-21234-12", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ mask: [\"99-99999-9\",\"99-999999-9\"] } - type 121234561", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99-99999-9", "99-999999-9"]
}).mask(testmask);
$("#testmask").Type("121234561");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12-123456-1", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("{ \"keepStatic\": true, greedy: false, mask: \"(99-9)|(99999)\" } - type 12345", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"keepStatic": true,
greedy: false,
"mask": "(99-9)|(99999)"
}).mask(testmask);
$("#testmask").Type("12345");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12345", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("7|8 999 99 99 - hiddenman", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("7|8 999 99 99").mask(testmask);
testmask.focus();
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "_ ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("7|8 999 99 99 type 7 - hiddenman", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("7|8 999 99 99").mask(testmask);
$("#testmask").Type("7");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "7 ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("7|8 999 99 99 type 8 - hiddenman", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("7|8 999 99 99").mask(testmask);
$("#testmask").Type("8");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "8 ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(78)|(79) 999 99 99", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(78)|(79) 999 99 99").mask(testmask);
testmask.focus();
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "7_ ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(78)|(79) 999 99 99 - type 5", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(78)|(79) 999 99 99").mask(testmask);
testmask.focus();
$("#testmask").Type("5");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "75 ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(78)|(74) 999 99 99", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(78)|(74) 999 99 99").mask(testmask);
testmask.focus();
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "7_ ___ __ __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("5-9|(9a)-5 - keepstatic: false", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "5-9|(9a)-5",
keepStatic: false
}).mask(testmask);
testmask.focus();
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "5-_-5", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("['(99) 9999-9999', '(99) 9-9999-9999'] - type 12123412345 - 3m0", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ['(99) 9999-9999', '(99) 9-9999-9999'],
removeMaskOnSubmit: false,
clearmaskonlostfocus: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123412345")
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "(12) 1-2341-2345", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("['(99) 9999-9999', '(99) 9-9999-9999'] - type 12123412345 - backspace - 3m0", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ['(99) 9999-9999', '(99) 9-9999-9999'],
removeMaskOnSubmit: false,
clearmaskonlostfocus: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12123412345")
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "(12) 1234-1234", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(99 99)|(*****) keepStatic false - type 12 abc", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99)|(*****)", {
keepStatic: false
}).mask(testmask);
$("#testmask").Type("12 abc");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12 __", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(99 99)|(*****) keepStatic false - type 12 123", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99)|(*****)", {
keepStatic: false
}).mask(testmask);
$("#testmask").Type("12 123");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12 12", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(99 99)|(*****) keepStatic true - type 1212", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99)|(*****)", {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("1212");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12 12", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(99 99)|(*****) keepStatic true - type 12123", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99)|(*****)", {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("12123");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "12123", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("(99 99)|(*****) keepStatic true - type abcde", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99)|(*****)", {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("abcde");
assert.equal(document.getElementById("testmask").inputmask._valueGet(), "abcde", "Result " + document.getElementById("testmask").inputmask._valueGet());
});
qunit.test("[\"9+9\", \"(99)+99+99\"] keepStatic true - type 123 - ishytow", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["9+9", "(99)+99+99"], {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("123");
assert.equal(testmask.value, "(12)+3_+__", "Result " + testmask.value);
});
qunit.test("[\"9+9\", \"99+99\", \"(99)+99+99\"] keepStatic true - type 12345 - ishytow", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["9+9", "99+99", "(99)+99+99"], {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("12345");
assert.equal(testmask.value, "(12)+34+5_", "Result " + testmask.value);
});
qunit.test("[\"9+9\", \"99+99\", \"(99)+99+99\"] keepStatic true - type 1234 - ishytow", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["9+9", "99+99", "(99)+99+99"], {
keepStatic: true
}).mask(testmask);
$("#testmask").Type("1234");
assert.equal(testmask.value, "12+34", "Result " + testmask.value);
});
qunit.test("[\"999-9999\", \"(999) 999-9999\", \"1-(999) 999-9999\"] - 999-9999 - carylewis", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["999-9999", "(999) 999-9999", "1-(999) 999-9999"]).mask(testmask);
$("#testmask").Type("1231234");
assert.equal(testmask.value, "123-1234", "Result " + testmask.value);
});
qunit.test("[\"999-9999\", \"(999) 999-9999\", \"1-(999) 999-9999\"] - (999) 999-9999 - carylewis", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["999-9999", "(999) 999-9999", "1-(999) 999-9999"]).mask(testmask);
$("#testmask").Type("1231231234");
assert.equal(testmask.value, "(123) 123-1234", "Result " + testmask.value);
});
qunit.test("[\"999-9999\", \"(999) 999-9999\", \"1-(999) 999-9999\"] - 1-(999) 999-9999 - carylewis", function(assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["999-9999", "(999) 999-9999", "1-(999) 999-9999"]).mask(testmask);
$("#testmask").Type("11231231234");
assert.equal(testmask.value, "1-(123) 123-1234", "Result " + testmask.value);
});
};
+438
View File
@@ -0,0 +1,438 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("multi masks");
qunit.test("inputmask({ mask: [\"99-99\", \"999-99\"]}) - input 12345", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99-99", "999-99"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345");
setTimeout(function () {
assert.equal(testmask.value, "123-45", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"999.999.999-99\", \"99.999.999/9999-99\"]}) - input 12312312312", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["999.999.999-99", "99.999.999/9999-99"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12312312312");
setTimeout(function () {
assert.equal(testmask.value, "123.123.123-12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"999.999.999-99\", \"99.999.999/9999-99\"]}) - input 12.123123123412", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["999.999.999-99", "99.999.999/9999-99"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12.123123123412");
setTimeout(function () {
assert.equal(testmask.value, "12.123.123/1234-12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\"]]}) - input 12345 greedy + blur", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345");
testmask.blur();
setTimeout(function () {
assert.equal(testmask.inputmask._valueGet(), "12345", "Result " + testmask.inputmask._valueGet());
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\"]]}) - input 12345 not greedy", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999"],
greedy: false,
keepStatic: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345");
setTimeout(function () {
assert.equal(testmask.value, "12345", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\"]]}) - input 12345-1234", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345-1234");
setTimeout(function () {
assert.equal(testmask.value, "12345-1234", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\"]]}) - input 123451234", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123451234");
setTimeout(function () {
assert.equal(testmask.value, "12345-1234", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\"]]}) - input 1234512", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1234512");
setTimeout(function () {
assert.equal(testmask.value, "12345-12__", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"]]}) - input 1234561234", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999", "999999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1234561234");
setTimeout(function () {
assert.equal(testmask.value, "123456-1234", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"]]}) - input 12345-6", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999", "999999-9999"]
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345-6");
setTimeout(function () {
assert.equal(testmask.value, "12345-6___", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"], keepStatic: false}) - input 123456", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999", "999999-9999"],
keepStatic: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
setTimeout(function () {
assert.equal(testmask.value, "123456-____", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"] , keepStatic: true}) - input 123456", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999", "999999-9999"],
keepStatic: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
setTimeout(function () {
assert.equal(testmask.value, "12345-6___", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: [\"99999\", \"99999-9999\", \"999999-9999\"]]}) - input 123456 (rtl)", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99999", "99999-9999", "999999-9999"]
}).mask(testmask);
testmask.focus();
setTimeout(function () { //needed to pass on ie
$("#testmask").Type("123456");
setTimeout(function () {
assert.equal(testmask.value, "___65-4321", "Result " + testmask.value);
done();
}, 0);
}, 0);
});
qunit.test("inputmask({ mask: ['9 AAA-AAA', 'A 999-999'] }) ", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ['9 AAA-AAA', 'A 999-999']
}).mask(testmask);
$("#testmask").Type("1abc");
setTimeout(function () {
assert.equal(testmask.value, "1 ABC-___", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: ['9 AAA-AAA', 'A 999-999'] }) ", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ['9 AAA-AAA', 'A 999-999']
}).mask(testmask);
$("#testmask").Type("a123");
setTimeout(function () {
assert.equal(testmask.value, "A 123-___", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: ['99.9', 'X'}) - annames", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: ["99.9", "X", "abc"],
definitions: {
"X": {
validator: "[xX]",
cardinality: 1,
casing: "upper"
}
}
}).mask(testmask);
$("#testmask").Type("x");
assert.equal(testmask.value, "X", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: [{ \"mask\": \"###-##-####\" }]) - lynxlive", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
var ssns = [{
"mask": "###-##-####"
}];
Inputmask({
mask: ssns,
greedy: false,
definitions: {
'#': {
validator: "[0-9]",
cardinality: 1
}
}
}).mask(testmask);
$("#testmask").Type("123121234");
assert.equal(testmask.value, "123-12-1234", "Result " + testmask.value);
});
qunit.test("'[9-]AAA-999', '999999' - type 1A - dekdegiv", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": ['[9-]AAA-999', '999999'],
keepStatic: false
}).mask(testmask);
$("#testmask").Type("1a");
assert.equal(testmask.value, "1-A__-___", "Result " + testmask.value);
});
qunit.test("(99 99 999999)|(*{+}) - 12abc - dekdegiv", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99 999999)|(*{+})").mask(testmask);
$("#testmask").Type("12abc");
assert.equal(testmask.value, "12abc", "Result " + testmask.value);
});
qunit.test("(99 99 999999)|(*{+}) - 12 34 delete ' 34' + 2abc", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99 999999)|(*{+})").mask(testmask);
$("#testmask").Type("12 34");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").Type("2abc");
assert.equal(testmask.value, "122abc", "Result " + testmask.value);
});
qunit.test("(99 99 999999)|(i{+}) - 12 3abc - dekdegiv", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99 99 999999)|(*{+})", {
definitions: {
"*": {
validator: ".",
cardinality: 1,
definitionSymbol: "*"
}
},
staticDefinitionSymbol: "*"
}).mask(testmask);
$("#testmask").Type("12 3abc");
assert.equal(testmask.value, "12 3abc", "Result " + testmask.value);
});
qunit.test("[\"(99) 9999-9999\",\"(99) 99999-9999\"] - 12123451234 - click front - asyncerror", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["(99) 9999-9999", "(99) 99999-9999"]).mask(testmask);
$("#testmask").Type("12123451234");
$.caret(testmask, 0);
testmask.focus();
$("#testmask").trigger("click");
assert.equal(testmask.value, "(12) 12345-1234", "Result " + testmask.value);
});
qunit.test("[\"+7(999)999-99-99\",\"+380(99)999-99-99\",\"+375(99)999-99-99\"] - andychups", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["+7(999)999-99-99", "+380(99)999-99-99", "+375(99)999-99-99"], {
keepStatic: false
}).mask(testmask);
$("#testmask").Type("3");
setTimeout(function () {
assert.equal(testmask.inputmask._valueGet(), "+3__(__)___-__-__", "Result " + testmask.inputmask._valueGet());
done();
}, 0);
});
qunit.test("[\"+7(999)999-99-99\",\"+380(99)999-99-99\",\"+375(99)999-99-99\"] - andychups", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask(["+7(999)999-99-99", "+380(99)999-99-99", "+375(99)999-99-99"], {
keepStatic: false
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
assert.equal(testmask.inputmask._valueGet(), "+_(___)___-__-__", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9{4} 9{4} 9{4} 9{4})|(9{4} 9{6} 9[5])|(9{9} 9{9}) - 1234123412341234 - necrosisoff ", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9{4} 9{4} 9{4} 9{4})|(9{4} 9{6} 9[5])|(9{9} 9{9})", {
"keepStatic": true
}
).mask(testmask);
testmask.focus();
$("#testmask").Type("1234123412341234")
assert.equal(testmask.inputmask._valueGet(), "1234 1234 1234 1234", "Result " + testmask.inputmask._valueGet());
});
qunit.test("(9{4} 9{4} 9{4} 9{4})|(9{4} 9{6} 9[5])|(9{9} 9{9}) - 12341234123412341 - necrosisoff ", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(9{4} 9{4} 9{4} 9{4})|(9{4} 9{6} 9[5])|(9{9} 9{9})", {
"keepStatic": true
}
).mask(testmask);
testmask.focus();
$("#testmask").Type("12341234123412341")
assert.equal(testmask.inputmask._valueGet(), "123412341 23412341_", "Result " + testmask.inputmask._valueGet());
});
};
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,402 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Direction RTL");
qunit.test("inputmask(\"999.999.999\") - delete 2nd with backspace, continue the mask", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").SendKey("1");
$("#testmask").SendKey("2");
$("#testmask").SendKey("3");
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey("4");
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey("5");
$("#testmask").SendKey("6");
assert.equal(testmask.value, "___._65.341", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999.999.999\") - delete 2nd with delete, continue the mask", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999.999.999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").SendKey("1");
$("#testmask").SendKey("2");
$("#testmask").SendKey("3");
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").SendKey(Inputmask.keyCode.RIGHT);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").SendKey("4");
$("#testmask").SendKey(Inputmask.keyCode.LEFT);
$("#testmask").SendKey("5");
$("#testmask").SendKey("6");
assert.equal(testmask.value, "___._65.341", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999-aaa-999\")", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999-aaa-999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123abc12");
assert.equal(testmask.value, "_21-cba-321", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999-999-999\") - replace selection", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999-999-999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123456789");
$.caret(testmask, 4, 7);
$("#testmask").Type("5");
assert.equal(testmask.value, "__9-875-321", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999-999-999\") - replace selection with backspace", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999-999-999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123456789");
$.caret(testmask, 4, 7);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").Type("5");
assert.equal(testmask.value, "__9-875-321", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"999-999-999\") - replace selection - with delete", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" dir="rtl" />');
var testmask = document.getElementById("testmask");
Inputmask("999-999-999").mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123456789");
$.caret(testmask, 4, 7);
$("#testmask").SendKey(Inputmask.keyCode.DELETE);
$("#testmask").Type("5");
assert.equal(testmask.value, "__9-875-321", "Result " + testmask.value);
done();
}, 0);
});
qunit.module("Numeric Input");
qunit.test("inputmask({ mask: \"9\", numericInput: true, repeat: 10, greedy: true }); - 1234567890", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "9",
numericInput: true,
repeat: 10,
greedy: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("1234567890");
assert.equal(testmask.value, "1234567890", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"9\", numericInput: true, repeat: 10, greedy: true }); - replace selection", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "9",
numericInput: true,
repeat: 10,
greedy: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("1234567890");
$.caret(testmask, 3, 6);
$("#testmask").Type("5");
assert.equal(testmask.value, "__12357890", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"99-99-99\", numericInput: true }); - 1234567890", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99-99-99",
numericInput: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("1234567890");
assert.equal(testmask.value, "12-34-56", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"€ 999.999.999,99\", numericInput: true }); - 123", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('€ 999.999.999,99', {
numericInput: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123");
assert.equal(testmask.value, "€ ___.___.__1,23", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"€ 999.999.999,99\", numericInput: true }); - 123 position before 456", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('€ 999.999.999,99', {
numericInput: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123");
$.caret(testmask, 12);
$("#testmask").Type("456");
assert.equal(testmask.value, "€ ___.__4.561,23", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('€ 999.999.999,99', {
numericInput: true,
radixPoint: ","
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
;
setTimeout(function () {
$("#testmask").Type("123");
assert.equal(testmask.value, "€ ___.___.__1,23", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123,45", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('€ 999.999.999,99', {
numericInput: true,
radixPoint: ","
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
;
setTimeout(function () {
$("#testmask").Type("123,45");
assert.equal(testmask.value, "€ ___.___.123,45", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"9999 t\", { numericInput: true }); - 123 - Joe Rosa", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('9999 t', {
numericInput: true
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
setTimeout(function () {
$("#testmask").Type("123");
assert.equal(testmask.value, "_123 t", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"9999 t\", { numericInput: true, autoUnmask: true }); - 70 - Joe Rosa", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('9999 t', {
numericInput: true,
autoUnmask: true
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
setTimeout(function () {
$("#testmask").Type("70");
assert.equal(testmask.value, "70", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask({ mask: \"['$9.99', '$99.99', '$999.99', '$9,999.99', '$99,999.99', '$999,999.99', '$9,999,999.99', '$99,999,999.99', '$999,999,999.99'], 'placeholder': ' ', 'numericInput': true, 'rightAlignNumerics': false\" value=\"$100000.00\"", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append("<input type=\"text\" id=\"testmask\" data-inputmask=\"'mask': ['$9.99', '$99.99', '$999.99', '$9,999.99', '$99,999.99', '$999,999.99', '$9,999,999.99', '$99,999,999.99', '$999,999,999.99'], 'placeholder': ' ', 'numericInput': true, 'rightAlignNumerics': false\" value=\"$100000.00\"/>");
var testmask = document.getElementById("testmask");
Inputmask().mask(testmask);
setTimeout(function () {
assert.equal(testmask.value, "$100,000.00", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("cuurency - numericInput: true - 123456 backspace x4", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("currency", {
numericInput: true
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type("123456");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.value, "$ 0.12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("decimal - numericInput: true - initial value 20,00 - Inkeliz", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="20,00" />');
var testmask = document.getElementById("testmask");
Inputmask('decimal', {
radixPoint: ',',
rightAlign: false,
showMaskOnHover: false,
numericInput: true,
allowPlus: false,
rightAlignNumerics: false,
greedy: false
}).mask(testmask);
assert.equal(testmask.value, "20,00", "Result " + testmask.value);
});
qunit.test("currency - numericInput: true - initial value 4545.56 - sadhuria", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" value="4545.56" />');
var testmask = document.getElementById("testmask");
Inputmask("currency", {
groupSeparator: ',',
placeholder: '0.00',
numericInput: true,
autoGroup: true
}).mask(testmask);
assert.equal(testmask.value, "$ 4,545.56", "Result " + testmask.value);
});
qunit.test("(,999){+|1}.99 - Baiquan", function (assert) {
var done = assert.async(),
$fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(,999){+|1}.99", {
numericInput: true,
placeholder: "0"
}).mask(testmask);
testmask.focus();
$("#testmask").trigger("click");
setTimeout(function () {
$("#testmask").Type("123456");
assert.equal(testmask.value, "1,234.56", "Result " + testmask.value);
done();
}, 0);
});
};
+15
View File
@@ -0,0 +1,15 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Extra options after masking");
qunit.test("decimal alias add suffix later - gkostov", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({alias: "decimal", suffix: ""}).mask("testmask");
testmask.inputmask.option({suffix: "%"});
$("#testmask").Type("123.45");
assert.equal(testmask.value, "123.45%", "Result " + testmask.value);
});
};
+312
View File
@@ -0,0 +1,312 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Optional");
qunit.test("inputmask(\"(99) 9999[9]-99999\") - input 121234-12345", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99) 9999[9]-99999").mask(testmask);
testmask.focus();
$("#testmask").Type("121234-12345");
assert.equal(testmask.value, "(12) 1234-12345", "Result " + testmask.value);
});
qunit.test("inputmask(\"(99) 9999[9]-99999\") - input 121234512345", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("(99) 9999[9]-99999").mask(testmask);
testmask.focus();
$("#testmask").Type("121234512345");
assert.equal(testmask.value, "(12) 12345-12345", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: true }) - input 123", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.value, "123__", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: false }) - input 123", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.value, "123__", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: false }) - input 12345", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12345");
assert.equal(testmask.value, "12345", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: false }) - input 123456", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
assert.equal(testmask.value, "12345-6___", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: false }) - input 123456789", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456789");
assert.equal(testmask.value, "12345-6789", "Result " + testmask.value);
});
qunit.test("inputmask(\"9[9][9] 999[9] 9999\") - input 123123 space 1234 - vipink70", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9[9][9] 999[9] 9999").mask(testmask);
testmask.focus();
$("#testmask").Type("123123");
$("#testmask").SendKey(Inputmask.keyCode.SPACE);
$("#testmask").Type("1234");
assert.equal(testmask.value, "123 123 1234", "Result " + testmask.value);
});
qunit.test("inputmask('[9-]AAA.999') ", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('[9-]AAA.999').mask(testmask);
$("#testmask").Type("1abc123");
$.caret(testmask, 4, 5);
$("#testmask").Type("d");
assert.equal(testmask.value, "1-ABD.123", "Result " + testmask.value);
});
qunit.test("inputmask('9[9]:99') ", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('9[9]:99').mask(testmask);
$("#testmask").Type("3:44");
$.caret(testmask, 1);
$("#testmask").Type("3");
assert.equal(testmask.value, "33:44", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99999[-9999]\", greedy: false }) - input 123456", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99999[-9999]",
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
testmask.blur();
$("#testmask").trigger("mouseenter");
assert.equal(testmask.value, "12345-6___", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"9'9{1,2}\"\", greedy: false, skipOptionalPartCharacter: \"\", \"clearIncomplete\": true }) - input 12 blur - thomstark", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "9'9{1,2}\"",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12");
testmask.blur();
assert.equal(testmask.value, "1'2\"", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99{1,2}lb\\s\", greedy: false, skipOptionalPartCharacter: \"\", \"clearIncomplete\": true }) - input 12 blur - thomstark", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99{1,2}lb\\s",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12");
testmask.blur();
assert.equal(testmask.value, "12lbs", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"9'9[9]\"\", greedy: false, skipOptionalPartCharacter: \"\", \"clearIncomplete\": true }) - input 12 blur - thomstark", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "9'9[9]\"",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12");
testmask.blur();
assert.equal(testmask.value, "1'2\"", "Result " + testmask.value);
});
qunit.test("inputmask({ mask: \"99[9]lb\\s\", greedy: false, skipOptionalPartCharacter: \"\", \"clearIncomplete\": true }) - input 12 blur - thomstark", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "99[9]lb\\s",
greedy: false,
skipOptionalPartCharacter: "",
"clearIncomplete": true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12");
testmask.blur();
assert.equal(testmask.value, "12lbs", "Result " + testmask.value);
});
qunit.test(".inputmask(\"99999[-9999]\", { greedy: false }); - type 123456 backspace iscomplete?", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("99999[-9999]", {
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.inputmask.isComplete(), true, "Result " + testmask.inputmask.isComplete());
});
qunit.test(".inputmask(\"99999[-9999]\", { greedy: false }); type 123456 backspace blur", function (assert) {
var $fixture = $("#qunit-fixture"), done = assert.async();
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("99999[-9999]", {
greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
testmask.blur();
setTimeout(function () {
assert.equal($("#testmask")[0].inputmask._valueGet(), "12345", "Result " + $("#testmask")[0].inputmask._valueGet());
done();
}, 0);
});
qunit.test(".inputmask(\"99999[-9999]\", { greedy: false, autoUnmask: true }); type 123456 backspace", function (assert) {
var $fixture = $("#qunit-fixture"), done = assert.async();
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("99999[-9999]", {
greedy: false,
autoUnmask: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123456");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
setTimeout(function () {
assert.equal(testmask.value, "12345", "Result " + testmask.value);
done();
}, 0);
});
qunit.test(".inputmask('999-999-9999[ ext 9{1,5}]'); - type 12345678901 backspace iscomplete? - antch", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('999-999-9999[ ext 9{1,5}]').mask(testmask);
testmask.focus();
$("#testmask").Type("12345678901");
$("#testmask").SendKey(Inputmask.keyCode.BACKSPACE);
assert.equal(testmask.inputmask.isComplete(), true, "Result " + testmask.inputmask.isComplete());
});
qunit.test("inputmask({ mask: \"9999[ 9999][ 9999]\"}) - input 1234 space space - GMTA", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: "9999[ 9999][ 9999]"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1234 ");
assert.equal(testmask.value, "1234", "Result " + testmask.value);
});
qunit.test("9999[ 9999][ 9999][ 9999][ 999] - Enfree", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
mask: '9999[ 9999][ 9999][ 9999][ 999]',
placeholder: '', greedy: false
}).mask(testmask);
testmask.focus();
$("#testmask").Type("45464748");
$.caret(testmask, 2);
$("#testmask").Type("0909");
assert.equal(testmask.value, "4509 0946 4748", "Result " + testmask.value);
});
};
+230
View File
@@ -0,0 +1,230 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Paste value");
qunit.test("inputmask(\"+7 (999) 999-99-99\") ~ paste \"+79114041112\"", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("+7 (999) 999-99-99").mask(testmask);
testmask.focus();
$("#testmask").paste("+79114041112");
setTimeout(function () {
assert.equal(testmask.value, "+7 (911) 404-11-12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"+7 (999) 999-99-99\") ~ paste \"+7 (9114041112___)\"", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("+7 (999) 999-99-99").mask(testmask);
testmask.focus();
$("#testmask").paste("+7 (9114041112___)");
setTimeout(function () {
assert.equal(testmask.value, "+7 (911) 404-11-12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"+7 (999) 999-99-99\") ~ paste \"0079114041112\" - monoblaine", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("+7 (999) 999-99-99", {
onBeforePaste: function (pastedValue) {
//just simplistic for the test ;-)
var strippedValue = pastedValue.substr(3);
return strippedValue;
}
}).mask(testmask);
testmask.focus();
$("#testmask").paste("0079114041112");
setTimeout(function () {
assert.equal(testmask.value, "+7 (911) 404-11-12", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"+31 9999999999\") ~ paste \"3112345678\" - jason16v", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("+31 9999999999").mask(testmask);
testmask.focus();
$("#testmask").paste("3112345678");
setTimeout(function () {
assert.equal(testmask.value, "+31 3112345678", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("inputmask(\"+31 9999999999\") ~ paste \"+3112345678\" - jason16v", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("+31 9999999999").mask(testmask);
testmask.focus();
$("#testmask").paste("+3112345678");
setTimeout(function () {
assert.equal(testmask.value, "+31 12345678__", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("99.999.999/9999-99 numericInput ~ paste 79100085302751__-____/..__ - imbelo", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "99.999.999/9999-99",
"numericInput": true
}).mask(testmask);
testmask.focus();
$("#testmask").paste("79100085302751");
setTimeout(function () {
assert.equal(testmask.value, "79.100.085/3027-51", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ $123.22 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("$123.22");
setTimeout(function () {
assert.equal(testmask.value, "$ 123.22", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ $-123.22 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("$-123.22");
setTimeout(function () {
assert.equal(testmask.value, "-$ 123.22", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ 1000.00 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("1000.00");
setTimeout(function () {
assert.equal(testmask.value, "$ 1,000.00", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ -1000.00 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("-1000.00");
setTimeout(function () {
assert.equal(testmask.value, "-$ 1,000.00", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ $1000.00 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("$1000.00");
setTimeout(function () {
assert.equal(testmask.value, "$ 1,000.00", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ $-1000.00 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("$-1000.00");
setTimeout(function () {
assert.equal(testmask.value, "-$ 1,000.00", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("currency ~ 000.02 - sjk07", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('currency').mask(testmask);
testmask.focus();
$("#testmask").paste("000.02");
setTimeout(function () {
$(testmask).trigger("blur");
assert.equal(testmask.value, "$ 0.02", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("02.999.999 ~ paste 02.024.900 - tnavarra", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("02.999.999").mask(testmask);
testmask.focus();
$("#testmask").paste("02.024.900");
setTimeout(function () {
assert.equal(testmask.value, "02.024.900", "Result " + testmask.value);
done();
}, 0);
});
qunit.test("R9999999999 ~ paste 1234567890 - s-a", function (assert) {
var done = assert.async(), $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("R9999999999", {
"placeholder": "0",
"showMaskOnFocus": false,
"numericInput": true
}).mask(testmask);
$("#testmask").trigger("click");
$("#testmask").paste("1234567890");
setTimeout(function () {
assert.equal(testmask.value, "R1234567890", "Result " + testmask.value);
done();
}, 0);
});
};
+360
View File
@@ -0,0 +1,360 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Regex masks");
qunit.test("inputmask({ regex: \"[0-9]*\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[0-9]*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123abc45");
assert.equal(testmask.value, "12345", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[0-9]*\"}); ~ isComplete", function (assert) {
var $fixture = $("#qunit-fixture"), done = assert.async();
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[0-9]*",
oncomplete: function () {
assert.equal(testmask.value, "1", "Result " + testmask.value);
done();
}
}).mask(testmask);
testmask.focus();
$("#testmask").SendKey("1");
});
qunit.test("inputmask({ regex: \"[A-Za-z\u0410-\u044F\u0401\u04510-9]*\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[A-Za-z\u0410-\u044F\u0401\u04510-9]*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123abc45");
assert.equal(testmask.value, "123abc45", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[A-Za-z\u0410-\u044F\u0401\u0451]+[A-Za-z\u0410-\u044F\u0401\u04510-9]*\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[A-Za-z\u0410-\u044F\u0401\u0451]+[A-Za-z\u0410-\u044F\u0401\u04510-9]*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123abc45");
assert.equal(testmask.value, "abc45", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[A-Za-z\u0410-\u044F\u0401\u0451]{1}[A-Za-z\u0410-\u044F\u0401\u04510-9]*\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[A-Za-z\u0410-\u044F\u0401\u0451]{1}[A-Za-z\u0410-\u044F\u0401\u04510-9]*"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123abc45");
assert.equal(testmask.value, "abc45", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[-]?(([1-8][0-9])|[1-9]0?)\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[-]?(([1-8][0-9])|[1-9]0?)"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("90");
assert.equal(testmask.value, "90", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[-]?(([1-8][0-9])|[1-9]0?)\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[-]?(([1-8][0-9])|[1-9]0?)"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("0");
assert.equal(testmask.value, "", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[-]?(([1-8][0-9])|[1-9]0?)\"});", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[-]?(([1-8][0-9])|[1-9]0?)"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("-78");
assert.equal(testmask.value, "-78", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[a-za-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*)?\" - simple regex email", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[a-za-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*)?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("some.body@mail.com");
assert.equal(testmask.value, "some.body@mail.com", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"[a-za-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*)?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\" - complexer regex email", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[a-za-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*)?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("denise.van.de.cruys@mail.com");
assert.equal(testmask.value, "denise.van.de.cruys@mail.com", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))\" - mrpanacs regex 1-123-4562", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("1-123-4562");
assert.equal(testmask.value, "1-123-4562", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))\" - mrpanacs regex 20-222-2222", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("20-222-2222");
assert.equal(testmask.value, "20-222-2222", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))\" - mrpanacs regex 22-222-234", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("22-222-234");
assert.equal(testmask.value, "22-222-234", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))\" - mrpanacs regex 70-12-34", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(([2-9][0-9])-([0-9]{3}-[0-9]{3}))|((1|30|20|70)-([0-9]{3}-[0-9]{4}))"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("70-12-34");
assert.equal(testmask.value, "70-123-4__", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?\" - arame regex 12", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12");
assert.equal(testmask.value, "12", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?\" } - arame regex 12.5", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12.5");
assert.equal(testmask.value, "12.5", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?\" } - arame regex 12.75", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("12.75");
assert.equal(testmask.value, "12.75", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(abc)+(def)\" }); - Flyarbonkers regex abcdef", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(abc)+(def)",
jitMasking: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcdef");
assert.equal(testmask.value, "abcdef", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(abc)+(def)\" }); - Flyarbonkers regex 123a4b5c6d7e8f", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(abc)+(def)",
jitMasking: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123a4b5c6d7e8f");
assert.equal(testmask.value, "abcdef", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(abc)+(def)\" }); - Flyarbonkers regex abcabcdef", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(abc)+(def)",
jitMasking: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcabcdef");
assert.equal(testmask.value, "abcabcdef", "Result " + testmask.value);
});
qunit.test("inputmask({ regex: \"(abc){2,4}(def)\" }); - Flyarbonkers regex abcafebcaefbfcabcdef", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "(abc){2,4}(def)",
jitMasking: true
}).mask(testmask);
testmask.focus();
$("#testmask").Type("abcafebcaefbfcabcdef");
assert.equal(testmask.value, "abcabcabcabcdef", "Result " + testmask.value);
});
qunit.test("inputmask({regex: \"[а-яА-Я\\s]*\"}) - type space - SilentImp", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[а-яА-Я\\s]*"
}).mask(testmask);
testmask.focus();
$("#testmask").SendKey(Inputmask.keyCode.SPACE);
assert.equal(testmask.value, " ", "Result " + testmask.value);
});
qunit.test("inputmask({regex: \"\\+7 \\(\\d{3}\\) \\d{3} \\d{4}\"}) - hxss", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "\\+7 \\(\\d{3}\\) \\d{3} \\d{4}"
}).mask(testmask);
testmask.focus();
assert.equal(testmask.inputmask.__valueGet.call(testmask), "+7 (___) ___ ____", "Result " + testmask.inputmask.__valueGet.call(testmask));
});
qunit.test("[0-9]{2}|[0-9]{3} - type 123", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[0-9]{2}|[0-9]{3}"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("123");
assert.equal(testmask.inputmask.__valueGet.call(testmask), "123", "Result " + testmask.inputmask.__valueGet.call(testmask));
});
qunit.test("[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc) - type maimairel", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask({
regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"
}).mask(testmask);
testmask.focus();
$("#testmask").Type("10px");
assert.equal(testmask.inputmask.__valueGet.call(testmask), "10px", "Result " + testmask.inputmask.__valueGet.call(testmask));
});
};
+149
View File
@@ -0,0 +1,149 @@
export default function (qunit, Inputmask) {
var $ = Inputmask.dependencyLib;
qunit.module("Set value with fn.val");
qunit.test("inputmask(\"decimal\") ~ value=\"123.45\"", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("decimal").mask(testmask);
$("#testmask").val("123.45");
assert.equal(testmask.value, "123.45", "Result " + testmask.value);
});
qunit.test("inputmask(\"9\") ~ value=\"1\"", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("9").mask(testmask);
$("#testmask").val("1");
assert.equal(testmask.value, "1", "Result " + testmask.value);
});
qunit.test("inputmask(\"decimal\") ~ .val(\"123.45\") - disabled input", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" disabled="disabled" />');
var testmask = document.getElementById("testmask");
Inputmask("decimal").mask(testmask);
$("#testmask").val("123.45");
assert.equal(testmask.value, "123.45", "Result " + testmask.value);
});
qunit.test("inputmask(\"mm/yyyy\") ~ .val(\"031973\") - disabled input", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" disabled="disabled" />');
var testmask = document.getElementById("testmask");
Inputmask("datetime", {inputFormat: "mm/yyyy"}).mask(testmask);
$("#testmask").val("031973");
assert.equal(testmask.value, "03/1973", "Result " + testmask.value);
});
qunit.test("inputmask({ \"mask\": \"(999) 999-9999\" }) ~ .val(\"8144419449\") - type=\"tel\" - bodrick", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="tel" id="testmask" disabled="disabled" />');
var testmask = document.getElementById("testmask");
Inputmask({
"mask": "(999) 999-9999"
}).mask(testmask);
$("#testmask").val("8144419449");
assert.equal(testmask.value, "(814) 441-9449", "Result " + testmask.value);
});
qunit.test(".inputmask('decimal',{ alias:\"decimal\",integerDigits:9,digits:3,digitsOptional: false,placeholder: '0' }); - '2000.000' - vijjj", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('decimal', {
alias: "decimal",
integerDigits: 9,
digits: 3,
digitsOptional: false,
placeholder: '0'
}).mask(testmask);
$("#testmask").val('2000.000');
assert.equal(testmask.value, "2000.000", "Result " + testmask.value);
});
qunit.test(".inputmask('decimal',{ alias:\"decimal\",integerDigits:9,digits:3,digitsOptional: false,placeholder: '0' }); - 3000.000 - vijjj", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('decimal', {
alias: "decimal",
integerDigits: 9,
digits: 3,
digitsOptional: false,
placeholder: '0'
}).mask(testmask);
$("#testmask").val(3000.000);
assert.equal(testmask.value, "3000.000", "Result " + testmask.value);
});
qunit.test(".inputmask('decimal',{ alias:\"decimal\",integerDigits:9,digits:3,digitsOptional: false,placeholder: '0' }); - '4000.00' - vijjj", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('decimal', {
alias: "decimal",
integerDigits: 9,
digits: 3,
digitsOptional: false,
placeholder: '0'
}).mask(testmask);
$("#testmask").val('4000.00');
assert.equal(testmask.value, "4000.000", "Result " + testmask.value);
});
qunit.test(".inputmask('decimal',{ alias:\"decimal\",integerDigits:9,digits:3,digitsOptional: false,placeholder: '0' }); - '5000.000' - vijjj", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask('decimal', {
alias: "decimal",
integerDigits: 9,
digits: 3,
digitsOptional: false,
placeholder: '0'
}).mask(testmask);
document.getElementById('testmask').value = '5000.000';
assert.equal(testmask.value, "5000.000", "Result " + testmask.value);
});
qunit.test(".inputmask(\"mask\", {\"mask\": \"+7 (999) 999-99-99\"}); - \"+7 (705) 123-45-67\" - serious-andy", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("mask", {
"mask": "+7 (999) 999-99-99"
}).mask(testmask);
$("#testmask").val('+7 (705) 123-45-67');
assert.equal(testmask.value, "+7 (705) 123-45-67", "Result " + testmask.value);
});
qunit.test(".inputmask(\"mask\", {\"mask\": \"+375 (99) 999-99-99\"}); - \"+375 (37) 999-99-99\" - PavelTyk", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("mask", {
"mask": "+375 (99) 999-99-99"
}).mask(testmask);
$("#testmask").val('+375 (37) 999-99-99');
assert.equal(testmask.value, "+375 (37) 999-99-99", "Result " + testmask.value);
});
qunit.test(".inputmask(\"mask\", {\"mask\": \"+7(999)999-99-99\"}); - '7771231234' + '' - moongrate", function (assert) {
var $fixture = $("#qunit-fixture"), done = assert.async();
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("mask", {
"mask": "+7(999)999-99-99"
}).mask(testmask);
testmask.focus();
setTimeout(function () {
$("#testmask").Type('7771231234');
$("#testmask").val(testmask.value);
assert.equal(testmask.value, "+7(777)123-12-34", "Result " + testmask.value);
done();
}, 0);
});
};
+98
View File
@@ -0,0 +1,98 @@
'use strict';
let webpack = require('webpack');
let path = require('path');
function _path(p) {
return path.join(__dirname, p);
}
const rules = {
sourceMap: {
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
},
js: {
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
options: {
presets: [
'env'
],
passPerPreset: true,
},
},
styles: {
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require('postcss-cssnext')
];
}
}
}
]
}
}
module.exports = {
entry: "./qunit/index.js",
output: {
path: __dirname,
filename: "./qunit.js"
},
externals: {
"qunit": "QUnit"
},
module: {
rules: [
rules.sourceMap,
rules.js,
rules.styles
]
},
resolve: {
alias: {
// "../js/dependencyLibs/inputmask.dependencyLib": "../js/dependencyLibs/inputmask.dependencyLib.jquery",
// "./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jquery"
}
},
plugins: [
new webpack.SourceMapDevToolPlugin({
// file and reference
filename: '[file].map',
// sources naming
moduleFilenameTemplate: '[absolute-resource-path]',
fallbackModuleFilenameTemplate: '[absolute-resource-path]',
// }),
// new webpack.LoaderOptionsPlugin({
// debug: true
})
],
bail: true,
mode: "none"
// devServer: {
// publicPath: '/',
// stats: {
// colors: true
// },
// host: '0.0.0.0',
// inline: true,
// port: '8080',
// quiet: false,
// noInfo: false,
// },
};
+107
View File
@@ -0,0 +1,107 @@
'use strict';
let webpack = require('webpack');
let path = require('path');
function _path(p) {
return path.join(__dirname, p);
}
const rules = {
sourceMap: {
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
},
js: {
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
options: {
presets: [
'env'
],
passPerPreset: true,
},
},
// ts: {
// test: /\.tsx?$/,
// loader: 'awesome-typescript-loader',
// exclude: /(node_modules)/
// },
styles: {
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require('postcss-cssnext')
];
}
}
}
]
}
}
module.exports = {
entry: "./bundle.js",
output: {
path: __dirname,
filename: "build/bundle.js"
},
externals: {
// "jquery": "jQuery"
// "jqlite": "jqlite"
},
module: {
rules: [
rules.sourceMap,
rules.js,
// rules.ts,
rules.styles
]
},
resolve: {
alias: {
// "./js/dependencyLibs/inputmask.dependencyLib": "./js/dependencyLibs/inputmask.dependencyLib.jquery",
// "./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jquery"
// "./js/dependencyLibs/inputmask.dependencyLib": "./js/dependencyLibs/inputmask.dependencyLib.jqlite",
// "./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jqlite"
}
},
plugins: [
new webpack.SourceMapDevToolPlugin({
// file and reference
filename: '[file].map',
// sources naming
moduleFilenameTemplate: '[absolute-resource-path]',
fallbackModuleFilenameTemplate: '[absolute-resource-path]',
// }),
// new webpack.LoaderOptionsPlugin({
// debug: true
})
],
bail: true,
mode: "none"
// devServer: {
// publicPath: '/',
// stats: {
// colors: true
// },
// host: '0.0.0.0',
// inline: true,
// port: '8080',
// quiet: false,
// noInfo: false,
// },
};
+100
View File
@@ -0,0 +1,100 @@
'use strict';
let webpack = require('webpack');
let path = require('path');
function _path(p) {
return path.join(__dirname, p);
}
const rules = {
sourceMap: {
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
},
js: {
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
options: {
presets: [
'env'
],
passPerPreset: true,
},
},
styles: {
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require('postcss-cssnext')
];
}
}
}
]
}
}
module.exports = {
entry: "./bundle.js",
output: {
path: __dirname,
filename: "build/bundle.js"
},
externals: {
"jquery": "jQuery"
},
module: {
rules: [
rules.sourceMap,
rules.js,
rules.styles
]
},
resolve: {
alias: {
"./js/dependencyLibs/inputmask.dependencyLib": "./js/dependencyLibs/inputmask.dependencyLib.jquery",
"./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jquery"
//"./js/dependencyLibs/inputmask.dependencyLib": "./js/dependencyLibs/inputmask.dependencyLib.jqlite",
// "./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jqlite"
}
},
plugins: [
new webpack.SourceMapDevToolPlugin({
// file and reference
filename: '[file].map',
// sources naming
moduleFilenameTemplate: '[absolute-resource-path]',
fallbackModuleFilenameTemplate: '[absolute-resource-path]',
// }),
// new webpack.LoaderOptionsPlugin({
// debug: true
})
],
bail: true,
mode: "none"
// devServer: {
// publicPath: '/',
// stats: {
// colors: true
// },
// host: '0.0.0.0',
// inline: true,
// port: '8080',
// quiet: false,
// noInfo: false,
// },
};