Version Notes
First preview release
Download this release
Release Info
Developer | Alexander |
Extension | Altima_BetterCreditCardForm |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Altima/BetterCreditCardForm/Block/Bettercreditcardformjs.php +80 -0
- app/code/local/Altima/BetterCreditCardForm/Helper/Data.php +27 -0
- app/code/local/Altima/BetterCreditCardForm/Model/Layout/Generate/Observer.php +48 -0
- app/code/local/Altima/BetterCreditCardForm/controllers/Adminhtml/BettercreditcartformController.php +35 -0
- app/code/local/Altima/BetterCreditCardForm/etc/config.xml +109 -0
- app/code/local/Altima/BetterCreditCardForm/etc/system.xml +64 -0
- app/code/local/Altima/BetterCreditCardForm/sql/altima_bettercreditcardform_setup/install-1.0.0.php +22 -0
- app/etc/modules/Altima_BetterCreditCardForm.xml +32 -0
- app/locale/en_US/Altima_BetterCreditCardForm.csv +43 -0
- js/altima/bettercreditcardform/card.js +1980 -0
- js/altima/bettercreditcardform/check_jquery.js +9 -0
- js/altima/bettercreditcardform/check_jquery.js~ +16 -0
- js/altima/bettercreditcardform/jquery-migrate-1.2.1.min.js +2 -0
- js/altima/bettercreditcardform/jquery.card.js +2023 -0
- js/altima/bettercreditcardform/jquery.noconflict.js +1 -0
- package.xml +18 -0
app/code/local/Altima/BetterCreditCardForm/Block/Bettercreditcardformjs.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
class Altima_BetterCreditCardForm_Block_BetterCreditCardFormjs extends Mage_Core_Block_Template {
|
22 |
+
|
23 |
+
public function _toHtml() {
|
24 |
+
$helper = Mage::helper('altima_bettercreditcardform');
|
25 |
+
$message = false;
|
26 |
+
|
27 |
+
$output = '
|
28 |
+
<script type="text/javascript">
|
29 |
+
|
30 |
+
jQuery("#checkout-payment-method-load").bind("DOMNodeInserted DOMNodeRemoved", function() {
|
31 |
+
if (!jQuery("div").is(".card-wrapper")) {
|
32 |
+
jQuery( "#payment_form_ccsave" ).prepend( "<div class=\'card-wrapper\'></div>" );
|
33 |
+
jQuery( "#payment_form_ccsave" ).append( "<input id=\'card-expiry\' name=\'card-expiry\' type=\'hidden\' />" );
|
34 |
+
var card_img = jQuery("#co-payment-form");
|
35 |
+
var card = new Card({
|
36 |
+
form: "#co-payment-form",
|
37 |
+
container: ".card-wrapper",
|
38 |
+
formSelectors: {
|
39 |
+
numberInput: "input#ccsave_cc_number",
|
40 |
+
expiryInput: "input#card-expiry",
|
41 |
+
cvcInput: "input#ccsave_cc_cid",
|
42 |
+
nameInput: "input#ccsave_cc_owner"
|
43 |
+
},
|
44 |
+
width: 200,
|
45 |
+
formatting: true,
|
46 |
+
debug: false
|
47 |
+
});
|
48 |
+
var exp_m = "**";
|
49 |
+
var exp_y = "**";
|
50 |
+
jQuery("#ccsave_expiration").change(function () {
|
51 |
+
jQuery( "select#ccsave_expiration option:selected" ).each(function() {
|
52 |
+
exp_m = jQuery( this ).val();
|
53 |
+
});
|
54 |
+
|
55 |
+
jQuery("input[name=\'card-expiry\']").val(exp_m+"/"+exp_y).change();
|
56 |
+
jQuery(".jp-card-expiry").html(exp_m+"/"+exp_y);
|
57 |
+
jQuery(".jp-card-expiry").addClass("jp-card-focused");
|
58 |
+
});
|
59 |
+
|
60 |
+
jQuery("#ccsave_expiration_yr").change(function () {
|
61 |
+
jQuery( "select#ccsave_expiration_yr option:selected" ).each(function() {
|
62 |
+
exp_y = jQuery( this ).val();
|
63 |
+
});
|
64 |
+
|
65 |
+
jQuery("input[name=\'card-expiry\']").val(exp_m+"/"+exp_y).change();
|
66 |
+
jQuery(".jp-card-expiry").html(exp_m+"/"+exp_y);
|
67 |
+
jQuery(".jp-card-expiry").addClass("jp-card-focused");
|
68 |
+
});
|
69 |
+
|
70 |
+
}
|
71 |
+
});
|
72 |
+
|
73 |
+
</script>
|
74 |
+
<script src="/js/altima/bettercreditcardform/jquery.card.js"></script>
|
75 |
+
';
|
76 |
+
|
77 |
+
return $output;
|
78 |
+
}
|
79 |
+
|
80 |
+
}
|
app/code/local/Altima/BetterCreditCardForm/Helper/Data.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
class Altima_BetterCreditCardForm_Helper_Data extends Mage_Core_Helper_Abstract {
|
22 |
+
|
23 |
+
public function getEnabled() {
|
24 |
+
return Mage::getStoreConfig('altima_bettercreditcardform/general/enabled');
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
app/code/local/Altima/BetterCreditCardForm/Model/Layout/Generate/Observer.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
class Altima_BetterCreditCardForm_Model_Layout_Generate_Observer {
|
22 |
+
|
23 |
+
public function __construct() {
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
public function includeJavascripts($observer) {
|
28 |
+
|
29 |
+
$helper = Mage::helper('altima_bettercreditcardform');
|
30 |
+
if ($helper->getEnabled()) {
|
31 |
+
|
32 |
+
|
33 |
+
$layout = Mage::app()->getLayout();
|
34 |
+
$content = $layout->getBlock('footer');
|
35 |
+
|
36 |
+
$_head = $layout->getBlock('head');
|
37 |
+
if ($_head) {
|
38 |
+
$_head->addJs('altima/bettercreditcardform/check_jquery.js');
|
39 |
+
$_head->addJs('altima/bettercreditcardform/jquery.noconflict.js');
|
40 |
+
}
|
41 |
+
if ($content = $layout->getBlock('footer')) {
|
42 |
+
$block = $layout->createBlock('altima_bettercreditcardform/bettercreditcardformjs');
|
43 |
+
$content->insert($block);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
app/code/local/Altima/BetterCreditCardForm/controllers/Adminhtml/BettercreditcartformController.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Altima BetterCreditCardForm Conversion Optimisation Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
class Altima_BetterCreditCardForm_Adminhtml_BetterCreditCardFormController extends Mage_Adminhtml_Controller_Action {
|
22 |
+
|
23 |
+
protected function _construct() {
|
24 |
+
$this->setUsedModuleName('Altima_BetterCreditCardForm');
|
25 |
+
}
|
26 |
+
|
27 |
+
public function indexAction() {
|
28 |
+
$this->loadLayout()->renderLayout();
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _isAllowed() {
|
32 |
+
return Mage::getSingleton('admin/session')->isAllowed('altima_bettercreditcardform/bettercreditcardform');
|
33 |
+
}
|
34 |
+
|
35 |
+
}
|
app/code/local/Altima/BetterCreditCardForm/etc/config.xml
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Altima_BetterCreditCardForm>
|
25 |
+
<version>1.0.0</version>
|
26 |
+
</Altima_BetterCreditCardForm>
|
27 |
+
</modules>
|
28 |
+
<global>
|
29 |
+
<models>
|
30 |
+
<altima_bettercreditcardform>
|
31 |
+
<class>Altima_BetterCreditCardForm_Model</class>
|
32 |
+
</altima_bettercreditcardform>
|
33 |
+
</models>
|
34 |
+
<extraconfig />
|
35 |
+
<blocks>
|
36 |
+
<altima_bettercreditcardform>
|
37 |
+
<class>Altima_BetterCreditCardForm_Block</class>
|
38 |
+
</altima_bettercreditcardform>
|
39 |
+
</blocks>
|
40 |
+
<resources>
|
41 |
+
<altima_bettercreditcardform_setup>
|
42 |
+
<setup>
|
43 |
+
<module>Altima_BetterCreditCardForm</module>
|
44 |
+
</setup>
|
45 |
+
<connection>
|
46 |
+
<use>core_setup</use>
|
47 |
+
</connection>
|
48 |
+
</altima_bettercreditcardform_setup>
|
49 |
+
<altima_bettercreditcardform_write>
|
50 |
+
<connection>
|
51 |
+
<use>core_write</use>
|
52 |
+
</connection>
|
53 |
+
</altima_bettercreditcardform_write>
|
54 |
+
<altima_bettercreditcardform_read>
|
55 |
+
<connection>
|
56 |
+
<use>core_read</use>
|
57 |
+
</connection>
|
58 |
+
</altima_bettercreditcardform_read>
|
59 |
+
</resources>
|
60 |
+
<helpers>
|
61 |
+
<altima_bettercreditcardform>
|
62 |
+
<class>Altima_BetterCreditCardForm_Helper</class>
|
63 |
+
</altima_bettercreditcardform>
|
64 |
+
</helpers>
|
65 |
+
<events>
|
66 |
+
<controller_action_layout_render_before_checkout_onepage_index>
|
67 |
+
<observers>
|
68 |
+
<bettercreditcardform_layout_generate_observer>
|
69 |
+
<type>singleton</type>
|
70 |
+
<class>altima_bettercreditcardform/layout_generate_observer</class>
|
71 |
+
<method>includeJavascripts</method>
|
72 |
+
</bettercreditcardform_layout_generate_observer>
|
73 |
+
</observers>
|
74 |
+
</controller_action_layout_render_before_checkout_onepage_index>
|
75 |
+
</events>
|
76 |
+
</global>
|
77 |
+
<adminhtml>
|
78 |
+
<acl>
|
79 |
+
<resources>
|
80 |
+
<admin>
|
81 |
+
<children>
|
82 |
+
<system>
|
83 |
+
<children>
|
84 |
+
<config>
|
85 |
+
<children>
|
86 |
+
<altima_bettercreditcardform>
|
87 |
+
<title>BetterCreditCartForm section</title>
|
88 |
+
</altima_bettercreditcardform>
|
89 |
+
</children>
|
90 |
+
</config>
|
91 |
+
</children>
|
92 |
+
</system>
|
93 |
+
</children>
|
94 |
+
</admin>
|
95 |
+
</resources>
|
96 |
+
</acl>
|
97 |
+
</adminhtml>
|
98 |
+
<admin>
|
99 |
+
<routers>
|
100 |
+
<adminhtml>
|
101 |
+
<args>
|
102 |
+
<modules>
|
103 |
+
<Altima_BetterCreditCardForm before="Mage_Adminhtml">Altima_BetterCreditCartForm_Adminhtml</Altima_BetterCreditCardForm>
|
104 |
+
</modules>
|
105 |
+
</args>
|
106 |
+
</adminhtml>
|
107 |
+
</routers>
|
108 |
+
</admin>
|
109 |
+
</config>
|
app/code/local/Altima/BetterCreditCardForm/etc/system.xml
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<tabs>
|
24 |
+
<altima translate="label comment" module="altima_bettercreditcardform">
|
25 |
+
<label>Altima</label>
|
26 |
+
<sort_order>500</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</altima>
|
31 |
+
</tabs>
|
32 |
+
<sections>
|
33 |
+
<altima_bettercreditcardform translate="label comment" module="altima_bettercreditcardform">
|
34 |
+
<tab>altima</tab>
|
35 |
+
<label>Better Credit Card Form</label>
|
36 |
+
<frontend_type>text</frontend_type>
|
37 |
+
<sort_order>600</sort_order>
|
38 |
+
<show_in_default>1</show_in_default>
|
39 |
+
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>1</show_in_store>
|
41 |
+
<groups>
|
42 |
+
<general translate="label comment" module="altima_bettercreditcardform">
|
43 |
+
<label>General Settings</label>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>10</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
<fields>
|
50 |
+
<enabled translate="label">
|
51 |
+
<label>Enabled</label>
|
52 |
+
<frontend_type>select</frontend_type>
|
53 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
54 |
+
<sort_order>10</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</enabled>
|
59 |
+
</fields>
|
60 |
+
</general>
|
61 |
+
</groups>
|
62 |
+
</altima_bettercreditcardform>
|
63 |
+
</sections>
|
64 |
+
</config>
|
app/code/local/Altima/BetterCreditCardForm/sql/altima_bettercreditcardform_setup/install-1.0.0.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
$this->startSetup();
|
22 |
+
$this->endSetup();
|
app/etc/modules/Altima_BetterCreditCardForm.xml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Altima Better Credit Card Form Extension
|
5 |
+
*
|
6 |
+
* Altima web systems.
|
7 |
+
*
|
8 |
+
* NOTICE OF LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the EULA
|
11 |
+
* that is available through the world-wide-web at this URL:
|
12 |
+
* http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
13 |
+
*
|
14 |
+
* @category Altima
|
15 |
+
* @package Altima_BetterCreditCardForm
|
16 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
17 |
+
* @license http://blog.altima.net.au/lookbook-magento-extension/lookbook-professional-licence/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Altima_BetterCreditCardForm>
|
25 |
+
<active>true</active>
|
26 |
+
<codePool>local</codePool>
|
27 |
+
<depends>
|
28 |
+
<Mage_Catalog />
|
29 |
+
</depends>
|
30 |
+
</Altima_BetterCreditCardForm>
|
31 |
+
</modules>
|
32 |
+
</config>
|
app/locale/en_US/Altima_BetterCreditCardForm.csv
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"",""
|
2 |
+
"Action","Action"
|
3 |
+
"An error occurred while updating the Better credit cart form.","An error occurred while updating the Better credit cart form."
|
4 |
+
"Are you sure?","Are you sure?"
|
5 |
+
"Change status","Change status"
|
6 |
+
"Could not find Extension to delete.","Could not find Extension to delete."
|
7 |
+
"Created at","Created at"
|
8 |
+
"Declare attribute value saving scope","Declare attribute value saving scope"
|
9 |
+
"Default Values","Default Values"
|
10 |
+
"Delete File","Delete File"
|
11 |
+
"Delete Extension","Delete Extension"
|
12 |
+
"Delete","Delete"
|
13 |
+
"Disabled","Disabled"
|
14 |
+
"Edit","Edit"
|
15 |
+
"Enable WYSIWYG","Enable WYSIWYG"
|
16 |
+
"Enabled","Enabled"
|
17 |
+
"Error saving","Error saving"
|
18 |
+
"File","File"
|
19 |
+
"Frontend Properties","Frontend Properties"
|
20 |
+
"Global","Global"
|
21 |
+
"Home","Home"
|
22 |
+
"Id","Id"
|
23 |
+
"Image","Image"
|
24 |
+
"No","No"
|
25 |
+
"None","None"
|
26 |
+
"Note","Note"
|
27 |
+
"Better Credit Card Form","Better Credit Card Form"
|
28 |
+
"Position in the admin form","Position in the admin form"
|
29 |
+
"Position","Position"
|
30 |
+
"Properties","Properties"
|
31 |
+
"Reset","Reset"
|
32 |
+
"Save And Continue Edit","Save And Continue Edit"
|
33 |
+
"Scope","Scope"
|
34 |
+
"Status","Status"
|
35 |
+
"Store View","Store View"
|
36 |
+
"Store views","Store views"
|
37 |
+
"Text to appear below the input.","Text to appear below the input."
|
38 |
+
"Updated at","Updated at"
|
39 |
+
"Website","Website"
|
40 |
+
"Yes","Yes"
|
41 |
+
"[GLOBAL]","[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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.card=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2 |
+
module.exports = _dereq_('./lib/extend');
|
3 |
+
|
4 |
+
|
5 |
+
},{"./lib/extend":2}],2:[function(_dereq_,module,exports){
|
6 |
+
/*!
|
7 |
+
* node.extend
|
8 |
+
* Copyright 2011, John Resig
|
9 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
10 |
+
* http://jquery.org/license
|
11 |
+
*
|
12 |
+
* @fileoverview
|
13 |
+
* Port of jQuery.extend that actually works on node.js
|
14 |
+
*/
|
15 |
+
var is = _dereq_('is');
|
16 |
+
|
17 |
+
function extend() {
|
18 |
+
var target = arguments[0] || {};
|
19 |
+
var i = 1;
|
20 |
+
var length = arguments.length;
|
21 |
+
var deep = false;
|
22 |
+
var options, name, src, copy, copy_is_array, clone;
|
23 |
+
|
24 |
+
// Handle a deep copy situation
|
25 |
+
if (typeof target === 'boolean') {
|
26 |
+
deep = target;
|
27 |
+
target = arguments[1] || {};
|
28 |
+
// skip the boolean and the target
|
29 |
+
i = 2;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Handle case when target is a string or something (possible in deep copy)
|
33 |
+
if (typeof target !== 'object' && !is.fn(target)) {
|
34 |
+
target = {};
|
35 |
+
}
|
36 |
+
|
37 |
+
for (; i < length; i++) {
|
38 |
+
// Only deal with non-null/undefined values
|
39 |
+
options = arguments[i]
|
40 |
+
if (options != null) {
|
41 |
+
if (typeof options === 'string') {
|
42 |
+
options = options.split('');
|
43 |
+
}
|
44 |
+
// Extend the base object
|
45 |
+
for (name in options) {
|
46 |
+
src = target[name];
|
47 |
+
copy = options[name];
|
48 |
+
|
49 |
+
// Prevent never-ending loop
|
50 |
+
if (target === copy) {
|
51 |
+
continue;
|
52 |
+
}
|
53 |
+
|
54 |
+
// Recurse if we're merging plain objects or arrays
|
55 |
+
if (deep && copy && (is.hash(copy) || (copy_is_array = is.array(copy)))) {
|
56 |
+
if (copy_is_array) {
|
57 |
+
copy_is_array = false;
|
58 |
+
clone = src && is.array(src) ? src : [];
|
59 |
+
} else {
|
60 |
+
clone = src && is.hash(src) ? src : {};
|
61 |
+
}
|
62 |
+
|
63 |
+
// Never move original objects, clone them
|
64 |
+
target[name] = extend(deep, clone, copy);
|
65 |
+
|
66 |
+
// Don't bring in undefined values
|
67 |
+
} else if (typeof copy !== 'undefined') {
|
68 |
+
target[name] = copy;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
// Return the modified object
|
75 |
+
return target;
|
76 |
+
};
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @public
|
80 |
+
*/
|
81 |
+
extend.version = '1.0.8';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Exports module.
|
85 |
+
*/
|
86 |
+
module.exports = extend;
|
87 |
+
|
88 |
+
|
89 |
+
},{"is":3}],3:[function(_dereq_,module,exports){
|
90 |
+
|
91 |
+
/**!
|
92 |
+
* is
|
93 |
+
* the definitive JavaScript type testing library
|
94 |
+
*
|
95 |
+
* @copyright 2013-2014 Enrico Marino / Jordan Harband
|
96 |
+
* @license MIT
|
97 |
+
*/
|
98 |
+
|
99 |
+
var objProto = Object.prototype;
|
100 |
+
var owns = objProto.hasOwnProperty;
|
101 |
+
var toString = objProto.toString;
|
102 |
+
var isActualNaN = function (value) {
|
103 |
+
return value !== value;
|
104 |
+
};
|
105 |
+
var NON_HOST_TYPES = {
|
106 |
+
boolean: 1,
|
107 |
+
number: 1,
|
108 |
+
string: 1,
|
109 |
+
undefined: 1
|
110 |
+
};
|
111 |
+
|
112 |
+
var base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
|
113 |
+
var hexRegex = /^[A-Fa-f0-9]+$/;
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Expose `is`
|
117 |
+
*/
|
118 |
+
|
119 |
+
var is = module.exports = {};
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Test general.
|
123 |
+
*/
|
124 |
+
|
125 |
+
/**
|
126 |
+
* is.type
|
127 |
+
* Test if `value` is a type of `type`.
|
128 |
+
*
|
129 |
+
* @param {Mixed} value value to test
|
130 |
+
* @param {String} type type
|
131 |
+
* @return {Boolean} true if `value` is a type of `type`, false otherwise
|
132 |
+
* @api public
|
133 |
+
*/
|
134 |
+
|
135 |
+
is.a = is.type = function (value, type) {
|
136 |
+
return typeof value === type;
|
137 |
+
};
|
138 |
+
|
139 |
+
/**
|
140 |
+
* is.defined
|
141 |
+
* Test if `value` is defined.
|
142 |
+
*
|
143 |
+
* @param {Mixed} value value to test
|
144 |
+
* @return {Boolean} true if 'value' is defined, false otherwise
|
145 |
+
* @api public
|
146 |
+
*/
|
147 |
+
|
148 |
+
is.defined = function (value) {
|
149 |
+
return typeof value !== 'undefined';
|
150 |
+
};
|
151 |
+
|
152 |
+
/**
|
153 |
+
* is.empty
|
154 |
+
* Test if `value` is empty.
|
155 |
+
*
|
156 |
+
* @param {Mixed} value value to test
|
157 |
+
* @return {Boolean} true if `value` is empty, false otherwise
|
158 |
+
* @api public
|
159 |
+
*/
|
160 |
+
|
161 |
+
is.empty = function (value) {
|
162 |
+
var type = toString.call(value);
|
163 |
+
var key;
|
164 |
+
|
165 |
+
if ('[object Array]' === type || '[object Arguments]' === type || '[object String]' === type) {
|
166 |
+
return value.length === 0;
|
167 |
+
}
|
168 |
+
|
169 |
+
if ('[object Object]' === type) {
|
170 |
+
for (key in value) {
|
171 |
+
if (owns.call(value, key)) { return false; }
|
172 |
+
}
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
|
176 |
+
return false;
|
177 |
+
};
|
178 |
+
|
179 |
+
/**
|
180 |
+
* is.equal
|
181 |
+
* Test if `value` is equal to `other`.
|
182 |
+
*
|
183 |
+
* @param {Mixed} value value to test
|
184 |
+
* @param {Mixed} other value to compare with
|
185 |
+
* @return {Boolean} true if `value` is equal to `other`, false otherwise
|
186 |
+
*/
|
187 |
+
|
188 |
+
is.equal = function (value, other) {
|
189 |
+
var strictlyEqual = value === other;
|
190 |
+
if (strictlyEqual) {
|
191 |
+
return true;
|
192 |
+
}
|
193 |
+
|
194 |
+
var type = toString.call(value);
|
195 |
+
var key;
|
196 |
+
|
197 |
+
if (type !== toString.call(other)) {
|
198 |
+
return false;
|
199 |
+
}
|
200 |
+
|
201 |
+
if ('[object Object]' === type) {
|
202 |
+
for (key in value) {
|
203 |
+
if (!is.equal(value[key], other[key]) || !(key in other)) {
|
204 |
+
return false;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
for (key in other) {
|
208 |
+
if (!is.equal(value[key], other[key]) || !(key in value)) {
|
209 |
+
return false;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
return true;
|
213 |
+
}
|
214 |
+
|
215 |
+
if ('[object Array]' === type) {
|
216 |
+
key = value.length;
|
217 |
+
if (key !== other.length) {
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
while (--key) {
|
221 |
+
if (!is.equal(value[key], other[key])) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
return true;
|
226 |
+
}
|
227 |
+
|
228 |
+
if ('[object Function]' === type) {
|
229 |
+
return value.prototype === other.prototype;
|
230 |
+
}
|
231 |
+
|
232 |
+
if ('[object Date]' === type) {
|
233 |
+
return value.getTime() === other.getTime();
|
234 |
+
}
|
235 |
+
|
236 |
+
return strictlyEqual;
|
237 |
+
};
|
238 |
+
|
239 |
+
/**
|
240 |
+
* is.hosted
|
241 |
+
* Test if `value` is hosted by `host`.
|
242 |
+
*
|
243 |
+
* @param {Mixed} value to test
|
244 |
+
* @param {Mixed} host host to test with
|
245 |
+
* @return {Boolean} true if `value` is hosted by `host`, false otherwise
|
246 |
+
* @api public
|
247 |
+
*/
|
248 |
+
|
249 |
+
is.hosted = function (value, host) {
|
250 |
+
var type = typeof host[value];
|
251 |
+
return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];
|
252 |
+
};
|
253 |
+
|
254 |
+
/**
|
255 |
+
* is.instance
|
256 |
+
* Test if `value` is an instance of `constructor`.
|
257 |
+
*
|
258 |
+
* @param {Mixed} value value to test
|
259 |
+
* @return {Boolean} true if `value` is an instance of `constructor`
|
260 |
+
* @api public
|
261 |
+
*/
|
262 |
+
|
263 |
+
is.instance = is['instanceof'] = function (value, constructor) {
|
264 |
+
return value instanceof constructor;
|
265 |
+
};
|
266 |
+
|
267 |
+
/**
|
268 |
+
* is.nil / is.null
|
269 |
+
* Test if `value` is null.
|
270 |
+
*
|
271 |
+
* @param {Mixed} value value to test
|
272 |
+
* @return {Boolean} true if `value` is null, false otherwise
|
273 |
+
* @api public
|
274 |
+
*/
|
275 |
+
|
276 |
+
is.nil = is['null'] = function (value) {
|
277 |
+
return value === null;
|
278 |
+
};
|
279 |
+
|
280 |
+
/**
|
281 |
+
* is.undef / is.undefined
|
282 |
+
* Test if `value` is undefined.
|
283 |
+
*
|
284 |
+
* @param {Mixed} value value to test
|
285 |
+
* @return {Boolean} true if `value` is undefined, false otherwise
|
286 |
+
* @api public
|
287 |
+
*/
|
288 |
+
|
289 |
+
is.undef = is['undefined'] = function (value) {
|
290 |
+
return typeof value === 'undefined';
|
291 |
+
};
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Test arguments.
|
295 |
+
*/
|
296 |
+
|
297 |
+
/**
|
298 |
+
* is.args
|
299 |
+
* Test if `value` is an arguments object.
|
300 |
+
*
|
301 |
+
* @param {Mixed} value value to test
|
302 |
+
* @return {Boolean} true if `value` is an arguments object, false otherwise
|
303 |
+
* @api public
|
304 |
+
*/
|
305 |
+
|
306 |
+
is.args = is['arguments'] = function (value) {
|
307 |
+
var isStandardArguments = '[object Arguments]' === toString.call(value);
|
308 |
+
var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);
|
309 |
+
return isStandardArguments || isOldArguments;
|
310 |
+
};
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Test array.
|
314 |
+
*/
|
315 |
+
|
316 |
+
/**
|
317 |
+
* is.array
|
318 |
+
* Test if 'value' is an array.
|
319 |
+
*
|
320 |
+
* @param {Mixed} value value to test
|
321 |
+
* @return {Boolean} true if `value` is an array, false otherwise
|
322 |
+
* @api public
|
323 |
+
*/
|
324 |
+
|
325 |
+
is.array = function (value) {
|
326 |
+
return '[object Array]' === toString.call(value);
|
327 |
+
};
|
328 |
+
|
329 |
+
/**
|
330 |
+
* is.arguments.empty
|
331 |
+
* Test if `value` is an empty arguments object.
|
332 |
+
*
|
333 |
+
* @param {Mixed} value value to test
|
334 |
+
* @return {Boolean} true if `value` is an empty arguments object, false otherwise
|
335 |
+
* @api public
|
336 |
+
*/
|
337 |
+
is.args.empty = function (value) {
|
338 |
+
return is.args(value) && value.length === 0;
|
339 |
+
};
|
340 |
+
|
341 |
+
/**
|
342 |
+
* is.array.empty
|
343 |
+
* Test if `value` is an empty array.
|
344 |
+
*
|
345 |
+
* @param {Mixed} value value to test
|
346 |
+
* @return {Boolean} true if `value` is an empty array, false otherwise
|
347 |
+
* @api public
|
348 |
+
*/
|
349 |
+
is.array.empty = function (value) {
|
350 |
+
return is.array(value) && value.length === 0;
|
351 |
+
};
|
352 |
+
|
353 |
+
/**
|
354 |
+
* is.arraylike
|
355 |
+
* Test if `value` is an arraylike object.
|
356 |
+
*
|
357 |
+
* @param {Mixed} value value to test
|
358 |
+
* @return {Boolean} true if `value` is an arguments object, false otherwise
|
359 |
+
* @api public
|
360 |
+
*/
|
361 |
+
|
362 |
+
is.arraylike = function (value) {
|
363 |
+
return !!value && !is.boolean(value)
|
364 |
+
&& owns.call(value, 'length')
|
365 |
+
&& isFinite(value.length)
|
366 |
+
&& is.number(value.length)
|
367 |
+
&& value.length >= 0;
|
368 |
+
};
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Test boolean.
|
372 |
+
*/
|
373 |
+
|
374 |
+
/**
|
375 |
+
* is.boolean
|
376 |
+
* Test if `value` is a boolean.
|
377 |
+
*
|
378 |
+
* @param {Mixed} value value to test
|
379 |
+
* @return {Boolean} true if `value` is a boolean, false otherwise
|
380 |
+
* @api public
|
381 |
+
*/
|
382 |
+
|
383 |
+
is.boolean = function (value) {
|
384 |
+
return '[object Boolean]' === toString.call(value);
|
385 |
+
};
|
386 |
+
|
387 |
+
/**
|
388 |
+
* is.false
|
389 |
+
* Test if `value` is false.
|
390 |
+
*
|
391 |
+
* @param {Mixed} value value to test
|
392 |
+
* @return {Boolean} true if `value` is false, false otherwise
|
393 |
+
* @api public
|
394 |
+
*/
|
395 |
+
|
396 |
+
is['false'] = function (value) {
|
397 |
+
return is.boolean(value) && Boolean(Number(value)) === false;
|
398 |
+
};
|
399 |
+
|
400 |
+
/**
|
401 |
+
* is.true
|
402 |
+
* Test if `value` is true.
|
403 |
+
*
|
404 |
+
* @param {Mixed} value value to test
|
405 |
+
* @return {Boolean} true if `value` is true, false otherwise
|
406 |
+
* @api public
|
407 |
+
*/
|
408 |
+
|
409 |
+
is['true'] = function (value) {
|
410 |
+
return is.boolean(value) && Boolean(Number(value)) === true;
|
411 |
+
};
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Test date.
|
415 |
+
*/
|
416 |
+
|
417 |
+
/**
|
418 |
+
* is.date
|
419 |
+
* Test if `value` is a date.
|
420 |
+
*
|
421 |
+
* @param {Mixed} value value to test
|
422 |
+
* @return {Boolean} true if `value` is a date, false otherwise
|
423 |
+
* @api public
|
424 |
+
*/
|
425 |
+
|
426 |
+
is.date = function (value) {
|
427 |
+
return '[object Date]' === toString.call(value);
|
428 |
+
};
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Test element.
|
432 |
+
*/
|
433 |
+
|
434 |
+
/**
|
435 |
+
* is.element
|
436 |
+
* Test if `value` is an html element.
|
437 |
+
*
|
438 |
+
* @param {Mixed} value value to test
|
439 |
+
* @return {Boolean} true if `value` is an HTML Element, false otherwise
|
440 |
+
* @api public
|
441 |
+
*/
|
442 |
+
|
443 |
+
is.element = function (value) {
|
444 |
+
return value !== undefined
|
445 |
+
&& typeof HTMLElement !== 'undefined'
|
446 |
+
&& value instanceof HTMLElement
|
447 |
+
&& value.nodeType === 1;
|
448 |
+
};
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Test error.
|
452 |
+
*/
|
453 |
+
|
454 |
+
/**
|
455 |
+
* is.error
|
456 |
+
* Test if `value` is an error object.
|
457 |
+
*
|
458 |
+
* @param {Mixed} value value to test
|
459 |
+
* @return {Boolean} true if `value` is an error object, false otherwise
|
460 |
+
* @api public
|
461 |
+
*/
|
462 |
+
|
463 |
+
is.error = function (value) {
|
464 |
+
return '[object Error]' === toString.call(value);
|
465 |
+
};
|
466 |
+
|
467 |
+
/**
|
468 |
+
* Test function.
|
469 |
+
*/
|
470 |
+
|
471 |
+
/**
|
472 |
+
* is.fn / is.function (deprecated)
|
473 |
+
* Test if `value` is a function.
|
474 |
+
*
|
475 |
+
* @param {Mixed} value value to test
|
476 |
+
* @return {Boolean} true if `value` is a function, false otherwise
|
477 |
+
* @api public
|
478 |
+
*/
|
479 |
+
|
480 |
+
is.fn = is['function'] = function (value) {
|
481 |
+
var isAlert = typeof window !== 'undefined' && value === window.alert;
|
482 |
+
return isAlert || '[object Function]' === toString.call(value);
|
483 |
+
};
|
484 |
+
|
485 |
+
/**
|
486 |
+
* Test number.
|
487 |
+
*/
|
488 |
+
|
489 |
+
/**
|
490 |
+
* is.number
|
491 |
+
* Test if `value` is a number.
|
492 |
+
*
|
493 |
+
* @param {Mixed} value value to test
|
494 |
+
* @return {Boolean} true if `value` is a number, false otherwise
|
495 |
+
* @api public
|
496 |
+
*/
|
497 |
+
|
498 |
+
is.number = function (value) {
|
499 |
+
return '[object Number]' === toString.call(value);
|
500 |
+
};
|
501 |
+
|
502 |
+
/**
|
503 |
+
* is.infinite
|
504 |
+
* Test if `value` is positive or negative infinity.
|
505 |
+
*
|
506 |
+
* @param {Mixed} value value to test
|
507 |
+
* @return {Boolean} true if `value` is positive or negative Infinity, false otherwise
|
508 |
+
* @api public
|
509 |
+
*/
|
510 |
+
is.infinite = function (value) {
|
511 |
+
return value === Infinity || value === -Infinity;
|
512 |
+
};
|
513 |
+
|
514 |
+
/**
|
515 |
+
* is.decimal
|
516 |
+
* Test if `value` is a decimal number.
|
517 |
+
*
|
518 |
+
* @param {Mixed} value value to test
|
519 |
+
* @return {Boolean} true if `value` is a decimal number, false otherwise
|
520 |
+
* @api public
|
521 |
+
*/
|
522 |
+
|
523 |
+
is.decimal = function (value) {
|
524 |
+
return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;
|
525 |
+
};
|
526 |
+
|
527 |
+
/**
|
528 |
+
* is.divisibleBy
|
529 |
+
* Test if `value` is divisible by `n`.
|
530 |
+
*
|
531 |
+
* @param {Number} value value to test
|
532 |
+
* @param {Number} n dividend
|
533 |
+
* @return {Boolean} true if `value` is divisible by `n`, false otherwise
|
534 |
+
* @api public
|
535 |
+
*/
|
536 |
+
|
537 |
+
is.divisibleBy = function (value, n) {
|
538 |
+
var isDividendInfinite = is.infinite(value);
|
539 |
+
var isDivisorInfinite = is.infinite(n);
|
540 |
+
var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;
|
541 |
+
return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);
|
542 |
+
};
|
543 |
+
|
544 |
+
/**
|
545 |
+
* is.int
|
546 |
+
* Test if `value` is an integer.
|
547 |
+
*
|
548 |
+
* @param value to test
|
549 |
+
* @return {Boolean} true if `value` is an integer, false otherwise
|
550 |
+
* @api public
|
551 |
+
*/
|
552 |
+
|
553 |
+
is.int = function (value) {
|
554 |
+
return is.number(value) && !isActualNaN(value) && value % 1 === 0;
|
555 |
+
};
|
556 |
+
|
557 |
+
/**
|
558 |
+
* is.maximum
|
559 |
+
* Test if `value` is greater than 'others' values.
|
560 |
+
*
|
561 |
+
* @param {Number} value value to test
|
562 |
+
* @param {Array} others values to compare with
|
563 |
+
* @return {Boolean} true if `value` is greater than `others` values
|
564 |
+
* @api public
|
565 |
+
*/
|
566 |
+
|
567 |
+
is.maximum = function (value, others) {
|
568 |
+
if (isActualNaN(value)) {
|
569 |
+
throw new TypeError('NaN is not a valid value');
|
570 |
+
} else if (!is.arraylike(others)) {
|
571 |
+
throw new TypeError('second argument must be array-like');
|
572 |
+
}
|
573 |
+
var len = others.length;
|
574 |
+
|
575 |
+
while (--len >= 0) {
|
576 |
+
if (value < others[len]) {
|
577 |
+
return false;
|
578 |
+
}
|
579 |
+
}
|
580 |
+
|
581 |
+
return true;
|
582 |
+
};
|
583 |
+
|
584 |
+
/**
|
585 |
+
* is.minimum
|
586 |
+
* Test if `value` is less than `others` values.
|
587 |
+
*
|
588 |
+
* @param {Number} value value to test
|
589 |
+
* @param {Array} others values to compare with
|
590 |
+
* @return {Boolean} true if `value` is less than `others` values
|
591 |
+
* @api public
|
592 |
+
*/
|
593 |
+
|
594 |
+
is.minimum = function (value, others) {
|
595 |
+
if (isActualNaN(value)) {
|
596 |
+
throw new TypeError('NaN is not a valid value');
|
597 |
+
} else if (!is.arraylike(others)) {
|
598 |
+
throw new TypeError('second argument must be array-like');
|
599 |
+
}
|
600 |
+
var len = others.length;
|
601 |
+
|
602 |
+
while (--len >= 0) {
|
603 |
+
if (value > others[len]) {
|
604 |
+
return false;
|
605 |
+
}
|
606 |
+
}
|
607 |
+
|
608 |
+
return true;
|
609 |
+
};
|
610 |
+
|
611 |
+
/**
|
612 |
+
* is.nan
|
613 |
+
* Test if `value` is not a number.
|
614 |
+
*
|
615 |
+
* @param {Mixed} value value to test
|
616 |
+
* @return {Boolean} true if `value` is not a number, false otherwise
|
617 |
+
* @api public
|
618 |
+
*/
|
619 |
+
|
620 |
+
is.nan = function (value) {
|
621 |
+
return !is.number(value) || value !== value;
|
622 |
+
};
|
623 |
+
|
624 |
+
/**
|
625 |
+
* is.even
|
626 |
+
* Test if `value` is an even number.
|
627 |
+
*
|
628 |
+
* @param {Number} value value to test
|
629 |
+
* @return {Boolean} true if `value` is an even number, false otherwise
|
630 |
+
* @api public
|
631 |
+
*/
|
632 |
+
|
633 |
+
is.even = function (value) {
|
634 |
+
return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);
|
635 |
+
};
|
636 |
+
|
637 |
+
/**
|
638 |
+
* is.odd
|
639 |
+
* Test if `value` is an odd number.
|
640 |
+
*
|
641 |
+
* @param {Number} value value to test
|
642 |
+
* @return {Boolean} true if `value` is an odd number, false otherwise
|
643 |
+
* @api public
|
644 |
+
*/
|
645 |
+
|
646 |
+
is.odd = function (value) {
|
647 |
+
return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);
|
648 |
+
};
|
649 |
+
|
650 |
+
/**
|
651 |
+
* is.ge
|
652 |
+
* Test if `value` is greater than or equal to `other`.
|
653 |
+
*
|
654 |
+
* @param {Number} value value to test
|
655 |
+
* @param {Number} other value to compare with
|
656 |
+
* @return {Boolean}
|
657 |
+
* @api public
|
658 |
+
*/
|
659 |
+
|
660 |
+
is.ge = function (value, other) {
|
661 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
662 |
+
throw new TypeError('NaN is not a valid value');
|
663 |
+
}
|
664 |
+
return !is.infinite(value) && !is.infinite(other) && value >= other;
|
665 |
+
};
|
666 |
+
|
667 |
+
/**
|
668 |
+
* is.gt
|
669 |
+
* Test if `value` is greater than `other`.
|
670 |
+
*
|
671 |
+
* @param {Number} value value to test
|
672 |
+
* @param {Number} other value to compare with
|
673 |
+
* @return {Boolean}
|
674 |
+
* @api public
|
675 |
+
*/
|
676 |
+
|
677 |
+
is.gt = function (value, other) {
|
678 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
679 |
+
throw new TypeError('NaN is not a valid value');
|
680 |
+
}
|
681 |
+
return !is.infinite(value) && !is.infinite(other) && value > other;
|
682 |
+
};
|
683 |
+
|
684 |
+
/**
|
685 |
+
* is.le
|
686 |
+
* Test if `value` is less than or equal to `other`.
|
687 |
+
*
|
688 |
+
* @param {Number} value value to test
|
689 |
+
* @param {Number} other value to compare with
|
690 |
+
* @return {Boolean} if 'value' is less than or equal to 'other'
|
691 |
+
* @api public
|
692 |
+
*/
|
693 |
+
|
694 |
+
is.le = function (value, other) {
|
695 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
696 |
+
throw new TypeError('NaN is not a valid value');
|
697 |
+
}
|
698 |
+
return !is.infinite(value) && !is.infinite(other) && value <= other;
|
699 |
+
};
|
700 |
+
|
701 |
+
/**
|
702 |
+
* is.lt
|
703 |
+
* Test if `value` is less than `other`.
|
704 |
+
*
|
705 |
+
* @param {Number} value value to test
|
706 |
+
* @param {Number} other value to compare with
|
707 |
+
* @return {Boolean} if `value` is less than `other`
|
708 |
+
* @api public
|
709 |
+
*/
|
710 |
+
|
711 |
+
is.lt = function (value, other) {
|
712 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
713 |
+
throw new TypeError('NaN is not a valid value');
|
714 |
+
}
|
715 |
+
return !is.infinite(value) && !is.infinite(other) && value < other;
|
716 |
+
};
|
717 |
+
|
718 |
+
/**
|
719 |
+
* is.within
|
720 |
+
* Test if `value` is within `start` and `finish`.
|
721 |
+
*
|
722 |
+
* @param {Number} value value to test
|
723 |
+
* @param {Number} start lower bound
|
724 |
+
* @param {Number} finish upper bound
|
725 |
+
* @return {Boolean} true if 'value' is is within 'start' and 'finish'
|
726 |
+
* @api public
|
727 |
+
*/
|
728 |
+
is.within = function (value, start, finish) {
|
729 |
+
if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {
|
730 |
+
throw new TypeError('NaN is not a valid value');
|
731 |
+
} else if (!is.number(value) || !is.number(start) || !is.number(finish)) {
|
732 |
+
throw new TypeError('all arguments must be numbers');
|
733 |
+
}
|
734 |
+
var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);
|
735 |
+
return isAnyInfinite || (value >= start && value <= finish);
|
736 |
+
};
|
737 |
+
|
738 |
+
/**
|
739 |
+
* Test object.
|
740 |
+
*/
|
741 |
+
|
742 |
+
/**
|
743 |
+
* is.object
|
744 |
+
* Test if `value` is an object.
|
745 |
+
*
|
746 |
+
* @param {Mixed} value value to test
|
747 |
+
* @return {Boolean} true if `value` is an object, false otherwise
|
748 |
+
* @api public
|
749 |
+
*/
|
750 |
+
|
751 |
+
is.object = function (value) {
|
752 |
+
return '[object Object]' === toString.call(value);
|
753 |
+
};
|
754 |
+
|
755 |
+
/**
|
756 |
+
* is.hash
|
757 |
+
* Test if `value` is a hash - a plain object literal.
|
758 |
+
*
|
759 |
+
* @param {Mixed} value value to test
|
760 |
+
* @return {Boolean} true if `value` is a hash, false otherwise
|
761 |
+
* @api public
|
762 |
+
*/
|
763 |
+
|
764 |
+
is.hash = function (value) {
|
765 |
+
return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;
|
766 |
+
};
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Test regexp.
|
770 |
+
*/
|
771 |
+
|
772 |
+
/**
|
773 |
+
* is.regexp
|
774 |
+
* Test if `value` is a regular expression.
|
775 |
+
*
|
776 |
+
* @param {Mixed} value value to test
|
777 |
+
* @return {Boolean} true if `value` is a regexp, false otherwise
|
778 |
+
* @api public
|
779 |
+
*/
|
780 |
+
|
781 |
+
is.regexp = function (value) {
|
782 |
+
return '[object RegExp]' === toString.call(value);
|
783 |
+
};
|
784 |
+
|
785 |
+
/**
|
786 |
+
* Test string.
|
787 |
+
*/
|
788 |
+
|
789 |
+
/**
|
790 |
+
* is.string
|
791 |
+
* Test if `value` is a string.
|
792 |
+
*
|
793 |
+
* @param {Mixed} value value to test
|
794 |
+
* @return {Boolean} true if 'value' is a string, false otherwise
|
795 |
+
* @api public
|
796 |
+
*/
|
797 |
+
|
798 |
+
is.string = function (value) {
|
799 |
+
return '[object String]' === toString.call(value);
|
800 |
+
};
|
801 |
+
|
802 |
+
/**
|
803 |
+
* Test base64 string.
|
804 |
+
*/
|
805 |
+
|
806 |
+
/**
|
807 |
+
* is.base64
|
808 |
+
* Test if `value` is a valid base64 encoded string.
|
809 |
+
*
|
810 |
+
* @param {Mixed} value value to test
|
811 |
+
* @return {Boolean} true if 'value' is a base64 encoded string, false otherwise
|
812 |
+
* @api public
|
813 |
+
*/
|
814 |
+
|
815 |
+
is.base64 = function (value) {
|
816 |
+
return is.string(value) && (!value.length || base64Regex.test(value));
|
817 |
+
};
|
818 |
+
|
819 |
+
/**
|
820 |
+
* Test base64 string.
|
821 |
+
*/
|
822 |
+
|
823 |
+
/**
|
824 |
+
* is.hex
|
825 |
+
* Test if `value` is a valid hex encoded string.
|
826 |
+
*
|
827 |
+
* @param {Mixed} value value to test
|
828 |
+
* @return {Boolean} true if 'value' is a hex encoded string, false otherwise
|
829 |
+
* @api public
|
830 |
+
*/
|
831 |
+
|
832 |
+
is.hex = function (value) {
|
833 |
+
return is.string(value) && (!value.length || hexRegex.test(value));
|
834 |
+
};
|
835 |
+
|
836 |
+
},{}],4:[function(_dereq_,module,exports){
|
837 |
+
(function (global){
|
838 |
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.qj||(f.qj={})).js=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
839 |
+
var QJ, rreturn, rtrim;
|
840 |
+
|
841 |
+
QJ = function(selector) {
|
842 |
+
if (QJ.isDOMElement(selector)) {
|
843 |
+
return selector;
|
844 |
+
}
|
845 |
+
return document.querySelectorAll(selector);
|
846 |
+
};
|
847 |
+
|
848 |
+
QJ.isDOMElement = function(el) {
|
849 |
+
return el && (el.nodeName != null);
|
850 |
+
};
|
851 |
+
|
852 |
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
853 |
+
|
854 |
+
QJ.trim = function(text) {
|
855 |
+
if (text === null) {
|
856 |
+
return "";
|
857 |
+
} else {
|
858 |
+
return (text + "").replace(rtrim, "");
|
859 |
+
}
|
860 |
+
};
|
861 |
+
|
862 |
+
rreturn = /\r/g;
|
863 |
+
|
864 |
+
QJ.val = function(el, val) {
|
865 |
+
var ret;
|
866 |
+
if (arguments.length > 1) {
|
867 |
+
return el.value = val;
|
868 |
+
} else {
|
869 |
+
ret = el.value;
|
870 |
+
if (typeof ret === "string") {
|
871 |
+
return ret.replace(rreturn, "");
|
872 |
+
} else {
|
873 |
+
if (ret === null) {
|
874 |
+
return "";
|
875 |
+
} else {
|
876 |
+
return ret;
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
};
|
881 |
+
|
882 |
+
QJ.preventDefault = function(eventObject) {
|
883 |
+
if (typeof eventObject.preventDefault === "function") {
|
884 |
+
eventObject.preventDefault();
|
885 |
+
return;
|
886 |
+
}
|
887 |
+
eventObject.returnValue = false;
|
888 |
+
return false;
|
889 |
+
};
|
890 |
+
|
891 |
+
QJ.normalizeEvent = function(e) {
|
892 |
+
var original;
|
893 |
+
original = e;
|
894 |
+
e = {
|
895 |
+
which: original.which != null ? original.which : void 0,
|
896 |
+
target: original.target || original.srcElement,
|
897 |
+
preventDefault: function() {
|
898 |
+
return QJ.preventDefault(original);
|
899 |
+
},
|
900 |
+
originalEvent: original,
|
901 |
+
data: original.data || original.detail
|
902 |
+
};
|
903 |
+
if (e.which == null) {
|
904 |
+
e.which = original.charCode != null ? original.charCode : original.keyCode;
|
905 |
+
}
|
906 |
+
return e;
|
907 |
+
};
|
908 |
+
|
909 |
+
QJ.on = function(element, eventName, callback) {
|
910 |
+
var el, multEventName, originalCallback, _i, _j, _len, _len1, _ref;
|
911 |
+
if (element.length) {
|
912 |
+
for (_i = 0, _len = element.length; _i < _len; _i++) {
|
913 |
+
el = element[_i];
|
914 |
+
QJ.on(el, eventName, callback);
|
915 |
+
}
|
916 |
+
return;
|
917 |
+
}
|
918 |
+
if (eventName.match(" ")) {
|
919 |
+
_ref = eventName.split(" ");
|
920 |
+
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
|
921 |
+
multEventName = _ref[_j];
|
922 |
+
QJ.on(element, multEventName, callback);
|
923 |
+
}
|
924 |
+
return;
|
925 |
+
}
|
926 |
+
originalCallback = callback;
|
927 |
+
callback = function(e) {
|
928 |
+
e = QJ.normalizeEvent(e);
|
929 |
+
return originalCallback(e);
|
930 |
+
};
|
931 |
+
if (element.addEventListener) {
|
932 |
+
return element.addEventListener(eventName, callback, false);
|
933 |
+
}
|
934 |
+
if (element.attachEvent) {
|
935 |
+
eventName = "on" + eventName;
|
936 |
+
return element.attachEvent(eventName, callback);
|
937 |
+
}
|
938 |
+
element['on' + eventName] = callback;
|
939 |
+
};
|
940 |
+
|
941 |
+
QJ.addClass = function(el, className) {
|
942 |
+
var e;
|
943 |
+
if (el.length) {
|
944 |
+
return (function() {
|
945 |
+
var _i, _len, _results;
|
946 |
+
_results = [];
|
947 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
948 |
+
e = el[_i];
|
949 |
+
_results.push(QJ.addClass(e, className));
|
950 |
+
}
|
951 |
+
return _results;
|
952 |
+
})();
|
953 |
+
}
|
954 |
+
if (el.classList) {
|
955 |
+
return el.classList.add(className);
|
956 |
+
} else {
|
957 |
+
return el.className += ' ' + className;
|
958 |
+
}
|
959 |
+
};
|
960 |
+
|
961 |
+
QJ.hasClass = function(el, className) {
|
962 |
+
var e, hasClass, _i, _len;
|
963 |
+
if (el.length) {
|
964 |
+
hasClass = true;
|
965 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
966 |
+
e = el[_i];
|
967 |
+
hasClass = hasClass && QJ.hasClass(e, className);
|
968 |
+
}
|
969 |
+
return hasClass;
|
970 |
+
}
|
971 |
+
if (el.classList) {
|
972 |
+
return el.classList.contains(className);
|
973 |
+
} else {
|
974 |
+
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
|
975 |
+
}
|
976 |
+
};
|
977 |
+
|
978 |
+
QJ.removeClass = function(el, className) {
|
979 |
+
var cls, e, _i, _len, _ref, _results;
|
980 |
+
if (el.length) {
|
981 |
+
return (function() {
|
982 |
+
var _i, _len, _results;
|
983 |
+
_results = [];
|
984 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
985 |
+
e = el[_i];
|
986 |
+
_results.push(QJ.removeClass(e, className));
|
987 |
+
}
|
988 |
+
return _results;
|
989 |
+
})();
|
990 |
+
}
|
991 |
+
if (el.classList) {
|
992 |
+
_ref = className.split(' ');
|
993 |
+
_results = [];
|
994 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
995 |
+
cls = _ref[_i];
|
996 |
+
_results.push(el.classList.remove(cls));
|
997 |
+
}
|
998 |
+
return _results;
|
999 |
+
} else {
|
1000 |
+
return el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
1001 |
+
}
|
1002 |
+
};
|
1003 |
+
|
1004 |
+
QJ.toggleClass = function(el, className, bool) {
|
1005 |
+
var e;
|
1006 |
+
if (el.length) {
|
1007 |
+
return (function() {
|
1008 |
+
var _i, _len, _results;
|
1009 |
+
_results = [];
|
1010 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1011 |
+
e = el[_i];
|
1012 |
+
_results.push(QJ.toggleClass(e, className, bool));
|
1013 |
+
}
|
1014 |
+
return _results;
|
1015 |
+
})();
|
1016 |
+
}
|
1017 |
+
if (bool) {
|
1018 |
+
if (!QJ.hasClass(el, className)) {
|
1019 |
+
return QJ.addClass(el, className);
|
1020 |
+
}
|
1021 |
+
} else {
|
1022 |
+
return QJ.removeClass(el, className);
|
1023 |
+
}
|
1024 |
+
};
|
1025 |
+
|
1026 |
+
QJ.append = function(el, toAppend) {
|
1027 |
+
var e;
|
1028 |
+
if (el.length) {
|
1029 |
+
return (function() {
|
1030 |
+
var _i, _len, _results;
|
1031 |
+
_results = [];
|
1032 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1033 |
+
e = el[_i];
|
1034 |
+
_results.push(QJ.append(e, toAppend));
|
1035 |
+
}
|
1036 |
+
return _results;
|
1037 |
+
})();
|
1038 |
+
}
|
1039 |
+
return el.insertAdjacentHTML('beforeend', toAppend);
|
1040 |
+
};
|
1041 |
+
|
1042 |
+
QJ.find = function(el, selector) {
|
1043 |
+
if (el instanceof NodeList || el instanceof Array) {
|
1044 |
+
el = el[0];
|
1045 |
+
}
|
1046 |
+
return el.querySelectorAll(selector);
|
1047 |
+
};
|
1048 |
+
|
1049 |
+
QJ.trigger = function(el, name, data) {
|
1050 |
+
var e, ev;
|
1051 |
+
try {
|
1052 |
+
ev = new CustomEvent(name, {
|
1053 |
+
detail: data
|
1054 |
+
});
|
1055 |
+
} catch (_error) {
|
1056 |
+
e = _error;
|
1057 |
+
ev = document.createEvent('CustomEvent');
|
1058 |
+
if (ev.initCustomEvent) {
|
1059 |
+
ev.initCustomEvent(name, true, true, data);
|
1060 |
+
} else {
|
1061 |
+
ev.initEvent(name, true, true, data);
|
1062 |
+
}
|
1063 |
+
}
|
1064 |
+
return el.dispatchEvent(ev);
|
1065 |
+
};
|
1066 |
+
|
1067 |
+
module.exports = QJ;
|
1068 |
+
|
1069 |
+
|
1070 |
+
},{}]},{},[1])
|
1071 |
+
(1)
|
1072 |
+
});
|
1073 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1074 |
+
},{}],5:[function(_dereq_,module,exports){
|
1075 |
+
module.exports = _dereq_('cssify');
|
1076 |
+
},{"cssify":6}],6:[function(_dereq_,module,exports){
|
1077 |
+
module.exports = function (css, customDocument) {
|
1078 |
+
var doc = customDocument || document;
|
1079 |
+
if (doc.createStyleSheet) {
|
1080 |
+
doc.createStyleSheet().cssText = css;
|
1081 |
+
} else {
|
1082 |
+
var head = doc.getElementsByTagName('head')[0],
|
1083 |
+
style = doc.createElement('style');
|
1084 |
+
|
1085 |
+
style.type = 'text/css';
|
1086 |
+
|
1087 |
+
if (style.styleSheet) {
|
1088 |
+
style.styleSheet.cssText = css;
|
1089 |
+
} else {
|
1090 |
+
style.appendChild(doc.createTextNode(css));
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
head.appendChild(style);
|
1094 |
+
}
|
1095 |
+
};
|
1096 |
+
|
1097 |
+
module.exports.byUrl = function(url) {
|
1098 |
+
if (document.createStyleSheet) {
|
1099 |
+
document.createStyleSheet(url);
|
1100 |
+
} else {
|
1101 |
+
var head = document.getElementsByTagName('head')[0],
|
1102 |
+
link = document.createElement('link');
|
1103 |
+
|
1104 |
+
link.rel = 'stylesheet';
|
1105 |
+
link.href = url;
|
1106 |
+
|
1107 |
+
head.appendChild(link);
|
1108 |
+
}
|
1109 |
+
};
|
1110 |
+
|
1111 |
+
},{}],7:[function(_dereq_,module,exports){
|
1112 |
+
(function (global){
|
1113 |
+
var Card, QJ, extend, payment;
|
1114 |
+
|
1115 |
+
_dereq_('../scss/card.scss');
|
1116 |
+
|
1117 |
+
QJ = _dereq_('qj');
|
1118 |
+
|
1119 |
+
payment = _dereq_('./payment/src/payment.coffee');
|
1120 |
+
|
1121 |
+
extend = _dereq_('node.extend');
|
1122 |
+
|
1123 |
+
Card = (function() {
|
1124 |
+
var bindVal;
|
1125 |
+
|
1126 |
+
Card.prototype.cardTemplate = '' + '<div class="jp-card-container">' + '<div class="jp-card">' + '<div class="jp-card-front">' + '<div class="jp-card-logo jp-card-visa">visa</div>' + '<div class="jp-card-logo jp-card-mastercard">MasterCard</div>' + '<div class="jp-card-logo jp-card-maestro">Maestro</div>' + '<div class="jp-card-logo jp-card-amex"></div>' + '<div class="jp-card-logo jp-card-discover">discover</div>' + '<div class="jp-card-logo jp-card-dankort"><div class="dk"><div class="d"></div><div class="k"></div></div></div>' + '<div class="jp-card-lower">' + '<div class="jp-card-shiny"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-number jp-card-display">{{number}}</div>' + '<div class="jp-card-name jp-card-display">{{name}}</div>' + '<div class="jp-card-expiry jp-card-display" data-before="{{monthYear}}" data-after="{{validDate}}">{{expiry}}</div>' + '</div>' + '</div>' + '<div class="jp-card-back">' + '<div class="jp-card-bar"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-shiny"></div>' + '</div>' + '</div>' + '</div>';
|
1127 |
+
|
1128 |
+
Card.prototype.template = function(tpl, data) {
|
1129 |
+
return tpl.replace(/\{\{(.*?)\}\}/g, function(match, key, str) {
|
1130 |
+
return data[key];
|
1131 |
+
});
|
1132 |
+
};
|
1133 |
+
|
1134 |
+
Card.prototype.cardTypes = ['jp-card-amex', 'jp-card-dankort', 'jp-card-dinersclub', 'jp-card-discover', 'jp-card-jcb', 'jp-card-laser', 'jp-card-maestro', 'jp-card-mastercard', 'jp-card-unionpay', 'jp-card-visa', 'jp-card-visaelectron'];
|
1135 |
+
|
1136 |
+
Card.prototype.defaults = {
|
1137 |
+
formatting: true,
|
1138 |
+
formSelectors: {
|
1139 |
+
numberInput: 'input[name="number"]',
|
1140 |
+
expiryInput: 'input[name="expiry"]',
|
1141 |
+
cvcInput: 'input[name="cvc"]',
|
1142 |
+
nameInput: 'input[name="name"]'
|
1143 |
+
},
|
1144 |
+
cardSelectors: {
|
1145 |
+
cardContainer: '.jp-card-container',
|
1146 |
+
card: '.jp-card',
|
1147 |
+
numberDisplay: '.jp-card-number',
|
1148 |
+
expiryDisplay: '.jp-card-expiry',
|
1149 |
+
cvcDisplay: '.jp-card-cvc',
|
1150 |
+
nameDisplay: '.jp-card-name'
|
1151 |
+
},
|
1152 |
+
messages: {
|
1153 |
+
validDate: 'valid\nthru',
|
1154 |
+
monthYear: 'month/year'
|
1155 |
+
},
|
1156 |
+
values: {
|
1157 |
+
number: '•••• •••• •••• ••••',
|
1158 |
+
cvc: '•••',
|
1159 |
+
expiry: '••/••',
|
1160 |
+
name: 'Full Name'
|
1161 |
+
},
|
1162 |
+
classes: {
|
1163 |
+
valid: 'jp-card-valid',
|
1164 |
+
invalid: 'jp-card-invalid'
|
1165 |
+
},
|
1166 |
+
debug: false
|
1167 |
+
};
|
1168 |
+
|
1169 |
+
function Card(opts) {
|
1170 |
+
this.options = extend(true, this.defaults, opts);
|
1171 |
+
if (!this.options.form) {
|
1172 |
+
console.log("Please provide a form");
|
1173 |
+
return;
|
1174 |
+
}
|
1175 |
+
this.$el = QJ(this.options.form);
|
1176 |
+
if (!this.options.container) {
|
1177 |
+
console.log("Please provide a container");
|
1178 |
+
return;
|
1179 |
+
}
|
1180 |
+
this.$container = QJ(this.options.container);
|
1181 |
+
this.render();
|
1182 |
+
this.attachHandlers();
|
1183 |
+
this.handleInitialValues();
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
Card.prototype.render = function() {
|
1187 |
+
var $cardContainer, baseWidth, name, obj, selector, ua, _ref, _ref1;
|
1188 |
+
QJ.append(this.$container, this.template(this.cardTemplate, extend({}, this.options.messages, this.options.values)));
|
1189 |
+
_ref = this.options.cardSelectors;
|
1190 |
+
for (name in _ref) {
|
1191 |
+
selector = _ref[name];
|
1192 |
+
this["$" + name] = QJ.find(this.$container, selector);
|
1193 |
+
}
|
1194 |
+
_ref1 = this.options.formSelectors;
|
1195 |
+
for (name in _ref1) {
|
1196 |
+
selector = _ref1[name];
|
1197 |
+
selector = this.options[name] ? this.options[name] : selector;
|
1198 |
+
obj = QJ.find(this.$el, selector);
|
1199 |
+
if (!obj.length && this.options.debug) {
|
1200 |
+
console.error("Card can't find a " + name + " in your form.");
|
1201 |
+
}
|
1202 |
+
this["$" + name] = obj;
|
1203 |
+
}
|
1204 |
+
if (this.options.formatting) {
|
1205 |
+
Payment.formatCardNumber(this.$numberInput);
|
1206 |
+
Payment.formatCardCVC(this.$cvcInput);
|
1207 |
+
if (this.$expiryInput.length === 1) {
|
1208 |
+
Payment.formatCardExpiry(this.$expiryInput);
|
1209 |
+
}
|
1210 |
+
}
|
1211 |
+
if (this.options.width) {
|
1212 |
+
$cardContainer = QJ(this.options.cardSelectors.cardContainer)[0];
|
1213 |
+
baseWidth = parseInt($cardContainer.clientWidth);
|
1214 |
+
$cardContainer.style.transform = "scale(" + (this.options.width / baseWidth) + ")";
|
1215 |
+
}
|
1216 |
+
if (typeof navigator !== "undefined" && navigator !== null ? navigator.userAgent : void 0) {
|
1217 |
+
ua = navigator.userAgent.toLowerCase();
|
1218 |
+
if (ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1) {
|
1219 |
+
QJ.addClass(this.$card, 'jp-card-safari');
|
1220 |
+
}
|
1221 |
+
}
|
1222 |
+
if (/MSIE 10\./i.test(navigator.userAgent)) {
|
1223 |
+
QJ.addClass(this.$card, 'jp-card-ie-10');
|
1224 |
+
}
|
1225 |
+
if (/rv:11.0/i.test(navigator.userAgent)) {
|
1226 |
+
return QJ.addClass(this.$card, 'jp-card-ie-11');
|
1227 |
+
}
|
1228 |
+
};
|
1229 |
+
|
1230 |
+
Card.prototype.attachHandlers = function() {
|
1231 |
+
var expiryFilters;
|
1232 |
+
bindVal(this.$numberInput, this.$numberDisplay, {
|
1233 |
+
fill: false,
|
1234 |
+
filters: this.validToggler('cardNumber')
|
1235 |
+
});
|
1236 |
+
QJ.on(this.$numberInput, 'payment.cardType', this.handle('setCardType'));
|
1237 |
+
expiryFilters = [
|
1238 |
+
function(val) {
|
1239 |
+
return val.replace(/(\s+)/g, '');
|
1240 |
+
}
|
1241 |
+
];
|
1242 |
+
if (this.$expiryInput.length === 1) {
|
1243 |
+
expiryFilters.push(this.validToggler('cardExpiry'));
|
1244 |
+
}
|
1245 |
+
bindVal(this.$expiryInput, this.$expiryDisplay, {
|
1246 |
+
join: function(text) {
|
1247 |
+
if (text[0].length === 2 || text[1]) {
|
1248 |
+
return "/";
|
1249 |
+
} else {
|
1250 |
+
return "";
|
1251 |
+
}
|
1252 |
+
},
|
1253 |
+
filters: expiryFilters
|
1254 |
+
});
|
1255 |
+
bindVal(this.$cvcInput, this.$cvcDisplay, {
|
1256 |
+
filters: this.validToggler('cardCVC')
|
1257 |
+
});
|
1258 |
+
QJ.on(this.$cvcInput, 'focus', this.handle('flipCard'));
|
1259 |
+
QJ.on(this.$cvcInput, 'blur', this.handle('unflipCard'));
|
1260 |
+
return bindVal(this.$nameInput, this.$nameDisplay, {
|
1261 |
+
fill: false,
|
1262 |
+
filters: this.validToggler('cardHolderName'),
|
1263 |
+
join: ' '
|
1264 |
+
});
|
1265 |
+
};
|
1266 |
+
|
1267 |
+
Card.prototype.handleInitialValues = function() {
|
1268 |
+
var el, name, selector, _ref, _results;
|
1269 |
+
_ref = this.options.formSelectors;
|
1270 |
+
_results = [];
|
1271 |
+
for (name in _ref) {
|
1272 |
+
selector = _ref[name];
|
1273 |
+
el = this["$" + name];
|
1274 |
+
if (QJ.val(el)) {
|
1275 |
+
QJ.trigger(el, 'paste');
|
1276 |
+
_results.push(setTimeout(function() {
|
1277 |
+
return QJ.trigger(el, 'keyup');
|
1278 |
+
}));
|
1279 |
+
} else {
|
1280 |
+
_results.push(void 0);
|
1281 |
+
}
|
1282 |
+
}
|
1283 |
+
return _results;
|
1284 |
+
};
|
1285 |
+
|
1286 |
+
Card.prototype.handle = function(fn) {
|
1287 |
+
return (function(_this) {
|
1288 |
+
return function(e) {
|
1289 |
+
var args;
|
1290 |
+
args = Array.prototype.slice.call(arguments);
|
1291 |
+
args.unshift(e.target);
|
1292 |
+
return _this.handlers[fn].apply(_this, args);
|
1293 |
+
};
|
1294 |
+
})(this);
|
1295 |
+
};
|
1296 |
+
|
1297 |
+
Card.prototype.validToggler = function(validatorName) {
|
1298 |
+
var isValid;
|
1299 |
+
if (validatorName === "cardExpiry") {
|
1300 |
+
isValid = function(val) {
|
1301 |
+
var objVal;
|
1302 |
+
objVal = Payment.fns.cardExpiryVal(val);
|
1303 |
+
return Payment.fns.validateCardExpiry(objVal.month, objVal.year);
|
1304 |
+
};
|
1305 |
+
} else if (validatorName === "cardCVC") {
|
1306 |
+
isValid = (function(_this) {
|
1307 |
+
return function(val) {
|
1308 |
+
return Payment.fns.validateCardCVC(val, _this.cardType);
|
1309 |
+
};
|
1310 |
+
})(this);
|
1311 |
+
} else if (validatorName === "cardNumber") {
|
1312 |
+
isValid = function(val) {
|
1313 |
+
return Payment.fns.validateCardNumber(val);
|
1314 |
+
};
|
1315 |
+
} else if (validatorName === "cardHolderName") {
|
1316 |
+
isValid = function(val) {
|
1317 |
+
return val !== "";
|
1318 |
+
};
|
1319 |
+
}
|
1320 |
+
return (function(_this) {
|
1321 |
+
return function(val, $in, $out) {
|
1322 |
+
var result;
|
1323 |
+
result = isValid(val);
|
1324 |
+
_this.toggleValidClass($in, result);
|
1325 |
+
_this.toggleValidClass($out, result);
|
1326 |
+
return val;
|
1327 |
+
};
|
1328 |
+
})(this);
|
1329 |
+
};
|
1330 |
+
|
1331 |
+
Card.prototype.toggleValidClass = function(el, test) {
|
1332 |
+
QJ.toggleClass(el, this.options.classes.valid, test);
|
1333 |
+
return QJ.toggleClass(el, this.options.classes.invalid, !test);
|
1334 |
+
};
|
1335 |
+
|
1336 |
+
Card.prototype.handlers = {
|
1337 |
+
setCardType: function($el, e) {
|
1338 |
+
var cardType;
|
1339 |
+
cardType = e.data;
|
1340 |
+
if (!QJ.hasClass(this.$card, cardType)) {
|
1341 |
+
QJ.removeClass(this.$card, 'jp-card-unknown');
|
1342 |
+
QJ.removeClass(this.$card, this.cardTypes.join(' '));
|
1343 |
+
QJ.addClass(this.$card, "jp-card-" + cardType);
|
1344 |
+
QJ.toggleClass(this.$card, 'jp-card-identified', cardType !== 'unknown');
|
1345 |
+
return this.cardType = cardType;
|
1346 |
+
}
|
1347 |
+
},
|
1348 |
+
flipCard: function() {
|
1349 |
+
return QJ.addClass(this.$card, 'jp-card-flipped');
|
1350 |
+
},
|
1351 |
+
unflipCard: function() {
|
1352 |
+
return QJ.removeClass(this.$card, 'jp-card-flipped');
|
1353 |
+
}
|
1354 |
+
};
|
1355 |
+
|
1356 |
+
bindVal = function(el, out, opts) {
|
1357 |
+
var joiner, o, outDefaults;
|
1358 |
+
if (opts == null) {
|
1359 |
+
opts = {};
|
1360 |
+
}
|
1361 |
+
opts.fill = opts.fill || false;
|
1362 |
+
opts.filters = opts.filters || [];
|
1363 |
+
if (!(opts.filters instanceof Array)) {
|
1364 |
+
opts.filters = [opts.filters];
|
1365 |
+
}
|
1366 |
+
opts.join = opts.join || "";
|
1367 |
+
if (!(typeof opts.join === "function")) {
|
1368 |
+
joiner = opts.join;
|
1369 |
+
opts.join = function() {
|
1370 |
+
return joiner;
|
1371 |
+
};
|
1372 |
+
}
|
1373 |
+
outDefaults = (function() {
|
1374 |
+
var _i, _len, _results;
|
1375 |
+
_results = [];
|
1376 |
+
for (_i = 0, _len = out.length; _i < _len; _i++) {
|
1377 |
+
o = out[_i];
|
1378 |
+
_results.push(o.textContent);
|
1379 |
+
}
|
1380 |
+
return _results;
|
1381 |
+
})();
|
1382 |
+
QJ.on(el, 'focus', function() {
|
1383 |
+
return QJ.addClass(out, 'jp-card-focused');
|
1384 |
+
});
|
1385 |
+
QJ.on(el, 'blur', function() {
|
1386 |
+
return QJ.removeClass(el, 'jp-card-focused');
|
1387 |
+
});
|
1388 |
+
QJ.on(el, 'keyup change paste', function(e) {
|
1389 |
+
var elem, filter, i, join, outEl, outVal, val, _i, _j, _len, _len1, _ref, _results;
|
1390 |
+
val = (function() {
|
1391 |
+
var _i, _len, _results;
|
1392 |
+
_results = [];
|
1393 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1394 |
+
elem = el[_i];
|
1395 |
+
_results.push(QJ.val(elem));
|
1396 |
+
}
|
1397 |
+
return _results;
|
1398 |
+
})();
|
1399 |
+
join = opts.join(val);
|
1400 |
+
val = val.join(join);
|
1401 |
+
if (val === join) {
|
1402 |
+
val = "";
|
1403 |
+
}
|
1404 |
+
_ref = opts.filters;
|
1405 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1406 |
+
filter = _ref[_i];
|
1407 |
+
val = filter(val, el, out);
|
1408 |
+
}
|
1409 |
+
_results = [];
|
1410 |
+
for (i = _j = 0, _len1 = out.length; _j < _len1; i = ++_j) {
|
1411 |
+
outEl = out[i];
|
1412 |
+
if (opts.fill) {
|
1413 |
+
outVal = val + outDefaults[i].substring(val.length);
|
1414 |
+
} else {
|
1415 |
+
outVal = val || outDefaults[i];
|
1416 |
+
}
|
1417 |
+
_results.push(outEl.textContent = outVal);
|
1418 |
+
}
|
1419 |
+
return _results;
|
1420 |
+
});
|
1421 |
+
return el;
|
1422 |
+
};
|
1423 |
+
|
1424 |
+
return Card;
|
1425 |
+
|
1426 |
+
})();
|
1427 |
+
|
1428 |
+
module.exports = Card;
|
1429 |
+
|
1430 |
+
global.Card = Card;
|
1431 |
+
|
1432 |
+
|
1433 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1434 |
+
},{"../scss/card.scss":9,"./payment/src/payment.coffee":8,"node.extend":1,"qj":4}],8:[function(_dereq_,module,exports){
|
1435 |
+
(function (global){
|
1436 |
+
var Payment, QJ, cardFromNumber, cardFromType, cards, defaultFormat, formatBackCardNumber, formatBackExpiry, formatCardNumber, formatExpiry, formatForwardExpiry, formatForwardSlash, hasTextSelected, luhnCheck, reFormatCardNumber, restrictCVC, restrictCardNumber, restrictExpiry, restrictNumeric, setCardType,
|
1437 |
+
__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; };
|
1438 |
+
|
1439 |
+
QJ = _dereq_('qj');
|
1440 |
+
|
1441 |
+
defaultFormat = /(\d{1,4})/g;
|
1442 |
+
|
1443 |
+
cards = [
|
1444 |
+
{
|
1445 |
+
type: 'amex',
|
1446 |
+
pattern: /^3[47]/,
|
1447 |
+
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
|
1448 |
+
length: [15],
|
1449 |
+
cvcLength: [3, 4],
|
1450 |
+
luhn: true
|
1451 |
+
}, {
|
1452 |
+
type: 'dankort',
|
1453 |
+
pattern: /^5019/,
|
1454 |
+
format: defaultFormat,
|
1455 |
+
length: [16],
|
1456 |
+
cvcLength: [3],
|
1457 |
+
luhn: true
|
1458 |
+
}, {
|
1459 |
+
type: 'dinersclub',
|
1460 |
+
pattern: /^(36|38|30[0-5])/,
|
1461 |
+
format: defaultFormat,
|
1462 |
+
length: [14],
|
1463 |
+
cvcLength: [3],
|
1464 |
+
luhn: true
|
1465 |
+
}, {
|
1466 |
+
type: 'discover',
|
1467 |
+
pattern: /^(6011|65|64[4-9]|622)/,
|
1468 |
+
format: defaultFormat,
|
1469 |
+
length: [16],
|
1470 |
+
cvcLength: [3],
|
1471 |
+
luhn: true
|
1472 |
+
}, {
|
1473 |
+
type: 'jcb',
|
1474 |
+
pattern: /^35/,
|
1475 |
+
format: defaultFormat,
|
1476 |
+
length: [16],
|
1477 |
+
cvcLength: [3],
|
1478 |
+
luhn: true
|
1479 |
+
}, {
|
1480 |
+
type: 'laser',
|
1481 |
+
pattern: /^(6706|6771|6709)/,
|
1482 |
+
format: defaultFormat,
|
1483 |
+
length: [16, 17, 18, 19],
|
1484 |
+
cvcLength: [3],
|
1485 |
+
luhn: true
|
1486 |
+
}, {
|
1487 |
+
type: 'maestro',
|
1488 |
+
pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
|
1489 |
+
format: defaultFormat,
|
1490 |
+
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
1491 |
+
cvcLength: [3],
|
1492 |
+
luhn: true
|
1493 |
+
}, {
|
1494 |
+
type: 'mastercard',
|
1495 |
+
pattern: /^5[1-5]/,
|
1496 |
+
format: defaultFormat,
|
1497 |
+
length: [16],
|
1498 |
+
cvcLength: [3],
|
1499 |
+
luhn: true
|
1500 |
+
}, {
|
1501 |
+
type: 'unionpay',
|
1502 |
+
pattern: /^62/,
|
1503 |
+
format: defaultFormat,
|
1504 |
+
length: [16, 17, 18, 19],
|
1505 |
+
cvcLength: [3],
|
1506 |
+
luhn: false
|
1507 |
+
}, {
|
1508 |
+
type: 'visaelectron',
|
1509 |
+
pattern: /^4(026|17500|405|508|844|91[37])/,
|
1510 |
+
format: defaultFormat,
|
1511 |
+
length: [16],
|
1512 |
+
cvcLength: [3],
|
1513 |
+
luhn: true
|
1514 |
+
}, {
|
1515 |
+
type: 'visa',
|
1516 |
+
pattern: /^4/,
|
1517 |
+
format: defaultFormat,
|
1518 |
+
length: [13, 14, 15, 16],
|
1519 |
+
cvcLength: [3],
|
1520 |
+
luhn: true
|
1521 |
+
}
|
1522 |
+
];
|
1523 |
+
|
1524 |
+
cardFromNumber = function(num) {
|
1525 |
+
var card, _i, _len;
|
1526 |
+
num = (num + '').replace(/\D/g, '');
|
1527 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1528 |
+
card = cards[_i];
|
1529 |
+
if (card.pattern.test(num)) {
|
1530 |
+
return card;
|
1531 |
+
}
|
1532 |
+
}
|
1533 |
+
};
|
1534 |
+
|
1535 |
+
cardFromType = function(type) {
|
1536 |
+
var card, _i, _len;
|
1537 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1538 |
+
card = cards[_i];
|
1539 |
+
if (card.type === type) {
|
1540 |
+
return card;
|
1541 |
+
}
|
1542 |
+
}
|
1543 |
+
};
|
1544 |
+
|
1545 |
+
luhnCheck = function(num) {
|
1546 |
+
var digit, digits, odd, sum, _i, _len;
|
1547 |
+
odd = true;
|
1548 |
+
sum = 0;
|
1549 |
+
digits = (num + '').split('').reverse();
|
1550 |
+
for (_i = 0, _len = digits.length; _i < _len; _i++) {
|
1551 |
+
digit = digits[_i];
|
1552 |
+
digit = parseInt(digit, 10);
|
1553 |
+
if ((odd = !odd)) {
|
1554 |
+
digit *= 2;
|
1555 |
+
}
|
1556 |
+
if (digit > 9) {
|
1557 |
+
digit -= 9;
|
1558 |
+
}
|
1559 |
+
sum += digit;
|
1560 |
+
}
|
1561 |
+
return sum % 10 === 0;
|
1562 |
+
};
|
1563 |
+
|
1564 |
+
hasTextSelected = function(target) {
|
1565 |
+
var _ref;
|
1566 |
+
if ((target.selectionStart != null) && target.selectionStart !== target.selectionEnd) {
|
1567 |
+
return true;
|
1568 |
+
}
|
1569 |
+
if ((typeof document !== "undefined" && document !== null ? (_ref = document.selection) != null ? _ref.createRange : void 0 : void 0) != null) {
|
1570 |
+
if (document.selection.createRange().text) {
|
1571 |
+
return true;
|
1572 |
+
}
|
1573 |
+
}
|
1574 |
+
return false;
|
1575 |
+
};
|
1576 |
+
|
1577 |
+
reFormatCardNumber = function(e) {
|
1578 |
+
return setTimeout((function(_this) {
|
1579 |
+
return function() {
|
1580 |
+
var target, value;
|
1581 |
+
target = e.target;
|
1582 |
+
value = QJ.val(target);
|
1583 |
+
value = Payment.fns.formatCardNumber(value);
|
1584 |
+
return QJ.val(target, value);
|
1585 |
+
};
|
1586 |
+
})(this));
|
1587 |
+
};
|
1588 |
+
|
1589 |
+
formatCardNumber = function(e) {
|
1590 |
+
var card, digit, length, re, target, upperLength, value;
|
1591 |
+
digit = String.fromCharCode(e.which);
|
1592 |
+
if (!/^\d+$/.test(digit)) {
|
1593 |
+
return;
|
1594 |
+
}
|
1595 |
+
target = e.target;
|
1596 |
+
value = QJ.val(target);
|
1597 |
+
card = cardFromNumber(value + digit);
|
1598 |
+
length = (value.replace(/\D/g, '') + digit).length;
|
1599 |
+
upperLength = 16;
|
1600 |
+
if (card) {
|
1601 |
+
upperLength = card.length[card.length.length - 1];
|
1602 |
+
}
|
1603 |
+
if (length >= upperLength) {
|
1604 |
+
return;
|
1605 |
+
}
|
1606 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1607 |
+
return;
|
1608 |
+
}
|
1609 |
+
if (card && card.type === 'amex') {
|
1610 |
+
re = /^(\d{4}|\d{4}\s\d{6})$/;
|
1611 |
+
} else {
|
1612 |
+
re = /(?:^|\s)(\d{4})$/;
|
1613 |
+
}
|
1614 |
+
if (re.test(value)) {
|
1615 |
+
e.preventDefault();
|
1616 |
+
return QJ.val(target, value + ' ' + digit);
|
1617 |
+
} else if (re.test(value + digit)) {
|
1618 |
+
e.preventDefault();
|
1619 |
+
return QJ.val(target, value + digit + ' ');
|
1620 |
+
}
|
1621 |
+
};
|
1622 |
+
|
1623 |
+
formatBackCardNumber = function(e) {
|
1624 |
+
var target, value;
|
1625 |
+
target = e.target;
|
1626 |
+
value = QJ.val(target);
|
1627 |
+
if (e.meta) {
|
1628 |
+
return;
|
1629 |
+
}
|
1630 |
+
if (e.which !== 8) {
|
1631 |
+
return;
|
1632 |
+
}
|
1633 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1634 |
+
return;
|
1635 |
+
}
|
1636 |
+
if (/\d\s$/.test(value)) {
|
1637 |
+
e.preventDefault();
|
1638 |
+
return QJ.val(target, value.replace(/\d\s$/, ''));
|
1639 |
+
} else if (/\s\d?$/.test(value)) {
|
1640 |
+
e.preventDefault();
|
1641 |
+
return QJ.val(target, value.replace(/\s\d?$/, ''));
|
1642 |
+
}
|
1643 |
+
};
|
1644 |
+
|
1645 |
+
formatExpiry = function(e) {
|
1646 |
+
var digit, target, val;
|
1647 |
+
digit = String.fromCharCode(e.which);
|
1648 |
+
if (!/^\d+$/.test(digit)) {
|
1649 |
+
return;
|
1650 |
+
}
|
1651 |
+
target = e.target;
|
1652 |
+
val = QJ.val(target) + digit;
|
1653 |
+
if (/^\d$/.test(val) && (val !== '0' && val !== '1')) {
|
1654 |
+
e.preventDefault();
|
1655 |
+
return QJ.val(target, "0" + val + " / ");
|
1656 |
+
} else if (/^\d\d$/.test(val)) {
|
1657 |
+
e.preventDefault();
|
1658 |
+
return QJ.val(target, "" + val + " / ");
|
1659 |
+
}
|
1660 |
+
};
|
1661 |
+
|
1662 |
+
formatForwardExpiry = function(e) {
|
1663 |
+
var digit, target, val;
|
1664 |
+
digit = String.fromCharCode(e.which);
|
1665 |
+
if (!/^\d+$/.test(digit)) {
|
1666 |
+
return;
|
1667 |
+
}
|
1668 |
+
target = e.target;
|
1669 |
+
val = QJ.val(target);
|
1670 |
+
if (/^\d\d$/.test(val)) {
|
1671 |
+
return QJ.val(target, "" + val + " / ");
|
1672 |
+
}
|
1673 |
+
};
|
1674 |
+
|
1675 |
+
formatForwardSlash = function(e) {
|
1676 |
+
var slash, target, val;
|
1677 |
+
slash = String.fromCharCode(e.which);
|
1678 |
+
if (slash !== '/') {
|
1679 |
+
return;
|
1680 |
+
}
|
1681 |
+
target = e.target;
|
1682 |
+
val = QJ.val(target);
|
1683 |
+
if (/^\d$/.test(val) && val !== '0') {
|
1684 |
+
return QJ.val(target, "0" + val + " / ");
|
1685 |
+
}
|
1686 |
+
};
|
1687 |
+
|
1688 |
+
formatBackExpiry = function(e) {
|
1689 |
+
var target, value;
|
1690 |
+
if (e.metaKey) {
|
1691 |
+
return;
|
1692 |
+
}
|
1693 |
+
target = e.target;
|
1694 |
+
value = QJ.val(target);
|
1695 |
+
if (e.which !== 8) {
|
1696 |
+
return;
|
1697 |
+
}
|
1698 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1699 |
+
return;
|
1700 |
+
}
|
1701 |
+
if (/\d(\s|\/)+$/.test(value)) {
|
1702 |
+
e.preventDefault();
|
1703 |
+
return QJ.val(target, value.replace(/\d(\s|\/)*$/, ''));
|
1704 |
+
} else if (/\s\/\s?\d?$/.test(value)) {
|
1705 |
+
e.preventDefault();
|
1706 |
+
return QJ.val(target, value.replace(/\s\/\s?\d?$/, ''));
|
1707 |
+
}
|
1708 |
+
};
|
1709 |
+
|
1710 |
+
restrictNumeric = function(e) {
|
1711 |
+
var input;
|
1712 |
+
if (e.metaKey || e.ctrlKey) {
|
1713 |
+
return true;
|
1714 |
+
}
|
1715 |
+
if (e.which === 32) {
|
1716 |
+
return e.preventDefault();
|
1717 |
+
}
|
1718 |
+
if (e.which === 0) {
|
1719 |
+
return true;
|
1720 |
+
}
|
1721 |
+
if (e.which < 33) {
|
1722 |
+
return true;
|
1723 |
+
}
|
1724 |
+
input = String.fromCharCode(e.which);
|
1725 |
+
if (!/[\d\s]/.test(input)) {
|
1726 |
+
return e.preventDefault();
|
1727 |
+
}
|
1728 |
+
};
|
1729 |
+
|
1730 |
+
restrictCardNumber = function(e) {
|
1731 |
+
var card, digit, target, value;
|
1732 |
+
target = e.target;
|
1733 |
+
digit = String.fromCharCode(e.which);
|
1734 |
+
if (!/^\d+$/.test(digit)) {
|
1735 |
+
return;
|
1736 |
+
}
|
1737 |
+
if (hasTextSelected(target)) {
|
1738 |
+
return;
|
1739 |
+
}
|
1740 |
+
value = (QJ.val(target) + digit).replace(/\D/g, '');
|
1741 |
+
card = cardFromNumber(value);
|
1742 |
+
if (card) {
|
1743 |
+
if (!(value.length <= card.length[card.length.length - 1])) {
|
1744 |
+
return e.preventDefault();
|
1745 |
+
}
|
1746 |
+
} else {
|
1747 |
+
if (!(value.length <= 16)) {
|
1748 |
+
return e.preventDefault();
|
1749 |
+
}
|
1750 |
+
}
|
1751 |
+
};
|
1752 |
+
|
1753 |
+
restrictExpiry = function(e) {
|
1754 |
+
var digit, target, value;
|
1755 |
+
target = e.target;
|
1756 |
+
digit = String.fromCharCode(e.which);
|
1757 |
+
if (!/^\d+$/.test(digit)) {
|
1758 |
+
return;
|
1759 |
+
}
|
1760 |
+
if (hasTextSelected(target)) {
|
1761 |
+
return;
|
1762 |
+
}
|
1763 |
+
value = QJ.val(target) + digit;
|
1764 |
+
value = value.replace(/\D/g, '');
|
1765 |
+
if (value.length > 6) {
|
1766 |
+
return e.preventDefault();
|
1767 |
+
}
|
1768 |
+
};
|
1769 |
+
|
1770 |
+
restrictCVC = function(e) {
|
1771 |
+
var digit, target, val;
|
1772 |
+
target = e.target;
|
1773 |
+
digit = String.fromCharCode(e.which);
|
1774 |
+
if (!/^\d+$/.test(digit)) {
|
1775 |
+
return;
|
1776 |
+
}
|
1777 |
+
val = QJ.val(target) + digit;
|
1778 |
+
if (!(val.length <= 4)) {
|
1779 |
+
return e.preventDefault();
|
1780 |
+
}
|
1781 |
+
};
|
1782 |
+
|
1783 |
+
setCardType = function(e) {
|
1784 |
+
var allTypes, card, cardType, target, val;
|
1785 |
+
target = e.target;
|
1786 |
+
val = QJ.val(target);
|
1787 |
+
cardType = Payment.fns.cardType(val) || 'unknown';
|
1788 |
+
if (!QJ.hasClass(target, cardType)) {
|
1789 |
+
allTypes = (function() {
|
1790 |
+
var _i, _len, _results;
|
1791 |
+
_results = [];
|
1792 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1793 |
+
card = cards[_i];
|
1794 |
+
_results.push(card.type);
|
1795 |
+
}
|
1796 |
+
return _results;
|
1797 |
+
})();
|
1798 |
+
QJ.removeClass(target, 'unknown');
|
1799 |
+
QJ.removeClass(target, allTypes.join(' '));
|
1800 |
+
QJ.addClass(target, cardType);
|
1801 |
+
QJ.toggleClass(target, 'identified', cardType !== 'unknown');
|
1802 |
+
return QJ.trigger(target, 'payment.cardType', cardType);
|
1803 |
+
}
|
1804 |
+
};
|
1805 |
+
|
1806 |
+
Payment = (function() {
|
1807 |
+
function Payment() {}
|
1808 |
+
|
1809 |
+
Payment.fns = {
|
1810 |
+
cardExpiryVal: function(value) {
|
1811 |
+
var month, prefix, year, _ref;
|
1812 |
+
value = value.replace(/\s/g, '');
|
1813 |
+
_ref = value.split('/', 2), month = _ref[0], year = _ref[1];
|
1814 |
+
if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
|
1815 |
+
prefix = (new Date).getFullYear();
|
1816 |
+
prefix = prefix.toString().slice(0, 2);
|
1817 |
+
year = prefix + year;
|
1818 |
+
}
|
1819 |
+
month = parseInt(month, 10);
|
1820 |
+
year = parseInt(year, 10);
|
1821 |
+
return {
|
1822 |
+
month: month,
|
1823 |
+
year: year
|
1824 |
+
};
|
1825 |
+
},
|
1826 |
+
validateCardNumber: function(num) {
|
1827 |
+
var card, _ref;
|
1828 |
+
num = (num + '').replace(/\s+|-/g, '');
|
1829 |
+
if (!/^\d+$/.test(num)) {
|
1830 |
+
return false;
|
1831 |
+
}
|
1832 |
+
card = cardFromNumber(num);
|
1833 |
+
if (!card) {
|
1834 |
+
return false;
|
1835 |
+
}
|
1836 |
+
return (_ref = num.length, __indexOf.call(card.length, _ref) >= 0) && (card.luhn === false || luhnCheck(num));
|
1837 |
+
},
|
1838 |
+
validateCardExpiry: function(month, year) {
|
1839 |
+
var currentTime, expiry, prefix, _ref;
|
1840 |
+
if (typeof month === 'object' && 'month' in month) {
|
1841 |
+
_ref = month, month = _ref.month, year = _ref.year;
|
1842 |
+
}
|
1843 |
+
if (!(month && year)) {
|
1844 |
+
return false;
|
1845 |
+
}
|
1846 |
+
month = QJ.trim(month);
|
1847 |
+
year = QJ.trim(year);
|
1848 |
+
if (!/^\d+$/.test(month)) {
|
1849 |
+
return false;
|
1850 |
+
}
|
1851 |
+
if (!/^\d+$/.test(year)) {
|
1852 |
+
return false;
|
1853 |
+
}
|
1854 |
+
if (!(parseInt(month, 10) <= 12)) {
|
1855 |
+
return false;
|
1856 |
+
}
|
1857 |
+
if (year.length === 2) {
|
1858 |
+
prefix = (new Date).getFullYear();
|
1859 |
+
prefix = prefix.toString().slice(0, 2);
|
1860 |
+
year = prefix + year;
|
1861 |
+
}
|
1862 |
+
expiry = new Date(year, month);
|
1863 |
+
currentTime = new Date;
|
1864 |
+
expiry.setMonth(expiry.getMonth() - 1);
|
1865 |
+
expiry.setMonth(expiry.getMonth() + 1, 1);
|
1866 |
+
return expiry > currentTime;
|
1867 |
+
},
|
1868 |
+
validateCardCVC: function(cvc, type) {
|
1869 |
+
var _ref, _ref1;
|
1870 |
+
cvc = QJ.trim(cvc);
|
1871 |
+
if (!/^\d+$/.test(cvc)) {
|
1872 |
+
return false;
|
1873 |
+
}
|
1874 |
+
if (type && cardFromType(type)) {
|
1875 |
+
return _ref = cvc.length, __indexOf.call((_ref1 = cardFromType(type)) != null ? _ref1.cvcLength : void 0, _ref) >= 0;
|
1876 |
+
} else {
|
1877 |
+
return cvc.length >= 3 && cvc.length <= 4;
|
1878 |
+
}
|
1879 |
+
},
|
1880 |
+
cardType: function(num) {
|
1881 |
+
var _ref;
|
1882 |
+
if (!num) {
|
1883 |
+
return null;
|
1884 |
+
}
|
1885 |
+
return ((_ref = cardFromNumber(num)) != null ? _ref.type : void 0) || null;
|
1886 |
+
},
|
1887 |
+
formatCardNumber: function(num) {
|
1888 |
+
var card, groups, upperLength, _ref;
|
1889 |
+
card = cardFromNumber(num);
|
1890 |
+
if (!card) {
|
1891 |
+
return num;
|
1892 |
+
}
|
1893 |
+
upperLength = card.length[card.length.length - 1];
|
1894 |
+
num = num.replace(/\D/g, '');
|
1895 |
+
num = num.slice(0, +upperLength + 1 || 9e9);
|
1896 |
+
if (card.format.global) {
|
1897 |
+
return (_ref = num.match(card.format)) != null ? _ref.join(' ') : void 0;
|
1898 |
+
} else {
|
1899 |
+
groups = card.format.exec(num);
|
1900 |
+
if (groups != null) {
|
1901 |
+
groups.shift();
|
1902 |
+
}
|
1903 |
+
return groups != null ? groups.join(' ') : void 0;
|
1904 |
+
}
|
1905 |
+
}
|
1906 |
+
};
|
1907 |
+
|
1908 |
+
Payment.restrictNumeric = function(el) {
|
1909 |
+
return QJ.on(el, 'keypress', restrictNumeric);
|
1910 |
+
};
|
1911 |
+
|
1912 |
+
Payment.cardExpiryVal = function(el) {
|
1913 |
+
return Payment.fns.cardExpiryVal(QJ.val(el));
|
1914 |
+
};
|
1915 |
+
|
1916 |
+
Payment.formatCardCVC = function(el) {
|
1917 |
+
Payment.restrictNumeric(el);
|
1918 |
+
QJ.on(el, 'keypress', restrictCVC);
|
1919 |
+
return el;
|
1920 |
+
};
|
1921 |
+
|
1922 |
+
Payment.formatCardExpiry = function(el) {
|
1923 |
+
Payment.restrictNumeric(el);
|
1924 |
+
QJ.on(el, 'keypress', restrictExpiry);
|
1925 |
+
QJ.on(el, 'keypress', formatExpiry);
|
1926 |
+
QJ.on(el, 'keypress', formatForwardSlash);
|
1927 |
+
QJ.on(el, 'keypress', formatForwardExpiry);
|
1928 |
+
QJ.on(el, 'keydown', formatBackExpiry);
|
1929 |
+
return el;
|
1930 |
+
};
|
1931 |
+
|
1932 |
+
Payment.formatCardNumber = function(el) {
|
1933 |
+
Payment.restrictNumeric(el);
|
1934 |
+
QJ.on(el, 'keypress', restrictCardNumber);
|
1935 |
+
QJ.on(el, 'keypress', formatCardNumber);
|
1936 |
+
QJ.on(el, 'keydown', formatBackCardNumber);
|
1937 |
+
QJ.on(el, 'keyup', setCardType);
|
1938 |
+
QJ.on(el, 'paste', reFormatCardNumber);
|
1939 |
+
return el;
|
1940 |
+
};
|
1941 |
+
|
1942 |
+
Payment.getCardArray = function() {
|
1943 |
+
return cards;
|
1944 |
+
};
|
1945 |
+
|
1946 |
+
Payment.setCardArray = function(cardArray) {
|
1947 |
+
cards = cardArray;
|
1948 |
+
return true;
|
1949 |
+
};
|
1950 |
+
|
1951 |
+
Payment.addToCardArray = function(cardObject) {
|
1952 |
+
return cards.push(cardObject);
|
1953 |
+
};
|
1954 |
+
|
1955 |
+
Payment.removeFromCardArray = function(type) {
|
1956 |
+
var key, value;
|
1957 |
+
for (key in cards) {
|
1958 |
+
value = cards[key];
|
1959 |
+
if (value.type === type) {
|
1960 |
+
cards.splice(key, 1);
|
1961 |
+
}
|
1962 |
+
}
|
1963 |
+
return true;
|
1964 |
+
};
|
1965 |
+
|
1966 |
+
return Payment;
|
1967 |
+
|
1968 |
+
})();
|
1969 |
+
|
1970 |
+
module.exports = Payment;
|
1971 |
+
|
1972 |
+
global.Payment = Payment;
|
1973 |
+
|
1974 |
+
|
1975 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1976 |
+
},{"qj":4}],9:[function(_dereq_,module,exports){
|
1977 |
+
var css = ".jp-card.jp-card-safari.jp-card-identified .jp-card-front:before, .jp-card.jp-card-safari.jp-card-identified .jp-card-back:before {\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); }\n\n.jp-card.jp-card-ie-10.jp-card-flipped, .jp-card.jp-card-ie-11.jp-card-flipped {\n -webkit-transform: 0deg;\n -moz-transform: 0deg;\n -ms-transform: 0deg;\n -o-transform: 0deg;\n transform: 0deg; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-front, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-front {\n -webkit-transform: rotateY(0deg);\n -moz-transform: rotateY(0deg);\n -ms-transform: rotateY(0deg);\n -o-transform: rotateY(0deg);\n transform: rotateY(0deg); }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back {\n -webkit-transform: rotateY(0deg);\n -moz-transform: rotateY(0deg);\n -ms-transform: rotateY(0deg);\n -o-transform: rotateY(0deg);\n transform: rotateY(0deg); }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back:after {\n left: 18%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-cvc, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-cvc {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg);\n left: 5%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny {\n left: 84%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny:after {\n left: -480%;\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n\n.jp-card.jp-card-ie-10.jp-card-amex .jp-card-back, .jp-card.jp-card-ie-11.jp-card-amex .jp-card-back {\n display: none; }\n\n.jp-card-logo {\n height: 36px;\n width: 60px;\n font-style: italic; }\n .jp-card-logo, .jp-card-logo:before, .jp-card-logo:after {\n box-sizing: border-box; }\n\n.jp-card-logo.jp-card-amex {\n text-transform: uppercase;\n font-size: 4px;\n font-weight: bold;\n color: white;\n background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px);\n background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px);\n border: 1px solid #EEE; }\n .jp-card-logo.jp-card-amex:before, .jp-card-logo.jp-card-amex:after {\n width: 28px;\n display: block;\n position: absolute;\n left: 16px; }\n .jp-card-logo.jp-card-amex:before {\n height: 28px;\n content: \"american\";\n top: 3px;\n text-align: left;\n padding-left: 2px;\n padding-top: 11px;\n background: #267AC3; }\n .jp-card-logo.jp-card-amex:after {\n content: \"express\";\n bottom: 11px;\n text-align: right;\n padding-right: 2px; }\n\n.jp-card.jp-card-amex.jp-card-flipped {\n -webkit-transform: none;\n -moz-transform: none;\n -ms-transform: none;\n -o-transform: none;\n transform: none; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front:before, .jp-card.jp-card-amex.jp-card-identified .jp-card-back:before {\n background-color: #108168; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-logo.jp-card-amex {\n opacity: 1; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-cvc {\n visibility: visible; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front:after {\n opacity: 1; }\n\n.jp-card-logo.jp-card-discover {\n background: #FF6600;\n color: #111;\n text-transform: uppercase;\n font-style: normal;\n font-weight: bold;\n font-size: 10px;\n text-align: center;\n overflow: hidden;\n z-index: 1;\n padding-top: 9px;\n letter-spacing: 0.03em;\n border: 1px solid #EEE; }\n .jp-card-logo.jp-card-discover:before, .jp-card-logo.jp-card-discover:after {\n content: \" \";\n display: block;\n position: absolute; }\n .jp-card-logo.jp-card-discover:before {\n background: white;\n width: 200px;\n height: 200px;\n border-radius: 200px;\n bottom: -5%;\n right: -80%;\n z-index: -1; }\n .jp-card-logo.jp-card-discover:after {\n width: 8px;\n height: 8px;\n border-radius: 4px;\n top: 10px;\n left: 27px;\n background-color: #FFF;\n background-image: -webkit-radial-gradient(#FFF, #FF6600);\n background-image: radial-gradient( #FFF, #FF6600);\n content: \"network\";\n font-size: 4px;\n line-height: 24px;\n text-indent: -7px; }\n\n.jp-card .jp-card-front .jp-card-logo.jp-card-discover {\n right: 12%;\n top: 18%; }\n\n.jp-card.jp-card-discover.jp-card-identified .jp-card-front:before, .jp-card.jp-card-discover.jp-card-identified .jp-card-back:before {\n background-color: #86B8CF; }\n.jp-card.jp-card-discover.jp-card-identified .jp-card-logo.jp-card-discover {\n opacity: 1; }\n.jp-card.jp-card-discover.jp-card-identified .jp-card-front:after {\n -webkit-transition: 400ms;\n -moz-transition: 400ms;\n transition: 400ms;\n content: \" \";\n display: block;\n background-color: #FF6600;\n background-image: -webkit-linear-gradient(#FF6600, #ffa166, #FF6600);\n background-image: linear-gradient(#FF6600, #ffa166, #FF6600);\n height: 50px;\n width: 50px;\n border-radius: 25px;\n position: absolute;\n left: 100%;\n top: 15%;\n margin-left: -25px;\n box-shadow: inset 1px 1px 3px 1px rgba(0, 0, 0, 0.5); }\n\n.jp-card-logo.jp-card-visa {\n background: white;\n text-transform: uppercase;\n color: #1A1876;\n text-align: center;\n font-weight: bold;\n font-size: 15px;\n line-height: 18px; }\n .jp-card-logo.jp-card-visa:before, .jp-card-logo.jp-card-visa:after {\n content: \" \";\n display: block;\n width: 100%;\n height: 25%; }\n .jp-card-logo.jp-card-visa:before {\n background: #1A1876; }\n .jp-card-logo.jp-card-visa:after {\n background: #E79800; }\n\n.jp-card.jp-card-visa.jp-card-identified .jp-card-front:before, .jp-card.jp-card-visa.jp-card-identified .jp-card-back:before {\n background-color: #191278; }\n.jp-card.jp-card-visa.jp-card-identified .jp-card-logo.jp-card-visa {\n opacity: 1; }\n\n.jp-card-logo.jp-card-mastercard {\n color: white;\n font-weight: bold;\n text-align: center;\n font-size: 9px;\n line-height: 36px;\n z-index: 1;\n text-shadow: 1px 1px rgba(0, 0, 0, 0.6); }\n .jp-card-logo.jp-card-mastercard:before, .jp-card-logo.jp-card-mastercard:after {\n content: \" \";\n display: block;\n width: 36px;\n top: 0;\n position: absolute;\n height: 36px;\n border-radius: 18px; }\n .jp-card-logo.jp-card-mastercard:before {\n left: 0;\n background: #FF0000;\n z-index: -1; }\n .jp-card-logo.jp-card-mastercard:after {\n right: 0;\n background: #FFAB00;\n z-index: -2; }\n\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-front .jp-card-logo.jp-card-mastercard, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back .jp-card-logo.jp-card-mastercard {\n box-shadow: none; }\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-front:before, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back:before {\n background-color: #0061A8; }\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-logo.jp-card-mastercard {\n opacity: 1; }\n\n.jp-card-logo.jp-card-maestro {\n color: white;\n font-weight: bold;\n text-align: center;\n font-size: 14px;\n line-height: 36px;\n z-index: 1;\n text-shadow: 1px 1px rgba(0, 0, 0, 0.6); }\n .jp-card-logo.jp-card-maestro:before, .jp-card-logo.jp-card-maestro:after {\n content: \" \";\n display: block;\n width: 36px;\n top: 0;\n position: absolute;\n height: 36px;\n border-radius: 18px; }\n .jp-card-logo.jp-card-maestro:before {\n left: 0;\n background: #0064CB;\n z-index: -1; }\n .jp-card-logo.jp-card-maestro:after {\n right: 0;\n background: #CC0000;\n z-index: -2; }\n\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-front .jp-card-logo.jp-card-maestro, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back .jp-card-logo.jp-card-maestro {\n box-shadow: none; }\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-front:before, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back:before {\n background-color: #0B2C5F; }\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-logo.jp-card-maestro {\n opacity: 1; }\n\n.jp-card-logo.jp-card-dankort {\n width: 60px;\n height: 36px;\n padding: 3px;\n border-radius: 8px;\n border: #000000 1px solid;\n background-color: #FFFFFF; }\n .jp-card-logo.jp-card-dankort .dk {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n .jp-card-logo.jp-card-dankort .dk:before {\n background-color: #ED1C24;\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n display: block;\n border-radius: 6px; }\n .jp-card-logo.jp-card-dankort .dk:after {\n content: '';\n position: absolute;\n top: 50%;\n margin-top: -7.7px;\n right: 0;\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 7px 7px 10px 0;\n border-color: transparent #ED1C24 transparent transparent;\n z-index: 1; }\n .jp-card-logo.jp-card-dankort .d, .jp-card-logo.jp-card-dankort .k {\n position: absolute;\n top: 50%;\n width: 50%;\n display: block;\n height: 15.4px;\n margin-top: -7.7px;\n background: white; }\n .jp-card-logo.jp-card-dankort .d {\n left: 0;\n border-radius: 0 8px 10px 0; }\n .jp-card-logo.jp-card-dankort .d:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n display: block;\n background: #ED1C24;\n border-radius: 2px 4px 6px 0px;\n height: 5px;\n width: 7px;\n margin: -3px 0 0 -4px; }\n .jp-card-logo.jp-card-dankort .k {\n right: 0; }\n .jp-card-logo.jp-card-dankort .k:before, .jp-card-logo.jp-card-dankort .k:after {\n content: '';\n position: absolute;\n right: 50%;\n width: 0;\n height: 0;\n border-style: solid;\n margin-right: -1px; }\n .jp-card-logo.jp-card-dankort .k:before {\n top: 0;\n border-width: 8px 5px 0 0;\n border-color: #ED1C24 transparent transparent transparent; }\n .jp-card-logo.jp-card-dankort .k:after {\n bottom: 0;\n border-width: 0 5px 8px 0;\n border-color: transparent transparent #ED1C24 transparent; }\n\n.jp-card.jp-card-dankort.jp-card-identified .jp-card-front:before, .jp-card.jp-card-dankort.jp-card-identified .jp-card-back:before {\n background-color: #0055C7; }\n.jp-card.jp-card-dankort.jp-card-identified .jp-card-logo.jp-card-dankort {\n opacity: 1; }\n\n.jp-card-container {\n -webkit-perspective: 1000px;\n -moz-perspective: 1000px;\n perspective: 1000px;\n width: 350px;\n max-width: 100%;\n height: 200px;\n margin: auto;\n z-index: 1;\n position: relative; }\n\n.jp-card {\n font-family: \"Helvetica Neue\";\n line-height: 1;\n position: relative;\n width: 100%;\n height: 100%;\n min-width: 315px;\n border-radius: 10px;\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n -ms-transform-style: preserve-3d;\n -o-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 400ms linear;\n -moz-transition: all 400ms linear;\n transition: all 400ms linear; }\n .jp-card > *, .jp-card > *:before, .jp-card > *:after {\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-family: inherit; }\n .jp-card.jp-card-flipped {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n .jp-card .jp-card-front, .jp-card .jp-card-back {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n -ms-transform-style: preserve-3d;\n -o-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 400ms linear;\n -moz-transition: all 400ms linear;\n transition: all 400ms linear;\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n border-radius: 10px;\n background: #DDD; }\n .jp-card .jp-card-front:before, .jp-card .jp-card-back:before {\n content: \" \";\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n opacity: 0;\n border-radius: 10px;\n -webkit-transition: all 400ms ease;\n -moz-transition: all 400ms ease;\n transition: all 400ms ease; }\n .jp-card .jp-card-front:after, .jp-card .jp-card-back:after {\n content: \" \";\n display: block; }\n .jp-card .jp-card-front .jp-card-display, .jp-card .jp-card-back .jp-card-display {\n color: white;\n font-weight: normal;\n opacity: 0.5;\n -webkit-transition: opacity 400ms linear;\n -moz-transition: opacity 400ms linear;\n transition: opacity 400ms linear; }\n .jp-card .jp-card-front .jp-card-display.jp-card-focused, .jp-card .jp-card-back .jp-card-display.jp-card-focused {\n opacity: 1;\n font-weight: 700; }\n .jp-card .jp-card-front .jp-card-cvc, .jp-card .jp-card-back .jp-card-cvc {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 14px; }\n .jp-card .jp-card-front .jp-card-shiny, .jp-card .jp-card-back .jp-card-shiny {\n width: 50px;\n height: 35px;\n border-radius: 5px;\n background: #CCC;\n position: relative; }\n .jp-card .jp-card-front .jp-card-shiny:before, .jp-card .jp-card-back .jp-card-shiny:before {\n content: \" \";\n display: block;\n width: 70%;\n height: 60%;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n background: #d9d9d9;\n position: absolute;\n top: 20%; }\n .jp-card .jp-card-front .jp-card-logo {\n position: absolute;\n opacity: 0;\n right: 5%;\n top: 8%;\n -webkit-transition: 400ms;\n -moz-transition: 400ms;\n transition: 400ms; }\n .jp-card .jp-card-front .jp-card-lower {\n width: 80%;\n position: absolute;\n left: 10%;\n bottom: 30px; }\n @media only screen and (max-width: 480px) {\n .jp-card .jp-card-front .jp-card-lower {\n width: 90%;\n left: 5%; } }\n .jp-card .jp-card-front .jp-card-lower .jp-card-cvc {\n visibility: hidden;\n float: right;\n position: relative;\n bottom: 5px; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-number {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 24px;\n clear: both;\n margin-bottom: 30px; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n letter-spacing: 0em;\n position: relative;\n float: right;\n width: 25%; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before, .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after {\n font-family: \"Helvetica Neue\";\n font-weight: bold;\n font-size: 7px;\n white-space: pre;\n display: block;\n opacity: 0.5; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before {\n content: attr(data-before);\n margin-bottom: 2px;\n font-size: 7px;\n text-transform: uppercase; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after {\n position: absolute;\n content: attr(data-after);\n text-align: right;\n right: 100%;\n margin-right: 5px;\n margin-top: 2px;\n bottom: 0; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-name {\n text-transform: uppercase;\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 20px;\n max-height: 45px;\n position: absolute;\n bottom: 0;\n width: 190px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: horizontal;\n overflow: hidden;\n text-overflow: ellipsis; }\n .jp-card .jp-card-back {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n .jp-card .jp-card-back .jp-card-bar {\n background-color: #444;\n background-image: -webkit-linear-gradient(#444, #333);\n background-image: linear-gradient(#444, #333);\n width: 100%;\n height: 20%;\n position: absolute;\n top: 10%; }\n .jp-card .jp-card-back:after {\n content: \" \";\n display: block;\n background-color: #FFF;\n background-image: -webkit-linear-gradient(#FFF, #FFF);\n background-image: linear-gradient(#FFF, #FFF);\n width: 80%;\n height: 16%;\n position: absolute;\n top: 40%;\n left: 2%; }\n .jp-card .jp-card-back .jp-card-cvc {\n position: absolute;\n top: 40%;\n left: 85%;\n -webkit-transition-delay: 600ms;\n -moz-transition-delay: 600ms;\n transition-delay: 600ms; }\n .jp-card .jp-card-back .jp-card-shiny {\n position: absolute;\n top: 66%;\n left: 2%; }\n .jp-card .jp-card-back .jp-card-shiny:after {\n content: \"This card has been issued by Jesse Pollak and is licensed for anyone to use anywhere for free.\\AIt comes with no warranty.\\A For support issues, please visit: github.com/jessepollak/card.\";\n position: absolute;\n left: 120%;\n top: 5%;\n color: white;\n font-size: 7px;\n width: 230px;\n opacity: 0.5; }\n .jp-card.jp-card-identified {\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); }\n .jp-card.jp-card-identified .jp-card-front, .jp-card.jp-card-identified .jp-card-back {\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.5); }\n .jp-card.jp-card-identified .jp-card-front:before, .jp-card.jp-card-identified .jp-card-back:before {\n -webkit-transition: all 400ms ease;\n -moz-transition: all 400ms ease;\n transition: all 400ms ease;\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n opacity: 1; }\n .jp-card.jp-card-identified .jp-card-front .jp-card-logo, .jp-card.jp-card-identified .jp-card-back .jp-card-logo {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }\n .jp-card.jp-card-identified.no-radial-gradient .jp-card-front:before, .jp-card.jp-card-identified.no-radial-gradient .jp-card-back:before {\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); }\n";(_dereq_('sassify'))(css); module.exports = css;
|
1978 |
+
},{"sassify":5}]},{},[7])
|
1979 |
+
(7)
|
1980 |
+
});
|
js/altima/bettercreditcardform/check_jquery.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if ( (typeof jQuery === 'undefined') && !window.jQuery ) {
|
2 |
+
document.write(unescape("%3Cscript type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'%3E%3C/script%3E"));
|
3 |
+
} else {
|
4 |
+
if((typeof jQuery === 'undefined') && window.jQuery) {
|
5 |
+
jQuery = window.jQuery;
|
6 |
+
} else if((typeof jQuery !== 'undefined') && !window.jQuery) {
|
7 |
+
window.jQuery = jQuery;
|
8 |
+
}
|
9 |
+
}
|
js/altima/bettercreditcardform/check_jquery.js~
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* To change this license header, choose License Headers in Project Properties.
|
3 |
+
* To change this template file, choose Tools | Templates
|
4 |
+
* and open the template in the editor.
|
5 |
+
*/
|
6 |
+
|
7 |
+
|
8 |
+
if ( (typeof jQuery === 'undefined') && !window.jQuery ) {
|
9 |
+
document.write(unescape("%3Cscript type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'%3E%3C/script%3E"));
|
10 |
+
} else {
|
11 |
+
if((typeof jQuery === 'undefined') && window.jQuery) {
|
12 |
+
jQuery = window.jQuery;
|
13 |
+
} else if((typeof jQuery !== 'undefined') && !window.jQuery) {
|
14 |
+
window.jQuery = jQuery;
|
15 |
+
}
|
16 |
+
}
|
js/altima/bettercreditcardform/jquery-migrate-1.2.1.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
|
2 |
+
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
|
js/altima/bettercreditcardform/jquery.card.js
ADDED
@@ -0,0 +1,2023 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.card=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2 |
+
module.exports = _dereq_('./lib/extend');
|
3 |
+
|
4 |
+
|
5 |
+
},{"./lib/extend":2}],2:[function(_dereq_,module,exports){
|
6 |
+
/*!
|
7 |
+
* node.extend
|
8 |
+
* Copyright 2011, John Resig
|
9 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
10 |
+
* http://jquery.org/license
|
11 |
+
*
|
12 |
+
* @fileoverview
|
13 |
+
* Port of jQuery.extend that actually works on node.js
|
14 |
+
*/
|
15 |
+
var is = _dereq_('is');
|
16 |
+
|
17 |
+
function extend() {
|
18 |
+
var target = arguments[0] || {};
|
19 |
+
var i = 1;
|
20 |
+
var length = arguments.length;
|
21 |
+
var deep = false;
|
22 |
+
var options, name, src, copy, copy_is_array, clone;
|
23 |
+
|
24 |
+
// Handle a deep copy situation
|
25 |
+
if (typeof target === 'boolean') {
|
26 |
+
deep = target;
|
27 |
+
target = arguments[1] || {};
|
28 |
+
// skip the boolean and the target
|
29 |
+
i = 2;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Handle case when target is a string or something (possible in deep copy)
|
33 |
+
if (typeof target !== 'object' && !is.fn(target)) {
|
34 |
+
target = {};
|
35 |
+
}
|
36 |
+
|
37 |
+
for (; i < length; i++) {
|
38 |
+
// Only deal with non-null/undefined values
|
39 |
+
options = arguments[i]
|
40 |
+
if (options != null) {
|
41 |
+
if (typeof options === 'string') {
|
42 |
+
options = options.split('');
|
43 |
+
}
|
44 |
+
// Extend the base object
|
45 |
+
for (name in options) {
|
46 |
+
src = target[name];
|
47 |
+
copy = options[name];
|
48 |
+
|
49 |
+
// Prevent never-ending loop
|
50 |
+
if (target === copy) {
|
51 |
+
continue;
|
52 |
+
}
|
53 |
+
|
54 |
+
// Recurse if we're merging plain objects or arrays
|
55 |
+
if (deep && copy && (is.hash(copy) || (copy_is_array = is.array(copy)))) {
|
56 |
+
if (copy_is_array) {
|
57 |
+
copy_is_array = false;
|
58 |
+
clone = src && is.array(src) ? src : [];
|
59 |
+
} else {
|
60 |
+
clone = src && is.hash(src) ? src : {};
|
61 |
+
}
|
62 |
+
|
63 |
+
// Never move original objects, clone them
|
64 |
+
target[name] = extend(deep, clone, copy);
|
65 |
+
|
66 |
+
// Don't bring in undefined values
|
67 |
+
} else if (typeof copy !== 'undefined') {
|
68 |
+
target[name] = copy;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
// Return the modified object
|
75 |
+
return target;
|
76 |
+
};
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @public
|
80 |
+
*/
|
81 |
+
extend.version = '1.0.8';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Exports module.
|
85 |
+
*/
|
86 |
+
module.exports = extend;
|
87 |
+
|
88 |
+
|
89 |
+
},{"is":3}],3:[function(_dereq_,module,exports){
|
90 |
+
|
91 |
+
/**!
|
92 |
+
* is
|
93 |
+
* the definitive JavaScript type testing library
|
94 |
+
*
|
95 |
+
* @copyright 2013-2014 Enrico Marino / Jordan Harband
|
96 |
+
* @license MIT
|
97 |
+
*/
|
98 |
+
|
99 |
+
var objProto = Object.prototype;
|
100 |
+
var owns = objProto.hasOwnProperty;
|
101 |
+
var toString = objProto.toString;
|
102 |
+
var isActualNaN = function (value) {
|
103 |
+
return value !== value;
|
104 |
+
};
|
105 |
+
var NON_HOST_TYPES = {
|
106 |
+
boolean: 1,
|
107 |
+
number: 1,
|
108 |
+
string: 1,
|
109 |
+
undefined: 1
|
110 |
+
};
|
111 |
+
|
112 |
+
var base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
|
113 |
+
var hexRegex = /^[A-Fa-f0-9]+$/;
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Expose `is`
|
117 |
+
*/
|
118 |
+
|
119 |
+
var is = module.exports = {};
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Test general.
|
123 |
+
*/
|
124 |
+
|
125 |
+
/**
|
126 |
+
* is.type
|
127 |
+
* Test if `value` is a type of `type`.
|
128 |
+
*
|
129 |
+
* @param {Mixed} value value to test
|
130 |
+
* @param {String} type type
|
131 |
+
* @return {Boolean} true if `value` is a type of `type`, false otherwise
|
132 |
+
* @api public
|
133 |
+
*/
|
134 |
+
|
135 |
+
is.a = is.type = function (value, type) {
|
136 |
+
return typeof value === type;
|
137 |
+
};
|
138 |
+
|
139 |
+
/**
|
140 |
+
* is.defined
|
141 |
+
* Test if `value` is defined.
|
142 |
+
*
|
143 |
+
* @param {Mixed} value value to test
|
144 |
+
* @return {Boolean} true if 'value' is defined, false otherwise
|
145 |
+
* @api public
|
146 |
+
*/
|
147 |
+
|
148 |
+
is.defined = function (value) {
|
149 |
+
return typeof value !== 'undefined';
|
150 |
+
};
|
151 |
+
|
152 |
+
/**
|
153 |
+
* is.empty
|
154 |
+
* Test if `value` is empty.
|
155 |
+
*
|
156 |
+
* @param {Mixed} value value to test
|
157 |
+
* @return {Boolean} true if `value` is empty, false otherwise
|
158 |
+
* @api public
|
159 |
+
*/
|
160 |
+
|
161 |
+
is.empty = function (value) {
|
162 |
+
var type = toString.call(value);
|
163 |
+
var key;
|
164 |
+
|
165 |
+
if ('[object Array]' === type || '[object Arguments]' === type || '[object String]' === type) {
|
166 |
+
return value.length === 0;
|
167 |
+
}
|
168 |
+
|
169 |
+
if ('[object Object]' === type) {
|
170 |
+
for (key in value) {
|
171 |
+
if (owns.call(value, key)) { return false; }
|
172 |
+
}
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
|
176 |
+
return false;
|
177 |
+
};
|
178 |
+
|
179 |
+
/**
|
180 |
+
* is.equal
|
181 |
+
* Test if `value` is equal to `other`.
|
182 |
+
*
|
183 |
+
* @param {Mixed} value value to test
|
184 |
+
* @param {Mixed} other value to compare with
|
185 |
+
* @return {Boolean} true if `value` is equal to `other`, false otherwise
|
186 |
+
*/
|
187 |
+
|
188 |
+
is.equal = function (value, other) {
|
189 |
+
var strictlyEqual = value === other;
|
190 |
+
if (strictlyEqual) {
|
191 |
+
return true;
|
192 |
+
}
|
193 |
+
|
194 |
+
var type = toString.call(value);
|
195 |
+
var key;
|
196 |
+
|
197 |
+
if (type !== toString.call(other)) {
|
198 |
+
return false;
|
199 |
+
}
|
200 |
+
|
201 |
+
if ('[object Object]' === type) {
|
202 |
+
for (key in value) {
|
203 |
+
if (!is.equal(value[key], other[key]) || !(key in other)) {
|
204 |
+
return false;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
for (key in other) {
|
208 |
+
if (!is.equal(value[key], other[key]) || !(key in value)) {
|
209 |
+
return false;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
return true;
|
213 |
+
}
|
214 |
+
|
215 |
+
if ('[object Array]' === type) {
|
216 |
+
key = value.length;
|
217 |
+
if (key !== other.length) {
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
while (--key) {
|
221 |
+
if (!is.equal(value[key], other[key])) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
return true;
|
226 |
+
}
|
227 |
+
|
228 |
+
if ('[object Function]' === type) {
|
229 |
+
return value.prototype === other.prototype;
|
230 |
+
}
|
231 |
+
|
232 |
+
if ('[object Date]' === type) {
|
233 |
+
return value.getTime() === other.getTime();
|
234 |
+
}
|
235 |
+
|
236 |
+
return strictlyEqual;
|
237 |
+
};
|
238 |
+
|
239 |
+
/**
|
240 |
+
* is.hosted
|
241 |
+
* Test if `value` is hosted by `host`.
|
242 |
+
*
|
243 |
+
* @param {Mixed} value to test
|
244 |
+
* @param {Mixed} host host to test with
|
245 |
+
* @return {Boolean} true if `value` is hosted by `host`, false otherwise
|
246 |
+
* @api public
|
247 |
+
*/
|
248 |
+
|
249 |
+
is.hosted = function (value, host) {
|
250 |
+
var type = typeof host[value];
|
251 |
+
return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];
|
252 |
+
};
|
253 |
+
|
254 |
+
/**
|
255 |
+
* is.instance
|
256 |
+
* Test if `value` is an instance of `constructor`.
|
257 |
+
*
|
258 |
+
* @param {Mixed} value value to test
|
259 |
+
* @return {Boolean} true if `value` is an instance of `constructor`
|
260 |
+
* @api public
|
261 |
+
*/
|
262 |
+
|
263 |
+
is.instance = is['instanceof'] = function (value, constructor) {
|
264 |
+
return value instanceof constructor;
|
265 |
+
};
|
266 |
+
|
267 |
+
/**
|
268 |
+
* is.nil / is.null
|
269 |
+
* Test if `value` is null.
|
270 |
+
*
|
271 |
+
* @param {Mixed} value value to test
|
272 |
+
* @return {Boolean} true if `value` is null, false otherwise
|
273 |
+
* @api public
|
274 |
+
*/
|
275 |
+
|
276 |
+
is.nil = is['null'] = function (value) {
|
277 |
+
return value === null;
|
278 |
+
};
|
279 |
+
|
280 |
+
/**
|
281 |
+
* is.undef / is.undefined
|
282 |
+
* Test if `value` is undefined.
|
283 |
+
*
|
284 |
+
* @param {Mixed} value value to test
|
285 |
+
* @return {Boolean} true if `value` is undefined, false otherwise
|
286 |
+
* @api public
|
287 |
+
*/
|
288 |
+
|
289 |
+
is.undef = is['undefined'] = function (value) {
|
290 |
+
return typeof value === 'undefined';
|
291 |
+
};
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Test arguments.
|
295 |
+
*/
|
296 |
+
|
297 |
+
/**
|
298 |
+
* is.args
|
299 |
+
* Test if `value` is an arguments object.
|
300 |
+
*
|
301 |
+
* @param {Mixed} value value to test
|
302 |
+
* @return {Boolean} true if `value` is an arguments object, false otherwise
|
303 |
+
* @api public
|
304 |
+
*/
|
305 |
+
|
306 |
+
is.args = is['arguments'] = function (value) {
|
307 |
+
var isStandardArguments = '[object Arguments]' === toString.call(value);
|
308 |
+
var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);
|
309 |
+
return isStandardArguments || isOldArguments;
|
310 |
+
};
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Test array.
|
314 |
+
*/
|
315 |
+
|
316 |
+
/**
|
317 |
+
* is.array
|
318 |
+
* Test if 'value' is an array.
|
319 |
+
*
|
320 |
+
* @param {Mixed} value value to test
|
321 |
+
* @return {Boolean} true if `value` is an array, false otherwise
|
322 |
+
* @api public
|
323 |
+
*/
|
324 |
+
|
325 |
+
is.array = function (value) {
|
326 |
+
return '[object Array]' === toString.call(value);
|
327 |
+
};
|
328 |
+
|
329 |
+
/**
|
330 |
+
* is.arguments.empty
|
331 |
+
* Test if `value` is an empty arguments object.
|
332 |
+
*
|
333 |
+
* @param {Mixed} value value to test
|
334 |
+
* @return {Boolean} true if `value` is an empty arguments object, false otherwise
|
335 |
+
* @api public
|
336 |
+
*/
|
337 |
+
is.args.empty = function (value) {
|
338 |
+
return is.args(value) && value.length === 0;
|
339 |
+
};
|
340 |
+
|
341 |
+
/**
|
342 |
+
* is.array.empty
|
343 |
+
* Test if `value` is an empty array.
|
344 |
+
*
|
345 |
+
* @param {Mixed} value value to test
|
346 |
+
* @return {Boolean} true if `value` is an empty array, false otherwise
|
347 |
+
* @api public
|
348 |
+
*/
|
349 |
+
is.array.empty = function (value) {
|
350 |
+
return is.array(value) && value.length === 0;
|
351 |
+
};
|
352 |
+
|
353 |
+
/**
|
354 |
+
* is.arraylike
|
355 |
+
* Test if `value` is an arraylike object.
|
356 |
+
*
|
357 |
+
* @param {Mixed} value value to test
|
358 |
+
* @return {Boolean} true if `value` is an arguments object, false otherwise
|
359 |
+
* @api public
|
360 |
+
*/
|
361 |
+
|
362 |
+
is.arraylike = function (value) {
|
363 |
+
return !!value && !is.boolean(value)
|
364 |
+
&& owns.call(value, 'length')
|
365 |
+
&& isFinite(value.length)
|
366 |
+
&& is.number(value.length)
|
367 |
+
&& value.length >= 0;
|
368 |
+
};
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Test boolean.
|
372 |
+
*/
|
373 |
+
|
374 |
+
/**
|
375 |
+
* is.boolean
|
376 |
+
* Test if `value` is a boolean.
|
377 |
+
*
|
378 |
+
* @param {Mixed} value value to test
|
379 |
+
* @return {Boolean} true if `value` is a boolean, false otherwise
|
380 |
+
* @api public
|
381 |
+
*/
|
382 |
+
|
383 |
+
is.boolean = function (value) {
|
384 |
+
return '[object Boolean]' === toString.call(value);
|
385 |
+
};
|
386 |
+
|
387 |
+
/**
|
388 |
+
* is.false
|
389 |
+
* Test if `value` is false.
|
390 |
+
*
|
391 |
+
* @param {Mixed} value value to test
|
392 |
+
* @return {Boolean} true if `value` is false, false otherwise
|
393 |
+
* @api public
|
394 |
+
*/
|
395 |
+
|
396 |
+
is['false'] = function (value) {
|
397 |
+
return is.boolean(value) && Boolean(Number(value)) === false;
|
398 |
+
};
|
399 |
+
|
400 |
+
/**
|
401 |
+
* is.true
|
402 |
+
* Test if `value` is true.
|
403 |
+
*
|
404 |
+
* @param {Mixed} value value to test
|
405 |
+
* @return {Boolean} true if `value` is true, false otherwise
|
406 |
+
* @api public
|
407 |
+
*/
|
408 |
+
|
409 |
+
is['true'] = function (value) {
|
410 |
+
return is.boolean(value) && Boolean(Number(value)) === true;
|
411 |
+
};
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Test date.
|
415 |
+
*/
|
416 |
+
|
417 |
+
/**
|
418 |
+
* is.date
|
419 |
+
* Test if `value` is a date.
|
420 |
+
*
|
421 |
+
* @param {Mixed} value value to test
|
422 |
+
* @return {Boolean} true if `value` is a date, false otherwise
|
423 |
+
* @api public
|
424 |
+
*/
|
425 |
+
|
426 |
+
is.date = function (value) {
|
427 |
+
return '[object Date]' === toString.call(value);
|
428 |
+
};
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Test element.
|
432 |
+
*/
|
433 |
+
|
434 |
+
/**
|
435 |
+
* is.element
|
436 |
+
* Test if `value` is an html element.
|
437 |
+
*
|
438 |
+
* @param {Mixed} value value to test
|
439 |
+
* @return {Boolean} true if `value` is an HTML Element, false otherwise
|
440 |
+
* @api public
|
441 |
+
*/
|
442 |
+
|
443 |
+
is.element = function (value) {
|
444 |
+
return value !== undefined
|
445 |
+
&& typeof HTMLElement !== 'undefined'
|
446 |
+
&& value instanceof HTMLElement
|
447 |
+
&& value.nodeType === 1;
|
448 |
+
};
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Test error.
|
452 |
+
*/
|
453 |
+
|
454 |
+
/**
|
455 |
+
* is.error
|
456 |
+
* Test if `value` is an error object.
|
457 |
+
*
|
458 |
+
* @param {Mixed} value value to test
|
459 |
+
* @return {Boolean} true if `value` is an error object, false otherwise
|
460 |
+
* @api public
|
461 |
+
*/
|
462 |
+
|
463 |
+
is.error = function (value) {
|
464 |
+
return '[object Error]' === toString.call(value);
|
465 |
+
};
|
466 |
+
|
467 |
+
/**
|
468 |
+
* Test function.
|
469 |
+
*/
|
470 |
+
|
471 |
+
/**
|
472 |
+
* is.fn / is.function (deprecated)
|
473 |
+
* Test if `value` is a function.
|
474 |
+
*
|
475 |
+
* @param {Mixed} value value to test
|
476 |
+
* @return {Boolean} true if `value` is a function, false otherwise
|
477 |
+
* @api public
|
478 |
+
*/
|
479 |
+
|
480 |
+
is.fn = is['function'] = function (value) {
|
481 |
+
var isAlert = typeof window !== 'undefined' && value === window.alert;
|
482 |
+
return isAlert || '[object Function]' === toString.call(value);
|
483 |
+
};
|
484 |
+
|
485 |
+
/**
|
486 |
+
* Test number.
|
487 |
+
*/
|
488 |
+
|
489 |
+
/**
|
490 |
+
* is.number
|
491 |
+
* Test if `value` is a number.
|
492 |
+
*
|
493 |
+
* @param {Mixed} value value to test
|
494 |
+
* @return {Boolean} true if `value` is a number, false otherwise
|
495 |
+
* @api public
|
496 |
+
*/
|
497 |
+
|
498 |
+
is.number = function (value) {
|
499 |
+
return '[object Number]' === toString.call(value);
|
500 |
+
};
|
501 |
+
|
502 |
+
/**
|
503 |
+
* is.infinite
|
504 |
+
* Test if `value` is positive or negative infinity.
|
505 |
+
*
|
506 |
+
* @param {Mixed} value value to test
|
507 |
+
* @return {Boolean} true if `value` is positive or negative Infinity, false otherwise
|
508 |
+
* @api public
|
509 |
+
*/
|
510 |
+
is.infinite = function (value) {
|
511 |
+
return value === Infinity || value === -Infinity;
|
512 |
+
};
|
513 |
+
|
514 |
+
/**
|
515 |
+
* is.decimal
|
516 |
+
* Test if `value` is a decimal number.
|
517 |
+
*
|
518 |
+
* @param {Mixed} value value to test
|
519 |
+
* @return {Boolean} true if `value` is a decimal number, false otherwise
|
520 |
+
* @api public
|
521 |
+
*/
|
522 |
+
|
523 |
+
is.decimal = function (value) {
|
524 |
+
return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;
|
525 |
+
};
|
526 |
+
|
527 |
+
/**
|
528 |
+
* is.divisibleBy
|
529 |
+
* Test if `value` is divisible by `n`.
|
530 |
+
*
|
531 |
+
* @param {Number} value value to test
|
532 |
+
* @param {Number} n dividend
|
533 |
+
* @return {Boolean} true if `value` is divisible by `n`, false otherwise
|
534 |
+
* @api public
|
535 |
+
*/
|
536 |
+
|
537 |
+
is.divisibleBy = function (value, n) {
|
538 |
+
var isDividendInfinite = is.infinite(value);
|
539 |
+
var isDivisorInfinite = is.infinite(n);
|
540 |
+
var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;
|
541 |
+
return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);
|
542 |
+
};
|
543 |
+
|
544 |
+
/**
|
545 |
+
* is.int
|
546 |
+
* Test if `value` is an integer.
|
547 |
+
*
|
548 |
+
* @param value to test
|
549 |
+
* @return {Boolean} true if `value` is an integer, false otherwise
|
550 |
+
* @api public
|
551 |
+
*/
|
552 |
+
|
553 |
+
is.int = function (value) {
|
554 |
+
return is.number(value) && !isActualNaN(value) && value % 1 === 0;
|
555 |
+
};
|
556 |
+
|
557 |
+
/**
|
558 |
+
* is.maximum
|
559 |
+
* Test if `value` is greater than 'others' values.
|
560 |
+
*
|
561 |
+
* @param {Number} value value to test
|
562 |
+
* @param {Array} others values to compare with
|
563 |
+
* @return {Boolean} true if `value` is greater than `others` values
|
564 |
+
* @api public
|
565 |
+
*/
|
566 |
+
|
567 |
+
is.maximum = function (value, others) {
|
568 |
+
if (isActualNaN(value)) {
|
569 |
+
throw new TypeError('NaN is not a valid value');
|
570 |
+
} else if (!is.arraylike(others)) {
|
571 |
+
throw new TypeError('second argument must be array-like');
|
572 |
+
}
|
573 |
+
var len = others.length;
|
574 |
+
|
575 |
+
while (--len >= 0) {
|
576 |
+
if (value < others[len]) {
|
577 |
+
return false;
|
578 |
+
}
|
579 |
+
}
|
580 |
+
|
581 |
+
return true;
|
582 |
+
};
|
583 |
+
|
584 |
+
/**
|
585 |
+
* is.minimum
|
586 |
+
* Test if `value` is less than `others` values.
|
587 |
+
*
|
588 |
+
* @param {Number} value value to test
|
589 |
+
* @param {Array} others values to compare with
|
590 |
+
* @return {Boolean} true if `value` is less than `others` values
|
591 |
+
* @api public
|
592 |
+
*/
|
593 |
+
|
594 |
+
is.minimum = function (value, others) {
|
595 |
+
if (isActualNaN(value)) {
|
596 |
+
throw new TypeError('NaN is not a valid value');
|
597 |
+
} else if (!is.arraylike(others)) {
|
598 |
+
throw new TypeError('second argument must be array-like');
|
599 |
+
}
|
600 |
+
var len = others.length;
|
601 |
+
|
602 |
+
while (--len >= 0) {
|
603 |
+
if (value > others[len]) {
|
604 |
+
return false;
|
605 |
+
}
|
606 |
+
}
|
607 |
+
|
608 |
+
return true;
|
609 |
+
};
|
610 |
+
|
611 |
+
/**
|
612 |
+
* is.nan
|
613 |
+
* Test if `value` is not a number.
|
614 |
+
*
|
615 |
+
* @param {Mixed} value value to test
|
616 |
+
* @return {Boolean} true if `value` is not a number, false otherwise
|
617 |
+
* @api public
|
618 |
+
*/
|
619 |
+
|
620 |
+
is.nan = function (value) {
|
621 |
+
return !is.number(value) || value !== value;
|
622 |
+
};
|
623 |
+
|
624 |
+
/**
|
625 |
+
* is.even
|
626 |
+
* Test if `value` is an even number.
|
627 |
+
*
|
628 |
+
* @param {Number} value value to test
|
629 |
+
* @return {Boolean} true if `value` is an even number, false otherwise
|
630 |
+
* @api public
|
631 |
+
*/
|
632 |
+
|
633 |
+
is.even = function (value) {
|
634 |
+
return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);
|
635 |
+
};
|
636 |
+
|
637 |
+
/**
|
638 |
+
* is.odd
|
639 |
+
* Test if `value` is an odd number.
|
640 |
+
*
|
641 |
+
* @param {Number} value value to test
|
642 |
+
* @return {Boolean} true if `value` is an odd number, false otherwise
|
643 |
+
* @api public
|
644 |
+
*/
|
645 |
+
|
646 |
+
is.odd = function (value) {
|
647 |
+
return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);
|
648 |
+
};
|
649 |
+
|
650 |
+
/**
|
651 |
+
* is.ge
|
652 |
+
* Test if `value` is greater than or equal to `other`.
|
653 |
+
*
|
654 |
+
* @param {Number} value value to test
|
655 |
+
* @param {Number} other value to compare with
|
656 |
+
* @return {Boolean}
|
657 |
+
* @api public
|
658 |
+
*/
|
659 |
+
|
660 |
+
is.ge = function (value, other) {
|
661 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
662 |
+
throw new TypeError('NaN is not a valid value');
|
663 |
+
}
|
664 |
+
return !is.infinite(value) && !is.infinite(other) && value >= other;
|
665 |
+
};
|
666 |
+
|
667 |
+
/**
|
668 |
+
* is.gt
|
669 |
+
* Test if `value` is greater than `other`.
|
670 |
+
*
|
671 |
+
* @param {Number} value value to test
|
672 |
+
* @param {Number} other value to compare with
|
673 |
+
* @return {Boolean}
|
674 |
+
* @api public
|
675 |
+
*/
|
676 |
+
|
677 |
+
is.gt = function (value, other) {
|
678 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
679 |
+
throw new TypeError('NaN is not a valid value');
|
680 |
+
}
|
681 |
+
return !is.infinite(value) && !is.infinite(other) && value > other;
|
682 |
+
};
|
683 |
+
|
684 |
+
/**
|
685 |
+
* is.le
|
686 |
+
* Test if `value` is less than or equal to `other`.
|
687 |
+
*
|
688 |
+
* @param {Number} value value to test
|
689 |
+
* @param {Number} other value to compare with
|
690 |
+
* @return {Boolean} if 'value' is less than or equal to 'other'
|
691 |
+
* @api public
|
692 |
+
*/
|
693 |
+
|
694 |
+
is.le = function (value, other) {
|
695 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
696 |
+
throw new TypeError('NaN is not a valid value');
|
697 |
+
}
|
698 |
+
return !is.infinite(value) && !is.infinite(other) && value <= other;
|
699 |
+
};
|
700 |
+
|
701 |
+
/**
|
702 |
+
* is.lt
|
703 |
+
* Test if `value` is less than `other`.
|
704 |
+
*
|
705 |
+
* @param {Number} value value to test
|
706 |
+
* @param {Number} other value to compare with
|
707 |
+
* @return {Boolean} if `value` is less than `other`
|
708 |
+
* @api public
|
709 |
+
*/
|
710 |
+
|
711 |
+
is.lt = function (value, other) {
|
712 |
+
if (isActualNaN(value) || isActualNaN(other)) {
|
713 |
+
throw new TypeError('NaN is not a valid value');
|
714 |
+
}
|
715 |
+
return !is.infinite(value) && !is.infinite(other) && value < other;
|
716 |
+
};
|
717 |
+
|
718 |
+
/**
|
719 |
+
* is.within
|
720 |
+
* Test if `value` is within `start` and `finish`.
|
721 |
+
*
|
722 |
+
* @param {Number} value value to test
|
723 |
+
* @param {Number} start lower bound
|
724 |
+
* @param {Number} finish upper bound
|
725 |
+
* @return {Boolean} true if 'value' is is within 'start' and 'finish'
|
726 |
+
* @api public
|
727 |
+
*/
|
728 |
+
is.within = function (value, start, finish) {
|
729 |
+
if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {
|
730 |
+
throw new TypeError('NaN is not a valid value');
|
731 |
+
} else if (!is.number(value) || !is.number(start) || !is.number(finish)) {
|
732 |
+
throw new TypeError('all arguments must be numbers');
|
733 |
+
}
|
734 |
+
var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);
|
735 |
+
return isAnyInfinite || (value >= start && value <= finish);
|
736 |
+
};
|
737 |
+
|
738 |
+
/**
|
739 |
+
* Test object.
|
740 |
+
*/
|
741 |
+
|
742 |
+
/**
|
743 |
+
* is.object
|
744 |
+
* Test if `value` is an object.
|
745 |
+
*
|
746 |
+
* @param {Mixed} value value to test
|
747 |
+
* @return {Boolean} true if `value` is an object, false otherwise
|
748 |
+
* @api public
|
749 |
+
*/
|
750 |
+
|
751 |
+
is.object = function (value) {
|
752 |
+
return '[object Object]' === toString.call(value);
|
753 |
+
};
|
754 |
+
|
755 |
+
/**
|
756 |
+
* is.hash
|
757 |
+
* Test if `value` is a hash - a plain object literal.
|
758 |
+
*
|
759 |
+
* @param {Mixed} value value to test
|
760 |
+
* @return {Boolean} true if `value` is a hash, false otherwise
|
761 |
+
* @api public
|
762 |
+
*/
|
763 |
+
|
764 |
+
is.hash = function (value) {
|
765 |
+
return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;
|
766 |
+
};
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Test regexp.
|
770 |
+
*/
|
771 |
+
|
772 |
+
/**
|
773 |
+
* is.regexp
|
774 |
+
* Test if `value` is a regular expression.
|
775 |
+
*
|
776 |
+
* @param {Mixed} value value to test
|
777 |
+
* @return {Boolean} true if `value` is a regexp, false otherwise
|
778 |
+
* @api public
|
779 |
+
*/
|
780 |
+
|
781 |
+
is.regexp = function (value) {
|
782 |
+
return '[object RegExp]' === toString.call(value);
|
783 |
+
};
|
784 |
+
|
785 |
+
/**
|
786 |
+
* Test string.
|
787 |
+
*/
|
788 |
+
|
789 |
+
/**
|
790 |
+
* is.string
|
791 |
+
* Test if `value` is a string.
|
792 |
+
*
|
793 |
+
* @param {Mixed} value value to test
|
794 |
+
* @return {Boolean} true if 'value' is a string, false otherwise
|
795 |
+
* @api public
|
796 |
+
*/
|
797 |
+
|
798 |
+
is.string = function (value) {
|
799 |
+
return '[object String]' === toString.call(value);
|
800 |
+
};
|
801 |
+
|
802 |
+
/**
|
803 |
+
* Test base64 string.
|
804 |
+
*/
|
805 |
+
|
806 |
+
/**
|
807 |
+
* is.base64
|
808 |
+
* Test if `value` is a valid base64 encoded string.
|
809 |
+
*
|
810 |
+
* @param {Mixed} value value to test
|
811 |
+
* @return {Boolean} true if 'value' is a base64 encoded string, false otherwise
|
812 |
+
* @api public
|
813 |
+
*/
|
814 |
+
|
815 |
+
is.base64 = function (value) {
|
816 |
+
return is.string(value) && (!value.length || base64Regex.test(value));
|
817 |
+
};
|
818 |
+
|
819 |
+
/**
|
820 |
+
* Test base64 string.
|
821 |
+
*/
|
822 |
+
|
823 |
+
/**
|
824 |
+
* is.hex
|
825 |
+
* Test if `value` is a valid hex encoded string.
|
826 |
+
*
|
827 |
+
* @param {Mixed} value value to test
|
828 |
+
* @return {Boolean} true if 'value' is a hex encoded string, false otherwise
|
829 |
+
* @api public
|
830 |
+
*/
|
831 |
+
|
832 |
+
is.hex = function (value) {
|
833 |
+
return is.string(value) && (!value.length || hexRegex.test(value));
|
834 |
+
};
|
835 |
+
|
836 |
+
},{}],4:[function(_dereq_,module,exports){
|
837 |
+
(function (global){
|
838 |
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.qj||(f.qj={})).js=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
839 |
+
var QJ, rreturn, rtrim;
|
840 |
+
|
841 |
+
QJ = function(selector) {
|
842 |
+
if (QJ.isDOMElement(selector)) {
|
843 |
+
return selector;
|
844 |
+
}
|
845 |
+
return document.querySelectorAll(selector);
|
846 |
+
};
|
847 |
+
|
848 |
+
QJ.isDOMElement = function(el) {
|
849 |
+
return el && (el.nodeName != null);
|
850 |
+
};
|
851 |
+
|
852 |
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
853 |
+
|
854 |
+
QJ.trim = function(text) {
|
855 |
+
if (text === null) {
|
856 |
+
return "";
|
857 |
+
} else {
|
858 |
+
return (text + "").replace(rtrim, "");
|
859 |
+
}
|
860 |
+
};
|
861 |
+
|
862 |
+
rreturn = /\r/g;
|
863 |
+
|
864 |
+
QJ.val = function(el, val) {
|
865 |
+
var ret;
|
866 |
+
if (arguments.length > 1) {
|
867 |
+
return el.value = val;
|
868 |
+
} else {
|
869 |
+
ret = el.value;
|
870 |
+
if (typeof ret === "string") {
|
871 |
+
return ret.replace(rreturn, "");
|
872 |
+
} else {
|
873 |
+
if (ret === null) {
|
874 |
+
return "";
|
875 |
+
} else {
|
876 |
+
return ret;
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
};
|
881 |
+
|
882 |
+
QJ.preventDefault = function(eventObject) {
|
883 |
+
if (typeof eventObject.preventDefault === "function") {
|
884 |
+
eventObject.preventDefault();
|
885 |
+
return;
|
886 |
+
}
|
887 |
+
eventObject.returnValue = false;
|
888 |
+
return false;
|
889 |
+
};
|
890 |
+
|
891 |
+
QJ.normalizeEvent = function(e) {
|
892 |
+
var original;
|
893 |
+
original = e;
|
894 |
+
e = {
|
895 |
+
which: original.which != null ? original.which : void 0,
|
896 |
+
target: original.target || original.srcElement,
|
897 |
+
preventDefault: function() {
|
898 |
+
return QJ.preventDefault(original);
|
899 |
+
},
|
900 |
+
originalEvent: original,
|
901 |
+
data: original.data || original.detail
|
902 |
+
};
|
903 |
+
if (e.which == null) {
|
904 |
+
e.which = original.charCode != null ? original.charCode : original.keyCode;
|
905 |
+
}
|
906 |
+
return e;
|
907 |
+
};
|
908 |
+
|
909 |
+
QJ.on = function(element, eventName, callback) {
|
910 |
+
var el, multEventName, originalCallback, _i, _j, _len, _len1, _ref;
|
911 |
+
if (element.length) {
|
912 |
+
for (_i = 0, _len = element.length; _i < _len; _i++) {
|
913 |
+
el = element[_i];
|
914 |
+
QJ.on(el, eventName, callback);
|
915 |
+
}
|
916 |
+
return;
|
917 |
+
}
|
918 |
+
if (eventName.match(" ")) {
|
919 |
+
_ref = eventName.split(" ");
|
920 |
+
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
|
921 |
+
multEventName = _ref[_j];
|
922 |
+
QJ.on(element, multEventName, callback);
|
923 |
+
}
|
924 |
+
return;
|
925 |
+
}
|
926 |
+
originalCallback = callback;
|
927 |
+
callback = function(e) {
|
928 |
+
e = QJ.normalizeEvent(e);
|
929 |
+
return originalCallback(e);
|
930 |
+
};
|
931 |
+
if (element.addEventListener) {
|
932 |
+
return element.addEventListener(eventName, callback, false);
|
933 |
+
}
|
934 |
+
if (element.attachEvent) {
|
935 |
+
eventName = "on" + eventName;
|
936 |
+
return element.attachEvent(eventName, callback);
|
937 |
+
}
|
938 |
+
element['on' + eventName] = callback;
|
939 |
+
};
|
940 |
+
|
941 |
+
QJ.addClass = function(el, className) {
|
942 |
+
var e;
|
943 |
+
if (el.length) {
|
944 |
+
return (function() {
|
945 |
+
var _i, _len, _results;
|
946 |
+
_results = [];
|
947 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
948 |
+
e = el[_i];
|
949 |
+
_results.push(QJ.addClass(e, className));
|
950 |
+
}
|
951 |
+
return _results;
|
952 |
+
})();
|
953 |
+
}
|
954 |
+
if (el.classList) {
|
955 |
+
return el.classList.add(className);
|
956 |
+
} else {
|
957 |
+
return el.className += ' ' + className;
|
958 |
+
}
|
959 |
+
};
|
960 |
+
|
961 |
+
QJ.hasClass = function(el, className) {
|
962 |
+
var e, hasClass, _i, _len;
|
963 |
+
if (el.length) {
|
964 |
+
hasClass = true;
|
965 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
966 |
+
e = el[_i];
|
967 |
+
hasClass = hasClass && QJ.hasClass(e, className);
|
968 |
+
}
|
969 |
+
return hasClass;
|
970 |
+
}
|
971 |
+
if (el.classList) {
|
972 |
+
return el.classList.contains(className);
|
973 |
+
} else {
|
974 |
+
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
|
975 |
+
}
|
976 |
+
};
|
977 |
+
|
978 |
+
QJ.removeClass = function(el, className) {
|
979 |
+
var cls, e, _i, _len, _ref, _results;
|
980 |
+
if (el.length) {
|
981 |
+
return (function() {
|
982 |
+
var _i, _len, _results;
|
983 |
+
_results = [];
|
984 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
985 |
+
e = el[_i];
|
986 |
+
_results.push(QJ.removeClass(e, className));
|
987 |
+
}
|
988 |
+
return _results;
|
989 |
+
})();
|
990 |
+
}
|
991 |
+
if (el.classList) {
|
992 |
+
_ref = className.split(' ');
|
993 |
+
_results = [];
|
994 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
995 |
+
cls = _ref[_i];
|
996 |
+
_results.push(el.classList.remove(cls));
|
997 |
+
}
|
998 |
+
return _results;
|
999 |
+
} else {
|
1000 |
+
return el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
1001 |
+
}
|
1002 |
+
};
|
1003 |
+
|
1004 |
+
QJ.toggleClass = function(el, className, bool) {
|
1005 |
+
var e;
|
1006 |
+
if (el.length) {
|
1007 |
+
return (function() {
|
1008 |
+
var _i, _len, _results;
|
1009 |
+
_results = [];
|
1010 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1011 |
+
e = el[_i];
|
1012 |
+
_results.push(QJ.toggleClass(e, className, bool));
|
1013 |
+
}
|
1014 |
+
return _results;
|
1015 |
+
})();
|
1016 |
+
}
|
1017 |
+
if (bool) {
|
1018 |
+
if (!QJ.hasClass(el, className)) {
|
1019 |
+
return QJ.addClass(el, className);
|
1020 |
+
}
|
1021 |
+
} else {
|
1022 |
+
return QJ.removeClass(el, className);
|
1023 |
+
}
|
1024 |
+
};
|
1025 |
+
|
1026 |
+
QJ.append = function(el, toAppend) {
|
1027 |
+
var e;
|
1028 |
+
if (el.length) {
|
1029 |
+
return (function() {
|
1030 |
+
var _i, _len, _results;
|
1031 |
+
_results = [];
|
1032 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1033 |
+
e = el[_i];
|
1034 |
+
_results.push(QJ.append(e, toAppend));
|
1035 |
+
}
|
1036 |
+
return _results;
|
1037 |
+
})();
|
1038 |
+
}
|
1039 |
+
return el.insertAdjacentHTML('beforeend', toAppend);
|
1040 |
+
};
|
1041 |
+
|
1042 |
+
QJ.find = function(el, selector) {
|
1043 |
+
if (el instanceof NodeList || el instanceof Array) {
|
1044 |
+
el = el[0];
|
1045 |
+
}
|
1046 |
+
return el.querySelectorAll(selector);
|
1047 |
+
};
|
1048 |
+
|
1049 |
+
QJ.trigger = function(el, name, data) {
|
1050 |
+
var e, ev;
|
1051 |
+
try {
|
1052 |
+
ev = new CustomEvent(name, {
|
1053 |
+
detail: data
|
1054 |
+
});
|
1055 |
+
} catch (_error) {
|
1056 |
+
e = _error;
|
1057 |
+
ev = document.createEvent('CustomEvent');
|
1058 |
+
if (ev.initCustomEvent) {
|
1059 |
+
ev.initCustomEvent(name, true, true, data);
|
1060 |
+
} else {
|
1061 |
+
ev.initEvent(name, true, true, data);
|
1062 |
+
}
|
1063 |
+
}
|
1064 |
+
return el.dispatchEvent(ev);
|
1065 |
+
};
|
1066 |
+
|
1067 |
+
module.exports = QJ;
|
1068 |
+
|
1069 |
+
|
1070 |
+
},{}]},{},[1])
|
1071 |
+
(1)
|
1072 |
+
});
|
1073 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1074 |
+
},{}],5:[function(_dereq_,module,exports){
|
1075 |
+
module.exports = _dereq_('cssify');
|
1076 |
+
},{"cssify":6}],6:[function(_dereq_,module,exports){
|
1077 |
+
module.exports = function (css, customDocument) {
|
1078 |
+
var doc = customDocument || document;
|
1079 |
+
if (doc.createStyleSheet) {
|
1080 |
+
doc.createStyleSheet().cssText = css;
|
1081 |
+
} else {
|
1082 |
+
var head = doc.getElementsByTagName('head')[0],
|
1083 |
+
style = doc.createElement('style');
|
1084 |
+
|
1085 |
+
style.type = 'text/css';
|
1086 |
+
|
1087 |
+
if (style.styleSheet) {
|
1088 |
+
style.styleSheet.cssText = css;
|
1089 |
+
} else {
|
1090 |
+
style.appendChild(doc.createTextNode(css));
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
head.appendChild(style);
|
1094 |
+
}
|
1095 |
+
};
|
1096 |
+
|
1097 |
+
module.exports.byUrl = function(url) {
|
1098 |
+
if (document.createStyleSheet) {
|
1099 |
+
document.createStyleSheet(url);
|
1100 |
+
} else {
|
1101 |
+
var head = document.getElementsByTagName('head')[0],
|
1102 |
+
link = document.createElement('link');
|
1103 |
+
|
1104 |
+
link.rel = 'stylesheet';
|
1105 |
+
link.href = url;
|
1106 |
+
|
1107 |
+
head.appendChild(link);
|
1108 |
+
}
|
1109 |
+
};
|
1110 |
+
|
1111 |
+
},{}],7:[function(_dereq_,module,exports){
|
1112 |
+
(function (global){
|
1113 |
+
var Card, QJ, extend, payment;
|
1114 |
+
|
1115 |
+
_dereq_('../scss/card.scss');
|
1116 |
+
|
1117 |
+
QJ = _dereq_('qj');
|
1118 |
+
|
1119 |
+
payment = _dereq_('./payment/src/payment.coffee');
|
1120 |
+
|
1121 |
+
extend = _dereq_('node.extend');
|
1122 |
+
|
1123 |
+
Card = (function() {
|
1124 |
+
var bindVal;
|
1125 |
+
|
1126 |
+
Card.prototype.cardTemplate = '' + '<div class="jp-card-container">' + '<div class="jp-card">' + '<div class="jp-card-front">' + '<div class="jp-card-logo jp-card-visa">visa</div>' + '<div class="jp-card-logo jp-card-mastercard">MasterCard</div>' + '<div class="jp-card-logo jp-card-maestro">Maestro</div>' + '<div class="jp-card-logo jp-card-amex"></div>' + '<div class="jp-card-logo jp-card-discover">discover</div>' + '<div class="jp-card-logo jp-card-dankort"><div class="dk"><div class="d"></div><div class="k"></div></div></div>' + '<div class="jp-card-lower">' + '<div class="jp-card-shiny"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-number jp-card-display">{{number}}</div>' + '<div class="jp-card-name jp-card-display">{{name}}</div>' + '<div class="jp-card-expiry jp-card-display" data-before="{{monthYear}}" data-after="{{validDate}}">{{expiry}}</div>' + '</div>' + '</div>' + '<div class="jp-card-back">' + '<div class="jp-card-bar"></div>' + '<div class="jp-card-cvc jp-card-display">{{cvc}}</div>' + '<div class="jp-card-shiny"></div>' + '</div>' + '</div>' + '</div>';
|
1127 |
+
|
1128 |
+
Card.prototype.template = function(tpl, data) {
|
1129 |
+
return tpl.replace(/\{\{(.*?)\}\}/g, function(match, key, str) {
|
1130 |
+
return data[key];
|
1131 |
+
});
|
1132 |
+
};
|
1133 |
+
|
1134 |
+
Card.prototype.cardTypes = ['jp-card-amex', 'jp-card-dankort', 'jp-card-dinersclub', 'jp-card-discover', 'jp-card-jcb', 'jp-card-laser', 'jp-card-maestro', 'jp-card-mastercard', 'jp-card-unionpay', 'jp-card-visa', 'jp-card-visaelectron'];
|
1135 |
+
|
1136 |
+
Card.prototype.defaults = {
|
1137 |
+
formatting: true,
|
1138 |
+
formSelectors: {
|
1139 |
+
numberInput: 'input[name="number"]',
|
1140 |
+
expiryInput: 'input[name="expiry"]',
|
1141 |
+
cvcInput: 'input[name="cvc"]',
|
1142 |
+
nameInput: 'input[name="name"]'
|
1143 |
+
},
|
1144 |
+
cardSelectors: {
|
1145 |
+
cardContainer: '.jp-card-container',
|
1146 |
+
card: '.jp-card',
|
1147 |
+
numberDisplay: '.jp-card-number',
|
1148 |
+
expiryDisplay: '.jp-card-expiry',
|
1149 |
+
cvcDisplay: '.jp-card-cvc',
|
1150 |
+
nameDisplay: '.jp-card-name'
|
1151 |
+
},
|
1152 |
+
messages: {
|
1153 |
+
validDate: 'valid\nthru',
|
1154 |
+
monthYear: 'month/year'
|
1155 |
+
},
|
1156 |
+
values: {
|
1157 |
+
number: '•••• •••• •••• ••••',
|
1158 |
+
cvc: '•••',
|
1159 |
+
expiry: '••/••',
|
1160 |
+
name: 'Full Name'
|
1161 |
+
},
|
1162 |
+
classes: {
|
1163 |
+
valid: 'jp-card-valid',
|
1164 |
+
invalid: 'jp-card-invalid'
|
1165 |
+
},
|
1166 |
+
debug: false
|
1167 |
+
};
|
1168 |
+
|
1169 |
+
function Card(opts) {
|
1170 |
+
this.options = extend(true, this.defaults, opts);
|
1171 |
+
if (!this.options.form) {
|
1172 |
+
console.log("Please provide a form");
|
1173 |
+
return;
|
1174 |
+
}
|
1175 |
+
this.$el = QJ(this.options.form);
|
1176 |
+
if (!this.options.container) {
|
1177 |
+
console.log("Please provide a container");
|
1178 |
+
return;
|
1179 |
+
}
|
1180 |
+
this.$container = QJ(this.options.container);
|
1181 |
+
this.render();
|
1182 |
+
this.attachHandlers();
|
1183 |
+
this.handleInitialValues();
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
Card.prototype.render = function() {
|
1187 |
+
var $cardContainer, baseWidth, name, obj, selector, ua, _ref, _ref1;
|
1188 |
+
QJ.append(this.$container, this.template(this.cardTemplate, extend({}, this.options.messages, this.options.values)));
|
1189 |
+
_ref = this.options.cardSelectors;
|
1190 |
+
for (name in _ref) {
|
1191 |
+
selector = _ref[name];
|
1192 |
+
this["$" + name] = QJ.find(this.$container, selector);
|
1193 |
+
}
|
1194 |
+
_ref1 = this.options.formSelectors;
|
1195 |
+
for (name in _ref1) {
|
1196 |
+
selector = _ref1[name];
|
1197 |
+
selector = this.options[name] ? this.options[name] : selector;
|
1198 |
+
obj = QJ.find(this.$el, selector);
|
1199 |
+
if (!obj.length && this.options.debug) {
|
1200 |
+
console.error("Card can't find a " + name + " in your form.");
|
1201 |
+
}
|
1202 |
+
this["$" + name] = obj;
|
1203 |
+
}
|
1204 |
+
if (this.options.formatting) {
|
1205 |
+
Payment.formatCardNumber(this.$numberInput);
|
1206 |
+
Payment.formatCardCVC(this.$cvcInput);
|
1207 |
+
if (this.$expiryInput.length === 1) {
|
1208 |
+
Payment.formatCardExpiry(this.$expiryInput);
|
1209 |
+
}
|
1210 |
+
}
|
1211 |
+
if (this.options.width) {
|
1212 |
+
$cardContainer = QJ(this.options.cardSelectors.cardContainer)[0];
|
1213 |
+
baseWidth = parseInt($cardContainer.clientWidth);
|
1214 |
+
$cardContainer.style.transform = "scale(" + (this.options.width / baseWidth) + ")";
|
1215 |
+
}
|
1216 |
+
if (typeof navigator !== "undefined" && navigator !== null ? navigator.userAgent : void 0) {
|
1217 |
+
ua = navigator.userAgent.toLowerCase();
|
1218 |
+
if (ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1) {
|
1219 |
+
QJ.addClass(this.$card, 'jp-card-safari');
|
1220 |
+
}
|
1221 |
+
}
|
1222 |
+
if (/MSIE 10\./i.test(navigator.userAgent)) {
|
1223 |
+
QJ.addClass(this.$card, 'jp-card-ie-10');
|
1224 |
+
}
|
1225 |
+
if (/rv:11.0/i.test(navigator.userAgent)) {
|
1226 |
+
return QJ.addClass(this.$card, 'jp-card-ie-11');
|
1227 |
+
}
|
1228 |
+
};
|
1229 |
+
|
1230 |
+
Card.prototype.attachHandlers = function() {
|
1231 |
+
var expiryFilters;
|
1232 |
+
bindVal(this.$numberInput, this.$numberDisplay, {
|
1233 |
+
fill: false,
|
1234 |
+
filters: this.validToggler('cardNumber')
|
1235 |
+
});
|
1236 |
+
QJ.on(this.$numberInput, 'payment.cardType', this.handle('setCardType'));
|
1237 |
+
expiryFilters = [
|
1238 |
+
function(val) {
|
1239 |
+
return val.replace(/(\s+)/g, '');
|
1240 |
+
}
|
1241 |
+
];
|
1242 |
+
if (this.$expiryInput.length === 1) {
|
1243 |
+
expiryFilters.push(this.validToggler('cardExpiry'));
|
1244 |
+
}
|
1245 |
+
bindVal(this.$expiryInput, this.$expiryDisplay, {
|
1246 |
+
join: function(text) {
|
1247 |
+
if (text[0].length === 2 || text[1]) {
|
1248 |
+
return "/";
|
1249 |
+
} else {
|
1250 |
+
return "";
|
1251 |
+
}
|
1252 |
+
},
|
1253 |
+
filters: expiryFilters
|
1254 |
+
});
|
1255 |
+
bindVal(this.$cvcInput, this.$cvcDisplay, {
|
1256 |
+
filters: this.validToggler('cardCVC')
|
1257 |
+
});
|
1258 |
+
QJ.on(this.$cvcInput, 'focus', this.handle('flipCard'));
|
1259 |
+
QJ.on(this.$cvcInput, 'blur', this.handle('unflipCard'));
|
1260 |
+
return bindVal(this.$nameInput, this.$nameDisplay, {
|
1261 |
+
fill: false,
|
1262 |
+
filters: this.validToggler('cardHolderName'),
|
1263 |
+
join: ' '
|
1264 |
+
});
|
1265 |
+
};
|
1266 |
+
|
1267 |
+
Card.prototype.handleInitialValues = function() {
|
1268 |
+
var el, name, selector, _ref, _results;
|
1269 |
+
_ref = this.options.formSelectors;
|
1270 |
+
_results = [];
|
1271 |
+
for (name in _ref) {
|
1272 |
+
selector = _ref[name];
|
1273 |
+
el = this["$" + name];
|
1274 |
+
if (QJ.val(el)) {
|
1275 |
+
QJ.trigger(el, 'paste');
|
1276 |
+
_results.push(setTimeout(function() {
|
1277 |
+
return QJ.trigger(el, 'keyup');
|
1278 |
+
}));
|
1279 |
+
} else {
|
1280 |
+
_results.push(void 0);
|
1281 |
+
}
|
1282 |
+
}
|
1283 |
+
return _results;
|
1284 |
+
};
|
1285 |
+
|
1286 |
+
Card.prototype.handle = function(fn) {
|
1287 |
+
return (function(_this) {
|
1288 |
+
return function(e) {
|
1289 |
+
var args;
|
1290 |
+
args = Array.prototype.slice.call(arguments);
|
1291 |
+
args.unshift(e.target);
|
1292 |
+
return _this.handlers[fn].apply(_this, args);
|
1293 |
+
};
|
1294 |
+
})(this);
|
1295 |
+
};
|
1296 |
+
|
1297 |
+
Card.prototype.validToggler = function(validatorName) {
|
1298 |
+
var isValid;
|
1299 |
+
if (validatorName === "cardExpiry") {
|
1300 |
+
isValid = function(val) {
|
1301 |
+
var objVal;
|
1302 |
+
objVal = Payment.fns.cardExpiryVal(val);
|
1303 |
+
return Payment.fns.validateCardExpiry(objVal.month, objVal.year);
|
1304 |
+
};
|
1305 |
+
} else if (validatorName === "cardCVC") {
|
1306 |
+
isValid = (function(_this) {
|
1307 |
+
return function(val) {
|
1308 |
+
return Payment.fns.validateCardCVC(val, _this.cardType);
|
1309 |
+
};
|
1310 |
+
})(this);
|
1311 |
+
} else if (validatorName === "cardNumber") {
|
1312 |
+
isValid = function(val) {
|
1313 |
+
return Payment.fns.validateCardNumber(val);
|
1314 |
+
};
|
1315 |
+
} else if (validatorName === "cardHolderName") {
|
1316 |
+
isValid = function(val) {
|
1317 |
+
return val !== "";
|
1318 |
+
};
|
1319 |
+
}
|
1320 |
+
return (function(_this) {
|
1321 |
+
return function(val, $in, $out) {
|
1322 |
+
var result;
|
1323 |
+
result = isValid(val);
|
1324 |
+
_this.toggleValidClass($in, result);
|
1325 |
+
_this.toggleValidClass($out, result);
|
1326 |
+
return val;
|
1327 |
+
};
|
1328 |
+
})(this);
|
1329 |
+
};
|
1330 |
+
|
1331 |
+
Card.prototype.toggleValidClass = function(el, test) {
|
1332 |
+
QJ.toggleClass(el, this.options.classes.valid, test);
|
1333 |
+
return QJ.toggleClass(el, this.options.classes.invalid, !test);
|
1334 |
+
};
|
1335 |
+
|
1336 |
+
Card.prototype.handlers = {
|
1337 |
+
setCardType: function($el, e) {
|
1338 |
+
var cardType;
|
1339 |
+
cardType = e.data;
|
1340 |
+
if (!QJ.hasClass(this.$card, cardType)) {
|
1341 |
+
QJ.removeClass(this.$card, 'jp-card-unknown');
|
1342 |
+
QJ.removeClass(this.$card, this.cardTypes.join(' '));
|
1343 |
+
QJ.addClass(this.$card, "jp-card-" + cardType);
|
1344 |
+
QJ.toggleClass(this.$card, 'jp-card-identified', cardType !== 'unknown');
|
1345 |
+
return this.cardType = cardType;
|
1346 |
+
}
|
1347 |
+
},
|
1348 |
+
flipCard: function() {
|
1349 |
+
return QJ.addClass(this.$card, 'jp-card-flipped');
|
1350 |
+
},
|
1351 |
+
unflipCard: function() {
|
1352 |
+
return QJ.removeClass(this.$card, 'jp-card-flipped');
|
1353 |
+
}
|
1354 |
+
};
|
1355 |
+
|
1356 |
+
bindVal = function(el, out, opts) {
|
1357 |
+
var joiner, o, outDefaults;
|
1358 |
+
if (opts == null) {
|
1359 |
+
opts = {};
|
1360 |
+
}
|
1361 |
+
opts.fill = opts.fill || false;
|
1362 |
+
opts.filters = opts.filters || [];
|
1363 |
+
if (!(opts.filters instanceof Array)) {
|
1364 |
+
opts.filters = [opts.filters];
|
1365 |
+
}
|
1366 |
+
opts.join = opts.join || "";
|
1367 |
+
if (!(typeof opts.join === "function")) {
|
1368 |
+
joiner = opts.join;
|
1369 |
+
opts.join = function() {
|
1370 |
+
return joiner;
|
1371 |
+
};
|
1372 |
+
}
|
1373 |
+
outDefaults = (function() {
|
1374 |
+
var _i, _len, _results;
|
1375 |
+
_results = [];
|
1376 |
+
for (_i = 0, _len = out.length; _i < _len; _i++) {
|
1377 |
+
o = out[_i];
|
1378 |
+
_results.push(o.textContent);
|
1379 |
+
}
|
1380 |
+
return _results;
|
1381 |
+
})();
|
1382 |
+
QJ.on(el, 'focus', function() {
|
1383 |
+
return QJ.addClass(out, 'jp-card-focused');
|
1384 |
+
});
|
1385 |
+
QJ.on(el, 'blur', function() {
|
1386 |
+
return QJ.removeClass(el, 'jp-card-focused');
|
1387 |
+
});
|
1388 |
+
QJ.on(el, 'keyup change paste', function(e) {
|
1389 |
+
var elem, filter, i, join, outEl, outVal, val, _i, _j, _len, _len1, _ref, _results;
|
1390 |
+
val = (function() {
|
1391 |
+
var _i, _len, _results;
|
1392 |
+
_results = [];
|
1393 |
+
for (_i = 0, _len = el.length; _i < _len; _i++) {
|
1394 |
+
elem = el[_i];
|
1395 |
+
_results.push(QJ.val(elem));
|
1396 |
+
}
|
1397 |
+
return _results;
|
1398 |
+
})();
|
1399 |
+
join = opts.join(val);
|
1400 |
+
val = val.join(join);
|
1401 |
+
if (val === join) {
|
1402 |
+
val = "";
|
1403 |
+
}
|
1404 |
+
_ref = opts.filters;
|
1405 |
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1406 |
+
filter = _ref[_i];
|
1407 |
+
val = filter(val, el, out);
|
1408 |
+
}
|
1409 |
+
_results = [];
|
1410 |
+
for (i = _j = 0, _len1 = out.length; _j < _len1; i = ++_j) {
|
1411 |
+
outEl = out[i];
|
1412 |
+
if (opts.fill) {
|
1413 |
+
outVal = val + outDefaults[i].substring(val.length);
|
1414 |
+
} else {
|
1415 |
+
outVal = val || outDefaults[i];
|
1416 |
+
}
|
1417 |
+
_results.push(outEl.textContent = outVal);
|
1418 |
+
}
|
1419 |
+
return _results;
|
1420 |
+
});
|
1421 |
+
return el;
|
1422 |
+
};
|
1423 |
+
|
1424 |
+
return Card;
|
1425 |
+
|
1426 |
+
})();
|
1427 |
+
|
1428 |
+
module.exports = Card;
|
1429 |
+
|
1430 |
+
global.Card = Card;
|
1431 |
+
|
1432 |
+
|
1433 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1434 |
+
},{"../scss/card.scss":10,"./payment/src/payment.coffee":9,"node.extend":1,"qj":4}],8:[function(_dereq_,module,exports){
|
1435 |
+
var $, Card,
|
1436 |
+
__slice = [].slice;
|
1437 |
+
|
1438 |
+
Card = _dereq_('./card');
|
1439 |
+
|
1440 |
+
$ = jQuery;
|
1441 |
+
|
1442 |
+
$.card = {};
|
1443 |
+
|
1444 |
+
$.card.fn = {};
|
1445 |
+
|
1446 |
+
$.fn.card = function(opts) {
|
1447 |
+
return $.card.fn.construct.apply(this, opts);
|
1448 |
+
};
|
1449 |
+
|
1450 |
+
$.fn.extend({
|
1451 |
+
card: function() {
|
1452 |
+
var args, option;
|
1453 |
+
option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
1454 |
+
return this.each(function() {
|
1455 |
+
var $this, data;
|
1456 |
+
$this = $(this);
|
1457 |
+
data = $this.data('card');
|
1458 |
+
if (!data) {
|
1459 |
+
$.each(option, (function(_this) {
|
1460 |
+
return function(key, value) {
|
1461 |
+
if (value instanceof jQuery) {
|
1462 |
+
return option[key] = value[0];
|
1463 |
+
}
|
1464 |
+
};
|
1465 |
+
})(this));
|
1466 |
+
option['form'] = this;
|
1467 |
+
$this.data('card', (data = new Card(option)));
|
1468 |
+
}
|
1469 |
+
if (typeof option === 'string') {
|
1470 |
+
return data[option].apply(data, args);
|
1471 |
+
}
|
1472 |
+
});
|
1473 |
+
}
|
1474 |
+
});
|
1475 |
+
|
1476 |
+
|
1477 |
+
},{"./card":7}],9:[function(_dereq_,module,exports){
|
1478 |
+
(function (global){
|
1479 |
+
var Payment, QJ, cardFromNumber, cardFromType, cards, defaultFormat, formatBackCardNumber, formatBackExpiry, formatCardNumber, formatExpiry, formatForwardExpiry, formatForwardSlash, hasTextSelected, luhnCheck, reFormatCardNumber, restrictCVC, restrictCardNumber, restrictExpiry, restrictNumeric, setCardType,
|
1480 |
+
__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; };
|
1481 |
+
|
1482 |
+
QJ = _dereq_('qj');
|
1483 |
+
|
1484 |
+
defaultFormat = /(\d{1,4})/g;
|
1485 |
+
|
1486 |
+
cards = [
|
1487 |
+
{
|
1488 |
+
type: 'amex',
|
1489 |
+
pattern: /^3[47]/,
|
1490 |
+
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
|
1491 |
+
length: [15],
|
1492 |
+
cvcLength: [3, 4],
|
1493 |
+
luhn: true
|
1494 |
+
}, {
|
1495 |
+
type: 'dankort',
|
1496 |
+
pattern: /^5019/,
|
1497 |
+
format: defaultFormat,
|
1498 |
+
length: [16],
|
1499 |
+
cvcLength: [3],
|
1500 |
+
luhn: true
|
1501 |
+
}, {
|
1502 |
+
type: 'dinersclub',
|
1503 |
+
pattern: /^(36|38|30[0-5])/,
|
1504 |
+
format: defaultFormat,
|
1505 |
+
length: [14],
|
1506 |
+
cvcLength: [3],
|
1507 |
+
luhn: true
|
1508 |
+
}, {
|
1509 |
+
type: 'discover',
|
1510 |
+
pattern: /^(6011|65|64[4-9]|622)/,
|
1511 |
+
format: defaultFormat,
|
1512 |
+
length: [16],
|
1513 |
+
cvcLength: [3],
|
1514 |
+
luhn: true
|
1515 |
+
}, {
|
1516 |
+
type: 'jcb',
|
1517 |
+
pattern: /^35/,
|
1518 |
+
format: defaultFormat,
|
1519 |
+
length: [16],
|
1520 |
+
cvcLength: [3],
|
1521 |
+
luhn: true
|
1522 |
+
}, {
|
1523 |
+
type: 'laser',
|
1524 |
+
pattern: /^(6706|6771|6709)/,
|
1525 |
+
format: defaultFormat,
|
1526 |
+
length: [16, 17, 18, 19],
|
1527 |
+
cvcLength: [3],
|
1528 |
+
luhn: true
|
1529 |
+
}, {
|
1530 |
+
type: 'maestro',
|
1531 |
+
pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
|
1532 |
+
format: defaultFormat,
|
1533 |
+
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
1534 |
+
cvcLength: [3],
|
1535 |
+
luhn: true
|
1536 |
+
}, {
|
1537 |
+
type: 'mastercard',
|
1538 |
+
pattern: /^5[1-5]/,
|
1539 |
+
format: defaultFormat,
|
1540 |
+
length: [16],
|
1541 |
+
cvcLength: [3],
|
1542 |
+
luhn: true
|
1543 |
+
}, {
|
1544 |
+
type: 'unionpay',
|
1545 |
+
pattern: /^62/,
|
1546 |
+
format: defaultFormat,
|
1547 |
+
length: [16, 17, 18, 19],
|
1548 |
+
cvcLength: [3],
|
1549 |
+
luhn: false
|
1550 |
+
}, {
|
1551 |
+
type: 'visaelectron',
|
1552 |
+
pattern: /^4(026|17500|405|508|844|91[37])/,
|
1553 |
+
format: defaultFormat,
|
1554 |
+
length: [16],
|
1555 |
+
cvcLength: [3],
|
1556 |
+
luhn: true
|
1557 |
+
}, {
|
1558 |
+
type: 'visa',
|
1559 |
+
pattern: /^4/,
|
1560 |
+
format: defaultFormat,
|
1561 |
+
length: [13, 14, 15, 16],
|
1562 |
+
cvcLength: [3],
|
1563 |
+
luhn: true
|
1564 |
+
}
|
1565 |
+
];
|
1566 |
+
|
1567 |
+
cardFromNumber = function(num) {
|
1568 |
+
var card, _i, _len;
|
1569 |
+
num = (num + '').replace(/\D/g, '');
|
1570 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1571 |
+
card = cards[_i];
|
1572 |
+
if (card.pattern.test(num)) {
|
1573 |
+
return card;
|
1574 |
+
}
|
1575 |
+
}
|
1576 |
+
};
|
1577 |
+
|
1578 |
+
cardFromType = function(type) {
|
1579 |
+
var card, _i, _len;
|
1580 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1581 |
+
card = cards[_i];
|
1582 |
+
if (card.type === type) {
|
1583 |
+
return card;
|
1584 |
+
}
|
1585 |
+
}
|
1586 |
+
};
|
1587 |
+
|
1588 |
+
luhnCheck = function(num) {
|
1589 |
+
var digit, digits, odd, sum, _i, _len;
|
1590 |
+
odd = true;
|
1591 |
+
sum = 0;
|
1592 |
+
digits = (num + '').split('').reverse();
|
1593 |
+
for (_i = 0, _len = digits.length; _i < _len; _i++) {
|
1594 |
+
digit = digits[_i];
|
1595 |
+
digit = parseInt(digit, 10);
|
1596 |
+
if ((odd = !odd)) {
|
1597 |
+
digit *= 2;
|
1598 |
+
}
|
1599 |
+
if (digit > 9) {
|
1600 |
+
digit -= 9;
|
1601 |
+
}
|
1602 |
+
sum += digit;
|
1603 |
+
}
|
1604 |
+
return sum % 10 === 0;
|
1605 |
+
};
|
1606 |
+
|
1607 |
+
hasTextSelected = function(target) {
|
1608 |
+
var _ref;
|
1609 |
+
if ((target.selectionStart != null) && target.selectionStart !== target.selectionEnd) {
|
1610 |
+
return true;
|
1611 |
+
}
|
1612 |
+
if ((typeof document !== "undefined" && document !== null ? (_ref = document.selection) != null ? _ref.createRange : void 0 : void 0) != null) {
|
1613 |
+
if (document.selection.createRange().text) {
|
1614 |
+
return true;
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
return false;
|
1618 |
+
};
|
1619 |
+
|
1620 |
+
reFormatCardNumber = function(e) {
|
1621 |
+
return setTimeout((function(_this) {
|
1622 |
+
return function() {
|
1623 |
+
var target, value;
|
1624 |
+
target = e.target;
|
1625 |
+
value = QJ.val(target);
|
1626 |
+
value = Payment.fns.formatCardNumber(value);
|
1627 |
+
return QJ.val(target, value);
|
1628 |
+
};
|
1629 |
+
})(this));
|
1630 |
+
};
|
1631 |
+
|
1632 |
+
formatCardNumber = function(e) {
|
1633 |
+
var card, digit, length, re, target, upperLength, value;
|
1634 |
+
digit = String.fromCharCode(e.which);
|
1635 |
+
if (!/^\d+$/.test(digit)) {
|
1636 |
+
return;
|
1637 |
+
}
|
1638 |
+
target = e.target;
|
1639 |
+
value = QJ.val(target);
|
1640 |
+
card = cardFromNumber(value + digit);
|
1641 |
+
length = (value.replace(/\D/g, '') + digit).length;
|
1642 |
+
upperLength = 16;
|
1643 |
+
if (card) {
|
1644 |
+
upperLength = card.length[card.length.length - 1];
|
1645 |
+
}
|
1646 |
+
if (length >= upperLength) {
|
1647 |
+
return;
|
1648 |
+
}
|
1649 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1650 |
+
return;
|
1651 |
+
}
|
1652 |
+
if (card && card.type === 'amex') {
|
1653 |
+
re = /^(\d{4}|\d{4}\s\d{6})$/;
|
1654 |
+
} else {
|
1655 |
+
re = /(?:^|\s)(\d{4})$/;
|
1656 |
+
}
|
1657 |
+
if (re.test(value)) {
|
1658 |
+
e.preventDefault();
|
1659 |
+
return QJ.val(target, value + ' ' + digit);
|
1660 |
+
} else if (re.test(value + digit)) {
|
1661 |
+
e.preventDefault();
|
1662 |
+
return QJ.val(target, value + digit + ' ');
|
1663 |
+
}
|
1664 |
+
};
|
1665 |
+
|
1666 |
+
formatBackCardNumber = function(e) {
|
1667 |
+
var target, value;
|
1668 |
+
target = e.target;
|
1669 |
+
value = QJ.val(target);
|
1670 |
+
if (e.meta) {
|
1671 |
+
return;
|
1672 |
+
}
|
1673 |
+
if (e.which !== 8) {
|
1674 |
+
return;
|
1675 |
+
}
|
1676 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1677 |
+
return;
|
1678 |
+
}
|
1679 |
+
if (/\d\s$/.test(value)) {
|
1680 |
+
e.preventDefault();
|
1681 |
+
return QJ.val(target, value.replace(/\d\s$/, ''));
|
1682 |
+
} else if (/\s\d?$/.test(value)) {
|
1683 |
+
e.preventDefault();
|
1684 |
+
return QJ.val(target, value.replace(/\s\d?$/, ''));
|
1685 |
+
}
|
1686 |
+
};
|
1687 |
+
|
1688 |
+
formatExpiry = function(e) {
|
1689 |
+
var digit, target, val;
|
1690 |
+
digit = String.fromCharCode(e.which);
|
1691 |
+
if (!/^\d+$/.test(digit)) {
|
1692 |
+
return;
|
1693 |
+
}
|
1694 |
+
target = e.target;
|
1695 |
+
val = QJ.val(target) + digit;
|
1696 |
+
if (/^\d$/.test(val) && (val !== '0' && val !== '1')) {
|
1697 |
+
e.preventDefault();
|
1698 |
+
return QJ.val(target, "0" + val + " / ");
|
1699 |
+
} else if (/^\d\d$/.test(val)) {
|
1700 |
+
e.preventDefault();
|
1701 |
+
return QJ.val(target, "" + val + " / ");
|
1702 |
+
}
|
1703 |
+
};
|
1704 |
+
|
1705 |
+
formatForwardExpiry = function(e) {
|
1706 |
+
var digit, target, val;
|
1707 |
+
digit = String.fromCharCode(e.which);
|
1708 |
+
if (!/^\d+$/.test(digit)) {
|
1709 |
+
return;
|
1710 |
+
}
|
1711 |
+
target = e.target;
|
1712 |
+
val = QJ.val(target);
|
1713 |
+
if (/^\d\d$/.test(val)) {
|
1714 |
+
return QJ.val(target, "" + val + " / ");
|
1715 |
+
}
|
1716 |
+
};
|
1717 |
+
|
1718 |
+
formatForwardSlash = function(e) {
|
1719 |
+
var slash, target, val;
|
1720 |
+
slash = String.fromCharCode(e.which);
|
1721 |
+
if (slash !== '/') {
|
1722 |
+
return;
|
1723 |
+
}
|
1724 |
+
target = e.target;
|
1725 |
+
val = QJ.val(target);
|
1726 |
+
if (/^\d$/.test(val) && val !== '0') {
|
1727 |
+
return QJ.val(target, "0" + val + " / ");
|
1728 |
+
}
|
1729 |
+
};
|
1730 |
+
|
1731 |
+
formatBackExpiry = function(e) {
|
1732 |
+
var target, value;
|
1733 |
+
if (e.metaKey) {
|
1734 |
+
return;
|
1735 |
+
}
|
1736 |
+
target = e.target;
|
1737 |
+
value = QJ.val(target);
|
1738 |
+
if (e.which !== 8) {
|
1739 |
+
return;
|
1740 |
+
}
|
1741 |
+
if ((target.selectionStart != null) && target.selectionStart !== value.length) {
|
1742 |
+
return;
|
1743 |
+
}
|
1744 |
+
if (/\d(\s|\/)+$/.test(value)) {
|
1745 |
+
e.preventDefault();
|
1746 |
+
return QJ.val(target, value.replace(/\d(\s|\/)*$/, ''));
|
1747 |
+
} else if (/\s\/\s?\d?$/.test(value)) {
|
1748 |
+
e.preventDefault();
|
1749 |
+
return QJ.val(target, value.replace(/\s\/\s?\d?$/, ''));
|
1750 |
+
}
|
1751 |
+
};
|
1752 |
+
|
1753 |
+
restrictNumeric = function(e) {
|
1754 |
+
var input;
|
1755 |
+
if (e.metaKey || e.ctrlKey) {
|
1756 |
+
return true;
|
1757 |
+
}
|
1758 |
+
if (e.which === 32) {
|
1759 |
+
return e.preventDefault();
|
1760 |
+
}
|
1761 |
+
if (e.which === 0) {
|
1762 |
+
return true;
|
1763 |
+
}
|
1764 |
+
if (e.which < 33) {
|
1765 |
+
return true;
|
1766 |
+
}
|
1767 |
+
input = String.fromCharCode(e.which);
|
1768 |
+
if (!/[\d\s]/.test(input)) {
|
1769 |
+
return e.preventDefault();
|
1770 |
+
}
|
1771 |
+
};
|
1772 |
+
|
1773 |
+
restrictCardNumber = function(e) {
|
1774 |
+
var card, digit, target, value;
|
1775 |
+
target = e.target;
|
1776 |
+
digit = String.fromCharCode(e.which);
|
1777 |
+
if (!/^\d+$/.test(digit)) {
|
1778 |
+
return;
|
1779 |
+
}
|
1780 |
+
if (hasTextSelected(target)) {
|
1781 |
+
return;
|
1782 |
+
}
|
1783 |
+
value = (QJ.val(target) + digit).replace(/\D/g, '');
|
1784 |
+
card = cardFromNumber(value);
|
1785 |
+
if (card) {
|
1786 |
+
if (!(value.length <= card.length[card.length.length - 1])) {
|
1787 |
+
return e.preventDefault();
|
1788 |
+
}
|
1789 |
+
} else {
|
1790 |
+
if (!(value.length <= 16)) {
|
1791 |
+
return e.preventDefault();
|
1792 |
+
}
|
1793 |
+
}
|
1794 |
+
};
|
1795 |
+
|
1796 |
+
restrictExpiry = function(e) {
|
1797 |
+
var digit, target, value;
|
1798 |
+
target = e.target;
|
1799 |
+
digit = String.fromCharCode(e.which);
|
1800 |
+
if (!/^\d+$/.test(digit)) {
|
1801 |
+
return;
|
1802 |
+
}
|
1803 |
+
if (hasTextSelected(target)) {
|
1804 |
+
return;
|
1805 |
+
}
|
1806 |
+
value = QJ.val(target) + digit;
|
1807 |
+
value = value.replace(/\D/g, '');
|
1808 |
+
if (value.length > 6) {
|
1809 |
+
return e.preventDefault();
|
1810 |
+
}
|
1811 |
+
};
|
1812 |
+
|
1813 |
+
restrictCVC = function(e) {
|
1814 |
+
var digit, target, val;
|
1815 |
+
target = e.target;
|
1816 |
+
digit = String.fromCharCode(e.which);
|
1817 |
+
if (!/^\d+$/.test(digit)) {
|
1818 |
+
return;
|
1819 |
+
}
|
1820 |
+
val = QJ.val(target) + digit;
|
1821 |
+
if (!(val.length <= 4)) {
|
1822 |
+
return e.preventDefault();
|
1823 |
+
}
|
1824 |
+
};
|
1825 |
+
|
1826 |
+
setCardType = function(e) {
|
1827 |
+
var allTypes, card, cardType, target, val;
|
1828 |
+
target = e.target;
|
1829 |
+
val = QJ.val(target);
|
1830 |
+
cardType = Payment.fns.cardType(val) || 'unknown';
|
1831 |
+
if (!QJ.hasClass(target, cardType)) {
|
1832 |
+
allTypes = (function() {
|
1833 |
+
var _i, _len, _results;
|
1834 |
+
_results = [];
|
1835 |
+
for (_i = 0, _len = cards.length; _i < _len; _i++) {
|
1836 |
+
card = cards[_i];
|
1837 |
+
_results.push(card.type);
|
1838 |
+
}
|
1839 |
+
return _results;
|
1840 |
+
})();
|
1841 |
+
QJ.removeClass(target, 'unknown');
|
1842 |
+
QJ.removeClass(target, allTypes.join(' '));
|
1843 |
+
QJ.addClass(target, cardType);
|
1844 |
+
QJ.toggleClass(target, 'identified', cardType !== 'unknown');
|
1845 |
+
return QJ.trigger(target, 'payment.cardType', cardType);
|
1846 |
+
}
|
1847 |
+
};
|
1848 |
+
|
1849 |
+
Payment = (function() {
|
1850 |
+
function Payment() {}
|
1851 |
+
|
1852 |
+
Payment.fns = {
|
1853 |
+
cardExpiryVal: function(value) {
|
1854 |
+
var month, prefix, year, _ref;
|
1855 |
+
value = value.replace(/\s/g, '');
|
1856 |
+
_ref = value.split('/', 2), month = _ref[0], year = _ref[1];
|
1857 |
+
if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
|
1858 |
+
prefix = (new Date).getFullYear();
|
1859 |
+
prefix = prefix.toString().slice(0, 2);
|
1860 |
+
year = prefix + year;
|
1861 |
+
}
|
1862 |
+
month = parseInt(month, 10);
|
1863 |
+
year = parseInt(year, 10);
|
1864 |
+
return {
|
1865 |
+
month: month,
|
1866 |
+
year: year
|
1867 |
+
};
|
1868 |
+
},
|
1869 |
+
validateCardNumber: function(num) {
|
1870 |
+
var card, _ref;
|
1871 |
+
num = (num + '').replace(/\s+|-/g, '');
|
1872 |
+
if (!/^\d+$/.test(num)) {
|
1873 |
+
return false;
|
1874 |
+
}
|
1875 |
+
card = cardFromNumber(num);
|
1876 |
+
if (!card) {
|
1877 |
+
return false;
|
1878 |
+
}
|
1879 |
+
return (_ref = num.length, __indexOf.call(card.length, _ref) >= 0) && (card.luhn === false || luhnCheck(num));
|
1880 |
+
},
|
1881 |
+
validateCardExpiry: function(month, year) {
|
1882 |
+
var currentTime, expiry, prefix, _ref;
|
1883 |
+
if (typeof month === 'object' && 'month' in month) {
|
1884 |
+
_ref = month, month = _ref.month, year = _ref.year;
|
1885 |
+
}
|
1886 |
+
if (!(month && year)) {
|
1887 |
+
return false;
|
1888 |
+
}
|
1889 |
+
month = QJ.trim(month);
|
1890 |
+
year = QJ.trim(year);
|
1891 |
+
if (!/^\d+$/.test(month)) {
|
1892 |
+
return false;
|
1893 |
+
}
|
1894 |
+
if (!/^\d+$/.test(year)) {
|
1895 |
+
return false;
|
1896 |
+
}
|
1897 |
+
if (!(parseInt(month, 10) <= 12)) {
|
1898 |
+
return false;
|
1899 |
+
}
|
1900 |
+
if (year.length === 2) {
|
1901 |
+
prefix = (new Date).getFullYear();
|
1902 |
+
prefix = prefix.toString().slice(0, 2);
|
1903 |
+
year = prefix + year;
|
1904 |
+
}
|
1905 |
+
expiry = new Date(year, month);
|
1906 |
+
currentTime = new Date;
|
1907 |
+
expiry.setMonth(expiry.getMonth() - 1);
|
1908 |
+
expiry.setMonth(expiry.getMonth() + 1, 1);
|
1909 |
+
return expiry > currentTime;
|
1910 |
+
},
|
1911 |
+
validateCardCVC: function(cvc, type) {
|
1912 |
+
var _ref, _ref1;
|
1913 |
+
cvc = QJ.trim(cvc);
|
1914 |
+
if (!/^\d+$/.test(cvc)) {
|
1915 |
+
return false;
|
1916 |
+
}
|
1917 |
+
if (type && cardFromType(type)) {
|
1918 |
+
return _ref = cvc.length, __indexOf.call((_ref1 = cardFromType(type)) != null ? _ref1.cvcLength : void 0, _ref) >= 0;
|
1919 |
+
} else {
|
1920 |
+
return cvc.length >= 3 && cvc.length <= 4;
|
1921 |
+
}
|
1922 |
+
},
|
1923 |
+
cardType: function(num) {
|
1924 |
+
var _ref;
|
1925 |
+
if (!num) {
|
1926 |
+
return null;
|
1927 |
+
}
|
1928 |
+
return ((_ref = cardFromNumber(num)) != null ? _ref.type : void 0) || null;
|
1929 |
+
},
|
1930 |
+
formatCardNumber: function(num) {
|
1931 |
+
var card, groups, upperLength, _ref;
|
1932 |
+
card = cardFromNumber(num);
|
1933 |
+
if (!card) {
|
1934 |
+
return num;
|
1935 |
+
}
|
1936 |
+
upperLength = card.length[card.length.length - 1];
|
1937 |
+
num = num.replace(/\D/g, '');
|
1938 |
+
num = num.slice(0, +upperLength + 1 || 9e9);
|
1939 |
+
if (card.format.global) {
|
1940 |
+
return (_ref = num.match(card.format)) != null ? _ref.join(' ') : void 0;
|
1941 |
+
} else {
|
1942 |
+
groups = card.format.exec(num);
|
1943 |
+
if (groups != null) {
|
1944 |
+
groups.shift();
|
1945 |
+
}
|
1946 |
+
return groups != null ? groups.join(' ') : void 0;
|
1947 |
+
}
|
1948 |
+
}
|
1949 |
+
};
|
1950 |
+
|
1951 |
+
Payment.restrictNumeric = function(el) {
|
1952 |
+
return QJ.on(el, 'keypress', restrictNumeric);
|
1953 |
+
};
|
1954 |
+
|
1955 |
+
Payment.cardExpiryVal = function(el) {
|
1956 |
+
return Payment.fns.cardExpiryVal(QJ.val(el));
|
1957 |
+
};
|
1958 |
+
|
1959 |
+
Payment.formatCardCVC = function(el) {
|
1960 |
+
Payment.restrictNumeric(el);
|
1961 |
+
QJ.on(el, 'keypress', restrictCVC);
|
1962 |
+
return el;
|
1963 |
+
};
|
1964 |
+
|
1965 |
+
Payment.formatCardExpiry = function(el) {
|
1966 |
+
Payment.restrictNumeric(el);
|
1967 |
+
QJ.on(el, 'keypress', restrictExpiry);
|
1968 |
+
QJ.on(el, 'keypress', formatExpiry);
|
1969 |
+
QJ.on(el, 'keypress', formatForwardSlash);
|
1970 |
+
QJ.on(el, 'keypress', formatForwardExpiry);
|
1971 |
+
QJ.on(el, 'keydown', formatBackExpiry);
|
1972 |
+
return el;
|
1973 |
+
};
|
1974 |
+
|
1975 |
+
Payment.formatCardNumber = function(el) {
|
1976 |
+
Payment.restrictNumeric(el);
|
1977 |
+
QJ.on(el, 'keypress', restrictCardNumber);
|
1978 |
+
QJ.on(el, 'keypress', formatCardNumber);
|
1979 |
+
QJ.on(el, 'keydown', formatBackCardNumber);
|
1980 |
+
QJ.on(el, 'keyup', setCardType);
|
1981 |
+
QJ.on(el, 'paste', reFormatCardNumber);
|
1982 |
+
return el;
|
1983 |
+
};
|
1984 |
+
|
1985 |
+
Payment.getCardArray = function() {
|
1986 |
+
return cards;
|
1987 |
+
};
|
1988 |
+
|
1989 |
+
Payment.setCardArray = function(cardArray) {
|
1990 |
+
cards = cardArray;
|
1991 |
+
return true;
|
1992 |
+
};
|
1993 |
+
|
1994 |
+
Payment.addToCardArray = function(cardObject) {
|
1995 |
+
return cards.push(cardObject);
|
1996 |
+
};
|
1997 |
+
|
1998 |
+
Payment.removeFromCardArray = function(type) {
|
1999 |
+
var key, value;
|
2000 |
+
for (key in cards) {
|
2001 |
+
value = cards[key];
|
2002 |
+
if (value.type === type) {
|
2003 |
+
cards.splice(key, 1);
|
2004 |
+
}
|
2005 |
+
}
|
2006 |
+
return true;
|
2007 |
+
};
|
2008 |
+
|
2009 |
+
return Payment;
|
2010 |
+
|
2011 |
+
})();
|
2012 |
+
|
2013 |
+
module.exports = Payment;
|
2014 |
+
|
2015 |
+
global.Payment = Payment;
|
2016 |
+
|
2017 |
+
|
2018 |
+
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
2019 |
+
},{"qj":4}],10:[function(_dereq_,module,exports){
|
2020 |
+
var css = ".jp-card.jp-card-safari.jp-card-identified .jp-card-front:before, .jp-card.jp-card-safari.jp-card-identified .jp-card-back:before {\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); }\n\n.jp-card.jp-card-ie-10.jp-card-flipped, .jp-card.jp-card-ie-11.jp-card-flipped {\n -webkit-transform: 0deg;\n -moz-transform: 0deg;\n -ms-transform: 0deg;\n -o-transform: 0deg;\n transform: 0deg; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-front, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-front {\n -webkit-transform: rotateY(0deg);\n -moz-transform: rotateY(0deg);\n -ms-transform: rotateY(0deg);\n -o-transform: rotateY(0deg);\n transform: rotateY(0deg); }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back {\n -webkit-transform: rotateY(0deg);\n -moz-transform: rotateY(0deg);\n -ms-transform: rotateY(0deg);\n -o-transform: rotateY(0deg);\n transform: rotateY(0deg); }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back:after {\n left: 18%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-cvc, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-cvc {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg);\n left: 5%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny {\n left: 84%; }\n .jp-card.jp-card-ie-10.jp-card-flipped .jp-card-back .jp-card-shiny:after, .jp-card.jp-card-ie-11.jp-card-flipped .jp-card-back .jp-card-shiny:after {\n left: -480%;\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n\n.jp-card.jp-card-ie-10.jp-card-amex .jp-card-back, .jp-card.jp-card-ie-11.jp-card-amex .jp-card-back {\n display: none; }\n\n.jp-card-logo {\n height: 36px;\n width: 60px;\n font-style: italic; }\n .jp-card-logo, .jp-card-logo:before, .jp-card-logo:after {\n box-sizing: border-box; }\n\n.jp-card-logo.jp-card-amex {\n text-transform: uppercase;\n font-size: 4px;\n font-weight: bold;\n color: white;\n background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px);\n background-image: repeating-radial-gradient(circle at center, #FFF 1px, #999 2px);\n border: 1px solid #EEE; }\n .jp-card-logo.jp-card-amex:before, .jp-card-logo.jp-card-amex:after {\n width: 28px;\n display: block;\n position: absolute;\n left: 16px; }\n .jp-card-logo.jp-card-amex:before {\n height: 28px;\n content: \"american\";\n top: 3px;\n text-align: left;\n padding-left: 2px;\n padding-top: 11px;\n background: #267AC3; }\n .jp-card-logo.jp-card-amex:after {\n content: \"express\";\n bottom: 11px;\n text-align: right;\n padding-right: 2px; }\n\n.jp-card.jp-card-amex.jp-card-flipped {\n -webkit-transform: none;\n -moz-transform: none;\n -ms-transform: none;\n -o-transform: none;\n transform: none; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front:before, .jp-card.jp-card-amex.jp-card-identified .jp-card-back:before {\n background-color: #108168; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-logo.jp-card-amex {\n opacity: 1; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front .jp-card-cvc {\n visibility: visible; }\n.jp-card.jp-card-amex.jp-card-identified .jp-card-front:after {\n opacity: 1; }\n\n.jp-card-logo.jp-card-discover {\n background: #FF6600;\n color: #111;\n text-transform: uppercase;\n font-style: normal;\n font-weight: bold;\n font-size: 10px;\n text-align: center;\n overflow: hidden;\n z-index: 1;\n padding-top: 9px;\n letter-spacing: 0.03em;\n border: 1px solid #EEE; }\n .jp-card-logo.jp-card-discover:before, .jp-card-logo.jp-card-discover:after {\n content: \" \";\n display: block;\n position: absolute; }\n .jp-card-logo.jp-card-discover:before {\n background: white;\n width: 200px;\n height: 200px;\n border-radius: 200px;\n bottom: -5%;\n right: -80%;\n z-index: -1; }\n .jp-card-logo.jp-card-discover:after {\n width: 8px;\n height: 8px;\n border-radius: 4px;\n top: 10px;\n left: 27px;\n background-color: #FFF;\n background-image: -webkit-radial-gradient(#FFF, #FF6600);\n background-image: radial-gradient( #FFF, #FF6600);\n content: \"network\";\n font-size: 4px;\n line-height: 24px;\n text-indent: -7px; }\n\n.jp-card .jp-card-front .jp-card-logo.jp-card-discover {\n right: 12%;\n top: 18%; }\n\n.jp-card.jp-card-discover.jp-card-identified .jp-card-front:before, .jp-card.jp-card-discover.jp-card-identified .jp-card-back:before {\n background-color: #86B8CF; }\n.jp-card.jp-card-discover.jp-card-identified .jp-card-logo.jp-card-discover {\n opacity: 1; }\n.jp-card.jp-card-discover.jp-card-identified .jp-card-front:after {\n -webkit-transition: 400ms;\n -moz-transition: 400ms;\n transition: 400ms;\n content: \" \";\n display: block;\n background-color: #FF6600;\n background-image: -webkit-linear-gradient(#FF6600, #ffa166, #FF6600);\n background-image: linear-gradient(#FF6600, #ffa166, #FF6600);\n height: 50px;\n width: 50px;\n border-radius: 25px;\n position: absolute;\n left: 100%;\n top: 15%;\n margin-left: -25px;\n box-shadow: inset 1px 1px 3px 1px rgba(0, 0, 0, 0.5); }\n\n.jp-card-logo.jp-card-visa {\n background: white;\n text-transform: uppercase;\n color: #1A1876;\n text-align: center;\n font-weight: bold;\n font-size: 15px;\n line-height: 18px; }\n .jp-card-logo.jp-card-visa:before, .jp-card-logo.jp-card-visa:after {\n content: \" \";\n display: block;\n width: 100%;\n height: 25%; }\n .jp-card-logo.jp-card-visa:before {\n background: #1A1876; }\n .jp-card-logo.jp-card-visa:after {\n background: #E79800; }\n\n.jp-card.jp-card-visa.jp-card-identified .jp-card-front:before, .jp-card.jp-card-visa.jp-card-identified .jp-card-back:before {\n background-color: #191278; }\n.jp-card.jp-card-visa.jp-card-identified .jp-card-logo.jp-card-visa {\n opacity: 1; }\n\n.jp-card-logo.jp-card-mastercard {\n color: white;\n font-weight: bold;\n text-align: center;\n font-size: 9px;\n line-height: 36px;\n z-index: 1;\n text-shadow: 1px 1px rgba(0, 0, 0, 0.6); }\n .jp-card-logo.jp-card-mastercard:before, .jp-card-logo.jp-card-mastercard:after {\n content: \" \";\n display: block;\n width: 36px;\n top: 0;\n position: absolute;\n height: 36px;\n border-radius: 18px; }\n .jp-card-logo.jp-card-mastercard:before {\n left: 0;\n background: #FF0000;\n z-index: -1; }\n .jp-card-logo.jp-card-mastercard:after {\n right: 0;\n background: #FFAB00;\n z-index: -2; }\n\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-front .jp-card-logo.jp-card-mastercard, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back .jp-card-logo.jp-card-mastercard {\n box-shadow: none; }\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-front:before, .jp-card.jp-card-mastercard.jp-card-identified .jp-card-back:before {\n background-color: #0061A8; }\n.jp-card.jp-card-mastercard.jp-card-identified .jp-card-logo.jp-card-mastercard {\n opacity: 1; }\n\n.jp-card-logo.jp-card-maestro {\n color: white;\n font-weight: bold;\n text-align: center;\n font-size: 14px;\n line-height: 36px;\n z-index: 1;\n text-shadow: 1px 1px rgba(0, 0, 0, 0.6); }\n .jp-card-logo.jp-card-maestro:before, .jp-card-logo.jp-card-maestro:after {\n content: \" \";\n display: block;\n width: 36px;\n top: 0;\n position: absolute;\n height: 36px;\n border-radius: 18px; }\n .jp-card-logo.jp-card-maestro:before {\n left: 0;\n background: #0064CB;\n z-index: -1; }\n .jp-card-logo.jp-card-maestro:after {\n right: 0;\n background: #CC0000;\n z-index: -2; }\n\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-front .jp-card-logo.jp-card-maestro, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back .jp-card-logo.jp-card-maestro {\n box-shadow: none; }\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-front:before, .jp-card.jp-card-maestro.jp-card-identified .jp-card-back:before {\n background-color: #0B2C5F; }\n.jp-card.jp-card-maestro.jp-card-identified .jp-card-logo.jp-card-maestro {\n opacity: 1; }\n\n.jp-card-logo.jp-card-dankort {\n width: 60px;\n height: 36px;\n padding: 3px;\n border-radius: 8px;\n border: #000000 1px solid;\n background-color: #FFFFFF; }\n .jp-card-logo.jp-card-dankort .dk {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n .jp-card-logo.jp-card-dankort .dk:before {\n background-color: #ED1C24;\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n display: block;\n border-radius: 6px; }\n .jp-card-logo.jp-card-dankort .dk:after {\n content: '';\n position: absolute;\n top: 50%;\n margin-top: -7.7px;\n right: 0;\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 7px 7px 10px 0;\n border-color: transparent #ED1C24 transparent transparent;\n z-index: 1; }\n .jp-card-logo.jp-card-dankort .d, .jp-card-logo.jp-card-dankort .k {\n position: absolute;\n top: 50%;\n width: 50%;\n display: block;\n height: 15.4px;\n margin-top: -7.7px;\n background: white; }\n .jp-card-logo.jp-card-dankort .d {\n left: 0;\n border-radius: 0 8px 10px 0; }\n .jp-card-logo.jp-card-dankort .d:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n display: block;\n background: #ED1C24;\n border-radius: 2px 4px 6px 0px;\n height: 5px;\n width: 7px;\n margin: -3px 0 0 -4px; }\n .jp-card-logo.jp-card-dankort .k {\n right: 0; }\n .jp-card-logo.jp-card-dankort .k:before, .jp-card-logo.jp-card-dankort .k:after {\n content: '';\n position: absolute;\n right: 50%;\n width: 0;\n height: 0;\n border-style: solid;\n margin-right: -1px; }\n .jp-card-logo.jp-card-dankort .k:before {\n top: 0;\n border-width: 8px 5px 0 0;\n border-color: #ED1C24 transparent transparent transparent; }\n .jp-card-logo.jp-card-dankort .k:after {\n bottom: 0;\n border-width: 0 5px 8px 0;\n border-color: transparent transparent #ED1C24 transparent; }\n\n.jp-card.jp-card-dankort.jp-card-identified .jp-card-front:before, .jp-card.jp-card-dankort.jp-card-identified .jp-card-back:before {\n background-color: #0055C7; }\n.jp-card.jp-card-dankort.jp-card-identified .jp-card-logo.jp-card-dankort {\n opacity: 1; }\n\n.jp-card-container {\n -webkit-perspective: 1000px;\n -moz-perspective: 1000px;\n perspective: 1000px;\n width: 350px;\n max-width: 100%;\n height: 200px;\n margin: auto;\n z-index: 1;\n position: relative; }\n\n.jp-card {\n font-family: \"Helvetica Neue\";\n line-height: 1;\n position: relative;\n width: 100%;\n height: 100%;\n min-width: 315px;\n border-radius: 10px;\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n -ms-transform-style: preserve-3d;\n -o-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 400ms linear;\n -moz-transition: all 400ms linear;\n transition: all 400ms linear; }\n .jp-card > *, .jp-card > *:before, .jp-card > *:after {\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-family: inherit; }\n .jp-card.jp-card-flipped {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n .jp-card .jp-card-front, .jp-card .jp-card-back {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n -ms-transform-style: preserve-3d;\n -o-transform-style: preserve-3d;\n transform-style: preserve-3d;\n -webkit-transition: all 400ms linear;\n -moz-transition: all 400ms linear;\n transition: all 400ms linear;\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n overflow: hidden;\n border-radius: 10px;\n background: #DDD; }\n .jp-card .jp-card-front:before, .jp-card .jp-card-back:before {\n content: \" \";\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n opacity: 0;\n border-radius: 10px;\n -webkit-transition: all 400ms ease;\n -moz-transition: all 400ms ease;\n transition: all 400ms ease; }\n .jp-card .jp-card-front:after, .jp-card .jp-card-back:after {\n content: \" \";\n display: block; }\n .jp-card .jp-card-front .jp-card-display, .jp-card .jp-card-back .jp-card-display {\n color: white;\n font-weight: normal;\n opacity: 0.5;\n -webkit-transition: opacity 400ms linear;\n -moz-transition: opacity 400ms linear;\n transition: opacity 400ms linear; }\n .jp-card .jp-card-front .jp-card-display.jp-card-focused, .jp-card .jp-card-back .jp-card-display.jp-card-focused {\n opacity: 1;\n font-weight: 700; }\n .jp-card .jp-card-front .jp-card-cvc, .jp-card .jp-card-back .jp-card-cvc {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 14px; }\n .jp-card .jp-card-front .jp-card-shiny, .jp-card .jp-card-back .jp-card-shiny {\n width: 50px;\n height: 35px;\n border-radius: 5px;\n background: #CCC;\n position: relative; }\n .jp-card .jp-card-front .jp-card-shiny:before, .jp-card .jp-card-back .jp-card-shiny:before {\n content: \" \";\n display: block;\n width: 70%;\n height: 60%;\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n background: #d9d9d9;\n position: absolute;\n top: 20%; }\n .jp-card .jp-card-front .jp-card-logo {\n position: absolute;\n opacity: 0;\n right: 5%;\n top: 8%;\n -webkit-transition: 400ms;\n -moz-transition: 400ms;\n transition: 400ms; }\n .jp-card .jp-card-front .jp-card-lower {\n width: 80%;\n position: absolute;\n left: 10%;\n bottom: 30px; }\n @media only screen and (max-width: 480px) {\n .jp-card .jp-card-front .jp-card-lower {\n width: 90%;\n left: 5%; } }\n .jp-card .jp-card-front .jp-card-lower .jp-card-cvc {\n visibility: hidden;\n float: right;\n position: relative;\n bottom: 5px; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-number {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 24px;\n clear: both;\n margin-bottom: 30px; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry {\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n letter-spacing: 0em;\n position: relative;\n float: right;\n width: 25%; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before, .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after {\n font-family: \"Helvetica Neue\";\n font-weight: bold;\n font-size: 7px;\n white-space: pre;\n display: block;\n opacity: 0.5; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:before {\n content: attr(data-before);\n margin-bottom: 2px;\n font-size: 7px;\n text-transform: uppercase; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-expiry:after {\n position: absolute;\n content: attr(data-after);\n text-align: right;\n right: 100%;\n margin-right: 5px;\n margin-top: 2px;\n bottom: 0; }\n .jp-card .jp-card-front .jp-card-lower .jp-card-name {\n text-transform: uppercase;\n font-family: \"Bitstream Vera Sans Mono\", Consolas, Courier, monospace;\n font-size: 20px;\n max-height: 45px;\n position: absolute;\n bottom: 0;\n width: 190px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: horizontal;\n overflow: hidden;\n text-overflow: ellipsis; }\n .jp-card .jp-card-back {\n -webkit-transform: rotateY(180deg);\n -moz-transform: rotateY(180deg);\n -ms-transform: rotateY(180deg);\n -o-transform: rotateY(180deg);\n transform: rotateY(180deg); }\n .jp-card .jp-card-back .jp-card-bar {\n background-color: #444;\n background-image: -webkit-linear-gradient(#444, #333);\n background-image: linear-gradient(#444, #333);\n width: 100%;\n height: 20%;\n position: absolute;\n top: 10%; }\n .jp-card .jp-card-back:after {\n content: \" \";\n display: block;\n background-color: #FFF;\n background-image: -webkit-linear-gradient(#FFF, #FFF);\n background-image: linear-gradient(#FFF, #FFF);\n width: 80%;\n height: 16%;\n position: absolute;\n top: 40%;\n left: 2%; }\n .jp-card .jp-card-back .jp-card-cvc {\n position: absolute;\n top: 40%;\n left: 85%;\n -webkit-transition-delay: 600ms;\n -moz-transition-delay: 600ms;\n transition-delay: 600ms; }\n .jp-card .jp-card-back .jp-card-shiny {\n position: absolute;\n top: 66%;\n left: 2%; }\n .jp-card .jp-card-back .jp-card-shiny:after {\n content: \"This card has been issued by Jesse Pollak and is licensed for anyone to use anywhere for free.\\AIt comes with no warranty.\\A For support issues, please visit: github.com/jessepollak/card.\";\n position: absolute;\n left: 120%;\n top: 5%;\n color: white;\n font-size: 7px;\n width: 230px;\n opacity: 0.5; }\n .jp-card.jp-card-identified {\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); }\n .jp-card.jp-card-identified .jp-card-front, .jp-card.jp-card-identified .jp-card-back {\n background-color: #000;\n background-color: rgba(0, 0, 0, 0.5); }\n .jp-card.jp-card-identified .jp-card-front:before, .jp-card.jp-card-identified .jp-card-back:before {\n -webkit-transition: all 400ms ease;\n -moz-transition: all 400ms ease;\n transition: all 400ms ease;\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n opacity: 1; }\n .jp-card.jp-card-identified .jp-card-front .jp-card-logo, .jp-card.jp-card-identified .jp-card-back .jp-card-logo {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }\n .jp-card.jp-card-identified.no-radial-gradient .jp-card-front:before, .jp-card.jp-card-identified.no-radial-gradient .jp-card-back:before {\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), -webkit-linear-gradient(-245deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%);\n background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 1px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.03) 4px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), repeating-linear-gradient(210deg, rgba(255, 255, 255, 0) 1px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.04) 3px, rgba(255, 255, 255, 0.05) 4px), linear-gradient(-25deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 90%); }\n";(_dereq_('sassify'))(css); module.exports = css;
|
2021 |
+
},{"sassify":5}]},{},[8])
|
2022 |
+
(8)
|
2023 |
+
});
|
js/altima/bettercreditcardform/jquery.noconflict.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.noConflict();
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Altima_BetterCreditCardForm</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/MIT"> The MIT License (MIT)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Better credit card form extension for Magento eCommerce - more user friendly way to enter credit card information on checkout.</summary>
|
10 |
+
<description>Better credit card form extension for Magento eCommerce helps online store customer entering credit card information during checkout process. It provides better user experience: users sees the data entered on the dynamic credit card images that changes as new information added or changed. Hence there is less chance to make an error and successfully complete checkout process. The extension is fully open-source. It is based on http://jessepollak.github.io/card/ library. Better credit card form extension is developed by Altima Interactive - http://shop.altima.net.au</description>
|
11 |
+
<notes>First preview release</notes>
|
12 |
+
<authors><author><name>Andrey</name><user>altimaweb</user><email>andrey.stepin@altima.com.ua</email></author></authors>
|
13 |
+
<date>2015-04-23</date>
|
14 |
+
<time>11:39:33</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Altima"><dir name="BetterCreditCardForm"><dir name="Block"><file name="Bettercreditcardformjs.php" hash="acacd39fa7c7bf21a30dceb537282096"/></dir><dir name="Helper"><file name="Data.php" hash="295924398cf8bc1ada16fd923806975a"/></dir><dir name="Model"><dir name="Layout"><dir name="Generate"><file name="Observer.php" hash="1129f3e0f0f0ca7ecde768abf39dac2e"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BettercreditcartformController.php" hash="71e98371cc54ba1bd2512451c4034954"/></dir></dir><dir name="etc"><file name="config.xml" hash="c88bca088b6dd9c36ad3851bd03be724"/><file name="system.xml" hash="495997ea9d6cb105af871952f4e4d0cb"/></dir><dir name="sql"><dir name="altima_bettercreditcardform_setup"><file name="install-1.0.0.php" hash="b9cf5f850fe4a0b59ebaab6a5eda0b10"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Altima_BetterCreditCardForm.xml" hash="07086ffb5378474f277b209e2b9bdc7f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Altima_BetterCreditCardForm.csv" hash="596284d0487419eb8be4c474a9cf730f"/></dir></target><target name="mageweb"><dir name="js"><dir name="altima"><dir name="bettercreditcardform"><file name="card.js" hash="e993653faa726ae1ebd539ea97309481"/><file name="check_jquery.js" hash="32878661b2bde879b2e93c48ae131941"/><file name="check_jquery.js~" hash="2149fd13025e5115156d75147b9dac0f"/><file name="jquery-migrate-1.2.1.min.js" hash="eb05d8d73b5b13d8d84308a4751ece96"/><file name="jquery.card.js" hash="60fdfa29b53cce38a188444c63bef47c"/><file name="jquery.noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.6</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.0.1</max></package></required></dependencies>
|
18 |
+
</package>
|