Version Notes
- Initial release for our global address endpoint.
Download this release
Release Info
Developer | Gabor Suranyi |
Extension | Crafty_Clicks_Clicktoaddress |
Version | 0.5.0 |
Comparing to | |
See all releases |
Version 0.5.0
- app/code/community/Craftyclicks/C2a/Block/Feedback.php +11 -0
- app/code/community/Craftyclicks/C2a/Block/Gridlight.php +29 -0
- app/code/community/Craftyclicks/C2a/Block/Integration.php +60 -0
- app/code/community/Craftyclicks/C2a/Block/Ordergrid.php +17 -0
- app/code/community/Craftyclicks/C2a/Helper/Data.php +5 -0
- app/code/community/Craftyclicks/C2a/Model/Address.php +9 -0
- app/code/community/Craftyclicks/C2a/Model/Ambient.php +18 -0
- app/code/community/Craftyclicks/C2a/Model/Mode.php +18 -0
- app/code/community/Craftyclicks/C2a/Model/Resource/Address.php +9 -0
- app/code/community/Craftyclicks/C2a/Model/Resource/Address/Collection.php +8 -0
- app/code/community/Craftyclicks/C2a/controllers/HashController.php +10 -0
- app/code/community/Craftyclicks/C2a/data/craftyclicks_c2a_setup/data-upgrade-2.4.9-2.5.0.php +43 -0
- app/code/community/Craftyclicks/C2a/etc/config.xml +123 -0
- app/code/community/Craftyclicks/C2a/etc/config.xml~ +123 -0
- app/code/community/Craftyclicks/C2a/etc/system.xml +145 -0
- app/code/community/Craftyclicks/C2a/etc/system.xml~ +145 -0
- app/code/community/Craftyclicks/C2a/sql/craftyclicks_c2a_setup/install-0.5.0.php +20 -0
- app/code/community/Craftyclicks/C2a/sql/craftyclicks_clicktoaddress_setup/install-1.0.0.php +37 -0
- app/design/adminhtml/default/default/layout/craftyclicks_c2a.xml +67 -0
- app/design/adminhtml/default/default/template/craftyclicks/c2a/c2a_config.phtml +104 -0
- app/design/frontend/base/default/layout/craftyclicks_c2a.xml +70 -0
- app/design/frontend/base/default/template/craftyclicks/c2a/c2a_config.phtml +35 -0
- app/etc/modules/Craftyclicks_C2a.xml +10 -0
- js/craftyclicks/c2a/admin.js +216 -0
- js/craftyclicks/c2a/admin/enhance.js +41 -0
- js/craftyclicks/c2a/default.js +132 -0
- js/craftyclicks/c2a/lib/cc_c2a.min.js +1118 -0
- package.xml +25 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.eot +0 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.min.css +6 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.svg +45 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.ttf +0 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.woff +0 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/enhance.css +13 -0
- skin/adminhtml/default/default/css/craftyclicks/c2a/flags.png +0 -0
- skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.eot +0 -0
- skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.min.css +6 -0
- skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.svg +45 -0
- skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.ttf +0 -0
- skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.woff +0 -0
- skin/frontend/base/default/css/craftyclicks/c2a/flags.png +0 -0
app/code/community/Craftyclicks/C2a/Block/Feedback.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Block_Feedback extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
public function _construct() {
|
6 |
+
parent::_construct();
|
7 |
+
}
|
8 |
+
public function getStatus($param){
|
9 |
+
echo '<script>alert("banana");</script>';
|
10 |
+
}
|
11 |
+
}
|
app/code/community/Craftyclicks/C2a/Block/Gridlight.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Craftyclicks_C2a_Block_Gridlight extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
3 |
+
{
|
4 |
+
public function render(Varien_Object $row)
|
5 |
+
{
|
6 |
+
$error_img = '<img src="'.$this->getSkinUrl('images/error_msg_icon.gif').'"/>';
|
7 |
+
$success_img = '<img src="'.$this->getSkinUrl('images/success_msg_icon.gif').'"/>';
|
8 |
+
//Get the order details based on the order id ($orderId)
|
9 |
+
$order = Mage::getModel('sales/order')->load($row->getData('entity_id'));
|
10 |
+
|
11 |
+
// Get the id of the orders shipping address
|
12 |
+
$shippingId = $order->getShippingAddress()->getId();
|
13 |
+
$billingId = $order->getBillingAddress()->getId();
|
14 |
+
// Get shipping address data using the id
|
15 |
+
$shippingaddress = Mage::getModel('sales/order_address')->load($shippingId);
|
16 |
+
$billingaddress = Mage::getModel('sales/order_address')->load($billingId);
|
17 |
+
/*echo '<pre>';
|
18 |
+
//var_dump($row->getData('addresses'));
|
19 |
+
var_dump($shippingaddress);
|
20 |
+
var_dump($billingaddress);
|
21 |
+
echo '</pre>';
|
22 |
+
*/
|
23 |
+
//$test = Mage::getModel('craftyclicks_c2a/address')->getCollection();
|
24 |
+
//var_dump($test);
|
25 |
+
return $error_img;
|
26 |
+
//return print_r($row, true);
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/Craftyclicks/C2a/Block/Integration.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Block_Integration extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
public function _construct() {
|
6 |
+
parent::_construct();
|
7 |
+
}
|
8 |
+
public function addJS($param){
|
9 |
+
$config = (object) array(
|
10 |
+
'cc_pcl_frontend' => (int) Mage::getStoreConfig('clicktoaddress/general/active'),
|
11 |
+
'cc_pcl_backend' => (int) Mage::getStoreConfig('clicktoaddress/general/active_admin_panel'),
|
12 |
+
'cc_c2a_global' => (int) Mage::getStoreConfig('c2a_global/options/active')
|
13 |
+
);
|
14 |
+
$head = $this->getLayout()->getBlock('head');
|
15 |
+
$path = 'craftyclicks/c2a/';
|
16 |
+
//$head->removeItem('js', 'craftyclicks/clicktoaddress/craftyclicks_magento.js');
|
17 |
+
if($config->cc_c2a_global){
|
18 |
+
$head->addItem('js', $path.'/lib/cc_c2a.min.js');
|
19 |
+
$head->addItem('skin_css', 'css/'.$path.'cc_c2a.min.css');
|
20 |
+
switch($param){
|
21 |
+
case 'admin':
|
22 |
+
$head->addItem('js', $path.'/admin.js');
|
23 |
+
break;
|
24 |
+
default:
|
25 |
+
$head->addItem('js', $path.'/default.js');
|
26 |
+
break;
|
27 |
+
}
|
28 |
+
} elseif($config->cc_pcl_frontend || $config->cc_pcl_backend){
|
29 |
+
/*
|
30 |
+
$head->addItem('js', $path.'crafty_postcode.class.js');
|
31 |
+
switch($param){
|
32 |
+
case 'admin':
|
33 |
+
$head->addItem('js', $path.'craftyclicks_magento_admin.js');
|
34 |
+
break;
|
35 |
+
default:
|
36 |
+
$head->addItem('js', $path.'craftyclicks_magento.js');
|
37 |
+
break;
|
38 |
+
}
|
39 |
+
*/
|
40 |
+
}
|
41 |
+
return $this;
|
42 |
+
}
|
43 |
+
public function addConfig(){
|
44 |
+
$config = (object) array(
|
45 |
+
'cc_pcl_frontend' => (int) Mage::getStoreConfig('clicktoaddress/general/active'),
|
46 |
+
'cc_pcl_backend' => (int) Mage::getStoreConfig('clicktoaddress/general/active_admin_panel'),
|
47 |
+
'cc_c2a_global' => (int) Mage::getStoreConfig('c2a_global/options/active')
|
48 |
+
);
|
49 |
+
/*$message = $this->__('Banana.');
|
50 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($message);
|
51 |
+
*/
|
52 |
+
if($config->cc_c2a_global){
|
53 |
+
echo $this->getLayout()->createBlock('core/template')->setTemplate('craftyclicks/c2a/c2a_config.phtml')->toHtml();
|
54 |
+
|
55 |
+
} elseif($config->cc_pcl_frontend || $config->cc_pcl_backend){
|
56 |
+
//echo $this->getLayout()->createBlock('core/template')->setTemplate('craftyclicks/clicktoaddress/common_config.phtml');
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
}
|
app/code/community/Craftyclicks/C2a/Block/Ordergrid.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Craftyclicks_C2a_Block_Ordergrid extends Mage_Adminhtml_Block_Sales_Order_Grid
|
3 |
+
{
|
4 |
+
protected function _prepareColumns()
|
5 |
+
{
|
6 |
+
parent::_prepareColumns();
|
7 |
+
$this->addColumn('cc_valid', array(
|
8 |
+
'header' => Mage::helper('catalog')->__('CC'),
|
9 |
+
'index' => 'cc_valid',
|
10 |
+
'width' => '50px',
|
11 |
+
'type' => 'text',
|
12 |
+
'filter' => false,
|
13 |
+
'sortable' => false,
|
14 |
+
'renderer' => 'Craftyclicks_Clicktoaddress_Block_Gridlight'
|
15 |
+
));
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Craftyclicks/C2a/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Craftyclicks_C2a_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/community/Craftyclicks/C2a/Model/Address.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Model_Address extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('craftyclicks_c2a/address');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Craftyclicks/C2a/Model/Ambient.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Model_Ambient
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array(
|
9 |
+
'value' => 'light',
|
10 |
+
'label' => 'Light'
|
11 |
+
),
|
12 |
+
array(
|
13 |
+
'value' => 'dark',
|
14 |
+
'label' => 'Dark'
|
15 |
+
)
|
16 |
+
);
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Craftyclicks/C2a/Model/Mode.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Model_Mode
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array(
|
9 |
+
'value' => '2',
|
10 |
+
'label' => 'Surround'
|
11 |
+
),
|
12 |
+
array(
|
13 |
+
'value' => '1',
|
14 |
+
'label' => 'Simple Below'
|
15 |
+
)
|
16 |
+
);
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Craftyclicks/C2a/Model/Resource/Address.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Craftyclicks_C2a_Model_Resource_Address extends Mage_Core_Model_Resource_Db_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('craftyclicks_c2a/address', 'address_id');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Craftyclicks/C2a/Model/Resource/Address/Collection.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Craftyclicks_C2a_Model_Resource_Address_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('craftyclicks_c2a/address');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Craftyclicks/C2a/controllers/HashController.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Craftyclicks_C2a_HashController extends Mage_Core_Controller_Front_Action{
|
3 |
+
public function saveAction(){
|
4 |
+
$inputJSON = file_get_contents('php://input');
|
5 |
+
$input= json_decode( $inputJSON, TRUE );
|
6 |
+
var_dump($input);
|
7 |
+
$model = Mage::getModel('craftyclicks_c2a/address');
|
8 |
+
echo 'banana';
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Craftyclicks/C2a/data/craftyclicks_c2a_setup/data-upgrade-2.4.9-2.5.0.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
$configAccess = new Mage_Core_Model_Config();
|
4 |
+
$oldCfg = Mage::getStoreConfig('general');
|
5 |
+
|
6 |
+
if(isset($oldCfg['craftyclicks'])){
|
7 |
+
//old plugin was set
|
8 |
+
|
9 |
+
// STEP 1: Take cfg over
|
10 |
+
if(!($oldCfg['craftyclicks']['access_token'] == 'xxxxx-xxxxx-xxxxx-xxxxx' && $oldCfg['craftyclicks']['access_token_admin_panel'] == 'xxxxx-xxxxx-xxxxx-xxxxx')){
|
11 |
+
//old plugin didn't had default values.
|
12 |
+
//transfer old config into new one.
|
13 |
+
$values = array("active",
|
14 |
+
"active_admin_panel",
|
15 |
+
"access_token",
|
16 |
+
"access_token_admin_panel",
|
17 |
+
"button_image",
|
18 |
+
"button_class",
|
19 |
+
"hide_fields",
|
20 |
+
"hide_county",
|
21 |
+
"clear_result",
|
22 |
+
"error_class",
|
23 |
+
"max_res_lines",
|
24 |
+
"first_res_line",
|
25 |
+
"error_msg_1",
|
26 |
+
"error_msg_2",
|
27 |
+
"error_msg_3",
|
28 |
+
"error_msg_4",
|
29 |
+
"button_fixposition");
|
30 |
+
$data = array();
|
31 |
+
//check if every old cfg exists. (some older versions might not have all of these options)
|
32 |
+
foreach($values as $val){
|
33 |
+
if(isset($oldCfg['craftyclicks'][$val])){
|
34 |
+
$data[$val] = $oldCfg['craftyclicks'][$val];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
foreach($data as $k=>$v){
|
38 |
+
$configAccess->saveConfig('clicktoaddress/general/'.$k,$v, 'default', 0);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
*/
|
43 |
+
?>
|
app/code/community/Craftyclicks/C2a/etc/config.xml
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Craftyclicks_C2a>
|
5 |
+
<version>0.5.0</version>
|
6 |
+
</Craftyclicks_C2a>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<blocks>
|
11 |
+
<c2a>
|
12 |
+
<class>Craftyclicks_C2a_Block</class>
|
13 |
+
</c2a>
|
14 |
+
<adminhtml>
|
15 |
+
<rewrite>
|
16 |
+
<sales_order_grid>Craftyclicks_C2a_Block_Ordergrid</sales_order_grid>
|
17 |
+
</rewrite>
|
18 |
+
</adminhtml>
|
19 |
+
</blocks>
|
20 |
+
<helpers>
|
21 |
+
<c2a>
|
22 |
+
<class>Craftyclicks_C2a_Helper</class>
|
23 |
+
</c2a>
|
24 |
+
</helpers>
|
25 |
+
<models>
|
26 |
+
<craftyclicks_c2a>
|
27 |
+
<class>Craftyclicks_C2a_Model</class>
|
28 |
+
<resourceModel>craftyclicks_c2a_resource</resourceModel>
|
29 |
+
</craftyclicks_c2a>
|
30 |
+
<craftyclicks_c2a_resource>
|
31 |
+
<class>Craftyclicks_C2a_Model_Resource</class>
|
32 |
+
<entities>
|
33 |
+
<address>
|
34 |
+
<table>craftyclicks_c2a_address</table>
|
35 |
+
</address>
|
36 |
+
</entities>
|
37 |
+
</craftyclicks_c2a_resource>
|
38 |
+
</models>
|
39 |
+
</global>
|
40 |
+
|
41 |
+
<default>
|
42 |
+
<c2a_global>
|
43 |
+
<options>
|
44 |
+
<active>0</active>
|
45 |
+
<access_token>xxxxx-xxxxx-xxxxx-xxxxx</access_token>
|
46 |
+
</options>
|
47 |
+
<design>
|
48 |
+
<dropdown_mode>1</dropdown_mode>
|
49 |
+
<dropdown_ambient>light</dropdown_ambient>
|
50 |
+
<dropdown_accent>default</dropdown_accent>
|
51 |
+
</design>
|
52 |
+
<texts>
|
53 |
+
<search_label>Address Search</search_label>
|
54 |
+
<search_placeholder>Start with post/zip code or street</search_placeholder>
|
55 |
+
<country_placeholder>Type here to search for a country</country_placeholder>
|
56 |
+
<country_button>Change Country</country_button>
|
57 |
+
<error_msg_1>No results found</error_msg_1>
|
58 |
+
<error_msg_2>An error occured. Please enter your address manually</error_msg_2>
|
59 |
+
</texts>
|
60 |
+
</c2a_global>
|
61 |
+
</default>
|
62 |
+
|
63 |
+
<frontend>
|
64 |
+
<layout>
|
65 |
+
<updates>
|
66 |
+
<craftyclicks_c2a>
|
67 |
+
<file>craftyclicks_c2a.xml</file>
|
68 |
+
</craftyclicks_c2a>
|
69 |
+
</updates>
|
70 |
+
</layout>
|
71 |
+
<routers>
|
72 |
+
<c2a_hash>
|
73 |
+
<use>standard</use>
|
74 |
+
<args>
|
75 |
+
<module>Craftyclicks_C2a</module>
|
76 |
+
<frontName>c2a</frontName>
|
77 |
+
</args>
|
78 |
+
</c2a_hash>
|
79 |
+
</routers>
|
80 |
+
</frontend>
|
81 |
+
|
82 |
+
<adminhtml>
|
83 |
+
<layout>
|
84 |
+
<updates>
|
85 |
+
<craftyclicks_c2a>
|
86 |
+
<file>craftyclicks_c2a.xml</file>
|
87 |
+
</craftyclicks_c2a>
|
88 |
+
</updates>
|
89 |
+
</layout>
|
90 |
+
<acl>
|
91 |
+
<resources>
|
92 |
+
<all>
|
93 |
+
<title>Allow Everything</title>
|
94 |
+
</all>
|
95 |
+
<admin>
|
96 |
+
<children>
|
97 |
+
<system>
|
98 |
+
<children>
|
99 |
+
<config>
|
100 |
+
<children>
|
101 |
+
<c2a_global translate="title" module="c2a">
|
102 |
+
<title>Click To Address Global</title>
|
103 |
+
</c2a_global>
|
104 |
+
</children>
|
105 |
+
</config>
|
106 |
+
</children>
|
107 |
+
</system>
|
108 |
+
</children>
|
109 |
+
</admin>
|
110 |
+
</resources>
|
111 |
+
</acl>
|
112 |
+
</adminhtml>
|
113 |
+
|
114 |
+
<global>
|
115 |
+
<resources>
|
116 |
+
<craftyclicks_c2a_setup>
|
117 |
+
<setup>
|
118 |
+
<module>Craftyclicks_C2a</module>
|
119 |
+
</setup>
|
120 |
+
</craftyclicks_c2a_setup>
|
121 |
+
</resources>
|
122 |
+
</global>
|
123 |
+
</config>
|
app/code/community/Craftyclicks/C2a/etc/config.xml~
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Craftyclicks_C2a>
|
5 |
+
<version>0.5.0</version>
|
6 |
+
</Craftyclicks_C2a>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<blocks>
|
11 |
+
<c2a>
|
12 |
+
<class>Craftyclicks_C2a_Block</class>
|
13 |
+
</c2a>
|
14 |
+
<adminhtml>
|
15 |
+
<rewrite>
|
16 |
+
<sales_order_grid>Craftyclicks_C2a_Block_Ordergrid</sales_order_grid>
|
17 |
+
</rewrite>
|
18 |
+
</adminhtml>
|
19 |
+
</blocks>
|
20 |
+
<helpers>
|
21 |
+
<c2a>
|
22 |
+
<class>Craftyclicks_C2a_Helper</class>
|
23 |
+
</c2a>
|
24 |
+
</helpers>
|
25 |
+
<models>
|
26 |
+
<craftyclicks_c2a>
|
27 |
+
<class>Craftyclicks_C2a_Model</class>
|
28 |
+
<resourceModel>craftyclicks_c2a_resource</resourceModel>
|
29 |
+
</craftyclicks_c2a>
|
30 |
+
<craftyclicks_c2a_resource>
|
31 |
+
<class>Craftyclicks_C2a_Model_Resource</class>
|
32 |
+
<entities>
|
33 |
+
<address>
|
34 |
+
<table>craftyclicks_c2a_address</table>
|
35 |
+
</address>
|
36 |
+
</entities>
|
37 |
+
</craftyclicks_c2a_resource>
|
38 |
+
</models>
|
39 |
+
</global>
|
40 |
+
|
41 |
+
<default>
|
42 |
+
<c2a_global>
|
43 |
+
<options>
|
44 |
+
<active>0</active>
|
45 |
+
<access_token>xxxxx-xxxxx-xxxxx-xxxxx</access_token>
|
46 |
+
</options>
|
47 |
+
<design>
|
48 |
+
<dropdown_mode>1</dropdown_mode>
|
49 |
+
<dropdown_ambient>light</dropdown_ambient>
|
50 |
+
<dropdown_accent>default</dropdown_accent>
|
51 |
+
</design>
|
52 |
+
<texts>
|
53 |
+
<search_label>Address Search</search_label>
|
54 |
+
<search_placeholder>Start with post/zip code or street</search_placeholder>
|
55 |
+
<country_placeholder>Type here to search for a country</country_placeholder>
|
56 |
+
<country_button>Change Country</country_button>
|
57 |
+
<error_msg_1>No results found</error_msg_1>
|
58 |
+
<error_msg_2>An error occured. Please enter your address manually</error_msg_2>
|
59 |
+
</texts>
|
60 |
+
</c2a_global>
|
61 |
+
</default>
|
62 |
+
|
63 |
+
<frontend>
|
64 |
+
<layout>
|
65 |
+
<updates>
|
66 |
+
<craftyclicks_c2a>
|
67 |
+
<file>craftyclicks_c2a.xml</file>
|
68 |
+
</craftyclicks_c2a>
|
69 |
+
</updates>
|
70 |
+
</layout>
|
71 |
+
<routers>
|
72 |
+
<c2a_hash>
|
73 |
+
<use>standard</use>
|
74 |
+
<args>
|
75 |
+
<module>Craftyclicks_C2a</module>
|
76 |
+
<frontName>c2a</frontName>
|
77 |
+
</args>
|
78 |
+
</c2a_hash>
|
79 |
+
</routers>
|
80 |
+
</frontend>
|
81 |
+
|
82 |
+
<adminhtml>
|
83 |
+
<layout>
|
84 |
+
<updates>
|
85 |
+
<craftyclicks_c2a>
|
86 |
+
<file>craftyclicks_c2a.xml</file>
|
87 |
+
</craftyclicks_c2a>
|
88 |
+
</updates>
|
89 |
+
</layout>
|
90 |
+
<acl>
|
91 |
+
<resources>
|
92 |
+
<all>
|
93 |
+
<title>Allow Everything</title>
|
94 |
+
</all>
|
95 |
+
<admin>
|
96 |
+
<children>
|
97 |
+
<system>
|
98 |
+
<children>
|
99 |
+
<config>
|
100 |
+
<children>
|
101 |
+
<c2a_global translate="title" module="c2a">
|
102 |
+
<title>Click To Address Global</title>
|
103 |
+
</c2a_global>
|
104 |
+
</children>
|
105 |
+
</config>
|
106 |
+
</children>
|
107 |
+
</system>
|
108 |
+
</children>
|
109 |
+
</admin>
|
110 |
+
</resources>
|
111 |
+
</acl>
|
112 |
+
</adminhtml>
|
113 |
+
|
114 |
+
<global>
|
115 |
+
<resources>
|
116 |
+
<craftyclicks_c2a_setup>
|
117 |
+
<setup>
|
118 |
+
<module>Craftyclicks_C2a</module>
|
119 |
+
</setup>
|
120 |
+
</craftyclicks_c2a_setup>
|
121 |
+
</resources>
|
122 |
+
</global>
|
123 |
+
</config>
|
app/code/community/Craftyclicks/C2a/etc/system.xml
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<craftyclicks translate="label">
|
5 |
+
<label><![CDATA[<img style="margin: 4px 4px 4px 0px;" src="https://craftyclicks.co.uk/assets/magento/crafty-logo.png" alt="Crafty Clicks" border="0" />]]></label>
|
6 |
+
<sort_order>101</sort_order>
|
7 |
+
</craftyclicks>
|
8 |
+
</tabs>
|
9 |
+
|
10 |
+
<sections>
|
11 |
+
<c2a_global translate="label" module="c2a">
|
12 |
+
<label>Global Address Auto-complete</label>
|
13 |
+
<tab>craftyclicks</tab>
|
14 |
+
<sort_order>99</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<options translate="label" module="c2a">
|
20 |
+
<label>Main Settings</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>100</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<active translate="label">
|
28 |
+
<label>Enabled</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
</active>
|
36 |
+
<access_token translate="label">
|
37 |
+
<label>Access Token</label>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>20</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
</access_token>
|
44 |
+
</fields>
|
45 |
+
</options>
|
46 |
+
<design>
|
47 |
+
<label>Design</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>200</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<fields>
|
54 |
+
<dropdown_mode translate="label">
|
55 |
+
<label>Mode</label>
|
56 |
+
<frontend_type>select</frontend_type>
|
57 |
+
<source_model>craftyclicks_c2a/mode</source_model>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
</dropdown_mode>
|
63 |
+
<dropdown_ambient translate="label">
|
64 |
+
<label>Ambient</label>
|
65 |
+
<frontend_type>select</frontend_type>
|
66 |
+
<source_model>craftyclicks_c2a/ambient</source_model>
|
67 |
+
<sort_order>10</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>1</show_in_website>
|
70 |
+
<show_in_store>1</show_in_store>
|
71 |
+
</dropdown_ambient>
|
72 |
+
<dropdown_accent translate="label">
|
73 |
+
<label>Accent</label>
|
74 |
+
<frontend_type>text</frontend_type>
|
75 |
+
<validate>color</validate>
|
76 |
+
<sort_order>30</sort_order>
|
77 |
+
<show_in_default>1</show_in_default>
|
78 |
+
<show_in_website>1</show_in_website>
|
79 |
+
<show_in_store>1</show_in_store>
|
80 |
+
</dropdown_accent>
|
81 |
+
</fields>
|
82 |
+
</design>
|
83 |
+
<texts>
|
84 |
+
<label>Texts</label>
|
85 |
+
<frontend_type>text</frontend_type>
|
86 |
+
<sort_order>800</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>1</show_in_store>
|
90 |
+
<fields>
|
91 |
+
<search_label translate="label">
|
92 |
+
<label>Search Label</label>
|
93 |
+
<frontend_type>text</frontend_type>
|
94 |
+
<sort_order>10</sort_order>
|
95 |
+
<show_in_default>1</show_in_default>
|
96 |
+
<show_in_website>1</show_in_website>
|
97 |
+
<show_in_store>1</show_in_store>
|
98 |
+
</search_label>
|
99 |
+
<search_placeholder translate="label">
|
100 |
+
<label>Search Placeholder</label>
|
101 |
+
<frontend_type>text</frontend_type>
|
102 |
+
<sort_order>20</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
</search_placeholder>
|
107 |
+
<country_placeholder translate="label">
|
108 |
+
<label>Placeholder for Country Selection</label>
|
109 |
+
<frontend_type>text</frontend_type>
|
110 |
+
<sort_order>30</sort_order>
|
111 |
+
<show_in_default>1</show_in_default>
|
112 |
+
<show_in_website>1</show_in_website>
|
113 |
+
<show_in_store>1</show_in_store>
|
114 |
+
</country_placeholder>
|
115 |
+
<country_button translate="label">
|
116 |
+
<label>Change Country button text</label>
|
117 |
+
<frontend_type>text</frontend_type>
|
118 |
+
<sort_order>40</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>1</show_in_store>
|
122 |
+
</country_button>
|
123 |
+
<error_msg_1 translate="label">
|
124 |
+
<label>No Results Message</label>
|
125 |
+
<frontend_type>text</frontend_type>
|
126 |
+
<sort_order>50</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>1</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
</error_msg_1>
|
131 |
+
<error_msg_2 translate="label">
|
132 |
+
<label>Generic Error Message</label>
|
133 |
+
<frontend_type>text</frontend_type>
|
134 |
+
<sort_order>60</sort_order>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>1</show_in_website>
|
137 |
+
<show_in_store>1</show_in_store>
|
138 |
+
</error_msg_2>
|
139 |
+
</fields>
|
140 |
+
</texts>
|
141 |
+
</groups>
|
142 |
+
</c2a_global>
|
143 |
+
</sections>
|
144 |
+
|
145 |
+
</config>
|
app/code/community/Craftyclicks/C2a/etc/system.xml~
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<craftyclicks translate="label">
|
5 |
+
<label><![CDATA[<img style="margin: 4px 4px 4px 0px;" src="https://craftyclicks.co.uk/assets/magento/crafty-logo.png" alt="Crafty Clicks" border="0" />]]></label>
|
6 |
+
<sort_order>101</sort_order>
|
7 |
+
</craftyclicks>
|
8 |
+
</tabs>
|
9 |
+
|
10 |
+
<sections>
|
11 |
+
<c2a_global translate="label" module="c2a">
|
12 |
+
<label>Global Address Auto-complete</label>
|
13 |
+
<tab>craftyclicks</tab>
|
14 |
+
<sort_order>99</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<options translate="label" module="c2a">
|
20 |
+
<label>Main Settings</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>100</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<active translate="label">
|
28 |
+
<label>Enabled - Frontend</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
</active>
|
36 |
+
<access_token translate="label">
|
37 |
+
<label>Access Token</label>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>20</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
</access_token>
|
44 |
+
</fields>
|
45 |
+
</options>
|
46 |
+
<design>
|
47 |
+
<label>Design</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>200</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<fields>
|
54 |
+
<dropdown_mode translate="label">
|
55 |
+
<label>Mode</label>
|
56 |
+
<frontend_type>select</frontend_type>
|
57 |
+
<source_model>craftyclicks_c2a/mode</source_model>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
</dropdown_mode>
|
63 |
+
<dropdown_ambient translate="label">
|
64 |
+
<label>Ambient</label>
|
65 |
+
<frontend_type>select</frontend_type>
|
66 |
+
<source_model>craftyclicks_c2a/ambient</source_model>
|
67 |
+
<sort_order>10</sort_order>
|
68 |
+
<show_in_default>1</show_in_default>
|
69 |
+
<show_in_website>1</show_in_website>
|
70 |
+
<show_in_store>1</show_in_store>
|
71 |
+
</dropdown_ambient>
|
72 |
+
<dropdown_accent translate="label">
|
73 |
+
<label>Accent</label>
|
74 |
+
<frontend_type>text</frontend_type>
|
75 |
+
<validate>color</validate>
|
76 |
+
<sort_order>30</sort_order>
|
77 |
+
<show_in_default>1</show_in_default>
|
78 |
+
<show_in_website>1</show_in_website>
|
79 |
+
<show_in_store>1</show_in_store>
|
80 |
+
</dropdown_accent>
|
81 |
+
</fields>
|
82 |
+
</design>
|
83 |
+
<texts>
|
84 |
+
<label>Texts</label>
|
85 |
+
<frontend_type>text</frontend_type>
|
86 |
+
<sort_order>800</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>1</show_in_store>
|
90 |
+
<fields>
|
91 |
+
<search_label translate="label">
|
92 |
+
<label>Search Label</label>
|
93 |
+
<frontend_type>text</frontend_type>
|
94 |
+
<sort_order>10</sort_order>
|
95 |
+
<show_in_default>1</show_in_default>
|
96 |
+
<show_in_website>1</show_in_website>
|
97 |
+
<show_in_store>1</show_in_store>
|
98 |
+
</search_label>
|
99 |
+
<search_placeholder translate="label">
|
100 |
+
<label>Search Placeholder</label>
|
101 |
+
<frontend_type>text</frontend_type>
|
102 |
+
<sort_order>20</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
</search_placeholder>
|
107 |
+
<country_placeholder translate="label">
|
108 |
+
<label>Placeholder for Country Selection</label>
|
109 |
+
<frontend_type>text</frontend_type>
|
110 |
+
<sort_order>30</sort_order>
|
111 |
+
<show_in_default>1</show_in_default>
|
112 |
+
<show_in_website>1</show_in_website>
|
113 |
+
<show_in_store>1</show_in_store>
|
114 |
+
</country_placeholder>
|
115 |
+
<country_button translate="label">
|
116 |
+
<label>Change Country button text</label>
|
117 |
+
<frontend_type>text</frontend_type>
|
118 |
+
<sort_order>40</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>1</show_in_store>
|
122 |
+
</country_button>
|
123 |
+
<error_msg_1 translate="label">
|
124 |
+
<label>No Results Message</label>
|
125 |
+
<frontend_type>text</frontend_type>
|
126 |
+
<sort_order>50</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>1</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
</error_msg_1>
|
131 |
+
<error_msg_2 translate="label">
|
132 |
+
<label>Generic Error Message</label>
|
133 |
+
<frontend_type>text</frontend_type>
|
134 |
+
<sort_order>60</sort_order>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>1</show_in_website>
|
137 |
+
<show_in_store>1</show_in_store>
|
138 |
+
</error_msg_2>
|
139 |
+
</fields>
|
140 |
+
</texts>
|
141 |
+
</groups>
|
142 |
+
</c2a_global>
|
143 |
+
</sections>
|
144 |
+
|
145 |
+
</config>
|
app/code/community/Craftyclicks/C2a/sql/craftyclicks_c2a_setup/install-0.5.0.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$table = $installer->getConnection()
|
8 |
+
->newTable($installer->getTable('craftyclicks_c2a/address'))
|
9 |
+
->addColumn('address_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
10 |
+
'identity' => true,
|
11 |
+
'unsigned' => true,
|
12 |
+
'nullable' => false,
|
13 |
+
'primary' => true,
|
14 |
+
), 'Id')
|
15 |
+
->addColumn('hash', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
16 |
+
'nullable' => false,
|
17 |
+
), 'Hash');
|
18 |
+
$installer->getConnection()->createTable($table);
|
19 |
+
|
20 |
+
$installer->endSetup();
|
app/code/community/Craftyclicks/C2a/sql/craftyclicks_clicktoaddress_setup/install-1.0.0.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$table = $installer->getConnection()
|
8 |
+
->newTable($installer->getTable('inchoo_dbscript/ticket'))
|
9 |
+
->addColumn('ticket_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
10 |
+
'identity' => true,
|
11 |
+
'unsigned' => true,
|
12 |
+
'nullable' => false,
|
13 |
+
'primary' => true,
|
14 |
+
), 'Id')
|
15 |
+
->addColumn('title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
16 |
+
'nullable' => false,
|
17 |
+
), 'Title')
|
18 |
+
->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
|
19 |
+
'nullable' => false,
|
20 |
+
), 'Description');
|
21 |
+
$installer->getConnection()->createTable($table);
|
22 |
+
|
23 |
+
$table = $installer->getConnection()
|
24 |
+
->newTable($installer->getTable('inchoo_dbscript/comment'))
|
25 |
+
->addColumn('comment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
26 |
+
'identity' => true,
|
27 |
+
'unsigned' => true,
|
28 |
+
'nullable' => false,
|
29 |
+
'primary' => true,
|
30 |
+
), 'Id')
|
31 |
+
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
32 |
+
'nullable' => false,
|
33 |
+
), 'Comment');
|
34 |
+
$installer->getConnection()->createTable($table);
|
35 |
+
|
36 |
+
$installer->endSetup();
|
37 |
+
*/
|
app/design/adminhtml/default/default/layout/craftyclicks_c2a.xml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Crafty Clicks Postcode Lookup
|
5 |
+
*
|
6 |
+
* @category Extension
|
7 |
+
* @copyright Copyright (c) 2009-2017 Crafty Clicks (https://www.craftyclicks.co.uk)
|
8 |
+
* @author Crafty Clicks
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
|
12 |
+
<layout>
|
13 |
+
<adminhtml_sales_order_create_load_block_data>
|
14 |
+
<reference name="head">
|
15 |
+
<block type="c2a/integration" name="integration">
|
16 |
+
<action method="addJS">
|
17 |
+
<parameter>admin</parameter>
|
18 |
+
</action>
|
19 |
+
<action method="addConfig"/>
|
20 |
+
</block>
|
21 |
+
</reference>
|
22 |
+
</adminhtml_sales_order_create_load_block_data>
|
23 |
+
|
24 |
+
<adminhtml_customer_edit>
|
25 |
+
<reference name="head">
|
26 |
+
<block type="c2a/integration" name="integration">
|
27 |
+
<action method="addJS">
|
28 |
+
<parameter>admin</parameter>
|
29 |
+
</action>
|
30 |
+
<action method="addConfig"/>
|
31 |
+
</block>
|
32 |
+
</reference>
|
33 |
+
</adminhtml_customer_edit>
|
34 |
+
|
35 |
+
<adminhtml_customer_new>
|
36 |
+
<reference name="head">
|
37 |
+
<block type="c2a/integration" name="integration">
|
38 |
+
<action method="addJS">
|
39 |
+
<parameter>admin</parameter>
|
40 |
+
</action>
|
41 |
+
<action method="addConfig"/>
|
42 |
+
</block>
|
43 |
+
</reference>
|
44 |
+
</adminhtml_customer_new>
|
45 |
+
|
46 |
+
<adminhtml_sales_order_address>
|
47 |
+
<reference name="head">
|
48 |
+
<block type="c2a/integration" name="integration">
|
49 |
+
<action method="addJS">
|
50 |
+
<parameter>admin</parameter>
|
51 |
+
</action>
|
52 |
+
<action method="addConfig"/>
|
53 |
+
</block>
|
54 |
+
</reference>
|
55 |
+
</adminhtml_sales_order_address>
|
56 |
+
|
57 |
+
<adminhtml_system_config_edit>
|
58 |
+
<reference name="head">
|
59 |
+
<action method="addJs">
|
60 |
+
<script>craftyclicks/c2a/admin/enhance.js</script>
|
61 |
+
</action>
|
62 |
+
<action method="addCss">
|
63 |
+
<stylesheet>css/craftyclicks/c2a/enhance.css</stylesheet>
|
64 |
+
</action>
|
65 |
+
</reference>
|
66 |
+
</adminhtml_system_config_edit>
|
67 |
+
</layout>
|
app/design/adminhtml/default/default/template/craftyclicks/c2a/c2a_config.phtml
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$conf = Mage::getStoreConfig('c2a_global/options');
|
3 |
+
|
4 |
+
$js_config = "";
|
5 |
+
|
6 |
+
if (1 == $conf['active']) {
|
7 |
+
$design = Mage::getStoreConfig('c2a_global/design');
|
8 |
+
$texts = Mage::getStoreConfig('c2a_global/texts');
|
9 |
+
$advanced = Mage::getStoreConfig('c2a_global/advanced');
|
10 |
+
|
11 |
+
$output = (object) array(
|
12 |
+
'active' => $conf['active'],
|
13 |
+
'access_token' => $conf['access_token'],
|
14 |
+
'design' => (object) array(
|
15 |
+
'mode' => $design['dropdown_mode'],
|
16 |
+
'ambient' => $design['dropdown_ambient'],
|
17 |
+
'accent' => $design['dropdown_accent']
|
18 |
+
),
|
19 |
+
'advanced' => (object) array(
|
20 |
+
'uk_internal_access_token' => $advanced['uk_internal_access_token']
|
21 |
+
)
|
22 |
+
);
|
23 |
+
|
24 |
+
/* ---------------------------------------------------------------------------
|
25 |
+
This is a workaround for Amestys lack of hookable layout tag.
|
26 |
+
--------------------------------------------------------------------------- */
|
27 |
+
/*
|
28 |
+
$ams = Mage::getStoreConfig('amscheckout');
|
29 |
+
if (isset($ams)){
|
30 |
+
$js_config .= " var _cp_integrate = false;";
|
31 |
+
$js_config .= " var _cp_integrate_amesty = true;";
|
32 |
+
echo '<script src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'craftyclicks/clicktoaddress/craftyclicks_amesty_onepagecheckout.js"></script>';
|
33 |
+
}
|
34 |
+
else{
|
35 |
+
$js_config .= " var _cp_integrate = true;";
|
36 |
+
}
|
37 |
+
$js_config.= " var _cp_enable_for_uk_only = true;"; // if true, the button will show up only for UK
|
38 |
+
if (array_key_exists('button_image',$conf) && '' != $conf['button_image']) {
|
39 |
+
$js_config.= " var _cp_button_image = '".$this->getSkinUrl('images/craftyclicks/'.$conf['button_image'])."';";
|
40 |
+
} else {
|
41 |
+
$js_config.= " var _cp_button_image = '';";
|
42 |
+
}
|
43 |
+
$js_config.= " var _cp_button_text = 'Find Address';";
|
44 |
+
$js_config.= " var _cp_button_class = '".$conf['button_class']."';";
|
45 |
+
$js_config.= " var _cp_result_box_height = '".$conf['max_res_lines']."';"; // number of lines to show in result box, must be 1 or more
|
46 |
+
$js_config.= " var _cp_result_box_width = '';"; // width of the result box
|
47 |
+
$js_config.= " var _cp_busy_img_url = '".$this->getSkinUrl('images/craftyclicks/clicktoaddress/'."crafty_postcode_busy.gif")."';"; // the url of the image to show while waiting for lookup results, e.g. a spinning wheel etc.
|
48 |
+
|
49 |
+
if (array_key_exists('clear_result',$conf) && $conf['clear_result']) {
|
50 |
+
$js_config.= " var _cp_clear_result = true;";
|
51 |
+
} else {
|
52 |
+
$js_config.= " var _cp_clear_result = false;";
|
53 |
+
}
|
54 |
+
|
55 |
+
$js_config.= " var _cp_hide_result = true;"; // once users make the selection, hide the result box - true/false
|
56 |
+
$js_config.= " var _cp_1st_res_line = '".htmlspecialchars($conf['first_res_line'])."';";
|
57 |
+
$js_config.= " var _cp_err_msg1 = '".htmlspecialchars($conf['error_msg_1'])."';";
|
58 |
+
$js_config.= " var _cp_err_msg2 = '".htmlspecialchars($conf['error_msg_2'])."';";
|
59 |
+
$js_config.= " var _cp_err_msg3 = '".htmlspecialchars($conf['error_msg_3'])."';";
|
60 |
+
$js_config.= " var _cp_err_msg4 = '".htmlspecialchars($conf['error_msg_4'])."';";
|
61 |
+
$js_config.= " var _cp_token_fe = '".$conf['access_token']."';";
|
62 |
+
|
63 |
+
if (array_key_exists('hide_fields',$conf) && $conf['hide_fields']) {
|
64 |
+
$js_config.= " var _cp_hide_fields = true;";
|
65 |
+
} else {
|
66 |
+
$js_config.= " var _cp_hide_fields = false;";
|
67 |
+
}
|
68 |
+
|
69 |
+
if (array_key_exists('hide_county',$conf) && $conf['hide_county']) {
|
70 |
+
$js_config.= " var _cp_hide_county = true;";
|
71 |
+
} else {
|
72 |
+
$js_config.= " var _cp_hide_county = false;";
|
73 |
+
}
|
74 |
+
|
75 |
+
if (array_key_exists('error_class',$conf) && '' != $conf['error_class']) {
|
76 |
+
$js_config.= " var _cp_error_class = '".$conf['error_class']."';";
|
77 |
+
} else {
|
78 |
+
$js_config.= " var _cp_error_class = '';";
|
79 |
+
}
|
80 |
+
|
81 |
+
if (array_key_exists('move_fields',$conf) && $conf['move_fields']) {
|
82 |
+
$js_config.= " var _cp_move_fields = true;";
|
83 |
+
} else {
|
84 |
+
$js_config.= " var _cp_move_fields = false;";
|
85 |
+
}
|
86 |
+
if (array_key_exists('button_fixposition',$conf) && 1 == $conf['button_fixposition']) {
|
87 |
+
$js_config.= " var _cp_button_fixposition = true;";
|
88 |
+
} else {
|
89 |
+
$js_config.= " var _cp_button_fixposition = false;";
|
90 |
+
}
|
91 |
+
*/
|
92 |
+
|
93 |
+
} else { //if (1 == $conf['active']) {
|
94 |
+
$output = (object) array(
|
95 |
+
'active' => false
|
96 |
+
);
|
97 |
+
}
|
98 |
+
?>
|
99 |
+
|
100 |
+
<script type="text/javascript">
|
101 |
+
//<![CDATA[
|
102 |
+
var c2a_config = <?php echo json_encode($output); ?>
|
103 |
+
//]]>
|
104 |
+
</script>
|
app/design/frontend/base/default/layout/craftyclicks_c2a.xml
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Crafty Clicks Postcode Lookup
|
5 |
+
*
|
6 |
+
* @category Extension
|
7 |
+
* @copyright Copyright (c) 2009-2016 Crafty Clicks (https://www.craftyclicks.co.uk)
|
8 |
+
* @author Crafty Clicks
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
|
12 |
+
<layout>
|
13 |
+
|
14 |
+
<!-- standard magento pages -->
|
15 |
+
|
16 |
+
<checkout_onepage_index>
|
17 |
+
<reference name="head">
|
18 |
+
<block type="c2a/integration" name="integration">
|
19 |
+
<action method="addJS">
|
20 |
+
<parameter>default</parameter>
|
21 |
+
</action>
|
22 |
+
<action method="addConfig"/>
|
23 |
+
</block>
|
24 |
+
</reference>
|
25 |
+
</checkout_onepage_index>
|
26 |
+
|
27 |
+
<checkout_multishipping_customer_address>
|
28 |
+
<reference name="head">
|
29 |
+
<block type="c2a/integration" name="integration">
|
30 |
+
<action method="addJS">
|
31 |
+
<parameter>default</parameter>
|
32 |
+
</action>
|
33 |
+
<action method="addConfig"/>
|
34 |
+
</block>
|
35 |
+
</reference>
|
36 |
+
</checkout_multishipping_customer_address>
|
37 |
+
|
38 |
+
<checkout_multishipping_register>
|
39 |
+
<reference name="head">
|
40 |
+
<block type="c2a/integration" name="integration">
|
41 |
+
<action method="addJS">
|
42 |
+
<parameter>default</parameter>
|
43 |
+
</action>
|
44 |
+
<action method="addConfig"/>
|
45 |
+
</block>
|
46 |
+
</reference>
|
47 |
+
</checkout_multishipping_register>
|
48 |
+
|
49 |
+
<customer_address_form>
|
50 |
+
<reference name="head">
|
51 |
+
<block type="c2a/integration" name="integration">
|
52 |
+
<action method="addJS">
|
53 |
+
<parameter>default</parameter>
|
54 |
+
</action>
|
55 |
+
<action method="addConfig"/>
|
56 |
+
</block>
|
57 |
+
</reference>
|
58 |
+
</customer_address_form>
|
59 |
+
|
60 |
+
<customer_account_create>
|
61 |
+
<reference name="head">
|
62 |
+
<block type="c2a/integration" name="integration">
|
63 |
+
<action method="addJS">
|
64 |
+
<parameter>default</parameter>
|
65 |
+
</action>
|
66 |
+
<action method="addConfig"/>
|
67 |
+
</block>
|
68 |
+
</reference>
|
69 |
+
</customer_account_create>
|
70 |
+
</layout>
|
app/design/frontend/base/default/template/craftyclicks/c2a/c2a_config.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$conf = Mage::getStoreConfig('c2a_global/options');
|
4 |
+
|
5 |
+
$js_config = "";
|
6 |
+
|
7 |
+
if (1 == $conf['active']) {
|
8 |
+
|
9 |
+
$design = Mage::getStoreConfig('c2a_global/design');
|
10 |
+
$texts = Mage::getStoreConfig('c2a_global/texts');
|
11 |
+
$advanced = Mage::getStoreConfig('c2a_global/advanced');
|
12 |
+
|
13 |
+
$output = (object) array(
|
14 |
+
'active' => $conf['active'],
|
15 |
+
'access_token' => $conf['access_token'],
|
16 |
+
'design' => (object) array(
|
17 |
+
'mode' => $design['dropdown_mode'],
|
18 |
+
'ambient' => $design['dropdown_ambient'],
|
19 |
+
'accent' => $design['dropdown_accent']
|
20 |
+
),
|
21 |
+
'cc_hash_url' => Mage::getUrl('c2a/hash/save',array('_secure'=>true))
|
22 |
+
);
|
23 |
+
|
24 |
+
} else { //if (1 == $conf['active']) {
|
25 |
+
$output = (object) array(
|
26 |
+
'active' => false
|
27 |
+
);
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
|
31 |
+
<script type="text/javascript">
|
32 |
+
//<![CDATA[
|
33 |
+
var c2a_config = <?php echo json_encode($output); ?>
|
34 |
+
//]]>
|
35 |
+
</script>
|
app/etc/modules/Craftyclicks_C2a.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Craftyclicks_C2a>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
</Craftyclicks_C2a>
|
9 |
+
</modules>
|
10 |
+
</config>
|
js/craftyclicks/c2a/admin.js
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
// This is a collection of JavaScript code to allow easy integration of
|
3 |
+
// the Crafty Clicks Click2Address functionality into Magento
|
4 |
+
//
|
5 |
+
// This file works for the standard magento checkout (both community and enterprise)
|
6 |
+
//
|
7 |
+
// Provided by www.CraftyClicks.co.uk
|
8 |
+
//
|
9 |
+
// Requires the new fancy Crafty Clicks Global JS library - Tested with 0.1
|
10 |
+
//
|
11 |
+
// If you copy/use/modify this code - please keep this
|
12 |
+
// comment header in place
|
13 |
+
//
|
14 |
+
// Copyright (c) 2009-2016 Crafty Clicks (http://www.craftyclicks.com)
|
15 |
+
//
|
16 |
+
// This code relies on prototype js, you must have a reasonably recent version loaded
|
17 |
+
// in your template. Magento should include it as standard.
|
18 |
+
//
|
19 |
+
// If you need any help, contact support@craftyclicks.co.uk - we will help!
|
20 |
+
//
|
21 |
+
**********************************************************************************/
|
22 |
+
var cc_search = null;
|
23 |
+
function cc_magento(magentoCfg){
|
24 |
+
var li_class = 'wide';
|
25 |
+
|
26 |
+
if (!$(magentoCfg.prefix+'_cc_search_input')) {
|
27 |
+
var tmp_html = '<tr><td class="label">Address Search</td><td class="value">'+
|
28 |
+
'<input id="'+magentoCfg.prefix+'_cc_search_input" class="input-text" type="text"/></td></tr>';
|
29 |
+
magentoCfg.fields.street1_obj.up('tr').insert( {before: tmp_html} );
|
30 |
+
}
|
31 |
+
cc_search.attach({
|
32 |
+
search: $(magentoCfg.prefix+'_cc_search_input'),
|
33 |
+
line_1: magentoCfg.fields.street1_obj,
|
34 |
+
line_2: magentoCfg.fields.street2_obj,
|
35 |
+
town: magentoCfg.fields.town_obj,
|
36 |
+
company: magentoCfg.fields.company_obj,
|
37 |
+
postcode: magentoCfg.fields.postcode_obj,
|
38 |
+
county: magentoCfg.fields.county_obj,
|
39 |
+
country: magentoCfg.fields.country_obj
|
40 |
+
});
|
41 |
+
}
|
42 |
+
|
43 |
+
document.observe('dom:loaded', function() {
|
44 |
+
|
45 |
+
if (typeof c2a_config == 'undefined' || !c2a_config.active) return;
|
46 |
+
|
47 |
+
var config = {
|
48 |
+
accessToken: c2a_config.access_token,
|
49 |
+
domMode: 'object',
|
50 |
+
geocode: false,
|
51 |
+
gfxMode: c2a_config.design.mode,
|
52 |
+
defaultCountry: 'usa',
|
53 |
+
style: {
|
54 |
+
ambient: c2a_config.design.ambient,
|
55 |
+
accent: c2a_config.design.accent
|
56 |
+
},
|
57 |
+
showLogo: false,
|
58 |
+
texts: {
|
59 |
+
default_placeholder: 'Typo here where you wanna go'
|
60 |
+
},
|
61 |
+
cssPath: false
|
62 |
+
/*
|
63 |
+
onResultSelected: function(address){
|
64 |
+
console.log(address);
|
65 |
+
var address_data = {
|
66 |
+
line_1: address.line_1,
|
67 |
+
line_2: address.line_2,
|
68 |
+
town: address.locality,
|
69 |
+
postal_code: address.postal_code
|
70 |
+
};
|
71 |
+
new Ajax.Request(c2a_config.cc_hash_url,{
|
72 |
+
method: "post",
|
73 |
+
postBody: JSON.stringify(address_data),
|
74 |
+
onSuccess: function(transport){
|
75 |
+
console.log(transport);
|
76 |
+
var response = transport.responseText || "no response text";
|
77 |
+
alert("Success! \n\n" + response);
|
78 |
+
},
|
79 |
+
onFailure: function(){ alert('Something went wrong...') }
|
80 |
+
});
|
81 |
+
}*/
|
82 |
+
};
|
83 |
+
cc_search = new clickToAddress(config);
|
84 |
+
|
85 |
+
if ($('address_list')) {
|
86 |
+
// looks like we are on the customer edit page, check and attach to all existing address forms (there could be many!)
|
87 |
+
var add_list = $$("#address_list > li");
|
88 |
+
|
89 |
+
if (add_list && 0 < add_list.length) {
|
90 |
+
var max_id = 0;
|
91 |
+
for (var ii = 0; ii < add_list.length; ii++) {
|
92 |
+
var item = add_list[ii];
|
93 |
+
var item_id = '';
|
94 |
+
var item_html_id = '';
|
95 |
+
if ('address_item_' == item.id.substr(0,13)) {
|
96 |
+
item_id = item.id.substr(13);
|
97 |
+
} else if ('new_item' == item.id.substr(0,8)) {
|
98 |
+
item_id = item.id.substr(8);
|
99 |
+
}
|
100 |
+
// old magento templates can have "idX", new ones have "_itemX", se we test for this here
|
101 |
+
if ($('id'+item_id+'postcode')) {
|
102 |
+
item_html_id = 'id'+item_id;
|
103 |
+
} if ($('_item'+item_id+'postcode')) {
|
104 |
+
item_html_id = '_item'+item_id;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ('' != item_html_id) {
|
108 |
+
var cc_tmp = cc_magento({
|
109 |
+
prefix : item_html_id,
|
110 |
+
fields : {
|
111 |
+
postcode_obj: $(item_html_id+"postcode"),
|
112 |
+
company_obj : $(item_html_id+"company"),
|
113 |
+
street1_obj : $(item_html_id+"street0"),
|
114 |
+
street2_obj : $(item_html_id+"street1"),
|
115 |
+
street3_obj : $(item_html_id+"street2"),
|
116 |
+
street4_obj : $(item_html_id+"street3"),
|
117 |
+
town_obj : $(item_html_id+"city"),
|
118 |
+
county_obj : $(item_html_id+"region"),
|
119 |
+
country_obj : $(item_html_id+"country_id")
|
120 |
+
}
|
121 |
+
});
|
122 |
+
}
|
123 |
+
|
124 |
+
if (item_id > max_id) max_id = item_id;
|
125 |
+
}
|
126 |
+
|
127 |
+
// check for magento bug in address numbering
|
128 |
+
if (customerAddresses.itemCount <= max_id) customerAddresses.itemCount = max_id;
|
129 |
+
}
|
130 |
+
|
131 |
+
// make sure lookup is added when a new adress form is created....
|
132 |
+
$('add_address_button').observe('click', function() {
|
133 |
+
var item_html_id = '_item'+(customerAddresses.itemCount);
|
134 |
+
cc_magento({
|
135 |
+
prefix : item_html_id,
|
136 |
+
fields : {
|
137 |
+
postcode_obj: $(item_html_id+"postcode"),
|
138 |
+
company_obj : $(item_html_id+"company"),
|
139 |
+
street1_obj : $(item_html_id+"street0"),
|
140 |
+
street2_obj : $(item_html_id+"street1"),
|
141 |
+
street3_obj : $(item_html_id+"street2"),
|
142 |
+
street4_obj : $(item_html_id+"street3"),
|
143 |
+
town_obj : $(item_html_id+"city"),
|
144 |
+
county_obj : $(item_html_id+"region"),
|
145 |
+
country_obj : $(item_html_id+"country_id")
|
146 |
+
}
|
147 |
+
});
|
148 |
+
});
|
149 |
+
} else {
|
150 |
+
// probably on the new order page, check and attach
|
151 |
+
_cp_check_and_attach();
|
152 |
+
}
|
153 |
+
});
|
154 |
+
|
155 |
+
var _cp_last_billing_attachement = null;
|
156 |
+
var _cp_last_shipping_attachement = null;
|
157 |
+
var _cp_last_edit_attachement = null;
|
158 |
+
function _cp_check_and_attach() {
|
159 |
+
if ($('order-billing_address_postcode') && _cp_last_billing_attachement != $('order-billing_address_postcode')) {
|
160 |
+
_cp_last_billing_attachement = $('order-billing_address_postcode');
|
161 |
+
var item_html_id = 'order-billing_address_';
|
162 |
+
cc_magento({
|
163 |
+
prefix : item_html_id,
|
164 |
+
fields : {
|
165 |
+
postcode_obj: $(item_html_id+"postcode"),
|
166 |
+
company_obj : $(item_html_id+"company"),
|
167 |
+
street1_obj : $(item_html_id+"street0"),
|
168 |
+
street2_obj : $(item_html_id+"street1"),
|
169 |
+
street3_obj : $(item_html_id+"street2"),
|
170 |
+
street4_obj : $(item_html_id+"street3"),
|
171 |
+
town_obj : $(item_html_id+"city"),
|
172 |
+
county_obj : $(item_html_id+"region"),
|
173 |
+
country_obj : $(item_html_id+"country_id")
|
174 |
+
}
|
175 |
+
});
|
176 |
+
}
|
177 |
+
|
178 |
+
if ($('order-shipping_address_postcode') && !$('order-shipping_address_postcode').disabled && _cp_last_shipping_attachement != $('order-shipping_address_postcode')) {
|
179 |
+
_cp_last_shipping_attachement = $('order-shipping_address_postcode');
|
180 |
+
var item_html_id = 'order-shipping_address_';
|
181 |
+
cc_magento({
|
182 |
+
prefix : item_html_id,
|
183 |
+
fields : {
|
184 |
+
postcode_obj: $(item_html_id+"postcode"),
|
185 |
+
company_obj : $(item_html_id+"company"),
|
186 |
+
street1_obj : $(item_html_id+"street0"),
|
187 |
+
street2_obj : $(item_html_id+"street1"),
|
188 |
+
street3_obj : $(item_html_id+"street2"),
|
189 |
+
street4_obj : $(item_html_id+"street3"),
|
190 |
+
town_obj : $(item_html_id+"city"),
|
191 |
+
county_obj : $(item_html_id+"region"),
|
192 |
+
country_obj : $(item_html_id+"country_id")
|
193 |
+
}
|
194 |
+
});
|
195 |
+
}
|
196 |
+
|
197 |
+
if ($('postcode') && !$('postcode').disabled && _cp_last_edit_attachement != $('postcode')) {
|
198 |
+
_cp_last_edit_attachement = $('postcode');
|
199 |
+
var item_html_id = '';
|
200 |
+
cc_magento({
|
201 |
+
prefix : item_html_id,
|
202 |
+
fields : {
|
203 |
+
postcode_obj: $(item_html_id+"postcode"),
|
204 |
+
company_obj : $(item_html_id+"company"),
|
205 |
+
street1_obj : $(item_html_id+"street0"),
|
206 |
+
street2_obj : $(item_html_id+"street1"),
|
207 |
+
street3_obj : $(item_html_id+"street2"),
|
208 |
+
street4_obj : $(item_html_id+"street3"),
|
209 |
+
town_obj : $(item_html_id+"city"),
|
210 |
+
county_obj : $(item_html_id+"region"),
|
211 |
+
country_obj : $(item_html_id+"country_id")
|
212 |
+
}
|
213 |
+
});
|
214 |
+
}
|
215 |
+
window.setTimeout(function() { _cp_check_and_attach(); }, 500);
|
216 |
+
}
|
js/craftyclicks/c2a/admin/enhance.js
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
document.observe('dom:loaded', function() {
|
2 |
+
if($($('c2a_global_design_dropdown_accent'))){
|
3 |
+
$('c2a_global_design_dropdown_accent').setStyle({display:'none'});
|
4 |
+
var colorpicker = '<div class="color-set"></div>';
|
5 |
+
$('c2a_global_design_dropdown_accent').insert({after: colorpicker});
|
6 |
+
var colors = {
|
7 |
+
default: '#63a2f1',
|
8 |
+
red: '#F44336',
|
9 |
+
pink: '#E91E63',
|
10 |
+
purple: '#9C27B0',
|
11 |
+
deepPurple: '#673ab7',
|
12 |
+
indigo: '#3f51b5',
|
13 |
+
blue: '#2196f3',
|
14 |
+
lightBlue: '#03a9f4',
|
15 |
+
cyan: '#00bcd4',
|
16 |
+
teal: '#009688',
|
17 |
+
green: '#4caf50',
|
18 |
+
lightGreen: '#8bc34a',
|
19 |
+
lime: '#cddc39',
|
20 |
+
yellow: '#ffeb3b',
|
21 |
+
amber: '#ffc107',
|
22 |
+
orange: '#ff9800',
|
23 |
+
deepOrange: '#ff5722',
|
24 |
+
brown: '#795548',
|
25 |
+
grey: '#9e9e9e',
|
26 |
+
blueGrey: '#607d8b'
|
27 |
+
};
|
28 |
+
var keys = Object.keys(colors);
|
29 |
+
for(var i=0; i<keys.length; i++){
|
30 |
+
$$('.color-set')[0].insert({bottom: '<div class="color-cube" data-value="'+keys[i]+'" style="background-color: '+colors[keys[i]]+'"></div>'})
|
31 |
+
}
|
32 |
+
$$('.color-set .color-cube').each(function(item){
|
33 |
+
$(item).on('click', function(event){
|
34 |
+
$('c2a_global_design_dropdown_accent').setValue(this.readAttribute('data-value'));
|
35 |
+
$$('.color-set .color-cube').each(function(cube){ cube.removeClassName('active'); });
|
36 |
+
this.addClassName('active');
|
37 |
+
});
|
38 |
+
});
|
39 |
+
// TODO: need to set the current cube active
|
40 |
+
}
|
41 |
+
});
|
js/craftyclicks/c2a/default.js
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
// This is a collection of JavaScript code to allow easy integration of
|
3 |
+
// the Crafty Clicks Click2Address functionality into Magento
|
4 |
+
//
|
5 |
+
// This file works for the standard magento checkout (both community and enterprise)
|
6 |
+
//
|
7 |
+
// Provided by www.CraftyClicks.co.uk
|
8 |
+
//
|
9 |
+
// Requires the new fancy Crafty Clicks Global JS library - Tested with 0.1
|
10 |
+
//
|
11 |
+
// If you copy/use/modify this code - please keep this
|
12 |
+
// comment header in place
|
13 |
+
//
|
14 |
+
// Copyright (c) 2009-2016 Crafty Clicks (http://www.craftyclicks.com)
|
15 |
+
//
|
16 |
+
// This code relies on prototype js, you must have a reasonably recent version loaded
|
17 |
+
// in your template. Magento should include it as standard.
|
18 |
+
//
|
19 |
+
// If you need any help, contact support@craftyclicks.co.uk - we will help!
|
20 |
+
//
|
21 |
+
**********************************************************************************/
|
22 |
+
var cc_search = null;
|
23 |
+
function cc_magento(magentoCfg){
|
24 |
+
var li_class = 'wide';
|
25 |
+
|
26 |
+
if (!$(magentoCfg.prefix+'_cc_search_input')) {
|
27 |
+
var tmp_html = '<li class="'+li_class+'"><label>Address Search</label><div class="input-box"><input id="'+magentoCfg.prefix+'_cc_search_input" type="text"/></div></li>';
|
28 |
+
magentoCfg.fields.street1_obj.up('li').insert( {before: tmp_html} );
|
29 |
+
}
|
30 |
+
cc_search.attach({
|
31 |
+
search: $(magentoCfg.prefix+'_cc_search_input'),
|
32 |
+
line_1: magentoCfg.fields.street1_obj,
|
33 |
+
line_2: magentoCfg.fields.street2_obj,
|
34 |
+
town: magentoCfg.fields.town_obj,
|
35 |
+
company: magentoCfg.fields.company_obj,
|
36 |
+
postcode: magentoCfg.fields.postcode_obj,
|
37 |
+
county: magentoCfg.fields.county_obj
|
38 |
+
});
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
document.observe('dom:loaded', function() {
|
43 |
+
if (typeof c2a_config == 'undefined' || !c2a_config.active) return;
|
44 |
+
|
45 |
+
var config = {
|
46 |
+
accessToken: c2a_config.access_token,
|
47 |
+
domMode: 'object',
|
48 |
+
geocode: false,
|
49 |
+
gfxMode: c2a_config.design.mode,
|
50 |
+
defaultCountry: 'usa',
|
51 |
+
style: {
|
52 |
+
ambient: c2a_config.design.ambient,
|
53 |
+
accent: c2a_config.design.accent
|
54 |
+
},
|
55 |
+
showLogo: false,
|
56 |
+
texts: {
|
57 |
+
default_placeholder: 'Typo here where you wanna go'
|
58 |
+
},
|
59 |
+
cssPath: false
|
60 |
+
/*
|
61 |
+
onResultSelected: function(address){
|
62 |
+
console.log(address);
|
63 |
+
var address_data = {
|
64 |
+
line_1: address.line_1,
|
65 |
+
line_2: address.line_2,
|
66 |
+
town: address.locality,
|
67 |
+
postal_code: address.postal_code
|
68 |
+
};
|
69 |
+
new Ajax.Request(c2a_config.cc_hash_url,{
|
70 |
+
method: "post",
|
71 |
+
postBody: JSON.stringify(address_data),
|
72 |
+
onSuccess: function(transport){
|
73 |
+
console.log(transport);
|
74 |
+
var response = transport.responseText || "no response text";
|
75 |
+
alert("Success! \n\n" + response);
|
76 |
+
},
|
77 |
+
onFailure: function(){ alert('Something went wrong...') }
|
78 |
+
});
|
79 |
+
}*/
|
80 |
+
};
|
81 |
+
cc_search = new clickToAddress(config);
|
82 |
+
|
83 |
+
if ($('billing:postcode')) {
|
84 |
+
cc_magento({
|
85 |
+
prefix: 'billing',
|
86 |
+
fields: {
|
87 |
+
postcode_obj: $('billing:postcode'),
|
88 |
+
company_obj : $('billing:company'),
|
89 |
+
street1_obj : $('billing:street1'),
|
90 |
+
street2_obj : $('billing:street2'),
|
91 |
+
street3_obj : $('billing:street3'),
|
92 |
+
street4_obj : $('billing:street4'),
|
93 |
+
town_obj : $('billing:city'),
|
94 |
+
county_obj : $('billing:region'),
|
95 |
+
country_obj : $('billing:country_id')
|
96 |
+
}
|
97 |
+
});
|
98 |
+
}
|
99 |
+
if ($('shipping:postcode')) {
|
100 |
+
cc_magento({
|
101 |
+
prefix : 'shipping',
|
102 |
+
fields : {
|
103 |
+
postcode_obj : $('shipping:postcode'),
|
104 |
+
company_obj : $('shipping:company'),
|
105 |
+
street1_obj : $('shipping:street1'),
|
106 |
+
street2_obj : $('shipping:street2'),
|
107 |
+
street3_obj : $('shipping:street3'),
|
108 |
+
street4_obj : $('shipping:street4'),
|
109 |
+
town_obj : $('shipping:city'),
|
110 |
+
county_obj : $('shipping:region'),
|
111 |
+
country_obj : $('shipping:country_id')
|
112 |
+
}
|
113 |
+
});
|
114 |
+
}
|
115 |
+
|
116 |
+
if ($('zip')) {
|
117 |
+
cc_magento({
|
118 |
+
prefix : '',
|
119 |
+
fields : {
|
120 |
+
postcode_obj : $('zip'),
|
121 |
+
company_obj : $('company'),
|
122 |
+
street1_obj : $('street_1'),
|
123 |
+
street2_obj : $('street_2'),
|
124 |
+
street3_obj : $('street_3'),
|
125 |
+
street4_obj : $('street_4'),
|
126 |
+
town_obj : $('city'),
|
127 |
+
county_obj : $('region'),
|
128 |
+
country_obj : $('country')
|
129 |
+
}
|
130 |
+
});
|
131 |
+
}
|
132 |
+
});
|
js/craftyclicks/c2a/lib/cc_c2a.min.js
ADDED
@@ -0,0 +1,1118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
clickToAddress.prototype.search = function(searchText, filters, timeTrack) {
|
2 |
+
var that = this;
|
3 |
+
if (searchText == "") {
|
4 |
+
return;
|
5 |
+
}
|
6 |
+
if (typeof filters == "undefined") {
|
7 |
+
filters = {};
|
8 |
+
}
|
9 |
+
this.setProgressBar(0);
|
10 |
+
var parameters = {
|
11 |
+
key: this.key,
|
12 |
+
query: searchText,
|
13 |
+
filters: filters,
|
14 |
+
country: this.activeCountry,
|
15 |
+
fingerprint: this.fingerprint,
|
16 |
+
integration: this.tag
|
17 |
+
};
|
18 |
+
if (typeof this.accessTokenOverride[this.activeCountry] != "undefined") {
|
19 |
+
parameters.key = this.accessTokenOverride[this.activeCountry];
|
20 |
+
}
|
21 |
+
if (this.coords != {}) {
|
22 |
+
parameters.coords = {};
|
23 |
+
parameters.coords.lat = this.coords.latitude;
|
24 |
+
parameters.coords.lng = this.coords.longitude;
|
25 |
+
}
|
26 |
+
try {
|
27 |
+
var data = this.cacheRetrieve(parameters);
|
28 |
+
that.hideErrors();
|
29 |
+
that.searchResults = data;
|
30 |
+
that.showResults();
|
31 |
+
if (!that.focused) {
|
32 |
+
that.activeInput.focus();
|
33 |
+
}
|
34 |
+
that.setProgressBar(1);
|
35 |
+
return;
|
36 |
+
} catch (err) {
|
37 |
+
if ([ "cc/cr/01", "cc/cr/02" ].indexOf(err) == -1) {
|
38 |
+
throw err;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
var url = this.baseURL + "find";
|
42 |
+
request = new XMLHttpRequest();
|
43 |
+
request.open("POST", url, true);
|
44 |
+
request.setRequestHeader("Content-Type", "application/json");
|
45 |
+
request.setRequestHeader("Accept", "application/json");
|
46 |
+
var that = this;
|
47 |
+
request.onreadystatechange = function() {
|
48 |
+
if (this.readyState === 4 && (that.sidCheck(timeTrack) || typeof timeTrack == "undefined")) {
|
49 |
+
that.setProgressBar(1);
|
50 |
+
that.clear();
|
51 |
+
if (this.status >= 200 && this.status < 400) {
|
52 |
+
if (this.status == 204) {
|
53 |
+
return;
|
54 |
+
}
|
55 |
+
var data = "";
|
56 |
+
try {
|
57 |
+
data = JSON.parse(this.responseText);
|
58 |
+
that.hideErrors();
|
59 |
+
that.searchResults = data;
|
60 |
+
that.showResults();
|
61 |
+
if (!that.focused) {
|
62 |
+
that.activeInput.focus();
|
63 |
+
}
|
64 |
+
that.cacheStore(parameters, data);
|
65 |
+
} catch (err) {
|
66 |
+
that.error(9011, "JS Client side error.");
|
67 |
+
}
|
68 |
+
} else {
|
69 |
+
that.handleApiError(this);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
};
|
73 |
+
request.send(JSON.stringify(parameters));
|
74 |
+
request = null;
|
75 |
+
};
|
76 |
+
|
77 |
+
clickToAddress.prototype.getAddressDetails = function(id) {
|
78 |
+
var parameters = {
|
79 |
+
id: id,
|
80 |
+
country: this.activeCountry,
|
81 |
+
key: this.key,
|
82 |
+
fingerprint: this.fingerprint,
|
83 |
+
integration: this.tag
|
84 |
+
};
|
85 |
+
if (typeof this.accessTokenOverride[this.activeCountry] != "undefined") {
|
86 |
+
parameters.key = this.accessTokenOverride[this.activeCountry];
|
87 |
+
}
|
88 |
+
if (this.coords != {}) {
|
89 |
+
parameters.coords = this.coords;
|
90 |
+
}
|
91 |
+
var url = this.baseURL + "retrieve";
|
92 |
+
request = new XMLHttpRequest();
|
93 |
+
request.open("POST", url, true);
|
94 |
+
request.setRequestHeader("Content-Type", "application/json");
|
95 |
+
request.setRequestHeader("Accept", "application/json");
|
96 |
+
var that = this;
|
97 |
+
request.onreadystatechange = function() {
|
98 |
+
if (this.readyState === 4) {
|
99 |
+
if (this.status >= 200 && this.status < 400) {
|
100 |
+
try {
|
101 |
+
that.fillData(JSON.parse(this.responseText));
|
102 |
+
that.hideErrors();
|
103 |
+
that.cleanHistory();
|
104 |
+
} catch (e) {
|
105 |
+
that.error(9011, "JS Client side error.");
|
106 |
+
}
|
107 |
+
} else {
|
108 |
+
that.handleApiError(this);
|
109 |
+
}
|
110 |
+
}
|
111 |
+
};
|
112 |
+
request.send(JSON.stringify(parameters));
|
113 |
+
request = null;
|
114 |
+
};
|
115 |
+
|
116 |
+
clickToAddress.prototype.getAvailableCountries = function(success_function) {
|
117 |
+
var parameters = {
|
118 |
+
key: this.key,
|
119 |
+
fingerprint: this.fingerprint,
|
120 |
+
integration: this.tag
|
121 |
+
};
|
122 |
+
var url = this.baseURL + "countries";
|
123 |
+
request = new XMLHttpRequest();
|
124 |
+
request.open("POST", url, true);
|
125 |
+
request.setRequestHeader("Content-Type", "application/json");
|
126 |
+
request.setRequestHeader("Accept", "application/json");
|
127 |
+
var that = this;
|
128 |
+
request.onreadystatechange = function() {
|
129 |
+
if (this.readyState === 4) {
|
130 |
+
if (this.status == 401) {
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
if (this.status >= 200 && this.status < 400) {
|
134 |
+
try {
|
135 |
+
that.serviceReady = 1;
|
136 |
+
var respJson = JSON.parse(this.responseText);
|
137 |
+
that.validCountries = respJson.countries;
|
138 |
+
that.ipLocation = respJson.ip_location;
|
139 |
+
that.hideErrors();
|
140 |
+
success_function();
|
141 |
+
} catch (e) {
|
142 |
+
that.error(9011, "JS Client side error.");
|
143 |
+
}
|
144 |
+
} else {
|
145 |
+
that.handleApiError(this);
|
146 |
+
}
|
147 |
+
}
|
148 |
+
};
|
149 |
+
request.send(JSON.stringify(parameters));
|
150 |
+
var xmlHttpTimeout = setTimeout(function() {
|
151 |
+
if (request != null && request.readyState !== 4) {
|
152 |
+
request.abort();
|
153 |
+
that.error(9012, "Server Unavailable. (timeout)");
|
154 |
+
}
|
155 |
+
}, 1e4);
|
156 |
+
};
|
157 |
+
|
158 |
+
clickToAddress.prototype.handleApiError = function(ajax) {
|
159 |
+
if ([ 401, 402 ].indexOf(ajax.status) != -1) {
|
160 |
+
this.serviceReady = -1;
|
161 |
+
}
|
162 |
+
var data = {};
|
163 |
+
try {
|
164 |
+
data = JSON.parse(ajax.responseText);
|
165 |
+
} catch (e) {
|
166 |
+
data = {};
|
167 |
+
}
|
168 |
+
if (typeof data.error != "undefined" && typeof data.error.status == "string") {
|
169 |
+
this.error(data.error.status, data.error.message);
|
170 |
+
} else {
|
171 |
+
this.error(9010, "Unknown Server Error.");
|
172 |
+
}
|
173 |
+
};
|
174 |
+
|
175 |
+
clickToAddress.prototype.cacheRetrieve = function(search) {
|
176 |
+
if (typeof this.cache[search.country] == "undefined") {
|
177 |
+
throw "cc/cr/01";
|
178 |
+
}
|
179 |
+
for (var i = 0; i < this.cache[search.country].length; i++) {
|
180 |
+
if (this.cache[search.country][i].query == search.query && JSON.stringify(this.cache[search.country][i].filters) == JSON.stringify(search.filters)) {
|
181 |
+
return this.cache[search.country][i].response;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
throw "cc/cr/02";
|
185 |
+
};
|
186 |
+
|
187 |
+
clickToAddress.prototype.cacheStore = function(search, obj) {
|
188 |
+
if (typeof this.cache[search.country] == "undefined") {
|
189 |
+
this.cache[search.country] = [];
|
190 |
+
}
|
191 |
+
this.cache[search.country].push({
|
192 |
+
query: search.query,
|
193 |
+
filters: search.filters,
|
194 |
+
response: obj
|
195 |
+
});
|
196 |
+
if (this.cache[search.country].length > 100) {
|
197 |
+
this.cache[search.country].shift();
|
198 |
+
}
|
199 |
+
this.setHistoryStep();
|
200 |
+
};
|
201 |
+
|
202 |
+
clickToAddress.prototype.history = function(dir) {
|
203 |
+
if (!this.historyTools) return;
|
204 |
+
if (this.cachePos == -1) {
|
205 |
+
this.cachePos = 0;
|
206 |
+
}
|
207 |
+
var searchParams = {};
|
208 |
+
var cacheLength = Object.keys(this.cache[this.activeCountry]).length - 1;
|
209 |
+
if (dir == 0) {
|
210 |
+
this.cachePos++;
|
211 |
+
searchParams = this.cache[this.activeCountry][cacheLength - this.cachePos];
|
212 |
+
} else {
|
213 |
+
this.cachePos--;
|
214 |
+
searchParams = this.cache[this.activeCountry][cacheLength - this.cachePos];
|
215 |
+
}
|
216 |
+
this.setHistoryStep();
|
217 |
+
this.activeInput.value = searchParams.query;
|
218 |
+
this.search(searchParams.query, searchParams.filters);
|
219 |
+
};
|
220 |
+
|
221 |
+
clickToAddress.prototype.setHistoryActions = function() {
|
222 |
+
if (!this.historyTools) return;
|
223 |
+
var that = this;
|
224 |
+
var backBtn = this.searchObj.getElementsByClassName("back")[0];
|
225 |
+
var forwardBtn = this.searchObj.getElementsByClassName("forward")[0];
|
226 |
+
ccEvent(backBtn, "click", function() {
|
227 |
+
if (backBtn.className == "back") {
|
228 |
+
for (var i = 0; i < that.cache[that.activeCountry].length; i++) {
|
229 |
+
console.log(that.cache[that.activeCountry][i].query);
|
230 |
+
}
|
231 |
+
that.history(0);
|
232 |
+
}
|
233 |
+
});
|
234 |
+
ccEvent(forwardBtn, "click", function() {
|
235 |
+
if (forwardBtn.className == "forward") {
|
236 |
+
that.history(1);
|
237 |
+
}
|
238 |
+
});
|
239 |
+
};
|
240 |
+
|
241 |
+
clickToAddress.prototype.setHistoryStep = function() {
|
242 |
+
if (!this.historyTools) return;
|
243 |
+
var backBtn = this.searchObj.getElementsByClassName("back")[0];
|
244 |
+
var forwardBtn = this.searchObj.getElementsByClassName("forward")[0];
|
245 |
+
backBtn.className = "back";
|
246 |
+
forwardBtn.className = "forward";
|
247 |
+
if (typeof this.cache[this.activeCountry] == "undefined" || this.cachePos == Object.keys(this.cache[this.activeCountry]).length - 1 || Object.keys(this.cache[this.activeCountry]).length <= 1) {
|
248 |
+
backBtn.className = "back disabled";
|
249 |
+
}
|
250 |
+
if (typeof this.cache[this.activeCountry] == "undefined" || this.cachePos <= 0 || Object.keys(this.cache[this.activeCountry]).length <= 1) {
|
251 |
+
forwardBtn.className = "forward disabled";
|
252 |
+
}
|
253 |
+
};
|
254 |
+
|
255 |
+
clickToAddress.prototype.cleanHistory = function() {
|
256 |
+
if (this.cachePos == -1) {
|
257 |
+
return;
|
258 |
+
}
|
259 |
+
var cacheLength = Object.keys(this.cache[this.activeCountry]).length - 1;
|
260 |
+
var removeAt = cacheLength - this.cachePos;
|
261 |
+
this.cache[this.activeCountry].splice(removeAt, this.cachePos);
|
262 |
+
this.cachePos = -1;
|
263 |
+
this.setHistoryStep();
|
264 |
+
};
|
265 |
+
|
266 |
+
clickToAddress.prototype.info = function(state) {
|
267 |
+
var infoBar = this.searchObj.getElementsByClassName("infoBar")[0];
|
268 |
+
switch (state) {
|
269 |
+
case "pre-trial":
|
270 |
+
infoBar.className += " infoActive";
|
271 |
+
infoBar.innerHTML = "<h5>Get a trial account today!</h5><p>You can test the functionality by using our test addresses.</p>";
|
272 |
+
break;
|
273 |
+
}
|
274 |
+
};
|
275 |
+
|
276 |
+
clickToAddress.prototype.setFingerPrint = function() {
|
277 |
+
var low = 1e15;
|
278 |
+
var high = 1e16;
|
279 |
+
var value = Math.floor(Math.random() * (high - low + 1) + low);
|
280 |
+
this.fingerprint = value.toString(16);
|
281 |
+
};
|
282 |
+
|
283 |
+
clickToAddress.prototype.getFingerPrint = function() {
|
284 |
+
return this.fingerprint;
|
285 |
+
};
|
286 |
+
|
287 |
+
function ccEvent(target, event_to_react, function_to_call) {
|
288 |
+
target.addEventListener(event_to_react, function_to_call);
|
289 |
+
}
|
290 |
+
|
291 |
+
function clickToAddress(config) {
|
292 |
+
if (document.getElementById("cc_c2a") != null) {
|
293 |
+
throw "Already initiated";
|
294 |
+
}
|
295 |
+
var that = this;
|
296 |
+
this.preset(config);
|
297 |
+
this.gfxModeTools = c2a_gfx_modes["mode" + this.gfxMode];
|
298 |
+
this.gfxModeTools.addHtml(this);
|
299 |
+
this.searchObj = document.getElementById("cc_c2a");
|
300 |
+
this.resultList = this.searchObj.getElementsByClassName("c2a_results")[0];
|
301 |
+
this.errorObj = this.searchObj.getElementsByClassName("c2a_error")[0];
|
302 |
+
this.getAvailableCountries(function() {
|
303 |
+
that.serviceReady = 1;
|
304 |
+
that.setCountryChange();
|
305 |
+
if (that.getIpLocation && that.ipLocation != "") {
|
306 |
+
var country = that.ipLocation;
|
307 |
+
} else {
|
308 |
+
var country = that.defaultCountry;
|
309 |
+
}
|
310 |
+
that.selectCountry(country);
|
311 |
+
});
|
312 |
+
if (this.searchObj.getElementsByClassName("history").length) {
|
313 |
+
this.setHistoryActions();
|
314 |
+
}
|
315 |
+
ccEvent(this.searchObj, "mouseover", function() {
|
316 |
+
that.hover = true;
|
317 |
+
});
|
318 |
+
ccEvent(this.searchObj, "mouseout", function() {
|
319 |
+
that.hover = false;
|
320 |
+
});
|
321 |
+
ccEvent(document, "click", function() {
|
322 |
+
that.hide();
|
323 |
+
});
|
324 |
+
ccEvent(document, "scroll", function() {
|
325 |
+
if (that.visible && that.focused) {
|
326 |
+
setTimeout(function() {
|
327 |
+
that.gfxModeTools.reposition(that, that.activeInput);
|
328 |
+
}, 100);
|
329 |
+
that.hideKeyboard();
|
330 |
+
}
|
331 |
+
});
|
332 |
+
ccEvent(window, "resize", function() {
|
333 |
+
if (that.visible) {
|
334 |
+
setTimeout(function() {
|
335 |
+
that.gfxModeTools.reposition(that, that.activeInput);
|
336 |
+
}, 100);
|
337 |
+
}
|
338 |
+
});
|
339 |
+
this.getStyleSheet();
|
340 |
+
if (this.key == "xxxxx-xxxxx-xxxxx-xxxxx") {
|
341 |
+
this.info("pre-trial");
|
342 |
+
}
|
343 |
+
if (typeof config.dom != "undefined") {
|
344 |
+
this.attach(config.dom);
|
345 |
+
}
|
346 |
+
}
|
347 |
+
|
348 |
+
clickToAddress.prototype.fillData = function(addressData) {
|
349 |
+
if (typeof this.activeDom.country != "undefined") {
|
350 |
+
var options = this.activeDom.country.getElementsByTagName("option");
|
351 |
+
if (options.length) {
|
352 |
+
var target_val = "";
|
353 |
+
for (var i = 0; i < options.length && target_val == ""; i++) {
|
354 |
+
switch (this.countryMatchWith) {
|
355 |
+
case "iso_2":
|
356 |
+
break;
|
357 |
+
}
|
358 |
+
if (options[i].innerHTML == this.validCountries[this.activeCountryId].country_name) {
|
359 |
+
target_val = options[i].value;
|
360 |
+
break;
|
361 |
+
}
|
362 |
+
if (options[i].value == this.activeCountry) {
|
363 |
+
target_val = options[i].value;
|
364 |
+
break;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
this.activeDom.country.value = target_val;
|
368 |
+
} else {
|
369 |
+
this.activeDom.country.value = this.validCountries[this.activeCountryId].country_name;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
if (typeof this.activeDom.line_1 != "undefined") {
|
373 |
+
this.activeDom.line_1.value = addressData.result.line_1;
|
374 |
+
if (typeof this.activeDom.line_2 != "undefined") {
|
375 |
+
this.activeDom.line_2.value = addressData.result.line_2;
|
376 |
+
} else {
|
377 |
+
if (addressData.result.line_2 != "") {
|
378 |
+
line_3.push(addressData.result.line_2);
|
379 |
+
}
|
380 |
+
}
|
381 |
+
if (typeof this.activeDom.company != "undefined") {
|
382 |
+
this.activeDom.company.value = addressData.result.company_name;
|
383 |
+
} else {
|
384 |
+
if (addressData.result.company_name != "") {
|
385 |
+
this.activeDom.line_1.value = addressData.result.company_name + ", " + this.activeDom.line_1.value;
|
386 |
+
}
|
387 |
+
}
|
388 |
+
var line_3 = [];
|
389 |
+
if (typeof this.activeDom.postcode != "undefined") {
|
390 |
+
this.activeDom.postcode.value = addressData.result.postal_code;
|
391 |
+
} else {
|
392 |
+
line_3.push(addressData.result.postal_code);
|
393 |
+
}
|
394 |
+
if (typeof this.activeDom.town != "undefined") {
|
395 |
+
if (addressData.result.locality != "") {
|
396 |
+
this.activeDom.town.value = addressData.result.locality;
|
397 |
+
} else {
|
398 |
+
this.activeDom.town.value = addressData.result.dependent_locality;
|
399 |
+
}
|
400 |
+
} else {
|
401 |
+
if (addressData.result.locality != "") {
|
402 |
+
line_3.push(addressData.result.locality);
|
403 |
+
} else {
|
404 |
+
line_3.push(addressData.result.dependent_locality);
|
405 |
+
}
|
406 |
+
}
|
407 |
+
if (addressData.result.province != "") {
|
408 |
+
var province_set = {
|
409 |
+
province: addressData.result.province,
|
410 |
+
code: addressData.result.province_code,
|
411 |
+
name: addressData.result.province_name
|
412 |
+
};
|
413 |
+
if (typeof this.onSetCounty == "function") {
|
414 |
+
this.onSetCounty(this, province_set, this.activeDom.county);
|
415 |
+
} else if (typeof this.activeDom.county != "undefined") {
|
416 |
+
this.setCounty(province_set);
|
417 |
+
}
|
418 |
+
}
|
419 |
+
if (line_3.length) {
|
420 |
+
if (typeof this.activeDom.line_2 != "undefined") {
|
421 |
+
this.activeDom.line_2.value += ", " + line_3.join(", ");
|
422 |
+
} else {
|
423 |
+
this.activeDom.line_1.value += ", " + line_3.join(", ");
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
if (typeof this.onResultSelected == "function") {
|
428 |
+
this.onResultSelected(this, this.activeDom, addressData.result);
|
429 |
+
}
|
430 |
+
this.hide(true);
|
431 |
+
};
|
432 |
+
|
433 |
+
clickToAddress.prototype.setCounty = function(element, province) {
|
434 |
+
var options = element.getElementsByTagName("option");
|
435 |
+
if (options.length) {
|
436 |
+
var target_val = province.code;
|
437 |
+
for (var i = 0; i < options.length; i++) {
|
438 |
+
if (options[i].innerHTML == province.name) {
|
439 |
+
target_val = options[i].value;
|
440 |
+
break;
|
441 |
+
}
|
442 |
+
}
|
443 |
+
element.value = target_val;
|
444 |
+
} else {
|
445 |
+
element.value = province.name;
|
446 |
+
}
|
447 |
+
};
|
448 |
+
|
449 |
+
clickToAddress.prototype.showResults = function(full) {
|
450 |
+
this.resetSelector();
|
451 |
+
var newHtml = "";
|
452 |
+
var limit = this.searchResults.results.length;
|
453 |
+
for (var i = 0; i < limit; i++) {
|
454 |
+
newHtml += "<li></li>";
|
455 |
+
}
|
456 |
+
this.resultList.innerHTML = newHtml;
|
457 |
+
var listElements = this.resultList.getElementsByTagName("li");
|
458 |
+
this.resultList.scrollTop = 0;
|
459 |
+
var that = this;
|
460 |
+
for (var i = 0; i < listElements.length; i++) {
|
461 |
+
var row = this.searchResults.results[i];
|
462 |
+
var content = "<div>";
|
463 |
+
if (typeof row.labels[0] == "string" && row.labels[0] !== "") content += "<span>" + row.labels[0] + "</span>";
|
464 |
+
if (typeof row.labels[1] == "string" && row.labels[1] !== "") content += '<span class="light">' + row.labels[1] + "</span>";
|
465 |
+
if (typeof row.count == "number" && row.count > 1) content += '<span class="light">(' + row.count + " more)</span>";
|
466 |
+
content += "</div>";
|
467 |
+
listElements[i].innerHTML = content;
|
468 |
+
listElements[i].setAttribute("title", row.labels.join(", "));
|
469 |
+
if (typeof row.count == "number" && row.count > 1) {
|
470 |
+
listElements[i].className = "filter";
|
471 |
+
listElements[i].innerHTML += '<i class="craftyicons-caret"></i>';
|
472 |
+
}
|
473 |
+
if (typeof row.id == "number") listElements[i].key = row.id; else listElements[i].key = 0;
|
474 |
+
if (typeof row.filters != "undefined") listElements[i].filters = row.filters; else listElements[i].filters = null;
|
475 |
+
if (typeof row.query != "undefined") listElements[i].query = row.query; else listElements[i].query = null;
|
476 |
+
ccEvent(listElements[i], "click", function() {
|
477 |
+
that.select(this);
|
478 |
+
});
|
479 |
+
}
|
480 |
+
if (this.searchResults.results.length === 0) {
|
481 |
+
this.resultList.innerHTML = '<li class="deadend">' + this.texts.no_results + "</li>";
|
482 |
+
this.hasContent = false;
|
483 |
+
} else {
|
484 |
+
this.hasContent = true;
|
485 |
+
}
|
486 |
+
};
|
487 |
+
|
488 |
+
clickToAddress.prototype.select = function(li) {
|
489 |
+
this.resetSelector();
|
490 |
+
this.cleanHistory();
|
491 |
+
if (li.key !== 0) {
|
492 |
+
this.getAddressDetails(li.key);
|
493 |
+
this.hide();
|
494 |
+
this.loseFocus();
|
495 |
+
return;
|
496 |
+
}
|
497 |
+
if (li.filters !== null || li.query !== null) {
|
498 |
+
this.search(this.activeInput.value, li.filters);
|
499 |
+
this.getFocus();
|
500 |
+
if (li.query !== null) {
|
501 |
+
this.activeInput.value = li.query;
|
502 |
+
}
|
503 |
+
this.activeFilters = li.filters;
|
504 |
+
return;
|
505 |
+
}
|
506 |
+
if (li.className != "deadend") {
|
507 |
+
this.search(this.activeInput.value);
|
508 |
+
this.getFocus();
|
509 |
+
return;
|
510 |
+
}
|
511 |
+
};
|
512 |
+
|
513 |
+
clickToAddress.prototype.getGeo = function() {
|
514 |
+
var that = this;
|
515 |
+
if (navigator.geolocation) {
|
516 |
+
navigator.geolocation.getCurrentPosition(function(position) {
|
517 |
+
that.coords = position.coords;
|
518 |
+
that.showGeo();
|
519 |
+
});
|
520 |
+
}
|
521 |
+
};
|
522 |
+
|
523 |
+
clickToAddress.prototype.changeCountry = function(filter) {
|
524 |
+
this.resetSelector();
|
525 |
+
var newHtml = "";
|
526 |
+
var limit = this.validCountries.length;
|
527 |
+
for (var i = 0; i < limit; i++) {
|
528 |
+
newHtml += "<li></li>";
|
529 |
+
}
|
530 |
+
this.resultList.innerHTML = newHtml;
|
531 |
+
var listElements = this.resultList.getElementsByTagName("li");
|
532 |
+
this.resultList.scrollTop = 0;
|
533 |
+
var that = this;
|
534 |
+
var skip = 0;
|
535 |
+
for (var i = 0; i < listElements.length; i++) {
|
536 |
+
var row = this.validCountries[i + skip];
|
537 |
+
var content = "";
|
538 |
+
if (typeof filter !== "undefined") {
|
539 |
+
if (row.country_name.toLowerCase().indexOf(filter.toLowerCase()) != -1) {
|
540 |
+
content = '<span class="flag flag-' + row.short_code + '"></span>' + "<span>" + row.country_name + "</span>";
|
541 |
+
} else {
|
542 |
+
listElements[i].parentNode.removeChild(listElements[i]);
|
543 |
+
i--;
|
544 |
+
skip++;
|
545 |
+
}
|
546 |
+
} else {
|
547 |
+
var content = '<span class="flag flag-' + row.short_code + '"></span>' + "<span>" + row.country_name + "</span>";
|
548 |
+
}
|
549 |
+
if (content != "") {
|
550 |
+
listElements[i].innerHTML = content;
|
551 |
+
listElements[i].setAttribute("countryCode", row.code);
|
552 |
+
that.hasContent = true;
|
553 |
+
ccEvent(listElements[i], "click", function() {
|
554 |
+
that.selectCountry(this.getAttribute("countryCode"));
|
555 |
+
});
|
556 |
+
}
|
557 |
+
}
|
558 |
+
this.sid = -1;
|
559 |
+
this.getFocus();
|
560 |
+
};
|
561 |
+
|
562 |
+
clickToAddress.prototype.selectCountry = function(countryCode) {
|
563 |
+
var that = this;
|
564 |
+
this.clear();
|
565 |
+
var countryObj = this.searchObj.getElementsByClassName("country_img")[0];
|
566 |
+
var selectedCountry = {};
|
567 |
+
this.activeCountryId = 0;
|
568 |
+
for (var i = 0; i < this.validCountries.length; i++) {
|
569 |
+
if (this.validCountries[i].code == countryCode) {
|
570 |
+
selectedCountry = this.validCountries[i];
|
571 |
+
this.activeCountryId = i;
|
572 |
+
break;
|
573 |
+
}
|
574 |
+
}
|
575 |
+
countryObj.setAttribute("class", "country_img flag flag-" + selectedCountry.short_code);
|
576 |
+
this.activeCountry = countryCode;
|
577 |
+
this.sid = 0;
|
578 |
+
this.getFocus();
|
579 |
+
if (typeof this.activeInput.value != "undefined" && typeof this.lastSearch != "undefined") {
|
580 |
+
this.activeInput.value = this.lastSearch;
|
581 |
+
this.activeFilters = {};
|
582 |
+
this.lastSearch = this.value;
|
583 |
+
var timeTrack = new Date().getTime() / 1e3;
|
584 |
+
this.sid = timeTrack;
|
585 |
+
setTimeout(function() {
|
586 |
+
if (that.sidCheck(timeTrack)) {
|
587 |
+
if (that.activeInput.value !== "") {
|
588 |
+
that.search(that.activeInput.value, that.activeFilters, timeTrack);
|
589 |
+
that.cleanHistory();
|
590 |
+
} else {
|
591 |
+
that.clear();
|
592 |
+
}
|
593 |
+
}
|
594 |
+
}, 500);
|
595 |
+
this.gfxModeTools.reposition(this, this.activeInput);
|
596 |
+
}
|
597 |
+
this.setPlaceholder(0);
|
598 |
+
};
|
599 |
+
|
600 |
+
clickToAddress.prototype.setCountryChange = function() {
|
601 |
+
if (this.enabledCountries.length !== 0) {
|
602 |
+
for (var i = 0; i < this.validCountries.length; i++) {
|
603 |
+
var row = this.validCountries[i];
|
604 |
+
if (this.enabledCountries.indexOf(row.code) == -1) {
|
605 |
+
this.validCountries.splice(i, 1);
|
606 |
+
i--;
|
607 |
+
}
|
608 |
+
}
|
609 |
+
}
|
610 |
+
var countryObj = this.searchObj.getElementsByClassName("country_btn")[0];
|
611 |
+
var that = this;
|
612 |
+
ccEvent(countryObj, "click", function() {
|
613 |
+
if (that.sid != -1) {
|
614 |
+
that.setPlaceholder(1);
|
615 |
+
that.changeCountry();
|
616 |
+
that.activeInput.value = "";
|
617 |
+
that.hasContent = true;
|
618 |
+
} else {
|
619 |
+
that.setPlaceholder(0);
|
620 |
+
that.sid = 0;
|
621 |
+
that.hide(true);
|
622 |
+
that.getFocus();
|
623 |
+
that.hover = true;
|
624 |
+
}
|
625 |
+
});
|
626 |
+
};
|
627 |
+
|
628 |
+
clickToAddress.prototype.sidCheck = function(sid) {
|
629 |
+
return sid == this.sid;
|
630 |
+
};
|
631 |
+
|
632 |
+
clickToAddress.prototype.destroy = function() {};
|
633 |
+
|
634 |
+
if (typeof c2a_gfx_modes == "undefined") {
|
635 |
+
var c2a_gfx_modes = {};
|
636 |
+
}
|
637 |
+
|
638 |
+
c2a_gfx_modes["mode1"] = {
|
639 |
+
addHtml: function(that) {
|
640 |
+
var cc_dropdown = document.createElement("DIV");
|
641 |
+
cc_dropdown.className = "c2a_mode" + that.gfxMode + " c2a_" + that.style.ambient + " c2a_accent_" + that.style.accent;
|
642 |
+
cc_dropdown.id = "cc_c2a";
|
643 |
+
var countrySelect = '<div class="country"><div class="country_btn"><div class="country_img"></div><span>' + that.texts.country_button + "</span></div></div>";
|
644 |
+
var progressBar = '<div class="progressBar"></div>';
|
645 |
+
var infoBar = '<div class="infoBar"></div>';
|
646 |
+
var historyBar = '<div class="history"><div class="back disabled"><i class="craftyicons-fw2 craftyicons-flip"></i></div>';
|
647 |
+
historyBar += '<div class="forward disabled"><i class="craftyicons-fw2"></i></div></div>';
|
648 |
+
var footerHtml = progressBar + countrySelect + infoBar;
|
649 |
+
if (that.historyTools === true) {
|
650 |
+
footerHtml += historyBar;
|
651 |
+
}
|
652 |
+
var footerClass = "c2a_footer", title = "";
|
653 |
+
var html = '<div class="c2a_error"></div><ul class="c2a_results"></ul>' + '<div class="' + footerClass + '"' + title + ">" + footerHtml + "</div>";
|
654 |
+
cc_dropdown.innerHTML = html;
|
655 |
+
document.body.appendChild(cc_dropdown);
|
656 |
+
},
|
657 |
+
reposition: function(that, target) {
|
658 |
+
var elemRect = target.getBoundingClientRect(), bodyRect = document.body.getBoundingClientRect(), topOffset = elemRect.top - bodyRect.top + target.offsetHeight - 3;
|
659 |
+
leftOffset = elemRect.left - bodyRect.left;
|
660 |
+
if (document.body.style.paddingLeft != "") {
|
661 |
+
leftOffset += parseInt(document.body.style.paddingLeft);
|
662 |
+
}
|
663 |
+
var htmlTop = parseInt(window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue("margin-top"));
|
664 |
+
htmlTop += parseInt(window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue("padding-top"));
|
665 |
+
topOffset += htmlTop;
|
666 |
+
if (bodyRect.bottom < that.searchObj.offsetHeight) {
|
667 |
+
topOffset -= target.offsetHeight + that.searchObj.offsetHeight;
|
668 |
+
}
|
669 |
+
that.searchObj.style.left = leftOffset + 3 + "px";
|
670 |
+
that.searchObj.style.top = topOffset + "px";
|
671 |
+
that.searchObj.style.width = target.offsetWidth - 6 + "px";
|
672 |
+
}
|
673 |
+
};
|
674 |
+
|
675 |
+
if (typeof c2a_gfx_modes == "undefined") {
|
676 |
+
var c2a_gfx_modes = {};
|
677 |
+
}
|
678 |
+
|
679 |
+
c2a_gfx_modes["mode2"] = {
|
680 |
+
addHtml: function(that) {
|
681 |
+
var cc_dropdown = document.createElement("DIV");
|
682 |
+
cc_dropdown.className = "c2a_mode" + that.gfxMode + " c2a_" + that.style.ambient + " c2a_accent_" + that.style.accent;
|
683 |
+
cc_dropdown.id = "cc_c2a";
|
684 |
+
var topbar = '<div class="country">';
|
685 |
+
topbar += '<div class="country_btn"><div class="country_img"></div><span>' + that.texts.country_button + "</span></div>";
|
686 |
+
if (that.historyTools === true) {
|
687 |
+
topbar += '<div class="history"><div class="back disabled"><i class="craftyicons-fw2 craftyicons-flip"></i></div>';
|
688 |
+
topbar += '<div class="forward disabled"><i class="craftyicons-fw2"></i></div></div>';
|
689 |
+
}
|
690 |
+
topbar += "</div>";
|
691 |
+
var progressBar = '<div class="progressBar"></div>';
|
692 |
+
var infoBar = '<div class="infoBar"></div>';
|
693 |
+
var footerClass = "c2a_footer", title = "";
|
694 |
+
var footerHtml = progressBar + infoBar;
|
695 |
+
if (that.showLogo) {
|
696 |
+
footerHtml += '<div class="c2a_logo"></div>';
|
697 |
+
title = ' title="Provided by Crafty Clicks"';
|
698 |
+
}
|
699 |
+
if (!that.showLogo && !that.geocode) {
|
700 |
+
footerClass += " c2a_footer_min";
|
701 |
+
}
|
702 |
+
var html = topbar + '<div class="c2a_error"></div><ul class="c2a_results"></ul>' + '<div class="' + footerClass + '"' + title + ">" + footerHtml + "</div>";
|
703 |
+
cc_dropdown.innerHTML = html;
|
704 |
+
document.body.appendChild(cc_dropdown);
|
705 |
+
},
|
706 |
+
reposition: function(that, target) {
|
707 |
+
var topElemHeight = 22;
|
708 |
+
var elemRect = target.getBoundingClientRect(), bodyRect = document.body.getBoundingClientRect(), topOffset = elemRect.top - bodyRect.top - (topElemHeight + 10);
|
709 |
+
leftOffset = elemRect.left - bodyRect.left + document.body.style.paddingLeft;
|
710 |
+
var htmlTop = parseInt(window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue("margin-top"));
|
711 |
+
htmlTop += parseInt(window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue("padding-top"));
|
712 |
+
topOffset += htmlTop;
|
713 |
+
that.searchObj.style.left = leftOffset - 5 + "px";
|
714 |
+
that.searchObj.style.top = topOffset + "px";
|
715 |
+
that.searchObj.style.width = target.offsetWidth + 10 + "px";
|
716 |
+
that.searchObj.getElementsByClassName("country")[0].style.marginBottom = target.offsetHeight + 10 + "px";
|
717 |
+
var activeClass = "c2a_active";
|
718 |
+
var activeElements = document.getElementsByClassName(activeClass);
|
719 |
+
for (var i = 0; i < activeElements.length; i++) {
|
720 |
+
activeElements[i].className = activeElements[i].className.replace(" " + activeClass, "");
|
721 |
+
}
|
722 |
+
target.className += " " + activeClass;
|
723 |
+
}
|
724 |
+
};
|
725 |
+
|
726 |
+
clickToAddress.prototype.preset = function(config) {
|
727 |
+
this.serviceReady = 0;
|
728 |
+
this.activeCountry = "";
|
729 |
+
this.hover = false;
|
730 |
+
this.visible = false;
|
731 |
+
this.focused = false;
|
732 |
+
this.hasContent = false;
|
733 |
+
this.keyboardHideInProgress = false;
|
734 |
+
this.coords = 0;
|
735 |
+
this.activeDom = {};
|
736 |
+
this.domLib = [];
|
737 |
+
this.searchResults = {};
|
738 |
+
this.searchObj = {};
|
739 |
+
this.selectorPos = -1;
|
740 |
+
this.activeInput = "init";
|
741 |
+
this.sid = 0;
|
742 |
+
this.cache = {};
|
743 |
+
this.cachePos = -1;
|
744 |
+
this.activeFilters = {};
|
745 |
+
this.lastSearch = "";
|
746 |
+
this.funcStore = {};
|
747 |
+
this.setCfg(config, "gfxMode", 1);
|
748 |
+
this.setCfg(config, "baseURL", "https://api.craftyclicks.co.uk/address/1.0", "relay");
|
749 |
+
if (this.baseURL[this.baseURL.length] != "/") {
|
750 |
+
this.baseURL += "/";
|
751 |
+
}
|
752 |
+
this.setCfg(config, "key", "xxxxx-xxxxx-xxxxx-xxxxx", "accessToken");
|
753 |
+
this.setCfg(config, "defaultCountry", "gbr");
|
754 |
+
this.setCfg(config, "enabledCountries", []);
|
755 |
+
this.setCfg(config, "style", {
|
756 |
+
ambient: "light",
|
757 |
+
accent: "default"
|
758 |
+
});
|
759 |
+
this.setCfg(config, "domMode", "name");
|
760 |
+
this.setCfg(config, "placeholders", true);
|
761 |
+
this.setCfg(config, "onResultSelected");
|
762 |
+
this.setCfg(config, "onCountryChange");
|
763 |
+
this.setCfg(config, "onSetCounty");
|
764 |
+
this.setCfg(config, "onError");
|
765 |
+
this.setCfg(config, "showLogo", true);
|
766 |
+
this.setCfg(config, "historyTools", true);
|
767 |
+
this.setCfg(config, "getIpLocation", true);
|
768 |
+
this.setCfg(config, "accessTokenOverride", {});
|
769 |
+
this.setupText(config.texts);
|
770 |
+
this.setCfg(config, "countryMatchWith", "iso_2");
|
771 |
+
this.setCfg(config, "tag", "");
|
772 |
+
this.setCfg(config, "cssPath", "cc_c2a.min.css");
|
773 |
+
this.setFingerPrint();
|
774 |
+
};
|
775 |
+
|
776 |
+
cc_debug = false;
|
777 |
+
|
778 |
+
clickToAddress.prototype.setupText = function(textCfg) {
|
779 |
+
this.texts = {
|
780 |
+
default_placeholder: "Start with post/zip code or street",
|
781 |
+
country_placeholder: "Type here to search for a country",
|
782 |
+
country_button: "Change Country",
|
783 |
+
generic_error: "An error occured. Please enter your address manually",
|
784 |
+
no_results: "No results found"
|
785 |
+
};
|
786 |
+
if (typeof textCfg != "undefined") {
|
787 |
+
var keys = Object.keys(this.texts);
|
788 |
+
for (var i = 0; i < keys.length; i++) {
|
789 |
+
if (typeof textCfg[keys[i]] != "undefined") {
|
790 |
+
this.texts[keys[i]] = textCfg[keys[i]];
|
791 |
+
}
|
792 |
+
}
|
793 |
+
}
|
794 |
+
};
|
795 |
+
|
796 |
+
clickToAddress.prototype.setCfg = function(config, name, defaultValue, cfgValue) {
|
797 |
+
if (typeof cfgValue == "undefined") {
|
798 |
+
cfgValue = name;
|
799 |
+
}
|
800 |
+
if (typeof config[cfgValue] != "undefined" && config[cfgValue] !== "") {
|
801 |
+
this[name] = config[cfgValue];
|
802 |
+
} else {
|
803 |
+
this[name] = defaultValue;
|
804 |
+
}
|
805 |
+
};
|
806 |
+
|
807 |
+
clickToAddress.prototype.setPlaceholder = function(country, target) {
|
808 |
+
if (this.activeInput != "init") {
|
809 |
+
target = this.activeInput;
|
810 |
+
}
|
811 |
+
if (this.placeholders && typeof target != "undefined") {
|
812 |
+
var text = this.texts.default_placeholder;
|
813 |
+
if (country) {
|
814 |
+
text = this.texts.country_placeholder;
|
815 |
+
}
|
816 |
+
target.setAttribute("placeholder", text);
|
817 |
+
}
|
818 |
+
};
|
819 |
+
|
820 |
+
clickToAddress.prototype.error = function(code, message) {
|
821 |
+
if (cc_debug) {
|
822 |
+
console.warn("CraftyClicks Debug Error Message: [" + code + "] " + message);
|
823 |
+
}
|
824 |
+
if (this.serviceReady == -1) {
|
825 |
+
this.errorObj.innerHTML = message;
|
826 |
+
} else {
|
827 |
+
this.errorObj.innerHTML = this.texts.generic_error;
|
828 |
+
}
|
829 |
+
this.errorObj.className = "c2a_error";
|
830 |
+
if (typeof this.onError != "undefined") {
|
831 |
+
this.onError(code, message);
|
832 |
+
}
|
833 |
+
};
|
834 |
+
|
835 |
+
clickToAddress.prototype.hideErrors = function() {
|
836 |
+
if (this.serviceReady != -1) {
|
837 |
+
this.errorObj.innerHTML = "";
|
838 |
+
this.errorObj.className = "c2a_error c2a_error_hidden";
|
839 |
+
}
|
840 |
+
};
|
841 |
+
|
842 |
+
clickToAddress.prototype.getFocus = function() {
|
843 |
+
if (this.activeInput != "init") this.activeInput.focus();
|
844 |
+
this.focused = true;
|
845 |
+
};
|
846 |
+
|
847 |
+
clickToAddress.prototype.loseFocus = function() {
|
848 |
+
if (this.activeInput != "init") this.activeInput.blur();
|
849 |
+
this.focused = false;
|
850 |
+
};
|
851 |
+
|
852 |
+
clickToAddress.prototype.clear = function() {
|
853 |
+
this.resultList.innerHTML = "";
|
854 |
+
this.sid = 0;
|
855 |
+
};
|
856 |
+
|
857 |
+
clickToAddress.prototype.show = function() {
|
858 |
+
this.searchObj.style.display = "block";
|
859 |
+
this.visible = true;
|
860 |
+
};
|
861 |
+
|
862 |
+
clickToAddress.prototype.hide = function(force_it) {
|
863 |
+
if (this.keyboardHideInProgress) {
|
864 |
+
this.keyboardHideInProgress = false;
|
865 |
+
return;
|
866 |
+
}
|
867 |
+
if (force_it || this.visible && !this.focused && !this.hover) {
|
868 |
+
this.searchObj.style.display = "none";
|
869 |
+
this.visible = false;
|
870 |
+
this.hover = false;
|
871 |
+
this.clear();
|
872 |
+
this.resetSelector();
|
873 |
+
this.setPlaceholder(0);
|
874 |
+
}
|
875 |
+
this.hideErrors();
|
876 |
+
};
|
877 |
+
|
878 |
+
clickToAddress.prototype.attach = function(dom) {
|
879 |
+
var domElements = {};
|
880 |
+
var objectArray = [ "search", "postcode", "town", "line_1", "line_2", "company", "county", "county_list", "country" ];
|
881 |
+
switch (this.domMode) {
|
882 |
+
case "id":
|
883 |
+
var quickGet = function(dom, obj_name) {
|
884 |
+
if (typeof dom[obj_name] == "string" && dom[obj_name] !== "") {
|
885 |
+
return document.getElementById(dom[obj_name]);
|
886 |
+
}
|
887 |
+
};
|
888 |
+
for (var i = 0; i < objectArray.length; i++) {
|
889 |
+
domElements[objectArray[i]] = quickGet(dom, objectArray[i]);
|
890 |
+
}
|
891 |
+
break;
|
892 |
+
|
893 |
+
case "class":
|
894 |
+
var quickGet = function(dom, obj_name) {
|
895 |
+
if (typeof dom[obj_name] == "string" && dom[obj_name] !== "") {
|
896 |
+
return document.getElementsByClassName(dom[obj_name])[0];
|
897 |
+
}
|
898 |
+
};
|
899 |
+
for (var i = 0; i < objectArray.length; i++) {
|
900 |
+
domElements[objectArray[i]] = quickGet(dom, objectArray[i]);
|
901 |
+
}
|
902 |
+
break;
|
903 |
+
|
904 |
+
case "name":
|
905 |
+
var quickGet = function(dom, obj_name) {
|
906 |
+
if (typeof dom[obj_name] == "string" && dom[obj_name] !== "") {
|
907 |
+
return document.getElementsByName(dom[obj_name])[0];
|
908 |
+
}
|
909 |
+
};
|
910 |
+
for (var i = 0; i < objectArray.length; i++) {
|
911 |
+
domElements[objectArray[i]] = quickGet(dom, objectArray[i]);
|
912 |
+
}
|
913 |
+
break;
|
914 |
+
|
915 |
+
case "object":
|
916 |
+
var quickGet = function(dom, obj_name) {
|
917 |
+
if (typeof dom[obj_name] == "object" && dom[obj_name] !== "") {
|
918 |
+
return dom[obj_name];
|
919 |
+
}
|
920 |
+
};
|
921 |
+
for (var i = 0; i < objectArray.length; i++) {
|
922 |
+
domElements[objectArray[i]] = quickGet(dom, objectArray[i]);
|
923 |
+
}
|
924 |
+
break;
|
925 |
+
}
|
926 |
+
var target = domElements.search;
|
927 |
+
if (target.getAttribute("cc_applied") == "true") {
|
928 |
+
throw "ClickToAddress already applied to this element!";
|
929 |
+
}
|
930 |
+
target.setAttribute("cc_applied", "true");
|
931 |
+
target.setAttribute("autocomplete", "off");
|
932 |
+
this.setPlaceholder(0, target);
|
933 |
+
var domLibId = this.domLib.length;
|
934 |
+
this.domLib.push(domElements);
|
935 |
+
var that = this;
|
936 |
+
ccEvent(target, "keydown", function(e) {
|
937 |
+
if (that.serviceReady == 0) return;
|
938 |
+
if (e.keyCode == 38 || e.keyCode == 40) {
|
939 |
+
e.preventDefault();
|
940 |
+
if (!that.hasContent) {
|
941 |
+
return;
|
942 |
+
}
|
943 |
+
that.moveSelector(e.keyCode == 40);
|
944 |
+
return;
|
945 |
+
}
|
946 |
+
});
|
947 |
+
ccEvent(target, "keyup", function(e) {
|
948 |
+
if (that.serviceReady == 0) return;
|
949 |
+
if (e.keyCode == 27) {
|
950 |
+
that.hide(true);
|
951 |
+
that.loseFocus();
|
952 |
+
that.resetSelector();
|
953 |
+
return;
|
954 |
+
}
|
955 |
+
var noActionKeys = [ 37, 38, 39, 40 ];
|
956 |
+
if (noActionKeys.indexOf(e.keyCode) != -1) {
|
957 |
+
return;
|
958 |
+
}
|
959 |
+
if (e.keyCode == 13) {
|
960 |
+
if (!that.hasContent || that.selectorPos < 0) {
|
961 |
+
return;
|
962 |
+
}
|
963 |
+
var elem = that.searchObj.getElementsByTagName("LI")[that.selectorPos];
|
964 |
+
if (that.sid == -1) {
|
965 |
+
that.selectCountry(elem.getAttribute("countryCode"));
|
966 |
+
} else {
|
967 |
+
that.select(elem);
|
968 |
+
}
|
969 |
+
return;
|
970 |
+
}
|
971 |
+
if (that.sid == -1) {
|
972 |
+
that.changeCountry(this.value);
|
973 |
+
} else {
|
974 |
+
that.activeFilters = {};
|
975 |
+
that.lastSearch = this.value;
|
976 |
+
var timeTrack = new Date().getTime() / 1e3;
|
977 |
+
that.sid = timeTrack;
|
978 |
+
var searchVal = this.value;
|
979 |
+
setTimeout(function() {
|
980 |
+
if (that.sidCheck(timeTrack)) {
|
981 |
+
if (searchVal !== "") {
|
982 |
+
that.search(searchVal, that.activeFilters, timeTrack);
|
983 |
+
that.cleanHistory();
|
984 |
+
} else {
|
985 |
+
that.clear();
|
986 |
+
}
|
987 |
+
}
|
988 |
+
}, 250);
|
989 |
+
that.activeDom = that.domLib[domLibId];
|
990 |
+
that.gfxModeTools.reposition(that, target);
|
991 |
+
}
|
992 |
+
});
|
993 |
+
ccEvent(target, "focus", function() {
|
994 |
+
that.onFocus(target);
|
995 |
+
});
|
996 |
+
ccEvent(target, "blur", function() {
|
997 |
+
if (that.serviceReady == 0) return;
|
998 |
+
that.focused = false;
|
999 |
+
that.hide();
|
1000 |
+
});
|
1001 |
+
if (target === document.activeElement) {
|
1002 |
+
this.onFocus(target);
|
1003 |
+
}
|
1004 |
+
};
|
1005 |
+
|
1006 |
+
clickToAddress.prototype.onFocus = function(target) {
|
1007 |
+
var that = this;
|
1008 |
+
if (that.serviceReady == 0) {
|
1009 |
+
setTimeout(function() {
|
1010 |
+
that.onFocus(target);
|
1011 |
+
}, 250);
|
1012 |
+
return;
|
1013 |
+
}
|
1014 |
+
var prestate = that.visible;
|
1015 |
+
that.gfxModeTools.reposition(that, target);
|
1016 |
+
that.activeInput = target;
|
1017 |
+
that.focused = true;
|
1018 |
+
that.show();
|
1019 |
+
if (target.value !== "" && !prestate) {
|
1020 |
+
that.search(target.value);
|
1021 |
+
}
|
1022 |
+
};
|
1023 |
+
|
1024 |
+
clickToAddress.prototype.resetSelector = function() {
|
1025 |
+
this.hasContent = false;
|
1026 |
+
this.selectorPos = -1;
|
1027 |
+
};
|
1028 |
+
|
1029 |
+
clickToAddress.prototype.moveSelector = function(goDown) {
|
1030 |
+
if (!this.visible) {
|
1031 |
+
return;
|
1032 |
+
}
|
1033 |
+
var elems = this.searchObj.getElementsByTagName("LI");
|
1034 |
+
if (goDown && this.selectorPos + 1 < elems.length) {
|
1035 |
+
this.selectorPos++;
|
1036 |
+
}
|
1037 |
+
if (!goDown && this.selectorPos - 1 >= 0) {
|
1038 |
+
this.selectorPos--;
|
1039 |
+
}
|
1040 |
+
for (var i = 0; i < elems.length; i++) {
|
1041 |
+
if (i != this.selectorPos) {
|
1042 |
+
elems[i].className = elems[i].className.replace(" active", "");
|
1043 |
+
} else {
|
1044 |
+
if (elems[i].className.indexOf("active") == -1) {
|
1045 |
+
elems[i].className = elems[i].className + " active";
|
1046 |
+
}
|
1047 |
+
}
|
1048 |
+
}
|
1049 |
+
var offset = 30 * (this.selectorPos + 1);
|
1050 |
+
var list = this.searchObj.getElementsByTagName("UL")[0];
|
1051 |
+
if (offset > list.offsetHeight + list.scrollTop) {
|
1052 |
+
list.scrollTop = offset - list.offsetHeight;
|
1053 |
+
}
|
1054 |
+
if (offset <= list.scrollTop) {
|
1055 |
+
list.scrollTop = offset - 30;
|
1056 |
+
}
|
1057 |
+
};
|
1058 |
+
|
1059 |
+
clickToAddress.prototype.showGeo = function() {
|
1060 |
+
this.searchObj.getElementsByClassName("geo")[0].style.display = "block";
|
1061 |
+
};
|
1062 |
+
|
1063 |
+
clickToAddress.prototype.hideKeyboard = function() {
|
1064 |
+
var that = this;
|
1065 |
+
that.keyboardHideInProgress = true;
|
1066 |
+
that.activeInput.setAttribute("readonly", "readonly");
|
1067 |
+
that.activeInput.setAttribute("disabled", "true");
|
1068 |
+
setTimeout(function() {
|
1069 |
+
that.activeInput.blur();
|
1070 |
+
that.activeInput.removeAttribute("readonly");
|
1071 |
+
that.activeInput.removeAttribute("disabled");
|
1072 |
+
}, 100);
|
1073 |
+
};
|
1074 |
+
|
1075 |
+
clickToAddress.prototype.getStyleSheet = function() {
|
1076 |
+
if (this.cssPath === false) {
|
1077 |
+
return;
|
1078 |
+
}
|
1079 |
+
var cssId = "crafty_css";
|
1080 |
+
if (!document.getElementById(cssId)) {
|
1081 |
+
var head = document.getElementsByTagName("head")[0];
|
1082 |
+
var link = document.createElement("link");
|
1083 |
+
link.id = cssId;
|
1084 |
+
link.rel = "stylesheet";
|
1085 |
+
link.type = "text/css";
|
1086 |
+
link.href = this.cssPath;
|
1087 |
+
link.media = "all";
|
1088 |
+
head.appendChild(link);
|
1089 |
+
}
|
1090 |
+
};
|
1091 |
+
|
1092 |
+
clickToAddress.prototype.setProgressBar = function(state) {
|
1093 |
+
var pgbar = this.searchObj.getElementsByClassName("progressBar")[0];
|
1094 |
+
switch (state) {
|
1095 |
+
case 0:
|
1096 |
+
pgbar.className = "progressBar action";
|
1097 |
+
pgbar.style.width = "50%";
|
1098 |
+
setTimeout(function() {
|
1099 |
+
if (pgbar.className == "progressBar action") {
|
1100 |
+
pgbar.className = "progressBar";
|
1101 |
+
pgbar.style.width = "0%";
|
1102 |
+
}
|
1103 |
+
}, 5e3);
|
1104 |
+
break;
|
1105 |
+
|
1106 |
+
case 1:
|
1107 |
+
pgbar.className = "progressBar finish";
|
1108 |
+
pgbar.style.width = "100%";
|
1109 |
+
setTimeout(function() {
|
1110 |
+
pgbar.className = "progressBar";
|
1111 |
+
pgbar.style.width = "0%";
|
1112 |
+
}, 2e3);
|
1113 |
+
break;
|
1114 |
+
|
1115 |
+
case 2:
|
1116 |
+
break;
|
1117 |
+
}
|
1118 |
+
};
|
package.xml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Crafty_Clicks_Clicktoaddress</name>
|
4 |
+
<version>0.5.0</version>
|
5 |
+
<stability>beta</stability>
|
6 |
+
<license uri="https://opensource.org/licenses/MIT">MIT License</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Predictive address auto-complete. Speeds up address form filling giving a faster checkout experience and improved address data quality.</summary>
|
10 |
+
<description>International address auto-complete
|
11 |
+

|
12 |
+
This extension provides address auto-complete functionality on all postal address forms in Magento - both on the shop front and in the admin panel.
|
13 |
+

|
14 |
+
Benefits
|
15 |
+

|
16 |
+
Faster checkout/registration experience - a boost for conversions
|
17 |
+
More accurate addresses captured - fewer missed deliveries</description>
|
18 |
+
<notes>- Initial release for our global address endpoint.</notes>
|
19 |
+
<authors><author><name>Gabor Suranyi</name><user>gabor</user><email>gabor@craftyclicks.co.uk</email></author></authors>
|
20 |
+
<date>2016-04-06</date>
|
21 |
+
<time>14:33:18</time>
|
22 |
+
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Craftyclicks"><dir name="C2a"><dir name="Block"><file name="Feedback.php" hash="a6cdfefcbf0e1016e86fb7ff539840da"/><file name="Gridlight.php" hash="3eeb13ebf0f5a0529f04a74456e6c6d2"/><file name="Integration.php" hash="fd9a1cfda3dece9a5f73e7780e8421dd"/><file name="Ordergrid.php" hash="dcd9f3fc32b8d18cbe818a58be4d66d7"/></dir><dir name="Helper"><file name="Data.php" hash="cab127b8e36bc60c6d1fd191b2cd2f2c"/></dir><dir name="Model"><file name="Address.php" hash="9e2d6ece83d4aedd9a1218b2023fdfaa"/><file name="Ambient.php" hash="f165ad641db7de86123107394aaee4a3"/><file name="Mode.php" hash="b443068ec106e4a31a0b60247d0a520f"/><dir name="Resource"><dir name="Address"><file name="Collection.php" hash="cc938718dbdb91443faf570a368a8144"/></dir><file name="Address.php" hash="844e3043e575b515d04e49a1f4541784"/></dir></dir><dir name="controllers"><file name="HashController.php" hash="dfd216a607538c94c1566c492c8cf068"/></dir><dir name="data"><dir name="craftyclicks_c2a_setup"><file name="data-upgrade-2.4.9-2.5.0.php" hash="aeca3eaad1229c41333e0cb1412e0a36"/></dir></dir><dir name="etc"><file name="config.xml" hash="33ed35145cd3ae723b41ac61123afc30"/><file name="config.xml~" hash="33ed35145cd3ae723b41ac61123afc30"/><file name="system.xml" hash="d76b1e2072c63b79b35f5ab5f1cd79a3"/><file name="system.xml~" hash="9e693fc1b04974bfb621c4176b899513"/></dir><dir name="sql"><dir name="craftyclicks_c2a_setup"><file name="install-0.5.0.php" hash="d8c8102ac06a84f00329b789ab7ed2c9"/></dir><dir name="craftyclicks_clicktoaddress_setup"><file name="install-1.0.0.php" hash="41a2f1c5692f981071ed5844d6f16cd2"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Craftyclicks_C2a.xml" hash="70ea298e8719f2e36adaf179a7614618"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="craftyclicks_c2a.xml" hash="d510a05473d878804a4dce701c134396"/></dir><dir name="template"><dir name="craftyclicks"><dir name="c2a"><file name="c2a_config.phtml" hash="cbec0d4cc4f19c5fd7133d0a02173fe3"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="craftyclicks_c2a.xml" hash="ba88fdb12be641b7e820721859f50568"/></dir><dir name="template"><dir name="craftyclicks"><dir name="c2a"><file name="c2a_config.phtml" hash="09c09e6d36cd2a0e9b7c8189be4fc0fd"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="craftyclicks"><dir name="c2a"><dir name="admin"><file name="enhance.js" hash="99cb87e69fc85aaadcd75ebc5dce7ec8"/></dir><file name="admin.js" hash="8257c18af09fec3d2be93d38f25fe9f8"/><file name="default.js" hash="07a2a2f19f3f493f9a8729f34af4efc8"/><dir name="lib"><file name="cc_c2a.min.js" hash="1d220b449af944c72fa153904a13dd6f"/></dir></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="craftyclicks"><dir name="c2a"><file name="cc_c2a.eot" hash="a282a1c5ba3fca326816c2d80171f616"/><file name="cc_c2a.min.css" hash="2e456806af35cb3e7becbff1c99a7577"/><file name="cc_c2a.svg" hash="63a63d1da047bbb9576addb748ac5c60"/><file name="cc_c2a.ttf" hash="60403a32780095f5c016ac4027dce698"/><file name="cc_c2a.woff" hash="ce680790197f576742e57c91209bef78"/><file name="enhance.css" hash="dda54390b1cab47079e073512dd73ba0"/><file name="flags.png" hash="532864aae05c78ed545214c84710fbcc"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="craftyclicks"><dir name="c2a"><file name="cc_c2a.eot" hash="a282a1c5ba3fca326816c2d80171f616"/><file name="cc_c2a.min.css" hash="2e456806af35cb3e7becbff1c99a7577"/><file name="cc_c2a.svg" hash="63a63d1da047bbb9576addb748ac5c60"/><file name="cc_c2a.ttf" hash="60403a32780095f5c016ac4027dce698"/><file name="cc_c2a.woff" hash="ce680790197f576742e57c91209bef78"/><file name="flags.png" hash="532864aae05c78ed545214c84710fbcc"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="app"><dir name="etc"><dir name="modules"><file name="CraftyClicks.xml" hash=""/></dir></dir></dir></target></contents>
|
23 |
+
<compatible/>
|
24 |
+
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
25 |
+
</package>
|
skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.eot
ADDED
Binary file
|
skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.min.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#cc_c2a.c2a_light{background-color:white;border:1px solid rgba(34,36,38,0.15);box-shadow:0 1px 2px 0 rgba(34,36,38,0.15)}#cc_c2a.c2a_light ul.c2a_results.hasContent{border-top:1px solid rgba(150,156,156,0.4);border-bottom:1px solid rgba(150,156,156,0.4)}#cc_c2a.c2a_light ul.c2a_results li{border-top:1px solid #fafafa}#cc_c2a.c2a_light ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_light ul.c2a_results li.active{color:white}#cc_c2a.c2a_light ul.c2a_results li:not(.deadend):hover span.light,#cc_c2a.c2a_light ul.c2a_results li.active span.light{color:white}#cc_c2a.c2a_light ul.c2a_results li span.light{color:#888}#cc_c2a.c2a_light .c2a_footer .progressBar.finish{background-color:white}#cc_c2a.c2a_light .c2a_error{background-color:#f44336;color:white}#cc_c2a.c2a_light .country .country_btn:hover span{color:white}#cc_c2a.c2a_light .history>div.disabled{cursor:default;color:white !important;background-color:white !important}#cc_c2a.c2a_light .history>div:hover{color:white}#cc_c2a.c2a_accent_default ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_default ul.c2a_results li.active{background-color:#63a2f1}#cc_c2a.c2a_accent_default .c2a_footer .progressBar{background-color:#63a2f1}#cc_c2a.c2a_accent_default .country .country_btn:hover{background-color:#63a2f1}#cc_c2a.c2a_accent_default .history>div:hover{background-color:#63a2f1}#cc_c2a.c2a_accent_red ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_red ul.c2a_results li.active{background-color:#f44336}#cc_c2a.c2a_accent_red .c2a_footer .progressBar{background-color:#f44336}#cc_c2a.c2a_accent_red .country .country_btn:hover{background-color:#f44336}#cc_c2a.c2a_accent_red .history>div:hover{background-color:#f44336}#cc_c2a.c2a_accent_pink ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_pink ul.c2a_results li.active{background-color:#e91e63}#cc_c2a.c2a_accent_pink .c2a_footer .progressBar{background-color:#e91e63}#cc_c2a.c2a_accent_pink .country .country_btn:hover{background-color:#e91e63}#cc_c2a.c2a_accent_pink .history>div:hover{background-color:#e91e63}#cc_c2a.c2a_accent_purple ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_purple ul.c2a_results li.active{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .c2a_footer .progressBar{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .country .country_btn:hover{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .history>div:hover{background-color:#9c27b0}#cc_c2a.c2a_accent_deepPurple ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_deepPurple ul.c2a_results li.active{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .c2a_footer .progressBar{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .country .country_btn:hover{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .history>div:hover{background-color:#673ab7}#cc_c2a.c2a_accent_indigo ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_indigo ul.c2a_results li.active{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .c2a_footer .progressBar{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .country .country_btn:hover{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .history>div:hover{background-color:#3f51b5}#cc_c2a.c2a_accent_blue ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_blue ul.c2a_results li.active{background-color:#2196f3}#cc_c2a.c2a_accent_blue .c2a_footer .progressBar{background-color:#2196f3}#cc_c2a.c2a_accent_blue .country .country_btn:hover{background-color:#2196f3}#cc_c2a.c2a_accent_blue .history>div:hover{background-color:#2196f3}#cc_c2a.c2a_accent_lightBlue ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lightBlue ul.c2a_results li.active{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .c2a_footer .progressBar{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .country .country_btn:hover{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .history>div:hover{background-color:#03a9f4}#cc_c2a.c2a_accent_cyan ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_cyan ul.c2a_results li.active{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .c2a_footer .progressBar{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .country .country_btn:hover{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .history>div:hover{background-color:#00bcd4}#cc_c2a.c2a_accent_teal ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_teal ul.c2a_results li.active{background-color:#009688}#cc_c2a.c2a_accent_teal .c2a_footer .progressBar{background-color:#009688}#cc_c2a.c2a_accent_teal .country .country_btn:hover{background-color:#009688}#cc_c2a.c2a_accent_teal .history>div:hover{background-color:#009688}#cc_c2a.c2a_accent_green ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_green ul.c2a_results li.active{background-color:#4caf50}#cc_c2a.c2a_accent_green .c2a_footer .progressBar{background-color:#4caf50}#cc_c2a.c2a_accent_green .country .country_btn:hover{background-color:#4caf50}#cc_c2a.c2a_accent_green .history>div:hover{background-color:#4caf50}#cc_c2a.c2a_accent_lightGreen ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lightGreen ul.c2a_results li.active{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .c2a_footer .progressBar{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .country .country_btn:hover{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .history>div:hover{background-color:#8bc34a}#cc_c2a.c2a_accent_lime ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lime ul.c2a_results li.active{background-color:#cddc39}#cc_c2a.c2a_accent_lime .c2a_footer .progressBar{background-color:#cddc39}#cc_c2a.c2a_accent_lime .country .country_btn:hover{background-color:#cddc39}#cc_c2a.c2a_accent_lime .history>div:hover{background-color:#cddc39}#cc_c2a.c2a_accent_yellow ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_yellow ul.c2a_results li.active{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .c2a_footer .progressBar{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .country .country_btn:hover{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .history>div:hover{background-color:#ffeb3b}#cc_c2a.c2a_accent_amber ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_amber ul.c2a_results li.active{background-color:#ffc107}#cc_c2a.c2a_accent_amber .c2a_footer .progressBar{background-color:#ffc107}#cc_c2a.c2a_accent_amber .country .country_btn:hover{background-color:#ffc107}#cc_c2a.c2a_accent_amber .history>div:hover{background-color:#ffc107}#cc_c2a.c2a_accent_orange ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_orange ul.c2a_results li.active{background-color:#ff9800}#cc_c2a.c2a_accent_orange .c2a_footer .progressBar{background-color:#ff9800}#cc_c2a.c2a_accent_orange .country .country_btn:hover{background-color:#ff9800}#cc_c2a.c2a_accent_orange .history>div:hover{background-color:#ff9800}#cc_c2a.c2a_accent_deepOrange ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_deepOrange ul.c2a_results li.active{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .c2a_footer .progressBar{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .country .country_btn:hover{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .history>div:hover{background-color:#ff5722}#cc_c2a.c2a_accent_brown ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_brown ul.c2a_results li.active{background-color:#795548}#cc_c2a.c2a_accent_brown .c2a_footer .progressBar{background-color:#795548}#cc_c2a.c2a_accent_brown .country .country_btn:hover{background-color:#795548}#cc_c2a.c2a_accent_brown .history>div:hover{background-color:#795548}#cc_c2a.c2a_accent_grey ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_grey ul.c2a_results li.active{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .c2a_footer .progressBar{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .country .country_btn:hover{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .history>div:hover{background-color:#9e9e9e}#cc_c2a.c2a_accent_blueGrey ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_blueGrey ul.c2a_results li.active{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .c2a_footer .progressBar{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .country .country_btn:hover{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .history>div:hover{background-color:#607d8b}
|
2 |
+
#cc_c2a{cursor:default;width:200px;display:none;position:absolute;border-radius:5px;overflow:hidden;z-index:1000}#cc_c2a ul.c2a_results{list-style:none;margin:0px;padding:0px;max-height:210px;overflow-y:auto}#cc_c2a ul.c2a_results li{margin:0px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:pointer;height:30px !important;line-height:1.25em;padding:0.5em 0.5em 0.5em 1em;transition:background-color .15s linear}#cc_c2a ul.c2a_results li:not(.deadend):hover,#cc_c2a ul.c2a_results li.active{color:white}#cc_c2a ul.c2a_results li:not(.deadend):hover span.light,#cc_c2a ul.c2a_results li.active span.light{color:white}#cc_c2a ul.c2a_results li>div{max-width:95%;padding-right:2%;float:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#cc_c2a ul.c2a_results li.filter>div{max-width:90%}#cc_c2a ul.c2a_results li.filter i{float:right}#cc_c2a ul.c2a_results li span.light{font-style:italic;margin-left:8px}#cc_c2a ul.c2a_results li.deadend{font-weight:bold;cursor:default}#cc_c2a ul.c2a_results li span.flag{display:inline-block;margin-right:12px}#cc_c2a .c2a_footer{width:100%;line-height:26px;min-height:30px;vertical-align:middle;position:relative}#cc_c2a .c2a_footer.c2a_footer_min{min-height:auto;border-top:none}#cc_c2a .c2a_footer .c2a_logo{float:left;background-image:url('https://gabor_pc.craftyclicks.lan/thunder/img/c2a_mini.png');background-repeat:no-repeat;background-size:auto 100%;width:50%;height:12px;margin:7px}#cc_c2a .c2a_footer .geo{float:right;background-image:url('https://gabor_pc.craftyclicks.lan/thunder/img/geo.png');background-repeat:no-repeat;width:20px;height:20px;margin:3px;display:none}#cc_c2a .c2a_footer .progressBar{clear:both;width:0%;height:2px;-webkit-transition:width 0s,background-color 0s;transition:width 0s,background-color 0s}#cc_c2a .c2a_footer .progressBar.action{-webkit-transition:width .5s,background-color 0s;transition:width .5s,background-color 0s}#cc_c2a .c2a_footer .progressBar.finish{-webkit-transition:width .5s,background-color 4s;transition:width .5s,background-color 4s}#cc_c2a .c2a_error{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 15px;margin:5px;font-weight:bold;border-radius:5px}#cc_c2a .c2a_error.c2a_error_hidden{display:none}#cc_c2a .country{height:24px;margin:3px;line-height:24px}#cc_c2a .country .country_btn{position:relative;float:left;margin-right:5px;cursor:pointer;height:24px;width:30px;border:1px solid transparent}#cc_c2a .country .country_btn .country_img{margin:5px 6px}#cc_c2a .country .country_btn:hover{border-radius:2px}#cc_c2a .history{float:right}#cc_c2a .history>div{position:relative;float:left;cursor:pointer;height:24px;width:24px;border:1px solid transparent;text-align:center;border-radius:2px}#cc_c2a .history>div:first-child{margin-right:5px}#cc_c2a.c2a_mode1{border-top-left-radius:0px;border-top-right-radius:0px}#cc_c2a.c2a_mode1 .c2a_footer .country{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;position:relative}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn{width:auto}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn .country_img{float:left}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn span{margin-right:0.5em;float:left}#cc_c2a.c2a_mode2 .country{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0px 5px;margin-left:0px;position:relative}#cc_c2a.c2a_mode2 .country .country_btn{width:auto}#cc_c2a.c2a_mode2 .country .country_btn .country_img{float:left}#cc_c2a.c2a_mode2 .country .country_btn span{margin-right:0.5em;float:left}.c2a_active{position:relative;z-index:9999999!important;opacity:1.0!important}
|
3 |
+
@font-face{font-family:"CraftyIcons";src:url("cc_c2a.eot");src:url("cc_c2a.eot?#iefix") format("embedded-opentype"),url("cc_c2a.woff") format("woff"),url("cc_c2a.ttf") format("truetype"),url("cc_c2a.svg#CraftyIcons") format("svg");font-weight:normal;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:"CraftyIcons";src:url("cc_c2a.svg") format("svg")}}[class^="craftyicons-"]:before,[class*=" craftyicons-"]:before,[class^="craftyicons-"]:after,[class*=" craftyicons-"]:after{font-family:CraftyIcons;font-style:normal}.craftyicons-forward:before{content:"\f100"}.craftyicons-back:before{content:"\f101"}.craftyicons-caret:before{content:"\f102"}.craftyicons-fw2:before{content:"\f103"}.craftyicons-flip{display:inline-block;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}
|
4 |
+
.infoBar{display:none}.infoBar.infoActive{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 15px;margin:5px;font-weight:bold;border-radius:5px;background:#459fd3;background:-moz-linear-gradient(-45deg, #459fd3 0, #0892cd 100%);background:-webkit-linear-gradient(-45deg, #459fd3 0, #0892cd 100%);background:linear-gradient(135deg, #459fd3 0, #0892cd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#459fd3', endColorstr='#0892cd', GradientType=1);display:block;color:white}.infoBar.infoActive h5{font-size:20px;margin:0px;margin-bottom:10px}.infoBar.infoActive p{margin:0px;line-height:1.2em}
|
5 |
+
|
6 |
+
[class^="flag"],[class*=" flag"]{display:inline-block;line-height:11px;background-image:url("flags.png");background-position:-208px -188px;width:16px;height:11px;background-repeat:no-repeat}.flag-xk{background-position:-208px -177px}.flag-zw{background-position:0px 0px}.flag-zm{background-position:-16px 0}.flag-za{background-position:0 -11px}.flag-yt{background-position:-16px -11px}.flag-ye{background-position:-32px 0}.flag-ws{background-position:-32px -11px}.flag-wf{background-position:0 -22px}.flag-wales{background-position:-16px -22px}.flag-vu{background-position:-32px -22px}.flag-vn{background-position:0 -33px}.flag-vi{background-position:-16px -33px}.flag-vg{background-position:-32px -33px}.flag-ve{background-position:-48px 0}.flag-vc{background-position:-48px -11px}.flag-va{background-position:-48px -22px}.flag-uz{background-position:-48px -33px}.flag-uy{background-position:0 -44px}.flag-us{background-position:-16px -44px}.flag-um{background-position:-16px -44px}.flag-ug{background-position:-32px -44px}.flag-ua{background-position:-48px -44px}.flag-tz{background-position:-64px 0}.flag-tw{background-position:-64px -11px}.flag-tv{background-position:-64px -22px}.flag-tt{background-position:-64px -33px}.flag-tr{background-position:-64px -44px}.flag-to{background-position:0 -55px}.flag-tn{background-position:-16px -55px}.flag-tm{background-position:-32px -55px}.flag-tl{background-position:-48px -55px}.flag-tk{background-position:-64px -55px}.flag-tj{background-position:0 -66px}.flag-th{background-position:-16px -66px}.flag-tg{background-position:-32px -66px}.flag-tf{background-position:-48px -66px}.flag-td{background-position:-64px -66px}.flag-tc{background-position:-80px 0}.flag-sz{background-position:-80px -11px}.flag-sy{background-position:-80px -22px}.flag-sx{background-position:-80px -33px}.flag-sv{background-position:-80px -44px}.flag-st{background-position:-80px -55px}.flag-ss{background-position:-80px -66px}.flag-sr{background-position:0 -77px}.flag-so{background-position:-16px -77px}.flag-sn{background-position:-32px -77px}.flag-sm{background-position:-48px -77px}.flag-sl{background-position:-64px -77px}.flag-sk{background-position:-80px -77px}.flag-si{background-position:-96px 0}.flag-sh{background-position:-96px -11px}.flag-sg{background-position:-96px -22px}.flag-se{background-position:-96px -33px}.flag-sd{background-position:-96px -44px}.flag-scotland{background-position:-96px -55px}.flag-sc{background-position:-96px -66px}.flag-sb{background-position:-96px -77px}.flag-sa{background-position:0 -88px}.flag-rw{background-position:-16px -88px}.flag-ru{background-position:-32px -88px}.flag-rs{background-position:-48px -88px}.flag-ro{background-position:-64px -88px}.flag-qa{background-position:-80px -88px}.flag-py{background-position:-96px -88px}.flag-pw{background-position:0 -99px}.flag-pt{background-position:-16px -99px}.flag-ps{background-position:-32px -99px}.flag-pr{background-position:-48px -99px}.flag-pn{background-position:-64px -99px}.flag-pm{background-position:-80px -99px}.flag-pl{background-position:-96px -99px}.flag-pk{background-position:-112px 0}.flag-ph{background-position:-112px -11px}.flag-pg{background-position:-112px -22px}.flag-pf{background-position:-112px -33px}.flag-pe{background-position:-112px -44px}.flag-pa{background-position:-112px -55px}.flag-om{background-position:-112px -66px}.flag-nz{background-position:-112px -77px}.flag-nu{background-position:-112px -88px}.flag-nr{background-position:-112px -99px}.flag-no{background-position:0 -110px}.flag-bv{background-position:0 -110px}.flag-sj{background-position:0 -110px}.flag-nl{background-position:-16px -110px}.flag-ni{background-position:-32px -110px}.flag-ng{background-position:-48px -110px}.flag-nf{background-position:-64px -110px}.flag-ne{background-position:-80px -110px}.flag-nc{background-position:-96px -110px}.flag-na{background-position:-112px -110px}.flag-mz{background-position:-128px 0}.flag-my{background-position:-128px -11px}.flag-mx{background-position:-128px -22px}.flag-mw{background-position:-128px -33px}.flag-mv{background-position:-128px -44px}.flag-mu{background-position:-128px -55px}.flag-mt{background-position:-128px -66px}.flag-ms{background-position:-128px -77px}.flag-mr{background-position:-128px -88px}.flag-mq{background-position:-128px -99px}.flag-mp{background-position:-128px -110px}.flag-mo{background-position:0 -121px}.flag-mn{background-position:-16px -121px}.flag-mm{background-position:-32px -121px}.flag-ml{background-position:-48px -121px}.flag-mk{background-position:-64px -121px}.flag-mh{background-position:-80px -121px}.flag-mg{background-position:-96px -121px}.flag-me{background-position:0 -132px;width:16px;height:12px}.flag-md{background-position:-112px -121px}.flag-mc{background-position:-128px -121px}.flag-ma{background-position:-16px -132px}.flag-ly{background-position:-32px -132px}.flag-lv{background-position:-48px -132px}.flag-lu{background-position:-64px -132px}.flag-lt{background-position:-80px -132px}.flag-ls{background-position:-96px -132px}.flag-lr{background-position:-112px -132px}.flag-lk{background-position:-128px -132px}.flag-li{background-position:-144px 0}.flag-lc{background-position:-144px -11px}.flag-lb{background-position:-144px -22px}.flag-la{background-position:-144px -33px}.flag-kz{background-position:-144px -44px}.flag-ky{background-position:-144px -55px}.flag-kw{background-position:-144px -66px}.flag-kr{background-position:-144px -77px}.flag-kp{background-position:-144px -88px}.flag-kn{background-position:-144px -99px}.flag-km{background-position:-144px -110px}.flag-ki{background-position:-144px -121px}.flag-kh{background-position:-144px -132px}.flag-kg{background-position:0 -144px}.flag-ke{background-position:-16px -144px}.flag-jp{background-position:-32px -144px}.flag-jo{background-position:-48px -144px}.flag-jm{background-position:-64px -144px}.flag-je{background-position:-80px -144px}.flag-it{background-position:-96px -144px}.flag-is{background-position:-112px -144px}.flag-ir{background-position:-128px -144px}.flag-iq{background-position:-144px -144px}.flag-io{background-position:-160px 0}.flag-in{background-position:-160px -11px}.flag-im{background-position:-160px -22px;width:16px;height:9px}.flag-il{background-position:-160px -31px}.flag-ie{background-position:-160px -42px}.flag-id{background-position:-160px -53px}.flag-hu{background-position:-160px -64px}.flag-ht{background-position:-160px -75px}.flag-hr{background-position:-160px -86px}.flag-hn{background-position:-160px -97px}.flag-hk{background-position:-160px -108px}.flag-gy{background-position:-160px -119px}.flag-gw{background-position:-160px -130px}.flag-gu{background-position:-160px -141px}.flag-gt{background-position:0 -155px}.flag-gs{background-position:-16px -155px}.flag-gr{background-position:-32px -155px}.flag-gq{background-position:-48px -155px}.flag-gp{background-position:-64px -155px}.flag-gn{background-position:-80px -155px}.flag-gm{background-position:-96px -155px}.flag-gl{background-position:-112px -155px}.flag-gi{background-position:-128px -155px}.flag-gh{background-position:-144px -155px}.flag-gg{background-position:-160px -155px}.flag-ge{background-position:-176px 0}.flag-gd{background-position:-176px -11px}.flag-gb{background-position:-176px -22px}.flag-ga{background-position:-176px -33px}.flag-fr{background-position:-176px -44px}.flag-gf{background-position:-176px -44px}.flag-re{background-position:-176px -44px}.flag-mf{background-position:-176px -44px}.flag-bl{background-position:-176px -44px}.flag-fo{background-position:-176px -55px}.flag-fm{background-position:-176px -66px}.flag-fk{background-position:-176px -77px}.flag-fj{background-position:-176px -88px}.flag-fi{background-position:-176px -99px}.flag-fam{background-position:-176px -110px}.flag-eu{background-position:-176px -121px}.flag-et{background-position:-176px -132px}.flag-es{background-position:-176px -143px}.flag-er{background-position:-176px -154px}.flag-england{background-position:0 -166px}.flag-eh{background-position:-16px -166px}.flag-eg{background-position:-32px -166px}.flag-ee{background-position:-48px -166px}.flag-ec{background-position:-64px -166px}.flag-dz{background-position:-80px -166px}.flag-do{background-position:-96px -166px}.flag-dm{background-position:-112px -166px}.flag-dk{background-position:-128px -166px}.flag-dj{background-position:-144px -166px}.flag-de{background-position:-160px -166px}.flag-cz{background-position:-176px -166px}.flag-cy{background-position:0 -177px}.flag-cx{background-position:-16px -177px}.flag-cw{background-position:-32px -177px}.flag-cv{background-position:-48px -177px}.flag-cu{background-position:-64px -177px}.flag-cs{background-position:-80px -177px}.flag-cr{background-position:-96px -177px}.flag-co{background-position:-112px -177px}.flag-cn{background-position:-128px -177px}.flag-cm{background-position:-144px -177px}.flag-cl{background-position:-160px -177px}.flag-ck{background-position:-176px -177px}.flag-ci{background-position:-192px 0}.flag-cg{background-position:-192px -11px}.flag-cf{background-position:-192px -22px}.flag-cd{background-position:-192px -33px}.flag-cc{background-position:-192px -44px}.flag-catalonia{background-position:-192px -55px}.flag-ca{background-position:-192px -66px}.flag-bz{background-position:-192px -77px}.flag-by{background-position:-192px -88px}.flag-bw{background-position:-192px -99px}.flag-bt{background-position:-192px -110px}.flag-bs{background-position:-192px -121px}.flag-br{background-position:-192px -132px}.flag-bq{background-position:-192px -143px}.flag-bo{background-position:-192px -154px}.flag-bn{background-position:-192px -165px}.flag-bm{background-position:-192px -176px}.flag-bj{background-position:0 -188px}.flag-bi{background-position:-16px -188px}.flag-bh{background-position:-32px -188px}.flag-bg{background-position:-48px -188px}.flag-bf{background-position:-64px -188px}.flag-be{background-position:-80px -188px}.flag-bd{background-position:-96px -188px}.flag-bb{background-position:-112px -188px}.flag-ba{background-position:-128px -188px}.flag-az{background-position:-144px -188px}.flag-ax{background-position:-160px -188px}.flag-aw{background-position:-176px -188px}.flag-au{background-position:-192px -188px}.flag-hm{background-position:-192px -188px}.flag-at{background-position:-208px 0}.flag-as{background-position:-208px -11px}.flag-ar{background-position:-208px -22px}.flag-ao{background-position:-208px -33px}.flag-an{background-position:-208px -44px}.flag-am{background-position:-208px -55px}.flag-al{background-position:-208px -66px}.flag-ai{background-position:-208px -77px}.flag-ag{background-position:-208px -88px}.flag-af{background-position:-208px -99px}.flag-ae{background-position:-208px -110px}.flag-ad{background-position:-208px -121px}.flag-np{background-position:-208px -132px;width:9px;height:11px}.flag-ch{background-position:-208px -143px;width:11px;height:11px}
|
skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.svg
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<!--
|
4 |
+
2016-3-17: Created.
|
5 |
+
-->
|
6 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
7 |
+
<metadata>
|
8 |
+
Created by FontForge 20120731 at Thu Mar 17 13:10:34 2016
|
9 |
+
By Apache
|
10 |
+
Created by Apache with FontForge 2.0 (http://fontforge.sf.net)
|
11 |
+
</metadata>
|
12 |
+
<defs>
|
13 |
+
<font id="Flaticon" horiz-adv-x="512" >
|
14 |
+
<font-face
|
15 |
+
font-family="Flaticon"
|
16 |
+
font-weight="500"
|
17 |
+
font-stretch="normal"
|
18 |
+
units-per-em="512"
|
19 |
+
panose-1="2 0 6 3 0 0 0 0 0 0"
|
20 |
+
ascent="448"
|
21 |
+
descent="-64"
|
22 |
+
bbox="0 -63.9998 512 448"
|
23 |
+
underline-thickness="25.6"
|
24 |
+
underline-position="-51.2"
|
25 |
+
unicode-range="U+0020-F103"
|
26 |
+
/>
|
27 |
+
<missing-glyph />
|
28 |
+
<glyph glyph-name="space" unicode=" " horiz-adv-x="200"
|
29 |
+
/>
|
30 |
+
<glyph glyph-name="uniF101" unicode=""
|
31 |
+
d="M512 312.007v-240.014c0 -4.18848 -1.72461 -8.35254 -4.68652 -11.3145s-7.125 -4.68652 -11.3145 -4.68652h-224.013v-104.006c-0.0126953 -6.27539 -4.08301 -12.3545 -9.88184 -14.7539c-5.79688 -2.40039 -12.9756 -0.976562 -17.4189 3.4541l-240.014 240.014
|
32 |
+
c-2.95312 2.95996 -4.67188 7.11914 -4.67188 11.2998s1.71875 8.33789 4.67188 11.2998l240.014 240.014c4.44336 4.43066 11.6201 5.85449 17.4189 3.4541c5.79883 -2.39941 9.86914 -8.47852 9.88184 -14.7539v-104.006h224.013
|
33 |
+
c4.18945 0 8.35254 -1.72461 11.3145 -4.68652s4.68652 -7.12598 4.68652 -11.3145z" />
|
34 |
+
<glyph glyph-name="uniF103" unicode=""
|
35 |
+
d="M500.572 219.583c15.2373 -15.2305 15.2373 -39.9355 0.000976562 -55.165l-212.053 -212.05c-7.45703 -7.46875 -17.4395 -11.4297 -27.5918 -11.4297c-5.0293 0 -10.0938 0.970703 -14.9141 2.97266c-14.582 6.03711 -24.0869 20.2568 -24.0869 36.0381v74.2959
|
36 |
+
h-182.917c-21.5439 0 -39.0107 17.4658 -39.0107 39.0098v197.49c0 21.543 17.4668 39.0107 39.0107 39.0107h182.917v74.2959c0 15.7822 9.50488 30.002 24.0869 36.0381c14.5723 6.03906 31.3623 2.70508 42.5049 -8.45703z" />
|
37 |
+
<glyph glyph-name="uniF102" unicode=""
|
38 |
+
d="M392.723 219.183c8.11426 -8.11426 11.3594 -16.2285 11.3594 -27.5879c0 -9.7373 -3.24512 -19.4746 -11.3594 -27.5889l-215.835 -215.835c-16.2285 -16.2275 -40.5703 -16.2275 -56.7988 0c-16.2285 16.2285 -16.2285 38.9482 0 55.1758l188.247 188.248
|
39 |
+
l-188.247 188.247c-16.2285 16.2275 -16.2285 38.9473 0 55.1758c8.11426 8.11426 17.8506 12.9824 27.5879 12.9824s21.0967 -4.86816 29.2109 -12.9824z" />
|
40 |
+
<glyph glyph-name="uniF100" unicode=""
|
41 |
+
d="M0 71.9932v240.014c0 4.18848 1.72461 8.35059 4.68652 11.3145c2.96191 2.96191 7.125 4.68652 11.3145 4.68652h224.013v104.006c0.0126953 6.27539 4.08301 12.3545 9.88184 14.7539c5.79688 2.40039 12.9756 0.976562 17.4189 -3.4541l240.014 -240.014
|
42 |
+
c2.95312 -2.95996 4.67188 -7.11914 4.67188 -11.2998s-1.71875 -8.33789 -4.67188 -11.2998l-240.014 -240.014c-4.44336 -4.43066 -11.6221 -5.85449 -17.4189 -3.4541c-5.79688 2.39941 -9.86914 8.47852 -9.88184 14.7539v104.006h-224.013
|
43 |
+
c-4.18945 0 -8.35254 1.72461 -11.3145 4.68652s-4.68652 7.12598 -4.68652 11.3145z" />
|
44 |
+
</font>
|
45 |
+
</defs></svg>
|
skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.ttf
ADDED
Binary file
|
skin/adminhtml/default/default/css/craftyclicks/c2a/cc_c2a.woff
ADDED
Binary file
|
skin/adminhtml/default/default/css/craftyclicks/c2a/enhance.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.color-cube{
|
2 |
+
height: 20px;
|
3 |
+
width: 20px;
|
4 |
+
margin: 2px;
|
5 |
+
float: left;
|
6 |
+
border: 2px solid white;
|
7 |
+
}
|
8 |
+
.color-cube:hover{
|
9 |
+
border-color: #63a2f1;
|
10 |
+
}
|
11 |
+
.color-cube.active{
|
12 |
+
border-color: black;
|
13 |
+
}
|
skin/adminhtml/default/default/css/craftyclicks/c2a/flags.png
ADDED
Binary file
|
skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.eot
ADDED
Binary file
|
skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.min.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#cc_c2a.c2a_light{background-color:white;border:1px solid rgba(34,36,38,0.15);box-shadow:0 1px 2px 0 rgba(34,36,38,0.15)}#cc_c2a.c2a_light ul.c2a_results.hasContent{border-top:1px solid rgba(150,156,156,0.4);border-bottom:1px solid rgba(150,156,156,0.4)}#cc_c2a.c2a_light ul.c2a_results li{border-top:1px solid #fafafa}#cc_c2a.c2a_light ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_light ul.c2a_results li.active{color:white}#cc_c2a.c2a_light ul.c2a_results li:not(.deadend):hover span.light,#cc_c2a.c2a_light ul.c2a_results li.active span.light{color:white}#cc_c2a.c2a_light ul.c2a_results li span.light{color:#888}#cc_c2a.c2a_light .c2a_footer .progressBar.finish{background-color:white}#cc_c2a.c2a_light .c2a_error{background-color:#f44336;color:white}#cc_c2a.c2a_light .country .country_btn:hover span{color:white}#cc_c2a.c2a_light .history>div.disabled{cursor:default;color:white !important;background-color:white !important}#cc_c2a.c2a_light .history>div:hover{color:white}#cc_c2a.c2a_accent_default ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_default ul.c2a_results li.active{background-color:#63a2f1}#cc_c2a.c2a_accent_default .c2a_footer .progressBar{background-color:#63a2f1}#cc_c2a.c2a_accent_default .country .country_btn:hover{background-color:#63a2f1}#cc_c2a.c2a_accent_default .history>div:hover{background-color:#63a2f1}#cc_c2a.c2a_accent_red ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_red ul.c2a_results li.active{background-color:#f44336}#cc_c2a.c2a_accent_red .c2a_footer .progressBar{background-color:#f44336}#cc_c2a.c2a_accent_red .country .country_btn:hover{background-color:#f44336}#cc_c2a.c2a_accent_red .history>div:hover{background-color:#f44336}#cc_c2a.c2a_accent_pink ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_pink ul.c2a_results li.active{background-color:#e91e63}#cc_c2a.c2a_accent_pink .c2a_footer .progressBar{background-color:#e91e63}#cc_c2a.c2a_accent_pink .country .country_btn:hover{background-color:#e91e63}#cc_c2a.c2a_accent_pink .history>div:hover{background-color:#e91e63}#cc_c2a.c2a_accent_purple ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_purple ul.c2a_results li.active{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .c2a_footer .progressBar{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .country .country_btn:hover{background-color:#9c27b0}#cc_c2a.c2a_accent_purple .history>div:hover{background-color:#9c27b0}#cc_c2a.c2a_accent_deepPurple ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_deepPurple ul.c2a_results li.active{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .c2a_footer .progressBar{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .country .country_btn:hover{background-color:#673ab7}#cc_c2a.c2a_accent_deepPurple .history>div:hover{background-color:#673ab7}#cc_c2a.c2a_accent_indigo ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_indigo ul.c2a_results li.active{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .c2a_footer .progressBar{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .country .country_btn:hover{background-color:#3f51b5}#cc_c2a.c2a_accent_indigo .history>div:hover{background-color:#3f51b5}#cc_c2a.c2a_accent_blue ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_blue ul.c2a_results li.active{background-color:#2196f3}#cc_c2a.c2a_accent_blue .c2a_footer .progressBar{background-color:#2196f3}#cc_c2a.c2a_accent_blue .country .country_btn:hover{background-color:#2196f3}#cc_c2a.c2a_accent_blue .history>div:hover{background-color:#2196f3}#cc_c2a.c2a_accent_lightBlue ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lightBlue ul.c2a_results li.active{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .c2a_footer .progressBar{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .country .country_btn:hover{background-color:#03a9f4}#cc_c2a.c2a_accent_lightBlue .history>div:hover{background-color:#03a9f4}#cc_c2a.c2a_accent_cyan ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_cyan ul.c2a_results li.active{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .c2a_footer .progressBar{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .country .country_btn:hover{background-color:#00bcd4}#cc_c2a.c2a_accent_cyan .history>div:hover{background-color:#00bcd4}#cc_c2a.c2a_accent_teal ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_teal ul.c2a_results li.active{background-color:#009688}#cc_c2a.c2a_accent_teal .c2a_footer .progressBar{background-color:#009688}#cc_c2a.c2a_accent_teal .country .country_btn:hover{background-color:#009688}#cc_c2a.c2a_accent_teal .history>div:hover{background-color:#009688}#cc_c2a.c2a_accent_green ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_green ul.c2a_results li.active{background-color:#4caf50}#cc_c2a.c2a_accent_green .c2a_footer .progressBar{background-color:#4caf50}#cc_c2a.c2a_accent_green .country .country_btn:hover{background-color:#4caf50}#cc_c2a.c2a_accent_green .history>div:hover{background-color:#4caf50}#cc_c2a.c2a_accent_lightGreen ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lightGreen ul.c2a_results li.active{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .c2a_footer .progressBar{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .country .country_btn:hover{background-color:#8bc34a}#cc_c2a.c2a_accent_lightGreen .history>div:hover{background-color:#8bc34a}#cc_c2a.c2a_accent_lime ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_lime ul.c2a_results li.active{background-color:#cddc39}#cc_c2a.c2a_accent_lime .c2a_footer .progressBar{background-color:#cddc39}#cc_c2a.c2a_accent_lime .country .country_btn:hover{background-color:#cddc39}#cc_c2a.c2a_accent_lime .history>div:hover{background-color:#cddc39}#cc_c2a.c2a_accent_yellow ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_yellow ul.c2a_results li.active{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .c2a_footer .progressBar{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .country .country_btn:hover{background-color:#ffeb3b}#cc_c2a.c2a_accent_yellow .history>div:hover{background-color:#ffeb3b}#cc_c2a.c2a_accent_amber ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_amber ul.c2a_results li.active{background-color:#ffc107}#cc_c2a.c2a_accent_amber .c2a_footer .progressBar{background-color:#ffc107}#cc_c2a.c2a_accent_amber .country .country_btn:hover{background-color:#ffc107}#cc_c2a.c2a_accent_amber .history>div:hover{background-color:#ffc107}#cc_c2a.c2a_accent_orange ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_orange ul.c2a_results li.active{background-color:#ff9800}#cc_c2a.c2a_accent_orange .c2a_footer .progressBar{background-color:#ff9800}#cc_c2a.c2a_accent_orange .country .country_btn:hover{background-color:#ff9800}#cc_c2a.c2a_accent_orange .history>div:hover{background-color:#ff9800}#cc_c2a.c2a_accent_deepOrange ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_deepOrange ul.c2a_results li.active{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .c2a_footer .progressBar{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .country .country_btn:hover{background-color:#ff5722}#cc_c2a.c2a_accent_deepOrange .history>div:hover{background-color:#ff5722}#cc_c2a.c2a_accent_brown ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_brown ul.c2a_results li.active{background-color:#795548}#cc_c2a.c2a_accent_brown .c2a_footer .progressBar{background-color:#795548}#cc_c2a.c2a_accent_brown .country .country_btn:hover{background-color:#795548}#cc_c2a.c2a_accent_brown .history>div:hover{background-color:#795548}#cc_c2a.c2a_accent_grey ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_grey ul.c2a_results li.active{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .c2a_footer .progressBar{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .country .country_btn:hover{background-color:#9e9e9e}#cc_c2a.c2a_accent_grey .history>div:hover{background-color:#9e9e9e}#cc_c2a.c2a_accent_blueGrey ul.c2a_results li:not(.deadend):hover,#cc_c2a.c2a_accent_blueGrey ul.c2a_results li.active{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .c2a_footer .progressBar{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .country .country_btn:hover{background-color:#607d8b}#cc_c2a.c2a_accent_blueGrey .history>div:hover{background-color:#607d8b}
|
2 |
+
#cc_c2a{cursor:default;width:200px;display:none;position:absolute;border-radius:5px;overflow:hidden;z-index:1000}#cc_c2a ul.c2a_results{list-style:none;margin:0px;padding:0px;max-height:210px;overflow-y:auto}#cc_c2a ul.c2a_results li{margin:0px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:pointer;height:30px !important;line-height:1.25em;padding:0.5em 0.5em 0.5em 1em;transition:background-color .15s linear}#cc_c2a ul.c2a_results li:not(.deadend):hover,#cc_c2a ul.c2a_results li.active{color:white}#cc_c2a ul.c2a_results li:not(.deadend):hover span.light,#cc_c2a ul.c2a_results li.active span.light{color:white}#cc_c2a ul.c2a_results li>div{max-width:95%;padding-right:2%;float:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#cc_c2a ul.c2a_results li.filter>div{max-width:90%}#cc_c2a ul.c2a_results li.filter i{float:right}#cc_c2a ul.c2a_results li span.light{font-style:italic;margin-left:8px}#cc_c2a ul.c2a_results li.deadend{font-weight:bold;cursor:default}#cc_c2a ul.c2a_results li span.flag{display:inline-block;margin-right:12px}#cc_c2a .c2a_footer{width:100%;line-height:26px;min-height:30px;vertical-align:middle;position:relative}#cc_c2a .c2a_footer.c2a_footer_min{min-height:auto;border-top:none}#cc_c2a .c2a_footer .c2a_logo{float:left;background-image:url('https://gabor_pc.craftyclicks.lan/thunder/img/c2a_mini.png');background-repeat:no-repeat;background-size:auto 100%;width:50%;height:12px;margin:7px}#cc_c2a .c2a_footer .geo{float:right;background-image:url('https://gabor_pc.craftyclicks.lan/thunder/img/geo.png');background-repeat:no-repeat;width:20px;height:20px;margin:3px;display:none}#cc_c2a .c2a_footer .progressBar{clear:both;width:0%;height:2px;-webkit-transition:width 0s,background-color 0s;transition:width 0s,background-color 0s}#cc_c2a .c2a_footer .progressBar.action{-webkit-transition:width .5s,background-color 0s;transition:width .5s,background-color 0s}#cc_c2a .c2a_footer .progressBar.finish{-webkit-transition:width .5s,background-color 4s;transition:width .5s,background-color 4s}#cc_c2a .c2a_error{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 15px;margin:5px;font-weight:bold;border-radius:5px}#cc_c2a .c2a_error.c2a_error_hidden{display:none}#cc_c2a .country{height:24px;margin:3px;line-height:24px}#cc_c2a .country .country_btn{position:relative;float:left;margin-right:5px;cursor:pointer;height:24px;width:30px;border:1px solid transparent}#cc_c2a .country .country_btn .country_img{margin:5px 6px}#cc_c2a .country .country_btn:hover{border-radius:2px}#cc_c2a .history{float:right}#cc_c2a .history>div{position:relative;float:left;cursor:pointer;height:24px;width:24px;border:1px solid transparent;text-align:center;border-radius:2px}#cc_c2a .history>div:first-child{margin-right:5px}#cc_c2a.c2a_mode1{border-top-left-radius:0px;border-top-right-radius:0px}#cc_c2a.c2a_mode1 .c2a_footer .country{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;position:relative}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn{width:auto}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn .country_img{float:left}#cc_c2a.c2a_mode1 .c2a_footer .country .country_btn span{margin-right:0.5em;float:left}#cc_c2a.c2a_mode2 .country{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0px 5px;margin-left:0px;position:relative}#cc_c2a.c2a_mode2 .country .country_btn{width:auto}#cc_c2a.c2a_mode2 .country .country_btn .country_img{float:left}#cc_c2a.c2a_mode2 .country .country_btn span{margin-right:0.5em;float:left}.c2a_active{position:relative;z-index:9999999!important;opacity:1.0!important}
|
3 |
+
@font-face{font-family:"CraftyIcons";src:url("cc_c2a.eot");src:url("cc_c2a.eot?#iefix") format("embedded-opentype"),url("cc_c2a.woff") format("woff"),url("cc_c2a.ttf") format("truetype"),url("cc_c2a.svg#CraftyIcons") format("svg");font-weight:normal;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:"CraftyIcons";src:url("cc_c2a.svg") format("svg")}}[class^="craftyicons-"]:before,[class*=" craftyicons-"]:before,[class^="craftyicons-"]:after,[class*=" craftyicons-"]:after{font-family:CraftyIcons;font-style:normal}.craftyicons-forward:before{content:"\f100"}.craftyicons-back:before{content:"\f101"}.craftyicons-caret:before{content:"\f102"}.craftyicons-fw2:before{content:"\f103"}.craftyicons-flip{display:inline-block;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}
|
4 |
+
.infoBar{display:none}.infoBar.infoActive{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 15px;margin:5px;font-weight:bold;border-radius:5px;background:#459fd3;background:-moz-linear-gradient(-45deg, #459fd3 0, #0892cd 100%);background:-webkit-linear-gradient(-45deg, #459fd3 0, #0892cd 100%);background:linear-gradient(135deg, #459fd3 0, #0892cd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#459fd3', endColorstr='#0892cd', GradientType=1);display:block;color:white}.infoBar.infoActive h5{font-size:20px;margin:0px;margin-bottom:10px}.infoBar.infoActive p{margin:0px;line-height:1.2em}
|
5 |
+
|
6 |
+
[class^="flag"],[class*=" flag"]{display:inline-block;line-height:11px;background-image:url("flags.png");background-position:-208px -188px;width:16px;height:11px;background-repeat:no-repeat}.flag-xk{background-position:-208px -177px}.flag-zw{background-position:0px 0px}.flag-zm{background-position:-16px 0}.flag-za{background-position:0 -11px}.flag-yt{background-position:-16px -11px}.flag-ye{background-position:-32px 0}.flag-ws{background-position:-32px -11px}.flag-wf{background-position:0 -22px}.flag-wales{background-position:-16px -22px}.flag-vu{background-position:-32px -22px}.flag-vn{background-position:0 -33px}.flag-vi{background-position:-16px -33px}.flag-vg{background-position:-32px -33px}.flag-ve{background-position:-48px 0}.flag-vc{background-position:-48px -11px}.flag-va{background-position:-48px -22px}.flag-uz{background-position:-48px -33px}.flag-uy{background-position:0 -44px}.flag-us{background-position:-16px -44px}.flag-um{background-position:-16px -44px}.flag-ug{background-position:-32px -44px}.flag-ua{background-position:-48px -44px}.flag-tz{background-position:-64px 0}.flag-tw{background-position:-64px -11px}.flag-tv{background-position:-64px -22px}.flag-tt{background-position:-64px -33px}.flag-tr{background-position:-64px -44px}.flag-to{background-position:0 -55px}.flag-tn{background-position:-16px -55px}.flag-tm{background-position:-32px -55px}.flag-tl{background-position:-48px -55px}.flag-tk{background-position:-64px -55px}.flag-tj{background-position:0 -66px}.flag-th{background-position:-16px -66px}.flag-tg{background-position:-32px -66px}.flag-tf{background-position:-48px -66px}.flag-td{background-position:-64px -66px}.flag-tc{background-position:-80px 0}.flag-sz{background-position:-80px -11px}.flag-sy{background-position:-80px -22px}.flag-sx{background-position:-80px -33px}.flag-sv{background-position:-80px -44px}.flag-st{background-position:-80px -55px}.flag-ss{background-position:-80px -66px}.flag-sr{background-position:0 -77px}.flag-so{background-position:-16px -77px}.flag-sn{background-position:-32px -77px}.flag-sm{background-position:-48px -77px}.flag-sl{background-position:-64px -77px}.flag-sk{background-position:-80px -77px}.flag-si{background-position:-96px 0}.flag-sh{background-position:-96px -11px}.flag-sg{background-position:-96px -22px}.flag-se{background-position:-96px -33px}.flag-sd{background-position:-96px -44px}.flag-scotland{background-position:-96px -55px}.flag-sc{background-position:-96px -66px}.flag-sb{background-position:-96px -77px}.flag-sa{background-position:0 -88px}.flag-rw{background-position:-16px -88px}.flag-ru{background-position:-32px -88px}.flag-rs{background-position:-48px -88px}.flag-ro{background-position:-64px -88px}.flag-qa{background-position:-80px -88px}.flag-py{background-position:-96px -88px}.flag-pw{background-position:0 -99px}.flag-pt{background-position:-16px -99px}.flag-ps{background-position:-32px -99px}.flag-pr{background-position:-48px -99px}.flag-pn{background-position:-64px -99px}.flag-pm{background-position:-80px -99px}.flag-pl{background-position:-96px -99px}.flag-pk{background-position:-112px 0}.flag-ph{background-position:-112px -11px}.flag-pg{background-position:-112px -22px}.flag-pf{background-position:-112px -33px}.flag-pe{background-position:-112px -44px}.flag-pa{background-position:-112px -55px}.flag-om{background-position:-112px -66px}.flag-nz{background-position:-112px -77px}.flag-nu{background-position:-112px -88px}.flag-nr{background-position:-112px -99px}.flag-no{background-position:0 -110px}.flag-bv{background-position:0 -110px}.flag-sj{background-position:0 -110px}.flag-nl{background-position:-16px -110px}.flag-ni{background-position:-32px -110px}.flag-ng{background-position:-48px -110px}.flag-nf{background-position:-64px -110px}.flag-ne{background-position:-80px -110px}.flag-nc{background-position:-96px -110px}.flag-na{background-position:-112px -110px}.flag-mz{background-position:-128px 0}.flag-my{background-position:-128px -11px}.flag-mx{background-position:-128px -22px}.flag-mw{background-position:-128px -33px}.flag-mv{background-position:-128px -44px}.flag-mu{background-position:-128px -55px}.flag-mt{background-position:-128px -66px}.flag-ms{background-position:-128px -77px}.flag-mr{background-position:-128px -88px}.flag-mq{background-position:-128px -99px}.flag-mp{background-position:-128px -110px}.flag-mo{background-position:0 -121px}.flag-mn{background-position:-16px -121px}.flag-mm{background-position:-32px -121px}.flag-ml{background-position:-48px -121px}.flag-mk{background-position:-64px -121px}.flag-mh{background-position:-80px -121px}.flag-mg{background-position:-96px -121px}.flag-me{background-position:0 -132px;width:16px;height:12px}.flag-md{background-position:-112px -121px}.flag-mc{background-position:-128px -121px}.flag-ma{background-position:-16px -132px}.flag-ly{background-position:-32px -132px}.flag-lv{background-position:-48px -132px}.flag-lu{background-position:-64px -132px}.flag-lt{background-position:-80px -132px}.flag-ls{background-position:-96px -132px}.flag-lr{background-position:-112px -132px}.flag-lk{background-position:-128px -132px}.flag-li{background-position:-144px 0}.flag-lc{background-position:-144px -11px}.flag-lb{background-position:-144px -22px}.flag-la{background-position:-144px -33px}.flag-kz{background-position:-144px -44px}.flag-ky{background-position:-144px -55px}.flag-kw{background-position:-144px -66px}.flag-kr{background-position:-144px -77px}.flag-kp{background-position:-144px -88px}.flag-kn{background-position:-144px -99px}.flag-km{background-position:-144px -110px}.flag-ki{background-position:-144px -121px}.flag-kh{background-position:-144px -132px}.flag-kg{background-position:0 -144px}.flag-ke{background-position:-16px -144px}.flag-jp{background-position:-32px -144px}.flag-jo{background-position:-48px -144px}.flag-jm{background-position:-64px -144px}.flag-je{background-position:-80px -144px}.flag-it{background-position:-96px -144px}.flag-is{background-position:-112px -144px}.flag-ir{background-position:-128px -144px}.flag-iq{background-position:-144px -144px}.flag-io{background-position:-160px 0}.flag-in{background-position:-160px -11px}.flag-im{background-position:-160px -22px;width:16px;height:9px}.flag-il{background-position:-160px -31px}.flag-ie{background-position:-160px -42px}.flag-id{background-position:-160px -53px}.flag-hu{background-position:-160px -64px}.flag-ht{background-position:-160px -75px}.flag-hr{background-position:-160px -86px}.flag-hn{background-position:-160px -97px}.flag-hk{background-position:-160px -108px}.flag-gy{background-position:-160px -119px}.flag-gw{background-position:-160px -130px}.flag-gu{background-position:-160px -141px}.flag-gt{background-position:0 -155px}.flag-gs{background-position:-16px -155px}.flag-gr{background-position:-32px -155px}.flag-gq{background-position:-48px -155px}.flag-gp{background-position:-64px -155px}.flag-gn{background-position:-80px -155px}.flag-gm{background-position:-96px -155px}.flag-gl{background-position:-112px -155px}.flag-gi{background-position:-128px -155px}.flag-gh{background-position:-144px -155px}.flag-gg{background-position:-160px -155px}.flag-ge{background-position:-176px 0}.flag-gd{background-position:-176px -11px}.flag-gb{background-position:-176px -22px}.flag-ga{background-position:-176px -33px}.flag-fr{background-position:-176px -44px}.flag-gf{background-position:-176px -44px}.flag-re{background-position:-176px -44px}.flag-mf{background-position:-176px -44px}.flag-bl{background-position:-176px -44px}.flag-fo{background-position:-176px -55px}.flag-fm{background-position:-176px -66px}.flag-fk{background-position:-176px -77px}.flag-fj{background-position:-176px -88px}.flag-fi{background-position:-176px -99px}.flag-fam{background-position:-176px -110px}.flag-eu{background-position:-176px -121px}.flag-et{background-position:-176px -132px}.flag-es{background-position:-176px -143px}.flag-er{background-position:-176px -154px}.flag-england{background-position:0 -166px}.flag-eh{background-position:-16px -166px}.flag-eg{background-position:-32px -166px}.flag-ee{background-position:-48px -166px}.flag-ec{background-position:-64px -166px}.flag-dz{background-position:-80px -166px}.flag-do{background-position:-96px -166px}.flag-dm{background-position:-112px -166px}.flag-dk{background-position:-128px -166px}.flag-dj{background-position:-144px -166px}.flag-de{background-position:-160px -166px}.flag-cz{background-position:-176px -166px}.flag-cy{background-position:0 -177px}.flag-cx{background-position:-16px -177px}.flag-cw{background-position:-32px -177px}.flag-cv{background-position:-48px -177px}.flag-cu{background-position:-64px -177px}.flag-cs{background-position:-80px -177px}.flag-cr{background-position:-96px -177px}.flag-co{background-position:-112px -177px}.flag-cn{background-position:-128px -177px}.flag-cm{background-position:-144px -177px}.flag-cl{background-position:-160px -177px}.flag-ck{background-position:-176px -177px}.flag-ci{background-position:-192px 0}.flag-cg{background-position:-192px -11px}.flag-cf{background-position:-192px -22px}.flag-cd{background-position:-192px -33px}.flag-cc{background-position:-192px -44px}.flag-catalonia{background-position:-192px -55px}.flag-ca{background-position:-192px -66px}.flag-bz{background-position:-192px -77px}.flag-by{background-position:-192px -88px}.flag-bw{background-position:-192px -99px}.flag-bt{background-position:-192px -110px}.flag-bs{background-position:-192px -121px}.flag-br{background-position:-192px -132px}.flag-bq{background-position:-192px -143px}.flag-bo{background-position:-192px -154px}.flag-bn{background-position:-192px -165px}.flag-bm{background-position:-192px -176px}.flag-bj{background-position:0 -188px}.flag-bi{background-position:-16px -188px}.flag-bh{background-position:-32px -188px}.flag-bg{background-position:-48px -188px}.flag-bf{background-position:-64px -188px}.flag-be{background-position:-80px -188px}.flag-bd{background-position:-96px -188px}.flag-bb{background-position:-112px -188px}.flag-ba{background-position:-128px -188px}.flag-az{background-position:-144px -188px}.flag-ax{background-position:-160px -188px}.flag-aw{background-position:-176px -188px}.flag-au{background-position:-192px -188px}.flag-hm{background-position:-192px -188px}.flag-at{background-position:-208px 0}.flag-as{background-position:-208px -11px}.flag-ar{background-position:-208px -22px}.flag-ao{background-position:-208px -33px}.flag-an{background-position:-208px -44px}.flag-am{background-position:-208px -55px}.flag-al{background-position:-208px -66px}.flag-ai{background-position:-208px -77px}.flag-ag{background-position:-208px -88px}.flag-af{background-position:-208px -99px}.flag-ae{background-position:-208px -110px}.flag-ad{background-position:-208px -121px}.flag-np{background-position:-208px -132px;width:9px;height:11px}.flag-ch{background-position:-208px -143px;width:11px;height:11px}
|
skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.svg
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<!--
|
4 |
+
2016-3-17: Created.
|
5 |
+
-->
|
6 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
7 |
+
<metadata>
|
8 |
+
Created by FontForge 20120731 at Thu Mar 17 13:10:34 2016
|
9 |
+
By Apache
|
10 |
+
Created by Apache with FontForge 2.0 (http://fontforge.sf.net)
|
11 |
+
</metadata>
|
12 |
+
<defs>
|
13 |
+
<font id="Flaticon" horiz-adv-x="512" >
|
14 |
+
<font-face
|
15 |
+
font-family="Flaticon"
|
16 |
+
font-weight="500"
|
17 |
+
font-stretch="normal"
|
18 |
+
units-per-em="512"
|
19 |
+
panose-1="2 0 6 3 0 0 0 0 0 0"
|
20 |
+
ascent="448"
|
21 |
+
descent="-64"
|
22 |
+
bbox="0 -63.9998 512 448"
|
23 |
+
underline-thickness="25.6"
|
24 |
+
underline-position="-51.2"
|
25 |
+
unicode-range="U+0020-F103"
|
26 |
+
/>
|
27 |
+
<missing-glyph />
|
28 |
+
<glyph glyph-name="space" unicode=" " horiz-adv-x="200"
|
29 |
+
/>
|
30 |
+
<glyph glyph-name="uniF101" unicode=""
|
31 |
+
d="M512 312.007v-240.014c0 -4.18848 -1.72461 -8.35254 -4.68652 -11.3145s-7.125 -4.68652 -11.3145 -4.68652h-224.013v-104.006c-0.0126953 -6.27539 -4.08301 -12.3545 -9.88184 -14.7539c-5.79688 -2.40039 -12.9756 -0.976562 -17.4189 3.4541l-240.014 240.014
|
32 |
+
c-2.95312 2.95996 -4.67188 7.11914 -4.67188 11.2998s1.71875 8.33789 4.67188 11.2998l240.014 240.014c4.44336 4.43066 11.6201 5.85449 17.4189 3.4541c5.79883 -2.39941 9.86914 -8.47852 9.88184 -14.7539v-104.006h224.013
|
33 |
+
c4.18945 0 8.35254 -1.72461 11.3145 -4.68652s4.68652 -7.12598 4.68652 -11.3145z" />
|
34 |
+
<glyph glyph-name="uniF103" unicode=""
|
35 |
+
d="M500.572 219.583c15.2373 -15.2305 15.2373 -39.9355 0.000976562 -55.165l-212.053 -212.05c-7.45703 -7.46875 -17.4395 -11.4297 -27.5918 -11.4297c-5.0293 0 -10.0938 0.970703 -14.9141 2.97266c-14.582 6.03711 -24.0869 20.2568 -24.0869 36.0381v74.2959
|
36 |
+
h-182.917c-21.5439 0 -39.0107 17.4658 -39.0107 39.0098v197.49c0 21.543 17.4668 39.0107 39.0107 39.0107h182.917v74.2959c0 15.7822 9.50488 30.002 24.0869 36.0381c14.5723 6.03906 31.3623 2.70508 42.5049 -8.45703z" />
|
37 |
+
<glyph glyph-name="uniF102" unicode=""
|
38 |
+
d="M392.723 219.183c8.11426 -8.11426 11.3594 -16.2285 11.3594 -27.5879c0 -9.7373 -3.24512 -19.4746 -11.3594 -27.5889l-215.835 -215.835c-16.2285 -16.2275 -40.5703 -16.2275 -56.7988 0c-16.2285 16.2285 -16.2285 38.9482 0 55.1758l188.247 188.248
|
39 |
+
l-188.247 188.247c-16.2285 16.2275 -16.2285 38.9473 0 55.1758c8.11426 8.11426 17.8506 12.9824 27.5879 12.9824s21.0967 -4.86816 29.2109 -12.9824z" />
|
40 |
+
<glyph glyph-name="uniF100" unicode=""
|
41 |
+
d="M0 71.9932v240.014c0 4.18848 1.72461 8.35059 4.68652 11.3145c2.96191 2.96191 7.125 4.68652 11.3145 4.68652h224.013v104.006c0.0126953 6.27539 4.08301 12.3545 9.88184 14.7539c5.79688 2.40039 12.9756 0.976562 17.4189 -3.4541l240.014 -240.014
|
42 |
+
c2.95312 -2.95996 4.67188 -7.11914 4.67188 -11.2998s-1.71875 -8.33789 -4.67188 -11.2998l-240.014 -240.014c-4.44336 -4.43066 -11.6221 -5.85449 -17.4189 -3.4541c-5.79688 2.39941 -9.86914 8.47852 -9.88184 14.7539v104.006h-224.013
|
43 |
+
c-4.18945 0 -8.35254 1.72461 -11.3145 4.68652s-4.68652 7.12598 -4.68652 11.3145z" />
|
44 |
+
</font>
|
45 |
+
</defs></svg>
|
skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.ttf
ADDED
Binary file
|
skin/frontend/base/default/css/craftyclicks/c2a/cc_c2a.woff
ADDED
Binary file
|
skin/frontend/base/default/css/craftyclicks/c2a/flags.png
ADDED
Binary file
|