skeuocard-rails 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +23 -0
- data/MIT-LICENSE +20 -0
- data/README.md +59 -0
- data/lib/skeuocard-rails.rb +3 -0
- data/lib/skeuocard-rails/engine.rb +6 -0
- data/vendor/assets/fonts/ocra-webfont.eot +0 -0
- data/vendor/assets/fonts/ocra-webfont.svg +138 -0
- data/vendor/assets/fonts/ocra-webfont.ttf +0 -0
- data/vendor/assets/fonts/ocra-webfont.woff +0 -0
- data/vendor/assets/images/card-flip-arrow.png +0 -0
- data/vendor/assets/images/card-invalid-indicator.png +0 -0
- data/vendor/assets/images/card-valid-anim.gif +0 -0
- data/vendor/assets/images/card-valid-indicator.png +0 -0
- data/vendor/assets/images/issuers/amex-blackcard-front.png +0 -0
- data/vendor/assets/images/issuers/visa-chase-sapphire.png +0 -0
- data/vendor/assets/images/issuers/visa-simple-front.png +0 -0
- data/vendor/assets/images/products/amex-front.png +0 -0
- data/vendor/assets/images/products/dinersclubintl-front.png +0 -0
- data/vendor/assets/images/products/discover-front.png +0 -0
- data/vendor/assets/images/products/generic-back.png +0 -0
- data/vendor/assets/images/products/generic-front.png +0 -0
- data/vendor/assets/images/products/mastercard-front.png +0 -0
- data/vendor/assets/images/products/visa-back.png +0 -0
- data/vendor/assets/images/products/visa-front.png +0 -0
- data/vendor/assets/javascripts/skeuocard.js +1432 -0
- data/vendor/assets/javascripts/src/skeuocard.coffee +1072 -0
- data/vendor/assets/javascripts/vendor/css_browser_selector.js +154 -0
- data/vendor/assets/javascripts/vendor/demo.fix.js +17 -0
- data/vendor/assets/javascripts/vendor/jquery-2.0.3.min.js +5 -0
- data/vendor/assets/stylesheets/src/_browser_hacks.scss +32 -0
- data/vendor/assets/stylesheets/src/_cards.scss +318 -0
- data/vendor/assets/stylesheets/src/_util.scss +15 -0
- data/vendor/assets/stylesheets/src/demo.scss +265 -0
- data/vendor/assets/stylesheets/src/skeuocard.reset.scss +52 -0
- data/vendor/assets/stylesheets/src/skeuocard.scss +168 -0
- metadata +92 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b450290878eef2c3dc6c8c69c0a081d4335daf9
|
4
|
+
data.tar.gz: e8c0d919d6b2faec20e80568ed3afc92ce10adb2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d90166cceeb69fa87c3c6d22e7491d333b69918d133d85f900975b3ce4bf0035f873d6378979896b43496cb3faf32bb2e339a3958dd517837a2963ef75e9d50b
|
7
|
+
data.tar.gz: e1585b2e10e78fe154ca2c27f367adeabc252baf179c279df55a01b62e913faeb3c9a240f340d982c3bd5f845c6d447cd2e1b031d57eb7766c6dc1bff5111f9c
|
data/Gemfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '>= 3.1.0'
|
4
|
+
|
5
|
+
gem 'sqlite3'
|
6
|
+
|
7
|
+
# Gems used only for assets and not required
|
8
|
+
# in production environments by default.
|
9
|
+
group :assets do
|
10
|
+
gem 'sass-rails', ">= 3.1.0"
|
11
|
+
gem 'coffee-rails', ">= 3.1.0"
|
12
|
+
gem 'uglifier'
|
13
|
+
end
|
14
|
+
|
15
|
+
gem 'jquery-rails'
|
16
|
+
|
17
|
+
group :test do
|
18
|
+
# Pretty printed test output
|
19
|
+
gem 'turn', :require => false
|
20
|
+
gem 'minitest'
|
21
|
+
gem 'capybara'
|
22
|
+
gem 'poltergeist'
|
23
|
+
end
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Rouge Cardinal
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# skeucard-rails
|
2
|
+
|
3
|
+
Use [skeuocard](http://kenkeiter.com/skeuocard/) with rails 3.1+ asset pipeline.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
This gem vendors skeuocard for Rails 3.1 and greater. The files
|
8
|
+
will be added to the asset pipeline and available for you to use.
|
9
|
+
|
10
|
+
First add the following lines to your applications `Gemfile`:
|
11
|
+
|
12
|
+
``` ruby
|
13
|
+
gem 'skeuocard-rails'
|
14
|
+
```
|
15
|
+
|
16
|
+
Then run `bundle install` to update your application's bundle.
|
17
|
+
|
18
|
+
Now you need to edit your `app/assets/javascripts/application.js`
|
19
|
+
file and add the following line:
|
20
|
+
|
21
|
+
``` javascript
|
22
|
+
//= require skeuocard
|
23
|
+
```
|
24
|
+
|
25
|
+
And then edit your `app/assets/stylesheets/application.css` file to
|
26
|
+
look something like:
|
27
|
+
|
28
|
+
``` css
|
29
|
+
/*
|
30
|
+
*= require_self
|
31
|
+
*= require skeuocard.reset
|
32
|
+
*= require skeuocard
|
33
|
+
*= require_tree .
|
34
|
+
*/
|
35
|
+
```
|
36
|
+
|
37
|
+
## Usage
|
38
|
+
|
39
|
+
Simply call the card with javascript after implementing the correct html.
|
40
|
+
|
41
|
+
``` javascript
|
42
|
+
window.card = new Skeuocard($("#skeuocard"));
|
43
|
+
```
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
52
|
+
|
53
|
+
|
54
|
+
### Useful links
|
55
|
+
|
56
|
+
* [Gem inspiration (fancybox)](https://github.com/hecticjeff/fancybox-rails)
|
57
|
+
* [DHH's RailsConf 2011 talk on the rails 3.1 asset pipeline](http://www.youtube.com/watch?v=cGdCI2HhfAU)
|
58
|
+
|
59
|
+
Copyright (c) Rouge Cardinal
|
Binary file
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<metadata></metadata>
|
5
|
+
<defs>
|
6
|
+
<font id="ocraregular" horiz-adv-x="1480" >
|
7
|
+
<font-face units-per-em="2048" ascent="1638" descent="-410" />
|
8
|
+
<missing-glyph horiz-adv-x="500" />
|
9
|
+
<glyph />
|
10
|
+
<glyph />
|
11
|
+
<glyph unicode="
" />
|
12
|
+
<glyph unicode=" " />
|
13
|
+
<glyph unicode="!" d="M586 104v86q0 43 30.5 73t73.5 30h101q43 0 73.5 -30t30.5 -73v-86q0 -43 -30.5 -73.5t-73.5 -30.5h-101q-43 0 -73.5 30.5t-30.5 73.5zM586 1495q0 41 30.5 71.5t73.5 30.5h101q41 0 72.5 -28.5t31.5 -67.5v-6l-51 -784q0 -43 -31 -73t-72 -30q-43 0 -71.5 30t-32.5 73z " />
|
14
|
+
<glyph unicode=""" d="M227 1495q0 6 4 27v75h1020v-65q4 -16 4 -25q0 -12 -4 -32v-29q-41 -152 -100 -475q-20 -102 -107 -103q-41 0 -73.5 27t-32.5 63q0 2 1 6.5t1 6.5l-84 420h-233l-86 -439q-6 -35 -35 -59.5t-66 -24.5t-65.5 23.5t-36.5 60.5z" />
|
15
|
+
<glyph unicode="#" d="M231 713q0 41 30 71.5t73 30.5h100v227h-100q-43 0 -73 31t-30 74t30 72.5t73 29.5h100v246q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-246h199v246q0 41 30.5 71.5t73.5 30.5t73 -30.5t30 -71.5v-246h100q43 0 73.5 -29.5t30.5 -72.5t-30.5 -74t-73.5 -31h-100v-227 h100q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -74t-73.5 -31h-100v-243q0 -43 -30 -74t-73 -31t-73.5 31t-30.5 74v243h-199v-243q0 -43 -30.5 -74t-73.5 -31t-73 31t-30 74v243h-100q-43 0 -73 31t-30 74zM641 815h199v227h-199v-227z" />
|
16
|
+
<glyph unicode="$" d="M231 451q0 43 30 73.5t73 30.5h710v139h-710q-43 0 -73 31t-30 74v348q0 43 30 72.5t73 29.5h303v246q0 41 30.5 71.5t73.5 30.5q41 0 72 -30.5t31 -71.5v-246h303q43 0 73.5 -29.5t30.5 -72.5t-30.5 -74t-73.5 -31h-711v-139h711q43 0 73.5 -30.5t30.5 -73.5v-348 q0 -43 -30.5 -73t-73.5 -30h-303v-244q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v244h-303q-43 0 -73 30t-30 73z" />
|
17
|
+
<glyph unicode="%" d="M231 276q0 41 21 64l813 1044q29 39 82 39q43 0 73.5 -29.5t30.5 -72.5q0 -37 -22 -64l-813 -1044q-29 -39 -82 -39q-43 0 -73 29.5t-30 72.5zM231 1321v174q0 41 30 71.5t73 30.5h203q43 0 73.5 -30.5t30.5 -71.5v-174q0 -43 -30.5 -73.5t-73.5 -30.5h-203 q-43 0 -73 30.5t-30 73.5zM840 104v172q0 43 30.5 74t73.5 31h203q43 0 73.5 -31t30.5 -74v-172q0 -43 -30.5 -73.5t-73.5 -30.5h-203q-43 0 -73.5 30.5t-30.5 73.5z" />
|
18
|
+
<glyph unicode="&" d="M231 309v142q0 49 35 79l189 162l-197 209q-27 31 -27 72v141q0 127 91.5 218t218.5 91h196q127 0 218.5 -91t91.5 -218v-141q0 -51 -35 -80l-256 -219l219 -234l104 90q31 25 68 25q43 0 73.5 -30.5t30.5 -73.5q0 -27 -16 -53.5t-31.5 -41t-49.5 -39t-38 -28.5l107 -115 q29 -33 28 -70q0 -43 -30.5 -73.5t-73.5 -30.5q-47 0 -76 33l-113 121l-151 -129q-31 -25 -66 -25h-200q-127 0 -218.5 91t-91.5 218zM438 309q0 -43 31 -72.5t72 -29.5h161l115 98l-219 234l-160 -136v-94zM438 1014l174 -187l228 193v94q0 41 -31 72t-72 31h-196 q-41 0 -72 -30t-31 -73v-100z" />
|
19
|
+
<glyph unicode="'" d="M535 799v696q0 41 30.5 71.5t73.5 30.5h203q43 0 73.5 -30.5t30.5 -71.5q0 -10 -4 -31l-203 -690q-10 -35 -36.5 -56.5t-63.5 -21.5q-43 0 -73.5 30t-30.5 73z" />
|
20
|
+
<glyph unicode="(" d="M535 602v393q0 141 88 256l239 308q33 39 82 38q43 0 73 -30.5t30 -71.5q0 -35 -21 -65l-240 -306q-45 -59 -45 -129v-393q0 -70 45 -129l240 -305q20 -31 21 -64q0 -43 -30 -73.5t-73 -30.5q-49 0 -82 39l-239 307q-88 115 -88 256z" />
|
21
|
+
<glyph unicode=")" d="M434 104q0 33 21 64l239 305q45 59 45 129v393q0 70 -45 129l-239 306q-20 31 -21 65q0 41 30 71.5t73 30.5q49 0 81 -38l240 -308q88 -115 88 -256v-393q0 -141 -88 -256l-240 -307q-33 -39 -81 -39q-43 0 -73 30.5t-30 73.5z" />
|
22
|
+
<glyph unicode="*" d="M231 451q0 49 35 79l314 269l-314 268q-35 31 -35 80q0 43 30 72.5t73 29.5q39 0 67 -24l236 -201v297q0 43 30.5 72.5t73.5 29.5q41 0 72 -29.5t31 -72.5v-297l235 201q27 25 68 24q43 0 73.5 -29.5t30.5 -72.5q0 -47 -37 -80l-313 -268l313 -269q37 -33 37 -79 q0 -43 -30.5 -73t-73.5 -30q-41 0 -68 25l-235 200v-297q0 -43 -31 -72.5t-72 -29.5q-43 0 -73.5 29.5t-30.5 72.5v297l-236 -200q-29 -25 -67 -25q-43 0 -73 30t-30 73z" />
|
23
|
+
<glyph unicode="+" d="M231 799q0 43 30 73.5t73 30.5h303v303q0 41 30.5 72t73.5 31q41 0 72 -31t31 -72v-303h303q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-303v-303q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v303h-303q-43 0 -73 30t-30 73z" />
|
24
|
+
<glyph unicode="," d="M434 625q0 43 30 73.5t73 30.5h407q43 0 73 -30.5t30 -73.5v-521q0 -43 -30 -73.5t-73 -30.5t-73.5 30.5t-30.5 73.5v418h-303q-43 0 -73 30t-30 73z" />
|
25
|
+
<glyph unicode="-" d="M231 713v86q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
26
|
+
<glyph unicode="." d="M535 365v174q0 43 30.5 72.5t73.5 29.5h203q43 0 73.5 -29.5t30.5 -72.5v-174q0 -43 -30.5 -74t-73.5 -31h-203q-43 0 -73.5 31t-30.5 74z" />
|
27
|
+
<glyph unicode="/" d="M231 104q0 27 13 52l813 1390q31 51 90 51q43 0 73.5 -30.5t30.5 -71.5q0 -25 -14 -53l-813 -1391q-31 -51 -90 -51q-43 0 -73 30.5t-30 73.5z" />
|
28
|
+
<glyph unicode="0" d="M231 207v1184q0 84 61.5 145t145.5 61h606q82 0 144.5 -61t62.5 -145v-1184q0 -84 -62.5 -145.5t-144.5 -61.5h-606q-84 0 -145.5 61.5t-61.5 145.5zM438 207h606v1184h-606v-1184z" />
|
29
|
+
<glyph unicode="1" d="M231 104q0 41 30 72t73 31h303v1184h-303q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h510v-1390h200v418q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-521q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5z" />
|
30
|
+
<glyph unicode="2" d="M231 0v696q0 84 61.5 144.5t145.5 60.5h606v490h-710q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h710q82 0 144.5 -61t62.5 -145v-490q0 -82 -61.5 -143.5t-145.5 -61.5h-606v-489h709q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-916z" />
|
31
|
+
<glyph unicode="3" d="M231 104q0 41 30 72t73 31h710v385q0 41 -31.5 72.5t-72.5 31.5h-403q-43 0 -73 30t-30 73t30 73.5t73 30.5h403q43 0 73.5 31t30.5 72v385h-710q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h710q82 0 144.5 -61t62.5 -145v-385q0 -119 -82 -207q82 -88 82 -207v-385 q0 -84 -62.5 -145.5t-144.5 -61.5h-710q-43 0 -73 30.5t-30 73.5z" />
|
32
|
+
<glyph unicode="4" d="M281 522v973q0 41 30.5 71.5t73.5 30.5t72.5 -30.5t29.5 -71.5v-766h404v592q0 43 30.5 72.5t73.5 29.5q41 0 72 -29.5t31 -72.5v-592q43 0 72.5 -30.5t29.5 -73.5t-29.5 -73t-72.5 -30v-418q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v418h-610z" />
|
33
|
+
<glyph unicode="5" d="M231 190q0 43 30 73t73 30q25 0 41 -8l184 -78h485v489h-610v901h713q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-506v-488h403q82 0 144.5 -62.5t62.5 -144.5v-489q0 -84 -62.5 -145.5t-144.5 -61.5h-464q-41 0 -83 10t-69 21.5t-72 33t-63 29.5 q-62 26 -62 96z" />
|
34
|
+
<glyph unicode="6" d="M231 104v1391q0 41 30 71.5t73 30.5h102q43 0 73 -30.5t30 -71.5q0 -43 -30 -73.5t-73 -30.5v-662h711q43 0 73.5 -30.5t30.5 -73.5v-521q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5zM436 207h608v315h-608v-315z" />
|
35
|
+
<glyph unicode="7" d="M231 1407v88q0 41 30 71.5t73 30.5h917v-624q0 -47 -37 -80l-370 -315v-474q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v521q0 47 37 80l370 315v371h-608q-6 -37 -34.5 -61.5t-67.5 -24.5q-43 0 -73 29.5t-30 72.5z" />
|
36
|
+
<glyph unicode="8" d="M231 207v489q0 84 60.5 145.5t144.5 61.5v592q0 43 29 72.5t72 29.5h407q43 0 71.5 -29.5t28.5 -72.5v-592q82 0 144.5 -62.5t62.5 -144.5v-489q0 -84 -62.5 -145.5t-144.5 -61.5h-608q-84 0 -144.5 61.5t-60.5 145.5zM436 207h608v489h-608v-489zM641 903h199v488h-199 v-488z" />
|
37
|
+
<glyph unicode="9" d="M231 973v522q0 41 30 71.5t73 30.5h813q43 0 73.5 -30.5t30.5 -71.5v-1391q0 -43 -30.5 -73.5t-73.5 -30.5h-103q-43 0 -72.5 30.5t-29.5 73.5q0 41 29.5 72t72.5 31v661h-710q-43 0 -73 31t-30 74zM436 1075h608v316h-608v-316z" />
|
38
|
+
<glyph unicode=":" d="M535 365v174q0 43 30.5 72.5t73.5 29.5h203q43 0 73.5 -29.5t30.5 -72.5v-174q0 -43 -30.5 -74t-73.5 -31h-203q-43 0 -73.5 31t-30.5 74zM535 1059v174q0 43 30.5 73.5t73.5 30.5h203q43 0 73.5 -30.5t30.5 -73.5v-174q0 -43 -30.5 -73t-73.5 -30h-203q-43 0 -73.5 30 t-30.5 73z" />
|
39
|
+
<glyph unicode=";" d="M434 625q0 43 30 73.5t73 30.5h407q43 0 73 -30.5t30 -73.5v-521q0 -43 -30 -73.5t-73 -30.5t-73.5 30.5t-30.5 73.5v418h-303q-43 0 -73 30t-30 73zM434 1147v174q0 43 30 72.5t73 29.5h204q41 0 72 -29.5t31 -72.5v-174q0 -43 -31 -74t-72 -31h-204q-43 0 -73 31 t-30 74z" />
|
40
|
+
<glyph unicode="<" d="M231 754v88q0 59 50 90l813 477q23 14 53 14q43 0 73.5 -29.5t30.5 -72.5q0 -57 -51 -90l-735 -432l735 -432q51 -33 51 -91q0 -43 -30.5 -72.5t-73.5 -29.5q-31 0 -53 14l-813 478q-50 31 -50 88z" />
|
41
|
+
<glyph unicode="=" d="M231 625q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-813q-43 0 -73 30t-30 73zM231 1059q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-813q-43 0 -73 30t-30 73z" />
|
42
|
+
<glyph unicode=">" d="M231 276q0 59 50 91l737 432l-737 432q-49 31 -50 90q0 43 30 72.5t73 29.5q31 0 53 -14l813 -477q51 -33 51 -90v-86q0 -59 -41 -84l-823 -484q-23 -14 -53 -14q-43 0 -73 29.5t-30 72.5z" />
|
43
|
+
<glyph unicode="?" d="M231 973q0 49 35 78l611 522q31 25 67.5 24.5t67.5 -24.5l202 -174q37 -31 37 -78v-174q0 -47 -37 -80l-573 -489v-127q0 -43 -30.5 -73t-73.5 -30t-73 30t-30 73v174q0 51 35 80l575 489v78l-100 86l-543 -465q-31 -25 -67 -25q-43 0 -73 31t-30 74zM434 104q0 41 30 72 t73 31t73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
44
|
+
<glyph unicode="@" d="M231 307v375q0 127 90.5 217t215.5 90h204q41 0 72 -30.5t31 -73.5v-578q0 -41 29.5 -70.5t70.5 -29.5t70.5 29.5t29.5 70.5v926q0 66 -47 112t-110 46h-293q-51 0 -97 -36t-71 -83q-29 -55 -92 -55q-43 0 -73 30.5t-30 73.5q0 74 111 174q113 102 252 102h293 q150 0 257 -108.5t107 -255.5v-926q0 -125 -91 -216t-216 -91q-117 0 -203 80q-90 -80 -204 -80q-125 0 -215.5 90t-90.5 217zM438 307q0 -41 29 -70.5t70 -29.5t70.5 29.5t29.5 70.5v475h-100q-41 0 -70 -29.5t-29 -70.5v-375z" />
|
45
|
+
<glyph unicode="A" d="M225 104l416 1420q10 33 37 53t61.5 20t63 -20.5t37.5 -52.5l413 -1420q0 -43 -31.5 -73.5t-74.5 -30.5q-35 0 -61.5 20.5t-36.5 53.5l-80 274h-457l-80 -274q-10 -33 -37.5 -53.5t-62.5 -20.5q-43 0 -75 30.5t-32 73.5zM573 555h334l-168 569z" />
|
46
|
+
<glyph unicode="B" d="M231 0v1597h607q168 0 290.5 -122.5t122.5 -290.5v-76q0 -182 -143 -309q143 -127 143 -310v-75q0 -168 -122.5 -291t-290.5 -123h-607zM438 207h400q84 0 145 62.5t61 144.5v75q0 84 -61 145.5t-145 61.5h-400v-489zM438 903h400q84 0 145 61.5t61 143.5v76 q0 82 -61 144.5t-145 62.5h-400v-488z" />
|
47
|
+
<glyph unicode="C" d="M231 799q0 109 50 211l206 417q33 74 110 122t169 48h381q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-381q-63 0 -90 -58l-211 -415q-27 -57 -27 -119t27 -119l211 -416q27 -57 90 -57h381q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-381 q-90 0 -165 49t-112 123q-152 289 -208 416q-50 105 -50 211z" />
|
48
|
+
<glyph unicode="D" d="M231 104q0 41 30 72t73 31h100v1184h-100q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h381q90 0 164.5 -49t111.5 -123l209 -415q51 -106 51 -211t-51 -211l-207 -418q-33 -74 -109.5 -122t-168.5 -48h-381q-43 0 -73 30.5t-30 73.5zM641 207h74q63 0 90 57l211 416 q29 70 28 119q0 61 -28 119l-211 415q-27 57 -90 58h-74v-1184z" />
|
49
|
+
<glyph unicode="E" d="M231 0v1597h916q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-709v-488h303q41 0 72 -30.5t31 -73.5t-31 -73t-72 -30h-303v-489h709q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-916z" />
|
50
|
+
<glyph unicode="F" d="M231 104v1493h916q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-709v-316h506q43 0 73 -29.5t30 -72.5t-30 -74t-73 -31h-506v-764q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
51
|
+
<glyph unicode="G" d="M231 311v555q0 141 86 252l279 361q91 118 243 118h3h305q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-305q-51 0 -82 -41l-279 -357q-43 -57 -43 -127v-555q0 -43 31 -73.5t72 -30.5h399q41 0 72.5 30.5t31.5 73.5v211h-202q-43 0 -73 30t-30 73 t30 73.5t73 30.5h409v-418q0 -127 -92 -219t-219 -92h-399q-129 0 -219.5 91t-90.5 220z" />
|
52
|
+
<glyph unicode="H" d="M231 104v1391q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-592h606v592q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1391q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5v592h-606v-592q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
53
|
+
<glyph unicode="I" d="M231 104q0 41 30 72t73 31h303v1184h-303q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h813q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-303v-1184h303q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5z" />
|
54
|
+
<glyph unicode="J" d="M332 309v316q0 43 30.5 73.5t73.5 30.5t73 -30.5t30 -73.5v-316q0 -43 30.5 -72.5t73.5 -29.5h195q43 0 73.5 30.5t30.5 71.5v1186q0 41 29.5 71.5t72.5 30.5t74 -30.5t31 -71.5v-1186q0 -127 -92 -218t-219 -91h-195q-127 0 -219 91t-92 218z" />
|
55
|
+
<glyph unicode="K" d="M231 104v1391q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-471l641 549q30 24 65 24h3q43 0 73.5 -30.5t30.5 -71.5q0 -49 -37 -80l-720 -616l720 -617q37 -31 37 -78q0 -43 -30.5 -73.5t-73.5 -30.5q-37 0 -68 25l-641 548v-469q0 -43 -30.5 -73.5t-73.5 -30.5 t-73 30.5t-30 73.5z" />
|
56
|
+
<glyph unicode="L" d="M231 0v1495q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1288h709q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-916z" />
|
57
|
+
<glyph unicode="M" d="M231 104v1493h258l252 -358l250 358h260v-1493q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5v1209l-200 -287v-53q0 -43 -31 -74t-72 -31q-43 0 -73.5 31t-30.5 74v53l-199 283v-1205q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
58
|
+
<glyph unicode="N" d="M231 104v1493h273l540 -1232v1130q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1495h-274l-539 1229v-1125q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
59
|
+
<glyph unicode="O" d="M231 799q0 109 50 211l219 440q33 63 97.5 105t141.5 42q80 0 144.5 -42t97.5 -105l219 -440q51 -106 51 -211t-51 -211l-219 -441q-33 -63 -97.5 -105t-144.5 -42q-78 0 -142.5 42t-96.5 105l-219 441q-50 94 -50 211zM438 798.5q0 -61.5 27 -118.5l221 -438 q16 -35 53 -35q41 0 58 33l219 440q29 70 28 119q0 61 -28 119l-221 436q-16 37 -56 37q-35 0 -53 -37l-221 -436q-27 -58 -27 -119.5z" />
|
60
|
+
<glyph unicode="P" d="M231 104v1493h709q127 0 219 -91t92 -218v-368q0 -127 -92 -219.5t-219 -92.5h-502v-504q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM438 815h502q41 0 72.5 31t31.5 74v368q0 41 -31.5 72t-72.5 31h-502v-576z" />
|
61
|
+
<glyph unicode="Q" d="M231 252v577q0 193 144 318l461 389q66 61 161 61q102 0 178 -74.5t76 -176.5v-578q0 -47 -8 -89t-28.5 -80t-35 -63.5t-50 -60.5t-50 -48t-59.5 -50t-55 -45l49 -125h133q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-275l-75 193l-154 -132 q-70 -61 -162 -61q-102 0 -176 75t-74 177zM438 252q0 -45 43 -45h17l221 188l-76 193q-6 14 -6 37q0 43 30.5 73.5t73.5 30.5q27 0 47.5 -11t36 -38t23.5 -44.5t20.5 -54t16.5 -44.5q8 8 39.5 33.5t46 39t35 40t29.5 55t9 63.5v578q0 18 -13 30.5t-34 12.5h-14l-475 -400 q-70 -61 -70 -160v-577z" />
|
62
|
+
<glyph unicode="R" d="M231 104v1493h709q127 0 219 -92t92 -219v-106q0 -127 -93 -219.5t-218 -92.5h-119l416 -712q14 -29 14 -52q0 -43 -30.5 -73.5t-73.5 -30.5q-59 0 -90 51l-477 817h-142v-764q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM438 1075h502q41 0 72.5 32t31.5 73v106 q0 43 -31.5 74t-72.5 31h-502v-316z" />
|
63
|
+
<glyph unicode="S" d="M231 276q0 43 30 74t73 31t73.5 -31t30.5 -74q0 -29 20.5 -49t49.5 -20h510q27 0 26 26l-765 988q-47 66 -48 143v6q0 92 69 159.5t163 67.5h510q113 0 195.5 -81.5t82.5 -194.5q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5q0 27 -21.5 48.5t-49.5 21.5h-510 q-25 0 -25 -21v-6v-8l762 -979q51 -61 51 -144q-4 -96 -70.5 -164.5t-162.5 -68.5h-510q-113 0 -195 81.5t-82 194.5z" />
|
64
|
+
<glyph unicode="T" d="M231 1321v276h1020v-276q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5v70h-200v-1287q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v1287h-199v-70q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
65
|
+
<glyph unicode="U" d="M231 309v1186q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1186q0 -43 31 -72.5t72 -29.5h399q41 0 72.5 30.5t31.5 71.5v1186q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1186q0 -127 -92 -218t-219 -91h-399q-127 0 -218.5 91t-91.5 218z" />
|
66
|
+
<glyph unicode="V" d="M231 1124v371q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-330l303 -774l303 774v330q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-369l-413 -1060q-27 -66 -97 -66q-72 0 -98 66z" />
|
67
|
+
<glyph unicode="W" d="M231 250v1245q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1190l58 -98h84q4 6 24.5 45t32.5 59v662q0 43 30.5 72.5t73.5 29.5q41 0 72 -29.5t31 -72.5v-662q12 -20 32.5 -59t24.5 -45h84l59 98v1190q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1245l-116 -199 q-31 -51 -91 -51h-200q-66 0 -103 72q-43 -72 -104 -72h-199q-61 0 -92 51z" />
|
68
|
+
<glyph unicode="X" d="M231 104q0 27 13 52l377 643l-377 643q-12 25 -13 53q0 41 30 71.5t73 30.5q59 0 90 -51l317 -540l316 540q31 51 90 51q43 0 73.5 -30.5t30.5 -71.5q0 -25 -14 -53l-377 -643l377 -643q14 -29 14 -52q0 -43 -30.5 -73.5t-73.5 -30.5q-59 0 -90 51l-316 541l-317 -541 q-31 -51 -90 -51q-43 0 -73 30.5t-30 73.5z" />
|
69
|
+
<glyph unicode="Y" d="M231 1284v211q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-139l303 -389l301 389v139q0 41 31 71.5t74 30.5t73.5 -30.5t30.5 -71.5v-211l-407 -520v-660q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v660z" />
|
70
|
+
<glyph unicode="Z" d="M229 131l738 1260h-633q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h917v-131l-737 -1259h633q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-916z" />
|
71
|
+
<glyph unicode="[" d="M231 104v1391q0 41 30 71.5t73 30.5h813q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-406v-1184h406q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5zM436 207h99v1184h-99v-1184z" />
|
72
|
+
<glyph unicode="\" d="M231 1495q0 41 30 71.5t73 30.5q59 0 90 -51l813 -1390q14 -29 14 -52q0 -43 -30.5 -73.5t-73.5 -30.5q-59 0 -90 51l-813 1391q-13 24 -13 53z" />
|
73
|
+
<glyph unicode="]" d="M231 104q0 41 30 72t73 31h405v1184h-405q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h813q43 0 73.5 -30.5t30.5 -71.5v-1391q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5zM946 207h98v1184h-98v-1184z" />
|
74
|
+
<glyph unicode="_" d="M231 -102q0 41 30 71.5t73 30.5h813q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
75
|
+
<glyph unicode="`" d="M332 1495q0 41 30.5 71.5t73.5 30.5h203q53 0 82 -38l416 -537q12 -23 12 -49q0 -43 -31 -74t-74 -31q-33 0 -65 25l-610 522q-37 31 -37 80z" />
|
76
|
+
<glyph unicode="a" d="M231 307v115q0 127 90.5 217t215.5 90h395q49 0 90 -14q0 14 -1 48t-2 49t-4 44t-9.5 42t-17.5 29.5t-28.5 22.5t-41.5 6h-381q-43 0 -73 30t-30 73t30 73.5t73 30.5h381q125 0 214 -87t93 -210l26 -764q0 -43 -31.5 -72.5t-74.5 -29.5q-41 0 -71 30.5t-30 71.5l-151 -88 q-20 -14 -51 -14h-305q-125 0 -215.5 90t-90.5 217zM438 307q0 -41 29 -70.5t70 -29.5h276l219 129v90q0 37 -31.5 66.5t-68.5 29.5h-395q-39 0 -69 -29.5t-30 -70.5v-115z" />
|
77
|
+
<glyph unicode="b" d="M231 104v1391q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-463q139 131 277 131h153q27 0 51.5 -3t49 -14t39 -16.5t39 -25t31.5 -24.5t35 -28.5t30 -25.5q109 -94 108 -233v-422q0 -33 -4 -60.5t-18.5 -54.5t-21.5 -42t-33.5 -42t-31.5 -33t-40 -37l-35 -28 q-84 -74 -199 -74h-153q-59 0 -114.5 22.5t-85.5 46t-77 66.5v-31q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM438 459q0 -47 35 -76l176 -152q24 -24 63 -24h3h153q29 0 51.5 12t53.5 43t35 33q37 29 36 76v422q0 29 -13 49t-45 46.5t-34 29.5q-42 38 -82 38h-2 h-153q-41 0 -66 -24l-176 -152q-35 -23 -35 -75v-246z" />
|
78
|
+
<glyph unicode="c" d="M231 459v246q0 141 107 233q23 18 75 68.5t85.5 78t93 53t123.5 25.5h432q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-432q-41 0 -66 -24l-176 -152q-35 -23 -35 -75v-246q0 -47 35 -78l176 -150q24 -24 63 -24h3h432q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5 t-73.5 -30.5h-432q-117 0 -201 74l-176 151q-107 93 -107 234z" />
|
79
|
+
<glyph unicode="d" d="M231 371v422q0 98 43 158.5t123 125.5q10 8 17 13q83 73 195 73h3h154q33 0 63.5 -7t50 -14t50.5 -27.5t39 -27t39.5 -35t35.5 -30.5v473q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-1391q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5v33q-47 -45 -76.5 -68.5 t-85 -46t-116.5 -22.5h-154q-23 0 -42 2t-38.5 8t-34 11.5t-31.5 15.5t-27.5 16t-28 20.5t-23.5 19.5t-25.5 22.5t-23.5 21.5q-107 89 -107 234zM438 371q0 -25 12.5 -47.5t25.5 -35t38 -31.5t33 -26q30 -24 62 -24h3h154q37 0 65 24l177 152q37 27 36 76v246q0 43 -36 75 l-177 152q-24 24 -62 24h-3h-154q-29 0 -52 -13t-50 -39.5t-35 -33.5q-37 -33 -37 -77v-422z" />
|
80
|
+
<glyph unicode="e" d="M231 371v422q0 72 33 133t59.5 85.5t90.5 78.5q83 73 195 73h3h256q20 0 40 -2t40.5 -8t32.5 -10t32.5 -16.5t28 -16.5t28 -21.5t24.5 -19.5t26 -22l23 -21q109 -94 108 -233v-254q0 -43 -30.5 -74t-73.5 -31h-709v-63q0 -25 12.5 -47.5t25.5 -35t38 -31.5t33 -26 q30 -24 62 -24h3h535q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-535q-23 0 -42 2t-38.5 8t-34 11.5t-31.5 15.5t-27.5 16t-28 20.5t-23.5 19.5t-25.5 22.5t-23.5 21.5q-107 89 -107 234zM438 641h606v152q0 53 -61 108t-115 55h-256q-29 0 -51 -12t-53 -43 t-35 -33q-35 -29 -35 -75v-152z" />
|
81
|
+
<glyph unicode="f" d="M281 1059q0 43 29.5 73.5t72.5 30.5h100v70q0 152 106.5 258t258.5 106h248q43 0 72.5 -30.5t29.5 -71.5q0 -43 -29.5 -73.5t-72.5 -30.5h-248q-66 0 -112 -46.5t-46 -111.5v-70h203q41 0 71.5 -30.5t30.5 -73.5t-30.5 -73t-71.5 -30h-203v-852q0 -43 -29.5 -73.5 t-72.5 -30.5t-74 30.5t-31 73.5v852h-100q-43 0 -72.5 30t-29.5 73z" />
|
82
|
+
<glyph unicode="g" d="M231 459v334q0 23 3.5 45t6.5 38.5t14 37t15 30.5t20.5 29.5t20.5 26t25.5 24.5t25 21.5t27 22.5t25.5 22q83 73 195 73h3h154q33 0 63.5 -7t50 -14t50.5 -27.5t39 -27t39.5 -35t35.5 -30.5v37q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-1122q0 -33 -4 -61 t-18.5 -54.5t-21.5 -42t-33.5 -42t-31.5 -32.5t-40 -37l-35 -28q-84 -74 -199 -74h-432q-43 0 -73.5 29.5t-30.5 72.5t30.5 74t73.5 31h432q29 0 52.5 14t52 41t35.5 33q37 29 36 76v288q-47 -43 -77.5 -67.5t-86 -48t-114.5 -23.5h-154q-31 0 -62.5 7t-50 13.5t-49 28 t-37.5 26.5t-40 36l-35 28q-107 93 -107 234zM436 459q0 -55 60.5 -110.5t115.5 -55.5h154q41 0 65 24l177 152q37 29 36 76v160q0 43 -36 75l-177 152q-24 24 -62 24h-3h-154q-31 0 -54 -14t-48 -38.5t-37 -33.5q-37 -37 -37 -77v-334z" />
|
83
|
+
<glyph unicode="h" d="M231 104v1391q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-506l197 125q78 49 166 49h117q125 0 214 -87t93 -210l24 -762q0 -43 -29.5 -73.5t-72.5 -30.5q-41 0 -72 29.5t-31 70.5l-26 760q-4 39 -32 67.5t-68 28.5h-146l-334 -215v-637q0 -43 -30.5 -73.5 t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
84
|
+
<glyph unicode="i" d="M332 104q0 41 30.5 72t73.5 31h203v749h-203q-43 0 -73.5 30t-30.5 73t30.5 73.5t73.5 30.5h305q41 0 72 -30.5t31 -73.5v-852h200q43 0 74 -31t31 -72q0 -43 -31 -73.5t-74 -30.5h-608q-43 0 -73.5 30.5t-30.5 73.5zM535 1495v86q0 43 30.5 72.5t73.5 29.5h102 q41 0 72 -29.5t31 -72.5v-86q0 -43 -31 -73.5t-72 -30.5h-102q-43 0 -73.5 30.5t-30.5 73.5z" />
|
85
|
+
<glyph unicode="j" d="M332 -158q0 43 30.5 74t73.5 31q41 0 65.5 -28t34 -59.5t35 -59t68.5 -27.5h201q41 0 72.5 29.5t31.5 70.5v1083h-305q-43 0 -73.5 30t-30.5 73t30.5 73.5t73.5 30.5h405q43 0 74 -30.5t31 -73.5v-1186q0 -127 -91 -217t-218 -90h-201q-115 0 -203 75.5t-104 184.5v16z M840 1495v86q0 43 30.5 72.5t73.5 29.5h100q43 0 74 -29.5t31 -72.5v-86q0 -43 -31 -73.5t-74 -30.5h-100q-43 0 -73.5 30.5t-30.5 73.5z" />
|
86
|
+
<glyph unicode="k" d="M231 104v1391q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-817l541 461q28 24 62 24h3q43 0 74 -30.5t31 -73.5q0 -47 -37 -78l-416 -356l518 -443q37 -31 37 -78q0 -43 -29.5 -73.5t-72.5 -30.5q-39 0 -70 25l-542 464l-99 -86v-299q0 -43 -30.5 -73.5t-73.5 -30.5 t-73 30.5t-30 73.5z" />
|
87
|
+
<glyph unicode="l" d="M332 104q0 41 30.5 72t73.5 31h201v1184h-201q-43 0 -73.5 30.5t-30.5 73.5q0 41 30.5 71.5t73.5 30.5h305q41 0 72 -30.5t31 -71.5v-1288h200q43 0 74 -31t31 -72q0 -43 -31 -73.5t-74 -30.5h-608q-43 0 -73.5 30.5t-30.5 73.5z" />
|
88
|
+
<glyph unicode="m" d="M215 104v955q0 43 29.5 73.5t72.5 30.5q33 0 61 -20.5t38 -50.5q83 71 173 71h3q125 0 199 -98l45 37q68 55 153 55q96 0 170 -67.5t76 -163.5l31 -822q0 -43 -30 -73.5t-73 -30.5q-41 0 -71.5 29.5t-32.5 70.5l-29 818q-4 39 -35 38h-12l-139 -118v-734q0 -43 -31 -73.5 t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v807q0 45 -45 45h-17l-153 -133v-719q0 -43 -31 -73.5t-74 -30.5t-72.5 30.5t-29.5 73.5z" />
|
89
|
+
<glyph unicode="n" d="M231 104v955q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-70l197 125q78 49 166 49h117q125 0 214 -87t93 -210l24 -762q0 -43 -29.5 -73.5t-72.5 -30.5q-41 0 -72 29.5t-31 70.5l-26 760q-4 39 -32 67.5t-68 28.5h-146l-334 -215v-637q0 -43 -30.5 -73.5t-73.5 -30.5 t-73 30.5t-30 73.5z" />
|
90
|
+
<glyph unicode="o" d="M231 371v422q0 72 33 133t59.5 85.5t90.5 78.5q83 73 195 73h3h256q27 0 51.5 -3t49 -14t39 -16.5t39 -25t31.5 -24.5t35 -28.5t30 -25.5q109 -94 108 -233v-422q0 -33 -4 -60.5t-18.5 -54.5t-21.5 -42t-33.5 -42t-31.5 -33t-40 -37l-35 -28q-84 -74 -199 -74h-256 q-33 0 -62.5 7t-50 14.5t-48 26t-39 26.5t-39 32.5t-35.5 30.5q-107 89 -107 234zM438 371q0 -25 12.5 -47.5t25.5 -35t38 -31.5t33 -26q30 -24 62 -24h3h256q29 0 51.5 12t53.5 43t35 33q37 29 36 76v422q0 53 -61 108t-115 55h-256q-29 0 -51 -12t-53 -43t-35 -33 q-35 -29 -35 -75v-422z" />
|
91
|
+
<glyph unicode="p" d="M231 -332v1436q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-55q4 4 23.5 24.5t26 25.5t24.5 22.5t28.5 23.5t29 19.5t33.5 18.5t34.5 12t41 9t44.5 2h43q59 0 115.5 -24.5t84 -46t78.5 -68.5q4 -4 53.5 -46t61.5 -57.5t42 -54.5t40 -77.5t10 -86.5v-329 q0 -139 -108 -234l-176 -151q-84 -74 -201 -74h-43q-63 0 -119.5 24.5t-89.5 53t-76 76.5v-443q0 -43 -30.5 -72.5t-73.5 -29.5t-73 29.5t-30 72.5zM438 449q0 -25 10.5 -46.5t20.5 -33t31.5 -29.5t27.5 -25q14 -14 39 -39.5t45.5 -46t38.5 -36.5q29 -29 72 -29h43 q41 0 65 24l179 152q35 27 34 76v329q0 49 -34 76l-179 154q-24 24 -62 24h-3h-43q-43 0 -72 -28l-184 -187q-29 -23 -29 -69v-266z" />
|
92
|
+
<glyph unicode="q" d="M231 371v422q0 98 43 158.5t123 125.5q10 8 17 13q83 73 195 73h3h154q33 0 63.5 -7t50 -14t50.5 -27.5t39 -27t39.5 -35t35.5 -30.5v37q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-1391q0 -43 -30.5 -72.5t-73.5 -29.5t-73 29.5t-30 72.5v469q-47 -45 -76.5 -68.5 t-85 -46t-116.5 -22.5h-154q-23 0 -42 2t-38.5 8t-34 11.5t-31.5 15.5t-27.5 16t-28 20.5t-23.5 19.5t-25.5 22.5t-23.5 21.5q-107 89 -107 234zM438 371q0 -25 12.5 -47.5t25.5 -35t38 -31.5t33 -26q30 -24 62 -24h3h154q37 0 65 24l177 152q37 27 36 76v246q0 43 -36 75 l-177 152q-24 24 -62 24h-3h-154q-29 0 -52 -13t-50 -39.5t-35 -33.5q-37 -33 -37 -77v-422z" />
|
93
|
+
<glyph unicode="r" d="M231 104v955q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-121l244 209q23 16 59 16h203q125 0 216 -91t91 -216v-57q0 -43 -30.5 -73t-73.5 -30t-73 30t-30 73v57q0 41 -29.5 70.5t-70.5 29.5h-166l-340 -292v-560q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z " />
|
94
|
+
<glyph unicode="s" d="M231 190q0 43 29 73t72 30q37 0 75.5 -30t57.5 -36q4 -2 24.5 -11t28.5 -9h416q49 0 76.5 32.5t27.5 77.5q0 70 -59 97l-567 245q-70 31 -113 99.5t-43 148.5q0 104 76 178q78 78 186 78h438q154 0 252 -129q20 -27 21 -61q0 -43 -31 -74t-74 -31q-37 0 -83 44t-85 44 h-438q-27 0 -42 -18t-15 -41q0 -37 33 -49l569 -246q78 -35 132 -113.5t54 -173.5v-4q-2 -129 -94 -220t-221 -91h-387q-150 0 -277 109q-39 32 -39 81z" />
|
95
|
+
<glyph unicode="t" d="M231 1059q0 43 30 73.5t73 30.5h100v244q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-244h403q43 0 73 -30.5t30 -73.5t-30 -73t-73 -30h-403v-649q0 -41 28.5 -70.5t69.5 -29.5h205q41 0 66.5 27.5t35 59.5t35 59.5t66.5 27.5q43 0 73.5 -31t31.5 -74v-16 q-20 -106 -107.5 -183t-200.5 -77h-205q-125 0 -215 91t-90 216v649h-100q-43 0 -73 30t-30 73z" />
|
96
|
+
<glyph unicode="u" d="M231 1059q0 43 30 73.5t73 30.5q41 0 71.5 -29.5t30.5 -70.5l27 -760q4 -41 31.5 -68.5t68.5 -27.5h146l335 213v639q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-955q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5v72l-198 -127q-78 -49 -166 -49h-117 q-123 0 -213 87t-94 208z" />
|
97
|
+
<glyph unicode="v" d="M231 885v174q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-152l301 -694l305 694v152q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-174q0 -20 -10 -41l-342 -783q-27 -61 -94 -61h-129q-68 0 -94 61l-342 783q-9 16 -9 41z" />
|
98
|
+
<glyph unicode="w" d="M209 1057q0 43 30.5 74.5t73.5 31.5q41 0 71 -29.5t32 -70.5l20 -596l66 -221l135 233v234q0 41 30.5 71.5t73.5 30.5q41 0 72 -30.5t31 -71.5v-234l135 -233l65 221l21 596q2 41 31.5 70.5t70.5 29.5t73 -30.5t32 -71.5v-4l-23 -635l-104 -348q-10 -33 -38 -53.5 t-63 -20.5h-100q-59 0 -90 51l-113 195l-114 -195q-31 -51 -90 -51h-101q-35 0 -62.5 20.5t-37.5 53.5l-107 372z" />
|
99
|
+
<glyph unicode="x" d="M231 104q0 39 21 66l354 426l-330 397q-25 31 -24 66q0 43 30.5 73.5t73.5 30.5q47 0 80 -39l305 -366l303 366q33 39 80 39q43 0 74 -30.5t31 -73.5q0 -35 -25 -66l-330 -397l355 -426q23 -29 22 -66q0 -43 -30.5 -73.5t-73.5 -30.5q-49 0 -80 37l-326 395l-327 -395 q-31 -37 -80 -37q-43 0 -73 30.5t-30 73.5z" />
|
100
|
+
<glyph unicode="y" d="M231 -332q0 43 30 74t73 31h211l137 313h-43q-70 0 -94 64l-305 694q-8 16 -9 41v174q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-152l269 -614h65l270 614v152q0 43 31 73.5t74 30.5t73.5 -30.5t30.5 -73.5v-174q0 -20 -10 -41l-532 -1217q-27 -61 -97 -61h-278 q-43 0 -73 29.5t-30 72.5z" />
|
101
|
+
<glyph unicode="z" d="M231 104v86q0 47 31 74l721 692h-600q-43 0 -72.5 30t-29.5 73t29.5 73.5t72.5 30.5h764q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -32 -76l-719 -690h647q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5z" />
|
102
|
+
<glyph unicode="{" d="M231 799q0 43 30 73.5t73 30.5h198q45 0 75 30t30 73v385q0 84 62.5 145t144.5 61h303q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-303v-385q0 -117 -80 -207q80 -90 80 -207v-385h303q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-303 q-82 0 -144.5 61.5t-62.5 145.5v385q0 41 -31 72.5t-74 31.5h-198q-43 0 -73 30t-30 73z" />
|
103
|
+
<glyph unicode="|" d="M637 104v592h207v-592q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5zM637 903v592q0 41 30.5 71.5t73.5 30.5q41 0 72 -30.5t31 -71.5v-592h-207z" />
|
104
|
+
<glyph unicode="}" d="M231 104q0 41 30 72t73 31h303v385q0 117 80 207q-80 90 -80 207v385h-303q-43 0 -73 30.5t-30 73.5q0 41 30 71.5t73 30.5h303q84 0 145.5 -61t61.5 -145v-385q0 -41 29.5 -72t72.5 -31h201q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-201q-43 0 -72.5 -31.5 t-29.5 -72.5v-385q0 -84 -61.5 -145.5t-145.5 -61.5h-303q-43 0 -73 30.5t-30 73.5z" />
|
105
|
+
<glyph unicode=" " />
|
106
|
+
<glyph unicode="£" d="M231 104q0 41 30 72t73 31h127l141 489h-268q-43 0 -73 30t-30 73t30 73.5t73 30.5h330l137 471q27 92 108.5 157.5t188.5 65.5h49q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-49q-35 0 -61.5 -21.5t-37.5 -52.5l-120 -414h268q43 0 73.5 -30.5 t30.5 -73.5t-30.5 -73t-73.5 -30h-328l-143 -489h471q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-813q-43 0 -73 30.5t-30 73.5z" />
|
107
|
+
<glyph unicode="¥" d="M231 625q0 43 30 73.5t73 30.5h303v43l-393 670q-12 25 -13 53q0 41 30 71.5t73 30.5q59 0 90 -51l317 -542l316 542q31 51 90 51q43 0 73.5 -30.5t30.5 -71.5q0 -25 -14 -53l-393 -670v-43h303q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-303v-418 q0 -43 -31 -73.5t-72 -30.5q-43 0 -73.5 30.5t-30.5 73.5v418h-303q-43 0 -73 30t-30 73z" />
|
108
|
+
<glyph unicode="­" d="M231 713v86q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
109
|
+
<glyph unicode="Ä" d="M231 104q0 18 7 37l405 1043q27 66 96 65q72 0 99 -65l405 -1043q8 -25 8 -37q0 -43 -30.5 -73.5t-73.5 -30.5q-72 0 -96 66l-76 194h-469l-76 -194q-25 -66 -96 -66q-43 0 -73 30.5t-30 73.5zM231 1321v174q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-174 q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM586 467h307l-154 395zM1044 1321v174q0 41 30 71.5t73 30.5t73.5 -30.5t30.5 -71.5v-174q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5z" />
|
110
|
+
<glyph unicode="Å" d="M223 106l279 941q-72 14 -121 71.5t-49 130.5v142q0 84 61.5 145t145.5 61h403q82 0 144.5 -61t62.5 -145v-142q0 -74 -49 -131t-121 -71l276 -943q0 -43 -31.5 -73.5t-74.5 -30.5q-35 0 -62.5 20.5t-37.5 53.5l-80 274h-455l-82 -274q-10 -33 -37.5 -53.5t-62.5 -20.5 q-43 0 -76 31.5t-33 74.5zM539 1249h403v142h-403v-142zM575 555h332l-143 487h-45z" />
|
111
|
+
<glyph unicode="Æ" d="M231 104q0 16 7 35l514 1409q31 49 90 49h305q43 0 73.5 -30.5t30.5 -71.5q0 -43 -30.5 -73.5t-73.5 -30.5h-201v-488h201q43 0 73.5 -30.5t30.5 -73.5t-30.5 -73t-73.5 -30h-201v-489h201q43 0 73.5 -31t30.5 -72q0 -43 -30.5 -73.5t-73.5 -30.5h-305q-43 0 -73 30.5 t-30 73.5v244h-207l-102 -280q-25 -68 -96 -68q-43 0 -73 30.5t-30 73.5zM608 555h131v358z" />
|
112
|
+
<glyph unicode="Ñ" d="M231 104v869q0 43 30 72.5t73 29.5q47 0 76 -33l634 -677v608q0 43 30 72.5t73 29.5t73.5 -29.5t30.5 -72.5v-869q0 -43 -30.5 -73.5t-73.5 -30.5q-47 0 -76 33l-633 678v-607q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM231 1407v88q0 41 28 71.5t67 30.5h8 l715 -75q8 33 35.5 54t62.5 21q43 0 73.5 -30.5t30.5 -71.5v-88q0 -43 -28.5 -73.5t-69.5 -30.5h-6l-713 75q-10 -33 -37.5 -54t-62.5 -21q-43 0 -73 30.5t-30 73.5z" />
|
113
|
+
<glyph unicode="Ö" d="M231 573v103q0 66 39 125q182 258 238 340q72 109 211 108h43q45 0 82 -11t67.5 -40t47 -47t45 -61t38.5 -58l168 -231q41 -59 41 -125v-103q0 -66 -41 -124l-108 -156q-10 -14 -46 -72.5t-56.5 -84t-58.5 -64.5t-82 -55.5t-97 -16.5h-43q-37 0 -71 10t-55.5 21.5t-49 39 t-37.5 41t-37 50.5t-33 45v10l-166 232q-39 56 -39 124zM231 1321v174q0 41 30 71.5t73 30.5t72.5 -30.5t29.5 -71.5v-174q0 -43 -29.5 -73.5t-72.5 -30.5t-73 30.5t-30 73.5zM436 567l242 -338q10 -23 41 -22h43q27 0 41 22l241 342v105l-241 346q-16 20 -41 20h-43 q-25 0 -41 -20l-242 -346v-109zM1042 1321v174q0 41 31 71.5t74 30.5t73.5 -30.5t30.5 -71.5v-174q0 -43 -30.5 -73.5t-73.5 -30.5t-74 30.5t-31 73.5z" />
|
114
|
+
<glyph unicode="Ø" d="M231 104q0 27 13 52l135 231q-12 25 -46 89.5t-51.5 100t-34 98t-16.5 124.5q0 109 50 211l219 440q33 63 97.5 105t141.5 42q86 0 152.5 -47t97.5 -118q6 8 26.5 48t34 59.5t40 38.5t57.5 19q43 0 73.5 -30.5t30.5 -71.5q0 -25 -14 -53l-135 -232q10 -23 46 -88 t53.5 -102t33.5 -99.5t16 -121.5q0 -104 -51 -211l-219 -441q-33 -63 -97.5 -105t-144.5 -42q-84 0 -150.5 47t-96.5 119q-6 -8 -27 -48t-34 -59.5t-39.5 -39t-57.5 -19.5q-43 0 -73 30.5t-30 73.5zM438 799q0 -25 3 -46.5t12.5 -45t14.5 -34.5t19.5 -38t16.5 -33l360 615 l-69 137q-16 37 -56 37q-35 0 -53 -37l-221 -436q-27 -58 -27 -119zM616 381l70 -139q16 -35 53 -35q39 0 56 35l221 438q29 70 28 119q0 18 -3 38.5t-7 35t-13 35t-13 29.5t-16.5 31.5t-14.5 26.5z" />
|
115
|
+
<glyph unicode="Ü" d="M231 311v836q0 43 30 72.5t73 29.5t73.5 -29.5t30.5 -72.5v-836q0 -43 31 -73.5t72 -30.5h399q41 0 72.5 30.5t31.5 73.5v836q0 43 30 72.5t73 29.5t73.5 -29.5t30.5 -72.5v-836q0 -127 -92 -219t-219 -92h-399q-129 0 -219.5 91t-90.5 220zM434 1321v174q0 41 30 71.5 t73 30.5t73.5 -30.5t30.5 -71.5v-174q0 -43 -30.5 -73.5t-73.5 -30.5t-73 30.5t-30 73.5zM840 1321v174q0 41 30.5 71.5t73.5 30.5t71.5 -29.5t28.5 -72.5v-174q0 -43 -28.5 -73.5t-71.5 -30.5t-73.5 30.5t-30.5 73.5z" />
|
116
|
+
<glyph unicode="ˆ" d="M229 389l420 805q27 55 92 55q61 0 90 -55l410 -786q10 -25 10 -43q0 -43 -30.5 -74t-73.5 -31q-55 0 -84 43l-322 483l-323 -483q-29 -43 -84 -43q-43 0 -73 31t-30 74z" />
|
117
|
+
<glyph unicode="˜" d="M231 1059v227q0 133 95.5 221t218.5 88q119 0 209 -90t90 -219v-106q0 -41 29.5 -73t70.5 -32t70.5 32t29.5 73v227q0 43 30 73.5t73 30.5t73.5 -30.5t30.5 -73.5v-227q0 -133 -94 -220.5t-219 -87.5q-123 0 -211 89q-90 94 -90 219v106q0 41 -29.5 72t-70.5 31t-70 -31 t-29 -72v-227q0 -43 -30.5 -73t-73.5 -30t-73 30t-30 73z" />
|
118
|
+
<glyph unicode=" " horiz-adv-x="841" />
|
119
|
+
<glyph unicode=" " horiz-adv-x="1683" />
|
120
|
+
<glyph unicode=" " horiz-adv-x="841" />
|
121
|
+
<glyph unicode=" " horiz-adv-x="1683" />
|
122
|
+
<glyph unicode=" " horiz-adv-x="561" />
|
123
|
+
<glyph unicode=" " horiz-adv-x="420" />
|
124
|
+
<glyph unicode=" " horiz-adv-x="280" />
|
125
|
+
<glyph unicode=" " horiz-adv-x="280" />
|
126
|
+
<glyph unicode=" " horiz-adv-x="210" />
|
127
|
+
<glyph unicode=" " horiz-adv-x="336" />
|
128
|
+
<glyph unicode=" " horiz-adv-x="93" />
|
129
|
+
<glyph unicode="‐" d="M231 713v86q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
130
|
+
<glyph unicode="‑" d="M231 713v86q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
131
|
+
<glyph unicode="‒" d="M231 713v86q0 43 30 73.5t73 30.5h813q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-813q-43 0 -73 31t-30 74z" />
|
132
|
+
<glyph unicode="–" horiz-adv-x="1484" d="M231 713v86q0 43 30 73.5t73 30.5h817q43 0 73.5 -30.5t30.5 -73.5v-86q0 -43 -30.5 -74t-73.5 -31h-817q-43 0 -73 31t-30 74z" />
|
133
|
+
<glyph unicode="—" horiz-adv-x="2508" d="M231 713v86q0 43 60 73.5t147 30.5h1632q87 0 148 -30.5t61 -73.5v-86q0 -43 -61 -74t-148 -31h-1632q-87 0 -147 31t-60 74z" />
|
134
|
+
<glyph unicode=" " horiz-adv-x="336" />
|
135
|
+
<glyph unicode=" " horiz-adv-x="420" />
|
136
|
+
<glyph unicode="" horiz-adv-x="1167" d="M0 0v1167h1167v-1167h-1167z" />
|
137
|
+
</font>
|
138
|
+
</defs></svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,1432 @@
|
|
1
|
+
// Generated by CoffeeScript 1.3.3
|
2
|
+
|
3
|
+
/*
|
4
|
+
"Skeuocard" -- A Skeuomorphic Credit-Card Input Enhancement
|
5
|
+
@description Skeuocard is a skeuomorphic credit card input plugin, supporting
|
6
|
+
progressive enhancement. It renders a credit-card input which
|
7
|
+
behaves similarly to a physical credit card.
|
8
|
+
@author Ken Keiter <ken@kenkeiter.com>
|
9
|
+
@updated 2013-07-25
|
10
|
+
@website http://kenkeiter.com/
|
11
|
+
@exports [window.Skeuocard]
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
(function() {
|
16
|
+
var CCIssuers, CCProducts, Skeuocard,
|
17
|
+
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
18
|
+
__slice = [].slice,
|
19
|
+
__hasProp = {}.hasOwnProperty,
|
20
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
21
|
+
|
22
|
+
Skeuocard = (function() {
|
23
|
+
|
24
|
+
function Skeuocard(el, opts) {
|
25
|
+
var optDefaults;
|
26
|
+
if (opts == null) {
|
27
|
+
opts = {};
|
28
|
+
}
|
29
|
+
this.el = {
|
30
|
+
container: $(el),
|
31
|
+
underlyingFields: {}
|
32
|
+
};
|
33
|
+
this._inputViews = {};
|
34
|
+
this._tabViews = {};
|
35
|
+
this.product = void 0;
|
36
|
+
this.productShortname = void 0;
|
37
|
+
this.issuerShortname = void 0;
|
38
|
+
this._cardProductNeedsLayout = true;
|
39
|
+
this.acceptedCardProducts = {};
|
40
|
+
this.visibleFace = 'front';
|
41
|
+
this._initialValidationState = {};
|
42
|
+
this._validationState = {
|
43
|
+
number: false,
|
44
|
+
exp: false,
|
45
|
+
name: false,
|
46
|
+
cvc: false
|
47
|
+
};
|
48
|
+
this._faceFillState = {
|
49
|
+
front: false,
|
50
|
+
back: false
|
51
|
+
};
|
52
|
+
optDefaults = {
|
53
|
+
debug: false,
|
54
|
+
acceptedCardProducts: [],
|
55
|
+
cardNumberPlaceholderChar: 'X',
|
56
|
+
genericPlaceholder: "XXXX XXXX XXXX XXXX",
|
57
|
+
typeInputSelector: '[name="cc_type"]',
|
58
|
+
numberInputSelector: '[name="cc_number"]',
|
59
|
+
expInputSelector: '[name="cc_exp"]',
|
60
|
+
nameInputSelector: '[name="cc_name"]',
|
61
|
+
cvcInputSelector: '[name="cc_cvc"]',
|
62
|
+
currentDate: new Date(),
|
63
|
+
initialValues: {},
|
64
|
+
validationState: {},
|
65
|
+
strings: {
|
66
|
+
hiddenFaceFillPrompt: "Click here to<br /> fill in the other side.",
|
67
|
+
hiddenFaceErrorWarning: "There's a problem on the other side.",
|
68
|
+
hiddenFaceSwitchPrompt: "Back to the other side..."
|
69
|
+
}
|
70
|
+
};
|
71
|
+
this.options = $.extend(optDefaults, opts);
|
72
|
+
this._conformDOM();
|
73
|
+
this._setAcceptedCardProducts();
|
74
|
+
this._createInputs();
|
75
|
+
this._updateProductIfNeeded();
|
76
|
+
this._flipToInvalidSide();
|
77
|
+
}
|
78
|
+
|
79
|
+
Skeuocard.prototype._conformDOM = function() {
|
80
|
+
var el, fieldName, fieldValue, _ref, _ref1, _ref2,
|
81
|
+
_this = this;
|
82
|
+
this.el.container.removeClass('no-js');
|
83
|
+
this.el.container.addClass("skeuocard js");
|
84
|
+
this.el.container.find("> :not(input,select,textarea)").remove();
|
85
|
+
this.el.container.find("> input,select,textarea").hide();
|
86
|
+
this.el.underlyingFields = {
|
87
|
+
type: this.el.container.find(this.options.typeInputSelector),
|
88
|
+
number: this.el.container.find(this.options.numberInputSelector),
|
89
|
+
exp: this.el.container.find(this.options.expInputSelector),
|
90
|
+
name: this.el.container.find(this.options.nameInputSelector),
|
91
|
+
cvc: this.el.container.find(this.options.cvcInputSelector)
|
92
|
+
};
|
93
|
+
_ref = this.options.initialValues;
|
94
|
+
for (fieldName in _ref) {
|
95
|
+
fieldValue = _ref[fieldName];
|
96
|
+
this.el.underlyingFields[fieldName].val(fieldValue);
|
97
|
+
}
|
98
|
+
_ref1 = this.el.underlyingFields;
|
99
|
+
for (fieldName in _ref1) {
|
100
|
+
el = _ref1[fieldName];
|
101
|
+
this.options.initialValues[fieldName] = el.val();
|
102
|
+
}
|
103
|
+
_ref2 = this.el.underlyingFields;
|
104
|
+
for (fieldName in _ref2) {
|
105
|
+
el = _ref2[fieldName];
|
106
|
+
if (this.options.validationState[fieldName] === false || el.hasClass('invalid')) {
|
107
|
+
this._initialValidationState[fieldName] = false;
|
108
|
+
if (!el.hasClass('invalid')) {
|
109
|
+
el.addClass('invalid');
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
this.el.underlyingFields.number.bind("change", function(e) {
|
114
|
+
_this._inputViews.number.setValue(_this._getUnderlyingValue('number'));
|
115
|
+
return _this.render();
|
116
|
+
});
|
117
|
+
this.el.underlyingFields.exp.bind("change", function(e) {
|
118
|
+
_this._inputViews.exp.setValue(_this._getUnderlyingValue('exp'));
|
119
|
+
return _this.render();
|
120
|
+
});
|
121
|
+
this.el.underlyingFields.name.bind("change", function(e) {
|
122
|
+
_this._inputViews.exp.setValue(_this._getUnderlyingValue('name'));
|
123
|
+
return _this.render();
|
124
|
+
});
|
125
|
+
this.el.underlyingFields.cvc.bind("change", function(e) {
|
126
|
+
_this._inputViews.exp.setValue(_this._getUnderlyingValue('cvc'));
|
127
|
+
return _this.render();
|
128
|
+
});
|
129
|
+
this.el.surfaceFront = $("<div>").attr({
|
130
|
+
"class": "face front"
|
131
|
+
});
|
132
|
+
this.el.surfaceBack = $("<div>").attr({
|
133
|
+
"class": "face back"
|
134
|
+
});
|
135
|
+
this.el.cardBody = $("<div>").attr({
|
136
|
+
"class": "card-body"
|
137
|
+
});
|
138
|
+
this.el.surfaceFront.appendTo(this.el.cardBody);
|
139
|
+
this.el.surfaceBack.appendTo(this.el.cardBody);
|
140
|
+
this.el.cardBody.appendTo(this.el.container);
|
141
|
+
this._tabViews.front = new this.FlipTabView('front');
|
142
|
+
this._tabViews.back = new this.FlipTabView('back');
|
143
|
+
this.el.surfaceFront.prepend(this._tabViews.front.el);
|
144
|
+
this.el.surfaceBack.prepend(this._tabViews.back.el);
|
145
|
+
this._tabViews.front.hide();
|
146
|
+
this._tabViews.back.hide();
|
147
|
+
this._tabViews.front.el.click(function() {
|
148
|
+
return _this.flip();
|
149
|
+
});
|
150
|
+
this._tabViews.back.el.click(function() {
|
151
|
+
return _this.flip();
|
152
|
+
});
|
153
|
+
return this.el.container;
|
154
|
+
};
|
155
|
+
|
156
|
+
Skeuocard.prototype._setAcceptedCardProducts = function() {
|
157
|
+
var matcher, product, _ref,
|
158
|
+
_this = this;
|
159
|
+
if (this.options.acceptedCardProducts.length === 0) {
|
160
|
+
this.el.underlyingFields.type.find('option').each(function(i, _el) {
|
161
|
+
var cardProductShortname, el;
|
162
|
+
el = $(_el);
|
163
|
+
cardProductShortname = el.attr('data-card-product-shortname') || el.attr('value');
|
164
|
+
return _this.options.acceptedCardProducts.push(cardProductShortname);
|
165
|
+
});
|
166
|
+
}
|
167
|
+
for (matcher in CCProducts) {
|
168
|
+
product = CCProducts[matcher];
|
169
|
+
if (_ref = product.companyShortname, __indexOf.call(this.options.acceptedCardProducts, _ref) >= 0) {
|
170
|
+
this.acceptedCardProducts[matcher] = product;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
return this.acceptedCardProducts;
|
174
|
+
};
|
175
|
+
|
176
|
+
Skeuocard.prototype._updateProductIfNeeded = function() {
|
177
|
+
var matchedIssuerIdentifier, matchedProduct, matchedProductIdentifier, number;
|
178
|
+
number = this._getUnderlyingValue('number');
|
179
|
+
matchedProduct = this.getProductForNumber(number);
|
180
|
+
matchedProductIdentifier = (matchedProduct != null ? matchedProduct.companyShortname : void 0) || '';
|
181
|
+
matchedIssuerIdentifier = (matchedProduct != null ? matchedProduct.issuerShortname : void 0) || '';
|
182
|
+
if ((this.productShortname !== matchedProductIdentifier) || (this.issuerShortname !== matchedIssuerIdentifier)) {
|
183
|
+
this.productShortname = matchedProductIdentifier;
|
184
|
+
this.issuerShortname = matchedIssuerIdentifier;
|
185
|
+
this.product = matchedProduct;
|
186
|
+
this._cardProductNeedsLayout = true;
|
187
|
+
this.trigger('productWillChange.skeuocard', [this, this.productShortname, matchedProductIdentifier]);
|
188
|
+
this._log("Triggering render because product changed.");
|
189
|
+
this.render();
|
190
|
+
return this.trigger('productDidChange.skeuocard', [this, this.productShortname, matchedProductIdentifier]);
|
191
|
+
}
|
192
|
+
};
|
193
|
+
|
194
|
+
Skeuocard.prototype._createInputs = function() {
|
195
|
+
var _this = this;
|
196
|
+
this._inputViews.number = new this.SegmentedCardNumberInputView();
|
197
|
+
this._inputViews.exp = new this.ExpirationInputView({
|
198
|
+
currentDate: this.options.currentDate
|
199
|
+
});
|
200
|
+
this._inputViews.name = new this.TextInputView({
|
201
|
+
"class": "cc-name",
|
202
|
+
placeholder: "YOUR NAME"
|
203
|
+
});
|
204
|
+
this._inputViews.cvc = new this.TextInputView({
|
205
|
+
"class": "cc-cvc",
|
206
|
+
placeholder: "XXX",
|
207
|
+
requireMaxLength: true
|
208
|
+
});
|
209
|
+
this._inputViews.number.el.addClass('cc-number');
|
210
|
+
this._inputViews.number.el.appendTo(this.el.surfaceFront);
|
211
|
+
this._inputViews.name.el.appendTo(this.el.surfaceFront);
|
212
|
+
this._inputViews.exp.el.addClass('cc-exp');
|
213
|
+
this._inputViews.exp.el.appendTo(this.el.surfaceFront);
|
214
|
+
this._inputViews.cvc.el.appendTo(this.el.surfaceBack);
|
215
|
+
this._inputViews.number.bind("keyup", function(e, input) {
|
216
|
+
_this._setUnderlyingValue('number', input.value);
|
217
|
+
_this._updateValidationStateForInputView('number');
|
218
|
+
return _this._updateProductIfNeeded();
|
219
|
+
});
|
220
|
+
this._inputViews.exp.bind("keyup", function(e, input) {
|
221
|
+
_this._setUnderlyingValue('exp', input.value);
|
222
|
+
return _this._updateValidationStateForInputView('exp');
|
223
|
+
});
|
224
|
+
this._inputViews.name.bind("keyup", function(e) {
|
225
|
+
_this._setUnderlyingValue('name', $(e.target).val());
|
226
|
+
return _this._updateValidationStateForInputView('name');
|
227
|
+
});
|
228
|
+
this._inputViews.cvc.bind("keyup", function(e) {
|
229
|
+
_this._setUnderlyingValue('cvc', $(e.target).val());
|
230
|
+
return _this._updateValidationStateForInputView('cvc');
|
231
|
+
});
|
232
|
+
this._inputViews.number.setValue(this._getUnderlyingValue('number'));
|
233
|
+
this._inputViews.exp.setValue(this._getUnderlyingValue('exp'));
|
234
|
+
this._inputViews.name.el.val(this._getUnderlyingValue('name'));
|
235
|
+
return this._inputViews.cvc.el.val(this._getUnderlyingValue('cvc'));
|
236
|
+
};
|
237
|
+
|
238
|
+
Skeuocard.prototype._log = function() {
|
239
|
+
var msg;
|
240
|
+
msg = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
241
|
+
if ((typeof console !== "undefined" && console !== null ? console.log : void 0) && !!this.options.debug) {
|
242
|
+
if (this.options.debug != null) {
|
243
|
+
return console.log.apply(console, ["[skeuocard]"].concat(__slice.call(msg)));
|
244
|
+
}
|
245
|
+
}
|
246
|
+
};
|
247
|
+
|
248
|
+
Skeuocard.prototype._flipToInvalidSide = function() {
|
249
|
+
var fieldName, state, _errorCounts, _oppositeFace, _ref, _ref1;
|
250
|
+
if (Object.keys(this._initialValidationState).length > 0) {
|
251
|
+
_oppositeFace = this.visibleFace === 'front' ? 'back' : 'front';
|
252
|
+
_errorCounts = {
|
253
|
+
front: 0,
|
254
|
+
back: 0
|
255
|
+
};
|
256
|
+
_ref = this._initialValidationState;
|
257
|
+
for (fieldName in _ref) {
|
258
|
+
state = _ref[fieldName];
|
259
|
+
_errorCounts[(_ref1 = this.product) != null ? _ref1.layout[fieldName] : void 0]++;
|
260
|
+
}
|
261
|
+
if (_errorCounts[this.visibleFace] === 0 && _errorCounts[_oppositeFace] > 0) {
|
262
|
+
return this.flip();
|
263
|
+
}
|
264
|
+
}
|
265
|
+
};
|
266
|
+
|
267
|
+
Skeuocard.prototype.render = function() {
|
268
|
+
var container, el, fieldName, inputEl, sel, surfaceName, _hiddenFaceFilled, _hiddenFaceValid, _oppositeFace, _ref, _visibleFaceFilled, _visibleFaceValid,
|
269
|
+
_this = this;
|
270
|
+
this._log("*** start rendering ***");
|
271
|
+
if (this._cardProductNeedsLayout === true) {
|
272
|
+
if (this.product !== void 0) {
|
273
|
+
this._log("[render]", "Activating product", this.product);
|
274
|
+
this.el.container.removeClass(function(index, css) {
|
275
|
+
return (css.match(/\b(product|issuer)-\S+/g) || []).join(' ');
|
276
|
+
});
|
277
|
+
this.el.container.addClass("product-" + this.product.companyShortname);
|
278
|
+
if (this.product.issuerShortname != null) {
|
279
|
+
this.el.container.addClass("issuer-" + this.product.issuerShortname);
|
280
|
+
}
|
281
|
+
this._setUnderlyingCardType(this.product.companyShortname);
|
282
|
+
this._inputViews.number.reconfigure({
|
283
|
+
groupings: this.product.cardNumberGrouping,
|
284
|
+
placeholderChar: this.options.cardNumberPlaceholderChar
|
285
|
+
});
|
286
|
+
this._inputViews.exp.show();
|
287
|
+
this._inputViews.name.show();
|
288
|
+
this._inputViews.exp.reconfigure({
|
289
|
+
pattern: this.product.expirationFormat
|
290
|
+
});
|
291
|
+
this._inputViews.cvc.show();
|
292
|
+
this._inputViews.cvc.attr({
|
293
|
+
maxlength: this.product.cvcLength,
|
294
|
+
placeholder: new Array(this.product.cvcLength + 1).join(this.options.cardNumberPlaceholderChar)
|
295
|
+
});
|
296
|
+
_ref = this.product.layout;
|
297
|
+
for (fieldName in _ref) {
|
298
|
+
surfaceName = _ref[fieldName];
|
299
|
+
sel = surfaceName === 'front' ? 'surfaceFront' : 'surfaceBack';
|
300
|
+
container = this.el[sel];
|
301
|
+
inputEl = this._inputViews[fieldName].el;
|
302
|
+
if (!(container.has(inputEl).length > 0)) {
|
303
|
+
this._log("Moving", inputEl, "=>", container);
|
304
|
+
el = this._inputViews[fieldName].el.detach();
|
305
|
+
$(el).appendTo(this.el[sel]);
|
306
|
+
}
|
307
|
+
}
|
308
|
+
} else {
|
309
|
+
this._log("[render]", "Becoming generic.");
|
310
|
+
this._inputViews.exp.clear();
|
311
|
+
this._inputViews.cvc.clear();
|
312
|
+
this._inputViews.exp.hide();
|
313
|
+
this._inputViews.name.hide();
|
314
|
+
this._inputViews.cvc.hide();
|
315
|
+
this._inputViews.number.reconfigure({
|
316
|
+
groupings: [this.options.genericPlaceholder.length],
|
317
|
+
placeholder: this.options.genericPlaceholder
|
318
|
+
});
|
319
|
+
this.el.container.removeClass(function(index, css) {
|
320
|
+
return (css.match(/\bproduct-\S+/g) || []).join(' ');
|
321
|
+
});
|
322
|
+
this.el.container.removeClass(function(index, css) {
|
323
|
+
return (css.match(/\bissuer-\S+/g) || []).join(' ');
|
324
|
+
});
|
325
|
+
}
|
326
|
+
this._cardProductNeedsLayout = false;
|
327
|
+
}
|
328
|
+
this._log("Validation state:", this._validationState);
|
329
|
+
this.showInitialValidationErrors();
|
330
|
+
_oppositeFace = this.visibleFace === 'front' ? 'back' : 'front';
|
331
|
+
_visibleFaceFilled = this._faceFillState[this.visibleFace];
|
332
|
+
_visibleFaceValid = this.isFaceValid(this.visibleFace);
|
333
|
+
_hiddenFaceFilled = this._faceFillState[_oppositeFace];
|
334
|
+
_hiddenFaceValid = this.isFaceValid(_oppositeFace);
|
335
|
+
if (_visibleFaceFilled && !_visibleFaceValid) {
|
336
|
+
this._log("Visible face is filled, but invalid; showing validation errors.");
|
337
|
+
this.showValidationErrors();
|
338
|
+
} else if (!_visibleFaceFilled) {
|
339
|
+
this._log("Visible face hasn't been filled; hiding validation errors.");
|
340
|
+
this.hideValidationErrors();
|
341
|
+
} else {
|
342
|
+
this._log("Visible face has been filled, and is valid.");
|
343
|
+
this.hideValidationErrors();
|
344
|
+
}
|
345
|
+
if (this.visibleFace === 'front' && this.fieldsForFace('back').length > 0) {
|
346
|
+
if (_visibleFaceFilled && _visibleFaceValid && !_hiddenFaceFilled) {
|
347
|
+
this._tabViews.front.prompt(this.options.strings.hiddenFaceFillPrompt, true);
|
348
|
+
} else if (_hiddenFaceFilled && !_hiddenFaceValid) {
|
349
|
+
this._tabViews.front.warn(this.options.strings.hiddenFaceErrorWarning, true);
|
350
|
+
} else if (_hiddenFaceFilled && _hiddenFaceValid) {
|
351
|
+
this._tabViews.front.prompt(this.options.strings.hiddenFaceSwitchPrompt, true);
|
352
|
+
} else {
|
353
|
+
this._tabViews.front.hide();
|
354
|
+
}
|
355
|
+
} else {
|
356
|
+
if (_hiddenFaceValid) {
|
357
|
+
this._tabViews.back.prompt(this.options.strings.hiddenFaceSwitchPrompt, true);
|
358
|
+
} else {
|
359
|
+
this._tabViews.back.warn(this.options.strings.hiddenFaceErrorWarning, true);
|
360
|
+
}
|
361
|
+
}
|
362
|
+
if (!this.isValid()) {
|
363
|
+
this.el.container.removeClass('valid');
|
364
|
+
this.el.container.addClass('invalid');
|
365
|
+
} else {
|
366
|
+
this.el.container.addClass('valid');
|
367
|
+
this.el.container.removeClass('invalid');
|
368
|
+
}
|
369
|
+
return this._log("*** rendering complete ***");
|
370
|
+
};
|
371
|
+
|
372
|
+
Skeuocard.prototype.showInitialValidationErrors = function() {
|
373
|
+
var fieldName, state, _ref, _results;
|
374
|
+
_ref = this._initialValidationState;
|
375
|
+
_results = [];
|
376
|
+
for (fieldName in _ref) {
|
377
|
+
state = _ref[fieldName];
|
378
|
+
if (state === false && this._validationState[fieldName] === false) {
|
379
|
+
_results.push(this._inputViews[fieldName].addClass('invalid'));
|
380
|
+
} else {
|
381
|
+
_results.push(this._inputViews[fieldName].removeClass('invalid'));
|
382
|
+
}
|
383
|
+
}
|
384
|
+
return _results;
|
385
|
+
};
|
386
|
+
|
387
|
+
Skeuocard.prototype.showValidationErrors = function() {
|
388
|
+
var fieldName, state, _ref, _results;
|
389
|
+
_ref = this._validationState;
|
390
|
+
_results = [];
|
391
|
+
for (fieldName in _ref) {
|
392
|
+
state = _ref[fieldName];
|
393
|
+
if (state === true) {
|
394
|
+
_results.push(this._inputViews[fieldName].removeClass('invalid'));
|
395
|
+
} else {
|
396
|
+
_results.push(this._inputViews[fieldName].addClass('invalid'));
|
397
|
+
}
|
398
|
+
}
|
399
|
+
return _results;
|
400
|
+
};
|
401
|
+
|
402
|
+
Skeuocard.prototype.hideValidationErrors = function() {
|
403
|
+
var fieldName, state, _ref, _results;
|
404
|
+
_ref = this._validationState;
|
405
|
+
_results = [];
|
406
|
+
for (fieldName in _ref) {
|
407
|
+
state = _ref[fieldName];
|
408
|
+
if ((this._initialValidationState[fieldName] === false && state === true) || (!(this._initialValidationState[fieldName] != null))) {
|
409
|
+
_results.push(this._inputViews[fieldName].el.removeClass('invalid'));
|
410
|
+
} else {
|
411
|
+
_results.push(void 0);
|
412
|
+
}
|
413
|
+
}
|
414
|
+
return _results;
|
415
|
+
};
|
416
|
+
|
417
|
+
Skeuocard.prototype.setFieldValidationState = function(fieldName, valid) {
|
418
|
+
if (valid) {
|
419
|
+
this.el.underlyingFields[fieldName].removeClass('invalid');
|
420
|
+
} else {
|
421
|
+
this.el.underlyingFields[fieldName].addClass('invalid');
|
422
|
+
}
|
423
|
+
return this._validationState[fieldName] = valid;
|
424
|
+
};
|
425
|
+
|
426
|
+
Skeuocard.prototype.isFaceFilled = function(faceName) {
|
427
|
+
var fields, filled, name;
|
428
|
+
fields = this.fieldsForFace(faceName);
|
429
|
+
filled = (function() {
|
430
|
+
var _i, _len, _results;
|
431
|
+
_results = [];
|
432
|
+
for (_i = 0, _len = fields.length; _i < _len; _i++) {
|
433
|
+
name = fields[_i];
|
434
|
+
if (this._inputViews[name].isFilled()) {
|
435
|
+
_results.push(name);
|
436
|
+
}
|
437
|
+
}
|
438
|
+
return _results;
|
439
|
+
}).call(this);
|
440
|
+
if (fields.length > 0) {
|
441
|
+
return filled.length === fields.length;
|
442
|
+
} else {
|
443
|
+
return false;
|
444
|
+
}
|
445
|
+
};
|
446
|
+
|
447
|
+
Skeuocard.prototype.fieldsForFace = function(faceName) {
|
448
|
+
var face, fn, _ref;
|
449
|
+
if ((_ref = this.product) != null ? _ref.layout : void 0) {
|
450
|
+
return (function() {
|
451
|
+
var _ref1, _results;
|
452
|
+
_ref1 = this.product.layout;
|
453
|
+
_results = [];
|
454
|
+
for (fn in _ref1) {
|
455
|
+
face = _ref1[fn];
|
456
|
+
if (face === faceName) {
|
457
|
+
_results.push(fn);
|
458
|
+
}
|
459
|
+
}
|
460
|
+
return _results;
|
461
|
+
}).call(this);
|
462
|
+
}
|
463
|
+
return [];
|
464
|
+
};
|
465
|
+
|
466
|
+
Skeuocard.prototype._updateValidationStateForInputView = function(fieldName) {
|
467
|
+
var field, fieldValid;
|
468
|
+
field = this._inputViews[fieldName];
|
469
|
+
fieldValid = field.isValid() && !(this._initialValidationState[fieldName] === false && field.getValue() === this.options.initialValues[fieldName]);
|
470
|
+
if (fieldValid !== this._validationState[fieldName]) {
|
471
|
+
this.setFieldValidationState(fieldName, fieldValid);
|
472
|
+
this._faceFillState.front = this.isFaceFilled('front');
|
473
|
+
this._faceFillState.back = this.isFaceFilled('back');
|
474
|
+
this.trigger('validationStateDidChange.skeuocard', [this, this._validationState]);
|
475
|
+
this._log("Change in validation for " + fieldName + " triggers re-render.");
|
476
|
+
return this.render();
|
477
|
+
}
|
478
|
+
};
|
479
|
+
|
480
|
+
Skeuocard.prototype.isFaceValid = function(faceName) {
|
481
|
+
var fieldName, valid, _i, _len, _ref;
|
482
|
+
valid = true;
|
483
|
+
_ref = this.fieldsForFace(faceName);
|
484
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
485
|
+
fieldName = _ref[_i];
|
486
|
+
valid &= this._validationState[fieldName];
|
487
|
+
}
|
488
|
+
return !!valid;
|
489
|
+
};
|
490
|
+
|
491
|
+
Skeuocard.prototype.isValid = function() {
|
492
|
+
return this._validationState.number && this._validationState.exp && this._validationState.name && this._validationState.cvc;
|
493
|
+
};
|
494
|
+
|
495
|
+
Skeuocard.prototype._getUnderlyingValue = function(field) {
|
496
|
+
return this.el.underlyingFields[field].val();
|
497
|
+
};
|
498
|
+
|
499
|
+
Skeuocard.prototype._setUnderlyingValue = function(field, newValue) {
|
500
|
+
this.trigger('change.skeuocard', [this]);
|
501
|
+
return this.el.underlyingFields[field].val(newValue);
|
502
|
+
};
|
503
|
+
|
504
|
+
Skeuocard.prototype.flip = function() {
|
505
|
+
var targetFace;
|
506
|
+
targetFace = this.visibleFace === 'front' ? 'back' : 'front';
|
507
|
+
this.trigger('faceWillBecomeVisible.skeuocard', [this, targetFace]);
|
508
|
+
this.visibleFace = targetFace;
|
509
|
+
this.render();
|
510
|
+
this.el.cardBody.toggleClass('flip');
|
511
|
+
return this.trigger('faceDidBecomeVisible.skeuocard', [this, targetFace]);
|
512
|
+
};
|
513
|
+
|
514
|
+
Skeuocard.prototype.getProductForNumber = function(num) {
|
515
|
+
var d, issuer, m, matcher, parts, _ref;
|
516
|
+
_ref = this.acceptedCardProducts;
|
517
|
+
for (m in _ref) {
|
518
|
+
d = _ref[m];
|
519
|
+
parts = m.split('/');
|
520
|
+
matcher = new RegExp(parts[1], parts[2]);
|
521
|
+
if (matcher.test(num)) {
|
522
|
+
issuer = this.getIssuerForNumber(num) || {};
|
523
|
+
return $.extend({}, d, issuer);
|
524
|
+
}
|
525
|
+
}
|
526
|
+
return void 0;
|
527
|
+
};
|
528
|
+
|
529
|
+
Skeuocard.prototype.getIssuerForNumber = function(num) {
|
530
|
+
var d, m, matcher, parts;
|
531
|
+
for (m in CCIssuers) {
|
532
|
+
d = CCIssuers[m];
|
533
|
+
parts = m.split('/');
|
534
|
+
matcher = new RegExp(parts[1], parts[2]);
|
535
|
+
if (matcher.test(num)) {
|
536
|
+
return d;
|
537
|
+
}
|
538
|
+
}
|
539
|
+
return void 0;
|
540
|
+
};
|
541
|
+
|
542
|
+
Skeuocard.prototype._setUnderlyingCardType = function(shortname) {
|
543
|
+
var _this = this;
|
544
|
+
return this.el.underlyingFields.type.find('option').each(function(i, _el) {
|
545
|
+
var el;
|
546
|
+
el = $(_el);
|
547
|
+
if (shortname === (el.attr('data-card-product-shortname') || el.attr('value'))) {
|
548
|
+
return el.val(el.attr('value'));
|
549
|
+
}
|
550
|
+
});
|
551
|
+
};
|
552
|
+
|
553
|
+
Skeuocard.prototype.trigger = function() {
|
554
|
+
var args, _ref;
|
555
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
556
|
+
return (_ref = this.el.container).trigger.apply(_ref, args);
|
557
|
+
};
|
558
|
+
|
559
|
+
Skeuocard.prototype.bind = function() {
|
560
|
+
var args, _ref;
|
561
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
562
|
+
return (_ref = this.el.container).trigger.apply(_ref, args);
|
563
|
+
};
|
564
|
+
|
565
|
+
return Skeuocard;
|
566
|
+
|
567
|
+
})();
|
568
|
+
|
569
|
+
/*
|
570
|
+
Skeuocard::FlipTabView
|
571
|
+
Handles rendering of the "flip button" control and its various warning and
|
572
|
+
prompt states.
|
573
|
+
*/
|
574
|
+
|
575
|
+
|
576
|
+
Skeuocard.prototype.FlipTabView = (function() {
|
577
|
+
|
578
|
+
function FlipTabView(face, opts) {
|
579
|
+
if (opts == null) {
|
580
|
+
opts = {};
|
581
|
+
}
|
582
|
+
this.el = $("<div class=\"flip-tab " + face + "\"><p></p></div>");
|
583
|
+
this.options = opts;
|
584
|
+
}
|
585
|
+
|
586
|
+
FlipTabView.prototype._setText = function(text) {
|
587
|
+
return this.el.find('p').html(text);
|
588
|
+
};
|
589
|
+
|
590
|
+
FlipTabView.prototype.warn = function(message, withAnimation) {
|
591
|
+
if (withAnimation == null) {
|
592
|
+
withAnimation = false;
|
593
|
+
}
|
594
|
+
this._resetClasses();
|
595
|
+
this.el.addClass('warn');
|
596
|
+
this._setText(message);
|
597
|
+
this.show();
|
598
|
+
if (withAnimation) {
|
599
|
+
this.el.removeClass('warn-anim');
|
600
|
+
return this.el.addClass('warn-anim');
|
601
|
+
}
|
602
|
+
};
|
603
|
+
|
604
|
+
FlipTabView.prototype.prompt = function(message, withAnimation) {
|
605
|
+
if (withAnimation == null) {
|
606
|
+
withAnimation = false;
|
607
|
+
}
|
608
|
+
this._resetClasses();
|
609
|
+
this.el.addClass('prompt');
|
610
|
+
this._setText(message);
|
611
|
+
this.show();
|
612
|
+
if (withAnimation) {
|
613
|
+
this.el.removeClass('valid-anim');
|
614
|
+
return this.el.addClass('valid-anim');
|
615
|
+
}
|
616
|
+
};
|
617
|
+
|
618
|
+
FlipTabView.prototype._resetClasses = function() {
|
619
|
+
this.el.removeClass('valid-anim');
|
620
|
+
this.el.removeClass('warn-anim');
|
621
|
+
this.el.removeClass('warn');
|
622
|
+
return this.el.removeClass('prompt');
|
623
|
+
};
|
624
|
+
|
625
|
+
FlipTabView.prototype.show = function() {
|
626
|
+
return this.el.show();
|
627
|
+
};
|
628
|
+
|
629
|
+
FlipTabView.prototype.hide = function() {
|
630
|
+
return this.el.hide();
|
631
|
+
};
|
632
|
+
|
633
|
+
return FlipTabView;
|
634
|
+
|
635
|
+
})();
|
636
|
+
|
637
|
+
/*
|
638
|
+
Skeuocard::TextInputView
|
639
|
+
*/
|
640
|
+
|
641
|
+
|
642
|
+
Skeuocard.prototype.TextInputView = (function() {
|
643
|
+
|
644
|
+
function TextInputView() {}
|
645
|
+
|
646
|
+
TextInputView.prototype.bind = function() {
|
647
|
+
var args, _ref;
|
648
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
649
|
+
return (_ref = this.el).bind.apply(_ref, args);
|
650
|
+
};
|
651
|
+
|
652
|
+
TextInputView.prototype.trigger = function() {
|
653
|
+
var args, _ref;
|
654
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
655
|
+
return (_ref = this.el).trigger.apply(_ref, args);
|
656
|
+
};
|
657
|
+
|
658
|
+
TextInputView.prototype._getFieldCaretPosition = function(el) {
|
659
|
+
var input, sel, selLength;
|
660
|
+
input = el.get(0);
|
661
|
+
if (input.selectionEnd != null) {
|
662
|
+
return input.selectionEnd;
|
663
|
+
} else if (document.selection) {
|
664
|
+
input.focus();
|
665
|
+
sel = document.selection.createRange();
|
666
|
+
selLength = document.selection.createRange().text.length;
|
667
|
+
sel.moveStart('character', -input.value.length);
|
668
|
+
return selLength;
|
669
|
+
}
|
670
|
+
};
|
671
|
+
|
672
|
+
TextInputView.prototype._setFieldCaretPosition = function(el, pos) {
|
673
|
+
var input, range;
|
674
|
+
input = el.get(0);
|
675
|
+
if (input.createTextRange != null) {
|
676
|
+
range = input.createTextRange();
|
677
|
+
range.move("character", pos);
|
678
|
+
return range.select();
|
679
|
+
} else if (input.selectionStart != null) {
|
680
|
+
input.focus();
|
681
|
+
return input.setSelectionRange(pos, pos);
|
682
|
+
}
|
683
|
+
};
|
684
|
+
|
685
|
+
TextInputView.prototype.show = function() {
|
686
|
+
return this.el.show();
|
687
|
+
};
|
688
|
+
|
689
|
+
TextInputView.prototype.hide = function() {
|
690
|
+
return this.el.hide();
|
691
|
+
};
|
692
|
+
|
693
|
+
TextInputView.prototype.addClass = function() {
|
694
|
+
var args, _ref;
|
695
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
696
|
+
return (_ref = this.el).addClass.apply(_ref, args);
|
697
|
+
};
|
698
|
+
|
699
|
+
TextInputView.prototype.removeClass = function() {
|
700
|
+
var args, _ref;
|
701
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
702
|
+
return (_ref = this.el).removeClass.apply(_ref, args);
|
703
|
+
};
|
704
|
+
|
705
|
+
TextInputView.prototype._zeroPadNumber = function(num, places) {
|
706
|
+
var zero;
|
707
|
+
zero = places - num.toString().length + 1;
|
708
|
+
return Array(zero).join("0") + num;
|
709
|
+
};
|
710
|
+
|
711
|
+
return TextInputView;
|
712
|
+
|
713
|
+
})();
|
714
|
+
|
715
|
+
Skeuocard.prototype.SegmentedCardNumberInputView = (function(_super) {
|
716
|
+
|
717
|
+
__extends(SegmentedCardNumberInputView, _super);
|
718
|
+
|
719
|
+
function SegmentedCardNumberInputView(opts) {
|
720
|
+
var _this = this;
|
721
|
+
if (opts == null) {
|
722
|
+
opts = {};
|
723
|
+
}
|
724
|
+
opts.value || (opts.value = "");
|
725
|
+
opts.groupings || (opts.groupings = [19]);
|
726
|
+
opts.placeholderChar || (opts.placeholderChar = "X");
|
727
|
+
this.options = opts;
|
728
|
+
this.value = this.options.value;
|
729
|
+
this.el = $("<fieldset>");
|
730
|
+
this.el.delegate("input", "keydown", function(e) {
|
731
|
+
return _this._onGroupKeyDown(e);
|
732
|
+
});
|
733
|
+
this.el.delegate("input", "keyup", function(e) {
|
734
|
+
return _this._onGroupKeyUp(e);
|
735
|
+
});
|
736
|
+
this.groupEls = $();
|
737
|
+
}
|
738
|
+
|
739
|
+
SegmentedCardNumberInputView.prototype._onGroupKeyDown = function(e) {
|
740
|
+
var arrowKeys, groupCaretPos, groupEl, groupMaxLength, _ref;
|
741
|
+
e.stopPropagation();
|
742
|
+
groupEl = $(e.currentTarget);
|
743
|
+
arrowKeys = [37, 38, 39, 40];
|
744
|
+
groupEl = $(e.currentTarget);
|
745
|
+
groupMaxLength = parseInt(groupEl.attr('maxlength'));
|
746
|
+
groupCaretPos = this._getFieldCaretPosition(groupEl);
|
747
|
+
if (e.which === 8 && groupCaretPos === 0 && !$.isEmptyObject(groupEl.prev())) {
|
748
|
+
groupEl.prev().focus();
|
749
|
+
}
|
750
|
+
if (_ref = e.which, __indexOf.call(arrowKeys, _ref) >= 0) {
|
751
|
+
switch (e.which) {
|
752
|
+
case 37:
|
753
|
+
if (groupCaretPos === 0 && !$.isEmptyObject(groupEl.prev())) {
|
754
|
+
return groupEl.prev().focus();
|
755
|
+
}
|
756
|
+
break;
|
757
|
+
case 39:
|
758
|
+
if (groupCaretPos === groupMaxLength && !$.isEmptyObject(groupEl.next())) {
|
759
|
+
return groupEl.next().focus();
|
760
|
+
}
|
761
|
+
break;
|
762
|
+
case 38:
|
763
|
+
if (!$.isEmptyObject(groupEl.prev())) {
|
764
|
+
return groupEl.prev().focus();
|
765
|
+
}
|
766
|
+
break;
|
767
|
+
case 40:
|
768
|
+
if (!$.isEmptyObject(groupEl.next())) {
|
769
|
+
return groupEl.next().focus();
|
770
|
+
}
|
771
|
+
}
|
772
|
+
}
|
773
|
+
};
|
774
|
+
|
775
|
+
SegmentedCardNumberInputView.prototype._onGroupKeyUp = function(e) {
|
776
|
+
var groupCaretPos, groupEl, groupMaxLength, groupValLength, newValue, pattern, specialKeys, _ref, _ref1;
|
777
|
+
e.stopPropagation();
|
778
|
+
specialKeys = [8, 9, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 91, 93, 144, 145, 224];
|
779
|
+
groupEl = $(e.currentTarget);
|
780
|
+
groupMaxLength = parseInt(groupEl.attr('maxlength'));
|
781
|
+
groupCaretPos = this._getFieldCaretPosition(groupEl);
|
782
|
+
if (_ref = e.which, __indexOf.call(specialKeys, _ref) < 0) {
|
783
|
+
groupValLength = groupEl.val().length;
|
784
|
+
pattern = new RegExp('[^0-9]+', 'g');
|
785
|
+
groupEl.val(groupEl.val().replace(pattern, ''));
|
786
|
+
if (groupEl.val().length < groupValLength) {
|
787
|
+
this._setFieldCaretPosition(groupEl, groupCaretPos - 1);
|
788
|
+
} else {
|
789
|
+
this._setFieldCaretPosition(groupEl, groupCaretPos);
|
790
|
+
}
|
791
|
+
}
|
792
|
+
if ((_ref1 = e.which, __indexOf.call(specialKeys, _ref1) < 0) && groupEl.val().length === groupMaxLength && !$.isEmptyObject(groupEl.next()) && this._getFieldCaretPosition(groupEl) === groupMaxLength) {
|
793
|
+
groupEl.next().focus();
|
794
|
+
}
|
795
|
+
newValue = "";
|
796
|
+
this.groupEls.each(function() {
|
797
|
+
return newValue += $(this).val();
|
798
|
+
});
|
799
|
+
this.value = newValue;
|
800
|
+
this.trigger("keyup", [this]);
|
801
|
+
return false;
|
802
|
+
};
|
803
|
+
|
804
|
+
SegmentedCardNumberInputView.prototype.setGroupings = function(groupings) {
|
805
|
+
var caretPos, groupEl, groupLength, _i, _len, _startLength;
|
806
|
+
caretPos = this._caretPosition();
|
807
|
+
this.el.empty();
|
808
|
+
_startLength = 0;
|
809
|
+
for (_i = 0, _len = groupings.length; _i < _len; _i++) {
|
810
|
+
groupLength = groupings[_i];
|
811
|
+
groupEl = $("<input>").attr({
|
812
|
+
type: 'text',
|
813
|
+
size: groupLength,
|
814
|
+
maxlength: groupLength,
|
815
|
+
"class": "group" + groupLength
|
816
|
+
});
|
817
|
+
if (this.value.length > _startLength) {
|
818
|
+
groupEl.val(this.value.substr(_startLength, groupLength));
|
819
|
+
_startLength += groupLength;
|
820
|
+
}
|
821
|
+
this.el.append(groupEl);
|
822
|
+
}
|
823
|
+
this.options.groupings = groupings;
|
824
|
+
this.groupEls = this.el.find("input");
|
825
|
+
this._caretTo(caretPos);
|
826
|
+
if (this.options.placeholderChar !== void 0) {
|
827
|
+
this.setPlaceholderChar(this.options.placeholderChar);
|
828
|
+
}
|
829
|
+
if (this.options.placeholder !== void 0) {
|
830
|
+
return this.setPlaceholder(this.options.placeholder);
|
831
|
+
}
|
832
|
+
};
|
833
|
+
|
834
|
+
SegmentedCardNumberInputView.prototype.setPlaceholderChar = function(ch) {
|
835
|
+
this.groupEls.each(function() {
|
836
|
+
var el;
|
837
|
+
el = $(this);
|
838
|
+
return el.attr('placeholder', new Array(parseInt(el.attr('maxlength')) + 1).join(ch));
|
839
|
+
});
|
840
|
+
this.options.placeholder = void 0;
|
841
|
+
return this.options.placeholderChar = ch;
|
842
|
+
};
|
843
|
+
|
844
|
+
SegmentedCardNumberInputView.prototype.setPlaceholder = function(str) {
|
845
|
+
this.groupEls.each(function() {
|
846
|
+
return $(this).attr('placeholder', str);
|
847
|
+
});
|
848
|
+
this.options.placeholderChar = void 0;
|
849
|
+
return this.options.placeholder = str;
|
850
|
+
};
|
851
|
+
|
852
|
+
SegmentedCardNumberInputView.prototype.setValue = function(newValue) {
|
853
|
+
var lastPos;
|
854
|
+
lastPos = 0;
|
855
|
+
this.groupEls.each(function() {
|
856
|
+
var el, len;
|
857
|
+
el = $(this);
|
858
|
+
len = parseInt(el.attr('maxlength'));
|
859
|
+
el.val(newValue.substr(lastPos, len));
|
860
|
+
return lastPos += len;
|
861
|
+
});
|
862
|
+
return this.value = newValue;
|
863
|
+
};
|
864
|
+
|
865
|
+
SegmentedCardNumberInputView.prototype.getValue = function() {
|
866
|
+
return this.value;
|
867
|
+
};
|
868
|
+
|
869
|
+
SegmentedCardNumberInputView.prototype.reconfigure = function(changes) {
|
870
|
+
if (changes == null) {
|
871
|
+
changes = {};
|
872
|
+
}
|
873
|
+
if (changes.groupings != null) {
|
874
|
+
this.setGroupings(changes.groupings);
|
875
|
+
}
|
876
|
+
if (changes.placeholderChar != null) {
|
877
|
+
this.setPlaceholderChar(changes.placeholderChar);
|
878
|
+
}
|
879
|
+
if (changes.placeholder != null) {
|
880
|
+
this.setPlaceholder(changes.placeholder);
|
881
|
+
}
|
882
|
+
if (changes.value != null) {
|
883
|
+
return this.setValue(changes.value);
|
884
|
+
}
|
885
|
+
};
|
886
|
+
|
887
|
+
SegmentedCardNumberInputView.prototype._caretTo = function(index) {
|
888
|
+
var inputEl, inputElIndex, pos,
|
889
|
+
_this = this;
|
890
|
+
pos = 0;
|
891
|
+
inputEl = void 0;
|
892
|
+
inputElIndex = 0;
|
893
|
+
this.groupEls.each(function(i, e) {
|
894
|
+
var el, elLength;
|
895
|
+
el = $(e);
|
896
|
+
elLength = parseInt(el.attr('maxlength'));
|
897
|
+
if (index <= elLength + pos && index >= pos) {
|
898
|
+
inputEl = el;
|
899
|
+
inputElIndex = index - pos;
|
900
|
+
}
|
901
|
+
return pos += elLength;
|
902
|
+
});
|
903
|
+
return this._setFieldCaretPosition(inputEl, inputElIndex);
|
904
|
+
};
|
905
|
+
|
906
|
+
SegmentedCardNumberInputView.prototype._caretPosition = function() {
|
907
|
+
var finalPos, iPos,
|
908
|
+
_this = this;
|
909
|
+
iPos = 0;
|
910
|
+
finalPos = 0;
|
911
|
+
this.groupEls.each(function(i, e) {
|
912
|
+
var el;
|
913
|
+
el = $(e);
|
914
|
+
if (el.is(':focus')) {
|
915
|
+
finalPos = iPos + _this._getFieldCaretPosition(el);
|
916
|
+
}
|
917
|
+
return iPos += parseInt(el.attr('maxlength'));
|
918
|
+
});
|
919
|
+
return finalPos;
|
920
|
+
};
|
921
|
+
|
922
|
+
SegmentedCardNumberInputView.prototype.maxLength = function() {
|
923
|
+
return this.options.groupings.reduce(function(a, b) {
|
924
|
+
return a + b;
|
925
|
+
});
|
926
|
+
};
|
927
|
+
|
928
|
+
SegmentedCardNumberInputView.prototype.isFilled = function() {
|
929
|
+
return this.value.length === this.maxLength();
|
930
|
+
};
|
931
|
+
|
932
|
+
SegmentedCardNumberInputView.prototype.isValid = function() {
|
933
|
+
return this.isFilled() && this.isValidLuhn(this.value);
|
934
|
+
};
|
935
|
+
|
936
|
+
SegmentedCardNumberInputView.prototype.isValidLuhn = function(identifier) {
|
937
|
+
var alt, i, num, sum, _i, _ref;
|
938
|
+
sum = 0;
|
939
|
+
alt = false;
|
940
|
+
for (i = _i = _ref = identifier.length - 1; _i >= 0; i = _i += -1) {
|
941
|
+
num = parseInt(identifier.charAt(i), 10);
|
942
|
+
if (isNaN(num)) {
|
943
|
+
return false;
|
944
|
+
}
|
945
|
+
if (alt) {
|
946
|
+
num *= 2;
|
947
|
+
if (num > 9) {
|
948
|
+
num = (num % 10) + 1;
|
949
|
+
}
|
950
|
+
}
|
951
|
+
alt = !alt;
|
952
|
+
sum += num;
|
953
|
+
}
|
954
|
+
return sum % 10 === 0;
|
955
|
+
};
|
956
|
+
|
957
|
+
return SegmentedCardNumberInputView;
|
958
|
+
|
959
|
+
})(Skeuocard.prototype.TextInputView);
|
960
|
+
|
961
|
+
/*
|
962
|
+
Skeuocard::ExpirationInputView
|
963
|
+
*/
|
964
|
+
|
965
|
+
|
966
|
+
Skeuocard.prototype.ExpirationInputView = (function(_super) {
|
967
|
+
|
968
|
+
__extends(ExpirationInputView, _super);
|
969
|
+
|
970
|
+
function ExpirationInputView(opts) {
|
971
|
+
var _this = this;
|
972
|
+
if (opts == null) {
|
973
|
+
opts = {};
|
974
|
+
}
|
975
|
+
opts.dateFormatter || (opts.dateFormatter = function(date) {
|
976
|
+
return date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
|
977
|
+
});
|
978
|
+
opts.dateParser || (opts.dateParser = function(value) {
|
979
|
+
var dateParts;
|
980
|
+
dateParts = value.split('-');
|
981
|
+
return new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
982
|
+
});
|
983
|
+
opts.currentDate || (opts.currentDate = new Date());
|
984
|
+
opts.pattern || (opts.pattern = "MM/YY");
|
985
|
+
this.options = opts;
|
986
|
+
this.date = void 0;
|
987
|
+
this.value = void 0;
|
988
|
+
this.el = $("<fieldset>");
|
989
|
+
this.el.delegate("input", "keydown", function(e) {
|
990
|
+
return _this._onKeyDown(e);
|
991
|
+
});
|
992
|
+
this.el.delegate("input", "keyup", function(e) {
|
993
|
+
return _this._onKeyUp(e);
|
994
|
+
});
|
995
|
+
}
|
996
|
+
|
997
|
+
ExpirationInputView.prototype._getFieldCaretPosition = function(el) {
|
998
|
+
var input, sel, selLength;
|
999
|
+
input = el.get(0);
|
1000
|
+
if (input.selectionEnd != null) {
|
1001
|
+
return input.selectionEnd;
|
1002
|
+
} else if (document.selection) {
|
1003
|
+
input.focus();
|
1004
|
+
sel = document.selection.createRange();
|
1005
|
+
selLength = document.selection.createRange().text.length;
|
1006
|
+
sel.moveStart('character', -input.value.length);
|
1007
|
+
return selLength;
|
1008
|
+
}
|
1009
|
+
};
|
1010
|
+
|
1011
|
+
ExpirationInputView.prototype._setFieldCaretPosition = function(el, pos) {
|
1012
|
+
var input, range;
|
1013
|
+
input = el.get(0);
|
1014
|
+
if (input.createTextRange != null) {
|
1015
|
+
range = input.createTextRange();
|
1016
|
+
range.move("character", pos);
|
1017
|
+
return range.select();
|
1018
|
+
} else if (input.selectionStart != null) {
|
1019
|
+
input.focus();
|
1020
|
+
return input.setSelectionRange(pos, pos);
|
1021
|
+
}
|
1022
|
+
};
|
1023
|
+
|
1024
|
+
ExpirationInputView.prototype.setPattern = function(pattern) {
|
1025
|
+
var char, groupings, i, patternParts, _currentLength, _i, _len;
|
1026
|
+
groupings = [];
|
1027
|
+
patternParts = pattern.split('');
|
1028
|
+
_currentLength = 0;
|
1029
|
+
for (i = _i = 0, _len = patternParts.length; _i < _len; i = ++_i) {
|
1030
|
+
char = patternParts[i];
|
1031
|
+
_currentLength++;
|
1032
|
+
if (patternParts[i + 1] !== char) {
|
1033
|
+
groupings.push([_currentLength, char]);
|
1034
|
+
_currentLength = 0;
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
this.options.groupings = groupings;
|
1038
|
+
return this._setGroupings(this.options.groupings);
|
1039
|
+
};
|
1040
|
+
|
1041
|
+
ExpirationInputView.prototype._setGroupings = function(groupings) {
|
1042
|
+
var fieldChars, group, groupChar, groupLength, input, sep, _i, _len, _startLength;
|
1043
|
+
fieldChars = ['D', 'M', 'Y'];
|
1044
|
+
this.el.empty();
|
1045
|
+
_startLength = 0;
|
1046
|
+
for (_i = 0, _len = groupings.length; _i < _len; _i++) {
|
1047
|
+
group = groupings[_i];
|
1048
|
+
groupLength = group[0];
|
1049
|
+
groupChar = group[1];
|
1050
|
+
if (__indexOf.call(fieldChars, groupChar) >= 0) {
|
1051
|
+
input = $('<input>').attr({
|
1052
|
+
type: 'text',
|
1053
|
+
placeholder: new Array(groupLength + 1).join(groupChar),
|
1054
|
+
maxlength: groupLength,
|
1055
|
+
"class": 'cc-exp-field-' + groupChar.toLowerCase() + ' group' + groupLength
|
1056
|
+
});
|
1057
|
+
input.data('fieldtype', groupChar);
|
1058
|
+
this.el.append(input);
|
1059
|
+
} else {
|
1060
|
+
sep = $('<span>').attr({
|
1061
|
+
"class": 'separator'
|
1062
|
+
});
|
1063
|
+
sep.html(new Array(groupLength + 1).join(groupChar));
|
1064
|
+
this.el.append(sep);
|
1065
|
+
}
|
1066
|
+
}
|
1067
|
+
this.groupEls = this.el.find('input');
|
1068
|
+
if (this.date != null) {
|
1069
|
+
return this._updateFieldValues();
|
1070
|
+
}
|
1071
|
+
};
|
1072
|
+
|
1073
|
+
ExpirationInputView.prototype._updateFieldValues = function() {
|
1074
|
+
var currentDate,
|
1075
|
+
_this = this;
|
1076
|
+
currentDate = this.date;
|
1077
|
+
if (!this.groupEls) {
|
1078
|
+
return this.setPattern(this.options.pattern);
|
1079
|
+
}
|
1080
|
+
return this.groupEls.each(function(i, _el) {
|
1081
|
+
var el, groupLength, year;
|
1082
|
+
el = $(_el);
|
1083
|
+
groupLength = parseInt(el.attr('maxlength'));
|
1084
|
+
switch (el.data('fieldtype')) {
|
1085
|
+
case 'M':
|
1086
|
+
return el.val(_this._zeroPadNumber(currentDate.getMonth() + 1, groupLength));
|
1087
|
+
case 'D':
|
1088
|
+
return el.val(_this._zeroPadNumber(currentDate.getDate(), groupLength));
|
1089
|
+
case 'Y':
|
1090
|
+
year = groupLength >= 4 ? currentDate.getFullYear() : currentDate.getFullYear().toString().substr(2, 4);
|
1091
|
+
return el.val(year);
|
1092
|
+
}
|
1093
|
+
});
|
1094
|
+
};
|
1095
|
+
|
1096
|
+
ExpirationInputView.prototype.clear = function() {
|
1097
|
+
this.value = "";
|
1098
|
+
this.date = null;
|
1099
|
+
return this.groupEls.each(function() {
|
1100
|
+
return $(this).val('');
|
1101
|
+
});
|
1102
|
+
};
|
1103
|
+
|
1104
|
+
ExpirationInputView.prototype.setDate = function(newDate) {
|
1105
|
+
this.date = newDate;
|
1106
|
+
this.value = this.options.dateFormatter(newDate);
|
1107
|
+
return this._updateFieldValues();
|
1108
|
+
};
|
1109
|
+
|
1110
|
+
ExpirationInputView.prototype.setValue = function(newValue) {
|
1111
|
+
this.value = newValue;
|
1112
|
+
this.date = this.options.dateParser(newValue);
|
1113
|
+
return this._updateFieldValues();
|
1114
|
+
};
|
1115
|
+
|
1116
|
+
ExpirationInputView.prototype.getDate = function() {
|
1117
|
+
return this.date;
|
1118
|
+
};
|
1119
|
+
|
1120
|
+
ExpirationInputView.prototype.getValue = function() {
|
1121
|
+
return this.value;
|
1122
|
+
};
|
1123
|
+
|
1124
|
+
ExpirationInputView.prototype.reconfigure = function(opts) {
|
1125
|
+
if (opts.pattern != null) {
|
1126
|
+
this.setPattern(opts.pattern);
|
1127
|
+
}
|
1128
|
+
if (opts.value != null) {
|
1129
|
+
return this.setValue(opts.value);
|
1130
|
+
}
|
1131
|
+
};
|
1132
|
+
|
1133
|
+
ExpirationInputView.prototype._onKeyDown = function(e) {
|
1134
|
+
var groupCaretPos, groupEl, groupMaxLength, nextInputEl, prevInputEl, _ref;
|
1135
|
+
e.stopPropagation();
|
1136
|
+
groupEl = $(e.currentTarget);
|
1137
|
+
groupEl = $(e.currentTarget);
|
1138
|
+
groupMaxLength = parseInt(groupEl.attr('maxlength'));
|
1139
|
+
groupCaretPos = this._getFieldCaretPosition(groupEl);
|
1140
|
+
prevInputEl = groupEl.prevAll('input').first();
|
1141
|
+
nextInputEl = groupEl.nextAll('input').first();
|
1142
|
+
if (e.which === 8 && groupCaretPos === 0 && !$.isEmptyObject(prevInputEl)) {
|
1143
|
+
prevInputEl.focus();
|
1144
|
+
}
|
1145
|
+
if ((_ref = e.which) === 37 || _ref === 38 || _ref === 39 || _ref === 40) {
|
1146
|
+
switch (e.which) {
|
1147
|
+
case 37:
|
1148
|
+
if (groupCaretPos === 0 && !$.isEmptyObject(prevInputEl)) {
|
1149
|
+
return prevInputEl.focus();
|
1150
|
+
}
|
1151
|
+
break;
|
1152
|
+
case 39:
|
1153
|
+
if (groupCaretPos === groupMaxLength && !$.isEmptyObject(nextInputEl)) {
|
1154
|
+
return nextInputEl.focus();
|
1155
|
+
}
|
1156
|
+
break;
|
1157
|
+
case 38:
|
1158
|
+
if (!$.isEmptyObject(groupEl.prev('input'))) {
|
1159
|
+
return prevInputEl.focus();
|
1160
|
+
}
|
1161
|
+
break;
|
1162
|
+
case 40:
|
1163
|
+
if (!$.isEmptyObject(groupEl.next('input'))) {
|
1164
|
+
return nextInputEl.focus();
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
}
|
1168
|
+
};
|
1169
|
+
|
1170
|
+
ExpirationInputView.prototype._onKeyUp = function(e) {
|
1171
|
+
var arrowKeys, dateObj, day, groupCaretPos, groupEl, groupMaxLength, groupValLength, month, nextInputEl, pattern, specialKeys, year, _ref, _ref1;
|
1172
|
+
e.stopPropagation();
|
1173
|
+
specialKeys = [8, 9, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 91, 93, 144, 145, 224];
|
1174
|
+
arrowKeys = [37, 38, 39, 40];
|
1175
|
+
groupEl = $(e.currentTarget);
|
1176
|
+
groupMaxLength = parseInt(groupEl.attr('maxlength'));
|
1177
|
+
groupCaretPos = this._getFieldCaretPosition(groupEl);
|
1178
|
+
if (_ref = e.which, __indexOf.call(specialKeys, _ref) < 0) {
|
1179
|
+
groupValLength = groupEl.val().length;
|
1180
|
+
pattern = new RegExp('[^0-9]+', 'g');
|
1181
|
+
groupEl.val(groupEl.val().replace(pattern, ''));
|
1182
|
+
if (groupEl.val().length < groupValLength) {
|
1183
|
+
this._setFieldCaretPosition(groupEl, groupCaretPos - 1);
|
1184
|
+
} else {
|
1185
|
+
this._setFieldCaretPosition(groupEl, groupCaretPos);
|
1186
|
+
}
|
1187
|
+
}
|
1188
|
+
nextInputEl = groupEl.nextAll('input').first();
|
1189
|
+
if ((_ref1 = e.which, __indexOf.call(specialKeys, _ref1) < 0) && groupEl.val().length === groupMaxLength && !$.isEmptyObject(nextInputEl) && this._getFieldCaretPosition(groupEl) === groupMaxLength) {
|
1190
|
+
nextInputEl.focus();
|
1191
|
+
}
|
1192
|
+
day = parseInt(this.el.find('.cc-exp-field-d').val()) || 1;
|
1193
|
+
month = parseInt(this.el.find('.cc-exp-field-m').val());
|
1194
|
+
year = parseInt(this.el.find('.cc-exp-field-y').val());
|
1195
|
+
if (month === 0 || year === 0) {
|
1196
|
+
this.value = "";
|
1197
|
+
this.date = null;
|
1198
|
+
} else {
|
1199
|
+
if (year < 2000) {
|
1200
|
+
year += 2000;
|
1201
|
+
}
|
1202
|
+
dateObj = new Date(year, month - 1, day);
|
1203
|
+
this.value = this.options.dateFormatter(dateObj);
|
1204
|
+
this.date = dateObj;
|
1205
|
+
}
|
1206
|
+
this.trigger("keyup", [this]);
|
1207
|
+
return false;
|
1208
|
+
};
|
1209
|
+
|
1210
|
+
ExpirationInputView.prototype._inputGroupEls = function() {
|
1211
|
+
return this.el.find("input");
|
1212
|
+
};
|
1213
|
+
|
1214
|
+
ExpirationInputView.prototype.isFilled = function() {
|
1215
|
+
var el, inputEl, _i, _len, _ref;
|
1216
|
+
_ref = this.groupEls;
|
1217
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1218
|
+
inputEl = _ref[_i];
|
1219
|
+
el = $(inputEl);
|
1220
|
+
if (el.val().length !== parseInt(el.attr('maxlength'))) {
|
1221
|
+
return false;
|
1222
|
+
}
|
1223
|
+
}
|
1224
|
+
return true;
|
1225
|
+
};
|
1226
|
+
|
1227
|
+
ExpirationInputView.prototype.isValid = function() {
|
1228
|
+
return this.isFilled() && ((this.date.getFullYear() === this.options.currentDate.getFullYear() && this.date.getMonth() >= this.options.currentDate.getMonth()) || this.date.getFullYear() > this.options.currentDate.getFullYear());
|
1229
|
+
};
|
1230
|
+
|
1231
|
+
return ExpirationInputView;
|
1232
|
+
|
1233
|
+
})(Skeuocard.prototype.TextInputView);
|
1234
|
+
|
1235
|
+
Skeuocard.prototype.TextInputView = (function(_super) {
|
1236
|
+
|
1237
|
+
__extends(TextInputView, _super);
|
1238
|
+
|
1239
|
+
function TextInputView(opts) {
|
1240
|
+
this.el = $("<input>").attr({
|
1241
|
+
type: 'text',
|
1242
|
+
placeholder: opts.placeholder,
|
1243
|
+
"class": opts["class"]
|
1244
|
+
});
|
1245
|
+
this.options = opts;
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
TextInputView.prototype.clear = function() {
|
1249
|
+
return this.el.val("");
|
1250
|
+
};
|
1251
|
+
|
1252
|
+
TextInputView.prototype.attr = function() {
|
1253
|
+
var args, _ref;
|
1254
|
+
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
1255
|
+
return (_ref = this.el).attr.apply(_ref, args);
|
1256
|
+
};
|
1257
|
+
|
1258
|
+
TextInputView.prototype.isFilled = function() {
|
1259
|
+
return this.el.val().length > 0;
|
1260
|
+
};
|
1261
|
+
|
1262
|
+
TextInputView.prototype.isValid = function() {
|
1263
|
+
if (this.options.requireMaxLength) {
|
1264
|
+
return this.el.val().length === parseInt(this.el.attr('maxlength'));
|
1265
|
+
} else {
|
1266
|
+
return this.isFilled();
|
1267
|
+
}
|
1268
|
+
};
|
1269
|
+
|
1270
|
+
TextInputView.prototype.getValue = function() {
|
1271
|
+
return this.el.val();
|
1272
|
+
};
|
1273
|
+
|
1274
|
+
return TextInputView;
|
1275
|
+
|
1276
|
+
})(Skeuocard.prototype.TextInputView);
|
1277
|
+
|
1278
|
+
window.Skeuocard = Skeuocard;
|
1279
|
+
|
1280
|
+
/*
|
1281
|
+
# Card Definitions
|
1282
|
+
*/
|
1283
|
+
|
1284
|
+
|
1285
|
+
CCProducts = {};
|
1286
|
+
|
1287
|
+
CCProducts[/^30[0-5][0-9]/] = {
|
1288
|
+
companyName: "Diners Club",
|
1289
|
+
companyShortname: "dinersclubintl",
|
1290
|
+
cardNumberGrouping: [4, 6, 4],
|
1291
|
+
expirationFormat: "MM/YY",
|
1292
|
+
cvcLength: 3,
|
1293
|
+
layout: {
|
1294
|
+
number: 'front',
|
1295
|
+
exp: 'front',
|
1296
|
+
name: 'front',
|
1297
|
+
cvc: 'back'
|
1298
|
+
}
|
1299
|
+
};
|
1300
|
+
|
1301
|
+
CCProducts[/^3095/] = {
|
1302
|
+
companyName: "Diners Club International",
|
1303
|
+
companyShortname: "dinersclubintl",
|
1304
|
+
cardNumberGrouping: [4, 6, 4],
|
1305
|
+
expirationFormat: "MM/YY",
|
1306
|
+
cvcLength: 3,
|
1307
|
+
layout: {
|
1308
|
+
number: 'front',
|
1309
|
+
exp: 'front',
|
1310
|
+
name: 'front',
|
1311
|
+
cvc: 'back'
|
1312
|
+
}
|
1313
|
+
};
|
1314
|
+
|
1315
|
+
CCProducts[/^36\d{2}/] = {
|
1316
|
+
companyName: "Diners Club International",
|
1317
|
+
companyShortname: "dinersclubintl",
|
1318
|
+
cardNumberGrouping: [4, 6, 4],
|
1319
|
+
expirationFormat: "MM/YY",
|
1320
|
+
cvcLength: 3,
|
1321
|
+
layout: {
|
1322
|
+
number: 'front',
|
1323
|
+
exp: 'front',
|
1324
|
+
name: 'front',
|
1325
|
+
cvc: 'back'
|
1326
|
+
}
|
1327
|
+
};
|
1328
|
+
|
1329
|
+
CCProducts[/^35\d{2}/] = {
|
1330
|
+
companyName: "JCB",
|
1331
|
+
companyShortname: "jcb",
|
1332
|
+
cardNumberGrouping: [4, 4, 4, 4],
|
1333
|
+
expirationFormat: "MM/YY",
|
1334
|
+
cvcLength: 3,
|
1335
|
+
layout: {
|
1336
|
+
number: 'front',
|
1337
|
+
exp: 'front',
|
1338
|
+
name: 'front',
|
1339
|
+
cvc: 'back'
|
1340
|
+
}
|
1341
|
+
};
|
1342
|
+
|
1343
|
+
CCProducts[/^37/] = {
|
1344
|
+
companyName: "American Express",
|
1345
|
+
companyShortname: "amex",
|
1346
|
+
cardNumberGrouping: [4, 6, 5],
|
1347
|
+
expirationFormat: "MM/YY",
|
1348
|
+
cvcLength: 4,
|
1349
|
+
layout: {
|
1350
|
+
number: 'front',
|
1351
|
+
exp: 'front',
|
1352
|
+
name: 'front',
|
1353
|
+
cvc: 'front'
|
1354
|
+
}
|
1355
|
+
};
|
1356
|
+
|
1357
|
+
CCProducts[/^38/] = {
|
1358
|
+
companyName: "Hipercard",
|
1359
|
+
companyShortname: "hipercard",
|
1360
|
+
cardNumberGrouping: [4, 4, 4, 4],
|
1361
|
+
expirationFormat: "MM/YY",
|
1362
|
+
cvcLength: 3,
|
1363
|
+
layout: {
|
1364
|
+
number: 'front',
|
1365
|
+
exp: 'front',
|
1366
|
+
name: 'front',
|
1367
|
+
cvc: 'back'
|
1368
|
+
}
|
1369
|
+
};
|
1370
|
+
|
1371
|
+
CCProducts[/^4[0-9]\d{2}/] = {
|
1372
|
+
companyName: "Visa",
|
1373
|
+
companyShortname: "visa",
|
1374
|
+
cardNumberGrouping: [4, 4, 4, 4],
|
1375
|
+
expirationFormat: "MM/YY",
|
1376
|
+
cvcLength: 3,
|
1377
|
+
layout: {
|
1378
|
+
number: 'front',
|
1379
|
+
exp: 'front',
|
1380
|
+
name: 'front',
|
1381
|
+
cvc: 'back'
|
1382
|
+
}
|
1383
|
+
};
|
1384
|
+
|
1385
|
+
CCProducts[/^5[0-8]\d{2}/] = {
|
1386
|
+
companyName: "Mastercard",
|
1387
|
+
companyShortname: "mastercard",
|
1388
|
+
cardNumberGrouping: [4, 4, 4, 4],
|
1389
|
+
expirationFormat: "MM/YY",
|
1390
|
+
cvcLength: 3,
|
1391
|
+
layout: {
|
1392
|
+
number: 'front',
|
1393
|
+
exp: 'front',
|
1394
|
+
name: 'front',
|
1395
|
+
cvc: 'back'
|
1396
|
+
}
|
1397
|
+
};
|
1398
|
+
|
1399
|
+
CCProducts[/^6011/] = {
|
1400
|
+
companyName: "Discover",
|
1401
|
+
companyShortname: "discover",
|
1402
|
+
cardNumberGrouping: [4, 4, 4, 4],
|
1403
|
+
expirationFormat: "MM/YY",
|
1404
|
+
cvcLength: 3,
|
1405
|
+
layout: {
|
1406
|
+
number: 'front',
|
1407
|
+
exp: 'front',
|
1408
|
+
name: 'front',
|
1409
|
+
cvc: 'back'
|
1410
|
+
}
|
1411
|
+
};
|
1412
|
+
|
1413
|
+
CCIssuers = {};
|
1414
|
+
|
1415
|
+
/*
|
1416
|
+
Hack fixes the Chase Sapphire card's stupid (nice?) layout non-conformity.
|
1417
|
+
*/
|
1418
|
+
|
1419
|
+
|
1420
|
+
CCIssuers[/^414720/] = {
|
1421
|
+
issuingAuthority: "Chase",
|
1422
|
+
issuerName: "Chase Sapphire Card",
|
1423
|
+
issuerShortname: "chase-sapphire",
|
1424
|
+
layout: {
|
1425
|
+
number: 'front',
|
1426
|
+
exp: 'front',
|
1427
|
+
name: 'front',
|
1428
|
+
cvc: 'front'
|
1429
|
+
}
|
1430
|
+
};
|
1431
|
+
|
1432
|
+
}).call(this);
|