postnord_delivery_module - Version 1.4.6

Version Notes

Stable version

Download this release

Release Info

Developer vConnect
Extension postnord_delivery_module
Version 1.4.6
Comparing to
See all releases


Version 1.4.6

Files changed (147) hide show
  1. app/code/community/Vconnect/AllInOne/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form.php +9 -0
  2. app/code/community/Vconnect/AllInOne/Block/Adminhtml/Shipping/Table.php +69 -0
  3. app/code/community/Vconnect/AllInOne/Block/Adminhtml/System/Config/Form/Prices.php +26 -0
  4. app/code/community/Vconnect/AllInOne/Block/Adminhtml/Total/Renderer/Additionalfee.php +71 -0
  5. app/code/community/Vconnect/AllInOne/Block/Adminhtml/Total/Renderer/Environmentalfee.php +71 -0
  6. app/code/community/Vconnect/AllInOne/Block/Shipping/Dialog.php +157 -0
  7. app/code/community/Vconnect/AllInOne/Helper/Data.php +198 -0
  8. app/code/community/Vconnect/AllInOne/Model/Apiclient.php +166 -0
  9. app/code/community/Vconnect/AllInOne/Model/Carrier/Postnord.php +251 -0
  10. app/code/community/Vconnect/AllInOne/Model/Creditmemo/Environmentaltotal.php +64 -0
  11. app/code/community/Vconnect/AllInOne/Model/Creditmemo/Total.php +64 -0
  12. app/code/community/Vconnect/AllInOne/Model/Invoice/Environmentaltotal.php +64 -0
  13. app/code/community/Vconnect/AllInOne/Model/Invoice/Pdf/Environmentaltotal.php +126 -0
  14. app/code/community/Vconnect/AllInOne/Model/Invoice/Pdf/Total.php +126 -0
  15. app/code/community/Vconnect/AllInOne/Model/Invoice/Total.php +64 -0
  16. app/code/community/Vconnect/AllInOne/Model/Observer.php +484 -0
  17. app/code/community/Vconnect/AllInOne/Model/Quote/Address/Rate.php +56 -0
  18. app/code/community/Vconnect/AllInOne/Model/Quote/Environmentaltotal.php +136 -0
  19. app/code/community/Vconnect/AllInOne/Model/Quote/Total.php +136 -0
  20. app/code/community/Vconnect/AllInOne/Model/Rate/Result.php +37 -0
  21. app/code/community/Vconnect/AllInOne/Model/System/Config/Backend/Shipping/License.php +79 -0
  22. app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Countries.php +45 -0
  23. app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Orderstate.php +31 -0
  24. app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Terms.php +23 -0
  25. app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Theme.php +23 -0
  26. app/code/community/Vconnect/AllInOne/controllers/IndexController.php +106 -0
  27. app/code/community/Vconnect/AllInOne/data/vconnect_postnord_setup/data-install-1.2.9.php +52 -0
  28. app/code/community/Vconnect/AllInOne/etc/config.xml +301 -0
  29. app/code/community/Vconnect/AllInOne/etc/system.xml +574 -0
  30. app/code/community/Vconnect/AllInOne/sql/vconnect_postnord_setup/install-0.1.2.0.php +14 -0
  31. app/code/community/Vconnect/AllInOne/sql/vconnect_postnord_setup/upgrade-0.1.2.0-0.1.2.1.php +18 -0
  32. app/code/community/Vconnect/AllInOneDk/Block/Adminhtml/System/Config/Form/Prices.php +27 -0
  33. app/code/community/Vconnect/AllInOneDk/Block/Shipping/Form.php +6 -0
  34. app/code/community/Vconnect/AllInOneDk/Helper/Data.php +44 -0
  35. app/code/community/Vconnect/AllInOneDk/Model/Adminhtml/System/Config/Source/Orderstate.php +34 -0
  36. app/code/community/Vconnect/AllInOneDk/Model/Array2XML.php +137 -0
  37. app/code/community/Vconnect/AllInOneDk/Model/Carrier/SmartDelivery.php +236 -0
  38. app/code/community/Vconnect/AllInOneDk/Model/Method/Mapper.php +88 -0
  39. app/code/community/Vconnect/AllInOneDk/Model/Observer.php +163 -0
  40. app/code/community/Vconnect/AllInOneDk/Model/Timeslot.php +127 -0
  41. app/code/community/Vconnect/AllInOneDk/etc/config.xml +61 -0
  42. app/code/community/Vconnect/AllInOneDk/etc/system.xml +22 -0
  43. app/code/community/Vconnect/AllInOneFi/Helper/Data.php +33 -0
  44. app/code/community/Vconnect/AllInOneFi/Model/Observer.php +144 -0
  45. app/code/community/Vconnect/AllInOneFi/etc/config.xml +61 -0
  46. app/code/community/Vconnect/AllInOneFi/etc/system.xml +22 -0
  47. app/code/community/Vconnect/AllInOneNo/Helper/Data.php +33 -0
  48. app/code/community/Vconnect/AllInOneNo/Model/Observer.php +203 -0
  49. app/code/community/Vconnect/AllInOneNo/etc/config.xml +61 -0
  50. app/code/community/Vconnect/AllInOneNo/etc/system.xml +22 -0
  51. app/code/community/Vconnect/AllInOneSe/Helper/Data.php +33 -0
  52. app/code/community/Vconnect/AllInOneSe/Model/Observer.php +215 -0
  53. app/code/community/Vconnect/AllInOneSe/etc/config.xml +57 -0
  54. app/code/community/Vconnect/AllInOneSe/etc/system.xml +151 -0
  55. app/design/adminhtml/default/default/layout/vconnect/aio.xml +10 -0
  56. app/design/adminhtml/default/default/template/vconnect/aio/methods_select.phtml +154 -0
  57. app/design/adminhtml/default/default/template/vconnect/aio/prices.phtml +63 -0
  58. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/base.phtml +184 -0
  59. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/commercial/tabHeader.phtml +73 -0
  60. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/commercial/tabScripts.phtml +42 -0
  61. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/mailbox/tabHeader.phtml +79 -0
  62. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/mailbox/tabScripts.phtml +115 -0
  63. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/pickup/tabHeader.phtml +114 -0
  64. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/pickup/tabScripts.phtml +781 -0
  65. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/private/tabHeader.phtml +80 -0
  66. app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/private/tabScripts.phtml +109 -0
  67. app/design/adminhtml/default/default/template/vconnect/sales/order/create/shipping/method/form.phtml +216 -0
  68. app/design/frontend/base/default/layout/vconnect/aio.xml +8 -0
  69. app/design/frontend/base/default/template/vconnect/aio/base.phtml +595 -0
  70. app/design/frontend/base/default/template/vconnect/aio/commercial/tabHeader.phtml +152 -0
  71. app/design/frontend/base/default/template/vconnect/aio/commercial/tabScripts.phtml +92 -0
  72. app/design/frontend/base/default/template/vconnect/aio/dpdeu/tabHeader.phtml +59 -0
  73. app/design/frontend/base/default/template/vconnect/aio/dpdeu/tabScripts.phtml +60 -0
  74. app/design/frontend/base/default/template/vconnect/aio/dpdinternational/tabHeader.phtml +58 -0
  75. app/design/frontend/base/default/template/vconnect/aio/dpdinternational/tabScripts.phtml +59 -0
  76. app/design/frontend/base/default/template/vconnect/aio/mailbox/tabHeader.phtml +166 -0
  77. app/design/frontend/base/default/template/vconnect/aio/mailbox/tabScripts.phtml +152 -0
  78. app/design/frontend/base/default/template/vconnect/aio/pickup/tabHeader.phtml +79 -0
  79. app/design/frontend/base/default/template/vconnect/aio/pickup/tabScripts.phtml +487 -0
  80. app/design/frontend/base/default/template/vconnect/aio/private/tabHeader.phtml +172 -0
  81. app/design/frontend/base/default/template/vconnect/aio/private/tabScripts.phtml +159 -0
  82. app/design/frontend/base/default/template/vconnect/aio_base/base.phtml +253 -0
  83. app/design/frontend/base/default/template/vconnect/aio_base/commercial/tabHeader.phtml +72 -0
  84. app/design/frontend/base/default/template/vconnect/aio_base/commercial/tabScripts.phtml +42 -0
  85. app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabHeader.phtml +78 -0
  86. app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabScripts.phtml +149 -0
  87. app/design/frontend/base/default/template/vconnect/aio_base/pickup/tabHeader.phtml +114 -0
  88. app/design/frontend/base/default/template/vconnect/aio_base/pickup/tabScripts.phtml +793 -0
  89. app/design/frontend/base/default/template/vconnect/aio_base/private/tabHeader.phtml +78 -0
  90. app/design/frontend/base/default/template/vconnect/aio_base/private/tabScripts.phtml +141 -0
  91. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/base.phtml +288 -0
  92. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/commercial/tabHeader.phtml +72 -0
  93. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/commercial/tabScripts.phtml +36 -0
  94. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/mailbox/tabHeader.phtml +102 -0
  95. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/mailbox/tabScripts.phtml +160 -0
  96. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/pickup/tabHeader.phtml +112 -0
  97. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/pickup/tabScripts.phtml +803 -0
  98. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/private/tabHeader.phtml +100 -0
  99. app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/private/tabScripts.phtml +155 -0
  100. app/etc/modules/Vconnect_AllInOne.xml +8 -0
  101. app/etc/modules/Vconnect_AllInOneDk.xml +11 -0
  102. app/etc/modules/Vconnect_AllInOneFi.xml +11 -0
  103. app/etc/modules/Vconnect_AllInOneNo.xml +11 -0
  104. app/etc/modules/Vconnect_AllInOneSe.xml +11 -0
  105. app/locale/da_DK/Vconnect_AllInOne.csv +61 -0
  106. app/locale/fi_FI/Vconnect_AllInOne.csv +54 -0
  107. app/locale/nb_NO/Vconnect_AllInOne.csv +66 -0
  108. app/locale/nn_NO/Vconnect_AllInOne.csv +64 -0
  109. app/locale/sv_SE/Vconnect_AllInOne.csv +72 -0
  110. package.xml +18 -0
  111. skin/adminhtml/default/default/css/vconnect/aio/blue.css +2526 -0
  112. skin/adminhtml/default/default/css/vconnect/aio/red.css +2407 -0
  113. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Black Italic.otf +0 -0
  114. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Black.otf +0 -0
  115. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Bold Italic.otf +0 -0
  116. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Bold.otf +0 -0
  117. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Book Italic.otf +0 -0
  118. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Book.otf +0 -0
  119. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Light Italic.otf +0 -0
  120. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Light.otf +0 -0
  121. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Medium Italic.otf +0 -0
  122. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Medium.otf +0 -0
  123. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Semibold Italic.otf +0 -0
  124. skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Semibold.otf +0 -0
  125. skin/adminhtml/default/default/images/vconnect/aio/PostDKLogo.svg.png +0 -0
  126. skin/adminhtml/default/default/images/vconnect/aio/active-pin-3.png +0 -0
  127. skin/adminhtml/default/default/images/vconnect/aio/active-pin-red-3.png +0 -0
  128. skin/adminhtml/default/default/images/vconnect/aio/active-pin.png +0 -0
  129. skin/adminhtml/default/default/images/vconnect/aio/aino-icons-red.png +0 -0
  130. skin/adminhtml/default/default/images/vconnect/aio/aino-icons.png +0 -0
  131. skin/adminhtml/default/default/images/vconnect/aio/aino-postnord-logo.png +0 -0
  132. skin/adminhtml/default/default/images/vconnect/aio/arrow.png +0 -0
  133. skin/adminhtml/default/default/images/vconnect/aio/button-arrow-icon.png +0 -0
  134. skin/adminhtml/default/default/images/vconnect/aio/not-active-pin-red.png +0 -0
  135. skin/adminhtml/default/default/images/vconnect/aio/not-active-pin.png +0 -0
  136. skin/adminhtml/default/default/images/vconnect/aio/realistic-frog-outline-0.png +0 -0
  137. skin/adminhtml/default/default/images/vconnect/aio/temp.png +0 -0
  138. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/01d.png +0 -0
  139. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/02d.png +0 -0
  140. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/03d.png +0 -0
  141. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/04d.png +0 -0
  142. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/09d.png +0 -0
  143. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/10d.png +0 -0
  144. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/11d.png +0 -0
  145. skin/adminhtml/default/default/images/vconnect/aio/weather-icons/13d.png +0 -0
  146. skin/adminhtml/default/default/js/vconnect/aio/facescroll.js +328 -0
  147. skin/adminhtml/default/default/js/vconnect/aio/jquery-1.11.3.js +7916 -0
app/code/community/Vconnect/AllInOne/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Vconnect_AllInOne_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form
3
+ {
4
+ protected function _toHtml(){
5
+ $this->setTemplate('vconnect/sales/order/create/shipping/method/form.phtml');
6
+ return parent::_toHtml();
7
+ }
8
+ }
9
+ ?>
app/code/community/Vconnect/AllInOne/Block/Adminhtml/Shipping/Table.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOne_Block_Adminhtml_Shipping_Table
29
+ */
30
+ class Vconnect_AllInOne_Block_Adminhtml_Shipping_Table extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
31
+
32
+ public function __construct() { // create columns for the table rate for the carriers(other than pickup) system config
33
+ $this->addColumn('orderminprice', array(
34
+ 'label' => $this->__('Min Price'),
35
+ 'size' => 6,
36
+ 'style' => 'width: 95%;',
37
+ ));
38
+ $this->addColumn('ordermaxprice', array(
39
+ 'label' => $this->__('Max Price'),
40
+ 'size' => 6,
41
+ 'style' => 'width: 95%;',
42
+ ));
43
+ $this->addColumn('orderminweight', array(
44
+ 'label' => $this->__('Min Weight'),
45
+ 'size' => 6,
46
+ 'style' => 'width: 95%;',
47
+ ));
48
+ $this->addColumn('ordermaxweight', array(
49
+ 'label' => $this->__('Max Weight'),
50
+ 'size' => 6,
51
+ 'style' => 'width: 95%;',
52
+ ));
53
+ $this->addColumn('price', array(
54
+ 'label' => $this->__('Shipping Fee'),
55
+ 'size' => 6,
56
+ 'style' => 'width: 95%;',
57
+ ));
58
+
59
+
60
+ $this->_addAfter = false;
61
+ $this->_addButtonLabel = $this->__('Add Rate');
62
+
63
+ parent::__construct();
64
+ $this->setTemplate('vconnect/aio/methods_select.phtml');
65
+ }
66
+
67
+
68
+
69
+ }
app/code/community/Vconnect/AllInOne/Block/Adminhtml/System/Config/Form/Prices.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOne_Block_Adminhtml_System_Config_Form_Prices
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
5
+ {
6
+ /*
7
+ * Set template
8
+ */
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->setTemplate('vconnect/aio/prices.phtml');
13
+ }
14
+ /**
15
+ * Return element html
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $this->setElement($element);
23
+ return $this->_toHtml();
24
+ }
25
+
26
+ }
app/code/community/Vconnect/AllInOne/Block/Adminhtml/Total/Renderer/Additionalfee.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Block_Adminhtml_Total_Renderer_Additionalfee
30
+ */
31
+ class Vconnect_AllInOne_Block_Adminhtml_Total_Renderer_Additionalfee extends Mage_Adminhtml_Block_Sales_Order_Totals
32
+ {
33
+ public function initTotals()
34
+ {
35
+ $order = $this->getParentBlock()
36
+ ->getOrder();
37
+
38
+ if (!$order->getVconnectPostnordData()) {
39
+ return $this;
40
+ }
41
+
42
+ $fee = 0;
43
+ $fee_base = 0;
44
+
45
+ $data = Mage::helper('core')->jsonDecode($order->getVconnectPostnordData(),true);
46
+ if (!empty($data['additional_fee_amount'])) {
47
+ $fee = $data['additional_fee_amount'];
48
+ $fee_base = $data['additional_fee_amount'];
49
+ }
50
+
51
+ $baseCurrencyCode = Mage::app()->getStore($order->getStoreId())->getBaseCurrencyCode();
52
+ $orderCurrencyCode = $order->getOrderCurrencyCode();
53
+
54
+ if ($baseCurrencyCode != $orderCurrencyCode) {
55
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
56
+ }
57
+
58
+ if ($fee > 0) {
59
+ $total = new Varien_Object(array(
60
+ 'code' => 'vc_aio_additionalfee',
61
+ 'value' => $fee,
62
+ 'base_value' => $fee_base,
63
+ 'label' => $data['additional_fee_label'],
64
+ ));
65
+
66
+ $this->getParentBlock()->addTotalBefore($total, 'shipping');
67
+ }
68
+
69
+ return $this;
70
+ }
71
+ }
app/code/community/Vconnect/AllInOne/Block/Adminhtml/Total/Renderer/Environmentalfee.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Block_Adminhtml_Total_Renderer_Environmentalfee
30
+ */
31
+ class Vconnect_AllInOne_Block_Adminhtml_Total_Renderer_Environmentalfee extends Mage_Adminhtml_Block_Sales_Order_Totals
32
+ {
33
+ public function initTotals()
34
+ {
35
+ $order = $this->getParentBlock()
36
+ ->getOrder();
37
+
38
+ if (!$order->getVconnectPostnordData()) {
39
+ return $this;
40
+ }
41
+
42
+ $fee = 0;
43
+ $fee_base = 0;
44
+
45
+ $data = Mage::helper('core')->jsonDecode($order->getVconnectPostnordData(),true);
46
+ if (!empty($data['environmental_fee'])) {
47
+ $fee = 10;
48
+ $fee_base = 10;
49
+ }
50
+
51
+ $baseCurrencyCode = Mage::app()->getStore($order->getStoreId())->getBaseCurrencyCode();
52
+ $orderCurrencyCode = $order->getOrderCurrencyCode();
53
+
54
+ if ($baseCurrencyCode != $orderCurrencyCode) {
55
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
56
+ }
57
+
58
+ if ($fee > 0) {
59
+ $total = new Varien_Object(array(
60
+ 'code' => 'vc_aio_environmentalfee',
61
+ 'value' => $fee,
62
+ 'base_value' => $fee_base,
63
+ 'label' => Mage::helper('vc_aio')->__('Environmental Fee'),
64
+ ));
65
+
66
+ $this->getParentBlock()->addTotalBefore($total, 'shipping');
67
+ }
68
+
69
+ return $this;
70
+ }
71
+ }
app/code/community/Vconnect/AllInOne/Block/Shipping/Dialog.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Block_Shipping_Dialog
30
+ */
31
+
32
+ class Vconnect_AllInOne_Block_Shipping_Dialog extends Mage_Checkout_Block_Onepage_Abstract
33
+ {
34
+ /**
35
+ *
36
+ * @var array
37
+ */
38
+ protected $_rates;
39
+
40
+ public function __construct() {
41
+ parent::__construct();
42
+ $templateTypePath = Mage::getStoreConfigFlag('carriers/vconnect_postnord/popup')?'aio':'aio_base';
43
+ if (Mage::app()->getStore()->isAdmin()) {
44
+ $templateTypePath = 'aio_base_createorder';
45
+ }
46
+ if (!Mage::getStoreConfigFlag('carriers/vconnect_postnord/popup') && Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout') {
47
+ $templateTypePath = 'klarnacheckout/aio_base';
48
+ }
49
+ $this->setTemplate("vconnect/$templateTypePath/base.phtml");
50
+ $this->setChild('tab_headers',Mage::app()->getLayout()->createBlock('core/text_list'));
51
+ $this->setChild('tab_bodies',Mage::app()->getLayout()->createBlock('core/text_list'));
52
+ $this->setChild('body_scripts',Mage::app()->getLayout()->createBlock('core/text_list'));
53
+ $this->setCacheLifetime(null);
54
+ }
55
+
56
+ public function getShippingInfo()
57
+ {
58
+ return $this->getQuote()->getVconnectPostnordData();
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @param Mage_Core_Block_Template $block
64
+ * @return Vconnect_AllInOne_Block_Shipping_Dialog
65
+ */
66
+ public function addTabHeader(Mage_Core_Block_Template $block)
67
+ {
68
+ $this->getChild('tab_headers')->append($block);
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ *
74
+ * @param Mage_Core_Block_Template $block
75
+ * @return Vconnect_AllInOne_Block_Shipping_Dialog
76
+ */
77
+ public function addTabBody(Mage_Core_Block_Template $block)
78
+ {
79
+ $this->getChild('tab_bodies')->append($block);
80
+ return $this;
81
+ }
82
+
83
+ /**
84
+ *
85
+ * @param Mage_Core_Block_Template $block
86
+ * @return Vconnect_AllInOne_Block_Shipping_Dialog
87
+ */
88
+ public function addTabScripts(Mage_Core_Block_Template $block)
89
+ {
90
+ $this->getChild('body_scripts')->append($block);
91
+ return $this;
92
+ }
93
+
94
+ /**
95
+ *
96
+ * @return bool
97
+ */
98
+ public function isWeatherOn(){
99
+ return Mage::getStoreConfigFlag('carriers/vconnect_postnord/weather') ;
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @return string
105
+ */
106
+ public function getWatherApiKey(){
107
+ return Mage::getStoreConfig('carriers/vconnect_postnord/weather_api_key') ;
108
+ }
109
+
110
+ /**
111
+ *
112
+ * @return array
113
+ */
114
+ public function getRates()
115
+ {
116
+ if(!$this->_rates){
117
+ $this->_rates = array();
118
+ if (Mage::app()->getStore()->isAdmin()) {
119
+ $_rates = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress()->getShippingRatesCollection()->toArray();
120
+ } else {
121
+ $_rates = $this->getQuote()->getShippingAddress()->getShippingRatesCollection()->toArray();
122
+ }
123
+
124
+ $_rates = array_slice($_rates['items'],count($_rates['items']) - $_rates['totalRecords']);
125
+ foreach ($_rates as $rate){
126
+ if(stripos($rate['code'],'vconnect_postnord') === false){
127
+ continue;
128
+ }
129
+ $config = Mage::helper('core')->jsonDecode($rate['vc_method_data']);
130
+
131
+ $rate['sort_order'] = Mage::getStoreConfig("carriers/{$config['system_path']}/sort_order");
132
+ $rate['price_formated'] = $this->_getPriceFromated($rate['price']);
133
+ $this->_rates[$rate['code']] = $rate;
134
+ }
135
+ usort($this->_rates, function($a,$b){
136
+ return (int)$a['sort_order'] - (int)$b['sort_order'];
137
+ });
138
+ }
139
+ return $this->_rates;
140
+ }
141
+
142
+ /**
143
+ *
144
+ * @param deciaml $price
145
+ * @return string
146
+ */
147
+ protected function _getPriceFromated($price)
148
+ {
149
+ return $this->getQuote()->getStore()->convertPrice(
150
+ Mage::helper('tax')->getShippingPrice(
151
+ $price,
152
+ $this->helper('tax')->displayShippingPriceIncludingTax(),
153
+ $this->getQuote()->getShippingAddress()), true);
154
+ }
155
+
156
+ }
157
+
app/code/community/Vconnect/AllInOne/Helper/Data.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOne_Helper_Data
29
+ */
30
+ class Vconnect_AllInOne_Helper_Data extends Mage_Core_Helper_Abstract
31
+ {
32
+ /**
33
+ *
34
+ * @var array
35
+ */
36
+ protected $_rates;
37
+
38
+ /**
39
+ * Common log for module
40
+ * @param mixed $msg
41
+ * @param int $type
42
+ * @return Vconnect_AllInOne_Helper_Data
43
+ */
44
+ public function log( $msg, $type = Zend_Log::DEBUG){
45
+ Mage::log($msg, $type, 'all_in_one.log');
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * Whethere a country code is scandianvian one
51
+ * $param $countryCode 2 chars iso code
52
+ * @return bool
53
+ */
54
+ public function isScandinavianCountry($countryCode)
55
+ {
56
+ return in_array($countryCode, $this->getScandinavianCountries());
57
+ }
58
+
59
+ /**
60
+ * Get scandinavian countries
61
+ * @return array
62
+ */
63
+ public function getScandinavianCountries()
64
+ {
65
+ return Mage::getModel('vc_aio/system_config_source_carrier_countries')->toArray();
66
+ }
67
+
68
+ /**
69
+ *
70
+ * @param string $countryCode 2 chars iso code
71
+ * @return bool
72
+ */
73
+ public function isEuCountry($countryCode)
74
+ {
75
+ return in_array(strtolower($countryCode), $this->getEuCountries());
76
+ }
77
+
78
+ /**
79
+ * Return array of EU countries 2 chars code
80
+ * @return array
81
+ */
82
+ public function getEuCountries()
83
+ {
84
+ $eu_countries = Mage::getStoreConfig('general/country/eu_countries');
85
+ return explode(',', strtolower($eu_countries));
86
+
87
+ }
88
+
89
+ /**
90
+ *
91
+ * @return array of all countries
92
+ */
93
+ public function getAllCountries()
94
+ {
95
+ return array_map( function($item){
96
+ return strtolower($item['value']);
97
+ },Mage::getModel('directory/country')->getResourceCollection()
98
+ ->loadByStore()
99
+ ->toOptionArray(false));
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @param Mage_Sales_Model_Quote $quote
105
+ * @return array
106
+ */
107
+ public function getRatesForQuote(Mage_Sales_Model_Quote $quote)
108
+ {
109
+ if(!$this->_rates){
110
+ $this->_rates = array();
111
+ $_rates = $quote->getShippingAddress()->getShippingRatesCollection()->toArray();
112
+ $_rates = array_slice($_rates['items'],count($_rates['items']) - $_rates['totalRecords']);
113
+ foreach ($_rates as $rate){
114
+ if(stripos($rate['code'],'vconnect_postnord') === false){
115
+ continue;
116
+ }
117
+ $config = Mage::helper('core')->jsonDecode($rate['vc_method_data']);
118
+
119
+ $rate['sort_order'] = Mage::getStoreConfig("carriers/{$config['system_path']}/sort_order");
120
+ $rate['price_formated'] = $this->getPriceFromated($quote,$rate['price']);
121
+ $this->_rates[$rate['code']] = $rate;
122
+ }
123
+ usort($this->_rates, function($a,$b){
124
+ return (int)$a['sort_order'] - (int)$b['sort_order'];
125
+ });
126
+ }
127
+ return $this->_rates;
128
+ }
129
+
130
+ /**
131
+ *
132
+ * @param Mage_Sales_Model_Quote $quote
133
+ * @param deciaml $price
134
+ * @return string
135
+ */
136
+ public function getPriceFromated( Mage_Sales_Model_Quote $quote, $price )
137
+ {
138
+ $displayTax = Mage::helper('tax')->displayShippingPriceIncludingTax();
139
+ $_price = Mage::helper('tax')->getShippingPrice($price,$displayTax,$quote->getShippingAddress());
140
+ return $quote->getStore()->convertPrice($_price, true);
141
+ }
142
+
143
+ /**
144
+ *
145
+ * @param Mage_Sales_Model_Quote $quote
146
+ * @param string $code
147
+ * @return array|null
148
+ */
149
+ public function getRateDetailsByMethodCode( Mage_Sales_Model_Quote $quote, $code)
150
+ {
151
+
152
+ $rates = $this->getRatesForQuote($quote);
153
+ $result = array_filter( $rates,function($item) use($code){
154
+ return $code == $item['code'];
155
+ });
156
+ return array_shift($result);
157
+ }
158
+
159
+ /**
160
+ *
161
+ * @param string $code
162
+ * @return string json string
163
+ */
164
+ public function getFelxDeliveryByMethodCode( $code)
165
+ {
166
+ $content = $this->getRateDetailsByMethodCode(Mage::getSingleton('checkout/session')->getQuote(), $code);
167
+ if(!isset($content['vc_method_data'])){
168
+ return array();
169
+ }
170
+ $data = Mage::helper('core')->jsonDecode($content['vc_method_data']);
171
+
172
+ return isset($data['delivery']['Flex Delivery'])?$data['delivery']['Flex Delivery']:array();
173
+ }
174
+
175
+ /**
176
+ *
177
+ * @param string $system_path
178
+ * @return string array
179
+ */
180
+ public function getAdditionalFeeData($system_path)
181
+ {
182
+ $data = array();
183
+
184
+ if (Mage::getStoreConfigFlag("carriers/{$system_path}/additional_fee_active")) {
185
+ $data = array(
186
+ 'label' => Mage::getStoreConfig("carriers/{$system_path}/additional_fee_label"),
187
+ 'label_with_price' => Mage::getStoreConfig("carriers/{$system_path}/additional_fee_label") . ' +' . Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)Mage::getStoreConfig("carriers/{$system_path}/additional_fee_amount"), true, false),
188
+ 'price_base' => (float)Mage::getStoreConfig("carriers/{$system_path}/additional_fee_amount"),
189
+ 'price' => Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)Mage::getStoreConfig("carriers/{$system_path}/additional_fee_amount"), false, false),
190
+ );
191
+ }
192
+
193
+ return $data;
194
+ }
195
+
196
+
197
+
198
+ }
app/code/community/Vconnect/AllInOne/Model/Apiclient.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Api
30
+ */
31
+ class Vconnect_AllInOne_Model_Apiclient extends Varien_Object
32
+ {
33
+ const POSTNORD_API_URL = "https://api2.postnord.com/rest/";
34
+
35
+ /**
36
+ *
37
+ * @param string $apiKey
38
+ * @param int $postCode
39
+ * @param string $countryCode
40
+ * @param int $limit
41
+ * @param string $street
42
+ * @param string $locale Allowed values are en, sv, no, da and fi
43
+ * @param bool $gls
44
+ * @return array
45
+ */
46
+ public function findPoints($apiKey,$postCode = 2100, $countryCode='DK',$limit = 10, $street = null, $locale='en')
47
+ {
48
+ $start = microtime();
49
+ $params = array(
50
+ 'apikey' => $apiKey,
51
+ 'countryCode' => strtoupper($countryCode),
52
+ 'postalCode' => $postCode,
53
+ 'streetName' => $street,
54
+ 'numberOfServicePoints' => $limit,
55
+ 'locale' => $locale
56
+ );
57
+
58
+ $url = self::POSTNORD_API_URL . 'businesslocation/v1/servicepoint/findNearestByAddress.json';
59
+ $client = new Zend_Http_Client($url);
60
+
61
+ // $client->
62
+ $client->setParameterGet($params);
63
+ // $client->setHeaders('Accept', 'application/json');
64
+ $result['postnord'] = array();
65
+ try {
66
+ $response = $client->request();
67
+ // Mage::log($client->getLastRequest());
68
+ // Mage::log($client->getLastResponse()->asString());
69
+ if($response->getStatus() == 200){
70
+ $body = $response->getBody();
71
+ $res = Mage::helper('core')->jsonDecode($body);
72
+ $result['postnord'] = $res;
73
+
74
+ }else{
75
+ $result['postnord']['error'] = true;
76
+ $result['postnord']['message'] = "API returned error with code {$response->getStatus()}";
77
+ }
78
+ } catch (Exception $ex) {
79
+ $result['postnord']['error'] = true;
80
+ $result['postnord']['message'] = $ex->getMessage();
81
+
82
+ }
83
+
84
+
85
+ if(!$this->getGls() || !class_exists('SoapClient')){
86
+ $result['time'] = microtime() - $start;
87
+ return $result;
88
+ }
89
+
90
+ $soap_client = new SoapClient("http://www.gls.dk/webservices_v2/wsPakkeshop.asmx?WSDL", array(
91
+ 'encoding' => 'UTF-8',
92
+ 'default_socket_timeout' => 5
93
+ ));
94
+
95
+ $result['gls'] = array();
96
+ try
97
+ {
98
+ $shops = $soap_client->SearchNearestParcelShops(array('street' => $street, 'zipcode' => $postCode, 'Amount' => $limit));
99
+ $result['gls'] = (array)$shops->SearchNearestParcelShopsResult->parcelshops->PakkeshopData;
100
+ $result['gls']['error'] = false;
101
+ }
102
+ catch(Exception $e)
103
+ {
104
+ $result['gls']['error'] = true;
105
+ $result['gls']['message'] = $e->getMessage();
106
+ $this->error = __METHOD__ . ' : ' . $e->getMessage();
107
+
108
+ }
109
+ $result['time'] = microtime()- $start;
110
+ return $result;
111
+
112
+ }
113
+
114
+ /**
115
+ *
116
+ * @param string $apiKey
117
+ * @param int $postCode
118
+ * @param string $countryCode
119
+ * @param int $limit
120
+ * @param string $street
121
+ * @param string $locale Allowed values are en, sv, no, da and fi
122
+ * @param bool $gls
123
+ * @return array
124
+ */
125
+ public function getTransitTimeInformation($apiKey, $dataParams = array())
126
+ {
127
+ $start = microtime();
128
+ $params = array(
129
+ 'apikey' => $apiKey,
130
+ 'serviceCode' => $dataParams['serviceCode'],
131
+ 'serviceGroupCode' => strtoupper($dataParams['serviceGroupCode']),
132
+ 'fromAddressPostalCode' => $dataParams['fromAddressPostalCode'],
133
+ 'fromAddressCountryCode' => strtoupper($dataParams['fromAddressCountryCode']),
134
+ 'toAddressPostalCode' => $dataParams['toAddressPostalCode'],
135
+ 'toAddressCountryCode' => strtoupper($dataParams['toAddressCountryCode'])
136
+ );
137
+
138
+ $url = self::POSTNORD_API_URL . 'transport/v1/transittime/getTransitTimeInformation.json';
139
+ $client = new Zend_Http_Client($url);
140
+
141
+ $client->setParameterGet($params);
142
+
143
+ $result['postnord'] = array();
144
+
145
+ try {
146
+ $response = $client->request();
147
+
148
+ if($response->getStatus() == 200){
149
+ $body = $response->getBody();
150
+ $res = Mage::helper('core')->jsonDecode($body);
151
+ $result['postnord'] = $res;
152
+
153
+ }else{
154
+ $result['postnord']['error'] = true;
155
+ $result['postnord']['message'] = "API returned error with code {$response->getStatus()}";
156
+ }
157
+ } catch (Exception $ex) {
158
+ $result['postnord']['error'] = true;
159
+ $result['postnord']['message'] = $ex->getMessage();
160
+ }
161
+
162
+ $result['time'] = microtime()- $start;
163
+ return $result;
164
+ }
165
+
166
+ }
app/code/community/Vconnect/AllInOne/Model/Carrier/Postnord.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOne_Model_Carrier_Postnord
29
+ */
30
+ class Vconnect_AllInOne_Model_Carrier_Postnord
31
+ extends Mage_Shipping_Model_Carrier_Abstract
32
+ implements Mage_Shipping_Model_Carrier_Interface
33
+ {
34
+
35
+ /**
36
+ * code name
37
+ *
38
+ * @var string
39
+ */
40
+ protected $_code = 'vconnect_postnord';
41
+
42
+ /**
43
+ * boolean isFixed
44
+ *
45
+ * @var boolean
46
+ */
47
+ protected $_isFixed = true;
48
+
49
+ /**
50
+ *
51
+ * @return Vconnect_AllInOne_Helper_Data
52
+ */
53
+ public function helper()
54
+ {
55
+ return Mage::helper('vc_aio');
56
+ }
57
+
58
+ /**
59
+ * Collect and get rates
60
+ *
61
+ * @param Mage_Shipping_Model_Rate_Request $request
62
+ * @return Mage_Shipping_Model_Rate_Result
63
+ */
64
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
65
+ {
66
+ if (!$this->getConfigFlag('active') || !$this->getConfigFlag('license_status')) {
67
+ return false;
68
+ }
69
+ if(!$request->getCountryId()){
70
+ return Mage::log('PostNord: No origin country');
71
+ }
72
+ // exclude Virtual products price from Package value if pre-configured
73
+ if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {
74
+ foreach ($request->getAllItems() as $item) {
75
+ if ($item->getParentItem()) {
76
+ continue;
77
+ }
78
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
79
+ foreach ($item->getChildren() as $child) {
80
+ if ($child->getProduct()->isVirtual()) {
81
+ $request->setPackageValue($request->getPackageValueWithDiscount() - $child->getBaseRowTotal());
82
+ }
83
+ }
84
+ } elseif ($item->getProduct()->isVirtual()) {
85
+ $request->setPackageValue($request->getPackageValueWithDiscount() - $item->getBaseRowTotal());
86
+ }
87
+ }
88
+ }
89
+
90
+ // Free shipping by qty
91
+ $freeQty = 0;
92
+ if ($request->getAllItems()) {
93
+ foreach ($request->getAllItems() as $item) {
94
+ if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
95
+ continue;
96
+ }
97
+
98
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
99
+ foreach ($item->getChildren() as $child) {
100
+ if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
101
+ $freeQty += $item->getQty() * ($child->getQty() - (is_numeric($child->getFreeShipping()) ? $child->getFreeShipping() : 0));
102
+ }
103
+ }
104
+ } elseif ($item->getFreeShipping()) {
105
+ $freeQty += ($item->getQty() - (is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0));
106
+ }
107
+ }
108
+ }
109
+
110
+ // Package weight and qty free shipping
111
+ $oldWeight = $request->getPackageWeight();
112
+ $oldQty = $request->getPackageQty();
113
+
114
+ $request->setPackageWeight($request->getFreeMethodWeight());
115
+ $request->setPackageQty($oldQty - $freeQty);
116
+
117
+ $request->setPackageWeight($oldWeight);
118
+ $request->setPackageQty($oldQty);
119
+
120
+ $result = Mage::getModel('shipping/rate_result');
121
+ /* @var $result Mage_Shipping_Model_Rate_Result */
122
+ $methods = new Varien_Data_Collection();
123
+ Mage::dispatchEvent('vconnect_postnord_collect_shipping_methods',array(
124
+ 'request' => $request,
125
+ 'methods' => $methods,
126
+ ));
127
+ if(!$methods->count()){
128
+ return false;
129
+ }
130
+
131
+ $items = $methods->getItems();
132
+ usort($items, function($a,$b){
133
+ if (isset($a['system_path']) && isset($b['system_path'])) {
134
+ $a['sort_order'] = (int)Mage::getStoreConfig("carriers/{$a['system_path']}/sort_order");
135
+ $b['sort_order'] = (int)Mage::getStoreConfig("carriers/{$b['system_path']}/sort_order");
136
+ if ($a['sort_order'] == $b['sort_order']) {
137
+ return 0;
138
+ }
139
+ return ($a['sort_order'] < $b['sort_order']) ? -1 : 1;
140
+ } else {
141
+ return 0;
142
+ }
143
+ });
144
+
145
+ foreach ( $items as $_method ){
146
+ $method = $this->_createShippingMethodByCode($request,$freeQty,$_method );
147
+ if( !$method ) {
148
+ continue;
149
+ }
150
+ $result->append($method);
151
+ }
152
+
153
+ return $result;
154
+ }
155
+ /**
156
+ * Get price rate for order with specific weight and subtotal
157
+ * @param float $orderPrice
158
+ * @param float $orderWeight
159
+ * @param Varien_Object $config method configuration
160
+ * @return float
161
+ */
162
+ public function getRate($orderPrice, $orderWeight, Varien_Object $config )
163
+ {
164
+ $code = $config->getSystemPath();
165
+ Mage::log("destination coutnry {$config->getDestCountry()}");
166
+ if($config->getMultiprices()){
167
+ $ratePath = sprintf('carriers/%s/price_%s',$code, $config->getDestCountry());
168
+ }else{
169
+ $ratePath = sprintf('carriers/%s/%s',$code, $config->getPriceCode());
170
+ }
171
+
172
+ $result = Mage::getStoreConfig($ratePath);
173
+ if(!$result){
174
+ Mage::log("no rate for code $code and path $ratePath" );
175
+
176
+ return FALSE;
177
+ }
178
+ $pickupShippingRates = unserialize($result);
179
+ if (is_array($pickupShippingRates) && !empty($pickupShippingRates)) {
180
+ foreach ($pickupShippingRates as $pickupShippingRate) {
181
+ if( (float)$pickupShippingRate['orderminprice'] <= (float)$orderPrice
182
+ && ( (float)$pickupShippingRate['ordermaxprice'] >= (float)$orderPrice || (float)$pickupShippingRate['ordermaxprice'] == 0)
183
+ && (float)$pickupShippingRate['orderminweight'] <= (float)$orderWeight
184
+ && ( (float)$pickupShippingRate['ordermaxweight'] >= (float)$orderWeight || (float)$pickupShippingRate['ordermaxweight'] == 0)
185
+ ) {
186
+ return $pickupShippingRate['price'];
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+ /**
193
+ *
194
+ * @param Mage_Shipping_Model_Rate_Request $request
195
+ * @param string $code
196
+ * @param float $freeQty
197
+ * @param array $data Method data
198
+ * @param Vconnect_AllInOne_Model_Carrier_Postnord $carrier carrier object
199
+ * @return Mage_Shipping_Model_Rate_Result_Method|Bool
200
+ */
201
+ protected function _createShippingMethodByCode(Mage_Shipping_Model_Rate_Request $request,
202
+ $freeQty , Varien_Object $data )
203
+ {
204
+ $code = $data->getSystemPath();
205
+ $methodCode = $data->getMethod();
206
+
207
+ Mage::log( ("$code is active:") . ( Mage::getStoreConfig("carriers/$code/active")?'yes':'no' ) );
208
+ if( !Mage::getStoreConfig("carriers/$code/active") ){
209
+ return false;
210
+ }
211
+ $data->setCountry(strtolower($request->getCountryId()));
212
+ $data->setDestCountry(strtolower($request->getDestCountryId()));
213
+ $data->setDeliveryTime(Mage::getStoreConfig("carriers/$code/transit_time")?:false);
214
+ $rate = $this->getRate($request->getPackageValueWithDiscount(), $request->getPackageWeight(), $data);
215
+ if(!$rate) {
216
+ Mage::log("No price rate for $code");
217
+ return false;
218
+ }
219
+ $method = Mage::getModel('shipping/rate_result_method');
220
+ /* @var $method Mage_Shipping_Model_Rate_Result_Method */
221
+ $method->setCarrier($this->getCarrierCode())->setCarrierTitle($this->getConfigData('title'));
222
+ $method->setVcMethodData($data->toJson());
223
+
224
+ $method->setMethod($methodCode)->setMethodTitle(Mage::getStoreConfig("carriers/$code/name"));
225
+
226
+ if ($request->getFreeShipping() === true || ($request->getPackageQty() == $freeQty)) {
227
+ $shippingPrice = 0;
228
+ } else {
229
+ $shippingPrice = $this->getFinalPriceWithHandlingFee($rate);
230
+ }
231
+
232
+ $method->setPrice($shippingPrice)->setCost($rate);
233
+
234
+ return $method;
235
+ }
236
+ /**
237
+ * Get allowed shipping methods
238
+ *
239
+ * @return array
240
+ */
241
+ public function getAllowedMethods()
242
+ {
243
+ return array(
244
+ $this->_code . '_private' => Mage::getStoreConfig('carrier/vconnect_postnord_home/name'),
245
+ $this->_code . '_commercial' => Mage::getStoreConfig('carrier/vconnect_postnord_business/name'),
246
+ $this->_code . '_pickup' => Mage::getStoreConfig('carrier/vconnect_postnord_pickup/name'),
247
+ $this->_code . '_mailbox' => Mage::getStoreConfig('carrier/vconnect_postnord_mailbox/name'),
248
+ );
249
+ }
250
+
251
+ }
app/code/community/Vconnect/AllInOne/Model/Creditmemo/Environmentaltotal.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Creditmemo_Environmentaltotal
30
+ */
31
+ class Vconnect_AllInOne_Model_Creditmemo_Environmentaltotal extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
32
+ {
33
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
34
+ {
35
+ if ($creditmemo->getOrder()->hasCreditmemos() != 0 || !$creditmemo->getOrder()->getVconnectPostnordData()) {
36
+ return $this;
37
+ }
38
+
39
+ $fee = 0;
40
+ $fee_base = 0;
41
+
42
+ $data = Mage::helper('core')->jsonDecode($creditmemo->getOrder()->getVconnectPostnordData(),true);
43
+ if (!empty($data['environmental_fee'])) {
44
+ $fee = 10;
45
+ $fee_base = 10;
46
+ }
47
+
48
+ $baseCurrencyCode = Mage::app()->getStore($creditmemo->getOrder()->getStoreId())->getBaseCurrencyCode();
49
+ $orderCurrencyCode = $creditmemo->getOrder()->getOrderCurrencyCode();
50
+
51
+ if ($baseCurrencyCode != $orderCurrencyCode) {
52
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
53
+ }
54
+
55
+ if (!$fee) {
56
+ return $this;
57
+ }
58
+
59
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $fee_base);
60
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $fee);
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Vconnect/AllInOne/Model/Creditmemo/Total.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Creditmemo_Total
30
+ */
31
+ class Vconnect_AllInOne_Model_Creditmemo_Total extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
32
+ {
33
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
34
+ {
35
+ if ($creditmemo->getOrder()->hasCreditmemos() != 0 || !$creditmemo->getOrder()->getVconnectPostnordData()) {
36
+ return $this;
37
+ }
38
+
39
+ $fee = 0;
40
+ $fee_base = 0;
41
+
42
+ $data = Mage::helper('core')->jsonDecode($creditmemo->getOrder()->getVconnectPostnordData(),true);
43
+ if (!empty($data['additional_fee_amount'])) {
44
+ $fee = $data['additional_fee_amount'];
45
+ $fee_base = $data['additional_fee_amount'];
46
+ }
47
+
48
+ $baseCurrencyCode = Mage::app()->getStore($creditmemo->getOrder()->getStoreId())->getBaseCurrencyCode();
49
+ $orderCurrencyCode = $creditmemo->getOrder()->getOrderCurrencyCode();
50
+
51
+ if ($baseCurrencyCode != $orderCurrencyCode) {
52
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
53
+ }
54
+
55
+ if (!$fee) {
56
+ return $this;
57
+ }
58
+
59
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $fee_base);
60
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $fee);
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Vconnect/AllInOne/Model/Invoice/Environmentaltotal.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Invoice_Environmentaltotal
30
+ */
31
+ class Vconnect_AllInOne_Model_Invoice_Environmentaltotal extends Mage_Sales_Model_Order_Invoice_Total_Abstract
32
+ {
33
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
34
+ {
35
+ if ($invoice->getOrder()->hasInvoices() != 0 || !$invoice->getOrder()->getVconnectPostnordData()) {
36
+ return $this;
37
+ }
38
+
39
+ $fee = 0;
40
+ $fee_base = 0;
41
+
42
+ $data = Mage::helper('core')->jsonDecode($invoice->getOrder()->getVconnectPostnordData(),true);
43
+ if (!empty($data['environmental_fee'])) {
44
+ $fee = 10;
45
+ $fee_base = 10;
46
+ }
47
+
48
+ $baseCurrencyCode = Mage::app()->getStore($invoice->getOrder()->getStoreId())->getBaseCurrencyCode();
49
+ $orderCurrencyCode = $invoice->getOrder()->getOrderCurrencyCode();
50
+
51
+ if ($baseCurrencyCode != $orderCurrencyCode) {
52
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
53
+ }
54
+
55
+ if (!$fee) {
56
+ return $this;
57
+ }
58
+
59
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $fee);
60
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $fee_base);
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Vconnect/AllInOne/Model/Invoice/Pdf/Environmentaltotal.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Invoice_Pdf_Environmentaltotal
30
+ */
31
+ class Vconnect_AllInOne_Model_Invoice_Pdf_Environmentaltotal extends Mage_Sales_Model_Order_Pdf_Total_Default
32
+ {
33
+ public function getTotalsForDisplay()
34
+ {
35
+ $fee = $this->getAmount();
36
+ $order = $this->getOrder();
37
+ $incl = $order->formatPriceTxt($fee['incl']);
38
+ $excl = $order->formatPriceTxt($fee['excl']);
39
+ if ($this->getAmountPrefix()) {
40
+ $incl = $this->getAmountPrefix() . $incl;
41
+ $excl = $this->getAmountPrefix() . $excl;
42
+ }
43
+
44
+ $label = Mage::helper('sales')->__($this->getTitle()) . ':';
45
+
46
+ if ($this->canDisplay() && $order->getVconnectPostnordData()) {
47
+ $data = Mage::helper('core')->jsonDecode($order->getVconnectPostnordData(),true);
48
+ $label = Mage::helper('vc_aio')->__('Environmental Fee');
49
+ }
50
+
51
+ $storeId = Mage::app()->getStore()->getId();
52
+ $vatOption = Mage::getStoreConfig('tax/sales_display/price', $storeId);
53
+ $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
54
+
55
+ $totals = array();
56
+ /**
57
+ * 1 : Show exluding tax
58
+ * 2 : Show including tax
59
+ * 3 : Show both
60
+ */
61
+ if ($vatOption == '1' || $vatOption == '3') {
62
+ $total = array(
63
+ 'amount' => $excl,
64
+ 'font_size' => $fontSize
65
+ );
66
+ $exclLabel = $label;
67
+ if ($vatOption == '3') {
68
+ $exclLabel .= ' (Excl.Tax)';
69
+ }
70
+ $total['label'] = $exclLabel;
71
+ $totals[] = $total;
72
+ }
73
+ if ($vatOption == '2' || $vatOption == '3') {
74
+ $total = array(
75
+ 'amount' => $incl,
76
+ 'font_size' => $fontSize
77
+ );
78
+ $inclLabel = $label;
79
+ if ($vatOption == '3') {
80
+ $inclLabel .= ' (Incl.Tax)';
81
+ }
82
+ $total['label'] = $inclLabel;
83
+ $totals[] = $total;
84
+ }
85
+
86
+ return $totals;
87
+ }
88
+
89
+ public function canDisplay()
90
+ {
91
+ $amount = $this->getAmount();
92
+ return ($amount['incl'] !== 0);
93
+ }
94
+
95
+ public function getAmount()
96
+ {
97
+ $fee = 0;
98
+ $fee_base = 0;
99
+
100
+ if (!$this->getOrder()->getVconnectPostnordData()) {
101
+ return array(
102
+ 'incl' => $fee,
103
+ 'excl' => $fee
104
+ );
105
+ }
106
+
107
+ $data = Mage::helper('core')->jsonDecode($this->getOrder()->getVconnectPostnordData(),true);
108
+ if (!empty($data['environmental_fee'])) {
109
+ $fee = 10;
110
+ $fee_base = 10;
111
+ }
112
+
113
+ $baseCurrencyCode = Mage::app()->getStore($this->getOrder()->getStoreId())->getBaseCurrencyCode();
114
+ $orderCurrencyCode = $this->getOrder()->getOrderCurrencyCode();
115
+
116
+ if ($baseCurrencyCode != $orderCurrencyCode) {
117
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
118
+ }
119
+
120
+ return array(
121
+ 'incl' => $fee,
122
+ 'excl' => $fee
123
+ );
124
+ }
125
+
126
+ }
app/code/community/Vconnect/AllInOne/Model/Invoice/Pdf/Total.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Invoice_Pdf_Total
30
+ */
31
+ class Vconnect_AllInOne_Model_Invoice_Pdf_Total extends Mage_Sales_Model_Order_Pdf_Total_Default
32
+ {
33
+ public function getTotalsForDisplay()
34
+ {
35
+ $fee = $this->getAmount();
36
+ $order = $this->getOrder();
37
+ $incl = $order->formatPriceTxt($fee['incl']);
38
+ $excl = $order->formatPriceTxt($fee['excl']);
39
+ if ($this->getAmountPrefix()) {
40
+ $incl = $this->getAmountPrefix() . $incl;
41
+ $excl = $this->getAmountPrefix() . $excl;
42
+ }
43
+
44
+ $label = Mage::helper('sales')->__($this->getTitle()) . ':';
45
+
46
+ if ($this->canDisplay() && $order->getVconnectPostnordData()) {
47
+ $data = Mage::helper('core')->jsonDecode($order->getVconnectPostnordData(),true);
48
+ $label = $data['additional_fee_label'];
49
+ }
50
+
51
+ $storeId = Mage::app()->getStore()->getId();
52
+ $vatOption = Mage::getStoreConfig('tax/sales_display/price', $storeId);
53
+ $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
54
+
55
+ $totals = array();
56
+ /**
57
+ * 1 : Show exluding tax
58
+ * 2 : Show including tax
59
+ * 3 : Show both
60
+ */
61
+ if ($vatOption == '1' || $vatOption == '3') {
62
+ $total = array(
63
+ 'amount' => $excl,
64
+ 'font_size' => $fontSize
65
+ );
66
+ $exclLabel = $label;
67
+ if ($vatOption == '3') {
68
+ $exclLabel .= ' (Excl.Tax)';
69
+ }
70
+ $total['label'] = $exclLabel;
71
+ $totals[] = $total;
72
+ }
73
+ if ($vatOption == '2' || $vatOption == '3') {
74
+ $total = array(
75
+ 'amount' => $incl,
76
+ 'font_size' => $fontSize
77
+ );
78
+ $inclLabel = $label;
79
+ if ($vatOption == '3') {
80
+ $inclLabel .= ' (Incl.Tax)';
81
+ }
82
+ $total['label'] = $inclLabel;
83
+ $totals[] = $total;
84
+ }
85
+
86
+ return $totals;
87
+ }
88
+
89
+ public function canDisplay()
90
+ {
91
+ $amount = $this->getAmount();
92
+ return ($amount['incl'] !== 0);
93
+ }
94
+
95
+ public function getAmount()
96
+ {
97
+ $fee = 0;
98
+ $fee_base = 0;
99
+
100
+ if (!$this->getOrder()->getVconnectPostnordData()) {
101
+ return array(
102
+ 'incl' => $fee,
103
+ 'excl' => $fee
104
+ );
105
+ }
106
+
107
+ $data = Mage::helper('core')->jsonDecode($this->getOrder()->getVconnectPostnordData(),true);
108
+ if (!empty($data['additional_fee_amount'])) {
109
+ $fee = $data['additional_fee_amount'];
110
+ $fee_base = $data['additional_fee_amount'];
111
+ }
112
+
113
+ $baseCurrencyCode = Mage::app()->getStore($this->getOrder()->getStoreId())->getBaseCurrencyCode();
114
+ $orderCurrencyCode = $this->getOrder()->getOrderCurrencyCode();
115
+
116
+ if ($baseCurrencyCode != $orderCurrencyCode) {
117
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
118
+ }
119
+
120
+ return array(
121
+ 'incl' => $fee,
122
+ 'excl' => $fee
123
+ );
124
+ }
125
+
126
+ }
app/code/community/Vconnect/AllInOne/Model/Invoice/Total.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Invoice_Total
30
+ */
31
+ class Vconnect_AllInOne_Model_Invoice_Total extends Mage_Sales_Model_Order_Invoice_Total_Abstract
32
+ {
33
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
34
+ {
35
+ if ($invoice->getOrder()->hasInvoices() != 0 || !$invoice->getOrder()->getVconnectPostnordData()) {
36
+ return $this;
37
+ }
38
+
39
+ $fee = 0;
40
+ $fee_base = 0;
41
+
42
+ $data = Mage::helper('core')->jsonDecode($invoice->getOrder()->getVconnectPostnordData(),true);
43
+ if (!empty($data['additional_fee_amount'])) {
44
+ $fee = $data['additional_fee_amount'];
45
+ $fee_base = $data['additional_fee_amount'];
46
+ }
47
+
48
+ $baseCurrencyCode = Mage::app()->getStore($invoice->getOrder()->getStoreId())->getBaseCurrencyCode();
49
+ $orderCurrencyCode = $invoice->getOrder()->getOrderCurrencyCode();
50
+
51
+ if ($baseCurrencyCode != $orderCurrencyCode) {
52
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $orderCurrencyCode);
53
+ }
54
+
55
+ if (!$fee) {
56
+ return $this;
57
+ }
58
+
59
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $fee);
60
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $fee_base);
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Vconnect/AllInOne/Model/Observer.php ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOne_Model_Observer
29
+ */
30
+ class Vconnect_AllInOne_Model_Observer
31
+ {
32
+ /**
33
+ *
34
+ * @param Varien_Event_Observer $observer
35
+ */
36
+ public function injectPopupCode(Varien_Event_Observer $observer)
37
+ {
38
+ $block = $observer->getBlock();
39
+ if ($block instanceof Mage_Checkout_Block_Onepage_Shipping_Method_Available || $block instanceof Vconnect_AllInOne_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form || (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout' && $block instanceof Mage_Checkout_Block_Cart_Shipping)) {
40
+ $transport = $observer->getTransport();
41
+ $html = $transport->getHtml();
42
+ if( stripos($html, 'vconnect_') !== false ){
43
+ $_block = Mage::app()->getLayout()->createBlock('vc_aio/shipping_dialog');
44
+ $color = strtolower(Mage::getStoreConfig('shipping/origin/country_id'))=='dk'?'red':'blue';
45
+ $_block->setColor($color);
46
+ /* @var $_block Vconnect_AllInOne_Block_Shipping_Dialog */
47
+ Mage::dispatchEvent('vconnect_shipping_methods_ui_collect', array(
48
+ 'block'=>$_block));
49
+ $newHtml = $_block->toHtml();
50
+ $html .= $newHtml;
51
+ }
52
+ $transport->setHtml($html);
53
+ }
54
+ }
55
+
56
+ /**
57
+ *
58
+ * @param Varien_Event_Observer $observer
59
+ */
60
+ public function shippingMethodsUiCollect(Varien_Event_Observer $observer) {
61
+ $block = $observer->getEvent()->getBlock();
62
+ /* @var $block Vconnect_AllInOne_Block_Shipping_Dialog */
63
+
64
+ if(!$block instanceof Vconnect_AllInOne_Block_Shipping_Dialog){
65
+ return;
66
+ }
67
+ $rates = $block->getRates();
68
+ foreach ($rates as $data){
69
+ if(!isset($data['vc_method_data']) || !$data['vc_method_data']){
70
+ continue;
71
+ }
72
+ $_data = json_decode($data['vc_method_data'],true);
73
+ $countryCode = strtolower($_data['country']);
74
+ $methodCode = $_data['method'];
75
+ $templatePath = $_data['template'];
76
+
77
+ foreach (array('tabHeader','tabScripts') as $template){
78
+ $b = Mage::app()->getLayout()->createBlock('core/template');
79
+ $b->setData($data);
80
+ $b->setConfig($_data);
81
+ $templateTypePath = Mage::getStoreConfigFlag('carriers/vconnect_postnord/popup')?'aio':'aio_base';
82
+ if (Mage::app()->getStore()->isAdmin()) {
83
+ $templateTypePath = 'aio_base_createorder';
84
+ }
85
+ if (!Mage::getStoreConfigFlag('carriers/vconnect_postnord/popup') && Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout') {
86
+ $templateTypePath = 'klarnacheckout/aio_base';
87
+ }
88
+ $b->setTemplate("vconnect/$templateTypePath/$templatePath/$template.phtml");
89
+ $templateFile = Mage::getBaseDir('design') . DS . $b->getTemplateFile();
90
+ if (! file_exists($templateFile)) {
91
+ Mage::log("Template file doesn't exists :$countryCode - $methodCode - $templateFile");
92
+ continue;
93
+ }
94
+ $action = sprintf('add%s', ucfirst($template));
95
+ if(is_callable(array($block,$action))){
96
+ $block->$action($b);
97
+ }
98
+
99
+ }
100
+ }
101
+ }
102
+
103
+ /**
104
+ * @param Varien_Event_Observer $observer
105
+ */
106
+ public function saveQuoteOnestepcheckout(Varien_Event_Observer $observer)
107
+ {
108
+ $post = Mage::app()->getRequest()->getPost();
109
+
110
+ // Fix for KlarnaCheckout
111
+ if ($observer->getEvent()->hasQuote() && Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout' && !empty($post) && !empty($post['payment_ain_vconnect_postnord_data']) && !empty($post['estimate_method'])) {
112
+ $quote = $observer->getEvent()->getQuote();
113
+
114
+ if (strpos($post['estimate_method'], 'vconnect_postnord_') === false || empty($post['payment_ain_vconnect_postnord_data'])) {
115
+ $quote->setData('vconnect_postnord_data', null);
116
+ $quote->save();
117
+ return;
118
+ }
119
+
120
+ $data = $post['payment_ain_vconnect_postnord_data'];
121
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$post['estimate_method']);
122
+ if (isset($rate['vc_method_data']) && !empty($data)) {
123
+ $_data = json_decode($rate['vc_method_data'],true);
124
+ if(isset($_data['system_path'])) {
125
+ $data = json_decode($data,true);
126
+
127
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
128
+ if ($additional_fee_data['label_with_price'] == $data['arrival']) {
129
+ $data['additional_fee_amount'] = $additional_fee_data['price_base'];
130
+ $data['additional_fee_label'] = $additional_fee_data['label'];
131
+ }
132
+
133
+ $data = json_encode($data);
134
+ }
135
+ }
136
+
137
+ if ($rate && !empty($rate['method_title'])) {
138
+ $data = json_decode($data,true);
139
+ $data['description'] = $rate['method_title'] . ': ' . $data['description'];
140
+ $data = json_encode($data);
141
+ }
142
+
143
+ Mage::getSingleton('checkout/session')->setVconnectPostnordSessionData(json_decode($data,true));
144
+
145
+ $quote->setData('vconnect_postnord_data', $data);
146
+ $quote->save();
147
+
148
+ } // Fix for Onestepcheckout
149
+ else if (!(!$observer->getEvent()->hasQuote() || Mage::app()->getRequest()->getModuleName() != 'onestepcheckout' || empty($post) || !empty($post['vconnect_postnord_data']) || empty($post['shipping_method']))) {
150
+ $quote = $observer->getEvent()->getQuote();
151
+
152
+ if (strpos($post['shipping_method'], 'vconnect_postnord_') === false || empty($post['payment_ain_vconnect_postnord_data'])) {
153
+ $quote->setData('vconnect_postnord_data', null);
154
+ $quote->save();
155
+ return;
156
+ }
157
+
158
+ $arrival = Mage::app()->getRequest()->getPost($post['shipping_method'].'_arrival');
159
+ $deliver = Mage::app()->getRequest()->getPost($post['shipping_method'].'_delivery');
160
+ $otherTxt = Mage::app()->getRequest()->getPost($post['shipping_method'].'_other');
161
+ if ($arrival || $deliver || $otherTxt) {
162
+ return;
163
+ }
164
+
165
+ $data = $post['payment_ain_vconnect_postnord_data'];
166
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$post['shipping_method']);
167
+ if (isset($rate['vc_method_data']) && !empty($data)) {
168
+ $_data = json_decode($rate['vc_method_data'],true);
169
+ if(isset($_data['system_path'])) {
170
+ $data = json_decode($data,true);
171
+
172
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
173
+ if ($additional_fee_data['label_with_price'] == $data['arrival']) {
174
+ $data['additional_fee_amount'] = $additional_fee_data['price_base'];
175
+ $data['additional_fee_label'] = $additional_fee_data['label'];
176
+ }
177
+
178
+ $data = json_encode($data);
179
+ }
180
+ }
181
+
182
+ if ($rate && !empty($rate['method_title'])) {
183
+ $data = json_decode($data,true);
184
+ $data['description'] = $rate['method_title'] . ': ' . $data['description'];
185
+ $data = json_encode($data);
186
+ }
187
+
188
+ $quote->setData('vconnect_postnord_data', $data);
189
+ $quote->save();
190
+ }
191
+ }
192
+
193
+ /**
194
+ * @param Varien_Event_Observer $observer
195
+ */
196
+ public function saveShipping(Varien_Event_Observer $observer)
197
+ {
198
+
199
+ if (!$observer->getEvent()->hasQuote()) {
200
+ return;
201
+ }
202
+
203
+ $quote = $observer->getEvent()->getQuote();
204
+ /* @var $quote Mage_Sales_Model_Quote */
205
+
206
+ Mage::log($observer->getRequest()->getPost());
207
+ $method = $observer->getRequest()->getPost('shipping_method');
208
+ if(strpos($method, 'vconnect_postnord_') === false){
209
+ $quote->setData('vconnect_postnord_data', null);
210
+ $quote->save();
211
+ return;
212
+ }
213
+ if(!Mage::getStoreConfigFlag('carriers/vconnect_postnord/active',$quote->getStoreId())){
214
+ $quote->setData('vconnect_postnord_data', null);
215
+ $quote->save();
216
+ return;
217
+ }
218
+
219
+ if ($observer->getRequest()->getPost('vconnect_postnord_data', false)) {
220
+ $data = $observer->getRequest()
221
+ ->getPost('vconnect_postnord_data');
222
+
223
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$method);
224
+ if (isset($rate['vc_method_data']) && !empty($data)) {
225
+ $_data = json_decode($rate['vc_method_data'],true);
226
+ if(isset($_data['system_path'])) {
227
+ $data = json_decode($data,true);
228
+
229
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
230
+ if ($additional_fee_data['label_with_price'] == $data['arrival']) {
231
+ $data['additional_fee_amount'] = $additional_fee_data['price_base'];
232
+ $data['additional_fee_label'] = $additional_fee_data['label'];
233
+ }
234
+
235
+ $data = json_encode($data);
236
+ }
237
+ }
238
+
239
+ if ($rate && !empty($rate['method_title'])) {
240
+ $data = json_decode($data,true);
241
+ $data['description'] = $rate['method_title'] . ': ' . $data['description'];
242
+ $data = json_encode($data);
243
+ }
244
+
245
+ $quote->setData('vconnect_postnord_data', $data);
246
+ $quote->save();
247
+ }
248
+ else {
249
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$method);
250
+
251
+
252
+ $arrival = $observer->getRequest()->getPost($method.'_arrival');
253
+ $deliver = $observer->getRequest()->getPost($method.'_delivery');
254
+ $otherTxt = $observer->getRequest()->getPost($method.'_other');
255
+
256
+ if ($arrival) {
257
+ if (isset($rate['vc_method_data'])) {
258
+ $_data = json_decode($rate['vc_method_data'],true);
259
+ if(isset($_data['system_path'])) {
260
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
261
+ if ($additional_fee_data['label_with_price'] == $arrival) {
262
+ $additional_fee_amount = $additional_fee_data['price_base'];
263
+ $additional_fee_label = $additional_fee_data['label'];
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ $flexDelivery = false;
270
+ if(isset($rate['vc_method_data'])){
271
+ $_data = json_decode($rate['vc_method_data'],true);
272
+
273
+ if(isset($_data['delivery']['Flex Delivery'])
274
+ && in_array($deliver, $_data['delivery']['Flex Delivery'])){
275
+ $flexDelivery = $otherTxt?:$deliver;
276
+ }
277
+ }
278
+
279
+ $description = sprintf('%s:%s%s%s',$rate['method_title'],$arrival,$deliver?" / $deliver":'',$otherTxt?" - $otherTxt":'');
280
+ $data = array(
281
+ 'code' => $method,
282
+ 'carrier' => $rate['carrier_title'],
283
+ 'arrival' => $arrival,
284
+ 'delivery' => $deliver,
285
+ 'flexdelivery' => $flexDelivery,
286
+ 'description' => $description,
287
+ );
288
+
289
+ if (isset($additional_fee_amount) && isset($additional_fee_label)) {
290
+ $data['additional_fee_amount'] = $additional_fee_amount;
291
+ $data['additional_fee_label'] = $additional_fee_label;
292
+ }
293
+
294
+ if ($observer->getRequest()->getPost('vconnect_postnord_environmental_fee')) {
295
+ $data['environmental_fee'] = 1;
296
+ }
297
+
298
+ $quote->setData('vconnect_postnord_data', Mage::helper('core')->jsonEncode($data));
299
+ $quote->save();
300
+ }
301
+ }
302
+
303
+ /**
304
+ * @param Varien_Event_Observer $observer
305
+ */
306
+ public function saveAdminShipping(Varien_Event_Observer $observer)
307
+ {
308
+ $model = $observer->getEvent()->getOrderCreateModel();
309
+
310
+ if (!$model->getQuote()->getId()) {
311
+ return;
312
+ }
313
+
314
+ $quote = $model->getQuote();
315
+ /* @var $quote Mage_Sales_Model_Quote */
316
+
317
+ $post_order = $observer->getRequest('order');
318
+
319
+ if (empty($post_order['shipping_method'])) {
320
+ return;
321
+ }
322
+
323
+ $method = $post_order['shipping_method'];
324
+
325
+ if(strpos($method, 'vconnect_postnord_') === false){
326
+ $quote->setData('vconnect_postnord_data', null);
327
+ $quote->save();
328
+ return;
329
+ }
330
+ if(!Mage::getStoreConfigFlag('carriers/vconnect_postnord/active',$quote->getStoreId())){
331
+ $quote->setData('vconnect_postnord_data', null);
332
+ $quote->save();
333
+ return;
334
+ }
335
+
336
+ if ($observer->getRequest('payment_ain_vconnect_postnord_data', false)) {
337
+ $data = $observer->getRequest('payment_ain_vconnect_postnord_data');
338
+
339
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$method);
340
+ if (isset($rate['vc_method_data']) && !empty($data)) {
341
+ $_data = json_decode($rate['vc_method_data'],true);
342
+ if(isset($_data['system_path'])) {
343
+ $data = json_decode($data,true);
344
+
345
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
346
+ if ($additional_fee_data['label_with_price'] == $data['arrival']) {
347
+ $data['additional_fee_amount'] = $additional_fee_data['price_base'];
348
+ $data['additional_fee_label'] = $additional_fee_data['label'];
349
+ }
350
+
351
+ $data = json_encode($data);
352
+ }
353
+ }
354
+
355
+ if ($rate && !empty($rate['method_title'])) {
356
+ $data = json_decode($data,true);
357
+ $data['description'] = $rate['method_title'] . ': ' . $data['description'];
358
+ $data = json_encode($data);
359
+ }
360
+
361
+ if ($observer->getRequest('vconnect_postnord_environmental_fee')) {
362
+ $data = json_decode($data,true);
363
+ $data['environmental_fee'] = 1;
364
+ $data = json_encode($data);
365
+ }
366
+
367
+ $quote->setData('vconnect_postnord_data', $data);
368
+ $quote->save();
369
+ }
370
+ else {
371
+ $rate = Mage::helper('vc_aio')->getRateDetailsByMethodCode($quote,$method);
372
+
373
+
374
+ $arrival = $observer->getRequest($method.'_arrival');
375
+ $deliver = $observer->getRequest($method.'_delivery');
376
+ $otherTxt = $observer->getRequest($method.'_other');
377
+
378
+ if ($arrival) {
379
+ if (isset($rate['vc_method_data'])) {
380
+ $_data = json_decode($rate['vc_method_data'],true);
381
+ if(isset($_data['system_path'])) {
382
+ $additional_fee_data = Mage::helper('vc_aio')->getAdditionalFeeData($_data['system_path']);
383
+ if ($additional_fee_data['label_with_price'] == $arrival) {
384
+ $additional_fee_amount = $additional_fee_data['price_base'];
385
+ $additional_fee_label = $additional_fee_data['label'];
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ $flexDelivery = false;
392
+ if(isset($rate['vc_method_data'])){
393
+ $_data = json_decode($rate['vc_method_data'],true);
394
+
395
+ if(isset($_data['delivery']['Flex Delivery'])
396
+ && in_array($deliver, $_data['delivery']['Flex Delivery'])){
397
+ $flexDelivery = $otherTxt?:$deliver;
398
+ }
399
+ }
400
+
401
+ $description = sprintf('%s:%s%s%s',$rate['method_title'],$arrival,$deliver?" / $deliver":'',$otherTxt?" - $otherTxt":'');
402
+ $data = array(
403
+ 'code' => $method,
404
+ 'carrier' => $rate['carrier_title'],
405
+ 'arrival' => $arrival,
406
+ 'delivery' => $deliver,
407
+ 'flexdelivery' => $flexDelivery,
408
+ 'description' => $description,
409
+ );
410
+
411
+ if (isset($additional_fee_amount) && isset($additional_fee_label)) {
412
+ $data['additional_fee_amount'] = $additional_fee_amount;
413
+ $data['additional_fee_label'] = $additional_fee_label;
414
+ }
415
+
416
+ if ($observer->getRequest('vconnect_postnord_environmental_fee')) {
417
+ $data['environmental_fee'] = 1;
418
+ }
419
+
420
+ $quote->setData('vconnect_postnord_data', Mage::helper('core')->jsonEncode($data));
421
+ $quote->save();
422
+ }
423
+ }
424
+ /**
425
+ *
426
+ * @param Varien_Event_Observer $observer
427
+ * @return Vconnect_Pdkalpha_Model_Observer
428
+ */
429
+ public function salesOrderPlaceAfter(Varien_Event_Observer $observer)
430
+ {
431
+ $order = $observer->getEvent()->getOrder();
432
+ /* @var $order Mage_Sales_Model_Order */
433
+ if(!Mage::getStoreConfigFlag('carriers/vconnect_postnord/active',$order->getStoreId())){
434
+ return;
435
+ }
436
+
437
+ if (stripos($order->getShippingMethod(), 'vconnect_postnord_') === false || !$order->getVconnectPostnordData()) {
438
+ return $this;
439
+ }
440
+
441
+ $data = Mage::helper('core')->jsonDecode($order->getVconnectPostnordData(),true);
442
+ $order->setShippingDescription("{$data['carrier']} - {$data['description']}");
443
+ }
444
+
445
+ public function paypalPrepareLineItems($observer)
446
+ {
447
+ $paypal = $observer->getEvent()->getPaypalCart();
448
+ if (!$paypal->getSalesEntity()->getVconnectPostnordData()) {
449
+ return $this;
450
+ }
451
+
452
+ $data = Mage::helper('core')->jsonDecode($paypal->getSalesEntity()->getVconnectPostnordData(),true);
453
+
454
+ // Environmental fee
455
+ if (!empty($data['environmental_fee'])) {
456
+ $environmental_fee = 10;
457
+ $paypal->addItem(Mage::helper('vc_aio')->__('Environmental Fee'), 1, $environmental_fee);
458
+ }
459
+
460
+ // Additional fee
461
+ if (!empty($data['additional_fee_amount'])) {
462
+ $additional_fee_amount = $data['additional_fee_amount'];
463
+ $additional_fee_label = $data['additional_fee_label'];
464
+ $paypal->addItem($additional_fee_label, 1, $additional_fee_amount);
465
+ }
466
+
467
+ return $this;
468
+ }
469
+
470
+ public function addPaymentFeeTotal($observer)
471
+ {
472
+ $block = $observer->getEvent()->getBlock();
473
+
474
+ if (!in_array($block->getNameInLayout(), array('order_totals', 'invoice_totals', 'creditmemo_totals'))) {
475
+ return;
476
+ }
477
+
478
+ $renderer = $block->getLayout()->createBlock('vc_aio/adminhtml_total_renderer_additionalfee');
479
+ $block->setChild('vc_aio_total_renderer', $renderer);
480
+
481
+ $renderer = $block->getLayout()->createBlock('vc_aio/adminhtml_total_renderer_environmentalfee');
482
+ $block->setChild('vc_aio_total_renderer_environmental', $renderer);
483
+ }
484
+ }
app/code/community/Vconnect/AllInOne/Model/Quote/Address/Rate.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Quote_Address_Shipping_Rate
30
+ */
31
+ class Vconnect_AllInOne_Model_Quote_Address_Rate extends Mage_Sales_Model_Quote_Address_Rate
32
+ {
33
+ public function importShippingRate(Mage_Shipping_Model_Rate_Result_Abstract $rate)
34
+ {
35
+ if ($rate instanceof Mage_Shipping_Model_Rate_Result_Error) {
36
+ $this
37
+ ->setCode($rate->getCarrier().'_error')
38
+ ->setCarrier($rate->getCarrier())
39
+ ->setCarrierTitle($rate->getCarrierTitle())
40
+ ->setErrorMessage($rate->getErrorMessage())
41
+ ;
42
+ } elseif ($rate instanceof Mage_Shipping_Model_Rate_Result_Method) {
43
+ $this
44
+ ->setCode($rate->getCarrier() . '_' . $rate->getMethod())
45
+ ->setCarrier($rate->getCarrier())
46
+ ->setCarrierTitle($rate->getCarrierTitle())
47
+ ->setMethod($rate->getMethod())
48
+ ->setMethodTitle($rate->getMethodTitle())
49
+ ->setMethodDescription($rate->getMethodDescription())
50
+ ->setPrice($rate->getPrice())
51
+ ->setVcMethodData($rate->getVcMethodData())
52
+ ;
53
+ }
54
+ return $this;
55
+ }
56
+ }
app/code/community/Vconnect/AllInOne/Model/Quote/Environmentaltotal.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Quote_Environmentaltotal
30
+ */
31
+ class Vconnect_AllInOne_Model_Quote_Environmentaltotal extends Mage_Sales_Model_Quote_Address_Total_Abstract
32
+ {
33
+ protected $address;
34
+ protected $paymentMethod;
35
+
36
+ public function __construct()
37
+ {
38
+ $this->setCode('vc_aio_environmentalfee');
39
+ }
40
+
41
+ public function collect(Mage_Sales_Model_Quote_Address $address)
42
+ {
43
+ if ($address->getAddressType() != 'shipping') {
44
+ return $this;
45
+ }
46
+
47
+ $this->address = $address;
48
+
49
+ if ($this->address->getQuote()->getId() == null) {
50
+ return $this;
51
+ }
52
+
53
+ $items = $this->address->getAllItems();
54
+ if (!count($items)) {
55
+ return $this;
56
+ }
57
+
58
+ if (Mage::app()->getRequest()->getControllerModule() != 'Avenla_KlarnaCheckout') {
59
+ $payment = $this->address->getQuote()->getPayment();
60
+
61
+ try {
62
+ $this->paymentMethod = $payment->getMethodInstance();
63
+ } catch (Mage_Core_Exception $e) {
64
+ return $this;
65
+ }
66
+
67
+ if (!$this->paymentMethod instanceof Mage_Payment_Model_Method_Abstract) {
68
+ return $this;
69
+ }
70
+ }
71
+
72
+ if (!$this->address->getQuote()->getVconnectPostnordData()) {
73
+ return $this;
74
+ }
75
+
76
+ $fee = 0;
77
+ $fee_base = 0;
78
+
79
+ $data = Mage::helper('core')->jsonDecode($this->address->getQuote()->getVconnectPostnordData(),true);
80
+ if (!empty($data['environmental_fee'])) {
81
+ $fee = 10;
82
+ $fee_base = 10;
83
+ }
84
+
85
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
86
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
87
+
88
+ if ($baseCurrencyCode != $currentCurrencyCode) {
89
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $currentCurrencyCode);
90
+ }
91
+
92
+ if ($fee > 0) {
93
+ if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout') {
94
+ $address->setBaseShippingInclTax($address->getBaseShippingInclTax() + $fee_base);
95
+ $address->setShippingInclTax($address->getShippingInclTax() + $fee);
96
+ }
97
+
98
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $fee_base);
99
+ $address->setGrandTotal($address->getGrandTotal() + $fee);
100
+ }
101
+
102
+ return $this;
103
+ }
104
+
105
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
106
+ {
107
+ if ($address->getAddressType() != 'shipping' || !$address->getQuote()->getVconnectPostnordData()) {
108
+ return $this;
109
+ }
110
+
111
+ $fee = 0;
112
+
113
+ $data = Mage::helper('core')->jsonDecode($address->getQuote()->getVconnectPostnordData(),true);
114
+ if (!empty($data['environmental_fee'])) {
115
+ $fee = 10;
116
+ }
117
+
118
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
119
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
120
+
121
+ if ($baseCurrencyCode != $currentCurrencyCode) {
122
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $currentCurrencyCode);
123
+ }
124
+
125
+ if ($fee > 0) {
126
+ $total = array(
127
+ 'code' => $this->getCode(),
128
+ 'title' => Mage::helper('vc_aio')->__('Environmental Fee'),
129
+ 'value' => $fee,
130
+ );
131
+ $address->addTotal($total);
132
+ }
133
+
134
+ return $this;
135
+ }
136
+ }
app/code/community/Vconnect/AllInOne/Model/Quote/Total.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Quote_Total
30
+ */
31
+ class Vconnect_AllInOne_Model_Quote_Total extends Mage_Sales_Model_Quote_Address_Total_Abstract
32
+ {
33
+ protected $address;
34
+ protected $paymentMethod;
35
+
36
+ public function __construct()
37
+ {
38
+ $this->setCode('vc_aio_additionalfee');
39
+ }
40
+
41
+ public function collect(Mage_Sales_Model_Quote_Address $address)
42
+ {
43
+ if ($address->getAddressType() != 'shipping') {
44
+ return $this;
45
+ }
46
+
47
+ $this->address = $address;
48
+
49
+ if ($this->address->getQuote()->getId() == null) {
50
+ return $this;
51
+ }
52
+
53
+ $items = $this->address->getAllItems();
54
+ if (!count($items)) {
55
+ return $this;
56
+ }
57
+
58
+ if (Mage::app()->getRequest()->getControllerModule() != 'Avenla_KlarnaCheckout') {
59
+ $payment = $this->address->getQuote()->getPayment();
60
+
61
+ try {
62
+ $this->paymentMethod = $payment->getMethodInstance();
63
+ } catch (Mage_Core_Exception $e) {
64
+ return $this;
65
+ }
66
+
67
+ if (!$this->paymentMethod instanceof Mage_Payment_Model_Method_Abstract) {
68
+ return $this;
69
+ }
70
+ }
71
+
72
+ if (!$this->address->getQuote()->getVconnectPostnordData()) {
73
+ return $this;
74
+ }
75
+
76
+ $fee = 0;
77
+ $fee_base = 0;
78
+
79
+ $data = Mage::helper('core')->jsonDecode($this->address->getQuote()->getVconnectPostnordData(),true);
80
+ if (!empty($data['additional_fee_amount'])) {
81
+ $fee = $data['additional_fee_amount'];
82
+ $fee_base = $data['additional_fee_amount'];
83
+ }
84
+
85
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
86
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
87
+
88
+ if ($baseCurrencyCode != $currentCurrencyCode) {
89
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $currentCurrencyCode);
90
+ }
91
+
92
+ if ($fee > 0) {
93
+ if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout') {
94
+ $address->setBaseShippingInclTax($address->getBaseShippingInclTax() + $fee_base);
95
+ $address->setShippingInclTax($address->getShippingInclTax() + $fee);
96
+ }
97
+
98
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $fee_base);
99
+ $address->setGrandTotal($address->getGrandTotal() + $fee);
100
+ }
101
+
102
+ return $this;
103
+ }
104
+
105
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
106
+ {
107
+ if ($address->getAddressType() != 'shipping' || !$address->getQuote()->getVconnectPostnordData()) {
108
+ return $this;
109
+ }
110
+
111
+ $fee = 0;
112
+
113
+ $data = Mage::helper('core')->jsonDecode($address->getQuote()->getVconnectPostnordData(),true);
114
+ if (!empty($data['additional_fee_amount'])) {
115
+ $fee = $data['additional_fee_amount'];
116
+ }
117
+
118
+ $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
119
+ $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
120
+
121
+ if ($baseCurrencyCode != $currentCurrencyCode) {
122
+ $fee = Mage::helper('directory')->currencyConvert($fee, $baseCurrencyCode, $currentCurrencyCode);
123
+ }
124
+
125
+ if ($fee > 0) {
126
+ $total = array(
127
+ 'code' => $this->getCode(),
128
+ 'title' => $data['additional_fee_label'],
129
+ 'value' => $fee,
130
+ );
131
+ $address->addTotal($total);
132
+ }
133
+
134
+ return $this;
135
+ }
136
+ }
app/code/community/Vconnect/AllInOne/Model/Rate/Result.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_Quote_Total
30
+ */
31
+ class Vconnect_AllInOne_Model_Rate_Result extends Mage_Shipping_Model_Rate_Result {
32
+ public function sortRatesByPrice() {
33
+ return $this;
34
+ }
35
+ }
36
+
37
+ ?>
app/code/community/Vconnect/AllInOne/Model/System/Config/Backend/Shipping/License.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_Model_System_Config_Backend_Shipping_License
30
+ */
31
+
32
+ class Vconnect_AllInOne_Model_System_Config_Backend_Shipping_License extends Mage_Core_Model_Config_Data
33
+ {
34
+ public function _beforeSave()
35
+ {
36
+
37
+ if (strlen($this->getValue()) == '20') {
38
+ try {
39
+ $client = new Zend_Http_Client('http://api.vconnect.systems/v1/licenses/activate');
40
+
41
+
42
+ // $client = new Zend_Http_Client('http://postdk-api.dev/v1/licenses/activate');
43
+ $client->setParameterGet(array(
44
+ 'license_key' => $this->getValue(),
45
+ 'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
46
+ 'ip' => Mage::helper('core/http')->getRemoteAddr(),
47
+ 'domain' => Mage::helper('core/http')->getHttpHost(),
48
+ 'client' => 'Magento ' . Mage::getVersion(),
49
+ ));
50
+ $response = $client->request();
51
+ Mage::log($client->getLastRequest());
52
+ Mage::log($client->getLastResponse()->asString());
53
+ $data = json_decode($response->getBody());
54
+
55
+ if ($data) {
56
+ if ($data->error) {
57
+ if ($data->error == '2000' || $data->error == '4003' || $data->error == '4001') {
58
+ Mage::getModel('core/config')->saveConfig('carriers/vconnect_postnord/license_status', 1);
59
+ Mage::getSingleton('adminhtml/session')->addSuccess('PostNord: Validation success');
60
+ } else {
61
+ Mage::getModel('core/config')->saveConfig('carriers/vconnect_postnord/license_status', 0);
62
+ Mage::getSingleton('adminhtml/session')->addError("PostNord: $data->description");
63
+ }
64
+ } else {
65
+ Mage::getModel('core/config')->saveConfig('carriers/vconnect_postnord/license_status', 1);
66
+ Mage::getSingleton('adminhtml/session')->addSuccess('PostNord: Validation success');
67
+ }
68
+ } else {
69
+ Mage::getSingleton('adminhtml/session')->addError('PostNord: System error');
70
+ }
71
+ } catch(Exception $e) {
72
+ Mage::getSingleton('adminhtml/session')->addError('PostNord: System error');
73
+ }
74
+ } else {
75
+ Mage::getModel('core/config')->saveConfig('carriers/vconnect_postnord/license_status', 0);
76
+ Mage::getSingleton('adminhtml/session')->addError('PostNord: Invalid license key');
77
+ }
78
+ }
79
+ }
app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Countries.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOne_Model_System_Config_Source_Carrier_Countries
4
+ {
5
+ protected $_options;
6
+
7
+ public function toOptionArray()
8
+ {
9
+ if (!$this->_options) {
10
+ $this->_options = array(
11
+ array(
12
+ 'label' => Mage::helper('adminhtml')->__('Denmark'),
13
+ 'value' => 'DK'
14
+ ),
15
+
16
+ array(
17
+ 'label' => Mage::helper('adminhtml')->__('Sweden'),
18
+ 'value' => 'SE'
19
+ ),
20
+
21
+ array(
22
+ 'label' => Mage::helper('adminhtml')->__('Norway'),
23
+ 'value' => 'NO'
24
+ ),
25
+
26
+ array(
27
+ 'label' => Mage::helper('adminhtml')->__('Finland'),
28
+ 'value' => 'FI'
29
+ ),
30
+
31
+ );
32
+ }
33
+ return $this->_options;
34
+ }
35
+
36
+ public function toArray()
37
+ {
38
+ return array_map(function($item)
39
+ {
40
+ return strtolower($item['value']);
41
+ }
42
+ , $this->toOptionArray()
43
+ );
44
+ }
45
+ }
app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Orderstate.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Vconnect_AllInOne_Model_System_Config_Source_Carrier_Orderstate extends Mage_Eav_Model_Entity_Attribute_Source_Table
3
+ {
4
+ protected $_options;
5
+ /**
6
+ *
7
+ * @return array
8
+ */
9
+ public function toOptionArray()
10
+ {
11
+ if(!$this->_options){
12
+ $this->_options = Mage::getResourceModel('sales/order_status_collection')
13
+ ->addStateFilter(Mage_Sales_Model_Order::STATE_PROCESSING)
14
+ ->toOptionHash();
15
+ array_unshift($this->_options, array('value'=>'',
16
+ 'label'=>Mage::helper('adminhtml')->__('--Please Select--')));
17
+ }
18
+ return $this->_options;
19
+ }
20
+
21
+ /**
22
+ *
23
+ * @return array
24
+ */
25
+ public function toArray()
26
+ {
27
+ return $this->toOptionArray();
28
+ }
29
+ }
30
+
31
+
app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Terms.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOne_Model_System_Config_Source_Carrier_Terms
4
+ {
5
+ protected $_options;
6
+
7
+ public function toOptionArray()
8
+ {
9
+ if (!$this->_options) {
10
+ $this->_options = array(
11
+ array(
12
+ 'label' => Mage::helper('adminhtml')->__('Normal'),
13
+ 'value' => 'http://www.postdanmark.dk/da/Documents/Forretningsbetingelser/brugervilkaar-smartlevering-privat-pakker.pdf'
14
+ ),
15
+ array(
16
+ 'label' => Mage::helper('adminhtml')->__('Daily products'),
17
+ 'value' => 'http://www.postdanmark.dk/da/Documents/Forretningsbetingelser/brugervilkaar-smartlevering-servicelogistik.pdf'
18
+ ),
19
+ );
20
+ }
21
+ return $this->_options;
22
+ }
23
+ }
app/code/community/Vconnect/AllInOne/Model/System/Config/Source/Carrier/Theme.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOne_Model_System_Config_Source_Carrier_Theme
4
+ {
5
+ protected $_options;
6
+
7
+ public function toOptionArray()
8
+ {
9
+ if (!$this->_options) {
10
+ $this->_options = array(
11
+ array(
12
+ 'label' => Mage::helper('adminhtml')->__('Red'),
13
+ 'value' => 'red'
14
+ ),
15
+ array(
16
+ 'label' => Mage::helper('adminhtml')->__('Blue'),
17
+ 'value' => 'blue'
18
+ ),
19
+ );
20
+ }
21
+ return $this->_options;
22
+ }
23
+ }
app/code/community/Vconnect/AllInOne/controllers/IndexController.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @class Vconnect_AllInOne_IndexController
30
+ */
31
+ class Vconnect_AllInOne_IndexController extends Mage_Core_Controller_Front_Action
32
+ {
33
+ public function indexAction()
34
+ {
35
+ $api = Mage::getModel('vc_aio/apiclient');
36
+ /* @var $api Vconnect_AllInOne_Model_ApiClient */
37
+ // if(!$this->getRequest()->isAjax()){
38
+ //
39
+ // }
40
+ $this->getResponse()->setHeader('Content-Type', 'application/json');
41
+ if(!Mage::getStoreConfigFlag('carriers/vconnect_postnord_pickup/active')){
42
+ $this->_redirect('home');
43
+ }
44
+
45
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
46
+ /* @var $quote Mage_Sales_Model_Quote */
47
+
48
+ $shippingAddress = $quote->getShippingAddress();
49
+
50
+ $apiKey = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/api_key');
51
+ $postcode = $this->getRequest()->getQuery('postcode', $shippingAddress->getPostcode());
52
+ $countryId = $this->getRequest()->getQuery('country_id', $shippingAddress->getCountryId());
53
+ $street = $this->getRequest()->getQuery('street', $shippingAddress->getStreetFull());
54
+ $api->setGls(Mage::getStoreConfigFlag('carriers/vconnect_postnord_pickup/gls'));
55
+
56
+ $response = $api->findPoints($apiKey, $postcode, $countryId, 10,$street);
57
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
58
+
59
+
60
+
61
+ }
62
+
63
+
64
+ public function transitInformationAction()
65
+ {
66
+ $api = Mage::getModel('vc_aio/apiclient');
67
+
68
+ $this->getResponse()->setHeader('Content-Type', 'application/json');
69
+ if(!Mage::getStoreConfigFlag('carriers/vconnect_postnord_pickup/active')){
70
+ $this->_redirect('home');
71
+ }
72
+
73
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
74
+ /* @var $quote Mage_Sales_Model_Quote */
75
+
76
+ $shippingAddress = $quote->getShippingAddress();
77
+
78
+ $apiKey = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/api_key');
79
+ $postcode = $this->getRequest()->getQuery('postcode', $shippingAddress->getPostcode());
80
+ $countryId = $this->getRequest()->getQuery('country_id', $shippingAddress->getCountryId());
81
+ $serviceCode = trim($this->getRequest()->getPost('service_code', false));
82
+
83
+ $storeCountryId = Mage::getStoreConfig('shipping/origin/country_id');
84
+ $storePostcode = Mage::getStoreConfig('shipping/origin/postcode');
85
+
86
+ if (empty($storeCountryId) || empty($storePostcode) || empty($countryId) || empty($postcode)) {
87
+ $response = array();
88
+ $response['postnord']['error'] = true;
89
+ $response['postnord']['message'] = 'Invalid transittime input data';
90
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
91
+ } else {
92
+ $dataParams = array(
93
+ 'serviceCode' => !empty($serviceCode) ? $serviceCode : 32,
94
+ 'serviceGroupCode' => $storeCountryId,
95
+ 'fromAddressPostalCode' => $storePostcode,
96
+ 'fromAddressCountryCode' => $storeCountryId,
97
+ 'toAddressPostalCode' => $postcode,
98
+ 'toAddressCountryCode' => $countryId,
99
+ );
100
+
101
+ $response = $api->getTransitTimeInformation($apiKey, $dataParams);
102
+ }
103
+
104
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
105
+ }
106
+ }
app/code/community/Vconnect/AllInOne/data/vconnect_postnord_setup/data-install-1.2.9.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ Mage::getConfig()->deleteConfig('carriers/vconnect_postnord/sallowspecific');
3
+ Mage::getConfig()->deleteConfig('carriers/vconnect_postnord/specificcountry');
4
+ Mage::getConfig()->deleteConfig('carriers/vconnect_postnord/handling_fee');
5
+
6
+ $storeCountryId = Mage::getStoreConfig('shipping/origin/country_id');
7
+ if ($storeCountryId == 'SE') {
8
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/button_label', 'Klicka här för att välja leveransalternativ');
9
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/button_label_active', 'Klicka här för att välja annat leveransalternativ');
10
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/title', 'Leverans med PostNord');
11
+
12
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/name', 'Till företag');
13
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/arrival_option_text', '08:00 - 16:00');
14
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/transit_time', '1-3 dagar');
15
+
16
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/name', 'Till dörren');
17
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/arrival_option_text', '08:00 - 17:00');
18
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/transit_time', '1-3 dagar');
19
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/additional_fee_label', '17:00 - 21:00');
20
+
21
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_pickup/name', 'Till serviceställe');
22
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_pickup/transit_time', '1-3 dagar');
23
+
24
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_mailbox/name', 'Till postlådan');
25
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_mailbox/arrival_option_text', '2-3 dagar');
26
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_mailbox/transit_time', '1-3 dagar');
27
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_mailbox/additional_fee_label', '1 dag');
28
+
29
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_eu/name', 'EU');
30
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_intl/name', 'To door');
31
+
32
+ } elseif ($storeCountryId == 'FI') {
33
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/button_label', 'Valitse toimitustapa');
34
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/button_label_active', 'Valitse toinen toimitustapa');
35
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord/title', 'PostNord');
36
+
37
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/name', 'Toimitus työpaikalle');
38
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/arrival_option_text', '1-3 arkipäivää. Toimitus klo 8-17 välisenä aikana.');
39
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_business/transit_time', '1-3 päivää');
40
+
41
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/name', 'Toimitus kotiin');
42
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/arrival_option_text', '1-3 arkipäivää. Toimitus klo 8-17 välisenä aikana.');
43
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_home/transit_time', '1-3 päivää');
44
+
45
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_pickup/name', 'Toimitus palvelupisteeseen');
46
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_pickup/transit_time', '1-4 päivää');
47
+
48
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_eu/name', 'EU');
49
+ Mage::getConfig()->saveConfig('carriers/vconnect_postnord_intl/name', 'International');
50
+ }
51
+
52
+ Mage::getConfig()->cleanCache();
app/code/community/Vconnect/AllInOne/etc/config.xml ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Vconnect_AllInOne>
6
+ <version>1.4.6</version>
7
+ </Vconnect_AllInOne>
8
+ </modules>
9
+ <global>
10
+ <blocks>
11
+ <vc_aio>
12
+ <class>Vconnect_AllInOne_Block</class>
13
+ </vc_aio>
14
+ <adminhtml>
15
+ <rewrite>
16
+ <sales_order_create_shipping_method_form>Vconnect_AllInOne_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form</sales_order_create_shipping_method_form>
17
+ </rewrite>
18
+ </adminhtml>
19
+ </blocks>
20
+ <models>
21
+ <vc_aio>
22
+ <class>Vconnect_AllInOne_Model</class>
23
+ <resourceModel>vc_aio_resource</resourceModel>
24
+ </vc_aio>
25
+ <vc_aio_resource>
26
+ <class>Vconnect_AllInOne_Model_Resource</class>
27
+ <entities>
28
+ </entities>
29
+ </vc_aio_resource>
30
+ <sales>
31
+ <rewrite>
32
+ <quote_address_rate>Vconnect_AllInOne_Model_Quote_Address_Rate</quote_address_rate>
33
+ </rewrite>
34
+ </sales>
35
+ <shipping>
36
+ <rewrite>
37
+ <rate_result>Vconnect_AllInOne_Model_Rate_Result</rate_result>
38
+ </rewrite>
39
+ </shipping>
40
+ </models>
41
+ <helpers>
42
+ <vc_aio>
43
+ <class>Vconnect_AllInOne_Helper</class>
44
+ </vc_aio>
45
+ </helpers>
46
+ <resources>
47
+ <vconnect_postnord_setup>
48
+ <setup>
49
+ <class>Mage_Sales_Model_Resource_Setup</class>
50
+ <module>Vconnect_AllInOne</module>
51
+ </setup>
52
+ <connection>
53
+ <use>core_setup</use>
54
+ </connection>
55
+ </vconnect_postnord_setup>
56
+ </resources>
57
+ <fieldsets>
58
+ <sales_copy_order>
59
+ <vconnect_postnord_data>
60
+ <to_edit>*</to_edit>
61
+ </vconnect_postnord_data>
62
+ </sales_copy_order>
63
+ <sales_convert_quote>
64
+ <vconnect_postnord_data>
65
+ <to_order>*</to_order>
66
+ </vconnect_postnord_data>
67
+ </sales_convert_quote>
68
+ <sales_convert_order>
69
+ <vconnect_postnord_data>
70
+ <to_quote>*</to_quote>
71
+ </vconnect_postnord_data>
72
+ </sales_convert_order>
73
+ </fieldsets>
74
+ <events>
75
+ <sales_order_place_after>
76
+ <observers>
77
+ <vc_postnord_sales_order_place_after>
78
+ <type>singleton</type>
79
+ <class>vc_aio/observer</class>
80
+ <method>salesOrderPlaceAfter</method>
81
+ </vc_postnord_sales_order_place_after>
82
+ </observers>
83
+ </sales_order_place_after>
84
+ <paypal_prepare_line_items>
85
+ <observers>
86
+ <vc_aio>
87
+ <type>singleton</type>
88
+ <class>vc_aio/observer</class>
89
+ <method>paypalPrepareLineItems</method>
90
+ </vc_aio>
91
+ </observers>
92
+ </paypal_prepare_line_items>
93
+ <core_block_abstract_to_html_after>
94
+ <observers>
95
+ <vc_aio_core_block_abstract_to_html_after>
96
+ <class>vc_aio/observer</class>
97
+ <method>injectPopupCode</method>
98
+ </vc_aio_core_block_abstract_to_html_after>
99
+ </observers>
100
+ </core_block_abstract_to_html_after>
101
+ <vconnect_shipping_methods_ui_collect>
102
+ <observers>
103
+ <vc_aio_dk_vconnect_shipping_methods_collect>
104
+ <class>vc_aio/observer</class>
105
+ <method>shippingMethodsUiCollect</method>
106
+ </vc_aio_dk_vconnect_shipping_methods_collect>
107
+ </observers>
108
+ </vconnect_shipping_methods_ui_collect>
109
+ </events>
110
+ <sales>
111
+ <quote>
112
+ <totals>
113
+ <vc_aio_additional_fee>
114
+ <class>vc_aio/quote_total</class>
115
+ <after>subtotal,discount,shipping</after>
116
+ <before>grand_total</before>
117
+ </vc_aio_additional_fee>
118
+ <vc_aio_environmental_fee>
119
+ <class>vc_aio/quote_environmentaltotal</class>
120
+ <after>subtotal,discount,shipping</after>
121
+ <before>grand_total</before>
122
+ </vc_aio_environmental_fee>
123
+ </totals>
124
+ </quote>
125
+ <order_creditmemo>
126
+ <totals>
127
+ <vc_aio_additional_fee>
128
+ <class>vc_aio/creditmemo_total</class>
129
+ </vc_aio_additional_fee>
130
+ <vc_aio_environmental_fee>
131
+ <class>vc_aio/creditmemo_environmentaltotal</class>
132
+ </vc_aio_environmental_fee>
133
+ </totals>
134
+ </order_creditmemo>
135
+ <order_invoice>
136
+ <totals>
137
+ <vc_aio_additional_fee>
138
+ <class>vc_aio/invoice_total</class>
139
+ </vc_aio_additional_fee>
140
+ <vc_aio_environmental_fee>
141
+ <class>vc_aio/invoice_environmentaltotal</class>
142
+ </vc_aio_environmental_fee>
143
+ </totals>
144
+ </order_invoice>
145
+ </sales>
146
+ <pdf>
147
+ <totals>
148
+ <vc_aio_additional_fee_invoice translate="title">
149
+ <title>Additional Fee</title>
150
+ <source_field>vc_aio_additional_fee</source_field>
151
+ <font_size>7</font_size>
152
+ <display_zero>1</display_zero>
153
+ <sort_order>550</sort_order>
154
+ <model>vc_aio/invoice_pdf_total</model>
155
+ </vc_aio_additional_fee_invoice>
156
+ <vc_aio_environmental_fee_invoice translate="title">
157
+ <title>Environmental Fee</title>
158
+ <source_field>vc_aio_environmental_fee</source_field>
159
+ <font_size>7</font_size>
160
+ <display_zero>1</display_zero>
161
+ <sort_order>550</sort_order>
162
+ <model>vc_aio/invoice_pdf_environmentaltotal</model>
163
+ </vc_aio_environmental_fee_invoice>
164
+ </totals>
165
+ </pdf>
166
+ </global>
167
+
168
+ <frontend>
169
+ <routers>
170
+ <vc_aio>
171
+ <use>standard</use>
172
+ <args>
173
+ <module>Vconnect_AllInOne</module>
174
+ <frontName>aio</frontName>
175
+ </args>
176
+ </vc_aio>
177
+ </routers>
178
+ <layout>
179
+ <updates>
180
+ <vconnect_aio>
181
+ <file>vconnect/aio.xml</file>
182
+ </vconnect_aio>
183
+ </updates>
184
+ </layout>
185
+ <events>
186
+ <checkout_controller_onepage_save_shipping_method>
187
+ <observers>
188
+ <vc_pdkalpha>
189
+ <class>vc_aio/observer</class>
190
+ <method>saveShipping</method>
191
+ </vc_pdkalpha>
192
+ </observers>
193
+ </checkout_controller_onepage_save_shipping_method>
194
+ <gomage_checkout_save_quote_before>
195
+ <observers>
196
+ <vc_pdkalpha>
197
+ <class>vc_aio/observer</class>
198
+ <method>saveShipping</method>
199
+ </vc_pdkalpha>
200
+ </observers>
201
+ </gomage_checkout_save_quote_before>
202
+ <sales_quote_collect_totals_before>
203
+ <observers>
204
+ <vc_pdkalpha>
205
+ <class>vc_aio/observer</class>
206
+ <method>saveQuoteOnestepcheckout</method>
207
+ </vc_pdkalpha>
208
+ </observers>
209
+ </sales_quote_collect_totals_before>
210
+ </events>
211
+ <translate>
212
+ <modules>
213
+ <Vconnect_AllInOne>
214
+ <files>
215
+ <default>Vconnect_AllInOne.csv</default>
216
+ </files>
217
+ </Vconnect_AllInOne>
218
+ </modules>
219
+ </translate>
220
+ </frontend>
221
+ <adminhtml>
222
+ <events>
223
+ <adminhtml_sales_order_create_process_data>
224
+ <observers>
225
+ <vc_pdkalpha>
226
+ <class>vc_aio/observer</class>
227
+ <method>saveAdminShipping</method>
228
+ </vc_pdkalpha>
229
+ </observers>
230
+ </adminhtml_sales_order_create_process_data>
231
+ <core_block_abstract_to_html_before>
232
+ <observers>
233
+ <vc_aio>
234
+ <type>singleton</type>
235
+ <class>vc_aio/observer</class>
236
+ <method>addPaymentFeeTotal</method>
237
+ </vc_aio>
238
+ </observers>
239
+ </core_block_abstract_to_html_before>
240
+ </events>
241
+ <layout>
242
+ <updates>
243
+ <vc_alpha>
244
+ <file>vconnect/aio.xml</file>
245
+ </vc_alpha>
246
+ </updates>
247
+ </layout>
248
+ <translate>
249
+ <modules>
250
+ <Vconnect_AllInOne>
251
+ <files>
252
+ <default>Vconnect_AllInOne.csv</default>
253
+ </files>
254
+ </Vconnect_AllInOne>
255
+ </modules>
256
+ </translate>
257
+ </adminhtml>
258
+ <default>
259
+ <carriers>
260
+ <vconnect_postnord>
261
+ <active>0</active>
262
+ <model>vc_aio/carrier_postnord</model>
263
+ <title>PostNord</title>
264
+ <weather_api_key>302924bfc78fda68f2deef7f21bc1526</weather_api_key>
265
+ <button_label>Choose a method</button_label>
266
+ <button_label_active>Choose another delivery method</button_label_active>
267
+ <popup>1</popup>
268
+ </vconnect_postnord>
269
+ <vconnect_postnord_pickup>
270
+ <active>0</active>
271
+ <name>To post office</name>
272
+ </vconnect_postnord_pickup>
273
+ <vconnect_postnord_business>
274
+ <active>0</active>
275
+ <name>To your business</name>
276
+ <arrival_option_text>08:00 - 16:00</arrival_option_text>
277
+ <flex_delivery_active>1</flex_delivery_active>
278
+ </vconnect_postnord_business>
279
+ <vconnect_postnord_home>
280
+ <active>0</active>
281
+ <name>To your address</name>
282
+ <arrival_option_text>08:00-17:00</arrival_option_text>
283
+ <flex_delivery_active>1</flex_delivery_active>
284
+ </vconnect_postnord_home>
285
+ <vconnect_postnord_intl>
286
+ <active>0</active>
287
+ <name>International</name>
288
+ </vconnect_postnord_intl>
289
+ <vconnect_postnord_eu>
290
+ <active>0</active>
291
+ <name>EU</name>
292
+ </vconnect_postnord_eu>
293
+ </carriers>
294
+ <sales>
295
+ <totals_sort>
296
+ <vc_aio_additionalfee>15</vc_aio_additionalfee>
297
+ <vc_aio_environmentalfee>25</vc_aio_environmentalfee>
298
+ </totals_sort>
299
+ </sales>
300
+ </default>
301
+ </config>
app/code/community/Vconnect/AllInOne/etc/system.xml ADDED
@@ -0,0 +1,574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections> <!-- system config section -->
4
+ <carriers>
5
+ <groups>
6
+ <vconnect_postnord translate="label" module="vc_aio">
7
+ <label>PostNord - General</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>73</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <license_key>
24
+ <label>License key</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>12</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>0</show_in_store>
30
+ <backend_model>vc_aio/system_config_backend_shipping_license</backend_model>
31
+ <validate>required-entry</validate>
32
+ <depends>
33
+ <active>1</active>
34
+ </depends>
35
+ </license_key>
36
+ <button_label>
37
+ <label>Button Label</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>13</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
+ <validate>required-entry</validate>
44
+ <comment><![CDATA[<span class="note">Choose method label for shipping methods dialog</span>]]></comment>
45
+ </button_label>
46
+ <button_label_active>
47
+ <label>Button Label Active</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>14</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
+ <validate>required-entry</validate>
54
+ </button_label_active>
55
+ <popup translate="label comment">
56
+ <label>Enable Popup</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>15</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment><![CDATA[<span class="note">Disabling the popup all postnord methods will be displayed separately at the checkout</span>]]></comment>
64
+ </popup>
65
+ <title translate="label">
66
+ <label>Carrier Title</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>20</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </title>
73
+ <weather>
74
+ <label>Enabled weather</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>adminhtml/system_config_source_yesno</source_model>
77
+ <sort_order>25</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>0</show_in_store>
81
+ <depends>
82
+ <active>1</active>
83
+ </depends>
84
+ <comment><![CDATA[<span class="note">Weather forecast at the top of shipping methods dialog if enabled.</span>]]></comment>
85
+ </weather>
86
+ <environmental_fee translate="label comment">
87
+ <label>Enable Environmental Fee</label>
88
+ <frontend_type>select</frontend_type>
89
+ <source_model>adminhtml/system_config_source_yesno</source_model>
90
+ <sort_order>30</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ </environmental_fee>
95
+ <!--<weather_api_key>-->
96
+ <!--<label>Weather API key</label>-->
97
+ <!--<frontend_type>text</frontend_type>-->
98
+ <!--<sort_order>30</sort_order>-->
99
+ <!--<show_in_default>1</show_in_default>-->
100
+ <!--<show_in_website>1</show_in_website>-->
101
+ <!--<show_in_store>1</show_in_store>-->
102
+ <!--<validate>required-entry</validate>-->
103
+ <!--<depends>-->
104
+ <!--<weather>1</weather>-->
105
+ <!--<active>1</active>-->
106
+ <!--</depends>-->
107
+ <!--</weather_api_key>-->
108
+ </fields>
109
+ </vconnect_postnord>
110
+ <vconnect_postnord_business translate="label" module="vc_aio">
111
+ <label>PostNord - To bussines address</label>
112
+ <frontend_type>text</frontend_type>
113
+ <sort_order>76</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>1</show_in_store>
117
+ <fields>
118
+ <active translate="label">
119
+ <label>Enabled</label>
120
+ <frontend_type>select</frontend_type>
121
+ <source_model>adminhtml/system_config_source_yesno</source_model>
122
+ <sort_order>10</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ </active>
127
+ <name translate="label">
128
+ <label>Method name</label>
129
+ <frontend_type>text</frontend_type>
130
+ <sort_order>30</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>1</show_in_store>
134
+ </name>
135
+ <arrival_option_text translate="label">
136
+ <label>Option text</label>
137
+ <frontend_type>text</frontend_type>
138
+ <sort_order>35</sort_order>
139
+ <show_in_default>1</show_in_default>
140
+ <show_in_website>1</show_in_website>
141
+ <show_in_store>1</show_in_store>
142
+ </arrival_option_text>
143
+ <price translate="label">
144
+ <label>Prices</label>
145
+ <frontend_type>text</frontend_type>
146
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
147
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
148
+ <sort_order>40</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>1</show_in_website>
151
+ <show_in_store>0</show_in_store>
152
+ </price>
153
+ <transit_time translate="label">
154
+ <label>Transit Time</label>
155
+ <frontend_type>text</frontend_type>
156
+ <sort_order>45</sort_order>
157
+ <show_in_default>1</show_in_default>
158
+ <show_in_website>1</show_in_website>
159
+ <show_in_store>1</show_in_store>
160
+ </transit_time>
161
+ <!-- <sallowspecific translate="label">
162
+ <label>Ship to applicable countries</label>
163
+ <frontend_type>select</frontend_type>
164
+ <sort_order>130</sort_order>
165
+ <frontend_class>shipping-applicable-country</frontend_class>
166
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>0</show_in_store>
170
+ </sallowspecific>
171
+ <specificcountry translate="label">
172
+ <label>Ship to Specific countries</label>
173
+ <frontend_type>multiselect</frontend_type>
174
+ <sort_order>140</sort_order>
175
+ <source_model>adminhtml/system_config_source_country</source_model>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>0</show_in_store>
179
+ </specificcountry>-->
180
+ <flex_delivery_active translate="label">
181
+ <label>Enable Flex Delivery</label>
182
+ <frontend_type>select</frontend_type>
183
+ <source_model>adminhtml/system_config_source_yesno</source_model>
184
+ <sort_order>60</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>0</show_in_store>
188
+ </flex_delivery_active>
189
+ <sort_order translate="label">
190
+ <label>Sort Order</label>
191
+ <frontend_type>text</frontend_type>
192
+ <sort_order>150</sort_order>
193
+ <show_in_default>1</show_in_default>
194
+ <show_in_website>1</show_in_website>
195
+ <show_in_store>0</show_in_store>
196
+ </sort_order>
197
+ </fields>
198
+ </vconnect_postnord_business>
199
+ <vconnect_postnord_home translate="label" module="vc_aio">
200
+ <label>PostNord - To home address</label>
201
+ <frontend_type>text</frontend_type>
202
+ <sort_order>79</sort_order>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>1</show_in_store>
206
+ <fields>
207
+ <active translate="label">
208
+ <label>Enabled</label>
209
+ <frontend_type>select</frontend_type>
210
+ <source_model>adminhtml/system_config_source_yesno</source_model>
211
+ <sort_order>10</sort_order>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>1</show_in_website>
214
+ <show_in_store>0</show_in_store>
215
+ </active>
216
+ <name translate="label">
217
+ <label>Method name</label>
218
+ <frontend_type>text</frontend_type>
219
+ <sort_order>20</sort_order>
220
+ <show_in_default>1</show_in_default>
221
+ <show_in_website>1</show_in_website>
222
+ <show_in_store>1</show_in_store>
223
+ </name>
224
+ <arrival_option_text translate="label">
225
+ <label>Option text</label>
226
+ <frontend_type>text</frontend_type>
227
+ <sort_order>30</sort_order>
228
+ <show_in_default>1</show_in_default>
229
+ <show_in_website>1</show_in_website>
230
+ <show_in_store>1</show_in_store>
231
+ </arrival_option_text>
232
+ <price translate="label">
233
+ <label>Prices</label>
234
+ <frontend_type>text</frontend_type>
235
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
236
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
237
+ <sort_order>40</sort_order>
238
+ <show_in_default>1</show_in_default>
239
+ <show_in_website>1</show_in_website>
240
+ <show_in_store>0</show_in_store>
241
+ </price>
242
+ <transit_time translate="label">
243
+ <label>Transit Time</label>
244
+ <frontend_type>text</frontend_type>
245
+ <sort_order>43</sort_order>
246
+ <show_in_default>1</show_in_default>
247
+ <show_in_website>1</show_in_website>
248
+ <show_in_store>1</show_in_store>
249
+ </transit_time>
250
+ <!-- <order_status translate="label">
251
+ <label>Shipping request on order status</label>
252
+ <frontend_type>select</frontend_type>
253
+ <source_model>vc_aio/system_config_source_carrier_orderstate</source_model>
254
+ <sort_order>360</sort_order>
255
+ <show_in_default>1</show_in_default>
256
+ <show_in_website>1</show_in_website>
257
+ <show_in_store>0</show_in_store>
258
+ <depends>
259
+ <smartdelivery>1</smartdelivery>
260
+ </depends>
261
+ <validate>required-entry</validate>
262
+ </order_status>
263
+ <sallowspecific translate="label">
264
+ <label>Ship to applicable countries</label>
265
+ <frontend_type>select</frontend_type>
266
+ <sort_order>380</sort_order>
267
+ <frontend_class>shipping-applicable-country</frontend_class>
268
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>0</show_in_store>
272
+ </sallowspecific>
273
+ <specificcountry translate="label">
274
+ <label>Ship to Specific countries</label>
275
+ <frontend_type>multiselect</frontend_type>
276
+ <sort_order>400</sort_order>
277
+ <source_model>adminhtml/system_config_source_country</source_model>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>0</show_in_store>
281
+ </specificcountry>-->
282
+ <additional_fee_active translate="label">
283
+ <label>Enable Additional Fee</label>
284
+ <frontend_type>select</frontend_type>
285
+ <source_model>adminhtml/system_config_source_yesno</source_model>
286
+ <sort_order>300</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>0</show_in_store>
290
+ </additional_fee_active>
291
+ <additional_fee_label translate="label">
292
+ <label>Fee Label</label>
293
+ <comment>This is the delivery time the customer sees during checkout</comment>
294
+ <frontend_type>text</frontend_type>
295
+ <sort_order>310</sort_order>
296
+ <show_in_default>1</show_in_default>
297
+ <show_in_website>1</show_in_website>
298
+ <show_in_store>0</show_in_store>
299
+ <depends><additional_fee_active>1</additional_fee_active></depends>
300
+ </additional_fee_label>
301
+ <additional_fee_amount translate="label">
302
+ <label>Fee amount</label>
303
+ <frontend_type>text</frontend_type>
304
+ <sort_order>320</sort_order>
305
+ <show_in_default>1</show_in_default>
306
+ <show_in_website>1</show_in_website>
307
+ <show_in_store>0</show_in_store>
308
+ <depends><additional_fee_active>1</additional_fee_active></depends>
309
+ </additional_fee_amount>
310
+ <flex_delivery_active translate="label">
311
+ <label>Enable Flex Delivery</label>
312
+ <frontend_type>select</frontend_type>
313
+ <source_model>adminhtml/system_config_source_yesno</source_model>
314
+ <sort_order>360</sort_order>
315
+ <show_in_default>1</show_in_default>
316
+ <show_in_website>1</show_in_website>
317
+ <show_in_store>0</show_in_store>
318
+ </flex_delivery_active>
319
+ <sort_order translate="label">
320
+ <label>Sort Order</label>
321
+ <frontend_type>text</frontend_type>
322
+ <sort_order>420</sort_order>
323
+ <show_in_default>1</show_in_default>
324
+ <show_in_website>1</show_in_website>
325
+ <show_in_store>0</show_in_store>
326
+ </sort_order>
327
+ </fields>
328
+ </vconnect_postnord_home>
329
+ <vconnect_postnord_pickup translate="label" module="vc_aio">
330
+ <label>PostNord - Pickup</label>
331
+ <frontend_type>text</frontend_type>
332
+ <sort_order>82</sort_order>
333
+ <show_in_default>1</show_in_default>
334
+ <show_in_website>1</show_in_website>
335
+ <show_in_store>1</show_in_store>
336
+ <fields>
337
+ <active translate="label">
338
+ <label>Enabled</label>
339
+ <frontend_type>select</frontend_type>
340
+ <source_model>adminhtml/system_config_source_yesno</source_model>
341
+ <sort_order>10</sort_order>
342
+ <show_in_default>1</show_in_default>
343
+ <show_in_website>1</show_in_website>
344
+ <show_in_store>0</show_in_store>
345
+ </active>
346
+ <api_key>
347
+ <label>Postnod API Key</label>
348
+ <frontend_type>text</frontend_type>
349
+ <sort_order>13</sort_order>
350
+ <show_in_default>1</show_in_default>
351
+ <show_in_website>1</show_in_website>
352
+ <show_in_store>0</show_in_store>
353
+ <validate>required-entry</validate>
354
+ <depends>
355
+ <active>1</active>
356
+ </depends>
357
+ </api_key>
358
+ <google_maps_api_key>
359
+ <label>Google Maps API Key</label>
360
+ <frontend_type>text</frontend_type>
361
+ <sort_order>15</sort_order>
362
+ <show_in_default>1</show_in_default>
363
+ <show_in_website>1</show_in_website>
364
+ <show_in_store>0</show_in_store>
365
+ <validate>required-entry</validate>
366
+ <depends>
367
+ <active>1</active>
368
+ </depends>
369
+ </google_maps_api_key>
370
+ <name translate="label">
371
+ <label>Method name</label>
372
+ <frontend_type>text</frontend_type>
373
+ <sort_order>30</sort_order>
374
+ <show_in_default>1</show_in_default>
375
+ <show_in_website>1</show_in_website>
376
+ <show_in_store>1</show_in_store>
377
+ </name>
378
+ <!-- <gls translate="label">
379
+ <label>Enable GLS pickups</label>
380
+ <frontend_type>select</frontend_type>
381
+ <source_model>adminhtml/system_config_source_yesno</source_model>
382
+ <sort_order>40</sort_order>
383
+ <show_in_default>1</show_in_default>
384
+ <show_in_website>1</show_in_website>
385
+ <show_in_store>0</show_in_store>
386
+ </gls>-->
387
+ <transit_time translate="label">
388
+ <label>Transit Time</label>
389
+ <frontend_type>text</frontend_type>
390
+ <sort_order>33</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>1</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ </transit_time>
395
+ <price_dk translate="label">
396
+ <label>Prices to Danmark</label>
397
+ <frontend_type>text</frontend_type>
398
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
399
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
400
+ <sort_order>50</sort_order>
401
+ <show_in_default>1</show_in_default>
402
+ <show_in_website>1</show_in_website>
403
+ <show_in_store>0</show_in_store>
404
+ </price_dk>
405
+ <price_se translate="label">
406
+ <label>Prices to Sweden</label>
407
+ <frontend_type>text</frontend_type>
408
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
409
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
410
+ <sort_order>60</sort_order>
411
+ <show_in_default>1</show_in_default>
412
+ <show_in_website>1</show_in_website>
413
+ <show_in_store>0</show_in_store>
414
+ </price_se>
415
+ <price_no translate="label">
416
+ <label>Prices to Norway</label>
417
+ <frontend_type>text</frontend_type>
418
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
419
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
420
+ <sort_order>70</sort_order>
421
+ <show_in_default>1</show_in_default>
422
+ <show_in_website>1</show_in_website>
423
+ <show_in_store>0</show_in_store>
424
+ </price_no>
425
+ <price_fi translate="label">
426
+ <label>Price to Finland</label>
427
+ <frontend_type>text</frontend_type>
428
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
429
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
430
+ <sort_order>80</sort_order>
431
+ <show_in_default>1</show_in_default>
432
+ <show_in_website>1</show_in_website>
433
+ <show_in_store>0</show_in_store>
434
+ </price_fi>
435
+ <sort_order translate="label">
436
+ <label>Sort Order</label>
437
+ <frontend_type>text</frontend_type>
438
+ <sort_order>140</sort_order>
439
+ <show_in_default>1</show_in_default>
440
+ <show_in_website>1</show_in_website>
441
+ <show_in_store>0</show_in_store>
442
+ </sort_order>
443
+ </fields>
444
+ </vconnect_postnord_pickup>
445
+ <vconnect_postnord_eu translate="label" module="vc_aio">
446
+ <label>PostNord - EU</label>
447
+ <frontend_type>text</frontend_type>
448
+ <sort_order>85</sort_order>
449
+ <show_in_default>1</show_in_default>
450
+ <show_in_website>1</show_in_website>
451
+ <show_in_store>1</show_in_store>
452
+ <fields>
453
+ <active translate="label">
454
+ <label>Enabled</label>
455
+ <frontend_type>select</frontend_type>
456
+ <source_model>adminhtml/system_config_source_yesno</source_model>
457
+ <sort_order>10</sort_order>
458
+ <show_in_default>1</show_in_default>
459
+ <show_in_website>1</show_in_website>
460
+ <show_in_store>0</show_in_store>
461
+ </active>
462
+ <name translate="label">
463
+ <label>Method name</label>
464
+ <frontend_type>text</frontend_type>
465
+ <sort_order>30</sort_order>
466
+ <show_in_default>1</show_in_default>
467
+ <show_in_website>1</show_in_website>
468
+ <show_in_store>1</show_in_store>
469
+ </name>
470
+ <price translate="label">
471
+ <label>Prices</label>
472
+ <frontend_type>text</frontend_type>
473
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
474
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
475
+ <sort_order>40</sort_order>
476
+ <show_in_default>1</show_in_default>
477
+ <show_in_website>1</show_in_website>
478
+ <show_in_store>0</show_in_store>
479
+ </price>
480
+ <transit_time translate="label">
481
+ <label>Transit Time</label>
482
+ <frontend_type>text</frontend_type>
483
+ <sort_order>45</sort_order>
484
+ <show_in_default>1</show_in_default>
485
+ <show_in_website>1</show_in_website>
486
+ <show_in_store>1</show_in_store>
487
+ </transit_time>
488
+ <!-- <sallowspecific translate="label">
489
+ <label>Ship to applicable countries</label>
490
+ <frontend_type>select</frontend_type>
491
+ <sort_order>130</sort_order>
492
+ <frontend_class>shipping-applicable-country</frontend_class>
493
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
494
+ <show_in_default>1</show_in_default>
495
+ <show_in_website>1</show_in_website>
496
+ <show_in_store>0</show_in_store>
497
+ </sallowspecific>
498
+ <specificcountry translate="label">
499
+ <label>Ship to Specific countries</label>
500
+ <frontend_type>multiselect</frontend_type>
501
+ <sort_order>140</sort_order>
502
+ <source_model>adminhtml/system_config_source_country</source_model>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>0</show_in_store>
506
+ </specificcountry>-->
507
+ <sort_order translate="label">
508
+ <label>Sort Order</label>
509
+ <frontend_type>text</frontend_type>
510
+ <sort_order>150</sort_order>
511
+ <show_in_default>1</show_in_default>
512
+ <show_in_website>1</show_in_website>
513
+ <show_in_store>0</show_in_store>
514
+ </sort_order>
515
+ </fields>
516
+ </vconnect_postnord_eu>
517
+ <vconnect_postnord_intl translate="label" module="vc_aio">
518
+ <label>PostNord - International</label>
519
+ <frontend_type>text</frontend_type>
520
+ <sort_order>87</sort_order>
521
+ <show_in_default>1</show_in_default>
522
+ <show_in_website>1</show_in_website>
523
+ <show_in_store>1</show_in_store>
524
+ <fields>
525
+ <active translate="label">
526
+ <label>Enabled</label>
527
+ <frontend_type>select</frontend_type>
528
+ <source_model>adminhtml/system_config_source_yesno</source_model>
529
+ <sort_order>10</sort_order>
530
+ <show_in_default>1</show_in_default>
531
+ <show_in_website>1</show_in_website>
532
+ <show_in_store>0</show_in_store>
533
+ </active>
534
+ <name translate="label">
535
+ <label>Method name</label>
536
+ <frontend_type>text</frontend_type>
537
+ <sort_order>30</sort_order>
538
+ <show_in_default>1</show_in_default>
539
+ <show_in_website>1</show_in_website>
540
+ <show_in_store>1</show_in_store>
541
+ </name>
542
+ <transit_time translate="label">
543
+ <label>Transit Time</label>
544
+ <frontend_type>text</frontend_type>
545
+ <sort_order>33</sort_order>
546
+ <show_in_default>1</show_in_default>
547
+ <show_in_website>1</show_in_website>
548
+ <show_in_store>1</show_in_store>
549
+ </transit_time>
550
+ <price translate="label">
551
+ <label>Prices</label>
552
+ <frontend_type>text</frontend_type>
553
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
554
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
555
+ <sort_order>40</sort_order>
556
+ <show_in_default>1</show_in_default>
557
+ <show_in_website>1</show_in_website>
558
+ <show_in_store>0</show_in_store>
559
+ </price>
560
+ <sort_order translate="label">
561
+ <label>Sort Order</label>
562
+ <frontend_type>text</frontend_type>
563
+ <sort_order>150</sort_order>
564
+ <show_in_default>1</show_in_default>
565
+ <show_in_website>1</show_in_website>
566
+ <show_in_store>0</show_in_store>
567
+ </sort_order>
568
+ </fields>
569
+ </vconnect_postnord_intl>
570
+
571
+ </groups>
572
+ </carriers>
573
+ </sections>
574
+ </config>
app/code/community/Vconnect/AllInOne/sql/vconnect_postnord_setup/install-0.1.2.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ /* @var $installer Mage_Sales_Model_Resource_Setup */
4
+ $installer->startSetup();
5
+
6
+ $installer->addAttribute('order', 'vconnect_postnord_data', array(
7
+ 'type'=>'text'
8
+ ));
9
+ $installer->addAttribute('quote', 'vconnect_postnord_data', array(
10
+ 'type'=>'text'
11
+ ));
12
+
13
+ $installer->endSetup();
14
+
app/code/community/Vconnect/AllInOne/sql/vconnect_postnord_setup/upgrade-0.1.2.0-0.1.2.1.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ /* @var $installer Mage_Sales_Model_Resource_Setup */
4
+ $installer->startSetup();
5
+ //quote_address_shipping_rate
6
+ //$quote_address_shipping_rate
7
+
8
+ $installer->getConnection()
9
+ ->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'vc_method_data', array(
10
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
11
+ 'nullable' => true,
12
+ 'length' => null,
13
+ 'after' => null, // column name to insert new column after
14
+ 'comment' => 'Postnord data'
15
+ ));
16
+
17
+ $installer->endSetup();
18
+
app/code/community/Vconnect/AllInOneDk/Block/Adminhtml/System/Config/Form/Prices.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOneDk_Block_Adminhtml_System_Config_Form_Prices
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
5
+ {
6
+ /*
7
+ * Set template
8
+ */
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->setTemplate('vconnect/pdkalpha/prices.phtml');
13
+ }
14
+
15
+ /**
16
+ * Return element html
17
+ *
18
+ * @param Varien_Data_Form_Element_Abstract $element
19
+ * @return string
20
+ */
21
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
22
+ {
23
+ $this->setElement($element);
24
+ return $this->_toHtml();
25
+ }
26
+
27
+ }
app/code/community/Vconnect/AllInOneDk/Block/Shipping/Form.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOneDk_Block_Shipping_Form extends Mage_Checkout_Block_Onepage_Abstract
4
+ {
5
+
6
+ }
app/code/community/Vconnect/AllInOneDk/Helper/Data.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneDk_Helper_Data
29
+ */
30
+ class Vconnect_AllInOneDk_Helper_Data extends Mage_Core_Helper_Abstract
31
+ {
32
+ public function getTemplateForCode($code){
33
+ $template = false;
34
+ switch ($code){
35
+ case 'vconnect_postnord_dk_private':
36
+ $template = 'vconnect/aio/dk.phtml';
37
+ break;
38
+ default :
39
+ $template = false;
40
+ break;
41
+ }
42
+ return $template;
43
+ }
44
+ }
app/code/community/Vconnect/AllInOneDk/Model/Adminhtml/System/Config/Source/Orderstate.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOneDk_Model_Adminhtml_System_Config_Source_Orderstate extends Mage_Eav_Model_Entity_Attribute_Source_Table
4
+ {
5
+ protected $_statuses;
6
+ /**
7
+ *
8
+ * @return array
9
+ */
10
+ public function toOptionArray()
11
+ {
12
+ if(!$this->_statuses){
13
+ $this->_statuses = Mage::getResourceModel('sales/order_status_collection')
14
+ ->addStateFilter(Mage_Sales_Model_Order::STATE_PROCESSING)
15
+ ->toOptionHash();
16
+ array_unshift($this->_statuses, array('value'=>'',
17
+ 'label'=>Mage::helper('adminhtml')->__('--Please Select--')));
18
+ }
19
+
20
+ return $this->_statuses;
21
+ }
22
+
23
+ /**
24
+ *
25
+ * @return array
26
+ */
27
+ public function toArray()
28
+ {
29
+ return $this->toOptionArray();
30
+ }
31
+
32
+ }
33
+
34
+
app/code/community/Vconnect/AllInOneDk/Model/Array2XML.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Vconnect_AllInOneDk_Model_Array2XML {
5
+ /**
6
+ *
7
+ * @var \DomDocument
8
+ */
9
+ private static $xml = null;
10
+ private static $encoding = 'UTF-8';
11
+
12
+ /**
13
+ * Initialize the root XML node [optional]
14
+ * @param $version
15
+ * @param $encoding
16
+ * @param $format_output
17
+ */
18
+ public static function init($version = '1.0', $encoding = 'UTF-8', $format_output = true) {
19
+ self::$xml = new \DomDocument($version, $encoding);
20
+ self::$xml->formatOutput = $format_output;
21
+ self::$encoding = $encoding;
22
+ }
23
+
24
+ /**
25
+ * Convert an Array to XML
26
+ * @param string $node_name - name of the root node to be converted
27
+ * @param array $arr - aray to be converterd
28
+ * @return DomDocument
29
+ */
30
+ public static function &createXML($node_name, $arr=array()) {
31
+ $xml = self::getXMLRoot();
32
+ $xml->appendChild(self::convert($node_name, $arr));
33
+
34
+ self::$xml = null; // clear the xml node in the class for 2nd time use.
35
+ return $xml;
36
+ }
37
+
38
+ /**
39
+ * Convert an Array to XML
40
+ * @param string $node_name - name of the root node to be converted
41
+ * @param array $arr - aray to be converterd
42
+ * @return DOMNode
43
+ */
44
+ private static function &convert($node_name, $arr=array()) {
45
+
46
+ //print_arr($node_name);
47
+ $xml = self::getXMLRoot();
48
+ $node = $xml->createElement($node_name);
49
+
50
+ if(is_array($arr)){
51
+ // get the attributes first.;
52
+ if(isset($arr['@attributes'])) {
53
+ foreach($arr['@attributes'] as $key => $value) {
54
+ if(!self::isValidTagName($key)) {
55
+ throw new Exception('[Array2XML] Illegal character in attribute name. attribute: '.$key.' in node: '.$node_name);
56
+ }
57
+ $node->setAttribute($key, self::bool2str($value));
58
+ }
59
+ unset($arr['@attributes']); //remove the key from the array once done.
60
+ }
61
+
62
+ // check if it has a value stored in @value, if yes store the value and return
63
+ // else check if its directly stored as string
64
+ if(isset($arr['@value'])) {
65
+ $node->appendChild($xml->createTextNode(self::bool2str($arr['@value'])));
66
+ unset($arr['@value']); //remove the key from the array once done.
67
+ //return from recursion, as a note with value cannot have child nodes.
68
+ return $node;
69
+ } else if(isset($arr['@cdata'])) {
70
+ $node->appendChild($xml->createCDATASection(self::bool2str($arr['@cdata'])));
71
+ unset($arr['@cdata']); //remove the key from the array once done.
72
+ //return from recursion, as a note with cdata cannot have child nodes.
73
+ return $node;
74
+ }
75
+ }
76
+
77
+ //create subnodes using recursion
78
+ if(is_array($arr)){
79
+ // recurse to get the node for that key
80
+ foreach($arr as $key=>$value){
81
+ if(!self::isValidTagName($key)) {
82
+ throw new Exception('[Array2XML] Illegal character in tag name. tag: '.$key.' in node: '.$node_name);
83
+ }
84
+ if(is_array($value) && is_numeric(key($value))) {
85
+ // MORE THAN ONE NODE OF ITS KIND;
86
+ // if the new array is numeric index, means it is array of nodes of the same kind
87
+ // it should follow the parent key name
88
+ foreach($value as $k=>$v){
89
+ $node->appendChild(self::convert($key, $v));
90
+ }
91
+ } else {
92
+ // ONLY ONE NODE OF ITS KIND
93
+ $node->appendChild(self::convert($key, $value));
94
+ }
95
+ unset($arr[$key]); //remove the key from the array once done.
96
+ }
97
+ }
98
+
99
+ // after we are done with all the keys in the array (if it is one)
100
+ // we check if it has any text value, if yes, append it.
101
+ if(!is_array($arr)) {
102
+ $node->appendChild($xml->createTextNode(self::bool2str($arr)));
103
+ }
104
+
105
+ return $node;
106
+ }
107
+
108
+ /*
109
+ * Get the root XML node, if there isn't one, create it.
110
+ */
111
+ private static function getXMLRoot(){
112
+ if(empty(self::$xml)) {
113
+ self::init();
114
+ }
115
+ return self::$xml;
116
+ }
117
+
118
+ /*
119
+ * Get string representation of boolean value
120
+ */
121
+ private static function bool2str($v){
122
+ //convert boolean to text value.
123
+ $v = $v === true ? 'true' : $v;
124
+ $v = $v === false ? 'false' : $v;
125
+ return $v;
126
+ }
127
+
128
+ /*
129
+ * Check if the tag name or attribute name contains illegal characters
130
+ * Ref: http://www.w3.org/TR/xml/#sec-common-syn
131
+ */
132
+ private static function isValidTagName($tag){
133
+ $pattern = '/^[a-z_]+[a-z0-9\:\-\.\_]*[^:]*$/i';
134
+ return preg_match($pattern, $tag, $matches) && $matches[0] == $tag;
135
+ }
136
+ }
137
+ ?>
app/code/community/Vconnect/AllInOneDk/Model/Carrier/SmartDelivery.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Vconnect_AllInOneDk_Model_Carrier_SmartDelivery
4
+ extends Mage_Shipping_Model_Carrier_Abstract
5
+ implements Mage_Shipping_Model_Carrier_Interface
6
+ {
7
+
8
+ /**
9
+ * code name
10
+ *
11
+ * @var string
12
+ */
13
+ protected $_code = 'vconnect_pdkalpha';
14
+
15
+ /**
16
+ * boolean isFixed
17
+ *
18
+ * @var boolean
19
+ */
20
+ protected $_isFixed = true;
21
+
22
+ /**d
23
+ * Default condition name
24
+ *
25
+ * @var string
26
+ */
27
+ protected $_default_condition_name = 'package_weight';
28
+
29
+ /**
30
+ * Condition names
31
+ *
32
+ * @var array
33
+ */
34
+ protected $_conditionNames = array();
35
+
36
+ /*
37
+ * Constructor
38
+ */
39
+ public function __construct()
40
+ {
41
+ parent::__construct();
42
+ foreach ($this->getCode('condition_name') as $k=>$v) {
43
+ $this->_conditionNames[] = $k;
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Collect and get rates
49
+ *
50
+ * @param Mage_Shipping_Model_Rate_Request $request
51
+ * @return Mage_Shipping_Model_Rate_Result
52
+ */
53
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
54
+ {
55
+ if (!$this->getConfigFlag('active')) {
56
+ return false;
57
+ }
58
+ $log = array();
59
+ $dataToLog = $request->getData();
60
+ foreach ($dataToLog as $key=>$value){
61
+ if(is_object($value)){
62
+ $log[$key] = get_class($value) ;
63
+ }
64
+ elseif(is_array($value)){
65
+ $log[$key] = array_keys($value) ;
66
+ }
67
+ else{
68
+ $log[$key] = $value ;
69
+ }
70
+ }
71
+ // Mage::log($log);
72
+
73
+ // exclude Virtual products price from Package value if pre-configured
74
+ if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {
75
+ foreach ($request->getAllItems() as $item) {
76
+ if ($item->getParentItem()) {
77
+ continue;
78
+ }
79
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
80
+ foreach ($item->getChildren() as $child) {
81
+ if ($child->getProduct()->isVirtual()) {
82
+ $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
83
+ }
84
+ }
85
+ } elseif ($item->getProduct()->isVirtual()) {
86
+ $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
87
+ }
88
+ }
89
+ }
90
+
91
+ // Free shipping by qty
92
+ $freeQty = 0;
93
+ if ($request->getAllItems()) {
94
+ foreach ($request->getAllItems() as $item) {
95
+ if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
96
+ continue;
97
+ }
98
+
99
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
100
+ foreach ($item->getChildren() as $child) {
101
+ if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
102
+ $freeQty += $item->getQty() * ($child->getQty() - (is_numeric($child->getFreeShipping()) ? $child->getFreeShipping() : 0));
103
+ }
104
+ }
105
+ } elseif ($item->getFreeShipping()) {
106
+ $freeQty += ($item->getQty() - (is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0));
107
+ }
108
+ }
109
+ }
110
+
111
+ //if (!$request->getConditionName()) {
112
+ $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
113
+ //}
114
+
115
+ // Package weight and qty free shipping
116
+ $oldWeight = $request->getPackageWeight();
117
+ $oldQty = $request->getPackageQty();
118
+
119
+ $request->setPackageWeight($request->getFreeMethodWeight());
120
+ $request->setPackageQty($oldQty - $freeQty);
121
+
122
+ $result = Mage::getModel('shipping/rate_result');
123
+
124
+
125
+ $request->setPackageWeight($oldWeight);
126
+ $request->setPackageQty($oldQty);
127
+
128
+
129
+ foreach ($this->getAllowedMethods() as $code=>$methodName){
130
+ $rate = $this->getRate($code);
131
+ if (!empty($rate) && $rate['price'] >= 0){
132
+ $method = Mage::getModel('shipping/rate_result_method');
133
+
134
+ $method->setCarrier($this->_code);
135
+ $method->setCarrierTitle($this->getConfigData('title'));
136
+
137
+ $method->setMethod($code);
138
+ $method->setMethodTitle($methodName);
139
+
140
+ if ($request->getFreeShipping() === true || ($request->getPackageQty() == $freeQty)) {
141
+ $shippingPrice = 0;
142
+ } else {
143
+ $shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
144
+ }
145
+
146
+ $method->setPrice($shippingPrice);
147
+ $method->setCost($rate['cost']);
148
+
149
+ $result->append($method);
150
+ }
151
+
152
+ }
153
+
154
+
155
+
156
+ return $result;
157
+ }
158
+
159
+ public function getRate($code)
160
+ {
161
+ $rates = $this->getPrices();
162
+ if(isset($rates[$code])){
163
+ return array(
164
+ 'price' => $rates[$code],
165
+ 'cost' => 0
166
+ );
167
+ }
168
+ return array();
169
+ }
170
+ protected function getPrices(){
171
+ $_prices = unserialize($this->getConfigData('prices'));
172
+ $prices['green_1'] = $_prices[1];
173
+ $prices['green_2'] = $_prices[2];
174
+ $prices['green_4'] = $_prices[3];
175
+ $prices['green_8'] = $_prices[4];
176
+ $prices['yellow_1'] = $_prices[6];
177
+ $prices['yellow_2'] = $_prices[7];
178
+ $prices['yellow_4'] = $_prices[8];
179
+ $prices['yellow_8'] = $_prices[9];
180
+ $prices['red_1'] = $_prices[11];
181
+ $prices['red_2'] = $_prices[12];
182
+ $prices['red_4'] = $_prices[13];
183
+ $prices['red_8'] = $_prices[14];
184
+ return $prices;
185
+ }
186
+
187
+ public function getCode($type, $code='')
188
+ {
189
+ $codes = array(
190
+
191
+ 'condition_name'=>array(
192
+ 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
193
+ 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
194
+ 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
195
+ ),
196
+
197
+ 'condition_name_short'=>array(
198
+ 'package_weight' => Mage::helper('shipping')->__('Weight (and above)'),
199
+ 'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),
200
+ 'package_qty' => Mage::helper('shipping')->__('# of Items (and above)'),
201
+ ),
202
+
203
+ );
204
+
205
+ if (!isset($codes[$type])) {
206
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Table Rate code type: %s', $type));
207
+ }
208
+
209
+ if (''===$code) {
210
+ return $codes[$type];
211
+ }
212
+
213
+ if (!isset($codes[$type][$code])) {
214
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Table Rate code for type %s: %s', $type, $code));
215
+ }
216
+ return $codes[$type][$code];
217
+ }
218
+
219
+ /**
220
+ * Get allowed shipping methods
221
+ *
222
+ * @return array
223
+ */
224
+ public function getAllowedMethods()
225
+ {
226
+ $prices = $this->getPrices();
227
+ $return = array();
228
+ foreach ($prices as $key=>$price){
229
+ $parts = explode('_', $key);
230
+ $title = strtoupper($parts[0]);
231
+ $return[$key] = "$title {$parts[1]} hr/s";
232
+ }
233
+ return $return;
234
+ }
235
+
236
+ }
app/code/community/Vconnect/AllInOneDk/Model/Method/Mapper.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author Ivaylo Alexandrov
28
+ * @email ivaylo@vconnect.dk
29
+ * @class Vconnect_Postnord_Model_Method_Mapper
30
+ */
31
+ /*
32
+ @author Ivaylo Alexandrov ivaylo@vconnect.dk
33
+ */
34
+ class Vconnect_Postnord_Model_Method_Mapper extends Mage_Core_Model_Abstract
35
+ {
36
+
37
+ public function mapBlocksForMethods(Vconnect_AllInOne_Block_Shipping_Dialog $block)
38
+ {
39
+ $layout = Mage::app()->getLayout();
40
+ foreach ($block->getRates() as $code => $rate)
41
+ {
42
+ if(isset($rate['price'])){
43
+
44
+ }
45
+ }
46
+ }
47
+
48
+ public function getConfigForMethod($code)
49
+ {
50
+ return array(
51
+ array(
52
+ 'private' => array(
53
+ 'delivery_type' => array(
54
+
55
+ ),
56
+ 'type' => array(
57
+
58
+ ),
59
+
60
+ )
61
+ ),
62
+ array(
63
+ 'commercial' => array(
64
+ 'delivery_type' => array(
65
+
66
+ ),
67
+ 'type' => array(
68
+
69
+ ),
70
+
71
+ )
72
+ ),
73
+ array(
74
+ 'pickup' => array(
75
+ 'delivery_type' => array(
76
+
77
+ ),
78
+ 'type' => array(
79
+
80
+ ),
81
+
82
+ )
83
+ ),
84
+ );
85
+ }
86
+
87
+
88
+ }
app/code/community/Vconnect/AllInOneDk/Model/Observer.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOneDk
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneDk_Model_Observer
29
+ */
30
+ class Vconnect_AllInOneDk_Model_Observer
31
+ {
32
+ /**
33
+ *
34
+ * @return Vconnect_AllInOne_Helper_Data
35
+ */
36
+ public function helper()
37
+ {
38
+ return Mage::helper('vc_aio');
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @param Varien_Event_Observer $observer
44
+ */
45
+ public function collectShippingMethods(Varien_Event_Observer $observer)
46
+ {
47
+
48
+
49
+
50
+ $methods = $observer->getEvent()->getMethods();
51
+ /* @var $methods Varien_Data_Collection */
52
+
53
+ $request = $observer->getEvent()->getRequest();
54
+ /* @var $request Mage_Shipping_Model_Rate_Request */
55
+
56
+ $destCountryId = strtolower($request->getDestCountryId());
57
+ if( strtolower($request->getCountryId()) != 'dk' )
58
+ {
59
+ return;
60
+ }
61
+ $shippingMethods = $this->getAvailableMethods();
62
+ foreach ($shippingMethods as $data)
63
+ {
64
+ if(in_array($destCountryId, $data['countries']) && !in_array($destCountryId,$data['exclude'])
65
+ && Mage::getStoreConfigFlag("carriers/{$data['system_path']}/active") ){
66
+
67
+ if ($data['system_path'] == 'vconnect_postnord_home' && Mage::getStoreConfigFlag("carriers/vconnect_postnord_home/flex_delivery_active")) {
68
+ $data['delivery']['Flex Delivery'] = array(
69
+ Mage::helper('vc_aio_dk')->__('In front of the Door'),
70
+ Mage::helper('vc_aio_dk')->__('Carport'),
71
+ Mage::helper('vc_aio_dk')->__('Infront of backdoor'),
72
+ Mage::helper('vc_aio_dk')->__('I have modttagarflex'),
73
+ Mage::helper('vc_aio_dk')->__('Other place') => Mage::helper('vc_aio_dk')->__('Other place')
74
+ );
75
+ } elseif ($data['system_path'] == 'vconnect_postnord_business' && Mage::getStoreConfigFlag("carriers/vconnect_postnord_business/flex_delivery_active")) {
76
+ $data['delivery']['Flex Delivery'] = array(
77
+ Mage::helper('vc_aio_dk')->__('In front of the Door'),
78
+ Mage::helper('vc_aio_dk')->__('Carport'),
79
+ Mage::helper('vc_aio_dk')->__('Infront of backdoor'),
80
+ Mage::helper('vc_aio_dk')->__('I have modttagarflex'),
81
+ Mage::helper('vc_aio_dk')->__('Other place') => Mage::helper('vc_aio_dk')->__('Other place')
82
+ );
83
+ }
84
+
85
+ $m = new Varien_Object($data);
86
+ $m->setIdFieldName('method');
87
+ $methods->addItem($m);
88
+ }
89
+
90
+ }
91
+ }
92
+
93
+ /**
94
+ *
95
+ * @return array method configurations
96
+ */
97
+ public function getAvailableMethods()
98
+ {
99
+ return array(
100
+
101
+ array(
102
+ 'system_path' => 'vconnect_postnord_home',
103
+ 'template' => 'private',
104
+ 'method' => 'dk_privatehome',
105
+ 'countries' => array('dk'),
106
+ 'exclude' => array(),
107
+ 'multiprices' => false,
108
+ 'price_code' => 'price',
109
+ 'delivery_time' => '1-3 days',
110
+ 'arrival' => array(
111
+ Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text")
112
+ ),
113
+ 'delivery' => array(
114
+ 'Personal Delivery'=>'Personal Delivery'
115
+ ),
116
+ ),
117
+ array(
118
+ 'system_path' => 'vconnect_postnord_pickup',
119
+ 'template' => 'pickup',
120
+ 'method' => 'dk_pickup',
121
+ 'countries' => $this->helper()->getScandinavianCountries(),
122
+ 'exclude' => array(),
123
+ 'multiprices' => true,
124
+ ),
125
+ array(
126
+ 'system_path' => 'vconnect_postnord_business',
127
+ 'template' => 'commercial',
128
+ 'method' => 'dk_commercial',
129
+ 'countries' => array('dk'),
130
+ 'exclude' => array(),
131
+ 'multiprices' => false,
132
+ 'price_code' => 'price',
133
+ 'delivery_time' => '1-3 days',
134
+ 'arrival' => array(
135
+ Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text")
136
+ ),
137
+ 'delivery' => array(
138
+ 'Personal Delivery'=>'Personal Delivery',
139
+ ),
140
+ ),
141
+ array(
142
+ 'system_path' => 'vconnect_postnord_eu',
143
+ 'template' => 'dpdeu',
144
+ 'method' => 'dk_dpdeu',
145
+ 'countries' => $this->helper()->getEuCountries(),
146
+ 'exclude' => $this->helper()->getScandinavianCountries(),
147
+ 'multiprices' => false,
148
+ 'price_code' => 'price',
149
+ ),
150
+ array(
151
+ 'system_path' => 'vconnect_postnord_intl',
152
+ 'template' => 'dpdinternational',
153
+ 'method' => 'dk_dpdinternational',
154
+ 'countries' => $this->helper()->getAllCountries(),
155
+ 'exclude' => $this->helper()->getEuCountries(),
156
+ 'multiprices' => false,
157
+ 'price_code' => 'price',
158
+ ),
159
+ );
160
+ }
161
+
162
+
163
+ }
app/code/community/Vconnect/AllInOneDk/Model/Timeslot.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Vconnect_AllInOneDk_Model_Timeslot extends Varien_Object
3
+ {
4
+
5
+ private $_normalized = false;
6
+
7
+ protected $_idFieldName = 'timeslot_id';
8
+
9
+ /**
10
+ * Check if shipping order is still available for this timeslot
11
+ * @return bool
12
+ */
13
+ public function isActive()
14
+ {
15
+ $deadline = $this->getData('deadline_ts');
16
+ /* @var $deadline Zend_Date */
17
+ if(!$deadline instanceof Zend_Date){
18
+ Mage::throwException('Timeslot deadline _ts is not instance of Zend_Date');
19
+ }
20
+ return $deadline->getTimestamp() > Mage::getModel('core/date')
21
+ ->gmtTimestamp();
22
+ }
23
+
24
+ /**
25
+ *
26
+ */
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->normalize();
30
+ }
31
+
32
+ public function __toArray(array $arrAttributes = array()) {
33
+ $arrData = parent::__toArray($arrAttributes);
34
+ foreach ($arrData as $key=>$value){
35
+ if(in_array($key, array('begin_ts','end_ts','deadline_ts'))
36
+ && $value instanceof Zend_Date)
37
+ {
38
+ $arrData[$key] = (int)$value->getTimestamp() *1000;
39
+ }
40
+ }
41
+ $arrData['description'] = $this->__toString();
42
+ return $arrData;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @return bool
48
+ */
49
+ public function isFree(){
50
+ return (bool)$this->getOrderCount();
51
+ }
52
+
53
+ /**
54
+ *
55
+ * @return string
56
+ */
57
+ public function __toString() {
58
+ $bdt = $this->getBeginTs()->toString( Zend_Date::DATE_FULL );
59
+ $bt = $this->getBeginTs()->toString( Zend_Date::TIME_SHORT );
60
+ $et = $this->getEndTs()->toString( Zend_Date::TIME_SHORT );
61
+ return Mage::helper('vc_alpha')
62
+ ->__("Expected delivery at %s between %s and %s",
63
+ $bdt,$bt,$et);
64
+ }
65
+
66
+ /**
67
+ *
68
+ * @return Vconnect_Pdkalpha_Model_Timeslot
69
+ */
70
+ public function normalize()
71
+ {
72
+ if($this->_normalized){
73
+ return $this;
74
+ }
75
+
76
+ $start = $this->getData('beginTs');
77
+ $end = $this->getData('endTs');
78
+ if($start && $end){
79
+ $diff = (int)substr( $end, 0,10) - (int)substr( $start, 0,10) ;
80
+ $type = $diff/3600;
81
+ $this->setData('type',$type);
82
+ }
83
+
84
+ $filter = new Zend_Filter_Word_CamelCaseToUnderscore();
85
+ foreach ( $this->getData() as $key => $value ){
86
+ $_key = strtolower($filter->filter($key));
87
+
88
+ $this->unsetData($key);
89
+
90
+ if($_key == 'status'){
91
+ $value = strtolower( $value?:'GREEN' );
92
+ }
93
+
94
+ $this->setData( $_key, $value );
95
+
96
+ if( in_array($_key, array('begin_ts','end_ts','deadline_ts') )
97
+ && !$value instanceof Zend_Date)
98
+ {
99
+ $value = Mage::app()->getLocale()
100
+ ->date( substr( $value, 0,10) );
101
+ $newKey = str_replace('_ts', '_time',$_key );
102
+ $time = $value->toString(Zend_Date::TIME_SHORT);
103
+ $this->setData($newKey,$time);
104
+ $this->setData($_key,$value);
105
+ }
106
+ }
107
+
108
+ $prices = Mage::helper('vc_alpha')->getPricesFormated();
109
+ if(isset($prices[$this->getStatus()]['prices'][$this->getType()])){
110
+ $price = $prices[$this->getStatus()]['prices'][$this->getType()];
111
+ }else{
112
+ $price = 0;
113
+ }
114
+ if(isset($prices[$this->getStatus()]['color'])){
115
+ $this->setColor('#'.$prices[$this->getStatus()]['color']);
116
+ }else{
117
+ $this->setColor('#a3ccea');
118
+ }
119
+
120
+ $this->setPrice($price);
121
+ $this->setPriceFormated( Mage::helper('core')
122
+ ->currency( $price, true, false ));
123
+ $this->setIsFree( (bool) $this->getOrderCount());
124
+ $this->_normalized = true;
125
+ return $this;
126
+ }
127
+ }
app/code/community/Vconnect/AllInOneDk/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Vconnect_AllInOneDk>
6
+ <version>1.0.0.0</version>
7
+ </Vconnect_AllInOneDk>
8
+ </modules>
9
+ <global>
10
+ <blocks>
11
+ <vc_aio_dk>
12
+ <class>Vconnect_AllInOneDk_Block</class>
13
+ </vc_aio_dk>
14
+ </blocks>
15
+ <models>
16
+ <vc_aio_dk>
17
+ <class>Vconnect_AllInOneDk_Model</class>
18
+ </vc_aio_dk>
19
+ </models>
20
+ <helpers>
21
+ <vc_aio_dk>
22
+ <class>Vconnect_AllInOneDk_Helper</class>
23
+ </vc_aio_dk>
24
+ </helpers>
25
+ <resources>
26
+ </resources>
27
+ <events>
28
+ <vconnect_postnord_collect_shipping_methods>
29
+ <observers>
30
+ <vc_aio_dk_collect_shipping_methods>
31
+ <class>vc_aio_dk/observer</class>
32
+ <method>collectShippingMethods</method>
33
+ </vc_aio_dk_collect_shipping_methods>
34
+ </observers>
35
+ </vconnect_postnord_collect_shipping_methods>
36
+ </events>
37
+ </global>
38
+ <frontend>
39
+ <routers>
40
+ </routers>
41
+ </frontend>
42
+ <adminhtml>
43
+ <layout>
44
+ <updates>
45
+ </updates>
46
+ </layout>
47
+ </adminhtml>
48
+ <default>
49
+ <carriers>
50
+ <!-- <vconnect_pdkalpha>
51
+ <active>0</active>
52
+ <include_jquery>1</include_jquery>
53
+ <include_jquery_ui>1</include_jquery_ui>
54
+ <name>SmartLevering</name>
55
+ <model>vc_aio_dk/carrier_pdkalpha</model>
56
+ <title>Post Danmark SmartLevering</title>
57
+ <create_preorder>0</create_preorder>
58
+ </vconnect_pdkalpha>-->
59
+ </carriers>
60
+ </default>
61
+ </config>
app/code/community/Vconnect/AllInOneDk/etc/system.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections> <!-- system config section -->
4
+ <carriers>
5
+ <groups>
6
+ <vconnect_postnord_business>
7
+ <fields>
8
+ </fields>
9
+ </vconnect_postnord_business>
10
+
11
+ <vconnect_postnord_home>
12
+ <fields>
13
+ </fields>
14
+ </vconnect_postnord_home>
15
+ <vconnect_postnord_pickup>
16
+ <fields>
17
+ </fields>
18
+ </vconnect_postnord_pickup>
19
+ </groups>
20
+ </carriers>
21
+ </sections>
22
+ </config>
app/code/community/Vconnect/AllInOneFi/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneFi_Helper_Data
29
+ */
30
+ class Vconnect_AllInOneFi_Helper_Data extends Mage_Core_Helper_Abstract
31
+ {
32
+
33
+ }
app/code/community/Vconnect/AllInOneFi/Model/Observer.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOneDk
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneDk_Model_Observer
29
+ */
30
+ class Vconnect_AllInOneFi_Model_Observer
31
+ {
32
+ /**
33
+ *
34
+ * @return Vconnect_AllInOne_Helper_Data
35
+ */
36
+ public function helper()
37
+ {
38
+ return Mage::helper('vc_aio');
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @param Varien_Event_Observer $observer
44
+ */
45
+ public function collectShippingMethods(Varien_Event_Observer $observer)
46
+ {
47
+ $request = $observer->getEvent()->getRequest();
48
+ /* @var $request Mage_Shipping_Model_Rate_Request */
49
+
50
+ if( strtolower($request->getCountryId()) != 'fi' )
51
+ {
52
+ return;
53
+ }
54
+ $methods = $observer->getEvent()->getMethods();
55
+ /* @var $methods Varien_Data_Collection */
56
+
57
+
58
+ $destCountryId = strtolower($request->getDestCountryId());
59
+ $shippingMethods = $this->getAvailableMethods();
60
+
61
+ foreach ($shippingMethods as $data)
62
+ {
63
+ if(in_array($destCountryId, $data['countries']) && !in_array($destCountryId,$data['exclude'])
64
+ && Mage::getStoreConfigFlag("carriers/{$data['system_path']}/active") ){
65
+ $m = new Varien_Object($data);
66
+ $m->setIdFieldName('method');
67
+ $methods->addItem($m);
68
+ }
69
+
70
+ }
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @return array method configurations
76
+ */
77
+ public function getAvailableMethods()
78
+ {
79
+ return array(
80
+
81
+ array(
82
+ 'system_path' => 'vconnect_postnord_home',
83
+ 'template' => 'private',
84
+ 'method' => 'fi_privatehome',
85
+ 'countries' => array('fi'),
86
+ 'exclude' => array(),
87
+ 'multiprices' => false,
88
+ 'price_code' => 'price',
89
+ 'delivery_time' => '1-3 days',
90
+ 'arrival' => array(
91
+ Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text")
92
+ ),
93
+ 'delivery' => array(
94
+ 'Personal Delivery'=>'Personal Delivery',
95
+ ),
96
+ ),
97
+ array(
98
+ 'system_path' => 'vconnect_postnord_pickup',
99
+ 'template' => 'pickup',
100
+ 'method' => 'fi_pickup',
101
+ 'countries' => $this->helper()->getScandinavianCountries(),
102
+ 'exclude' => array(),
103
+ 'multiprices' => true,
104
+
105
+ ),
106
+ array(
107
+ 'system_path' => 'vconnect_postnord_business',
108
+ 'template' => 'commercial',
109
+ 'method' => 'fi_commercial',
110
+ 'countries' => array('fi'),
111
+ 'exclude' => array(),
112
+ 'multiprices' => false,
113
+ 'price_code' => 'price',
114
+ 'delivery_time' => '1-3 days',
115
+ 'arrival' => array(
116
+ Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text")
117
+ ),
118
+ 'delivery' => array(
119
+ 'Personal Delivery'=>'Personal Delivery',
120
+ ),
121
+ ),
122
+ array(
123
+ 'system_path' => 'vconnect_postnord_eu',
124
+ 'template' => 'dpdeu',
125
+ 'method' => 'fi_dpdclassic',
126
+ 'countries' => $this->helper()->getEuCountries(),
127
+ 'exclude' => $this->helper()->getScandinavianCountries(),
128
+ 'multiprices' => false,
129
+ 'price_code' => 'price',
130
+ ),
131
+ array(
132
+ 'system_path' => 'vconnect_postnord_intl',
133
+ 'template' => 'dpdinternational',
134
+ 'method' => 'fi_dpdclassic',
135
+ 'countries' => $this->helper()->getAllCountries(),
136
+ 'exclude' => $this->helper()->getEuCountries(),
137
+ 'multiprices' => false,
138
+ 'price_code' => 'price',
139
+ ),
140
+ );
141
+ }
142
+
143
+
144
+ }
app/code/community/Vconnect/AllInOneFi/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Vconnect_AllInOneFi>
6
+ <version>1.0.0.0</version>
7
+ </Vconnect_AllInOneFi>
8
+ </modules>
9
+ <global>
10
+ <blocks>
11
+ <vc_aio_fi>
12
+ <class>Vconnect_AllInOneFi_Block</class>
13
+ </vc_aio_fi>
14
+ </blocks>
15
+ <models>
16
+ <vc_aio_fi>
17
+ <class>Vconnect_AllInOneFi_Model</class>
18
+ </vc_aio_fi>
19
+ </models>
20
+ <helpers>
21
+ <vc_aio_fi>
22
+ <class>Vconnect_AllInOneFi_Helper</class>
23
+ </vc_aio_fi>
24
+ </helpers>
25
+ <resources>
26
+ </resources>
27
+ <events>
28
+ <vconnect_postnord_collect_shipping_methods>
29
+ <observers>
30
+ <vc_aio_fi_collect_shipping_methods>
31
+ <class>vc_aio_fi/observer</class>
32
+ <method>collectShippingMethods</method>
33
+ </vc_aio_fi_collect_shipping_methods>
34
+ </observers>
35
+ </vconnect_postnord_collect_shipping_methods>
36
+ </events>
37
+ </global>
38
+ <frontend>
39
+ <routers>
40
+ </routers>
41
+ </frontend>
42
+ <adminhtml>
43
+ <layout>
44
+ <updates>
45
+ </updates>
46
+ </layout>
47
+ </adminhtml>
48
+ <default>
49
+ <carriers>
50
+ <!-- <vconnect_pdkalpha>
51
+ <active>0</active>
52
+ <include_jquery>1</include_jquery>
53
+ <include_jquery_ui>1</include_jquery_ui>
54
+ <name>SmartLevering</name>
55
+ <model>vc_aio_dk/carrier_pdkalpha</model>
56
+ <title>Post Danmark SmartLevering</title>
57
+ <create_preorder>0</create_preorder>
58
+ </vconnect_pdkalpha>-->
59
+ </carriers>
60
+ </default>
61
+ </config>
app/code/community/Vconnect/AllInOneFi/etc/system.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections> <!-- system config section -->
4
+ <carriers>
5
+ <groups>
6
+ <vconnect_postnord_business>
7
+ <fields>
8
+ </fields>
9
+ </vconnect_postnord_business>
10
+
11
+ <vconnect_postnord_home>
12
+ <fields>
13
+ </fields>
14
+ </vconnect_postnord_home>
15
+ <vconnect_postnord_pickup>
16
+ <fields>
17
+ </fields>
18
+ </vconnect_postnord_pickup>
19
+ </groups>
20
+ </carriers>
21
+ </sections>
22
+ </config>
app/code/community/Vconnect/AllInOneNo/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneNo_Helper_Data
29
+ */
30
+ class Vconnect_AllInOneNo_Helper_Data extends Mage_Core_Helper_Abstract
31
+ {
32
+
33
+ }
app/code/community/Vconnect/AllInOneNo/Model/Observer.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOneDk
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneNo_Model_Observer
29
+ */
30
+ class Vconnect_AllInOneNo_Model_Observer
31
+ {
32
+ /**
33
+ *
34
+ * @return Vconnect_AllInOne_Helper_Data
35
+ */
36
+ public function helper()
37
+ {
38
+ return Mage::helper('vc_aio');
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @param Varien_Event_Observer $observer
44
+ */
45
+ public function collectShippingMethods(Varien_Event_Observer $observer)
46
+ {
47
+ $request = $observer->getEvent()->getRequest();
48
+ /* @var $request Mage_Shipping_Model_Rate_Request */
49
+
50
+ if( strtolower($request->getCountryId()) != 'no' || !$request->getDestCountryId()
51
+ || $request->getDestCountryId() == '')
52
+ {
53
+ return;
54
+ }
55
+ $methods = $observer->getEvent()->getMethods();
56
+ /* @var $methods Varien_Data_Collection */
57
+
58
+
59
+ $destCountryId = strtolower($request->getDestCountryId());
60
+ $shippingMethods = $this->getAvailableMethods();
61
+
62
+ foreach ($shippingMethods as $data)
63
+ {
64
+ if(in_array($destCountryId, $data['countries']) && !in_array($destCountryId,$data['exclude'])
65
+ && Mage::getStoreConfigFlag("carriers/{$data['system_path']}/active") ){
66
+
67
+ if ($data['system_path'] == 'vconnect_postnord_home' && Mage::getStoreConfigFlag("carriers/vconnect_postnord_home/flex_delivery_active")) {
68
+ $data['delivery']['Flex Delivery'] = array(
69
+ 'In front of the Door',
70
+ // 'Carport',
71
+ // 'Infront of backdoor',
72
+ // 'I have modttagarflex',
73
+ // 'Other place'=>'Other place'
74
+ );
75
+ } elseif ($data['system_path'] == 'vconnect_postnord_business' && Mage::getStoreConfigFlag("carriers/vconnect_postnord_business/flex_delivery_active")) {
76
+ $data['delivery']['Flex Delivery'] = array(
77
+ 'In front of the Door',
78
+ 'Carport',
79
+ 'Infront of backdoor',
80
+ 'I have modttagarflex',
81
+ 'Other place'=>'Other place'
82
+ );
83
+ }
84
+
85
+ Mage::log($data);
86
+ $m = new Varien_Object($data);
87
+ $m->setIdFieldName('method');
88
+ $methods->addItem($m);
89
+ }
90
+
91
+ }
92
+ }
93
+
94
+ /**
95
+ *
96
+ * @return array method configurations
97
+ */
98
+ public function getAvailableMethods()
99
+ {
100
+ return array(
101
+
102
+ array(
103
+ 'system_path' => 'vconnect_postnord_home',
104
+ 'template' => 'private',
105
+ 'method' => 'no_private',
106
+ 'countries' => array('no'),
107
+ 'exclude' => array(),
108
+ 'multiprices' => false,
109
+ 'price_code' => 'price',
110
+ 'delivery_info' => 'You will have the opportunity to choose the time of delivery as soon as we have received your package',
111
+ 'arrival' => array(
112
+ Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text")
113
+ ),
114
+ 'delivery' => array(
115
+ 'Personal Delivery'=>'Personal Delivery',
116
+ ),
117
+ ),
118
+ array(
119
+ 'system_path' => 'vconnect_postnord_mailbox',
120
+ 'template' => 'mailbox',
121
+ 'method' => 'no_privatehome',
122
+ 'arrival' => array(
123
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
124
+ ),
125
+ 'delivery' => array(),
126
+ 'countries' => array('no'),
127
+ 'exclude' => array(),
128
+ 'multiprices' => false,
129
+ 'price_code' => 'price_no',
130
+ 'delivery_info' => 'The package comes the same place as your local newspaper, either in your mailbox or on the doormat.',
131
+ ),
132
+ array(
133
+ 'system_path' => 'vconnect_postnord_mailbox',
134
+ 'template' => 'mailbox',
135
+ 'method' => 'no_privatehome',
136
+ 'arrival' => array(
137
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
138
+ ),
139
+ 'delivery' => array(),
140
+ 'countries' => $this->helper()->getEuCountries(),
141
+ 'exclude' => $this->helper()->getScandinavianCountries(),
142
+ 'multiprices' => false,
143
+ 'price_code' => 'price_eu',
144
+ ),
145
+ array(
146
+ 'system_path' => 'vconnect_postnord_mailbox',
147
+ 'template' => 'mailbox',
148
+ 'method' => 'no_privatehome',
149
+ 'arrival' => array(
150
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
151
+ ),
152
+ 'delivery' => array(),
153
+ 'countries' => $this->helper()->getAllCountries(),
154
+ 'exclude' => array_merge($this->helper()->getEuCountries() , $this->helper()->getScandinavianCountries()),
155
+ 'multiprices' => false,
156
+ 'price_code' => 'price_intl',
157
+ ),
158
+ array(
159
+ 'system_path' => 'vconnect_postnord_pickup',
160
+ 'template' => 'pickup',
161
+ 'method' => 'no_pickup',
162
+ 'countries' => $this->helper()->getScandinavianCountries(),
163
+ 'exclude' => array(),
164
+ 'multiprices' => true,
165
+ ),
166
+ array(
167
+ 'system_path' => 'vconnect_postnord_business',
168
+ 'template' => 'commercial',
169
+ 'method' => 'no_commercial',
170
+ 'countries' => array('no'),
171
+ 'exclude' => array(),
172
+ 'multiprices' => false,
173
+ 'price_code' => 'price',
174
+ 'arrival' => array(
175
+ Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text")
176
+ ),
177
+ 'delivery' => array(
178
+ 'Personal Delivery'=>'Personal Delivery',
179
+ ),
180
+ ),
181
+ array(
182
+ 'system_path' => 'vconnect_postnord_eu',
183
+ 'template' => 'dpdeu',
184
+ 'method' => 'no_dpdclassic',
185
+ 'countries' => $this->helper()->getEuCountries(),
186
+ 'exclude' => $this->helper()->getScandinavianCountries(),
187
+ 'multiprices' => false,
188
+ 'price_code' => 'price',
189
+ ),
190
+ array(
191
+ 'system_path' => 'vconnect_postnord_intl',
192
+ 'template' => 'dpdinternational',
193
+ 'method' => 'no_dpdclassic',
194
+ 'countries' => $this->helper()->getAllCountries(),
195
+ 'exclude' => array_merge($this->helper()->getEuCountries() , $this->helper()->getScandinavianCountries()),
196
+ 'multiprices' => false,
197
+ 'price_code' => 'price',
198
+ ),
199
+ );
200
+ }
201
+
202
+
203
+ }
app/code/community/Vconnect/AllInOneNo/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Vconnect_AllInOneNo>
6
+ <version>1.0.0.0</version>
7
+ </Vconnect_AllInOneNo>
8
+ </modules>
9
+ <global>
10
+ <blocks>
11
+ <vc_aio_no>
12
+ <class>Vconnect_AllInOneNo_Block</class>
13
+ </vc_aio_no>
14
+ </blocks>
15
+ <models>
16
+ <vc_aio_no>
17
+ <class>Vconnect_AllInOneNo_Model</class>
18
+ </vc_aio_no>
19
+ </models>
20
+ <helpers>
21
+ <vc_aio_no>
22
+ <class>Vconnect_AllInOneNo_Helper</class>
23
+ </vc_aio_no>
24
+ </helpers>
25
+ <resources>
26
+ </resources>
27
+ <events>
28
+ <vconnect_postnord_collect_shipping_methods>
29
+ <observers>
30
+ <vc_aio_no_collect_shipping_methods>
31
+ <class>vc_aio_no/observer</class>
32
+ <method>collectShippingMethods</method>
33
+ </vc_aio_no_collect_shipping_methods>
34
+ </observers>
35
+ </vconnect_postnord_collect_shipping_methods>
36
+ </events>
37
+ </global>
38
+ <frontend>
39
+ <routers>
40
+ </routers>
41
+ </frontend>
42
+ <adminhtml>
43
+ <layout>
44
+ <updates>
45
+ </updates>
46
+ </layout>
47
+ </adminhtml>
48
+ <default>
49
+ <carriers>
50
+ <!-- <vconnect_pdkalpha>
51
+ <active>0</active>
52
+ <include_jquery>1</include_jquery>
53
+ <include_jquery_ui>1</include_jquery_ui>
54
+ <name>SmartLevering</name>
55
+ <model>vc_aio_dk/carrier_pdkalpha</model>
56
+ <title>Post Danmark SmartLevering</title>
57
+ <create_preorder>0</create_preorder>
58
+ </vconnect_pdkalpha>-->
59
+ </carriers>
60
+ </default>
61
+ </config>
app/code/community/Vconnect/AllInOneNo/etc/system.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections> <!-- system config section -->
4
+ <carriers>
5
+ <groups>
6
+ <vconnect_postnord_business>
7
+ <fields>
8
+ </fields>
9
+ </vconnect_postnord_business>
10
+
11
+ <vconnect_postnord_home>
12
+ <fields>
13
+ </fields>
14
+ </vconnect_postnord_home>
15
+ <vconnect_postnord_pickup>
16
+ <fields>
17
+ </fields>
18
+ </vconnect_postnord_pickup>
19
+ </groups>
20
+ </carriers>
21
+ </sections>
22
+ </config>
app/code/community/Vconnect/AllInOneSe/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneSe_Helper_Data
29
+ */
30
+ class Vconnect_AllInOneSe_Helper_Data extends Mage_Core_Helper_Abstract
31
+ {
32
+
33
+ }
app/code/community/Vconnect/AllInOneSe/Model/Observer.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOneDk
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @class Vconnect_AllInOneSe_Model_Observer
29
+ */
30
+ class Vconnect_AllInOneSe_Model_Observer
31
+ {
32
+ /**
33
+ *
34
+ * @return Vconnect_AllInOne_Helper_Data
35
+ */
36
+ public function helper()
37
+ {
38
+ return Mage::helper('vc_aio');
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @param Varien_Event_Observer $observer
44
+ */
45
+ public function collectShippingMethods(Varien_Event_Observer $observer)
46
+ {
47
+ $request = $observer->getEvent()->getRequest();
48
+ /* @var $request Mage_Shipping_Model_Rate_Request */
49
+
50
+ if( strtolower($request->getCountryId()) != 'se' )
51
+ {
52
+ return;
53
+ }
54
+ $methods = $observer->getEvent()->getMethods();
55
+ /* @var $methods Varien_Data_Collection */
56
+
57
+
58
+ $destCountryId = strtolower($request->getDestCountryId());
59
+ $shippingMethods = $this->getAvailableMethods();
60
+
61
+ foreach ($shippingMethods as $data)
62
+ {
63
+ if(in_array($destCountryId, $data['countries']) && !in_array($destCountryId,$data['exclude'])
64
+ && Mage::getStoreConfigFlag("carriers/{$data['system_path']}/active") ){
65
+ $m = new Varien_Object($data);
66
+ $m->setIdFieldName('method');
67
+ $methods->addItem($m);
68
+ }
69
+
70
+ }
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @return array method configurations
76
+ */
77
+ public function getAvailableMethods()
78
+ {
79
+ return array(
80
+ array(
81
+ 'system_path' => 'vconnect_postnord_mailbox',
82
+ 'template' => 'mailbox',
83
+ 'method' => 'se_valuemail',
84
+ 'countries' => array('se'),
85
+ 'exclude' => array(),
86
+ 'arrival' => array(
87
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
88
+ ),
89
+ 'delivery' => array(
90
+ 'Nearest pickuplocation' => 'Nearest pickuplocation'
91
+ ),
92
+ 'multiprices' => false,
93
+ 'price_code' => 'price_se',
94
+ 'delivery_time' => '2-3 days',
95
+ ),
96
+ array(
97
+ 'system_path' => 'vconnect_postnord_mailbox',
98
+ 'template' => 'mailbox',
99
+ 'method' => 'se_privatehome',
100
+ 'countries' => array('dk'),
101
+ 'arrival' => array(
102
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
103
+ ),
104
+ 'delivery' => array(),
105
+ 'exclude' => array(),
106
+ 'multiprices' => false,
107
+ 'price_code' => 'price_dk',
108
+ 'delivery_time' => '2-3 days',
109
+ ),
110
+ array(
111
+ 'system_path' => 'vconnect_postnord_mailbox',
112
+ 'template' => 'mailbox',
113
+ 'method' => 'se_private',
114
+ 'arrival' => array(
115
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
116
+ ),
117
+ 'delivery' => array(),
118
+ 'countries' => array('no'),
119
+ 'exclude' => array(),
120
+ 'multiprices' => false,
121
+ 'price_code' => 'price_no',
122
+ 'delivery_time' => '2-3 days',
123
+ ),
124
+ array(
125
+ 'system_path' => 'vconnect_postnord_mailbox',
126
+ 'template' => 'mailbox',
127
+ 'method' => 'se_private',
128
+ 'arrival' => array(
129
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
130
+ ),
131
+ 'delivery' => array(),
132
+ 'countries' => $this->helper()->getEuCountries(),
133
+ 'exclude' => $this->helper()->getScandinavianCountries(),
134
+ 'multiprices' => false,
135
+ 'price_code' => 'price_eu',
136
+ 'delivery_time' => '2-3 days',
137
+ ),
138
+ array(
139
+ 'system_path' => 'vconnect_postnord_mailbox',
140
+ 'template' => 'mailbox',
141
+ 'method' => 'se_private',
142
+ 'arrival' => array(
143
+ Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_mailbox/arrival_option_text")
144
+ ),
145
+ 'delivery' => array(),
146
+ 'countries' => $this->helper()->getAllCountries(),
147
+ 'exclude' => array_merge($this->helper()->getEuCountries() , $this->helper()->getScandinavianCountries()),
148
+ 'multiprices' => false,
149
+ 'price_code' => 'price_intl',
150
+ 'delivery_time'=> '2-3 days',
151
+ ),
152
+ array(
153
+ 'system_path' => 'vconnect_postnord_home',
154
+ 'template' => 'private',
155
+ 'method' => 'se_privatehome',
156
+ 'countries' => array('se'),
157
+ 'exclude' => array(),
158
+ 'arrival' => array(
159
+ Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_home/arrival_option_text")
160
+ ),
161
+ 'delivery' => array(
162
+ 'Med kvittens'=>'Med kvittens',
163
+ 'Utan kvittens (paketet ställs utanför dörren)'=>'Utan kvittens (paketet ställs utanför dörren)',
164
+ ),
165
+ 'multiprices' => false,
166
+ 'price_code' => 'price',
167
+ 'delivery_time' => '1-3 days',
168
+ ),
169
+ array(
170
+ 'system_path' => 'vconnect_postnord_pickup',
171
+ 'template' => 'pickup',
172
+ 'method' => 'se_pickup',
173
+ 'countries' => $this->helper()->getScandinavianCountries(),
174
+ 'exclude' => array(),
175
+ 'multiprices' => true,
176
+ ),
177
+ array(
178
+ 'system_path' => 'vconnect_postnord_business',
179
+ 'template' => 'commercial',
180
+ 'method' => 'se_commercial',
181
+ 'countries' => array('se'),
182
+ 'exclude' => array(),
183
+ 'multiprices' => false,
184
+ 'price_code' => 'price',
185
+ 'delivery_time' => '1-3 days',
186
+ 'arrival' => array(
187
+ Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text") => Mage::getStoreConfig("carriers/vconnect_postnord_business/arrival_option_text")
188
+ ),
189
+ 'delivery' => array(
190
+ 'Personal Delivery'=>'Personal Delivery',
191
+ ),
192
+ ),
193
+ array(
194
+ 'system_path' => 'vconnect_postnord_eu',
195
+ 'template' => 'dpdeu',
196
+ 'method' => 'se_dpdclassic',
197
+ 'countries' => $this->helper()->getEuCountries(),
198
+ 'exclude' => $this->helper()->getScandinavianCountries(),
199
+ 'multiprices' => false,
200
+ 'price_code' => 'price',
201
+ ),
202
+ array(
203
+ 'system_path' => 'vconnect_postnord_intl',
204
+ 'template' => 'dpdinternational',
205
+ 'method' => 'se_dpdclassic',
206
+ 'countries' => $this->helper()->getAllCountries(),
207
+ 'exclude' => array_merge($this->helper()->getEuCountries() , $this->helper()->getScandinavianCountries()),
208
+ 'multiprices' => false,
209
+ 'price_code' => 'price',
210
+ ),
211
+ );
212
+ }
213
+
214
+
215
+ }
app/code/community/Vconnect/AllInOneSe/etc/config.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Vconnect_AllInOneSe>
6
+ <version>1.0.0.0</version>
7
+ </Vconnect_AllInOneSe>
8
+ </modules>
9
+ <global>
10
+ <blocks>
11
+ <vc_aio_se>
12
+ <class>Vconnect_AllInOneSe_Block</class>
13
+ </vc_aio_se>
14
+ </blocks>
15
+ <models>
16
+ <vc_aio_se>
17
+ <class>Vconnect_AllInOneSe_Model</class>
18
+ </vc_aio_se>
19
+ </models>
20
+ <helpers>
21
+ <vc_aio_se>
22
+ <class>Vconnect_AllInOneSe_Helper</class>
23
+ </vc_aio_se>
24
+ </helpers>
25
+ <resources>
26
+ </resources>
27
+ <events>
28
+ <vconnect_postnord_collect_shipping_methods>
29
+ <observers>
30
+ <vc_aio_se_collect_shipping_methods>
31
+ <class>vc_aio_se/observer</class>
32
+ <method>collectShippingMethods</method>
33
+ </vc_aio_se_collect_shipping_methods>
34
+ </observers>
35
+ </vconnect_postnord_collect_shipping_methods>
36
+ </events>
37
+ </global>
38
+ <frontend>
39
+ <routers>
40
+ </routers>
41
+ </frontend>
42
+ <adminhtml>
43
+ <layout>
44
+ <updates>
45
+ </updates>
46
+ </layout>
47
+ </adminhtml>
48
+ <default>
49
+ <carriers>
50
+ <vconnect_postnord_mailbox>
51
+ <active>0</active>
52
+ <name>To my mailbox</name>
53
+ <arrival_option_text>2-3 dagar</arrival_option_text>
54
+ </vconnect_postnord_mailbox>
55
+ </carriers>
56
+ </default>
57
+ </config>
app/code/community/Vconnect/AllInOneSe/etc/system.xml ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections> <!-- system config section -->
4
+ <carriers>
5
+ <groups>
6
+ <vconnect_postnord_mailbox >
7
+ <label>PostNord - To mailbox</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>96</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+
24
+ <name translate="label">
25
+ <label>Method name</label>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>30</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ </name>
32
+ <arrival_option_text translate="label">
33
+ <label>Option text</label>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>35</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </arrival_option_text>
40
+ <price_se translate="label">
41
+ <label>Price to Sweden</label>
42
+ <frontend_type>text</frontend_type>
43
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
44
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
45
+ <sort_order>100</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ </price_se>
50
+ <price_no translate="label">
51
+ <label>Price to Norway</label>
52
+ <frontend_type>text</frontend_type>
53
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
54
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
55
+ <sort_order>110</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>0</show_in_store>
59
+ </price_no>
60
+ <price_dk translate="label">
61
+ <label>Price to Danmark</label>
62
+ <frontend_type>text</frontend_type>
63
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
64
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
65
+ <sort_order>120</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </price_dk>
70
+ <price_eu translate="label">
71
+ <label>Price to EU</label>
72
+ <frontend_type>text</frontend_type>
73
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
74
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
75
+ <sort_order>123</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>0</show_in_store>
79
+ </price_eu>
80
+ <price_intl translate="label">
81
+ <label>Price to International</label>
82
+ <frontend_type>text</frontend_type>
83
+ <frontend_model>vc_aio/adminhtml_shipping_table</frontend_model>
84
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
85
+ <sort_order>126</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>0</show_in_store>
89
+ </price_intl>
90
+ <transit_time translate="label">
91
+ <label>Transit Time</label>
92
+ <frontend_type>text</frontend_type>
93
+ <sort_order>128</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ </transit_time>
98
+ <additional_fee_active translate="label">
99
+ <label>Enable Additional Fee</label>
100
+ <frontend_type>select</frontend_type>
101
+ <source_model>adminhtml/system_config_source_yesno</source_model>
102
+ <sort_order>130</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>0</show_in_store>
106
+ </additional_fee_active>
107
+ <additional_fee_label translate="label">
108
+ <label>Fee Label</label>
109
+ <comment>This is the delivery time the customer sees during checkout</comment>
110
+ <frontend_type>text</frontend_type>
111
+ <sort_order>133</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>0</show_in_store>
115
+ <depends><additional_fee_active>1</additional_fee_active></depends>
116
+ </additional_fee_label>
117
+ <additional_fee_amount translate="label">
118
+ <label>Fee amount</label>
119
+ <frontend_type>text</frontend_type>
120
+ <sort_order>135</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>0</show_in_store>
124
+ <depends><additional_fee_active>1</additional_fee_active></depends>
125
+ </additional_fee_amount>
126
+ <sort_order translate="label">
127
+ <label>Sort Order</label>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>140</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>0</show_in_store>
133
+ </sort_order>
134
+ </fields>
135
+ </vconnect_postnord_mailbox>
136
+ <vconnect_postnord_business>
137
+ <fields>
138
+ </fields>
139
+ </vconnect_postnord_business>
140
+ <vconnect_postnord_home>
141
+ <fields>
142
+ </fields>
143
+ </vconnect_postnord_home>
144
+ <vconnect_postnord_pickup>
145
+ <fields>
146
+ </fields>
147
+ </vconnect_postnord_pickup>
148
+ </groups>
149
+ </carriers>
150
+ </sections>
151
+ </config>
app/design/adminhtml/default/default/layout/vconnect/aio.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_system_config_edit>
4
+ <reference name="head">
5
+ <action method="addJs">
6
+ <script>jscolor/jscolor.js</script>
7
+ </action>
8
+ </reference>
9
+ </adminhtml_system_config_edit>
10
+ </layout>
app/design/adminhtml/default/default/template/vconnect/aio/methods_select.phtml ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* dropdown for the admin system config table rates */
4
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid(); // id of the table
5
+
6
+ $_colspan = 2;
7
+ if (!$this->_addAfter) {
8
+ $_colspan -= 1;
9
+ }
10
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
11
+ ?>
12
+
13
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
14
+ <table cellpadding="0" cellspacing="0" class="border">
15
+ <tbody>
16
+
17
+ <tr class="headings" id="headings<?php echo $_htmlId ?>"> <!-- heading for the table rates -->
18
+ <?php foreach ($this->_columns as $columnName => $column):?>
19
+ <th><?php echo $column['label'] ?></th>
20
+ <?php endforeach;?>
21
+ <th <?php echo $_colspan?>></th>
22
+ </tr>
23
+
24
+ <tr id="addRow<?php echo $_htmlId ?>"> <!-- standard values rows -->
25
+ <td colspan="<?php echo count($this->_columns) ?>"></td>
26
+ <td <?php echo $_colspan?>>
27
+ <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>"> <!-- button for adding more standard values rows -->
28
+ <span><?php echo $this->_addButtonLabel ?></span>
29
+ </button>
30
+ </td>
31
+ </tr>
32
+
33
+ </tbody>
34
+ </table>
35
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
36
+ </div>
37
+ <div id="empty<?php echo $_htmlId ?>">
38
+ <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
39
+ <span><?php echo $this->_addButtonLabel ?></span>
40
+ </button>
41
+ </div>
42
+
43
+ <script type="text/javascript">
44
+
45
+ //<![CDATA[
46
+ // create row creator
47
+ var arrayRow<?php echo $_htmlId ?> = {
48
+ // define row prototypeJS template
49
+ template : new Template( //template for the new table rate row
50
+ '<tr id="#{_id}">'
51
+ <?php foreach ($this->_columns as $columnName => $column):?>
52
+ +'<td>'
53
+ +'<?php echo $this->_renderCellTemplate($columnName)?>' //column values for the table rate row
54
+ +'<\/td>'
55
+ <?php endforeach;?>
56
+ <?php if ($this->_addAfter):?>
57
+ +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo $this->__('Add after') ?><\/span><\/button><\/td>'
58
+ <?php endif;?>
59
+ +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo $this->__('Delete') ?><\/span><\/button><\/td>' //delete button for the row
60
+ +'<\/tr>'
61
+ ),
62
+
63
+ rowsCount : 0,
64
+
65
+ add : function(templateData, insertAfterId)
66
+ {
67
+
68
+ // generate default template data
69
+ if ('' == templateData) {
70
+ var d = new Date();
71
+ var templateData = {
72
+ <?php foreach ($this->_columns as $columnName => $column):?>
73
+ <?php echo $columnName ?> : '',
74
+ <?php endforeach;?>
75
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
76
+ };
77
+ }
78
+
79
+ // insert before last row
80
+ if ('' == insertAfterId) {
81
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
82
+ }
83
+ // insert after specified row
84
+ else {
85
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
86
+ }
87
+
88
+ <?php if ($this->_addAfter):?>
89
+ Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
90
+ <?php endif;?>
91
+ <?php foreach ($this->_columns as $columnName => $column):?>
92
+
93
+ var options = $$("select[name*='["+templateData._id+"][<?php echo $columnName?>]"+"'] option");
94
+
95
+ for (var index = 0; index < options.length; ++index) {
96
+ var option = options[index];
97
+
98
+ if (option.getAttribute('value') == templateData.<?php echo $columnName?>) {
99
+
100
+ option.selected = true
101
+ }
102
+ }
103
+ <?php endforeach;?>
104
+
105
+ this.rowsCount += 1;
106
+ },
107
+
108
+ del : function(rowId)
109
+ {
110
+ $(rowId).remove();
111
+ this.rowsCount -= 1;
112
+ if (0 == this.rowsCount) {
113
+ this.showButtonOnly();
114
+ }
115
+ },
116
+
117
+ showButtonOnly : function()
118
+ {
119
+ $('grid<?php echo $_htmlId ?>').hide();
120
+ $('empty<?php echo $_htmlId ?>').show();
121
+ }
122
+ }
123
+
124
+ // bind add action to "Add" button in last row
125
+ Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
126
+
127
+ // add existing rows
128
+ <?php
129
+ $_addAfterId = "headings{$_htmlId}";
130
+ foreach ($this->getArrayRows() as $_rowId => $_row) { //getting the standard values for the table rates
131
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
132
+ $_addAfterId = $_rowId;
133
+ }
134
+ ?>
135
+
136
+ // initialize standalone button
137
+ $('empty<?php echo $_htmlId ?>').hide();
138
+ Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
139
+ $('grid<?php echo $_htmlId ?>').show();
140
+ $('empty<?php echo $_htmlId ?>').hide();
141
+ arrayRow<?php echo $_htmlId ?>.add('', '');
142
+ });
143
+
144
+ // if no rows, hide grid and show button only
145
+ <?php if (!$this->getArrayRows()):?>
146
+ arrayRow<?php echo $_htmlId ?>.showButtonOnly();
147
+ <?php endif;?>
148
+
149
+ // toggle the grid, if element is disabled (depending on scope)
150
+ <?php if ($this->getElement()->getDisabled()):?>
151
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
152
+ <?php endif;?>
153
+ //]]>
154
+ </script>
app/design/adminhtml/default/default/template/vconnect/aio/prices.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_element = $this->getElement();
3
+ /* @var $_element Varien_Data_Form_Element_Multiselect */
4
+
5
+ $_htmlId = $this->getElement()->getHtmlId();
6
+ $_htmlClass = $this->getElement()->getClass();
7
+ $_htmlName = $this->getElement()->getName();
8
+ $_readonly = $this->getElement()->getReadonly();
9
+ $_value = $this->getElement()->getValue();
10
+
11
+ ?>
12
+ <style>
13
+ .cst_input{
14
+ width: 30px;
15
+ text-align: center;
16
+ }
17
+ .cst_input.color{
18
+ width: 60px;
19
+ }
20
+ #<?php echo $_htmlId ?> th{
21
+ text-align: center;
22
+ }
23
+ </style>
24
+ <table id="<?php echo $_htmlId ?>" class="<?php echo $_htmlClass ?>">
25
+ <thead>
26
+ <tr>
27
+ <th><?php echo $this->__('Status') ?></th>
28
+ <th><?php echo $this->__('Color') ?></th>
29
+ <th><?php echo $this->__('1 hr') ?></th>
30
+ <th><?php echo $this->__('2 hr') ?></th>
31
+ <th><?php echo $this->__('4 hr') ?></th>
32
+ <th><?php echo $this->__('8 hr') ?></th>
33
+ </tr>
34
+ </thead>
35
+ <tbody>
36
+ <tr>
37
+ <td><label><?php echo $this->__('Green') ?></label></td>
38
+ <td><input class="color cst_input" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[0])?$_value[0]:'' ?>"></td>
39
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[1])?$_value[1]:'' ?>"></td>
40
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[2])?$_value[2]:'' ?>"></td>
41
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[3])?$_value[3]:'' ?>"></td>
42
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[4])?$_value[4]:'' ?>"></td>
43
+ </tr>
44
+ <tr>
45
+ <td><label><?php echo $this->__('Yellow') ?></label></td>
46
+ <td><input class="color cst_input" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[5])?$_value[5]:'' ?>"></td>
47
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[6])?$_value[6]:'' ?>"></td>
48
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[7])?$_value[7]:'' ?>"></td>
49
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[8])?$_value[8]:'' ?>"></td>
50
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[9])?$_value[9]:'' ?>"></td>
51
+ </tr>
52
+ <tr>
53
+ <td><label><?php echo $this->__('Red') ?></label></td>
54
+ <td><input class="color cst_input" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[10])?$_value[10]:'' ?>"></td>
55
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[11])?$_value[11]:'' ?>"></td>
56
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[12])?$_value[12]:'' ?>"></td>
57
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[13])?$_value[13]:'' ?>"></td>
58
+ <td><input class="cst_input <?php echo $_htmlClass?>" name="<?php echo $_htmlName ?>" <?php echo $_readonly?'disabled="disabled"':'' ?> value="<?php echo isset($_value[14])?$_value[14]:'' ?>"></td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
62
+
63
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/base.phtml ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @template app/design/frontend/base/default/template/vconnect/aio/base.phtml
30
+ */
31
+
32
+ /* @var $this Vconnect_AllInOne_Block_Shipping_Dialog */
33
+ ?>
34
+
35
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-1.11.3.js') ?>"></script>
36
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-ui.js') ?>"></script>
37
+ <script type="text/javascript">
38
+ jQuery.noConflict();
39
+ </script>
40
+
41
+ <?php
42
+ $rates = $this->getRates();
43
+ /* @var $rates Mage_Sales_Model_Resource_Quote_Address_Rate_Collection */
44
+ ?>
45
+ <input class="aio-hidden" id="payment_ain_vconnect_postnord_data" name="payment_ain_vconnect_postnord_data" value='' style="display: none;">
46
+
47
+ <?php
48
+ $vconnect_postnord_data = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getVconnectPostnordData();
49
+ if (!empty($vconnect_postnord_data)) {
50
+ $vconnect_postnord_data = json_decode($vconnect_postnord_data);
51
+ }
52
+ ?>
53
+
54
+ <?php echo $this->getChildHtml('tab_headers') ?>
55
+ <script type="text/javascript">
56
+ (function(d, id){
57
+ if (d.getElementById(id)) {
58
+ return;
59
+ }
60
+ var css = d.createElement('link');
61
+ css.id = id;
62
+ css.type ='text/css';
63
+ css.href = "https://fonts.googleapis.com/css?family=Roboto:400,700,800";
64
+ css.rel = "stylesheet";
65
+ d.head.appendChild(css);
66
+
67
+ var css1 = d.createElement('link');
68
+ css1.type = 'text/css';
69
+ // css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/{$this->getColor()}.css") ?>";
70
+ css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/blue.css") ?>";
71
+ css1.rel = "stylesheet";
72
+ d.head.appendChild(css1);
73
+ }(document, 'vconnect_postnord_scripts'));
74
+ </script>
75
+ <?php echo $this->getChildHtml('body_scripts') ?>
76
+
77
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
78
+ <div id="environmental_fee" style="display: none;">
79
+ <label class="aino-custom-input cf">
80
+ <span class="aino-custom-input-text">
81
+ <?php echo $this->__('Environmental fee'); ?>
82
+ <div class="aino-delivery-price"><span class="price"><?php echo Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)10, true, true); ?></span></div>
83
+ </span>
84
+ <input type="checkbox" name="vconnect_postnord_environmental_fee" value="1" <?php if(!empty($vconnect_postnord_data->environmental_fee)) { ?> checked="checked" <?php } ?> />
85
+ <span class="aino-custom-checkbox-indicator"></span>
86
+ </label>
87
+ </div>
88
+ <?php endif; ?>
89
+
90
+ <script type="text/javascript">
91
+ jQuery(function($){
92
+ if ($('#environmental_fee').length != 0 && $('#order-shipping-method-choose').length != 0) {
93
+ $('#environmental_fee').insertBefore( "#aio_shipping_save" );
94
+ }
95
+
96
+ $('input[name="order[shipping_method]"]').each(function(){
97
+ var self = $(this);
98
+ if(self.is(':checked') && self.val().indexOf('vconnect_postnord_') != -1){
99
+ $('.aio-options[data-code='+self.val()+']').addClass('active');
100
+ if ($('#environmental_fee').length != 0) {
101
+ $('#environmental_fee').show();
102
+ }
103
+ }
104
+ });
105
+ $('select[name*="_delivery"]').each(function(){
106
+ console.log(this);
107
+ var self = $(this);
108
+ var txtArea = $('textarea.other-txt',self.parent());
109
+ if(self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
110
+ txtArea.show();
111
+ }else{
112
+ txtArea.hide();
113
+ }
114
+ });
115
+
116
+
117
+ $('input[name="order[shipping_method]"]').on('change',function(){
118
+ if ($('#environmental_fee').length != 0) {
119
+ $('#environmental_fee').hide();
120
+ }
121
+
122
+ $('.aio-options').removeClass('active');
123
+ var self = $(this);
124
+ if(self.val().indexOf('vconnect_postnord_') != -1){
125
+ $('.aio-options[data-code='+self.val()+']').addClass('active');
126
+
127
+ if ($('#environmental_fee').length != 0) {
128
+ $('#environmental_fee').show();
129
+ }
130
+ }
131
+ if(self.val().indexOf('_pickup') != -1){
132
+ $('.aio-hidden').show();
133
+ }else{
134
+ $('.aio-hidden').hide();
135
+ }
136
+
137
+ if ($('.aio-options[data-code='+self.val()+'] select[name*="_arrival"]').length) {
138
+ $('.aio-options[data-code='+self.val()+'] select[name*="_arrival"]').trigger('change');
139
+ }
140
+
141
+ });
142
+
143
+ $('select[name*="_delivery"]').on('change',function(){
144
+ var self = $(this);
145
+ var txtArea = self.parent().find('textarea');
146
+ if(self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
147
+ txtArea.show();
148
+ }else{
149
+ txtArea.hide();
150
+ }
151
+ });
152
+
153
+ <?php
154
+ if ($rates) {
155
+ foreach ($rates as $rate) {
156
+ if (empty($rate['code']) || empty($rate['vc_method_data'])) {
157
+ continue;
158
+ }
159
+
160
+ $method_code = $rate['code'];
161
+ $method_data = json_decode($rate['vc_method_data']);
162
+
163
+ if ($method_data && $method_data->delivery_time) {
164
+ ?>
165
+ $('input[name="order[shipping_method]"]').each(function(){
166
+ if($(this).val() == '<?php echo $method_code; ?>'){
167
+ $(this).parent().find('span.price').before('<span class="transit_time"> <?php echo $method_data->delivery_time; ?> </span>');
168
+ }
169
+ });
170
+ <?php
171
+ }
172
+ }
173
+ }
174
+ ?>
175
+
176
+ // postcode reload - fix for Magestore_Onestepcheckoud
177
+ if ($('#one-step-checkout-form').length > 0 && typeof save_address_information !== 'undefined' && typeof save_address_url !== 'undefined' && typeof update_address_shipping !== 'undefined' && typeof update_address_payment !== 'undefined' && typeof update_address_review !== 'undefined') {
178
+ $('[name="billing[postcode]"],[name="shipping[postcode]"]').change(function () {
179
+ save_address_information(save_address_url, update_address_shipping, update_address_payment, update_address_review);
180
+ });
181
+ }
182
+ });
183
+ </script>
184
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/commercial/tabHeader.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/commercial/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
33
+ <?php if(!empty($config['delivery_time'])): ?>
34
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time commercial:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
35
+ <?php endif;?>
36
+
37
+ <?php if (count($config['arrival'])): ?>
38
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival commercial:') ?></label>
39
+ <select id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
40
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
41
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
42
+ <?php endforeach; ?>
43
+ </select>
44
+ <?php endif; ?>
45
+ <?php if (count($config['delivery'])): ?>
46
+ <br />
47
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Label delivery commercial:') ?></label>
48
+ <select id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
49
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
50
+ <?php if (is_array($label)): ?>
51
+ <optgroup label="<?php echo $value?>">
52
+ <?php foreach ($label as $j=>$k): ?>
53
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
54
+ <?php endforeach; ?>
55
+ </optgroup>
56
+ <?php else: ?>
57
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
58
+ <?php endif; ?>
59
+
60
+ <?php endforeach; ?>
61
+ </select>
62
+ <br/>
63
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
64
+ <?php endif; ?>
65
+ </div>
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/commercial/tabScripts.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ jQuery(function($){
35
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
36
+ });
37
+
38
+ </script>
39
+
40
+
41
+
42
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/mailbox/tabHeader.phtml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ $addditional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
32
+ ?>
33
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
34
+ <?php if (count($config['arrival'])): ?>
35
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival mailbox:') ?></label>
36
+ <select id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
37
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
38
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
39
+ <?php endforeach; ?>
40
+ <?php if ($addditional_fee): ?>
41
+ <option value="<?php echo $addditional_fee['label_with_price'] ?>"><?php echo $addditional_fee['label_with_price'] ?></option>
42
+ <?php endif; ?>
43
+ </select>
44
+ <?php endif; ?>
45
+ <?php if (count($config['delivery'])): ?>
46
+ <br />
47
+ <label for="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>><?php echo $this->__('Label delivery mailbox:') ?></label>
48
+ <select id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>>
49
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
50
+ <?php if (is_array($label)): ?>
51
+ <optgroup label="<?php echo $value?>">
52
+ <?php foreach ($label as $j=>$k): ?>
53
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
54
+ <?php endforeach; ?>
55
+ </optgroup>
56
+ <?php else: ?>
57
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
58
+ <?php endif; ?>
59
+
60
+ <?php endforeach; ?>
61
+ </select>
62
+ <br/>
63
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
64
+ <?php endif; ?>
65
+ <?php if (count($config['delivery'])): ?>
66
+ <div class="nearest_point_container" style="display: none">
67
+ <span class="vc-label"><?php echo $this->__('Delivery types'); ?></span>
68
+ <span class="vc-value"></span>
69
+ </div>
70
+ <?php endif; ?>
71
+ </div>
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/mailbox/tabScripts.phtml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
35
+
36
+ jQuery(function($){
37
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
38
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
39
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
40
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
41
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
42
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
43
+
44
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
45
+ shipContryVal = '';
46
+ shipPostcodeVal = '';
47
+ shipStreetVal = '';
48
+ }
49
+
50
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
51
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
52
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
53
+
54
+ var html_nearest_point = '';
55
+
56
+ if ($('.nearest_point_container').length > 0) {
57
+ getPickupPoints(country_id,postcode,street,function (points) {
58
+ var nearest_point_monFriOpen = (typeof points[0].openingHours !== 'undefined')
59
+ ?points[0].openingHours[0].from1.insertString(2, 0, ":"):'';
60
+ var nearest_point_monFriClose = (typeof points[0].openingHours !== 'undefined')
61
+ ?points[0].openingHours[0].to1.insertString(2, 0, ":"):'';
62
+ var nearest_point_satOpen = (typeof points[0].openingHours !== 'undefined')
63
+ ?points[0].openingHours[points[0].openingHours.length-1].from1.insertString(2, 0, ":"):'';
64
+ var nearest_point_satClose = (typeof points[0].openingHours !== 'undefined')
65
+ ?points[0].openingHours[points[0].openingHours.length-1].to1.insertString(2, 0, ":"):'';
66
+
67
+ html_nearest_point = '<div class="aino-nearest-data">';
68
+ html_nearest_point += '<div class="aino-nearest-name">' +points[0].name + '</div>';
69
+ html_nearest_point += '<div class="aino-nearest-address">' + points[0].deliveryAddress.streetName + ', ' + points[0].deliveryAddress.streetNumber + '</div>';
70
+ html_nearest_point += '<div class="aino-work-hours">' +
71
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+nearest_point_monFriOpen +' - '+ nearest_point_monFriClose +'<br/>' +
72
+ '<?php echo $this->__('Sat'); ?>: '+nearest_point_satOpen +' - '+ nearest_point_satClose +
73
+ '</div>';
74
+ html_nearest_point += '</div>';
75
+ $('.nearest_point_container').show().find('.vc-value').html(html_nearest_point);
76
+ });
77
+ }
78
+
79
+ function getPickupPoints(country_id,postcode,street,callback)
80
+ {
81
+ var dataToSend = {
82
+ country_id : country_id,
83
+ postcode : postcode
84
+ };
85
+ if(street){
86
+ dataToSend.street = street;
87
+ }
88
+ $.ajax({
89
+ url : pointsEndpoint,
90
+ data : dataToSend
91
+ }).done(function (data) {
92
+
93
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
94
+ {
95
+ if( typeof data.postnord.message !== 'undefined'){
96
+ console.error(data.postnord.message);
97
+ }
98
+ return console.log('Pickup api\'s return unknown error');
99
+ }
100
+ var points = data.postnord.servicePointInformationResponse.servicePoints;
101
+
102
+ if(callback) {
103
+ callback(points);
104
+ }
105
+ });
106
+ }
107
+
108
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
109
+ });
110
+
111
+ </script>
112
+
113
+
114
+
115
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/pickup/tabHeader.phtml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
33
+ <button class="button aio-pick-btn" type="button">
34
+ <?php echo $this->__('Pick a point') ?>
35
+ </button>
36
+ <input class="required-entry aio-hidden" name="vconnect_postnord_data" value='<?php echo $this->getShippingInfo() ?>' style="width: 1px; height: 1px; outline-width: 0px;">
37
+ <div class="postnord-description"></div>
38
+ </div>
39
+ <div class="all-in-one-container">
40
+ <div class="aio-container">
41
+ <div class="aino-container desktop">
42
+ <div class="aino-core">
43
+ <div class="aino-header cf">
44
+ <h1 class="postnord-logo">
45
+ <span><?php echo Mage::getStoreConfig('carriers/vconnect_postnord/title') ?></span>
46
+ </h1>
47
+
48
+ <div class="aino-weather cf">
49
+ <ul class="aino-nav">
50
+
51
+ </ul>
52
+ </div>
53
+ </div>
54
+ <div class="aino-tabs cf">
55
+ <ul class="aino-nav aino-deliver-to">
56
+ <li class="aino-office-tab ui-state-active" data-code="<?php echo $this->getCode() ?>" >
57
+ <a href="#post-office" class="cf pickup">
58
+ <span>
59
+ <?php echo $this->getMethodTitle() ?>
60
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
61
+ </span>
62
+ </a>
63
+
64
+
65
+ <div class="tab-list aino-post-office cf aino-column" data-target="post-office">
66
+ <div class="aino-map-container">
67
+ <div class="aino-map"></div>
68
+ <div class="zipcode-holder">
69
+ <div class="post-code-input">
70
+ <label>
71
+ <?php echo $this->__('Skift postnumber') ?>
72
+ <input type="text"/>
73
+ </label>
74
+ <button type="button"><span></span></button>
75
+ </div>
76
+ <div class="directions-display-type">
77
+ <button role="DRIVING" type="button" class="aino-map-driving"><span></span></button>
78
+ <button role="WALKING" type="button" class="aino-map-walking"><span></span></button>
79
+ <button role="TRANSIT" type="button" class="aino-map-transit"><span></span></button>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ <div class="address-near-you">
84
+ <ul class="aino-nav">
85
+
86
+ </ul>
87
+ </div>
88
+ </div>
89
+
90
+ </li>
91
+ </ul>
92
+ </div>
93
+ <div class="aino-footer">
94
+ <div>
95
+ <button type="button" class="aino-button gray" role="close" >
96
+ <?php echo $this->__('Cancel') ?>
97
+ </button>
98
+ <button type="button" class="aino-button blue" role="submit">
99
+ <?php echo $this->__('OK') ?>
100
+ </button>
101
+ </div>
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+ </div>
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/pickup/tabScripts.phtml ADDED
@@ -0,0 +1,781 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+
35
+ <script>
36
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
37
+ jQuery(function($){
38
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
39
+ });
40
+
41
+ </script>
42
+ <script type="text/javascript">
43
+ jQuery(function($){
44
+
45
+ // $('button.aio-pick-btn').appendTo($("input[value*='vconnect_postnord_']").parent());
46
+ var btn = $('button.aio-pick-btn');
47
+ var submitBtn = $('.aino-button[role=submit]');
48
+ window.aio_opened = false;
49
+ //moving the pickup button to the outside container
50
+ var inputs = $("input[value*='vconnect_postnord_']");
51
+ var cont = inputs.closest('dd');
52
+
53
+ var descriptionField = $('.postnord-description');
54
+ var hiddenInput = $('input.aio-hidden');
55
+ if(hiddenInput.val() !== '' && hiddenInput.val()){
56
+ var data = JSON.parse(hiddenInput.val());
57
+ descriptionField.text(data.description);
58
+ }
59
+
60
+ refreshControls();
61
+
62
+ $('.tab-list:first').addClass('active');
63
+ $('input[name="order[shipping_method]"]').on('change',refreshControls);
64
+ $('.all-in-one-container').hide();
65
+ if($('body > .all-in-one-container').length < 1){
66
+ console.log('popup code moved to body');
67
+ $('.all-in-one-container').appendTo('body');
68
+ }else{
69
+ console.log('popup code raplaced');
70
+ $('body > .all-in-one-container').remove();
71
+ $('.all-in-one-container').appendTo('body');
72
+ // $('body > .all-in-one-container').replaceWith($('.wrapper .all-in-one-container'));
73
+ }
74
+ //close popup
75
+ $('.aino-footer button[role=close]').on('click', closePopup);
76
+
77
+ // $('.aino-deliver-to a').first().click(); //select first element
78
+ //init popup
79
+ initMobileCollapse();
80
+ setTabs();
81
+ setJQueryTabs();
82
+
83
+ btn.on('click',openPopup);
84
+
85
+ function refreshControls() {
86
+ var div = $('div[data-code=<?php echo $this->getCode() ?>]');
87
+ var cont = $("input[value='<?php echo $this->getCode() ?>']");
88
+ console.log(cont);
89
+ if(cont.is(':checked')){
90
+ div.show();
91
+ }else{
92
+ div.hide();
93
+ }
94
+ }
95
+ function initMobileCollapse(){
96
+ var collapseBtn = $('.aino-collapse');
97
+ collapseBtn.each(function(){
98
+ $(this).unbind('click');
99
+ $(this).on('click',function(){
100
+ var self = this;
101
+ $(self).next().animate({
102
+ height: "toggle"
103
+ }, 'fast', function(){
104
+ $(self).toggleClass('active');
105
+ var sibl = $(self).parent().siblings();
106
+ sibl.each(function(){
107
+ $(this).find('.aino-collapse-content').hide();
108
+ $(this).find('.aino-collapse').removeClass('active');
109
+ });
110
+ });
111
+ });
112
+ });
113
+ };
114
+ submitBtn.on('click',submit);
115
+ function submit()
116
+ {
117
+ var el = $('.aino-deliver-to li.ui-state-active');
118
+ $('.all-in-one-container').trigger('popup.submit.before',[]);
119
+
120
+ var event = 'submit_before_' + el.attr('data-code');
121
+ $('.all-in-one-container').trigger(event,[]);
122
+ console.info("Event trigger: " + event);
123
+ var data = el.data('shipping');
124
+ if(typeof data !== 'undefined'){
125
+ data.environmental_fee = 0;
126
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
127
+ data.environmental_fee = 1;
128
+ }
129
+
130
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(data)) ;
131
+ $('input[name=vconnect_postnord_data]').val(JSON.stringify(data)) ;
132
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
133
+ $('div.postnord-description').html(data.pointinfo);
134
+ } else {
135
+ $('div.postnord-description').text(data.description);
136
+ }
137
+ $('input[value='+data.code+']').prop('checked',true).trigger('change');
138
+ }
139
+
140
+ $('.all-in-one-container').trigger('popup.submit.after',[]);
141
+
142
+
143
+ refreshControls();
144
+ closePopup();
145
+ }
146
+ function openPopup(){
147
+
148
+ console.log('openPopup');
149
+ var cont = $('.all-in-one-container');
150
+ cont.trigger({
151
+ type : 'popup.open.before'
152
+ });
153
+ // if($('body > .all-in-one-container').length !== 1){
154
+ // console.log('appending popup markup to body');
155
+ // $('.all-in-one-container').appendTo('body');
156
+ // }
157
+ if ($('.aino-cover').length === 0) {
158
+ $('<div/>').addClass('aino-cover').appendTo('body');
159
+ }
160
+ $('.aino-container').addClass('opened');
161
+ $('.all-in-one-container').show();
162
+ var popup = $('div.aio-container').addClass('opened').show();
163
+ $('.aino-container').removeClass('opened');
164
+
165
+ popup.find('.aino-container.desktop').addClass('opened').show();
166
+
167
+ $('.all-in-one-container').trigger({
168
+ type : 'popup.open.after'
169
+ });
170
+ window.aio_opened = true;
171
+ var cont = $('.all-in-one-container');
172
+ var el = $('.aino-deliver-to .ui-state-active');
173
+ var evName = 'tab_visible_' + el.attr('data-code');
174
+ cont.trigger(evName,[]);
175
+ console.info('-- trigered tab.visible for ' + evName);
176
+
177
+ }
178
+ function closePopup()
179
+ {
180
+ $('.all-in-one-container').trigger({
181
+ type : 'popup.close.before'
182
+ });
183
+ $('.aino-cover').remove();
184
+ $('.aino-container').removeClass('opened').hide();
185
+ $('.all-in-one-container').hide();
186
+ $('.all-in-one-container').trigger({
187
+ type : 'popup.close.after'
188
+ });
189
+ window.aio_opened = false;
190
+ }
191
+
192
+ function setTabs(){
193
+ var tabs = $('.aino-inner-tabs');
194
+ tabs.each(function(){
195
+ var self = $(this), target ;
196
+ var btn = $('a[role=tab]',self);
197
+ btn.each(function(){
198
+ var that = $(this);
199
+
200
+
201
+
202
+ that.unbind('click').on('click', function(){
203
+ $('.aino-deliver-to .delivery-context').removeClass('active') ;
204
+ target = that.attr('href');
205
+ target = target.substr(1);
206
+ $('.tab-list:not([data-target='+target+'])',tabs).hide();
207
+ var col2 = tabs.find('[data-target='+target+']');
208
+
209
+ if(self.find('[data-target='+target+']').css('display') === 'none'){
210
+ col2.parent().siblings('li').removeClass('active');
211
+ col2.show().addClass('active');
212
+ col2.parent().addClass('active');
213
+ that.parent('li').addClass('active');
214
+ that.parent('li').siblings().removeClass('active');
215
+ }
216
+ else{
217
+ col2.parent().siblings('ul').addClass('active');
218
+ col2.hide().removeClass('active');
219
+ col2.parent().removeClass('active');
220
+ that.parent('li').removeClass('active');
221
+ }
222
+ col2.closest('.aio-nav').siblings().hide().removeClass('active');
223
+ });
224
+ });
225
+
226
+ var close = $(this).find('.close');
227
+ close.each(function(){
228
+ $(this).on('click', function(){
229
+ setDeactive(self,target);
230
+ btn.parent('li').removeClass('active');
231
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
232
+ });
233
+ });
234
+
235
+ var closeInner = self.find('.close-inner');
236
+ closeInner.each(function(){
237
+ $(this).on('click', function(){
238
+ $(this).closest('.delivery-time').hide();
239
+ $(this).closest('.delivery-time')
240
+ .siblings('.aino-calendar-holder')
241
+ .find('.toggle-calendar').hide();
242
+ $(this).closest('.delivery-time')
243
+ .siblings('.aino-calendar-holder')
244
+ .find('.aino-calendar').removeClass('hidden');
245
+ });
246
+ });
247
+ });
248
+
249
+
250
+ }
251
+ function setActive(tabs ,ele, target){
252
+ $(tabs).find('[data-target='+target+']').parent().siblings('li').removeClass('active');
253
+ $(tabs).find('[data-target='+target+']').show().addClass('active');
254
+ $(tabs).find('[data-target='+target+']').parent().addClass('active');
255
+ $(ele).parent('li').addClass('active');
256
+ $(ele).parent('li').siblings().removeClass('active');
257
+ }
258
+
259
+ function setDeactive(tabs,target){
260
+ $(tabs).find('[data-target='+target+']').parent().siblings('ul').addClass('active');
261
+ $(tabs).find('[data-target='+target+']').hide().removeClass('active');
262
+ $(tabs).find('[data-target='+target+']').parent().removeClass('active');
263
+ }
264
+ function setJQueryTabs(){
265
+ /*
266
+ events for switching the outer tabs (buttons on the left)
267
+ set active tab, show child, and set the others tabs to unactive
268
+ */
269
+ $('.aino-deliver-to > li > a').on('click', function(){
270
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
271
+ $('.tab-list.aino-column-2').removeClass('active').hide();
272
+ $('.tab-list.aino-column').removeClass('active');
273
+ $('.aino-inner-tabs > ul li').removeClass('active');
274
+ var el = $(this).parent();
275
+ el.addClass('ui-state-active');
276
+ el.siblings().removeClass('ui-state-active');
277
+ $('.aino-deliver-to .tab-list.aino-column').hide().removeClass('active');
278
+ var activeTab = el.find('.tab-list.aino-column');
279
+
280
+ el.trigger({
281
+ type : 'tab.click',
282
+ tab : activeTab
283
+ });
284
+ activeTab.show().addClass('active');
285
+
286
+ if(aio_opened){
287
+ var cont = $('.all-in-one-container');
288
+ var evName = 'tab_visible_' + el.attr('data-code');
289
+ cont.trigger(evName,[]);
290
+ console.info('++ trigered tab.visible for ' + evName);
291
+ }
292
+
293
+ });
294
+ }
295
+
296
+
297
+
298
+ });
299
+ </script>
300
+ <?php echo $this->getChildHtml('body_scripts') ?>
301
+ <script>
302
+ jQuery(function($){
303
+
304
+ var radios = $('input[type=radio][name=delivery]');
305
+
306
+ radios.unbind('change');
307
+ radios.on('change',function(){
308
+ var closest = $(this).closest('.aino-inner-tabs');
309
+ var el = $('.aino-textarea-holder',closest);
310
+ if($(this).val() == '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || $(this).val() == 'Utan kvittens (paketet ställs utanför dörren)'){
311
+ el.show();
312
+ }else{
313
+ el.hide();
314
+ }
315
+ });
316
+
317
+ var liEls = $('.column-2 .aino-nav > li:not(.aino-sub-nav)');
318
+ liEls.unbind('click');
319
+ liEls.on('click',function(){
320
+ var self = $(this);
321
+
322
+ var tabDiv = self.closest('.tab-list.active');
323
+ var elsToUncheck = $('input',tabDiv) ;
324
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
325
+
326
+ elsToUncheck.prop('checked',false).attr('checked',false);
327
+ // self.closest('.tab-list.active input[chekced]').prop('checked',false).attr('checked',false);
328
+
329
+ // console.log($(this).find('label input').val());
330
+ self.closest('.tab-list.active.column-2').hide().find('li').removeClass('active');
331
+ // self.closest('.aino-nav').find('li').removeClass('active');
332
+ self.addClass('active');
333
+
334
+ $('input[type=radio]',self).prop('checked',true).attr('checked',true).trigger('change');
335
+ var parentTarget = self.parents('.column-2').attr('data-target');
336
+
337
+ if(self.find('.aino-nav').length != 0 ){
338
+ self.unbind('click');
339
+ }
340
+
341
+
342
+ self.closest('.aino-inner-tabs').find("[href=#"+parentTarget+"] span").html(self.find('label .label-text').html());
343
+
344
+ });
345
+ $('.aino-deliver-to > li > a').first().click();
346
+
347
+
348
+
349
+
350
+
351
+ });
352
+ </script>
353
+ <script>
354
+ jQuery(function($){
355
+ String.prototype.insertString = function(start, delCount, newSubStr) {
356
+ return this.slice(0, start) + newSubStr + this.slice(start + Math.abs(delCount));
357
+ };
358
+
359
+ var called = false,labels = [],bounds,markers = [],directionsDisplay,aio_points = [];
360
+
361
+ $('.all-in-one-container').on('tab_visible_<?php echo $this->getCode()?>',function(){
362
+
363
+ if(called){
364
+ return;
365
+ }
366
+ called = true;
367
+ bootstrap(function(){
368
+ var shipContryVal = $('select[name="order[shipping_address][country_id]"]:last').val();
369
+ var shipPostcodeVal = $('input[name="order[shipping_address][postcode]"]:last').val();
370
+ var shipStreetVal = $('input[name="order[shipping_address][street][]"]:first').val();
371
+ var billContryVal = $('select[name="order[billing_address][country_id]"]:last').val();
372
+ var billPostcodeVal = $('input[name="order[billing_address][postcode]"]:last').val();
373
+ var billStreetVal = $('input[name="order[billing_address][street][]"]:first').val();
374
+
375
+ if ($('input[name="shipping_as_billing"]').length > 0 && $('input[name="shipping_as_billing"]').is(':checked')) {
376
+ shipContryVal = '';
377
+ shipPostcodeVal = '';
378
+ shipStreetVal = '';
379
+ }
380
+
381
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
382
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
383
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
384
+
385
+ if (country_id != '' && postcode == '') {
386
+ if (country_id == 'SE') {
387
+ postcode = '10044';
388
+ } else if (country_id == 'FI') {
389
+ postcode = '00100';
390
+ } else if (country_id == 'NO') {
391
+ postcode = '0107';
392
+ } else if (country_id == 'DK') {
393
+ postcode = '1000';
394
+ }
395
+ }
396
+
397
+ var map = initMap();
398
+ window.map = map;
399
+ $('.post-code-input input').val(postcode);
400
+ $('.post-code-input button').on('click',function(){
401
+ console.log('button clicked');
402
+ getPickupPoints(country_id,$('.post-code-input input').val(),null,function(points){
403
+ setMapContent(map,points,false);
404
+ },false);
405
+ });
406
+ getPickupPoints(country_id,postcode,street,function(points){
407
+ setMapContent(map,points,true);
408
+ },true);
409
+ });
410
+
411
+
412
+
413
+ });
414
+ $('.all-in-one-container').on('tab.visible',function(target,el){
415
+ console.log('.post-office 1');
416
+ });
417
+ // $('.aino-tabs-body').on('tab.opened.post-office',function(){
418
+ //
419
+ //
420
+ // });
421
+
422
+
423
+ function initMap()
424
+ {
425
+ // Create a map object and specify the DOM element for display.
426
+ $('.aino-weather').hide();
427
+ var center = { lat:58.663585, lng:15.307749 } ;
428
+ var zoom = 5;
429
+ if(typeof current_loc !== 'undefined'){
430
+ center = current_loc;
431
+ zoom = 8;
432
+ }
433
+ window.map = new google.maps.Map($('.aino-map:last')[0], {
434
+ scrollwheel : true,
435
+ zoom : zoom,
436
+ mapTypeId : google.maps.MapTypeId.ROADMAP,
437
+ zoomControl : true,
438
+ center : center
439
+ });
440
+ google.maps.event.addListenerOnce(map, 'idle', function(){
441
+ google.maps.event.trigger(map, 'resize');
442
+ });
443
+ $(window).resize(function() {
444
+ google.maps.event.trigger(map, 'resize');
445
+ });
446
+
447
+
448
+
449
+ return map;
450
+
451
+ }
452
+ function showDirections(map, origin, destination, type){
453
+ if(directionsDisplay != null) {
454
+ directionsDisplay.setMap(null);
455
+ directionsDisplay = null;
456
+ }
457
+
458
+ directionsDisplay = new google.maps.DirectionsRenderer({
459
+ map: map,
460
+ suppressMarkers: true
461
+ });
462
+
463
+
464
+ // Set destination, origin and travel mode.
465
+ var request = {
466
+ destination: destination,
467
+ origin: origin,
468
+ travelMode: google.maps.TravelMode[type]
469
+ };
470
+
471
+
472
+ // Pass the directions request to the directions service.
473
+ var directionsService = new google.maps.DirectionsService();
474
+ directionsService.route(request, function(response, status) {
475
+ if (status == google.maps.DirectionsStatus.OK) {
476
+ // Display the route on the map.
477
+ directionsDisplay.setDirections(response);
478
+ }
479
+
480
+ google.maps.event.addListenerOnce(map, 'zoom_changed', function() {
481
+ var oldZoom = map.getZoom();
482
+
483
+ if(oldZoom > 14){
484
+ map.setZoom(oldZoom - 1);
485
+ }
486
+ else{
487
+ map.setZoom(oldZoom);
488
+ }
489
+ });
490
+ });
491
+
492
+ return directionsDisplay;
493
+ }
494
+ function getPickupPoints(country_id,postcode,street,callback,shouldGoecode)
495
+ {
496
+ console.log('getPickupPoints called');
497
+ delete window.current_loc;
498
+ if(street && shouldGoecode){
499
+ var geocoder = new google.maps.Geocoder();
500
+ geocoder.geocode({
501
+ address: street + ',' + postcode + ',' + country_id
502
+ }, function(results, status) {
503
+ if (status == google.maps.GeocoderStatus.OK) {
504
+ results.forEach(function(v){
505
+ console.log(v);
506
+ if(typeof v.partial_match === 'undefined' || !v.partial_match){
507
+ window.current_loc = v.geometry.location;
508
+ }
509
+ });
510
+ }
511
+ });
512
+ }
513
+ var dataToSend = {
514
+ country_id : country_id,
515
+ postcode : postcode
516
+ };
517
+ if(street){
518
+ dataToSend.street = street;
519
+ }
520
+ $.ajax({
521
+ url : pointsEndpoint,
522
+ data : dataToSend
523
+ }).done(function (data) {
524
+
525
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
526
+ {
527
+ if( typeof data.postnord.message !== 'undefined'){
528
+ console.error(data.postnord.message);
529
+ }
530
+ return console.log('Pickup api\'s return unknown error');
531
+ }
532
+ aio_points = data.postnord.servicePointInformationResponse.servicePoints;
533
+ if(callback) {
534
+ callback(aio_points);
535
+ }
536
+ });
537
+ }
538
+
539
+
540
+
541
+ function setMapContent(map,points,direction)
542
+ {
543
+ labels = [];
544
+
545
+
546
+ markers.forEach(function(v){
547
+ v.setMap(null);
548
+ });
549
+ markers = [];
550
+
551
+ bounds = new google.maps.LatLngBounds();
552
+ var container = $('.address-near-you .aino-nav').empty();
553
+ var x = 1;
554
+ var image = {
555
+ url: '<?php echo $this->getSkinUrl('images/vconnect/aio/temp.png') ?>',
556
+ size: new google.maps.Size(20, 40)
557
+ };
558
+ points.sort(function(a,b){
559
+ return a.routeDistance - b.routeDistance;
560
+ });
561
+ locations = [];
562
+ points.forEach(function(v,i){
563
+ var location = new google.maps.LatLng(v.coordinate.northing, v.coordinate.easting);
564
+ locations.push(location);
565
+ labels.push(makeMarkerLabel(v));
566
+ var marker = new MarkerWithLabel({
567
+ map: map,
568
+ icon: image,
569
+ zIndex: i,
570
+ labelContent: (x).toString(),
571
+ labelClass: "aino-label",
572
+ labelAnchor: new google.maps.Point(14, 46),
573
+ position: location,
574
+ labelStyle: {'display': 'block', height:'50px'}
575
+ });
576
+ markers.push(marker);
577
+ marker.addListener('click', function () {
578
+ setActiveMapComponent(map,marker,true,direction);
579
+ });
580
+ var listItem = $('<li></li>').on('click',function(){
581
+ setActiveMapComponent(map,marker,false,direction);
582
+ });
583
+ var distanceElement = $('<div class="aino-distance"><span></span></div>');
584
+ distanceElement.find('span').text((v.routeDistance/1000).toFixed(1) + ' km');
585
+
586
+ // openingHours
587
+ v_html_pickup_point = '';
588
+ v_pickup_point_monFriOpen = (typeof v.openingHours !== 'undefined')
589
+ ?v.openingHours[0].from1.insertString(2, 0, ":"):'';
590
+ v_pickup_point_monFriClose = (typeof v.openingHours !== 'undefined')
591
+ ?v.openingHours[0].to1.insertString(2, 0, ":"):'';
592
+ v_pickup_point_satOpen = (typeof v.openingHours !== 'undefined')
593
+ ?v.openingHours[v.openingHours.length-1].from1.insertString(2, 0, ":"):'';
594
+ v_pickup_point_satClose = (typeof v.openingHours !== 'undefined')
595
+ ?v.openingHours[v.openingHours.length-1].to1.insertString(2, 0, ":"):'';
596
+
597
+ if (v_pickup_point_monFriOpen || v_pickup_point_monFriClose) {
598
+ v_html_pickup_point = '<div class="aino-open-hours">' +
599
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_monFriOpen +' - '+ v_pickup_point_monFriClose +'<br/>' +'</div>';
600
+ } else if (v_pickup_point_satOpen || v_pickup_point_satClose) {
601
+ v_html_pickup_point = '<div class="aino-open-hours">' +
602
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_satOpen +' - '+ v_pickup_point_satClose +'</div>';
603
+ }
604
+
605
+ var addressItem = $('<div class="cf"></div>')
606
+
607
+ .append(distanceElement)
608
+ .append($('<div class="aino-index">' + x + '</div>'))
609
+ .append($('<div class="aino-title">' + v.name + '</div>'))
610
+ .append(
611
+ $('<div class="aino-address">' + v.deliveryAddress.streetName + ' ' + v.deliveryAddress.streetNumber + '<br />' + v.deliveryAddress.postalCode + ' ' +v.deliveryAddress.city + ' </div>')
612
+ )
613
+ .append(v_html_pickup_point)
614
+ ;
615
+
616
+
617
+
618
+
619
+ var shell = $('<div class="cf"></div>');
620
+ shell.append($('<label class="aino-input aino-checkbox"></label>')
621
+ .append($('<input type="radio" name="delivery" value="">'))
622
+ .append($('<span class="aino-indicator"></span>'))
623
+ .append(addressItem)
624
+ );
625
+ shell.appendTo(listItem.appendTo(container));
626
+
627
+
628
+
629
+
630
+ bounds.extend(location);
631
+ x++;
632
+ });
633
+
634
+ map.fitBounds(bounds);
635
+ }
636
+
637
+ function setActiveMapComponent(map, marker, scroll,direction){
638
+ var iwIndex = parseInt(marker.get('labelContent')) - 1;
639
+ var selectedPoint = aio_points[iwIndex];
640
+
641
+ pickup_point_monFriOpen = (typeof selectedPoint.openingHours !== 'undefined')
642
+ ?selectedPoint.openingHours[0].from1.insertString(2, 0, ":"):'';
643
+ pickup_point_monFriClose = (typeof selectedPoint.openingHours !== 'undefined')
644
+ ?selectedPoint.openingHours[0].to1.insertString(2, 0, ":"):'';
645
+ pickup_point_satOpen = (typeof selectedPoint.openingHours !== 'undefined')
646
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].from1.insertString(2, 0, ":"):'';
647
+ pickup_point_satClose = (typeof selectedPoint.openingHours !== 'undefined')
648
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].to1.insertString(2, 0, ":"):'';
649
+
650
+ html_pickup_point = '';
651
+
652
+ <?php if(!empty($config['delivery_time'])): ?>
653
+ html_pickup_point += '<b><?php echo $this->__("Label arrival time pickup:") ?></b><br /><?php echo $config['delivery_time']; ?> <br /><b><?php echo $this->__("Label delivery pickup:") ?></b><br/>';
654
+ <?php endif;?>
655
+
656
+ html_pickup_point += '<div class="aino-pickup-name">' +selectedPoint.name + '</div>';
657
+ html_pickup_point += '<div class="aino-pickup-address">' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + '</div>';
658
+ html_pickup_point += '<div class="aino-work-hours">' +
659
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+pickup_point_monFriOpen +' - '+ pickup_point_monFriClose +'<br/>' +
660
+ '<?php echo $this->__('Sat'); ?>: '+pickup_point_satOpen +' - '+ pickup_point_satClose +
661
+ '</div>';
662
+
663
+ var data = {
664
+ code : $('.aino-office-tab').attr('data-code'),
665
+ data : selectedPoint,
666
+ carrier : '<?php echo $this->getCarrierTitle()?>',
667
+ description : selectedPoint.name + ' - ' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + ' - ' + selectedPoint.deliveryAddress.postalCode + ' - ID:' + selectedPoint.servicePointId,
668
+ pointinfo : html_pickup_point,
669
+ };
670
+ $('.aino-office-tab').data('shipping',data);
671
+ var addresses = $('.address-near-you li');
672
+ markers.forEach(function(v,i){
673
+ v.set('zIndex',i );
674
+ v.set('labelClass', "aino-label");
675
+ });
676
+ marker.set('zIndex', markers.length +1 );
677
+ marker.set('labelClass', "aino-label active");
678
+
679
+ labels.forEach(function(v){
680
+ v.close();
681
+ });
682
+
683
+
684
+ labels[iwIndex].open(map, marker);
685
+
686
+
687
+
688
+ $(addresses[iwIndex]).siblings('li').removeClass('active');
689
+ $(addresses[iwIndex]).addClass('active');
690
+ if(scroll){
691
+ var scrollEl = addresses.parent().parent();
692
+ var scrollAmount = $(addresses[iwIndex]).offset().top - scrollEl.offset().top + scrollEl.scrollTop();
693
+ scrollEl.animate({
694
+ scrollTop: scrollAmount
695
+ },200);
696
+ }
697
+
698
+ if( typeof current_loc !== 'undefined' && direction ){
699
+ showDirections(map,current_loc,marker.get('position'),'DRIVING');
700
+ $('.aino-map-container .directions-display-type > button').each(function(){
701
+ $(this).unbind('click').on('click', function(){
702
+ var type = $(this).attr('role');
703
+ showDirections(map,current_loc,marker.get('position'), type);
704
+ });
705
+ });
706
+ }else{
707
+ map.fitBounds(bounds);
708
+ }
709
+ }
710
+
711
+ function makeMarkerLabel(item){
712
+
713
+ var monFriOpen = (typeof item.openingHours !== 'undefined')
714
+ ?item.openingHours[0].from1.insertString(2, 0, ":"):'';
715
+ var monFriClose = (typeof item.openingHours !== 'undefined')
716
+ ?item.openingHours[0].to1.insertString(2, 0, ":"):'';
717
+ var satOpen = (typeof item.openingHours !== 'undefined')
718
+ ?item.openingHours[item.openingHours.length-1].from1.insertString(2, 0, ":"):'';
719
+ var satClose = (typeof item.openingHours !== 'undefined')
720
+ ?item.openingHours[item.openingHours.length-1].to1.insertString(2, 0, ":"):'';
721
+
722
+ var shippingMethodLogo = '<?php echo $this->getSkinUrl('images/vconnect/aio/aino-postnord-logo.png'); ?>';
723
+
724
+ return new google.maps.InfoWindow({
725
+ content:
726
+ '<div class="aino-info-window">' +
727
+ '<div>' +
728
+ '<span><?php echo $this->__('Opening hours'); ?></span>' +
729
+ '<img src="'+shippingMethodLogo+'" alt="">' +
730
+ '</div>' +
731
+ '<div class="aino-work-hours">' +
732
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+monFriOpen +' - '+ monFriClose +'<br/>' +
733
+ '<?php echo $this->__('Sat'); ?>: '+satOpen +' - '+ satClose +
734
+ '</div>' +
735
+ '</div>'
736
+ });
737
+
738
+ }
739
+
740
+ function bootstrap(callback) {
741
+ var script6 = document.createElement('script');
742
+ script6.type = 'text/javascript';
743
+ script6.src = "<?php echo $this->getSkinUrl('js/vconnect/aio/markerwithlabel.js') ?>";
744
+
745
+ if (typeof google === 'object' && typeof google.maps === 'object') {
746
+ console.info('google maps is already here');
747
+
748
+ document.head.appendChild(script6);
749
+ } else {
750
+ <?php
751
+ $key = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/google_maps_api_key');
752
+ if($key){
753
+ $key = ('&key=' . $key);
754
+ }
755
+ ?>
756
+ var script5 = document.createElement('script');
757
+ script5.type = 'text/javascript';
758
+ script5.src = "//maps.googleapis.com/maps/api/js?libraries=geometry<?php echo $key; ?>" ;
759
+
760
+ document.head.appendChild(script5);
761
+
762
+ script5.onload = function(){
763
+ document.head.appendChild(script6);
764
+ }
765
+ }
766
+
767
+ if(callback){
768
+ script6.onload = callback;
769
+ }
770
+ }
771
+
772
+
773
+
774
+
775
+ });
776
+
777
+
778
+ </script>
779
+
780
+
781
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/private/tabHeader.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+
31
+
32
+ $config = $this->getConfig();
33
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
34
+ ?>
35
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
36
+ <?php if(!empty($config['delivery_time'])): ?>
37
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time private:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
38
+ <?php endif;?>
39
+
40
+ <?php if (count($config['arrival'])): ?>
41
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival private:') ?></label>
42
+ <select id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
43
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
44
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
45
+ <?php endforeach; ?>
46
+ <?php if ($additional_fee): ?>
47
+ <option style="display: none;" id="<?php echo $this->getCode() ?>_additional_fee_element" value="<?php echo $additional_fee['label_with_price'] ?>"><?php echo $additional_fee['label_with_price'] ?></option>
48
+ <?php endif; ?>
49
+ </select>
50
+ <?php endif; ?>
51
+ <?php if (count($config['delivery'])): ?>
52
+ <br />
53
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Delivery type') ?></label>
54
+ <select id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
55
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
56
+ <?php if (is_array($label)): ?>
57
+ <optgroup label="<?php echo $value?>">
58
+ <?php foreach ($label as $j=>$k): ?>
59
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
60
+ <?php endforeach; ?>
61
+ </optgroup>
62
+ <?php else: ?>
63
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
64
+ <?php endif; ?>
65
+
66
+ <?php endforeach; ?>
67
+ </select>
68
+ <br/>
69
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
70
+ <?php endif; ?>
71
+
72
+ </div>
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
app/design/adminhtml/default/default/template/vconnect/aio_base_createorder/private/tabScripts.phtml ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+
32
+ $config = $this->getConfig();
33
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
34
+ ?>
35
+
36
+ <?php if ($additional_fee): ?>
37
+ <script>
38
+ window.transitInformation = "<?php echo $this->getUrl('aio/index/transitInformation', array('_secure' => true))?>";
39
+ </script>
40
+ <?php endif; ?>
41
+
42
+ <script>
43
+ jQuery(function($){
44
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
45
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
46
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
47
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
48
+
49
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
50
+ shipContryVal = '';
51
+ shipPostcodeVal = '';
52
+ }
53
+
54
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
55
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
56
+
57
+ <?php if ($additional_fee): ?>
58
+ if (country_id && postcode && $('select[name="<?php echo $this->getCode()?>_arrival"]').length != 0) {
59
+ getTransitInformation(country_id, postcode);
60
+ }
61
+
62
+ function getTransitInformation(country_id, postcode)
63
+ {
64
+ console.log('getTransitInformation called');
65
+
66
+ var dataToSend = {
67
+ country_id : country_id,
68
+ postcode : postcode,
69
+ service_code : 32
70
+ };
71
+
72
+ var eveningDelivery = false;
73
+
74
+ $.ajax({
75
+ url : transitInformation,
76
+ data : dataToSend
77
+ }).done(function (data) {
78
+ if (!data || !data.postnord) {
79
+ return;
80
+ }
81
+
82
+ if (data.postnord.error) {
83
+ console.log(data.postnord.message);
84
+ } else {
85
+ if(typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays !== 'undefined')
86
+ {
87
+ if (data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays == 1 && data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime == '21:00') {
88
+ eveningDelivery = true;
89
+ }
90
+ }
91
+
92
+ if (eveningDelivery) {
93
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').show();
94
+ } else {
95
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').hide();
96
+ }
97
+ }
98
+ });
99
+ }
100
+ <?php endif; ?>
101
+
102
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
103
+ });
104
+
105
+ </script>
106
+
107
+
108
+
109
+
app/design/adminhtml/default/default/template/vconnect/sales/order/create/shipping/method/form.phtml ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form */ ?>
28
+ <?php $_shippingRateGroups = $this->getShippingRates(); ?>
29
+ <?php if ($_shippingRateGroups): ?>
30
+ <div id="order-shipping-method-choose" style="display:none">
31
+ <dl class="shipment-methods">
32
+ <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
33
+ <dt><strong><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></strong></dt>
34
+ <dd>
35
+ <ul>
36
+ <?php foreach ($_rates as $_rate): ?>
37
+ <?php $_radioProperty = 'name="order[shipping_method]" type="radio"' ?>
38
+ <?php $_code=$_rate->getCode() ?>
39
+ <li>
40
+ <?php if ($_rate->getErrorMessage()): ?>
41
+ <ul class="messages">
42
+ <li class="error-msg"><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li>
43
+ </ul>
44
+ <?php else: ?>
45
+ <?php $_checked = $this->isMethodActive($_code) ? 'checked="checked"' : '' ?>
46
+ <input <?php echo $_radioProperty ?> value="<?php echo $_code ?>" id="s_method_<?php echo $_code ?>" <?php echo $_checked ?>/>
47
+ <label class="normal" for="s_method_<?php echo $_code ?>">
48
+ <?php echo $this->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
49
+ <strong>
50
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
51
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
52
+
53
+ <?php echo $_excl; ?>
54
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
55
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
56
+ <?php endif; ?>
57
+ </strong>
58
+ </label>
59
+ <?php endif ?>
60
+ </li>
61
+ <?php endforeach; ?>
62
+ </ul>
63
+ </dd>
64
+ <?php endforeach; ?>
65
+ </dl>
66
+ <div>
67
+ <button id="aio_shipping_save" name="aio_shipping_save" class="button validation-passed" type="button">
68
+ <span><span><?php echo $this->__('Save shipping data') ?></span></span>
69
+ </button>
70
+ </div>
71
+ </div>
72
+ <?php /* if ($_rate = $this->getActiveMethodRate()): ?>
73
+ <div id="order-shipping-method-info">
74
+ <strong><?php echo $this->escapeHtml($this->getCarrierName($_rate->getCarrier())) ?></strong><br/>
75
+ <?php echo $this->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
76
+ <strong>
77
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
78
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
79
+
80
+ <?php echo $_excl; ?>
81
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
82
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
83
+ <?php endif; ?>
84
+ </strong>
85
+ <!--input type="text" class="input-text" style="width:70px"/-->
86
+ <br/>
87
+ <a href="#" onclick="$('order-shipping-method-info').hide();$('order-shipping-method-choose').show();return false">
88
+ <?php echo Mage::helper('sales')->__('Click to change shipping method') ?>
89
+ </a>
90
+ </div>
91
+ <?php else: */ ?>
92
+ <script type="text/javascript">$('order-shipping-method-choose').show();</script>
93
+ <?php //endif; ?>
94
+ <?php elseif($this->getIsRateRequest()): ?>
95
+ <strong><?php echo Mage::helper('sales')->__('Sorry, no quotes are available for this order at this time.') ?></strong>
96
+ <?php else: ?>
97
+ <div id="order-shipping-method-summary">
98
+ <a href="#" onclick="order.loadShippingRates();return false">
99
+ <?php echo Mage::helper('sales')->__('Get shipping methods and rates') ?>
100
+ </a>
101
+ </div>
102
+ <?php endif; ?>
103
+ <input type="hidden" name="order[has_shipping]" value="" class="required-entry" />
104
+ <div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div>
105
+ <script type="text/javascript">
106
+ order.overlay('shipping-method-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
107
+ order.overlay('address-shipping-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
108
+ </script>
109
+
110
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-1.11.3.js') ?>"></script>
111
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-ui.js') ?>"></script>
112
+ <script type="text/javascript">
113
+ jQuery.noConflict();
114
+ </script>
115
+
116
+ <?php $deliveries = Mage::helper('vc_aio')->getFelxDeliveryByMethodCode($this->getCode()); ?>
117
+ <script type="text/javascript">
118
+ jQuery('document').ready(function($) {
119
+ if ($('input[name="order[shipping_method]"]:checked').length) {
120
+ if ($('input[name="order[shipping_method]"]:checked').val().indexOf('vconnect_postnord_') == -1 || ($('input[name="order[shipping_method]"]:checked').val().indexOf('vconnect_postnord_') != -1 && $('input[name="order[shipping_method]"]:checked').val().indexOf('pickup') == -1)) {
121
+ if ($('input[name=vconnect_postnord_data]').length != 0) {
122
+ $('input[name=vconnect_postnord_data]').removeClass('required-entry');
123
+ }
124
+ $('input[name="order[has_shipping]"]').val(1);
125
+ }
126
+ }
127
+
128
+ $('#aio_shipping_save').click(function() {
129
+ validation_passed = false;
130
+
131
+ if ($('input[name="order[shipping_method]"]:checked').length) {
132
+ validation_passed = true;
133
+ if ($('input[name="order[shipping_method]"]:checked').val().indexOf('vconnect_postnord_') != -1) {
134
+ if ($('input[name="order[shipping_method]"]:checked').val().indexOf('pickup') != -1) {
135
+ $('input[name=vconnect_postnord_data]').addClass('required-entry');
136
+ if ($('input[name=vconnect_postnord_data]').val() == '') {
137
+ validation_passed = false;
138
+ }
139
+ } else {
140
+ $('input[name=vconnect_postnord_data]').removeClass('required-entry');
141
+ }
142
+ }
143
+ }
144
+
145
+ if (validation_passed) {
146
+ $('input[name="order[has_shipping]"]').val(1);
147
+ } else {
148
+ $('input[name="order[has_shipping]"]').val('');
149
+ }
150
+
151
+ if ($('input[name="order[shipping_method]"]:checked').length != 0 && $('input[name="order[shipping_method]"]:checked').val()) {
152
+ if ($('input[name="order[shipping_method]"]:checked').val().indexOf('vconnect_postnord_') != -1) {
153
+ if ($('input[name="order[shipping_method]"]:checked').val().indexOf('pickup') == -1) {
154
+ var flexDeliveries = <?php echo json_encode($deliveries)?>;
155
+ var desc = '';
156
+ var arrival = $('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_arrival"]');
157
+ if(arrival.length){
158
+ desc += ('' + arrival.val());
159
+ }
160
+ var flexDelivery = false;
161
+ var delivery = $('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_delivery"]');
162
+ if(delivery.length){
163
+ desc += (' / ' + delivery.val());
164
+ if($.inArray(delivery,flexDeliveries)){
165
+ flexDelivery = (delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)')?$('textarea[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_other"]',closest).val():delivery.val();
166
+ }
167
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
168
+ var closest = delivery.closest('.aino-inner-tabs');
169
+ var otherText = $('textarea[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_other"]').val();
170
+ var escaped = $('<div/>').text(otherText).html();
171
+ desc += (" - " + escaped);
172
+ }
173
+ }
174
+
175
+ var obj = {
176
+ code : $('input[name="order[shipping_method]"]:checked').val(),
177
+ arrival : $('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_arrival"]').length?$('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_arrival"]').val():false,
178
+ delivery : $('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_delivery"]').length?$('select[name="'+$('input[name="order[shipping_method]"]:checked').val()+'_delivery"]').val():false,
179
+ flexdelivery : flexDelivery,
180
+ carrier : '<?php echo $this->escapeHtml(Mage::getStoreConfig('carriers/vconnect_postnord/title'))?>',
181
+ description : desc
182
+ };
183
+
184
+ obj.environmental_fee = 0;
185
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
186
+ obj.environmental_fee = 1;
187
+ }
188
+
189
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
190
+ } else if ($('input[name=payment_ain_vconnect_postnord_data]').length != 0 && $('input[name=payment_ain_vconnect_postnord_data]').val()) {
191
+ obj = JSON.parse($('input[name=payment_ain_vconnect_postnord_data]').val());
192
+
193
+ obj.environmental_fee = 0;
194
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
195
+ obj.environmental_fee = 1;
196
+ }
197
+
198
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
199
+ }
200
+ }
201
+
202
+ order.setShippingMethod($('input[name="order[shipping_method]"]:checked').val());
203
+ }
204
+ });
205
+ });
206
+
207
+ AdminOrder.addMethods({
208
+ setShippingMethod: function(method) {
209
+ var data = {};
210
+ data['order[shipping_method]'] = method;
211
+ data['payment_ain_vconnect_postnord_data'] = $('payment_ain_vconnect_postnord_data').getValue();
212
+
213
+ this.loadArea(['totals', 'billing_method'], true, data);
214
+ }
215
+ });
216
+ </script>
app/design/frontend/base/default/layout/vconnect/aio.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <checkout_cart_index>
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_js</type><name>js/vconnect/aio/simulate.js</name></action>
6
+ </reference>
7
+ </checkout_cart_index>
8
+ </layout>
app/design/frontend/base/default/template/vconnect/aio/base.phtml ADDED
@@ -0,0 +1,595 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @template app/design/frontend/base/default/template/vconnect/aio/base.phtml
30
+ */
31
+
32
+ /* @var $this Vconnect_AllInOne_Block_Shipping_Dialog */
33
+ ?>
34
+
35
+ <!--[if IE 8]>
36
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl("css/vconnect/aio/blue_ie8.css") ?>" media="all" />
37
+ <![endif]-->
38
+
39
+ <?php
40
+ $rates = $this->getRates();
41
+ /* @var $rates Mage_Sales_Model_Resource_Quote_Address_Rate_Collection */
42
+ ?>
43
+ <input class="required-entry aio-hidden" name="vconnect_postnord_data" value='<?php echo $this->getShippingInfo() ?>' style="width: 1px; height: 1px;">
44
+ <input class="aio-hidden" name="payment_ain_vconnect_postnord_data" value='' style="display: none;">
45
+
46
+ <div class="all-in-one-container">
47
+ <div class="aio-container">
48
+ <div class="aino-container desktop">
49
+ <div class="aino-core">
50
+ <div class="aino-header cf">
51
+ <h1 class="postnord-logo">
52
+ <span><?php echo Mage::getStoreConfig('carriers/vconnect_postnord/title') ?></span>
53
+ </h1>
54
+
55
+ <div class="aino-weather cf">
56
+ <ul class="aino-nav">
57
+
58
+ </ul>
59
+ </div>
60
+ </div>
61
+ <div class="aino-tabs cf">
62
+ <ul class="aino-nav aino-deliver-to">
63
+ <?php echo $this->getChildHtml('tab_headers') ?>
64
+ </ul>
65
+ </div>
66
+ <div class="aino-footer">
67
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
68
+ <div>
69
+ <label class="aino-custom-input cf">
70
+ <span class="aino-custom-input-text">
71
+ <?php echo $this->__('Environmental fee'); ?>
72
+ <span class="aino-env-free-help">
73
+ <span class="aino-env-free-help-icon">?</span>
74
+ <span class="aino-env-fee-info-popup">
75
+ <span><?php echo $this->__("Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com");?></span>
76
+ </span>
77
+ </span>
78
+ <span class="aino-delivery-price"><span class="price">+<?php echo Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)10, true, true); ?></span></span>
79
+ <i><?php echo $this->__('By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.'); ?></i>
80
+
81
+ </span>
82
+ <input type="checkbox" name="vconnect_postnord_environmental_fee" value="1" />
83
+ <span class="aino-custom-checkbox-indicator"></span>
84
+ </label>
85
+ </div>
86
+ <?php endif; ?>
87
+
88
+ <div>
89
+ <button type="button" class="aino-button gray" role="close" >
90
+ <?php echo $this->__('Cancel') ?>
91
+ </button>
92
+ <button type="button" class="aino-button blue" role="submit">
93
+ <?php echo $this->__('OK') ?>
94
+ </button>
95
+ </div>
96
+ </div>
97
+ </div>
98
+
99
+ </div>
100
+ </div>
101
+ </div>
102
+
103
+ <div class="postnord-description" style="display: none;"></div>
104
+ <button type="button" class="aio-pick-btn">
105
+ <?php echo Mage::getStoreConfig('carriers/vconnect_postnord/button_label') ?>
106
+ </button>
107
+
108
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-1.11.3.js') ?>"></script>
109
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-ui.js') ?>"></script>
110
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/simulate.js') ?>"></script>
111
+ <script type="text/javascript">
112
+ jQuery.noConflict();
113
+ </script>
114
+
115
+ <script type="text/javascript">
116
+ (function(d, id){
117
+ if (d.getElementById(id)) {
118
+ return;
119
+ }
120
+ if (d.head === undefined && document.getElementsByTagName('head').length > 0) {
121
+ head_element = document.getElementsByTagName('head')[0];
122
+ } else {
123
+ head_element = d.head;
124
+ }
125
+ var css = d.createElement('link');
126
+ css.id = id;
127
+ css.type ='text/css';
128
+ css.href = "https://fonts.googleapis.com/css?family=Roboto:400,700,800";
129
+ css.rel = "stylesheet";
130
+ head_element.appendChild(css);
131
+
132
+ var css1 = d.createElement('link');
133
+ css1.type = 'text/css';
134
+ // css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/{$this->getColor()}.css") ?>";
135
+ css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/blue.css") ?>";
136
+ css1.rel = "stylesheet";
137
+ head_element.appendChild(css1);
138
+ }(document, 'vconnect_postnord_scripts' ));
139
+
140
+ if (typeof console === "undefined" || typeof console.log === "undefined") {
141
+ console = {};
142
+ console.log = function() {};
143
+ console.info = function() {};
144
+ }
145
+
146
+ function InitAioBaseScripts() {
147
+ var $ = jQuery;
148
+
149
+ <?php if ($this->getChildHtml('body_scripts') == '') { ?>
150
+ // Start fixer for Onestepcheckout
151
+ if ($('#onestepcheckout-form').length > 0) {
152
+ // reload shipping methods section - fixer for IWD_OPC
153
+ get_save_billing_function('<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>', '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>', true, true)();
154
+ }
155
+ // End fixer for Onestepcheckout
156
+ <?php } ?>
157
+
158
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
159
+ var aio_shipping_method_name = 'estimate_method';
160
+ <?php else: ?>
161
+ var aio_shipping_method_name = 'shipping_method';
162
+ <?php endif; ?>
163
+
164
+ // $('button.aio-pick-btn').appendTo($("input[value*='vconnect_postnord_']").parent());
165
+ var btn = $('button.aio-pick-btn');
166
+ var submitBtn = $('.aino-button[role=submit]');
167
+ window.aio_opened = false;
168
+ //moving the pickup button to the outside container
169
+ var inputs = $("input[value*='vconnect_postnord_']:not(.aio-hidden)");
170
+ var cont = inputs.closest('dd');
171
+ cont.append(btn);
172
+ var descriptionField = $('.postnord-description');
173
+ $('.aio-pick-btn').before($('.postnord-description'));
174
+ var hiddenInput = $('input.aio-hidden');
175
+ cont.append(hiddenInput);
176
+ if(hiddenInput.val() !== '' && hiddenInput.val()){
177
+ var data = JSON.parse(hiddenInput.val());
178
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
179
+ $('div.postnord-description').html(data.pointinfo);
180
+ } else {
181
+ $('div.postnord-description').text(data.description);
182
+ }
183
+ }
184
+
185
+ refreshControls();
186
+
187
+ $('.tab-list:first').addClass('active');
188
+ $('input[name=' + aio_shipping_method_name + ']').on('change',refreshControls);
189
+ $('.all-in-one-container').hide();
190
+ if($('body > .all-in-one-container').length < 1){
191
+ console.log('popup code moved to body');
192
+ $('.all-in-one-container').appendTo('body');
193
+ }else{
194
+ console.log('popup code raplaced');
195
+ $('body > .all-in-one-container').remove();
196
+ $('.all-in-one-container').appendTo('body');
197
+ // $('body > .all-in-one-container').replaceWith($('.wrapper .all-in-one-container'));
198
+ }
199
+ //close popup
200
+ $('.aino-footer button[role=close]').on('click', closePopup);
201
+
202
+ // $('.aino-deliver-to a').first().click(); //select first element
203
+ //init popup
204
+ initMobileCollapse();
205
+ setTabs();
206
+ setJQueryTabs();
207
+
208
+ var weather_shipContryVal = $('select[name="shipping[country_id]"]:last').val();
209
+ var weather_shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
210
+ var weather_billContryVal = $('select[name="billing[country_id]"]:last').val();
211
+ var weather_billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
212
+
213
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
214
+ weather_shipContryVal = '';
215
+ weather_shipPostcodeVal = '';
216
+ }
217
+
218
+ var weather_country_id = (weather_shipContryVal !== '')?weather_shipContryVal:weather_billContryVal;
219
+ var weather_postcode = (weather_shipPostcodeVal !== '')?weather_shipPostcodeVal:weather_billPostcodeVal;
220
+
221
+ <?php if($this->isWeatherOn()):?>
222
+ weatherInit(
223
+ weather_country_id,
224
+ weather_postcode,
225
+ '<?php echo $this->getWatherApiKey()?>'
226
+ );
227
+ <?php endif;?>
228
+ btn.on('click',openPopup);
229
+
230
+ function refreshControls() {
231
+ var inputs = $("input[value*='vconnect_postnord_']:not(.aio-hidden)");
232
+ $('div.postnord-description').show();
233
+ var unseleted = inputs.not(":checked");
234
+ unseleted.parent().hide();
235
+ var selected = inputs.filter(":checked");
236
+ if(selected.length === 0){
237
+ $('input.aio-hidden').val('').hide();
238
+ $('div.postnord-description').hide();
239
+ }else{
240
+ $('input.aio-hidden').show();
241
+ }
242
+ selected.parent().show();
243
+ }
244
+ function initMobileCollapse(){
245
+ var collapseBtn = $('.aino-collapse');
246
+ collapseBtn.each(function(){
247
+ $(this).unbind('click');
248
+ $(this).on('click',function(){
249
+ var self = this;
250
+ $(self).next().animate({
251
+ height: "toggle"
252
+ }, 'fast', function(){
253
+ $(self).toggleClass('active');
254
+ var sibl = $(self).parent().siblings();
255
+ sibl.each(function(){
256
+ $(this).find('.aino-collapse-content').hide();
257
+ $(this).find('.aino-collapse').removeClass('active');
258
+ });
259
+ });
260
+ });
261
+ });
262
+ };
263
+ submitBtn.on('click',submit);
264
+ function submit()
265
+ {
266
+ var el = $('.aino-deliver-to li.ui-state-active');
267
+ $('.all-in-one-container').trigger('popup.submit.before',[]);
268
+
269
+ var event = 'submit_before_' + el.attr('data-code');
270
+ $('.all-in-one-container').trigger(event,[]);
271
+ console.info("Event trigger: " + event);
272
+
273
+ var data = el.data('shipping');
274
+
275
+ if(typeof data !== 'undefined'){
276
+ data.environmental_fee = 0;
277
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
278
+ data.environmental_fee = 1;
279
+ }
280
+ $('input[name=vconnect_postnord_data]').val(JSON.stringify(data)) ;
281
+
282
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
283
+ $('div.postnord-description').html(data.pointinfo);
284
+ } else {
285
+ $('div.postnord-description').text(data.description);
286
+ }
287
+
288
+ // Start fixer for IWD_OPC
289
+ if (typeof IWD !== 'undefined' && typeof IWD.OPC !== 'undefined' && typeof IWD.OPC.Shipping !== 'undefined' && typeof IWD.OPC.Checkout !== 'undefined' && IWD.OPC.Checkout.isVirtual === false) {
290
+ IWD.OPC.Shipping.saveShippingMethod();
291
+ }
292
+ // End fixer for IWD_OPC
293
+
294
+ // Start fixer for Onestepcheckout (Both trigger clicks for reload total section)
295
+ if ($('#onestepcheckout-form').length > 0) {
296
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(data));
297
+ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click');
298
+ setTimeout(function(){ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click'); }, 900);
299
+ }
300
+ // End fixer for Onestepcheckout (Both trigger clicks for reload total section)
301
+
302
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
303
+ // Start fixer for KlarnaCheckout
304
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(data));
305
+ // End fixer for KlarnaCheckout
306
+ <?php endif; ?>
307
+
308
+ $('input[value='+data.code+']').prop('checked',true).trigger('change');
309
+ }
310
+
311
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
312
+ // Start fixer for KlarnaCheckout
313
+ $$('input:checked[name="estimate_method"]')[0].simulate('click');
314
+ // End fixer for KlarnaCheckout
315
+ <?php endif; ?>
316
+
317
+ $('.all-in-one-container').trigger('popup.submit.after',[]);
318
+ btn.text('<?php echo Mage::getStoreConfig('carriers/vconnect_postnord/button_label_active') ?>');
319
+ // refreshControls();
320
+ closePopup();
321
+ }
322
+ function openPopup(){
323
+
324
+ console.log('openPopup');
325
+ var cont = $('.all-in-one-container');
326
+ cont.trigger({
327
+ type : 'popup.open.before'
328
+ });
329
+ // if($('body > .all-in-one-container').length !== 1){
330
+ // console.log('appending popup markup to body');
331
+ // $('.all-in-one-container').appendTo('body');
332
+ // }
333
+ if ($('.aino-cover').length === 0) {
334
+ $('<div/>').addClass('aino-cover').appendTo('body');
335
+ }
336
+ $('.aino-container').addClass('opened');
337
+ $('.all-in-one-container').css({
338
+ 'z-index' : 10000000,
339
+ 'position' : "relative"
340
+ }).show();
341
+ var popup = $('div.aio-container').addClass('opened').show();
342
+ $('.aino-container').removeClass('opened');
343
+
344
+ popup.find('.aino-container.desktop').addClass('opened').show();
345
+
346
+ $('.all-in-one-container').trigger({
347
+ type : 'popup.open.after'
348
+ });
349
+ window.aio_opened = true;
350
+ var cont = $('.all-in-one-container');
351
+ var el = $('.aino-deliver-to .ui-state-active');
352
+ var evName = 'tab_visible_' + el.attr('data-code');
353
+ cont.trigger(evName,[]);
354
+ console.info('-- trigered tab.visible for ' + evName);
355
+
356
+ }
357
+ function closePopup()
358
+ {
359
+ $('.all-in-one-container').trigger({
360
+ type : 'popup.close.before'
361
+ });
362
+ $('.aino-cover').remove();
363
+ $('.aino-container').removeClass('opened').hide();
364
+ $('.all-in-one-container').hide();
365
+ $('.all-in-one-container').trigger({
366
+ type : 'popup.close.after'
367
+ });
368
+ window.aio_opened = false;
369
+ }
370
+ function weatherInit(zip,countryCode,apiKey){
371
+ var days = [
372
+ '<?php echo $this->__("Sun");?>',
373
+ '<?php echo $this->__("Mon");?>',
374
+ '<?php echo $this->__("Tue");?>',
375
+ '<?php echo $this->__("Wed");?>',
376
+ '<?php echo $this->__("Thu");?>',
377
+ '<?php echo $this->__("Fri");?>',
378
+ '<?php echo $this->__("Sat");?>'
379
+ ];
380
+ $.ajax({
381
+ dataType: 'jsonp',
382
+ url : 'http://api.openweathermap.org/data/2.5/forecast/daily',
383
+ data : {
384
+ zip : zip+','+countryCode,
385
+ APPID : apiKey,
386
+ mode : 'json'
387
+ }
388
+
389
+ }).done( function( data ) {
390
+ if(typeof data.list == 'undefined'){
391
+ return console.error(data);
392
+ }
393
+ $('.aino-weather').each(function(){
394
+ var self = $(this);
395
+ if(self.find('ul li').length === 0){
396
+ var container = self.find('ul');
397
+ var icon;
398
+ var temp;
399
+ var listItem;
400
+ for(var x = 0 ; x < 5; x++){
401
+ var date = (new Date().getDay() + x) <= 6 ? new Date().getDay() + x :(new Date().getDay() + x) - 7 ;
402
+ icon = $('<div class="weather-icon"></div>')
403
+ .append('<img src="<?php echo $this->getSkinUrl('images/vconnect/aio/weather-icons/') ?>'+ data.list[x].weather[0].icon.replace('n', 'd') + '.png">');
404
+ temp = $('<div class="weather-temp-day"></div>')
405
+ .append('<span class="aion-weather-day">'+ days[date] +'</span>')
406
+ .append('<span class="aion-weather-temp">'+ (parseInt(data.list[x].temp.day)-273) +'<sup>o</sup>C</span>');
407
+
408
+ listItem = $('<li></li>');
409
+
410
+ icon.appendTo(listItem);
411
+ temp.appendTo(listItem);
412
+
413
+ listItem.appendTo(container);
414
+ }
415
+ }
416
+ });
417
+ });
418
+ }
419
+ function setTabs(){
420
+ var tabs = $('.aino-inner-tabs');
421
+ tabs.each(function(){
422
+ var self = $(this), target ;
423
+ var btn = $('a[role=tab]',self);
424
+ btn.each(function(){
425
+ var that = $(this);
426
+
427
+ that.unbind('click').on('click', function(){
428
+
429
+ $('.aino-deliver-to .delivery-context').removeClass('active') ;
430
+ target = that.attr('href');
431
+ target = target.substr(1);
432
+ $('.tab-list:not([data-target='+target+'])',tabs).hide();
433
+ var col2 = tabs.find('[data-target='+target+']');
434
+
435
+ if(self.find('[data-target='+target+']').css('display') === 'none'){
436
+ col2.parent().siblings('li').removeClass('active');
437
+ col2.show().addClass('active');
438
+ col2.parent().addClass('active');
439
+ that.parent('li').addClass('active');
440
+ that.parent('li').siblings().removeClass('active');
441
+ }
442
+ else{
443
+ col2.parent().siblings('ul').addClass('active');
444
+ col2.hide().removeClass('active');
445
+ col2.parent().removeClass('active');
446
+ that.parent('li').removeClass('active');
447
+ }
448
+ col2.closest('.aio-nav').siblings().hide().removeClass('active');
449
+ });
450
+ });
451
+
452
+ var close = $(this).find('.close');
453
+ close.each(function(){
454
+ $(this).on('click', function(){
455
+ setDeactive(self,target);
456
+ btn.parent('li').removeClass('active');
457
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
458
+ });
459
+ });
460
+
461
+ var closeInner = self.find('.close-inner');
462
+ closeInner.each(function(){
463
+ $(this).on('click', function(){
464
+ $(this).closest('.delivery-time').hide();
465
+ $(this).closest('.delivery-time')
466
+ .siblings('.aino-calendar-holder')
467
+ .find('.toggle-calendar').hide();
468
+ $(this).closest('.delivery-time')
469
+ .siblings('.aino-calendar-holder')
470
+ .find('.aino-calendar').removeClass('hidden');
471
+ });
472
+ });
473
+ });
474
+
475
+
476
+ }
477
+
478
+ function setDeactive(tabs,target){
479
+ $(tabs).find('[data-target='+target+']').parent().siblings('ul').addClass('active');
480
+ $(tabs).find('[data-target='+target+']').hide().removeClass('active');
481
+ $(tabs).find('[data-target='+target+']').parent().removeClass('active');
482
+ }
483
+ function setJQueryTabs(){
484
+ /*
485
+ events for switching the outer tabs (buttons on the left)
486
+ set active tab, show child, and set the others tabs to unactive
487
+ */
488
+ $('.aino-deliver-to > li > a').on('click', function(){
489
+
490
+ if($(this).attr('href') === '#post-office' && $(window).width() > 767){
491
+ $('.aino-weather').hide();
492
+ }
493
+ else{
494
+ $('.aino-weather').show();
495
+ }
496
+
497
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
498
+ $('.tab-list.aino-column-2').removeClass('active').hide();
499
+ $('.tab-list.aino-column').removeClass('active');
500
+ $('.aino-inner-tabs > ul li').removeClass('active');
501
+ var el = $(this).parent();
502
+ el.addClass('ui-state-active');
503
+ el.siblings().removeClass('ui-state-active');
504
+ $('.aino-deliver-to .tab-list.aino-column').hide().removeClass('active');
505
+ var activeTab = el.find('.tab-list.aino-column');
506
+
507
+ el.trigger({
508
+ type : 'tab.click',
509
+ tab : activeTab
510
+ });
511
+ activeTab.show().addClass('active');
512
+
513
+ if(aio_opened){
514
+ var cont = $('.all-in-one-container');
515
+ var evName = 'tab_visible_' + el.attr('data-code');
516
+ cont.trigger(evName,[]);
517
+ console.info('++ trigered tab.visible for ' + evName);
518
+ }
519
+
520
+ });
521
+ }
522
+ }
523
+
524
+ function InitAioBaseAfterScripts() {
525
+ var $ = jQuery;
526
+
527
+ var radios = $('input[type=radio][name=delivery]');
528
+ console.log('radios');
529
+ console.log(radios);
530
+ radios.unbind('change');
531
+ radios.on('change',function(){
532
+ var closest = $(this).closest('.aino-inner-tabs');
533
+ var el = $('.aino-textarea-holder',closest);
534
+ if($(this).val() == '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || $(this).val() == 'Utan kvittens (paketet ställs utanför dörren)'){
535
+ el.show();
536
+ }else{
537
+ el.hide();
538
+ }
539
+ });
540
+
541
+ var liEls = $('.aino-column-2 .aino-nav > li:not(.aino-sub-nav)');
542
+ liEls.unbind('click');
543
+ liEls.on('click',function(){
544
+ var self = $(this);
545
+
546
+ var tabDiv = self.closest('.tab-list.active');
547
+ var elsToUncheck = $('input',tabDiv) ;
548
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
549
+
550
+ elsToUncheck.prop('checked',false).attr('checked',false);
551
+ // self.closest('.tab-list.active input[chekced]').prop('checked',false).attr('checked',false);
552
+
553
+ // console.log($(this).find('label input').val());
554
+ self.closest('.tab-list.active.aino-column-2').hide().find('li').removeClass('aino-active');
555
+ // self.closest('.aino-nav').find('li').removeClass('active');
556
+ self.addClass('aino-active');
557
+
558
+ $('input[type=radio]',self).prop('checked',true).attr('checked',true).trigger('change');
559
+ var parentTarget = self.parents('.aino-column-2').attr('data-target');
560
+
561
+ if(self.find('.aino-nav').length != 0 ){
562
+ self.unbind('click');
563
+ }
564
+
565
+
566
+ self.closest('.aino-inner-tabs').find("[href=#"+parentTarget+"] span").html(self.find('label .label-text').html());
567
+
568
+ });
569
+ $('.aino-deliver-to > li > a').first().click();
570
+
571
+ // postcode reload - fix for Magestore_Onestepcheckoud
572
+ if ($('#one-step-checkout-form').length > 0 && typeof save_address_information !== 'undefined' && typeof save_address_url !== 'undefined' && typeof update_address_shipping !== 'undefined' && typeof update_address_payment !== 'undefined' && typeof update_address_review !== 'undefined') {
573
+ $('[name="billing[postcode]"],[name="shipping[postcode]"]').change(function () {
574
+ save_address_information(save_address_url, update_address_shipping, update_address_payment, update_address_review);
575
+ });
576
+ }
577
+ }
578
+
579
+ var init_runned = false;
580
+ jQuery(document).ready(function () {
581
+ if (init_runned == false) {
582
+ InitAioBaseScripts();
583
+ InitAioBaseAfterScripts();
584
+ init_runned = true;
585
+ }
586
+ });
587
+ jQuery(window).load(function () {
588
+ if (init_runned == false) {
589
+ InitAioBaseScripts();
590
+ InitAioBaseAfterScripts();
591
+ init_runned = true;
592
+ }
593
+ });
594
+ </script>
595
+ <?php echo $this->getChildHtml('body_scripts') ?>
app/design/frontend/base/default/template/vconnect/aio/commercial/tabHeader.phtml ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+ <li class="aino-business-tab" data-code="<?php echo $this->getCode() ?>">
35
+ <a href="#your-business" class="cf">
36
+ <span>
37
+ <?php echo $this->getMethodTitle() ?>
38
+ <?php if(!empty($config['delivery_time'])): ?>
39
+ <em><?php echo $config['delivery_time'] ?></em>
40
+ <?php endif;?>
41
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
42
+ </span>
43
+ </a>
44
+ <div class="tab-list aino-your-business cf aino-column" data-target="your-business">
45
+ <div class="aino-inner-tabs cf">
46
+ <ul class="aino-nav active">
47
+ <?php if (count($config['arrival'])): ?>
48
+ <li class="cf">
49
+ <div class="delivery-context">
50
+ <p class="aino-tab-sub-title">
51
+ <?php echo $this->__("We will arrive") ?>
52
+ </p>
53
+ <?php $b = $config['arrival'] ?>
54
+ <a role='tab' href="#arrival">
55
+ <span>
56
+ <?php echo $this->__(array_shift($b)); ?>
57
+ <?php // echo $this->__("Choose delivery form") ?>
58
+ </span>
59
+ </a>
60
+ </div>
61
+
62
+
63
+ <div class="tab-list aino-arrival aino-column-2" data-target="arrival">
64
+ <div><?php echo $this->__('Choose delivery option commercial arrival') ?> <span class="close"></span></div>
65
+ <ul class="aino-nav">
66
+ <?php $i = 0; ?>
67
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
68
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
69
+ <label class="aino-input aino-checkbox">
70
+ <input type="radio" name="arrival" value="<?php echo $value ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
71
+ <span class="aino-indicator"></span>
72
+ <span class="label-text"><?php echo $this->__($label) ?></span>
73
+ </label>
74
+ </li>
75
+ <?php $i++; ?>
76
+ <?php endforeach; ?>
77
+ </ul>
78
+ </div>
79
+ </li>
80
+ <?php endif; ?>
81
+
82
+ <li class="cf">
83
+ <?php if (count($config['delivery'])): ?>
84
+ <div class="delivery-context">
85
+ <div class="aino-tab-sub-title">
86
+ <?php echo $this->__('Delivery type') ?>
87
+ </div>
88
+ <?php $b = $config['delivery'] ?>
89
+ <a role='tab' href="#personal-delivery">
90
+ <span><?php echo $this->__(array_shift($b)); ?></span>
91
+ </a>
92
+ <p>
93
+ <?php echo $this->__('Please note that small packeges will be delivered directly to your mall box.') ?>
94
+ </p>
95
+
96
+ <br />
97
+ <div class="aino-textarea-holder">
98
+ <?php echo $this->__('Please add the code for yhe outside door in the textbox bellow (if there is):') ?>
99
+ <br />
100
+ <textarea rows="6" cols="10" name="other" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
101
+ </div>
102
+ </div>
103
+ <div class="tab-list aino-column-2" data-target="personal-delivery">
104
+ <div><?php echo $this->__('Choose delivery option commercial delivery') ?> <span class="close"></span></div>
105
+ <ul class="aino-nav">
106
+ <?php $i = 0; ?>
107
+ <?php foreach ($config['delivery'] as $value => $label): ?>
108
+ <?php if (is_array($label)): ?>
109
+ <li class="aino-sub-nav">
110
+ <a class="aino-collapse" href="javascript:void(0)">
111
+ <?php echo $this->__($value); ?>
112
+ </a>
113
+ <div class="aino-collapse-content">
114
+ <ul class="aino-nav">
115
+ <?php foreach ($label as $j=>$k): ?>
116
+ <li class="">
117
+ <label class="aino-input aino-checkbox">
118
+ <input type="radio" name="delivery" value="<?php echo is_int($j)?$k:$j ?>">
119
+ <span class="aino-indicator"></span>
120
+ <span class="label-text"><?php echo $this->__($k) ?></span>
121
+ </label>
122
+ </li>
123
+ <?php endforeach; ?>
124
+ </ul>
125
+ </div>
126
+ </li>
127
+ <?php else: ?>
128
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
129
+ <label class="aino-input aino-checkbox">
130
+ <input type="radio" name="delivery" value="<?php echo $this->__($value); ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
131
+ <span class="aino-indicator"></span>
132
+ <span class="label-text"><?php echo $this->__($label) ?></span>
133
+ </label>
134
+ </li>
135
+ <?php endif; ?>
136
+ <?php $i++; ?>
137
+ <?php endforeach; ?>
138
+
139
+ </ul>
140
+
141
+ </div>
142
+ <?php endif; ?>
143
+ </li>
144
+ </ul>
145
+ </div>
146
+ </div>
147
+ </li>
148
+
149
+
150
+
151
+
152
+
app/design/frontend/base/default/template/vconnect/aio/commercial/tabScripts.phtml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/commercial/tabScripts.phtml
29
+ */
30
+ $deliveries = Mage::helper('vc_aio')->getFelxDeliveryByMethodCode($this->getCode());
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+
35
+ <script>
36
+
37
+ jQuery(function($){
38
+
39
+
40
+ $('.all-in-one-container').on('submit_before_<?php echo $this->getCode()?>',function(){
41
+ var flexDeliveries = <?php echo json_encode($deliveries)?>;
42
+ var desc = '';
43
+ pointinfo = '';
44
+
45
+ <?php if(!empty($config['delivery_time'])): ?>
46
+ pointinfo += '<b><?php echo $this->__("Label arrival time commercial:") ?></b><br /><?php echo $config['delivery_time']; ?> <br />';
47
+ <?php endif;?>
48
+
49
+ var arrival = $('[data-code=<?php echo $this->getCode()?>] input[name=arrival][checked]');
50
+ if(arrival.length){
51
+ desc += ('' + arrival.val());
52
+ pointinfo += ('<b><?php echo $this->__("Label arrival commercial:") ?></b><br />' + arrival.parent().find('.label-text').text() + '<br/>');
53
+ }
54
+ var flexDelivery = false;
55
+ var delivery = $('[data-code=<?php echo $this->getCode()?>] input[name=delivery][checked]');
56
+ if(delivery.length){
57
+ desc += (' / ' + delivery.val());
58
+ pointinfo += ('<b><?php echo $this->__("Label delivery commercial:") ?></b><br />' + delivery.parent().find('.label-text').text() + '<br/>');
59
+ if($.inArray(delivery,flexDeliveries)){
60
+ flexDelivery = (delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)')?$('textarea[name=other]',closest).val():delivery.val();
61
+ }
62
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
63
+ var closest = delivery.closest('.aino-inner-tabs');
64
+ var otherText = $('textarea[name=other]',closest).val();
65
+ var escaped = $('<div/>').text(otherText).html();
66
+ desc += (" - " + escaped);
67
+ pointinfo += (" - " + escaped);
68
+ }
69
+ }
70
+
71
+
72
+
73
+ var obj = {
74
+ code : '<?php echo $this->getCode()?>',
75
+ arrival : arrival.length?arrival.val():false,
76
+ delivery : delivery.length?delivery.val():false,
77
+ flexdelivery : flexDelivery,
78
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
79
+ description : desc,
80
+ pointinfo : pointinfo
81
+ };
82
+ $('.aino-deliver-to li.ui-state-active').data('shipping',obj);
83
+ });
84
+
85
+ });
86
+
87
+
88
+ </script>
89
+
90
+
91
+
92
+
app/design/frontend/base/default/template/vconnect/aio/dpdeu/tabHeader.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <li class="aino-international-tab" data-code="<?php echo $this->getCode() ?>">
33
+ <a href="#aino-international" class="cf">
34
+ <span>
35
+ <?php echo $this->getMethodTitle() ?>
36
+ <?php if(!empty($config['delivery_time'])): ?>
37
+ <em><?php echo $config['delivery_time'] ?></em>
38
+ <?php endif;?>
39
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
40
+ </span>
41
+ </a>
42
+
43
+ <div class="tab-list aino-international cf aino-column" data-target="aino-international">
44
+ <div class="aino-tabs cf">
45
+ <ul class="aino-nav">
46
+ </ul>
47
+ <div class="aino-tabs-body active">
48
+ <div><?php echo $this->__('International Parcel delivered by DPD') ?>:</div>
49
+
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </li>
54
+
55
+
56
+
57
+
58
+
59
+
app/design/frontend/base/default/template/vconnect/aio/dpdeu/tabScripts.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ jQuery(function($){
35
+
36
+ $('.all-in-one-container').on('popup.submit.before',function(){
37
+ console.log($('.aino-international-tab.ui-state-active').attr('data-code'));
38
+ if($('.aino-international-tab.ui-state-active').attr('data-code') === '<?php echo $this->getCode()?>')
39
+ {
40
+
41
+ var obj = {
42
+ code : '<?php echo $this->getCode()?>',
43
+ arrival : null,
44
+ delivery : null,
45
+ flexdelivery:false,
46
+ carrier : '<?php echo $this->getCarrierTitle()?>',
47
+ description : 'International Parcel delivered by DPD'
48
+ };
49
+ $('.aino-international-tab.ui-state-active').data('shipping',obj);
50
+ }
51
+ });
52
+
53
+ });
54
+
55
+
56
+ </script>
57
+
58
+
59
+
60
+
app/design/frontend/base/default/template/vconnect/aio/dpdinternational/tabHeader.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <li class="aino-international-tab" data-code="<?php echo $this->getCode() ?>">
33
+ <a href="#aino-international" class="cf">
34
+ <span>
35
+ <?php echo $this->getMethodTitle() ?>
36
+ <?php if(!empty($config['delivery_time'])): ?>
37
+ <em><?php echo $config['delivery_time'] ?></em>
38
+ <?php endif;?>
39
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
40
+ </span>
41
+ </a>
42
+ <div class="tab-list aino-international cf aino-column" data-target="aino-international">
43
+ <div class="aino-tabs cf">
44
+ <ul class="aino-nav">
45
+ </ul>
46
+ <div class="aino-tabs-body active">
47
+ <div><?php echo $this->__('International Parcel delivered by DPD') ?>:</div>
48
+
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </li>
53
+
54
+
55
+
56
+
57
+
58
+
app/design/frontend/base/default/template/vconnect/aio/dpdinternational/tabScripts.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ jQuery(function($){
35
+
36
+ $('.all-in-one-container').on('popup.submit.before',function(){
37
+ if($('.aino-international-tab.ui-state-active').attr('data-code') === '<?php echo $this->getCode()?>')
38
+ {
39
+
40
+ var obj = {
41
+ code : '<?php echo $this->getCode()?>',
42
+ arrival : null,
43
+ delivery : null,
44
+ flexdelivery:false,
45
+ carrier : '<?php echo $this->getCarrierTitle()?>',
46
+ description : 'International Parcel delivered by DPD'
47
+ };
48
+ $('.aino-international-tab.ui-state-active').data('shipping',obj);
49
+ }
50
+ });
51
+
52
+ });
53
+
54
+
55
+ </script>
56
+
57
+
58
+
59
+
app/design/frontend/base/default/template/vconnect/aio/mailbox/tabHeader.phtml ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ $addditional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
32
+ ?>
33
+ <li class="aino-mailbox-tab" data-code="<?php echo $this->getCode() ?>">
34
+ <a href="#your-mailbox" class="cf">
35
+ <span>
36
+ <?php echo $this->getMethodTitle() ?>
37
+ <?php if(!empty($config['delivery_time'])): ?>
38
+ <em><?php echo $config['delivery_time'] ?></em>
39
+ <?php endif;?>
40
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
41
+ </span>
42
+ </a>
43
+ <div class="tab-list aino-your-mailbox cf aino-column" data-target="your-mailbox">
44
+ <div class="aino-inner-tabs cf">
45
+ <ul class="aino-nav active">
46
+ <?php if (count($config['arrival'])): ?>
47
+ <li class="cf">
48
+ <div class="delivery-context">
49
+ <p class="aino-tab-sub-title">
50
+ <?php echo $this->__("We will arrive in") ?>
51
+ </p>
52
+
53
+ <a role='tab' href="#arrival">
54
+ <span>
55
+ <?php echo $this->__(reset($config['arrival'])) ?>
56
+ </span>
57
+ </a>
58
+ <?php if(!empty($config['delivery_info'])): ?>
59
+ <p class="aino-tab-sub-title">
60
+ <?php echo $this->__($config['delivery_info']); ?>
61
+ </p>
62
+ <br />
63
+ <?php endif;?>
64
+ </div>
65
+ <div class="tab-list aino-arrival aino-column-2" data-target="arrival">
66
+ <div><?php echo $this->__('Choose delivery option mailbox arrival') ?> <span class="close"></span></div>
67
+ <ul class="aino-nav">
68
+ <?php $i = 0; ?>
69
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
70
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
71
+ <label class="aino-input aino-checkbox">
72
+ <input type="radio" name="arrival" value="<?php echo $value ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
73
+ <span class="aino-indicator"></span>
74
+ <span class="label-text"><?php echo $this->__($label) ?></span>
75
+ </label>
76
+ </li>
77
+ <?php $i++; ?>
78
+ <?php endforeach; ?>
79
+ <?php if ($addditional_fee): ?>
80
+ <li class="">
81
+ <label class="aino-input aino-checkbox">
82
+ <input type="radio" name="arrival" value="<?php echo $addditional_fee['label_with_price'] ?>">
83
+ <span class="aino-indicator"></span>
84
+ <span class="label-text"><?php echo $addditional_fee['label_with_price'] ?></span>
85
+ </label>
86
+ </li>
87
+ <?php endif; ?>
88
+ </ul>
89
+ </div>
90
+ </li>
91
+ <?php endif; ?>
92
+
93
+ <li class="cf">
94
+ <?php if (count($config['delivery'])): ?>
95
+ <div class="delivery-context">
96
+ <div class="aino-tab-sub-title">
97
+ <?php echo $this->__('Delivery types') ?>
98
+ </div>
99
+
100
+ <?php if (count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation'): ?>
101
+ <a role='tab' href="#personal-delivery">
102
+ <span><?php echo $this->__(reset($config['delivery'])) ?></span>
103
+ </a>
104
+ <p>
105
+ <?php echo $this->__('Please note that small packeges will be delivered directly to your mall box.') ?>
106
+
107
+ </p>
108
+ <?php endif; ?>
109
+
110
+ <br />
111
+ <div class="aino-textarea-holder">
112
+ <?php echo $this->__('Please add the code for yhe outside door in the textbox bellow (if there is):') ?>
113
+ <br />
114
+ <textarea rows="6" cols="10" name="other" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
115
+ </div>
116
+ </div>
117
+ <div class="tab-list aino-column-2" data-target="personal-delivery">
118
+ <div><?php echo $this->__('Choose delivery option mailbox delivery') ?> <span class="close"></span></div>
119
+ <ul class="aino-nav">
120
+ <?php $i = 0; ?>
121
+ <?php foreach ($config['delivery'] as $value => $label): ?>
122
+ <?php if (is_array($label)): ?>
123
+ <li class="aino-sub-nav">
124
+ <a class="aino-collapse" href="javascript:void(0)">
125
+ <?php echo $this->__($value); ?>
126
+ </a>
127
+ <div class="aino-collapse-content">
128
+ <ul class="aino-nav">
129
+ <?php foreach ($label as $j=>$k): ?>
130
+ <li class="">
131
+ <label class="aino-input aino-checkbox">
132
+ <input type="radio" name="delivery" value="<?php echo is_int($j)?$k:$j ?>">
133
+ <span class="aino-indicator"></span>
134
+ <span class="label-text"><?php echo $this->__($k) ?></span>
135
+ </label>
136
+ </li>
137
+ <?php endforeach; ?>
138
+ </ul>
139
+ </div>
140
+ </li>
141
+ <?php else: ?>
142
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
143
+ <label class="aino-input aino-checkbox">
144
+ <input type="radio" name="delivery" value="<?php echo $this->__($value); ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
145
+ <span class="aino-indicator"></span>
146
+ <span class="label-text"><?php echo $this->__($label) ?></span>
147
+ </label>
148
+ </li>
149
+ <?php endif; ?>
150
+ <?php $i++; ?>
151
+ <?php endforeach; ?>
152
+
153
+ </ul>
154
+
155
+ </div>
156
+ <?php endif; ?>
157
+ </li>
158
+ </ul>
159
+ <?php if (count($config['delivery'])): ?>
160
+ <div class="nearest_point_container" style="display: none">
161
+ <span class="vc-value"></span>
162
+ </div>
163
+ <?php endif; ?>
164
+ </div>
165
+ </div>
166
+ </li>
app/design/frontend/base/default/template/vconnect/aio/mailbox/tabScripts.phtml ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/mailbox/tabScripts.phtml
29
+ */
30
+ $deliveries = Mage::helper('vc_aio')->getFelxDeliveryByMethodCode($this->getCode());
31
+ ?>
32
+
33
+ <script>
34
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
35
+
36
+ jQuery(function($){
37
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
38
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
39
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
40
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
41
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
42
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
43
+
44
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
45
+ shipContryVal = '';
46
+ shipPostcodeVal = '';
47
+ shipStreetVal = '';
48
+ }
49
+
50
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
51
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
52
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
53
+
54
+ var html_nearest_point = '';
55
+
56
+ if ($('.nearest_point_container').length > 0) {
57
+ getPickupPoints(country_id,postcode,street,function (points) {
58
+ var nearest_point_monFriOpen = (typeof points[0].openingHours !== 'undefined')
59
+ ?points[0].openingHours[0].from1.insertString(2, 0, ":"):'';
60
+ var nearest_point_monFriClose = (typeof points[0].openingHours !== 'undefined')
61
+ ?points[0].openingHours[0].to1.insertString(2, 0, ":"):'';
62
+ var nearest_point_satOpen = (typeof points[0].openingHours !== 'undefined')
63
+ ?points[0].openingHours[points[0].openingHours.length-1].from1.insertString(2, 0, ":"):'';
64
+ var nearest_point_satClose = (typeof points[0].openingHours !== 'undefined')
65
+ ?points[0].openingHours[points[0].openingHours.length-1].to1.insertString(2, 0, ":"):'';
66
+
67
+ html_nearest_point = '<div class="aino-nearest-data">';
68
+ html_nearest_point += '<div class="aino-nearest-name">' +points[0].name + '</div>';
69
+ html_nearest_point += '<div class="aino-nearest-address">' + points[0].deliveryAddress.streetName + ', ' + points[0].deliveryAddress.streetNumber + '</div>';
70
+ html_nearest_point += '<div class="aino-work-hours">' +
71
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+nearest_point_monFriOpen +' - '+ nearest_point_monFriClose +'<br/>' +
72
+ '<?php echo $this->__('Sat'); ?>: '+nearest_point_satOpen +' - '+ nearest_point_satClose +
73
+ '</div>';
74
+ html_nearest_point += '</div>';
75
+ $('.nearest_point_container').show().find('.vc-value').html(html_nearest_point);
76
+ });
77
+ }
78
+
79
+ function getPickupPoints(country_id,postcode,street,callback)
80
+ {
81
+
82
+
83
+
84
+ var dataToSend = {
85
+ country_id : country_id,
86
+ postcode : postcode
87
+ };
88
+ if(street){
89
+ dataToSend.street = street;
90
+ }
91
+ $.ajax({
92
+ url : pointsEndpoint,
93
+ data : dataToSend
94
+ }).done(function (data) {
95
+
96
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
97
+ {
98
+ if( typeof data.postnord.message !== 'undefined'){
99
+ console.error(data.postnord.message);
100
+ }
101
+ return console.log('Pickup api\'s return unknown error');
102
+ }
103
+ var points = data.postnord.servicePointInformationResponse.servicePoints;
104
+
105
+ if(callback) {
106
+ callback(points);
107
+ }
108
+ });
109
+ }
110
+ $('.all-in-one-container').on('submit_before_<?php echo $this->getCode()?>',function(){
111
+ var flexDeliveries = <?php echo json_encode($deliveries)?>;
112
+ var desc = '';
113
+ var arrival = $('[data-code=<?php echo $this->getCode()?>] input[name=arrival][checked]');
114
+ if(arrival.length){
115
+ desc += ('' + arrival.val());
116
+ }
117
+ var flexDelivery = false;
118
+ var delivery = $('[data-code=<?php echo $this->getCode()?>] input[name=delivery][checked]');
119
+ if(delivery.length){
120
+ desc += (' / ' + delivery.val());
121
+ if($.inArray(delivery,flexDeliveries)){
122
+ flexDelivery = (delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)')?$('textarea[name=other]',closest).val():delivery.val();
123
+ }
124
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
125
+ var closest = delivery.closest('.aino-inner-tabs');
126
+ var otherText = $('textarea[name=other]',closest).val();
127
+ var escaped = $('<div/>').text(otherText).html();
128
+ desc += (" - " + escaped);
129
+ }
130
+ }
131
+
132
+
133
+ var obj = {
134
+ code : '<?php echo $this->getCode()?>',
135
+ arrival : arrival.length?arrival.val():false,
136
+ delivery : delivery.length?delivery.val():false,
137
+ flexdelivery : flexDelivery,
138
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
139
+ description : desc,
140
+ pointinfo : arrival.length?'<b><?php echo $this->__("We will arrive in") ?>:</b><br />' + arrival.parent().find('.label-text').text() + (html_nearest_point !== ''?(' <br /> <?php echo $this->__('Delivery types') ?><br />' + html_nearest_point):''):'',
141
+ };
142
+ $('.aino-deliver-to li.ui-state-active').data('shipping',obj);
143
+ });
144
+
145
+ });
146
+
147
+
148
+ </script>
149
+
150
+
151
+
152
+
app/design/frontend/base/default/template/vconnect/aio/pickup/tabHeader.phtml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+
33
+
34
+
35
+
36
+
37
+ <li class="aino-office-tab" data-code="<?php echo $this->getCode() ?>">
38
+ <a href="#post-office" class="cf pickup">
39
+ <span>
40
+ <?php echo $this->getMethodTitle() ?>
41
+ <?php if(!empty($config['delivery_time'])): ?>
42
+ <em><?php echo $config['delivery_time'] ?></em>
43
+ <?php endif;?>
44
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
45
+ </span>
46
+ </a>
47
+
48
+
49
+ <div class="tab-list aino-post-office cf aino-column" data-target="post-office">
50
+ <div class="aino-map-container">
51
+ <div class="aino-map"></div>
52
+ <div class="zipcode-holder">
53
+ <div class="post-code-input">
54
+ <label>
55
+ <?php echo $this->__('Skift postnumber') ?>
56
+ <input type="text"/>
57
+ </label>
58
+ <button type="button"><span></span></button>
59
+ </div>
60
+ <div class="directions-display-type">
61
+ <button role="DRIVING" type="button" class="aino-map-driving"><span></span></button>
62
+ <button role="WALKING" type="button" class="aino-map-walking"><span></span></button>
63
+ <button role="TRANSIT" type="button" class="aino-map-transit"><span></span></button>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <div class="address-near-you">
68
+ <ul class="aino-nav">
69
+
70
+ </ul>
71
+ </div>
72
+ </div>
73
+
74
+ </li>
75
+
76
+
77
+
78
+
79
+
app/design/frontend/base/default/template/vconnect/aio/pickup/tabScripts.phtml ADDED
@@ -0,0 +1,487 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/base.phtml
29
+ */
30
+
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+ <script>
35
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
36
+ </script>
37
+ <script>
38
+ jQuery(function($){
39
+ String.prototype.insertString = function(start, delCount, newSubStr) {
40
+ return this.slice(0, start) + newSubStr + this.slice(start + Math.abs(delCount));
41
+ };
42
+
43
+ var called = false,labels = [],bounds,markers = [],directionsDisplay,aio_points = [];
44
+
45
+ $('.all-in-one-container').on('tab_visible_<?php echo $this->getCode()?>',function(){
46
+
47
+ if(called){
48
+ return;
49
+ }
50
+ called = true;
51
+ bootstrap(function(){
52
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
53
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
54
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
55
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
56
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
57
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
58
+
59
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
60
+ if ($('select[name="country_id"]').length > 0 && $('input[name="estimate_postcode"]').length > 0) {
61
+ var shipContryVal = $('select[name="country_id"]:last').val();
62
+ var shipPostcodeVal = $('input[name="estimate_postcode"]:last').val();
63
+ }
64
+ <?php endif; ?>
65
+
66
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
67
+ shipContryVal = '';
68
+ shipPostcodeVal = '';
69
+ shipStreetVal = '';
70
+ } else if ($('#one-step-checkout-form').length > 0 && $('input[name="shipping[different_shipping]"]').length > 0 && !$('input[name="shipping[different_shipping]"]').is(':checked')) {
71
+ shipContryVal = '';
72
+ shipPostcodeVal = '';
73
+ shipStreetVal = '';
74
+ }
75
+
76
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
77
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
78
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
79
+
80
+ if (country_id != '' && postcode == '') {
81
+ if (country_id == 'SE') {
82
+ postcode = '10044';
83
+ } else if (country_id == 'FI') {
84
+ postcode = '00100';
85
+ } else if (country_id == 'NO') {
86
+ postcode = '0107';
87
+ } else if (country_id == 'DK') {
88
+ postcode = '1000';
89
+ }
90
+ }
91
+
92
+ var map = initMap();
93
+ window.map = map;
94
+ $('.post-code-input input').val(postcode);
95
+ $('.post-code-input button').on('click',function(){
96
+
97
+ getPickupPoints(country_id,$('.post-code-input input').val(),null,function(points){
98
+ setMapContent(map,points,false);
99
+ },false);
100
+ });
101
+ getPickupPoints(country_id,postcode,street,function(points){
102
+ setMapContent(map,points,true);
103
+ },true);
104
+ });
105
+
106
+
107
+
108
+ });
109
+ $('.all-in-one-container').on('tab.visible',function(target,el){
110
+ console.log('.post-office 1');
111
+ });
112
+ // $('.aino-tabs-body').on('tab.opened.post-office',function(){
113
+ //
114
+ //
115
+ // });
116
+
117
+
118
+ function initMap()
119
+ {
120
+ // Create a map object and specify the DOM element for display.
121
+ var center = { lat:58.663585, lng:15.307749 } ;
122
+ var zoom = 5;
123
+ if(typeof current_loc !== 'undefined'){
124
+ center = current_loc;
125
+ zoom = 8;
126
+ }
127
+ window.map = new google.maps.Map($('.aino-map:last')[0], {
128
+ scrollwheel : true,
129
+ zoom : zoom,
130
+ mapTypeId : google.maps.MapTypeId.ROADMAP,
131
+ zoomControl : true,
132
+ center : center
133
+ });
134
+ google.maps.event.addListenerOnce(map, 'idle', function(){
135
+ google.maps.event.trigger(map, 'resize');
136
+ });
137
+ $(window).resize(function() {
138
+ google.maps.event.trigger(map, 'resize');
139
+ });
140
+
141
+
142
+
143
+ return map;
144
+
145
+ }
146
+ function showDirections(map, origin, destination, type){
147
+ if(directionsDisplay != null) {
148
+ directionsDisplay.setMap(null);
149
+ directionsDisplay = null;
150
+ }
151
+
152
+ directionsDisplay = new google.maps.DirectionsRenderer({
153
+ map: map,
154
+ suppressMarkers: true
155
+ });
156
+
157
+
158
+ // Set destination, origin and travel mode.
159
+ var request = {
160
+ destination: destination,
161
+ origin: origin,
162
+ travelMode: google.maps.TravelMode[type]
163
+ };
164
+
165
+
166
+ // Pass the directions request to the directions service.
167
+ var directionsService = new google.maps.DirectionsService();
168
+ directionsService.route(request, function(response, status) {
169
+ if (status == google.maps.DirectionsStatus.OK) {
170
+ // Display the route on the map.
171
+ directionsDisplay.setDirections(response);
172
+ }
173
+
174
+ google.maps.event.addListenerOnce(map, 'zoom_changed', function() {
175
+ var oldZoom = map.getZoom();
176
+
177
+ if(oldZoom > 14){
178
+ map.setZoom(oldZoom - 1);
179
+ }
180
+ else{
181
+ map.setZoom(oldZoom);
182
+ }
183
+ });
184
+ });
185
+
186
+ return directionsDisplay;
187
+ }
188
+ function getPickupPoints(country_id,postcode,street,callback,shouldGoecode)
189
+ {
190
+ console.log('getPickupPoints called');
191
+
192
+ try{
193
+ delete window.current_loc;
194
+ }catch(e){}
195
+
196
+ if(street && shouldGoecode){
197
+ var geocoder = new google.maps.Geocoder();
198
+ geocoder.geocode({
199
+ address: street + ',' + postcode + ',' + country_id
200
+ }, function(results, status) {
201
+ if (status == google.maps.GeocoderStatus.OK) {
202
+ $.each( results, function( i, v ) {
203
+ if(typeof v.partial_match === 'undefined' || !v.partial_match){
204
+ window.current_loc = v.geometry.location;
205
+ }
206
+ });
207
+ }
208
+ });
209
+ }
210
+ var dataToSend = {
211
+ country_id : country_id,
212
+ postcode : postcode
213
+ };
214
+ if(street){
215
+ dataToSend.street = street;
216
+ }
217
+ $.ajax({
218
+ url : pointsEndpoint,
219
+ data : dataToSend
220
+ }).done(function (data) {
221
+
222
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
223
+ {
224
+ if( typeof data.postnord.message !== 'undefined'){
225
+ console.error(data.postnord.message);
226
+ }
227
+ return console.log('Pickup api\'s return unknown error');
228
+ }
229
+ var points = data.postnord.servicePointInformationResponse.servicePoints;
230
+ aio_points = points;
231
+ if(callback) {
232
+ callback(points);
233
+ }
234
+ });
235
+ }
236
+
237
+
238
+
239
+ function setMapContent(map,points,direction)
240
+ {
241
+ labels = [];
242
+
243
+ $.each( markers, function( i, v ) {
244
+ v.setMap(null);
245
+ });
246
+
247
+ markers = [];
248
+
249
+ bounds = new google.maps.LatLngBounds();
250
+ var container = $('.address-near-you .aino-nav').empty();
251
+ var x = 1;
252
+ var image = {
253
+ url: '<?php echo $this->getSkinUrl('images/vconnect/aio/temp.png') ?>',
254
+ size: new google.maps.Size(20, 40)
255
+ };
256
+ points.sort(function(a,b){
257
+ return a.routeDistance - b.routeDistance;
258
+ });
259
+ locations = [];
260
+ $.each( points, function( i, v ) {
261
+ var location = new google.maps.LatLng(v.coordinate.northing, v.coordinate.easting);
262
+ locations.push(location);
263
+ labels.push(makeMarkerLabel(v));
264
+ var marker = new MarkerWithLabel({
265
+ map: map,
266
+ icon: image,
267
+ zIndex: i,
268
+ labelContent: (x).toString(),
269
+ labelClass: "aino-label",
270
+ labelAnchor: new google.maps.Point(5, 50),
271
+ position: location,
272
+ labelStyle: {'display': 'block', height:'50px'}
273
+ });
274
+ markers.push(marker);
275
+ marker.addListener('click', function () {
276
+ setActiveMapComponent(map,marker,true,direction);
277
+ });
278
+ var listItem = $('<li></li>').on('click',function(){
279
+ setActiveMapComponent(map,marker,false,direction);
280
+ });
281
+ var distanceElement = $('<div class="aino-distance"><span></span></div>');
282
+ distanceElement.find('span').text((v.routeDistance/1000).toFixed(1) + ' km');
283
+
284
+ // openingHours
285
+ v_html_pickup_point = '';
286
+ v_pickup_point_monFriOpen = (typeof v.openingHours !== 'undefined')
287
+ ?v.openingHours[0].from1.insertString(2, 0, ":"):'';
288
+ v_pickup_point_monFriClose = (typeof v.openingHours !== 'undefined')
289
+ ?v.openingHours[0].to1.insertString(2, 0, ":"):'';
290
+ v_pickup_point_satOpen = (typeof v.openingHours !== 'undefined')
291
+ ?v.openingHours[v.openingHours.length-1].from1.insertString(2, 0, ":"):'';
292
+ v_pickup_point_satClose = (typeof v.openingHours !== 'undefined')
293
+ ?v.openingHours[v.openingHours.length-1].to1.insertString(2, 0, ":"):'';
294
+
295
+ if (v_pickup_point_monFriOpen || v_pickup_point_monFriClose) {
296
+ v_html_pickup_point = '<div class="aino-open-hours">' +
297
+ '<?php echo $this->__('Opening hours:'); ?> ' + v_pickup_point_monFriOpen +' - '+ v_pickup_point_monFriClose +'<br/>' +'</div>';
298
+ } else if (v_pickup_point_satOpen || v_pickup_point_satClose) {
299
+ v_html_pickup_point = '<div class="aino-open-hours">' +
300
+ '<?php echo $this->__('Opening hours:'); ?> ' + v_pickup_point_satOpen +' - '+ v_pickup_point_satClose +'</div>';
301
+ }
302
+
303
+ var addressItem = $('<div class="cf"></div>')
304
+
305
+ .append(distanceElement)
306
+ .append($('<div class="aino-index">' + x + '</div>'))
307
+ .append($('<div class="aino-title">' + v.name + '</div>'))
308
+ .append(
309
+ $('<div class="aino-address">' + v.deliveryAddress.streetName + ' ' + v.deliveryAddress.streetNumber + '<br />' + v.deliveryAddress.postalCode + ' ' + v.deliveryAddress.city + ' </div>')
310
+ )
311
+ .append(v_html_pickup_point)
312
+ ;
313
+
314
+
315
+
316
+
317
+ var shell = $('<div class="cf"></div>');
318
+ shell.append($('<label class="aino-input aino-checkbox"></label>')
319
+ .append($('<input type="radio" name="delivery" value="">'))
320
+ .append($('<span class="aino-indicator"></span>'))
321
+ .append(addressItem)
322
+ );
323
+ shell.appendTo(listItem.appendTo(container));
324
+
325
+
326
+
327
+
328
+ bounds.extend(location);
329
+ x++;
330
+ });
331
+
332
+ map.fitBounds(bounds);
333
+ setActiveMapComponent(map,markers[0],false,false);
334
+ }
335
+
336
+ function setActiveMapComponent(map, marker, scroll,direction){
337
+ var iwIndex = parseInt(marker.get('labelContent')) - 1;
338
+ var selectedPoint = aio_points[iwIndex];
339
+
340
+ pickup_point_monFriOpen = (typeof selectedPoint.openingHours !== 'undefined')
341
+ ?selectedPoint.openingHours[0].from1.insertString(2, 0, ":"):'';
342
+ pickup_point_monFriClose = (typeof selectedPoint.openingHours !== 'undefined')
343
+ ?selectedPoint.openingHours[0].to1.insertString(2, 0, ":"):'';
344
+ pickup_point_satOpen = (typeof selectedPoint.openingHours !== 'undefined')
345
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].from1.insertString(2, 0, ":"):'';
346
+ pickup_point_satClose = (typeof selectedPoint.openingHours !== 'undefined')
347
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].to1.insertString(2, 0, ":"):'';
348
+
349
+ html_pickup_point = '';
350
+
351
+ <?php if(!empty($config['delivery_time'])): ?>
352
+ html_pickup_point += '<b><?php echo $this->__("Label arrival time pickup:") ?></b><br /><?php echo $config['delivery_time']; ?> <br /><b><?php echo $this->__("Label delivery pickup:") ?></b><br/>';
353
+ <?php endif;?>
354
+
355
+ html_pickup_point += '<div class="aino-pickup-name">' +selectedPoint.name + '</div>';
356
+ html_pickup_point += '<div class="aino-pickup-address">' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + '</div>';
357
+ html_pickup_point += '<div class="aino-work-hours">' +
358
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+pickup_point_monFriOpen +' - '+ pickup_point_monFriClose +'<br/>' +
359
+ '<?php echo $this->__('Sat'); ?>: '+pickup_point_satOpen +' - '+ pickup_point_satClose +
360
+ '</div>';
361
+
362
+ var data = {
363
+ code : $('.aino-office-tab').attr('data-code'),
364
+ data : selectedPoint,
365
+ carrier : '<?php echo $this->getCarrierTitle()?>',
366
+ description : selectedPoint.name + ' - ' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + ' - ' + selectedPoint.deliveryAddress.postalCode + ' - ID:' + selectedPoint.servicePointId,
367
+ pointinfo : html_pickup_point,
368
+ };
369
+ $('.aino-office-tab').data('shipping',data);
370
+ var addresses = $('.address-near-you li');
371
+ $.each( markers, function( i, v ) {
372
+ v.set('zIndex',i );
373
+ v.set('labelClass', "aino-label");
374
+ });
375
+ marker.set('zIndex', markers.length +1 );
376
+ marker.set('labelClass', "aino-label active");
377
+
378
+ $.each( labels, function( i, v ) {
379
+ v.close();
380
+ });
381
+
382
+ labels[iwIndex].open(map, marker);
383
+
384
+ $(addresses[iwIndex]).siblings('li').removeClass('active');
385
+ $(addresses[iwIndex]).addClass('active');
386
+ if(scroll){
387
+
388
+ // scrollTo.offset().top - container.offset().top + container.scrollTop()
389
+ var scrollEl = addresses.parent().parent();
390
+ var scrollAmount = $(addresses[iwIndex]).offset().top - scrollEl.offset().top + scrollEl.scrollTop();
391
+ scrollEl.animate({
392
+ scrollTop: scrollAmount
393
+ },200);
394
+ }
395
+
396
+ if( typeof current_loc !== 'undefined' && direction ){
397
+ showDirections(map,current_loc,marker.get('position'),'DRIVING');
398
+ $('.aino-map-container .directions-display-type > button').each(function(){
399
+ $(this).unbind('click').on('click', function(){
400
+ var type = $(this).attr('role');
401
+ showDirections(map,current_loc,marker.get('position'), type);
402
+ });
403
+ });
404
+ }else{
405
+ map.fitBounds(bounds);
406
+ }
407
+
408
+ }
409
+
410
+ function makeMarkerLabel(item){
411
+
412
+ var monFriOpen = (typeof item.openingHours !== 'undefined')
413
+ ?item.openingHours[0].from1.insertString(2, 0, ":"):'';
414
+ var monFriClose = (typeof item.openingHours !== 'undefined')
415
+ ?item.openingHours[0].to1.insertString(2, 0, ":"):'';
416
+ var satOpen = (typeof item.openingHours !== 'undefined')
417
+ ?item.openingHours[item.openingHours.length-1].from1.insertString(2, 0, ":"):'';
418
+ var satClose = (typeof item.openingHours !== 'undefined')
419
+ ?item.openingHours[item.openingHours.length-1].to1.insertString(2, 0, ":"):'';
420
+
421
+ var shippingMethodLogo = '<?php echo $this->getSkinUrl('images/vconnect/aio/aino-postnord-logo.png'); ?>';
422
+
423
+ return new google.maps.InfoWindow({
424
+ content:
425
+ '<div class="aino-info-window">' +
426
+ '<div>' +
427
+ '<span><?php echo $this->__('Opening hours'); ?></span>' +
428
+ '<img src="'+shippingMethodLogo+'" alt="">' +
429
+ '</div>' +
430
+ '<div class="aino-work-hours">' +
431
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+monFriOpen +' - '+ monFriClose +'<br/>' +
432
+ '<?php echo $this->__('Sat'); ?>: '+satOpen +' - '+ satClose +
433
+ '</div>' +
434
+ '</div>'
435
+ });
436
+
437
+ }
438
+
439
+ function bootstrap(callback) {
440
+ if (document.head === undefined && document.getElementsByTagName('head').length > 0) {
441
+ head_element = document.getElementsByTagName('head')[0];
442
+ } else {
443
+ head_element = document.head;
444
+ }
445
+
446
+ google_load_script = function() {
447
+ var script6 = document.createElement('script');
448
+ script6.type = 'text/javascript';
449
+ script6.src = "<?php echo $this->getSkinUrl('js/vconnect/aio/markerwithlabel.js') ?>";
450
+
451
+ // bind the event to the callback function (callback)
452
+ if(script6.addEventListener) {
453
+ script6.addEventListener("load", callback, false); // IE9+, Chrome, Firefox
454
+ } else if(script6.readyState) {
455
+ script6.onreadystatechange = callback; // IE8
456
+ }
457
+
458
+ head_element.appendChild(script6);
459
+ };
460
+
461
+ if (typeof google === 'object' && typeof google.maps === 'object') {
462
+ console.info('google maps is already here');
463
+ google_load_script();
464
+ } else {
465
+ <?php
466
+ $key = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/google_maps_api_key');
467
+ if($key){
468
+ $key = ('&key=' . $key);
469
+ }
470
+ ?>
471
+
472
+ var script5 = document.createElement('script');
473
+ script5.type = 'text/javascript';
474
+ script5.src = "//maps.googleapis.com/maps/api/js?libraries=geometry<?php echo $key; ?>" ;
475
+
476
+ // bind the event to the callback function (google_load_script)
477
+ if(script5.addEventListener) {
478
+ script5.addEventListener("load", google_load_script, false); // IE9+, Chrome, Firefox
479
+ } else if(script5.readyState) {
480
+ script5.onreadystatechange = google_load_script; // IE8
481
+ }
482
+
483
+ head_element.appendChild(script5);
484
+ }
485
+ }
486
+ });
487
+ </script>
app/design/frontend/base/default/template/vconnect/aio/private/tabHeader.phtml ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
32
+ ?>
33
+ <li class="aino-address-tab" data-code="<?php echo $this->getCode() ?>">
34
+ <a href="#your-address" class="cf">
35
+ <span>
36
+ <?php echo $this->getMethodTitle() ?>
37
+ <?php if(!empty($config['delivery_time'])): ?>
38
+ <em><?php echo $config['delivery_time'] ?></em>
39
+ <?php endif;?>
40
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
41
+ </span>
42
+ </a>
43
+ <div class="tab-list aino-your-address cf aino-column" data-target="your-address">
44
+ <div class="aino-inner-tabs cf">
45
+ <ul class="aino-nav active">
46
+ <?php if (count($config['arrival'])): ?>
47
+ <li class="cf">
48
+ <div class="delivery-context">
49
+ <p class="aino-tab-sub-title">
50
+ <?php echo $this->__("We will arrive") ?>
51
+ </p>
52
+
53
+ <a role='tab' href="#arrival">
54
+ <span>
55
+ <?php echo $this->__(reset($config['arrival'])) ?>
56
+ <?php // echo $this->__("Choose delivery form") ?>
57
+ </span>
58
+ </a>
59
+
60
+ <?php if(!empty($config['delivery_info'])): ?>
61
+ <p class="aino-tab-sub-title">
62
+ <?php echo $this->__($config['delivery_info']); ?>
63
+ </p>
64
+ <br />
65
+ <?php endif;?>
66
+
67
+ </div>
68
+
69
+
70
+ <div class="tab-list aino-arrival aino-column-2" data-target="arrival">
71
+ <div><?php echo $this->__('Choose delivery option private arrival') ?> <span class="close"></span></div>
72
+ <ul class="aino-nav">
73
+ <?php $i = 0; ?>
74
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
75
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
76
+ <label class="aino-input aino-checkbox">
77
+ <input type="radio" name="arrival" value="<?php echo $value ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
78
+ <span class="aino-indicator"></span>
79
+ <span class="label-text"><?php echo $this->__($label) ?></span>
80
+ </label>
81
+ </li>
82
+ <?php $i++; ?>
83
+ <?php endforeach; ?>
84
+ <?php if ($additional_fee): ?>
85
+ <li style="display: none;" id="<?php echo $this->getCode() ?>_additional_fee_element" class="">
86
+ <label class="aino-input aino-checkbox">
87
+ <input type="radio" name="arrival" value="<?php echo $additional_fee['label_with_price'] ?>">
88
+ <span class="aino-indicator"></span>
89
+ <span class="label-text"><?php echo $additional_fee['label_with_price'] ?></span>
90
+ </label>
91
+ </li>
92
+ <?php endif; ?>
93
+ </ul>
94
+ </div>
95
+ </li>
96
+ <?php endif; ?>
97
+
98
+ <li class="cf">
99
+ <?php if (count($config['delivery'])): ?>
100
+ <div class="delivery-context">
101
+ <div class="aino-tab-sub-title">
102
+ <?php echo $this->__('Delivery type') ?>
103
+ </div>
104
+
105
+ <a role='tab' href="#personal-delivery">
106
+ <span><?php echo $this->__(reset($config['delivery'])) ?></span>
107
+ </a>
108
+ <p>
109
+ <?php echo $this->__('Please note that small packeges will be delivered directly to your mall box.') ?>
110
+
111
+ </p>
112
+
113
+ <br />
114
+ <div class="aino-textarea-holder">
115
+ <?php echo $this->__('Please add the code for the outside door in the textbox bellow (if there is):') ?>
116
+ <br />
117
+ <textarea rows="6" cols="10" name="other" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
118
+ </div>
119
+ </div>
120
+ <div class="tab-list aino-column-2" data-target="personal-delivery">
121
+ <div><?php echo $this->__('Choose delivery option private delivery') ?> <span class="close"></span></div>
122
+ <ul class="aino-nav">
123
+ <?php $i = 0; ?>
124
+ <?php foreach ($config['delivery'] as $value => $label): ?>
125
+ <?php if (is_array($label)): ?>
126
+ <li class="aino-sub-nav">
127
+ <a class="aino-collapse" href="javascript:void(0)">
128
+ <?php echo $this->__($value); ?>
129
+ </a>
130
+ <div class="aino-collapse-content">
131
+ <ul class="aino-nav">
132
+ <?php foreach ($label as $j=>$k): ?>
133
+ <li class="">
134
+ <label class="aino-input aino-checkbox">
135
+ <input type="radio" name="delivery" value="<?php echo is_int($j)?$k:$j ?>">
136
+ <span class="aino-indicator"></span>
137
+ <span class="label-text"><?php echo $this->__($k) ?></span>
138
+ </label>
139
+ </li>
140
+ <?php endforeach; ?>
141
+ </ul>
142
+ </div>
143
+ </li>
144
+ <?php else: ?>
145
+ <li class="<?php echo ($i == 0) ? 'aino-active' : '' ?>">
146
+ <label class="aino-input aino-checkbox">
147
+ <input type="radio" name="delivery" value="<?php echo $this->__($value); ?>" <?php echo ($i == 0) ? 'checked="checked"' : '' ?>>
148
+ <span class="aino-indicator"></span>
149
+ <span class="label-text"><?php echo $this->__($label) ?></span>
150
+ </label>
151
+ </li>
152
+ <?php endif; ?>
153
+ <?php $i++; ?>
154
+ <?php endforeach; ?>
155
+
156
+ </ul>
157
+
158
+ </div>
159
+
160
+ <?php endif; ?>
161
+ </li>
162
+ </ul>
163
+ </div>
164
+ </div>
165
+ </li>
166
+
167
+
168
+
169
+
170
+
171
+
172
+
app/design/frontend/base/default/template/vconnect/aio/private/tabScripts.phtml ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/private/tabScripts.phtml
29
+ */
30
+
31
+ $deliveries = Mage::helper('vc_aio')->getFelxDeliveryByMethodCode($this->getCode());
32
+
33
+ $config = $this->getConfig();
34
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
35
+ ?>
36
+
37
+ <?php if ($additional_fee): ?>
38
+ <script>
39
+ window.transitInformation = "<?php echo $this->getUrl('aio/index/transitInformation', array('_secure' => true))?>";
40
+ </script>
41
+ <?php endif; ?>
42
+
43
+ <script>
44
+
45
+ jQuery(function($){
46
+ $('.aino-weather').show();
47
+
48
+ $('.all-in-one-container').on('submit_before_<?php echo $this->getCode()?>',function(){
49
+ var flexDeliveries = <?php echo json_encode($deliveries)?>;
50
+ var desc = '';
51
+ pointinfo = '';
52
+
53
+ <?php if(!empty($config['delivery_time'])): ?>
54
+ pointinfo += '<b><?php echo $this->__("Label arrival time private:") ?></b><br /><?php echo $config['delivery_time']; ?> <br />';
55
+ <?php endif;?>
56
+
57
+ var arrival = $('[data-code=<?php echo $this->getCode()?>] input[name=arrival][checked]');
58
+ if(arrival.length){
59
+ desc += ('' + arrival.val());
60
+ pointinfo += ('<b><?php echo $this->__("Label arrival private:") ?></b><br />' + arrival.parent().find('.label-text').text() + '<br/>');
61
+ }
62
+
63
+ var flexDelivery = false;
64
+ var delivery = $('[data-code=<?php echo $this->getCode()?>] input[name=delivery][checked]');
65
+ if(delivery.length){
66
+ desc += (' / ' + delivery.val());
67
+ pointinfo += ('<b><?php echo $this->__("Label delivery private:") ?></b><br />' + delivery.parent().find('.label-text').text() + '<br/>');
68
+ if($.inArray(delivery,flexDeliveries)){
69
+ flexDelivery = (delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)')?$('textarea[name=other]',closest).val():delivery.val();
70
+ }
71
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
72
+ var closest = delivery.closest('.aino-inner-tabs');
73
+ var otherText = $('textarea[name=other]',closest).val();
74
+ var escaped = $('<div/>').text(otherText).html();
75
+ desc += (" - " + escaped);
76
+ pointinfo += (" - " + escaped);
77
+ }
78
+ }
79
+
80
+
81
+
82
+ var obj = {
83
+ code : '<?php echo $this->getCode()?>',
84
+ arrival : arrival.length?arrival.val():false,
85
+ delivery : delivery.length?delivery.val():false,
86
+ flexdelivery : flexDelivery,
87
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
88
+ description : desc,
89
+ pointinfo : pointinfo
90
+ };
91
+ $('.aino-deliver-to li.ui-state-active').data('shipping',obj);
92
+ });
93
+
94
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
95
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
96
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
97
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
98
+
99
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
100
+ shipContryVal = '';
101
+ shipPostcodeVal = '';
102
+ }
103
+
104
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
105
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
106
+
107
+ <?php if ($additional_fee): ?>
108
+ if (country_id && postcode && $('[data-code=<?php echo $this->getCode()?>] .aino-arrival .aino-nav').length != 0) {
109
+ getTransitInformation(country_id, postcode);
110
+ }
111
+
112
+ function getTransitInformation(country_id, postcode)
113
+ {
114
+ console.log('getTransitInformation called');
115
+
116
+ var dataToSend = {
117
+ country_id : country_id,
118
+ postcode : postcode,
119
+ service_code : 32
120
+ };
121
+
122
+ var eveningDelivery = false;
123
+
124
+ $.ajax({
125
+ url : transitInformation,
126
+ data : dataToSend
127
+ }).done(function (data) {
128
+ if (!data || !data.postnord) {
129
+ return;
130
+ }
131
+
132
+ if (data.postnord.error) {
133
+ console.log(data.postnord.message);
134
+ } else {
135
+ if(typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays !== 'undefined')
136
+ {
137
+ if (data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays == 1 && data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime == '21:00') {
138
+ eveningDelivery = true;
139
+ }
140
+ }
141
+
142
+ if (eveningDelivery) {
143
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').show();
144
+ } else {
145
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').hide();
146
+ }
147
+ }
148
+ });
149
+ }
150
+ <?php endif; ?>
151
+
152
+ });
153
+
154
+
155
+ </script>
156
+
157
+
158
+
159
+
app/design/frontend/base/default/template/vconnect/aio_base/base.phtml ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @template app/design/frontend/base/default/template/vconnect/aio/base.phtml
30
+ */
31
+
32
+ /* @var $this Vconnect_AllInOne_Block_Shipping_Dialog */
33
+ ?>
34
+
35
+ <!--[if IE 8]>
36
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl("css/vconnect/aio/blue_ie8.css") ?>" media="all" />
37
+ <![endif]-->
38
+
39
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-1.11.3.js') ?>"></script>
40
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-ui.js') ?>"></script>
41
+ <script type="text/javascript">
42
+ jQuery.noConflict();
43
+ </script>
44
+
45
+ <?php
46
+ $rates = $this->getRates();
47
+ /* @var $rates Mage_Sales_Model_Resource_Quote_Address_Rate_Collection */
48
+ ?>
49
+ <input class="aio-hidden" name="payment_ain_vconnect_postnord_data" value='' style="display: none;">
50
+
51
+ <?php echo $this->getChildHtml('tab_headers') ?>
52
+ <script type="text/javascript">
53
+ (function (d, id) {
54
+ if (d.getElementById(id)) {
55
+ return;
56
+ }
57
+ if (d.head === undefined && document.getElementsByTagName('head').length > 0) {
58
+ head_element = document.getElementsByTagName('head')[0];
59
+ } else {
60
+ head_element = d.head;
61
+ }
62
+ var css = d.createElement('link');
63
+ css.id = id;
64
+ css.type = 'text/css';
65
+ css.href = "https://fonts.googleapis.com/css?family=Roboto:400,700,800";
66
+ css.rel = "stylesheet";
67
+ head_element.appendChild(css);
68
+
69
+ var css1 = d.createElement('link');
70
+ css1.type = 'text/css';
71
+ // css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/{$this->getColor()}.css") ?>";
72
+ css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/blue.css") ?>";
73
+ css1.rel = "stylesheet";
74
+ head_element.appendChild(css1);
75
+ }(document, 'vconnect_postnord_scripts'));
76
+
77
+ if (typeof console === "undefined" || typeof console.log === "undefined") {
78
+ console = {};
79
+ console.log = function() {};
80
+ console.info = function() {};
81
+ }
82
+ </script>
83
+ <?php echo $this->getChildHtml('body_scripts') ?>
84
+
85
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
86
+ <div id="environmental_fee" style="display: none;">
87
+ <label class="aino-custom-input cf">
88
+ <span class="aino-custom-input-text">
89
+ <?php echo $this->__('Environmental fee'); ?>
90
+ <span class="aino-env-free-help">
91
+ <span class="aino-env-free-help-icon">?</span>
92
+ <span class="aino-env-fee-info-popup">
93
+ <span><?php echo $this->__("Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com"); ?></span>
94
+ </span>
95
+ </span>
96
+ <span class="aino-delivery-price"><span
97
+ class="price">+<?php echo Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)10, true, true); ?></span></span>
98
+ <i><?php echo $this->__('By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.'); ?></i>
99
+
100
+ </span>
101
+ <input type="checkbox" name="vconnect_postnord_environmental_fee" value="1"/>
102
+ <span class="aino-custom-checkbox-indicator"></span>
103
+ </label>
104
+ </div>
105
+ <?php endif; ?>
106
+
107
+ <script type="text/javascript">
108
+ var init_runned = false;
109
+ jQuery(document).ready(function () {
110
+ if (init_runned == false) {
111
+ InitAioBaseScripts();
112
+ init_runned = true;
113
+ }
114
+ });
115
+ jQuery(window).load(function () {
116
+ if (init_runned == false) {
117
+ InitAioBaseScripts();
118
+ init_runned = true;
119
+ }
120
+ });
121
+
122
+ function InitAioBaseScripts() {
123
+ var $ = jQuery;
124
+
125
+ $("input[name=shipping_method]").each(function () {
126
+ var self = $(this);
127
+ if (self.is(':checked') && self.val().indexOf('vconnect_postnord_') != -1) {
128
+ $('.aio-options[data-code=' + self.val() + ']').addClass('active');
129
+ if ($('#environmental_fee').length != 0) {
130
+ $('#environmental_fee').show();
131
+ }
132
+ }
133
+ });
134
+ $('select[name*="_delivery"]').each(function () {
135
+ console.log(this);
136
+ var self = $(this);
137
+ var txtArea = $('textarea.other-txt', self.parent());
138
+ // console.log('txt area');
139
+ // console.log(txtArea);
140
+ if (self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)') {
141
+ txtArea.show();
142
+ } else {
143
+ txtArea.hide();
144
+ }
145
+ });
146
+
147
+
148
+ $("input[name=shipping_method]").on('change', function () {
149
+ if ($('#environmental_fee').length != 0) {
150
+ $('#environmental_fee').hide();
151
+ }
152
+
153
+ $('.aio-options').removeClass('active');
154
+ var self = $(this);
155
+ if (self.val().indexOf('vconnect_postnord_') != -1) {
156
+ $('.aio-options[data-code=' + self.val() + ']').addClass('active');
157
+
158
+ if ($('#environmental_fee').length != 0) {
159
+ $('#environmental_fee').show();
160
+ }
161
+ }
162
+ if (self.val().indexOf('_pickup') != -1) {
163
+ $('.aio-hidden').show();
164
+ } else {
165
+ $('.aio-hidden').hide();
166
+ }
167
+
168
+ if ($('.aio-options[data-code=' + self.val() + '] select[name*="_arrival"]').length) {
169
+ $('.aio-options[data-code=' + self.val() + '] select[name*="_arrival"]').trigger('change');
170
+ }
171
+
172
+ });
173
+
174
+ $('select[name*="_delivery"]').on('change', function () {
175
+ var self = $(this);
176
+ var txtArea = self.parent().find('textarea');
177
+ if (self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)') {
178
+ txtArea.show();
179
+ } else {
180
+ txtArea.hide();
181
+ }
182
+ });
183
+
184
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
185
+ $('[name="vconnect_postnord_environmental_fee"]').on('change', function () {
186
+ if ($("input[name=shipping_method]:checked").length != 0 && $("input[name=shipping_method]:checked").val().indexOf('vconnect_postnord_') != -1) {
187
+ var obj = {
188
+ code: $("input[name=shipping_method]:checked").val(),
189
+ arrival: $('select[name="' + $("input[name=shipping_method]:checked").val() + '_arrival"]').length ? $('select[name="' + $("input[name=shipping_method]:checked").val() + '_arrival"]').val() : false,
190
+ delivery: $('select[name="' + $("input[name=shipping_method]:checked").val() + '_delivery"]').length ? $('select[name="' + $("input[name=shipping_method]:checked").val() + '_delivery"]').val() : false,
191
+ flexdelivery: false,
192
+ carrier: '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
193
+ description: false
194
+ };
195
+
196
+ obj.environmental_fee = 0;
197
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
198
+ obj.environmental_fee = 1;
199
+ }
200
+
201
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
202
+
203
+ // Start fixer for IWD_OPC
204
+ if (typeof IWD !== 'undefined' && typeof IWD.OPC !== 'undefined' && typeof IWD.OPC.Shipping !== 'undefined' && typeof IWD.OPC.Checkout !== 'undefined' && IWD.OPC.Checkout.isVirtual === false) {
205
+ IWD.OPC.Shipping.saveShippingMethod();
206
+ }
207
+ // End fixer for IWD_OPC
208
+
209
+ // Start fixer for Onestepcheckout (Both trigger clicks for reload total section)
210
+ if ($('#onestepcheckout-form').length > 0) {
211
+ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click');
212
+ setTimeout(function () {
213
+ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click');
214
+ }, 900);
215
+ }
216
+ // End fixer for IWD_OPC
217
+ }
218
+ });
219
+ $('[name="vconnect_postnord_environmental_fee"]').trigger('change');
220
+ <?php endif; ?>
221
+
222
+ <?php
223
+ if ($rates) {
224
+ foreach ($rates as $rate) {
225
+ if (empty($rate['code']) || empty($rate['vc_method_data'])) {
226
+ continue;
227
+ }
228
+
229
+ $method_code = $rate['code'];
230
+ $method_data = json_decode($rate['vc_method_data']);
231
+
232
+ if ($method_data && $method_data->delivery_time) {
233
+ ?>
234
+ $("input[name=shipping_method]").each(function () {
235
+ if ($(this).val() == '<?php echo $method_code; ?>') {
236
+ $(this).parent().find('span.price').before('<span class="transit_time"> <?php echo $method_data->delivery_time; ?> </span>');
237
+ }
238
+ });
239
+ <?php
240
+ }
241
+ }
242
+ }
243
+ ?>
244
+
245
+ // postcode reload - fix for Magestore_Onestepcheckoud
246
+ if ($('#one-step-checkout-form').length > 0 && typeof save_address_information !== 'undefined' && typeof save_address_url !== 'undefined' && typeof update_address_shipping !== 'undefined' && typeof update_address_payment !== 'undefined' && typeof update_address_review !== 'undefined') {
247
+ $('[name="billing[postcode]"],[name="shipping[postcode]"]').change(function () {
248
+ save_address_information(save_address_url, update_address_shipping, update_address_payment, update_address_review);
249
+ });
250
+ }
251
+ }
252
+ </script>
253
+
app/design/frontend/base/default/template/vconnect/aio_base/commercial/tabHeader.phtml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/commercial/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
33
+ <?php if(!empty($config['delivery_time'])): ?>
34
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time commercial:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
35
+ <?php endif;?>
36
+
37
+ <?php $count_arrival = count($config['arrival']); ?>
38
+ <?php if ($count_arrival): ?>
39
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival commercial:') ?></label>
40
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
41
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
42
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
43
+ <?php endforeach; ?>
44
+ </select>
45
+ <?php if ($count_arrival == 1 && isset($label)): ?>
46
+ <span><?php echo $this->__($label) ?></span><br/>
47
+ <?php endif; ?>
48
+ <?php endif; ?>
49
+
50
+ <?php $count_delivery = count($config['delivery']); ?>
51
+ <?php if ($count_delivery): ?>
52
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Label delivery commercial:') ?></label>
53
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
54
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
55
+ <?php if (is_array($label)): ?>
56
+ <optgroup label="<?php echo $value?>">
57
+ <?php foreach ($label as $j=>$k): ?>
58
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
59
+ <?php endforeach; ?>
60
+ </optgroup>
61
+ <?php else: ?>
62
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
63
+ <?php endif; ?>
64
+ <?php endforeach; ?>
65
+ </select>
66
+ <?php if ($count_delivery == 1 && isset($label)): ?>
67
+ <span><?php echo $this->__($label) ?></span>
68
+ <?php endif; ?>
69
+ <br/>
70
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
71
+ <?php endif; ?>
72
+ </div>
app/design/frontend/base/default/template/vconnect/aio_base/commercial/tabScripts.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ jQuery(function($){
35
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
36
+ });
37
+
38
+ </script>
39
+
40
+
41
+
42
+
app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabHeader.phtml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ $addditional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
32
+ ?>
33
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
34
+ <?php $count_arrival = count($config['arrival']) + ($addditional_fee ? 1 : 0); ?>
35
+ <?php if ($count_arrival): ?>
36
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival mailbox:') ?></label>
37
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
38
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
39
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
40
+ <?php endforeach; ?>
41
+ <?php if ($addditional_fee): ?>
42
+ <option value="<?php echo $addditional_fee['label_with_price'] ?>"><?php echo $addditional_fee['label_with_price'] ?></option>
43
+ <?php endif; ?>
44
+ </select>
45
+ <?php if ($count_arrival == 1 && isset($label)): ?>
46
+ <span><?php echo $this->__($label) ?></span><br/>
47
+ <?php endif; ?>
48
+ <?php endif; ?>
49
+
50
+ <?php $count_delivery = count($config['delivery']); ?>
51
+ <?php if ($count_delivery): ?>
52
+ <label for="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>><?php echo $this->__('Label delivery mailbox:') ?></label>
53
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>>
54
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
55
+ <?php if (is_array($label)): ?>
56
+ <optgroup label="<?php echo $value?>">
57
+ <?php foreach ($label as $j=>$k): ?>
58
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
59
+ <?php endforeach; ?>
60
+ </optgroup>
61
+ <?php else: ?>
62
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
63
+ <?php endif; ?>
64
+ <?php endforeach; ?>
65
+ </select>
66
+ <?php if ($count_delivery == 1 && isset($label)): ?>
67
+ <span><?php echo $this->__($label) ?></span>
68
+ <?php endif; ?>
69
+ <br/>
70
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
71
+ <?php endif; ?>
72
+ <?php if (count($config['delivery'])): ?>
73
+ <div class="nearest_point_container" style="display: none">
74
+ <span class="vc-label"><?php echo $this->__('Delivery types'); ?></span>
75
+ <span class="vc-value"></span>
76
+ </div>
77
+ <?php endif; ?>
78
+ </div>
app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabScripts.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+
33
+ <script>
34
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
35
+
36
+ jQuery(function($){
37
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
38
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
39
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
40
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
41
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
42
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
43
+
44
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
45
+ shipContryVal = '';
46
+ shipPostcodeVal = '';
47
+ shipStreetVal = '';
48
+ }
49
+
50
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
51
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
52
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
53
+
54
+ var html_nearest_point = '';
55
+
56
+ if ($('.nearest_point_container').length > 0) {
57
+ getPickupPoints(country_id,postcode,street,function (points) {
58
+ var nearest_point_monFriOpen = (typeof points[0].openingHours !== 'undefined')
59
+ ?points[0].openingHours[0].from1.insertString(2, 0, ":"):'';
60
+ var nearest_point_monFriClose = (typeof points[0].openingHours !== 'undefined')
61
+ ?points[0].openingHours[0].to1.insertString(2, 0, ":"):'';
62
+ var nearest_point_satOpen = (typeof points[0].openingHours !== 'undefined')
63
+ ?points[0].openingHours[points[0].openingHours.length-1].from1.insertString(2, 0, ":"):'';
64
+ var nearest_point_satClose = (typeof points[0].openingHours !== 'undefined')
65
+ ?points[0].openingHours[points[0].openingHours.length-1].to1.insertString(2, 0, ":"):'';
66
+
67
+ html_nearest_point = '<div class="aino-nearest-data">';
68
+ html_nearest_point += '<div class="aino-nearest-name">' +points[0].name + '</div>';
69
+ html_nearest_point += '<div class="aino-nearest-address">' + points[0].deliveryAddress.streetName + ', ' + points[0].deliveryAddress.streetNumber + '</div>';
70
+ html_nearest_point += '<div class="aino-work-hours">' +
71
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+nearest_point_monFriOpen +' - '+ nearest_point_monFriClose +'<br/>' +
72
+ '<?php echo $this->__('Sat'); ?>: '+nearest_point_satOpen +' - '+ nearest_point_satClose +
73
+ '</div>';
74
+ html_nearest_point += '</div>';
75
+ $('.nearest_point_container').show().find('.vc-value').html(html_nearest_point);
76
+ });
77
+ }
78
+
79
+ function getPickupPoints(country_id,postcode,street,callback)
80
+ {
81
+ var dataToSend = {
82
+ country_id : country_id,
83
+ postcode : postcode
84
+ };
85
+ if(street){
86
+ dataToSend.street = street;
87
+ }
88
+ $.ajax({
89
+ url : pointsEndpoint,
90
+ data : dataToSend
91
+ }).done(function (data) {
92
+
93
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
94
+ {
95
+ if( typeof data.postnord.message !== 'undefined'){
96
+ console.error(data.postnord.message);
97
+ }
98
+ return console.log('Pickup api\'s return unknown error');
99
+ }
100
+ var points = data.postnord.servicePointInformationResponse.servicePoints;
101
+
102
+ if(callback) {
103
+ callback(points);
104
+ }
105
+ });
106
+ }
107
+
108
+ $('select[name="<?php echo $this->getCode()?>_arrival"]').on('change',function(){
109
+ var obj = {
110
+ code : '<?php echo $this->getCode()?>',
111
+ arrival : $('select[name="<?php echo $this->getCode()?>_arrival"]').length?$('select[name="<?php echo $this->getCode()?>_arrival"]').val():false,
112
+ delivery : $('select[name="<?php echo $this->getCode()?>_delivery"]').length?$('select[name="<?php echo $this->getCode()?>_delivery"]').val():false,
113
+ flexdelivery : false,
114
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
115
+ description : false
116
+ };
117
+
118
+ obj.environmental_fee = 0;
119
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
120
+ obj.environmental_fee = 1;
121
+ }
122
+
123
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
124
+
125
+ // Start fixer for IWD_OPC
126
+ if (typeof IWD !== 'undefined' && typeof IWD.OPC !== 'undefined' && typeof IWD.OPC.Shipping !== 'undefined' && typeof IWD.OPC.Checkout !== 'undefined' && IWD.OPC.Checkout.isVirtual === false) {
127
+ IWD.OPC.Shipping.saveShippingMethod();
128
+ }
129
+ // End fixer for IWD_OPC
130
+
131
+ // Start fixer for Onestepcheckout (Both trigger clicks for reload total section)
132
+ if ($('#onestepcheckout-form').length > 0) {
133
+ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click');
134
+ setTimeout(function(){ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click'); }, 900);
135
+ }
136
+ // End fixer for IWD_OPC
137
+
138
+ });
139
+ $('select[name="<?php echo $this->getCode()?>_arrival"]').trigger('change');
140
+
141
+
142
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
143
+ });
144
+
145
+ </script>
146
+
147
+
148
+
149
+
app/design/frontend/base/default/template/vconnect/aio_base/pickup/tabHeader.phtml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
33
+ <button class="button aio-pick-btn" type="button">
34
+ <?php echo $this->__('Pick a point') ?>
35
+ </button>
36
+ <input class="required-entry aio-hidden" name="vconnect_postnord_data" value='<?php echo $this->getShippingInfo() ?>' style="width: 1px; height: 1px; outline-width: 0px;">
37
+ <div class="postnord-description"></div>
38
+ </div>
39
+ <div class="all-in-one-container">
40
+ <div class="aio-container">
41
+ <div class="aino-container desktop">
42
+ <div class="aino-core">
43
+ <div class="aino-header cf">
44
+ <h1 class="postnord-logo">
45
+ <span><?php echo Mage::getStoreConfig('carriers/vconnect_postnord/title') ?></span>
46
+ </h1>
47
+
48
+ <div class="aino-weather cf">
49
+ <ul class="aino-nav">
50
+
51
+ </ul>
52
+ </div>
53
+ </div>
54
+ <div class="aino-tabs cf">
55
+ <ul class="aino-nav aino-deliver-to">
56
+ <li class="aino-office-tab ui-state-active" data-code="<?php echo $this->getCode() ?>" >
57
+ <a href="#post-office" class="cf pickup">
58
+ <span>
59
+ <?php echo $this->getMethodTitle() ?>
60
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
61
+ </span>
62
+ </a>
63
+
64
+
65
+ <div class="tab-list aino-post-office cf aino-column" data-target="post-office">
66
+ <div class="aino-map-container">
67
+ <div class="aino-map"></div>
68
+ <div class="zipcode-holder">
69
+ <div class="post-code-input">
70
+ <label>
71
+ <?php echo $this->__('Skift postnumber') ?>
72
+ <input type="text"/>
73
+ </label>
74
+ <button type="button"><span></span></button>
75
+ </div>
76
+ <div class="directions-display-type">
77
+ <button role="DRIVING" type="button" class="aino-map-driving"><span></span></button>
78
+ <button role="WALKING" type="button" class="aino-map-walking"><span></span></button>
79
+ <button role="TRANSIT" type="button" class="aino-map-transit"><span></span></button>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ <div class="address-near-you">
84
+ <ul class="aino-nav">
85
+
86
+ </ul>
87
+ </div>
88
+ </div>
89
+
90
+ </li>
91
+ </ul>
92
+ </div>
93
+ <div class="aino-footer">
94
+ <div>
95
+ <button type="button" class="aino-button gray" role="close" >
96
+ <?php echo $this->__('Cancel') ?>
97
+ </button>
98
+ <button type="button" class="aino-button blue" role="submit">
99
+ <?php echo $this->__('OK') ?>
100
+ </button>
101
+ </div>
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+ </div>
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
app/design/frontend/base/default/template/vconnect/aio_base/pickup/tabScripts.phtml ADDED
@@ -0,0 +1,793 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+
35
+ <script>
36
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
37
+ jQuery(function($){
38
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
39
+ });
40
+
41
+ </script>
42
+ <script type="text/javascript">
43
+ jQuery(function($){
44
+
45
+ // $('button.aio-pick-btn').appendTo($("input[value*='vconnect_postnord_']").parent());
46
+ var btn = $('button.aio-pick-btn');
47
+ var submitBtn = $('.aino-button[role=submit]');
48
+ window.aio_opened = false;
49
+ //moving the pickup button to the outside container
50
+ var inputs = $("input[value*='vconnect_postnord_']");
51
+ var cont = inputs.closest('dd');
52
+
53
+ var descriptionField = $('.postnord-description');
54
+ var hiddenInput = $('input.aio-hidden');
55
+ if(hiddenInput.val() !== '' && hiddenInput.val()){
56
+ var data = JSON.parse(hiddenInput.val());
57
+ descriptionField.text(data.description);
58
+ }
59
+
60
+ refreshControls();
61
+
62
+ $('.tab-list:first').addClass('active');
63
+ $('input[name=shipping_method]').on('change',refreshControls);
64
+ $('.all-in-one-container').hide();
65
+ if($('body > .all-in-one-container').length < 1){
66
+ console.log('popup code moved to body');
67
+ $('.all-in-one-container').appendTo('body');
68
+ }else{
69
+ console.log('popup code raplaced');
70
+ $('body > .all-in-one-container').remove();
71
+ $('.all-in-one-container').appendTo('body');
72
+ // $('body > .all-in-one-container').replaceWith($('.wrapper .all-in-one-container'));
73
+ }
74
+ //close popup
75
+ $('.aino-footer button[role=close]').on('click', closePopup);
76
+
77
+ // $('.aino-deliver-to a').first().click(); //select first element
78
+ //init popup
79
+ initMobileCollapse();
80
+ setTabs();
81
+ setJQueryTabs();
82
+
83
+ btn.on('click',openPopup);
84
+
85
+ function refreshControls() {
86
+ var div = $('div[data-code=<?php echo $this->getCode() ?>]');
87
+ var cont = $("input[value='<?php echo $this->getCode() ?>']");
88
+ console.log(cont);
89
+ if(cont.is(':checked')){
90
+ div.show();
91
+ }else{
92
+ div.hide();
93
+ }
94
+ }
95
+ function initMobileCollapse(){
96
+ var collapseBtn = $('.aino-collapse');
97
+ collapseBtn.each(function(){
98
+ $(this).unbind('click');
99
+ $(this).on('click',function(){
100
+ var self = this;
101
+ $(self).next().animate({
102
+ height: "toggle"
103
+ }, 'fast', function(){
104
+ $(self).toggleClass('active');
105
+ var sibl = $(self).parent().siblings();
106
+ sibl.each(function(){
107
+ $(this).find('.aino-collapse-content').hide();
108
+ $(this).find('.aino-collapse').removeClass('active');
109
+ });
110
+ });
111
+ });
112
+ });
113
+ };
114
+ submitBtn.on('click',submit);
115
+ function submit()
116
+ {
117
+ var el = $('.aino-deliver-to li.ui-state-active');
118
+ $('.all-in-one-container').trigger('popup.submit.before',[]);
119
+
120
+ var event = 'submit_before_' + el.attr('data-code');
121
+ $('.all-in-one-container').trigger(event,[]);
122
+ console.info("Event trigger: " + event);
123
+ var data = el.data('shipping');
124
+ if(typeof data !== 'undefined'){
125
+ data.environmental_fee = 0;
126
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
127
+ data.environmental_fee = 1;
128
+ }
129
+
130
+ $('input[name=vconnect_postnord_data]').val(JSON.stringify(data)) ;
131
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
132
+ $('div.postnord-description').html(data.pointinfo);
133
+ } else {
134
+ $('div.postnord-description').text(data.description);
135
+ }
136
+ $('input[value='+data.code+']').prop('checked',true).trigger('change');
137
+ }
138
+
139
+ $('.all-in-one-container').trigger('popup.submit.after',[]);
140
+
141
+
142
+ refreshControls();
143
+ closePopup();
144
+ }
145
+ function openPopup(){
146
+
147
+ console.log('openPopup');
148
+ var cont = $('.all-in-one-container');
149
+ cont.trigger({
150
+ type : 'popup.open.before'
151
+ });
152
+ // if($('body > .all-in-one-container').length !== 1){
153
+ // console.log('appending popup markup to body');
154
+ // $('.all-in-one-container').appendTo('body');
155
+ // }
156
+ if ($('.aino-cover').length === 0) {
157
+ $('<div/>').addClass('aino-cover').appendTo('body');
158
+ }
159
+ $('.aino-container').addClass('opened');
160
+ $('.all-in-one-container').show();
161
+ var popup = $('div.aio-container').addClass('opened').show();
162
+ $('.aino-container').removeClass('opened');
163
+
164
+ popup.find('.aino-container.desktop').addClass('opened').show();
165
+
166
+ $('.all-in-one-container').trigger({
167
+ type : 'popup.open.after'
168
+ });
169
+ window.aio_opened = true;
170
+ var cont = $('.all-in-one-container');
171
+ var el = $('.aino-deliver-to .ui-state-active');
172
+ var evName = 'tab_visible_' + el.attr('data-code');
173
+ cont.trigger(evName,[]);
174
+ console.info('-- trigered tab.visible for ' + evName);
175
+
176
+ }
177
+ function closePopup()
178
+ {
179
+ $('.all-in-one-container').trigger({
180
+ type : 'popup.close.before'
181
+ });
182
+ $('.aino-cover').remove();
183
+ $('.aino-container').removeClass('opened').hide();
184
+ $('.all-in-one-container').hide();
185
+ $('.all-in-one-container').trigger({
186
+ type : 'popup.close.after'
187
+ });
188
+ window.aio_opened = false;
189
+ }
190
+
191
+ function setTabs(){
192
+ var tabs = $('.aino-inner-tabs');
193
+ tabs.each(function(){
194
+ var self = $(this), target ;
195
+ var btn = $('a[role=tab]',self);
196
+ btn.each(function(){
197
+ var that = $(this);
198
+
199
+
200
+
201
+ that.unbind('click').on('click', function(){
202
+ $('.aino-deliver-to .delivery-context').removeClass('active') ;
203
+ target = that.attr('href');
204
+ target = target.substr(1);
205
+ $('.tab-list:not([data-target='+target+'])',tabs).hide();
206
+ var col2 = tabs.find('[data-target='+target+']');
207
+
208
+ if(self.find('[data-target='+target+']').css('display') === 'none'){
209
+ col2.parent().siblings('li').removeClass('active');
210
+ col2.show().addClass('active');
211
+ col2.parent().addClass('active');
212
+ that.parent('li').addClass('active');
213
+ that.parent('li').siblings().removeClass('active');
214
+ }
215
+ else{
216
+ col2.parent().siblings('ul').addClass('active');
217
+ col2.hide().removeClass('active');
218
+ col2.parent().removeClass('active');
219
+ that.parent('li').removeClass('active');
220
+ }
221
+ col2.closest('.aio-nav').siblings().hide().removeClass('active');
222
+ });
223
+ });
224
+
225
+ var close = $(this).find('.close');
226
+ close.each(function(){
227
+ $(this).on('click', function(){
228
+ setDeactive(self,target);
229
+ btn.parent('li').removeClass('active');
230
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
231
+ });
232
+ });
233
+
234
+ var closeInner = self.find('.close-inner');
235
+ closeInner.each(function(){
236
+ $(this).on('click', function(){
237
+ $(this).closest('.delivery-time').hide();
238
+ $(this).closest('.delivery-time')
239
+ .siblings('.aino-calendar-holder')
240
+ .find('.toggle-calendar').hide();
241
+ $(this).closest('.delivery-time')
242
+ .siblings('.aino-calendar-holder')
243
+ .find('.aino-calendar').removeClass('hidden');
244
+ });
245
+ });
246
+ });
247
+
248
+
249
+ }
250
+ function setActive(tabs ,ele, target){
251
+ $(tabs).find('[data-target='+target+']').parent().siblings('li').removeClass('active');
252
+ $(tabs).find('[data-target='+target+']').show().addClass('active');
253
+ $(tabs).find('[data-target='+target+']').parent().addClass('active');
254
+ $(ele).parent('li').addClass('active');
255
+ $(ele).parent('li').siblings().removeClass('active');
256
+ }
257
+
258
+ function setDeactive(tabs,target){
259
+ $(tabs).find('[data-target='+target+']').parent().siblings('ul').addClass('active');
260
+ $(tabs).find('[data-target='+target+']').hide().removeClass('active');
261
+ $(tabs).find('[data-target='+target+']').parent().removeClass('active');
262
+ }
263
+ function setJQueryTabs(){
264
+ /*
265
+ events for switching the outer tabs (buttons on the left)
266
+ set active tab, show child, and set the others tabs to unactive
267
+ */
268
+ $('.aino-deliver-to > li > a').on('click', function(){
269
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
270
+ $('.tab-list.aino-column-2').removeClass('active').hide();
271
+ $('.tab-list.aino-column').removeClass('active');
272
+ $('.aino-inner-tabs > ul li').removeClass('active');
273
+ var el = $(this).parent();
274
+ el.addClass('ui-state-active');
275
+ el.siblings().removeClass('ui-state-active');
276
+ $('.aino-deliver-to .tab-list.aino-column').hide().removeClass('active');
277
+ var activeTab = el.find('.tab-list.aino-column');
278
+
279
+ el.trigger({
280
+ type : 'tab.click',
281
+ tab : activeTab
282
+ });
283
+ activeTab.show().addClass('active');
284
+
285
+ if(aio_opened){
286
+ var cont = $('.all-in-one-container');
287
+ var evName = 'tab_visible_' + el.attr('data-code');
288
+ cont.trigger(evName,[]);
289
+ console.info('++ trigered tab.visible for ' + evName);
290
+ }
291
+
292
+ });
293
+ }
294
+
295
+
296
+
297
+ });
298
+ </script>
299
+ <?php echo $this->getChildHtml('body_scripts') ?>
300
+ <script>
301
+ jQuery(function($){
302
+
303
+ var radios = $('input[type=radio][name=delivery]');
304
+
305
+ radios.unbind('change');
306
+ radios.on('change',function(){
307
+ var closest = $(this).closest('.aino-inner-tabs');
308
+ var el = $('.aino-textarea-holder',closest);
309
+ if($(this).val() == '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || $(this).val() == 'Utan kvittens (paketet ställs utanför dörren)'){
310
+ el.show();
311
+ }else{
312
+ el.hide();
313
+ }
314
+ });
315
+
316
+ var liEls = $('.column-2 .aino-nav > li:not(.aino-sub-nav)');
317
+ liEls.unbind('click');
318
+ liEls.on('click',function(){
319
+ var self = $(this);
320
+
321
+ var tabDiv = self.closest('.tab-list.active');
322
+ var elsToUncheck = $('input',tabDiv) ;
323
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
324
+
325
+ elsToUncheck.prop('checked',false).attr('checked',false);
326
+ // self.closest('.tab-list.active input[chekced]').prop('checked',false).attr('checked',false);
327
+
328
+ // console.log($(this).find('label input').val());
329
+ self.closest('.tab-list.active.column-2').hide().find('li').removeClass('active');
330
+ // self.closest('.aino-nav').find('li').removeClass('active');
331
+ self.addClass('active');
332
+
333
+ $('input[type=radio]',self).prop('checked',true).attr('checked',true).trigger('change');
334
+ var parentTarget = self.parents('.column-2').attr('data-target');
335
+
336
+ if(self.find('.aino-nav').length != 0 ){
337
+ self.unbind('click');
338
+ }
339
+
340
+
341
+ self.closest('.aino-inner-tabs').find("[href=#"+parentTarget+"] span").html(self.find('label .label-text').html());
342
+
343
+ });
344
+ $('.aino-deliver-to > li > a').first().click();
345
+
346
+
347
+
348
+
349
+
350
+ });
351
+ </script>
352
+ <script>
353
+ jQuery(function($){
354
+ String.prototype.insertString = function(start, delCount, newSubStr) {
355
+ return this.slice(0, start) + newSubStr + this.slice(start + Math.abs(delCount));
356
+ };
357
+
358
+ var called = false,labels = [],bounds,markers = [],directionsDisplay,aio_points = [];
359
+
360
+ $('.all-in-one-container').on('tab_visible_<?php echo $this->getCode()?>',function(){
361
+
362
+ if(called){
363
+ return;
364
+ }
365
+ called = true;
366
+ bootstrap(function(){
367
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
368
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
369
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
370
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
371
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
372
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
373
+
374
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
375
+ shipContryVal = '';
376
+ shipPostcodeVal = '';
377
+ shipStreetVal = '';
378
+ } else if ($('#one-step-checkout-form').length > 0 && $('input[name="shipping[different_shipping]"]').length > 0 && !$('input[name="shipping[different_shipping]"]').is(':checked')) {
379
+ shipContryVal = '';
380
+ shipPostcodeVal = '';
381
+ shipStreetVal = '';
382
+ }
383
+
384
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
385
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
386
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
387
+
388
+ if (country_id != '' && postcode == '') {
389
+ if (country_id == 'SE') {
390
+ postcode = '10044';
391
+ } else if (country_id == 'FI') {
392
+ postcode = '00100';
393
+ } else if (country_id == 'NO') {
394
+ postcode = '0107';
395
+ } else if (country_id == 'DK') {
396
+ postcode = '1000';
397
+ }
398
+ }
399
+
400
+ var map = initMap();
401
+ window.map = map;
402
+ $('.post-code-input input').val(postcode);
403
+ $('.post-code-input button').on('click',function(){
404
+ console.log('button clicked');
405
+ getPickupPoints(country_id,$('.post-code-input input').val(),null,function(points){
406
+ setMapContent(map,points,false);
407
+ },false);
408
+ });
409
+ getPickupPoints(country_id,postcode,street,function(points){
410
+ setMapContent(map,points,true);
411
+ },true);
412
+ });
413
+
414
+
415
+
416
+ });
417
+ $('.all-in-one-container').on('tab.visible',function(target,el){
418
+ console.log('.post-office 1');
419
+ });
420
+ // $('.aino-tabs-body').on('tab.opened.post-office',function(){
421
+ //
422
+ //
423
+ // });
424
+
425
+
426
+ function initMap()
427
+ {
428
+ // Create a map object and specify the DOM element for display.
429
+ $('.aino-weather').hide();
430
+ var center = { lat:58.663585, lng:15.307749 } ;
431
+ var zoom = 5;
432
+ if(typeof current_loc !== 'undefined'){
433
+ center = current_loc;
434
+ zoom = 8;
435
+ }
436
+ window.map = new google.maps.Map($('.aino-map:last')[0], {
437
+ scrollwheel : true,
438
+ zoom : zoom,
439
+ mapTypeId : google.maps.MapTypeId.ROADMAP,
440
+ zoomControl : true,
441
+ center : center
442
+ });
443
+ google.maps.event.addListenerOnce(map, 'idle', function(){
444
+ google.maps.event.trigger(map, 'resize');
445
+ });
446
+ $(window).resize(function() {
447
+ google.maps.event.trigger(map, 'resize');
448
+ });
449
+
450
+
451
+
452
+ return map;
453
+
454
+ }
455
+ function showDirections(map, origin, destination, type){
456
+ if(directionsDisplay != null) {
457
+ directionsDisplay.setMap(null);
458
+ directionsDisplay = null;
459
+ }
460
+
461
+ directionsDisplay = new google.maps.DirectionsRenderer({
462
+ map: map,
463
+ suppressMarkers: true
464
+ });
465
+
466
+
467
+ // Set destination, origin and travel mode.
468
+ var request = {
469
+ destination: destination,
470
+ origin: origin,
471
+ travelMode: google.maps.TravelMode[type]
472
+ };
473
+
474
+
475
+ // Pass the directions request to the directions service.
476
+ var directionsService = new google.maps.DirectionsService();
477
+ directionsService.route(request, function(response, status) {
478
+ if (status == google.maps.DirectionsStatus.OK) {
479
+ // Display the route on the map.
480
+ directionsDisplay.setDirections(response);
481
+ }
482
+
483
+ google.maps.event.addListenerOnce(map, 'zoom_changed', function() {
484
+ var oldZoom = map.getZoom();
485
+
486
+ if(oldZoom > 14){
487
+ map.setZoom(oldZoom - 1);
488
+ }
489
+ else{
490
+ map.setZoom(oldZoom);
491
+ }
492
+ });
493
+ });
494
+
495
+ return directionsDisplay;
496
+ }
497
+ function getPickupPoints(country_id,postcode,street,callback,shouldGoecode)
498
+ {
499
+ console.log('getPickupPoints called');
500
+
501
+ try{
502
+ delete window.current_loc;
503
+ }catch(e){}
504
+
505
+ if(street && shouldGoecode){
506
+ var geocoder = new google.maps.Geocoder();
507
+ geocoder.geocode({
508
+ address: street + ',' + postcode + ',' + country_id
509
+ }, function(results, status) {
510
+ if (status == google.maps.GeocoderStatus.OK) {
511
+ $.each( results, function( i, v ) {
512
+ if(typeof v.partial_match === 'undefined' || !v.partial_match){
513
+ window.current_loc = v.geometry.location;
514
+ }
515
+ });
516
+ }
517
+ });
518
+ }
519
+ var dataToSend = {
520
+ country_id : country_id,
521
+ postcode : postcode
522
+ };
523
+ if(street){
524
+ dataToSend.street = street;
525
+ }
526
+ $.ajax({
527
+ url : pointsEndpoint,
528
+ data : dataToSend
529
+ }).done(function (data) {
530
+
531
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
532
+ {
533
+ if( typeof data.postnord.message !== 'undefined'){
534
+ console.error(data.postnord.message);
535
+ }
536
+ return console.log('Pickup api\'s return unknown error');
537
+ }
538
+ aio_points = data.postnord.servicePointInformationResponse.servicePoints;
539
+ if(callback) {
540
+ callback(aio_points);
541
+ }
542
+ });
543
+ }
544
+
545
+
546
+
547
+ function setMapContent(map,points,direction)
548
+ {
549
+ labels = [];
550
+
551
+ $.each( markers, function( i, v ) {
552
+ v.setMap(null);
553
+ });
554
+
555
+ markers = [];
556
+
557
+ bounds = new google.maps.LatLngBounds();
558
+ var container = $('.address-near-you .aino-nav').empty();
559
+ var x = 1;
560
+ var image = {
561
+ url: '<?php echo $this->getSkinUrl('images/vconnect/aio/temp.png') ?>',
562
+ size: new google.maps.Size(20, 40)
563
+ };
564
+ points.sort(function(a,b){
565
+ return a.routeDistance - b.routeDistance;
566
+ });
567
+ locations = [];
568
+
569
+ $.each( points, function( i, v ) {
570
+ var location = new google.maps.LatLng(v.coordinate.northing, v.coordinate.easting);
571
+ locations.push(location);
572
+ labels.push(makeMarkerLabel(v));
573
+ var marker = new MarkerWithLabel({
574
+ map: map,
575
+ icon: image,
576
+ zIndex: i,
577
+ labelContent: (x).toString(),
578
+ labelClass: "aino-label",
579
+ labelAnchor: new google.maps.Point(14, 46),
580
+ position: location,
581
+ labelStyle: {'display': 'block', height:'50px'}
582
+ });
583
+ markers.push(marker);
584
+ marker.addListener('click', function () {
585
+ setActiveMapComponent(map,marker,true,direction);
586
+ });
587
+ var listItem = $('<li></li>').on('click',function(){
588
+ setActiveMapComponent(map,marker,false,direction);
589
+ });
590
+ var distanceElement = $('<div class="aino-distance"><span></span></div>');
591
+ distanceElement.find('span').text((v.routeDistance/1000).toFixed(1) + ' km');
592
+
593
+ // openingHours
594
+ v_html_pickup_point = '';
595
+ v_pickup_point_monFriOpen = (typeof v.openingHours !== 'undefined')
596
+ ?v.openingHours[0].from1.insertString(2, 0, ":"):'';
597
+ v_pickup_point_monFriClose = (typeof v.openingHours !== 'undefined')
598
+ ?v.openingHours[0].to1.insertString(2, 0, ":"):'';
599
+ v_pickup_point_satOpen = (typeof v.openingHours !== 'undefined')
600
+ ?v.openingHours[v.openingHours.length-1].from1.insertString(2, 0, ":"):'';
601
+ v_pickup_point_satClose = (typeof v.openingHours !== 'undefined')
602
+ ?v.openingHours[v.openingHours.length-1].to1.insertString(2, 0, ":"):'';
603
+
604
+ if (v_pickup_point_monFriOpen || v_pickup_point_monFriClose) {
605
+ v_html_pickup_point = '<div class="aino-open-hours">' +
606
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_monFriOpen +' - '+ v_pickup_point_monFriClose +'<br/>' +'</div>';
607
+ } else if (v_pickup_point_satOpen || v_pickup_point_satClose) {
608
+ v_html_pickup_point = '<div class="aino-open-hours">' +
609
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_satOpen +' - '+ v_pickup_point_satClose +'</div>';
610
+ }
611
+
612
+ var addressItem = $('<div class="cf"></div>')
613
+
614
+ .append(distanceElement)
615
+ .append($('<div class="aino-index">' + x + '</div>'))
616
+ .append($('<div class="aino-title">' + v.name + '</div>'))
617
+ .append(
618
+ $('<div class="aino-address">' + v.deliveryAddress.streetName + ' ' + v.deliveryAddress.streetNumber + '<br />' + v.deliveryAddress.postalCode + ' ' +v.deliveryAddress.city + ' </div>')
619
+ )
620
+ .append(v_html_pickup_point)
621
+ ;
622
+
623
+
624
+
625
+
626
+ var shell = $('<div class="cf"></div>');
627
+ shell.append($('<label class="aino-input aino-checkbox"></label>')
628
+ .append($('<input type="radio" name="delivery" value="">'))
629
+ .append($('<span class="aino-indicator"></span>'))
630
+ .append(addressItem)
631
+ );
632
+ shell.appendTo(listItem.appendTo(container));
633
+
634
+
635
+
636
+
637
+ bounds.extend(location);
638
+ x++;
639
+ });
640
+
641
+ map.fitBounds(bounds);
642
+ }
643
+
644
+ function setActiveMapComponent(map, marker, scroll,direction){
645
+ var iwIndex = parseInt(marker.get('labelContent')) - 1;
646
+ var selectedPoint = aio_points[iwIndex];
647
+
648
+ pickup_point_monFriOpen = (typeof selectedPoint.openingHours !== 'undefined')
649
+ ?selectedPoint.openingHours[0].from1.insertString(2, 0, ":"):'';
650
+ pickup_point_monFriClose = (typeof selectedPoint.openingHours !== 'undefined')
651
+ ?selectedPoint.openingHours[0].to1.insertString(2, 0, ":"):'';
652
+ pickup_point_satOpen = (typeof selectedPoint.openingHours !== 'undefined')
653
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].from1.insertString(2, 0, ":"):'';
654
+ pickup_point_satClose = (typeof selectedPoint.openingHours !== 'undefined')
655
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].to1.insertString(2, 0, ":"):'';
656
+
657
+ html_pickup_point = '';
658
+
659
+ <?php if(!empty($config['delivery_time'])): ?>
660
+ html_pickup_point += '<b><?php echo $this->__("Label arrival time pickup:") ?></b><br /><?php echo $config['delivery_time']; ?> <br /><b><?php echo $this->__("Label delivery pickup:") ?></b><br/>';
661
+ <?php endif;?>
662
+
663
+ html_pickup_point += '<div class="aino-pickup-name">' +selectedPoint.name + '</div>';
664
+ html_pickup_point += '<div class="aino-pickup-address">' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + '</div>';
665
+ html_pickup_point += '<div class="aino-work-hours">' +
666
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+pickup_point_monFriOpen +' - '+ pickup_point_monFriClose +'<br/>' +
667
+ '<?php echo $this->__('Sat'); ?>: '+pickup_point_satOpen +' - '+ pickup_point_satClose +
668
+ '</div>';
669
+
670
+ var data = {
671
+ code : $('.aino-office-tab').attr('data-code'),
672
+ data : selectedPoint,
673
+ carrier : '<?php echo $this->getCarrierTitle()?>',
674
+ description : selectedPoint.name + ' - ' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + ' - ' + selectedPoint.deliveryAddress.postalCode + ' - ID:' + selectedPoint.servicePointId,
675
+ pointinfo : html_pickup_point,
676
+ };
677
+ $('.aino-office-tab').data('shipping',data);
678
+ var addresses = $('.address-near-you li');
679
+ $.each( markers, function( i, v ) {
680
+ v.set('zIndex',i );
681
+ v.set('labelClass', "aino-label");
682
+ });
683
+
684
+ marker.set('zIndex', markers.length +1 );
685
+ marker.set('labelClass', "aino-label active");
686
+
687
+ $.each( labels, function( i, v ) {
688
+ v.close();
689
+ });
690
+
691
+ labels[iwIndex].open(map, marker);
692
+
693
+ $(addresses[iwIndex]).siblings('li').removeClass('active');
694
+ $(addresses[iwIndex]).addClass('active');
695
+ if(scroll){
696
+ var scrollEl = addresses.parent().parent();
697
+ var scrollAmount = $(addresses[iwIndex]).offset().top - scrollEl.offset().top + scrollEl.scrollTop();
698
+ scrollEl.animate({
699
+ scrollTop: scrollAmount
700
+ },200);
701
+ }
702
+
703
+ if( typeof current_loc !== 'undefined' && direction ){
704
+ showDirections(map,current_loc,marker.get('position'),'DRIVING');
705
+ $('.aino-map-container .directions-display-type > button').each(function(){
706
+ $(this).unbind('click').on('click', function(){
707
+ var type = $(this).attr('role');
708
+ showDirections(map,current_loc,marker.get('position'), type);
709
+ });
710
+ });
711
+ }else{
712
+ map.fitBounds(bounds);
713
+ }
714
+ }
715
+
716
+ function makeMarkerLabel(item){
717
+
718
+ var monFriOpen = (typeof item.openingHours !== 'undefined')
719
+ ?item.openingHours[0].from1.insertString(2, 0, ":"):'';
720
+ var monFriClose = (typeof item.openingHours !== 'undefined')
721
+ ?item.openingHours[0].to1.insertString(2, 0, ":"):'';
722
+ var satOpen = (typeof item.openingHours !== 'undefined')
723
+ ?item.openingHours[item.openingHours.length-1].from1.insertString(2, 0, ":"):'';
724
+ var satClose = (typeof item.openingHours !== 'undefined')
725
+ ?item.openingHours[item.openingHours.length-1].to1.insertString(2, 0, ":"):'';
726
+
727
+ var shippingMethodLogo = '<?php echo $this->getSkinUrl('images/vconnect/aio/aino-postnord-logo.png'); ?>';
728
+
729
+ return new google.maps.InfoWindow({
730
+ content:
731
+ '<div class="aino-info-window">' +
732
+ '<div>' +
733
+ '<span><?php echo $this->__('Opening hours'); ?></span>' +
734
+ '<img src="'+shippingMethodLogo+'" alt="">' +
735
+ '</div>' +
736
+ '<div class="aino-work-hours">' +
737
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+monFriOpen +' - '+ monFriClose +'<br/>' +
738
+ '<?php echo $this->__('Sat'); ?>: '+satOpen +' - '+ satClose +
739
+ '</div>' +
740
+ '</div>'
741
+ });
742
+
743
+ }
744
+
745
+ function bootstrap(callback) {
746
+ if (document.head === undefined && document.getElementsByTagName('head').length > 0) {
747
+ head_element = document.getElementsByTagName('head')[0];
748
+ } else {
749
+ head_element = document.head;
750
+ }
751
+
752
+ google_load_script = function() {
753
+ var script6 = document.createElement('script');
754
+ script6.type = 'text/javascript';
755
+ script6.src = "<?php echo $this->getSkinUrl('js/vconnect/aio/markerwithlabel.js') ?>";
756
+
757
+ // bind the event to the callback function (callback)
758
+ if(script6.addEventListener) {
759
+ script6.addEventListener("load", callback, false); // IE9+, Chrome, Firefox
760
+ } else if(script6.readyState) {
761
+ script6.onreadystatechange = callback; // IE8
762
+ }
763
+
764
+ head_element.appendChild(script6);
765
+ };
766
+
767
+ if (typeof google === 'object' && typeof google.maps === 'object') {
768
+ console.info('google maps is already here');
769
+ google_load_script();
770
+ } else {
771
+ <?php
772
+ $key = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/google_maps_api_key');
773
+ if($key){
774
+ $key = ('&key=' . $key);
775
+ }
776
+ ?>
777
+
778
+ var script5 = document.createElement('script');
779
+ script5.type = 'text/javascript';
780
+ script5.src = "//maps.googleapis.com/maps/api/js?libraries=geometry<?php echo $key; ?>" ;
781
+
782
+ // bind the event to the callback function (google_load_script)
783
+ if(script5.addEventListener) {
784
+ script5.addEventListener("load", google_load_script, false); // IE9+, Chrome, Firefox
785
+ } else if(script5.readyState) {
786
+ script5.onreadystatechange = google_load_script; // IE8
787
+ }
788
+
789
+ head_element.appendChild(script5);
790
+ }
791
+ }
792
+ });
793
+ </script>
app/design/frontend/base/default/template/vconnect/aio_base/private/tabHeader.phtml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+
31
+
32
+ $config = $this->getConfig();
33
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
34
+ ?>
35
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
36
+ <?php if(!empty($config['delivery_time'])): ?>
37
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time private:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
38
+ <?php endif;?>
39
+
40
+ <?php $count_arrival = count($config['arrival']) + ($additional_fee ? 1 : 0); ?>
41
+ <?php if ($count_arrival): ?>
42
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival private:') ?></label>
43
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
44
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
45
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
46
+ <?php endforeach; ?>
47
+ <?php if ($additional_fee): ?>
48
+ <option style="display: none;" id="<?php echo $this->getCode() ?>_additional_fee_element" value="<?php echo $additional_fee['label_with_price'] ?>"><?php echo $additional_fee['label_with_price'] ?></option>
49
+ <?php endif; ?>
50
+ </select>
51
+ <?php if ($count_arrival == 1 && isset($label)): ?>
52
+ <span><?php echo $this->__($label) ?></span><br/>
53
+ <?php endif; ?>
54
+ <?php endif; ?>
55
+
56
+ <?php $count_delivery = count($config['delivery']); ?>
57
+ <?php if ($count_delivery): ?>
58
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Delivery type') ?></label>
59
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
60
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
61
+ <?php if (is_array($label)): ?>
62
+ <optgroup label="<?php echo $value?>">
63
+ <?php foreach ($label as $j=>$k): ?>
64
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
65
+ <?php endforeach; ?>
66
+ </optgroup>
67
+ <?php else: ?>
68
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
69
+ <?php endif; ?>
70
+ <?php endforeach; ?>
71
+ </select>
72
+ <?php if ($count_delivery == 1 && isset($label)): ?>
73
+ <span><?php echo $this->__($label) ?></span>
74
+ <?php endif; ?>
75
+ <br/>
76
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
77
+ <?php endif; ?>
78
+ </div>
app/design/frontend/base/default/template/vconnect/aio_base/private/tabScripts.phtml ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+
32
+ $config = $this->getConfig();
33
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
34
+ ?>
35
+
36
+ <?php if ($additional_fee): ?>
37
+ <script>
38
+ window.transitInformation = "<?php echo $this->getUrl('aio/index/transitInformation', array('_secure' => true))?>";
39
+ </script>
40
+ <?php endif; ?>
41
+
42
+ <script>
43
+ jQuery(function($){
44
+ $('select[name="<?php echo $this->getCode()?>_arrival"]').on('change',function(){
45
+ var obj = {
46
+ code : '<?php echo $this->getCode()?>',
47
+ arrival : $('select[name="<?php echo $this->getCode()?>_arrival"]').length?$('select[name="<?php echo $this->getCode()?>_arrival"]').val():false,
48
+ delivery : $('select[name="<?php echo $this->getCode()?>_delivery"]').length?$('select[name="<?php echo $this->getCode()?>_delivery"]').val():false,
49
+ flexdelivery : false,
50
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
51
+ description : false
52
+ };
53
+
54
+ obj.environmental_fee = 0;
55
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
56
+ obj.environmental_fee = 1;
57
+ }
58
+
59
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
60
+
61
+ // Start fixer for IWD_OPC
62
+ if (typeof IWD !== 'undefined' && typeof IWD.OPC !== 'undefined' && typeof IWD.OPC.Shipping !== 'undefined' && typeof IWD.OPC.Checkout !== 'undefined' && IWD.OPC.Checkout.isVirtual === false) {
63
+ IWD.OPC.Shipping.saveShippingMethod();
64
+ }
65
+ // End fixer for IWD_OPC
66
+
67
+ // Start fixer for Onestepcheckout (Both trigger clicks for reload total section)
68
+ if ($('#onestepcheckout-form').length > 0) {
69
+ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click');
70
+ setTimeout(function(){ $('#onestepcheckout-form input[name="payment[method]"]:checked').trigger('click'); }, 900);
71
+ }
72
+ // End fixer for IWD_OPC
73
+ });
74
+ $('select[name="<?php echo $this->getCode()?>_arrival"]').trigger('change');
75
+
76
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
77
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
78
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
79
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
80
+
81
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
82
+ shipContryVal = '';
83
+ shipPostcodeVal = '';
84
+ }
85
+
86
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
87
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
88
+
89
+ <?php if ($additional_fee): ?>
90
+ if (country_id && postcode && $('select[name="<?php echo $this->getCode()?>_arrival"]').length != 0) {
91
+ getTransitInformation(country_id, postcode);
92
+ }
93
+
94
+ function getTransitInformation(country_id, postcode)
95
+ {
96
+ console.log('getTransitInformation called');
97
+
98
+ var dataToSend = {
99
+ country_id : country_id,
100
+ postcode : postcode,
101
+ service_code : 32
102
+ };
103
+
104
+ var eveningDelivery = false;
105
+
106
+ $.ajax({
107
+ url : transitInformation,
108
+ data : dataToSend
109
+ }).done(function (data) {
110
+ if (!data || !data.postnord) {
111
+ return;
112
+ }
113
+
114
+ if (data.postnord.error) {
115
+ console.log(data.postnord.message);
116
+ } else {
117
+ if(typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays !== 'undefined')
118
+ {
119
+ if (data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays == 1 && data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime == '21:00') {
120
+ eveningDelivery = true;
121
+ }
122
+ }
123
+
124
+ if (eveningDelivery) {
125
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').show();
126
+ } else {
127
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').hide();
128
+ }
129
+ }
130
+ });
131
+ }
132
+ <?php endif; ?>
133
+
134
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
135
+ });
136
+
137
+ </script>
138
+
139
+
140
+
141
+
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/base.phtml ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The MIT License
5
+ *
6
+ * Copyright 2016 vConnect.dk
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ * @category Magento
26
+ * @package Vconnect_AllInOne
27
+ * @author vConnect
28
+ * @email kontakt@vconnect.dk
29
+ * @template app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/base.phtml
30
+ */
31
+
32
+ /* @var $this Vconnect_AllInOne_Block_Shipping_Dialog */
33
+ ?>
34
+
35
+ <?php
36
+ $vconnectPostnordSessionData = array();
37
+ if (Mage::getSingleton('checkout/session')->hasVconnectPostnordSessionData()) {
38
+ $vconnectPostnordSessionData = Mage::getSingleton('checkout/session')->getVconnectPostnordSessionData();
39
+ }
40
+ ?>
41
+
42
+ <!--[if IE 8]>
43
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl("css/vconnect/aio/blue_ie8.css") ?>" media="all" />
44
+ <![endif]-->
45
+
46
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-1.11.3.js') ?>"></script>
47
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/vconnect/aio/jquery-ui.js') ?>"></script>
48
+ <script type="text/javascript">
49
+ jQuery.noConflict();
50
+ </script>
51
+
52
+ <?php
53
+ $rates = $this->getRates();
54
+ /* @var $rates Mage_Sales_Model_Resource_Quote_Address_Rate_Collection */
55
+ ?>
56
+
57
+ <script type="text/javascript">
58
+ jQuery(document).ready(function($){
59
+ if (jQuery('#co-shipping-method-form input[name=payment_ain_vconnect_postnord_data]').length < 1) {
60
+ html_input_data = '<input class="aio-hidden" name="payment_ain_vconnect_postnord_data" value="" style="display: none;">';
61
+ jQuery('#co-shipping-method-form').append(html_input_data);
62
+ }
63
+
64
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
65
+ if (jQuery('#co-shipping-method-form #environmental_fee').length > 0) {
66
+ jQuery('#co-shipping-method-form #environmental_fee').remove();
67
+ }
68
+ html_environmental_fee_data = '<div id="environmental_fee" style="display: none;">';
69
+ html_environmental_fee_data += ' <label class="aino-custom-input cf">';
70
+ html_environmental_fee_data += ' <span class="aino-custom-input-text"><?php echo $this->__('Environmental fee'); ?>';
71
+ html_environmental_fee_data += ' <span class="aino-env-free-help">';
72
+ html_environmental_fee_data += ' <span class="aino-env-free-help-icon">?</span>';
73
+ html_environmental_fee_data += ' <span class="aino-env-fee-info-popup">';
74
+ html_environmental_fee_data += ' <span><?php echo $this->__("Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com"); ?></span>';
75
+ html_environmental_fee_data += ' </span>';
76
+ html_environmental_fee_data += ' </span>';
77
+ html_environmental_fee_data += ' <span class="aino-delivery-price"><span class="price">+<?php echo Mage::getSingleton('checkout/session')->getQuote()->getStore()->convertPrice((float)10, true, true); ?></span></span>';
78
+ html_environmental_fee_data += ' <i><?php echo $this->__('By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.'); ?></i>';
79
+ html_environmental_fee_data += ' </span>';
80
+ html_environmental_fee_data += ' <input type="checkbox" name="vconnect_postnord_environmental_fee" <?php if (!empty($vconnectPostnordSessionData['environmental_fee'])) { ?> checked="checked" <?php } ?> value="1"/>';
81
+ html_environmental_fee_data += ' <span class="aino-custom-checkbox-indicator"></span>';
82
+ html_environmental_fee_data += ' </label>';
83
+ html_environmental_fee_data += '</div>';
84
+ jQuery("#co-shipping-method-form .buttons-set").prepend(html_environmental_fee_data);
85
+ <?php endif; ?>
86
+ });
87
+ </script>
88
+
89
+ <?php echo $this->getChildHtml('tab_headers') ?>
90
+ <script type="text/javascript">
91
+ (function(d, id){
92
+ if (d.getElementById(id)) {
93
+ return;
94
+ }
95
+ if (d.head === undefined && document.getElementsByTagName('head').length > 0) {
96
+ head_element = document.getElementsByTagName('head')[0];
97
+ } else {
98
+ head_element = d.head;
99
+ }
100
+ var css = d.createElement('link');
101
+ css.id = id;
102
+ css.type ='text/css';
103
+ css.href = "https://fonts.googleapis.com/css?family=Roboto:400,700,800";
104
+ css.rel = "stylesheet";
105
+ head_element.appendChild(css);
106
+
107
+ var css1 = d.createElement('link');
108
+ css1.type = 'text/css';
109
+ // css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/{$this->getColor()}.css") ?>";
110
+ css1.href = "<?php echo $this->getSkinUrl("css/vconnect/aio/blue.css") ?>";
111
+ css1.rel = "stylesheet";
112
+ head_element.appendChild(css1);
113
+ }(document, 'vconnect_postnord_scripts'));
114
+
115
+ if (typeof console === "undefined" || typeof console.log === "undefined") {
116
+ console = {};
117
+ console.log = function() {};
118
+ console.info = function() {};
119
+ }
120
+ </script>
121
+ <?php echo $this->getChildHtml('body_scripts') ?>
122
+
123
+ <script type="text/javascript">
124
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
125
+ var aio_shipping_method_name = 'estimate_method';
126
+ <?php else: ?>
127
+ var aio_shipping_method_name = 'shipping_method';
128
+ <?php endif; ?>
129
+
130
+ var init_runned = false;
131
+ jQuery(document).ready(function () {
132
+ if (init_runned == false) {
133
+ InitAioBaseScripts();
134
+ init_runned = true;
135
+ }
136
+ });
137
+ jQuery(window).load(function () {
138
+ if (init_runned == false) {
139
+ InitAioBaseScripts();
140
+ init_runned = true;
141
+ }
142
+ });
143
+
144
+ function InitAioBaseScripts() {
145
+ var $ = jQuery;
146
+
147
+ $("input[name="+aio_shipping_method_name+"]").each(function(){
148
+ var self = $(this);
149
+ if(self.is(':checked') && self.val().indexOf('vconnect_postnord_') != -1){
150
+ $('.aio-options[data-code='+self.val()+']').addClass('active');
151
+ if ($('#environmental_fee').length != 0) {
152
+ $('#environmental_fee').show();
153
+ }
154
+ }
155
+ });
156
+ $('select[name*="_delivery"]').each(function(){
157
+ console.log(this);
158
+ var self = $(this);
159
+ var txtArea = $('textarea.other-txt',self.parent());
160
+ // console.log('txt area');
161
+ // console.log(txtArea);
162
+ if(self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
163
+ txtArea.show();
164
+ }else{
165
+ txtArea.hide();
166
+ }
167
+ });
168
+
169
+
170
+ $("input[name="+aio_shipping_method_name+"]").on('change',function(){
171
+ if ($('#environmental_fee').length != 0) {
172
+ $('#environmental_fee').hide();
173
+ }
174
+
175
+ $('.aio-options').removeClass('active');
176
+ var self = $(this);
177
+ if(self.val().indexOf('vconnect_postnord_') != -1){
178
+ $('.aio-options[data-code='+self.val()+']').addClass('active');
179
+
180
+ if ($('#environmental_fee').length != 0) {
181
+ $('#environmental_fee').show();
182
+ }
183
+ }
184
+ if(self.val().indexOf('_pickup') != -1){
185
+ $('.aio-hidden').show();
186
+ }else{
187
+ $('.aio-hidden').hide();
188
+ }
189
+
190
+ if ($('.aio-options[data-code='+self.val()+'] select[name*="_arrival"]').length) {
191
+ $('.aio-options[data-code='+self.val()+'] select[name*="_arrival"]').trigger('change');
192
+ }
193
+
194
+ });
195
+
196
+ $('select[name*="_delivery"]').on('change',function(){
197
+ var self = $(this);
198
+ var txtArea = self.parent().find('textarea');
199
+ if(self.val() === '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || self.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
200
+ txtArea.show();
201
+ }else{
202
+ txtArea.hide();
203
+ }
204
+ });
205
+
206
+ <?php if (Mage::getStoreConfigFlag('carriers/vconnect_postnord/environmental_fee')): ?>
207
+ $('[name="vconnect_postnord_environmental_fee"]').on('change',function(){
208
+ if ($("input[name="+aio_shipping_method_name+"]:checked").length != 0 && $("input[name="+aio_shipping_method_name+"]:checked").val().indexOf('vconnect_postnord_') != -1) {
209
+ setVconnectPostnordData();
210
+
211
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
212
+ // Start fixer for KlarnaCheckout
213
+ $$('input:checked[name="estimate_method"]')[0].simulate('click');
214
+ // End fixer for KlarnaCheckout
215
+ <?php endif; ?>
216
+ }
217
+ });
218
+ <?php endif; ?>
219
+
220
+ <?php
221
+ if ($rates) {
222
+ foreach ($rates as $rate) {
223
+ if (empty($rate['code']) || empty($rate['vc_method_data'])) {
224
+ continue;
225
+ }
226
+
227
+ $method_code = $rate['code'];
228
+ $method_data = json_decode($rate['vc_method_data']);
229
+
230
+ if ($method_data && $method_data->delivery_time) {
231
+ ?>
232
+ $("input[name="+aio_shipping_method_name+"]").each(function(){
233
+ if($(this).val() == '<?php echo $method_code; ?>'){
234
+ $(this).parent().find('span.price').before('<span class="transit_time"> <?php echo $method_data->delivery_time; ?> </span>');
235
+ }
236
+ });
237
+ <?php
238
+ }
239
+ }
240
+ }
241
+ ?>
242
+
243
+ setVconnectPostnordData();
244
+ }
245
+
246
+ function setVconnectPostnordData() {
247
+ if (jQuery("input[name="+aio_shipping_method_name+"]:checked").length != 0 && jQuery("input[name="+aio_shipping_method_name+"]:checked").val().indexOf('vconnect_postnord_') != -1) {
248
+ var desc = '';
249
+ var otherText = '';
250
+
251
+ var arrival = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]');
252
+ if(arrival.length){
253
+ desc += ('' + arrival.val());
254
+ }
255
+
256
+ var delivery = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_delivery"]');
257
+ if(delivery.length){
258
+ desc += (' / ' + delivery.val());
259
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
260
+ var otherText = jQuery('textarea[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_other"]').val();
261
+ var escaped = jQuery('<div/>').text(otherText).html();
262
+ desc += (" - " + escaped);
263
+ }
264
+ }
265
+
266
+ var obj = {
267
+ code : jQuery("input[name="+aio_shipping_method_name+"]:checked").val(),
268
+ arrival : jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').length?jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').val():false,
269
+ delivery : delivery.length?delivery.val():false,
270
+ other : otherText,
271
+ flexdelivery : false,
272
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
273
+ description : desc
274
+ };
275
+
276
+ if (jQuery("input[name="+aio_shipping_method_name+"]:checked").val().indexOf('pickup') != -1 && jQuery("input[name=vconnect_postnord_data]").length != 0 && jQuery("input[name=vconnect_postnord_data]").val()) {
277
+ var obj = JSON.parse(jQuery("input[name=vconnect_postnord_data]").val());
278
+ }
279
+
280
+ obj.environmental_fee = 0;
281
+ if (jQuery('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
282
+ obj.environmental_fee = 1;
283
+ }
284
+
285
+ jQuery('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
286
+ }
287
+ }
288
+ </script>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/commercial/tabHeader.phtml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/commercial/tabHeader.phtml
29
+ */
30
+ $config = $this->getConfig();
31
+ ?>
32
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
33
+ <?php if(!empty($config['delivery_time'])): ?>
34
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time commercial:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
35
+ <?php endif;?>
36
+
37
+ <?php $count_arrival = count($config['arrival']); ?>
38
+ <?php if ($count_arrival): ?>
39
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival commercial:') ?></label>
40
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
41
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
42
+ <option value="<?php echo $value ?>"><?php echo $this->__($label) ?></option>
43
+ <?php endforeach; ?>
44
+ </select>
45
+ <?php if ($count_arrival == 1 && isset($label)): ?>
46
+ <span><?php echo $this->__($label) ?></span><br/>
47
+ <?php endif; ?>
48
+ <?php endif; ?>
49
+
50
+ <?php $count_delivery = count($config['delivery']); ?>
51
+ <?php if ($count_delivery): ?>
52
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Label delivery commercial:') ?></label>
53
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
54
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
55
+ <?php if (is_array($label)): ?>
56
+ <optgroup label="<?php echo $value?>">
57
+ <?php foreach ($label as $j=>$k): ?>
58
+ <option value="<?php echo is_int($j)?$k:$j ?>"><?php echo $this->__($k) ?></option>
59
+ <?php endforeach; ?>
60
+ </optgroup>
61
+ <?php else: ?>
62
+ <option value="<?php echo $this->__($value); ?>"><?php echo $this->__($label) ?></option>
63
+ <?php endif; ?>
64
+ <?php endforeach; ?>
65
+ </select>
66
+ <?php if ($count_delivery == 1 && isset($label)): ?>
67
+ <span><?php echo $this->__($label) ?></span>
68
+ <?php endif; ?>
69
+ <br/>
70
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"></textarea>
71
+ <?php endif; ?>
72
+ </div>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/commercial/tabScripts.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+ <script>
33
+ jQuery(function($){
34
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
35
+ });
36
+ </script>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/mailbox/tabHeader.phtml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/mailbox/tabHeader.phtml
29
+ */
30
+ ?>
31
+
32
+ <?php
33
+ $config = $this->getConfig();
34
+ $addditional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
35
+
36
+ $vconnectPostnordSessionData = array();
37
+ if (Mage::getSingleton('checkout/session')->hasVconnectPostnordSessionData()) {
38
+ $vconnectPostnordSessionData = Mage::getSingleton('checkout/session')->getVconnectPostnordSessionData();
39
+ }
40
+
41
+ $arrival_default = '';
42
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['arrival']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
43
+ $arrival_default = $vconnectPostnordSessionData['arrival'];
44
+ }
45
+
46
+ $delivery_default = '';
47
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['delivery']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
48
+ $delivery_default = $vconnectPostnordSessionData['delivery'];
49
+ }
50
+
51
+ $other_default = '';
52
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['other']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
53
+ $other_default = $vconnectPostnordSessionData['other'];
54
+ }
55
+ ?>
56
+
57
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
58
+ <?php $count_arrival = count($config['arrival']) + ($addditional_fee ? 1 : 0); ?>
59
+ <?php if ($count_arrival): ?>
60
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival mailbox:') ?></label>
61
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
62
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
63
+ <option value="<?php echo $value ?>" <?php if ($arrival_default == $value) { ?> selected="selected" <?php } ?>><?php echo $this->__($label) ?></option>
64
+ <?php endforeach; ?>
65
+ <?php if ($addditional_fee): ?>
66
+ <option value="<?php echo $addditional_fee['label_with_price'] ?>" <?php if ($arrival_default == $addditional_fee['label_with_price']) { ?> selected="selected" <?php } ?>><?php echo $addditional_fee['label_with_price'] ?></option>
67
+ <?php endif; ?>
68
+ </select>
69
+ <?php if ($count_arrival == 1 && isset($label)): ?>
70
+ <span><?php echo $this->__($label) ?></span><br/>
71
+ <?php endif; ?>
72
+ <?php endif; ?>
73
+
74
+ <?php $count_delivery = count($config['delivery']); ?>
75
+ <?php if ($count_delivery): ?>
76
+ <label for="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>><?php echo $this->__('Label delivery mailbox:') ?></label>
77
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery" <?php if (!(count($config['delivery']) > 1 || reset($config['delivery']) != 'Nearest pickuplocation')): ?>style="display: none;"<?php endif; ?>>
78
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
79
+ <?php if (is_array($label)): ?>
80
+ <optgroup label="<?php echo $value?>">
81
+ <?php foreach ($label as $j=>$k): ?>
82
+ <option value="<?php echo is_int($j)?$k:$j ?>" <?php if ($delivery_default == (is_int($j)?$k:$j)) { ?> selected="selected" <?php } ?>><?php echo $this->__($k) ?></option>
83
+ <?php endforeach; ?>
84
+ </optgroup>
85
+ <?php else: ?>
86
+ <option value="<?php echo $this->__($value); ?>" <?php if ($delivery_default == $this->__($value)) { ?> selected="selected" <?php } ?>><?php echo $this->__($label) ?></option>
87
+ <?php endif; ?>
88
+ <?php endforeach; ?>
89
+ </select>
90
+ <?php if ($count_delivery == 1 && isset($label)): ?>
91
+ <span><?php echo $this->__($label) ?></span>
92
+ <?php endif; ?>
93
+ <br/>
94
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"><?php echo $other_default; ?></textarea>
95
+ <?php endif; ?>
96
+ <?php if (count($config['delivery'])): ?>
97
+ <div class="nearest_point_container" style="display: none">
98
+ <span class="vc-label"><?php echo $this->__('Delivery types'); ?></span>
99
+ <span class="vc-value"></span>
100
+ </div>
101
+ <?php endif; ?>
102
+ </div>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/mailbox/tabScripts.phtml ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+ ?>
31
+
32
+ <script>
33
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
34
+
35
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
36
+ var aio_shipping_method_name = 'estimate_method';
37
+ <?php else: ?>
38
+ var aio_shipping_method_name = 'shipping_method';
39
+ <?php endif; ?>
40
+
41
+ jQuery(function($){
42
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
43
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
44
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
45
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
46
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
47
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
48
+
49
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
50
+ shipContryVal = '';
51
+ shipPostcodeVal = '';
52
+ shipStreetVal = '';
53
+ }
54
+
55
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
56
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
57
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
58
+
59
+ var html_nearest_point = '';
60
+
61
+ if ($('.nearest_point_container').length > 0) {
62
+ getPickupPoints(country_id,postcode,street,function (points) {
63
+ var nearest_point_monFriOpen = (typeof points[0].openingHours !== 'undefined')
64
+ ?points[0].openingHours[0].from1.insertString(2, 0, ":"):'';
65
+ var nearest_point_monFriClose = (typeof points[0].openingHours !== 'undefined')
66
+ ?points[0].openingHours[0].to1.insertString(2, 0, ":"):'';
67
+ var nearest_point_satOpen = (typeof points[0].openingHours !== 'undefined')
68
+ ?points[0].openingHours[points[0].openingHours.length-1].from1.insertString(2, 0, ":"):'';
69
+ var nearest_point_satClose = (typeof points[0].openingHours !== 'undefined')
70
+ ?points[0].openingHours[points[0].openingHours.length-1].to1.insertString(2, 0, ":"):'';
71
+
72
+ html_nearest_point = '<div class="aino-nearest-data">';
73
+ html_nearest_point += '<div class="aino-nearest-name">' +points[0].name + '</div>';
74
+ html_nearest_point += '<div class="aino-nearest-address">' + points[0].deliveryAddress.streetName + ', ' + points[0].deliveryAddress.streetNumber + '</div>';
75
+ html_nearest_point += '<div class="aino-work-hours">' +
76
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+nearest_point_monFriOpen +' - '+ nearest_point_monFriClose +'<br/>' +
77
+ '<?php echo $this->__('Sat'); ?>: '+nearest_point_satOpen +' - '+ nearest_point_satClose +
78
+ '</div>';
79
+ html_nearest_point += '</div>';
80
+ $('.nearest_point_container').show().find('.vc-value').html(html_nearest_point);
81
+ });
82
+ }
83
+
84
+ function getPickupPoints(country_id,postcode,street,callback)
85
+ {
86
+ var dataToSend = {
87
+ country_id : country_id,
88
+ postcode : postcode
89
+ };
90
+ if(street){
91
+ dataToSend.street = street;
92
+ }
93
+ $.ajax({
94
+ url : pointsEndpoint,
95
+ data : dataToSend
96
+ }).done(function (data) {
97
+
98
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
99
+ {
100
+ if( typeof data.postnord.message !== 'undefined'){
101
+ console.error(data.postnord.message);
102
+ }
103
+ return console.log('Pickup api\'s return unknown error');
104
+ }
105
+ var points = data.postnord.servicePointInformationResponse.servicePoints;
106
+
107
+ if(callback) {
108
+ callback(points);
109
+ }
110
+ });
111
+ }
112
+
113
+ $('select[name="<?php echo $this->getCode()?>_arrival"],select[name="<?php echo $this->getCode()?>_delivery"]').on('change',function(){
114
+ if (jQuery("input[name="+aio_shipping_method_name+"]:checked").length != 0 && jQuery("input[name="+aio_shipping_method_name+"]:checked").val().indexOf('vconnect_postnord_') != -1) {
115
+ var desc = '';
116
+ var otherText = '';
117
+
118
+ var arrival = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]');
119
+ if(arrival.length){
120
+ desc += ('' + arrival.val());
121
+ }
122
+
123
+ var delivery = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_delivery"]');
124
+ if(delivery.length){
125
+ desc += (' / ' + delivery.val());
126
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
127
+ var otherText = jQuery('textarea[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_other"]').val();
128
+ var escaped = jQuery('<div/>').text(otherText).html();
129
+ desc += (" - " + escaped);
130
+ }
131
+ }
132
+
133
+ var obj = {
134
+ code : jQuery("input[name="+aio_shipping_method_name+"]:checked").val(),
135
+ arrival : jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').length?jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').val():false,
136
+ delivery : delivery.length?delivery.val():false,
137
+ other : otherText,
138
+ flexdelivery : false,
139
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
140
+ description : desc
141
+ };
142
+
143
+ obj.environmental_fee = 0;
144
+ if (jQuery('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
145
+ obj.environmental_fee = 1;
146
+ }
147
+
148
+ jQuery('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
149
+ }
150
+
151
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
152
+ // Start fixer for KlarnaCheckout
153
+ $$('input:checked[name="estimate_method"]')[0].simulate('click');
154
+ // End fixer for KlarnaCheckout
155
+ <?php endif; ?>
156
+ });
157
+
158
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
159
+ });
160
+ </script>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/pickup/tabHeader.phtml ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+ ?>
31
+ <?php
32
+ $vconnectPostnordSessionData = array();
33
+ if (Mage::getSingleton('checkout/session')->hasVconnectPostnordSessionData()) {
34
+ $vconnectPostnordSessionData = Mage::getSingleton('checkout/session')->getVconnectPostnordSessionData();
35
+ }
36
+ ?>
37
+ <div data-code="<?php echo $this->getCode() ?>"class="aio-options">
38
+ <button class="button aio-pick-btn" type="button">
39
+ <?php echo $this->__('Pick a point') ?>
40
+ </button>
41
+ <input class="required-entry aio-hidden" name="vconnect_postnord_data" value='<?php echo ($vconnectPostnordSessionData ? json_encode($vconnectPostnordSessionData) : '') ?>' style="width: 1px; height: 1px; outline-width: 0px;">
42
+ <div class="postnord-description"></div>
43
+ </div>
44
+ <div class="all-in-one-container">
45
+ <div class="aio-container">
46
+ <div class="aino-container desktop">
47
+ <div class="aino-core">
48
+ <div class="aino-header cf">
49
+ <h1 class="postnord-logo">
50
+ <span><?php echo Mage::getStoreConfig('carriers/vconnect_postnord/title') ?></span>
51
+ </h1>
52
+
53
+ <div class="aino-weather cf">
54
+ <ul class="aino-nav">
55
+
56
+ </ul>
57
+ </div>
58
+ </div>
59
+ <div class="aino-tabs cf">
60
+ <ul class="aino-nav aino-deliver-to">
61
+ <li class="aino-office-tab ui-state-active" data-code="<?php echo $this->getCode() ?>" >
62
+ <a href="#post-office" class="cf pickup">
63
+ <span>
64
+ <?php echo $this->getMethodTitle() ?>
65
+ <div class="aino-delivery-price"><?php echo $this->getPriceFormated() ?></div>
66
+ </span>
67
+ </a>
68
+
69
+
70
+ <div class="tab-list aino-post-office cf aino-column" data-target="post-office">
71
+ <div class="aino-map-container">
72
+ <div class="aino-map"></div>
73
+ <div class="zipcode-holder">
74
+ <div class="post-code-input">
75
+ <label>
76
+ <?php echo $this->__('Skift postnumber') ?>
77
+ <input type="text"/>
78
+ </label>
79
+ <button type="button"><span></span></button>
80
+ </div>
81
+ <div class="directions-display-type">
82
+ <button role="DRIVING" type="button" class="aino-map-driving"><span></span></button>
83
+ <button role="WALKING" type="button" class="aino-map-walking"><span></span></button>
84
+ <button role="TRANSIT" type="button" class="aino-map-transit"><span></span></button>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ <div class="address-near-you">
89
+ <ul class="aino-nav">
90
+
91
+ </ul>
92
+ </div>
93
+ </div>
94
+
95
+ </li>
96
+ </ul>
97
+ </div>
98
+ <div class="aino-footer">
99
+ <div>
100
+ <button type="button" class="aino-button gray" role="close" >
101
+ <?php echo $this->__('Cancel') ?>
102
+ </button>
103
+ <button type="button" class="aino-button blue" role="submit">
104
+ <?php echo $this->__('OK') ?>
105
+ </button>
106
+ </div>
107
+ </div>
108
+ </div>
109
+
110
+ </div>
111
+ </div>
112
+ </div>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/pickup/tabScripts.phtml ADDED
@@ -0,0 +1,803 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+ $config = $this->getConfig();
32
+ ?>
33
+
34
+ <script>
35
+ window.pointsEndpoint = "<?php echo $this->getUrl('aio/index/index', array('_secure' => true))?>";
36
+ jQuery(function($){
37
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
38
+ });
39
+
40
+ </script>
41
+ <script type="text/javascript">
42
+ jQuery(function($){
43
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
44
+ var aio_shipping_method_name = 'estimate_method';
45
+ <?php else: ?>
46
+ var aio_shipping_method_name = 'shipping_method';
47
+ <?php endif; ?>
48
+
49
+ // $('button.aio-pick-btn').appendTo($("input[value*='vconnect_postnord_']").parent());
50
+ var btn = $('button.aio-pick-btn');
51
+ var submitBtn = $('.aino-button[role=submit]');
52
+ window.aio_opened = false;
53
+ //moving the pickup button to the outside container
54
+ var inputs = $("input[value*='vconnect_postnord_']");
55
+ var cont = inputs.closest('dd');
56
+
57
+ var descriptionField = $('.postnord-description');
58
+ var hiddenInput = $('input.aio-hidden');
59
+ if(hiddenInput.val() !== '' && hiddenInput.val()){
60
+ var data = JSON.parse(hiddenInput.val());
61
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(data)) ;
62
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
63
+ descriptionField.html(data.pointinfo);
64
+ } else {
65
+ descriptionField.text(data.description);
66
+ }
67
+ }
68
+
69
+ refreshControls();
70
+
71
+ $('.tab-list:first').addClass('active');
72
+ $('input[name='+aio_shipping_method_name+']').on('change',refreshControls);
73
+ $('.all-in-one-container').hide();
74
+ if($('body > .all-in-one-container').length < 1){
75
+ console.log('popup code moved to body');
76
+ $('.all-in-one-container').appendTo('body');
77
+ }else{
78
+ console.log('popup code raplaced');
79
+ $('body > .all-in-one-container').remove();
80
+ $('.all-in-one-container').appendTo('body');
81
+ // $('body > .all-in-one-container').replaceWith($('.wrapper .all-in-one-container'));
82
+ }
83
+ //close popup
84
+ $('.aino-footer button[role=close]').on('click', closePopup);
85
+
86
+ // $('.aino-deliver-to a').first().click(); //select first element
87
+ //init popup
88
+ initMobileCollapse();
89
+ setTabs();
90
+ setJQueryTabs();
91
+
92
+ btn.on('click',openPopup);
93
+
94
+ function refreshControls() {
95
+ var div = $('div[data-code=<?php echo $this->getCode() ?>]');
96
+ var cont = $("input[value='<?php echo $this->getCode() ?>']");
97
+ console.log(cont);
98
+ if(cont.is(':checked')){
99
+ div.show();
100
+ }else{
101
+ div.hide();
102
+ }
103
+ }
104
+ function initMobileCollapse(){
105
+ var collapseBtn = $('.aino-collapse');
106
+ collapseBtn.each(function(){
107
+ $(this).unbind('click');
108
+ $(this).on('click',function(){
109
+ var self = this;
110
+ $(self).next().animate({
111
+ height: "toggle"
112
+ }, 'fast', function(){
113
+ $(self).toggleClass('active');
114
+ var sibl = $(self).parent().siblings();
115
+ sibl.each(function(){
116
+ $(this).find('.aino-collapse-content').hide();
117
+ $(this).find('.aino-collapse').removeClass('active');
118
+ });
119
+ });
120
+ });
121
+ });
122
+ };
123
+ submitBtn.on('click',submit);
124
+ function submit()
125
+ {
126
+ var el = $('.aino-deliver-to li.ui-state-active');
127
+ $('.all-in-one-container').trigger('popup.submit.before',[]);
128
+
129
+ var event = 'submit_before_' + el.attr('data-code');
130
+ $('.all-in-one-container').trigger(event,[]);
131
+ console.info("Event trigger: " + event);
132
+ var data = el.data('shipping');
133
+ if(typeof data !== 'undefined'){
134
+ data.environmental_fee = 0;
135
+ if ($('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
136
+ data.environmental_fee = 1;
137
+ }
138
+
139
+ $('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(data)) ;
140
+ if (typeof data.pointinfo !== 'undefined' && data.pointinfo != '') {
141
+ $('div.postnord-description').html(data.pointinfo);
142
+ } else {
143
+ $('div.postnord-description').text(data.description);
144
+ }
145
+
146
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
147
+ // Start fixer for KlarnaCheckout
148
+ $$('input:checked[name="estimate_method"]')[0].simulate('click');
149
+ // End fixer for KlarnaCheckout
150
+ <?php endif; ?>
151
+ }
152
+
153
+ $('.all-in-one-container').trigger('popup.submit.after',[]);
154
+
155
+
156
+ refreshControls();
157
+ closePopup();
158
+ }
159
+ function openPopup(){
160
+
161
+ console.log('openPopup');
162
+ var cont = $('.all-in-one-container');
163
+ cont.trigger({
164
+ type : 'popup.open.before'
165
+ });
166
+ // if($('body > .all-in-one-container').length !== 1){
167
+ // console.log('appending popup markup to body');
168
+ // $('.all-in-one-container').appendTo('body');
169
+ // }
170
+ if ($('.aino-cover').length === 0) {
171
+ $('<div/>').addClass('aino-cover').appendTo('body');
172
+ }
173
+ $('.aino-container').addClass('opened');
174
+ $('.all-in-one-container').show();
175
+ var popup = $('div.aio-container').addClass('opened').show();
176
+ $('.aino-container').removeClass('opened');
177
+
178
+ popup.find('.aino-container.desktop').addClass('opened').show();
179
+
180
+ $('.all-in-one-container').trigger({
181
+ type : 'popup.open.after'
182
+ });
183
+ window.aio_opened = true;
184
+ var cont = $('.all-in-one-container');
185
+ var el = $('.aino-deliver-to .ui-state-active');
186
+ var evName = 'tab_visible_' + el.attr('data-code');
187
+ cont.trigger(evName,[]);
188
+ console.info('-- trigered tab.visible for ' + evName);
189
+
190
+ }
191
+ function closePopup()
192
+ {
193
+ $('.all-in-one-container').trigger({
194
+ type : 'popup.close.before'
195
+ });
196
+ $('.aino-cover').remove();
197
+ $('.aino-container').removeClass('opened').hide();
198
+ $('.all-in-one-container').hide();
199
+ $('.all-in-one-container').trigger({
200
+ type : 'popup.close.after'
201
+ });
202
+ window.aio_opened = false;
203
+ }
204
+
205
+ function setTabs(){
206
+ var tabs = $('.aino-inner-tabs');
207
+ tabs.each(function(){
208
+ var self = $(this), target ;
209
+ var btn = $('a[role=tab]',self);
210
+ btn.each(function(){
211
+ var that = $(this);
212
+
213
+
214
+
215
+ that.unbind('click').on('click', function(){
216
+ $('.aino-deliver-to .delivery-context').removeClass('active') ;
217
+ target = that.attr('href');
218
+ target = target.substr(1);
219
+ $('.tab-list:not([data-target='+target+'])',tabs).hide();
220
+ var col2 = tabs.find('[data-target='+target+']');
221
+
222
+ if(self.find('[data-target='+target+']').css('display') === 'none'){
223
+ col2.parent().siblings('li').removeClass('active');
224
+ col2.show().addClass('active');
225
+ col2.parent().addClass('active');
226
+ that.parent('li').addClass('active');
227
+ that.parent('li').siblings().removeClass('active');
228
+ }
229
+ else{
230
+ col2.parent().siblings('ul').addClass('active');
231
+ col2.hide().removeClass('active');
232
+ col2.parent().removeClass('active');
233
+ that.parent('li').removeClass('active');
234
+ }
235
+ col2.closest('.aio-nav').siblings().hide().removeClass('active');
236
+ });
237
+ });
238
+
239
+ var close = $(this).find('.close');
240
+ close.each(function(){
241
+ $(this).on('click', function(){
242
+ setDeactive(self,target);
243
+ btn.parent('li').removeClass('active');
244
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
245
+ });
246
+ });
247
+
248
+ var closeInner = self.find('.close-inner');
249
+ closeInner.each(function(){
250
+ $(this).on('click', function(){
251
+ $(this).closest('.delivery-time').hide();
252
+ $(this).closest('.delivery-time')
253
+ .siblings('.aino-calendar-holder')
254
+ .find('.toggle-calendar').hide();
255
+ $(this).closest('.delivery-time')
256
+ .siblings('.aino-calendar-holder')
257
+ .find('.aino-calendar').removeClass('hidden');
258
+ });
259
+ });
260
+ });
261
+
262
+
263
+ }
264
+ function setActive(tabs ,ele, target){
265
+ $(tabs).find('[data-target='+target+']').parent().siblings('li').removeClass('active');
266
+ $(tabs).find('[data-target='+target+']').show().addClass('active');
267
+ $(tabs).find('[data-target='+target+']').parent().addClass('active');
268
+ $(ele).parent('li').addClass('active');
269
+ $(ele).parent('li').siblings().removeClass('active');
270
+ }
271
+
272
+ function setDeactive(tabs,target){
273
+ $(tabs).find('[data-target='+target+']').parent().siblings('ul').addClass('active');
274
+ $(tabs).find('[data-target='+target+']').hide().removeClass('active');
275
+ $(tabs).find('[data-target='+target+']').parent().removeClass('active');
276
+ }
277
+ function setJQueryTabs(){
278
+ /*
279
+ events for switching the outer tabs (buttons on the left)
280
+ set active tab, show child, and set the others tabs to unactive
281
+ */
282
+ $('.aino-deliver-to > li > a').on('click', function(){
283
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
284
+ $('.tab-list.aino-column-2').removeClass('active').hide();
285
+ $('.tab-list.aino-column').removeClass('active');
286
+ $('.aino-inner-tabs > ul li').removeClass('active');
287
+ var el = $(this).parent();
288
+ el.addClass('ui-state-active');
289
+ el.siblings().removeClass('ui-state-active');
290
+ $('.aino-deliver-to .tab-list.aino-column').hide().removeClass('active');
291
+ var activeTab = el.find('.tab-list.aino-column');
292
+
293
+ el.trigger({
294
+ type : 'tab.click',
295
+ tab : activeTab
296
+ });
297
+ activeTab.show().addClass('active');
298
+
299
+ if(aio_opened){
300
+ var cont = $('.all-in-one-container');
301
+ var evName = 'tab_visible_' + el.attr('data-code');
302
+ cont.trigger(evName,[]);
303
+ console.info('++ trigered tab.visible for ' + evName);
304
+ }
305
+
306
+ });
307
+ }
308
+
309
+
310
+
311
+ });
312
+ </script>
313
+ <?php echo $this->getChildHtml('body_scripts') ?>
314
+ <script>
315
+ jQuery(function($){
316
+
317
+ var radios = $('input[type=radio][name=delivery]');
318
+
319
+ radios.unbind('change');
320
+ radios.on('change',function(){
321
+ var closest = $(this).closest('.aino-inner-tabs');
322
+ var el = $('.aino-textarea-holder',closest);
323
+ if($(this).val() == '<?php echo Mage::helper('vc_aio')->__('Other place'); ?>' || $(this).val() == 'Utan kvittens (paketet ställs utanför dörren)'){
324
+ el.show();
325
+ }else{
326
+ el.hide();
327
+ }
328
+ });
329
+
330
+ var liEls = $('.column-2 .aino-nav > li:not(.aino-sub-nav)');
331
+ liEls.unbind('click');
332
+ liEls.on('click',function(){
333
+ var self = $(this);
334
+
335
+ var tabDiv = self.closest('.tab-list.active');
336
+ var elsToUncheck = $('input',tabDiv) ;
337
+ $('.aino-deliver-to .delivery-context').addClass('active') ;
338
+
339
+ elsToUncheck.prop('checked',false).attr('checked',false);
340
+ // self.closest('.tab-list.active input[chekced]').prop('checked',false).attr('checked',false);
341
+
342
+ // console.log($(this).find('label input').val());
343
+ self.closest('.tab-list.active.column-2').hide().find('li').removeClass('active');
344
+ // self.closest('.aino-nav').find('li').removeClass('active');
345
+ self.addClass('active');
346
+
347
+ $('input[type=radio]',self).prop('checked',true).attr('checked',true).trigger('change');
348
+ var parentTarget = self.parents('.column-2').attr('data-target');
349
+
350
+ if(self.find('.aino-nav').length != 0 ){
351
+ self.unbind('click');
352
+ }
353
+
354
+
355
+ self.closest('.aino-inner-tabs').find("[href=#"+parentTarget+"] span").html(self.find('label .label-text').html());
356
+
357
+ });
358
+ $('.aino-deliver-to > li > a').first().click();
359
+
360
+
361
+
362
+
363
+
364
+ });
365
+ </script>
366
+ <script>
367
+ jQuery(function($){
368
+ String.prototype.insertString = function(start, delCount, newSubStr) {
369
+ return this.slice(0, start) + newSubStr + this.slice(start + Math.abs(delCount));
370
+ };
371
+
372
+ var called = false,labels = [],bounds,markers = [],directionsDisplay,aio_points = [];
373
+
374
+ $('.all-in-one-container').on('tab_visible_<?php echo $this->getCode()?>',function(){
375
+
376
+ if(called){
377
+ return;
378
+ }
379
+ called = true;
380
+ bootstrap(function(){
381
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
382
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
383
+ var shipStreetVal = $('input[name="shipping[street][]"]:first').val();
384
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
385
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
386
+ var billStreetVal = $('input[name="billing[street][]"]:first').val();
387
+
388
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
389
+ if ($('select[name="country_id"]').length > 0 && $('input[name="estimate_postcode"]').length > 0) {
390
+ var shipContryVal = $('select[name="country_id"]:last').val();
391
+ var shipPostcodeVal = $('input[name="estimate_postcode"]:last').val();
392
+ }
393
+ <?php endif; ?>
394
+
395
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
396
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
397
+ var street = (shipStreetVal !== '')?shipStreetVal:billStreetVal;
398
+
399
+ if (country_id != '' && postcode == '') {
400
+ if (country_id == 'SE') {
401
+ postcode = '10044';
402
+ } else if (country_id == 'FI') {
403
+ postcode = '00100';
404
+ } else if (country_id == 'NO') {
405
+ postcode = '0107';
406
+ } else if (country_id == 'DK') {
407
+ postcode = '1000';
408
+ }
409
+ }
410
+
411
+ var map = initMap();
412
+ window.map = map;
413
+ $('.post-code-input input').val(postcode);
414
+ $('.post-code-input button').on('click',function(){
415
+ console.log('button clicked');
416
+ getPickupPoints(country_id,$('.post-code-input input').val(),null,function(points){
417
+ setMapContent(map,points,false);
418
+ },false);
419
+ });
420
+ getPickupPoints(country_id,postcode,street,function(points){
421
+ setMapContent(map,points,true);
422
+ },true);
423
+ });
424
+
425
+
426
+
427
+ });
428
+ $('.all-in-one-container').on('tab.visible',function(target,el){
429
+ console.log('.post-office 1');
430
+ });
431
+ // $('.aino-tabs-body').on('tab.opened.post-office',function(){
432
+ //
433
+ //
434
+ // });
435
+
436
+
437
+ function initMap()
438
+ {
439
+ // Create a map object and specify the DOM element for display.
440
+ $('.aino-weather').hide();
441
+ var center = { lat:58.663585, lng:15.307749 } ;
442
+ var zoom = 5;
443
+ if(typeof current_loc !== 'undefined'){
444
+ center = current_loc;
445
+ zoom = 8;
446
+ }
447
+ window.map = new google.maps.Map($('.aino-map:last')[0], {
448
+ scrollwheel : true,
449
+ zoom : zoom,
450
+ mapTypeId : google.maps.MapTypeId.ROADMAP,
451
+ zoomControl : true,
452
+ center : center
453
+ });
454
+ google.maps.event.addListenerOnce(map, 'idle', function(){
455
+ google.maps.event.trigger(map, 'resize');
456
+ });
457
+ $(window).resize(function() {
458
+ google.maps.event.trigger(map, 'resize');
459
+ });
460
+
461
+
462
+
463
+ return map;
464
+
465
+ }
466
+ function showDirections(map, origin, destination, type){
467
+ if(directionsDisplay != null) {
468
+ directionsDisplay.setMap(null);
469
+ directionsDisplay = null;
470
+ }
471
+
472
+ directionsDisplay = new google.maps.DirectionsRenderer({
473
+ map: map,
474
+ suppressMarkers: true
475
+ });
476
+
477
+
478
+ // Set destination, origin and travel mode.
479
+ var request = {
480
+ destination: destination,
481
+ origin: origin,
482
+ travelMode: google.maps.TravelMode[type]
483
+ };
484
+
485
+
486
+ // Pass the directions request to the directions service.
487
+ var directionsService = new google.maps.DirectionsService();
488
+ directionsService.route(request, function(response, status) {
489
+ if (status == google.maps.DirectionsStatus.OK) {
490
+ // Display the route on the map.
491
+ directionsDisplay.setDirections(response);
492
+ }
493
+
494
+ google.maps.event.addListenerOnce(map, 'zoom_changed', function() {
495
+ var oldZoom = map.getZoom();
496
+
497
+ if(oldZoom > 14){
498
+ map.setZoom(oldZoom - 1);
499
+ }
500
+ else{
501
+ map.setZoom(oldZoom);
502
+ }
503
+ });
504
+ });
505
+
506
+ return directionsDisplay;
507
+ }
508
+ function getPickupPoints(country_id,postcode,street,callback,shouldGoecode)
509
+ {
510
+ console.log('getPickupPoints called');
511
+
512
+ try{
513
+ delete window.current_loc;
514
+ }catch(e){}
515
+
516
+ if(street && shouldGoecode){
517
+ var geocoder = new google.maps.Geocoder();
518
+ geocoder.geocode({
519
+ address: street + ',' + postcode + ',' + country_id
520
+ }, function(results, status) {
521
+ if (status == google.maps.GeocoderStatus.OK) {
522
+ $.each( results, function( i, v ) {
523
+ if(typeof v.partial_match === 'undefined' || !v.partial_match){
524
+ window.current_loc = v.geometry.location;
525
+ }
526
+ });
527
+ }
528
+ });
529
+ }
530
+ var dataToSend = {
531
+ country_id : country_id,
532
+ postcode : postcode
533
+ };
534
+ if(street){
535
+ dataToSend.street = street;
536
+ }
537
+ $.ajax({
538
+ url : pointsEndpoint,
539
+ data : dataToSend
540
+ }).done(function (data) {
541
+
542
+ if( typeof data.postnord.servicePointInformationResponse === 'undefined')
543
+ {
544
+ if( typeof data.postnord.message !== 'undefined'){
545
+ console.error(data.postnord.message);
546
+ }
547
+ return console.log('Pickup api\'s return unknown error');
548
+ }
549
+ aio_points = data.postnord.servicePointInformationResponse.servicePoints;
550
+ if(callback) {
551
+ callback(aio_points);
552
+ }
553
+ });
554
+ }
555
+
556
+
557
+
558
+ function setMapContent(map,points,direction)
559
+ {
560
+ labels = [];
561
+
562
+ $.each( markers, function( i, v ) {
563
+ v.setMap(null);
564
+ });
565
+
566
+ markers = [];
567
+
568
+ bounds = new google.maps.LatLngBounds();
569
+ var container = $('.address-near-you .aino-nav').empty();
570
+ var x = 1;
571
+ var image = {
572
+ url: '<?php echo $this->getSkinUrl('images/vconnect/aio/temp.png') ?>',
573
+ size: new google.maps.Size(20, 40)
574
+ };
575
+ points.sort(function(a,b){
576
+ return a.routeDistance - b.routeDistance;
577
+ });
578
+ locations = [];
579
+
580
+ $.each( points, function( i, v ) {
581
+ var location = new google.maps.LatLng(v.coordinate.northing, v.coordinate.easting);
582
+ locations.push(location);
583
+ labels.push(makeMarkerLabel(v));
584
+ var marker = new MarkerWithLabel({
585
+ map: map,
586
+ icon: image,
587
+ zIndex: i,
588
+ labelContent: (x).toString(),
589
+ labelClass: "aino-label",
590
+ labelAnchor: new google.maps.Point(14, 46),
591
+ position: location,
592
+ labelStyle: {'display': 'block', height:'50px'}
593
+ });
594
+ markers.push(marker);
595
+ marker.addListener('click', function () {
596
+ setActiveMapComponent(map,marker,true,direction);
597
+ });
598
+ var listItem = $('<li></li>').on('click',function(){
599
+ setActiveMapComponent(map,marker,false,direction);
600
+ });
601
+ var distanceElement = $('<div class="aino-distance"><span></span></div>');
602
+ distanceElement.find('span').text((v.routeDistance/1000).toFixed(1) + ' km');
603
+
604
+ // openingHours
605
+ v_html_pickup_point = '';
606
+ v_pickup_point_monFriOpen = (typeof v.openingHours !== 'undefined')
607
+ ?v.openingHours[0].from1.insertString(2, 0, ":"):'';
608
+ v_pickup_point_monFriClose = (typeof v.openingHours !== 'undefined')
609
+ ?v.openingHours[0].to1.insertString(2, 0, ":"):'';
610
+ v_pickup_point_satOpen = (typeof v.openingHours !== 'undefined')
611
+ ?v.openingHours[v.openingHours.length-1].from1.insertString(2, 0, ":"):'';
612
+ v_pickup_point_satClose = (typeof v.openingHours !== 'undefined')
613
+ ?v.openingHours[v.openingHours.length-1].to1.insertString(2, 0, ":"):'';
614
+
615
+ if (v_pickup_point_monFriOpen || v_pickup_point_monFriClose) {
616
+ v_html_pickup_point = '<div class="aino-open-hours">' +
617
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_monFriOpen +' - '+ v_pickup_point_monFriClose +'<br/>' +'</div>';
618
+ } else if (v_pickup_point_satOpen || v_pickup_point_satClose) {
619
+ v_html_pickup_point = '<div class="aino-open-hours">' +
620
+ '<?php echo $this->__('Open hours:'); ?> ' + v_pickup_point_satOpen +' - '+ v_pickup_point_satClose +'</div>';
621
+ }
622
+
623
+ var addressItem = $('<div class="cf"></div>')
624
+
625
+ .append(distanceElement)
626
+ .append($('<div class="aino-index">' + x + '</div>'))
627
+ .append($('<div class="aino-title">' + v.name + '</div>'))
628
+ .append(
629
+ $('<div class="aino-address">' + v.deliveryAddress.streetName + ' ' + v.deliveryAddress.streetNumber + '<br />' + v.deliveryAddress.postalCode + ' ' +v.deliveryAddress.city + ' </div>')
630
+ )
631
+ .append(v_html_pickup_point)
632
+ ;
633
+
634
+
635
+
636
+
637
+ var shell = $('<div class="cf"></div>');
638
+ shell.append($('<label class="aino-input aino-checkbox"></label>')
639
+ .append($('<input type="radio" name="delivery" value="">'))
640
+ .append($('<span class="aino-indicator"></span>'))
641
+ .append(addressItem)
642
+ );
643
+ shell.appendTo(listItem.appendTo(container));
644
+
645
+
646
+
647
+
648
+ bounds.extend(location);
649
+ x++;
650
+ });
651
+
652
+ map.fitBounds(bounds);
653
+ }
654
+
655
+ function setActiveMapComponent(map, marker, scroll,direction){
656
+ var iwIndex = parseInt(marker.get('labelContent')) - 1;
657
+ var selectedPoint = aio_points[iwIndex];
658
+
659
+ pickup_point_monFriOpen = (typeof selectedPoint.openingHours !== 'undefined')
660
+ ?selectedPoint.openingHours[0].from1.insertString(2, 0, ":"):'';
661
+ pickup_point_monFriClose = (typeof selectedPoint.openingHours !== 'undefined')
662
+ ?selectedPoint.openingHours[0].to1.insertString(2, 0, ":"):'';
663
+ pickup_point_satOpen = (typeof selectedPoint.openingHours !== 'undefined')
664
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].from1.insertString(2, 0, ":"):'';
665
+ pickup_point_satClose = (typeof selectedPoint.openingHours !== 'undefined')
666
+ ?selectedPoint.openingHours[selectedPoint.openingHours.length-1].to1.insertString(2, 0, ":"):'';
667
+
668
+ html_pickup_point = '';
669
+
670
+ <?php if(!empty($config['delivery_time'])): ?>
671
+ html_pickup_point += '<b><?php echo $this->__("Label arrival time pickup:") ?></b><br /><?php echo $config['delivery_time']; ?> <br /><b><?php echo $this->__("Label delivery pickup:") ?></b><br/>';
672
+ <?php endif;?>
673
+
674
+ html_pickup_point += '<div class="aino-pickup-name">' +selectedPoint.name + '</div>';
675
+ html_pickup_point += '<div class="aino-pickup-address">' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + '</div>';
676
+ html_pickup_point += '<div class="aino-work-hours">' +
677
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+pickup_point_monFriOpen +' - '+ pickup_point_monFriClose +'<br/>' +
678
+ '<?php echo $this->__('Sat'); ?>: '+pickup_point_satOpen +' - '+ pickup_point_satClose +
679
+ '</div>';
680
+
681
+ var data = {
682
+ code : $('.aino-office-tab').attr('data-code'),
683
+ data : selectedPoint,
684
+ carrier : '<?php echo $this->getCarrierTitle()?>',
685
+ description : selectedPoint.name + ' - ' + selectedPoint.deliveryAddress.streetName + ', ' + selectedPoint.deliveryAddress.streetNumber + ' - ' + selectedPoint.deliveryAddress.postalCode + ' - ID:' + selectedPoint.servicePointId,
686
+ pointinfo : html_pickup_point,
687
+ };
688
+ $('.aino-office-tab').data('shipping',data);
689
+ var addresses = $('.address-near-you li');
690
+ $.each( markers, function( i, v ) {
691
+ v.set('zIndex',i );
692
+ v.set('labelClass', "aino-label");
693
+ });
694
+
695
+ marker.set('zIndex', markers.length +1 );
696
+ marker.set('labelClass', "aino-label active");
697
+
698
+ $.each( labels, function( i, v ) {
699
+ v.close();
700
+ });
701
+
702
+ labels[iwIndex].open(map, marker);
703
+
704
+ $(addresses[iwIndex]).siblings('li').removeClass('active');
705
+ $(addresses[iwIndex]).addClass('active');
706
+ if(scroll){
707
+ var scrollEl = addresses.parent().parent();
708
+ var scrollAmount = $(addresses[iwIndex]).offset().top - scrollEl.offset().top + scrollEl.scrollTop();
709
+ scrollEl.animate({
710
+ scrollTop: scrollAmount
711
+ },200);
712
+ }
713
+
714
+ if( typeof current_loc !== 'undefined' && direction ){
715
+ showDirections(map,current_loc,marker.get('position'),'DRIVING');
716
+ $('.aino-map-container .directions-display-type > button').each(function(){
717
+ $(this).unbind('click').on('click', function(){
718
+ var type = $(this).attr('role');
719
+ showDirections(map,current_loc,marker.get('position'), type);
720
+ });
721
+ });
722
+ }else{
723
+ map.fitBounds(bounds);
724
+ }
725
+ }
726
+
727
+ function makeMarkerLabel(item){
728
+
729
+ var monFriOpen = (typeof item.openingHours !== 'undefined')
730
+ ?item.openingHours[0].from1.insertString(2, 0, ":"):'';
731
+ var monFriClose = (typeof item.openingHours !== 'undefined')
732
+ ?item.openingHours[0].to1.insertString(2, 0, ":"):'';
733
+ var satOpen = (typeof item.openingHours !== 'undefined')
734
+ ?item.openingHours[item.openingHours.length-1].from1.insertString(2, 0, ":"):'';
735
+ var satClose = (typeof item.openingHours !== 'undefined')
736
+ ?item.openingHours[item.openingHours.length-1].to1.insertString(2, 0, ":"):'';
737
+
738
+ var shippingMethodLogo = '<?php echo $this->getSkinUrl('images/vconnect/aio/aino-postnord-logo.png'); ?>';
739
+
740
+ return new google.maps.InfoWindow({
741
+ content:
742
+ '<div class="aino-info-window">' +
743
+ '<div>' +
744
+ '<span><?php echo $this->__('Opening hours'); ?></span>' +
745
+ '<img src="'+shippingMethodLogo+'" alt="">' +
746
+ '</div>' +
747
+ '<div class="aino-work-hours">' +
748
+ '<?php echo $this->__('Mon'); ?>-<?php echo $this->__('Fri'); ?>: '+monFriOpen +' - '+ monFriClose +'<br/>' +
749
+ '<?php echo $this->__('Sat'); ?>: '+satOpen +' - '+ satClose +
750
+ '</div>' +
751
+ '</div>'
752
+ });
753
+ }
754
+
755
+ function bootstrap(callback) {
756
+ if (document.head === undefined && document.getElementsByTagName('head').length > 0) {
757
+ head_element = document.getElementsByTagName('head')[0];
758
+ } else {
759
+ head_element = document.head;
760
+ }
761
+
762
+ google_load_script = function() {
763
+ var script6 = document.createElement('script');
764
+ script6.type = 'text/javascript';
765
+ script6.src = "<?php echo $this->getSkinUrl('js/vconnect/aio/markerwithlabel.js') ?>";
766
+
767
+ // bind the event to the callback function (callback)
768
+ if(script6.addEventListener) {
769
+ script6.addEventListener("load", callback, false); // IE9+, Chrome, Firefox
770
+ } else if(script6.readyState) {
771
+ script6.onreadystatechange = callback; // IE8
772
+ }
773
+
774
+ head_element.appendChild(script6);
775
+ };
776
+
777
+ if (typeof google === 'object' && typeof google.maps === 'object') {
778
+ console.info('google maps is already here');
779
+ google_load_script();
780
+ } else {
781
+ <?php
782
+ $key = Mage::getStoreConfig('carriers/vconnect_postnord_pickup/google_maps_api_key');
783
+ if($key){
784
+ $key = ('&key=' . $key);
785
+ }
786
+ ?>
787
+
788
+ var script5 = document.createElement('script');
789
+ script5.type = 'text/javascript';
790
+ script5.src = "//maps.googleapis.com/maps/api/js?libraries=geometry<?php echo $key; ?>" ;
791
+
792
+ // bind the event to the callback function (google_load_script)
793
+ if(script5.addEventListener) {
794
+ script5.addEventListener("load", google_load_script, false); // IE9+, Chrome, Firefox
795
+ } else if(script5.readyState) {
796
+ script5.onreadystatechange = google_load_script; // IE8
797
+ }
798
+
799
+ head_element.appendChild(script5);
800
+ }
801
+ }
802
+ });
803
+ </script>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/private/tabHeader.phtml ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio_base/dk/home/tabHeader.phtml
29
+ */
30
+ ?>
31
+
32
+ <?php
33
+ $config = $this->getConfig();
34
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
35
+
36
+ $vconnectPostnordSessionData = array();
37
+ if (Mage::getSingleton('checkout/session')->hasVconnectPostnordSessionData()) {
38
+ $vconnectPostnordSessionData = Mage::getSingleton('checkout/session')->getVconnectPostnordSessionData();
39
+ }
40
+
41
+ $arrival_default = '';
42
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['arrival']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
43
+ $arrival_default = $vconnectPostnordSessionData['arrival'];
44
+ }
45
+
46
+ $delivery_default = '';
47
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['delivery']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
48
+ $delivery_default = $vconnectPostnordSessionData['delivery'];
49
+ }
50
+
51
+ $other_default = '';
52
+ if (!empty($vconnectPostnordSessionData['code']) && !empty($vconnectPostnordSessionData['other']) && $vconnectPostnordSessionData['code'] == $this->getCode()) {
53
+ $other_default = $vconnectPostnordSessionData['other'];
54
+ }
55
+ ?>
56
+
57
+ <div data-code="<?php echo $this->getCode() ?>" class="aio-options">
58
+ <?php if(!empty($config['delivery_time'])): ?>
59
+ <label for="<?php echo $this->getCode() ?>_deliverytime"><?php echo $this->__("Label arrival time private:") ?></label><br /><?php echo $config['delivery_time']; ?><br />
60
+ <?php endif;?>
61
+
62
+ <?php $count_arrival = count($config['arrival']) + ($additional_fee ? 1 : 0); ?>
63
+ <?php if ($count_arrival): ?>
64
+ <label for="<?php echo $this->getCode() ?>_arrival"><?php echo $this->__('Label arrival private:') ?></label>
65
+ <select style="<?php if ($count_arrival == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_arrival" name="<?php echo $this->getCode() ?>_arrival">
66
+ <?php foreach ($config['arrival'] as $value => $label) : ?>
67
+ <option value="<?php echo $value ?>" <?php if ($arrival_default == $value) { ?> selected="selected" <?php } ?>><?php echo $this->__($label) ?></option>
68
+ <?php endforeach; ?>
69
+ <?php if ($additional_fee): ?>
70
+ <option style="display: none;" id="<?php echo $this->getCode() ?>_additional_fee_element" value="<?php echo $additional_fee['label_with_price'] ?>" <?php if ($arrival_default == $additional_fee['label_with_price']) { ?> selected="selected" <?php } ?>><?php echo $additional_fee['label_with_price'] ?></option>
71
+ <?php endif; ?>
72
+ </select>
73
+ <?php if ($count_arrival == 1 && isset($label)): ?>
74
+ <span><?php echo $this->__($label) ?></span><br/>
75
+ <?php endif; ?>
76
+ <?php endif; ?>
77
+
78
+ <?php $count_delivery = count($config['delivery']); ?>
79
+ <?php if ($count_delivery): ?>
80
+ <label for="<?php echo $this->getCode() ?>_delivery"><?php echo $this->__('Delivery type') ?></label>
81
+ <select style="<?php if ($count_delivery == 1): ?> display: none; <?php endif; ?>" id="<?php echo $this->getCode() ?>_delivery" name="<?php echo $this->getCode() ?>_delivery">
82
+ <?php foreach ($config['delivery'] as $value => $label) : ?>
83
+ <?php if (is_array($label)): ?>
84
+ <optgroup label="<?php echo $value?>">
85
+ <?php foreach ($label as $j=>$k): ?>
86
+ <option value="<?php echo is_int($j)?$k:$j ?>" <?php if ($delivery_default == (is_int($j)?$k:$j)) { ?> selected="selected" <?php } ?>><?php echo $this->__($k) ?></option>
87
+ <?php endforeach; ?>
88
+ </optgroup>
89
+ <?php else: ?>
90
+ <option value="<?php echo $this->__($value); ?>" <?php if ($delivery_default == $this->__($value)) { ?> selected="selected" <?php } ?>><?php echo $this->__($label) ?></option>
91
+ <?php endif; ?>
92
+ <?php endforeach; ?>
93
+ </select>
94
+ <?php if ($count_delivery == 1 && isset($label)): ?>
95
+ <span><?php echo $this->__($label) ?></span>
96
+ <?php endif; ?>
97
+ <br/>
98
+ <textarea name="<?php echo $this->getCode() ?>_other" class="other-txt" placeholder="<?php echo $this->__('Write place') ?>"><?php echo $other_default; ?></textarea>
99
+ <?php endif; ?>
100
+ </div>
app/design/frontend/base/default/template/vconnect/klarnacheckout/aio_base/private/tabScripts.phtml ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * The MIT License
4
+ *
5
+ * Copyright 2016 vConnect.dk
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ * @category Magento
25
+ * @package Vconnect_AllInOne
26
+ * @author vConnect
27
+ * @email kontakt@vconnect.dk
28
+ * @template app/design/frontend/base/default/template/vconnect/aio/dk/home/scripts.phtml
29
+ */
30
+
31
+
32
+ $config = $this->getConfig();
33
+ $additional_fee = Mage::helper('vc_aio')->getAdditionalFeeData($config['system_path']);
34
+ ?>
35
+
36
+ <?php if ($additional_fee): ?>
37
+ <script>
38
+ window.transitInformation = "<?php echo $this->getUrl('aio/index/transitInformation', array('_secure' => true))?>";
39
+ </script>
40
+ <?php endif; ?>
41
+
42
+ <script>
43
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
44
+ var aio_shipping_method_name = 'estimate_method';
45
+ <?php else: ?>
46
+ var aio_shipping_method_name = 'shipping_method';
47
+ <?php endif; ?>
48
+
49
+ jQuery(document).ready(function($){
50
+ $('select[name="<?php echo $this->getCode()?>_arrival"],select[name="<?php echo $this->getCode()?>_delivery"],textarea[name="<?php echo $this->getCode()?>_other"]').on('change',function(){
51
+ if (jQuery("input[name="+aio_shipping_method_name+"]:checked").length != 0 && jQuery("input[name="+aio_shipping_method_name+"]:checked").val().indexOf('vconnect_postnord_') != -1) {
52
+ var desc = '';
53
+ var otherText = '';
54
+
55
+ var arrival = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]');
56
+ if(arrival.length){
57
+ desc += ('' + arrival.val());
58
+ }
59
+
60
+ var delivery = jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_delivery"]');
61
+ if(delivery.length){
62
+ desc += (' / ' + delivery.val());
63
+ if(delivery.val() == "<?php echo Mage::helper('vc_aio')->__('Other place'); ?>" || delivery.val() == 'Utan kvittens (paketet ställs utanför dörren)'){
64
+ var otherText = jQuery('textarea[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_other"]').val();
65
+ var escaped = jQuery('<div/>').text(otherText).html();
66
+ desc += (" - " + escaped);
67
+ }
68
+ }
69
+
70
+ var obj = {
71
+ code : jQuery("input[name="+aio_shipping_method_name+"]:checked").val(),
72
+ arrival : jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').length?jQuery('select[name="'+jQuery("input[name="+aio_shipping_method_name+"]:checked").val()+'_arrival"]').val():false,
73
+ delivery : delivery.length?delivery.val():false,
74
+ other : otherText,
75
+ flexdelivery : false,
76
+ carrier : '<?php echo $this->escapeHtml($this->getCarrierTitle())?>',
77
+ description : desc
78
+ };
79
+
80
+ obj.environmental_fee = 0;
81
+ if (jQuery('[name="vconnect_postnord_environmental_fee"]:checked').length != 0) {
82
+ obj.environmental_fee = 1;
83
+ }
84
+
85
+ jQuery('input[name=payment_ain_vconnect_postnord_data]').val(JSON.stringify(obj));
86
+ }
87
+
88
+ <?php if (Mage::app()->getRequest()->getControllerModule() == 'Avenla_KlarnaCheckout'): ?>
89
+ // Start fixer for KlarnaCheckout
90
+ $$('input:checked[name="estimate_method"]')[0].simulate('click');
91
+ // End fixer for KlarnaCheckout
92
+ <?php endif; ?>
93
+ });
94
+
95
+ var shipContryVal = $('select[name="shipping[country_id]"]:last').val();
96
+ var shipPostcodeVal = $('input[name="shipping[postcode]"]:last').val();
97
+ var billContryVal = $('select[name="billing[country_id]"]:last').val();
98
+ var billPostcodeVal = $('input[name="billing[postcode]"]:last').val();
99
+
100
+ if (($('#onestepcheckout-form').length > 0 || $('.opc-wrapper-opc').length > 0) && $('input[name="billing[use_for_shipping]"]').length > 0 && $('input[name="billing[use_for_shipping]"]').is(':checked')) {
101
+ shipContryVal = '';
102
+ shipPostcodeVal = '';
103
+ }
104
+
105
+ var country_id = (shipContryVal !== '')?shipContryVal:billContryVal;
106
+ var postcode = (shipPostcodeVal !== '')?shipPostcodeVal:billPostcodeVal;
107
+
108
+ <?php if ($additional_fee): ?>
109
+ if (country_id && postcode && $('select[name="<?php echo $this->getCode()?>_arrival"]').length != 0) {
110
+ getTransitInformation(country_id, postcode);
111
+ }
112
+
113
+ function getTransitInformation(country_id, postcode)
114
+ {
115
+ console.log('getTransitInformation called');
116
+
117
+ var dataToSend = {
118
+ country_id : country_id,
119
+ postcode : postcode,
120
+ service_code : 32
121
+ };
122
+
123
+ var eveningDelivery = false;
124
+
125
+ $.ajax({
126
+ url : transitInformation,
127
+ data : dataToSend
128
+ }).done(function (data) {
129
+ if (!data || !data.postnord) {
130
+ return;
131
+ }
132
+
133
+ if (data.postnord.error) {
134
+ console.log(data.postnord.message);
135
+ } else {
136
+ if(typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0] !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime !== 'undefined' && typeof data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays !== 'undefined')
137
+ {
138
+ if (data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].transitTimeInDays == 1 && data.postnord['se.posten.loab.lisp.notis.publicapi.serviceapi.TransitTimeResponse'].transitTimes[0].deliveryTime == '21:00') {
139
+ eveningDelivery = true;
140
+ }
141
+ }
142
+
143
+ if (eveningDelivery) {
144
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').show();
145
+ } else {
146
+ $('#<?php echo $this->getCode() ?>_additional_fee_element').hide();
147
+ }
148
+ }
149
+ });
150
+ }
151
+ <?php endif; ?>
152
+
153
+ $('div[data-code=<?php echo $this->getCode() ?>]').appendTo($('input[value=<?php echo $this->getCode() ?>]').parent());
154
+ });
155
+ </script>
app/etc/modules/Vconnect_AllInOne.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Vconnect_AllInOne>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ </Vconnect_AllInOne>
7
+ </modules>
8
+ </config>
app/etc/modules/Vconnect_AllInOneDk.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Vconnect_AllInOneDk>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ <depends>
7
+ <Vconnect_AllInOne/>
8
+ </depends>
9
+ </Vconnect_AllInOneDk>
10
+ </modules>
11
+ </config>
app/etc/modules/Vconnect_AllInOneFi.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Vconnect_AllInOneFi>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ <depends>
7
+ <Vconnect_AllInOne/>
8
+ </depends>
9
+ </Vconnect_AllInOneFi>
10
+ </modules>
11
+ </config>
app/etc/modules/Vconnect_AllInOneNo.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Vconnect_AllInOneNo>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ <depends>
7
+ <Vconnect_AllInOne/>
8
+ </depends>
9
+ </Vconnect_AllInOneNo>
10
+ </modules>
11
+ </config>
app/etc/modules/Vconnect_AllInOneSe.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Vconnect_AllInOneSe>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ <depends>
7
+ <Vconnect_AllInOne/>
8
+ </depends>
9
+ </Vconnect_AllInOneSe>
10
+ </modules>
11
+ </config>
app/locale/da_DK/Vconnect_AllInOne.csv ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "To your address","Til din adresse"
2
+ "To a post office","Til Posthus/Pakkeboks"
3
+ "To your Business","Til erhverv"
4
+ "We will arrive","Leveringstid"
5
+ "We will arrive in","Leveringstid"
6
+ "1-3 days ","1-3 dage"
7
+ "Delivery type","Levering"
8
+ "Personal Delivery","Din adresse"
9
+ "Please note that small packeges will be delivered directly to your mall box.","Små pakker lægges i postkassen"
10
+ "Skift postnumber","Ændr Postnummer"
11
+ "Cancel","Fortryd"
12
+ "International Parcel delivered by DPD","International levering"
13
+ "Select delivery day","Vælg leveringsdag"
14
+ "Standart Delivery","Din adresse"
15
+ "Smart Delivery","Smartlevering"
16
+ "Choose delivery option","Vælg leveringsdag"
17
+ "Choose delivery options","Vælg leveringsdag"
18
+ "Personal Delivery","Din adresse"
19
+ "Flex delivery","Flexlevering"
20
+ "Flex Delivery","Flexlevering"
21
+ "In front of the Door","Foran hoveddøren"
22
+ "Carport","Carport/garage"
23
+ "Infront of backdoor","Ved bagdøren"
24
+ "I have modttagarflex","Jeg har Modtagerflex"
25
+ "Other place","Andet sted"
26
+ "Opening hours","Ã…bningstider"
27
+ "Zip/Postal Code","Postnummer"
28
+ "Write place", "Skriv placering"
29
+ "1-3 days", "1-3 dage"
30
+ "2-3 days", "2-3 dage"
31
+ "Choose a method", "Vælg leveringsmetode"
32
+ "Pick a point", "Vælg udleveringssted"
33
+ "Mon", "Man"
34
+ "Tue", "Tirs"
35
+ "Wed", "Ons"
36
+ "Thu", "Tors"
37
+ "Fri", "Fre"
38
+ "Sat", "Lør"
39
+ "Sun", "Søn"
40
+ "Choose delivery option commercial arrival","Vælg leveringsdag"
41
+ "Choose delivery option commercial delivery","Vælg leveringsdag"
42
+ "Choose delivery option private arrival","Vælg leveringsdag"
43
+ "Choose delivery option private delivery","Vælg leveringsdag"
44
+ "Choose delivery option mailbox arrival","Vælg leveringsdag"
45
+ "Choose delivery option mailbox delivery","Vælg leveringsdag"
46
+ "Label arrival time commercial:","Leveringstid:"
47
+ "Label arrival commercial:","Leveringstid:"
48
+ "Label delivery commercial:","Levering:"
49
+ "Label arrival time private:","Leveringstid:"
50
+ "Label arrival private:","Leveringstid:"
51
+ "Label delivery private:","Levering:"
52
+ "Label arrival time mailbox:","Leveringstid:"
53
+ "Label arrival mailbox:","Leveringstid:"
54
+ "Label delivery mailbox:","Levering:"
55
+ "Label arrival time pickup:","Leveringstid:"
56
+ "Label arrival pickup:","Leveringstid:"
57
+ "Label delivery pickup:","Levering:"
58
+ "Environmental fee","Jag väljer att klimatkompensera"
59
+ "By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.","Genom att betala 10 kronor klimatkompenserar jag för min leverans och bidrar till omställningen till förnybar energi."
60
+ "Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com", "Dina 10 kronor går oavkortat till projekt certifieradeav FN. Projekten syftar till att ersätta fossil energiproduktioni utvecklingsländer med produktion av förnybar energi.Projekten är även certifierade enligt Gold Standard, sominnebär ytterligare krav på socialt ansvarstagande ochen hållbar utveckling. Du kan läsa mer om klimatkompensationoch PostNords hållbarhetsarbete på postnord.com."
61
+ "Please add the code for the outside door in the textbox bellow (if there is):", "Tilføj venligst koden til døren i tekstfeltet nedenfor (hvis der er en kode):"
app/locale/fi_FI/Vconnect_AllInOne.csv ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "To your address","Kotiintoimitus"
2
+ "To a post office","Toimitus noutopisteeseen"
3
+ "To your Business","Toimitus työpaikalle"
4
+ "We will arrive","Arvioitu toimitusaika"
5
+ "We will arrive in","Toimitusaika"
6
+ "1-3 days ","1 - 3 arkipäivää"
7
+ "Delivery type","Lähetyksen toimitustapa"
8
+ "Personal Delivery","Lähetyksen toimitus kuittausta vastaan"
9
+ "Please note that small packeges will be delivered directly to your mall box.",""
10
+ "Skift postnumber","Etsi palvelupiste postinumeron perusteella"
11
+ "Cancel","Peruuta"
12
+ "International Parcel delivered by DPD","International levering"
13
+ "Select delivery day","Valitse toimituspäivämäärä"
14
+ "Standart Delivery","Toimitus maanantaista perjantaihin klo 08:00 - 16:00"
15
+ "Smart Delivery","Smartlevering"
16
+ "Choose delivery option","Valitse toimitustapa"
17
+ "Personal Delivery","Lähetyksen toimitus kuittausta vastaan"
18
+ "Flex delivery","Flexlevering"
19
+ "Flex Delivery","Flexlevering"
20
+ "In front of the Door","Foran hoveddøren"
21
+ "Carport","Carport/garage"
22
+ "Infront of backdoor","Ved bagdøren"
23
+ "I have modttagarflex","Jeg har Modtagerflex"
24
+ "Other place","Andet sted"
25
+ "Opening hours","Aukioloajat"
26
+ "Pick a point", "valitse palvelu paikka"
27
+ "Mon", "Ma"
28
+ "Tue", "Tii"
29
+ "Wed", "Kes"
30
+ "Thu", "Tor"
31
+ "Fri", "Pe"
32
+ "Sat", "La"
33
+ "Sun", "Sun"
34
+ "Choose delivery option commercial arrival","Valitse toimitustapa"
35
+ "Choose delivery option commercial delivery","Valitse toimitustapa"
36
+ "Choose delivery option private arrival","Valitse toimitustapa"
37
+ "Choose delivery option private delivery","Valitse toimitustapa"
38
+ "Choose delivery option mailbox arrival","Valitse toimitustapa"
39
+ "Choose delivery option mailbox delivery","Valitse toimitustapa"
40
+ "Label arrival time commercial:","Toimitusaika:"
41
+ "Label arrival commercial:","Arvioitu toimitusaika:"
42
+ "Label delivery commercial:","Lähetyksen toimitustapa:"
43
+ "Label arrival time private:","Toimitusaika:"
44
+ "Label arrival private:","Arvioitu toimitusaika:"
45
+ "Label delivery private:","Lähetyksen toimitustapa:"
46
+ "Label arrival time mailbox:","Toimitusaika:"
47
+ "Label arrival mailbox:","Arvioitu toimitusaika:"
48
+ "Label delivery mailbox:","Lähetyksen toimitustapa:"
49
+ "Label arrival time pickup:","Toimitusaika:"
50
+ "Label arrival pickup:","Arvioitu toimitusaika:"
51
+ "Label delivery pickup:","Arvioitu toimitusaika:"
52
+ "Environmental fee","Jag väljer att klimatkompensera"
53
+ "By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.","Genom att betala 10 kronor klimatkompenserar jag för min leverans och bidrar till omställningen till förnybar energi."
54
+ "Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com", "Dina 10 kronor går oavkortat till projekt certifieradeav FN. Projekten syftar till att ersätta fossil energiproduktioni utvecklingsländer med produktion av förnybar energi.Projekten är även certifierade enligt Gold Standard, sominnebär ytterligare krav på socialt ansvarstagande ochen hållbar utveckling. Du kan läsa mer om klimatkompensationoch PostNords hållbarhetsarbete på postnord.com."
app/locale/nb_NO/Vconnect_AllInOne.csv ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "To your address","Til døren"
2
+ "To a post office","Til pakkeutleveringssted"
3
+ "To your Business","Til bedriftsadresse"
4
+ "To my mailbox","Til postkassen"
5
+ "We will arrive","Pakken kommer"
6
+ "We will arrive in","Sendes innen"
7
+ "1-3 days ","2-5 dager"
8
+ "Delivery type","Pakken leveres"
9
+ "Personal Delivery","Levering mot signatur"
10
+ "Please note that small packeges will be delivered directly to your mall box.",""
11
+ "Skift postnumber","Endre postnummer"
12
+ "Cancel","Avbryt"
13
+ "International Parcel delivered by DPD","Internasjonal pakke levert av DPD"
14
+ "Select delivery day","Velg leveringsdato"
15
+ "Standart Delivery","Standard levering"
16
+ "Smart Delivery","Smartlevering"
17
+ "Choose delivery option","Velg leveringsalternativ"
18
+ "Normal delivery (2-3 days)","Standard levering (2-4 dager)"
19
+ "Flex delivery","Levering uten signering (pakken settes på anvist sted om du ikke er tilstede)"
20
+ "Flex Delivery","Levering uten signering (pakken settes på anvist sted om du ikke er tilstede)"
21
+ "In front of the Door","Foran hoveddøren"
22
+ "Carport","Carport/garage"
23
+ "Infront of backdoor","Ved bagdøren"
24
+ "I have modttagarflex","Jeg har Modtagerflex"
25
+ "Other place","Andet sted"
26
+ "Opening hours","Ã…pningstider"
27
+ "Added services","Tilleggstjenester"
28
+ "None","Ingen"
29
+ "Carry in and up","Inn- og oppbæring til anvist sted"
30
+ "Unwrapping","Avemballering (utpakking)"
31
+ "Installation","Installasjon"
32
+ "Pick a point", "velger tjeneste plass"
33
+ "Choose a method", "Velge en metode"
34
+ "Within 1-5 days 08:00 - 17:00", "innen 1-5 dager 08:00 - 17:00"
35
+ "Choose delivery options", "Velg leveringsdato"
36
+ "Postnummer", "Endre postnummer"
37
+ "Mon", "Man"
38
+ "Tue", "Tirs"
39
+ "Wed", "Ons"
40
+ "Thu", "Tor"
41
+ "Fri", "Fre"
42
+ "Sat", "Lør"
43
+ "Sun", "Søn"
44
+ "Choose delivery option commercial arrival","Velg leveringsalternativ"
45
+ "Choose delivery option commercial delivery","Velg leveringsalternativ"
46
+ "Choose delivery option private arrival","Velg leveringsalternativ"
47
+ "Choose delivery option private delivery","Velg leveringsalternativ"
48
+ "Choose delivery option mailbox arrival","Velg leveringsalternativ"
49
+ "Choose delivery option mailbox delivery","Velg leveringsalternativ"
50
+ "Label arrival time commercial:","Sendes innen:"
51
+ "Label arrival commercial:","Pakken kommer:"
52
+ "Label delivery commercial:","Pakken leveres:"
53
+ "Label arrival time private:","Sendes innen:"
54
+ "Label arrival private:","Pakken kommer:"
55
+ "Label delivery private:","Pakken leveres:"
56
+ "Label arrival time mailbox:","Sendes innen:"
57
+ "Label arrival mailbox:","Pakken kommer:"
58
+ "Label delivery mailbox:","Pakken leveres:"
59
+ "Label arrival time pickup:","Sendes innen:"
60
+ "Label arrival pickup:","Pakken leveres:"
61
+ "Label delivery pickup:","Pakken kommer med:"
62
+ "You will have the opportunity to choose the time of delivery as soon as we have received your package", "Du vil få mulighet til å velge tidspunkt for levering så snart vi har mottatt pakken din"
63
+ "The package comes the same place as your local newspaper, either in your mailbox or on the doormat.", "Pakken leveres samme sted som din lokalavis, enten i postkassen eller på dørmatten."
64
+ "Environmental fee","Jag väljer att klimatkompensera"
65
+ "By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.","Genom att betala 10 kronor klimatkompenserar jag för min leverans och bidrar till omställningen till förnybar energi."
66
+ "Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com", "Dina 10 kronor går oavkortat till projekt certifieradeav FN. Projekten syftar till att ersätta fossil energiproduktioni utvecklingsländer med produktion av förnybar energi.Projekten är även certifierade enligt Gold Standard, sominnebär ytterligare krav på socialt ansvarstagande ochen hållbar utveckling. Du kan läsa mer om klimatkompensationoch PostNords hållbarhetsarbete på postnord.com."
app/locale/nn_NO/Vconnect_AllInOne.csv ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "To your address","Til døren"
2
+ "To a post office","Til pakkeutleveringssted"
3
+ "To your Business","Til bedriftsadresse"
4
+ "To my mailbox","Til postkassen"
5
+ "We will arrive","Pakken kommer"
6
+ "We will arrive in","Sendes innen"
7
+ "1-3 days ","2-5 dager"
8
+ "Delivery type","Pakken leveres"
9
+ "Personal Delivery","Levering mot signatur"
10
+ "Please note that small packeges will be delivered directly to your mall box.",""
11
+ "Skift postnumber","Endre postnummer"
12
+ "Cancel","Avbryt"
13
+ "International Parcel delivered by DPD","Internasjonal pakke levert av DPD"
14
+ "Select delivery day","Velg leveringsdato"
15
+ "Standart Delivery","Standard levering"
16
+ "Smart Delivery","Smartlevering"
17
+ "Choose delivery option","Velg leveringsalternativ"
18
+ "Normal delivery (2-3 days)","Standard levering (2-4 dager)"
19
+ "Flex delivery","Levering uten signering (pakken settes på anvist sted om du ikke er tilstede)"
20
+ "Flex Delivery","Levering uten signering (pakken settes på anvist sted om du ikke er tilstede)"
21
+ "In front of the Door","Foran hoveddøren"
22
+ "Carport","Carport/garage"
23
+ "Infront of backdoor","Ved bagdøren"
24
+ "I have modttagarflex","Jeg har Modtagerflex"
25
+ "Other place","Andet sted"
26
+ "Opening hours","Aukioloajat"
27
+ "Added services","Tilleggstjenester"
28
+ "None","Ingen"
29
+ "Carry in and up","Inn- og oppbæring til anvist sted"
30
+ "Unwrapping","Avemballering (utpakking)"
31
+ "Installation","Installasjon"
32
+ "Pick a point", "velger tjeneste plass"
33
+ "Choose a method", "Velge en metode"
34
+ "Within 1-5 days 08:00 - 17:00", "innen 1-5 dager 08:00 - 17:00"
35
+ "Choose delivery options", "Velg leveringsdato"
36
+ "Postnummer", "Endre postnummer"
37
+ "Mon", "Man"
38
+ "Tue", "Tirs"
39
+ "Wed", "Ons"
40
+ "Thu", "Tor"
41
+ "Fri", "Fre"
42
+ "Sat", "Lør"
43
+ "Sun", "Søn"
44
+ "Choose delivery option commercial arrival","Velg leveringsalternativ"
45
+ "Choose delivery option commercial delivery","Velg leveringsalternativ"
46
+ "Choose delivery option private arrival","Velg leveringsalternativ"
47
+ "Choose delivery option private delivery","Velg leveringsalternativ"
48
+ "Choose delivery option mailbox arrival","Velg leveringsalternativ"
49
+ "Choose delivery option mailbox delivery","Velg leveringsalternativ"
50
+ "Label arrival time commercial:","Sendes innen:"
51
+ "Label arrival commercial:","Pakken kommer:"
52
+ "Label delivery commercial:","Pakken leveres:"
53
+ "Label arrival time private:","Sendes innen:"
54
+ "Label arrival private:","Pakken kommer:"
55
+ "Label delivery private:","Pakken leveres:"
56
+ "Label arrival time mailbox:","Sendes innen:"
57
+ "Label arrival mailbox:","Pakken kommer:"
58
+ "Label delivery mailbox:","Pakken leveres:"
59
+ "Label arrival time pickup:","Sendes innen:"
60
+ "Label arrival pickup:","Pakken leveres:"
61
+ "Label delivery pickup:","Pakken kommer med:"
62
+ "I choose to offset","Jag väljer att klimatkompensera"
63
+ "By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.","Genom att betala 10 kronor klimatkompenserar jag för min leverans och bidrar till omställningen till förnybar energi."
64
+ "Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com", "Dina 10 kronor går oavkortat till projekt certifieradeav FN. Projekten syftar till att ersätta fossil energiproduktioni utvecklingsländer med produktion av förnybar energi.Projekten är även certifierade enligt Gold Standard, sominnebär ytterligare krav på socialt ansvarstagande ochen hållbar utveckling. Du kan läsa mer om klimatkompensationoch PostNords hållbarhetsarbete på postnord.com."
app/locale/sv_SE/Vconnect_AllInOne.csv ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "To your address","Till dörren"
2
+ "To a post office","Till serviceställe"
3
+ "To your Business","Till företag"
4
+ "To my mailbox","Till postlådan"
5
+ "EU","To door"
6
+ "International","To dorr"
7
+ "We will arrive","Paketet levereras"
8
+ "We will arrive in","Paketet levereras inom"
9
+ "Chose delivery form","Välj hur snabbt paketet ska levereras"
10
+ "Nearest pickuplocation","Ica Bandhagen"
11
+ "1-3 days ","inom 1-3 dagar"
12
+ "Delivery type","Paketet lämnas"
13
+ "Delivery types","Om paketet inte får plats i postlådan kommer det att levereras till"
14
+ "Personal Delivery","Med kvittens"
15
+ "Please note that small packeges will be delivered directly to your mall box.",""
16
+ "Skift postnumber","ändra postnummer"
17
+ "Cancel","avbryt"
18
+ "International Parcel delivered by DPD","Internasjonal pakke levert av DPD"
19
+ "Select delivery day","Välj leveranstid"
20
+ "Standart Delivery","Dagtid"
21
+ "Evening delivery","Kvällstid 17-21"
22
+ "Smart Delivery","Smartlevering"
23
+ "Choose delivery options","Välj var paketet ska lämnas"
24
+ "Choose delivery option","Välj hur snabbt paketet ska levereras"
25
+ "Normal delivery (2-3 days)","2-3dagar"
26
+ "Flex delivery","Utan kvittens (paketet ställs utanför dörren)"
27
+ "In front of the Door","Utan kvittens (paketet ställs utanför dörren)"
28
+ "Carport","Carport/garage"
29
+ "Infront of backdoor","Ved bagdøren"
30
+ "I have modttagarflex","Jeg har Modtagerflex"
31
+ "Other place","Andet sted"
32
+ "Opening hours","öppettider"
33
+ "Added services","Tilleggstjenester"
34
+ "None","Ingen"
35
+ "Carry in and up","inbärning "
36
+ "Unwrapping","Avemballering"
37
+ "Installation","Installation"
38
+ "Bag on the door","I en påse på dörren"
39
+ "Please add the code for the outside door in the textbox bellow (if there is):","Glöm inte att skriva in din portkod i textrutan nedan (om du har någon):"
40
+ "1-3 days", "1-3 dagar"
41
+ "2-3 days", "2-3 dagar"
42
+ "Choose a method", "Klicka här för att välja annat leveransalternativ"
43
+ "Pick a point", "VÄLJ UTLÄMNINGSSTÄLLE"
44
+ "Mon", "MÃ¥n"
45
+ "Tue", "Tis"
46
+ "Wed", "Ons"
47
+ "Thu", "Tors"
48
+ "Fri", "Fre"
49
+ "Sat", "Lör"
50
+ "Sun", "Sön"
51
+ "Write place", "Om du har en portkod kan du skriva den här"
52
+ "Choose delivery option commercial arrival","Välj leveranstid"
53
+ "Choose delivery option commercial delivery","Välj hur paketet ska levereras"
54
+ "Choose delivery option private arrival","Välj leveranstid"
55
+ "Choose delivery option private delivery","Välj hur paketet ska levereras"
56
+ "Choose delivery option mailbox arrival","Välj hur snabbt paketet ska levereras"
57
+ "Choose delivery option mailbox delivery","Välj hur snabbt paketet ska levereras"
58
+ "Label arrival time commercial:","Beräknad leveranstid:"
59
+ "Label arrival commercial:","Paketet levereras:"
60
+ "Label delivery commercial:","Paketet lämnas:"
61
+ "Label arrival time private:","Beräknad leveranstid:"
62
+ "Label arrival private:","Paketet levereras:"
63
+ "Label delivery private:","Paketet lämnas:"
64
+ "Label arrival time mailbox:","Beräknad leveranstid:"
65
+ "Label arrival mailbox:","Paketet levereras inom:"
66
+ "Label delivery mailbox:","Paketet levereras till:"
67
+ "Label arrival time pickup:","Beräknad leveranstid:"
68
+ "Label arrival pickup:","Paketet levereras inom:"
69
+ "Label delivery pickup:","Paketet levereras till:"
70
+ "Environmental fee","Jag väljer att klimatkompensera"
71
+ "By paying 10 crowns carbon offsets for my delivery and contribute to the transition to renewable energy.","Genom att betala 10 kronor klimatkompenserar jag för min leverans och bidrar till omställningen till förnybar energi."
72
+ "Your 10 crowns will go to projects certified by the UN. The projects aim to replace fossil energy production in developing countries with renewable energy. The projects are also certified according to the Gold Standard, which involves additional requirements on social responsibility and sustainable development. You can read more about carbon offsetting and PostNord's sustainability work on postnord.com", "Dina 10 kronor går oavkortat till projekt certifieradeav FN. Projekten syftar till att ersätta fossil energiproduktioni utvecklingsländer med produktion av förnybar energi.Projekten är även certifierade enligt Gold Standard, sominnebär ytterligare krav på socialt ansvarstagande ochen hållbar utveckling. Du kan läsa mer om klimatkompensationoch PostNords hållbarhetsarbete på postnord.com."
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>postnord_delivery_module</name>
4
+ <version>1.4.6</version>
5
+ <stability>stable</stability>
6
+ <license>MIT</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>vConnect All In One module</summary>
10
+ <description>vConnect All In One module</description>
11
+ <notes>Stable version</notes>
12
+ <authors><author><name>vConnect</name><user>vConnect</user><email>kontakt@vconnect.dk</email></author></authors>
13
+ <date>2017-01-24</date>
14
+ <time>08:24:36</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Vconnect_AllInOne.xml" hash="c65796cdad628ae69ae8b3870694d0fa"/><file name="Vconnect_AllInOneDk.xml" hash="3e3990e3b1edf06ab1b32b98ab6d45bd"/><file name="Vconnect_AllInOneFi.xml" hash="6274a7aea1e57b8cc53ef7a4e96da631"/><file name="Vconnect_AllInOneNo.xml" hash="9bf9c08d7927ee2160c66edb62345329"/><file name="Vconnect_AllInOneSe.xml" hash="7172132f4f9d975952968dfad947bc23"/></dir></target><target name="magecommunity"><dir name="Vconnect"><dir name="AllInOne"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Shipping"><dir name="Method"><file name="Form.php" hash="c53b8011ffbef39040ec60c890edc1f7"/></dir></dir></dir></dir></dir><dir name="Shipping"><file name="Table.php" hash="e19906acf6b1a2a67ab2c7c35e40691f"/></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Prices.php" hash="fcdd181db92df3071ba0af7b59506b3b"/></dir></dir></dir><dir name="Total"><dir name="Renderer"><file name="Additionalfee.php" hash="170e3ce6f2f5dac8e7c874083eb44b42"/><file name="Environmentalfee.php" hash="9b4240c3dd2fd715fb285796184507fb"/></dir></dir></dir><dir name="Shipping"><file name="Dialog.php" hash="c6df1a522643a2ff878f710e7ca2b3c0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="1591211e00a11387cb36c29d0ffe1bb3"/></dir><dir name="Model"><file name="Apiclient.php" hash="56c28632418f291b1a35f115839234a8"/><dir name="Carrier"><file name="Postnord.php" hash="d7f5d6ed4502dba3041bbfced2019f94"/></dir><dir name="Creditmemo"><file name="Environmentaltotal.php" hash="ef72d3a4ce5697d6dce9624fa2a9407b"/><file name="Total.php" hash="cd258747aac9d4fac13853ea1fe062b4"/></dir><dir name="Invoice"><file name="Environmentaltotal.php" hash="bd4e9583d115e508516bf58d3a8a6616"/><dir name="Pdf"><file name="Environmentaltotal.php" hash="1dc46a1a007cf4a0e7139fe49c7d296e"/><file name="Total.php" hash="8dbea4a6017aa032f3c5fb4e539c8275"/></dir><file name="Total.php" hash="ed24844be3a328c0446e445eca73616e"/></dir><file name="Observer.php" hash="921b7e46c704778c20194b54ab4094b2"/><dir name="Quote"><dir name="Address"><file name="Rate.php" hash="7f1a98cff16e1783b980a545bcdd8ef5"/></dir><file name="Environmentaltotal.php" hash="b6eca9338f0808ffe1eb66511bdeb303"/><file name="Total.php" hash="68e7fbd24707ae63a89b0264f7912789"/></dir><dir name="Rate"><file name="Result.php" hash="b984f1da0fb26484fed6b4a734958091"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="License.php" hash="61289afeaf97fb815dfdf5874e6e30d5"/></dir></dir><dir name="Source"><dir name="Carrier"><file name="Countries.php" hash="50262157ae7c38ce3e3317b1696ccdb3"/><file name="Orderstate.php" hash="5e089bd01c8ca400666cda01d5ad9bdf"/><file name="Terms.php" hash="a9825b1a26d6b39784c3a5f0b323f111"/><file name="Theme.php" hash="d88bd733c3fbb74a3869fd4d4675493c"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="2273aa8cc767cd2cc4d3ae27d291c4e8"/></dir><dir name="data"><dir name="vconnect_postnord_setup"><file name="data-install-1.2.9.php" hash="9b6f615cdf4be36c2e86663fc34eb753"/></dir></dir><dir name="etc"><file name="config.xml" hash="5c353eba249b1aa7f0903d76e6006c13"/><file name="system.xml" hash="4ba02adab7dc0194bb0a069ab294c08b"/></dir><dir name="sql"><dir name="vconnect_postnord_setup"><file name="install-0.1.2.0.php" hash="b8bbd0cf375ee6b4267938a14eef638d"/><file name="upgrade-0.1.2.0-0.1.2.1.php" hash="8fd18bf950cb67bf04b4d4370d5ebbe7"/></dir></dir></dir><dir name="AllInOneDk"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Prices.php" hash="84b62a4bc7c9461745eaf00f0bcb45b1"/></dir></dir></dir></dir><dir name="Shipping"><file name="Form.php" hash="a6350912108d727d483b93286a93b1a7"/></dir></dir><dir name="Helper"><file name="Data.php" hash="bca8bca4c2054cf55fa40ba67c5f5825"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Orderstate.php" hash="0b3dad957fd53a0c81400bdc53ea69fd"/></dir></dir></dir></dir><file name="Array2XML.php" hash="614455991d5d1a5ec4e78d9049b4ad72"/><dir name="Carrier"><file name="SmartDelivery.php" hash="6d3aa5fbe6ff00996d9ad2483426ac5e"/></dir><dir name="Method"><file name="Mapper.php" hash="61e97598897f1f2c543515e263d26e5f"/></dir><file name="Observer.php" hash="a113fa332970e200f2437e6fc1cf1c73"/><file name="Timeslot.php" hash="41db5bd7000ec4a8992c42e4807d72ab"/></dir><dir name="etc"><file name="config.xml" hash="ba6a4c60e6e22545b63aa69324fe1510"/><file name="system.xml" hash="4421cd49cc1a42fd075cc6d68ccbbe22"/></dir></dir><dir name="AllInOneFi"><dir name="Helper"><file name="Data.php" hash="282925e2c06d3a136c216cca9d50f254"/></dir><dir name="Model"><file name="Observer.php" hash="117dfe8d85cfdced1cc838c8f486fa01"/></dir><dir name="etc"><file name="config.xml" hash="c4cc53a2eff8bf3626aff4962d743d8e"/><file name="system.xml" hash="4421cd49cc1a42fd075cc6d68ccbbe22"/></dir></dir><dir name="AllInOneNo"><dir name="Helper"><file name="Data.php" hash="69b3cae92269cca1507bfba07046daf8"/></dir><dir name="Model"><file name="Observer.php" hash="a1040f3758c25300e23279d0c53523a2"/></dir><dir name="etc"><file name="config.xml" hash="41ce55d46814ed0c868b79047dc61fbc"/><file name="system.xml" hash="4421cd49cc1a42fd075cc6d68ccbbe22"/></dir></dir><dir name="AllInOneSe"><dir name="Helper"><file name="Data.php" hash="4febe9409ab74fdd8b45186010898372"/></dir><dir name="Model"><file name="Observer.php" hash="ba742dad31c2845edea6f6e5a0d82796"/></dir><dir name="etc"><file name="config.xml" hash="70978f8ccd351016d006f31572409864"/><file name="system.xml" hash="68c84bfd210d09af4cdf68a5b23d2af1"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="da_DK"><file name="Vconnect_AllInOne.csv" hash="038b46e9223790b2e99546e8bf4829de"/></dir><dir name="fi_FI"><file name="Vconnect_AllInOne.csv" hash="0a975e8e4888348ba5c2e421ba07d5db"/></dir><dir name="nb_NO"><file name="Vconnect_AllInOne.csv" hash="cc4c7d3ea73f43c48eb1e160839a3b8e"/></dir><dir name="nn_NO"><file name="Vconnect_AllInOne.csv" hash="1b78af62119cedd91b9b09c77e35eaa0"/></dir><dir name="sv_SE"><file name="Vconnect_AllInOne.csv" hash="aa94e8b302b0062907d70a4e658291fe"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="vconnect"><file name="aio.xml" hash="4fe1cbed58e74f4c545771daf1db8bf7"/></dir></dir><dir name="template"><dir name="vconnect"><dir name="aio"><file name="methods_select.phtml" hash="710fbeb6e7e16ca7397a17f2c428ff8d"/><file name="prices.phtml" hash="52a3adda44db6030dd022dc799db41c7"/></dir><dir name="aio_base_createorder"><file name="base.phtml" hash="27be61b183d103cb6fc15e1f8ec4ae4d"/><dir name="commercial"><file name="tabHeader.phtml" hash="99fc7c30e21f6095ecc1faae34bbfb52"/><file name="tabScripts.phtml" hash="d18b147fed9158058a942d45bc4eaf1b"/></dir><dir name="mailbox"><file name="tabHeader.phtml" hash="df868ea1ec29b7db74ad3459f90a1e9b"/><file name="tabScripts.phtml" hash="3b3d3b931876f5d823fe9e09f5f22107"/></dir><dir name="pickup"><file name="tabHeader.phtml" hash="6c1892bca9564aa6ddaa6d31b181f177"/><file name="tabScripts.phtml" hash="718506c2e32a86c3b09ed09690cba580"/></dir><dir name="private"><file name="tabHeader.phtml" hash="cbc2e13a4f967ce05dc103f411b46203"/><file name="tabScripts.phtml" hash="c9d094e145ea0520eed2a4b86256f2fc"/></dir></dir><dir name="sales"><dir name="order"><dir name="create"><dir name="shipping"><dir name="method"><file name="form.phtml" hash="ef6391a41e4e63153b470425dcd8c283"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="vconnect"><file name="aio.xml" hash="d8b775cdc6498885218edb0ccfe52ef9"/></dir></dir><dir name="template"><dir name="vconnect"><dir name="aio"><file name="base.phtml" hash="f7efbb467cd622be03b7479219c0feca"/><dir name="commercial"><file name="tabHeader.phtml" hash="9e1d5c20e7cc5cd79552575f2e2d4127"/><file name="tabScripts.phtml" hash="ce2a2405179ea4e2333a4d39431291d7"/></dir><dir name="dpdeu"><file name="tabHeader.phtml" hash="0dba2425b904d72e58526373a3a5cb70"/><file name="tabScripts.phtml" hash="bd0c45a0ba94e9afc8f0404fab7c0ac1"/></dir><dir name="dpdinternational"><file name="tabHeader.phtml" hash="8ce697babe5e965c804267b8851d707f"/><file name="tabScripts.phtml" hash="025b5e8f20767878f0811767591b974a"/></dir><dir name="mailbox"><file name="tabHeader.phtml" hash="da85ae98a20d3eec96e8ed8d36f8fc8e"/><file name="tabScripts.phtml" hash="68b11e64d8413b3dd74af21ad72cb6ac"/></dir><dir name="pickup"><file name="tabHeader.phtml" hash="5a228f846e7843c031fd646fb79dd0da"/><file name="tabScripts.phtml" hash="3ac844fca1c1d8c4c34c1215151ff5ec"/></dir><dir name="private"><file name="tabHeader.phtml" hash="8cf493ae770580277d9e47d9135c5c35"/><file name="tabScripts.phtml" hash="fef4d9addfa8ecd1c14a650c1a6d92ae"/></dir></dir><dir name="aio_base"><file name="base.phtml" hash="53e741bf98153cc4a8d6d316d6ade776"/><dir name="commercial"><file name="tabHeader.phtml" hash="2752ed21f7b66af9573299d97cc1680f"/><file name="tabScripts.phtml" hash="d18b147fed9158058a942d45bc4eaf1b"/></dir><dir name="mailbox"><file name="tabHeader.phtml" hash="47dc92c6e504bb625a5cc810883d0fd7"/><file name="tabScripts.phtml" hash="53ec3691f032b92887a1ac615f40d225"/></dir><dir name="pickup"><file name="tabHeader.phtml" hash="6c1892bca9564aa6ddaa6d31b181f177"/><file name="tabScripts.phtml" hash="65a31c06ac51e9d7e0fb496064897c67"/></dir><dir name="private"><file name="tabHeader.phtml" hash="f38c2e011548e5100b32d01961d06c34"/><file name="tabScripts.phtml" hash="7574799fe5f8879258ae2ddc104d4da9"/></dir></dir><dir name="klarnacheckout"><dir name="aio_base"><file name="base.phtml" hash="8bf9fc04e72c07f39f73cdefc862fbc9"/><dir name="commercial"><file name="tabHeader.phtml" hash="2752ed21f7b66af9573299d97cc1680f"/><file name="tabScripts.phtml" hash="1b6170b0856e621b6645de1e73f0eb21"/></dir><dir name="mailbox"><file name="tabHeader.phtml" hash="d93d80899bf96be78c9a619bcef22ff6"/><file name="tabScripts.phtml" hash="eb4377b1494ac17a244348768010cc7e"/></dir><dir name="pickup"><file name="tabHeader.phtml" hash="c6830211e4bb901c487aa1442dd8e387"/><file name="tabScripts.phtml" hash="f7622283d8cb95d1f431629db9d41bfc"/></dir><dir name="private"><file name="tabHeader.phtml" hash="d001e3cbbc7e817c045ec4c141a53059"/><file name="tabScripts.phtml" hash="b9970ce8310bdadbcb3208b5f075d80b"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="vconnect"><dir name="aio"><file name="blue.css" hash="f1abac4fd9c81336d795365d188a5600"/><file name="red.css" hash="a521d92afeaf8ffe5b299b9bd6a94d2b"/></dir></dir></dir><dir name="fonts"><dir name="vconnect"><dir name="aio"><file name="Stag Sans Round - Black Italic.otf" hash="3d88dcc30c641adb7bfe249ea763d4ca"/><file name="Stag Sans Round - Black.otf" hash="5245c1a236bb9712e1fcef79ec8bb16e"/><file name="Stag Sans Round - Bold Italic.otf" hash="d08353af5bcc4a6b8fdfdbee706d18c9"/><file name="Stag Sans Round - Bold.otf" hash="2b08e6cf853bc938ec3dd5d8eab45e63"/><file name="Stag Sans Round - Book Italic.otf" hash="322137ed2634fd0b76988bfe841ea370"/><file name="Stag Sans Round - Book.otf" hash="8634ef3aade493ad91d1e0561eb625f0"/><file name="Stag Sans Round - Light Italic.otf" hash="0492f3e9b247131ba205cbbbd4223846"/><file name="Stag Sans Round - Light.otf" hash="b4cd27deaf3de28c38f991b179b44f75"/><file name="Stag Sans Round - Medium Italic.otf" hash="7dd4b6e73f3d18a9b5c5ca2339e58a01"/><file name="Stag Sans Round - Medium.otf" hash="4205e652f525b57b8facb44f218ad149"/><file name="Stag Sans Round - Semibold Italic.otf" hash="fb8f889f6fbdd5a31cbcd8f22ed5bdf1"/><file name="Stag Sans Round - Semibold.otf" hash="db0c2ccd2420aebad4981c365d04714d"/></dir></dir></dir><dir name="images"><dir name="vconnect"><dir name="aio"><file name="PostDKLogo.svg.png" hash="132a4ddf60858f85399d1b4831f7d1d6"/><file name="active-pin-3.png" hash="f5a9913799ee7c8dcb4638b97743913a"/><file name="active-pin-red-3.png" hash="fcc1bd4da6ad7a57f84b855a79bcc47a"/><file name="active-pin.png" hash="6158c43b71d593fef551eec0d7efbc11"/><file name="aino-icons-red.png" hash="696af7550e10aefd53c8fda92706b8b7"/><file name="aino-icons.png" hash="7c3e33eb460e307deecc809c2c959b63"/><file name="aino-postnord-logo.png" hash="4a0bb79d90a53fd9ccc727eb4ca3e1bf"/><file name="arrow.png" hash="e9343f52c090c17d8122fa1c9fb75e59"/><file name="button-arrow-icon.png" hash="cec6fe459116aae4efbef9771c12ecbf"/><file name="not-active-pin-red.png" hash="d48ed1189481c84ade7e800c899b7829"/><file name="not-active-pin.png" hash="8cbb2b9dfb2c9ab091ddfc620f46015b"/><file name="realistic-frog-outline-0.png" hash="1e256e3278a358d65ef33e9ab0e53472"/><file name="temp.png" hash="69d0497e5e4883debdb9ac9e83dbcaaf"/><dir name="weather-icons"><file name="01d.png" hash="878a99f00f36a38b7e9f494bb49b313f"/><file name="02d.png" hash="702333e82ab733d83e779ab5bc643153"/><file name="03d.png" hash="b43ad4cb29011f78c5961a28e63a56f3"/><file name="04d.png" hash="c4cbd71d3078a001177ca1ff57f6e7c8"/><file name="09d.png" hash="00e56cad86cc68faa326e4936c368912"/><file name="10d.png" hash="aeb6e8215dbef1ef10b2ef2fbcd50342"/><file name="11d.png" hash="bf0d0999afade5388f49cf750a9de4fd"/><file name="13d.png" hash="8acb7bfa692a3bbaddac253dfdfc2d3a"/></dir></dir></dir></dir><dir name="js"><dir name="vconnect"><dir name="aio"><file name="facescroll.js" hash="476bb5ba838bdf436d9b6a7a6e31ab20"/><file name="jquery-1.11.3.js" hash="7f38dcbfb11aff050652ff3b754adb63"/><file name="jquery-ui.js" hash="f319f43dae020665d17a3b87943200f7"/><file name="jquery.nicescroll.js" hash="b94b7b9ba120e0cc59cf30eba70772af"/><file name="jquery.ui.touch-punch.js" hash="f94a17c1ca86c0a61275c4d084f53f1c"/><file name="markerwithlabel.js" hash="77f38899e96a35e4ce2105ea433159a3"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="vconnect"><dir name="aio"><file name="blue.css" hash="cf5d4f22c7a195bfb614bda0ccbe60fb"/><file name="blue_ie8.css" hash="db2fbe53423dce690d3ba97a69bf2778"/><file name="red.css" hash="a521d92afeaf8ffe5b299b9bd6a94d2b"/></dir></dir></dir><dir name="fonts"><dir name="vconnect"><dir name="aio"><file name="Stag_Sans_Round_-_Black.otf" hash="5245c1a236bb9712e1fcef79ec8bb16e"/><file name="Stag_Sans_Round_-_Black_Italic.otf" hash="3d88dcc30c641adb7bfe249ea763d4ca"/><file name="Stag_Sans_Round_-_Bold.otf" hash="2b08e6cf853bc938ec3dd5d8eab45e63"/><file name="Stag_Sans_Round_-_Bold_Italic.otf" hash="d08353af5bcc4a6b8fdfdbee706d18c9"/><file name="Stag_Sans_Round_-_Book.otf" hash="8634ef3aade493ad91d1e0561eb625f0"/><file name="Stag_Sans_Round_-_Book_Italic.otf" hash="322137ed2634fd0b76988bfe841ea370"/><file name="Stag_Sans_Round_-_Light.otf" hash="b4cd27deaf3de28c38f991b179b44f75"/><file name="Stag_Sans_Round_-_Light_Italic.otf" hash="0492f3e9b247131ba205cbbbd4223846"/><file name="Stag_Sans_Round_-_Medium.otf" hash="4205e652f525b57b8facb44f218ad149"/><file name="Stag_Sans_Round_-_Medium_Italic.otf" hash="7dd4b6e73f3d18a9b5c5ca2339e58a01"/><file name="Stag_Sans_Round_-_Semibold.otf" hash="db0c2ccd2420aebad4981c365d04714d"/><file name="Stag_Sans_Round_-_Semibold_Italic.otf" hash="fb8f889f6fbdd5a31cbcd8f22ed5bdf1"/></dir></dir></dir><dir name="images"><dir name="vconnect"><dir name="aio"><file name="PostDKLogo.svg.png" hash="132a4ddf60858f85399d1b4831f7d1d6"/><file name="active-pin-3.png" hash="f5a9913799ee7c8dcb4638b97743913a"/><file name="active-pin-red-3.png" hash="fcc1bd4da6ad7a57f84b855a79bcc47a"/><file name="active-pin.png" hash="6158c43b71d593fef551eec0d7efbc11"/><file name="aino-icons-red.png" hash="696af7550e10aefd53c8fda92706b8b7"/><file name="aino-icons.png" hash="7c3e33eb460e307deecc809c2c959b63"/><file name="aino-postnord-logo.png" hash="4a0bb79d90a53fd9ccc727eb4ca3e1bf"/><file name="arrow.png" hash="e9343f52c090c17d8122fa1c9fb75e59"/><file name="button-arrow-icon.png" hash="cec6fe459116aae4efbef9771c12ecbf"/><file name="env-fee-icon.png" hash="30ed4025ea88cec049881db434ca3e9c"/><file name="not-active-pin-red.png" hash="d48ed1189481c84ade7e800c899b7829"/><file name="not-active-pin.png" hash="8cbb2b9dfb2c9ab091ddfc620f46015b"/><file name="realistic-frog-outline-0.png" hash="1e256e3278a358d65ef33e9ab0e53472"/><file name="temp.png" hash="69d0497e5e4883debdb9ac9e83dbcaaf"/><dir name="weather-icons"><file name="01d.png" hash="878a99f00f36a38b7e9f494bb49b313f"/><file name="02d.png" hash="702333e82ab733d83e779ab5bc643153"/><file name="03d.png" hash="b43ad4cb29011f78c5961a28e63a56f3"/><file name="04d.png" hash="c4cbd71d3078a001177ca1ff57f6e7c8"/><file name="09d.png" hash="00e56cad86cc68faa326e4936c368912"/><file name="10d.png" hash="aeb6e8215dbef1ef10b2ef2fbcd50342"/><file name="11d.png" hash="bf0d0999afade5388f49cf750a9de4fd"/><file name="13d.png" hash="8acb7bfa692a3bbaddac253dfdfc2d3a"/></dir></dir></dir></dir><dir name="js"><dir name="vconnect"><dir name="aio"><file name="facescroll.js" hash="476bb5ba838bdf436d9b6a7a6e31ab20"/><file name="jquery-1.11.3.js" hash="7f38dcbfb11aff050652ff3b754adb63"/><file name="jquery-ui.js" hash="f319f43dae020665d17a3b87943200f7"/><file name="jquery.nicescroll.js" hash="b94b7b9ba120e0cc59cf30eba70772af"/><file name="jquery.ui.touch-punch.js" hash="f94a17c1ca86c0a61275c4d084f53f1c"/><file name="markerwithlabel.js" hash="77f38899e96a35e4ce2105ea433159a3"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/><file name="simulate.js" hash="7c1da2e8125793007443e3c5a166b170"/></dir></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.9.9</max></package></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/css/vconnect/aio/blue.css ADDED
@@ -0,0 +1,2526 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*reset*/
2
+ .all-in-one-container {
3
+ margin: 0;
4
+ padding: 0;
5
+ border: 0;
6
+ font-size: 16px; /*+*/
7
+ vertical-align: baseline;
8
+
9
+ }
10
+
11
+ .all-in-one-container table {
12
+ border-collapse: collapse;
13
+ border-spacing: 0;
14
+ }
15
+
16
+ /*reset*/
17
+
18
+ /*clearfix*/
19
+ .cf:before,
20
+ .cf:after {
21
+ content: "";
22
+ display: table;
23
+ }
24
+
25
+ .cf:after {
26
+ clear: both;
27
+ }
28
+
29
+ .cf {
30
+ zoom: 1; /* For IE 6/7 (trigger hasLayout) */
31
+ }
32
+
33
+ /*clearfix*/
34
+ @font-face {
35
+ font-family: 'Stag Sans Round - Medium';
36
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf');
37
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('truetype');
38
+ }
39
+
40
+ @font-face {
41
+ font-family: 'Stag Sans Round - Book';
42
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf');
43
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('truetype');
44
+ }
45
+
46
+ @font-face {
47
+ font-family: 'Stag Sans Round - Light';
48
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf');
49
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('truetype');
50
+ }
51
+
52
+ @font-face {
53
+ font-family: 'Stag Sans Round - Semibold';
54
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf');
55
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('truetype');
56
+ }
57
+
58
+ /*checkbox*/
59
+ .aino-container .aino-input {
60
+ position: relative;
61
+ cursor: pointer;
62
+ display: block !important;
63
+ padding: 15px 15px 15px 60px;
64
+ border-bottom: 2px solid #f3f3f3;
65
+ margin-bottom: 0;
66
+ }
67
+
68
+ .aino-container .aino-input > input {
69
+ position: absolute;
70
+ z-index: -1;
71
+ opacity: 0;
72
+ display: none;
73
+ }
74
+
75
+ .aino-container .aino-indicator {
76
+ position: absolute;
77
+ top: 13px;
78
+ left: 10px;
79
+ display: block;
80
+ line-height: 1rem;
81
+ user-select: none;
82
+ width: 20px;
83
+ height: 16px;
84
+ }
85
+
86
+ .aino-container .aino-input > input:checked ~ .aino-indicator,
87
+ .aino-container .aino-input > input[checked] ~ .aino-indicator{
88
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat 0 -108px;
89
+ }
90
+
91
+ .aino-custom-input {
92
+ display: inline-block;
93
+ position: relative;
94
+ cursor: pointer;
95
+ border: 2px solid #f6f6f6;
96
+ padding: 4px 54px 3px 12px;
97
+ text-align: left;
98
+ margin-bottom: 8px;
99
+ background-color: #fff;
100
+ z-index: 4;
101
+ }
102
+
103
+ .aino-custom-input > input {
104
+ position: absolute;
105
+ z-index: -1;
106
+ opacity: 0;
107
+ }
108
+
109
+ .aino-custom-checkbox-indicator {
110
+ position: absolute;
111
+ top: 14px;
112
+ right: 10px;
113
+ display: block;
114
+ line-height: 1rem;
115
+ user-select: none;
116
+ width: 24px;
117
+ height: 19px;
118
+ box-shadow: 3px 3px 0 #e5e5e5;
119
+ border: 1px solid #e5e5e5;
120
+ }
121
+
122
+ .aino-custom-input > input:checked ~ .aino-custom-checkbox-indicator {
123
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat 0 -108px;
124
+ }
125
+
126
+ .aino-custom-input:before{
127
+ content: '';
128
+ background: url(../../../images/vconnect/aio/realistic-frog-outline-0.png);
129
+ background-size: 100%;
130
+ width: 35px;
131
+ height: 35px;
132
+ display: inline-block;
133
+ margin-right: 12px;
134
+ vertical-align: baseline;
135
+ }
136
+
137
+ .aino-custom-input-text{
138
+ display: inline-block;
139
+ font-size: 12px !important;
140
+ }
141
+
142
+ .aino-custom-input-text i{
143
+ font-size: 10px;
144
+ display: block;
145
+ }
146
+ .aino-custom-input-text .aino-delivery-price{
147
+ font-size: 16px;
148
+ }
149
+
150
+ /*!checkbox*/
151
+
152
+ .page-navigation li a:hover{
153
+ background-color: #17b5d5;
154
+ }
155
+
156
+ .aino-cover {
157
+ width: 100%;
158
+ height: 100%;
159
+ position: fixed;
160
+ top: 0;
161
+ right: 0;
162
+ bottom: 0;
163
+ left: 0;
164
+ background-color: rgba(0, 0, 0, 0.7);
165
+ z-index: 1060;
166
+ }
167
+
168
+ .aino-container {
169
+ width: 100%;
170
+ position: fixed;
171
+ top: 10%;
172
+ bottom: 10%;
173
+ z-index: 9999999999;
174
+ outline: 0;
175
+ }
176
+ .aino-container .aino-core{
177
+ background-color: #fff;
178
+ font-family: 'Stag Sans Round - Medium';
179
+ margin: 0 auto;
180
+ border: 1px solid #000;
181
+ font-size: 16px;
182
+ text-align: left;
183
+ }
184
+
185
+ .aino-container *{
186
+ box-sizing: border-box;
187
+ }
188
+
189
+ .aino-container.desktop .aino-core{
190
+ width: 1155px;
191
+ height: 100%;
192
+ padding: 23px 16px 0;
193
+ color: #000;
194
+ }
195
+
196
+ .aino-container.mobile .aino-core{
197
+ width: 100%;
198
+ height:100%;
199
+ }
200
+
201
+ .aino-container .aino-header .postnord-logo {
202
+ width: 22%;
203
+ float: left;
204
+ text-align: center;
205
+ margin-bottom: 13px;
206
+ }
207
+
208
+ .aino-container .aino-header .postnord-logo span {
209
+ /*background: url(../images/aino-postnord-logo.png) no-repeat;*/
210
+ background: url(../../../images/vconnect/aio/aino-postnord-logo.png) no-repeat;
211
+ display: inline-block;
212
+ width: 166px;
213
+ height: 31px;
214
+ margin: 5px;
215
+ outline: none;
216
+ overflow: hidden;
217
+ text-indent: -999px;
218
+ white-space: nowrap;
219
+ z-index: 2;
220
+ }
221
+
222
+ .aino-container .aino-nav {
223
+ list-style-type: none;
224
+ padding: 0;
225
+ }
226
+
227
+ .aino-container .aino-inner-tabs > .aino-nav
228
+ {
229
+ position: relative;
230
+ margin-top: 16px;
231
+ }
232
+
233
+ .aino-container > .aino-core > .aino-tabs,
234
+ .aino-container .aino-inner-tabs
235
+ {
236
+ height: 84%;
237
+ }
238
+
239
+ .aino-deliver-to {
240
+ width: 100%;
241
+ position: relative;
242
+ }
243
+
244
+ .aino-deliver-to > li > a {
245
+ background-color: #fafafa;
246
+ color: #1799b9;
247
+ display: block;
248
+ padding: 16px 26px;
249
+ text-decoration: none;
250
+ line-height: 20px;
251
+ box-shadow: 3px 3px 0 #e5e5e5;
252
+ margin-bottom: 20px;
253
+ margin-right: 30px;
254
+ width: 22.5%;
255
+ }
256
+
257
+ .aino-deliver-to > li > a:before {
258
+ content: '';
259
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat;
260
+ display: inline-block;
261
+ margin-right: 28px;
262
+ vertical-align: middle;
263
+ }
264
+
265
+ .aino-deliver-to > li > .tab-list{
266
+ position: absolute;
267
+ width: 74%;
268
+ top: 0;
269
+ left: 25%;
270
+ }
271
+
272
+ .aino-deliver-to .aino-mailbox-tab > a:before {
273
+ background: url("../../../images/vconnect/aio/aino-icons.png") -1px -273px;
274
+ width: 20px;
275
+ height: 14px;
276
+ }
277
+
278
+ .aino-deliver-to .aino-mailbox-tab > a:hover:before,
279
+ .aino-deliver-to .aino-mailbox-tab.ui-state-active > a:before {
280
+ background-position: -23px -273px;
281
+ }
282
+
283
+ .aino-deliver-to .aino-address-tab > a:before {
284
+ background: url("../../../images/vconnect/aio/aino-icons.png") -23px 0;
285
+ width: 20px;
286
+ height: 18px;
287
+ }
288
+
289
+ .aino-deliver-to .aino-address-tab > a:hover:before,
290
+ .aino-deliver-to .aino-address-tab.ui-state-active > a:before {
291
+ background-position: 0 0;
292
+ }
293
+
294
+ .aino-deliver-to .aino-office-tab > a:before {
295
+ background-position: -23px -23px;
296
+ width: 20px;
297
+ height: 21px;
298
+ }
299
+
300
+ .aino-deliver-to > li > a span{
301
+ display: inline-block;
302
+ vertical-align: middle;
303
+ line-height: 20px;
304
+ }
305
+ .aino-deliver-to .aino-international-tab > a:before {
306
+ background-position: -2px -250px;
307
+ width: 21px;
308
+ height: 21px;
309
+ }
310
+
311
+ .aino-deliver-to .aino-international-tab.ui-state-active > a:before,
312
+ .aino-deliver-to .aino-international-tab:hover > a:before{
313
+ background-position: -23px -249px;
314
+ }
315
+
316
+ .aino-deliver-to .aino-office-tab.ui-state-active > a:before,
317
+ .aino-deliver-to .aino-office-tab > a:hover:before {
318
+ background-position: 0 -23px;
319
+ }
320
+
321
+ .aino-deliver-to .aino-business-tab > a:before {
322
+ background-position: -23px -44px;
323
+ width: 20px;
324
+ height: 21px;
325
+ }
326
+
327
+ .aino-deliver-to .aino-business-tab.ui-state-active > a:before,
328
+ .aino-deliver-to .aino-business-tab > a:hover:before {
329
+ background-position: 0 -44px;
330
+ }
331
+
332
+
333
+ .aino-tabs-body .aino-smart-delivery .toggle-calendar{
334
+ text-align: left;
335
+ }
336
+
337
+ .aino-tabs-body .aino-smart-delivery .mounth-day{
338
+ display: none;
339
+ }
340
+
341
+ .aino-deliver-to .aino-smartdelivery-tab > a:before {
342
+ background-position: 0 -358px;
343
+ width: 20px;
344
+ height: 20px;
345
+ }
346
+
347
+ .aino-deliver-to .aino-smartdelivery-tab.ui-state-active > a:before,
348
+ .aino-deliver-to .aino-smartdelivery-tab > a:hover:before {
349
+ background-position: -22px -358px;
350
+ }
351
+
352
+ .aino-deliver-to .ui-state-active{
353
+ border:none !important;
354
+ background: none !important;
355
+ font-weight: normal;
356
+ color: inherit;
357
+ }
358
+
359
+ .aino-deliver-to > li > a .aino-delivery-price{
360
+ line-height: 20px;
361
+ }
362
+
363
+ .aino-deliver-to > .ui-state-active > a,
364
+ .aino-deliver-to > li > a:hover,
365
+ .aino-deliver-to > li > a:hover .aino-delivery-price,
366
+ .aino-deliver-to > .ui-state-active > a .aino-delivery-price {
367
+ background-color: #1799b9;
368
+ color: #fff;
369
+ transition: none;
370
+ }
371
+
372
+ .aino-deliver-to > li > a i{
373
+ font-style: italic;
374
+ }
375
+
376
+ .aino-container li:focus,
377
+ .aino-container li a:focus,
378
+ .aino-container li button:focus {
379
+ outline: none;
380
+ }
381
+
382
+ .aino-container .aino-tabs-body {
383
+ width: 75%;
384
+ }
385
+ .aino-container .aino-tabs-body .aino-tabs-body {
386
+ margin-top: 16px;
387
+ }
388
+
389
+ .aino-container .aino-tabs-body .tab-list:not(:first-child){
390
+ display: none;
391
+ }
392
+
393
+ .aino-container .aino-tabs-body .tab-list{
394
+ width: 80%;
395
+ position: absolute;
396
+ }
397
+
398
+ .aino-container .aino-tabs-body,
399
+ .aino-container .aino-nav {
400
+ float: left;
401
+ margin-top: 0;
402
+ margin-bottom:0;
403
+ }
404
+
405
+ .aino-container .aino-tabs-body .aino-heading {
406
+ color: #a29a9b;
407
+ }
408
+
409
+ .aino-container .aino-tabs-body {
410
+ font-family: 'Stag Sans Round - Book'!important;
411
+ }
412
+
413
+ .aino-container .aino-tabs-body .aino-tabs,
414
+ .aino-container .aino-inner-tabs{
415
+ border-top: 2px solid #f6f6f6;
416
+ }
417
+
418
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
419
+ content: '';
420
+ border-top: 4px solid #1799b9;
421
+ display: block;
422
+ margin-top: -19px;
423
+ margin-bottom: 15px;
424
+ }
425
+
426
+ .aino-container .aino-column > .aino-tabs > ul > li ,
427
+ .aino-container .aino-inner-tabs > ul > li{
428
+ margin-bottom: 19px;
429
+ }
430
+ .aino-container .aino-tabs-body .aino-inner-tabs p,
431
+ .aino-container .aino-tabs-body > div{
432
+ line-height: 19px;
433
+ }
434
+
435
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab]{
436
+ text-decoration: none;
437
+ color: #000;
438
+ font-size: 20px!important;
439
+ display: block;
440
+ border-bottom: 2px solid #f6f6f6;
441
+ margin: 18px 0 16px;
442
+ font-family: 'Stag Sans Round - Medium'!important;
443
+ position: relative;
444
+ }
445
+
446
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab] label{
447
+ cursor: pointer;
448
+ }
449
+
450
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab]:after {
451
+ content: '';
452
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat 0 -67px;
453
+ display: block;
454
+ position: absolute;
455
+ top: 14px;
456
+ right: 16px;
457
+ width: 10px;
458
+ height: 16px;
459
+ }
460
+
461
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] span {
462
+ padding: 13px 30px 13px 0;
463
+ display: block;
464
+ line-height: 19px;
465
+ }
466
+
467
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
468
+ background-color: #1799b9;
469
+ color: #fff;
470
+ margin-left: -14px;
471
+ padding: 13px 30px 13px 14px;
472
+ }
473
+
474
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab]:after{
475
+ background-position: -14px -67px;
476
+ }
477
+
478
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context{
479
+ float: left;
480
+ width: 43%;
481
+ }
482
+
483
+ .aino-container .aino-column-2{
484
+ display: none;
485
+ width: 50%;
486
+ position: absolute;
487
+ right: 0;
488
+ top: 0;
489
+ }
490
+
491
+ .aino-container .aino-column-2 ul {
492
+ width: 100%;
493
+ position: relative;
494
+ z-index: 3;
495
+ }
496
+
497
+ .aino-container .aino-column-2 ul li {
498
+ padding: 0 23px;
499
+ }
500
+
501
+ .aino-container .aino-column-2 ul li.aino-active {
502
+ background-color: #f8f8f8;
503
+ }
504
+
505
+ .aino-container .aino-column-2 > div {
506
+ padding: 11px 24px 23px;
507
+ border-bottom: 2px solid #efefef;
508
+ }
509
+
510
+ .aino-container .aino-column-2 > div .close,
511
+ .aino-container .aino-column-2 > div .close-inner{
512
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat 0 -88px;
513
+ width: 20px;
514
+ height: 20px;
515
+ display: inline-block;
516
+ float: right;
517
+ cursor: pointer;
518
+ opacity: 1;
519
+ }
520
+
521
+ .aino-container .aino-column-2 .aino-input{
522
+ color: #000;
523
+ }
524
+
525
+
526
+ .aino-container .aino-textarea-holder{
527
+ padding-right: 23px;
528
+ display: none;
529
+ }
530
+
531
+ .aino-container textarea{
532
+ border:2px solid #e5e5e5;
533
+ outline: none;
534
+ padding: 10px;
535
+ width:100%;
536
+ font-family: 'Stag Sans Round - Light';
537
+ resize: none;
538
+ }
539
+
540
+ .aino-map-container {
541
+ width: 47%;
542
+ float: left;
543
+ position: relative;
544
+ margin-right: -15px;
545
+ margin-top: -73px;
546
+ }
547
+
548
+ .address-near-you {
549
+ width: 32%;
550
+ float: left;
551
+ height: 685px;
552
+ overflow: auto;
553
+ background-color: transparent;
554
+ padding-left: 15px;
555
+ margin-top: -73px;
556
+ }
557
+
558
+ .alt-scroll-holder, .alt-scroll-content{
559
+ width: 100% !important;
560
+ }
561
+
562
+ .address-near-you ul {
563
+ width: 100%;
564
+ padding-left: 15px;
565
+ margin-left: -15px;
566
+ }
567
+
568
+ .address-near-you ul > li {
569
+ background-color: #f8f8f8;
570
+ position: relative;
571
+ font-family: 'Roboto', sans-serif;
572
+ font-size: 12px;
573
+ border-bottom: 1px solid #fff;
574
+ cursor: pointer;
575
+ }
576
+
577
+ .address-near-you ul > li .aino-input{
578
+ border: none;
579
+ }
580
+
581
+ .address-near-you li.active {
582
+ margin-left: -17px;
583
+ margin-top: -1px;
584
+ padding: 0 0 0 17px;
585
+ }
586
+
587
+ .address-near-you li.active > div{
588
+ border-bottom: 4px solid #dfdfdf;
589
+ margin-bottom: -5px;
590
+ z-index: 10;
591
+ position: relative;
592
+ }
593
+
594
+ .address-near-you li:hover .aino-index,
595
+ .address-near-you li:hover .aino-title{
596
+ color: #1f2457 !important;
597
+ font-weight:800;
598
+ }
599
+
600
+ .address-near-you li:hover .aino-address{
601
+ font-family:'Stag Sans Round - book';
602
+ color: #1f2457 !important;
603
+ }
604
+
605
+ .address-near-you li.active .aino-distance {
606
+ left: 0;
607
+ height: 95%;
608
+ }
609
+
610
+ .address-near-you li.active .aino-index {
611
+ color: #1799b9;
612
+ }
613
+
614
+ .address-near-you li.active,
615
+ .address-near-you li.active .aino-distance {
616
+ background-color: #fff;
617
+ }
618
+
619
+ .address-near-you .aino-distance {
620
+ position: absolute;
621
+ top: 0;
622
+ left: 0;
623
+ height: 100%;
624
+ width: 60px;
625
+ text-align: center;
626
+ letter-spacing: 0.5px;
627
+ background-color: #ebebeb;
628
+ color: #000;
629
+ }
630
+
631
+ .address-near-you .aino-distance span {
632
+ display: block;
633
+ font-size: 20px;
634
+ position: relative;
635
+ top: 25%;
636
+ }
637
+
638
+ .address-near-you .aino-title {
639
+ color: #1799b9;
640
+ text-transform: uppercase;
641
+ }
642
+
643
+ .address-near-you .aino-title,
644
+ .address-near-you .aino-address,
645
+ .address-near-you .aino-rating{
646
+ float: right;
647
+ width: 80%;
648
+ }
649
+
650
+
651
+ .address-near-you .aino-index {
652
+ font-size: 18px;
653
+ float: left;
654
+ margin-top:-4px;
655
+ text-align: right;
656
+ margin-left: 9px;
657
+ }
658
+
659
+ .address-near-you .aino-address {
660
+ font-family: 'Stag Sans Round - Light';
661
+ line-height: 17px;
662
+ }
663
+
664
+ .aino-rating {
665
+ padding: 9px 0;
666
+ }
667
+
668
+ .aino-rating .aino-star.active {
669
+ background-position: -1px -126px;
670
+ }
671
+
672
+ .aino-rating .aino-star {
673
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat;
674
+ background-position: -20px -126px;
675
+ width: 13px;
676
+ height: 13px;
677
+ display: inline-block;
678
+ margin-right: 3px;
679
+ }
680
+
681
+ .aino-footer > div {
682
+ margin-right: 10px;
683
+ vertical-align: middle;
684
+ }
685
+
686
+ .aino-footer .aino-button {
687
+ width: 280px;
688
+ border: none;
689
+ text-transform: uppercase;
690
+ color: #fff;
691
+ padding: 12px;
692
+ font-weight: bold;
693
+ font-family: 'Roboto', sans-serif;
694
+ cursor: pointer;
695
+ outline: none;
696
+ }
697
+
698
+ .aino-footer .aino-button.blue {
699
+ background-color: #1799b9;
700
+ }
701
+
702
+ .aino-footer .aino-button.gray {
703
+ background-color: #878787;
704
+ }
705
+
706
+ .aino-label {
707
+ color: #1799b9;
708
+ background-color: #fff;
709
+ position: relative;
710
+ z-index: -1;
711
+ text-align: center;
712
+ padding-top: 10px;
713
+ background: url(../../../images/vconnect/aio/not-active-pin.png) no-repeat 0 0;
714
+ width: 27px;
715
+ height: 35px;
716
+ font-size: 12px;
717
+ font-weight: bold;
718
+ }
719
+
720
+ .aino-label.active {
721
+ background: url(../../../images/vconnect/aio/active-pin-3.png) no-repeat 0 0;
722
+ color: #fff;
723
+ text-shadow: 1px 1px #000;
724
+ }
725
+
726
+ .aino-weather {
727
+ margin-top: 16px;
728
+ }
729
+
730
+ .weather-temp-day sup {
731
+ display: inline-block;
732
+ vertical-align: super;
733
+ font-size: 60%;
734
+ }
735
+
736
+ .aino-weather .aino-nav {
737
+ margin-left: 5%;
738
+ width: 72%;
739
+ }
740
+
741
+ .aino-weather .aino-nav li{
742
+ width: 20%;
743
+ float: left;
744
+ }
745
+
746
+ .aino-weather .aino-nav li > div {
747
+ float: left;
748
+ font-family: 'Roboto', sans-serif;
749
+ font-size: 20px;
750
+ cursor: default;
751
+ }
752
+
753
+ .aino-weather .aino-nav li .weather-temp-day span {
754
+ display: block;
755
+ }
756
+
757
+ .aino-weather .aino-nav li .weather-icon {
758
+ margin-right: 12px;
759
+ }
760
+
761
+ .aino-weather .aino-nav li .aion-weather-day {
762
+ font-size: 12px;
763
+ text-transform: uppercase;
764
+ line-height: 20px;
765
+ margin-top: -9px;
766
+ }
767
+
768
+ .aino-weather .aino-nav li .aion-weather-temp {
769
+ letter-spacing: 1.2px;
770
+ }
771
+
772
+ .zipcode-holder{
773
+ position: absolute;
774
+ top: 10px;
775
+ right: 0px;
776
+ width:75%;
777
+ text-align: right;
778
+ }
779
+
780
+ .post-code-input, .directions-display-type{
781
+ float: right;
782
+ margin-right:15px;
783
+ }
784
+
785
+ .post-code-input {
786
+ padding: 5px 5px 5px 16px;
787
+ font-family: 'Roboto', sans-serif !important;
788
+ font-size: 12px !important;
789
+ font-weight: 500 !important;
790
+ text-transform: uppercase;
791
+ background-color: #fff;
792
+ color: #6e6e6e;
793
+ }
794
+
795
+ .post-code-input input {
796
+ width: 72px;
797
+ height: 26px;
798
+ border-radius: 4px;
799
+ border: 1px solid #dfdfdf;
800
+ color: #000;
801
+ text-align: center;
802
+ margin-left: 12px;
803
+ margin-right: 4px;
804
+ outline: none;
805
+ }
806
+
807
+ .post-code-input button {
808
+ background: none;
809
+ border: none;
810
+ padding: 5px 10px;
811
+ }
812
+
813
+ .post-code-input button span {
814
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -3px -140px;
815
+ width: 12px;
816
+ height: 10px;
817
+ display: block;
818
+ }
819
+
820
+ .aino-map-container .directions-display-type{
821
+ margin-top:5px;
822
+ }
823
+
824
+ .aino-map-container .directions-display-type > button{
825
+ padding: 5px;
826
+ background-color: #fff;
827
+ border: none;
828
+ border-radius: 1px;
829
+ box-shadow: 2px 2px 2px #e5e5e5;
830
+ margin: 0 1px;
831
+ outline: none;
832
+ cursor: pointer;
833
+ }
834
+
835
+ .aino-map-container .directions-display-type > button > span{
836
+ width: 16px;
837
+ height: 16px;
838
+ display: block;
839
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat;
840
+ }
841
+
842
+ .aino-map-container .aino-map-driving span{
843
+ background-position: -3px -287px !important;
844
+ }
845
+
846
+ .aino-map-container .aino-map-walking span{
847
+ background-position: -3px -304px !important;
848
+ }
849
+
850
+ .aino-map-container .aino-map-transit span{
851
+ background-position: -24px -287px !important;
852
+ }
853
+
854
+ .aino-map .aino-info-window {
855
+ font-family: 'Stag Sans Round - Book'!important;
856
+ margin: 0 -23px 0 0;
857
+ color: #000;
858
+ }
859
+
860
+ .aino-map .aino-info-window b,
861
+ .aino-map .aino-info-window span {
862
+ font-family: 'Stag Sans Round - Semibold';
863
+ text-transform: uppercase;
864
+ font-size: 12px;
865
+ width: 60px;
866
+ display: inline-block;
867
+ }
868
+
869
+ .aino-map .aino-info-window span {
870
+ width: auto;
871
+ max-width: 95px;
872
+ margin-bottom: 20px;
873
+ }
874
+
875
+ .aino-map .aino-info-window img {
876
+ width: 71px;
877
+ height: 13px;
878
+ margin-bottom: -2px;
879
+ margin-left: 22px;
880
+ float: right;
881
+ }
882
+
883
+ .aino-map .gm-style-iw div {
884
+ overflow: visible !important;
885
+ }
886
+
887
+ .aino-map .gm-style > div:first-child > div:nth-child(4)
888
+ > div:nth-child(4) > div:first-child > div:first-child > div:last-child{
889
+ border: 2px solid #189aba;
890
+ }
891
+
892
+ .aino-map .gm-style > div:first-child > div:nth-child(4)
893
+ > div:nth-child(4) > div:first-child > div:first-child > div:not(:last-child) {
894
+ display: none;
895
+ }
896
+
897
+ .aino-map .gm-style .gm-style-iw {
898
+ overflow: visible;
899
+ }
900
+
901
+ .aino-map .gm-style-iw:before {
902
+ content: '';
903
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -4px -175px;
904
+ width: 17px;
905
+ height: 18px;
906
+ position: absolute;
907
+ bottom: -17px;
908
+ left: 84px;
909
+ z-index: 9;
910
+ }
911
+
912
+ .aino-map .gm-style-iw + div {
913
+ top: -9px !important;
914
+ right: -13px !important;
915
+ width: 22px !important;
916
+ height: 22px !important;
917
+ opacity: 1 !important;
918
+ }
919
+
920
+ .aino-map .gm-style-iw + div:after {
921
+ content: '';
922
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat 0 -152px;
923
+ display: block;
924
+ width: 22px;
925
+ height: 22px;
926
+ }
927
+
928
+ .aino-map .gm-style-iw + div img {
929
+ display: none;
930
+ }
931
+
932
+ /*mobile styles*/
933
+ .aino-container.mobile{
934
+ display: none;
935
+ padding: 0;
936
+ font-family: 'Stag Sans Round - Book'!important;
937
+ }
938
+
939
+ .aino-container.mobile .aino-header{
940
+ text-align: center;
941
+ margin-top: 14px;
942
+ }
943
+
944
+ .aino-container.mobile .aino-header .postnord-logo{
945
+ width: auto;
946
+ float: none;
947
+ }
948
+
949
+ .aino-container.mobile .aino-footer > div{
950
+ float: none;
951
+ margin-right:0 !important;
952
+ }
953
+
954
+ .aino-container.mobile .aino-footer{
955
+ padding: 0 15px;
956
+ }
957
+
958
+ .aino-container.mobile .aino-footer .aino-button{
959
+ width: 49%;
960
+ display: block;
961
+ float: left;
962
+ padding: 11px;
963
+ }
964
+
965
+ .aino-container.mobile .aino-footer .aino-button.gray{
966
+ margin-right:2%;
967
+ }
968
+
969
+ .aino-container.mobile .aino-body{
970
+ margin-bottom: 14px;
971
+ height: 76%;
972
+ overflow: auto;
973
+ }
974
+
975
+ .aino-container.mobile .aino-body .aino-nav li a{
976
+ border-top: 2px solid #f3f3f3;
977
+ font-family: 'Stag Sans Round - Medium'!important;
978
+ }
979
+
980
+ .aino-container.mobile .aino-body .aino-nav li:last-child > a{
981
+ border-bottom: 2px solid #f3f3f3;
982
+ }
983
+
984
+ .aino-container.mobile .aino-body .aino-collapse{
985
+ color: #1799b9;
986
+ background-color: #f8f8f8;
987
+ display: block;
988
+ padding: 17px 14px;
989
+ cursor: pointer;
990
+ position: relative;
991
+ }
992
+
993
+ .aino-container.mobile .aino-body .aino-collapse-content{
994
+ padding: 14px 25px;
995
+ }
996
+
997
+ .aino-collapse-content{
998
+ display: none;
999
+ }
1000
+
1001
+ .aino-container.desktop .aino-collapse{
1002
+ display: block;
1003
+ padding: 15px 30px 15px 80px;
1004
+ border-bottom: 2px solid #f3f3f3;
1005
+ cursor: pointer;
1006
+ }
1007
+
1008
+ .aino-container.desktop .aino-collapse:after{
1009
+ content: '';
1010
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -3px -325px;
1011
+ width: 9px;
1012
+ height: 13px;
1013
+ display: block;
1014
+ float: right;
1015
+ margin-right: -13px;
1016
+ }
1017
+
1018
+ .aino-container.desktop .aino-collapse.active:after{
1019
+ background-position: -18px -325px;
1020
+ width: 14px;
1021
+ margin-right: 19px;
1022
+ }
1023
+
1024
+ .aino-container.mobile .aino-body .aino-collapse-content textarea{
1025
+ display: none;
1026
+ width:90%;
1027
+ margin-bottom: 15px;
1028
+ }
1029
+
1030
+ .aino-container.mobile .aino-body .aino-collapse:before{
1031
+ content: '';
1032
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -2px -196px;
1033
+ width: 9px;
1034
+ height:13px;
1035
+ display: block;
1036
+ float: left;
1037
+ margin-right: 25px;
1038
+ }
1039
+
1040
+ .aino-container.mobile .aino-body .aino-collapse.active{
1041
+ background-color: #0099bb;
1042
+ color: #ffffff;
1043
+ }
1044
+
1045
+ .aino-container.mobile .aino-body .aino-collapse.active:before{
1046
+ background-position: -13px -196px;
1047
+ width: 14px;
1048
+ margin-right: 19px;
1049
+ }
1050
+
1051
+ .aino-container.mobile .aino-body .aino-nav li .aino-collapse.active{
1052
+ border-color: #0099bb;
1053
+ }
1054
+
1055
+ .aino-container.mobile .aino-body .aino-nav li .aino-collapse.active div{
1056
+ color: #fff;
1057
+ }
1058
+
1059
+ .aino-container.mobile .aino-body .aino-collapse div{
1060
+ float: right;
1061
+ color: #434343;
1062
+ }
1063
+
1064
+ .aino-container.mobile .aino-body .aino-collapse .mounth-day{
1065
+ float: left;
1066
+ margin-right: 10px;
1067
+ color: #fff;
1068
+ }
1069
+
1070
+ .aino-container.mobile .aino-weather{
1071
+ margin-left: -25px;
1072
+ margin-right: -25px;
1073
+ background-color: #f7f7f7;
1074
+ border-top: 1px solid #dadada;
1075
+ border-bottom: 1px solid #dadada;
1076
+ padding: 24px 0 18px;
1077
+ margin-top: 0;
1078
+ overflow: auto;
1079
+ }
1080
+
1081
+
1082
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse{
1083
+ background-color: #0099bb;
1084
+ border-top: 1px solid #028cb1;
1085
+ border-bottom: 1px solid #028cb1;
1086
+ color: #ffffff;
1087
+ margin: 0 -11px;
1088
+ padding: 9px 13px 9px 10px;
1089
+ }
1090
+
1091
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse .pull-right{
1092
+ margin-right:15px;
1093
+ color: #fff;
1094
+ }
1095
+
1096
+ .aino-container.mobile .aino-collapse-content .aino-nav li:last-child > a{
1097
+ border-bottom: 1px solid #028cb1;
1098
+ }
1099
+
1100
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse:before{
1101
+ display: none;
1102
+ }
1103
+
1104
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse:after{
1105
+ content: '';
1106
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -31px -196px;
1107
+ width: 9px;
1108
+ height:13px;
1109
+ display: block;
1110
+ margin-right: 0;
1111
+ margin-top: 2px;
1112
+ position: absolute;
1113
+ right: 10px;
1114
+ top:9px;
1115
+ }
1116
+
1117
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse.active:after {
1118
+ background-position: -13px -196px;
1119
+ width: 14px;
1120
+ margin-top:0;
1121
+ }
1122
+
1123
+ .aino-container.mobile .aino-collapse-content p{
1124
+ margin: 15px 0;
1125
+ line-height: 19px;
1126
+ }
1127
+
1128
+ .aino-container.mobile .aino-collapse-content .aino-nav .active .aino-input{
1129
+ background-color: #f8f8f8;
1130
+ color: #000;
1131
+ }
1132
+
1133
+ .aino-container.mobile .aino-collapse-content .active .aino-title,
1134
+ .aino-container.mobile .aino-collapse-content .active .aino-address
1135
+ {
1136
+ color: #1c96bf;
1137
+ }
1138
+
1139
+ .aino-container.mobile .aino-collapse-content .aino-input{
1140
+ margin:0 -50px;
1141
+ padding: 9px 0 9px 70px;
1142
+ color: #474747;
1143
+ border-bottom: 1px solid #dadada;
1144
+ }
1145
+
1146
+ .aino-container.mobile .aino-collapse-content .aino-indicator{
1147
+ left: 24px;
1148
+ top: 9px;
1149
+ }
1150
+ .aino-container.mobile .post-code-input{
1151
+ position: static;
1152
+ width: 100%;
1153
+ text-align: center;
1154
+ padding: 5px 0;
1155
+ }
1156
+
1157
+ .aino-container.mobile .aino-collapse-content .aino-result-list.active > div{
1158
+ background-color: #f8f8f8;
1159
+ color: #1799b9;
1160
+ }
1161
+
1162
+ .aino-container.mobile .aino-collapse-content .aino-result-list > div{
1163
+ border-bottom: 2px solid #f2f2f2;
1164
+ background-color: #fff;
1165
+ margin: 0 -25px;
1166
+ padding: 15px;
1167
+ line-height: 20px;
1168
+ font-size: 15px;
1169
+ }
1170
+
1171
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input{
1172
+ border:none;
1173
+ margin: 0;
1174
+ position: relative;
1175
+ padding-left: 49px;
1176
+ }
1177
+
1178
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input .aino-indicator{
1179
+ left: 7px;
1180
+ }
1181
+
1182
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input:before{
1183
+ content: '';
1184
+ background:url("../../../images/vconnect/aio/aino-icons.png") no-repeat -3px -211px;
1185
+ display: block;
1186
+ width: 36px;
1187
+ height: 36px;
1188
+ position: absolute;
1189
+ top: 31px;
1190
+ left: -1px;
1191
+ }
1192
+
1193
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-distance{
1194
+ float: right;
1195
+ font-size: 11px;
1196
+ color: #a6a6a6;
1197
+ }
1198
+
1199
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-open-hours{
1200
+ font-size: 11px;
1201
+ color: #a6a6a6;
1202
+ margin-top: 12px;
1203
+ line-height: 11px;
1204
+ }
1205
+
1206
+ .aino-container .aino-nav .aino-open-hours{
1207
+ font-size: 11px;
1208
+ color: #a6a6a6;
1209
+ margin-top: 12px;
1210
+ line-height: 11px;
1211
+ }
1212
+
1213
+ .nicescroll-rails{
1214
+ background-color: #8d8d8d !important;
1215
+ width: 5px !important;
1216
+ border-radius: 5px;
1217
+ z-index: 10;
1218
+ }
1219
+
1220
+ .nicescroll-rails ins{
1221
+ background-color: #e6e6e6;
1222
+ width: 5px;
1223
+ }
1224
+
1225
+ .see-more-locations{
1226
+ text-align: center;
1227
+ padding-top: 12px;
1228
+ cursor: pointer;
1229
+ }
1230
+
1231
+ .aino-tab-sub-title{
1232
+ color: #888;
1233
+ line-height: 21px;
1234
+ font-size: 14px;
1235
+ margin-bottom: -10px;
1236
+ }
1237
+
1238
+ .pull-right{
1239
+ float: right;
1240
+ }
1241
+
1242
+ .aino-inner-tabs .mounth-day{
1243
+ float: left;
1244
+ margin-right:1.5rem;
1245
+ }
1246
+
1247
+ .aino-inner-tabs a[role="tab"] .pull-right{
1248
+ margin-right:15px;
1249
+ }
1250
+
1251
+ .aino-delivery-time-picker li label:before{
1252
+ content: 'kl. ';
1253
+ }
1254
+
1255
+ .aino-delivery-time-picker .mounth-day{
1256
+ display: none;
1257
+ }
1258
+
1259
+ .delivery-time-title{
1260
+ height:45px;
1261
+ padding-top: 25px !important;
1262
+ border-bottom: 2px solid #efefef;
1263
+ }
1264
+
1265
+ .delivery-time-title i{
1266
+ position: absolute;
1267
+ left: 25px;
1268
+ font-style: normal;
1269
+ }
1270
+
1271
+ .toggle-calendar {
1272
+ display: none;
1273
+ background-color: #1799b9;
1274
+ color: #fff;
1275
+ margin: 0px -15px;
1276
+ padding: 13px 30px 13px 14px;
1277
+ cursor: pointer;
1278
+ font-size: 20px!important;
1279
+ font-family: 'Stag Sans Round - Book'!important;
1280
+ text-align: center;
1281
+ position: relative;
1282
+ }
1283
+
1284
+ .toggle-calendar:after{
1285
+ content: '';
1286
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -14px -67px;
1287
+ display: block;
1288
+ position: absolute;
1289
+ top: 14px;
1290
+ right: 16px;
1291
+ width: 10px;
1292
+ height: 16px;
1293
+ }
1294
+
1295
+ .aino-calendar-holder,.delivery-time{
1296
+ border-bottom:none !important;
1297
+ }
1298
+
1299
+ .aino-calendar-holder{
1300
+ padding-bottom: 0 !important;
1301
+ padding-top: 0 !important;
1302
+ }
1303
+
1304
+ .aino-smart-delivery .aino-calendar-holder{
1305
+ padding: 0 15px;
1306
+ }
1307
+
1308
+ .delivery-time{
1309
+ padding: 0 !important;
1310
+ position: relative;
1311
+ z-index: 2;
1312
+ display: none;
1313
+ width:100% !important;
1314
+ }
1315
+
1316
+ .delivery-time .close-inner{
1317
+ position: absolute;
1318
+ right: 24px;
1319
+ }
1320
+
1321
+ .aino-delivery-time-picker{
1322
+ height:370px;
1323
+ }
1324
+
1325
+ .aino-calendar.hidden{
1326
+ opacity: 0;
1327
+ height: 0;
1328
+ }
1329
+
1330
+
1331
+ .aino-arrival{
1332
+ overflow: hidden;
1333
+ height: 550px;
1334
+ }
1335
+
1336
+ .aino-container.desktop .aino-calendar{
1337
+ margin: 0 -15px;
1338
+ }
1339
+
1340
+ .aino-calendar{
1341
+ border-bottom: none !important;
1342
+ -moz-transition: all 500ms ease;
1343
+ -webkit-transition: all 500ms ease;
1344
+ -o-transition: all 500ms ease;
1345
+ transition: all 500ms ease;
1346
+ opacity: 1;
1347
+ height:375px;
1348
+ }
1349
+
1350
+ .aino-calendar table,.aino-calendar th,.aino-calendar td{
1351
+ border: 2px solid #fff;
1352
+ text-align: center;
1353
+ }
1354
+
1355
+ .aino-calendar table{
1356
+ border: none;
1357
+ }
1358
+
1359
+ .aino-calendar thead tr{
1360
+ background-color: #29abcc;
1361
+ color: #fff;
1362
+ }
1363
+
1364
+ .aino-calendar thead tr th{
1365
+ padding: 7px 0 8px;
1366
+ font-family: Verdana, Arial, sans-serif;
1367
+ border: none;
1368
+ }
1369
+
1370
+ .aino-calendar table td a,
1371
+ .aino-calendar table td span{
1372
+ font-family: Verdana, Arial, sans-serif;
1373
+ font-style: normal;
1374
+ padding:15px 13px 14px 13px;
1375
+ }
1376
+
1377
+ .aino-calendar table td a{
1378
+ color: #000;
1379
+ background-color: #fff;
1380
+ border-color: #eee;
1381
+ border-radius: 0;
1382
+ }
1383
+
1384
+ .aino-calendar table td span{
1385
+ display: block;
1386
+ border: 1px solid #eee;
1387
+ }
1388
+
1389
+ .aino-calendar table td{
1390
+ padding: 0;
1391
+ font-size: 14px;
1392
+ }
1393
+
1394
+ .aino-calendar .ui-state-disabled{
1395
+ color: #a5a5a5;
1396
+ opacity: 1 !important;
1397
+ background: #e1e1dd;
1398
+ }
1399
+
1400
+ .aino-calendar .ui-datepicker-header{
1401
+ margin-right:1px;
1402
+ height:45px;
1403
+ position: relative;
1404
+ }
1405
+
1406
+ .aino-calendar .ui-datepicker-header > a, .aino-calendar .ui-datepicker-header > div{
1407
+ float: left;
1408
+ text-align: center;
1409
+ }
1410
+
1411
+ .aino-calendar .ui-datepicker-header > .ui-datepicker-next{
1412
+ float: right;
1413
+ }
1414
+
1415
+ .aino-calendar .ui-datepicker-header > a{
1416
+ width: 21.5%;
1417
+ background-color: #2399b7;
1418
+ min-height: 1px;
1419
+ padding: 14px 0;
1420
+ cursor: pointer;
1421
+ }
1422
+
1423
+ .aino-calendar .ui-datepicker-header .ui-datepicker-prev:before,
1424
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next:before{
1425
+ content: '';
1426
+ display: block;
1427
+ width: 10px;
1428
+ height: 17px;
1429
+ margin: 0 auto;
1430
+ }
1431
+
1432
+ .aino-calendar .ui-datepicker-header .ui-datepicker-prev:before{
1433
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -18px -339px;
1434
+ }
1435
+
1436
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next:before{
1437
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -3px -339px;
1438
+ }
1439
+
1440
+ .aino-calendar .ui-datepicker-header > a span{
1441
+ display: none;
1442
+ }
1443
+
1444
+ .aino-calendar .ui-state-active{
1445
+ background-color: #249ab9;
1446
+ color: #fff;
1447
+ }
1448
+
1449
+ .aino-calendar table td a:hover{
1450
+ background-color: #1799b9;
1451
+ color: #fff;
1452
+ border-radius: 0;
1453
+ }
1454
+
1455
+ .aino-calendar .ui-datepicker-header > div{
1456
+ width: 56.3%;
1457
+ padding: 13px 0;
1458
+ color: #fff;
1459
+ background-color: #2399b7;
1460
+ font-size: 20px;
1461
+ border-left:1px solid #fff;
1462
+ border-right:1px solid #fff;
1463
+ }
1464
+
1465
+ #calc-swe-sweden .aino-tabs-body .aino-column-2 li:hover{
1466
+ background-color: #fdfdfd;
1467
+ }
1468
+
1469
+
1470
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1471
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1472
+ padding: 15px 14px 14px 14px;
1473
+ }
1474
+
1475
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1476
+ width: 61.2%;
1477
+ }
1478
+
1479
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1480
+ width: 18.5%;
1481
+ }
1482
+
1483
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1484
+ margin-right: 4px;
1485
+ }
1486
+
1487
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1488
+ height: 500px;
1489
+ }
1490
+ .aino-tabs ul.aino-nav .aino-address-tab em,
1491
+ .aino-tabs ul.aino-nav .aino-business-tab em,
1492
+ .aino-tabs ul.aino-nav .aino-office-tab em,
1493
+ .aino-tabs ul.aino-nav .aino-mailbox-tab em{
1494
+ display:block;
1495
+ }
1496
+
1497
+ .aino-container .aino-core{
1498
+ position: relative;
1499
+ }
1500
+
1501
+ .aino-footer{
1502
+ text-align: right;
1503
+ position: absolute;
1504
+ width: 100%;
1505
+ right: 2%;
1506
+ bottom: 2%;
1507
+ }
1508
+
1509
+ /*mobile styles*/
1510
+
1511
+ /*@media height*/
1512
+ @media (min-height: 550px){
1513
+ .address-near-you, .aino-map{
1514
+ height: 460px;
1515
+ }
1516
+ }
1517
+ @media (min-height: 600px){
1518
+ .address-near-you, .aino-map{
1519
+ height: 525px;
1520
+ }
1521
+ }
1522
+ @media (min-height: 650px){
1523
+ .address-near-you, .aino-map{
1524
+ height: 560px;
1525
+ }
1526
+ }
1527
+ @media (min-height: 700px){
1528
+ .address-near-you, .aino-map{
1529
+ height: 603px;
1530
+ }
1531
+ }
1532
+ @media (min-height: 750px){
1533
+ .address-near-you, .aino-map{
1534
+ height: 650px;
1535
+ }
1536
+ }
1537
+
1538
+ @media (min-height: 800px){
1539
+ .address-near-you, .aino-map{
1540
+ height: 675px;
1541
+ }
1542
+ }
1543
+
1544
+ @media (min-height: 850px){
1545
+ .address-near-you, .aino-map{
1546
+ height: 715px;
1547
+ }
1548
+ }
1549
+
1550
+ @media (min-height: 900px){
1551
+ .address-near-you, .aino-map{
1552
+ height: 627px;
1553
+ }
1554
+ }
1555
+
1556
+ @media (min-height: 1000px){
1557
+ .address-near-you, .aino-map{
1558
+ height: 685px;
1559
+ }
1560
+ }
1561
+
1562
+ @media (max-height: 1023px){
1563
+ .aino-container{
1564
+ top: 5%;
1565
+ bottom: 15%;
1566
+ }
1567
+
1568
+ .aino-container > .aino-core > .aino-tabs,
1569
+ .aino-container .aino-inner-tabs{
1570
+ max-height: 81%;
1571
+ }
1572
+ }
1573
+
1574
+ @media (max-height: 900px){
1575
+ .aino-container{
1576
+ top: 2%;
1577
+ bottom: 1%;
1578
+ }
1579
+ }
1580
+
1581
+ @media (max-height: 800px){
1582
+ .aino-container{
1583
+ top: 0 !important;
1584
+ bottom: 0 !important;
1585
+ }
1586
+ }
1587
+
1588
+ @media (max-height: 787px){
1589
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1590
+ height: 500px;
1591
+ }
1592
+
1593
+ .aino-arrival ul{
1594
+ height: 450px;
1595
+ }
1596
+
1597
+ .aino-container > .aino-core > .aino-tabs ,
1598
+ .aino-container .aino-inner-tabs{
1599
+ max-height: 72%;
1600
+ height: 72%;
1601
+ }
1602
+
1603
+ /* .aino-container .aino-post-office{
1604
+ margin-top: -77px;
1605
+ }
1606
+ */
1607
+
1608
+ }
1609
+
1610
+ @media (max-height: 700px){
1611
+
1612
+ .aino-container > .aino-core > .aino-tabs,
1613
+ .aino-container .aino-inner-tabs{
1614
+ max-height: 66%;
1615
+ }
1616
+
1617
+ .aino-delivery-time-picker
1618
+ {
1619
+ height: 280px;
1620
+ }
1621
+
1622
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1623
+ height: 400px;
1624
+ }
1625
+ }
1626
+
1627
+
1628
+ /*@media height*/
1629
+ /*@media width*/
1630
+ @media (min-width: 1401px) {
1631
+ .aino-container .aino-column > .aino-inner-tabs .aino-tabs-body,
1632
+ .aino-container .aino-column > .aino-tabs > ul,
1633
+ .aino-container .aino-tabs-body .aino-tabs-body,
1634
+ .aino-container .aino-inner-tabs > ul{
1635
+ width: 100%;
1636
+ }
1637
+ }
1638
+ @media (max-width: 1400px) {
1639
+ .aino-footer > div {
1640
+ margin-right: 28px;
1641
+ }
1642
+
1643
+ .aino-container .aino-column > .aino-tabs .aino-tabs-body,
1644
+ .aino-container .aino-tabs-body .aino-tabs-body,
1645
+ .aino-container .aino-column > .aino-tabs > ul ,
1646
+ .aino-container .aino-inner-tabs > ul{
1647
+ width: 100%;
1648
+ }
1649
+
1650
+ }
1651
+
1652
+ @media (max-width: 1200px) {
1653
+
1654
+ .aino-map-container .directions-display-type{
1655
+ top: 61px;
1656
+ right: 20px;
1657
+ }
1658
+
1659
+ .aino-deliver-to > li > a > span{
1660
+ max-width:118px;
1661
+ }
1662
+
1663
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1664
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1665
+ padding: 15px 9px 14px 9px;
1666
+ }
1667
+
1668
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1669
+ width: 57.4%;
1670
+ }
1671
+
1672
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1673
+ margin-right:3px;
1674
+ }
1675
+
1676
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1677
+ width: 20.4%;
1678
+ }
1679
+
1680
+ .aino-inner-tabs a[role="tab"] .pull-right{
1681
+ margin-right: 5px;
1682
+ float: none;
1683
+ text-align: right;
1684
+ }
1685
+
1686
+ .aino-calendar .ui-datepicker-header > a{
1687
+ width: 21.4%;
1688
+ }
1689
+
1690
+ .aino-calendar table td a,
1691
+ .aino-calendar table td span{
1692
+ padding: 15px 8px 14px 8px;
1693
+ }
1694
+
1695
+ .aino-calendar table, .aino-calendar th, .aino-calendar td{
1696
+ border: 1px solid #fff;
1697
+ }
1698
+
1699
+ .aino-calendar .ui-datepicker-header{
1700
+ margin-right: 0;
1701
+ margin-left: 1px;
1702
+ }
1703
+
1704
+ .aino-calendar table td{
1705
+ font-size: 15px;
1706
+ }
1707
+
1708
+
1709
+ .address-near-you .aino-index{
1710
+ margin-bottom:0;
1711
+ }
1712
+
1713
+ .aino-container .aino-tabs-body{
1714
+ width: 74%;
1715
+ }
1716
+
1717
+ .aino-container.desktop .aino-core{
1718
+ width: 957px;
1719
+ }
1720
+
1721
+ .aino-deliver-to > li > a:before{
1722
+ margin-right: 17px;
1723
+ }
1724
+ }
1725
+
1726
+ @media (max-width: 992px) {
1727
+
1728
+
1729
+ .aino-tabs-body .aino-smart-delivery .toggle-calendar .pull-right
1730
+ {
1731
+ float:none;
1732
+ text-align: right;
1733
+ }
1734
+ .aino-arrival{
1735
+ width: 270px;
1736
+ }
1737
+ .aino-container.desktop .aino-calendar{
1738
+ margin: 0 -22px 0 -10px;
1739
+ }
1740
+ .aino-calendar-holder{
1741
+ width: 240px !important;
1742
+ }
1743
+ .aino-calendar table td a,
1744
+ .aino-calendar table td span,
1745
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1746
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1747
+ padding: 15px 8px 14px 7px;
1748
+ }
1749
+
1750
+ .aino-calendar .ui-datepicker-header > a,
1751
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1752
+ width: 22.4%;
1753
+ position: absolute;
1754
+ }
1755
+
1756
+ .aino-calendar .ui-datepicker-header > div,
1757
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1758
+ left:20.4%;
1759
+ position: absolute;
1760
+ }
1761
+
1762
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1763
+ margin-right:0;
1764
+ }
1765
+
1766
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next{
1767
+ right: 6px;
1768
+ }
1769
+
1770
+ .aino-container .aino-tabs-body{
1771
+ width:73%;
1772
+ }
1773
+
1774
+ .aino-container.desktop .aino-core{
1775
+ width:100%;
1776
+ }
1777
+
1778
+ .address-near-you{
1779
+ width: 37%;
1780
+ }
1781
+
1782
+ .aino-map-container{
1783
+ width: 65% !important;
1784
+ }
1785
+
1786
+ .aino-footer > div {
1787
+ margin-right: 8px;
1788
+ }
1789
+
1790
+ .aino-deliver-to > li> a{
1791
+ padding: 16px;
1792
+ }
1793
+
1794
+ .aino-container .aino-tabs-body .aino-column-2 ul li{
1795
+ padding: 0 5px;
1796
+ }
1797
+
1798
+ .aino-container .aino-input{
1799
+ padding-right: 5px;
1800
+ }
1801
+
1802
+ .aino-container .aino-tabs-body .aino-column-2 > div{
1803
+ padding: 11px 9px 23px;
1804
+ }
1805
+
1806
+ .aino-map-container .directions-display-type{
1807
+ right: 40px;
1808
+ }
1809
+
1810
+ .post-code-input{
1811
+ right: 40px;
1812
+ }
1813
+
1814
+ .aino-map-container .gm-style-mtc{
1815
+ margin-top: 51px !important;
1816
+ }
1817
+ }
1818
+
1819
+ @media (max-width: 900px) {
1820
+ .aino-inner-tabs .mounth-day {
1821
+ float: none;
1822
+ text-align: left;
1823
+ }
1824
+ .address-near-you .aino-index{
1825
+ margin-left: 4px;
1826
+ }
1827
+
1828
+ .aino-deliver-to > li > a:before{
1829
+ margin-right: 12px;
1830
+ }
1831
+ }
1832
+
1833
+ @media (max-width: 810px) {
1834
+ .aino-footer > div{
1835
+ display: block;
1836
+ }
1837
+
1838
+ .aino-custom-input{
1839
+ margin-bottom: 8px;
1840
+ display: inline-block;
1841
+ }
1842
+ }
1843
+
1844
+ @media (min-width: 768px){
1845
+ .aino-deliver-to > li > a{
1846
+ max-width: 252px;
1847
+ }
1848
+ .aino-open-hours {
1849
+ display: none;
1850
+ }
1851
+ }
1852
+
1853
+ @media (max-width: 767px){
1854
+ .aino-container .aino-nav{
1855
+ float: none;
1856
+ margin-top: 0 !important;
1857
+ }
1858
+
1859
+ .aino-container .aino-input {
1860
+ padding-left: 70px;
1861
+ }
1862
+
1863
+ .label-text .pull-right{
1864
+ margin-right: 15px;
1865
+ }
1866
+
1867
+ .aino-calendar .ui-datepicker-header{
1868
+ width: 100%;
1869
+ margin-right: 0;
1870
+ }
1871
+
1872
+ .aino-calendar{
1873
+ height: auto;
1874
+ margin: 0 -35px;
1875
+ }
1876
+
1877
+ .aino-calendar table{
1878
+ width:100%;
1879
+ }
1880
+
1881
+ .aino-calendar .ui-datepicker-header > a{
1882
+ top: -2px;
1883
+ padding: 14.5px 0;
1884
+ width: 21.6%;
1885
+ }
1886
+
1887
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next{
1888
+ right:2px;
1889
+ }
1890
+
1891
+ .aino-calendar .ui-datepicker-header > div{
1892
+ width: 56.4%;
1893
+ left: 21.6%;
1894
+ padding: 8px 0;
1895
+ line-height: 30px;
1896
+ }
1897
+
1898
+ .aino-delivery-time-picker{
1899
+ height:auto;
1900
+ margin-top: 14px;
1901
+ }
1902
+ }
1903
+
1904
+ /*@media width*/
1905
+ /*@media width and height*/
1906
+ @media (max-width: 414px) and (max-height: 736px){
1907
+ .aino-container .aino-tabs{
1908
+ height: 63% !important;
1909
+ }
1910
+ }
1911
+
1912
+ @media (max-width: 375px) and (max-height: 667px){
1913
+ .aino-container .aino-tabs{
1914
+ height: 60% !important;
1915
+ }
1916
+ }
1917
+
1918
+ @media (max-width: 320px) and (max-height: 568px){
1919
+ .aino-container .aino-tabs{
1920
+ height: 55% !important;
1921
+ }
1922
+ }
1923
+ .aino-core a, .aino-core li, .aino-core div, .aino-core span, .aino-core p, .aino-core button,
1924
+ .aino-core label{
1925
+ font-size: inherit;
1926
+ font-family: inherit;
1927
+ line-height: normal;
1928
+ font-weight: normal !important;
1929
+ }
1930
+
1931
+ .aino-nav li .aino-indicator{
1932
+ display: none;
1933
+ }
1934
+
1935
+ .aino-nav li.active .aino-indicator{
1936
+ display: block;
1937
+ }
1938
+
1939
+ /*Corrections*/
1940
+ .aino-container a,
1941
+ .aino-container label{
1942
+ -webkit-touch-callout: none !important;
1943
+ -webkit-user-select: none !important;
1944
+ -khtml-user-select: none !important;
1945
+ -moz-user-select: none !important;
1946
+ -ms-user-select: none !important;
1947
+ user-select: none !important;
1948
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
1949
+ }
1950
+
1951
+ .aino-container.desktop .aino-collapse{
1952
+ padding-left: 58px;
1953
+ color: inherit;
1954
+ text-decoration: none;
1955
+ }
1956
+
1957
+ .address-near-you ul{
1958
+ margin-left: 0;
1959
+ }
1960
+
1961
+ .address-near-you .aino-distance{
1962
+ padding: 0 9px;
1963
+ }
1964
+
1965
+ .address-near-you ul > li .aino-input{
1966
+ word-break: break-all;
1967
+ }
1968
+
1969
+ .aino-map-container{
1970
+ width: 68%;
1971
+ }
1972
+
1973
+ .aino-deliver-to > li > a span{
1974
+ width: 72%;
1975
+ }
1976
+
1977
+ .aino-container .aino-header .postnord-logo{
1978
+ margin-top: 21px;
1979
+ }
1980
+
1981
+ .aino-arrival{
1982
+ overflow: visible;
1983
+ }
1984
+
1985
+ .aino-arrival ul{
1986
+ overflow: hidden;
1987
+ height: 500px;
1988
+ }
1989
+
1990
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
1991
+ content: '';
1992
+ border-top: 4px solid #1799b9;
1993
+ display: block;
1994
+ margin-top: -19px;
1995
+ margin-bottom: 15px;
1996
+ }
1997
+
1998
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] label{
1999
+ display: block;
2000
+ font-weight: normal;
2001
+ margin-bottom: 0;
2002
+ }
2003
+
2004
+ .aino-container .tab-list.aino-column .aino-inner-tabs ul{
2005
+ position: relative;
2006
+ }
2007
+
2008
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context.active:before{
2009
+ content: '';
2010
+ border-top: 4px solid #1799b9;
2011
+ display: block;
2012
+ position: absolute;
2013
+ top: 0;
2014
+ width: 44%;
2015
+ }
2016
+
2017
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context:before{
2018
+ display: none;
2019
+ }
2020
+
2021
+ .aino-nav > .aino-collapse{
2022
+ color: #636363;
2023
+ font-weight: 600;
2024
+ text-decoration: none !important;
2025
+ }
2026
+
2027
+ .aio-options{
2028
+ display: none;
2029
+ }
2030
+ .aio-options select{
2031
+ width: 45%;
2032
+ margin: 2px 1% 0 0;
2033
+ }
2034
+ .aio-options textarea {
2035
+ margin: 5px 0 0 0;
2036
+ width: 45%;
2037
+ }
2038
+ .aio-options.active{
2039
+ display: block;
2040
+ }
2041
+
2042
+ button.aio-pick-btn{
2043
+ background-color: #1c96bf !important;
2044
+ background-image: none;
2045
+ padding: 14px 26px;
2046
+ color: #fff;
2047
+ font-family: 'Stag Sans Round - Medium';
2048
+ border: none;
2049
+ line-height: normal;
2050
+ width: 70%;
2051
+ max-width: 211px;
2052
+ word-spacing: 3px;
2053
+ }
2054
+
2055
+ .aio-hidden{
2056
+ display: none !important;
2057
+ }
2058
+
2059
+ @media (max-width: 1200px){
2060
+ .aino-deliver-to > li > a > span{
2061
+ word-break: break-word;
2062
+ }
2063
+
2064
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context.active:before{
2065
+ width: 43%;
2066
+ }
2067
+ }
2068
+
2069
+ @media (max-width: 992px){
2070
+ .aino-container .aino-collapse {
2071
+ padding-left: 66px !important;
2072
+ }
2073
+ }
2074
+
2075
+ @media (max-width: 768px){
2076
+ .aino-container .aino-core {
2077
+ width: 98% !important;
2078
+ }
2079
+ }
2080
+
2081
+ @media (max-width: 767px){
2082
+ .aino-footer{
2083
+ right: 0;
2084
+ }
2085
+ .aino-custom-input{
2086
+ display: block;
2087
+ }
2088
+ .zipcode-holder{
2089
+ position: static;
2090
+ width: 100%;
2091
+ text-align: center;
2092
+ }
2093
+
2094
+ .post-code-input{
2095
+ float: none;
2096
+ }
2097
+
2098
+ .address-near-you{
2099
+ width: 100%;
2100
+ height: auto;
2101
+ margin-top: 0;
2102
+ float: none;
2103
+ overflow: visible;
2104
+ padding-left: 0;
2105
+ }
2106
+
2107
+ .address-near-you .aino-title,
2108
+ .address-near-you .aino-rating,
2109
+ .address-near-you .aino-address{
2110
+ width: 100%;
2111
+ }
2112
+
2113
+ .address-near-you ul > li{
2114
+ background-color: transparent;
2115
+ margin: 0px -15px;
2116
+ padding: 0 0 0 17px !important;
2117
+ }
2118
+
2119
+ .address-near-you li.active{
2120
+ border-bottom: 1px solid #dadada;
2121
+ background-color: #f8f8f8;
2122
+ }
2123
+
2124
+ .address-near-you li.active .aino-distance {
2125
+ background-color: transparent;
2126
+ }
2127
+
2128
+ .address-near-you li.active > div{
2129
+ border-bottom: none;
2130
+ margin-bottom: 0;
2131
+ }
2132
+
2133
+ .address-near-you .aino-input{
2134
+ padding: 12px 0 9px 49px !important;
2135
+ font-size: 15px;
2136
+ height: 101px;
2137
+ }
2138
+
2139
+ .address-near-you .aino-input .aino-indicator
2140
+ {
2141
+ left: 9px;
2142
+ }
2143
+
2144
+ .address-near-you .aino-input> div{
2145
+ vertical-align: middle;
2146
+ display: inline-block;
2147
+ width: 100%;
2148
+ }
2149
+
2150
+ .address-near-you .aino-input:before{
2151
+ content: '';
2152
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -3px -211px;
2153
+ display: block;
2154
+ width: 36px;
2155
+ height: 36px;
2156
+ position: absolute;
2157
+ left: -1px;
2158
+ top: 31px;
2159
+ }
2160
+
2161
+ .post-code-input input{
2162
+ width: 77px;
2163
+ }
2164
+
2165
+ .address-near-you .aino-distance{
2166
+ position: static;
2167
+ float: right;
2168
+ color: #a6a6a6;
2169
+ background-color: transparent;
2170
+ width: auto;
2171
+ }
2172
+ .address-near-you li.active .aino-distance{
2173
+ height: auto;
2174
+ }
2175
+
2176
+ .address-near-you .aino-distance span{
2177
+ font-size: 11px;
2178
+ }
2179
+
2180
+ .address-near-you .aino-index{
2181
+ display: none;
2182
+ }
2183
+
2184
+ .address-near-you .aino-title{
2185
+ float:none;
2186
+ }
2187
+
2188
+ .aino-container{
2189
+ width: 100%;
2190
+ position: fixed;
2191
+ top: 0;
2192
+ bottom: 0;
2193
+ outline: 0;
2194
+ }
2195
+
2196
+ .all-in-one-container .aino-container{
2197
+ display: block;
2198
+ }
2199
+
2200
+ .aino-container .aino-core{
2201
+ width: 100% !important;
2202
+ height: 100% !important;
2203
+ padding-left: 0 !important;
2204
+ padding-right: 0 !important;
2205
+ }
2206
+
2207
+ .aino-container > .aino-core > .aino-tabs,
2208
+ .aino-container .aino-inner-tabs{
2209
+ max-height: none;
2210
+ border: none;
2211
+ }
2212
+
2213
+ .aino-container .aino-tabs{
2214
+ margin-bottom: 14px;
2215
+ height: 72%;
2216
+ overflow-y: auto;
2217
+ overflow-x: hidden;
2218
+ }
2219
+
2220
+ .aino-container .aino-header .postnord-logo{
2221
+ width: 100%;
2222
+ text-align: center;
2223
+ float: none;
2224
+ }
2225
+
2226
+ .aino-container.mobile .aino-body .aino-nav li a {
2227
+ border-top: 2px solid #f3f3f3;
2228
+ font-family: 'Stag Sans Round - Medium';
2229
+ }
2230
+
2231
+ .aino-container .aino-nav:before,
2232
+ .aino-container .aino-nav:after {
2233
+ content: "";
2234
+ display: table;
2235
+ }
2236
+
2237
+ .aino-container .aino-nav:after {
2238
+ clear: both;
2239
+ }
2240
+
2241
+ .aino-container .aino-weather{
2242
+ background-color: #f7f7f7;
2243
+ border-top: 1px solid #dadada;
2244
+ border-bottom: 1px solid #dadada;
2245
+ padding: 24px 0 18px;
2246
+ margin-top: 0;
2247
+ margin-bottom: 13px;
2248
+ overflow: auto;
2249
+ }
2250
+
2251
+ .aino-container .aino-weather .aino-nav{
2252
+ width: 600px;
2253
+ float: none;
2254
+ margin: 0 auto;
2255
+ padding:0 15px;
2256
+ }
2257
+
2258
+ .aino-deliver-to > li > a{
2259
+ width: 100%;
2260
+ box-shadow: none;
2261
+ margin-bottom: 0;
2262
+ border-top: 2px solid #f3f3f3;
2263
+ }
2264
+
2265
+ .aino-deliver-to > li > a > span{
2266
+ max-width: none;
2267
+ width: 85%;
2268
+ }
2269
+
2270
+
2271
+ .aino-deliver-to > li > a span span{
2272
+ width: auto;
2273
+ }
2274
+
2275
+
2276
+ .aino-tabs ul.aino-nav .aino-address-tab em,
2277
+ .aino-tabs ul.aino-nav .aino-business-tab em,
2278
+ .aino-tabs ul.aino-nav .aino-office-tab em,
2279
+ .aino-tabs ul.aino-nav .aino-mailbox-tab em{
2280
+ display: inline-block;
2281
+ }
2282
+
2283
+
2284
+ .aino-deliver-to > li > a .aino-delivery-price{
2285
+ float: right;
2286
+ }
2287
+ .aino-deliver-to > li > a .aino-delivery-price:first-child{
2288
+ display: none;
2289
+ }
2290
+
2291
+ .aino-deliver-to > li > a .aino-delivery-price:last-child{
2292
+ display: block;
2293
+ }
2294
+
2295
+ .aino-container .aino-textarea-holder{
2296
+ margin-bottom: 15px;
2297
+ }
2298
+
2299
+ .aino-deliver-to > li > .tab-list{
2300
+ position: static;
2301
+ width: 100%;
2302
+ padding: 0 15px;
2303
+ }
2304
+
2305
+ .aino-container .aino-footer > div{
2306
+ width: 100%;
2307
+ margin-right: 0;
2308
+ }
2309
+
2310
+ .aino-container .aino-footer .aino-button.gray{
2311
+ margin-right: 2%;
2312
+ }
2313
+
2314
+ .aino-container .aino-footer .aino-button{
2315
+ width: 49%;
2316
+ display: block;
2317
+ float: left;
2318
+ padding: 11px;
2319
+ }
2320
+
2321
+ .aino-container .aino-tabs-body .tab-list{
2322
+ width: 90%;
2323
+ }
2324
+
2325
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
2326
+ margin-left: 0;
2327
+ }
2328
+
2329
+ .aino-delivery-price:first-child{
2330
+ display: none;
2331
+ }
2332
+
2333
+ .aino-delivery-price:last-child{
2334
+ display: block;
2335
+ }
2336
+
2337
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context{
2338
+ float: none;
2339
+ width: 100%;
2340
+ padding-right: 0;
2341
+ }
2342
+
2343
+ .aino-container .aino-column-2 {
2344
+ display: none;
2345
+ width: 100%;
2346
+ position: static;
2347
+ }
2348
+
2349
+ .aino-container .aino-column-2 > ul{
2350
+ padding: 14px 25px;
2351
+ }
2352
+
2353
+ .aino-arrival,.aino-arrival ul{
2354
+ overflow: visible;
2355
+ height: auto;
2356
+ }
2357
+
2358
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
2359
+ display: none;
2360
+ }
2361
+
2362
+ .aino-container .aino-column-2 ul li{
2363
+ margin: 0 -49px 0 -50px;
2364
+ border-bottom: 1px solid #dadada;
2365
+ }
2366
+
2367
+ .aino-collapse-content{
2368
+ margin: 0;
2369
+ }
2370
+
2371
+ .aino-collapse-content ul li{
2372
+ margin: 0;
2373
+ }
2374
+
2375
+ .aino-collapse-content .aino-input{
2376
+ padding-left: 108px !important;
2377
+ }
2378
+
2379
+ .aino-collapse-content .aino-input .aino-indicator{
2380
+ left: 70px;
2381
+ }
2382
+
2383
+ .aino-container .aino-column-2 > div{
2384
+ display: none;
2385
+ }
2386
+
2387
+ .aino-container .aino-input{
2388
+ padding: 9px 0 9px 70px;
2389
+ color: #474747;
2390
+ border-bottom: none;
2391
+ }
2392
+
2393
+ .aino-container .aino-indicator{
2394
+ top: 9px;
2395
+ left: 30px;
2396
+ }
2397
+ .aino-container .aino-column-2 .aino-sub-nav{
2398
+ border-bottom: none;
2399
+ }
2400
+
2401
+ .aino-container .aino-collapse{
2402
+ margin: 0 -12px;
2403
+ padding: 9px 0 9px 82px !important;
2404
+ color: #474747 !important;
2405
+ border-bottom: 1px solid #dadada !important;
2406
+ }
2407
+
2408
+ .aino-container .aino-collapse-content li:last-child{
2409
+ border-bottom: none;
2410
+ }
2411
+
2412
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab]{
2413
+ background-color: #0099bb;
2414
+ border-top: 1px solid #028cb1;
2415
+ border-bottom: 1px solid #028cb1;
2416
+ color: #ffffff;
2417
+ margin: 0;
2418
+ padding: 9px 30px 9px 10px;
2419
+ }
2420
+
2421
+ .aino-map-container{
2422
+ float: none;
2423
+ margin: 0 0;
2424
+ width: auto !important;
2425
+ }
2426
+
2427
+ .aino-map-container .post-code-input{
2428
+ position: static;
2429
+ padding: 0 0;
2430
+ margin: 20px 0;
2431
+ text-align: center;
2432
+ }
2433
+
2434
+ .aino-map-container .aino-map,
2435
+ .aino-map-container .directions-display-type
2436
+ {
2437
+ display: none;
2438
+ }
2439
+
2440
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] span,
2441
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
2442
+ padding: 0;
2443
+ }
2444
+
2445
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab]:after{
2446
+ content: '';
2447
+ background: url("../../../images/vconnect/aio/aino-icons.png") no-repeat -31px -196px;
2448
+ width: 9px;
2449
+ height: 13px;
2450
+ display: block;
2451
+ margin-right: 0;
2452
+ margin-top: 2px;
2453
+ position: absolute;
2454
+ right: 10px;
2455
+ top: 11px;
2456
+ }
2457
+
2458
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab]:after{
2459
+ background-position: -13px -196px;
2460
+ width: 14px;
2461
+ margin-top: 0;
2462
+ }
2463
+
2464
+ .aino-container .delivery-context .aino-tab-sub-title,
2465
+ .aino-container .delivery-context p
2466
+ {
2467
+ margin: 15px 0;
2468
+ line-height: 19px;
2469
+ }
2470
+
2471
+ .aino-container .aino-inner-tabs > ul > li{
2472
+ margin-bottom: 0;
2473
+ }
2474
+ }
2475
+
2476
+ @media only screen and (max-width: 500px) {
2477
+ .aio-options select {
2478
+ width: 100%;
2479
+ }
2480
+ .aio-options textarea {
2481
+ width: 100%;
2482
+ }
2483
+ .postnord-description {
2484
+ width: 100%;
2485
+ }
2486
+ .nearest_point_container .vc-value {
2487
+ width: 100%;
2488
+ }
2489
+ }
2490
+
2491
+ @media only screen and (max-width: 360px) {
2492
+ button.aio-pick-btn{
2493
+ width: 100%;
2494
+ max-width: none;
2495
+ }
2496
+ }
2497
+
2498
+ .aino-nearest-data {
2499
+ border: 1px solid;
2500
+ display: inline-block;
2501
+ margin-bottom: 5px;
2502
+ margin-top: 5px;
2503
+ padding: 5px;
2504
+ width: 90%;
2505
+ }
2506
+
2507
+ .aino-container .aino-nearest-data {
2508
+ width: auto;
2509
+ display: block;
2510
+ padding: 0;
2511
+ border: none;
2512
+ }
2513
+ .sp-methods label[for^="s_method_vconnect_postnord"] {
2514
+ font-weight: bold;
2515
+ }
2516
+ #checkout-shipping-method-load .sp-methods dd .aio-options label[for^="vconnect_postnord"] {
2517
+ background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
2518
+ font-weight: bold;
2519
+ width: 100%;
2520
+ padding: 5px 0 0 0;
2521
+ }
2522
+
2523
+
2524
+ .all-in-one-container button, .all-in-one-container .form-button {
2525
+ background-image: none;
2526
+ }
skin/adminhtml/default/default/css/vconnect/aio/red.css ADDED
@@ -0,0 +1,2407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*reset*/
2
+ .all-in-one-container {
3
+ margin: 0;
4
+ padding: 0;
5
+ border: 0;
6
+ font-size: 16px; /*+*/
7
+ vertical-align: baseline;
8
+
9
+ }
10
+
11
+ .all-in-one-container table {
12
+ border-collapse: collapse;
13
+ border-spacing: 0;
14
+ }
15
+
16
+ /*reset*/
17
+
18
+ /*clearfix*/
19
+ .cf:before,
20
+ .cf:after {
21
+ content: "";
22
+ display: table;
23
+ }
24
+
25
+ .cf:after {
26
+ clear: both;
27
+ }
28
+
29
+ .cf {
30
+ zoom: 1; /* For IE 6/7 (trigger hasLayout) */
31
+ }
32
+
33
+ /*clearfix*/
34
+ @font-face {
35
+ font-family: 'Stag Sans Round - Medium';
36
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf');
37
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Medium.otf') format('truetype');
38
+ }
39
+
40
+ @font-face {
41
+ font-family: 'Stag Sans Round - Book';
42
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf');
43
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Book.otf') format('truetype');
44
+ }
45
+
46
+ @font-face {
47
+ font-family: 'Stag Sans Round - Light';
48
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf');
49
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Light.otf') format('truetype');
50
+ }
51
+
52
+ @font-face {
53
+ font-family: 'Stag Sans Round - Semibold';
54
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf');
55
+ src: url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf?#iefix') format('embedded-opentype'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('woff2'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('woff'), url('../../../fonts/vconnect/aio/Stag Sans Round - Semibold.otf') format('truetype');
56
+ }
57
+
58
+ /*checkbox*/
59
+ .aino-container .aino-input {
60
+ position: relative;
61
+ cursor: pointer;
62
+ display: block !important;
63
+ padding: 15px 15px 15px 60px;
64
+ border-bottom: 2px solid #f3f3f3;
65
+ margin-bottom: 0;
66
+ }
67
+
68
+ .aino-container .aino-input > input {
69
+ position: absolute;
70
+ z-index: -1;
71
+ opacity: 0;
72
+ display: none;
73
+ }
74
+
75
+ .aino-container .aino-indicator {
76
+ position: absolute;
77
+ top: 13px;
78
+ left: 10px;
79
+ display: block;
80
+ line-height: 1rem;
81
+ user-select: none;
82
+ width: 20px;
83
+ height: 16px;
84
+ }
85
+
86
+ .aino-container .aino-input > input:checked ~ .aino-indicator,
87
+ .aino-container .aino-input > input[checked] ~ .aino-indicator{
88
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat 0 -108px;
89
+ }
90
+
91
+ .page-navigation li a:hover{
92
+ background-color: #cc0000;
93
+ }
94
+
95
+ .aino-cover {
96
+ width: 100%;
97
+ height: 100%;
98
+ position: fixed;
99
+ top: 0;
100
+ right: 0;
101
+ bottom: 0;
102
+ left: 0;
103
+ background-color: rgba(0, 0, 0, 0.7);
104
+ z-index: 1060;
105
+ }
106
+
107
+ .aino-container {
108
+ width: 100%;
109
+ position: fixed;
110
+ top: 10%;
111
+ bottom: 10%;
112
+ z-index: 9999999999;
113
+ outline: 0;
114
+ }
115
+ .aino-container .aino-core{
116
+ background-color: #fff;
117
+ font-family: 'Stag Sans Round - Medium';
118
+ margin: 0 auto;
119
+ border: 1px solid #000;
120
+ font-size: 16px;
121
+ text-align: left;
122
+ }
123
+
124
+ .aino-container *{
125
+ box-sizing: border-box;
126
+ }
127
+
128
+ .aino-container.desktop .aino-core{
129
+ width: 1155px;
130
+ height: 100%;
131
+ padding: 23px 16px 0;
132
+ color: #000;
133
+ }
134
+
135
+ .aino-container.mobile .aino-core{
136
+ width: 100%;
137
+ height:100%;
138
+ }
139
+
140
+ .aino-container .aino-header .postnord-logo {
141
+ width: 22%;
142
+ float: left;
143
+ text-align: center;
144
+ margin-bottom: 13px;
145
+ margin-top: 0 !important;
146
+ }
147
+
148
+ .aino-container .aino-header .postnord-logo span {
149
+ /*background: url(../images/PostDKLogo.svg.png) no-repeat;*/
150
+ background: url(../../../images/vconnect/aio/PostDKLogo.svg.png) no-repeat;
151
+ background-size: 100%;
152
+ display: inline-block;
153
+ width: 166px;
154
+ height: 48px;
155
+ margin: 5px;
156
+ outline: none;
157
+ overflow: hidden;
158
+ text-indent: -999px;
159
+ white-space: nowrap;
160
+ z-index: 2;
161
+ }
162
+
163
+ .aino-container .aino-nav {
164
+ list-style-type: none;
165
+ padding: 0;
166
+ }
167
+
168
+ .aino-container .aino-inner-tabs > .aino-nav
169
+ {
170
+ position: relative;
171
+ margin-top: 16px;
172
+ }
173
+
174
+ .aino-container > .aino-core > .aino-tabs,
175
+ .aino-container .aino-inner-tabs
176
+ {
177
+ height: 84%;
178
+ }
179
+
180
+ .aino-deliver-to {
181
+ width: 100%;
182
+ position: relative;
183
+ }
184
+
185
+ .aino-deliver-to > li > a {
186
+ background-color: #fafafa;
187
+ color: #cc0000;
188
+ display: block;
189
+ padding: 16px 26px;
190
+ text-decoration: none;
191
+ line-height: 20px;
192
+ box-shadow: 3px 3px 0 #e5e5e5;
193
+ margin-bottom: 20px;
194
+ margin-right: 30px;
195
+ width: 22.5%;
196
+ }
197
+
198
+ .aino-deliver-to > li > a:before {
199
+ content: '';
200
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat;
201
+ display: inline-block;
202
+ margin-right: 28px;
203
+ vertical-align: middle;
204
+ }
205
+
206
+ .aino-deliver-to > li > .tab-list{
207
+ position: absolute;
208
+ width: 74%;
209
+ top: 0;
210
+ left: 25%;
211
+ }
212
+
213
+ .aino-deliver-to .aino-mailbox-tab > a:before {
214
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") -1px -273px;
215
+ width: 20px;
216
+ height: 14px;
217
+ }
218
+
219
+ .aino-deliver-to .aino-mailbox-tab > a:hover:before,
220
+ .aino-deliver-to .aino-mailbox-tab.ui-state-active > a:before {
221
+ background-position: -23px -273px;
222
+ }
223
+
224
+ .aino-deliver-to .aino-address-tab > a:before {
225
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") -23px 0;
226
+ width: 20px;
227
+ height: 18px;
228
+ }
229
+
230
+ .aino-deliver-to .aino-address-tab > a:hover:before,
231
+ .aino-deliver-to .aino-address-tab.ui-state-active > a:before {
232
+ background-position: 0 0;
233
+ }
234
+
235
+ .aino-deliver-to .aino-office-tab > a:before {
236
+ background-position: -23px -23px;
237
+ width: 20px;
238
+ height: 21px;
239
+ }
240
+
241
+ .aino-deliver-to > li > a span{
242
+ display: inline-block;
243
+ vertical-align: middle;
244
+ line-height: 20px;
245
+ }
246
+ .aino-deliver-to .aino-international-tab > a:before {
247
+ background-position: -2px -250px;
248
+ width: 21px;
249
+ height: 21px;
250
+ }
251
+
252
+ .aino-deliver-to .aino-international-tab.ui-state-active > a:before,
253
+ .aino-deliver-to .aino-international-tab:hover > a:before{
254
+ background-position: -23px -249px;
255
+ }
256
+
257
+ .aino-deliver-to .aino-office-tab.ui-state-active > a:before,
258
+ .aino-deliver-to .aino-office-tab > a:hover:before {
259
+ background-position: 0 -23px;
260
+ }
261
+
262
+ .aino-deliver-to .aino-business-tab > a:before {
263
+ background-position: -23px -44px;
264
+ width: 20px;
265
+ height: 21px;
266
+ }
267
+
268
+ .aino-deliver-to .aino-business-tab.ui-state-active > a:before,
269
+ .aino-deliver-to .aino-business-tab > a:hover:before {
270
+ background-position: 0 -44px;
271
+ }
272
+
273
+
274
+ .aino-tabs-body .aino-smart-delivery .toggle-calendar{
275
+ text-align: left;
276
+ }
277
+
278
+ .aino-tabs-body .aino-smart-delivery .mounth-day{
279
+ display: none;
280
+ }
281
+
282
+ .aino-deliver-to .aino-smartdelivery-tab > a:before {
283
+ background-position: 0 -358px;
284
+ width: 20px;
285
+ height: 20px;
286
+ }
287
+
288
+ .aino-deliver-to .aino-smartdelivery-tab.ui-state-active > a:before,
289
+ .aino-deliver-to .aino-smartdelivery-tab > a:hover:before {
290
+ background-position: -22px -358px;
291
+ }
292
+
293
+ .aino-deliver-to .ui-state-active{
294
+ border:none !important;
295
+ background: none !important;
296
+ font-weight: normal;
297
+ color: inherit;
298
+ }
299
+
300
+ .aino-deliver-to > li > a .aino-delivery-price{
301
+ line-height: 20px;
302
+ }
303
+
304
+ .aino-deliver-to > .ui-state-active > a,
305
+ .aino-deliver-to > li > a:hover,
306
+ .aino-deliver-to > li > a:hover .aino-delivery-price,
307
+ .aino-deliver-to > .ui-state-active > a .aino-delivery-price {
308
+ background-color: #cc0000;
309
+ color: #fff;
310
+ transition: none;
311
+ }
312
+
313
+ .aino-deliver-to > li > a i{
314
+ font-style: italic;
315
+ }
316
+
317
+ .aino-container li:focus,
318
+ .aino-container li a:focus,
319
+ .aino-container li button:focus {
320
+ outline: none;
321
+ }
322
+
323
+ .aino-container .aino-tabs-body {
324
+ width: 75%;
325
+ }
326
+ .aino-container .aino-tabs-body .aino-tabs-body {
327
+ margin-top: 16px;
328
+ }
329
+
330
+ .aino-container .aino-tabs-body .tab-list:not(:first-child){
331
+ display: none;
332
+ }
333
+
334
+ .aino-container .aino-tabs-body .tab-list{
335
+ width: 80%;
336
+ position: absolute;
337
+ }
338
+
339
+ .aino-container .aino-tabs-body,
340
+ .aino-container .aino-nav {
341
+ float: left;
342
+ margin-top: 0;
343
+ margin-bottom:0;
344
+ }
345
+
346
+ .aino-container .aino-tabs-body .aino-heading {
347
+ color: #a29a9b;
348
+ }
349
+
350
+ .aino-container .aino-tabs-body {
351
+ font-family: 'Stag Sans Round - Book'!important;
352
+ }
353
+
354
+ .aino-container .aino-tabs-body .aino-tabs,
355
+ .aino-container .aino-inner-tabs{
356
+ border-top: 2px solid #f6f6f6;
357
+ }
358
+
359
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
360
+ content: '';
361
+ border-top: 4px solid #cc0000;
362
+ display: block;
363
+ margin-top: -19px;
364
+ margin-bottom: 15px;
365
+ }
366
+
367
+ .aino-container .aino-column > .aino-tabs > ul > li ,
368
+ .aino-container .aino-inner-tabs > ul > li{
369
+ margin-bottom: 19px;
370
+ }
371
+ .aino-container .aino-tabs-body .aino-inner-tabs p,
372
+ .aino-container .aino-tabs-body > div{
373
+ line-height: 19px;
374
+ }
375
+
376
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab]{
377
+ text-decoration: none;
378
+ color: #000;
379
+ font-size: 20px!important;
380
+ display: block;
381
+ border-bottom: 2px solid #f6f6f6;
382
+ margin: 18px 0 16px;
383
+ font-family: 'Stag Sans Round - Medium'!important;
384
+ position: relative;
385
+ }
386
+
387
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab] label{
388
+ cursor: pointer;
389
+ }
390
+
391
+ .aino-container .tab-list.aino-column .aino-inner-tabs [role=tab]:after {
392
+ content: '';
393
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat 0 -67px;
394
+ display: block;
395
+ position: absolute;
396
+ top: 14px;
397
+ right: 16px;
398
+ width: 10px;
399
+ height: 16px;
400
+ }
401
+
402
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] span {
403
+ padding: 13px 30px 13px 0;
404
+ display: block;
405
+ line-height: 19px;
406
+ }
407
+
408
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
409
+ background-color: #cc0000;
410
+ color: #fff;
411
+ margin-left: -14px;
412
+ padding: 13px 30px 13px 14px;
413
+ }
414
+
415
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab]:after{
416
+ background-position: -14px -67px;
417
+ }
418
+
419
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context{
420
+ float: left;
421
+ width: 43%;
422
+ }
423
+
424
+ .aino-container .aino-column-2{
425
+ display: none;
426
+ width: 50%;
427
+ position: absolute;
428
+ right: 0;
429
+ top: 0;
430
+ }
431
+
432
+ .aino-container .aino-column-2 ul {
433
+ width: 100%;
434
+ position: relative;
435
+ z-index: 3;
436
+ }
437
+
438
+ .aino-container .aino-column-2 ul li {
439
+ padding: 0 23px;
440
+ }
441
+
442
+ .aino-container .aino-column-2 ul li.aino-active {
443
+ background-color: #f8f8f8;
444
+ }
445
+
446
+ .aino-container .aino-column-2 > div {
447
+ padding: 11px 24px 23px;
448
+ border-bottom: 2px solid #efefef;
449
+ }
450
+
451
+ .aino-container .aino-column-2 > div .close,
452
+ .aino-container .aino-column-2 > div .close-inner{
453
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat 0 -88px;
454
+ width: 20px;
455
+ height: 20px;
456
+ display: inline-block;
457
+ float: right;
458
+ cursor: pointer;
459
+ opacity: 1;
460
+ }
461
+
462
+ .aino-container .aino-column-2 .aino-input{
463
+ color: #000;
464
+ }
465
+
466
+
467
+ .aino-container .aino-textarea-holder{
468
+ padding-right: 23px;
469
+ display: none;
470
+ }
471
+
472
+ .aino-container textarea{
473
+ border:2px solid #e5e5e5;
474
+ outline: none;
475
+ padding: 10px;
476
+ width:100%;
477
+ font-family: 'Stag Sans Round - Light';
478
+ resize: none;
479
+ }
480
+
481
+ .aino-map-container {
482
+ width: 47%;
483
+ float: left;
484
+ position: relative;
485
+ margin-right: -15px;
486
+ margin-top: -73px;
487
+ }
488
+
489
+ .address-near-you {
490
+ width: 32%;
491
+ float: left;
492
+ height: 685px;
493
+ overflow: auto;
494
+ background-color: transparent;
495
+ padding-left: 15px;
496
+ margin-top: -73px;
497
+ }
498
+
499
+ .alt-scroll-holder, .alt-scroll-content{
500
+ width: 100% !important;
501
+ }
502
+
503
+ .address-near-you ul {
504
+ width: 100%;
505
+ padding-left: 15px;
506
+ margin-left: -15px;
507
+ }
508
+
509
+ .address-near-you ul > li {
510
+ background-color: #f8f8f8;
511
+ position: relative;
512
+ font-family: 'Roboto', sans-serif;
513
+ font-size: 12px;
514
+ border-bottom: 1px solid #fff;
515
+ cursor: pointer;
516
+ }
517
+
518
+ .address-near-you ul > li .aino-input{
519
+ border: none;
520
+ }
521
+
522
+ .address-near-you li.active {
523
+ margin-left: -17px;
524
+ margin-top: -1px;
525
+ padding: 0 0 0 17px;
526
+ }
527
+
528
+ .address-near-you li.active > div{
529
+ border-bottom: 4px solid #dfdfdf;
530
+ margin-bottom: -5px;
531
+ z-index: 10;
532
+ position: relative;
533
+ }
534
+
535
+ .address-near-you li:hover .aino-index,
536
+ .address-near-you li:hover .aino-title{
537
+ color: #B51422 !important;
538
+ font-weight:800;
539
+ }
540
+
541
+ .address-near-you li:hover .aino-address{
542
+ font-family:'Stag Sans Round - book';
543
+ color: #B51422 !important;
544
+ }
545
+
546
+ .address-near-you li.active .aino-distance {
547
+ left: 0;
548
+ height: 95%;
549
+ }
550
+
551
+ .address-near-you li.active .aino-index {
552
+ color: #cc0000;
553
+ }
554
+
555
+ .address-near-you li.active,
556
+ .address-near-you li.active .aino-distance {
557
+ background-color: #fff;
558
+ }
559
+
560
+ .address-near-you .aino-distance {
561
+ position: absolute;
562
+ top: 0;
563
+ left: 0;
564
+ height: 100%;
565
+ width: 60px;
566
+ text-align: center;
567
+ letter-spacing: 0.5px;
568
+ background-color: #ebebeb;
569
+ color: #000;
570
+ }
571
+
572
+ .address-near-you .aino-distance span {
573
+ display: block;
574
+ font-size: 20px;
575
+ position: relative;
576
+ top: 25%;
577
+ }
578
+
579
+ .address-near-you .aino-title {
580
+ color: #cc0000;
581
+ text-transform: uppercase;
582
+ }
583
+
584
+ .address-near-you .aino-title,
585
+ .address-near-you .aino-address,
586
+ .address-near-you .aino-rating{
587
+ float: right;
588
+ width: 80%;
589
+ }
590
+
591
+
592
+ .address-near-you .aino-index {
593
+ font-size: 18px;
594
+ float: left;
595
+ margin-top:-4px;
596
+ text-align: right;
597
+ margin-left: 9px;
598
+ }
599
+
600
+ .address-near-you .aino-address {
601
+ font-family: 'Stag Sans Round - Light';
602
+ line-height: 17px;
603
+ }
604
+
605
+ .aino-rating {
606
+ padding: 9px 0;
607
+ }
608
+
609
+ .aino-rating .aino-star.active {
610
+ background-position: -1px -126px;
611
+ }
612
+
613
+ .aino-rating .aino-star {
614
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat;
615
+ background-position: -20px -126px;
616
+ width: 13px;
617
+ height: 13px;
618
+ display: inline-block;
619
+ margin-right: 3px;
620
+ }
621
+
622
+ .aino-footer > div {
623
+ float: right;
624
+ margin-right: 10px;
625
+ }
626
+
627
+ .aino-footer .aino-button {
628
+ width: 280px;
629
+ border: none;
630
+ text-transform: uppercase;
631
+ color: #fff;
632
+ padding: 12px;
633
+ font-weight: bold;
634
+ font-family: 'Roboto', sans-serif;
635
+ cursor: pointer;
636
+ outline: none;
637
+ }
638
+
639
+ .aino-footer .aino-button.blue {
640
+ background-color: #cc0000;
641
+ }
642
+
643
+ .aino-footer .aino-button.gray {
644
+ background-color: #878787;
645
+ }
646
+
647
+ .aino-label {
648
+ color: #cc0000;
649
+ background-color: #fff;
650
+ position: relative;
651
+ z-index: -1;
652
+ text-align: center;
653
+ padding-top: 10px;
654
+ background: url(../../../images/vconnect/aio/not-active-pin-red.png) no-repeat 0 0;
655
+ width: 27px;
656
+ height: 35px;
657
+ font-size: 12px;
658
+ font-weight: bold;
659
+ }
660
+
661
+ .aino-label.active {
662
+ background: url(../../../images/vconnect/aio/active-pin-red-3.png) no-repeat 0 0;
663
+ color: #fff;
664
+ text-shadow: 1px 1px #000;
665
+ }
666
+
667
+ .aino-weather {
668
+ margin-top: 16px;
669
+ }
670
+
671
+ .weather-temp-day sup {
672
+ display: inline-block;
673
+ vertical-align: super;
674
+ font-size: 60%;
675
+ }
676
+
677
+ .aino-weather .aino-nav {
678
+ margin-left: 5%;
679
+ width: 72%;
680
+ }
681
+
682
+ .aino-weather .aino-nav li{
683
+ width: 20%;
684
+ float: left;
685
+ }
686
+
687
+ .aino-weather .aino-nav li > div {
688
+ float: left;
689
+ font-family: 'Roboto', sans-serif;
690
+ font-size: 20px;
691
+ cursor: default;
692
+ }
693
+
694
+ .aino-weather .aino-nav li .weather-temp-day span {
695
+ display: block;
696
+ }
697
+
698
+ .aino-weather .aino-nav li .weather-icon {
699
+ margin-right: 12px;
700
+ }
701
+
702
+ .aino-weather .aino-nav li .aion-weather-day {
703
+ font-size: 12px;
704
+ text-transform: uppercase;
705
+ line-height: 20px;
706
+ margin-top: -9px;
707
+ }
708
+
709
+ .aino-weather .aino-nav li .aion-weather-temp {
710
+ letter-spacing: 1.2px;
711
+ }
712
+
713
+ .zipcode-holder{
714
+ position: absolute;
715
+ top: 10px;
716
+ right: 0px;
717
+ width:75%;
718
+ text-align: right;
719
+ }
720
+
721
+ .post-code-input, .directions-display-type{
722
+ float: right;
723
+ margin-right:15px;
724
+ }
725
+
726
+ .post-code-input {
727
+ padding: 5px 5px 5px 16px;
728
+ font-family: 'Roboto', sans-serif !important;
729
+ font-size: 12px !important;
730
+ font-weight: 500 !important;
731
+ text-transform: uppercase;
732
+ background-color: #fff;
733
+ color: #6e6e6e;
734
+ }
735
+
736
+ .post-code-input input {
737
+ width: 72px;
738
+ height: 26px;
739
+ border-radius: 4px;
740
+ border: 1px solid #dfdfdf;
741
+ color: #000;
742
+ text-align: center;
743
+ margin-left: 12px;
744
+ margin-right: 4px;
745
+ outline: none;
746
+ }
747
+
748
+ .post-code-input button {
749
+ background: none;
750
+ border: none;
751
+ padding: 5px 10px;
752
+ }
753
+
754
+ .post-code-input button span {
755
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -3px -140px;
756
+ width: 12px;
757
+ height: 10px;
758
+ display: block;
759
+ }
760
+
761
+ .aino-map-container .directions-display-type{
762
+ margin-top:5px;
763
+ }
764
+
765
+ .aino-map-container .directions-display-type > button{
766
+ padding: 5px;
767
+ background-color: #fff;
768
+ border: none;
769
+ border-radius: 1px;
770
+ box-shadow: 2px 2px 2px #e5e5e5;
771
+ margin: 0 1px;
772
+ outline: none;
773
+ cursor: pointer;
774
+ }
775
+
776
+ .aino-map-container .directions-display-type > button > span{
777
+ width: 16px;
778
+ height: 16px;
779
+ display: block;
780
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat;
781
+ }
782
+
783
+ .aino-map-container .aino-map-driving span{
784
+ background-position: -3px -287px !important;
785
+ }
786
+
787
+ .aino-map-container .aino-map-walking span{
788
+ background-position: -3px -304px !important;
789
+ }
790
+
791
+ .aino-map-container .aino-map-transit span{
792
+ background-position: -24px -287px !important;
793
+ }
794
+
795
+ .aino-map .aino-info-window {
796
+ font-family: 'Stag Sans Round - Book'!important;
797
+ margin: 0 -23px 0 0;
798
+ color:#000;
799
+ }
800
+
801
+ .aino-map .aino-info-window b,
802
+ .aino-map .aino-info-window span {
803
+ font-family: 'Stag Sans Round - Semibold';
804
+ text-transform: uppercase;
805
+ font-size: 12px;
806
+ width: 60px;
807
+ display: inline-block;
808
+ }
809
+
810
+ .aino-map .aino-info-window span {
811
+ width: auto;
812
+ max-width: 95px;
813
+ margin-bottom: 20px;
814
+ }
815
+
816
+ .aino-map .aino-info-window img {
817
+ width: 61px;
818
+ height: 17px;
819
+ margin-bottom: -2px;
820
+ margin-left: 22px;
821
+ float: right;
822
+ }
823
+
824
+ .aino-map .gm-style-iw div {
825
+ overflow: visible !important;
826
+ }
827
+
828
+ .aino-map .gm-style > div:first-child > div:nth-child(4)
829
+ > div:nth-child(4) > div:first-child > div:first-child > div:last-child{
830
+ border: 2px solid #cc0000;
831
+ }
832
+
833
+ .aino-map .gm-style > div:first-child > div:nth-child(4)
834
+ > div:nth-child(4) > div:first-child > div:first-child > div:not(:last-child) {
835
+ display: none;
836
+ }
837
+
838
+ .aino-map .gm-style .gm-style-iw {
839
+ overflow: visible;
840
+ }
841
+
842
+ .aino-map .gm-style-iw:before {
843
+ content: '';
844
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -4px -175px;
845
+ width: 17px;
846
+ height: 18px;
847
+ position: absolute;
848
+ bottom: -17px;
849
+ left: 84px;
850
+ z-index: 9;
851
+ }
852
+
853
+ .aino-map .gm-style-iw + div {
854
+ top: -9px !important;
855
+ right: -13px !important;
856
+ width: 22px !important;
857
+ height: 22px !important;
858
+ opacity: 1 !important;
859
+ }
860
+
861
+ .aino-map .gm-style-iw + div:after {
862
+ content: '';
863
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat 0 -152px;
864
+ display: block;
865
+ width: 22px;
866
+ height: 22px;
867
+ }
868
+
869
+ .aino-map .gm-style-iw + div img {
870
+ display: none;
871
+ }
872
+
873
+ /*mobile styles*/
874
+ .aino-container.mobile{
875
+ display: none;
876
+ padding: 0;
877
+ font-family: 'Stag Sans Round - Book'!important;
878
+ }
879
+
880
+ .aino-container.mobile .aino-header{
881
+ text-align: center;
882
+ margin-top: 14px;
883
+ }
884
+
885
+ .aino-container.mobile .aino-header .postnord-logo{
886
+ width: auto;
887
+ float: none;
888
+ }
889
+
890
+ .aino-container.mobile .aino-footer > div{
891
+ float: none;
892
+ margin-right:0 !important;
893
+ }
894
+
895
+ .aino-container.mobile .aino-footer{
896
+ padding: 0 15px;
897
+ }
898
+
899
+ .aino-container.mobile .aino-footer .aino-button{
900
+ width: 49%;
901
+ display: block;
902
+ float: left;
903
+ padding: 11px;
904
+ }
905
+
906
+ .aino-container.mobile .aino-footer .aino-button.gray{
907
+ margin-right:2%;
908
+ }
909
+
910
+ .aino-container.mobile .aino-body{
911
+ margin-bottom: 14px;
912
+ height: 76%;
913
+ overflow: auto;
914
+ }
915
+
916
+ .aino-container.mobile .aino-body .aino-nav li a{
917
+ border-top: 2px solid #f3f3f3;
918
+ font-family: 'Stag Sans Round - Medium'!important;
919
+ }
920
+
921
+ .aino-container.mobile .aino-body .aino-nav li:last-child > a{
922
+ border-bottom: 2px solid #f3f3f3;
923
+ }
924
+
925
+ .aino-container.mobile .aino-body .aino-collapse{
926
+ color: #cc0000;
927
+ background-color: #f8f8f8;
928
+ display: block;
929
+ padding: 17px 14px;
930
+ cursor: pointer;
931
+ position: relative;
932
+ }
933
+
934
+ .aino-container.mobile .aino-body .aino-collapse-content{
935
+ padding: 14px 25px;
936
+ }
937
+
938
+ .aino-collapse-content{
939
+ display: none;
940
+ }
941
+
942
+ .aino-container.desktop .aino-collapse{
943
+ display: block;
944
+ padding: 15px 30px 15px 80px;
945
+ border-bottom: 2px solid #f3f3f3;
946
+ cursor: pointer;
947
+ }
948
+
949
+ .aino-container.desktop .aino-collapse:after{
950
+ content: '';
951
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -3px -325px;
952
+ width: 9px;
953
+ height: 13px;
954
+ display: block;
955
+ float: right;
956
+ margin-right: -13px;
957
+ }
958
+
959
+ .aino-container.desktop .aino-collapse.active:after{
960
+ background-position: -18px -325px;
961
+ width: 14px;
962
+ margin-right: 19px;
963
+ }
964
+
965
+ .aino-container.mobile .aino-body .aino-collapse-content textarea{
966
+ display: none;
967
+ width:90%;
968
+ margin-bottom: 15px;
969
+ }
970
+
971
+ .aino-container.mobile .aino-body .aino-collapse:before{
972
+ content: '';
973
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -2px -196px;
974
+ width: 9px;
975
+ height:13px;
976
+ display: block;
977
+ float: left;
978
+ margin-right: 25px;
979
+ }
980
+
981
+ .aino-container.mobile .aino-body .aino-collapse.active{
982
+ background-color: #cc0000;
983
+ color: #ffffff;
984
+ }
985
+
986
+ .aino-container.mobile .aino-body .aino-collapse.active:before{
987
+ background-position: -13px -196px;
988
+ width: 14px;
989
+ margin-right: 19px;
990
+ }
991
+
992
+ .aino-container.mobile .aino-body .aino-nav li .aino-collapse.active{
993
+ border-color: #cc0000;
994
+ }
995
+
996
+ .aino-container.mobile .aino-body .aino-nav li .aino-collapse.active div{
997
+ color: #fff;
998
+ }
999
+
1000
+ .aino-container.mobile .aino-body .aino-collapse div{
1001
+ float: right;
1002
+ color: #434343;
1003
+ }
1004
+
1005
+ .aino-container.mobile .aino-body .aino-collapse .mounth-day{
1006
+ float: left;
1007
+ margin-right: 10px;
1008
+ color: #fff;
1009
+ }
1010
+
1011
+ .aino-container.mobile .aino-weather{
1012
+ margin-left: -25px;
1013
+ margin-right: -25px;
1014
+ background-color: #f7f7f7;
1015
+ border-top: 1px solid #dadada;
1016
+ border-bottom: 1px solid #dadada;
1017
+ padding: 24px 0 18px;
1018
+ margin-top: 0;
1019
+ overflow: auto;
1020
+ }
1021
+
1022
+
1023
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse{
1024
+ background-color: #cc0000;
1025
+ border-top: 1px solid #cc0000;
1026
+ border-bottom: 1px solid #cc0000;
1027
+ color: #ffffff;
1028
+ margin: 0 -11px;
1029
+ padding: 9px 13px 9px 10px;
1030
+ }
1031
+
1032
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse .pull-right{
1033
+ margin-right:15px;
1034
+ color: #fff;
1035
+ }
1036
+
1037
+ .aino-container.mobile .aino-collapse-content .aino-nav li:last-child > a{
1038
+ border-bottom: 1px solid #cc0000;
1039
+ }
1040
+
1041
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse:before{
1042
+ display: none;
1043
+ }
1044
+
1045
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse:after{
1046
+ content: '';
1047
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -31px -196px;
1048
+ width: 9px;
1049
+ height:13px;
1050
+ display: block;
1051
+ margin-right: 0;
1052
+ margin-top: 2px;
1053
+ position: absolute;
1054
+ right: 10px;
1055
+ top:9px;
1056
+ }
1057
+
1058
+ .aino-container.mobile .aino-collapse-content .aino-nav .aino-collapse.active:after {
1059
+ background-position: -13px -196px;
1060
+ width: 14px;
1061
+ margin-top:0;
1062
+ }
1063
+
1064
+ .aino-container.mobile .aino-collapse-content p{
1065
+ margin: 15px 0;
1066
+ line-height: 19px;
1067
+ }
1068
+
1069
+ .aino-container.mobile .aino-collapse-content .aino-nav .active .aino-input{
1070
+ background-color: #f8f8f8;
1071
+ color: #000;
1072
+ }
1073
+
1074
+ .aino-container.mobile .aino-collapse-content .active .aino-title,
1075
+ .aino-container.mobile .aino-collapse-content .active .aino-address
1076
+ {
1077
+ color: #cc0000;
1078
+ }
1079
+
1080
+ .aino-container.mobile .aino-collapse-content .aino-input{
1081
+ margin:0 -50px;
1082
+ padding: 9px 0 9px 70px;
1083
+ color: #474747;
1084
+ border-bottom: 1px solid #dadada;
1085
+ }
1086
+
1087
+ .aino-container.mobile .aino-collapse-content .aino-indicator{
1088
+ left: 24px;
1089
+ top: 9px;
1090
+ }
1091
+ .aino-container.mobile .post-code-input{
1092
+ position: static;
1093
+ width: 100%;
1094
+ text-align: center;
1095
+ padding: 5px 0;
1096
+ }
1097
+
1098
+ .aino-container.mobile .aino-collapse-content .aino-result-list.active > div{
1099
+ background-color: #f8f8f8;
1100
+ color: #cc0000;
1101
+ }
1102
+
1103
+ .aino-container.mobile .aino-collapse-content .aino-result-list > div{
1104
+ border-bottom: 2px solid #f2f2f2;
1105
+ background-color: #fff;
1106
+ margin: 0 -25px;
1107
+ padding: 15px;
1108
+ line-height: 20px;
1109
+ font-size: 15px;
1110
+ }
1111
+
1112
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input{
1113
+ border:none;
1114
+ margin: 0;
1115
+ position: relative;
1116
+ padding-left: 49px;
1117
+ }
1118
+
1119
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input .aino-indicator{
1120
+ left: 7px;
1121
+ }
1122
+
1123
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-input:before{
1124
+ content: '';
1125
+ background:url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -3px -211px;
1126
+ display: block;
1127
+ width: 36px;
1128
+ height: 36px;
1129
+ position: absolute;
1130
+ top: 31px;
1131
+ left: -1px;
1132
+ }
1133
+
1134
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-distance{
1135
+ float: right;
1136
+ font-size: 11px;
1137
+ color: #a6a6a6;
1138
+ }
1139
+
1140
+ .aino-container.mobile .aino-collapse-content .aino-result-list .aino-open-hours{
1141
+ font-size: 11px;
1142
+ color: #a6a6a6;
1143
+ margin-top: 12px;
1144
+ line-height: 11px;
1145
+ }
1146
+
1147
+ .aino-container .aino-nav .aino-open-hours{
1148
+ font-size: 11px;
1149
+ color: #a6a6a6;
1150
+ margin-top: 12px;
1151
+ line-height: 11px;
1152
+ }
1153
+
1154
+ .nicescroll-rails{
1155
+ background-color: #8d8d8d !important;
1156
+ width: 5px !important;
1157
+ border-radius: 5px;
1158
+ z-index: 10;
1159
+ }
1160
+
1161
+ .nicescroll-rails ins{
1162
+ background-color: #e6e6e6;
1163
+ width: 5px;
1164
+ }
1165
+
1166
+ .see-more-locations{
1167
+ text-align: center;
1168
+ padding-top: 12px;
1169
+ cursor: pointer;
1170
+ }
1171
+
1172
+ .aino-tab-sub-title{
1173
+ color: #888;
1174
+ line-height: 21px;
1175
+ font-size: 14px;
1176
+ margin-bottom: -10px;
1177
+ }
1178
+
1179
+ .pull-right{
1180
+ float: right;
1181
+ }
1182
+
1183
+ .aino-inner-tabs .mounth-day{
1184
+ float: left;
1185
+ margin-right:1.5rem;
1186
+ }
1187
+
1188
+ .aino-inner-tabs a[role="tab"] .pull-right{
1189
+ margin-right:15px;
1190
+ }
1191
+
1192
+ .aino-delivery-time-picker li label:before{
1193
+ content: 'kl. ';
1194
+ }
1195
+
1196
+ .aino-delivery-time-picker .mounth-day{
1197
+ display: none;
1198
+ }
1199
+
1200
+ .delivery-time-title{
1201
+ height:45px;
1202
+ padding-top: 25px !important;
1203
+ border-bottom: 2px solid #efefef;
1204
+ }
1205
+
1206
+ .delivery-time-title i{
1207
+ position: absolute;
1208
+ left: 25px;
1209
+ font-style: normal;
1210
+ }
1211
+
1212
+ .toggle-calendar {
1213
+ display: none;
1214
+ background-color: #cc0000;
1215
+ color: #fff;
1216
+ margin: 0px -15px;
1217
+ padding: 13px 30px 13px 14px;
1218
+ cursor: pointer;
1219
+ font-size: 20px!important;
1220
+ font-family: 'Stag Sans Round - Book'!important;
1221
+ text-align: center;
1222
+ position: relative;
1223
+ }
1224
+
1225
+ .toggle-calendar:after{
1226
+ content: '';
1227
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -14px -67px;
1228
+ display: block;
1229
+ position: absolute;
1230
+ top: 14px;
1231
+ right: 16px;
1232
+ width: 10px;
1233
+ height: 16px;
1234
+ }
1235
+
1236
+ .aino-calendar-holder,.delivery-time{
1237
+ border-bottom:none !important;
1238
+ }
1239
+
1240
+ .aino-calendar-holder{
1241
+ padding-bottom: 0 !important;
1242
+ padding-top: 0 !important;
1243
+ }
1244
+
1245
+ .aino-smart-delivery .aino-calendar-holder{
1246
+ padding: 0 15px;
1247
+ }
1248
+
1249
+ .delivery-time{
1250
+ padding: 0 !important;
1251
+ position: relative;
1252
+ z-index: 2;
1253
+ display: none;
1254
+ width:100% !important;
1255
+ }
1256
+
1257
+ .delivery-time .close-inner{
1258
+ position: absolute;
1259
+ right: 24px;
1260
+ }
1261
+
1262
+ .aino-delivery-time-picker{
1263
+ height:370px;
1264
+ }
1265
+
1266
+ .aino-calendar.hidden{
1267
+ opacity: 0;
1268
+ height: 0;
1269
+ }
1270
+
1271
+
1272
+ .aino-arrival{
1273
+ overflow: hidden;
1274
+ height: 550px;
1275
+ }
1276
+
1277
+ .aino-container.desktop .aino-calendar{
1278
+ margin: 0 -15px;
1279
+ }
1280
+
1281
+ .aino-calendar{
1282
+ border-bottom: none !important;
1283
+ -moz-transition: all 500ms ease;
1284
+ -webkit-transition: all 500ms ease;
1285
+ -o-transition: all 500ms ease;
1286
+ transition: all 500ms ease;
1287
+ opacity: 1;
1288
+ height:375px;
1289
+ }
1290
+
1291
+ .aino-calendar table,.aino-calendar th,.aino-calendar td{
1292
+ border: 2px solid #fff;
1293
+ text-align: center;
1294
+ }
1295
+
1296
+ .aino-calendar table{
1297
+ border: none;
1298
+ }
1299
+
1300
+ .aino-calendar thead tr{
1301
+ background-color: #29abcc;
1302
+ color: #fff;
1303
+ }
1304
+
1305
+ .aino-calendar thead tr th{
1306
+ padding: 7px 0 8px;
1307
+ font-family: Verdana, Arial, sans-serif;
1308
+ border: none;
1309
+ }
1310
+
1311
+ .aino-calendar table td a,
1312
+ .aino-calendar table td span{
1313
+ font-family: Verdana, Arial, sans-serif;
1314
+ font-style: normal;
1315
+ padding:15px 13px 14px 13px;
1316
+ }
1317
+
1318
+ .aino-calendar table td a{
1319
+ color: #000;
1320
+ background-color: #fff;
1321
+ border-color: #eee;
1322
+ border-radius: 0;
1323
+ }
1324
+
1325
+ .aino-calendar table td span{
1326
+ display: block;
1327
+ border: 1px solid #eee;
1328
+ }
1329
+
1330
+ .aino-calendar table td{
1331
+ padding: 0;
1332
+ font-size: 14px;
1333
+ }
1334
+
1335
+ .aino-calendar .ui-state-disabled{
1336
+ color: #a5a5a5;
1337
+ opacity: 1 !important;
1338
+ background: #e1e1dd;
1339
+ }
1340
+
1341
+ .aino-calendar .ui-datepicker-header{
1342
+ margin-right:1px;
1343
+ height:45px;
1344
+ position: relative;
1345
+ }
1346
+
1347
+ .aino-calendar .ui-datepicker-header > a, .aino-calendar .ui-datepicker-header > div{
1348
+ float: left;
1349
+ text-align: center;
1350
+ }
1351
+
1352
+ .aino-calendar .ui-datepicker-header > .ui-datepicker-next{
1353
+ float: right;
1354
+ }
1355
+
1356
+ .aino-calendar .ui-datepicker-header > a{
1357
+ width: 21.5%;
1358
+ background-color: #2399b7;
1359
+ min-height: 1px;
1360
+ padding: 14px 0;
1361
+ cursor: pointer;
1362
+ }
1363
+
1364
+ .aino-calendar .ui-datepicker-header .ui-datepicker-prev:before,
1365
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next:before{
1366
+ content: '';
1367
+ display: block;
1368
+ width: 10px;
1369
+ height: 17px;
1370
+ margin: 0 auto;
1371
+ }
1372
+
1373
+ .aino-calendar .ui-datepicker-header .ui-datepicker-prev:before{
1374
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -18px -339px;
1375
+ }
1376
+
1377
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next:before{
1378
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -3px -339px;
1379
+ }
1380
+
1381
+ .aino-calendar .ui-datepicker-header > a span{
1382
+ display: none;
1383
+ }
1384
+
1385
+ .aino-calendar .ui-state-active{
1386
+ background-color: #249ab9;
1387
+ color: #fff;
1388
+ }
1389
+
1390
+ .aino-calendar table td a:hover{
1391
+ background-color: #cc0000;
1392
+ color: #fff;
1393
+ border-radius: 0;
1394
+ }
1395
+
1396
+ .aino-calendar .ui-datepicker-header > div{
1397
+ width: 56.3%;
1398
+ padding: 13px 0;
1399
+ color: #fff;
1400
+ background-color: #2399b7;
1401
+ font-size: 20px;
1402
+ border-left:1px solid #fff;
1403
+ border-right:1px solid #fff;
1404
+ }
1405
+
1406
+ #calc-swe-sweden .aino-tabs-body .aino-column-2 li:hover{
1407
+ background-color: #fdfdfd;
1408
+ }
1409
+
1410
+
1411
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1412
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1413
+ padding: 15px 14px 14px 14px;
1414
+ }
1415
+
1416
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1417
+ width: 61.2%;
1418
+ }
1419
+
1420
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1421
+ width: 18.5%;
1422
+ }
1423
+
1424
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1425
+ margin-right: 4px;
1426
+ }
1427
+
1428
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1429
+ height: 500px;
1430
+ }
1431
+ .aino-tabs ul.aino-nav .aino-address-tab em,
1432
+ .aino-tabs ul.aino-nav .aino-business-tab em,
1433
+ .aino-tabs ul.aino-nav .aino-office-tab em,
1434
+ .aino-tabs ul.aino-nav .aino-mailbox-tab em{
1435
+ display:block;
1436
+ }
1437
+
1438
+ .aino-container .aino-core{
1439
+ position: relative;
1440
+ }
1441
+
1442
+ .aino-footer{
1443
+ position: absolute;
1444
+ width: 100%;
1445
+ right: 2%;
1446
+ bottom: 2%;
1447
+ }
1448
+
1449
+ /*mobile styles*/
1450
+
1451
+ /*@media height*/
1452
+ @media (min-height: 550px){
1453
+ .address-near-you, .aino-map{
1454
+ height: 460px;
1455
+ }
1456
+ }
1457
+ @media (min-height: 600px){
1458
+ .address-near-you, .aino-map{
1459
+ height: 525px;
1460
+ }
1461
+ }
1462
+ @media (min-height: 650px){
1463
+ .address-near-you, .aino-map{
1464
+ height: 560px;
1465
+ }
1466
+ }
1467
+ @media (min-height: 700px){
1468
+ .address-near-you, .aino-map{
1469
+ height: 603px;
1470
+ }
1471
+ }
1472
+ @media (min-height: 750px){
1473
+ .address-near-you, .aino-map{
1474
+ height: 650px;
1475
+ }
1476
+ }
1477
+
1478
+ @media (min-height: 800px){
1479
+ .address-near-you, .aino-map{
1480
+ height: 675px;
1481
+ }
1482
+ }
1483
+
1484
+ @media (min-height: 850px){
1485
+ .address-near-you, .aino-map{
1486
+ height: 715px;
1487
+ }
1488
+ }
1489
+
1490
+ @media (min-height: 900px){
1491
+ .address-near-you, .aino-map{
1492
+ height: 627px;
1493
+ }
1494
+ }
1495
+
1496
+ @media (min-height: 1000px){
1497
+ .address-near-you, .aino-map{
1498
+ height: 685px;
1499
+ }
1500
+ }
1501
+
1502
+ @media (max-height: 1023px){
1503
+ .aino-container{
1504
+ top: 5%;
1505
+ bottom: 15%;
1506
+ }
1507
+
1508
+ .aino-container > .aino-core > .aino-tabs,
1509
+ .aino-container .aino-inner-tabs{
1510
+ max-height: 81%;
1511
+ }
1512
+ }
1513
+
1514
+ @media (max-height: 900px){
1515
+ .aino-container{
1516
+ top: 2%;
1517
+ bottom: 1%;
1518
+ }
1519
+ }
1520
+
1521
+ @media (max-height: 800px){
1522
+ .aino-container{
1523
+ top: 0 !important;
1524
+ bottom: 0 !important;
1525
+ }
1526
+ }
1527
+
1528
+ @media (max-height: 787px){
1529
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1530
+ height: 500px;
1531
+ }
1532
+
1533
+ .aino-arrival ul{
1534
+ height: 450px;
1535
+ }
1536
+
1537
+ .aino-container > .aino-core > .aino-tabs ,
1538
+ .aino-container .aino-inner-tabs{
1539
+ max-height: 72%;
1540
+ height: 72%;
1541
+ }
1542
+
1543
+ /* .aino-container .aino-post-office{
1544
+ margin-top: -77px;
1545
+ }
1546
+ */
1547
+
1548
+ }
1549
+
1550
+ @media (max-height: 700px){
1551
+
1552
+ .aino-container > .aino-core > .aino-tabs,
1553
+ .aino-container .aino-inner-tabs{
1554
+ max-height: 66%;
1555
+ }
1556
+
1557
+ .aino-delivery-time-picker
1558
+ {
1559
+ height: 280px;
1560
+ }
1561
+
1562
+ .aino-tabs-body .aino-smart-delivery-time .aino-delivery-time-picker{
1563
+ height: 400px;
1564
+ }
1565
+ }
1566
+
1567
+
1568
+ /*@media height*/
1569
+ /*@media width*/
1570
+ @media (min-width: 1401px) {
1571
+ .aino-container .aino-column > .aino-inner-tabs .aino-tabs-body,
1572
+ .aino-container .aino-column > .aino-tabs > ul,
1573
+ .aino-container .aino-tabs-body .aino-tabs-body,
1574
+ .aino-container .aino-inner-tabs > ul{
1575
+ width: 100%;
1576
+ }
1577
+ }
1578
+ @media (max-width: 1400px) {
1579
+ .aino-footer > div {
1580
+ margin-right: 28px;
1581
+ }
1582
+
1583
+ .aino-container .aino-column > .aino-tabs .aino-tabs-body,
1584
+ .aino-container .aino-tabs-body .aino-tabs-body,
1585
+ .aino-container .aino-column > .aino-tabs > ul ,
1586
+ .aino-container .aino-inner-tabs > ul{
1587
+ width: 100%;
1588
+ }
1589
+
1590
+ }
1591
+
1592
+ @media (max-width: 1200px) {
1593
+
1594
+ .aino-map-container .directions-display-type{
1595
+ top: 61px;
1596
+ right: 20px;
1597
+ }
1598
+
1599
+ .aino-deliver-to > li > a > span{
1600
+ max-width:118px;
1601
+ }
1602
+
1603
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1604
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1605
+ padding: 15px 9px 14px 9px;
1606
+ }
1607
+
1608
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1609
+ width: 57.4%;
1610
+ }
1611
+
1612
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1613
+ margin-right:3px;
1614
+ }
1615
+
1616
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1617
+ width: 20.4%;
1618
+ }
1619
+
1620
+ .aino-inner-tabs a[role="tab"] .pull-right{
1621
+ margin-right: 5px;
1622
+ float: none;
1623
+ text-align: right;
1624
+ }
1625
+
1626
+ .aino-calendar .ui-datepicker-header > a{
1627
+ width: 21.4%;
1628
+ }
1629
+
1630
+ .aino-calendar table td a,
1631
+ .aino-calendar table td span{
1632
+ padding: 15px 8px 14px 8px;
1633
+ }
1634
+
1635
+ .aino-calendar table, .aino-calendar th, .aino-calendar td{
1636
+ border: 1px solid #fff;
1637
+ }
1638
+
1639
+ .aino-calendar .ui-datepicker-header{
1640
+ margin-right: 0;
1641
+ margin-left: 1px;
1642
+ }
1643
+
1644
+ .aino-calendar table td{
1645
+ font-size: 15px;
1646
+ }
1647
+
1648
+
1649
+ .address-near-you .aino-index{
1650
+ margin-bottom:0;
1651
+ }
1652
+
1653
+ .aino-container .aino-tabs-body{
1654
+ width: 74%;
1655
+ }
1656
+
1657
+ .aino-container.desktop .aino-core{
1658
+ width: 957px;
1659
+ }
1660
+
1661
+ .aino-deliver-to > li > a:before{
1662
+ margin-right: 17px;
1663
+ }
1664
+ }
1665
+
1666
+ @media (max-width: 992px) {
1667
+
1668
+
1669
+ .aino-tabs-body .aino-smart-delivery .toggle-calendar .pull-right
1670
+ {
1671
+ float:none;
1672
+ text-align: right;
1673
+ }
1674
+ .aino-arrival{
1675
+ width: 270px;
1676
+ }
1677
+ .aino-container.desktop .aino-calendar{
1678
+ margin: 0 -22px 0 -10px;
1679
+ }
1680
+ .aino-calendar-holder{
1681
+ width: 240px !important;
1682
+ }
1683
+ .aino-calendar table td a,
1684
+ .aino-calendar table td span,
1685
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td span,
1686
+ .aino-tabs-body .aino-smart-delivery .aino-calendar table td a{
1687
+ padding: 15px 8px 14px 7px;
1688
+ }
1689
+
1690
+ .aino-calendar .ui-datepicker-header > a,
1691
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > a{
1692
+ width: 22.4%;
1693
+ position: absolute;
1694
+ }
1695
+
1696
+ .aino-calendar .ui-datepicker-header > div,
1697
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > div{
1698
+ left:20.4%;
1699
+ position: absolute;
1700
+ }
1701
+
1702
+ .aino-tabs-body .aino-smart-delivery .ui-datepicker-header > .ui-datepicker-next{
1703
+ margin-right:0;
1704
+ }
1705
+
1706
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next{
1707
+ right: 6px;
1708
+ }
1709
+
1710
+ .aino-container .aino-tabs-body{
1711
+ width:73%;
1712
+ }
1713
+
1714
+ .aino-container.desktop .aino-core{
1715
+ width:100%;
1716
+ }
1717
+
1718
+ .address-near-you{
1719
+ width: 37%;
1720
+ }
1721
+
1722
+ .aino-map-container{
1723
+ width: 65% !important;
1724
+ }
1725
+
1726
+ .aino-footer > div {
1727
+ margin-right: 8px;
1728
+ }
1729
+
1730
+ .aino-deliver-to > li> a{
1731
+ padding: 16px;
1732
+ }
1733
+
1734
+ .aino-container .aino-tabs-body .aino-column-2 ul li{
1735
+ padding: 0 5px;
1736
+ }
1737
+
1738
+ .aino-container .aino-input{
1739
+ padding-right: 5px;
1740
+ }
1741
+
1742
+ .aino-container .aino-tabs-body .aino-column-2 > div{
1743
+ padding: 11px 9px 23px;
1744
+ }
1745
+
1746
+ .aino-map-container .directions-display-type{
1747
+ right: 40px;
1748
+ }
1749
+
1750
+ .post-code-input{
1751
+ right: 40px;
1752
+ }
1753
+
1754
+ .aino-map-container .gm-style-mtc{
1755
+ margin-top: 51px !important;
1756
+ }
1757
+ }
1758
+
1759
+ @media (max-width: 900px) {
1760
+ .aino-inner-tabs .mounth-day {
1761
+ float: none;
1762
+ text-align: left;
1763
+ }
1764
+ .address-near-you .aino-index{
1765
+ margin-left: 4px;
1766
+ }
1767
+
1768
+ .aino-deliver-to > li > a:before{
1769
+ margin-right: 12px;
1770
+ }
1771
+ }
1772
+
1773
+ @media (max-width: 850px){
1774
+ .zipcode-holder {
1775
+ width: 84%;
1776
+ }
1777
+ }
1778
+
1779
+ @media (min-width: 768px){
1780
+ .aino-deliver-to > li > a{
1781
+ max-width: 252px;
1782
+ }
1783
+ .aino-open-hours {
1784
+ display: none;
1785
+ }
1786
+ }
1787
+
1788
+ @media (max-width: 767px){
1789
+ .aino-container .aino-nav{
1790
+ float: none;
1791
+ margin-top: 0 !important;
1792
+ }
1793
+
1794
+ .aino-container .aino-input {
1795
+ padding-left: 70px;
1796
+ }
1797
+
1798
+ .label-text .pull-right{
1799
+ margin-right: 15px;
1800
+ }
1801
+
1802
+ .aino-calendar .ui-datepicker-header{
1803
+ width: 100%;
1804
+ margin-right: 0;
1805
+ }
1806
+
1807
+ .aino-calendar{
1808
+ height: auto;
1809
+ margin: 0 -35px;
1810
+ }
1811
+
1812
+ .aino-calendar table{
1813
+ width:100%;
1814
+ }
1815
+
1816
+ .aino-calendar .ui-datepicker-header > a{
1817
+ top: -2px;
1818
+ padding: 14.5px 0;
1819
+ width: 21.6%;
1820
+ }
1821
+
1822
+ .aino-calendar .ui-datepicker-header .ui-datepicker-next{
1823
+ right:2px;
1824
+ }
1825
+
1826
+ .aino-calendar .ui-datepicker-header > div{
1827
+ width: 56.4%;
1828
+ left: 21.6%;
1829
+ padding: 8px 0;
1830
+ line-height: 30px;
1831
+ }
1832
+
1833
+ .aino-delivery-time-picker{
1834
+ height:auto;
1835
+ margin-top: 14px;
1836
+ }
1837
+ }
1838
+
1839
+ /*@media width*/
1840
+ /*@media width and height*/
1841
+
1842
+ @media (max-width: 375px) and (max-height: 667px){
1843
+ .aino-container .aino-tabs{
1844
+ height: 60% !important;
1845
+ }
1846
+ }
1847
+
1848
+ @media (max-width: 320px) and (max-height: 568px){
1849
+ .aino-container .aino-tabs{
1850
+ height: 55% !important;
1851
+ }
1852
+ }
1853
+ .aino-core a, .aino-core li, .aino-core div, .aino-core span, .aino-core p, .aino-core button,
1854
+ .aino-core label{
1855
+ font-size: inherit;
1856
+ font-family: inherit;
1857
+ line-height: normal;
1858
+ font-weight: normal !important;
1859
+ }
1860
+
1861
+ .aino-nav li .aino-indicator{
1862
+ display: none;
1863
+ }
1864
+
1865
+ .aino-nav li.active .aino-indicator{
1866
+ display: block;
1867
+ }
1868
+
1869
+ /*Corrections*/
1870
+ .aino-container a,
1871
+ .aino-container label{
1872
+ -webkit-touch-callout: none !important;
1873
+ -webkit-user-select: none !important;
1874
+ -khtml-user-select: none !important;
1875
+ -moz-user-select: none !important;
1876
+ -ms-user-select: none !important;
1877
+ user-select: none !important;
1878
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
1879
+ }
1880
+
1881
+ .aino-container.desktop .aino-collapse{
1882
+ padding-left: 58px;
1883
+ color: inherit;
1884
+ text-decoration: none;
1885
+ }
1886
+
1887
+ .address-near-you ul{
1888
+ margin-left: 0;
1889
+ }
1890
+
1891
+ .address-near-you .aino-distance{
1892
+ padding: 0 9px;
1893
+ }
1894
+
1895
+ .address-near-you ul > li .aino-input{
1896
+ word-break: break-all;
1897
+ }
1898
+
1899
+ .aino-map-container{
1900
+ width: 68%;
1901
+ }
1902
+
1903
+ .aino-deliver-to > li > a span{
1904
+ width: 72%;
1905
+ }
1906
+
1907
+ .aino-container .aino-header .postnord-logo{
1908
+ margin-top: 21px;
1909
+ }
1910
+
1911
+ .aino-arrival{
1912
+ overflow: visible;
1913
+ }
1914
+
1915
+ .aino-arrival ul{
1916
+ overflow: hidden;
1917
+ height: 500px;
1918
+ }
1919
+
1920
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
1921
+ content: '';
1922
+ border-top: 4px solid #cc0000;
1923
+ display: block;
1924
+ margin-top: -19px;
1925
+ margin-bottom: 15px;
1926
+ }
1927
+
1928
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] label{
1929
+ display: block;
1930
+ font-weight: normal;
1931
+ margin-bottom: 0;
1932
+ }
1933
+
1934
+ .aino-container .tab-list.aino-column .aino-inner-tabs ul{
1935
+ position: relative;
1936
+ }
1937
+
1938
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context.active:before{
1939
+ content: '';
1940
+ border-top: 4px solid #cc0000;
1941
+ display: block;
1942
+ position: absolute;
1943
+ top: 0;
1944
+ width: 44%;
1945
+ }
1946
+
1947
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context:before{
1948
+ display: none;
1949
+ }
1950
+
1951
+ .aino-nav > .aino-collapse{
1952
+ color: #636363;
1953
+ font-weight: 600;
1954
+ text-decoration: none !important;
1955
+ }
1956
+
1957
+ .aio-options{
1958
+ display: none;
1959
+ }
1960
+ .aio-options select{
1961
+ width: 49%;
1962
+ margin:5px 1% 0 0;
1963
+ }
1964
+
1965
+ .aio-options.active{
1966
+ display: block;
1967
+ }
1968
+
1969
+ .aio-hidden{
1970
+ display: none !important;
1971
+ }
1972
+
1973
+ button.aio-pick-btn{
1974
+ background-color: #cc0000 !important;
1975
+ padding: 14px 26px;
1976
+ color: #fff;
1977
+ font-family: 'Stag Sans Round - Medium';
1978
+ border: none;
1979
+ line-height: normal;
1980
+ width: 70%;
1981
+ max-width: 211px;
1982
+ word-spacing: 3px;
1983
+ }
1984
+
1985
+ @media (max-width: 1200px){
1986
+ .aino-deliver-to > li > a > span{
1987
+ word-break: break-word;
1988
+ }
1989
+
1990
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context.active:before{
1991
+ width: 43%;
1992
+ }
1993
+ }
1994
+
1995
+ @media (max-width: 992px){
1996
+ .aino-container .aino-collapse {
1997
+ padding-left: 66px !important;
1998
+ }
1999
+ }
2000
+
2001
+ @media (max-width: 768px){
2002
+ .aino-container .aino-core {
2003
+ width: 98% !important;
2004
+ }
2005
+ }
2006
+
2007
+ @media (max-width: 767px){
2008
+ .zipcode-holder{
2009
+ position: static;
2010
+ width: 100%;
2011
+ text-align: center;
2012
+ }
2013
+
2014
+ .post-code-input{
2015
+ float: none;
2016
+ }
2017
+
2018
+ .address-near-you{
2019
+ width: 100%;
2020
+ height: auto;
2021
+ margin-top: 0;
2022
+ float: none;
2023
+ overflow: visible;
2024
+ padding-left: 0;
2025
+ }
2026
+
2027
+ .address-near-you .aino-title,
2028
+ .address-near-you .aino-rating,
2029
+ .address-near-you .aino-address{
2030
+ width: 100%;
2031
+ }
2032
+
2033
+ .address-near-you ul > li{
2034
+ background-color: transparent;
2035
+ margin: 0px -15px;
2036
+ padding: 0 0 0 17px !important;
2037
+ }
2038
+
2039
+ .address-near-you li.active{
2040
+ border-bottom: 1px solid #dadada;
2041
+ background-color: #f8f8f8;
2042
+ }
2043
+
2044
+ .address-near-you li.active .aino-distance {
2045
+ background-color: transparent;
2046
+ }
2047
+
2048
+ .address-near-you li.active > div{
2049
+ border-bottom: none;
2050
+ margin-bottom: 0;
2051
+ }
2052
+
2053
+ .address-near-you .aino-input{
2054
+ padding: 12px 0 9px 49px !important;
2055
+ font-size: 15px;
2056
+ height: 101px;
2057
+ }
2058
+
2059
+ .address-near-you .aino-input .aino-indicator
2060
+ {
2061
+ left: 9px;
2062
+ }
2063
+
2064
+ .address-near-you .aino-input> div{
2065
+ vertical-align: middle;
2066
+ display: inline-block;
2067
+ width: 100%;
2068
+ }
2069
+
2070
+ .address-near-you .aino-input:before{
2071
+ content: '';
2072
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -3px -211px;
2073
+ display: block;
2074
+ width: 36px;
2075
+ height: 36px;
2076
+ position: absolute;
2077
+ left: -1px;
2078
+ top: 31px;
2079
+ }
2080
+
2081
+ .post-code-input input{
2082
+ width: 77px;
2083
+ }
2084
+
2085
+ .address-near-you .aino-distance{
2086
+ position: static;
2087
+ float: right;
2088
+ color: #a6a6a6;
2089
+ background-color: transparent;
2090
+ width: auto;
2091
+ }
2092
+ .address-near-you li.active .aino-distance{
2093
+ height: auto;
2094
+ }
2095
+
2096
+ .address-near-you .aino-distance span{
2097
+ font-size: 11px;
2098
+ }
2099
+
2100
+ .address-near-you .aino-index{
2101
+ display: none;
2102
+ }
2103
+
2104
+ .address-near-you .aino-title{
2105
+ float:none;
2106
+ }
2107
+
2108
+ .aino-container{
2109
+ width: 100%;
2110
+ position: fixed;
2111
+ top: 0;
2112
+ bottom: 0;
2113
+ outline: 0;
2114
+ }
2115
+
2116
+ .all-in-one-container .aino-container{
2117
+ display: block;
2118
+ }
2119
+
2120
+ .aino-container .aino-core{
2121
+ width: 100% !important;
2122
+ height: 100% !important;
2123
+ padding-left: 0 !important;
2124
+ padding-right: 0 !important;
2125
+ }
2126
+
2127
+ .aino-container > .aino-core > .aino-tabs,
2128
+ .aino-container .aino-inner-tabs{
2129
+ max-height: none;
2130
+ border: none;
2131
+ }
2132
+
2133
+ .aino-container .aino-tabs{
2134
+ margin-bottom: 14px;
2135
+ height: 72%;
2136
+ overflow-y: auto;
2137
+ overflow-x: hidden;
2138
+ }
2139
+
2140
+ .aino-container .aino-header .postnord-logo{
2141
+ width: 100%;
2142
+ text-align: center;
2143
+ float: none;
2144
+ }
2145
+
2146
+ .aino-container.mobile .aino-body .aino-nav li a {
2147
+ border-top: 2px solid #f3f3f3;
2148
+ font-family: 'Stag Sans Round - Medium';
2149
+ }
2150
+
2151
+ .aino-container .aino-nav:before,
2152
+ .aino-container .aino-nav:after {
2153
+ content: "";
2154
+ display: table;
2155
+ }
2156
+
2157
+ .aino-container .aino-nav:after {
2158
+ clear: both;
2159
+ }
2160
+
2161
+ .aino-container .aino-weather{
2162
+ background-color: #f7f7f7;
2163
+ border-top: 1px solid #dadada;
2164
+ border-bottom: 1px solid #dadada;
2165
+ padding: 24px 0 18px;
2166
+ margin-top: 0;
2167
+ margin-bottom: 13px;
2168
+ overflow: auto;
2169
+ }
2170
+
2171
+ .aino-container .aino-weather .aino-nav{
2172
+ width: 600px;
2173
+ float: none;
2174
+ margin: 0 auto;
2175
+ padding:0 15px;
2176
+ }
2177
+
2178
+ .aino-deliver-to > li > a{
2179
+ width: 100%;
2180
+ box-shadow: none;
2181
+ margin-bottom: 0;
2182
+ border-top: 2px solid #f3f3f3;
2183
+ }
2184
+
2185
+ .aino-deliver-to > li > a > span{
2186
+ max-width: none;
2187
+ width: 85%;
2188
+ }
2189
+
2190
+
2191
+ .aino-deliver-to > li > a span span{
2192
+ width: auto;
2193
+ }
2194
+
2195
+
2196
+ .aino-tabs ul.aino-nav .aino-address-tab em,
2197
+ .aino-tabs ul.aino-nav .aino-business-tab em,
2198
+ .aino-tabs ul.aino-nav .aino-office-tab em,
2199
+ .aino-tabs ul.aino-nav .aino-mailbox-tab em{
2200
+ display: inline-block;
2201
+ }
2202
+
2203
+
2204
+ .aino-deliver-to > li > a .aino-delivery-price{
2205
+ float: right;
2206
+ }
2207
+ .aino-deliver-to > li > a .aino-delivery-price:first-child{
2208
+ display: none;
2209
+ }
2210
+
2211
+ .aino-deliver-to > li > a .aino-delivery-price:last-child{
2212
+ display: block;
2213
+ }
2214
+
2215
+ .aino-container .aino-textarea-holder{
2216
+ margin-bottom: 15px;
2217
+ }
2218
+
2219
+ .aino-deliver-to > li > .tab-list{
2220
+ position: static;
2221
+ width: 100%;
2222
+ padding: 0 15px;
2223
+ }
2224
+
2225
+ .aino-container .aino-footer > div{
2226
+ width: 100%;
2227
+ margin-right: 0;
2228
+ }
2229
+
2230
+ .aino-container .aino-footer .aino-button.gray{
2231
+ margin-right: 2%;
2232
+ }
2233
+
2234
+ .aino-container .aino-footer .aino-button{
2235
+ width: 49%;
2236
+ display: block;
2237
+ float: left;
2238
+ padding: 11px;
2239
+ }
2240
+
2241
+ .aino-container .aino-tabs-body .tab-list{
2242
+ width: 90%;
2243
+ }
2244
+
2245
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
2246
+ margin-left: 0;
2247
+ }
2248
+
2249
+ .aino-delivery-price:first-child{
2250
+ display: none;
2251
+ }
2252
+
2253
+ .aino-delivery-price:last-child{
2254
+ display: block;
2255
+ }
2256
+
2257
+ .aino-container .tab-list.aino-column .aino-inner-tabs .delivery-context{
2258
+ float: none;
2259
+ width: 100%;
2260
+ padding-right: 0;
2261
+ }
2262
+
2263
+ .aino-container .aino-column-2 {
2264
+ display: none;
2265
+ width: 100%;
2266
+ position: static;
2267
+ }
2268
+
2269
+ .aino-container .aino-column-2 > ul{
2270
+ padding: 14px 25px;
2271
+ }
2272
+
2273
+ .aino-arrival,.aino-arrival ul{
2274
+ overflow: visible;
2275
+ height: auto;
2276
+ }
2277
+
2278
+ .aino-container .aino-inner-tabs > ul > li > div.active:before{
2279
+ display: none;
2280
+ }
2281
+
2282
+ .aino-container .aino-column-2 ul li{
2283
+ margin: 0 -49px 0 -50px;
2284
+ border-bottom: 1px solid #dadada;
2285
+ }
2286
+
2287
+ .aino-collapse-content{
2288
+ margin: 0;
2289
+ }
2290
+
2291
+ .aino-collapse-content ul li{
2292
+ margin: 0;
2293
+ }
2294
+
2295
+ .aino-collapse-content .aino-input{
2296
+ padding-left: 108px !important;
2297
+ }
2298
+
2299
+ .aino-collapse-content .aino-input .aino-indicator{
2300
+ left: 70px;
2301
+ }
2302
+
2303
+ .aino-container .aino-column-2 > div{
2304
+ display: none;
2305
+ }
2306
+
2307
+ .aino-container .aino-input{
2308
+ padding: 9px 0 9px 70px;
2309
+ color: #474747;
2310
+ border-bottom: none;
2311
+ }
2312
+
2313
+ .aino-container .aino-indicator{
2314
+ top: 9px;
2315
+ left: 30px;
2316
+ }
2317
+ .aino-container .aino-column-2 .aino-sub-nav{
2318
+ border-bottom: none;
2319
+ }
2320
+
2321
+ .aino-container .aino-collapse{
2322
+ margin: 0 -12px;
2323
+ padding: 9px 0 9px 82px !important;
2324
+ color: #474747 !important;
2325
+ border-bottom: 1px solid #dadada !important;
2326
+ }
2327
+
2328
+ .aino-container .aino-collapse-content li:last-child{
2329
+ border-bottom: none;
2330
+ }
2331
+
2332
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab]{
2333
+ background-color: #cc0000;
2334
+ border-top: 1px solid #cc0000;
2335
+ border-bottom: 1px solid #cc0000;
2336
+ color: #ffffff;
2337
+ margin: 0;
2338
+ padding: 9px 30px 9px 10px;
2339
+ }
2340
+
2341
+ .aino-map-container{
2342
+ float: none;
2343
+ margin: 0 0;
2344
+ width: auto !important;
2345
+ }
2346
+
2347
+ .aino-map-container .post-code-input{
2348
+ position: static;
2349
+ padding: 0 0;
2350
+ margin: 20px 0;
2351
+ text-align: center;
2352
+ }
2353
+
2354
+ .aino-map-container .aino-map,
2355
+ .aino-map-container .directions-display-type
2356
+ {
2357
+ display: none;
2358
+ }
2359
+
2360
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab] span,
2361
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab] span{
2362
+ padding: 0;
2363
+ }
2364
+
2365
+ .aino-container .tab-list.aino-column .aino-inner-tabs li [role=tab]:after{
2366
+ content: '';
2367
+ background: url("../../../images/vconnect/aio/aino-icons-red.png") no-repeat -31px -196px;
2368
+ width: 9px;
2369
+ height: 13px;
2370
+ display: block;
2371
+ margin-right: 0;
2372
+ margin-top: 2px;
2373
+ position: absolute;
2374
+ right: 10px;
2375
+ top: 11px;
2376
+ }
2377
+
2378
+ .aino-container .tab-list.aino-column .aino-inner-tabs li.active [role=tab]:after{
2379
+ background-position: -13px -196px;
2380
+ width: 14px;
2381
+ margin-top: 0;
2382
+ }
2383
+
2384
+ .aino-container .delivery-context .aino-tab-sub-title,
2385
+ .aino-container .delivery-context p
2386
+ {
2387
+ margin: 15px 0;
2388
+ line-height: 19px;
2389
+ }
2390
+
2391
+ .aino-container .aino-inner-tabs > ul > li{
2392
+ margin-bottom: 0;
2393
+ }
2394
+ }
2395
+
2396
+ @media only screen and (max-width: 500px) {
2397
+ .aio-options select {
2398
+ width: 100%;
2399
+ }
2400
+ }
2401
+
2402
+ @media only screen and (max-width: 360px) {
2403
+ button.aio-pick-btn{
2404
+ width: 100%;
2405
+ max-width: none;
2406
+ }
2407
+ }
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Black Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Black.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Bold Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Bold.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Book Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Book.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Light Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Light.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Medium Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Medium.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Semibold Italic.otf ADDED
Binary file
skin/adminhtml/default/default/fonts/vconnect/aio/Stag Sans Round - Semibold.otf ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/PostDKLogo.svg.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/active-pin-3.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/active-pin-red-3.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/active-pin.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/aino-icons-red.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/aino-icons.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/aino-postnord-logo.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/arrow.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/button-arrow-icon.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/not-active-pin-red.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/not-active-pin.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/realistic-frog-outline-0.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/temp.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/01d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/02d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/03d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/04d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/09d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/10d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/11d.png ADDED
Binary file
skin/adminhtml/default/default/images/vconnect/aio/weather-icons/13d.png ADDED
Binary file
skin/adminhtml/default/default/js/vconnect/aio/facescroll.js ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FaceScroll v1.0: http://www.dynamicdrive.com/dynamicindex11/facescroll/index.htm
3
+ *
4
+ * Depends:
5
+ * jquery.ui.widget.js
6
+ * jquery.ui.mouse.js
7
+ * jquery.ui.draggable.js
8
+ * jquery UI Touch Punch
9
+ */
10
+
11
+
12
+ (function($) {
13
+ var methods = {
14
+ init : function(options) {
15
+ this.each(function() {
16
+
17
+ if ($(this).hasClass('alternate-scroll')) return;
18
+ $(this).addClass('alternate-scroll');
19
+
20
+ var settings = $.extend({
21
+ 'animation-time' : 500,
22
+ 'bar-class' : '',
23
+ 'vertical-bar-class' : '',
24
+ 'horizontal-bar-class' : '',
25
+ 'mouse-wheel-sensitivity': 2,
26
+ 'auto-size' : true,
27
+ 'hide-bars' : true,
28
+ 'easing' : 'easeOutCubic'
29
+ }, options);
30
+
31
+
32
+ var scrollHolderWidth = $(this).width();
33
+ var scrollHolderHeight = $(this).height();
34
+
35
+ var prevOverflow = $(this).css('overflow');
36
+ var prevFloat = $(this).css('float');
37
+
38
+ var $scrollObj = $(this).scrollTop(0).scrollLeft(0).css({ 'overflow': 'hidden' }).data({'prev-overflow': prevOverflow, 'prev-float': prevFloat });
39
+
40
+ $scrollObj.wrapInner('<div class="alt-scroll-holder" style="position: relative;"><div class="alt-scroll-content" style="position: absolute; top: 0; left: 0"></div></div>');
41
+ var $scrollHolder = $('.alt-scroll-holder', $scrollObj);
42
+ var $scrollContent = $('.alt-scroll-content', $scrollObj);
43
+ $scrollHolder.width(scrollHolderWidth).height(scrollHolderHeight);
44
+ var scrollContentWidth = $scrollContent.width();
45
+ $scrollContent.css('width', scrollContentWidth);
46
+ var scrollContentHeight = $scrollContent.height();
47
+
48
+ var verticalBarMultiplier = scrollHolderHeight / scrollContentHeight;
49
+ var horizontalBarMultiplier = scrollHolderWidth / scrollContentWidth;
50
+
51
+ var dragScrollPosTop;
52
+ var dragScrollPosLeft;
53
+ var dragTime;
54
+
55
+ var isTouch = isTouchDevice();
56
+
57
+ $scrollHolder.append('<div class="alt-scroll-vertical-bar ' + settings['bar-class'] + ' ' + settings['vertical-bar-class'] + '"><ins></ins></div>');
58
+ var $verticalBar = $('.alt-scroll-vertical-bar', $scrollHolder);
59
+
60
+
61
+ if (document.all && document.documentMode<=8 && settings['bar-class']=='' && settings['vertical-bar-class']=='') // if IE8 and above, add additional style to default style bar to fix display issues
62
+ $verticalBar.css({background:'gray', marginBottom:'4px'})
63
+
64
+ $verticalBar.css({ 'display': 'block', 'position': 'absolute', 'top': 0, 'right': 0});
65
+ if (($verticalBar.css('background-color') == 'rgba(0, 0, 0, 0)') && ($verticalBar.css('background-image') == 'none')) $verticalBar.css('background-color', 'rgba(0, 0, 0, 0.3)');
66
+ if (($verticalBar.css('background-color') == 'transparent') && ($verticalBar.css('background-image') == 'none')) $verticalBar.css('background-color', 'rgba(0, 0, 0, 0.3)');
67
+ if (parseInt($verticalBar.css('width')) == 0 || $verticalBar.css('width') == 'auto') $verticalBar.css({'width': 7, 'border-radius': 3, 'cursor': 'default' });
68
+ var verticalBarWidth = $verticalBar.width();
69
+ var verticalBarHeight = Math.floor(scrollHolderHeight * verticalBarMultiplier);
70
+ $verticalBar.height(verticalBarHeight - parseInt($verticalBar.css('margin-bottom')));
71
+
72
+ if (verticalBarMultiplier < 1) {
73
+ if (settings['hide-bars']) $verticalBar.delay(2 * settings['animation-time']).fadeOut(settings['animation-time'] / 2);
74
+ } else {
75
+ $verticalBar.hide();
76
+ }
77
+
78
+ $scrollHolder.append('<div class="alt-scroll-horizontal-bar ' + settings['bar-class'] + ' ' + settings['horizontal-bar-class'] + '"><ins></ins></div>');
79
+ var $horizontalBar = $('.alt-scroll-horizontal-bar', $scrollHolder);
80
+ $horizontalBar.css({ 'display': 'block', 'position': 'absolute', 'bottom': 0, 'left': 0 });
81
+ if (($horizontalBar.css('background-color') == 'rgba(0, 0, 0, 0)') && ($horizontalBar.css('background-image') == 'none')) $horizontalBar.css('background-color', 'rgba(0, 0, 0, 0.3)');
82
+ if (($horizontalBar.css('background-color') == 'transparent') && ($horizontalBar.css('background-image') == 'none')) $horizontalBar.css('background-color', 'rgba(0, 0, 0, 0.3)');
83
+ if (parseInt($horizontalBar.css('height')) == 0 || $horizontalBar.css('height') == 'auto') $horizontalBar.css({ 'height': 7, 'border-radius': 3, 'cursor': 'default' });
84
+ var horizontalBarHeight = $horizontalBar.height();
85
+ var horizontalBarWidth = Math.floor(scrollHolderWidth * horizontalBarMultiplier);
86
+ var horizontalBarGap = 0;
87
+ if ($verticalBar) {
88
+ horizontalBarGap = parseInt($horizontalBar.css('margin-right')) + Math.ceil(verticalBarWidth * 1.2);
89
+ $horizontalBar.css({ 'margin-right' : horizontalBarGap });
90
+ }
91
+ $horizontalBar.width(horizontalBarWidth - horizontalBarGap);
92
+ if (horizontalBarMultiplier < 1) {
93
+ if (settings['hide-bars']) $horizontalBar.delay(2 * settings['animation-time']).fadeOut(settings['animation-time'] / 2);
94
+ } else {
95
+ $horizontalBar.hide();
96
+ }
97
+
98
+ var verticalScrollMultiplier = (scrollHolderHeight - scrollContentHeight) / (scrollHolderHeight - verticalBarHeight);
99
+ var horizontalScrollMultiplier = (scrollHolderWidth - scrollContentWidth) / (scrollHolderWidth - horizontalBarWidth);
100
+
101
+ if (isTouch) {
102
+ var holderOffsetTop = $scrollHolder.offset().top;
103
+ var holderOffsetLeft = $scrollHolder.offset().left;
104
+
105
+ var dragTopCorner = scrollHolderHeight - scrollContentHeight;
106
+ if (dragTopCorner > 0) dragTopCorner = 0;
107
+
108
+ var dragLeftCorner = scrollHolderWidth - scrollContentWidth;
109
+ if (dragLeftCorner > 0) dragLeftCorner = 0;
110
+
111
+ $scrollContent
112
+ .draggable({ scrollSensitivity: 40, containment: [dragLeftCorner + holderOffsetLeft, dragTopCorner + holderOffsetTop, holderOffsetLeft, holderOffsetTop] })
113
+ .bind('drag', function() {
114
+ $verticalBar.stop(true, true).css('top', parseInt($(this).css('top')) / verticalScrollMultiplier);
115
+ $horizontalBar.stop(true, true).css('left', parseInt($(this).css('left')) / horizontalScrollMultiplier);
116
+ })
117
+ .mousedown(function() {
118
+ $(this).stop(true, false);
119
+ var d = new Date();
120
+ dragTime = d.getTime();
121
+ dragScrollPosTop = parseInt($(this).css('top'));
122
+ dragScrollPosLeft = parseInt($(this).css('left'));
123
+ if (settings['hide-bars']) {
124
+ if (verticalBarMultiplier < 1) $verticalBar.stop(true, true).fadeIn(settings['animation-time'] / 2);
125
+ if (horizontalBarMultiplier < 1) $horizontalBar.stop(true, true).fadeIn(settings['animation-time'] / 2);
126
+ }
127
+ })
128
+ .mouseup(function() {
129
+ var d = new Date();
130
+
131
+ var currentTopPos = parseInt($(this).css('top'));
132
+ var currentLeftPos = parseInt($(this).css('left'))
133
+
134
+ var newTopPos = currentTopPos + (currentTopPos - dragScrollPosTop) * 50 / (d.getTime() - dragTime);
135
+ if (newTopPos < scrollHolderHeight - scrollContentHeight) newTopPos = scrollHolderHeight - scrollContentHeight;
136
+ if (newTopPos > 0) newTopPos = 0;
137
+
138
+ var newLeftPos = currentLeftPos + (currentLeftPos - dragScrollPosLeft) * 50 / (d.getTime() - dragTime);
139
+ if (newLeftPos < scrollHolderWidth - scrollContentWidth) newLeftPos = scrollHolderWidth - scrollContentWidth;
140
+ if (newLeftPos > 0) newLeftPos = 0;
141
+
142
+ $(this).stop(true, false).animate({ 'top': newTopPos, 'left': newLeftPos }, settings['animation-time'])
143
+
144
+ $verticalBar.stop(true, true).animate({ 'top': newTopPos / verticalScrollMultiplier }, settings['animation-time']);
145
+ $horizontalBar.stop(true, true).animate({ 'left': newLeftPos / horizontalScrollMultiplier }, settings['animation-time']);
146
+ if (settings['hide-bars']) {
147
+ $verticalBar.fadeOut(settings['animation-time']);
148
+ $horizontalBar.fadeOut(settings['animation-time']);
149
+ }
150
+ });
151
+ } else {
152
+ $verticalBar
153
+ .draggable({ containment: $scrollObj, axis: 'y' })
154
+ .bind('drag', function() {
155
+ $scrollContent.css('top', parseInt($(this).css('top')) * verticalScrollMultiplier);
156
+ });
157
+
158
+ $horizontalBar
159
+ .draggable({ containment: $scrollObj, axis: 'x' })
160
+ .bind('drag', function() {
161
+ $scrollContent.css('left', parseInt($(this).css('left')) * horizontalScrollMultiplier);
162
+ });
163
+
164
+ $scrollObj.hover(
165
+ function() {
166
+ if (settings['hide-bars']) {
167
+ if (verticalBarMultiplier < 1) { $verticalBar.stop(true, true).css('opacity', '').fadeIn(settings['animation-time'] / 4); }
168
+ if (horizontalBarMultiplier < 1) { $horizontalBar.stop(true, true).css('opacity', '').fadeIn(settings['animation-time'] / 4); }
169
+ }
170
+ mouseWheel(true);
171
+ },
172
+ function() {
173
+ if (settings['hide-bars']) {
174
+ if (verticalBarMultiplier < 1) { $verticalBar.stop(true, true).fadeOut(settings['animation-time'] / 2); }
175
+ if (horizontalBarMultiplier < 1) { $horizontalBar.stop(true, true).fadeOut(settings['animation-time'] / 2); }
176
+ }
177
+ mouseWheel(false);
178
+ }
179
+ );
180
+ }
181
+
182
+ if (settings['auto-size']) {
183
+ setInterval(function() { handleSizeChanges(); }, 500);
184
+ }
185
+
186
+ function handleSizeChanges() {
187
+ $scrollContent.css({ 'height': 'auto', 'width': 'auto' });
188
+ if (($scrollContent.height() != scrollContentHeight) || ($scrollContent.width() != scrollContentWidth) || ($scrollObj.width() != scrollHolderWidth) || ($scrollObj.height() != scrollHolderHeight)) {
189
+ scrollHolderWidth = $scrollObj.width();
190
+ scrollHolderHeight = $scrollObj.height();
191
+ $scrollHolder.width(scrollHolderWidth).height(scrollHolderHeight);
192
+ scrollContentWidth = $scrollContent.width();
193
+ $scrollContent.css('width', scrollContentWidth);
194
+ scrollContentHeight = $scrollContent.height();
195
+
196
+ verticalBarMultiplier = scrollHolderHeight / scrollContentHeight;
197
+ horizontalBarMultiplier = scrollHolderWidth / scrollContentWidth;
198
+
199
+ verticalBarHeight = Math.floor(scrollHolderHeight * verticalBarMultiplier);
200
+ if (verticalBarMultiplier < 1) {
201
+ $verticalBar.height(verticalBarHeight - parseInt($verticalBar.css('margin-bottom')));
202
+ if (!settings['hide-bars']) $verticalBar.stop(true, true).fadeIn(settings['animation-time'] / 2);
203
+ } else {
204
+ $verticalBar.stop(true, true).fadeOut(settings['animation-time'] / 2);
205
+ }
206
+
207
+ horizontalBarWidth = Math.floor(scrollHolderWidth * horizontalBarMultiplier);
208
+ if (horizontalBarMultiplier < 1) {
209
+ $horizontalBar.width(horizontalBarWidth - horizontalBarGap);
210
+ if (!settings['hide-bars']) $horizontalBar.stop(true, true).fadeIn(settings['animation-time'] / 2);
211
+ } else {
212
+ $horizontalBar.stop(true, true).fadeOut(settings['animation-time'] / 2);
213
+ }
214
+
215
+ verticalScrollMultiplier = (scrollHolderHeight - scrollContentHeight) / (scrollHolderHeight - verticalBarHeight);
216
+ horizontalScrollMultiplier = (scrollHolderWidth - scrollContentWidth) / (scrollHolderWidth - horizontalBarWidth);
217
+
218
+ var currentScrollLeft = parseInt($scrollContent.css('left'));
219
+ if (currentScrollLeft < scrollHolderWidth - scrollContentWidth) currentScrollLeft = scrollHolderWidth - scrollContentWidth;
220
+ if (currentScrollLeft > 0) currentScrollLeft = 0;
221
+
222
+ var currentScrollTop = parseInt($scrollContent.css('top'));
223
+ if (currentScrollTop < scrollHolderHeight - scrollContentHeight) currentScrollTop = scrollHolderHeight - scrollContentHeight;
224
+ if (currentScrollTop > 0) currentScrollTop = 0;
225
+
226
+ $scrollContent.stop(true, false).animate( { 'left': currentScrollLeft, 'top': currentScrollTop }, { duration: settings['animation-time'] / 2, queue: true });
227
+
228
+ $verticalBar.css('top', currentScrollTop / verticalScrollMultiplier);
229
+ $horizontalBar.css('left', currentScrollLeft / horizontalScrollMultiplier);
230
+
231
+ if (isTouch) {
232
+ holderOffsetTop = $scrollHolder.offset().top;
233
+ holderOffsetLeft = $scrollHolder.offset().left;
234
+
235
+ dragTopCorner = scrollHolderHeight - scrollContentHeight;
236
+ if (dragTopCorner > 0) dragTopCorner = 0;
237
+
238
+ dragLeftCorner = scrollHolderWidth - scrollContentWidth;
239
+ if (dragLeftCorner > 0) dragLeftCorner = 0;
240
+
241
+ $scrollContent.draggable({ containment: [dragLeftCorner + holderOffsetLeft, dragTopCorner + holderOffsetTop, holderOffsetLeft, holderOffsetTop] });
242
+ }
243
+ }
244
+ }
245
+
246
+ function mouseWheel(init) {
247
+ if (init) {
248
+ if (window.addEventListener) {
249
+ window.addEventListener('DOMMouseScroll', handleMouseWheel, false);
250
+ }
251
+ window.onmousewheel = document.onmousewheel = handleMouseWheel;
252
+ } else {
253
+ if (window.removeEventListener) {
254
+ window.removeEventListener('DOMMouseScroll', handleMouseWheel);
255
+ }
256
+ window.onmousewheel = document.onmousewheel = null;
257
+ }
258
+ }
259
+
260
+ function handleMouseWheel(event) {
261
+ var delta = 0;
262
+ if (!event) { event = window.event; }
263
+ if (event.wheelDelta) {
264
+ delta = event.wheelDelta / 120;
265
+ } else if (event.detail) {
266
+ delta = -event.detail / 3;
267
+ }
268
+ if (delta == 0) { return; }
269
+ if (verticalBarMultiplier >= 1) { return; }
270
+ var newContentTop = parseInt($scrollContent.css('top')) + Math.floor(delta * scrollHolderHeight / settings['mouse-wheel-sensitivity']);
271
+ if (newContentTop > 0) { newContentTop = 0; }
272
+ if (newContentTop < scrollHolderHeight - scrollContentHeight) { newContentTop = scrollHolderHeight - scrollContentHeight; }
273
+ $scrollContent.stop(true, false).animate({ 'top': newContentTop }, { duration: settings['animation-time'], queue: true, easing: settings['easing'] });
274
+ $verticalBar.stop(true, false).animate({ 'top': newContentTop / verticalScrollMultiplier }, { duration: settings['animation-time'], queue: true, easing: settings['easing'] });
275
+
276
+ if (event.preventDefault) { event.preventDefault(); }
277
+ event.returnValue = false;
278
+ }
279
+
280
+ function isTouchDevice() {
281
+ var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
282
+ try {
283
+ document.createEvent("TouchEvent");
284
+ return true && mobile;
285
+ } catch (e) {
286
+ return false && mobile;
287
+ }
288
+ }
289
+
290
+ function getStyleProperty(DOMobj, property) {
291
+ if (DOMobj.style.getPropertyValue) {
292
+ return (DOMobj.style.getPropertyValue(property));
293
+ } else {
294
+ return (DOMobj.style.getAttribute(property));
295
+ }
296
+ }
297
+ });
298
+ },
299
+
300
+ remove : function() {
301
+ this.each(function() {
302
+ var $scrollObj = $(this);
303
+ if (!$scrollObj.hasClass('alternate-scroll')) return;
304
+ $('.alt-scroll-vertical-bar', $scrollObj).remove();
305
+ $('.alt-scroll-horizontal-bar', $scrollObj).remove();
306
+ $('.alt-scroll-content', $scrollObj).wrapInner('<div class="alt-scroll-dummy"></div>');
307
+ $('.alt-scroll-dummy', $scrollObj).insertAfter($('.alt-scroll-holder', $scrollObj));
308
+ $('.alt-scroll-holder', $scrollObj).remove();
309
+ $('.alt-scroll-dummy > *:first-child', $scrollObj).unwrap();
310
+ $scrollObj.css({ 'overflow': $scrollObj.data('prev-overflow'), 'float': $scrollObj.data('prev-float') }).removeClass('alternate-scroll');
311
+ });
312
+ }
313
+ };
314
+
315
+ $.fn.alternateScroll = function(method) {
316
+ if (document.all && typeof XDomainRequest=="undefined") //if IE7 or less
317
+ return
318
+ if ( methods[method] ) {
319
+ return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
320
+ } else if ( typeof method === 'object' || ! method ) {
321
+ return methods.init.apply( this, arguments );
322
+ } else {
323
+ $.error( 'Method ' + method + ' does not exist on jQuery.alternateScroll' );
324
+ }
325
+ };
326
+
327
+ })( jQuery );
328
+
skin/adminhtml/default/default/js/vconnect/aio/jquery-1.11.3.js ADDED
@@ -0,0 +1,10351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.11.3
3
+ * http://jquery.com/
4
+ *
5
+ * Includes Sizzle.js
6
+ * http://sizzlejs.com/
7
+ *
8
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
9
+ * Released under the MIT license
10
+ * http://jquery.org/license
11
+ *
12
+ * Date: 2015-04-28T16:19Z
13
+ */
14
+
15
+ (function( global, factory ) {
16
+
17
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
18
+ // For CommonJS and CommonJS-like environments where a proper window is present,
19
+ // execute the factory and get jQuery
20
+ // For environments that do not inherently posses a window with a document
21
+ // (such as Node.js), expose a jQuery-making factory as module.exports
22
+ // This accentuates the need for the creation of a real window
23
+ // e.g. var jQuery = require("jquery")(window);
24
+ // See ticket #14549 for more info
25
+ module.exports = global.document ?
26
+ factory( global, true ) :
27
+ function( w ) {
28
+ if ( !w.document ) {
29
+ throw new Error( "jQuery requires a window with a document" );
30
+ }
31
+ return factory( w );
32
+ };
33
+ } else {
34
+ factory( global );
35
+ }
36
+
37
+ // Pass this if window is not defined yet
38
+ }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
39
+
40
+ // Can't do this because several apps including ASP.NET trace
41
+ // the stack via arguments.caller.callee and Firefox dies if
42
+ // you try to trace through "use strict" call chains. (#13335)
43
+ // Support: Firefox 18+
44
+ //
45
+
46
+ var deletedIds = [];
47
+
48
+ var slice = deletedIds.slice;
49
+
50
+ var concat = deletedIds.concat;
51
+
52
+ var push = deletedIds.push;
53
+
54
+ var indexOf = deletedIds.indexOf;
55
+
56
+ var class2type = {};
57
+
58
+ var toString = class2type.toString;
59
+
60
+ var hasOwn = class2type.hasOwnProperty;
61
+
62
+ var support = {};
63
+
64
+
65
+
66
+ var
67
+ version = "1.11.3",
68
+
69
+ // Define a local copy of jQuery
70
+ jQuery = function( selector, context ) {
71
+ // The jQuery object is actually just the init constructor 'enhanced'
72
+ // Need init if jQuery is called (just allow error to be thrown if not included)
73
+ return new jQuery.fn.init( selector, context );
74
+ },
75
+
76
+ // Support: Android<4.1, IE<9
77
+ // Make sure we trim BOM and NBSP
78
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
79
+
80
+ // Matches dashed string for camelizing
81
+ rmsPrefix = /^-ms-/,
82
+ rdashAlpha = /-([\da-z])/gi,
83
+
84
+ // Used by jQuery.camelCase as callback to replace()
85
+ fcamelCase = function( all, letter ) {
86
+ return letter.toUpperCase();
87
+ };
88
+
89
+ jQuery.fn = jQuery.prototype = {
90
+ // The current version of jQuery being used
91
+ jquery: version,
92
+
93
+ constructor: jQuery,
94
+
95
+ // Start with an empty selector
96
+ selector: "",
97
+
98
+ // The default length of a jQuery object is 0
99
+ length: 0,
100
+
101
+ toArray: function() {
102
+ return slice.call( this );
103
+ },
104
+
105
+ // Get the Nth element in the matched element set OR
106
+ // Get the whole matched element set as a clean array
107
+ get: function( num ) {
108
+ return num != null ?
109
+
110
+ // Return just the one element from the set
111
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
112
+
113
+ // Return all the elements in a clean array
114
+ slice.call( this );
115
+ },
116
+
117
+ // Take an array of elements and push it onto the stack
118
+ // (returning the new matched element set)
119
+ pushStack: function( elems ) {
120
+
121
+ // Build a new jQuery matched element set
122
+ var ret = jQuery.merge( this.constructor(), elems );
123
+
124
+ // Add the old object onto the stack (as a reference)
125
+ ret.prevObject = this;
126
+ ret.context = this.context;
127
+
128
+ // Return the newly-formed element set
129
+ return ret;
130
+ },
131
+
132
+ // Execute a callback for every element in the matched set.
133
+ // (You can seed the arguments with an array of args, but this is
134
+ // only used internally.)
135
+ each: function( callback, args ) {
136
+ return jQuery.each( this, callback, args );
137
+ },
138
+
139
+ map: function( callback ) {
140
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
141
+ return callback.call( elem, i, elem );
142
+ }));
143
+ },
144
+
145
+ slice: function() {
146
+ return this.pushStack( slice.apply( this, arguments ) );
147
+ },
148
+
149
+ first: function() {
150
+ return this.eq( 0 );
151
+ },
152
+
153
+ last: function() {
154
+ return this.eq( -1 );
155
+ },
156
+
157
+ eq: function( i ) {
158
+ var len = this.length,
159
+ j = +i + ( i < 0 ? len : 0 );
160
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
161
+ },
162
+
163
+ end: function() {
164
+ return this.prevObject || this.constructor(null);
165
+ },
166
+
167
+ // For internal use only.
168
+ // Behaves like an Array's method, not like a jQuery method.
169
+ push: push,
170
+ sort: deletedIds.sort,
171
+ splice: deletedIds.splice
172
+ };
173
+
174
+ jQuery.extend = jQuery.fn.extend = function() {
175
+ var src, copyIsArray, copy, name, options, clone,
176
+ target = arguments[0] || {},
177
+ i = 1,
178
+ length = arguments.length,
179
+ deep = false;
180
+
181
+ // Handle a deep copy situation
182
+ if ( typeof target === "boolean" ) {
183
+ deep = target;
184
+
185
+ // skip the boolean and the target
186
+ target = arguments[ i ] || {};
187
+ i++;
188
+ }
189
+
190
+ // Handle case when target is a string or something (possible in deep copy)
191
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
192
+ target = {};
193
+ }
194
+
195
+ // extend jQuery itself if only one argument is passed
196
+ if ( i === length ) {
197
+ target = this;
198
+ i--;
199
+ }
200
+
201
+ for ( ; i < length; i++ ) {
202
+ // Only deal with non-null/undefined values
203
+ if ( (options = arguments[ i ]) != null ) {
204
+ // Extend the base object
205
+ for ( name in options ) {
206
+ src = target[ name ];
207
+ copy = options[ name ];
208
+
209
+ // Prevent never-ending loop
210
+ if ( target === copy ) {
211
+ continue;
212
+ }
213
+
214
+ // Recurse if we're merging plain objects or arrays
215
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
216
+ if ( copyIsArray ) {
217
+ copyIsArray = false;
218
+ clone = src && jQuery.isArray(src) ? src : [];
219
+
220
+ } else {
221
+ clone = src && jQuery.isPlainObject(src) ? src : {};
222
+ }
223
+
224
+ // Never move original objects, clone them
225
+ target[ name ] = jQuery.extend( deep, clone, copy );
226
+
227
+ // Don't bring in undefined values
228
+ } else if ( copy !== undefined ) {
229
+ target[ name ] = copy;
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ // Return the modified object
236
+ return target;
237
+ };
238
+
239
+ jQuery.extend({
240
+ // Unique for each copy of jQuery on the page
241
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
242
+
243
+ // Assume jQuery is ready without the ready module
244
+ isReady: true,
245
+
246
+ error: function( msg ) {
247
+ throw new Error( msg );
248
+ },
249
+
250
+ noop: function() {},
251
+
252
+ // See test/unit/core.js for details concerning isFunction.
253
+ // Since version 1.3, DOM methods and functions like alert
254
+ // aren't supported. They return false on IE (#2968).
255
+ isFunction: function( obj ) {
256
+ return jQuery.type(obj) === "function";
257
+ },
258
+
259
+ isArray: Array.isArray || function( obj ) {
260
+ return jQuery.type(obj) === "array";
261
+ },
262
+
263
+ isWindow: function( obj ) {
264
+ /* jshint eqeqeq: false */
265
+ return obj != null && obj == obj.window;
266
+ },
267
+
268
+ isNumeric: function( obj ) {
269
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
270
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
271
+ // subtraction forces infinities to NaN
272
+ // adding 1 corrects loss of precision from parseFloat (#15100)
273
+ return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
274
+ },
275
+
276
+ isEmptyObject: function( obj ) {
277
+ var name;
278
+ for ( name in obj ) {
279
+ return false;
280
+ }
281
+ return true;
282
+ },
283
+
284
+ isPlainObject: function( obj ) {
285
+ var key;
286
+
287
+ // Must be an Object.
288
+ // Because of IE, we also have to check the presence of the constructor property.
289
+ // Make sure that DOM nodes and window objects don't pass through, as well
290
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
291
+ return false;
292
+ }
293
+
294
+ try {
295
+ // Not own constructor property must be Object
296
+ if ( obj.constructor &&
297
+ !hasOwn.call(obj, "constructor") &&
298
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
299
+ return false;
300
+ }
301
+ } catch ( e ) {
302
+ // IE8,9 Will throw exceptions on certain host objects #9897
303
+ return false;
304
+ }
305
+
306
+ // Support: IE<9
307
+ // Handle iteration over inherited properties before own properties.
308
+ if ( support.ownLast ) {
309
+ for ( key in obj ) {
310
+ return hasOwn.call( obj, key );
311
+ }
312
+ }
313
+
314
+ // Own properties are enumerated firstly, so to speed up,
315
+ // if last one is own, then all properties are own.
316
+ for ( key in obj ) {}
317
+
318
+ return key === undefined || hasOwn.call( obj, key );
319
+ },
320
+
321
+ type: function( obj ) {
322
+ if ( obj == null ) {
323
+ return obj + "";
324
+ }
325
+ return typeof obj === "object" || typeof obj === "function" ?
326
+ class2type[ toString.call(obj) ] || "object" :
327
+ typeof obj;
328
+ },
329
+
330
+ // Evaluates a script in a global context
331
+ // Workarounds based on findings by Jim Driscoll
332
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
333
+ globalEval: function( data ) {
334
+ if ( data && jQuery.trim( data ) ) {
335
+ // We use execScript on Internet Explorer
336
+ // We use an anonymous function so that context is window
337
+ // rather than jQuery in Firefox
338
+ ( window.execScript || function( data ) {
339
+ window[ "eval" ].call( window, data );
340
+ } )( data );
341
+ }
342
+ },
343
+
344
+ // Convert dashed to camelCase; used by the css and data modules
345
+ // Microsoft forgot to hump their vendor prefix (#9572)
346
+ camelCase: function( string ) {
347
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
348
+ },
349
+
350
+ nodeName: function( elem, name ) {
351
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
352
+ },
353
+
354
+ // args is for internal usage only
355
+ each: function( obj, callback, args ) {
356
+ var value,
357
+ i = 0,
358
+ length = obj.length,
359
+ isArray = isArraylike( obj );
360
+
361
+ if ( args ) {
362
+ if ( isArray ) {
363
+ for ( ; i < length; i++ ) {
364
+ value = callback.apply( obj[ i ], args );
365
+
366
+ if ( value === false ) {
367
+ break;
368
+ }
369
+ }
370
+ } else {
371
+ for ( i in obj ) {
372
+ value = callback.apply( obj[ i ], args );
373
+
374
+ if ( value === false ) {
375
+ break;
376
+ }
377
+ }
378
+ }
379
+
380
+ // A special, fast, case for the most common use of each
381
+ } else {
382
+ if ( isArray ) {
383
+ for ( ; i < length; i++ ) {
384
+ value = callback.call( obj[ i ], i, obj[ i ] );
385
+
386
+ if ( value === false ) {
387
+ break;
388
+ }
389
+ }
390
+ } else {
391
+ for ( i in obj ) {
392
+ value = callback.call( obj[ i ], i, obj[ i ] );
393
+
394
+ if ( value === false ) {
395
+ break;
396
+ }
397
+ }
398
+ }
399
+ }
400
+
401
+ return obj;
402
+ },
403
+
404
+ // Support: Android<4.1, IE<9
405
+ trim: function( text ) {
406
+ return text == null ?
407
+ "" :
408
+ ( text + "" ).replace( rtrim, "" );
409
+ },
410
+
411
+ // results is for internal usage only
412
+ makeArray: function( arr, results ) {
413
+ var ret = results || [];
414
+
415
+ if ( arr != null ) {
416
+ if ( isArraylike( Object(arr) ) ) {
417
+ jQuery.merge( ret,
418
+ typeof arr === "string" ?
419
+ [ arr ] : arr
420
+ );
421
+ } else {
422
+ push.call( ret, arr );
423
+ }
424
+ }
425
+
426
+ return ret;
427
+ },
428
+
429
+ inArray: function( elem, arr, i ) {
430
+ var len;
431
+
432
+ if ( arr ) {
433
+ if ( indexOf ) {
434
+ return indexOf.call( arr, elem, i );
435
+ }
436
+
437
+ len = arr.length;
438
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
439
+
440
+ for ( ; i < len; i++ ) {
441
+ // Skip accessing in sparse arrays
442
+ if ( i in arr && arr[ i ] === elem ) {
443
+ return i;
444
+ }
445
+ }
446
+ }
447
+
448
+ return -1;
449
+ },
450
+
451
+ merge: function( first, second ) {
452
+ var len = +second.length,
453
+ j = 0,
454
+ i = first.length;
455
+
456
+ while ( j < len ) {
457
+ first[ i++ ] = second[ j++ ];
458
+ }
459
+
460
+ // Support: IE<9
461
+ // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
462
+ if ( len !== len ) {
463
+ while ( second[j] !== undefined ) {
464
+ first[ i++ ] = second[ j++ ];
465
+ }
466
+ }
467
+
468
+ first.length = i;
469
+
470
+ return first;
471
+ },
472
+
473
+ grep: function( elems, callback, invert ) {
474
+ var callbackInverse,
475
+ matches = [],
476
+ i = 0,
477
+ length = elems.length,
478
+ callbackExpect = !invert;
479
+
480
+ // Go through the array, only saving the items
481
+ // that pass the validator function
482
+ for ( ; i < length; i++ ) {
483
+ callbackInverse = !callback( elems[ i ], i );
484
+ if ( callbackInverse !== callbackExpect ) {
485
+ matches.push( elems[ i ] );
486
+ }
487
+ }
488
+
489
+ return matches;
490
+ },
491
+
492
+ // arg is for internal usage only
493
+ map: function( elems, callback, arg ) {
494
+ var value,
495
+ i = 0,
496
+ length = elems.length,
497
+ isArray = isArraylike( elems ),
498
+ ret = [];
499
+
500
+ // Go through the array, translating each of the items to their new values
501
+ if ( isArray ) {
502
+ for ( ; i < length; i++ ) {
503
+ value = callback( elems[ i ], i, arg );
504
+
505
+ if ( value != null ) {
506
+ ret.push( value );
507
+ }
508
+ }
509
+
510
+ // Go through every key on the object,
511
+ } else {
512
+ for ( i in elems ) {
513
+ value = callback( elems[ i ], i, arg );
514
+
515
+ if ( value != null ) {
516
+ ret.push( value );
517
+ }
518
+ }
519
+ }
520
+
521
+ // Flatten any nested arrays
522
+ return concat.apply( [], ret );
523
+ },
524
+
525
+ // A global GUID counter for objects
526
+ guid: 1,
527
+
528
+ // Bind a function to a context, optionally partially applying any
529
+ // arguments.
530
+ proxy: function( fn, context ) {
531
+ var args, proxy, tmp;
532
+
533
+ if ( typeof context === "string" ) {
534
+ tmp = fn[ context ];
535
+ context = fn;
536
+ fn = tmp;
537
+ }
538
+
539
+ // Quick check to determine if target is callable, in the spec
540
+ // this throws a TypeError, but we will just return undefined.
541
+ if ( !jQuery.isFunction( fn ) ) {
542
+ return undefined;
543
+ }
544
+
545
+ // Simulated bind
546
+ args = slice.call( arguments, 2 );
547
+ proxy = function() {
548
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
549
+ };
550
+
551
+ // Set the guid of unique handler to the same of original handler, so it can be removed
552
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
553
+
554
+ return proxy;
555
+ },
556
+
557
+ now: function() {
558
+ return +( new Date() );
559
+ },
560
+
561
+ // jQuery.support is not used in Core but other projects attach their
562
+ // properties to it so it needs to exist.
563
+ support: support
564
+ });
565
+
566
+ // Populate the class2type map
567
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
568
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
569
+ });
570
+
571
+ function isArraylike( obj ) {
572
+
573
+ // Support: iOS 8.2 (not reproducible in simulator)
574
+ // `in` check used to prevent JIT error (gh-2145)
575
+ // hasOwn isn't used here due to false negatives
576
+ // regarding Nodelist length in IE
577
+ var length = "length" in obj && obj.length,
578
+ type = jQuery.type( obj );
579
+
580
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
581
+ return false;
582
+ }
583
+
584
+ if ( obj.nodeType === 1 && length ) {
585
+ return true;
586
+ }
587
+
588
+ return type === "array" || length === 0 ||
589
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
590
+ }
591
+ var Sizzle =
592
+ /*!
593
+ * Sizzle CSS Selector Engine v2.2.0-pre
594
+ * http://sizzlejs.com/
595
+ *
596
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
597
+ * Released under the MIT license
598
+ * http://jquery.org/license
599
+ *
600
+ * Date: 2014-12-16
601
+ */
602
+ (function( window ) {
603
+
604
+ var i,
605
+ support,
606
+ Expr,
607
+ getText,
608
+ isXML,
609
+ tokenize,
610
+ compile,
611
+ select,
612
+ outermostContext,
613
+ sortInput,
614
+ hasDuplicate,
615
+
616
+ // Local document vars
617
+ setDocument,
618
+ document,
619
+ docElem,
620
+ documentIsHTML,
621
+ rbuggyQSA,
622
+ rbuggyMatches,
623
+ matches,
624
+ contains,
625
+
626
+ // Instance-specific data
627
+ expando = "sizzle" + 1 * new Date(),
628
+ preferredDoc = window.document,
629
+ dirruns = 0,
630
+ done = 0,
631
+ classCache = createCache(),
632
+ tokenCache = createCache(),
633
+ compilerCache = createCache(),
634
+ sortOrder = function( a, b ) {
635
+ if ( a === b ) {
636
+ hasDuplicate = true;
637
+ }
638
+ return 0;
639
+ },
640
+
641
+ // General-purpose constants
642
+ MAX_NEGATIVE = 1 << 31,
643
+
644
+ // Instance methods
645
+ hasOwn = ({}).hasOwnProperty,
646
+ arr = [],
647
+ pop = arr.pop,
648
+ push_native = arr.push,
649
+ push = arr.push,
650
+ slice = arr.slice,
651
+ // Use a stripped-down indexOf as it's faster than native
652
+ // http://jsperf.com/thor-indexof-vs-for/5
653
+ indexOf = function( list, elem ) {
654
+ var i = 0,
655
+ len = list.length;
656
+ for ( ; i < len; i++ ) {
657
+ if ( list[i] === elem ) {
658
+ return i;
659
+ }
660
+ }
661
+ return -1;
662
+ },
663
+
664
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
665
+
666
+ // Regular expressions
667
+
668
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
669
+ whitespace = "[\\x20\\t\\r\\n\\f]",
670
+ // http://www.w3.org/TR/css3-syntax/#characters
671
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
672
+
673
+ // Loosely modeled on CSS identifier characters
674
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
675
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
676
+ identifier = characterEncoding.replace( "w", "w#" ),
677
+
678
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
679
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
680
+ // Operator (capture 2)
681
+ "*([*^$|!~]?=)" + whitespace +
682
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
683
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
684
+ "*\\]",
685
+
686
+ pseudos = ":(" + characterEncoding + ")(?:\\((" +
687
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
688
+ // 1. quoted (capture 3; capture 4 or capture 5)
689
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
690
+ // 2. simple (capture 6)
691
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
692
+ // 3. anything else (capture 2)
693
+ ".*" +
694
+ ")\\)|)",
695
+
696
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
697
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
698
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
699
+
700
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
701
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
702
+
703
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
704
+
705
+ rpseudo = new RegExp( pseudos ),
706
+ ridentifier = new RegExp( "^" + identifier + "$" ),
707
+
708
+ matchExpr = {
709
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
710
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
711
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
712
+ "ATTR": new RegExp( "^" + attributes ),
713
+ "PSEUDO": new RegExp( "^" + pseudos ),
714
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
715
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
716
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
717
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
718
+ // For use in libraries implementing .is()
719
+ // We use this for POS matching in `select`
720
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
721
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
722
+ },
723
+
724
+ rinputs = /^(?:input|select|textarea|button)$/i,
725
+ rheader = /^h\d$/i,
726
+
727
+ rnative = /^[^{]+\{\s*\[native \w/,
728
+
729
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
730
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
731
+
732
+ rsibling = /[+~]/,
733
+ rescape = /'|\\/g,
734
+
735
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
736
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
737
+ funescape = function( _, escaped, escapedWhitespace ) {
738
+ var high = "0x" + escaped - 0x10000;
739
+ // NaN means non-codepoint
740
+ // Support: Firefox<24
741
+ // Workaround erroneous numeric interpretation of +"0x"
742
+ return high !== high || escapedWhitespace ?
743
+ escaped :
744
+ high < 0 ?
745
+ // BMP codepoint
746
+ String.fromCharCode( high + 0x10000 ) :
747
+ // Supplemental Plane codepoint (surrogate pair)
748
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
749
+ },
750
+
751
+ // Used for iframes
752
+ // See setDocument()
753
+ // Removing the function wrapper causes a "Permission Denied"
754
+ // error in IE
755
+ unloadHandler = function() {
756
+ setDocument();
757
+ };
758
+
759
+ // Optimize for push.apply( _, NodeList )
760
+ try {
761
+ push.apply(
762
+ (arr = slice.call( preferredDoc.childNodes )),
763
+ preferredDoc.childNodes
764
+ );
765
+ // Support: Android<4.0
766
+ // Detect silently failing push.apply
767
+ arr[ preferredDoc.childNodes.length ].nodeType;
768
+ } catch ( e ) {
769
+ push = { apply: arr.length ?
770
+
771
+ // Leverage slice if possible
772
+ function( target, els ) {
773
+ push_native.apply( target, slice.call(els) );
774
+ } :
775
+
776
+ // Support: IE<9
777
+ // Otherwise append directly
778
+ function( target, els ) {
779
+ var j = target.length,
780
+ i = 0;
781
+ // Can't trust NodeList.length
782
+ while ( (target[j++] = els[i++]) ) {}
783
+ target.length = j - 1;
784
+ }
785
+ };
786
+ }
787
+
788
+ function Sizzle( selector, context, results, seed ) {
789
+ var match, elem, m, nodeType,
790
+ // QSA vars
791
+ i, groups, old, nid, newContext, newSelector;
792
+
793
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
794
+ setDocument( context );
795
+ }
796
+
797
+ context = context || document;
798
+ results = results || [];
799
+ nodeType = context.nodeType;
800
+
801
+ if ( typeof selector !== "string" || !selector ||
802
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
803
+
804
+ return results;
805
+ }
806
+
807
+ if ( !seed && documentIsHTML ) {
808
+
809
+ // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
810
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
811
+ // Speed-up: Sizzle("#ID")
812
+ if ( (m = match[1]) ) {
813
+ if ( nodeType === 9 ) {
814
+ elem = context.getElementById( m );
815
+ // Check parentNode to catch when Blackberry 4.6 returns
816
+ // nodes that are no longer in the document (jQuery #6963)
817
+ if ( elem && elem.parentNode ) {
818
+ // Handle the case where IE, Opera, and Webkit return items
819
+ // by name instead of ID
820
+ if ( elem.id === m ) {
821
+ results.push( elem );
822
+ return results;
823
+ }
824
+ } else {
825
+ return results;
826
+ }
827
+ } else {
828
+ // Context is not a document
829
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
830
+ contains( context, elem ) && elem.id === m ) {
831
+ results.push( elem );
832
+ return results;
833
+ }
834
+ }
835
+
836
+ // Speed-up: Sizzle("TAG")
837
+ } else if ( match[2] ) {
838
+ push.apply( results, context.getElementsByTagName( selector ) );
839
+ return results;
840
+
841
+ // Speed-up: Sizzle(".CLASS")
842
+ } else if ( (m = match[3]) && support.getElementsByClassName ) {
843
+ push.apply( results, context.getElementsByClassName( m ) );
844
+ return results;
845
+ }
846
+ }
847
+
848
+ // QSA path
849
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
850
+ nid = old = expando;
851
+ newContext = context;
852
+ newSelector = nodeType !== 1 && selector;
853
+
854
+ // qSA works strangely on Element-rooted queries
855
+ // We can work around this by specifying an extra ID on the root
856
+ // and working up from there (Thanks to Andrew Dupont for the technique)
857
+ // IE 8 doesn't work on object elements
858
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
859
+ groups = tokenize( selector );
860
+
861
+ if ( (old = context.getAttribute("id")) ) {
862
+ nid = old.replace( rescape, "\\$&" );
863
+ } else {
864
+ context.setAttribute( "id", nid );
865
+ }
866
+ nid = "[id='" + nid + "'] ";
867
+
868
+ i = groups.length;
869
+ while ( i-- ) {
870
+ groups[i] = nid + toSelector( groups[i] );
871
+ }
872
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
873
+ newSelector = groups.join(",");
874
+ }
875
+
876
+ if ( newSelector ) {
877
+ try {
878
+ push.apply( results,
879
+ newContext.querySelectorAll( newSelector )
880
+ );
881
+ return results;
882
+ } catch(qsaError) {
883
+ } finally {
884
+ if ( !old ) {
885
+ context.removeAttribute("id");
886
+ }
887
+ }
888
+ }
889
+ }
890
+ }
891
+
892
+ // All others
893
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
894
+ }
895
+
896
+ /**
897
+ * Create key-value caches of limited size
898
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
899
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
900
+ * deleting the oldest entry
901
+ */
902
+ function createCache() {
903
+ var keys = [];
904
+
905
+ function cache( key, value ) {
906
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
907
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
908
+ // Only keep the most recent entries
909
+ delete cache[ keys.shift() ];
910
+ }
911
+ return (cache[ key + " " ] = value);
912
+ }
913
+ return cache;
914
+ }
915
+
916
+ /**
917
+ * Mark a function for special use by Sizzle
918
+ * @param {Function} fn The function to mark
919
+ */
920
+ function markFunction( fn ) {
921
+ fn[ expando ] = true;
922
+ return fn;
923
+ }
924
+
925
+ /**
926
+ * Support testing using an element
927
+ * @param {Function} fn Passed the created div and expects a boolean result
928
+ */
929
+ function assert( fn ) {
930
+ var div = document.createElement("div");
931
+
932
+ try {
933
+ return !!fn( div );
934
+ } catch (e) {
935
+ return false;
936
+ } finally {
937
+ // Remove from its parent by default
938
+ if ( div.parentNode ) {
939
+ div.parentNode.removeChild( div );
940
+ }
941
+ // release memory in IE
942
+ div = null;
943
+ }
944
+ }
945
+
946
+ /**
947
+ * Adds the same handler for all of the specified attrs
948
+ * @param {String} attrs Pipe-separated list of attributes
949
+ * @param {Function} handler The method that will be applied
950
+ */
951
+ function addHandle( attrs, handler ) {
952
+ var arr = attrs.split("|"),
953
+ i = attrs.length;
954
+
955
+ while ( i-- ) {
956
+ Expr.attrHandle[ arr[i] ] = handler;
957
+ }
958
+ }
959
+
960
+ /**
961
+ * Checks document order of two siblings
962
+ * @param {Element} a
963
+ * @param {Element} b
964
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
965
+ */
966
+ function siblingCheck( a, b ) {
967
+ var cur = b && a,
968
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
969
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
970
+ ( ~a.sourceIndex || MAX_NEGATIVE );
971
+
972
+ // Use IE sourceIndex if available on both nodes
973
+ if ( diff ) {
974
+ return diff;
975
+ }
976
+
977
+ // Check if b follows a
978
+ if ( cur ) {
979
+ while ( (cur = cur.nextSibling) ) {
980
+ if ( cur === b ) {
981
+ return -1;
982
+ }
983
+ }
984
+ }
985
+
986
+ return a ? 1 : -1;
987
+ }
988
+
989
+ /**
990
+ * Returns a function to use in pseudos for input types
991
+ * @param {String} type
992
+ */
993
+ function createInputPseudo( type ) {
994
+ return function( elem ) {
995
+ var name = elem.nodeName.toLowerCase();
996
+ return name === "input" && elem.type === type;
997
+ };
998
+ }
999
+
1000
+ /**
1001
+ * Returns a function to use in pseudos for buttons
1002
+ * @param {String} type
1003
+ */
1004
+ function createButtonPseudo( type ) {
1005
+ return function( elem ) {
1006
+ var name = elem.nodeName.toLowerCase();
1007
+ return (name === "input" || name === "button") && elem.type === type;
1008
+ };
1009
+ }
1010
+
1011
+ /**
1012
+ * Returns a function to use in pseudos for positionals
1013
+ * @param {Function} fn
1014
+ */
1015
+ function createPositionalPseudo( fn ) {
1016
+ return markFunction(function( argument ) {
1017
+ argument = +argument;
1018
+ return markFunction(function( seed, matches ) {
1019
+ var j,
1020
+ matchIndexes = fn( [], seed.length, argument ),
1021
+ i = matchIndexes.length;
1022
+
1023
+ // Match elements found at the specified indexes
1024
+ while ( i-- ) {
1025
+ if ( seed[ (j = matchIndexes[i]) ] ) {
1026
+ seed[j] = !(matches[j] = seed[j]);
1027
+ }
1028
+ }
1029
+ });
1030
+ });
1031
+ }
1032
+
1033
+ /**
1034
+ * Checks a node for validity as a Sizzle context
1035
+ * @param {Element|Object=} context
1036
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1037
+ */
1038
+ function testContext( context ) {
1039
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
1040
+ }
1041
+
1042
+ // Expose support vars for convenience
1043
+ support = Sizzle.support = {};
1044
+
1045
+ /**
1046
+ * Detects XML nodes
1047
+ * @param {Element|Object} elem An element or a document
1048
+ * @returns {Boolean} True iff elem is a non-HTML XML node
1049
+ */
1050
+ isXML = Sizzle.isXML = function( elem ) {
1051
+ // documentElement is verified for cases where it doesn't yet exist
1052
+ // (such as loading iframes in IE - #4833)
1053
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1054
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
1055
+ };
1056
+
1057
+ /**
1058
+ * Sets document-related variables once based on the current document
1059
+ * @param {Element|Object} [doc] An element or document object to use to set the document
1060
+ * @returns {Object} Returns the current document
1061
+ */
1062
+ setDocument = Sizzle.setDocument = function( node ) {
1063
+ var hasCompare, parent,
1064
+ doc = node ? node.ownerDocument || node : preferredDoc;
1065
+
1066
+ // If no document and documentElement is available, return
1067
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1068
+ return document;
1069
+ }
1070
+
1071
+ // Set our document
1072
+ document = doc;
1073
+ docElem = doc.documentElement;
1074
+ parent = doc.defaultView;
1075
+
1076
+ // Support: IE>8
1077
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1078
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1079
+ // IE6-8 do not support the defaultView property so parent will be undefined
1080
+ if ( parent && parent !== parent.top ) {
1081
+ // IE11 does not have attachEvent, so all must suffer
1082
+ if ( parent.addEventListener ) {
1083
+ parent.addEventListener( "unload", unloadHandler, false );
1084
+ } else if ( parent.attachEvent ) {
1085
+ parent.attachEvent( "onunload", unloadHandler );
1086
+ }
1087
+ }
1088
+
1089
+ /* Support tests
1090
+ ---------------------------------------------------------------------- */
1091
+ documentIsHTML = !isXML( doc );
1092
+
1093
+ /* Attributes
1094
+ ---------------------------------------------------------------------- */
1095
+
1096
+ // Support: IE<8
1097
+ // Verify that getAttribute really returns attributes and not properties
1098
+ // (excepting IE8 booleans)
1099
+ support.attributes = assert(function( div ) {
1100
+ div.className = "i";
1101
+ return !div.getAttribute("className");
1102
+ });
1103
+
1104
+ /* getElement(s)By*
1105
+ ---------------------------------------------------------------------- */
1106
+
1107
+ // Check if getElementsByTagName("*") returns only elements
1108
+ support.getElementsByTagName = assert(function( div ) {
1109
+ div.appendChild( doc.createComment("") );
1110
+ return !div.getElementsByTagName("*").length;
1111
+ });
1112
+
1113
+ // Support: IE<9
1114
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
1115
+
1116
+ // Support: IE<10
1117
+ // Check if getElementById returns elements by name
1118
+ // The broken getElementById methods don't pick up programatically-set names,
1119
+ // so use a roundabout getElementsByName test
1120
+ support.getById = assert(function( div ) {
1121
+ docElem.appendChild( div ).id = expando;
1122
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1123
+ });
1124
+
1125
+ // ID find and filter
1126
+ if ( support.getById ) {
1127
+ Expr.find["ID"] = function( id, context ) {
1128
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1129
+ var m = context.getElementById( id );
1130
+ // Check parentNode to catch when Blackberry 4.6 returns
1131
+ // nodes that are no longer in the document #6963
1132
+ return m && m.parentNode ? [ m ] : [];
1133
+ }
1134
+ };
1135
+ Expr.filter["ID"] = function( id ) {
1136
+ var attrId = id.replace( runescape, funescape );
1137
+ return function( elem ) {
1138
+ return elem.getAttribute("id") === attrId;
1139
+ };
1140
+ };
1141
+ } else {
1142
+ // Support: IE6/7
1143
+ // getElementById is not reliable as a find shortcut
1144
+ delete Expr.find["ID"];
1145
+
1146
+ Expr.filter["ID"] = function( id ) {
1147
+ var attrId = id.replace( runescape, funescape );
1148
+ return function( elem ) {
1149
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1150
+ return node && node.value === attrId;
1151
+ };
1152
+ };
1153
+ }
1154
+
1155
+ // Tag
1156
+ Expr.find["TAG"] = support.getElementsByTagName ?
1157
+ function( tag, context ) {
1158
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
1159
+ return context.getElementsByTagName( tag );
1160
+
1161
+ // DocumentFragment nodes don't have gEBTN
1162
+ } else if ( support.qsa ) {
1163
+ return context.querySelectorAll( tag );
1164
+ }
1165
+ } :
1166
+
1167
+ function( tag, context ) {
1168
+ var elem,
1169
+ tmp = [],
1170
+ i = 0,
1171
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1172
+ results = context.getElementsByTagName( tag );
1173
+
1174
+ // Filter out possible comments
1175
+ if ( tag === "*" ) {
1176
+ while ( (elem = results[i++]) ) {
1177
+ if ( elem.nodeType === 1 ) {
1178
+ tmp.push( elem );
1179
+ }
1180
+ }
1181
+
1182
+ return tmp;
1183
+ }
1184
+ return results;
1185
+ };
1186
+
1187
+ // Class
1188
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1189
+ if ( documentIsHTML ) {
1190
+ return context.getElementsByClassName( className );
1191
+ }
1192
+ };
1193
+
1194
+ /* QSA/matchesSelector
1195
+ ---------------------------------------------------------------------- */
1196
+
1197
+ // QSA and matchesSelector support
1198
+
1199
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1200
+ rbuggyMatches = [];
1201
+
1202
+ // qSa(:focus) reports false when true (Chrome 21)
1203
+ // We allow this because of a bug in IE8/9 that throws an error
1204
+ // whenever `document.activeElement` is accessed on an iframe
1205
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
1206
+ // See http://bugs.jquery.com/ticket/13378
1207
+ rbuggyQSA = [];
1208
+
1209
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1210
+ // Build QSA regex
1211
+ // Regex strategy adopted from Diego Perini
1212
+ assert(function( div ) {
1213
+ // Select is set to empty string on purpose
1214
+ // This is to test IE's treatment of not explicitly
1215
+ // setting a boolean content attribute,
1216
+ // since its presence should be enough
1217
+ // http://bugs.jquery.com/ticket/12359
1218
+ docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
1219
+ "<select id='" + expando + "-\f]' msallowcapture=''>" +
1220
+ "<option selected=''></option></select>";
1221
+
1222
+ // Support: IE8, Opera 11-12.16
1223
+ // Nothing should be selected when empty strings follow ^= or $= or *=
1224
+ // The test attribute must be unknown in Opera but "safe" for WinRT
1225
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1226
+ if ( div.querySelectorAll("[msallowcapture^='']").length ) {
1227
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1228
+ }
1229
+
1230
+ // Support: IE8
1231
+ // Boolean attributes and "value" are not treated correctly
1232
+ if ( !div.querySelectorAll("[selected]").length ) {
1233
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1234
+ }
1235
+
1236
+ // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
1237
+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1238
+ rbuggyQSA.push("~=");
1239
+ }
1240
+
1241
+ // Webkit/Opera - :checked should return selected option elements
1242
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1243
+ // IE8 throws error here and will not see later tests
1244
+ if ( !div.querySelectorAll(":checked").length ) {
1245
+ rbuggyQSA.push(":checked");
1246
+ }
1247
+
1248
+ // Support: Safari 8+, iOS 8+
1249
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
1250
+ // In-page `selector#id sibing-combinator selector` fails
1251
+ if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
1252
+ rbuggyQSA.push(".#.+[+~]");
1253
+ }
1254
+ });
1255
+
1256
+ assert(function( div ) {
1257
+ // Support: Windows 8 Native Apps
1258
+ // The type and name attributes are restricted during .innerHTML assignment
1259
+ var input = doc.createElement("input");
1260
+ input.setAttribute( "type", "hidden" );
1261
+ div.appendChild( input ).setAttribute( "name", "D" );
1262
+
1263
+ // Support: IE8
1264
+ // Enforce case-sensitivity of name attribute
1265
+ if ( div.querySelectorAll("[name=d]").length ) {
1266
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1267
+ }
1268
+
1269
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1270
+ // IE8 throws error here and will not see later tests
1271
+ if ( !div.querySelectorAll(":enabled").length ) {
1272
+ rbuggyQSA.push( ":enabled", ":disabled" );
1273
+ }
1274
+
1275
+ // Opera 10-11 does not throw on post-comma invalid pseudos
1276
+ div.querySelectorAll("*,:x");
1277
+ rbuggyQSA.push(",.*:");
1278
+ });
1279
+ }
1280
+
1281
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1282
+ docElem.webkitMatchesSelector ||
1283
+ docElem.mozMatchesSelector ||
1284
+ docElem.oMatchesSelector ||
1285
+ docElem.msMatchesSelector) )) ) {
1286
+
1287
+ assert(function( div ) {
1288
+ // Check to see if it's possible to do matchesSelector
1289
+ // on a disconnected node (IE 9)
1290
+ support.disconnectedMatch = matches.call( div, "div" );
1291
+
1292
+ // This should fail with an exception
1293
+ // Gecko does not error, returns false instead
1294
+ matches.call( div, "[s!='']:x" );
1295
+ rbuggyMatches.push( "!=", pseudos );
1296
+ });
1297
+ }
1298
+
1299
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1300
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1301
+
1302
+ /* Contains
1303
+ ---------------------------------------------------------------------- */
1304
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
1305
+
1306
+ // Element contains another
1307
+ // Purposefully does not implement inclusive descendent
1308
+ // As in, an element does not contain itself
1309
+ contains = hasCompare || rnative.test( docElem.contains ) ?
1310
+ function( a, b ) {
1311
+ var adown = a.nodeType === 9 ? a.documentElement : a,
1312
+ bup = b && b.parentNode;
1313
+ return a === bup || !!( bup && bup.nodeType === 1 && (
1314
+ adown.contains ?
1315
+ adown.contains( bup ) :
1316
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1317
+ ));
1318
+ } :
1319
+ function( a, b ) {
1320
+ if ( b ) {
1321
+ while ( (b = b.parentNode) ) {
1322
+ if ( b === a ) {
1323
+ return true;
1324
+ }
1325
+ }
1326
+ }
1327
+ return false;
1328
+ };
1329
+
1330
+ /* Sorting
1331
+ ---------------------------------------------------------------------- */
1332
+
1333
+ // Document order sorting
1334
+ sortOrder = hasCompare ?
1335
+ function( a, b ) {
1336
+
1337
+ // Flag for duplicate removal
1338
+ if ( a === b ) {
1339
+ hasDuplicate = true;
1340
+ return 0;
1341
+ }
1342
+
1343
+ // Sort on method existence if only one input has compareDocumentPosition
1344
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1345
+ if ( compare ) {
1346
+ return compare;
1347
+ }
1348
+
1349
+ // Calculate position if both inputs belong to the same document
1350
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1351
+ a.compareDocumentPosition( b ) :
1352
+
1353
+ // Otherwise we know they are disconnected
1354
+ 1;
1355
+
1356
+ // Disconnected nodes
1357
+ if ( compare & 1 ||
1358
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1359
+
1360
+ // Choose the first element that is related to our preferred document
1361
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1362
+ return -1;
1363
+ }
1364
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1365
+ return 1;
1366
+ }
1367
+
1368
+ // Maintain original order
1369
+ return sortInput ?
1370
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1371
+ 0;
1372
+ }
1373
+
1374
+ return compare & 4 ? -1 : 1;
1375
+ } :
1376
+ function( a, b ) {
1377
+ // Exit early if the nodes are identical
1378
+ if ( a === b ) {
1379
+ hasDuplicate = true;
1380
+ return 0;
1381
+ }
1382
+
1383
+ var cur,
1384
+ i = 0,
1385
+ aup = a.parentNode,
1386
+ bup = b.parentNode,
1387
+ ap = [ a ],
1388
+ bp = [ b ];
1389
+
1390
+ // Parentless nodes are either documents or disconnected
1391
+ if ( !aup || !bup ) {
1392
+ return a === doc ? -1 :
1393
+ b === doc ? 1 :
1394
+ aup ? -1 :
1395
+ bup ? 1 :
1396
+ sortInput ?
1397
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1398
+ 0;
1399
+
1400
+ // If the nodes are siblings, we can do a quick check
1401
+ } else if ( aup === bup ) {
1402
+ return siblingCheck( a, b );
1403
+ }
1404
+
1405
+ // Otherwise we need full lists of their ancestors for comparison
1406
+ cur = a;
1407
+ while ( (cur = cur.parentNode) ) {
1408
+ ap.unshift( cur );
1409
+ }
1410
+ cur = b;
1411
+ while ( (cur = cur.parentNode) ) {
1412
+ bp.unshift( cur );
1413
+ }
1414
+
1415
+ // Walk down the tree looking for a discrepancy
1416
+ while ( ap[i] === bp[i] ) {
1417
+ i++;
1418
+ }
1419
+
1420
+ return i ?
1421
+ // Do a sibling check if the nodes have a common ancestor
1422
+ siblingCheck( ap[i], bp[i] ) :
1423
+
1424
+ // Otherwise nodes in our document sort first
1425
+ ap[i] === preferredDoc ? -1 :
1426
+ bp[i] === preferredDoc ? 1 :
1427
+ 0;
1428
+ };
1429
+
1430
+ return doc;
1431
+ };
1432
+
1433
+ Sizzle.matches = function( expr, elements ) {
1434
+ return Sizzle( expr, null, null, elements );
1435
+ };
1436
+
1437
+ Sizzle.matchesSelector = function( elem, expr ) {
1438
+ // Set document vars if needed
1439
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1440
+ setDocument( elem );
1441
+ }
1442
+
1443
+ // Make sure that attribute selectors are quoted
1444
+ expr = expr.replace( rattributeQuotes, "='$1']" );
1445
+
1446
+ if ( support.matchesSelector && documentIsHTML &&
1447
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1448
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1449
+
1450
+ try {
1451
+ var ret = matches.call( elem, expr );
1452
+
1453
+ // IE 9's matchesSelector returns false on disconnected nodes
1454
+ if ( ret || support.disconnectedMatch ||
1455
+ // As well, disconnected nodes are said to be in a document
1456
+ // fragment in IE 9
1457
+ elem.document && elem.document.nodeType !== 11 ) {
1458
+ return ret;
1459
+ }
1460
+ } catch (e) {}
1461
+ }
1462
+
1463
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
1464
+ };
1465
+
1466
+ Sizzle.contains = function( context, elem ) {
1467
+ // Set document vars if needed
1468
+ if ( ( context.ownerDocument || context ) !== document ) {
1469
+ setDocument( context );
1470
+ }
1471
+ return contains( context, elem );
1472
+ };
1473
+
1474
+ Sizzle.attr = function( elem, name ) {
1475
+ // Set document vars if needed
1476
+ if ( ( elem.ownerDocument || elem ) !== document ) {
1477
+ setDocument( elem );
1478
+ }
1479
+
1480
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
1481
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
1482
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1483
+ fn( elem, name, !documentIsHTML ) :
1484
+ undefined;
1485
+
1486
+ return val !== undefined ?
1487
+ val :
1488
+ support.attributes || !documentIsHTML ?
1489
+ elem.getAttribute( name ) :
1490
+ (val = elem.getAttributeNode(name)) && val.specified ?
1491
+ val.value :
1492
+ null;
1493
+ };
1494
+
1495
+ Sizzle.error = function( msg ) {
1496
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
1497
+ };
1498
+
1499
+ /**
1500
+ * Document sorting and removing duplicates
1501
+ * @param {ArrayLike} results
1502
+ */
1503
+ Sizzle.uniqueSort = function( results ) {
1504
+ var elem,
1505
+ duplicates = [],
1506
+ j = 0,
1507
+ i = 0;
1508
+
1509
+ // Unless we *know* we can detect duplicates, assume their presence
1510
+ hasDuplicate = !support.detectDuplicates;
1511
+ sortInput = !support.sortStable && results.slice( 0 );
1512
+ results.sort( sortOrder );
1513
+
1514
+ if ( hasDuplicate ) {
1515
+ while ( (elem = results[i++]) ) {
1516
+ if ( elem === results[ i ] ) {
1517
+ j = duplicates.push( i );
1518
+ }
1519
+ }
1520
+ while ( j-- ) {
1521
+ results.splice( duplicates[ j ], 1 );
1522
+ }
1523
+ }
1524
+
1525
+ // Clear input after sorting to release objects
1526
+ // See https://github.com/jquery/sizzle/pull/225
1527
+ sortInput = null;
1528
+
1529
+ return results;
1530
+ };
1531
+
1532
+ /**
1533
+ * Utility function for retrieving the text value of an array of DOM nodes
1534
+ * @param {Array|Element} elem
1535
+ */
1536
+ getText = Sizzle.getText = function( elem ) {
1537
+ var node,
1538
+ ret = "",
1539
+ i = 0,
1540
+ nodeType = elem.nodeType;
1541
+
1542
+ if ( !nodeType ) {
1543
+ // If no nodeType, this is expected to be an array
1544
+ while ( (node = elem[i++]) ) {
1545
+ // Do not traverse comment nodes
1546
+ ret += getText( node );
1547
+ }
1548
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1549
+ // Use textContent for elements
1550
+ // innerText usage removed for consistency of new lines (jQuery #11153)
1551
+ if ( typeof elem.textContent === "string" ) {
1552
+ return elem.textContent;
1553
+ } else {
1554
+ // Traverse its children
1555
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1556
+ ret += getText( elem );
1557
+ }
1558
+ }
1559
+ } else if ( nodeType === 3 || nodeType === 4 ) {
1560
+ return elem.nodeValue;
1561
+ }
1562
+ // Do not include comment or processing instruction nodes
1563
+
1564
+ return ret;
1565
+ };
1566
+
1567
+ Expr = Sizzle.selectors = {
1568
+
1569
+ // Can be adjusted by the user
1570
+ cacheLength: 50,
1571
+
1572
+ createPseudo: markFunction,
1573
+
1574
+ match: matchExpr,
1575
+
1576
+ attrHandle: {},
1577
+
1578
+ find: {},
1579
+
1580
+ relative: {
1581
+ ">": { dir: "parentNode", first: true },
1582
+ " ": { dir: "parentNode" },
1583
+ "+": { dir: "previousSibling", first: true },
1584
+ "~": { dir: "previousSibling" }
1585
+ },
1586
+
1587
+ preFilter: {
1588
+ "ATTR": function( match ) {
1589
+ match[1] = match[1].replace( runescape, funescape );
1590
+
1591
+ // Move the given value to match[3] whether quoted or unquoted
1592
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1593
+
1594
+ if ( match[2] === "~=" ) {
1595
+ match[3] = " " + match[3] + " ";
1596
+ }
1597
+
1598
+ return match.slice( 0, 4 );
1599
+ },
1600
+
1601
+ "CHILD": function( match ) {
1602
+ /* matches from matchExpr["CHILD"]
1603
+ 1 type (only|nth|...)
1604
+ 2 what (child|of-type)
1605
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1606
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
1607
+ 5 sign of xn-component
1608
+ 6 x of xn-component
1609
+ 7 sign of y-component
1610
+ 8 y of y-component
1611
+ */
1612
+ match[1] = match[1].toLowerCase();
1613
+
1614
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
1615
+ // nth-* requires argument
1616
+ if ( !match[3] ) {
1617
+ Sizzle.error( match[0] );
1618
+ }
1619
+
1620
+ // numeric x and y parameters for Expr.filter.CHILD
1621
+ // remember that false/true cast respectively to 0/1
1622
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1623
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1624
+
1625
+ // other types prohibit arguments
1626
+ } else if ( match[3] ) {
1627
+ Sizzle.error( match[0] );
1628
+ }
1629
+
1630
+ return match;
1631
+ },
1632
+
1633
+ "PSEUDO": function( match ) {
1634
+ var excess,
1635
+ unquoted = !match[6] && match[2];
1636
+
1637
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
1638
+ return null;
1639
+ }
1640
+
1641
+ // Accept quoted arguments as-is
1642
+ if ( match[3] ) {
1643
+ match[2] = match[4] || match[5] || "";
1644
+
1645
+ // Strip excess characters from unquoted arguments
1646
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
1647
+ // Get excess from tokenize (recursively)
1648
+ (excess = tokenize( unquoted, true )) &&
1649
+ // advance to the next closing parenthesis
1650
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1651
+
1652
+ // excess is a negative index
1653
+ match[0] = match[0].slice( 0, excess );
1654
+ match[2] = unquoted.slice( 0, excess );
1655
+ }
1656
+
1657
+ // Return only captures needed by the pseudo filter method (type and argument)
1658
+ return match.slice( 0, 3 );
1659
+ }
1660
+ },
1661
+
1662
+ filter: {
1663
+
1664
+ "TAG": function( nodeNameSelector ) {
1665
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1666
+ return nodeNameSelector === "*" ?
1667
+ function() { return true; } :
1668
+ function( elem ) {
1669
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1670
+ };
1671
+ },
1672
+
1673
+ "CLASS": function( className ) {
1674
+ var pattern = classCache[ className + " " ];
1675
+
1676
+ return pattern ||
1677
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1678
+ classCache( className, function( elem ) {
1679
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1680
+ });
1681
+ },
1682
+
1683
+ "ATTR": function( name, operator, check ) {
1684
+ return function( elem ) {
1685
+ var result = Sizzle.attr( elem, name );
1686
+
1687
+ if ( result == null ) {
1688
+ return operator === "!=";
1689
+ }
1690
+ if ( !operator ) {
1691
+ return true;
1692
+ }
1693
+
1694
+ result += "";
1695
+
1696
+ return operator === "=" ? result === check :
1697
+ operator === "!=" ? result !== check :
1698
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
1699
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
1700
+ operator === "$=" ? check && result.slice( -check.length ) === check :
1701
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1702
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1703
+ false;
1704
+ };
1705
+ },
1706
+
1707
+ "CHILD": function( type, what, argument, first, last ) {
1708
+ var simple = type.slice( 0, 3 ) !== "nth",
1709
+ forward = type.slice( -4 ) !== "last",
1710
+ ofType = what === "of-type";
1711
+
1712
+ return first === 1 && last === 0 ?
1713
+
1714
+ // Shortcut for :nth-*(n)
1715
+ function( elem ) {
1716
+ return !!elem.parentNode;
1717
+ } :
1718
+
1719
+ function( elem, context, xml ) {
1720
+ var cache, outerCache, node, diff, nodeIndex, start,
1721
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
1722
+ parent = elem.parentNode,
1723
+ name = ofType && elem.nodeName.toLowerCase(),
1724
+ useCache = !xml && !ofType;
1725
+
1726
+ if ( parent ) {
1727
+
1728
+ // :(first|last|only)-(child|of-type)
1729
+ if ( simple ) {
1730
+ while ( dir ) {
1731
+ node = elem;
1732
+ while ( (node = node[ dir ]) ) {
1733
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1734
+ return false;
1735
+ }
1736
+ }
1737
+ // Reverse direction for :only-* (if we haven't yet done so)
1738
+ start = dir = type === "only" && !start && "nextSibling";
1739
+ }
1740
+ return true;
1741
+ }
1742
+
1743
+ start = [ forward ? parent.firstChild : parent.lastChild ];
1744
+
1745
+ // non-xml :nth-child(...) stores cache data on `parent`
1746
+ if ( forward && useCache ) {
1747
+ // Seek `elem` from a previously-cached index
1748
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
1749
+ cache = outerCache[ type ] || [];
1750
+ nodeIndex = cache[0] === dirruns && cache[1];
1751
+ diff = cache[0] === dirruns && cache[2];
1752
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
1753
+
1754
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1755
+
1756
+ // Fallback to seeking `elem` from the start
1757
+ (diff = nodeIndex = 0) || start.pop()) ) {
1758
+
1759
+ // When found, cache indexes on `parent` and break
1760
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
1761
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1762
+ break;
1763
+ }
1764
+ }
1765
+
1766
+ // Use previously-cached element index if available
1767
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1768
+ diff = cache[1];
1769
+
1770
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1771
+ } else {
1772
+ // Use the same loop as above to seek `elem` from the start
1773
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1774
+ (diff = nodeIndex = 0) || start.pop()) ) {
1775
+
1776
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1777
+ // Cache the index of each encountered element
1778
+ if ( useCache ) {
1779
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1780
+ }
1781
+
1782
+ if ( node === elem ) {
1783
+ break;
1784
+ }
1785
+ }
1786
+ }
1787
+ }
1788
+
1789
+ // Incorporate the offset, then check against cycle size
1790
+ diff -= last;
1791
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
1792
+ }
1793
+ };
1794
+ },
1795
+
1796
+ "PSEUDO": function( pseudo, argument ) {
1797
+ // pseudo-class names are case-insensitive
1798
+ // http://www.w3.org/TR/selectors/#pseudo-classes
1799
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1800
+ // Remember that setFilters inherits from pseudos
1801
+ var args,
1802
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1803
+ Sizzle.error( "unsupported pseudo: " + pseudo );
1804
+
1805
+ // The user may use createPseudo to indicate that
1806
+ // arguments are needed to create the filter function
1807
+ // just as Sizzle does
1808
+ if ( fn[ expando ] ) {
1809
+ return fn( argument );
1810
+ }
1811
+
1812
+ // But maintain support for old signatures
1813
+ if ( fn.length > 1 ) {
1814
+ args = [ pseudo, pseudo, "", argument ];
1815
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1816
+ markFunction(function( seed, matches ) {
1817
+ var idx,
1818
+ matched = fn( seed, argument ),
1819
+ i = matched.length;
1820
+ while ( i-- ) {
1821
+ idx = indexOf( seed, matched[i] );
1822
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
1823
+ }
1824
+ }) :
1825
+ function( elem ) {
1826
+ return fn( elem, 0, args );
1827
+ };
1828
+ }
1829
+
1830
+ return fn;
1831
+ }
1832
+ },
1833
+
1834
+ pseudos: {
1835
+ // Potentially complex pseudos
1836
+ "not": markFunction(function( selector ) {
1837
+ // Trim the selector passed to compile
1838
+ // to avoid treating leading and trailing
1839
+ // spaces as combinators
1840
+ var input = [],
1841
+ results = [],
1842
+ matcher = compile( selector.replace( rtrim, "$1" ) );
1843
+
1844
+ return matcher[ expando ] ?
1845
+ markFunction(function( seed, matches, context, xml ) {
1846
+ var elem,
1847
+ unmatched = matcher( seed, null, xml, [] ),
1848
+ i = seed.length;
1849
+
1850
+ // Match elements unmatched by `matcher`
1851
+ while ( i-- ) {
1852
+ if ( (elem = unmatched[i]) ) {
1853
+ seed[i] = !(matches[i] = elem);
1854
+ }
1855
+ }
1856
+ }) :
1857
+ function( elem, context, xml ) {
1858
+ input[0] = elem;
1859
+ matcher( input, null, xml, results );
1860
+ // Don't keep the element (issue #299)
1861
+ input[0] = null;
1862
+ return !results.pop();
1863
+ };
1864
+ }),
1865
+
1866
+ "has": markFunction(function( selector ) {
1867
+ return function( elem ) {
1868
+ return Sizzle( selector, elem ).length > 0;
1869
+ };
1870
+ }),
1871
+
1872
+ "contains": markFunction(function( text ) {
1873
+ text = text.replace( runescape, funescape );
1874
+ return function( elem ) {
1875
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1876
+ };
1877
+ }),
1878
+
1879
+ // "Whether an element is represented by a :lang() selector
1880
+ // is based solely on the element's language value
1881
+ // being equal to the identifier C,
1882
+ // or beginning with the identifier C immediately followed by "-".
1883
+ // The matching of C against the element's language value is performed case-insensitively.
1884
+ // The identifier C does not have to be a valid language name."
1885
+ // http://www.w3.org/TR/selectors/#lang-pseudo
1886
+ "lang": markFunction( function( lang ) {
1887
+ // lang value must be a valid identifier
1888
+ if ( !ridentifier.test(lang || "") ) {
1889
+ Sizzle.error( "unsupported lang: " + lang );
1890
+ }
1891
+ lang = lang.replace( runescape, funescape ).toLowerCase();
1892
+ return function( elem ) {
1893
+ var elemLang;
1894
+ do {
1895
+ if ( (elemLang = documentIsHTML ?
1896
+ elem.lang :
1897
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1898
+
1899
+ elemLang = elemLang.toLowerCase();
1900
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1901
+ }
1902
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1903
+ return false;
1904
+ };
1905
+ }),
1906
+
1907
+ // Miscellaneous
1908
+ "target": function( elem ) {
1909
+ var hash = window.location && window.location.hash;
1910
+ return hash && hash.slice( 1 ) === elem.id;
1911
+ },
1912
+
1913
+ "root": function( elem ) {
1914
+ return elem === docElem;
1915
+ },
1916
+
1917
+ "focus": function( elem ) {
1918
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1919
+ },
1920
+
1921
+ // Boolean properties
1922
+ "enabled": function( elem ) {
1923
+ return elem.disabled === false;
1924
+ },
1925
+
1926
+ "disabled": function( elem ) {
1927
+ return elem.disabled === true;
1928
+ },
1929
+
1930
+ "checked": function( elem ) {
1931
+ // In CSS3, :checked should return both checked and selected elements
1932
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1933
+ var nodeName = elem.nodeName.toLowerCase();
1934
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1935
+ },
1936
+
1937
+ "selected": function( elem ) {
1938
+ // Accessing this property makes selected-by-default
1939
+ // options in Safari work properly
1940
+ if ( elem.parentNode ) {
1941
+ elem.parentNode.selectedIndex;
1942
+ }
1943
+
1944
+ return elem.selected === true;
1945
+ },
1946
+
1947
+ // Contents
1948
+ "empty": function( elem ) {
1949
+ // http://www.w3.org/TR/selectors/#empty-pseudo
1950
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1951
+ // but not by others (comment: 8; processing instruction: 7; etc.)
1952
+ // nodeType < 6 works because attributes (2) do not appear as children
1953
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1954
+ if ( elem.nodeType < 6 ) {
1955
+ return false;
1956
+ }
1957
+ }
1958
+ return true;
1959
+ },
1960
+
1961
+ "parent": function( elem ) {
1962
+ return !Expr.pseudos["empty"]( elem );
1963
+ },
1964
+
1965
+ // Element/input types
1966
+ "header": function( elem ) {
1967
+ return rheader.test( elem.nodeName );
1968
+ },
1969
+
1970
+ "input": function( elem ) {
1971
+ return rinputs.test( elem.nodeName );
1972
+ },
1973
+
1974
+ "button": function( elem ) {
1975
+ var name = elem.nodeName.toLowerCase();
1976
+ return name === "input" && elem.type === "button" || name === "button";
1977
+ },
1978
+
1979
+ "text": function( elem ) {
1980
+ var attr;
1981
+ return elem.nodeName.toLowerCase() === "input" &&
1982
+ elem.type === "text" &&
1983
+
1984
+ // Support: IE<8
1985
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1986
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1987
+ },
1988
+
1989
+ // Position-in-collection
1990
+ "first": createPositionalPseudo(function() {
1991
+ return [ 0 ];
1992
+ }),
1993
+
1994
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
1995
+ return [ length - 1 ];
1996
+ }),
1997
+
1998
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1999
+ return [ argument < 0 ? argument + length : argument ];
2000
+ }),
2001
+
2002
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
2003
+ var i = 0;
2004
+ for ( ; i < length; i += 2 ) {
2005
+ matchIndexes.push( i );
2006
+ }
2007
+ return matchIndexes;
2008
+ }),
2009
+
2010
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
2011
+ var i = 1;
2012
+ for ( ; i < length; i += 2 ) {
2013
+ matchIndexes.push( i );
2014
+ }
2015
+ return matchIndexes;
2016
+ }),
2017
+
2018
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2019
+ var i = argument < 0 ? argument + length : argument;
2020
+ for ( ; --i >= 0; ) {
2021
+ matchIndexes.push( i );
2022
+ }
2023
+ return matchIndexes;
2024
+ }),
2025
+
2026
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2027
+ var i = argument < 0 ? argument + length : argument;
2028
+ for ( ; ++i < length; ) {
2029
+ matchIndexes.push( i );
2030
+ }
2031
+ return matchIndexes;
2032
+ })
2033
+ }
2034
+ };
2035
+
2036
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
2037
+
2038
+ // Add button/input type pseudos
2039
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2040
+ Expr.pseudos[ i ] = createInputPseudo( i );
2041
+ }
2042
+ for ( i in { submit: true, reset: true } ) {
2043
+ Expr.pseudos[ i ] = createButtonPseudo( i );
2044
+ }
2045
+
2046
+ // Easy API for creating new setFilters
2047
+ function setFilters() {}
2048
+ setFilters.prototype = Expr.filters = Expr.pseudos;
2049
+ Expr.setFilters = new setFilters();
2050
+
2051
+ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2052
+ var matched, match, tokens, type,
2053
+ soFar, groups, preFilters,
2054
+ cached = tokenCache[ selector + " " ];
2055
+
2056
+ if ( cached ) {
2057
+ return parseOnly ? 0 : cached.slice( 0 );
2058
+ }
2059
+
2060
+ soFar = selector;
2061
+ groups = [];
2062
+ preFilters = Expr.preFilter;
2063
+
2064
+ while ( soFar ) {
2065
+
2066
+ // Comma and first run
2067
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
2068
+ if ( match ) {
2069
+ // Don't consume trailing commas as valid
2070
+ soFar = soFar.slice( match[0].length ) || soFar;
2071
+ }
2072
+ groups.push( (tokens = []) );
2073
+ }
2074
+
2075
+ matched = false;
2076
+
2077
+ // Combinators
2078
+ if ( (match = rcombinators.exec( soFar )) ) {
2079
+ matched = match.shift();
2080
+ tokens.push({
2081
+ value: matched,
2082
+ // Cast descendant combinators to space
2083
+ type: match[0].replace( rtrim, " " )
2084
+ });
2085
+ soFar = soFar.slice( matched.length );
2086
+ }
2087
+
2088
+ // Filters
2089
+ for ( type in Expr.filter ) {
2090
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2091
+ (match = preFilters[ type ]( match ))) ) {
2092
+ matched = match.shift();
2093
+ tokens.push({
2094
+ value: matched,
2095
+ type: type,
2096
+ matches: match
2097
+ });
2098
+ soFar = soFar.slice( matched.length );
2099
+ }
2100
+ }
2101
+
2102
+ if ( !matched ) {
2103
+ break;
2104
+ }
2105
+ }
2106
+
2107
+ // Return the length of the invalid excess
2108
+ // if we're just parsing
2109
+ // Otherwise, throw an error or return tokens
2110
+ return parseOnly ?
2111
+ soFar.length :
2112
+ soFar ?
2113
+ Sizzle.error( selector ) :
2114
+ // Cache the tokens
2115
+ tokenCache( selector, groups ).slice( 0 );
2116
+ };
2117
+
2118
+ function toSelector( tokens ) {
2119
+ var i = 0,
2120
+ len = tokens.length,
2121
+ selector = "";
2122
+ for ( ; i < len; i++ ) {
2123
+ selector += tokens[i].value;
2124
+ }
2125
+ return selector;
2126
+ }
2127
+
2128
+ function addCombinator( matcher, combinator, base ) {
2129
+ var dir = combinator.dir,
2130
+ checkNonElements = base && dir === "parentNode",
2131
+ doneName = done++;
2132
+
2133
+ return combinator.first ?
2134
+ // Check against closest ancestor/preceding element
2135
+ function( elem, context, xml ) {
2136
+ while ( (elem = elem[ dir ]) ) {
2137
+ if ( elem.nodeType === 1 || checkNonElements ) {
2138
+ return matcher( elem, context, xml );
2139
+ }
2140
+ }
2141
+ } :
2142
+
2143
+ // Check against all ancestor/preceding elements
2144
+ function( elem, context, xml ) {
2145
+ var oldCache, outerCache,
2146
+ newCache = [ dirruns, doneName ];
2147
+
2148
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2149
+ if ( xml ) {
2150
+ while ( (elem = elem[ dir ]) ) {
2151
+ if ( elem.nodeType === 1 || checkNonElements ) {
2152
+ if ( matcher( elem, context, xml ) ) {
2153
+ return true;
2154
+ }
2155
+ }
2156
+ }
2157
+ } else {
2158
+ while ( (elem = elem[ dir ]) ) {
2159
+ if ( elem.nodeType === 1 || checkNonElements ) {
2160
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
2161
+ if ( (oldCache = outerCache[ dir ]) &&
2162
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2163
+
2164
+ // Assign to newCache so results back-propagate to previous elements
2165
+ return (newCache[ 2 ] = oldCache[ 2 ]);
2166
+ } else {
2167
+ // Reuse newcache so results back-propagate to previous elements
2168
+ outerCache[ dir ] = newCache;
2169
+
2170
+ // A match means we're done; a fail means we have to keep checking
2171
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2172
+ return true;
2173
+ }
2174
+ }
2175
+ }
2176
+ }
2177
+ }
2178
+ };
2179
+ }
2180
+
2181
+ function elementMatcher( matchers ) {
2182
+ return matchers.length > 1 ?
2183
+ function( elem, context, xml ) {
2184
+ var i = matchers.length;
2185
+ while ( i-- ) {
2186
+ if ( !matchers[i]( elem, context, xml ) ) {
2187
+ return false;
2188
+ }
2189
+ }
2190
+ return true;
2191
+ } :
2192
+ matchers[0];
2193
+ }
2194
+
2195
+ function multipleContexts( selector, contexts, results ) {
2196
+ var i = 0,
2197
+ len = contexts.length;
2198
+ for ( ; i < len; i++ ) {
2199
+ Sizzle( selector, contexts[i], results );
2200
+ }
2201
+ return results;
2202
+ }
2203
+
2204
+ function condense( unmatched, map, filter, context, xml ) {
2205
+ var elem,
2206
+ newUnmatched = [],
2207
+ i = 0,
2208
+ len = unmatched.length,
2209
+ mapped = map != null;
2210
+
2211
+ for ( ; i < len; i++ ) {
2212
+ if ( (elem = unmatched[i]) ) {
2213
+ if ( !filter || filter( elem, context, xml ) ) {
2214
+ newUnmatched.push( elem );
2215
+ if ( mapped ) {
2216
+ map.push( i );
2217
+ }
2218
+ }
2219
+ }
2220
+ }
2221
+
2222
+ return newUnmatched;
2223
+ }
2224
+
2225
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2226
+ if ( postFilter && !postFilter[ expando ] ) {
2227
+ postFilter = setMatcher( postFilter );
2228
+ }
2229
+ if ( postFinder && !postFinder[ expando ] ) {
2230
+ postFinder = setMatcher( postFinder, postSelector );
2231
+ }
2232
+ return markFunction(function( seed, results, context, xml ) {
2233
+ var temp, i, elem,
2234
+ preMap = [],
2235
+ postMap = [],
2236
+ preexisting = results.length,
2237
+
2238
+ // Get initial elements from seed or context
2239
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2240
+
2241
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
2242
+ matcherIn = preFilter && ( seed || !selector ) ?
2243
+ condense( elems, preMap, preFilter, context, xml ) :
2244
+ elems,
2245
+
2246
+ matcherOut = matcher ?
2247
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2248
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2249
+
2250
+ // ...intermediate processing is necessary
2251
+ [] :
2252
+
2253
+ // ...otherwise use results directly
2254
+ results :
2255
+ matcherIn;
2256
+
2257
+ // Find primary matches
2258
+ if ( matcher ) {
2259
+ matcher( matcherIn, matcherOut, context, xml );
2260
+ }
2261
+
2262
+ // Apply postFilter
2263
+ if ( postFilter ) {
2264
+ temp = condense( matcherOut, postMap );
2265
+ postFilter( temp, [], context, xml );
2266
+
2267
+ // Un-match failing elements by moving them back to matcherIn
2268
+ i = temp.length;
2269
+ while ( i-- ) {
2270
+ if ( (elem = temp[i]) ) {
2271
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2272
+ }
2273
+ }
2274
+ }
2275
+
2276
+ if ( seed ) {
2277
+ if ( postFinder || preFilter ) {
2278
+ if ( postFinder ) {
2279
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
2280
+ temp = [];
2281
+ i = matcherOut.length;
2282
+ while ( i-- ) {
2283
+ if ( (elem = matcherOut[i]) ) {
2284
+ // Restore matcherIn since elem is not yet a final match
2285
+ temp.push( (matcherIn[i] = elem) );
2286
+ }
2287
+ }
2288
+ postFinder( null, (matcherOut = []), temp, xml );
2289
+ }
2290
+
2291
+ // Move matched elements from seed to results to keep them synchronized
2292
+ i = matcherOut.length;
2293
+ while ( i-- ) {
2294
+ if ( (elem = matcherOut[i]) &&
2295
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2296
+
2297
+ seed[temp] = !(results[temp] = elem);
2298
+ }
2299
+ }
2300
+ }
2301
+
2302
+ // Add elements to results, through postFinder if defined
2303
+ } else {
2304
+ matcherOut = condense(
2305
+ matcherOut === results ?
2306
+ matcherOut.splice( preexisting, matcherOut.length ) :
2307
+ matcherOut
2308
+ );
2309
+ if ( postFinder ) {
2310
+ postFinder( null, results, matcherOut, xml );
2311
+ } else {
2312
+ push.apply( results, matcherOut );
2313
+ }
2314
+ }
2315
+ });
2316
+ }
2317
+
2318
+ function matcherFromTokens( tokens ) {
2319
+ var checkContext, matcher, j,
2320
+ len = tokens.length,
2321
+ leadingRelative = Expr.relative[ tokens[0].type ],
2322
+ implicitRelative = leadingRelative || Expr.relative[" "],
2323
+ i = leadingRelative ? 1 : 0,
2324
+
2325
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
2326
+ matchContext = addCombinator( function( elem ) {
2327
+ return elem === checkContext;
2328
+ }, implicitRelative, true ),
2329
+ matchAnyContext = addCombinator( function( elem ) {
2330
+ return indexOf( checkContext, elem ) > -1;
2331
+ }, implicitRelative, true ),
2332
+ matchers = [ function( elem, context, xml ) {
2333
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2334
+ (checkContext = context).nodeType ?
2335
+ matchContext( elem, context, xml ) :
2336
+ matchAnyContext( elem, context, xml ) );
2337
+ // Avoid hanging onto element (issue #299)
2338
+ checkContext = null;
2339
+ return ret;
2340
+ } ];
2341
+
2342
+ for ( ; i < len; i++ ) {
2343
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2344
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2345
+ } else {
2346
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2347
+
2348
+ // Return special upon seeing a positional matcher
2349
+ if ( matcher[ expando ] ) {
2350
+ // Find the next relative operator (if any) for proper handling
2351
+ j = ++i;
2352
+ for ( ; j < len; j++ ) {
2353
+ if ( Expr.relative[ tokens[j].type ] ) {
2354
+ break;
2355
+ }
2356
+ }
2357
+ return setMatcher(
2358
+ i > 1 && elementMatcher( matchers ),
2359
+ i > 1 && toSelector(
2360
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2361
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2362
+ ).replace( rtrim, "$1" ),
2363
+ matcher,
2364
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
2365
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2366
+ j < len && toSelector( tokens )
2367
+ );
2368
+ }
2369
+ matchers.push( matcher );
2370
+ }
2371
+ }
2372
+
2373
+ return elementMatcher( matchers );
2374
+ }
2375
+
2376
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2377
+ var bySet = setMatchers.length > 0,
2378
+ byElement = elementMatchers.length > 0,
2379
+ superMatcher = function( seed, context, xml, results, outermost ) {
2380
+ var elem, j, matcher,
2381
+ matchedCount = 0,
2382
+ i = "0",
2383
+ unmatched = seed && [],
2384
+ setMatched = [],
2385
+ contextBackup = outermostContext,
2386
+ // We must always have either seed elements or outermost context
2387
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2388
+ // Use integer dirruns iff this is the outermost matcher
2389
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2390
+ len = elems.length;
2391
+
2392
+ if ( outermost ) {
2393
+ outermostContext = context !== document && context;
2394
+ }
2395
+
2396
+ // Add elements passing elementMatchers directly to results
2397
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2398
+ // Support: IE<9, Safari
2399
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2400
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2401
+ if ( byElement && elem ) {
2402
+ j = 0;
2403
+ while ( (matcher = elementMatchers[j++]) ) {
2404
+ if ( matcher( elem, context, xml ) ) {
2405
+ results.push( elem );
2406
+ break;
2407
+ }
2408
+ }
2409
+ if ( outermost ) {
2410
+ dirruns = dirrunsUnique;
2411
+ }
2412
+ }
2413
+
2414
+ // Track unmatched elements for set filters
2415
+ if ( bySet ) {
2416
+ // They will have gone through all possible matchers
2417
+ if ( (elem = !matcher && elem) ) {
2418
+ matchedCount--;
2419
+ }
2420
+
2421
+ // Lengthen the array for every element, matched or not
2422
+ if ( seed ) {
2423
+ unmatched.push( elem );
2424
+ }
2425
+ }
2426
+ }
2427
+
2428
+ // Apply set filters to unmatched elements
2429
+ matchedCount += i;
2430
+ if ( bySet && i !== matchedCount ) {
2431
+ j = 0;
2432
+ while ( (matcher = setMatchers[j++]) ) {
2433
+ matcher( unmatched, setMatched, context, xml );
2434
+ }
2435
+
2436
+ if ( seed ) {
2437
+ // Reintegrate element matches to eliminate the need for sorting
2438
+ if ( matchedCount > 0 ) {
2439
+ while ( i-- ) {
2440
+ if ( !(unmatched[i] || setMatched[i]) ) {
2441
+ setMatched[i] = pop.call( results );
2442
+ }
2443
+ }
2444
+ }
2445
+
2446
+ // Discard index placeholder values to get only actual matches
2447
+ setMatched = condense( setMatched );
2448
+ }
2449
+
2450
+ // Add matches to results
2451
+ push.apply( results, setMatched );
2452
+
2453
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
2454
+ if ( outermost && !seed && setMatched.length > 0 &&
2455
+ ( matchedCount + setMatchers.length ) > 1 ) {
2456
+
2457
+ Sizzle.uniqueSort( results );
2458
+ }
2459
+ }
2460
+
2461
+ // Override manipulation of globals by nested matchers
2462
+ if ( outermost ) {
2463
+ dirruns = dirrunsUnique;
2464
+ outermostContext = contextBackup;
2465
+ }
2466
+
2467
+ return unmatched;
2468
+ };
2469
+
2470
+ return bySet ?
2471
+ markFunction( superMatcher ) :
2472
+ superMatcher;
2473
+ }
2474
+
2475
+ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2476
+ var i,
2477
+ setMatchers = [],
2478
+ elementMatchers = [],
2479
+ cached = compilerCache[ selector + " " ];
2480
+
2481
+ if ( !cached ) {
2482
+ // Generate a function of recursive functions that can be used to check each element
2483
+ if ( !match ) {
2484
+ match = tokenize( selector );
2485
+ }
2486
+ i = match.length;
2487
+ while ( i-- ) {
2488
+ cached = matcherFromTokens( match[i] );
2489
+ if ( cached[ expando ] ) {
2490
+ setMatchers.push( cached );
2491
+ } else {
2492
+ elementMatchers.push( cached );
2493
+ }
2494
+ }
2495
+
2496
+ // Cache the compiled function
2497
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2498
+
2499
+ // Save selector and tokenization
2500
+ cached.selector = selector;
2501
+ }
2502
+ return cached;
2503
+ };
2504
+
2505
+ /**
2506
+ * A low-level selection function that works with Sizzle's compiled
2507
+ * selector functions
2508
+ * @param {String|Function} selector A selector or a pre-compiled
2509
+ * selector function built with Sizzle.compile
2510
+ * @param {Element} context
2511
+ * @param {Array} [results]
2512
+ * @param {Array} [seed] A set of elements to match against
2513
+ */
2514
+ select = Sizzle.select = function( selector, context, results, seed ) {
2515
+ var i, tokens, token, type, find,
2516
+ compiled = typeof selector === "function" && selector,
2517
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
2518
+
2519
+ results = results || [];
2520
+
2521
+ // Try to minimize operations if there is no seed and only one group
2522
+ if ( match.length === 1 ) {
2523
+
2524
+ // Take a shortcut and set the context if the root selector is an ID
2525
+ tokens = match[0] = match[0].slice( 0 );
2526
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2527
+ support.getById && context.nodeType === 9 && documentIsHTML &&
2528
+ Expr.relative[ tokens[1].type ] ) {
2529
+
2530
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2531
+ if ( !context ) {
2532
+ return results;
2533
+
2534
+ // Precompiled matchers will still verify ancestry, so step up a level
2535
+ } else if ( compiled ) {
2536
+ context = context.parentNode;
2537
+ }
2538
+
2539
+ selector = selector.slice( tokens.shift().value.length );
2540
+ }
2541
+
2542
+ // Fetch a seed set for right-to-left matching
2543
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2544
+ while ( i-- ) {
2545
+ token = tokens[i];
2546
+
2547
+ // Abort if we hit a combinator
2548
+ if ( Expr.relative[ (type = token.type) ] ) {
2549
+ break;
2550
+ }
2551
+ if ( (find = Expr.find[ type ]) ) {
2552
+ // Search, expanding context for leading sibling combinators
2553
+ if ( (seed = find(
2554
+ token.matches[0].replace( runescape, funescape ),
2555
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2556
+ )) ) {
2557
+
2558
+ // If seed is empty or no tokens remain, we can return early
2559
+ tokens.splice( i, 1 );
2560
+ selector = seed.length && toSelector( tokens );
2561
+ if ( !selector ) {
2562
+ push.apply( results, seed );
2563
+ return results;
2564
+ }
2565
+
2566
+ break;
2567
+ }
2568
+ }
2569
+ }
2570
+ }
2571
+
2572
+ // Compile and execute a filtering function if one is not provided
2573
+ // Provide `match` to avoid retokenization if we modified the selector above
2574
+ ( compiled || compile( selector, match ) )(
2575
+ seed,
2576
+ context,
2577
+ !documentIsHTML,
2578
+ results,
2579
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
2580
+ );
2581
+ return results;
2582
+ };
2583
+
2584
+ // One-time assignments
2585
+
2586
+ // Sort stability
2587
+ support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2588
+
2589
+ // Support: Chrome 14-35+
2590
+ // Always assume duplicates if they aren't passed to the comparison function
2591
+ support.detectDuplicates = !!hasDuplicate;
2592
+
2593
+ // Initialize against the default document
2594
+ setDocument();
2595
+
2596
+ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2597
+ // Detached nodes confoundingly follow *each other*
2598
+ support.sortDetached = assert(function( div1 ) {
2599
+ // Should return 1, but returns 4 (following)
2600
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2601
+ });
2602
+
2603
+ // Support: IE<8
2604
+ // Prevent attribute/property "interpolation"
2605
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2606
+ if ( !assert(function( div ) {
2607
+ div.innerHTML = "<a href='#'></a>";
2608
+ return div.firstChild.getAttribute("href") === "#" ;
2609
+ }) ) {
2610
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
2611
+ if ( !isXML ) {
2612
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2613
+ }
2614
+ });
2615
+ }
2616
+
2617
+ // Support: IE<9
2618
+ // Use defaultValue in place of getAttribute("value")
2619
+ if ( !support.attributes || !assert(function( div ) {
2620
+ div.innerHTML = "<input/>";
2621
+ div.firstChild.setAttribute( "value", "" );
2622
+ return div.firstChild.getAttribute( "value" ) === "";
2623
+ }) ) {
2624
+ addHandle( "value", function( elem, name, isXML ) {
2625
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2626
+ return elem.defaultValue;
2627
+ }
2628
+ });
2629
+ }
2630
+
2631
+ // Support: IE<9
2632
+ // Use getAttributeNode to fetch booleans when getAttribute lies
2633
+ if ( !assert(function( div ) {
2634
+ return div.getAttribute("disabled") == null;
2635
+ }) ) {
2636
+ addHandle( booleans, function( elem, name, isXML ) {
2637
+ var val;
2638
+ if ( !isXML ) {
2639
+ return elem[ name ] === true ? name.toLowerCase() :
2640
+ (val = elem.getAttributeNode( name )) && val.specified ?
2641
+ val.value :
2642
+ null;
2643
+ }
2644
+ });
2645
+ }
2646
+
2647
+ return Sizzle;
2648
+
2649
+ })( window );
2650
+
2651
+
2652
+
2653
+ jQuery.find = Sizzle;
2654
+ jQuery.expr = Sizzle.selectors;
2655
+ jQuery.expr[":"] = jQuery.expr.pseudos;
2656
+ jQuery.unique = Sizzle.uniqueSort;
2657
+ jQuery.text = Sizzle.getText;
2658
+ jQuery.isXMLDoc = Sizzle.isXML;
2659
+ jQuery.contains = Sizzle.contains;
2660
+
2661
+
2662
+
2663
+ var rneedsContext = jQuery.expr.match.needsContext;
2664
+
2665
+ var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2666
+
2667
+
2668
+
2669
+ var risSimple = /^.[^:#\[\.,]*$/;
2670
+
2671
+ // Implement the identical functionality for filter and not
2672
+ function winnow( elements, qualifier, not ) {
2673
+ if ( jQuery.isFunction( qualifier ) ) {
2674
+ return jQuery.grep( elements, function( elem, i ) {
2675
+ /* jshint -W018 */
2676
+ return !!qualifier.call( elem, i, elem ) !== not;
2677
+ });
2678
+
2679
+ }
2680
+
2681
+ if ( qualifier.nodeType ) {
2682
+ return jQuery.grep( elements, function( elem ) {
2683
+ return ( elem === qualifier ) !== not;
2684
+ });
2685
+
2686
+ }
2687
+
2688
+ if ( typeof qualifier === "string" ) {
2689
+ if ( risSimple.test( qualifier ) ) {
2690
+ return jQuery.filter( qualifier, elements, not );
2691
+ }
2692
+
2693
+ qualifier = jQuery.filter( qualifier, elements );
2694
+ }
2695
+
2696
+ return jQuery.grep( elements, function( elem ) {
2697
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
2698
+ });
2699
+ }
2700
+
2701
+ jQuery.filter = function( expr, elems, not ) {
2702
+ var elem = elems[ 0 ];
2703
+
2704
+ if ( not ) {
2705
+ expr = ":not(" + expr + ")";
2706
+ }
2707
+
2708
+ return elems.length === 1 && elem.nodeType === 1 ?
2709
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2710
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2711
+ return elem.nodeType === 1;
2712
+ }));
2713
+ };
2714
+
2715
+ jQuery.fn.extend({
2716
+ find: function( selector ) {
2717
+ var i,
2718
+ ret = [],
2719
+ self = this,
2720
+ len = self.length;
2721
+
2722
+ if ( typeof selector !== "string" ) {
2723
+ return this.pushStack( jQuery( selector ).filter(function() {
2724
+ for ( i = 0; i < len; i++ ) {
2725
+ if ( jQuery.contains( self[ i ], this ) ) {
2726
+ return true;
2727
+ }
2728
+ }
2729
+ }) );
2730
+ }
2731
+
2732
+ for ( i = 0; i < len; i++ ) {
2733
+ jQuery.find( selector, self[ i ], ret );
2734
+ }
2735
+
2736
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
2737
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2738
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
2739
+ return ret;
2740
+ },
2741
+ filter: function( selector ) {
2742
+ return this.pushStack( winnow(this, selector || [], false) );
2743
+ },
2744
+ not: function( selector ) {
2745
+ return this.pushStack( winnow(this, selector || [], true) );
2746
+ },
2747
+ is: function( selector ) {
2748
+ return !!winnow(
2749
+ this,
2750
+
2751
+ // If this is a positional/relative selector, check membership in the returned set
2752
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
2753
+ typeof selector === "string" && rneedsContext.test( selector ) ?
2754
+ jQuery( selector ) :
2755
+ selector || [],
2756
+ false
2757
+ ).length;
2758
+ }
2759
+ });
2760
+
2761
+
2762
+ // Initialize a jQuery object
2763
+
2764
+
2765
+ // A central reference to the root jQuery(document)
2766
+ var rootjQuery,
2767
+
2768
+ // Use the correct document accordingly with window argument (sandbox)
2769
+ document = window.document,
2770
+
2771
+ // A simple way to check for HTML strings
2772
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2773
+ // Strict HTML recognition (#11290: must start with <)
2774
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2775
+
2776
+ init = jQuery.fn.init = function( selector, context ) {
2777
+ var match, elem;
2778
+
2779
+ // HANDLE: $(""), $(null), $(undefined), $(false)
2780
+ if ( !selector ) {
2781
+ return this;
2782
+ }
2783
+
2784
+ // Handle HTML strings
2785
+ if ( typeof selector === "string" ) {
2786
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
2787
+ // Assume that strings that start and end with <> are HTML and skip the regex check
2788
+ match = [ null, selector, null ];
2789
+
2790
+ } else {
2791
+ match = rquickExpr.exec( selector );
2792
+ }
2793
+
2794
+ // Match html or make sure no context is specified for #id
2795
+ if ( match && (match[1] || !context) ) {
2796
+
2797
+ // HANDLE: $(html) -> $(array)
2798
+ if ( match[1] ) {
2799
+ context = context instanceof jQuery ? context[0] : context;
2800
+
2801
+ // scripts is true for back-compat
2802
+ // Intentionally let the error be thrown if parseHTML is not present
2803
+ jQuery.merge( this, jQuery.parseHTML(
2804
+ match[1],
2805
+ context && context.nodeType ? context.ownerDocument || context : document,
2806
+ true
2807
+ ) );
2808
+
2809
+ // HANDLE: $(html, props)
2810
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2811
+ for ( match in context ) {
2812
+ // Properties of context are called as methods if possible
2813
+ if ( jQuery.isFunction( this[ match ] ) ) {
2814
+ this[ match ]( context[ match ] );
2815
+
2816
+ // ...and otherwise set as attributes
2817
+ } else {
2818
+ this.attr( match, context[ match ] );
2819
+ }
2820
+ }
2821
+ }
2822
+
2823
+ return this;
2824
+
2825
+ // HANDLE: $(#id)
2826
+ } else {
2827
+ elem = document.getElementById( match[2] );
2828
+
2829
+ // Check parentNode to catch when Blackberry 4.6 returns
2830
+ // nodes that are no longer in the document #6963
2831
+ if ( elem && elem.parentNode ) {
2832
+ // Handle the case where IE and Opera return items
2833
+ // by name instead of ID
2834
+ if ( elem.id !== match[2] ) {
2835
+ return rootjQuery.find( selector );
2836
+ }
2837
+
2838
+ // Otherwise, we inject the element directly into the jQuery object
2839
+ this.length = 1;
2840
+ this[0] = elem;
2841
+ }
2842
+
2843
+ this.context = document;
2844
+ this.selector = selector;
2845
+ return this;
2846
+ }
2847
+
2848
+ // HANDLE: $(expr, $(...))
2849
+ } else if ( !context || context.jquery ) {
2850
+ return ( context || rootjQuery ).find( selector );
2851
+
2852
+ // HANDLE: $(expr, context)
2853
+ // (which is just equivalent to: $(context).find(expr)
2854
+ } else {
2855
+ return this.constructor( context ).find( selector );
2856
+ }
2857
+
2858
+ // HANDLE: $(DOMElement)
2859
+ } else if ( selector.nodeType ) {
2860
+ this.context = this[0] = selector;
2861
+ this.length = 1;
2862
+ return this;
2863
+
2864
+ // HANDLE: $(function)
2865
+ // Shortcut for document ready
2866
+ } else if ( jQuery.isFunction( selector ) ) {
2867
+ return typeof rootjQuery.ready !== "undefined" ?
2868
+ rootjQuery.ready( selector ) :
2869
+ // Execute immediately if ready is not present
2870
+ selector( jQuery );
2871
+ }
2872
+
2873
+ if ( selector.selector !== undefined ) {
2874
+ this.selector = selector.selector;
2875
+ this.context = selector.context;
2876
+ }
2877
+
2878
+ return jQuery.makeArray( selector, this );
2879
+ };
2880
+
2881
+ // Give the init function the jQuery prototype for later instantiation
2882
+ init.prototype = jQuery.fn;
2883
+
2884
+ // Initialize central reference
2885
+ rootjQuery = jQuery( document );
2886
+
2887
+
2888
+ var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2889
+ // methods guaranteed to produce a unique set when starting from a unique set
2890
+ guaranteedUnique = {
2891
+ children: true,
2892
+ contents: true,
2893
+ next: true,
2894
+ prev: true
2895
+ };
2896
+
2897
+ jQuery.extend({
2898
+ dir: function( elem, dir, until ) {
2899
+ var matched = [],
2900
+ cur = elem[ dir ];
2901
+
2902
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
2903
+ if ( cur.nodeType === 1 ) {
2904
+ matched.push( cur );
2905
+ }
2906
+ cur = cur[dir];
2907
+ }
2908
+ return matched;
2909
+ },
2910
+
2911
+ sibling: function( n, elem ) {
2912
+ var r = [];
2913
+
2914
+ for ( ; n; n = n.nextSibling ) {
2915
+ if ( n.nodeType === 1 && n !== elem ) {
2916
+ r.push( n );
2917
+ }
2918
+ }
2919
+
2920
+ return r;
2921
+ }
2922
+ });
2923
+
2924
+ jQuery.fn.extend({
2925
+ has: function( target ) {
2926
+ var i,
2927
+ targets = jQuery( target, this ),
2928
+ len = targets.length;
2929
+
2930
+ return this.filter(function() {
2931
+ for ( i = 0; i < len; i++ ) {
2932
+ if ( jQuery.contains( this, targets[i] ) ) {
2933
+ return true;
2934
+ }
2935
+ }
2936
+ });
2937
+ },
2938
+
2939
+ closest: function( selectors, context ) {
2940
+ var cur,
2941
+ i = 0,
2942
+ l = this.length,
2943
+ matched = [],
2944
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2945
+ jQuery( selectors, context || this.context ) :
2946
+ 0;
2947
+
2948
+ for ( ; i < l; i++ ) {
2949
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2950
+ // Always skip document fragments
2951
+ if ( cur.nodeType < 11 && (pos ?
2952
+ pos.index(cur) > -1 :
2953
+
2954
+ // Don't pass non-elements to Sizzle
2955
+ cur.nodeType === 1 &&
2956
+ jQuery.find.matchesSelector(cur, selectors)) ) {
2957
+
2958
+ matched.push( cur );
2959
+ break;
2960
+ }
2961
+ }
2962
+ }
2963
+
2964
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2965
+ },
2966
+
2967
+ // Determine the position of an element within
2968
+ // the matched set of elements
2969
+ index: function( elem ) {
2970
+
2971
+ // No argument, return index in parent
2972
+ if ( !elem ) {
2973
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
2974
+ }
2975
+
2976
+ // index in selector
2977
+ if ( typeof elem === "string" ) {
2978
+ return jQuery.inArray( this[0], jQuery( elem ) );
2979
+ }
2980
+
2981
+ // Locate the position of the desired element
2982
+ return jQuery.inArray(
2983
+ // If it receives a jQuery object, the first element is used
2984
+ elem.jquery ? elem[0] : elem, this );
2985
+ },
2986
+
2987
+ add: function( selector, context ) {
2988
+ return this.pushStack(
2989
+ jQuery.unique(
2990
+ jQuery.merge( this.get(), jQuery( selector, context ) )
2991
+ )
2992
+ );
2993
+ },
2994
+
2995
+ addBack: function( selector ) {
2996
+ return this.add( selector == null ?
2997
+ this.prevObject : this.prevObject.filter(selector)
2998
+ );
2999
+ }
3000
+ });
3001
+
3002
+ function sibling( cur, dir ) {
3003
+ do {
3004
+ cur = cur[ dir ];
3005
+ } while ( cur && cur.nodeType !== 1 );
3006
+
3007
+ return cur;
3008
+ }
3009
+
3010
+ jQuery.each({
3011
+ parent: function( elem ) {
3012
+ var parent = elem.parentNode;
3013
+ return parent && parent.nodeType !== 11 ? parent : null;
3014
+ },
3015
+ parents: function( elem ) {
3016
+ return jQuery.dir( elem, "parentNode" );
3017
+ },
3018
+ parentsUntil: function( elem, i, until ) {
3019
+ return jQuery.dir( elem, "parentNode", until );
3020
+ },
3021
+ next: function( elem ) {
3022
+ return sibling( elem, "nextSibling" );
3023
+ },
3024
+ prev: function( elem ) {
3025
+ return sibling( elem, "previousSibling" );
3026
+ },
3027
+ nextAll: function( elem ) {
3028
+ return jQuery.dir( elem, "nextSibling" );
3029
+ },
3030
+ prevAll: function( elem ) {
3031
+ return jQuery.dir( elem, "previousSibling" );
3032
+ },
3033
+ nextUntil: function( elem, i, until ) {
3034
+ return jQuery.dir( elem, "nextSibling", until );
3035
+ },
3036
+ prevUntil: function( elem, i, until ) {
3037
+ return jQuery.dir( elem, "previousSibling", until );
3038
+ },
3039
+ siblings: function( elem ) {
3040
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
3041
+ },
3042
+ children: function( elem ) {
3043
+ return jQuery.sibling( elem.firstChild );
3044
+ },
3045
+ contents: function( elem ) {
3046
+ return jQuery.nodeName( elem, "iframe" ) ?
3047
+ elem.contentDocument || elem.contentWindow.document :
3048
+ jQuery.merge( [], elem.childNodes );
3049
+ }
3050
+ }, function( name, fn ) {
3051
+ jQuery.fn[ name ] = function( until, selector ) {
3052
+ var ret = jQuery.map( this, fn, until );
3053
+
3054
+ if ( name.slice( -5 ) !== "Until" ) {
3055
+ selector = until;
3056
+ }
3057
+
3058
+ if ( selector && typeof selector === "string" ) {
3059
+ ret = jQuery.filter( selector, ret );
3060
+ }
3061
+
3062
+ if ( this.length > 1 ) {
3063
+ // Remove duplicates
3064
+ if ( !guaranteedUnique[ name ] ) {
3065
+ ret = jQuery.unique( ret );
3066
+ }
3067
+
3068
+ // Reverse order for parents* and prev-derivatives
3069
+ if ( rparentsprev.test( name ) ) {
3070
+ ret = ret.reverse();
3071
+ }
3072
+ }
3073
+
3074
+ return this.pushStack( ret );
3075
+ };
3076
+ });
3077
+ var rnotwhite = (/\S+/g);
3078
+
3079
+
3080
+
3081
+ // String to Object options format cache
3082
+ var optionsCache = {};
3083
+
3084
+ // Convert String-formatted options into Object-formatted ones and store in cache
3085
+ function createOptions( options ) {
3086
+ var object = optionsCache[ options ] = {};
3087
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3088
+ object[ flag ] = true;
3089
+ });
3090
+ return object;
3091
+ }
3092
+
3093
+ /*
3094
+ * Create a callback list using the following parameters:
3095
+ *
3096
+ * options: an optional list of space-separated options that will change how
3097
+ * the callback list behaves or a more traditional option object
3098
+ *
3099
+ * By default a callback list will act like an event callback list and can be
3100
+ * "fired" multiple times.
3101
+ *
3102
+ * Possible options:
3103
+ *
3104
+ * once: will ensure the callback list can only be fired once (like a Deferred)
3105
+ *
3106
+ * memory: will keep track of previous values and will call any callback added
3107
+ * after the list has been fired right away with the latest "memorized"
3108
+ * values (like a Deferred)
3109
+ *
3110
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
3111
+ *
3112
+ * stopOnFalse: interrupt callings when a callback returns false
3113
+ *
3114
+ */
3115
+ jQuery.Callbacks = function( options ) {
3116
+
3117
+ // Convert options from String-formatted to Object-formatted if needed
3118
+ // (we check in cache first)
3119
+ options = typeof options === "string" ?
3120
+ ( optionsCache[ options ] || createOptions( options ) ) :
3121
+ jQuery.extend( {}, options );
3122
+
3123
+ var // Flag to know if list is currently firing
3124
+ firing,
3125
+ // Last fire value (for non-forgettable lists)
3126
+ memory,
3127
+ // Flag to know if list was already fired
3128
+ fired,
3129
+ // End of the loop when firing
3130
+ firingLength,
3131
+ // Index of currently firing callback (modified by remove if needed)
3132
+ firingIndex,
3133
+ // First callback to fire (used internally by add and fireWith)
3134
+ firingStart,
3135
+ // Actual callback list
3136
+ list = [],
3137
+ // Stack of fire calls for repeatable lists
3138
+ stack = !options.once && [],
3139
+ // Fire callbacks
3140
+ fire = function( data ) {
3141
+ memory = options.memory && data;
3142
+ fired = true;
3143
+ firingIndex = firingStart || 0;
3144
+ firingStart = 0;
3145
+ firingLength = list.length;
3146
+ firing = true;
3147
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3148
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3149
+ memory = false; // To prevent further calls using add
3150
+ break;
3151
+ }
3152
+ }
3153
+ firing = false;
3154
+ if ( list ) {
3155
+ if ( stack ) {
3156
+ if ( stack.length ) {
3157
+ fire( stack.shift() );
3158
+ }
3159
+ } else if ( memory ) {
3160
+ list = [];
3161
+ } else {
3162
+ self.disable();
3163
+ }
3164
+ }
3165
+ },
3166
+ // Actual Callbacks object
3167
+ self = {
3168
+ // Add a callback or a collection of callbacks to the list
3169
+ add: function() {
3170
+ if ( list ) {
3171
+ // First, we save the current length
3172
+ var start = list.length;
3173
+ (function add( args ) {
3174
+ jQuery.each( args, function( _, arg ) {
3175
+ var type = jQuery.type( arg );
3176
+ if ( type === "function" ) {
3177
+ if ( !options.unique || !self.has( arg ) ) {
3178
+ list.push( arg );
3179
+ }
3180
+ } else if ( arg && arg.length && type !== "string" ) {
3181
+ // Inspect recursively
3182
+ add( arg );
3183
+ }
3184
+ });
3185
+ })( arguments );
3186
+ // Do we need to add the callbacks to the
3187
+ // current firing batch?
3188
+ if ( firing ) {
3189
+ firingLength = list.length;
3190
+ // With memory, if we're not firing then
3191
+ // we should call right away
3192
+ } else if ( memory ) {
3193
+ firingStart = start;
3194
+ fire( memory );
3195
+ }
3196
+ }
3197
+ return this;
3198
+ },
3199
+ // Remove a callback from the list
3200
+ remove: function() {
3201
+ if ( list ) {
3202
+ jQuery.each( arguments, function( _, arg ) {
3203
+ var index;
3204
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3205
+ list.splice( index, 1 );
3206
+ // Handle firing indexes
3207
+ if ( firing ) {
3208
+ if ( index <= firingLength ) {
3209
+ firingLength--;
3210
+ }
3211
+ if ( index <= firingIndex ) {
3212
+ firingIndex--;
3213
+ }
3214
+ }
3215
+ }
3216
+ });
3217
+ }
3218
+ return this;
3219
+ },
3220
+ // Check if a given callback is in the list.
3221
+ // If no argument is given, return whether or not list has callbacks attached.
3222
+ has: function( fn ) {
3223
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3224
+ },
3225
+ // Remove all callbacks from the list
3226
+ empty: function() {
3227
+ list = [];
3228
+ firingLength = 0;
3229
+ return this;
3230
+ },
3231
+ // Have the list do nothing anymore
3232
+ disable: function() {
3233
+ list = stack = memory = undefined;
3234
+ return this;
3235
+ },
3236
+ // Is it disabled?
3237
+ disabled: function() {
3238
+ return !list;
3239
+ },
3240
+ // Lock the list in its current state
3241
+ lock: function() {
3242
+ stack = undefined;
3243
+ if ( !memory ) {
3244
+ self.disable();
3245
+ }
3246
+ return this;
3247
+ },
3248
+ // Is it locked?
3249
+ locked: function() {
3250
+ return !stack;
3251
+ },
3252
+ // Call all callbacks with the given context and arguments
3253
+ fireWith: function( context, args ) {
3254
+ if ( list && ( !fired || stack ) ) {
3255
+ args = args || [];
3256
+ args = [ context, args.slice ? args.slice() : args ];
3257
+ if ( firing ) {
3258
+ stack.push( args );
3259
+ } else {
3260
+ fire( args );
3261
+ }
3262
+ }
3263
+ return this;
3264
+ },
3265
+ // Call all the callbacks with the given arguments
3266
+ fire: function() {
3267
+ self.fireWith( this, arguments );
3268
+ return this;
3269
+ },
3270
+ // To know if the callbacks have already been called at least once
3271
+ fired: function() {
3272
+ return !!fired;
3273
+ }
3274
+ };
3275
+
3276
+ return self;
3277
+ };
3278
+
3279
+
3280
+ jQuery.extend({
3281
+
3282
+ Deferred: function( func ) {
3283
+ var tuples = [
3284
+ // action, add listener, listener list, final state
3285
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3286
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3287
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
3288
+ ],
3289
+ state = "pending",
3290
+ promise = {
3291
+ state: function() {
3292
+ return state;
3293
+ },
3294
+ always: function() {
3295
+ deferred.done( arguments ).fail( arguments );
3296
+ return this;
3297
+ },
3298
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
3299
+ var fns = arguments;
3300
+ return jQuery.Deferred(function( newDefer ) {
3301
+ jQuery.each( tuples, function( i, tuple ) {
3302
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3303
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
3304
+ deferred[ tuple[1] ](function() {
3305
+ var returned = fn && fn.apply( this, arguments );
3306
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
3307
+ returned.promise()
3308
+ .done( newDefer.resolve )
3309
+ .fail( newDefer.reject )
3310
+ .progress( newDefer.notify );
3311
+ } else {
3312
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3313
+ }
3314
+ });
3315
+ });
3316
+ fns = null;
3317
+ }).promise();
3318
+ },
3319
+ // Get a promise for this deferred
3320
+ // If obj is provided, the promise aspect is added to the object
3321
+ promise: function( obj ) {
3322
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
3323
+ }
3324
+ },
3325
+ deferred = {};
3326
+
3327
+ // Keep pipe for back-compat
3328
+ promise.pipe = promise.then;
3329
+
3330
+ // Add list-specific methods
3331
+ jQuery.each( tuples, function( i, tuple ) {
3332
+ var list = tuple[ 2 ],
3333
+ stateString = tuple[ 3 ];
3334
+
3335
+ // promise[ done | fail | progress ] = list.add
3336
+ promise[ tuple[1] ] = list.add;
3337
+
3338
+ // Handle state
3339
+ if ( stateString ) {
3340
+ list.add(function() {
3341
+ // state = [ resolved | rejected ]
3342
+ state = stateString;
3343
+
3344
+ // [ reject_list | resolve_list ].disable; progress_list.lock
3345
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3346
+ }
3347
+
3348
+ // deferred[ resolve | reject | notify ]
3349
+ deferred[ tuple[0] ] = function() {
3350
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3351
+ return this;
3352
+ };
3353
+ deferred[ tuple[0] + "With" ] = list.fireWith;
3354
+ });
3355
+
3356
+ // Make the deferred a promise
3357
+ promise.promise( deferred );
3358
+
3359
+ // Call given func if any
3360
+ if ( func ) {
3361
+ func.call( deferred, deferred );
3362
+ }
3363
+
3364
+ // All done!
3365
+ return deferred;
3366
+ },
3367
+
3368
+ // Deferred helper
3369
+ when: function( subordinate /* , ..., subordinateN */ ) {
3370
+ var i = 0,
3371
+ resolveValues = slice.call( arguments ),
3372
+ length = resolveValues.length,
3373
+
3374
+ // the count of uncompleted subordinates
3375
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3376
+
3377
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3378
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3379
+
3380
+ // Update function for both resolve and progress values
3381
+ updateFunc = function( i, contexts, values ) {
3382
+ return function( value ) {
3383
+ contexts[ i ] = this;
3384
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3385
+ if ( values === progressValues ) {
3386
+ deferred.notifyWith( contexts, values );
3387
+
3388
+ } else if ( !(--remaining) ) {
3389
+ deferred.resolveWith( contexts, values );
3390
+ }
3391
+ };
3392
+ },
3393
+
3394
+ progressValues, progressContexts, resolveContexts;
3395
+
3396
+ // add listeners to Deferred subordinates; treat others as resolved
3397
+ if ( length > 1 ) {
3398
+ progressValues = new Array( length );
3399
+ progressContexts = new Array( length );
3400
+ resolveContexts = new Array( length );
3401
+ for ( ; i < length; i++ ) {
3402
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3403
+ resolveValues[ i ].promise()
3404
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
3405
+ .fail( deferred.reject )
3406
+ .progress( updateFunc( i, progressContexts, progressValues ) );
3407
+ } else {
3408
+ --remaining;
3409
+ }
3410
+ }
3411
+ }
3412
+
3413
+ // if we're not waiting on anything, resolve the master
3414
+ if ( !remaining ) {
3415
+ deferred.resolveWith( resolveContexts, resolveValues );
3416
+ }
3417
+
3418
+ return deferred.promise();
3419
+ }
3420
+ });
3421
+
3422
+
3423
+ // The deferred used on DOM ready
3424
+ var readyList;
3425
+
3426
+ jQuery.fn.ready = function( fn ) {
3427
+ // Add the callback
3428
+ jQuery.ready.promise().done( fn );
3429
+
3430
+ return this;
3431
+ };
3432
+
3433
+ jQuery.extend({
3434
+ // Is the DOM ready to be used? Set to true once it occurs.
3435
+ isReady: false,
3436
+
3437
+ // A counter to track how many items to wait for before
3438
+ // the ready event fires. See #6781
3439
+ readyWait: 1,
3440
+
3441
+ // Hold (or release) the ready event
3442
+ holdReady: function( hold ) {
3443
+ if ( hold ) {
3444
+ jQuery.readyWait++;
3445
+ } else {
3446
+ jQuery.ready( true );
3447
+ }
3448
+ },
3449
+
3450
+ // Handle when the DOM is ready
3451
+ ready: function( wait ) {
3452
+
3453
+ // Abort if there are pending holds or we're already ready
3454
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3455
+ return;
3456
+ }
3457
+
3458
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
3459
+ if ( !document.body ) {
3460
+ return setTimeout( jQuery.ready );
3461
+ }
3462
+
3463
+ // Remember that the DOM is ready
3464
+ jQuery.isReady = true;
3465
+
3466
+ // If a normal DOM Ready event fired, decrement, and wait if need be
3467
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
3468
+ return;
3469
+ }
3470
+
3471
+ // If there are functions bound, to execute
3472
+ readyList.resolveWith( document, [ jQuery ] );
3473
+
3474
+ // Trigger any bound ready events
3475
+ if ( jQuery.fn.triggerHandler ) {
3476
+ jQuery( document ).triggerHandler( "ready" );
3477
+ jQuery( document ).off( "ready" );
3478
+ }
3479
+ }
3480
+ });
3481
+
3482
+ /**
3483
+ * Clean-up method for dom ready events
3484
+ */
3485
+ function detach() {
3486
+ if ( document.addEventListener ) {
3487
+ document.removeEventListener( "DOMContentLoaded", completed, false );
3488
+ window.removeEventListener( "load", completed, false );
3489
+
3490
+ } else {
3491
+ document.detachEvent( "onreadystatechange", completed );
3492
+ window.detachEvent( "onload", completed );
3493
+ }
3494
+ }
3495
+
3496
+ /**
3497
+ * The ready event handler and self cleanup method
3498
+ */
3499
+ function completed() {
3500
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
3501
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
3502
+ detach();
3503
+ jQuery.ready();
3504
+ }
3505
+ }
3506
+
3507
+ jQuery.ready.promise = function( obj ) {
3508
+ if ( !readyList ) {
3509
+
3510
+ readyList = jQuery.Deferred();
3511
+
3512
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
3513
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
3514
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3515
+ if ( document.readyState === "complete" ) {
3516
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
3517
+ setTimeout( jQuery.ready );
3518
+
3519
+ // Standards-based browsers support DOMContentLoaded
3520
+ } else if ( document.addEventListener ) {
3521
+ // Use the handy event callback
3522
+ document.addEventListener( "DOMContentLoaded", completed, false );
3523
+
3524
+ // A fallback to window.onload, that will always work
3525
+ window.addEventListener( "load", completed, false );
3526
+
3527
+ // If IE event model is used
3528
+ } else {
3529
+ // Ensure firing before onload, maybe late but safe also for iframes
3530
+ document.attachEvent( "onreadystatechange", completed );
3531
+
3532
+ // A fallback to window.onload, that will always work
3533
+ window.attachEvent( "onload", completed );
3534
+
3535
+ // If IE and not a frame
3536
+ // continually check to see if the document is ready
3537
+ var top = false;
3538
+
3539
+ try {
3540
+ top = window.frameElement == null && document.documentElement;
3541
+ } catch(e) {}
3542
+
3543
+ if ( top && top.doScroll ) {
3544
+ (function doScrollCheck() {
3545
+ if ( !jQuery.isReady ) {
3546
+
3547
+ try {
3548
+ // Use the trick by Diego Perini
3549
+ // http://javascript.nwbox.com/IEContentLoaded/
3550
+ top.doScroll("left");
3551
+ } catch(e) {
3552
+ return setTimeout( doScrollCheck, 50 );
3553
+ }
3554
+
3555
+ // detach all dom ready events
3556
+ detach();
3557
+
3558
+ // and execute any waiting functions
3559
+ jQuery.ready();
3560
+ }
3561
+ })();
3562
+ }
3563
+ }
3564
+ }
3565
+ return readyList.promise( obj );
3566
+ };
3567
+
3568
+
3569
+ var strundefined = typeof undefined;
3570
+
3571
+
3572
+
3573
+ // Support: IE<9
3574
+ // Iteration over object's inherited properties before its own
3575
+ var i;
3576
+ for ( i in jQuery( support ) ) {
3577
+ break;
3578
+ }
3579
+ support.ownLast = i !== "0";
3580
+
3581
+ // Note: most support tests are defined in their respective modules.
3582
+ // false until the test is run
3583
+ support.inlineBlockNeedsLayout = false;
3584
+
3585
+ // Execute ASAP in case we need to set body.style.zoom
3586
+ jQuery(function() {
3587
+ // Minified: var a,b,c,d
3588
+ var val, div, body, container;
3589
+
3590
+ body = document.getElementsByTagName( "body" )[ 0 ];
3591
+ if ( !body || !body.style ) {
3592
+ // Return for frameset docs that don't have a body
3593
+ return;
3594
+ }
3595
+
3596
+ // Setup
3597
+ div = document.createElement( "div" );
3598
+ container = document.createElement( "div" );
3599
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
3600
+ body.appendChild( container ).appendChild( div );
3601
+
3602
+ if ( typeof div.style.zoom !== strundefined ) {
3603
+ // Support: IE<8
3604
+ // Check if natively block-level elements act like inline-block
3605
+ // elements when setting their display to 'inline' and giving
3606
+ // them layout
3607
+ div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
3608
+
3609
+ support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
3610
+ if ( val ) {
3611
+ // Prevent IE 6 from affecting layout for positioned elements #11048
3612
+ // Prevent IE from shrinking the body in IE 7 mode #12869
3613
+ // Support: IE<8
3614
+ body.style.zoom = 1;
3615
+ }
3616
+ }
3617
+
3618
+ body.removeChild( container );
3619
+ });
3620
+
3621
+
3622
+
3623
+
3624
+ (function() {
3625
+ var div = document.createElement( "div" );
3626
+
3627
+ // Execute the test only if not already executed in another module.
3628
+ if (support.deleteExpando == null) {
3629
+ // Support: IE<9
3630
+ support.deleteExpando = true;
3631
+ try {
3632
+ delete div.test;
3633
+ } catch( e ) {
3634
+ support.deleteExpando = false;
3635
+ }
3636
+ }
3637
+
3638
+ // Null elements to avoid leaks in IE.
3639
+ div = null;
3640
+ })();
3641
+
3642
+
3643
+ /**
3644
+ * Determines whether an object can have data
3645
+ */
3646
+ jQuery.acceptData = function( elem ) {
3647
+ var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
3648
+ nodeType = +elem.nodeType || 1;
3649
+
3650
+ // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3651
+ return nodeType !== 1 && nodeType !== 9 ?
3652
+ false :
3653
+
3654
+ // Nodes accept data unless otherwise specified; rejection can be conditional
3655
+ !noData || noData !== true && elem.getAttribute("classid") === noData;
3656
+ };
3657
+
3658
+
3659
+ var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3660
+ rmultiDash = /([A-Z])/g;
3661
+
3662
+ function dataAttr( elem, key, data ) {
3663
+ // If nothing was found internally, try to fetch any
3664
+ // data from the HTML5 data-* attribute
3665
+ if ( data === undefined && elem.nodeType === 1 ) {
3666
+
3667
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3668
+
3669
+ data = elem.getAttribute( name );
3670
+
3671
+ if ( typeof data === "string" ) {
3672
+ try {
3673
+ data = data === "true" ? true :
3674
+ data === "false" ? false :
3675
+ data === "null" ? null :
3676
+ // Only convert to a number if it doesn't change the string
3677
+ +data + "" === data ? +data :
3678
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
3679
+ data;
3680
+ } catch( e ) {}
3681
+
3682
+ // Make sure we set the data so it isn't changed later
3683
+ jQuery.data( elem, key, data );
3684
+
3685
+ } else {
3686
+ data = undefined;
3687
+ }
3688
+ }
3689
+
3690
+ return data;
3691
+ }
3692
+
3693
+ // checks a cache object for emptiness
3694
+ function isEmptyDataObject( obj ) {
3695
+ var name;
3696
+ for ( name in obj ) {
3697
+
3698
+ // if the public data object is empty, the private is still empty
3699
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3700
+ continue;
3701
+ }
3702
+ if ( name !== "toJSON" ) {
3703
+ return false;
3704
+ }
3705
+ }
3706
+
3707
+ return true;
3708
+ }
3709
+
3710
+ function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3711
+ if ( !jQuery.acceptData( elem ) ) {
3712
+ return;
3713
+ }
3714
+
3715
+ var ret, thisCache,
3716
+ internalKey = jQuery.expando,
3717
+
3718
+ // We have to handle DOM nodes and JS objects differently because IE6-7
3719
+ // can't GC object references properly across the DOM-JS boundary
3720
+ isNode = elem.nodeType,
3721
+
3722
+ // Only DOM nodes need the global jQuery cache; JS object data is
3723
+ // attached directly to the object so GC can occur automatically
3724
+ cache = isNode ? jQuery.cache : elem,
3725
+
3726
+ // Only defining an ID for JS objects if its cache already exists allows
3727
+ // the code to shortcut on the same path as a DOM node with no cache
3728
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3729
+
3730
+ // Avoid doing any more work than we need to when trying to get data on an
3731
+ // object that has no data at all
3732
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3733
+ return;
3734
+ }
3735
+
3736
+ if ( !id ) {
3737
+ // Only DOM nodes need a new unique ID for each element since their data
3738
+ // ends up in the global cache
3739
+ if ( isNode ) {
3740
+ id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3741
+ } else {
3742
+ id = internalKey;
3743
+ }
3744
+ }
3745
+
3746
+ if ( !cache[ id ] ) {
3747
+ // Avoid exposing jQuery metadata on plain JS objects when the object
3748
+ // is serialized using JSON.stringify
3749
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3750
+ }
3751
+
3752
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
3753
+ // shallow copied over onto the existing cache
3754
+ if ( typeof name === "object" || typeof name === "function" ) {
3755
+ if ( pvt ) {
3756
+ cache[ id ] = jQuery.extend( cache[ id ], name );
3757
+ } else {
3758
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3759
+ }
3760
+ }
3761
+
3762
+ thisCache = cache[ id ];
3763
+
3764
+ // jQuery data() is stored in a separate object inside the object's internal data
3765
+ // cache in order to avoid key collisions between internal data and user-defined
3766
+ // data.
3767
+ if ( !pvt ) {
3768
+ if ( !thisCache.data ) {
3769
+ thisCache.data = {};
3770
+ }
3771
+
3772
+ thisCache = thisCache.data;
3773
+ }
3774
+
3775
+ if ( data !== undefined ) {
3776
+ thisCache[ jQuery.camelCase( name ) ] = data;
3777
+ }
3778
+
3779
+ // Check for both converted-to-camel and non-converted data property names
3780
+ // If a data property was specified
3781
+ if ( typeof name === "string" ) {
3782
+
3783
+ // First Try to find as-is property data
3784
+ ret = thisCache[ name ];
3785
+
3786
+ // Test for null|undefined property data
3787
+ if ( ret == null ) {
3788
+
3789
+ // Try to find the camelCased property
3790
+ ret = thisCache[ jQuery.camelCase( name ) ];
3791
+ }
3792
+ } else {
3793
+ ret = thisCache;
3794
+ }
3795
+
3796
+ return ret;
3797
+ }
3798
+
3799
+ function internalRemoveData( elem, name, pvt ) {
3800
+ if ( !jQuery.acceptData( elem ) ) {
3801
+ return;
3802
+ }
3803
+
3804
+ var thisCache, i,
3805
+ isNode = elem.nodeType,
3806
+
3807
+ // See jQuery.data for more information
3808
+ cache = isNode ? jQuery.cache : elem,
3809
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3810
+
3811
+ // If there is already no cache entry for this object, there is no
3812
+ // purpose in continuing
3813
+ if ( !cache[ id ] ) {
3814
+ return;
3815
+ }
3816
+
3817
+ if ( name ) {
3818
+
3819
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
3820
+
3821
+ if ( thisCache ) {
3822
+
3823
+ // Support array or space separated string names for data keys
3824
+ if ( !jQuery.isArray( name ) ) {
3825
+
3826
+ // try the string as a key before any manipulation
3827
+ if ( name in thisCache ) {
3828
+ name = [ name ];
3829
+ } else {
3830
+
3831
+ // split the camel cased version by spaces unless a key with the spaces exists
3832
+ name = jQuery.camelCase( name );
3833
+ if ( name in thisCache ) {
3834
+ name = [ name ];
3835
+ } else {
3836
+ name = name.split(" ");
3837
+ }
3838
+ }
3839
+ } else {
3840
+ // If "name" is an array of keys...
3841
+ // When data is initially created, via ("key", "val") signature,
3842
+ // keys will be converted to camelCase.
3843
+ // Since there is no way to tell _how_ a key was added, remove
3844
+ // both plain key and camelCase key. #12786
3845
+ // This will only penalize the array argument path.
3846
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3847
+ }
3848
+
3849
+ i = name.length;
3850
+ while ( i-- ) {
3851
+ delete thisCache[ name[i] ];
3852
+ }
3853
+
3854
+ // If there is no data left in the cache, we want to continue
3855
+ // and let the cache object itself get destroyed
3856
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3857
+ return;
3858
+ }
3859
+ }
3860
+ }
3861
+
3862
+ // See jQuery.data for more information
3863
+ if ( !pvt ) {
3864
+ delete cache[ id ].data;
3865
+
3866
+ // Don't destroy the parent cache unless the internal data object
3867
+ // had been the only thing left in it
3868
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
3869
+ return;
3870
+ }
3871
+ }
3872
+
3873
+ // Destroy the cache
3874
+ if ( isNode ) {
3875
+ jQuery.cleanData( [ elem ], true );
3876
+
3877
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3878
+ /* jshint eqeqeq: false */
3879
+ } else if ( support.deleteExpando || cache != cache.window ) {
3880
+ /* jshint eqeqeq: true */
3881
+ delete cache[ id ];
3882
+
3883
+ // When all else fails, null
3884
+ } else {
3885
+ cache[ id ] = null;
3886
+ }
3887
+ }
3888
+
3889
+ jQuery.extend({
3890
+ cache: {},
3891
+
3892
+ // The following elements (space-suffixed to avoid Object.prototype collisions)
3893
+ // throw uncatchable exceptions if you attempt to set expando properties
3894
+ noData: {
3895
+ "applet ": true,
3896
+ "embed ": true,
3897
+ // ...but Flash objects (which have this classid) *can* handle expandos
3898
+ "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3899
+ },
3900
+
3901
+ hasData: function( elem ) {
3902
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3903
+ return !!elem && !isEmptyDataObject( elem );
3904
+ },
3905
+
3906
+ data: function( elem, name, data ) {
3907
+ return internalData( elem, name, data );
3908
+ },
3909
+
3910
+ removeData: function( elem, name ) {
3911
+ return internalRemoveData( elem, name );
3912
+ },
3913
+
3914
+ // For internal use only.
3915
+ _data: function( elem, name, data ) {
3916
+ return internalData( elem, name, data, true );
3917
+ },
3918
+
3919
+ _removeData: function( elem, name ) {
3920
+ return internalRemoveData( elem, name, true );
3921
+ }
3922
+ });
3923
+
3924
+ jQuery.fn.extend({
3925
+ data: function( key, value ) {
3926
+ var i, name, data,
3927
+ elem = this[0],
3928
+ attrs = elem && elem.attributes;
3929
+
3930
+ // Special expections of .data basically thwart jQuery.access,
3931
+ // so implement the relevant behavior ourselves
3932
+
3933
+ // Gets all values
3934
+ if ( key === undefined ) {
3935
+ if ( this.length ) {
3936
+ data = jQuery.data( elem );
3937
+
3938
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3939
+ i = attrs.length;
3940
+ while ( i-- ) {
3941
+
3942
+ // Support: IE11+
3943
+ // The attrs elements can be null (#14894)
3944
+ if ( attrs[ i ] ) {
3945
+ name = attrs[ i ].name;
3946
+ if ( name.indexOf( "data-" ) === 0 ) {
3947
+ name = jQuery.camelCase( name.slice(5) );
3948
+ dataAttr( elem, name, data[ name ] );
3949
+ }
3950
+ }
3951
+ }
3952
+ jQuery._data( elem, "parsedAttrs", true );
3953
+ }
3954
+ }
3955
+
3956
+ return data;
3957
+ }
3958
+
3959
+ // Sets multiple values
3960
+ if ( typeof key === "object" ) {
3961
+ return this.each(function() {
3962
+ jQuery.data( this, key );
3963
+ });
3964
+ }
3965
+
3966
+ return arguments.length > 1 ?
3967
+
3968
+ // Sets one value
3969
+ this.each(function() {
3970
+ jQuery.data( this, key, value );
3971
+ }) :
3972
+
3973
+ // Gets one value
3974
+ // Try to fetch any internally stored data first
3975
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
3976
+ },
3977
+
3978
+ removeData: function( key ) {
3979
+ return this.each(function() {
3980
+ jQuery.removeData( this, key );
3981
+ });
3982
+ }
3983
+ });
3984
+
3985
+
3986
+ jQuery.extend({
3987
+ queue: function( elem, type, data ) {
3988
+ var queue;
3989
+
3990
+ if ( elem ) {
3991
+ type = ( type || "fx" ) + "queue";
3992
+ queue = jQuery._data( elem, type );
3993
+
3994
+ // Speed up dequeue by getting out quickly if this is just a lookup
3995
+ if ( data ) {
3996
+ if ( !queue || jQuery.isArray(data) ) {
3997
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3998
+ } else {
3999
+ queue.push( data );
4000
+ }
4001
+ }
4002
+ return queue || [];
4003
+ }
4004
+ },
4005
+
4006
+ dequeue: function( elem, type ) {
4007
+ type = type || "fx";
4008
+
4009
+ var queue = jQuery.queue( elem, type ),
4010
+ startLength = queue.length,
4011
+ fn = queue.shift(),
4012
+ hooks = jQuery._queueHooks( elem, type ),
4013
+ next = function() {
4014
+ jQuery.dequeue( elem, type );
4015
+ };
4016
+
4017
+ // If the fx queue is dequeued, always remove the progress sentinel
4018
+ if ( fn === "inprogress" ) {
4019
+ fn = queue.shift();
4020
+ startLength--;
4021
+ }
4022
+
4023
+ if ( fn ) {
4024
+
4025
+ // Add a progress sentinel to prevent the fx queue from being
4026
+ // automatically dequeued
4027
+ if ( type === "fx" ) {
4028
+ queue.unshift( "inprogress" );
4029
+ }
4030
+
4031
+ // clear up the last queue stop function
4032
+ delete hooks.stop;
4033
+ fn.call( elem, next, hooks );
4034
+ }
4035
+
4036
+ if ( !startLength && hooks ) {
4037
+ hooks.empty.fire();
4038
+ }
4039
+ },
4040
+
4041
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
4042
+ _queueHooks: function( elem, type ) {
4043
+ var key = type + "queueHooks";
4044
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4045
+ empty: jQuery.Callbacks("once memory").add(function() {
4046
+ jQuery._removeData( elem, type + "queue" );
4047
+ jQuery._removeData( elem, key );
4048
+ })
4049
+ });
4050
+ }
4051
+ });
4052
+
4053
+ jQuery.fn.extend({
4054
+ queue: function( type, data ) {
4055
+ var setter = 2;
4056
+
4057
+ if ( typeof type !== "string" ) {
4058
+ data = type;
4059
+ type = "fx";
4060
+ setter--;
4061
+ }
4062
+
4063
+ if ( arguments.length < setter ) {
4064
+ return jQuery.queue( this[0], type );
4065
+ }
4066
+
4067
+ return data === undefined ?
4068
+ this :
4069
+ this.each(function() {
4070
+ var queue = jQuery.queue( this, type, data );
4071
+
4072
+ // ensure a hooks for this queue
4073
+ jQuery._queueHooks( this, type );
4074
+
4075
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
4076
+ jQuery.dequeue( this, type );
4077
+ }
4078
+ });
4079
+ },
4080
+ dequeue: function( type ) {
4081
+ return this.each(function() {
4082
+ jQuery.dequeue( this, type );
4083
+ });
4084
+ },
4085
+ clearQueue: function( type ) {
4086
+ return this.queue( type || "fx", [] );
4087
+ },
4088
+ // Get a promise resolved when queues of a certain type
4089
+ // are emptied (fx is the type by default)
4090
+ promise: function( type, obj ) {
4091
+ var tmp,
4092
+ count = 1,
4093
+ defer = jQuery.Deferred(),
4094
+ elements = this,
4095
+ i = this.length,
4096
+ resolve = function() {
4097
+ if ( !( --count ) ) {
4098
+ defer.resolveWith( elements, [ elements ] );
4099
+ }
4100
+ };
4101
+
4102
+ if ( typeof type !== "string" ) {
4103
+ obj = type;
4104
+ type = undefined;
4105
+ }
4106
+ type = type || "fx";
4107
+
4108
+ while ( i-- ) {
4109
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4110
+ if ( tmp && tmp.empty ) {
4111
+ count++;
4112
+ tmp.empty.add( resolve );
4113
+ }
4114
+ }
4115
+ resolve();
4116
+ return defer.promise( obj );
4117
+ }
4118
+ });
4119
+ var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
4120
+
4121
+ var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4122
+
4123
+ var isHidden = function( elem, el ) {
4124
+ // isHidden might be called from jQuery#filter function;
4125
+ // in that case, element will be second argument
4126
+ elem = el || elem;
4127
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4128
+ };
4129
+
4130
+
4131
+
4132
+ // Multifunctional method to get and set values of a collection
4133
+ // The value/s can optionally be executed if it's a function
4134
+ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4135
+ var i = 0,
4136
+ length = elems.length,
4137
+ bulk = key == null;
4138
+
4139
+ // Sets many values
4140
+ if ( jQuery.type( key ) === "object" ) {
4141
+ chainable = true;
4142
+ for ( i in key ) {
4143
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4144
+ }
4145
+
4146
+ // Sets one value
4147
+ } else if ( value !== undefined ) {
4148
+ chainable = true;
4149
+
4150
+ if ( !jQuery.isFunction( value ) ) {
4151
+ raw = true;
4152
+ }
4153
+
4154
+ if ( bulk ) {
4155
+ // Bulk operations run against the entire set
4156
+ if ( raw ) {
4157
+ fn.call( elems, value );
4158
+ fn = null;
4159
+
4160
+ // ...except when executing function values
4161
+ } else {
4162
+ bulk = fn;
4163
+ fn = function( elem, key, value ) {
4164
+ return bulk.call( jQuery( elem ), value );
4165
+ };
4166
+ }
4167
+ }
4168
+
4169
+ if ( fn ) {
4170
+ for ( ; i < length; i++ ) {
4171
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4172
+ }
4173
+ }
4174
+ }
4175
+
4176
+ return chainable ?
4177
+ elems :
4178
+
4179
+ // Gets
4180
+ bulk ?
4181
+ fn.call( elems ) :
4182
+ length ? fn( elems[0], key ) : emptyGet;
4183
+ };
4184
+ var rcheckableType = (/^(?:checkbox|radio)$/i);
4185
+
4186
+
4187
+
4188
+ (function() {
4189
+ // Minified: var a,b,c
4190
+ var input = document.createElement( "input" ),
4191
+ div = document.createElement( "div" ),
4192
+ fragment = document.createDocumentFragment();
4193
+
4194
+ // Setup
4195
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4196
+
4197
+ // IE strips leading whitespace when .innerHTML is used
4198
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
4199
+
4200
+ // Make sure that tbody elements aren't automatically inserted
4201
+ // IE will insert them into empty tables
4202
+ support.tbody = !div.getElementsByTagName( "tbody" ).length;
4203
+
4204
+ // Make sure that link elements get serialized correctly by innerHTML
4205
+ // This requires a wrapper element in IE
4206
+ support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4207
+
4208
+ // Makes sure cloning an html5 element does not cause problems
4209
+ // Where outerHTML is undefined, this still works
4210
+ support.html5Clone =
4211
+ document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4212
+
4213
+ // Check if a disconnected checkbox will retain its checked
4214
+ // value of true after appended to the DOM (IE6/7)
4215
+ input.type = "checkbox";
4216
+ input.checked = true;
4217
+ fragment.appendChild( input );
4218
+ support.appendChecked = input.checked;
4219
+
4220
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
4221
+ // Support: IE6-IE11+
4222
+ div.innerHTML = "<textarea>x</textarea>";
4223
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4224
+
4225
+ // #11217 - WebKit loses check when the name is after the checked attribute
4226
+ fragment.appendChild( div );
4227
+ div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
4228
+
4229
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4230
+ // old WebKit doesn't clone checked state correctly in fragments
4231
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4232
+
4233
+ // Support: IE<9
4234
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
4235
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4236
+ support.noCloneEvent = true;
4237
+ if ( div.attachEvent ) {
4238
+ div.attachEvent( "onclick", function() {
4239
+ support.noCloneEvent = false;
4240
+ });
4241
+
4242
+ div.cloneNode( true ).click();
4243
+ }
4244
+
4245
+ // Execute the test only if not already executed in another module.
4246
+ if (support.deleteExpando == null) {
4247
+ // Support: IE<9
4248
+ support.deleteExpando = true;
4249
+ try {
4250
+ delete div.test;
4251
+ } catch( e ) {
4252
+ support.deleteExpando = false;
4253
+ }
4254
+ }
4255
+ })();
4256
+
4257
+
4258
+ (function() {
4259
+ var i, eventName,
4260
+ div = document.createElement( "div" );
4261
+
4262
+ // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
4263
+ for ( i in { submit: true, change: true, focusin: true }) {
4264
+ eventName = "on" + i;
4265
+
4266
+ if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
4267
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4268
+ div.setAttribute( eventName, "t" );
4269
+ support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
4270
+ }
4271
+ }
4272
+
4273
+ // Null elements to avoid leaks in IE.
4274
+ div = null;
4275
+ })();
4276
+
4277
+
4278
+ var rformElems = /^(?:input|select|textarea)$/i,
4279
+ rkeyEvent = /^key/,
4280
+ rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
4281
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4282
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4283
+
4284
+ function returnTrue() {
4285
+ return true;
4286
+ }
4287
+
4288
+ function returnFalse() {
4289
+ return false;
4290
+ }
4291
+
4292
+ function safeActiveElement() {
4293
+ try {
4294
+ return document.activeElement;
4295
+ } catch ( err ) { }
4296
+ }
4297
+
4298
+ /*
4299
+ * Helper functions for managing events -- not part of the public interface.
4300
+ * Props to Dean Edwards' addEvent library for many of the ideas.
4301
+ */
4302
+ jQuery.event = {
4303
+
4304
+ global: {},
4305
+
4306
+ add: function( elem, types, handler, data, selector ) {
4307
+ var tmp, events, t, handleObjIn,
4308
+ special, eventHandle, handleObj,
4309
+ handlers, type, namespaces, origType,
4310
+ elemData = jQuery._data( elem );
4311
+
4312
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
4313
+ if ( !elemData ) {
4314
+ return;
4315
+ }
4316
+
4317
+ // Caller can pass in an object of custom data in lieu of the handler
4318
+ if ( handler.handler ) {
4319
+ handleObjIn = handler;
4320
+ handler = handleObjIn.handler;
4321
+ selector = handleObjIn.selector;
4322
+ }
4323
+
4324
+ // Make sure that the handler has a unique ID, used to find/remove it later
4325
+ if ( !handler.guid ) {
4326
+ handler.guid = jQuery.guid++;
4327
+ }
4328
+
4329
+ // Init the element's event structure and main handler, if this is the first
4330
+ if ( !(events = elemData.events) ) {
4331
+ events = elemData.events = {};
4332
+ }
4333
+ if ( !(eventHandle = elemData.handle) ) {
4334
+ eventHandle = elemData.handle = function( e ) {
4335
+ // Discard the second event of a jQuery.event.trigger() and
4336
+ // when an event is called after a page has unloaded
4337
+ return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
4338
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4339
+ undefined;
4340
+ };
4341
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4342
+ eventHandle.elem = elem;
4343
+ }
4344
+
4345
+ // Handle multiple events separated by a space
4346
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
4347
+ t = types.length;
4348
+ while ( t-- ) {
4349
+ tmp = rtypenamespace.exec( types[t] ) || [];
4350
+ type = origType = tmp[1];
4351
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4352
+
4353
+ // There *must* be a type, no attaching namespace-only handlers
4354
+ if ( !type ) {
4355
+ continue;
4356
+ }
4357
+
4358
+ // If event changes its type, use the special event handlers for the changed type
4359
+ special = jQuery.event.special[ type ] || {};
4360
+
4361
+ // If selector defined, determine special event api type, otherwise given type
4362
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4363
+
4364
+ // Update special based on newly reset type
4365
+ special = jQuery.event.special[ type ] || {};
4366
+
4367
+ // handleObj is passed to all event handlers
4368
+ handleObj = jQuery.extend({
4369
+ type: type,
4370
+ origType: origType,
4371
+ data: data,
4372
+ handler: handler,
4373
+ guid: handler.guid,
4374
+ selector: selector,
4375
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4376
+ namespace: namespaces.join(".")
4377
+ }, handleObjIn );
4378
+
4379
+ // Init the event handler queue if we're the first
4380
+ if ( !(handlers = events[ type ]) ) {
4381
+ handlers = events[ type ] = [];
4382
+ handlers.delegateCount = 0;
4383
+
4384
+ // Only use addEventListener/attachEvent if the special events handler returns false
4385
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4386
+ // Bind the global event handler to the element
4387
+ if ( elem.addEventListener ) {
4388
+ elem.addEventListener( type, eventHandle, false );
4389
+
4390
+ } else if ( elem.attachEvent ) {
4391
+ elem.attachEvent( "on" + type, eventHandle );
4392
+ }
4393
+ }
4394
+ }
4395
+
4396
+ if ( special.add ) {
4397
+ special.add.call( elem, handleObj );
4398
+
4399
+ if ( !handleObj.handler.guid ) {
4400
+ handleObj.handler.guid = handler.guid;
4401
+ }
4402
+ }
4403
+
4404
+ // Add to the element's handler list, delegates in front
4405
+ if ( selector ) {
4406
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
4407
+ } else {
4408
+ handlers.push( handleObj );
4409
+ }
4410
+
4411
+ // Keep track of which events have ever been used, for event optimization
4412
+ jQuery.event.global[ type ] = true;
4413
+ }
4414
+
4415
+ // Nullify elem to prevent memory leaks in IE
4416
+ elem = null;
4417
+ },
4418
+
4419
+ // Detach an event or set of events from an element
4420
+ remove: function( elem, types, handler, selector, mappedTypes ) {
4421
+ var j, handleObj, tmp,
4422
+ origCount, t, events,
4423
+ special, handlers, type,
4424
+ namespaces, origType,
4425
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4426
+
4427
+ if ( !elemData || !(events = elemData.events) ) {
4428
+ return;
4429
+ }
4430
+
4431
+ // Once for each type.namespace in types; type may be omitted
4432
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
4433
+ t = types.length;
4434
+ while ( t-- ) {
4435
+ tmp = rtypenamespace.exec( types[t] ) || [];
4436
+ type = origType = tmp[1];
4437
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
4438
+
4439
+ // Unbind all events (on this namespace, if provided) for the element
4440
+ if ( !type ) {
4441
+ for ( type in events ) {
4442
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4443
+ }
4444
+ continue;
4445
+ }
4446
+
4447
+ special = jQuery.event.special[ type ] || {};
4448
+ type = ( selector ? special.delegateType : special.bindType ) || type;
4449
+ handlers = events[ type ] || [];
4450
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4451
+
4452
+ // Remove matching events
4453
+ origCount = j = handlers.length;
4454
+ while ( j-- ) {
4455
+ handleObj = handlers[ j ];
4456
+
4457
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
4458
+ ( !handler || handler.guid === handleObj.guid ) &&
4459
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
4460
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4461
+ handlers.splice( j, 1 );
4462
+
4463
+ if ( handleObj.selector ) {
4464
+ handlers.delegateCount--;
4465
+ }
4466
+ if ( special.remove ) {
4467
+ special.remove.call( elem, handleObj );
4468
+ }
4469
+ }
4470
+ }
4471
+
4472
+ // Remove generic event handler if we removed something and no more handlers exist
4473
+ // (avoids potential for endless recursion during removal of special event handlers)
4474
+ if ( origCount && !handlers.length ) {
4475
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4476
+ jQuery.removeEvent( elem, type, elemData.handle );
4477
+ }
4478
+
4479
+ delete events[ type ];
4480
+ }
4481
+ }
4482
+
4483
+ // Remove the expando if it's no longer used
4484
+ if ( jQuery.isEmptyObject( events ) ) {
4485
+ delete elemData.handle;
4486
+
4487
+ // removeData also checks for emptiness and clears the expando if empty
4488
+ // so use it instead of delete
4489
+ jQuery._removeData( elem, "events" );
4490
+ }
4491
+ },
4492
+
4493
+ trigger: function( event, data, elem, onlyHandlers ) {
4494
+ var handle, ontype, cur,
4495
+ bubbleType, special, tmp, i,
4496
+ eventPath = [ elem || document ],
4497
+ type = hasOwn.call( event, "type" ) ? event.type : event,
4498
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4499
+
4500
+ cur = tmp = elem = elem || document;
4501
+
4502
+ // Don't do events on text and comment nodes
4503
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4504
+ return;
4505
+ }
4506
+
4507
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
4508
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4509
+ return;
4510
+ }
4511
+
4512
+ if ( type.indexOf(".") >= 0 ) {
4513
+ // Namespaced trigger; create a regexp to match event type in handle()
4514
+ namespaces = type.split(".");
4515
+ type = namespaces.shift();
4516
+ namespaces.sort();
4517
+ }
4518
+ ontype = type.indexOf(":") < 0 && "on" + type;
4519
+
4520
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
4521
+ event = event[ jQuery.expando ] ?
4522
+ event :
4523
+ new jQuery.Event( type, typeof event === "object" && event );
4524
+
4525
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4526
+ event.isTrigger = onlyHandlers ? 2 : 3;
4527
+ event.namespace = namespaces.join(".");
4528
+ event.namespace_re = event.namespace ?
4529
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4530
+ null;
4531
+
4532
+ // Clean up the event in case it is being reused
4533
+ event.result = undefined;
4534
+ if ( !event.target ) {
4535
+ event.target = elem;
4536
+ }
4537
+
4538
+ // Clone any incoming data and prepend the event, creating the handler arg list
4539
+ data = data == null ?
4540
+ [ event ] :
4541
+ jQuery.makeArray( data, [ event ] );
4542
+
4543
+ // Allow special events to draw outside the lines
4544
+ special = jQuery.event.special[ type ] || {};
4545
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4546
+ return;
4547
+ }
4548
+
4549
+ // Determine event propagation path in advance, per W3C events spec (#9951)
4550
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4551
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4552
+
4553
+ bubbleType = special.delegateType || type;
4554
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
4555
+ cur = cur.parentNode;
4556
+ }
4557
+ for ( ; cur; cur = cur.parentNode ) {
4558
+ eventPath.push( cur );
4559
+ tmp = cur;
4560
+ }
4561
+
4562
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
4563
+ if ( tmp === (elem.ownerDocument || document) ) {
4564
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4565
+ }
4566
+ }
4567
+
4568
+ // Fire handlers on the event path
4569
+ i = 0;
4570
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4571
+
4572
+ event.type = i > 1 ?
4573
+ bubbleType :
4574
+ special.bindType || type;
4575
+
4576
+ // jQuery handler
4577
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4578
+ if ( handle ) {
4579
+ handle.apply( cur, data );
4580
+ }
4581
+
4582
+ // Native handler
4583
+ handle = ontype && cur[ ontype ];
4584
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4585
+ event.result = handle.apply( cur, data );
4586
+ if ( event.result === false ) {
4587
+ event.preventDefault();
4588
+ }
4589
+ }
4590
+ }
4591
+ event.type = type;
4592
+
4593
+ // If nobody prevented the default action, do it now
4594
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4595
+
4596
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4597
+ jQuery.acceptData( elem ) ) {
4598
+
4599
+ // Call a native DOM method on the target with the same name name as the event.
4600
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
4601
+ // Don't do default actions on window, that's where global variables be (#6170)
4602
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4603
+
4604
+ // Don't re-trigger an onFOO event when we call its FOO() method
4605
+ tmp = elem[ ontype ];
4606
+
4607
+ if ( tmp ) {
4608
+ elem[ ontype ] = null;
4609
+ }
4610
+
4611
+ // Prevent re-triggering of the same event, since we already bubbled it above
4612
+ jQuery.event.triggered = type;
4613
+ try {
4614
+ elem[ type ]();
4615
+ } catch ( e ) {
4616
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4617
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4618
+ }
4619
+ jQuery.event.triggered = undefined;
4620
+
4621
+ if ( tmp ) {
4622
+ elem[ ontype ] = tmp;
4623
+ }
4624
+ }
4625
+ }
4626
+ }
4627
+
4628
+ return event.result;
4629
+ },
4630
+
4631
+ dispatch: function( event ) {
4632
+
4633
+ // Make a writable jQuery.Event from the native event object
4634
+ event = jQuery.event.fix( event );
4635
+
4636
+ var i, ret, handleObj, matched, j,
4637
+ handlerQueue = [],
4638
+ args = slice.call( arguments ),
4639
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4640
+ special = jQuery.event.special[ event.type ] || {};
4641
+
4642
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
4643
+ args[0] = event;
4644
+ event.delegateTarget = this;
4645
+
4646
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
4647
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4648
+ return;
4649
+ }
4650
+
4651
+ // Determine handlers
4652
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4653
+
4654
+ // Run delegates first; they may want to stop propagation beneath us
4655
+ i = 0;
4656
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4657
+ event.currentTarget = matched.elem;
4658
+
4659
+ j = 0;
4660
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4661
+
4662
+ // Triggered event must either 1) have no namespace, or
4663
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4664
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4665
+
4666
+ event.handleObj = handleObj;
4667
+ event.data = handleObj.data;
4668
+
4669
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4670
+ .apply( matched.elem, args );
4671
+
4672
+ if ( ret !== undefined ) {
4673
+ if ( (event.result = ret) === false ) {
4674
+ event.preventDefault();
4675
+ event.stopPropagation();
4676
+ }
4677
+ }
4678
+ }
4679
+ }
4680
+ }
4681
+
4682
+ // Call the postDispatch hook for the mapped type
4683
+ if ( special.postDispatch ) {
4684
+ special.postDispatch.call( this, event );
4685
+ }
4686
+
4687
+ return event.result;
4688
+ },
4689
+
4690
+ handlers: function( event, handlers ) {
4691
+ var sel, handleObj, matches, i,
4692
+ handlerQueue = [],
4693
+ delegateCount = handlers.delegateCount,
4694
+ cur = event.target;
4695
+
4696
+ // Find delegate handlers
4697
+ // Black-hole SVG <use> instance trees (#13180)
4698
+ // Avoid non-left-click bubbling in Firefox (#3861)
4699
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4700
+
4701
+ /* jshint eqeqeq: false */
4702
+ for ( ; cur != this; cur = cur.parentNode || this ) {
4703
+ /* jshint eqeqeq: true */
4704
+
4705
+ // Don't check non-elements (#13208)
4706
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4707
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4708
+ matches = [];
4709
+ for ( i = 0; i < delegateCount; i++ ) {
4710
+ handleObj = handlers[ i ];
4711
+
4712
+ // Don't conflict with Object.prototype properties (#13203)
4713
+ sel = handleObj.selector + " ";
4714
+
4715
+ if ( matches[ sel ] === undefined ) {
4716
+ matches[ sel ] = handleObj.needsContext ?
4717
+ jQuery( sel, this ).index( cur ) >= 0 :
4718
+ jQuery.find( sel, this, null, [ cur ] ).length;
4719
+ }
4720
+ if ( matches[ sel ] ) {
4721
+ matches.push( handleObj );
4722
+ }
4723
+ }
4724
+ if ( matches.length ) {
4725
+ handlerQueue.push({ elem: cur, handlers: matches });
4726
+ }
4727
+ }
4728
+ }
4729
+ }
4730
+
4731
+ // Add the remaining (directly-bound) handlers
4732
+ if ( delegateCount < handlers.length ) {
4733
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4734
+ }
4735
+
4736
+ return handlerQueue;
4737
+ },
4738
+
4739
+ fix: function( event ) {
4740
+ if ( event[ jQuery.expando ] ) {
4741
+ return event;
4742
+ }
4743
+
4744
+ // Create a writable copy of the event object and normalize some properties
4745
+ var i, prop, copy,
4746
+ type = event.type,
4747
+ originalEvent = event,
4748
+ fixHook = this.fixHooks[ type ];
4749
+
4750
+ if ( !fixHook ) {
4751
+ this.fixHooks[ type ] = fixHook =
4752
+ rmouseEvent.test( type ) ? this.mouseHooks :
4753
+ rkeyEvent.test( type ) ? this.keyHooks :
4754
+ {};
4755
+ }
4756
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4757
+
4758
+ event = new jQuery.Event( originalEvent );
4759
+
4760
+ i = copy.length;
4761
+ while ( i-- ) {
4762
+ prop = copy[ i ];
4763
+ event[ prop ] = originalEvent[ prop ];
4764
+ }
4765
+
4766
+ // Support: IE<9
4767
+ // Fix target property (#1925)
4768
+ if ( !event.target ) {
4769
+ event.target = originalEvent.srcElement || document;
4770
+ }
4771
+
4772
+ // Support: Chrome 23+, Safari?
4773
+ // Target should not be a text node (#504, #13143)
4774
+ if ( event.target.nodeType === 3 ) {
4775
+ event.target = event.target.parentNode;
4776
+ }
4777
+
4778
+ // Support: IE<9
4779
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4780
+ event.metaKey = !!event.metaKey;
4781
+
4782
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4783
+ },
4784
+
4785
+ // Includes some event props shared by KeyEvent and MouseEvent
4786
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4787
+
4788
+ fixHooks: {},
4789
+
4790
+ keyHooks: {
4791
+ props: "char charCode key keyCode".split(" "),
4792
+ filter: function( event, original ) {
4793
+
4794
+ // Add which for key events
4795
+ if ( event.which == null ) {
4796
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
4797
+ }
4798
+
4799
+ return event;
4800
+ }
4801
+ },
4802
+
4803
+ mouseHooks: {
4804
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4805
+ filter: function( event, original ) {
4806
+ var body, eventDoc, doc,
4807
+ button = original.button,
4808
+ fromElement = original.fromElement;
4809
+
4810
+ // Calculate pageX/Y if missing and clientX/Y available
4811
+ if ( event.pageX == null && original.clientX != null ) {
4812
+ eventDoc = event.target.ownerDocument || document;
4813
+ doc = eventDoc.documentElement;
4814
+ body = eventDoc.body;
4815
+
4816
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4817
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4818
+ }
4819
+
4820
+ // Add relatedTarget, if necessary
4821
+ if ( !event.relatedTarget && fromElement ) {
4822
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4823
+ }
4824
+
4825
+ // Add which for click: 1 === left; 2 === middle; 3 === right
4826
+ // Note: button is not normalized, so don't use it
4827
+ if ( !event.which && button !== undefined ) {
4828
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4829
+ }
4830
+
4831
+ return event;
4832
+ }
4833
+ },
4834
+
4835
+ special: {
4836
+ load: {
4837
+ // Prevent triggered image.load events from bubbling to window.load
4838
+ noBubble: true
4839
+ },
4840
+ focus: {
4841
+ // Fire native event if possible so blur/focus sequence is correct
4842
+ trigger: function() {
4843
+ if ( this !== safeActiveElement() && this.focus ) {
4844
+ try {
4845
+ this.focus();
4846
+ return false;
4847
+ } catch ( e ) {
4848
+ // Support: IE<9
4849
+ // If we error on focus to hidden element (#1486, #12518),
4850
+ // let .trigger() run the handlers
4851
+ }
4852
+ }
4853
+ },
4854
+ delegateType: "focusin"
4855
+ },
4856
+ blur: {
4857
+ trigger: function() {
4858
+ if ( this === safeActiveElement() && this.blur ) {
4859
+ this.blur();
4860
+ return false;
4861
+ }
4862
+ },
4863
+ delegateType: "focusout"
4864
+ },
4865
+ click: {
4866
+ // For checkbox, fire native event so checked state will be right
4867
+ trigger: function() {
4868
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4869
+ this.click();
4870
+ return false;
4871
+ }
4872
+ },
4873
+
4874
+ // For cross-browser consistency, don't fire native .click() on links
4875
+ _default: function( event ) {
4876
+ return jQuery.nodeName( event.target, "a" );
4877
+ }
4878
+ },
4879
+
4880
+ beforeunload: {
4881
+ postDispatch: function( event ) {
4882
+
4883
+ // Support: Firefox 20+
4884
+ // Firefox doesn't alert if the returnValue field is not set.
4885
+ if ( event.result !== undefined && event.originalEvent ) {
4886
+ event.originalEvent.returnValue = event.result;
4887
+ }
4888
+ }
4889
+ }
4890
+ },
4891
+
4892
+ simulate: function( type, elem, event, bubble ) {
4893
+ // Piggyback on a donor event to simulate a different one.
4894
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
4895
+ // simulated event prevents default then we do the same on the donor.
4896
+ var e = jQuery.extend(
4897
+ new jQuery.Event(),
4898
+ event,
4899
+ {
4900
+ type: type,
4901
+ isSimulated: true,
4902
+ originalEvent: {}
4903
+ }
4904
+ );
4905
+ if ( bubble ) {
4906
+ jQuery.event.trigger( e, null, elem );
4907
+ } else {
4908
+ jQuery.event.dispatch.call( elem, e );
4909
+ }
4910
+ if ( e.isDefaultPrevented() ) {
4911
+ event.preventDefault();
4912
+ }
4913
+ }
4914
+ };
4915
+
4916
+ jQuery.removeEvent = document.removeEventListener ?
4917
+ function( elem, type, handle ) {
4918
+ if ( elem.removeEventListener ) {
4919
+ elem.removeEventListener( type, handle, false );
4920
+ }
4921
+ } :
4922
+ function( elem, type, handle ) {
4923
+ var name = "on" + type;
4924
+
4925
+ if ( elem.detachEvent ) {
4926
+
4927
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
4928
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
4929
+ if ( typeof elem[ name ] === strundefined ) {
4930
+ elem[ name ] = null;
4931
+ }
4932
+
4933
+ elem.detachEvent( name, handle );
4934
+ }
4935
+ };
4936
+
4937
+ jQuery.Event = function( src, props ) {
4938
+ // Allow instantiation without the 'new' keyword
4939
+ if ( !(this instanceof jQuery.Event) ) {
4940
+ return new jQuery.Event( src, props );
4941
+ }
4942
+
4943
+ // Event object
4944
+ if ( src && src.type ) {
4945
+ this.originalEvent = src;
4946
+ this.type = src.type;
4947
+
4948
+ // Events bubbling up the document may have been marked as prevented
4949
+ // by a handler lower down the tree; reflect the correct value.
4950
+ this.isDefaultPrevented = src.defaultPrevented ||
4951
+ src.defaultPrevented === undefined &&
4952
+ // Support: IE < 9, Android < 4.0
4953
+ src.returnValue === false ?
4954
+ returnTrue :
4955
+ returnFalse;
4956
+
4957
+ // Event type
4958
+ } else {
4959
+ this.type = src;
4960
+ }
4961
+
4962
+ // Put explicitly provided properties onto the event object
4963
+ if ( props ) {
4964
+ jQuery.extend( this, props );
4965
+ }
4966
+
4967
+ // Create a timestamp if incoming event doesn't have one
4968
+ this.timeStamp = src && src.timeStamp || jQuery.now();
4969
+
4970
+ // Mark it as fixed
4971
+ this[ jQuery.expando ] = true;
4972
+ };
4973
+
4974
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4975
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4976
+ jQuery.Event.prototype = {
4977
+ isDefaultPrevented: returnFalse,
4978
+ isPropagationStopped: returnFalse,
4979
+ isImmediatePropagationStopped: returnFalse,
4980
+
4981
+ preventDefault: function() {
4982
+ var e = this.originalEvent;
4983
+
4984
+ this.isDefaultPrevented = returnTrue;
4985
+ if ( !e ) {
4986
+ return;
4987
+ }
4988
+
4989
+ // If preventDefault exists, run it on the original event
4990
+ if ( e.preventDefault ) {
4991
+ e.preventDefault();
4992
+
4993
+ // Support: IE
4994
+ // Otherwise set the returnValue property of the original event to false
4995
+ } else {
4996
+ e.returnValue = false;
4997
+ }
4998
+ },
4999
+ stopPropagation: function() {
5000
+ var e = this.originalEvent;
5001
+
5002
+ this.isPropagationStopped = returnTrue;
5003
+ if ( !e ) {
5004
+ return;
5005
+ }
5006
+ // If stopPropagation exists, run it on the original event
5007
+ if ( e.stopPropagation ) {
5008
+ e.stopPropagation();
5009
+ }
5010
+
5011
+ // Support: IE
5012
+ // Set the cancelBubble property of the original event to true
5013
+ e.cancelBubble = true;
5014
+ },
5015
+ stopImmediatePropagation: function() {
5016
+ var e = this.originalEvent;
5017
+
5018
+ this.isImmediatePropagationStopped = returnTrue;
5019
+
5020
+ if ( e && e.stopImmediatePropagation ) {
5021
+ e.stopImmediatePropagation();
5022
+ }
5023
+
5024
+ this.stopPropagation();
5025
+ }
5026
+ };
5027
+
5028
+ // Create mouseenter/leave events using mouseover/out and event-time checks
5029
+ jQuery.each({
5030
+ mouseenter: "mouseover",
5031
+ mouseleave: "mouseout",
5032
+ pointerenter: "pointerover",
5033
+ pointerleave: "pointerout"
5034
+ }, function( orig, fix ) {
5035
+ jQuery.event.special[ orig ] = {
5036
+ delegateType: fix,
5037
+ bindType: fix,
5038
+
5039
+ handle: function( event ) {
5040
+ var ret,
5041
+ target = this,
5042
+ related = event.relatedTarget,
5043
+ handleObj = event.handleObj;
5044
+
5045
+ // For mousenter/leave call the handler if related is outside the target.
5046
+ // NB: No relatedTarget if the mouse left/entered the browser window
5047
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5048
+ event.type = handleObj.origType;
5049
+ ret = handleObj.handler.apply( this, arguments );
5050
+ event.type = fix;
5051
+ }
5052
+ return ret;
5053
+ }
5054
+ };
5055
+ });
5056
+
5057
+ // IE submit delegation
5058
+ if ( !support.submitBubbles ) {
5059
+
5060
+ jQuery.event.special.submit = {
5061
+ setup: function() {
5062
+ // Only need this for delegated form submit events
5063
+ if ( jQuery.nodeName( this, "form" ) ) {
5064
+ return false;
5065
+ }
5066
+
5067
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
5068
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5069
+ // Node name check avoids a VML-related crash in IE (#9807)
5070
+ var elem = e.target,
5071
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5072
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5073
+ jQuery.event.add( form, "submit._submit", function( event ) {
5074
+ event._submit_bubble = true;
5075
+ });
5076
+ jQuery._data( form, "submitBubbles", true );
5077
+ }
5078
+ });
5079
+ // return undefined since we don't need an event listener
5080
+ },
5081
+
5082
+ postDispatch: function( event ) {
5083
+ // If form was submitted by the user, bubble the event up the tree
5084
+ if ( event._submit_bubble ) {
5085
+ delete event._submit_bubble;
5086
+ if ( this.parentNode && !event.isTrigger ) {
5087
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
5088
+ }
5089
+ }
5090
+ },
5091
+
5092
+ teardown: function() {
5093
+ // Only need this for delegated form submit events
5094
+ if ( jQuery.nodeName( this, "form" ) ) {
5095
+ return false;
5096
+ }
5097
+
5098
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5099
+ jQuery.event.remove( this, "._submit" );
5100
+ }
5101
+ };
5102
+ }
5103
+
5104
+ // IE change delegation and checkbox/radio fix
5105
+ if ( !support.changeBubbles ) {
5106
+
5107
+ jQuery.event.special.change = {
5108
+
5109
+ setup: function() {
5110
+
5111
+ if ( rformElems.test( this.nodeName ) ) {
5112
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
5113
+ // after a propertychange. Eat the blur-change in special.change.handle.
5114
+ // This still fires onchange a second time for check/radio after blur.
5115
+ if ( this.type === "checkbox" || this.type === "radio" ) {
5116
+ jQuery.event.add( this, "propertychange._change", function( event ) {
5117
+ if ( event.originalEvent.propertyName === "checked" ) {
5118
+ this._just_changed = true;
5119
+ }
5120
+ });
5121
+ jQuery.event.add( this, "click._change", function( event ) {
5122
+ if ( this._just_changed && !event.isTrigger ) {
5123
+ this._just_changed = false;
5124
+ }
5125
+ // Allow triggered, simulated change events (#11500)
5126
+ jQuery.event.simulate( "change", this, event, true );
5127
+ });
5128
+ }
5129
+ return false;
5130
+ }
5131
+ // Delegated event; lazy-add a change handler on descendant inputs
5132
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
5133
+ var elem = e.target;
5134
+
5135
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5136
+ jQuery.event.add( elem, "change._change", function( event ) {
5137
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5138
+ jQuery.event.simulate( "change", this.parentNode, event, true );
5139
+ }
5140
+ });
5141
+ jQuery._data( elem, "changeBubbles", true );
5142
+ }
5143
+ });
5144
+ },
5145
+
5146
+ handle: function( event ) {
5147
+ var elem = event.target;
5148
+
5149
+ // Swallow native change events from checkbox/radio, we already triggered them above
5150
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5151
+ return event.handleObj.handler.apply( this, arguments );
5152
+ }
5153
+ },
5154
+
5155
+ teardown: function() {
5156
+ jQuery.event.remove( this, "._change" );
5157
+
5158
+ return !rformElems.test( this.nodeName );
5159
+ }
5160
+ };
5161
+ }
5162
+
5163
+ // Create "bubbling" focus and blur events
5164
+ if ( !support.focusinBubbles ) {
5165
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5166
+
5167
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
5168
+ var handler = function( event ) {
5169
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5170
+ };
5171
+
5172
+ jQuery.event.special[ fix ] = {
5173
+ setup: function() {
5174
+ var doc = this.ownerDocument || this,
5175
+ attaches = jQuery._data( doc, fix );
5176
+
5177
+ if ( !attaches ) {
5178
+ doc.addEventListener( orig, handler, true );
5179
+ }
5180
+ jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5181
+ },
5182
+ teardown: function() {
5183
+ var doc = this.ownerDocument || this,
5184
+ attaches = jQuery._data( doc, fix ) - 1;
5185
+
5186
+ if ( !attaches ) {
5187
+ doc.removeEventListener( orig, handler, true );
5188
+ jQuery._removeData( doc, fix );
5189
+ } else {
5190
+ jQuery._data( doc, fix, attaches );
5191
+ }
5192
+ }
5193
+ };
5194
+ });
5195
+ }
5196
+
5197
+ jQuery.fn.extend({
5198
+
5199
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5200
+ var type, origFn;
5201
+
5202
+ // Types can be a map of types/handlers
5203
+ if ( typeof types === "object" ) {
5204
+ // ( types-Object, selector, data )
5205
+ if ( typeof selector !== "string" ) {
5206
+ // ( types-Object, data )
5207
+ data = data || selector;
5208
+ selector = undefined;
5209
+ }
5210
+ for ( type in types ) {
5211
+ this.on( type, selector, data, types[ type ], one );
5212
+ }
5213
+ return this;
5214
+ }
5215
+
5216
+ if ( data == null && fn == null ) {
5217
+ // ( types, fn )
5218
+ fn = selector;
5219
+ data = selector = undefined;
5220
+ } else if ( fn == null ) {
5221
+ if ( typeof selector === "string" ) {
5222
+ // ( types, selector, fn )
5223
+ fn = data;
5224
+ data = undefined;
5225
+ } else {
5226
+ // ( types, data, fn )
5227
+ fn = data;
5228
+ data = selector;
5229
+ selector = undefined;
5230
+ }
5231
+ }
5232
+ if ( fn === false ) {
5233
+ fn = returnFalse;
5234
+ } else if ( !fn ) {
5235
+ return this;
5236
+ }
5237
+
5238
+ if ( one === 1 ) {
5239
+ origFn = fn;
5240
+ fn = function( event ) {
5241
+ // Can use an empty set, since event contains the info
5242
+ jQuery().off( event );
5243
+ return origFn.apply( this, arguments );
5244
+ };
5245
+ // Use same guid so caller can remove using origFn
5246
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5247
+ }
5248
+ return this.each( function() {
5249
+ jQuery.event.add( this, types, fn, data, selector );
5250
+ });
5251
+ },
5252
+ one: function( types, selector, data, fn ) {
5253
+ return this.on( types, selector, data, fn, 1 );
5254
+ },
5255
+ off: function( types, selector, fn ) {
5256
+ var handleObj, type;
5257
+ if ( types && types.preventDefault && types.handleObj ) {
5258
+ // ( event ) dispatched jQuery.Event
5259
+ handleObj = types.handleObj;
5260
+ jQuery( types.delegateTarget ).off(
5261
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5262
+ handleObj.selector,
5263
+ handleObj.handler
5264
+ );
5265
+ return this;
5266
+ }
5267
+ if ( typeof types === "object" ) {
5268
+ // ( types-object [, selector] )
5269
+ for ( type in types ) {
5270
+ this.off( type, selector, types[ type ] );
5271
+ }
5272
+ return this;
5273
+ }
5274
+ if ( selector === false || typeof selector === "function" ) {
5275
+ // ( types [, fn] )
5276
+ fn = selector;
5277
+ selector = undefined;
5278
+ }
5279
+ if ( fn === false ) {
5280
+ fn = returnFalse;
5281
+ }
5282
+ return this.each(function() {
5283
+ jQuery.event.remove( this, types, fn, selector );
5284
+ });
5285
+ },
5286
+
5287
+ trigger: function( type, data ) {
5288
+ return this.each(function() {
5289
+ jQuery.event.trigger( type, data, this );
5290
+ });
5291
+ },
5292
+ triggerHandler: function( type, data ) {
5293
+ var elem = this[0];
5294
+ if ( elem ) {
5295
+ return jQuery.event.trigger( type, data, elem, true );
5296
+ }
5297
+ }
5298
+ });
5299
+
5300
+
5301
+ function createSafeFragment( document ) {
5302
+ var list = nodeNames.split( "|" ),
5303
+ safeFrag = document.createDocumentFragment();
5304
+
5305
+ if ( safeFrag.createElement ) {
5306
+ while ( list.length ) {
5307
+ safeFrag.createElement(
5308
+ list.pop()
5309
+ );
5310
+ }
5311
+ }
5312
+ return safeFrag;
5313
+ }
5314
+
5315
+ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5316
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5317
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5318
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5319
+ rleadingWhitespace = /^\s+/,
5320
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5321
+ rtagName = /<([\w:]+)/,
5322
+ rtbody = /<tbody/i,
5323
+ rhtml = /<|&#?\w+;/,
5324
+ rnoInnerhtml = /<(?:script|style|link)/i,
5325
+ // checked="checked" or checked
5326
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5327
+ rscriptType = /^$|\/(?:java|ecma)script/i,
5328
+ rscriptTypeMasked = /^true\/(.*)/,
5329
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5330
+
5331
+ // We have to close these tags to support XHTML (#13200)
5332
+ wrapMap = {
5333
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
5334
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
5335
+ area: [ 1, "<map>", "</map>" ],
5336
+ param: [ 1, "<object>", "</object>" ],
5337
+ thead: [ 1, "<table>", "</table>" ],
5338
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5339
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5340
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5341
+
5342
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5343
+ // unless wrapped in a div with non-breaking characters in front of it.
5344
+ _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5345
+ },
5346
+ safeFragment = createSafeFragment( document ),
5347
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5348
+
5349
+ wrapMap.optgroup = wrapMap.option;
5350
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5351
+ wrapMap.th = wrapMap.td;
5352
+
5353
+ function getAll( context, tag ) {
5354
+ var elems, elem,
5355
+ i = 0,
5356
+ found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
5357
+ typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
5358
+ undefined;
5359
+
5360
+ if ( !found ) {
5361
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5362
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
5363
+ found.push( elem );
5364
+ } else {
5365
+ jQuery.merge( found, getAll( elem, tag ) );
5366
+ }
5367
+ }
5368
+ }
5369
+
5370
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5371
+ jQuery.merge( [ context ], found ) :
5372
+ found;
5373
+ }
5374
+
5375
+ // Used in buildFragment, fixes the defaultChecked property
5376
+ function fixDefaultChecked( elem ) {
5377
+ if ( rcheckableType.test( elem.type ) ) {
5378
+ elem.defaultChecked = elem.checked;
5379
+ }
5380
+ }
5381
+
5382
+ // Support: IE<8
5383
+ // Manipulating tables requires a tbody
5384
+ function manipulationTarget( elem, content ) {
5385
+ return jQuery.nodeName( elem, "table" ) &&
5386
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5387
+
5388
+ elem.getElementsByTagName("tbody")[0] ||
5389
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
5390
+ elem;
5391
+ }
5392
+
5393
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
5394
+ function disableScript( elem ) {
5395
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
5396
+ return elem;
5397
+ }
5398
+ function restoreScript( elem ) {
5399
+ var match = rscriptTypeMasked.exec( elem.type );
5400
+ if ( match ) {
5401
+ elem.type = match[1];
5402
+ } else {
5403
+ elem.removeAttribute("type");
5404
+ }
5405
+ return elem;
5406
+ }
5407
+
5408
+ // Mark scripts as having already been evaluated
5409
+ function setGlobalEval( elems, refElements ) {
5410
+ var elem,
5411
+ i = 0;
5412
+ for ( ; (elem = elems[i]) != null; i++ ) {
5413
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5414
+ }
5415
+ }
5416
+
5417
+ function cloneCopyEvent( src, dest ) {
5418
+
5419
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5420
+ return;
5421
+ }
5422
+
5423
+ var type, i, l,
5424
+ oldData = jQuery._data( src ),
5425
+ curData = jQuery._data( dest, oldData ),
5426
+ events = oldData.events;
5427
+
5428
+ if ( events ) {
5429
+ delete curData.handle;
5430
+ curData.events = {};
5431
+
5432
+ for ( type in events ) {
5433
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5434
+ jQuery.event.add( dest, type, events[ type ][ i ] );
5435
+ }
5436
+ }
5437
+ }
5438
+
5439
+ // make the cloned public data object a copy from the original
5440
+ if ( curData.data ) {
5441
+ curData.data = jQuery.extend( {}, curData.data );
5442
+ }
5443
+ }
5444
+
5445
+ function fixCloneNodeIssues( src, dest ) {
5446
+ var nodeName, e, data;
5447
+
5448
+ // We do not need to do anything for non-Elements
5449
+ if ( dest.nodeType !== 1 ) {
5450
+ return;
5451
+ }
5452
+
5453
+ nodeName = dest.nodeName.toLowerCase();
5454
+
5455
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
5456
+ if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5457
+ data = jQuery._data( dest );
5458
+
5459
+ for ( e in data.events ) {
5460
+ jQuery.removeEvent( dest, e, data.handle );
5461
+ }
5462
+
5463
+ // Event data gets referenced instead of copied if the expando gets copied too
5464
+ dest.removeAttribute( jQuery.expando );
5465
+ }
5466
+
5467
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5468
+ if ( nodeName === "script" && dest.text !== src.text ) {
5469
+ disableScript( dest ).text = src.text;
5470
+ restoreScript( dest );
5471
+
5472
+ // IE6-10 improperly clones children of object elements using classid.
5473
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
5474
+ } else if ( nodeName === "object" ) {
5475
+ if ( dest.parentNode ) {
5476
+ dest.outerHTML = src.outerHTML;
5477
+ }
5478
+
5479
+ // This path appears unavoidable for IE9. When cloning an object
5480
+ // element in IE9, the outerHTML strategy above is not sufficient.
5481
+ // If the src has innerHTML and the destination does not,
5482
+ // copy the src.innerHTML into the dest.innerHTML. #10324
5483
+ if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5484
+ dest.innerHTML = src.innerHTML;
5485
+ }
5486
+
5487
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5488
+ // IE6-8 fails to persist the checked state of a cloned checkbox
5489
+ // or radio button. Worse, IE6-7 fail to give the cloned element
5490
+ // a checked appearance if the defaultChecked value isn't also set
5491
+
5492
+ dest.defaultChecked = dest.checked = src.checked;
5493
+
5494
+ // IE6-7 get confused and end up setting the value of a cloned
5495
+ // checkbox/radio button to an empty string instead of "on"
5496
+ if ( dest.value !== src.value ) {
5497
+ dest.value = src.value;
5498
+ }
5499
+
5500
+ // IE6-8 fails to return the selected option to the default selected
5501
+ // state when cloning options
5502
+ } else if ( nodeName === "option" ) {
5503
+ dest.defaultSelected = dest.selected = src.defaultSelected;
5504
+
5505
+ // IE6-8 fails to set the defaultValue to the correct value when
5506
+ // cloning other types of input fields
5507
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
5508
+ dest.defaultValue = src.defaultValue;
5509
+ }
5510
+ }
5511
+
5512
+ jQuery.extend({
5513
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5514
+ var destElements, node, clone, i, srcElements,
5515
+ inPage = jQuery.contains( elem.ownerDocument, elem );
5516
+
5517
+ if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5518
+ clone = elem.cloneNode( true );
5519
+
5520
+ // IE<=8 does not properly clone detached, unknown element nodes
5521
+ } else {
5522
+ fragmentDiv.innerHTML = elem.outerHTML;
5523
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5524
+ }
5525
+
5526
+ if ( (!support.noCloneEvent || !support.noCloneChecked) &&
5527
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5528
+
5529
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5530
+ destElements = getAll( clone );
5531
+ srcElements = getAll( elem );
5532
+
5533
+ // Fix all IE cloning issues
5534
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5535
+ // Ensure that the destination node is not null; Fixes #9587
5536
+ if ( destElements[i] ) {
5537
+ fixCloneNodeIssues( node, destElements[i] );
5538
+ }
5539
+ }
5540
+ }
5541
+
5542
+ // Copy the events from the original to the clone
5543
+ if ( dataAndEvents ) {
5544
+ if ( deepDataAndEvents ) {
5545
+ srcElements = srcElements || getAll( elem );
5546
+ destElements = destElements || getAll( clone );
5547
+
5548
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5549
+ cloneCopyEvent( node, destElements[i] );
5550
+ }
5551
+ } else {
5552
+ cloneCopyEvent( elem, clone );
5553
+ }
5554
+ }
5555
+
5556
+ // Preserve script evaluation history
5557
+ destElements = getAll( clone, "script" );
5558
+ if ( destElements.length > 0 ) {
5559
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5560
+ }
5561
+
5562
+ destElements = srcElements = node = null;
5563
+
5564
+ // Return the cloned set
5565
+ return clone;
5566
+ },
5567
+
5568
+ buildFragment: function( elems, context, scripts, selection ) {
5569
+ var j, elem, contains,
5570
+ tmp, tag, tbody, wrap,
5571
+ l = elems.length,
5572
+
5573
+ // Ensure a safe fragment
5574
+ safe = createSafeFragment( context ),
5575
+
5576
+ nodes = [],
5577
+ i = 0;
5578
+
5579
+ for ( ; i < l; i++ ) {
5580
+ elem = elems[ i ];
5581
+
5582
+ if ( elem || elem === 0 ) {
5583
+
5584
+ // Add nodes directly
5585
+ if ( jQuery.type( elem ) === "object" ) {
5586
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5587
+
5588
+ // Convert non-html into a text node
5589
+ } else if ( !rhtml.test( elem ) ) {
5590
+ nodes.push( context.createTextNode( elem ) );
5591
+
5592
+ // Convert html into DOM nodes
5593
+ } else {
5594
+ tmp = tmp || safe.appendChild( context.createElement("div") );
5595
+
5596
+ // Deserialize a standard representation
5597
+ tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
5598
+ wrap = wrapMap[ tag ] || wrapMap._default;
5599
+
5600
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5601
+
5602
+ // Descend through wrappers to the right content
5603
+ j = wrap[0];
5604
+ while ( j-- ) {
5605
+ tmp = tmp.lastChild;
5606
+ }
5607
+
5608
+ // Manually add leading whitespace removed by IE
5609
+ if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5610
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5611
+ }
5612
+
5613
+ // Remove IE's autoinserted <tbody> from table fragments
5614
+ if ( !support.tbody ) {
5615
+
5616
+ // String was a <table>, *may* have spurious <tbody>
5617
+ elem = tag === "table" && !rtbody.test( elem ) ?
5618
+ tmp.firstChild :
5619
+
5620
+ // String was a bare <thead> or <tfoot>
5621
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
5622
+ tmp :
5623
+ 0;
5624
+
5625
+ j = elem && elem.childNodes.length;
5626
+ while ( j-- ) {
5627
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5628
+ elem.removeChild( tbody );
5629
+ }
5630
+ }
5631
+ }
5632
+
5633
+ jQuery.merge( nodes, tmp.childNodes );
5634
+
5635
+ // Fix #12392 for WebKit and IE > 9
5636
+ tmp.textContent = "";
5637
+
5638
+ // Fix #12392 for oldIE
5639
+ while ( tmp.firstChild ) {
5640
+ tmp.removeChild( tmp.firstChild );
5641
+ }
5642
+
5643
+ // Remember the top-level container for proper cleanup
5644
+ tmp = safe.lastChild;
5645
+ }
5646
+ }
5647
+ }
5648
+
5649
+ // Fix #11356: Clear elements from fragment
5650
+ if ( tmp ) {
5651
+ safe.removeChild( tmp );
5652
+ }
5653
+
5654
+ // Reset defaultChecked for any radios and checkboxes
5655
+ // about to be appended to the DOM in IE 6/7 (#8060)
5656
+ if ( !support.appendChecked ) {
5657
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5658
+ }
5659
+
5660
+ i = 0;
5661
+ while ( (elem = nodes[ i++ ]) ) {
5662
+
5663
+ // #4087 - If origin and destination elements are the same, and this is
5664
+ // that element, do not do anything
5665
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5666
+ continue;
5667
+ }
5668
+
5669
+ contains = jQuery.contains( elem.ownerDocument, elem );
5670
+
5671
+ // Append to fragment
5672
+ tmp = getAll( safe.appendChild( elem ), "script" );
5673
+
5674
+ // Preserve script evaluation history
5675
+ if ( contains ) {
5676
+ setGlobalEval( tmp );
5677
+ }
5678
+
5679
+ // Capture executables
5680
+ if ( scripts ) {
5681
+ j = 0;
5682
+ while ( (elem = tmp[ j++ ]) ) {
5683
+ if ( rscriptType.test( elem.type || "" ) ) {
5684
+ scripts.push( elem );
5685
+ }
5686
+ }
5687
+ }
5688
+ }
5689
+
5690
+ tmp = null;
5691
+
5692
+ return safe;
5693
+ },
5694
+
5695
+ cleanData: function( elems, /* internal */ acceptData ) {
5696
+ var elem, type, id, data,
5697
+ i = 0,
5698
+ internalKey = jQuery.expando,
5699
+ cache = jQuery.cache,
5700
+ deleteExpando = support.deleteExpando,
5701
+ special = jQuery.event.special;
5702
+
5703
+ for ( ; (elem = elems[i]) != null; i++ ) {
5704
+ if ( acceptData || jQuery.acceptData( elem ) ) {
5705
+
5706
+ id = elem[ internalKey ];
5707
+ data = id && cache[ id ];
5708
+
5709
+ if ( data ) {
5710
+ if ( data.events ) {
5711
+ for ( type in data.events ) {
5712
+ if ( special[ type ] ) {
5713
+ jQuery.event.remove( elem, type );
5714
+
5715
+ // This is a shortcut to avoid jQuery.event.remove's overhead
5716
+ } else {
5717
+ jQuery.removeEvent( elem, type, data.handle );
5718
+ }
5719
+ }
5720
+ }
5721
+
5722
+ // Remove cache only if it was not already removed by jQuery.event.remove
5723
+ if ( cache[ id ] ) {
5724
+
5725
+ delete cache[ id ];
5726
+
5727
+ // IE does not allow us to delete expando properties from nodes,
5728
+ // nor does it have a removeAttribute function on Document nodes;
5729
+ // we must handle all of these cases
5730
+ if ( deleteExpando ) {
5731
+ delete elem[ internalKey ];
5732
+
5733
+ } else if ( typeof elem.removeAttribute !== strundefined ) {
5734
+ elem.removeAttribute( internalKey );
5735
+
5736
+ } else {
5737
+ elem[ internalKey ] = null;
5738
+ }
5739
+
5740
+ deletedIds.push( id );
5741
+ }
5742
+ }
5743
+ }
5744
+ }
5745
+ }
5746
+ });
5747
+
5748
+ jQuery.fn.extend({
5749
+ text: function( value ) {
5750
+ return access( this, function( value ) {
5751
+ return value === undefined ?
5752
+ jQuery.text( this ) :
5753
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5754
+ }, null, value, arguments.length );
5755
+ },
5756
+
5757
+ append: function() {
5758
+ return this.domManip( arguments, function( elem ) {
5759
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5760
+ var target = manipulationTarget( this, elem );
5761
+ target.appendChild( elem );
5762
+ }
5763
+ });
5764
+ },
5765
+
5766
+ prepend: function() {
5767
+ return this.domManip( arguments, function( elem ) {
5768
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5769
+ var target = manipulationTarget( this, elem );
5770
+ target.insertBefore( elem, target.firstChild );
5771
+ }
5772
+ });
5773
+ },
5774
+
5775
+ before: function() {
5776
+ return this.domManip( arguments, function( elem ) {
5777
+ if ( this.parentNode ) {
5778
+ this.parentNode.insertBefore( elem, this );
5779
+ }
5780
+ });
5781
+ },
5782
+
5783
+ after: function() {
5784
+ return this.domManip( arguments, function( elem ) {
5785
+ if ( this.parentNode ) {
5786
+ this.parentNode.insertBefore( elem, this.nextSibling );
5787
+ }
5788
+ });
5789
+ },
5790
+
5791
+ remove: function( selector, keepData /* Internal Use Only */ ) {
5792
+ var elem,
5793
+ elems = selector ? jQuery.filter( selector, this ) : this,
5794
+ i = 0;
5795
+
5796
+ for ( ; (elem = elems[i]) != null; i++ ) {
5797
+
5798
+ if ( !keepData && elem.nodeType === 1 ) {
5799
+ jQuery.cleanData( getAll( elem ) );
5800
+ }
5801
+
5802
+ if ( elem.parentNode ) {
5803
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5804
+ setGlobalEval( getAll( elem, "script" ) );
5805
+ }
5806
+ elem.parentNode.removeChild( elem );
5807
+ }
5808
+ }
5809
+
5810
+ return this;
5811
+ },
5812
+
5813
+ empty: function() {
5814
+ var elem,
5815
+ i = 0;
5816
+
5817
+ for ( ; (elem = this[i]) != null; i++ ) {
5818
+ // Remove element nodes and prevent memory leaks
5819
+ if ( elem.nodeType === 1 ) {
5820
+ jQuery.cleanData( getAll( elem, false ) );
5821
+ }
5822
+
5823
+ // Remove any remaining nodes
5824
+ while ( elem.firstChild ) {
5825
+ elem.removeChild( elem.firstChild );
5826
+ }
5827
+
5828
+ // If this is a select, ensure that it displays empty (#12336)
5829
+ // Support: IE<9
5830
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5831
+ elem.options.length = 0;
5832
+ }
5833
+ }
5834
+
5835
+ return this;
5836
+ },
5837
+
5838
+ clone: function( dataAndEvents, deepDataAndEvents ) {
5839
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5840
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5841
+
5842
+ return this.map(function() {
5843
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5844
+ });
5845
+ },
5846
+
5847
+ html: function( value ) {
5848
+ return access( this, function( value ) {
5849
+ var elem = this[ 0 ] || {},
5850
+ i = 0,
5851
+ l = this.length;
5852
+
5853
+ if ( value === undefined ) {
5854
+ return elem.nodeType === 1 ?
5855
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
5856
+ undefined;
5857
+ }
5858
+
5859
+ // See if we can take a shortcut and just use innerHTML
5860
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5861
+ ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
5862
+ ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5863
+ !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
5864
+
5865
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
5866
+
5867
+ try {
5868
+ for (; i < l; i++ ) {
5869
+ // Remove element nodes and prevent memory leaks
5870
+ elem = this[i] || {};
5871
+ if ( elem.nodeType === 1 ) {
5872
+ jQuery.cleanData( getAll( elem, false ) );
5873
+ elem.innerHTML = value;
5874
+ }
5875
+ }
5876
+
5877
+ elem = 0;
5878
+
5879
+ // If using innerHTML throws an exception, use the fallback method
5880
+ } catch(e) {}
5881
+ }
5882
+
5883
+ if ( elem ) {
5884
+ this.empty().append( value );
5885
+ }
5886
+ }, null, value, arguments.length );
5887
+ },
5888
+
5889
+ replaceWith: function() {
5890
+ var arg = arguments[ 0 ];
5891
+
5892
+ // Make the changes, replacing each context element with the new content
5893
+ this.domManip( arguments, function( elem ) {
5894
+ arg = this.parentNode;
5895
+
5896
+ jQuery.cleanData( getAll( this ) );
5897
+
5898
+ if ( arg ) {
5899
+ arg.replaceChild( elem, this );
5900
+ }
5901
+ });
5902
+
5903
+ // Force removal if there was no new content (e.g., from empty arguments)
5904
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
5905
+ },
5906
+
5907
+ detach: function( selector ) {
5908
+ return this.remove( selector, true );
5909
+ },
5910
+
5911
+ domManip: function( args, callback ) {
5912
+
5913
+ // Flatten any nested arrays
5914
+ args = concat.apply( [], args );
5915
+
5916
+ var first, node, hasScripts,
5917
+ scripts, doc, fragment,
5918
+ i = 0,
5919
+ l = this.length,
5920
+ set = this,
5921
+ iNoClone = l - 1,
5922
+ value = args[0],
5923
+ isFunction = jQuery.isFunction( value );
5924
+
5925
+ // We can't cloneNode fragments that contain checked, in WebKit
5926
+ if ( isFunction ||
5927
+ ( l > 1 && typeof value === "string" &&
5928
+ !support.checkClone && rchecked.test( value ) ) ) {
5929
+ return this.each(function( index ) {
5930
+ var self = set.eq( index );
5931
+ if ( isFunction ) {
5932
+ args[0] = value.call( this, index, self.html() );
5933
+ }
5934
+ self.domManip( args, callback );
5935
+ });
5936
+ }
5937
+
5938
+ if ( l ) {
5939
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5940
+ first = fragment.firstChild;
5941
+
5942
+ if ( fragment.childNodes.length === 1 ) {
5943
+ fragment = first;
5944
+ }
5945
+
5946
+ if ( first ) {
5947
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5948
+ hasScripts = scripts.length;
5949
+
5950
+ // Use the original fragment for the last item instead of the first because it can end up
5951
+ // being emptied incorrectly in certain situations (#8070).
5952
+ for ( ; i < l; i++ ) {
5953
+ node = fragment;
5954
+
5955
+ if ( i !== iNoClone ) {
5956
+ node = jQuery.clone( node, true, true );
5957
+
5958
+ // Keep references to cloned scripts for later restoration
5959
+ if ( hasScripts ) {
5960
+ jQuery.merge( scripts, getAll( node, "script" ) );
5961
+ }
5962
+ }
5963
+
5964
+ callback.call( this[i], node, i );
5965
+ }
5966
+
5967
+ if ( hasScripts ) {
5968
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
5969
+
5970
+ // Reenable scripts
5971
+ jQuery.map( scripts, restoreScript );
5972
+
5973
+ // Evaluate executable scripts on first document insertion
5974
+ for ( i = 0; i < hasScripts; i++ ) {
5975
+ node = scripts[ i ];
5976
+ if ( rscriptType.test( node.type || "" ) &&
5977
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5978
+
5979
+ if ( node.src ) {
5980
+ // Optional AJAX dependency, but won't run scripts if not present
5981
+ if ( jQuery._evalUrl ) {
5982
+ jQuery._evalUrl( node.src );
5983
+ }
5984
+ } else {
5985
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5986
+ }
5987
+ }
5988
+ }
5989
+ }
5990
+
5991
+ // Fix #11809: Avoid leaking memory
5992
+ fragment = first = null;
5993
+ }
5994
+ }
5995
+
5996
+ return this;
5997
+ }
5998
+ });
5999
+
6000
+ jQuery.each({
6001
+ appendTo: "append",
6002
+ prependTo: "prepend",
6003
+ insertBefore: "before",
6004
+ insertAfter: "after",
6005
+ replaceAll: "replaceWith"
6006
+ }, function( name, original ) {
6007
+ jQuery.fn[ name ] = function( selector ) {
6008
+ var elems,
6009
+ i = 0,
6010
+ ret = [],
6011
+ insert = jQuery( selector ),
6012
+ last = insert.length - 1;
6013
+
6014
+ for ( ; i <= last; i++ ) {
6015
+ elems = i === last ? this : this.clone(true);
6016
+ jQuery( insert[i] )[ original ]( elems );
6017
+
6018
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6019
+ push.apply( ret, elems.get() );
6020
+ }
6021
+
6022
+ return this.pushStack( ret );
6023
+ };
6024
+ });
6025
+
6026
+
6027
+ var iframe,
6028
+ elemdisplay = {};
6029
+
6030
+ /**
6031
+ * Retrieve the actual display of a element
6032
+ * @param {String} name nodeName of the element
6033
+ * @param {Object} doc Document object
6034
+ */
6035
+ // Called only from within defaultDisplay
6036
+ function actualDisplay( name, doc ) {
6037
+ var style,
6038
+ elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6039
+
6040
+ // getDefaultComputedStyle might be reliably used only on attached element
6041
+ display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
6042
+
6043
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
6044
+ // since it was removed from specification and supported only in FF
6045
+ style.display : jQuery.css( elem[ 0 ], "display" );
6046
+
6047
+ // We don't have any data stored on the element,
6048
+ // so use "detach" method as fast way to get rid of the element
6049
+ elem.detach();
6050
+
6051
+ return display;
6052
+ }
6053
+
6054
+ /**
6055
+ * Try to determine the default display value of an element
6056
+ * @param {String} nodeName
6057
+ */
6058
+ function defaultDisplay( nodeName ) {
6059
+ var doc = document,
6060
+ display = elemdisplay[ nodeName ];
6061
+
6062
+ if ( !display ) {
6063
+ display = actualDisplay( nodeName, doc );
6064
+
6065
+ // If the simple way fails, read from inside an iframe
6066
+ if ( display === "none" || !display ) {
6067
+
6068
+ // Use the already-created iframe if possible
6069
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6070
+
6071
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6072
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6073
+
6074
+ // Support: IE
6075
+ doc.write();
6076
+ doc.close();
6077
+
6078
+ display = actualDisplay( nodeName, doc );
6079
+ iframe.detach();
6080
+ }
6081
+
6082
+ // Store the correct default display
6083
+ elemdisplay[ nodeName ] = display;
6084
+ }
6085
+
6086
+ return display;
6087
+ }
6088
+
6089
+
6090
+ (function() {
6091
+ var shrinkWrapBlocksVal;
6092
+
6093
+ support.shrinkWrapBlocks = function() {
6094
+ if ( shrinkWrapBlocksVal != null ) {
6095
+ return shrinkWrapBlocksVal;
6096
+ }
6097
+
6098
+ // Will be changed later if needed.
6099
+ shrinkWrapBlocksVal = false;
6100
+
6101
+ // Minified: var b,c,d
6102
+ var div, body, container;
6103
+
6104
+ body = document.getElementsByTagName( "body" )[ 0 ];
6105
+ if ( !body || !body.style ) {
6106
+ // Test fired too early or in an unsupported environment, exit.
6107
+ return;
6108
+ }
6109
+
6110
+ // Setup
6111
+ div = document.createElement( "div" );
6112
+ container = document.createElement( "div" );
6113
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6114
+ body.appendChild( container ).appendChild( div );
6115
+
6116
+ // Support: IE6
6117
+ // Check if elements with layout shrink-wrap their children
6118
+ if ( typeof div.style.zoom !== strundefined ) {
6119
+ // Reset CSS: box-sizing; display; margin; border
6120
+ div.style.cssText =
6121
+ // Support: Firefox<29, Android 2.3
6122
+ // Vendor-prefix box-sizing
6123
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6124
+ "box-sizing:content-box;display:block;margin:0;border:0;" +
6125
+ "padding:1px;width:1px;zoom:1";
6126
+ div.appendChild( document.createElement( "div" ) ).style.width = "5px";
6127
+ shrinkWrapBlocksVal = div.offsetWidth !== 3;
6128
+ }
6129
+
6130
+ body.removeChild( container );
6131
+
6132
+ return shrinkWrapBlocksVal;
6133
+ };
6134
+
6135
+ })();
6136
+ var rmargin = (/^margin/);
6137
+
6138
+ var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6139
+
6140
+
6141
+
6142
+ var getStyles, curCSS,
6143
+ rposition = /^(top|right|bottom|left)$/;
6144
+
6145
+ if ( window.getComputedStyle ) {
6146
+ getStyles = function( elem ) {
6147
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
6148
+ // IE throws on elements created in popups
6149
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6150
+ if ( elem.ownerDocument.defaultView.opener ) {
6151
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
6152
+ }
6153
+
6154
+ return window.getComputedStyle( elem, null );
6155
+ };
6156
+
6157
+ curCSS = function( elem, name, computed ) {
6158
+ var width, minWidth, maxWidth, ret,
6159
+ style = elem.style;
6160
+
6161
+ computed = computed || getStyles( elem );
6162
+
6163
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6164
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6165
+
6166
+ if ( computed ) {
6167
+
6168
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6169
+ ret = jQuery.style( elem, name );
6170
+ }
6171
+
6172
+ // A tribute to the "awesome hack by Dean Edwards"
6173
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6174
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6175
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6176
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6177
+
6178
+ // Remember the original values
6179
+ width = style.width;
6180
+ minWidth = style.minWidth;
6181
+ maxWidth = style.maxWidth;
6182
+
6183
+ // Put in the new values to get a computed value out
6184
+ style.minWidth = style.maxWidth = style.width = ret;
6185
+ ret = computed.width;
6186
+
6187
+ // Revert the changed values
6188
+ style.width = width;
6189
+ style.minWidth = minWidth;
6190
+ style.maxWidth = maxWidth;
6191
+ }
6192
+ }
6193
+
6194
+ // Support: IE
6195
+ // IE returns zIndex value as an integer.
6196
+ return ret === undefined ?
6197
+ ret :
6198
+ ret + "";
6199
+ };
6200
+ } else if ( document.documentElement.currentStyle ) {
6201
+ getStyles = function( elem ) {
6202
+ return elem.currentStyle;
6203
+ };
6204
+
6205
+ curCSS = function( elem, name, computed ) {
6206
+ var left, rs, rsLeft, ret,
6207
+ style = elem.style;
6208
+
6209
+ computed = computed || getStyles( elem );
6210
+ ret = computed ? computed[ name ] : undefined;
6211
+
6212
+ // Avoid setting ret to empty string here
6213
+ // so we don't default to auto
6214
+ if ( ret == null && style && style[ name ] ) {
6215
+ ret = style[ name ];
6216
+ }
6217
+
6218
+ // From the awesome hack by Dean Edwards
6219
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6220
+
6221
+ // If we're not dealing with a regular pixel number
6222
+ // but a number that has a weird ending, we need to convert it to pixels
6223
+ // but not position css attributes, as those are proportional to the parent element instead
6224
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6225
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6226
+
6227
+ // Remember the original values
6228
+ left = style.left;
6229
+ rs = elem.runtimeStyle;
6230
+ rsLeft = rs && rs.left;
6231
+
6232
+ // Put in the new values to get a computed value out
6233
+ if ( rsLeft ) {
6234
+ rs.left = elem.currentStyle.left;
6235
+ }
6236
+ style.left = name === "fontSize" ? "1em" : ret;
6237
+ ret = style.pixelLeft + "px";
6238
+
6239
+ // Revert the changed values
6240
+ style.left = left;
6241
+ if ( rsLeft ) {
6242
+ rs.left = rsLeft;
6243
+ }
6244
+ }
6245
+
6246
+ // Support: IE
6247
+ // IE returns zIndex value as an integer.
6248
+ return ret === undefined ?
6249
+ ret :
6250
+ ret + "" || "auto";
6251
+ };
6252
+ }
6253
+
6254
+
6255
+
6256
+
6257
+ function addGetHookIf( conditionFn, hookFn ) {
6258
+ // Define the hook, we'll check on the first run if it's really needed.
6259
+ return {
6260
+ get: function() {
6261
+ var condition = conditionFn();
6262
+
6263
+ if ( condition == null ) {
6264
+ // The test was not ready at this point; screw the hook this time
6265
+ // but check again when needed next time.
6266
+ return;
6267
+ }
6268
+
6269
+ if ( condition ) {
6270
+ // Hook not needed (or it's not possible to use it due to missing dependency),
6271
+ // remove it.
6272
+ // Since there are no other hooks for marginRight, remove the whole object.
6273
+ delete this.get;
6274
+ return;
6275
+ }
6276
+
6277
+ // Hook needed; redefine it so that the support test is not executed again.
6278
+
6279
+ return (this.get = hookFn).apply( this, arguments );
6280
+ }
6281
+ };
6282
+ }
6283
+
6284
+
6285
+ (function() {
6286
+ // Minified: var b,c,d,e,f,g, h,i
6287
+ var div, style, a, pixelPositionVal, boxSizingReliableVal,
6288
+ reliableHiddenOffsetsVal, reliableMarginRightVal;
6289
+
6290
+ // Setup
6291
+ div = document.createElement( "div" );
6292
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6293
+ a = div.getElementsByTagName( "a" )[ 0 ];
6294
+ style = a && a.style;
6295
+
6296
+ // Finish early in limited (non-browser) environments
6297
+ if ( !style ) {
6298
+ return;
6299
+ }
6300
+
6301
+ style.cssText = "float:left;opacity:.5";
6302
+
6303
+ // Support: IE<9
6304
+ // Make sure that element opacity exists (as opposed to filter)
6305
+ support.opacity = style.opacity === "0.5";
6306
+
6307
+ // Verify style float existence
6308
+ // (IE uses styleFloat instead of cssFloat)
6309
+ support.cssFloat = !!style.cssFloat;
6310
+
6311
+ div.style.backgroundClip = "content-box";
6312
+ div.cloneNode( true ).style.backgroundClip = "";
6313
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
6314
+
6315
+ // Support: Firefox<29, Android 2.3
6316
+ // Vendor-prefix box-sizing
6317
+ support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
6318
+ style.WebkitBoxSizing === "";
6319
+
6320
+ jQuery.extend(support, {
6321
+ reliableHiddenOffsets: function() {
6322
+ if ( reliableHiddenOffsetsVal == null ) {
6323
+ computeStyleTests();
6324
+ }
6325
+ return reliableHiddenOffsetsVal;
6326
+ },
6327
+
6328
+ boxSizingReliable: function() {
6329
+ if ( boxSizingReliableVal == null ) {
6330
+ computeStyleTests();
6331
+ }
6332
+ return boxSizingReliableVal;
6333
+ },
6334
+
6335
+ pixelPosition: function() {
6336
+ if ( pixelPositionVal == null ) {
6337
+ computeStyleTests();
6338
+ }
6339
+ return pixelPositionVal;
6340
+ },
6341
+
6342
+ // Support: Android 2.3
6343
+ reliableMarginRight: function() {
6344
+ if ( reliableMarginRightVal == null ) {
6345
+ computeStyleTests();
6346
+ }
6347
+ return reliableMarginRightVal;
6348
+ }
6349
+ });
6350
+
6351
+ function computeStyleTests() {
6352
+ // Minified: var b,c,d,j
6353
+ var div, body, container, contents;
6354
+
6355
+ body = document.getElementsByTagName( "body" )[ 0 ];
6356
+ if ( !body || !body.style ) {
6357
+ // Test fired too early or in an unsupported environment, exit.
6358
+ return;
6359
+ }
6360
+
6361
+ // Setup
6362
+ div = document.createElement( "div" );
6363
+ container = document.createElement( "div" );
6364
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6365
+ body.appendChild( container ).appendChild( div );
6366
+
6367
+ div.style.cssText =
6368
+ // Support: Firefox<29, Android 2.3
6369
+ // Vendor-prefix box-sizing
6370
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
6371
+ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
6372
+ "border:1px;padding:1px;width:4px;position:absolute";
6373
+
6374
+ // Support: IE<9
6375
+ // Assume reasonable values in the absence of getComputedStyle
6376
+ pixelPositionVal = boxSizingReliableVal = false;
6377
+ reliableMarginRightVal = true;
6378
+
6379
+ // Check for getComputedStyle so that this code is not run in IE<9.
6380
+ if ( window.getComputedStyle ) {
6381
+ pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
6382
+ boxSizingReliableVal =
6383
+ ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
6384
+
6385
+ // Support: Android 2.3
6386
+ // Div with explicit width and no margin-right incorrectly
6387
+ // gets computed margin-right based on width of container (#3333)
6388
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6389
+ contents = div.appendChild( document.createElement( "div" ) );
6390
+
6391
+ // Reset CSS: box-sizing; display; margin; border; padding
6392
+ contents.style.cssText = div.style.cssText =
6393
+ // Support: Firefox<29, Android 2.3
6394
+ // Vendor-prefix box-sizing
6395
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6396
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
6397
+ contents.style.marginRight = contents.style.width = "0";
6398
+ div.style.width = "1px";
6399
+
6400
+ reliableMarginRightVal =
6401
+ !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
6402
+
6403
+ div.removeChild( contents );
6404
+ }
6405
+
6406
+ // Support: IE8
6407
+ // Check if table cells still have offsetWidth/Height when they are set
6408
+ // to display:none and there are still other visible table cells in a
6409
+ // table row; if so, offsetWidth/Height are not reliable for use when
6410
+ // determining if an element has been hidden directly using
6411
+ // display:none (it is still safe to use offsets if a parent element is
6412
+ // hidden; don safety goggles and see bug #4512 for more information).
6413
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6414
+ contents = div.getElementsByTagName( "td" );
6415
+ contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
6416
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6417
+ if ( reliableHiddenOffsetsVal ) {
6418
+ contents[ 0 ].style.display = "";
6419
+ contents[ 1 ].style.display = "none";
6420
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6421
+ }
6422
+
6423
+ body.removeChild( container );
6424
+ }
6425
+
6426
+ })();
6427
+
6428
+
6429
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
6430
+ jQuery.swap = function( elem, options, callback, args ) {
6431
+ var ret, name,
6432
+ old = {};
6433
+
6434
+ // Remember the old values, and insert the new ones
6435
+ for ( name in options ) {
6436
+ old[ name ] = elem.style[ name ];
6437
+ elem.style[ name ] = options[ name ];
6438
+ }
6439
+
6440
+ ret = callback.apply( elem, args || [] );
6441
+
6442
+ // Revert the old values
6443
+ for ( name in options ) {
6444
+ elem.style[ name ] = old[ name ];
6445
+ }
6446
+
6447
+ return ret;
6448
+ };
6449
+
6450
+
6451
+ var
6452
+ ralpha = /alpha\([^)]*\)/i,
6453
+ ropacity = /opacity\s*=\s*([^)]*)/,
6454
+
6455
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6456
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6457
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6458
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6459
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
6460
+
6461
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6462
+ cssNormalTransform = {
6463
+ letterSpacing: "0",
6464
+ fontWeight: "400"
6465
+ },
6466
+
6467
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6468
+
6469
+
6470
+ // return a css property mapped to a potentially vendor prefixed property
6471
+ function vendorPropName( style, name ) {
6472
+
6473
+ // shortcut for names that are not vendor prefixed
6474
+ if ( name in style ) {
6475
+ return name;
6476
+ }
6477
+
6478
+ // check for vendor prefixed names
6479
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
6480
+ origName = name,
6481
+ i = cssPrefixes.length;
6482
+
6483
+ while ( i-- ) {
6484
+ name = cssPrefixes[ i ] + capName;
6485
+ if ( name in style ) {
6486
+ return name;
6487
+ }
6488
+ }
6489
+
6490
+ return origName;
6491
+ }
6492
+
6493
+ function showHide( elements, show ) {
6494
+ var display, elem, hidden,
6495
+ values = [],
6496
+ index = 0,
6497
+ length = elements.length;
6498
+
6499
+ for ( ; index < length; index++ ) {
6500
+ elem = elements[ index ];
6501
+ if ( !elem.style ) {
6502
+ continue;
6503
+ }
6504
+
6505
+ values[ index ] = jQuery._data( elem, "olddisplay" );
6506
+ display = elem.style.display;
6507
+ if ( show ) {
6508
+ // Reset the inline display of this element to learn if it is
6509
+ // being hidden by cascaded rules or not
6510
+ if ( !values[ index ] && display === "none" ) {
6511
+ elem.style.display = "";
6512
+ }
6513
+
6514
+ // Set elements which have been overridden with display: none
6515
+ // in a stylesheet to whatever the default browser style is
6516
+ // for such an element
6517
+ if ( elem.style.display === "" && isHidden( elem ) ) {
6518
+ values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
6519
+ }
6520
+ } else {
6521
+ hidden = isHidden( elem );
6522
+
6523
+ if ( display && display !== "none" || !hidden ) {
6524
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6525
+ }
6526
+ }
6527
+ }
6528
+
6529
+ // Set the display of most of the elements in a second loop
6530
+ // to avoid the constant reflow
6531
+ for ( index = 0; index < length; index++ ) {
6532
+ elem = elements[ index ];
6533
+ if ( !elem.style ) {
6534
+ continue;
6535
+ }
6536
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6537
+ elem.style.display = show ? values[ index ] || "" : "none";
6538
+ }
6539
+ }
6540
+
6541
+ return elements;
6542
+ }
6543
+
6544
+ function setPositiveNumber( elem, value, subtract ) {
6545
+ var matches = rnumsplit.exec( value );
6546
+ return matches ?
6547
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
6548
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6549
+ value;
6550
+ }
6551
+
6552
+ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6553
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
6554
+ // If we already have the right measurement, avoid augmentation
6555
+ 4 :
6556
+ // Otherwise initialize for horizontal or vertical properties
6557
+ name === "width" ? 1 : 0,
6558
+
6559
+ val = 0;
6560
+
6561
+ for ( ; i < 4; i += 2 ) {
6562
+ // both box models exclude margin, so add it if we want it
6563
+ if ( extra === "margin" ) {
6564
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6565
+ }
6566
+
6567
+ if ( isBorderBox ) {
6568
+ // border-box includes padding, so remove it if we want content
6569
+ if ( extra === "content" ) {
6570
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6571
+ }
6572
+
6573
+ // at this point, extra isn't border nor margin, so remove border
6574
+ if ( extra !== "margin" ) {
6575
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6576
+ }
6577
+ } else {
6578
+ // at this point, extra isn't content, so add padding
6579
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6580
+
6581
+ // at this point, extra isn't content nor padding, so add border
6582
+ if ( extra !== "padding" ) {
6583
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6584
+ }
6585
+ }
6586
+ }
6587
+
6588
+ return val;
6589
+ }
6590
+
6591
+ function getWidthOrHeight( elem, name, extra ) {
6592
+
6593
+ // Start with offset property, which is equivalent to the border-box value
6594
+ var valueIsBorderBox = true,
6595
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6596
+ styles = getStyles( elem ),
6597
+ isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6598
+
6599
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
6600
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6601
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6602
+ if ( val <= 0 || val == null ) {
6603
+ // Fall back to computed then uncomputed css if necessary
6604
+ val = curCSS( elem, name, styles );
6605
+ if ( val < 0 || val == null ) {
6606
+ val = elem.style[ name ];
6607
+ }
6608
+
6609
+ // Computed unit is not pixels. Stop here and return.
6610
+ if ( rnumnonpx.test(val) ) {
6611
+ return val;
6612
+ }
6613
+
6614
+ // we need the check for style in case a browser which returns unreliable values
6615
+ // for getComputedStyle silently falls back to the reliable elem.style
6616
+ valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
6617
+
6618
+ // Normalize "", auto, and prepare for extra
6619
+ val = parseFloat( val ) || 0;
6620
+ }
6621
+
6622
+ // use the active box-sizing model to add/subtract irrelevant styles
6623
+ return ( val +
6624
+ augmentWidthOrHeight(
6625
+ elem,
6626
+ name,
6627
+ extra || ( isBorderBox ? "border" : "content" ),
6628
+ valueIsBorderBox,
6629
+ styles
6630
+ )
6631
+ ) + "px";
6632
+ }
6633
+
6634
+ jQuery.extend({
6635
+ // Add in style property hooks for overriding the default
6636
+ // behavior of getting and setting a style property
6637
+ cssHooks: {
6638
+ opacity: {
6639
+ get: function( elem, computed ) {
6640
+ if ( computed ) {
6641
+ // We should always get a number back from opacity
6642
+ var ret = curCSS( elem, "opacity" );
6643
+ return ret === "" ? "1" : ret;
6644
+ }
6645
+ }
6646
+ }
6647
+ },
6648
+
6649
+ // Don't automatically add "px" to these possibly-unitless properties
6650
+ cssNumber: {
6651
+ "columnCount": true,
6652
+ "fillOpacity": true,
6653
+ "flexGrow": true,
6654
+ "flexShrink": true,
6655
+ "fontWeight": true,
6656
+ "lineHeight": true,
6657
+ "opacity": true,
6658
+ "order": true,
6659
+ "orphans": true,
6660
+ "widows": true,
6661
+ "zIndex": true,
6662
+ "zoom": true
6663
+ },
6664
+
6665
+ // Add in properties whose names you wish to fix before
6666
+ // setting or getting the value
6667
+ cssProps: {
6668
+ // normalize float css property
6669
+ "float": support.cssFloat ? "cssFloat" : "styleFloat"
6670
+ },
6671
+
6672
+ // Get and set the style property on a DOM Node
6673
+ style: function( elem, name, value, extra ) {
6674
+ // Don't set styles on text and comment nodes
6675
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6676
+ return;
6677
+ }
6678
+
6679
+ // Make sure that we're working with the right name
6680
+ var ret, type, hooks,
6681
+ origName = jQuery.camelCase( name ),
6682
+ style = elem.style;
6683
+
6684
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6685
+
6686
+ // gets hook for the prefixed version
6687
+ // followed by the unprefixed version
6688
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6689
+
6690
+ // Check if we're setting a value
6691
+ if ( value !== undefined ) {
6692
+ type = typeof value;
6693
+
6694
+ // convert relative number strings (+= or -=) to relative numbers. #7345
6695
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6696
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6697
+ // Fixes bug #9237
6698
+ type = "number";
6699
+ }
6700
+
6701
+ // Make sure that null and NaN values aren't set. See: #7116
6702
+ if ( value == null || value !== value ) {
6703
+ return;
6704
+ }
6705
+
6706
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
6707
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6708
+ value += "px";
6709
+ }
6710
+
6711
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6712
+ // but it would mean to define eight (for every problematic property) identical functions
6713
+ if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6714
+ style[ name ] = "inherit";
6715
+ }
6716
+
6717
+ // If a hook was provided, use that value, otherwise just set the specified value
6718
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6719
+
6720
+ // Support: IE
6721
+ // Swallow errors from 'invalid' CSS values (#5509)
6722
+ try {
6723
+ style[ name ] = value;
6724
+ } catch(e) {}
6725
+ }
6726
+
6727
+ } else {
6728
+ // If a hook was provided get the non-computed value from there
6729
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6730
+ return ret;
6731
+ }
6732
+
6733
+ // Otherwise just get the value from the style object
6734
+ return style[ name ];
6735
+ }
6736
+ },
6737
+
6738
+ css: function( elem, name, extra, styles ) {
6739
+ var num, val, hooks,
6740
+ origName = jQuery.camelCase( name );
6741
+
6742
+ // Make sure that we're working with the right name
6743
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6744
+
6745
+ // gets hook for the prefixed version
6746
+ // followed by the unprefixed version
6747
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6748
+
6749
+ // If a hook was provided get the computed value from there
6750
+ if ( hooks && "get" in hooks ) {
6751
+ val = hooks.get( elem, true, extra );
6752
+ }
6753
+
6754
+ // Otherwise, if a way to get the computed value exists, use that
6755
+ if ( val === undefined ) {
6756
+ val = curCSS( elem, name, styles );
6757
+ }
6758
+
6759
+ //convert "normal" to computed value
6760
+ if ( val === "normal" && name in cssNormalTransform ) {
6761
+ val = cssNormalTransform[ name ];
6762
+ }
6763
+
6764
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
6765
+ if ( extra === "" || extra ) {
6766
+ num = parseFloat( val );
6767
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6768
+ }
6769
+ return val;
6770
+ }
6771
+ });
6772
+
6773
+ jQuery.each([ "height", "width" ], function( i, name ) {
6774
+ jQuery.cssHooks[ name ] = {
6775
+ get: function( elem, computed, extra ) {
6776
+ if ( computed ) {
6777
+ // certain elements can have dimension info if we invisibly show them
6778
+ // however, it must have a current display style that would benefit from this
6779
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
6780
+ jQuery.swap( elem, cssShow, function() {
6781
+ return getWidthOrHeight( elem, name, extra );
6782
+ }) :
6783
+ getWidthOrHeight( elem, name, extra );
6784
+ }
6785
+ },
6786
+
6787
+ set: function( elem, value, extra ) {
6788
+ var styles = extra && getStyles( elem );
6789
+ return setPositiveNumber( elem, value, extra ?
6790
+ augmentWidthOrHeight(
6791
+ elem,
6792
+ name,
6793
+ extra,
6794
+ support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6795
+ styles
6796
+ ) : 0
6797
+ );
6798
+ }
6799
+ };
6800
+ });
6801
+
6802
+ if ( !support.opacity ) {
6803
+ jQuery.cssHooks.opacity = {
6804
+ get: function( elem, computed ) {
6805
+ // IE uses filters for opacity
6806
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6807
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6808
+ computed ? "1" : "";
6809
+ },
6810
+
6811
+ set: function( elem, value ) {
6812
+ var style = elem.style,
6813
+ currentStyle = elem.currentStyle,
6814
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6815
+ filter = currentStyle && currentStyle.filter || style.filter || "";
6816
+
6817
+ // IE has trouble with opacity if it does not have layout
6818
+ // Force it by setting the zoom level
6819
+ style.zoom = 1;
6820
+
6821
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6822
+ // if value === "", then remove inline opacity #12685
6823
+ if ( ( value >= 1 || value === "" ) &&
6824
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6825
+ style.removeAttribute ) {
6826
+
6827
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6828
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
6829
+ // style.removeAttribute is IE Only, but so apparently is this code path...
6830
+ style.removeAttribute( "filter" );
6831
+
6832
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
6833
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
6834
+ return;
6835
+ }
6836
+ }
6837
+
6838
+ // otherwise, set new filter values
6839
+ style.filter = ralpha.test( filter ) ?
6840
+ filter.replace( ralpha, opacity ) :
6841
+ filter + " " + opacity;
6842
+ }
6843
+ };
6844
+ }
6845
+
6846
+ jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6847
+ function( elem, computed ) {
6848
+ if ( computed ) {
6849
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6850
+ // Work around by temporarily setting element display to inline-block
6851
+ return jQuery.swap( elem, { "display": "inline-block" },
6852
+ curCSS, [ elem, "marginRight" ] );
6853
+ }
6854
+ }
6855
+ );
6856
+
6857
+ // These hooks are used by animate to expand properties
6858
+ jQuery.each({
6859
+ margin: "",
6860
+ padding: "",
6861
+ border: "Width"
6862
+ }, function( prefix, suffix ) {
6863
+ jQuery.cssHooks[ prefix + suffix ] = {
6864
+ expand: function( value ) {
6865
+ var i = 0,
6866
+ expanded = {},
6867
+
6868
+ // assumes a single number if not a string
6869
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
6870
+
6871
+ for ( ; i < 4; i++ ) {
6872
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
6873
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6874
+ }
6875
+
6876
+ return expanded;
6877
+ }
6878
+ };
6879
+
6880
+ if ( !rmargin.test( prefix ) ) {
6881
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6882
+ }
6883
+ });
6884
+
6885
+ jQuery.fn.extend({
6886
+ css: function( name, value ) {
6887
+ return access( this, function( elem, name, value ) {
6888
+ var styles, len,
6889
+ map = {},
6890
+ i = 0;
6891
+
6892
+ if ( jQuery.isArray( name ) ) {
6893
+ styles = getStyles( elem );
6894
+ len = name.length;
6895
+
6896
+ for ( ; i < len; i++ ) {
6897
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6898
+ }
6899
+
6900
+ return map;
6901
+ }
6902
+
6903
+ return value !== undefined ?
6904
+ jQuery.style( elem, name, value ) :
6905
+ jQuery.css( elem, name );
6906
+ }, name, value, arguments.length > 1 );
6907
+ },
6908
+ show: function() {
6909
+ return showHide( this, true );
6910
+ },
6911
+ hide: function() {
6912
+ return showHide( this );
6913
+ },
6914
+ toggle: function( state ) {
6915
+ if ( typeof state === "boolean" ) {
6916
+ return state ? this.show() : this.hide();
6917
+ }
6918
+
6919
+ return this.each(function() {
6920
+ if ( isHidden( this ) ) {
6921
+ jQuery( this ).show();
6922
+ } else {
6923
+ jQuery( this ).hide();
6924
+ }
6925
+ });
6926
+ }
6927
+ });
6928
+
6929
+
6930
+ function Tween( elem, options, prop, end, easing ) {
6931
+ return new Tween.prototype.init( elem, options, prop, end, easing );
6932
+ }
6933
+ jQuery.Tween = Tween;
6934
+
6935
+ Tween.prototype = {
6936
+ constructor: Tween,
6937
+ init: function( elem, options, prop, end, easing, unit ) {
6938
+ this.elem = elem;
6939
+ this.prop = prop;
6940
+ this.easing = easing || "swing";
6941
+ this.options = options;
6942
+ this.start = this.now = this.cur();
6943
+ this.end = end;
6944
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6945
+ },
6946
+ cur: function() {
6947
+ var hooks = Tween.propHooks[ this.prop ];
6948
+
6949
+ return hooks && hooks.get ?
6950
+ hooks.get( this ) :
6951
+ Tween.propHooks._default.get( this );
6952
+ },
6953
+ run: function( percent ) {
6954
+ var eased,
6955
+ hooks = Tween.propHooks[ this.prop ];
6956
+
6957
+ if ( this.options.duration ) {
6958
+ this.pos = eased = jQuery.easing[ this.easing ](
6959
+ percent, this.options.duration * percent, 0, 1, this.options.duration
6960
+ );
6961
+ } else {
6962
+ this.pos = eased = percent;
6963
+ }
6964
+ this.now = ( this.end - this.start ) * eased + this.start;
6965
+
6966
+ if ( this.options.step ) {
6967
+ this.options.step.call( this.elem, this.now, this );
6968
+ }
6969
+
6970
+ if ( hooks && hooks.set ) {
6971
+ hooks.set( this );
6972
+ } else {
6973
+ Tween.propHooks._default.set( this );
6974
+ }
6975
+ return this;
6976
+ }
6977
+ };
6978
+
6979
+ Tween.prototype.init.prototype = Tween.prototype;
6980
+
6981
+ Tween.propHooks = {
6982
+ _default: {
6983
+ get: function( tween ) {
6984
+ var result;
6985
+
6986
+ if ( tween.elem[ tween.prop ] != null &&
6987
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6988
+ return tween.elem[ tween.prop ];
6989
+ }
6990
+
6991
+ // passing an empty string as a 3rd parameter to .css will automatically
6992
+ // attempt a parseFloat and fallback to a string if the parse fails
6993
+ // so, simple values such as "10px" are parsed to Float.
6994
+ // complex values such as "rotate(1rad)" are returned as is.
6995
+ result = jQuery.css( tween.elem, tween.prop, "" );
6996
+ // Empty strings, null, undefined and "auto" are converted to 0.
6997
+ return !result || result === "auto" ? 0 : result;
6998
+ },
6999
+ set: function( tween ) {
7000
+ // use step hook for back compat - use cssHook if its there - use .style if its
7001
+ // available and use plain properties where available
7002
+ if ( jQuery.fx.step[ tween.prop ] ) {
7003
+ jQuery.fx.step[ tween.prop ]( tween );
7004
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
7005
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7006
+ } else {
7007
+ tween.elem[ tween.prop ] = tween.now;
7008
+ }
7009
+ }
7010
+ }
7011
+ };
7012
+
7013
+ // Support: IE <=9
7014
+ // Panic based approach to setting things on disconnected nodes
7015
+
7016
+ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7017
+ set: function( tween ) {
7018
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
7019
+ tween.elem[ tween.prop ] = tween.now;
7020
+ }
7021
+ }
7022
+ };
7023
+
7024
+ jQuery.easing = {
7025
+ linear: function( p ) {
7026
+ return p;
7027
+ },
7028
+ swing: function( p ) {
7029
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
7030
+ }
7031
+ };
7032
+
7033
+ jQuery.fx = Tween.prototype.init;
7034
+
7035
+ // Back Compat <1.8 extension point
7036
+ jQuery.fx.step = {};
7037
+
7038
+
7039
+
7040
+
7041
+ var
7042
+ fxNow, timerId,
7043
+ rfxtypes = /^(?:toggle|show|hide)$/,
7044
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
7045
+ rrun = /queueHooks$/,
7046
+ animationPrefilters = [ defaultPrefilter ],
7047
+ tweeners = {
7048
+ "*": [ function( prop, value ) {
7049
+ var tween = this.createTween( prop, value ),
7050
+ target = tween.cur(),
7051
+ parts = rfxnum.exec( value ),
7052
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
7053
+
7054
+ // Starting value computation is required for potential unit mismatches
7055
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
7056
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
7057
+ scale = 1,
7058
+ maxIterations = 20;
7059
+
7060
+ if ( start && start[ 3 ] !== unit ) {
7061
+ // Trust units reported by jQuery.css
7062
+ unit = unit || start[ 3 ];
7063
+
7064
+ // Make sure we update the tween properties later on
7065
+ parts = parts || [];
7066
+
7067
+ // Iteratively approximate from a nonzero starting point
7068
+ start = +target || 1;
7069
+
7070
+ do {
7071
+ // If previous iteration zeroed out, double until we get *something*
7072
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7073
+ scale = scale || ".5";
7074
+
7075
+ // Adjust and apply
7076
+ start = start / scale;
7077
+ jQuery.style( tween.elem, prop, start + unit );
7078
+
7079
+ // Update scale, tolerating zero or NaN from tween.cur()
7080
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7081
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7082
+ }
7083
+
7084
+ // Update tween properties
7085
+ if ( parts ) {
7086
+ start = tween.start = +start || +target || 0;
7087
+ tween.unit = unit;
7088
+ // If a +=/-= token was provided, we're doing a relative animation
7089
+ tween.end = parts[ 1 ] ?
7090
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
7091
+ +parts[ 2 ];
7092
+ }
7093
+
7094
+ return tween;
7095
+ } ]
7096
+ };
7097
+
7098
+ // Animations created synchronously will run synchronously
7099
+ function createFxNow() {
7100
+ setTimeout(function() {
7101
+ fxNow = undefined;
7102
+ });
7103
+ return ( fxNow = jQuery.now() );
7104
+ }
7105
+
7106
+ // Generate parameters to create a standard animation
7107
+ function genFx( type, includeWidth ) {
7108
+ var which,
7109
+ attrs = { height: type },
7110
+ i = 0;
7111
+
7112
+ // if we include width, step value is 1 to do all cssExpand values,
7113
+ // if we don't include width, step value is 2 to skip over Left and Right
7114
+ includeWidth = includeWidth ? 1 : 0;
7115
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
7116
+ which = cssExpand[ i ];
7117
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7118
+ }
7119
+
7120
+ if ( includeWidth ) {
7121
+ attrs.opacity = attrs.width = type;
7122
+ }
7123
+
7124
+ return attrs;
7125
+ }
7126
+
7127
+ function createTween( value, prop, animation ) {
7128
+ var tween,
7129
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7130
+ index = 0,
7131
+ length = collection.length;
7132
+ for ( ; index < length; index++ ) {
7133
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
7134
+
7135
+ // we're done with this property
7136
+ return tween;
7137
+ }
7138
+ }
7139
+ }
7140
+
7141
+ function defaultPrefilter( elem, props, opts ) {
7142
+ /* jshint validthis: true */
7143
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7144
+ anim = this,
7145
+ orig = {},
7146
+ style = elem.style,
7147
+ hidden = elem.nodeType && isHidden( elem ),
7148
+ dataShow = jQuery._data( elem, "fxshow" );
7149
+
7150
+ // handle queue: false promises
7151
+ if ( !opts.queue ) {
7152
+ hooks = jQuery._queueHooks( elem, "fx" );
7153
+ if ( hooks.unqueued == null ) {
7154
+ hooks.unqueued = 0;
7155
+ oldfire = hooks.empty.fire;
7156
+ hooks.empty.fire = function() {
7157
+ if ( !hooks.unqueued ) {
7158
+ oldfire();
7159
+ }
7160
+ };
7161
+ }
7162
+ hooks.unqueued++;
7163
+
7164
+ anim.always(function() {
7165
+ // doing this makes sure that the complete handler will be called
7166
+ // before this completes
7167
+ anim.always(function() {
7168
+ hooks.unqueued--;
7169
+ if ( !jQuery.queue( elem, "fx" ).length ) {
7170
+ hooks.empty.fire();
7171
+ }
7172
+ });
7173
+ });
7174
+ }
7175
+
7176
+ // height/width overflow pass
7177
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7178
+ // Make sure that nothing sneaks out
7179
+ // Record all 3 overflow attributes because IE does not
7180
+ // change the overflow attribute when overflowX and
7181
+ // overflowY are set to the same value
7182
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7183
+
7184
+ // Set display property to inline-block for height/width
7185
+ // animations on inline elements that are having width/height animated
7186
+ display = jQuery.css( elem, "display" );
7187
+
7188
+ // Test default display if display is currently "none"
7189
+ checkDisplay = display === "none" ?
7190
+ jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7191
+
7192
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7193
+
7194
+ // inline-level elements accept inline-block;
7195
+ // block-level elements need to be inline with layout
7196
+ if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7197
+ style.display = "inline-block";
7198
+ } else {
7199
+ style.zoom = 1;
7200
+ }
7201
+ }
7202
+ }
7203
+
7204
+ if ( opts.overflow ) {
7205
+ style.overflow = "hidden";
7206
+ if ( !support.shrinkWrapBlocks() ) {
7207
+ anim.always(function() {
7208
+ style.overflow = opts.overflow[ 0 ];
7209
+ style.overflowX = opts.overflow[ 1 ];
7210
+ style.overflowY = opts.overflow[ 2 ];
7211
+ });
7212
+ }
7213
+ }
7214
+
7215
+ // show/hide pass
7216
+ for ( prop in props ) {
7217
+ value = props[ prop ];
7218
+ if ( rfxtypes.exec( value ) ) {
7219
+ delete props[ prop ];
7220
+ toggle = toggle || value === "toggle";
7221
+ if ( value === ( hidden ? "hide" : "show" ) ) {
7222
+
7223
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
7224
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7225
+ hidden = true;
7226
+ } else {
7227
+ continue;
7228
+ }
7229
+ }
7230
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7231
+
7232
+ // Any non-fx value stops us from restoring the original display value
7233
+ } else {
7234
+ display = undefined;
7235
+ }
7236
+ }
7237
+
7238
+ if ( !jQuery.isEmptyObject( orig ) ) {
7239
+ if ( dataShow ) {
7240
+ if ( "hidden" in dataShow ) {
7241
+ hidden = dataShow.hidden;
7242
+ }
7243
+ } else {
7244
+ dataShow = jQuery._data( elem, "fxshow", {} );
7245
+ }
7246
+
7247
+ // store state if its toggle - enables .stop().toggle() to "reverse"
7248
+ if ( toggle ) {
7249
+ dataShow.hidden = !hidden;
7250
+ }
7251
+ if ( hidden ) {
7252
+ jQuery( elem ).show();
7253
+ } else {
7254
+ anim.done(function() {
7255
+ jQuery( elem ).hide();
7256
+ });
7257
+ }
7258
+ anim.done(function() {
7259
+ var prop;
7260
+ jQuery._removeData( elem, "fxshow" );
7261
+ for ( prop in orig ) {
7262
+ jQuery.style( elem, prop, orig[ prop ] );
7263
+ }
7264
+ });
7265
+ for ( prop in orig ) {
7266
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7267
+
7268
+ if ( !( prop in dataShow ) ) {
7269
+ dataShow[ prop ] = tween.start;
7270
+ if ( hidden ) {
7271
+ tween.end = tween.start;
7272
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
7273
+ }
7274
+ }
7275
+ }
7276
+
7277
+ // If this is a noop like .hide().hide(), restore an overwritten display value
7278
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
7279
+ style.display = display;
7280
+ }
7281
+ }
7282
+
7283
+ function propFilter( props, specialEasing ) {
7284
+ var index, name, easing, value, hooks;
7285
+
7286
+ // camelCase, specialEasing and expand cssHook pass
7287
+ for ( index in props ) {
7288
+ name = jQuery.camelCase( index );
7289
+ easing = specialEasing[ name ];
7290
+ value = props[ index ];
7291
+ if ( jQuery.isArray( value ) ) {
7292
+ easing = value[ 1 ];
7293
+ value = props[ index ] = value[ 0 ];
7294
+ }
7295
+
7296
+ if ( index !== name ) {
7297
+ props[ name ] = value;
7298
+ delete props[ index ];
7299
+ }
7300
+
7301
+ hooks = jQuery.cssHooks[ name ];
7302
+ if ( hooks && "expand" in hooks ) {
7303
+ value = hooks.expand( value );
7304
+ delete props[ name ];
7305
+
7306
+ // not quite $.extend, this wont overwrite keys already present.
7307
+ // also - reusing 'index' from above because we have the correct "name"
7308
+ for ( index in value ) {
7309
+ if ( !( index in props ) ) {
7310
+ props[ index ] = value[ index ];
7311
+ specialEasing[ index ] = easing;
7312
+ }
7313
+ }
7314
+ } else {
7315
+ specialEasing[ name ] = easing;
7316
+ }
7317
+ }
7318
+ }
7319
+
7320
+ function Animation( elem, properties, options ) {
7321
+ var result,
7322
+ stopped,
7323
+ index = 0,
7324
+ length = animationPrefilters.length,
7325
+ deferred = jQuery.Deferred().always( function() {
7326
+ // don't match elem in the :animated selector
7327
+ delete tick.elem;
7328
+ }),
7329
+ tick = function() {
7330
+ if ( stopped ) {
7331
+ return false;
7332
+ }
7333
+ var currentTime = fxNow || createFxNow(),
7334
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7335
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7336
+ temp = remaining / animation.duration || 0,
7337
+ percent = 1 - temp,
7338
+ index = 0,
7339
+ length = animation.tweens.length;
7340
+
7341
+ for ( ; index < length ; index++ ) {
7342
+ animation.tweens[ index ].run( percent );
7343
+ }
7344
+
7345
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
7346
+
7347
+ if ( percent < 1 && length ) {
7348
+ return remaining;
7349
+ } else {
7350
+ deferred.resolveWith( elem, [ animation ] );
7351
+ return false;
7352
+ }
7353
+ },
7354
+ animation = deferred.promise({
7355
+ elem: elem,
7356
+ props: jQuery.extend( {}, properties ),
7357
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
7358
+ originalProperties: properties,
7359
+ originalOptions: options,
7360
+ startTime: fxNow || createFxNow(),
7361
+ duration: options.duration,
7362
+ tweens: [],
7363
+ createTween: function( prop, end ) {
7364
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
7365
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
7366
+ animation.tweens.push( tween );
7367
+ return tween;
7368
+ },
7369
+ stop: function( gotoEnd ) {
7370
+ var index = 0,
7371
+ // if we are going to the end, we want to run all the tweens
7372
+ // otherwise we skip this part
7373
+ length = gotoEnd ? animation.tweens.length : 0;
7374
+ if ( stopped ) {
7375
+ return this;
7376
+ }
7377
+ stopped = true;
7378
+ for ( ; index < length ; index++ ) {
7379
+ animation.tweens[ index ].run( 1 );
7380
+ }
7381
+
7382
+ // resolve when we played the last frame
7383
+ // otherwise, reject
7384
+ if ( gotoEnd ) {
7385
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
7386
+ } else {
7387
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
7388
+ }
7389
+ return this;
7390
+ }
7391
+ }),
7392
+ props = animation.props;
7393
+
7394
+ propFilter( props, animation.opts.specialEasing );
7395
+
7396
+ for ( ; index < length ; index++ ) {
7397
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7398
+ if ( result ) {
7399
+ return result;
7400
+ }
7401
+ }
7402
+
7403
+ jQuery.map( props, createTween, animation );
7404
+
7405
+ if ( jQuery.isFunction( animation.opts.start ) ) {
7406
+ animation.opts.start.call( elem, animation );
7407
+ }
7408
+
7409
+ jQuery.fx.timer(
7410
+ jQuery.extend( tick, {
7411
+ elem: elem,
7412
+ anim: animation,
7413
+ queue: animation.opts.queue
7414
+ })
7415
+ );
7416
+
7417
+ // attach callbacks from options
7418
+ return animation.progress( animation.opts.progress )
7419
+ .done( animation.opts.done, animation.opts.complete )
7420
+ .fail( animation.opts.fail )
7421
+ .always( animation.opts.always );
7422
+ }
7423
+
7424
+ jQuery.Animation = jQuery.extend( Animation, {
7425
+ tweener: function( props, callback ) {
7426
+ if ( jQuery.isFunction( props ) ) {
7427
+ callback = props;
7428
+ props = [ "*" ];
7429
+ } else {
7430
+ props = props.split(" ");
7431
+ }
7432
+
7433
+ var prop,
7434
+ index = 0,
7435
+ length = props.length;
7436
+
7437
+ for ( ; index < length ; index++ ) {
7438
+ prop = props[ index ];
7439
+ tweeners[ prop ] = tweeners[ prop ] || [];
7440
+ tweeners[ prop ].unshift( callback );
7441
+ }
7442
+ },
7443
+
7444
+ prefilter: function( callback, prepend ) {
7445
+ if ( prepend ) {
7446
+ animationPrefilters.unshift( callback );
7447
+ } else {
7448
+ animationPrefilters.push( callback );
7449
+ }
7450
+ }
7451
+ });
7452
+
7453
+ jQuery.speed = function( speed, easing, fn ) {
7454
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7455
+ complete: fn || !fn && easing ||
7456
+ jQuery.isFunction( speed ) && speed,
7457
+ duration: speed,
7458
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7459
+ };
7460
+
7461
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7462
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7463
+
7464
+ // normalize opt.queue - true/undefined/null -> "fx"
7465
+ if ( opt.queue == null || opt.queue === true ) {
7466
+ opt.queue = "fx";
7467
+ }
7468
+
7469
+ // Queueing
7470
+ opt.old = opt.complete;
7471
+
7472
+ opt.complete = function() {
7473
+ if ( jQuery.isFunction( opt.old ) ) {
7474
+ opt.old.call( this );
7475
+ }
7476
+
7477
+ if ( opt.queue ) {
7478
+ jQuery.dequeue( this, opt.queue );
7479
+ }
7480
+ };
7481
+
7482
+ return opt;
7483
+ };
7484
+
7485
+ jQuery.fn.extend({
7486
+ fadeTo: function( speed, to, easing, callback ) {
7487
+
7488
+ // show any hidden elements after setting opacity to 0
7489
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
7490
+
7491
+ // animate to the value specified
7492
+ .end().animate({ opacity: to }, speed, easing, callback );
7493
+ },
7494
+ animate: function( prop, speed, easing, callback ) {
7495
+ var empty = jQuery.isEmptyObject( prop ),
7496
+ optall = jQuery.speed( speed, easing, callback ),
7497
+ doAnimation = function() {
7498
+ // Operate on a copy of prop so per-property easing won't be lost
7499
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7500
+
7501
+ // Empty animations, or finishing resolves immediately
7502
+ if ( empty || jQuery._data( this, "finish" ) ) {
7503
+ anim.stop( true );
7504
+ }
7505
+ };
7506
+ doAnimation.finish = doAnimation;
7507
+
7508
+ return empty || optall.queue === false ?
7509
+ this.each( doAnimation ) :
7510
+ this.queue( optall.queue, doAnimation );
7511
+ },
7512
+ stop: function( type, clearQueue, gotoEnd ) {
7513
+ var stopQueue = function( hooks ) {
7514
+ var stop = hooks.stop;
7515
+ delete hooks.stop;
7516
+ stop( gotoEnd );
7517
+ };
7518
+
7519
+ if ( typeof type !== "string" ) {
7520
+ gotoEnd = clearQueue;
7521
+ clearQueue = type;
7522
+ type = undefined;
7523
+ }
7524
+ if ( clearQueue && type !== false ) {
7525
+ this.queue( type || "fx", [] );
7526
+ }
7527
+
7528
+ return this.each(function() {
7529
+ var dequeue = true,
7530
+ index = type != null && type + "queueHooks",
7531
+ timers = jQuery.timers,
7532
+ data = jQuery._data( this );
7533
+
7534
+ if ( index ) {
7535
+ if ( data[ index ] && data[ index ].stop ) {
7536
+ stopQueue( data[ index ] );
7537
+ }
7538
+ } else {
7539
+ for ( index in data ) {
7540
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7541
+ stopQueue( data[ index ] );
7542
+ }
7543
+ }
7544
+ }
7545
+
7546
+ for ( index = timers.length; index--; ) {
7547
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7548
+ timers[ index ].anim.stop( gotoEnd );
7549
+ dequeue = false;
7550
+ timers.splice( index, 1 );
7551
+ }
7552
+ }
7553
+
7554
+ // start the next in the queue if the last step wasn't forced
7555
+ // timers currently will call their complete callbacks, which will dequeue
7556
+ // but only if they were gotoEnd
7557
+ if ( dequeue || !gotoEnd ) {
7558
+ jQuery.dequeue( this, type );
7559
+ }
7560
+ });
7561
+ },
7562
+ finish: function( type ) {
7563
+ if ( type !== false ) {
7564
+ type = type || "fx";
7565
+ }
7566
+ return this.each(function() {
7567
+ var index,
7568
+ data = jQuery._data( this ),
7569
+ queue = data[ type + "queue" ],
7570
+ hooks = data[ type + "queueHooks" ],
7571
+ timers = jQuery.timers,
7572
+ length = queue ? queue.length : 0;
7573
+
7574
+ // enable finishing flag on private data
7575
+ data.finish = true;
7576
+
7577
+ // empty the queue first
7578
+ jQuery.queue( this, type, [] );
7579
+
7580
+ if ( hooks && hooks.stop ) {
7581
+ hooks.stop.call( this, true );
7582
+ }
7583
+
7584
+ // look for any active animations, and finish them
7585
+ for ( index = timers.length; index--; ) {
7586
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7587
+ timers[ index ].anim.stop( true );
7588
+ timers.splice( index, 1 );
7589
+ }
7590
+ }
7591
+
7592
+ // look for any animations in the old queue and finish them
7593
+ for ( index = 0; index < length; index++ ) {
7594
+ if ( queue[ index ] && queue[ index ].finish ) {
7595
+ queue[ index ].finish.call( this );
7596
+ }
7597
+ }
7598
+
7599
+ // turn off finishing flag
7600
+ delete data.finish;
7601
+ });
7602
+ }
7603
+ });
7604
+
7605
+ jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7606
+ var cssFn = jQuery.fn[ name ];
7607
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
7608
+ return speed == null || typeof speed === "boolean" ?
7609
+ cssFn.apply( this, arguments ) :
7610
+ this.animate( genFx( name, true ), speed, easing, callback );
7611
+ };
7612
+ });
7613
+
7614
+ // Generate shortcuts for custom animations
7615
+ jQuery.each({
7616
+ slideDown: genFx("show"),
7617
+ slideUp: genFx("hide"),
7618
+ slideToggle: genFx("toggle"),
7619
+ fadeIn: { opacity: "show" },
7620
+ fadeOut: { opacity: "hide" },
7621
+ fadeToggle: { opacity: "toggle" }
7622
+ }, function( name, props ) {
7623
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
7624
+ return this.animate( props, speed, easing, callback );
7625
+ };
7626
+ });
7627
+
7628
+ jQuery.timers = [];
7629
+ jQuery.fx.tick = function() {
7630
+ var timer,
7631
+ timers = jQuery.timers,
7632
+ i = 0;
7633
+
7634
+ fxNow = jQuery.now();
7635
+
7636
+ for ( ; i < timers.length; i++ ) {
7637
+ timer = timers[ i ];
7638
+ // Checks the timer has not already been removed
7639
+ if ( !timer() && timers[ i ] === timer ) {
7640
+ timers.splice( i--, 1 );
7641
+ }
7642
+ }
7643
+
7644
+ if ( !timers.length ) {
7645
+ jQuery.fx.stop();
7646
+ }
7647
+ fxNow = undefined;
7648
+ };
7649
+
7650
+ jQuery.fx.timer = function( timer ) {
7651
+ jQuery.timers.push( timer );
7652
+ if ( timer() ) {
7653
+ jQuery.fx.start();
7654
+ } else {
7655
+ jQuery.timers.pop();
7656
+ }
7657
+ };
7658
+
7659
+ jQuery.fx.interval = 13;
7660
+
7661
+ jQuery.fx.start = function() {
7662
+ if ( !timerId ) {
7663
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7664
+ }
7665
+ };
7666
+
7667
+ jQuery.fx.stop = function() {
7668
+ clearInterval( timerId );
7669
+ timerId = null;
7670
+ };
7671
+
7672
+ jQuery.fx.speeds = {
7673
+ slow: 600,
7674
+ fast: 200,
7675
+ // Default speed
7676
+ _default: 400
7677
+ };
7678
+
7679
+
7680
+ // Based off of the plugin by Clint Helfers, with permission.
7681
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
7682
+ jQuery.fn.delay = function( time, type ) {
7683
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7684
+ type = type || "fx";
7685
+
7686
+ return this.queue( type, function( next, hooks ) {
7687
+ var timeout = setTimeout( next, time );
7688
+ hooks.stop = function() {
7689
+ clearTimeout( timeout );
7690
+ };
7691
+ });
7692
+ };
7693
+
7694
+
7695
+ (function() {
7696
+ // Minified: var a,b,c,d,e
7697
+ var input, div, select, a, opt;
7698
+
7699
+ // Setup
7700
+ div = document.createElement( "div" );
7701
+ div.setAttribute( "className", "t" );
7702
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
7703
+ a = div.getElementsByTagName("a")[ 0 ];
7704
+
7705
+ // First batch of tests.
7706
+ select = document.createElement("select");
7707
+ opt = select.appendChild( document.createElement("option") );
7708
+ input = div.getElementsByTagName("input")[ 0 ];
7709
+
7710
+ a.style.cssText = "top:1px";
7711
+
7712
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
7713
+ support.getSetAttribute = div.className !== "t";
7714
+
7715
+ // Get the style information from getAttribute
7716
+ // (IE uses .cssText instead)
7717
+ support.style = /top/.test( a.getAttribute("style") );
7718
+
7719
+ // Make sure that URLs aren't manipulated
7720
+ // (IE normalizes it by default)
7721
+ support.hrefNormalized = a.getAttribute("href") === "/a";
7722
+
7723
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
7724
+ support.checkOn = !!input.value;
7725
+
7726
+ // Make sure that a selected-by-default option has a working selected property.
7727
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
7728
+ support.optSelected = opt.selected;
7729
+
7730
+ // Tests for enctype support on a form (#6743)
7731
+ support.enctype = !!document.createElement("form").enctype;
7732
+
7733
+ // Make sure that the options inside disabled selects aren't marked as disabled
7734
+ // (WebKit marks them as disabled)
7735
+ select.disabled = true;
7736
+ support.optDisabled = !opt.disabled;
7737
+
7738
+ // Support: IE8 only
7739
+ // Check if we can trust getAttribute("value")
7740
+ input = document.createElement( "input" );
7741
+ input.setAttribute( "value", "" );
7742
+ support.input = input.getAttribute( "value" ) === "";
7743
+
7744
+ // Check if an input maintains its value after becoming a radio
7745
+ input.value = "t";
7746
+ input.setAttribute( "type", "radio" );
7747
+ support.radioValue = input.value === "t";
7748
+ })();
7749
+
7750
+
7751
+ var rreturn = /\r/g;
7752
+
7753
+ jQuery.fn.extend({
7754
+ val: function( value ) {
7755
+ var hooks, ret, isFunction,
7756
+ elem = this[0];
7757
+
7758
+ if ( !arguments.length ) {
7759
+ if ( elem ) {
7760
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7761
+
7762
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7763
+ return ret;
7764
+ }
7765
+
7766
+ ret = elem.value;
7767
+
7768
+ return typeof ret === "string" ?
7769
+ // handle most common string cases
7770
+ ret.replace(rreturn, "") :
7771
+ // handle cases where value is null/undef or number
7772
+ ret == null ? "" : ret;
7773
+ }
7774
+
7775
+ return;
7776
+ }
7777
+
7778
+ isFunction = jQuery.isFunction( value );
7779
+
7780
+ return this.each(function( i ) {
7781
+ var val;
7782
+
7783
+ if ( this.nodeType !== 1 ) {
7784
+ return;
7785
+ }
7786
+
7787
+ if ( isFunction ) {
7788
+ val = value.call( this, i, jQuery( this ).val() );
7789
+ } else {
7790
+ val = value;
7791
+ }
7792
+
7793
+ // Treat null/undefined as ""; convert numbers to string
7794
+ if ( val == null ) {
7795
+ val = "";
7796
+ } else if ( typeof val === "number" ) {
7797
+ val += "";
7798
+ } else if ( jQuery.isArray( val ) ) {
7799
+ val = jQuery.map( val, function( value ) {
7800
+ return value == null ? "" : value + "";
7801
+ });
7802
+ }
7803
+
7804
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7805
+
7806
+ // If set returns undefined, fall back to normal setting
7807
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7808
+ this.value = val;
7809
+ }
7810
+ });
7811
+ }
7812
+ });
7813
+
7814
+ jQuery.extend({
7815
+ valHooks: {
7816
+ option: {
7817
+ get: function( elem ) {
7818
+ var val = jQuery.find.attr( elem, "value" );
7819
+ return val != null ?
7820
+ val :
7821
+ // Support: IE10-11+
7822
+ // option.text throws exceptions (#14686, #14858)
7823
+ jQuery.trim( jQuery.text( elem ) );
7824
+ }
7825
+ },
7826
+ select: {
7827
+ get: function( elem ) {
7828
+ var value, option,
7829
+ options = elem.options,
7830
+ index = elem.selectedIndex,
7831
+ one = elem.type === "select-one" || index < 0,
7832
+ values = one ? null : [],
7833
+ max = one ? index + 1 : options.length,
7834
+ i = index < 0 ?
7835
+ max :
7836
+ one ? index : 0;
7837
+
7838
+ // Loop through all the selected options
7839
+ for ( ; i < max; i++ ) {
7840
+ option = options[ i ];
7841
+
7842
+ // oldIE doesn't update selected after form reset (#2551)
7843
+ if ( ( option.selected || i === index ) &&
7844
+ // Don't return options that are disabled or in a disabled optgroup
7845
+ ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
7846
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7847
+
7848
+ // Get the specific value for the option
7849
+ value = jQuery( option ).val();
7850
+
7851
+ // We don't need an array for one selects
7852
+ if ( one ) {
7853
+ return value;
7854
+ }
7855
+
7856
+ // Multi-Selects return an array
7857
+ values.push( value );
7858
+ }
7859
+ }
7860
+
7861
+ return values;
7862
+ },
7863
+
7864
+ set: function( elem, value ) {
7865
+ var optionSet, option,
7866
+ options = elem.options,
7867
+ values = jQuery.makeArray( value ),
7868
+ i = options.length;
7869
+
7870
+ while ( i-- ) {
7871
+ option = options[ i ];
7872
+
7873
+ if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
7874
+
7875
+ // Support: IE6
7876
+ // When new option element is added to select box we need to
7877
+ // force reflow of newly added node in order to workaround delay
7878
+ // of initialization properties
7879
+ try {
7880
+ option.selected = optionSet = true;
7881
+
7882
+ } catch ( _ ) {
7883
+
7884
+ // Will be executed only in IE6
7885
+ option.scrollHeight;
7886
+ }
7887
+
7888
+ } else {
7889
+ option.selected = false;
7890
+ }
7891
+ }
7892
+
7893
+ // Force browsers to behave consistently when non-matching value is set
7894
+ if ( !optionSet ) {
7895
+ elem.selectedIndex = -1;
7896
+ }
7897
+
7898
+ return options;
7899
+ }
7900
+ }
7901
+ }
7902
+ });
7903
+
7904
+ // Radios and checkboxes getter/setter
7905
+ jQuery.each([ "radio", "checkbox" ], function() {
7906
+ jQuery.valHooks[ this ] = {
7907
+ set: function( elem, value ) {
7908
+ if ( jQuery.isArray( value ) ) {
7909
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7910
+ }
7911
+ }
7912
+ };
7913
+ if ( !support.checkOn ) {
7914
+ jQuery.valHooks[ this ].get = function( elem ) {
7915
+ // Support: Webkit
7916
+ // "" is returned instead of "on" if a value isn't specifie