Version Notes
Retail version of the youstice resolution system package
Download this release
Release Info
Developer | Youstice |
Extension | Youstice |
Version | 1.3.7 |
Comparing to | |
See all releases |
Version 1.3.7
- app/code/community/Youstice/YousticeResolutionSystem/Helper/ApiSingleton.php +68 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Api.php +738 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Helpers/HelperFunctions.php +51 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Helpers/LanguageCodes.php +211 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Local.php +315 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/LocalInterface.php +41 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Providers/SessionProvider.php +36 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Providers/SessionProviderInterface.php +15 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Remote.php +147 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/BaseReport.php +77 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/OrderReport.php +55 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/ProductReport.php +25 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/WebReport.php +25 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Request.php +114 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopItem.php +381 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopOrder.php +48 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopProduct.php +38 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/SimpleApi.php +292 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Tools.php +67 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Translator.php +38 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderDetail.php +55 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderDetailButton.php +129 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderReportButton.php +75 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ProductReportButton.php +74 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ReportClaimsForm.php +39 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ShowButtons.php +31 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/WebReportButton.php +72 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/cs.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/de.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/en.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/es.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/fr.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/pt.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/ru.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/sk.php +93 -0
- app/code/community/Youstice/YousticeResolutionSystem/controllers/AdminController.php +71 -0
- app/code/community/Youstice/YousticeResolutionSystem/controllers/IndexController.php +310 -0
- app/code/community/Youstice/YousticeResolutionSystem/etc/adminhtml.xml +13 -0
- app/code/community/Youstice/YousticeResolutionSystem/etc/config.xml +62 -0
- app/code/community/Youstice/YousticeResolutionSystem/sql/youstice_setup/mysql4-install-0.9.8.php +13 -0
- app/design/adminhtml/default/default/layout/youstice_layout_update.xml +23 -0
- app/design/adminhtml/default/default/template/youstice/adminForm.phtml +181 -0
- app/design/frontend/base/default/layout/youstice_layout_update.xml +52 -0
- app/design/frontend/base/default/template/youstice/baseUrl.phtml +6 -0
- app/design/frontend/base/default/template/youstice/reportClaims.phtml +4 -0
- app/design/frontend/base/default/template/youstice/reportClaimsOgTags.phtml +12 -0
- app/etc/modules/Youstice_YousticeResolutionSystem.xml +10 -0
- js/youstice/admin.js +76 -0
- js/youstice/jquery.fancybox.js +2020 -0
- js/youstice/jquery.min.js +7 -0
- js/youstice/logoWidget.js +7 -0
- js/youstice/orders.js +90 -0
- js/youstice/products.js +26 -0
- js/youstice/reportClaims.js +44 -0
- package.xml +18 -0
- skin/adminhtml/default/default/images/youstice/screenshot_1.png +0 -0
- skin/adminhtml/default/default/images/youstice/screenshot_2.png +0 -0
- skin/adminhtml/default/default/images/youstice/screenshot_3.png +0 -0
- skin/adminhtml/default/default/yousticeAdmin.css +335 -0
- skin/frontend/base/default/css/fancybox/blank.gif +0 -0
- skin/frontend/base/default/css/fancybox/fancybox_loading.gif +0 -0
- skin/frontend/base/default/css/fancybox/fancybox_loading@2x.gif +0 -0
- skin/frontend/base/default/css/fancybox/fancybox_overlay.png +0 -0
- skin/frontend/base/default/css/fancybox/fancybox_sprite.png +0 -0
- skin/frontend/base/default/css/fancybox/fancybox_sprite@2x.png +0 -0
- skin/frontend/base/default/css/fancybox/jquery.fancybox.css +274 -0
- skin/frontend/base/default/css/youstice.css +260 -0
- skin/frontend/base/default/css/youstice_magento.css +38 -0
- skin/frontend/base/default/images/youstice/logo.png +0 -0
app/code/community/Youstice/YousticeResolutionSystem/Helper/ApiSingleton.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Description of ApiSingleton
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Youstice_YousticeResolutionSystem_Helper_ApiSingleton {
|
8 |
+
|
9 |
+
protected $api;
|
10 |
+
|
11 |
+
function __construct() {
|
12 |
+
require_once(__DIR__ . '/../SDK/Api.php');
|
13 |
+
|
14 |
+
$this->api = Youstice_Api::create();
|
15 |
+
|
16 |
+
$this->api->setDbCredentials($this->getDbCredentials())
|
17 |
+
->setLanguage($this->getLanguage())
|
18 |
+
->setShopSoftwareType('magento', Mage::getVersion())
|
19 |
+
->setThisShopSells(Mage::getStoreConfig('youstice/shop_sells'))
|
20 |
+
->setApiKey(Mage::getStoreConfig('youstice/api_key'), Mage::getStoreConfig('youstice/use_sandbox'))
|
21 |
+
->setUserId($this->getCustomerId());
|
22 |
+
|
23 |
+
$this->api->run();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function get() {
|
27 |
+
return $this->api;
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function getDbCredentials() {
|
31 |
+
$config = Mage::getConfig()->getResourceConnectionConfig('default_setup');
|
32 |
+
$driver = $config->type->asArray();
|
33 |
+
|
34 |
+
$array = array(
|
35 |
+
'driver' => str_replace('pdo_', '', $driver),
|
36 |
+
'host' => $config->host->asArray(),
|
37 |
+
'user' => $config->username->asArray(),
|
38 |
+
'pass' => $config->password->asArray(),
|
39 |
+
'name' => $config->dbname->asArray(),
|
40 |
+
'prefix' => (string) Mage::getConfig()->getTablePrefix()
|
41 |
+
);
|
42 |
+
|
43 |
+
return $array;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCustomerId() {
|
47 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
48 |
+
$customer = Mage::getSingleton('customer/session');
|
49 |
+
|
50 |
+
return $customer->getId();
|
51 |
+
}
|
52 |
+
|
53 |
+
return null;
|
54 |
+
}
|
55 |
+
|
56 |
+
protected function getLanguage() {
|
57 |
+
if(Mage::getStoreConfig('youstice/default_language'))
|
58 |
+
return Mage::getStoreConfig('youstice/default_language');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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Main Youstice class.
|
5 |
+
*
|
6 |
+
* @author Youstice
|
7 |
+
* @copyright (c) 2014, Youstice
|
8 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Youstice main API class
|
13 |
+
*
|
14 |
+
* @author KBS Development
|
15 |
+
*/
|
16 |
+
class Youstice_Api {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Because updateData function is called every request, update only every 10 minutes
|
20 |
+
* @var int
|
21 |
+
*/
|
22 |
+
protected $update_interval = 600;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* When setOftenUpdates was called, next 5 minutes updates occurs
|
26 |
+
* @var int
|
27 |
+
*/
|
28 |
+
protected $often_update_interval = 300;
|
29 |
+
|
30 |
+
/**
|
31 |
+
*
|
32 |
+
* @var type Youstice_Translator
|
33 |
+
*/
|
34 |
+
protected $translator;
|
35 |
+
|
36 |
+
/**
|
37 |
+
*
|
38 |
+
* @var SessionProviderInterface
|
39 |
+
*/
|
40 |
+
protected $session;
|
41 |
+
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
* @var type Youstice_LocalInterface
|
45 |
+
*/
|
46 |
+
protected $local;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* ISO 639-1 char code "en|sk|cz|es"
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $language;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* string from youstice service
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
protected $api_key;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* product|service
|
62 |
+
* @var string
|
63 |
+
*/
|
64 |
+
protected $shop_sells;
|
65 |
+
|
66 |
+
/**
|
67 |
+
* unique integer identifier
|
68 |
+
* @var type
|
69 |
+
*/
|
70 |
+
protected $user_id;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* true for testing environment
|
74 |
+
* @var boolean
|
75 |
+
*/
|
76 |
+
protected $use_sandbox;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* prestashop|magento|ownSoftware
|
80 |
+
* @var string
|
81 |
+
*/
|
82 |
+
protected $shop_software_type;
|
83 |
+
|
84 |
+
/**
|
85 |
+
* e.g. 1.9.4.2
|
86 |
+
* @var string
|
87 |
+
*/
|
88 |
+
protected $shop_software_version;
|
89 |
+
|
90 |
+
/**
|
91 |
+
*
|
92 |
+
* @param array $db_credentials associative array for PDO connection with must fields: driver, host, name, user, pass
|
93 |
+
* @param string $language ISO 639-1 char code "en|sk|cz|es"
|
94 |
+
* @param string $api_key string from youstice service
|
95 |
+
* @param string $shop_sells "product|service"
|
96 |
+
* @param integer $user_id unique integer for user
|
97 |
+
* @param boolean $use_sandbox true if testing implementation
|
98 |
+
* @param string $shop_software_type prestashop|magento|ownSoftware
|
99 |
+
* @param string $shop_software_version e.g. 1.9.4.2
|
100 |
+
* @return Youstice_Api
|
101 |
+
*/
|
102 |
+
public static function create(array $db_credentials = array(), $language = 'sk', $api_key = '', $shop_sells = 'product', $user_id = null, $use_sandbox = false, $shop_software_type = 'custom', $shop_software_version = '')
|
103 |
+
{
|
104 |
+
return new self($db_credentials, $language, $api_key, $shop_sells, $user_id, $use_sandbox, $shop_software_type, $shop_software_version);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
*
|
109 |
+
* @param array $db_credentials associative array for PDO connection with must fields: driver, host, name, user, pass
|
110 |
+
* @param string $language ISO 639-1 char code "en|sk|cz|es"
|
111 |
+
* @param string $api_key string from youstice service
|
112 |
+
* @param string $shop_sells "product|service"
|
113 |
+
* @param integer $user_id unique integer for user
|
114 |
+
* @param boolean $use_sandbox true if testing implementation
|
115 |
+
* @param string $shop_software_type prestashop|magento|ownSoftware
|
116 |
+
* @param string $shop_software_version e.g. 1.9.4.2
|
117 |
+
* @return Youstice_Api
|
118 |
+
*/
|
119 |
+
public function __construct(array $db_credentials = array(), $language = 'sk', $api_key = '', $shop_sells = 'product', $user_id = null, $use_sandbox = false, $shop_software_type = 'custom', $shop_software_version = '')
|
120 |
+
{
|
121 |
+
$this->registerAutoloader();
|
122 |
+
|
123 |
+
$this->setDbCredentials($db_credentials);
|
124 |
+
$this->setLanguage($language);
|
125 |
+
$this->setUserId($user_id);
|
126 |
+
$this->setApiKey($api_key, $use_sandbox);
|
127 |
+
$this->setThisShopSells($shop_sells);
|
128 |
+
$this->setShopSoftwareType($shop_software_type, $shop_software_version);
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Start Youstice API
|
135 |
+
* @return Youstice_Api
|
136 |
+
*/
|
137 |
+
public function run()
|
138 |
+
{
|
139 |
+
$this->runWithoutUpdates();
|
140 |
+
|
141 |
+
$this->updateData();
|
142 |
+
|
143 |
+
return $this;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Start Youstice API and do not run updates
|
148 |
+
* @return YousticeApi
|
149 |
+
*/
|
150 |
+
public function runWithoutUpdates()
|
151 |
+
{
|
152 |
+
$this->checkShopSells();
|
153 |
+
|
154 |
+
if ($this->session === null)
|
155 |
+
$this->setSession(new Youstice_Providers_SessionProvider());
|
156 |
+
|
157 |
+
$this->remote = new Youstice_Remote($this->api_key, $this->use_sandbox, $this->language, $this->shop_sells, $this->shop_software_type, $this->shop_software_version);
|
158 |
+
|
159 |
+
return $this;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Helper function for autoloading classes (called in constructor)
|
164 |
+
*/
|
165 |
+
protected function registerAutoloader()
|
166 |
+
{
|
167 |
+
spl_autoload_register(function ($class_name) {
|
168 |
+
$class_name = str_replace('Youstice_', '', $class_name);
|
169 |
+
$class_path = str_replace('_', DIRECTORY_SEPARATOR, $class_name);
|
170 |
+
|
171 |
+
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $class_path;
|
172 |
+
|
173 |
+
if (is_readable($path . '.php'))
|
174 |
+
require_once $path . '.php';
|
175 |
+
}, true, true); //prepend our autoloader
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Renders form with fields email and orderNumber for reporting claims
|
180 |
+
* @return string html
|
181 |
+
*/
|
182 |
+
public function getReportClaimsFormHtml()
|
183 |
+
{
|
184 |
+
if (!trim($this->api_key))
|
185 |
+
return "Invalid shop's api key";
|
186 |
+
|
187 |
+
$widget = new Youstice_Widgets_ReportClaimsForm($this->language);
|
188 |
+
|
189 |
+
return $widget->toString();
|
190 |
+
}
|
191 |
+
|
192 |
+
public function getShowButtonsWidgetHtml()
|
193 |
+
{
|
194 |
+
if (!trim($this->api_key))
|
195 |
+
return '';
|
196 |
+
|
197 |
+
$reports_count = count($this->local->getReportsByUser($this->user_id));
|
198 |
+
|
199 |
+
$widget = new Youstice_Widgets_ShowButtons($this->language, $reports_count > 0);
|
200 |
+
|
201 |
+
return $widget->toString();
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Returns html string of logo widget
|
206 |
+
* @param string $claim_url url to report claims form
|
207 |
+
* @return string html
|
208 |
+
*/
|
209 |
+
public function getLogoWidgetHtml($claim_url = '')
|
210 |
+
{
|
211 |
+
if (!trim($this->api_key))
|
212 |
+
return '';
|
213 |
+
|
214 |
+
return $this->remote->getLogoWidgetData($this->local->getChangedReportStatusesCount(), $claim_url, $this->user_id !== null);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Returns html string of web report button
|
219 |
+
* @param string $href url address where web report is created
|
220 |
+
* @return string of html button
|
221 |
+
*/
|
222 |
+
public function getWebReportButtonHtml($href)
|
223 |
+
{
|
224 |
+
if (!trim($this->api_key))
|
225 |
+
return '';
|
226 |
+
|
227 |
+
$report = $this->local->getWebReport($this->user_id);
|
228 |
+
|
229 |
+
//exists, just redirect
|
230 |
+
if (!$report->canCreateNew())
|
231 |
+
{
|
232 |
+
$remote_link = $this->local->getCachedRemoteReportLink($report->getCode());
|
233 |
+
|
234 |
+
if (Youstice_Tools::strlen($remote_link))
|
235 |
+
$href = $remote_link;
|
236 |
+
}
|
237 |
+
|
238 |
+
$web_button = new Youstice_Widgets_WebReportButton($href, $this->language, $report);
|
239 |
+
|
240 |
+
return $web_button->toString();
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Returns html of product button
|
245 |
+
* @param string $href url address where product report is created
|
246 |
+
* @param integer $product_id
|
247 |
+
* @param integer $order_id
|
248 |
+
* @return string of html button
|
249 |
+
*/
|
250 |
+
public function getProductReportButtonHtml($href, $product_id, $order_id = null)
|
251 |
+
{
|
252 |
+
if (!trim($this->api_key))
|
253 |
+
return '';
|
254 |
+
|
255 |
+
$report = $this->local->getProductReport($product_id, $order_id);
|
256 |
+
|
257 |
+
//exists, just redirect
|
258 |
+
if (!$report->canCreateNew())
|
259 |
+
{
|
260 |
+
$remote_link = $this->local->getCachedRemoteReportLink($report->getCode());
|
261 |
+
|
262 |
+
if (Youstice_Tools::strlen($remote_link))
|
263 |
+
$href = $remote_link;
|
264 |
+
}
|
265 |
+
|
266 |
+
$product_button = new Youstice_Widgets_ProductReportButton($href, $this->language, $report);
|
267 |
+
|
268 |
+
return $product_button->toString();
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Returns html of button for simple order reporting
|
273 |
+
* @param string $href url address where order report is created
|
274 |
+
* @param inteter $order_id
|
275 |
+
* @return string of html button
|
276 |
+
*/
|
277 |
+
public function getOrderReportButtonHtml($href, $order_id)
|
278 |
+
{
|
279 |
+
if (!trim($this->api_key))
|
280 |
+
return '';
|
281 |
+
|
282 |
+
$report = $this->local->getOrderReport($order_id);
|
283 |
+
|
284 |
+
//exists, just redirect
|
285 |
+
if (!$report->canCreateNew())
|
286 |
+
{
|
287 |
+
$remote_link = $this->local->getCachedRemoteReportLink($report->getCode());
|
288 |
+
|
289 |
+
if (Youstice_Tools::strlen($remote_link))
|
290 |
+
$href = $remote_link;
|
291 |
+
}
|
292 |
+
|
293 |
+
$order_button = new Youstice_Widgets_OrderReportButton($href, $this->language, $report);
|
294 |
+
|
295 |
+
return $order_button->toString();
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Returns button for opening popup
|
300 |
+
* @param string $href url address where showing order detail is mantained
|
301 |
+
* @param Youstice_ShopOrder $order class with attached data
|
302 |
+
*/
|
303 |
+
public function getOrderDetailButtonHtml($href, Youstice_ShopOrder $order)
|
304 |
+
{
|
305 |
+
if (!trim($this->api_key))
|
306 |
+
return '';
|
307 |
+
|
308 |
+
$products = $order->getProducts();
|
309 |
+
$product_codes = array();
|
310 |
+
|
311 |
+
foreach ($products as $product)
|
312 |
+
$product_codes[] = $product->getCode();
|
313 |
+
|
314 |
+
$report = $this->local->getOrderReport($order->getId(), $product_codes);
|
315 |
+
|
316 |
+
$order_button = new Youstice_Widgets_OrderDetailButton($href, $this->language, $order, $report, $this);
|
317 |
+
|
318 |
+
return $order_button->toString();
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Returns html string of popup
|
323 |
+
* @param Youstice_ShopOrder $order class with attached data
|
324 |
+
*/
|
325 |
+
public function getOrderDetailHtml(Youstice_ShopOrder $order)
|
326 |
+
{
|
327 |
+
if (!trim($this->api_key))
|
328 |
+
return '';
|
329 |
+
|
330 |
+
$products = $order->getProducts();
|
331 |
+
$product_codes = array();
|
332 |
+
|
333 |
+
foreach ($products as $product)
|
334 |
+
$product_codes[] = $product->getCode();
|
335 |
+
|
336 |
+
$report = $this->local->getOrderReport($order->getCode(), $product_codes);
|
337 |
+
|
338 |
+
$order_detail = new Youstice_Widgets_OrderDetail($this->language, $order, $report, $this);
|
339 |
+
|
340 |
+
return $order_detail->toString();
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Action when user viewed order history (for changing report statuses count)
|
345 |
+
* @return Youstice_Api
|
346 |
+
*/
|
347 |
+
public function orderHistoryViewed()
|
348 |
+
{
|
349 |
+
$this->local->setChangedReportStatusesCount(0);
|
350 |
+
|
351 |
+
return $this;
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Creates report of web
|
356 |
+
* @return string where to redirect
|
357 |
+
*/
|
358 |
+
public function createWebReport()
|
359 |
+
{
|
360 |
+
$this->updateData(true);
|
361 |
+
|
362 |
+
$local_report = $this->local->getWebReport($this->user_id);
|
363 |
+
|
364 |
+
if ($local_report->canCreateNew())
|
365 |
+
return $this->createWebReportExecute($this->user_id);
|
366 |
+
else
|
367 |
+
{
|
368 |
+
$remote_link = $this->local->getCachedRemoteReportLink($local_report->getCode());
|
369 |
+
|
370 |
+
if (Youstice_Tools::strlen($remote_link))
|
371 |
+
return $remote_link;
|
372 |
+
else
|
373 |
+
return $this->createWebReportExecute($this->user_id);
|
374 |
+
}
|
375 |
+
}
|
376 |
+
|
377 |
+
private function createWebReportExecute($user_id)
|
378 |
+
{
|
379 |
+
$new_code = $this->local->createWebReport($user_id, $user_id);
|
380 |
+
|
381 |
+
$redirect_link = $this->remote->createWebReport($new_code);
|
382 |
+
|
383 |
+
if ($redirect_link == null)
|
384 |
+
throw new Youstice_FailedRemoteConnectionException;
|
385 |
+
|
386 |
+
$this->setOftenUpdates();
|
387 |
+
|
388 |
+
return $redirect_link;
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Creates order report
|
393 |
+
* @param Youstice_ShopOrder $order class with attached data
|
394 |
+
* @return string where to redirect
|
395 |
+
*/
|
396 |
+
public function createOrderReport(Youstice_ShopOrder $order)
|
397 |
+
{
|
398 |
+
$this->updateData(true);
|
399 |
+
|
400 |
+
$report = new Youstice_Reports_OrderReport($order->toArray());
|
401 |
+
$local_report = $this->local->getOrderReport($report->getCode());
|
402 |
+
|
403 |
+
if ($local_report->canCreateNew())
|
404 |
+
return $this->createOrderReportExecute($order);
|
405 |
+
else
|
406 |
+
{
|
407 |
+
$remote_link = $this->local->getCachedRemoteReportLink($local_report->getCode());
|
408 |
+
|
409 |
+
if (Youstice_Tools::strlen($remote_link))
|
410 |
+
return $remote_link;
|
411 |
+
else
|
412 |
+
return $this->createOrderReportExecute($order);
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
private function createOrderReportExecute(Youstice_ShopOrder $order)
|
417 |
+
{
|
418 |
+
$report = new Youstice_Reports_OrderReport($order->toArray());
|
419 |
+
$new_code = $this->local->createReport($report->getCode(), $this->user_id);
|
420 |
+
|
421 |
+
$redirect_link = $this->remote->createOrderReport($order, $new_code);
|
422 |
+
|
423 |
+
if ($redirect_link == null)
|
424 |
+
throw new Youstice_FailedRemoteConnectionException;
|
425 |
+
|
426 |
+
$this->setOftenUpdates();
|
427 |
+
|
428 |
+
return $redirect_link;
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Creates product report
|
433 |
+
* @param Youstice_ShopProduct $product class with attached data
|
434 |
+
* @return string where redirect
|
435 |
+
*/
|
436 |
+
public function createProductReport(Youstice_ShopProduct $product)
|
437 |
+
{
|
438 |
+
$this->updateData(true);
|
439 |
+
|
440 |
+
$report = new Youstice_Reports_ProductReport($product->toArray());
|
441 |
+
$local_report = $this->local->getProductReport($report->getCode());
|
442 |
+
|
443 |
+
if ($local_report->canCreateNew())
|
444 |
+
return $this->createProductReportExecute($product);
|
445 |
+
else
|
446 |
+
{
|
447 |
+
$remote_link = $this->local->getCachedRemoteReportLink($local_report->getCode());
|
448 |
+
|
449 |
+
if (Youstice_Tools::strlen($remote_link))
|
450 |
+
return $remote_link;
|
451 |
+
else
|
452 |
+
return $this->createProductReportExecute($product);
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
private function createProductReportExecute(Youstice_ShopProduct $product)
|
457 |
+
{
|
458 |
+
$report = new Youstice_Reports_ProductReport($product->toArray());
|
459 |
+
$new_code = $this->local->createReport($report->getCode(), $this->user_id);
|
460 |
+
|
461 |
+
$redirect_link = $this->remote->createProductReport($product, $new_code);
|
462 |
+
|
463 |
+
if ($redirect_link == null)
|
464 |
+
throw new Youstice_FailedRemoteConnectionException;
|
465 |
+
|
466 |
+
$this->setOftenUpdates();
|
467 |
+
|
468 |
+
return $redirect_link;
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
*
|
473 |
+
* @param string $string to translate
|
474 |
+
* @param array $variables
|
475 |
+
* @return string translated
|
476 |
+
*/
|
477 |
+
public function t($string, $variables = array())
|
478 |
+
{
|
479 |
+
return $this->translator->t($string, $variables);
|
480 |
+
}
|
481 |
+
|
482 |
+
/**
|
483 |
+
* Create necessary table
|
484 |
+
* @return boolean success
|
485 |
+
*/
|
486 |
+
public function install()
|
487 |
+
{
|
488 |
+
return $this->local->install();
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Drop table
|
493 |
+
* @return boolean success
|
494 |
+
*/
|
495 |
+
public function uninstall()
|
496 |
+
{
|
497 |
+
return $this->local->uninstall();
|
498 |
+
}
|
499 |
+
|
500 |
+
public function setOftenUpdates()
|
501 |
+
{
|
502 |
+
$this->session->set('last_often_update', time());
|
503 |
+
}
|
504 |
+
|
505 |
+
/**
|
506 |
+
* Connect to remote and update local data
|
507 |
+
* @param boolean $force_update update also if data are acutal
|
508 |
+
*/
|
509 |
+
protected function updateData($force_update = false)
|
510 |
+
{
|
511 |
+
if ($force_update || $this->canUpdate())
|
512 |
+
{
|
513 |
+
if ($this->updateDataExecute())
|
514 |
+
$this->session->set('last_update', time());
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
/**
|
519 |
+
* If api key is set and time upate intervals are in range
|
520 |
+
* @return boolean if can update
|
521 |
+
*/
|
522 |
+
protected function canUpdate()
|
523 |
+
{
|
524 |
+
if (Youstice_Tools::strlen($this->api_key) == 0)
|
525 |
+
return false;
|
526 |
+
|
527 |
+
$last_often_update = 0;
|
528 |
+
if ($this->session->get('last_often_update'))
|
529 |
+
$last_often_update = $this->session->get('last_often_update');
|
530 |
+
|
531 |
+
//setOftenUpdates() was called 5 minutes before or earlier
|
532 |
+
if ($last_often_update + $this->often_update_interval > time())
|
533 |
+
return true;
|
534 |
+
|
535 |
+
$last_update = 0;
|
536 |
+
if ($this->session->get('last_update'))
|
537 |
+
$last_update = $this->session->get('last_update');
|
538 |
+
|
539 |
+
return $last_update + $this->update_interval < time();
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Get data for logoWidget, update report statuses and time
|
544 |
+
* @return boolean success
|
545 |
+
*/
|
546 |
+
protected function updateDataExecute()
|
547 |
+
{
|
548 |
+
if (!$this->user_id)
|
549 |
+
return false;
|
550 |
+
|
551 |
+
$local_reports_data = $this->local->getReportsByUser($this->user_id);
|
552 |
+
|
553 |
+
//try to get remote reports
|
554 |
+
try {
|
555 |
+
$remote_reports_data = $this->remote->getRemoteReportsData($local_reports_data);
|
556 |
+
} catch (Exception $e) {
|
557 |
+
return false;
|
558 |
+
}
|
559 |
+
|
560 |
+
//no new updates
|
561 |
+
if (count($remote_reports_data) === 0)
|
562 |
+
return true;
|
563 |
+
|
564 |
+
$changed_report_statuses_count = $this->local->getChangedReportStatusesCount();
|
565 |
+
|
566 |
+
foreach ($local_reports_data as $local) {
|
567 |
+
foreach ($remote_reports_data as $remote) {
|
568 |
+
if (!isset($remote['orderNumber']) || $local['code'] !== $remote['orderNumber'])
|
569 |
+
continue;
|
570 |
+
|
571 |
+
$this->local->setCachedRemoteReportLink($local['code'], $remote['redirect_link']);
|
572 |
+
//status changed?
|
573 |
+
if ($local['status'] !== $remote['status'])
|
574 |
+
{
|
575 |
+
$changed_report_statuses_count++;
|
576 |
+
$this->local->updateReportStatus($remote['orderNumber'], $remote['status']);
|
577 |
+
}
|
578 |
+
|
579 |
+
$this->local->updateReportRemainingTime($remote['orderNumber'], $remote['remaining_time']);
|
580 |
+
}
|
581 |
+
}
|
582 |
+
|
583 |
+
$this->local->setChangedReportStatusesCount($changed_report_statuses_count);
|
584 |
+
|
585 |
+
return true;
|
586 |
+
}
|
587 |
+
|
588 |
+
/**
|
589 |
+
* Set database params in associative array for PDO
|
590 |
+
* @param array $db_credentials associative array for PDO connection with must fields: driver, host, name, user, pass
|
591 |
+
* @return Youstice_Api
|
592 |
+
*/
|
593 |
+
public function setDbCredentials(array $db_credentials)
|
594 |
+
{
|
595 |
+
if (count($db_credentials))
|
596 |
+
$this->setLocal(new Youstice_Local($db_credentials));
|
597 |
+
|
598 |
+
return $this;
|
599 |
+
}
|
600 |
+
|
601 |
+
/**
|
602 |
+
*
|
603 |
+
* @param Youstice_Providers_SessionProviderInterface $session
|
604 |
+
* @return Youstice_Api
|
605 |
+
*/
|
606 |
+
public function setSession(Youstice_Providers_SessionProviderInterface $session)
|
607 |
+
{
|
608 |
+
$this->session = $session;
|
609 |
+
$this->session->start();
|
610 |
+
|
611 |
+
if ($this->local !== null)
|
612 |
+
$this->local->setSession($this->session);
|
613 |
+
|
614 |
+
return $this;
|
615 |
+
}
|
616 |
+
|
617 |
+
/**
|
618 |
+
*
|
619 |
+
* @param Youstice_LocalInterface $local
|
620 |
+
* @return Youstice_Api
|
621 |
+
*/
|
622 |
+
public function setLocal(Youstice_LocalInterface $local)
|
623 |
+
{
|
624 |
+
$this->local = $local;
|
625 |
+
|
626 |
+
if ($this->session !== null)
|
627 |
+
$this->local->setSession($this->session);
|
628 |
+
|
629 |
+
return $this;
|
630 |
+
}
|
631 |
+
|
632 |
+
/**
|
633 |
+
* Set eshop language
|
634 |
+
* @param string ISO 639-1 char code "en|sk|cz|es"
|
635 |
+
* @return Youstice_Api
|
636 |
+
* @throws InvalidArgumentException
|
637 |
+
*/
|
638 |
+
public function setLanguage($lang = null)
|
639 |
+
{
|
640 |
+
$lang = trim(Youstice_Tools::strtolower($lang));
|
641 |
+
|
642 |
+
if ($lang && Youstice_Helpers_LanguageCodes::check($lang))
|
643 |
+
{
|
644 |
+
$this->language = $lang;
|
645 |
+
$this->translator = new Youstice_Translator($this->language);
|
646 |
+
} else
|
647 |
+
throw new InvalidArgumentException('Language code "' . $lang . '" is not allowed.');
|
648 |
+
|
649 |
+
return $this;
|
650 |
+
}
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Set API key
|
654 |
+
* @param string $api_key if true api is in playground mode, data are not real
|
655 |
+
* @return Youstice_Api
|
656 |
+
*/
|
657 |
+
public function setApiKey($api_key, $use_sandbox = false)
|
658 |
+
{
|
659 |
+
if (!trim($api_key))
|
660 |
+
return $this;
|
661 |
+
|
662 |
+
$this->api_key = $api_key;
|
663 |
+
|
664 |
+
$this->use_sandbox = ($use_sandbox == true ? true : false);
|
665 |
+
|
666 |
+
return $this;
|
667 |
+
}
|
668 |
+
|
669 |
+
public function checkApiKey()
|
670 |
+
{
|
671 |
+
return $this->remote->checkApiKey();
|
672 |
+
}
|
673 |
+
|
674 |
+
/**
|
675 |
+
* Set what type of goods is eshop selling
|
676 |
+
* @param string $shop_sells "product|service"
|
677 |
+
* @return Youstice_Api
|
678 |
+
* @throws InvalidArgumentException
|
679 |
+
*/
|
680 |
+
public function setThisShopSells($shop_sells)
|
681 |
+
{
|
682 |
+
$this->shop_sells = Youstice_Tools::strtolower($shop_sells);
|
683 |
+
|
684 |
+
return $this;
|
685 |
+
}
|
686 |
+
|
687 |
+
/**
|
688 |
+
* Check if shopSells attribute is correct
|
689 |
+
* @throws InvalidArgumentException
|
690 |
+
*/
|
691 |
+
protected function checkShopSells()
|
692 |
+
{
|
693 |
+
$allowed_types = array('product', 'service');
|
694 |
+
|
695 |
+
if (in_array(Youstice_Tools::strtolower($this->shop_sells), $allowed_types))
|
696 |
+
$this->shop_sells = Youstice_Tools::strtolower($this->shop_sells);
|
697 |
+
else
|
698 |
+
throw new InvalidArgumentException('Shop selling "' . $this->shop_sells . '" is not allowed.');
|
699 |
+
}
|
700 |
+
|
701 |
+
/**
|
702 |
+
* Set on which software is eshop running
|
703 |
+
* @param string $shop_type "prestashop|magento|ownSoftware"
|
704 |
+
* @param string $shop_version full version string
|
705 |
+
* @return Youstice_Api
|
706 |
+
*/
|
707 |
+
public function setShopSoftwareType($shop_type, $shop_version = '')
|
708 |
+
{
|
709 |
+
if (Youstice_Tools::strlen($shop_type))
|
710 |
+
$this->shop_software_type = $shop_type;
|
711 |
+
|
712 |
+
if (Youstice_Tools::strlen($shop_version))
|
713 |
+
$this->shop_software_version = $shop_version;
|
714 |
+
|
715 |
+
return $this;
|
716 |
+
}
|
717 |
+
|
718 |
+
/**
|
719 |
+
* Set user id, unique for eshop
|
720 |
+
* @param integer $user_id
|
721 |
+
* @return Youstice_Api
|
722 |
+
*/
|
723 |
+
public function setUserId($user_id)
|
724 |
+
{
|
725 |
+
$this->user_id = $user_id;
|
726 |
+
|
727 |
+
return $this;
|
728 |
+
}
|
729 |
+
|
730 |
+
}
|
731 |
+
|
732 |
+
class Youstice_InvalidApiKeyException extends Exception {
|
733 |
+
|
734 |
+
}
|
735 |
+
|
736 |
+
class Youstice_FailedRemoteConnectionException extends Exception {
|
737 |
+
|
738 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Helpers/HelperFunctions.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Various helpers for the Youstice API
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Helpers_HelperFunctions {
|
11 |
+
|
12 |
+
public static function webalize($string)
|
13 |
+
{
|
14 |
+
$string = preg_replace('~[^\\pL0-9_]+~u', '-', $string);
|
15 |
+
$string = trim($string, '-');
|
16 |
+
$string = iconv('utf-8', 'us-ascii//TRANSLIT', $string);
|
17 |
+
$string = Youstice_Tools::strtolower($string);
|
18 |
+
$string = preg_replace('~[^-a-z0-9_]+~', '', $string);
|
19 |
+
|
20 |
+
return $string;
|
21 |
+
}
|
22 |
+
|
23 |
+
public static function sh($string)
|
24 |
+
{
|
25 |
+
$s = str_replace('&', '&', $string);
|
26 |
+
return htmlspecialchars($s, ENT_QUOTES);
|
27 |
+
}
|
28 |
+
|
29 |
+
public static function remainingTimeToString($time = 0, Youstice_Translator $translator)
|
30 |
+
{
|
31 |
+
$days = floor($time / (60 * 60 * 24));
|
32 |
+
|
33 |
+
$hours = floor(($time - ($days * 60 * 60 * 24)) / (60 * 60));
|
34 |
+
|
35 |
+
return $translator->t('%d days %d hours', $days, $hours);
|
36 |
+
}
|
37 |
+
|
38 |
+
public static function isSessionStarted()
|
39 |
+
{
|
40 |
+
if (php_sapi_name() !== 'cli')
|
41 |
+
{
|
42 |
+
if (version_compare(phpversion(), '5.4.0', '>='))
|
43 |
+
return session_status() === PHP_SESSION_ACTIVE;
|
44 |
+
else
|
45 |
+
return session_id() === '' ? false : true;
|
46 |
+
}
|
47 |
+
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Helpers/LanguageCodes.php
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class handling all ISO 639-1 language codes
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Checks if language 2 char code exists (ISO 639-1)
|
12 |
+
*/
|
13 |
+
class Youstice_Helpers_LanguageCodes {
|
14 |
+
|
15 |
+
public static function check($code) {
|
16 |
+
return array_key_exists($code, self::$languageCodes);
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function getNameForCode($code = null) {
|
20 |
+
return self::$languageCodes[$code] ?: null;
|
21 |
+
}
|
22 |
+
|
23 |
+
private static $languageCodes = array(
|
24 |
+
'aa' => 'Afar',
|
25 |
+
'ab' => 'Abkhazian',
|
26 |
+
'ae' => 'Avestan',
|
27 |
+
'af' => 'Afrikaans',
|
28 |
+
'ak' => 'Akan',
|
29 |
+
'am' => 'Amharic',
|
30 |
+
'an' => 'Aragonese',
|
31 |
+
'ar' => 'Arabic',
|
32 |
+
'as' => 'Assamese',
|
33 |
+
'av' => 'Avaric',
|
34 |
+
'ay' => 'Aymara',
|
35 |
+
'az' => 'Azerbaijani',
|
36 |
+
'ba' => 'Bashkir',
|
37 |
+
'be' => 'Belarusian',
|
38 |
+
'bg' => 'Bulgarian',
|
39 |
+
'bh' => 'Bihari',
|
40 |
+
'bi' => 'Bislama',
|
41 |
+
'bm' => 'Bambara',
|
42 |
+
'bn' => 'Bengali',
|
43 |
+
'bo' => 'Tibetan',
|
44 |
+
'br' => 'Breton',
|
45 |
+
'bs' => 'Bosnian',
|
46 |
+
'ca' => 'Catalan',
|
47 |
+
'ce' => 'Chechen',
|
48 |
+
'ch' => 'Chamorro',
|
49 |
+
'co' => 'Corsican',
|
50 |
+
'cr' => 'Cree',
|
51 |
+
'cs' => 'Czech',
|
52 |
+
'cu' => 'Church Slavic',
|
53 |
+
'cv' => 'Chuvash',
|
54 |
+
'cy' => 'Welsh',
|
55 |
+
'da' => 'Danish',
|
56 |
+
'de' => 'German',
|
57 |
+
'dv' => 'Divehi',
|
58 |
+
'dz' => 'Dzongkha',
|
59 |
+
'ee' => 'Ewe',
|
60 |
+
'el' => 'Greek',
|
61 |
+
'en' => 'English',
|
62 |
+
'eo' => 'Esperanto',
|
63 |
+
'es' => 'Spanish',
|
64 |
+
'et' => 'Estonian',
|
65 |
+
'eu' => 'Basque',
|
66 |
+
'fa' => 'Persian',
|
67 |
+
'ff' => 'Fulah',
|
68 |
+
'fi' => 'Finnish',
|
69 |
+
'fj' => 'Fijian',
|
70 |
+
'fo' => 'Faroese',
|
71 |
+
'fr' => 'French',
|
72 |
+
'fy' => 'Western Frisian',
|
73 |
+
'ga' => 'Irish',
|
74 |
+
'gb' => 'United Kingdom',
|
75 |
+
'gd' => 'Scottish Gaelic',
|
76 |
+
'gl' => 'Galician',
|
77 |
+
'gn' => 'Guarani',
|
78 |
+
'gu' => 'Gujarati',
|
79 |
+
'gv' => 'Manx',
|
80 |
+
'ha' => 'Hausa',
|
81 |
+
'he' => 'Hebrew',
|
82 |
+
'hi' => 'Hindi',
|
83 |
+
'ho' => 'Hiri Motu',
|
84 |
+
'hr' => 'Croatian',
|
85 |
+
'ht' => 'Haitian',
|
86 |
+
'hu' => 'Hungarian',
|
87 |
+
'hy' => 'Armenian',
|
88 |
+
'hz' => 'Herero',
|
89 |
+
'ia' => 'Interlingua (International Auxiliary Language Association)',
|
90 |
+
'id' => 'Indonesian',
|
91 |
+
'ie' => 'Interlingue',
|
92 |
+
'ig' => 'Igbo',
|
93 |
+
'ii' => 'Sichuan Yi',
|
94 |
+
'ik' => 'Inupiaq',
|
95 |
+
'io' => 'Ido',
|
96 |
+
'is' => 'Icelandic',
|
97 |
+
'it' => 'Italian',
|
98 |
+
'iu' => 'Inuktitut',
|
99 |
+
'ja' => 'Japanese',
|
100 |
+
'jv' => 'Javanese',
|
101 |
+
'ka' => 'Georgian',
|
102 |
+
'kg' => 'Kongo',
|
103 |
+
'ki' => 'Kikuyu',
|
104 |
+
'kj' => 'Kwanyama',
|
105 |
+
'kk' => 'Kazakh',
|
106 |
+
'kl' => 'Kalaallisut',
|
107 |
+
'km' => 'Khmer',
|
108 |
+
'kn' => 'Kannada',
|
109 |
+
'ko' => 'Korean',
|
110 |
+
'kr' => 'Kanuri',
|
111 |
+
'ks' => 'Kashmiri',
|
112 |
+
'ku' => 'Kurdish',
|
113 |
+
'kv' => 'Komi',
|
114 |
+
'kw' => 'Cornish',
|
115 |
+
'ky' => 'Kirghiz',
|
116 |
+
'la' => 'Latin',
|
117 |
+
'lb' => 'Luxembourgish',
|
118 |
+
'lg' => 'Ganda',
|
119 |
+
'li' => 'Limburgish',
|
120 |
+
'ln' => 'Lingala',
|
121 |
+
'lo' => 'Lao',
|
122 |
+
'lt' => 'Lithuanian',
|
123 |
+
'lu' => 'Luba-Katanga',
|
124 |
+
'lv' => 'Latvian',
|
125 |
+
'mg' => 'Malagasy',
|
126 |
+
'mh' => 'Marshallese',
|
127 |
+
'mi' => 'Maori',
|
128 |
+
'mk' => 'Macedonian',
|
129 |
+
'ml' => 'Malayalam',
|
130 |
+
'mn' => 'Mongolian',
|
131 |
+
'mr' => 'Marathi',
|
132 |
+
'ms' => 'Malay',
|
133 |
+
'mt' => 'Maltese',
|
134 |
+
'my' => 'Burmese',
|
135 |
+
'na' => 'Nauru',
|
136 |
+
'nb' => 'Norwegian Bokmal',
|
137 |
+
'nd' => 'North Ndebele',
|
138 |
+
'ne' => 'Nepali',
|
139 |
+
'ng' => 'Ndonga',
|
140 |
+
'nl' => 'Dutch',
|
141 |
+
'nn' => 'Norwegian Nynorsk',
|
142 |
+
'no' => 'Norwegian',
|
143 |
+
'nr' => 'South Ndebele',
|
144 |
+
'nv' => 'Navajo',
|
145 |
+
'ny' => 'Chichewa',
|
146 |
+
'oc' => 'Occitan',
|
147 |
+
'oj' => 'Ojibwa',
|
148 |
+
'om' => 'Oromo',
|
149 |
+
'or' => 'Oriya',
|
150 |
+
'os' => 'Ossetian',
|
151 |
+
'pa' => 'Panjabi',
|
152 |
+
'pi' => 'Pali',
|
153 |
+
'pl' => 'Polish',
|
154 |
+
'ps' => 'Pashto',
|
155 |
+
'pt' => 'Portuguese',
|
156 |
+
'qu' => 'Quechua',
|
157 |
+
'rm' => 'Raeto-Romance',
|
158 |
+
'rn' => 'Kirundi',
|
159 |
+
'ro' => 'Romanian',
|
160 |
+
'ru' => 'Russian',
|
161 |
+
'rw' => 'Kinyarwanda',
|
162 |
+
'sa' => 'Sanskrit',
|
163 |
+
'sc' => 'Sardinian',
|
164 |
+
'sd' => 'Sindhi',
|
165 |
+
'se' => 'Northern Sami',
|
166 |
+
'sg' => 'Sango',
|
167 |
+
'si' => 'Sinhala',
|
168 |
+
'sk' => 'Slovak',
|
169 |
+
'sl' => 'Slovenian',
|
170 |
+
'sm' => 'Samoan',
|
171 |
+
'sn' => 'Shona',
|
172 |
+
'so' => 'Somali',
|
173 |
+
'sq' => 'Albanian',
|
174 |
+
'sr' => 'Serbian',
|
175 |
+
'ss' => 'Swati',
|
176 |
+
'st' => 'Southern Sotho',
|
177 |
+
'su' => 'Sundanese',
|
178 |
+
'sv' => 'Swedish',
|
179 |
+
'sw' => 'Swahili',
|
180 |
+
'ta' => 'Tamil',
|
181 |
+
'te' => 'Telugu',
|
182 |
+
'tg' => 'Tajik',
|
183 |
+
'th' => 'Thai',
|
184 |
+
'ti' => 'Tigrinya',
|
185 |
+
'tk' => 'Turkmen',
|
186 |
+
'tl' => 'Tagalog',
|
187 |
+
'tn' => 'Tswana',
|
188 |
+
'to' => 'Tonga',
|
189 |
+
'tr' => 'Turkish',
|
190 |
+
'ts' => 'Tsonga',
|
191 |
+
'tt' => 'Tatar',
|
192 |
+
'tw' => 'Twi',
|
193 |
+
'ty' => 'Tahitian',
|
194 |
+
'ug' => 'Uighur',
|
195 |
+
'uk' => 'Ukrainian',
|
196 |
+
'ur' => 'Urdu',
|
197 |
+
'uz' => 'Uzbek',
|
198 |
+
've' => 'Venda',
|
199 |
+
'vi' => 'Vietnamese',
|
200 |
+
'vo' => 'Volapuk',
|
201 |
+
'wa' => 'Walloon',
|
202 |
+
'wo' => 'Wolof',
|
203 |
+
'xh' => 'Xhosa',
|
204 |
+
'yi' => 'Yiddish',
|
205 |
+
'yo' => 'Yoruba',
|
206 |
+
'za' => 'Zhuang',
|
207 |
+
'zh' => 'Chinese',
|
208 |
+
'zu' => 'Zulu'
|
209 |
+
);
|
210 |
+
|
211 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Local.php
ADDED
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles localy stored reports
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Handles localy stored reports
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
class Youstice_Local implements Youstice_LocalInterface {
|
15 |
+
|
16 |
+
private $connection = null;
|
17 |
+
private $table_prefix;
|
18 |
+
private $db_driver;
|
19 |
+
private $session;
|
20 |
+
private $cached = array();
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Initialize connection
|
24 |
+
* @param array $db credentials for PDO
|
25 |
+
* @throws InvalidArgumentException
|
26 |
+
*/
|
27 |
+
public function __construct(array $db)
|
28 |
+
{
|
29 |
+
$connection_string = $this->getConnectionString($db);
|
30 |
+
|
31 |
+
try {
|
32 |
+
$pdo = new PDO($connection_string, $db['user'], $db['pass'], array(
|
33 |
+
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
34 |
+
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
35 |
+
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
|
36 |
+
));
|
37 |
+
} catch (PDOException $e) {
|
38 |
+
throw new InvalidArgumentException('PDOException was thrown while connecting');
|
39 |
+
}
|
40 |
+
|
41 |
+
$this->connection = $pdo;
|
42 |
+
$this->table_prefix = isset($db['prefix']) ? $db['prefix'] : '';
|
43 |
+
$this->db_driver = $db['driver'];
|
44 |
+
}
|
45 |
+
|
46 |
+
private function getConnectionString(array $db)
|
47 |
+
{
|
48 |
+
if (isset($db['host']) && isset($db['socket']))
|
49 |
+
throw new Exception("Host and socket can't be specified simultaneously");
|
50 |
+
|
51 |
+
if ($db['driver'] == 'mysqli')
|
52 |
+
$db['driver'] = 'mysql';
|
53 |
+
|
54 |
+
$connection_string = $db['driver'].':dbname='.$db['name'];
|
55 |
+
|
56 |
+
if($db['driver'] == 'mysql')
|
57 |
+
$connection_string .= ';charset=utf8';
|
58 |
+
|
59 |
+
if (isset($db['host']))
|
60 |
+
$connection_string .= ';host='.$db['host'];
|
61 |
+
|
62 |
+
if (isset($db['port']))
|
63 |
+
$connection_string .= ';port='.$db['port'];
|
64 |
+
|
65 |
+
if (isset($db['socket']))
|
66 |
+
$connection_string .= ';unix_socket='.$db['socket'];
|
67 |
+
|
68 |
+
return $connection_string;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
*
|
73 |
+
* @param Youstice_Providers_SessionProviderInterface $session
|
74 |
+
* @return Youstice_Api
|
75 |
+
*/
|
76 |
+
public function setSession(Youstice_Providers_SessionProviderInterface &$session)
|
77 |
+
{
|
78 |
+
$this->session = $session;
|
79 |
+
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
*
|
85 |
+
* @param string $code
|
86 |
+
* @return string remote link | null
|
87 |
+
*/
|
88 |
+
public function getCachedRemoteReportLink($code)
|
89 |
+
{
|
90 |
+
if ($this->session->get('report'.$code.'remoteLink'))
|
91 |
+
return $this->session->get('report'.$code.'remoteLink');
|
92 |
+
|
93 |
+
return null;
|
94 |
+
}
|
95 |
+
|
96 |
+
public function setCachedRemoteReportLink($code, $link)
|
97 |
+
{
|
98 |
+
$this->session->set('report'.$code.'remoteLink', $link);
|
99 |
+
}
|
100 |
+
|
101 |
+
public function getChangedReportStatusesCount()
|
102 |
+
{
|
103 |
+
return $this->session->get('changedReportStatusesCount') ? $this->session->get('changedReportStatusesCount') : 0;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function setChangedReportStatusesCount($value)
|
107 |
+
{
|
108 |
+
$this->session->set('changedReportStatusesCount', $value);
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getWebReport($user_id)
|
112 |
+
{
|
113 |
+
$code = 'WEB_REPORT__'.$user_id;
|
114 |
+
|
115 |
+
$result = $this->getReport($code.'__%');
|
116 |
+
|
117 |
+
return new Youstice_Reports_WebReport($result);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getProductReport($product_id, $order_code = null)
|
121 |
+
{
|
122 |
+
$code = $product_id;
|
123 |
+
|
124 |
+
if (isset($order_code))
|
125 |
+
$code = $order_code.'__'.$product_id;
|
126 |
+
|
127 |
+
$result = $this->getReport($code.'__%');
|
128 |
+
|
129 |
+
return new Youstice_Reports_ProductReport($result);
|
130 |
+
}
|
131 |
+
|
132 |
+
public function getOrderReport($order_code, $product_codes = array())
|
133 |
+
{
|
134 |
+
$result = $this->getReport('^'.$order_code.'__[0-9]*$', true);
|
135 |
+
|
136 |
+
if (count($product_codes))
|
137 |
+
{
|
138 |
+
//get products
|
139 |
+
foreach ($product_codes as $code)
|
140 |
+
{
|
141 |
+
$found_report = $this->getProductReport($code);
|
142 |
+
|
143 |
+
if ($found_report->exists())
|
144 |
+
$result['products'][] = $found_report->toArray();
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
return new Youstice_Reports_OrderReport($result);
|
149 |
+
}
|
150 |
+
|
151 |
+
protected function getReport($searchValue, $useRegexp = false) {
|
152 |
+
if(isset($this->cached[$searchValue]))
|
153 |
+
return $this->cached[$searchValue];
|
154 |
+
|
155 |
+
$searchBy = $useRegexp ? "REGEXP" : "LIKE";
|
156 |
+
|
157 |
+
//try to find filled report
|
158 |
+
$query_filled = $this->prepareRegexpQuery('SELECT * FROM '.$this->table_prefix.'yrs_reports WHERE code '.$searchBy.' ? AND status IS NOT NULL ORDER BY created_at DESC, code DESC LIMIT 1');
|
159 |
+
$query_res = $this->executeQueryFetch($query_filled, array($searchValue));
|
160 |
+
|
161 |
+
//otherwise select last
|
162 |
+
if(!$query_res) {
|
163 |
+
$query_last = $this->prepareRegexpQuery('SELECT * FROM '.$this->table_prefix.'yrs_reports WHERE code '.$searchBy.' ? ORDER BY created_at DESC, code DESC LIMIT 1');
|
164 |
+
|
165 |
+
$query_res = $this->executeQueryFetch($query_last, array($searchValue));
|
166 |
+
}
|
167 |
+
|
168 |
+
return $this->cached[$searchValue] = $query_res;
|
169 |
+
}
|
170 |
+
|
171 |
+
public function createWebReport($user_id)
|
172 |
+
{
|
173 |
+
return $this->createReport('WEB_REPORT__'.$user_id, $user_id);
|
174 |
+
}
|
175 |
+
|
176 |
+
public function createReport($code, $user_id, $remaining_time = 0)
|
177 |
+
{
|
178 |
+
$this->connection->beginTransaction();
|
179 |
+
$this->lockTable();
|
180 |
+
|
181 |
+
$query_count = $this->prepareRegexpQuery('SELECT count(1) count FROM '.$this->table_prefix.'yrs_reports WHERE code REGEXP ?');
|
182 |
+
$result_count = $this->executeQueryFetch($query_count, array('^'.$code.'__[0-9]*$'));
|
183 |
+
|
184 |
+
$code .= '__'.($result_count['count'] + 1);
|
185 |
+
|
186 |
+
$stmt = $this->connection->prepare('INSERT INTO '.$this->table_prefix.'yrs_reports
|
187 |
+
(code, user_id, status, remaining_time, created_at, updated_at) VALUES (?, ?, null, ?, NOW(), NOW())');
|
188 |
+
|
189 |
+
try {
|
190 |
+
$stmt->execute(array($code, $user_id, $remaining_time));
|
191 |
+
|
192 |
+
$this->unlockTable();
|
193 |
+
$this->connection->commit();
|
194 |
+
} catch (PDOException $e) {
|
195 |
+
$this->connection->rollBack();
|
196 |
+
|
197 |
+
if ((int)$e->getCode() === 23000)
|
198 |
+
throw new Exception('Report with code '.$code.' already exists');
|
199 |
+
else
|
200 |
+
throw new Exception ('Creating report failed');
|
201 |
+
}
|
202 |
+
|
203 |
+
return $code;
|
204 |
+
}
|
205 |
+
|
206 |
+
public function updateReportStatus($code, $status)
|
207 |
+
{
|
208 |
+
if (!trim($status))
|
209 |
+
return;
|
210 |
+
|
211 |
+
$stmt = $this->connection->prepare('UPDATE '.$this->table_prefix.'yrs_reports SET status = ?, updated_at = NOW() WHERE code = ?');
|
212 |
+
|
213 |
+
return $stmt->execute(array($status, $code));
|
214 |
+
}
|
215 |
+
|
216 |
+
public function updateReportRemainingTime($code, $time)
|
217 |
+
{
|
218 |
+
if ((int)$time < 0 || $time == null)
|
219 |
+
return;
|
220 |
+
|
221 |
+
$stmt = $this->connection->prepare('UPDATE '.$this->table_prefix.'yrs_reports SET remaining_time = ?, updated_at = NOW() WHERE code = ?');
|
222 |
+
|
223 |
+
return $stmt->execute(array($time, $code));
|
224 |
+
}
|
225 |
+
|
226 |
+
public function getReportsByUser($user_id)
|
227 |
+
{
|
228 |
+
$stmt = $this->connection->prepare('SELECT * FROM '.$this->table_prefix.'yrs_reports WHERE user_id = ?');
|
229 |
+
$stmt->execute(array($user_id));
|
230 |
+
|
231 |
+
return $stmt->fetchAll();
|
232 |
+
}
|
233 |
+
|
234 |
+
protected function executeQueryFetch($query, array $params)
|
235 |
+
{
|
236 |
+
$stmt = $this->connection->prepare($query);
|
237 |
+
|
238 |
+
$stmt->execute($params);
|
239 |
+
|
240 |
+
return $stmt->fetch();
|
241 |
+
}
|
242 |
+
|
243 |
+
protected function prepareRegexpQuery($query = '')
|
244 |
+
{
|
245 |
+
if($this->db_driver === 'pgsql')
|
246 |
+
$query = str_replace('REGEXP', '~', $query);
|
247 |
+
|
248 |
+
return $query;
|
249 |
+
}
|
250 |
+
|
251 |
+
protected function lockTable()
|
252 |
+
{
|
253 |
+
if ($this->db_driver == 'pgsql')
|
254 |
+
{
|
255 |
+
$this->connection->exec('LOCK TABLE '.$this->table_prefix.'yrs_reports IN ACCESS EXCLUSIVE MODE');
|
256 |
+
}
|
257 |
+
else
|
258 |
+
{
|
259 |
+
$this->connection->exec('LOCK TABLES '.$this->table_prefix.'yrs_reports WRITE');
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
protected function unlockTable()
|
264 |
+
{
|
265 |
+
if($this->db_driver !== 'pgsql')
|
266 |
+
$this->connection->exec('UNLOCK TABLES');
|
267 |
+
}
|
268 |
+
|
269 |
+
public function install()
|
270 |
+
{
|
271 |
+
$queries = $this->installPrepareQueries();
|
272 |
+
|
273 |
+
$installed = 0;
|
274 |
+
foreach ($queries as $query)
|
275 |
+
{
|
276 |
+
if ($this->db_driver == 'pgsql')
|
277 |
+
{
|
278 |
+
$query = str_replace('remaining_time INTEGER DEFAULT NULL', 'remaining_time INTEGER', $query);
|
279 |
+
$query = str_replace('int(10) unsigned', 'INTEGER', $query);
|
280 |
+
$query = str_replace('DATETIME', 'timestamp without time zone', $query);
|
281 |
+
}
|
282 |
+
|
283 |
+
try {
|
284 |
+
if ($this->connection->query($query))
|
285 |
+
$installed++;
|
286 |
+
} catch (PDOException $e) {
|
287 |
+
return false;
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
return count($queries) == $installed;
|
292 |
+
}
|
293 |
+
|
294 |
+
protected function installPrepareQueries()
|
295 |
+
{
|
296 |
+
return array('CREATE TABLE IF NOT EXISTS '.$this->table_prefix."yrs_reports(\n
|
297 |
+
code VARCHAR(255) NOT NULL DEFAULT '',
|
298 |
+
user_id int(10) unsigned NOT NULL,
|
299 |
+
status VARCHAR(200) NULL,
|
300 |
+
remaining_time int(10) unsigned DEFAULT NULL,
|
301 |
+
created_at DATETIME NULL,
|
302 |
+
updated_at DATETIME NULL,
|
303 |
+
PRIMARY KEY (code)
|
304 |
+
)");
|
305 |
+
}
|
306 |
+
|
307 |
+
public function uninstall()
|
308 |
+
{
|
309 |
+
if($this->session !== null)
|
310 |
+
$this->session->destroy();
|
311 |
+
|
312 |
+
return $this->connection->query('DROP TABLE IF EXISTS `'.$this->table_prefix.'yrs_reports`');
|
313 |
+
}
|
314 |
+
|
315 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/LocalInterface.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles localy stored reports
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
interface Youstice_LocalInterface {
|
11 |
+
|
12 |
+
public function __construct(array $db);
|
13 |
+
|
14 |
+
public function getCachedRemoteReportLink($code);
|
15 |
+
|
16 |
+
public function setCachedRemoteReportLink($code, $link);
|
17 |
+
|
18 |
+
public function getChangedReportStatusesCount();
|
19 |
+
|
20 |
+
public function setChangedReportStatusesCount($value);
|
21 |
+
|
22 |
+
public function getWebReport($user_id);
|
23 |
+
|
24 |
+
public function getProductReport($product_id, $order_code = null);
|
25 |
+
|
26 |
+
public function getOrderReport($order_code, $product_codes = array());
|
27 |
+
|
28 |
+
public function createWebReport($user_id);
|
29 |
+
|
30 |
+
public function createReport($code, $user_id, $remaining_time = 0);
|
31 |
+
|
32 |
+
public function updateReportStatus($code, $status);
|
33 |
+
|
34 |
+
public function updateReportRemainingTime($code, $time);
|
35 |
+
|
36 |
+
public function getReportsByUser($user_id);
|
37 |
+
|
38 |
+
public function install();
|
39 |
+
|
40 |
+
public function uninstall();
|
41 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Providers/SessionProvider.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Youstice_Providers_SessionProvider implements Youstice_Providers_SessionProviderInterface {
|
4 |
+
|
5 |
+
public function start()
|
6 |
+
{
|
7 |
+
if (!Youstice_Helpers_HelperFunctions::isSessionStarted())
|
8 |
+
session_start();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function get($var)
|
12 |
+
{
|
13 |
+
if (!isset($_SESSION['YRS']))
|
14 |
+
return false;
|
15 |
+
|
16 |
+
if (!isset($_SESSION['YRS'][$var]))
|
17 |
+
return false;
|
18 |
+
|
19 |
+
return $_SESSION['YRS'][$var];
|
20 |
+
}
|
21 |
+
|
22 |
+
public function set($var, $value)
|
23 |
+
{
|
24 |
+
if (!isset($_SESSION['YRS']))
|
25 |
+
$_SESSION['YRS'] = array();
|
26 |
+
|
27 |
+
$_SESSION['YRS'][$var] = $value;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function destroy()
|
31 |
+
{
|
32 |
+
if (isset($_SESSION['YRS']))
|
33 |
+
$_SESSION['YRS'] = array();
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Providers/SessionProviderInterface.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Interface for session providers.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
interface Youstice_Providers_SessionProviderInterface {
|
11 |
+
public function start();
|
12 |
+
public function get($var);
|
13 |
+
public function set($var, $value);
|
14 |
+
public function destroy();
|
15 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Remote.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Handles remote API communication
|
5 |
+
*
|
6 |
+
* @author Youstice
|
7 |
+
* @copyright (c) 2014, Youstice
|
8 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Handles remote API communication
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class Youstice_Remote extends Youstice_Request {
|
16 |
+
|
17 |
+
protected $api_url = 'https://api.youstice.com/YApiServices/services/';
|
18 |
+
protected $api_sandbox_url = 'https://api-sand.youstice.com/YApiServices/services/';
|
19 |
+
protected $api_key;
|
20 |
+
protected $use_sandbox;
|
21 |
+
protected $lang;
|
22 |
+
protected $shop_sells;
|
23 |
+
protected $shop_software_type;
|
24 |
+
protected $shop_software_version;
|
25 |
+
|
26 |
+
public function __construct($api_key, $use_sandbox, $lang, $shop_sells, $shop_software_type, $shop_software_version = '')
|
27 |
+
{
|
28 |
+
$this->api_key = $api_key;
|
29 |
+
$this->use_sandbox = $use_sandbox;
|
30 |
+
$this->lang = $lang;
|
31 |
+
$this->shop_sells = $shop_sells;
|
32 |
+
$this->shop_software_type = $shop_software_type;
|
33 |
+
$this->shop_software_version = $shop_software_version;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
*
|
38 |
+
* @return string html
|
39 |
+
*/
|
40 |
+
public function getLogoWidgetData($updates_count, $claim_url = '', $is_logged_in = false)
|
41 |
+
{
|
42 |
+
$this->setAdditionalParam('numberOfUpdates', $updates_count);
|
43 |
+
$this->setAdditionalParam('claimUrl', $claim_url);
|
44 |
+
$this->setAdditionalParam('isLoggedIn', $is_logged_in);
|
45 |
+
|
46 |
+
$this->get('Api/logo');
|
47 |
+
|
48 |
+
$response = $this->responseToArray();
|
49 |
+
|
50 |
+
return $response['html'];
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getRemoteReportsData(array $local_reports_data)
|
54 |
+
{
|
55 |
+
//no request when no data
|
56 |
+
if(empty($local_reports_data))
|
57 |
+
return $local_reports_data;
|
58 |
+
|
59 |
+
$send = array('orders' => array());
|
60 |
+
|
61 |
+
foreach ($local_reports_data as $local_report_data)
|
62 |
+
$send['orders'][] = array('orderNumber' => $local_report_data['code']);
|
63 |
+
|
64 |
+
$this->post('Api/claims', $send);
|
65 |
+
$response = $this->responseToArray();
|
66 |
+
|
67 |
+
return $response['orders'];
|
68 |
+
}
|
69 |
+
|
70 |
+
public function createWebReport($order_number)
|
71 |
+
{
|
72 |
+
$this->post('Api/addTransactionShop', array('orderNumber' => $order_number));
|
73 |
+
|
74 |
+
$response = $this->responseToArray();
|
75 |
+
|
76 |
+
return $response['redirect_link'];
|
77 |
+
}
|
78 |
+
|
79 |
+
public function createOrderReport(Youstice_ShopOrder $order, $code)
|
80 |
+
{
|
81 |
+
$data = $order->toArray();
|
82 |
+
$now = new Datetime();
|
83 |
+
|
84 |
+
$request_data = array(
|
85 |
+
'itemType' => $this->shop_sells,
|
86 |
+
'orderNumber' => $code,
|
87 |
+
'itemDescription' => $data['description'],
|
88 |
+
'itemName' => $data['name'],
|
89 |
+
'itemCurrency' => $data['currency'],
|
90 |
+
'itemPrice' => $data['price'],
|
91 |
+
'itemCode' => $data['id'],
|
92 |
+
'deliveryDate' => $data['deliveryDate'],
|
93 |
+
'orderDate' => $data['orderDate'] ? $data['orderDate'] : $now->format(Datetime::ISO8601),
|
94 |
+
'shopType' => $this->shop_software_type,
|
95 |
+
'image' => $order->getImage(),
|
96 |
+
'other' => $data['other'],
|
97 |
+
);
|
98 |
+
|
99 |
+
$this->post('Api/addTransaction', $request_data);
|
100 |
+
|
101 |
+
$response = $this->responseToArray();
|
102 |
+
|
103 |
+
return $response['redirect_link'];
|
104 |
+
}
|
105 |
+
|
106 |
+
public function createProductReport(Youstice_ShopProduct $product, $code)
|
107 |
+
{
|
108 |
+
$data = $product->toArray();
|
109 |
+
$now = new Datetime();
|
110 |
+
|
111 |
+
$request_data = array(
|
112 |
+
'itemType' => $this->shop_sells,
|
113 |
+
'orderNumber' => $code,
|
114 |
+
'itemDescription' => $data['description'],
|
115 |
+
'itemName' => $data['name'],
|
116 |
+
'itemCurrency' => $data['currency'],
|
117 |
+
'itemPrice' => $data['price'],
|
118 |
+
'itemCode' => $data['id'],
|
119 |
+
'deliveryDate' => $data['deliveryDate'],
|
120 |
+
'orderDate' => $data['orderDate'] ? $data['orderDate'] : $now->format(Datetime::ISO8601),
|
121 |
+
'shopType' => $this->shop_software_type,
|
122 |
+
'image' => $data['image'],
|
123 |
+
'other' => $data['other'],
|
124 |
+
);
|
125 |
+
|
126 |
+
$this->post('Api/addTransaction', $request_data);
|
127 |
+
|
128 |
+
$response = $this->responseToArray();
|
129 |
+
|
130 |
+
return $response['redirect_link'];
|
131 |
+
}
|
132 |
+
|
133 |
+
public function checkApiKey()
|
134 |
+
{
|
135 |
+
$request_data = array(
|
136 |
+
'platform' => $this->shop_software_type,
|
137 |
+
'version' => $this->shop_software_version
|
138 |
+
);
|
139 |
+
|
140 |
+
$this->post('Api/auth', $request_data);
|
141 |
+
|
142 |
+
$response = $this->responseToArray();
|
143 |
+
|
144 |
+
return $response && $response['result'] == 'true';
|
145 |
+
}
|
146 |
+
|
147 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/BaseReport.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Represents base class for orders
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Reports_BaseReport {
|
11 |
+
|
12 |
+
protected $exists = false;
|
13 |
+
protected $data = array();
|
14 |
+
|
15 |
+
public function __construct($data = array())
|
16 |
+
{
|
17 |
+
if (isset($data) && is_array($data) && count($data))
|
18 |
+
{
|
19 |
+
$this->exists = true;
|
20 |
+
$this->data = $data;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
public function exists()
|
25 |
+
{
|
26 |
+
return $this->exists && $this->getStatus() !== null;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Creating another new report is allowed only on this conditions
|
31 |
+
* @return boolean
|
32 |
+
*/
|
33 |
+
public function canCreateNew()
|
34 |
+
{
|
35 |
+
if (!$this->exists())
|
36 |
+
return true;
|
37 |
+
|
38 |
+
$status = $this->getStatus();
|
39 |
+
|
40 |
+
if (Youstice_Tools::strtolower($status) == 'terminated')
|
41 |
+
return true;
|
42 |
+
|
43 |
+
if ($status == 'Problem reported')
|
44 |
+
return true;
|
45 |
+
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getStatus()
|
50 |
+
{
|
51 |
+
if (count($this->data) && isset($this->data['status']))
|
52 |
+
return $this->data['status'];
|
53 |
+
|
54 |
+
if(isset($this->data['created_at']) && strtotime($this->data['created_at']) + 600 > time())
|
55 |
+
return 'Problem reported';
|
56 |
+
|
57 |
+
return null;
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getRemainingTime()
|
61 |
+
{
|
62 |
+
$remaining_time = isset($this->data['remaining_time']) ? $this->data['remaining_time'] : 0;
|
63 |
+
|
64 |
+
if (!$remaining_time || !isset($this->data['updated_at']))
|
65 |
+
return 0;
|
66 |
+
|
67 |
+
$actual_remaining_time = $remaining_time - (time() - strtotime($this->data['updated_at']));
|
68 |
+
|
69 |
+
return $actual_remaining_time >= 0 ? $actual_remaining_time : 0;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function toArray()
|
73 |
+
{
|
74 |
+
return $this->data;
|
75 |
+
}
|
76 |
+
|
77 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/OrderReport.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Represents one order report.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Reports_OrderReport extends Youstice_Reports_BaseReport {
|
11 |
+
|
12 |
+
public function orderReportExists()
|
13 |
+
{
|
14 |
+
return isset($this->data['code']) && isset($this->data['created_at']) && $this->getStatus() !== null;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getProducts()
|
18 |
+
{
|
19 |
+
return isset($this->data['products']) ? $this->data['products'] : array();
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getReportedProductsCount()
|
23 |
+
{
|
24 |
+
return isset($this->data['products']) ? count($this->data['products']) : 0;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getCode()
|
28 |
+
{
|
29 |
+
if (count($this->data) && isset($this->data['code']))
|
30 |
+
return $this->data['code'];
|
31 |
+
|
32 |
+
return $this->data['id'];
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getName()
|
36 |
+
{
|
37 |
+
if (count($this->data) && isset($this->data['name']))
|
38 |
+
return $this->data['name'];
|
39 |
+
|
40 |
+
return '';
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getFirstProductStatus()
|
44 |
+
{
|
45 |
+
if (isset($this->data['products']) && count($this->data['products']))
|
46 |
+
{
|
47 |
+
$status = $this->data['products'][0]['status'];
|
48 |
+
|
49 |
+
return Youstice_Tools::strlen($status) ? $status : 'Problem reported';
|
50 |
+
}
|
51 |
+
|
52 |
+
return '';
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/ProductReport.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Represents one product report.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Reports_ProductReport extends Youstice_Reports_BaseReport {
|
11 |
+
|
12 |
+
public function getCode()
|
13 |
+
{
|
14 |
+
if (count($this->data) && isset($this->data['code']) && trim($this->data['code']))
|
15 |
+
return $this->data['code'];
|
16 |
+
else
|
17 |
+
return $this->data['orderId'].'__'.$this->data['id'];
|
18 |
+
}
|
19 |
+
|
20 |
+
public function setCode($code)
|
21 |
+
{
|
22 |
+
$this->data['code'] = $code;
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Reports/WebReport.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Represents one web report.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Reports_WebReport extends Youstice_Reports_BaseReport {
|
11 |
+
|
12 |
+
public function getCode()
|
13 |
+
{
|
14 |
+
if (count($this->data) && isset($this->data['code']))
|
15 |
+
return $this->data['code'];
|
16 |
+
|
17 |
+
return 'WEB_REPORT__';
|
18 |
+
}
|
19 |
+
|
20 |
+
public function setCode($user_id)
|
21 |
+
{
|
22 |
+
$this->data['code'] = 'WEB_REPORT__'.$user_id;
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Request.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Base communication interface
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Request {
|
11 |
+
|
12 |
+
private $auth_login = 'adminapi';
|
13 |
+
private $auth_passw = 'AdminApi';
|
14 |
+
protected $response = null;
|
15 |
+
private $additional_params = array();
|
16 |
+
|
17 |
+
public function returnResponse()
|
18 |
+
{
|
19 |
+
return $this->response;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function responseToArray()
|
23 |
+
{
|
24 |
+
$data = Youstice_Tools::jsonDecode($this->response, true);
|
25 |
+
|
26 |
+
return $data;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function setAdditionalParam($key, $val)
|
30 |
+
{
|
31 |
+
$this->additional_params[$key] = $val;
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function generateUrl($url)
|
35 |
+
{
|
36 |
+
$api_url = $this->use_sandbox ? $this->api_sandbox_url : $this->api_url;
|
37 |
+
|
38 |
+
$return_url = $api_url.$url.'/'.$this->api_key.'?version=1&channel='.$this->shop_software_type;
|
39 |
+
|
40 |
+
if (count($this->additional_params))
|
41 |
+
{
|
42 |
+
foreach ($this->additional_params as $key => $val) {
|
43 |
+
$return_url .= '&' . urlencode($key) . '=' . urlencode($val);
|
44 |
+
}
|
45 |
+
|
46 |
+
//reset params for next calls
|
47 |
+
$this->additional_params = array();
|
48 |
+
}
|
49 |
+
|
50 |
+
return $return_url;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function post($url, $data = array())
|
54 |
+
{
|
55 |
+
$url = $this->generateUrl($url);
|
56 |
+
$this->postStream($url, $data);
|
57 |
+
|
58 |
+
if ($this->response === false || $this->response === null)
|
59 |
+
throw new Youstice_FailedRemoteConnectionException('Post Request failed: '.$url);
|
60 |
+
|
61 |
+
if (strpos($this->response, 'Invalid api key') !== false)
|
62 |
+
throw new Youstice_InvalidApiKeyException;
|
63 |
+
|
64 |
+
return $this->response;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function get($url)
|
68 |
+
{
|
69 |
+
$url = $this->generateUrl($url);
|
70 |
+
$this->getStream($url);
|
71 |
+
|
72 |
+
if ($this->response === false || $this->response === null)
|
73 |
+
throw new Youstice_FailedRemoteConnectionException('get Request failed: '.$url);
|
74 |
+
|
75 |
+
if (strpos($this->response, 'Invalid api key') !== false)
|
76 |
+
throw new Youstice_InvalidApiKeyException;
|
77 |
+
|
78 |
+
return $this->response;
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function getStream($url)
|
82 |
+
{
|
83 |
+
$request = stream_context_create(array(
|
84 |
+
'http' => array(
|
85 |
+
'method' => 'GET',
|
86 |
+
'ignore_errors' => false,
|
87 |
+
'timeout' => 10.0,
|
88 |
+
'header' => "Content-Type: application/json\r\n".'Accept-Language: '.$this->lang."\r\n",
|
89 |
+
)
|
90 |
+
));
|
91 |
+
|
92 |
+
$url = str_replace('://', '://'.$this->auth_login.':'.$this->auth_passw.'@', $url);
|
93 |
+
|
94 |
+
$this->response = Youstice_Tools::file_get_contents($url, false, $request);
|
95 |
+
}
|
96 |
+
|
97 |
+
protected function postStream($url, $data)
|
98 |
+
{
|
99 |
+
$request = stream_context_create(array(
|
100 |
+
'http' => array(
|
101 |
+
'method' => 'POST',
|
102 |
+
'ignore_errors' => false,
|
103 |
+
'timeout' => 10.0,
|
104 |
+
'content' => Youstice_Tools::jsonEncode($data),
|
105 |
+
'header' => "Content-Type: application/json\r\n".'Accept-Language: '.$this->lang."\r\n",
|
106 |
+
)
|
107 |
+
));
|
108 |
+
|
109 |
+
$url = str_replace('://', '://'.$this->auth_login.':'.$this->auth_passw.'@', $url);
|
110 |
+
|
111 |
+
$this->response = Youstice_Tools::file_get_contents($url, false, $request);
|
112 |
+
}
|
113 |
+
|
114 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopItem.php
ADDED
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class representing one shop item (order or product)
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
abstract class Youstice_ShopItem {
|
11 |
+
|
12 |
+
protected $data = array(
|
13 |
+
'description' => '',
|
14 |
+
'name' => '',
|
15 |
+
'currency' => '',
|
16 |
+
'price' => 0.0,
|
17 |
+
'id' => -1,
|
18 |
+
'deliveryDate' => '',
|
19 |
+
'orderDate' => '',
|
20 |
+
'image' => '',
|
21 |
+
'other' => '',
|
22 |
+
'products' => array(),
|
23 |
+
'href' => ''
|
24 |
+
);
|
25 |
+
|
26 |
+
public function __construct($description, $name = '', $currency = 'EUR', $price = 0.0, $id = null, $delivery_date = null,
|
27 |
+
$order_date = null, $image = null, $other_info = '', $products = array())
|
28 |
+
{
|
29 |
+
//one array parameter
|
30 |
+
if (is_array($description) && count($description))
|
31 |
+
{
|
32 |
+
$this->setDescription($description['description']);
|
33 |
+
$this->setName($description['name']);
|
34 |
+
$this->setCurrency($description['currency']);
|
35 |
+
$this->setPrice($description['price']);
|
36 |
+
$this->setId($description['id']);
|
37 |
+
$this->setDeliveryDate($description['deliveryDate']);
|
38 |
+
$this->setOrderDate($description['orderDate']);
|
39 |
+
if (isset($description['image']) && is_readable($description['image']))
|
40 |
+
$this->setImagePath($description['image']);
|
41 |
+
else
|
42 |
+
$this->setImageRawBytes($description['image']);
|
43 |
+
$this->setOtherInfo($description['otherInfo']);
|
44 |
+
$this->setProducts($description['products']);
|
45 |
+
}
|
46 |
+
|
47 |
+
$this->setDescription($description);
|
48 |
+
$this->setName($name);
|
49 |
+
$this->setCurrency($currency);
|
50 |
+
$this->setPrice($price);
|
51 |
+
$this->setId($id);
|
52 |
+
$this->setDeliveryDate($delivery_date);
|
53 |
+
$this->setOrderDate($order_date);
|
54 |
+
if (isset($image) && is_readable($image))
|
55 |
+
$this->setImagePath($image);
|
56 |
+
else
|
57 |
+
$this->setImageRawBytes($image);
|
58 |
+
$this->setOtherInfo($other_info);
|
59 |
+
$this->setProducts($products);
|
60 |
+
|
61 |
+
return $this;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getDescription()
|
65 |
+
{
|
66 |
+
return $this->data['description'];
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getName()
|
70 |
+
{
|
71 |
+
return $this->data['name'];
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getCurrency()
|
75 |
+
{
|
76 |
+
return $this->data['currency'];
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getPrice()
|
80 |
+
{
|
81 |
+
return $this->data['price'];
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getId()
|
85 |
+
{
|
86 |
+
return $this->data['id'];
|
87 |
+
}
|
88 |
+
|
89 |
+
public function getDeliveryDate()
|
90 |
+
{
|
91 |
+
return $this->data['deliveryDate'];
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getOrderDate()
|
95 |
+
{
|
96 |
+
return $this->data['orderDate'];
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getImage()
|
100 |
+
{
|
101 |
+
return $this->data['image'];
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getOtherInfo()
|
105 |
+
{
|
106 |
+
return $this->data['other'];
|
107 |
+
}
|
108 |
+
|
109 |
+
public function getProducts()
|
110 |
+
{
|
111 |
+
return $this->data['products'];
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getOrderId()
|
115 |
+
{
|
116 |
+
return $this->data['orderId'];
|
117 |
+
}
|
118 |
+
|
119 |
+
public function getHref()
|
120 |
+
{
|
121 |
+
return $this->data['href'];
|
122 |
+
}
|
123 |
+
|
124 |
+
public function setDescription($description = '')
|
125 |
+
{
|
126 |
+
$this->data['description'] = $description;
|
127 |
+
|
128 |
+
return $this;
|
129 |
+
}
|
130 |
+
|
131 |
+
public function setName($name = '')
|
132 |
+
{
|
133 |
+
$this->data['name'] = $name;
|
134 |
+
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function setCurrency($currency = '')
|
139 |
+
{
|
140 |
+
$this->data['currency'] = $currency;
|
141 |
+
|
142 |
+
return $this;
|
143 |
+
}
|
144 |
+
|
145 |
+
public function setPrice($price = 0.0)
|
146 |
+
{
|
147 |
+
if ($price < 0)
|
148 |
+
throw new InvalidArgumentException('Price cannot be negative number.');
|
149 |
+
|
150 |
+
$this->data['price'] = $price;
|
151 |
+
|
152 |
+
return $this;
|
153 |
+
}
|
154 |
+
|
155 |
+
public function setId($id = null)
|
156 |
+
{
|
157 |
+
$this->data['id'] = $id;
|
158 |
+
|
159 |
+
return $this;
|
160 |
+
}
|
161 |
+
|
162 |
+
public function setDeliveryDate($delivery_date)
|
163 |
+
{
|
164 |
+
if (Youstice_Tools::strlen($delivery_date > 1)) {
|
165 |
+
$timestamp = strtotime($delivery_date);
|
166 |
+
$this->data['deliveryDate'] = date('c', $timestamp);
|
167 |
+
return $this;
|
168 |
+
}
|
169 |
+
|
170 |
+
return $this;
|
171 |
+
}
|
172 |
+
|
173 |
+
public function setOrderDate($order_date)
|
174 |
+
{
|
175 |
+
if (Youstice_Tools::strlen($order_date > 1)) {
|
176 |
+
$timestamp = strtotime($order_date);
|
177 |
+
$this->data['orderDate'] = date('c', $timestamp);
|
178 |
+
return $this;
|
179 |
+
}
|
180 |
+
|
181 |
+
return $this;
|
182 |
+
}
|
183 |
+
|
184 |
+
public function setImage($image = '')
|
185 |
+
{
|
186 |
+
if (is_readable($image))
|
187 |
+
$this->setImagePath($image);
|
188 |
+
else
|
189 |
+
$this->setImageRawBytes($image);
|
190 |
+
|
191 |
+
return $this;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function setImagePath($image = '')
|
195 |
+
{
|
196 |
+
$this->data['image'] = $this->loadImage($image);
|
197 |
+
|
198 |
+
return $this;
|
199 |
+
}
|
200 |
+
|
201 |
+
public function setImageRawBytes($image = '')
|
202 |
+
{
|
203 |
+
if (Youstice_Tools::strlen($image) > 0)
|
204 |
+
{
|
205 |
+
$image_data = $this->resize($image, 300, 300);
|
206 |
+
$a = 'base64_encode';
|
207 |
+
$this->data['image'] = $a($image_data);
|
208 |
+
}
|
209 |
+
|
210 |
+
return $this;
|
211 |
+
}
|
212 |
+
|
213 |
+
public function setOtherInfo($other_info = '')
|
214 |
+
{
|
215 |
+
$this->data['other'] = $other_info;
|
216 |
+
|
217 |
+
return $this;
|
218 |
+
}
|
219 |
+
|
220 |
+
public function setProducts($products = array())
|
221 |
+
{
|
222 |
+
$this->data['products'] = $products;
|
223 |
+
|
224 |
+
return $this;
|
225 |
+
}
|
226 |
+
|
227 |
+
public function setHref($href = '')
|
228 |
+
{
|
229 |
+
$this->data['href'] = $href;
|
230 |
+
|
231 |
+
return $this;
|
232 |
+
}
|
233 |
+
|
234 |
+
public function toArray()
|
235 |
+
{
|
236 |
+
return $this->data;
|
237 |
+
}
|
238 |
+
|
239 |
+
protected function loadImage($path)
|
240 |
+
{
|
241 |
+
if ($path == null || !trim($path))
|
242 |
+
return;
|
243 |
+
|
244 |
+
if (is_readable($path))
|
245 |
+
{
|
246 |
+
$image_data = Youstice_Tools::file_get_contents($path);
|
247 |
+
|
248 |
+
if ($image_data === false)
|
249 |
+
throw new Exception('Image does not exists');
|
250 |
+
|
251 |
+
//correct image
|
252 |
+
if (Youstice_Tools::strlen($image_data) > 0)
|
253 |
+
{
|
254 |
+
$image_data = $this->resize($image_data, 300, 300);
|
255 |
+
$a = 'base64_encode';
|
256 |
+
return $a($image_data);
|
257 |
+
}
|
258 |
+
|
259 |
+
return null;
|
260 |
+
}
|
261 |
+
else
|
262 |
+
throw new Exception('Image path is not readable');
|
263 |
+
}
|
264 |
+
|
265 |
+
protected function resize($image_data, $width = 100, $height = 100, $stretch = false)
|
266 |
+
{
|
267 |
+
$file = tempnam(sys_get_temp_dir(), md5(time().'YRS'));
|
268 |
+
|
269 |
+
if ($file === false)
|
270 |
+
throw new Exception('Creating temporary file failed. Temporary Directory: '.sys_get_temp_dir());
|
271 |
+
|
272 |
+
$file_handle = fopen($file, 'w');
|
273 |
+
fwrite($file_handle, $image_data);
|
274 |
+
fclose($file_handle);
|
275 |
+
|
276 |
+
$mime = $this->getMimeType($file);
|
277 |
+
|
278 |
+
switch ($mime)
|
279 |
+
{
|
280 |
+
case 'image/bmp':
|
281 |
+
$handle = imagecreatefromwbmp($file);
|
282 |
+
break;
|
283 |
+
case 'image/jpeg':
|
284 |
+
$handle = imagecreatefromjpeg($file);
|
285 |
+
break;
|
286 |
+
case 'image/gif':
|
287 |
+
$handle = imagecreatefromgif($file);
|
288 |
+
break;
|
289 |
+
case 'image/png':
|
290 |
+
$handle = imagecreatefrompng($file);
|
291 |
+
break;
|
292 |
+
default:
|
293 |
+
throw new Exception('Unsupported image type '.$mime);
|
294 |
+
}
|
295 |
+
|
296 |
+
$dimensions = getimagesize($file);
|
297 |
+
|
298 |
+
if (!$dimensions)
|
299 |
+
throw new Exception('Reading of temporary file failed');
|
300 |
+
|
301 |
+
$offset_x = 0;
|
302 |
+
$offset_y = 0;
|
303 |
+
$dst_w = $width;
|
304 |
+
$dst_h = $height;
|
305 |
+
|
306 |
+
$bnd_x = $width / $dimensions[0];
|
307 |
+
$bnd_y = $height / $dimensions[1];
|
308 |
+
|
309 |
+
if ($stretch)
|
310 |
+
{
|
311 |
+
if ($bnd_x > $bnd_y)
|
312 |
+
{
|
313 |
+
$ratio = $height / $width;
|
314 |
+
$temp = floor($dimensions[1] / $ratio);
|
315 |
+
|
316 |
+
if ($temp > $dimensions[0])
|
317 |
+
$dimensions[1] -= ($temp - $dimensions[0]) * $ratio;
|
318 |
+
else
|
319 |
+
$dimensions[0] = $temp;
|
320 |
+
}
|
321 |
+
else
|
322 |
+
{
|
323 |
+
$ratio = $width / $height;
|
324 |
+
$temp = floor($dimensions[0] / $ratio);
|
325 |
+
if ($temp > $dimensions[1])
|
326 |
+
$dimensions[0] -= ($temp - $dimensions[1]) * $ratio;
|
327 |
+
else
|
328 |
+
$dimensions[1] = $temp;
|
329 |
+
}
|
330 |
+
}
|
331 |
+
else
|
332 |
+
{
|
333 |
+
if ($bnd_x > $bnd_y)
|
334 |
+
{
|
335 |
+
# height reaches boundary first, modify width
|
336 |
+
$offset_x = ($width - $dimensions[0] * $bnd_y) / 2;
|
337 |
+
$dst_w = $dimensions[0] * $bnd_y;
|
338 |
+
}
|
339 |
+
else
|
340 |
+
{
|
341 |
+
# width reaches boundary first (or equal), modify height
|
342 |
+
$offset_y = ($height - $dimensions[1] * $bnd_x) / 2;
|
343 |
+
$dst_h = $dimensions[1] * $bnd_x;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
$preview = imagecreatetruecolor($width, $height);
|
348 |
+
|
349 |
+
if (!$preview)
|
350 |
+
throw new Exception('Creating thumbnail failed');
|
351 |
+
|
352 |
+
# draw white background -> opravene na transparent
|
353 |
+
$c = imagecolorallocatealpha($preview, 255, 255, 255, 0);
|
354 |
+
if ($c !== false)
|
355 |
+
{
|
356 |
+
imagefilledrectangle($preview, 0, 0, $width, $height, $c);
|
357 |
+
imagecolortransparent($preview, $c);
|
358 |
+
imagecolordeallocate($preview, $c);
|
359 |
+
}
|
360 |
+
|
361 |
+
if (!imagecopyresampled($preview, $handle, $offset_x, $offset_y, 0, 0, $dst_w, $dst_h, $dimensions[0], $dimensions[1]))
|
362 |
+
throw new Exception('Creating thumbnail failed');
|
363 |
+
|
364 |
+
unlink($file);
|
365 |
+
imagedestroy($handle);
|
366 |
+
|
367 |
+
ob_start();
|
368 |
+
imagejpeg($preview);
|
369 |
+
imagedestroy($preview);
|
370 |
+
return ob_get_clean();
|
371 |
+
}
|
372 |
+
|
373 |
+
protected function getMimeType($filename)
|
374 |
+
{
|
375 |
+
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
376 |
+
$mime = finfo_file($finfo, $filename);
|
377 |
+
finfo_close($finfo);
|
378 |
+
return $mime;
|
379 |
+
}
|
380 |
+
|
381 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopOrder.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The shop order it self.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_ShopOrder extends Youstice_ShopItem {
|
11 |
+
|
12 |
+
public static function create($description = array(), $name = '', $currency = 'EUR', $price = 0.0, $product_id = null,
|
13 |
+
$delivery_date = null, $order_date = null, $image = null, $other_info = '', $products = array())
|
14 |
+
{
|
15 |
+
return new self($description, $name, $currency, $price, $product_id, $delivery_date, $order_date,
|
16 |
+
$image, $other_info, $products);
|
17 |
+
}
|
18 |
+
|
19 |
+
protected function parseOneArrayParameter($array)
|
20 |
+
{
|
21 |
+
return new self($array['description'], $array['name'], $array['currency'], $array['price'], $array['productId'],
|
22 |
+
$array['deliveryDate'], $array['orderDate'], $array['image'], $array['otherInfo'], $array['products']);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Add product related to this order
|
27 |
+
* @param Youstice_ShopProduct $product of order
|
28 |
+
*/
|
29 |
+
public function addProduct(Youstice_ShopProduct $product)
|
30 |
+
{
|
31 |
+
$this->data['products'][] = $product;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getCode()
|
35 |
+
{
|
36 |
+
return $this->data['id'];
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getImage()
|
40 |
+
{
|
41 |
+
if (trim($this->data['image']))
|
42 |
+
return $this->data['image'];
|
43 |
+
|
44 |
+
elseif (count($this->data['products']))
|
45 |
+
return $this->data['products'][0]->getImage();
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/ShopProduct.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class represents one shop product
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_ShopProduct extends Youstice_ShopItem {
|
11 |
+
|
12 |
+
public static function create($description = array(), $name = '', $currency = 'EUR', $price = 0.0, $product_id = null,
|
13 |
+
$delivery_date = null, $order_date = null, $image = null, $other_info = '')
|
14 |
+
{
|
15 |
+
return new self($description, $name, $currency, $price, $product_id, $delivery_date, $order_date, $image, $other_info);
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function parseOneArrayParameter($array)
|
19 |
+
{
|
20 |
+
return new self($array['description'], $array['name'], $array['currency'], $array['price'], $array['productId'],
|
21 |
+
$array['deliveryDate'], $array['orderDate'], $array['image'], $array['otherInfo']);
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Set related order id to this product
|
26 |
+
* @param string $id
|
27 |
+
*/
|
28 |
+
public function setOrderId($id)
|
29 |
+
{
|
30 |
+
$this->data['orderId']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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Main Youstice simple class.
|
5 |
+
*
|
6 |
+
* @author Youstice
|
7 |
+
* @copyright (c) 2014, Youstice
|
8 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Youstice main API simple class
|
13 |
+
*
|
14 |
+
* @author KBS Development
|
15 |
+
*/
|
16 |
+
class Youstice_Simple_Api {
|
17 |
+
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
* @var type Youstice_Translator
|
21 |
+
*/
|
22 |
+
protected $translator;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* ISO 639-1 char code "en|sk|cz|es"
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
protected $language;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* string from youstice service
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
protected $api_key;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* product|service
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
protected $shop_sells;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* true for testing environment
|
44 |
+
* @var boolean
|
45 |
+
*/
|
46 |
+
protected $use_sandbox;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* prestashop|magento|ownSoftware
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
protected $shop_software_type;
|
53 |
+
|
54 |
+
/**
|
55 |
+
*
|
56 |
+
* @param string $language ISO 639-1 char code "en|sk|cz|es"
|
57 |
+
* @param string $api_key string from youstice service
|
58 |
+
* @param string $shop_sells "product|service"
|
59 |
+
* @param boolean $use_sandbox true if testing implementation
|
60 |
+
* @param string $shop_software_type prestashop|magento|ownSoftware
|
61 |
+
* @return Youstice_Simple_Api
|
62 |
+
*/
|
63 |
+
public static function create($language = 'sk', $api_key = '', $shop_sells = 'product', $use_sandbox = false, $shop_software_type = 'custom')
|
64 |
+
{
|
65 |
+
return new self($language, $api_key, $shop_sells, $use_sandbox, $shop_software_type);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
*
|
70 |
+
* @param string $language ISO 639-1 char code "en|sk|cz|es"
|
71 |
+
* @param string $api_key string from youstice service
|
72 |
+
* @param string $shop_sells "product|service"
|
73 |
+
* @param boolean $use_sandbox true if testing implementation
|
74 |
+
* @param string $shop_software_type prestashop|magento|ownSoftware
|
75 |
+
* @return Youstice_Simple_Api
|
76 |
+
*/
|
77 |
+
public function __construct($language = 'sk', $api_key = '', $shop_sells = 'product', $use_sandbox = false, $shop_software_type = 'custom')
|
78 |
+
{
|
79 |
+
$this->registerAutoloader();
|
80 |
+
|
81 |
+
$this->setLanguage($language);
|
82 |
+
$this->setApiKey($api_key, $use_sandbox);
|
83 |
+
$this->setThisShopSells($shop_sells);
|
84 |
+
$this->setShopSoftwareType($shop_software_type);
|
85 |
+
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Start Youstice API
|
91 |
+
* @return Youstice_Simple_Api
|
92 |
+
*/
|
93 |
+
public function run()
|
94 |
+
{
|
95 |
+
$this->checkShopSells();
|
96 |
+
|
97 |
+
$this->remote = new Youstice_Remote($this->api_key, $this->use_sandbox, $this->language, $this->shop_sells, $this->shop_software_type);
|
98 |
+
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Helper function for autoloading classes (called in constructor)
|
104 |
+
*/
|
105 |
+
protected function registerAutoloader()
|
106 |
+
{
|
107 |
+
spl_autoload_register(function ($class_name) {
|
108 |
+
$class_name = str_replace('Youstice_', '', $class_name);
|
109 |
+
$class_path = str_replace('_', DIRECTORY_SEPARATOR, $class_name);
|
110 |
+
|
111 |
+
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $class_path;
|
112 |
+
|
113 |
+
if (is_readable($path . '.php'))
|
114 |
+
require $path . '.php';
|
115 |
+
}, true, true); //prepend our autoloader
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Returns html string of logo widget
|
120 |
+
* @param string $claims_url url to report claims form
|
121 |
+
* @return string html
|
122 |
+
*/
|
123 |
+
public function getLogoWidgetHtml($claims_url = '')
|
124 |
+
{
|
125 |
+
if (!trim($this->api_key))
|
126 |
+
return '';
|
127 |
+
|
128 |
+
return $this->remote->getLogoWidgetData(0, $claims_url, false);
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Returns html string of web report button
|
133 |
+
* @param string $href url address where web report is created
|
134 |
+
* @return string of html button
|
135 |
+
*/
|
136 |
+
public function getWebReportButtonHtml($href)
|
137 |
+
{
|
138 |
+
if (!trim($this->api_key))
|
139 |
+
return '';
|
140 |
+
|
141 |
+
$report = new Youstice_Reports_WebReport();
|
142 |
+
|
143 |
+
$web_button = new Youstice_Widgets_WebReportButton($href, $this->language, $report);
|
144 |
+
|
145 |
+
return $web_button->toString().$this->getBaseButtonCss();
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Creates report of web
|
150 |
+
* @return string where to redirect
|
151 |
+
*/
|
152 |
+
public function createWebReport()
|
153 |
+
{
|
154 |
+
return $this->createWebReportExecute();
|
155 |
+
}
|
156 |
+
|
157 |
+
private function createWebReportExecute()
|
158 |
+
{
|
159 |
+
$code = 'WEB_REPORT_SIMPLE__' . time() . substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
|
160 |
+
|
161 |
+
$redirect_link = $this->remote->createWebReport($code);
|
162 |
+
|
163 |
+
if ($redirect_link == null)
|
164 |
+
throw new Youstice_FailedRemoteConnectionException;
|
165 |
+
|
166 |
+
return $redirect_link;
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
*
|
171 |
+
* @param string $string to translate
|
172 |
+
* @param array $variables
|
173 |
+
* @return string translated
|
174 |
+
*/
|
175 |
+
public function t($string, $variables = array())
|
176 |
+
{
|
177 |
+
return $this->translator->t($string, $variables);
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Set eshop language
|
182 |
+
* @param string ISO 639-1 char code "en|sk|cz|es"
|
183 |
+
* @return Youstice_Simple_Api
|
184 |
+
* @throws InvalidArgumentException
|
185 |
+
*/
|
186 |
+
public function setLanguage($lang = null)
|
187 |
+
{
|
188 |
+
$lang = trim(Youstice_Tools::strtolower($lang));
|
189 |
+
|
190 |
+
if ($lang && Youstice_Helpers_LanguageCodes::check($lang))
|
191 |
+
{
|
192 |
+
$this->language = $lang;
|
193 |
+
$this->translator = new Youstice_Translator($this->language);
|
194 |
+
} else
|
195 |
+
throw new InvalidArgumentException('Language code "' . $lang . '" is not allowed.');
|
196 |
+
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Set API key
|
202 |
+
* @param string $api_key if true api is in playground mode, data are not real
|
203 |
+
* @return Youstice_Simple_Api
|
204 |
+
*/
|
205 |
+
public function setApiKey($api_key, $use_sandbox = false)
|
206 |
+
{
|
207 |
+
if (!trim($api_key))
|
208 |
+
return $this;
|
209 |
+
|
210 |
+
$this->api_key = $api_key;
|
211 |
+
|
212 |
+
$this->use_sandbox = ($use_sandbox == true ? true : false);
|
213 |
+
|
214 |
+
return $this;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Set what type of goods is eshop selling
|
219 |
+
* @param string $shop_sells "product|service"
|
220 |
+
* @return Youstice_Simple_Api
|
221 |
+
* @throws InvalidArgumentException
|
222 |
+
*/
|
223 |
+
public function setThisShopSells($shop_sells)
|
224 |
+
{
|
225 |
+
$this->shop_sells = Youstice_Tools::strtolower($shop_sells);
|
226 |
+
|
227 |
+
return $this;
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Check if shopSells attribute is correct
|
232 |
+
* @throws InvalidArgumentException
|
233 |
+
*/
|
234 |
+
protected function checkShopSells()
|
235 |
+
{
|
236 |
+
$allowed_types = array('product', 'service');
|
237 |
+
|
238 |
+
if (in_array(Youstice_Tools::strtolower($this->shop_sells), $allowed_types))
|
239 |
+
$this->shop_sells = Youstice_Tools::strtolower($this->shop_sells);
|
240 |
+
else
|
241 |
+
throw new InvalidArgumentException('Shop selling "' . $this->shop_sells . '" is not allowed.');
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Set on which software is eshop running
|
246 |
+
* @param string $shop_type "prestashop|magento|ownSoftware"
|
247 |
+
* @return Youstice_Simple_Api
|
248 |
+
*/
|
249 |
+
public function setShopSoftwareType($shop_type)
|
250 |
+
{
|
251 |
+
if (Youstice_Tools::strlen($shop_type))
|
252 |
+
$this->shop_software_type = $shop_type;
|
253 |
+
|
254 |
+
return $this;
|
255 |
+
}
|
256 |
+
|
257 |
+
private function getBaseButtonCss()
|
258 |
+
{
|
259 |
+
return '<style type="text/css">.yrsButton {
|
260 |
+
display: inline-block;
|
261 |
+
background: #92278f 12px 9px no-repeat;
|
262 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmV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TUP5u/AgwAXbTAlNaE4y8AAAAASUVORK5CYII=);
|
263 |
+
color: #fff;
|
264 |
+
text-decoration: none;
|
265 |
+
font-family: Arial, Helvetica, sans-serif;
|
266 |
+
font-size: 16px;
|
267 |
+
font-size: 1.2em;
|
268 |
+
padding: 10px 21px 10px 42px;
|
269 |
+
font-weight: normal;
|
270 |
+
line-height: 1em;
|
271 |
+
|
272 |
+
border: 1px solid #3c193a;
|
273 |
+
border-radius: 7px;
|
274 |
+
-moz-border-radius: 7px;
|
275 |
+
white-space:nowrap;
|
276 |
+
}
|
277 |
+
|
278 |
+
.yrsButton:hover { text-decoration: none; color: #fff; }
|
279 |
+
|
280 |
+
.yrsButton:active, .yrsButton:visited { color: #fff; }
|
281 |
+
</style>';
|
282 |
+
}
|
283 |
+
|
284 |
+
}
|
285 |
+
|
286 |
+
class Youstice_InvalidApiKeyException extends Exception {
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
+
class Youstice_FailedRemoteConnectionException extends Exception {
|
291 |
+
|
292 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Tools.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Youstice_Tools {
|
4 |
+
|
5 |
+
public static function strtolower($str)
|
6 |
+
{
|
7 |
+
if (function_exists('mb_strtolower'))
|
8 |
+
return mb_strtolower($str, 'utf-8');
|
9 |
+
|
10 |
+
return strtolower($str);
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function strlen($str, $encoding = 'UTF-8')
|
14 |
+
{
|
15 |
+
$str = html_entity_decode($str, ENT_COMPAT, 'UTF-8');
|
16 |
+
|
17 |
+
if (function_exists('mb_strlen'))
|
18 |
+
return mb_strlen($str, $encoding);
|
19 |
+
|
20 |
+
return strlen($str);
|
21 |
+
}
|
22 |
+
|
23 |
+
public static function file_get_contents($url, $use_include_path = false, $stream_context = null, $curl_timeout = 5)
|
24 |
+
{
|
25 |
+
if ($stream_context == null && preg_match('/^https?:\/\//', $url))
|
26 |
+
$stream_context = @stream_context_create(array('http' => array('timeout' => $curl_timeout)));
|
27 |
+
if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $url))
|
28 |
+
return @file_get_contents($url, $use_include_path, $stream_context);
|
29 |
+
elseif (function_exists('curl_init'))
|
30 |
+
{
|
31 |
+
$curl = curl_init();
|
32 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
33 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
34 |
+
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
|
35 |
+
curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
|
36 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
37 |
+
if ($stream_context != null)
|
38 |
+
{
|
39 |
+
$opts = stream_context_get_options($stream_context);
|
40 |
+
if (isset($opts['http']['method']) && Youstice_Tools::strtolower($opts['http']['method']) == 'post')
|
41 |
+
{
|
42 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
43 |
+
if (isset($opts['http']['content']))
|
44 |
+
{
|
45 |
+
parse_str($opts['http']['content'], $datas);
|
46 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $datas);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
$content = curl_exec($curl);
|
51 |
+
curl_close($curl);
|
52 |
+
return $content;
|
53 |
+
} else
|
54 |
+
return false;
|
55 |
+
}
|
56 |
+
|
57 |
+
public static function jsonDecode($json, $assoc = false)
|
58 |
+
{
|
59 |
+
return json_decode($json, $assoc);
|
60 |
+
}
|
61 |
+
|
62 |
+
public static function jsonEncode($json, $assoc = false)
|
63 |
+
{
|
64 |
+
return json_encode($json, $assoc);
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Translator.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class handles local module translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Translator {
|
11 |
+
|
12 |
+
private $strings = array();
|
13 |
+
|
14 |
+
public function __construct($lang = 'en')
|
15 |
+
{
|
16 |
+
$file = dirname(__FILE__)."/languageStrings/{$lang}.php";
|
17 |
+
|
18 |
+
if (file_exists($file))
|
19 |
+
$this->strings = include $file;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function setLanguageStrings($strings)
|
23 |
+
{
|
24 |
+
$this->strings = $strings;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function t($string)
|
28 |
+
{
|
29 |
+
$variables = func_get_args();
|
30 |
+
array_shift($variables);
|
31 |
+
|
32 |
+
if (array_key_exists($string, $this->strings))
|
33 |
+
return vsprintf($this->strings[$string], $variables);
|
34 |
+
|
35 |
+
return vsprintf($string, $variables);
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderDetail.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders order detail (usually in popup form)
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_OrderDetail {
|
11 |
+
|
12 |
+
protected $api;
|
13 |
+
protected $lang;
|
14 |
+
protected $report;
|
15 |
+
protected $order;
|
16 |
+
|
17 |
+
public function __construct($lang, Youstice_ShopOrder $order, Youstice_Reports_OrderReport $report, $api)
|
18 |
+
{
|
19 |
+
$this->translator = new Youstice_Translator($lang);
|
20 |
+
$this->order = $order;
|
21 |
+
$this->report = $report;
|
22 |
+
$this->api = $api;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function toString()
|
26 |
+
{
|
27 |
+
$products = $this->order->getProducts();
|
28 |
+
$output = '<div class="orderDetailWrap"><h1>'.$this->translator->t('Order').' '.Youstice_Helpers_HelperFunctions::sh($this->order->getName()).'</h1>';
|
29 |
+
$output .= '<div class="topRightWrap">';
|
30 |
+
$output .= $this->api->getOrderReportButtonHtml($this->order->getHref(), $this->order->getCode());
|
31 |
+
$output .= '<span class="space"></span>
|
32 |
+
<a class="yrsButton yrsButton-close">x</a>
|
33 |
+
</div>
|
34 |
+
<h2>'.$this->translator->t('Products in your order (%d)', count($products)).'</h2>';
|
35 |
+
|
36 |
+
if (count($products))
|
37 |
+
{
|
38 |
+
$output .=
|
39 |
+
'<table class="orderDetail">';
|
40 |
+
|
41 |
+
$products = $this->order->getProducts();
|
42 |
+
|
43 |
+
foreach ($products as $product)
|
44 |
+
{
|
45 |
+
$output .= '<tr><td>'.Youstice_Helpers_HelperFunctions::sh($product->getName()).'</td>
|
46 |
+
<td>'.$this->api->getProductReportButtonHtml($product->getHref(), $product->getId(), $product->getOrderId()).'</td></tr>';
|
47 |
+
}
|
48 |
+
|
49 |
+
$output .= '</table></div>';
|
50 |
+
}
|
51 |
+
|
52 |
+
return $output;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderDetailButton.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders button to open order detail
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_OrderDetailButton {
|
11 |
+
|
12 |
+
protected $api;
|
13 |
+
protected $href;
|
14 |
+
protected $translator;
|
15 |
+
protected $report;
|
16 |
+
|
17 |
+
public function __construct($href, $lang, Youstice_ShopOrder $order, Youstice_Reports_OrderReport $report, $api)
|
18 |
+
{
|
19 |
+
$this->href = $href;
|
20 |
+
$this->translator = new Youstice_Translator($lang);
|
21 |
+
$this->order = $order;
|
22 |
+
$this->report = $report;
|
23 |
+
$this->api = $api;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function toString()
|
27 |
+
{
|
28 |
+
$reported_products_count = $this->report->getReportedProductsCount();
|
29 |
+
|
30 |
+
//nothing reported
|
31 |
+
if (!$this->report->orderReportExists() && $reported_products_count == 0)
|
32 |
+
return $this->renderUnreportedButton();
|
33 |
+
|
34 |
+
//exists report for order?
|
35 |
+
if ($this->report->orderReportExists())
|
36 |
+
{
|
37 |
+
if ($reported_products_count > 0)
|
38 |
+
return $this->renderReportedButtonWithCount($reported_products_count + 1);
|
39 |
+
|
40 |
+
//only report is reported
|
41 |
+
return $this->renderReportedButtonWithStatus($this->report->getStatus());
|
42 |
+
}
|
43 |
+
|
44 |
+
//only product/s reported
|
45 |
+
if ($reported_products_count > 1)
|
46 |
+
return $this->renderReportedButtonWithCount($reported_products_count);
|
47 |
+
|
48 |
+
//only 1 product reported
|
49 |
+
return $this->renderReportedButtonWithStatus($this->report->getFirstProductStatus());
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function renderReportedButtonWithCount($count)
|
53 |
+
{
|
54 |
+
$message = $this->translator->t('%d ongoing cases', $count);
|
55 |
+
|
56 |
+
$output = '<div class="orderDetailButtonWrap">
|
57 |
+
<a class="yrsButton yrsButton-order-detail"
|
58 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
59 |
+
|
60 |
+
$output .= '<a class="yrsButton yrsButton-plus" href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">+</a>';
|
61 |
+
|
62 |
+
// POPUP
|
63 |
+
$output .= '<div class="popup"><span> </span>';
|
64 |
+
|
65 |
+
if ($this->report->orderReportExists())
|
66 |
+
$output .= $this->api->getOrderReportButtonHtml($this->order->getHref(), $this->order->getId());
|
67 |
+
|
68 |
+
$order_products = $this->order->getProducts();
|
69 |
+
$report_products = $this->report->getProducts();
|
70 |
+
|
71 |
+
foreach ($order_products as $op)
|
72 |
+
{
|
73 |
+
foreach ($report_products as $rp)
|
74 |
+
{
|
75 |
+
$temp = explode('__', $rp['code']);
|
76 |
+
$local_product_code = $temp[1];
|
77 |
+
|
78 |
+
if ($op->getId() != $local_product_code)
|
79 |
+
continue;
|
80 |
+
|
81 |
+
$output .= $this->api->getProductReportButtonHtml($op->getHref(), $op->getId(), $op->getOrderId());
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
$output .= '</div></div>';
|
86 |
+
|
87 |
+
return $output;
|
88 |
+
}
|
89 |
+
|
90 |
+
protected function renderReportedButton($status)
|
91 |
+
{
|
92 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($status);
|
93 |
+
|
94 |
+
$message = $this->translator->t($status);
|
95 |
+
|
96 |
+
$output = '<a class="yrsButton yrsOrderDetailButton '.$status_css_class.'" target="_blank"
|
97 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
98 |
+
|
99 |
+
return $output;
|
100 |
+
}
|
101 |
+
|
102 |
+
protected function renderReportedButtonWithStatus($status)
|
103 |
+
{
|
104 |
+
if ($this->report->getRemainingTime() == 0)
|
105 |
+
return $this->renderReportedButton($status);
|
106 |
+
|
107 |
+
$message = $this->translator->t($status);
|
108 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($this->report->getStatus());
|
109 |
+
$remaining_time_string = Youstice_Helpers_HelperFunctions::remainingTimeToString($this->report->getRemainingTime(), $this->translator);
|
110 |
+
|
111 |
+
$output = '<a class="yrsButton yrsOrderDetailButton yrsButton-with-time '.$status_css_class.'"
|
112 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">
|
113 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($message).'</span>
|
114 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($remaining_time_string).'</span></a>';
|
115 |
+
|
116 |
+
return $output;
|
117 |
+
}
|
118 |
+
|
119 |
+
protected function renderUnreportedButton()
|
120 |
+
{
|
121 |
+
$message = $this->translator->t('Report a problem');
|
122 |
+
|
123 |
+
$output = '<a class="yrsButton yrsOrderDetailButton"
|
124 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
125 |
+
|
126 |
+
return $output;
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/OrderReportButton.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders button to report an order
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_OrderReportButton {
|
11 |
+
|
12 |
+
protected $href;
|
13 |
+
protected $translator;
|
14 |
+
protected $report;
|
15 |
+
|
16 |
+
public function __construct($href, $lang, Youstice_Reports_OrderReport $report)
|
17 |
+
{
|
18 |
+
$this->href = $href;
|
19 |
+
$this->translator = new Youstice_Translator($lang);
|
20 |
+
$this->report = $report;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function toString()
|
24 |
+
{
|
25 |
+
if ($this->report->exists())
|
26 |
+
{
|
27 |
+
if ($this->report->getRemainingTime() == 0)
|
28 |
+
return $this->renderReportedButton();
|
29 |
+
|
30 |
+
return $this->renderReportedButtonWithTimeString();
|
31 |
+
}
|
32 |
+
|
33 |
+
return $this->renderUnreportedButton();
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function renderReportedButton()
|
37 |
+
{
|
38 |
+
$status = $this->report->getStatus();
|
39 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($status);
|
40 |
+
|
41 |
+
$message = $this->translator->t($status);
|
42 |
+
|
43 |
+
$output = '<a class="yrsButton yrsOrderButton '.$status_css_class.'" target="_blank"
|
44 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
45 |
+
|
46 |
+
return $output;
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function renderReportedButtonWithTimeString()
|
50 |
+
{
|
51 |
+
$status = $this->report->getStatus();
|
52 |
+
|
53 |
+
$message = $this->translator->t($status);
|
54 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($status);
|
55 |
+
$remaining_time_string = Youstice_Helpers_HelperFunctions::remainingTimeToString($this->report->getRemainingTime(), $this->translator);
|
56 |
+
|
57 |
+
$output = '<a class="yrsButton yrsOrderButton yrsButton-with-time '.$status_css_class.'" target="_blank"
|
58 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">
|
59 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($message).'</span>
|
60 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($remaining_time_string).'</span></a>';
|
61 |
+
|
62 |
+
return $output;
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function renderUnreportedButton()
|
66 |
+
{
|
67 |
+
$message = $this->translator->t('Report a problem');
|
68 |
+
|
69 |
+
$output = '<a class="yrsButton yrsOrderButton" target="_blank"
|
70 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
71 |
+
|
72 |
+
return $output;
|
73 |
+
}
|
74 |
+
|
75 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ProductReportButton.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders button to report a product
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_ProductReportButton {
|
11 |
+
|
12 |
+
protected $href;
|
13 |
+
protected $translator;
|
14 |
+
protected $report;
|
15 |
+
|
16 |
+
public function __construct($href, $lang, Youstice_Reports_ProductReport $report)
|
17 |
+
{
|
18 |
+
$this->href = $href;
|
19 |
+
$this->translator = new Youstice_Translator($lang);
|
20 |
+
$this->report = $report;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function toString()
|
24 |
+
{
|
25 |
+
if ($this->report->exists())
|
26 |
+
{
|
27 |
+
if ($this->report->getRemainingTime() == 0)
|
28 |
+
return $this->renderReportedButton();
|
29 |
+
|
30 |
+
return $this->renderReportedButtonWithTimeString();
|
31 |
+
}
|
32 |
+
|
33 |
+
return $this->renderUnreportedButton();
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function renderReportedButton()
|
37 |
+
{
|
38 |
+
$status = $this->report->getStatus();
|
39 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($status);
|
40 |
+
|
41 |
+
$message = $this->translator->t($status);
|
42 |
+
|
43 |
+
$output = '<a class="yrsButton '.$status_css_class.'" target="_blank"
|
44 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
45 |
+
|
46 |
+
return $output;
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function renderReportedButtonWithTimeString()
|
50 |
+
{
|
51 |
+
$status = $this->report->getStatus();
|
52 |
+
$message = $this->translator->t($status);
|
53 |
+
$status_css_class = 'yrsButton-'.Youstice_Helpers_HelperFunctions::webalize($status);
|
54 |
+
$remaining_time_string = Youstice_Helpers_HelperFunctions::remainingTimeToString($this->report->getRemainingTime(), $this->translator);
|
55 |
+
|
56 |
+
$output = '<a class="yrsButton yrsButton-with-time '.$status_css_class.'" target="_blank"
|
57 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">
|
58 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($message).'</span>
|
59 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($remaining_time_string).'</span></a>';
|
60 |
+
|
61 |
+
return $output;
|
62 |
+
}
|
63 |
+
|
64 |
+
protected function renderUnreportedButton()
|
65 |
+
{
|
66 |
+
$message = $this->translator->t('Report a problem');
|
67 |
+
|
68 |
+
$output = '<a class="yrsButton" target="_blank"
|
69 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
70 |
+
|
71 |
+
return $output;
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ReportClaimsForm.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Youstice form for reporting claims.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_ReportClaimsForm {
|
11 |
+
|
12 |
+
protected $action;
|
13 |
+
protected $translator;
|
14 |
+
|
15 |
+
public function __construct($lang)
|
16 |
+
{
|
17 |
+
$this->translator = new Youstice_Translator($lang);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function toString()
|
21 |
+
{
|
22 |
+
$order_number_text = $this->translator->t('Order number');
|
23 |
+
$description_text = 'Would you like to file a complaint and report on your shopping issue? Simply enter the details below:';
|
24 |
+
|
25 |
+
$output = '<h2>'.$this->translator->t('File a complaint').'</h2>';
|
26 |
+
$output .= '<img style="float:left; margin-right:15px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ0AAABACAYAAAAAoyIOAAAABHNCSVQICAgIfAhkiAAAIABJREFUeJztfV1wG9eV5ncuQJGRLLHtxOWJky1BTs287IPBl33bElg7yaxr1yFQWZuW9EDwYStblmQQliVGUhwQcSxFkhUIkewqPxHciURBjgdkFI8SJzuAHmd3atTJp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U89tXucCVFIngaJFIGrMIUwE5RGv6myMB/O9nymdr3RT8OGIUnmCZQhpiqzvEokdgKsMeMqiHL2/i7cDe/oGEM3DuuWI7SDIJAGZs2aGaenJ6oL8139kGaSIol8cfJCAgCKxckxhmEbYKZhcK2PmSZkCCozDTPTxMJCj2NwXJqcnALX+iDlDKScAdf6Lk1OTskQVJboB0TFKqsLTjPTxKXJ82cgkQdIY6YJw3Vcqx/LkJFDdGEhrFrnxcnzacvFzMCNhfmuwN3Gd+92pa1+gGt9ukCC2bCtOPt9Pj09PVEF1/ok0S8MfpBlRpakVBfmu/otlYyZDdtM8ULB3d+OwNhYdFYa9wiDg4MRFiJKoAwkT1uz/ScRT+zeHQ1JygGsXbx44WMYu9JBO1iXHKEdeCFDIUUwhj7pAgMw3KpSYHpxvqvwUfPSQQcddNBBBx100MHHGf8fAYLZOnwnutYAAAAASUVORK5CYII="/>';
|
27 |
+
$output .= '<p style="clear:left;max-width:300px;padding-top:8px">'.$this->translator->t($description_text).'</p>';
|
28 |
+
$output .= '<form action="" method="post" id="yReportClaims">';
|
29 |
+
$output .= '<label for="yEmail">Email</label>';
|
30 |
+
$output .= '<input type="email" id="yEmail" name="email">';
|
31 |
+
$output .= '<label for="yOrderNumber">'.$order_number_text.'</label>';
|
32 |
+
$output .= '<input type="text" id="yOrderNumber" name="orderNumber">';
|
33 |
+
$output .= '<input type="submit" name="send" value="'.$this->translator->t('Continue').'">';
|
34 |
+
$output .= '</form>';
|
35 |
+
|
36 |
+
return $output;
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/ShowButtons.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Youstice show buttons widget.
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_ShowButtons {
|
11 |
+
|
12 |
+
protected $href;
|
13 |
+
protected $has_reports;
|
14 |
+
protected $translator;
|
15 |
+
|
16 |
+
public function __construct($lang, $has_reports)
|
17 |
+
{
|
18 |
+
$this->has_reports = $has_reports;
|
19 |
+
$this->translator = new Youstice_Translator($lang);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function toString()
|
23 |
+
{
|
24 |
+
$text = $this->translator->t('Would you like to file a complaint?');
|
25 |
+
|
26 |
+
return '<a href="#" class="yrsShowButtons yrsButton"
|
27 |
+
data-has-reports="'.(int)$this->has_reports.'">'
|
28 |
+
.$text.'</a>';
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/Widgets/WebReportButton.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders the "unrelated to orders" report button (web report / generic claim)
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Youstice_Widgets_WebReportButton {
|
11 |
+
|
12 |
+
protected $href;
|
13 |
+
protected $translator;
|
14 |
+
protected $report;
|
15 |
+
|
16 |
+
public function __construct($href, $lang, Youstice_Reports_WebReport $report)
|
17 |
+
{
|
18 |
+
$this->href = $href;
|
19 |
+
$this->translator = new Youstice_Translator($lang);
|
20 |
+
$this->report = $report;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function toString()
|
24 |
+
{
|
25 |
+
if (!$this->report->exists())
|
26 |
+
return $this->renderUnreportedButton();
|
27 |
+
|
28 |
+
if ($this->report->getRemainingTime() == 0)
|
29 |
+
return $this->renderReportedButton();
|
30 |
+
else
|
31 |
+
return $this->renderReportedButtonWithTimeString();
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function renderReportedButton()
|
35 |
+
{
|
36 |
+
$status = $this->report->getStatus();
|
37 |
+
$status_css_class = '';
|
38 |
+
if ($status == 'Problem reported')
|
39 |
+
$status_css_class = 'yrsButton-problem-reported';
|
40 |
+
|
41 |
+
$message = $this->translator->t($status);
|
42 |
+
|
43 |
+
$output = '<a class="yrsButton '.$status_css_class.'" target="_blank"
|
44 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
45 |
+
|
46 |
+
return $output;
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function renderReportedButtonWithTimeString()
|
50 |
+
{
|
51 |
+
$message = $this->translator->t($this->report->getStatus());
|
52 |
+
$remaining_time_string = Youstice_Helpers_HelperFunctions::remainingTimeToString($this->report->getRemainingTime(), $this->translator);
|
53 |
+
|
54 |
+
$output = '<a class="yrsButton yrsButton-with-time" target="_blank"
|
55 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">
|
56 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($message).'</span>
|
57 |
+
<span>'.Youstice_Helpers_HelperFunctions::sh($remaining_time_string).'</span></a>';
|
58 |
+
|
59 |
+
return $output;
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function renderUnreportedButton()
|
63 |
+
{
|
64 |
+
$message = $this->translator->t('Report a problem unrelated to your orders');
|
65 |
+
|
66 |
+
$output = '<a class="yrsButton" target="_blank"
|
67 |
+
href="'.Youstice_Helpers_HelperFunctions::sh($this->href).'">'.Youstice_Helpers_HelperFunctions::sh($message).'</a>';
|
68 |
+
|
69 |
+
return $output;
|
70 |
+
}
|
71 |
+
|
72 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/cs.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Czech translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Chceli by jste podat sťížnost?",
|
12 |
+
"Order number" => "Číslo objednavky",
|
13 |
+
"File a complaint" => "Podat sťížnost",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Chceli by jste podat sťížnost a nahlásit váš problém s nakupováním? Jen vyplňte tyhle údaje:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "V případe, že chcete nahlásit stížnost na produkt nebo službu, prosiḿ kliknete na tento odkaz.",
|
16 |
+
"Continue" => "Pokračovat",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Produkty v objednávce (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Objednávka",
|
21 |
+
"Report a problem" => "Podat stížnost",
|
22 |
+
"Report a problem unrelated to your orders" => "Podat stížnost nesouvisející s objednávkou",
|
23 |
+
"Problem reported" => "Stížnost byla podaná",
|
24 |
+
"%d days %d hours" => "%d dní %d hodin",
|
25 |
+
"%d ongoing cases" => "%d probíhajicích stížností",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Čeká na implementaci",
|
28 |
+
"Respond to retailer" => "Odpovězet prodejcovi",
|
29 |
+
"Waiting for decision" => "Čeká na rozhodnutí",
|
30 |
+
"Escalated to ODR" => "Eskalováno na ODR",
|
31 |
+
"Waiting for retailer's response" => "Čeká na odpověd od prodajcu",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Ano",
|
41 |
+
"No" => "Ne",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Předvolený jazyk",
|
49 |
+
"Auto detection" => "Automatická detekcia",
|
50 |
+
"Are you sure you want to uninstall?" => "Jste si jistý, že chcete odinstalovat?",
|
51 |
+
"Settings were saved successfully." => "Nastavení byly úspěšne uloženy.",
|
52 |
+
"Invalid API KEY" => "Neplatný API klíč",
|
53 |
+
"Invalid Configuration value" => "Neplatní hodnota v nastaveních",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Maximalizujte spokojenost zákazníků a staňte se důvěryhodným predajcem. ",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Vyřešte stížnosti několika klikmi.',
|
58 |
+
'For more information' => 'Pro více informací',
|
59 |
+
'about Youstice visit' => 'o Youstice navštivte',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Začít s Youstice zabere jenom pár minut.',
|
61 |
+
'Already have a Youstice account?' => 'Already have a Youstice account?',
|
62 |
+
'START FREE TRIAL' => 'START FREE TRIAL',
|
63 |
+
'Stop scathing reviews' => 'Stop scathing reviews',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Stop scathing reviews. Handle customer complaints fast and right.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'It’s a storeowner’s worst nightmare.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'It matters little whether the criticism is justified. Prevention is the best cure.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'You can resolve customer complaints effectively. You just need the right tool.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.',
|
71 |
+
'Configure Youstice for your website' => 'Nastavte Youstice pro vaši stránku',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'API klíč je pro Live nebo Sandbox přostredí?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => 'API klíč vašeho obchodu',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to',
|
77 |
+
'register specifically for Sandbox' => 'register specifically for Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'GET YOUR API KEY',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Váš API klíč je uvedený v Youstice aplikaci. Přihlaste se do Youstice',
|
80 |
+
'or' => 'nebo',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'jeďte do menu OBCHODY, kliknete na konkrétný obchod a API klíč najdete v spodní části stránky.',
|
82 |
+
'Need some help?' => 'Need some help?',
|
83 |
+
'Our support team is here for you' => 'Our support team is here for you',
|
84 |
+
'Filing a claim without login' => 'Filing a claim without login',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.',
|
87 |
+
'How the Youstice plugin works' => 'How the Youstice plugin works',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'The customer can use this option to report a problem, whether related to a specific order or not.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'It is also possible to report a problem with a specific item within an order.',
|
91 |
+
'Screenshots' => 'Screenshots',
|
92 |
+
"SAVE" => "ULOŽIT",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/de.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Deutsch translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Möchten Sie eine Beschwerde einreichen?",
|
12 |
+
"Order number" => "Die Bestellnummer",
|
13 |
+
"File a complaint" => "die Beschwerde einbringen",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Möchten Sie eine Beschwerde einreichen und berichten über Ihre Merk Problem? Geben Sie einfach die Details:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "Falls Sie über ein Produkt oder eine Dienstleistung beschweren möchten, folgen Sie bitte diesem Link.",
|
16 |
+
"Continue" => "Fortsetzen",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Artikel in Ihre Bestellung (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "die Bestellung",
|
21 |
+
"Report a problem" => "die Beschwerde einbringen",
|
22 |
+
"Report a problem unrelated to your orders" => "Eine Beschwerde nicht mit Ihren Bestellungen einbringen",
|
23 |
+
"Problem reported" => "Problem gemeldet",
|
24 |
+
"%d days %d hours" => "%d Tage %d Stunden",
|
25 |
+
"%d ongoing cases" => "%d aktuelle Fälle",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Warten auf die Implementanz",
|
28 |
+
"Respond to retailer" => "Antwort an den Händler",
|
29 |
+
"Waiting for decision" => "Warten auf die Entscheidung",
|
30 |
+
"Escalated to ODR" => "Zu ODR eskaliert",
|
31 |
+
"Waiting for retailer's response" => "Warten auf Antwort des Verkäufers",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Ja",
|
41 |
+
"No" => "Nein",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "Sind Sie sicher dass Sie deinstallieren möchten?",
|
51 |
+
"Settings were saved successfully." => "Einstellungen wurden erfolgreich gespeichert.",
|
52 |
+
"Invalid API KEY" => "Ungültiges API-Schlüssel",
|
53 |
+
"Invalid Configuration value" => "Ungültiger Einstellungswert",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Erhöhung der Kundenzufriedenheit und einen vertrauenswürdigen Händler. Verhandeln und lösen Kundenbeschwerden in nur wenigen Klicks",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Lösen Sie Ihre Beschwerden nur in ein paar Klicks',
|
58 |
+
'For more information' => 'Für weitere Informationen',
|
59 |
+
'about Youstice visit' => 'über Youstice besuchen Sie',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Es dauert nur ein paar Minuten, um mit Youstice zu beginnen.',
|
61 |
+
'Already have a Youstice account?' => 'haben Sie bereits ein Konto Youstice?',
|
62 |
+
'START FREE TRIAL' => 'Starten Sie die kostenlose Version',
|
63 |
+
'Stop scathing reviews' => 'Stoppen Sie vernichtende Bewertungen',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Beenden Sie negatives Feedback. Bearbeiten Sie die Kundenbeschwerden schnell und korrekt.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'Es ist der Alptraum jedes Shopbesitzers',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Ein verstimmter Kunde kritisiert Ihren Shop in den Social Media. Sie werden unmittelbar in den Krisen-modus versetzt, versuchen das Beste, um Ihren Ruf zu bewahren.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Es macht wenig aus, ob die Kritik berechtigt war. Es ist besser, gut vorbereitet zu sein.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Sie können Kundenbeschwerden effektiv klären. Sie brauchen nur das richtige Tool!',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Beschwerden schnell und effektiv zu lösen kann eine große Belastung für kleine Unternehmen sein. Je länger Kunden auf eine Antwort warten, desto ärgerlicher werden sie. Aber Sie können nicht 24 Stunden, 7 Tage die Woche an Ihrem PC sitzen.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Lassen Sie uns behilflich bei der Klärung dieser Beschwerden sein. Dank unserer preisgekrönten App kann Ihr Kunde erkennen, dass Sie zu Ihren Produkten stehen und dass sie Ihrem Unternehmen vertrauen können.',
|
71 |
+
'Configure Youstice for your website' => 'Konfigurieren Sie Youstice für Ihre Website',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'Ist der API-Schlüssel für Live oder Sandbox Umgebung?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => 'API-Schlüssel Ihres Shops',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'Für einen Test sollten Sie die Sandbox-Umgebung nutzen. Bitte denken Sie daran, dass es verschiedene API-Schlüssel für die Live und Sandboxumgebung gibt. Um mit Sandbox zu starten und den API-Schlüssel zu erhalten, müssen Sie sich',
|
77 |
+
'register specifically for Sandbox' => 'speziell für Sandbox anmelden',
|
78 |
+
'GET YOUR API KEY' => 'API-Schlüssel für Ihren Shop',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Ihrer API-Schlüssel können Sie in Youstice Aplikation finden. Einloggen Sie in Youstice',
|
80 |
+
'or' => 'oder',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'Gehen Sie Zum Menü SHOPS, klicken Sie auf Ihren Shop und einen API-Schlüssel auf der Unterseite der Seite zu sehen.',
|
82 |
+
'Need some help?' => 'Sie benötigen Hilfe?',
|
83 |
+
'Our support team is here for you' => 'Unser Support-Team ist für Sie da',
|
84 |
+
'Filing a claim without login' => 'Eine Beschwerde ohne Log-In einreichen',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Optional können Sie auch mit copy and paste den unten angegebenen Code überall auf Ihre Seite einfügen wenn Sie den Kunden eine Einreichung einer Beschwerde ohne Log-In basierend auf E-Mailadresse und Bestelldetails ermöglichen wollen.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Fühlt euch frei, diesen Link auf den sozialen Netzwerken zu benutzen. Postet ihn proaktiv auf Facebook, Google+, Twitter, etc. Es wird euch helfen, die negativen Meinungen und die potenziellen Beschwerden auf Youstice umzuleiten und eure Pinnwand sauber zu halten.',
|
87 |
+
'How the Youstice plugin works' => 'Wie das Plugin funktioniert',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'Der neue Button „Möchten Sie eine Beschwerde eingeben“ erscheint in der Bestellübersicht jedes Kunden.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'Der Kunde kann diese Option nutzen um ein Problem zu melden, sowohl zu einer speziellen Bestellung oder allgemein.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Es ist ebenso möglich, ein spezielles Problem innerhalb einer Bestellung zu melden.',
|
91 |
+
'Screenshots' => 'Screenshots',
|
92 |
+
"SAVE" => "SPEICHERN",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/en.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local English translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Would you like to file a complaint?",
|
12 |
+
"Order number" => "Order number",
|
13 |
+
"File a complaint" => "File a complaint",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Would you like to file a complaint and report on your shopping issue? Simply enter the details below:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "In case you want to complain about a product or service, please follow this link.",
|
16 |
+
"Continue" => "Continue",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Products in your order (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Order",
|
21 |
+
"Report a problem" => "Report a problem",
|
22 |
+
"Report a problem unrelated to your orders" => "Report a problem unrelated to your orders",
|
23 |
+
"Problem reported" => "Problem reported",
|
24 |
+
"%d days %d hours" => "%d days %d hours",
|
25 |
+
"%d ongoing cases" => "%d ongoing cases",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "To be implemented",
|
28 |
+
"Respond to retailer" => "Respond to retailer",
|
29 |
+
"Waiting for decision" => "Waiting for decision",
|
30 |
+
"Escalated to ODR" => "Escalated to ODR",
|
31 |
+
"Waiting for retailer's response" => "Waiting for retailer's response",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Yes",
|
41 |
+
"No" => "No",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "Are you sure you want to uninstall?",
|
51 |
+
"Settings were saved successfully." => "Settings were saved successfully.",
|
52 |
+
"Invalid API KEY" => "Invalid API KEY",
|
53 |
+
"Invalid Configuration value" => "Invalid Configuration value",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Resolve customer complaints in a few clicks.',
|
58 |
+
'For more information' => 'For more information',
|
59 |
+
'about Youstice visit' => 'about Youstice visit',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'It only takes a few minutes to get started with Youstice.',
|
61 |
+
'Already have a Youstice account?' => 'Already have a Youstice account?',
|
62 |
+
'START FREE TRIAL' => 'START FREE TRIAL',
|
63 |
+
'Stop scathing reviews' => 'Stop scathing reviews',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Stop scathing reviews. Handle customer complaints fast and right.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'It’s a storeowner’s worst nightmare.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'It matters little whether the criticism is justified. Prevention is the best cure.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'You can resolve customer complaints effectively. You just need the right tool.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.',
|
71 |
+
'Configure Youstice for your website' => 'Configure Youstice for your website',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'Is the API key for Live or Sandbox environment?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => 'API Key of your shop',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to',
|
77 |
+
'register specifically for Sandbox' => 'register specifically for Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'GET YOUR API KEY',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Your API key can be found in Youstice application. Log in to Youstice',
|
80 |
+
'or' => 'or',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'go to menu SHOPS, click on your shop and see API key on the bottom of the page.',
|
82 |
+
'Need some help?' => 'Need some help?',
|
83 |
+
'Our support team is here for you' => 'Our support team is here for you',
|
84 |
+
'Filing a claim without login' => 'Filing a claim without login',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.',
|
87 |
+
'How the Youstice plugin works' => 'How the Youstice plugin works',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'The customer can use this option to report a problem, whether related to a specific order or not.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'It is also possible to report a problem with a specific item within an order.',
|
91 |
+
'Screenshots' => 'Screenshots',
|
92 |
+
"SAVE" => "SAVE",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/es.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Spain translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "¿Te gustaría presentar una reclamación?",
|
12 |
+
"Order number" => "El número de orden",
|
13 |
+
"File a complaint" => "Presente una reclamación",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "¿Te gustaría presentar una reclamación e informar de tu problema de las compras? Simplemente entra los detalles a continuación:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "En el caso de que quiera presenta run areclamación acerca de un producto o un servicio, por favor, siga este enlace.",
|
16 |
+
"Continue" => "Continua",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Productos en tu orden (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Orden",
|
21 |
+
"Report a problem" => "Presente una reclamación",
|
22 |
+
"Report a problem unrelated to your orders" => "Informar de / Reportar un problema no relacionado a tu órdenes",
|
23 |
+
"Problem reported" => "El problema reportado",
|
24 |
+
"%d days %d hours" => "%d días %d horas",
|
25 |
+
"%d ongoing cases" => "%d casos en curso",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Para ser implementado",
|
28 |
+
"Respond to retailer" => "Responder a comerciante",
|
29 |
+
"Waiting for decision" => "Esperando la desición",
|
30 |
+
"Escalated to ODR" => "Escalado a ODR",
|
31 |
+
"Waiting for retailer's response" => "Esperando la respuesta del comerciante",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice " => "Youstice",
|
35 |
+
"Your online justice" => "Tu justicia en línea",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "Facilitamos la resolución rápida y efectiva de conflictos entre clientes y comerciantes.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice es una plataforma global en línea para clientes y comerciantes",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "Facilita la comunicación rápida y eficaz entre clientes y comerciantes",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Las reclamaciones se resuelven con tan solo unos clics.",
|
40 |
+
"Yes" => "Sí",
|
41 |
+
"No" => "No",
|
42 |
+
"Products" => "Productos",
|
43 |
+
"Services" => "Servicios",
|
44 |
+
"Settings" => "Configuraciones",
|
45 |
+
"Api Key" => "Llave Api",
|
46 |
+
"Use sandbox environment" => "Utiliza el entorno de prueba sandbox",
|
47 |
+
"This e-shop sells" => "Este comercio electrónico vende",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "¿Estás seguro que quieres desinstalar?",
|
51 |
+
"Settings were saved successfully." => "Configuración se ha guardado correctamente",
|
52 |
+
"Invalid API KEY" => "Clave de API no válida",
|
53 |
+
"Invalid Configuration value" => "El valor de configuración no válido",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Aumenta la satisfacción del cliente y tu credibilidad como comerciante al que se puede confiar. Negocia y resuelta las reclamaciones de los clientes en tan sólo unos clicks.",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Resuelta las reclamaciones/quejas de los clientes en tan sólo unos clicks.',
|
58 |
+
'For more information' => 'Para obtener más información',
|
59 |
+
'about Youstice visit' => 'sobre Youstice visite',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Sólo se tarda unos pocos minutos para empezar a utlizar Youstice',
|
61 |
+
'Already have a Youstice account?' => '¿Ya tiene una cuenta de Youstice?',
|
62 |
+
'START FREE TRIAL' => 'EMPIEZA TU PRUEBA GRATUITA',
|
63 |
+
'Stop scathing reviews' => 'Evita las evaluaciones negativas.',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Evita las evaluaciones negativas. Gestiona las quejas de tus clientes rápida y eficazmente.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'Es la peor pesadilla de cualquier comerciante. ',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Un cliente descontento critica tu empresa en las redes sociales. Instantáneamente te hundes en un estado de crisis, intentando salvaguardar tu reputación lo mejor posible. ',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Lo cierto es que si la crítica es justificada, no importa lo que hagas. La prevención es la mejor cura.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Puedes resolver las quejas de tus clientes de manera efectiva. Solo necesitas la herramienta adecuada.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Resolver las reclamaciones de tus clientes rápida y eficazmente puede imponer una pesada carga a tu empresa. Cuanto más tardes en responder a tus clientes, más se enojarán. Sin embargo, tú tampoco puedes estar las 24 horas del día frente a la pantalla de tu ordenador, respondiendo a todas las reclamaciones.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Deja que eliminemos las dificultades típicas de la gestión de quejas. Gracias a nuestra premiada plataforma, tus clientes saben que garantizas tus productos y que pueden confiar en tu empresa.',
|
71 |
+
'Configure Youstice for your website' => 'Configura Youstice para tu página web',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => '¿Es la clave de API para el ambiente Live o Sandbox?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'En vivo/ Live',
|
75 |
+
'API Key of your shop' => 'La clave API de tu tienda',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'Si deseas probar la plataforma, por favor utiliza nuestro entorno Sandbox. Ten presente que las claves API para el entorno de producción y el entorno de prueba son distintas Para empezar a utilizar el entorno Sandbox y obtener la clave API correspondiente, deberás',
|
77 |
+
'register specifically for Sandbox' => 'registrarte específicamente para el entorno Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'OBTÉN TU CLAVE API',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Su clave de API puede encontrar en la aplicación Youstice. Conéctese/entra a Youstice',
|
80 |
+
'or' => 'o',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'Ve al menu TIENDAS, haga clic en tu tienda y ve la clave API en la parte inferior de la página',
|
82 |
+
'Need some help?' => '¿Necesitas ayuda?',
|
83 |
+
'Our support team is here for you' => 'Nuestro equipo de atención al cliente está aquí para ayudarte',
|
84 |
+
'Filing a claim without login' => 'NOTIFICACIONES DE QUEJA SIN ACCESO A LA PLATAFORMA',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Alternativamente, si quieres que tus clientes puedan presentar reclamaciones sin tener que acceder a la plataforma, y utilizando su dirección de correo electrónico y número de pedido como referencia, puedes copiar y pegar el código que te mostramos a continuación en cualquier parte de tu página web.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Siéntate libre de utilizar este enlace en las redes sociales. Póngalo de manera proactiva en Facebook, Google+, Twitter, etc. Eso te ayudará a provenir de las críticas negativas y de las quejas potenciales através de Youstice y así mantegas tu pared limpia de las quejas.',
|
87 |
+
'How the Youstice plugin works' => '¿CÓMO FUNCIONA EL PLUGIN DE YOUSTICE?',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'El botón “¿Quieres presentar una reclamación?” aparece en el historial de compra de cada cliente.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'El cliente puede utilizar esta opción para notificar un problema, ya sea relacionado con un pedido determinado o no.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Es posible también notificar un problema sobre un artículo concreto de un pedido.',
|
91 |
+
'Screenshots' => 'CAPTURAS DE PANTALLA',
|
92 |
+
"SAVE" => "GUARDAR",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/fr.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local French translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Souhaitez-vous porter une plainte ",
|
12 |
+
"Order number" => "Numéro d'ordre",
|
13 |
+
"File a complaint" => "Porter plainte",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Souhaitez-vous déposer une plainte et annoncer votre problèmes d´achat? Il vous suffit de renseigner vos coordonnées ci-dessous:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "Si Vous aimeriez vous plaindre d'un produit ou d'un service, veuillez cliquer sur ce lien",
|
16 |
+
"Continue" => "Continuer",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Des produits dans votre commande (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Commande",
|
21 |
+
"Report a problem" => "Porter plainte",
|
22 |
+
"Report a problem unrelated to your orders" => "Rapporter un problème qui n´est pas lié à votre commande",
|
23 |
+
"Problem reported" => "Problème signalé",
|
24 |
+
"%d days %d hours" => "%d jours %d heures",
|
25 |
+
"%d ongoing cases" => "%d affaires en cours",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "A mis en œuvre",
|
28 |
+
"Respond to retailer" => "Répondre à détaillant",
|
29 |
+
"Waiting for decision" => "Attendre la décision",
|
30 |
+
"Escalated to ODR" => "Remonté au ODR",
|
31 |
+
"Waiting for retailer's response" => "Attendre la réponse du détaillant",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Oui",
|
41 |
+
"No" => "Non",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "Vous êtes sûr de vouloir désinstaller",
|
51 |
+
"Settings were saved successfully." => "Vos paramètres ont été enregistrés avec succès",
|
52 |
+
"Invalid API KEY" => "Clé d´API ne peut être acceptée/ Clé d´API non valable",
|
53 |
+
"Invalid Configuration value" => "Une valeur d´une configuration non valable",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Maximalisez la satisfaction de vos clientes et devenez un marchand de confiance. Négotiez et résolvez les compliances en queques clics seulement",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Resolvéz les complaintes en quelques clics',
|
58 |
+
'For more information' => 'Pour plus d\'informations',
|
59 |
+
'about Youstice visit' => 'sur Youstice visitez',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Pour commencer avec Youstice il ne faut que quelques minutes',
|
61 |
+
'Already have a Youstice account?' => 'Êtes-vous déja enrégistré sur Youstice?',
|
62 |
+
'START FREE TRIAL' => 'ESSAYEZ GRATUITEMENT NOTRE APP',
|
63 |
+
'Stop scathing reviews' => 'ARRÊTEZ LES AVIS NÉGATIFS',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Arrêtez les avis négatifs. Traitez les réclamations de vos clients de manière rapide et efficace. ',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'C’est la pire chose qui puisse arriver à un commerçant.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Un client mécontent écrit un avis négative sur votre boutique sur les médias sociaux. Vous vous trouvez immédiatement en situation de crise, à essayer tant bien que mal de sauver votre réputation.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Peu importe que la critique soit justifiée ou non. Dans une telle situation, la prévention est le meilleur remède.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Pour bien traiter les réclamations clients, il vous suffit d’avoir le bon outil.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Traiter les réclamations clients est un vrai fardeau pour une petite entreprise. Plus vos clients doivent attendre votre réponse, plus leur colère monte. Malgré tout, vous ne pouvez pas rester derrière votre écran d’ordinateur 24h sur 24.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Laissez-nous vous aider Notre app innovante permet à vos clients de savoir que vous assurerez toujours le suivi de vos produits et ils vous font confiance.',
|
71 |
+
'Configure Youstice for your website' => 'Installez Youstice sur votre page',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => "Clé d'API pour Live ou Sandbox environment?",
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => "Clé d'API de votre magazin",
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'Pour tester Youstice, veuillez utiliser notre environnement de test appelé « Sandbox ». Les clés d’API ne sont pas les mêmes selon qu’il s’agit d’un environnement de test ou live. Pour utiliser notre environnement de test et obtenir la clé d’API correspondante vous devez',
|
77 |
+
'register specifically for Sandbox' => 'enregistrer sur l’environnement de Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'OBTENIR VOTRE CLÉ D’API',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => "Vous pouvez trouver votre clé d'API dans l'application Youstice. Connectez-vous sur Youstice",
|
80 |
+
'or' => 'ou',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => "Venez dans le menu MAGASINS, cliquez sur un magasin spécifique et vous trouverez le clé d'API au bas de la page",
|
82 |
+
'Need some help?' => 'Besoin d\'aide ?',
|
83 |
+
'Our support team is here for you' => 'Notre équipe de support est là pour vous',
|
84 |
+
'Filing a claim without login' => 'SOUMETTRE UNE RÉCLAMATION SANS SE CONNECTER',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Vous pouvez copier et coller le code ci-dessous à n’importe quel endroit de votre site web pour permettre à vos clients de soumettre des réclamations sans se connecter par leur adresse mail et numéro de commande.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'N\'hésitez pas à utiliser ce lien sur les réseaux sociaux. Diffusez le de manière proactive sur Facebook, Google+, Twitter, etc. Il aidera à rediriger les opinions négatives et de plaintes potentielles vers Youstice et garder votre page d\'accueil propre.',
|
87 |
+
'How the Youstice plugin works' => 'COMMENT MARCHE LE PLUGIN DE YOUSTICE',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'Un nouveau bouton « souhaitez-vous soumettre une réclamation ? » apparaît dans l’historique des commande de chaque client.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'Le client peut utiliser cette option pour signaler un problème en lien ou non avec une commande.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Il peut aussi signaler un problème relatif à un article d’une commande.',
|
91 |
+
'Screenshots' => 'COPIES D’ÉCRAN',
|
92 |
+
"SAVE" => "ENREGISTER",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/pt.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Portugese translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Gostaria de fazer uma reclamação?",
|
12 |
+
"Order number" => "Número do pedido",
|
13 |
+
"File a complaint" => "apresentar uma reclamação",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Gostaria de fazer uma reclamação e informar sobre o seu problema relacionado as compras? Basta digitar os detalhes abaixo:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "Caso queira reclamar de um produto ou serviço, por favor, siga este link.",
|
16 |
+
"Continue" => "Continuar",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Produtos no seu pedido (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Encomendar",
|
21 |
+
"Report a problem" => "Apresentar uma reclamação",
|
22 |
+
"Report a problem unrelated to your orders" => "Comunicar um problema não relacionado com as suas ordens",
|
23 |
+
"Problem reported" => "Problema relatado",
|
24 |
+
"%d days %d hours" => "%d dias %d horas",
|
25 |
+
"%d ongoing cases" => "%d processos em curso",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Para ser implementado",
|
28 |
+
"Respond to retailer" => "Responda ao varejista",
|
29 |
+
"Waiting for decision" => "À espera de decisão",
|
30 |
+
"Escalated to ODR" => "Enviados para a RDO",
|
31 |
+
"Waiting for retailer's response" => "Aguardando a resposta do varejista",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Sim",
|
41 |
+
"No" => "Não",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "Tem certeza de que deseja desinstalar?",
|
51 |
+
"Settings were saved successfully." => "As configurações foram salvas com sucesso.",
|
52 |
+
"Invalid API KEY" => "API KEY Inválida",
|
53 |
+
"Invalid Configuration value" => "Valor de configuração inválido",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Aumente a satisfação dos seus clientes e se torne um revendedor de confiança. Negocie e resolva reclamações de clientes em apenas alguns cliques",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Resolva as reclamações dos seus clientes em poucos cliques.',
|
58 |
+
'For more information' => 'Para mais informações',
|
59 |
+
'about Youstice visit' => 'sobre Visite Youstice',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Leva apenas alguns minutos para começar com Youstice.',
|
61 |
+
'Already have a Youstice account?' => 'Já tem uma conta Youstice?',
|
62 |
+
'START FREE TRIAL' => 'COMECE O TESTE GRÁTIS',
|
63 |
+
'Stop scathing reviews' => 'PARE DE SE INCOMODAR COM AS CRĺTICAS',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Pare de se incomodar com as críticas. Cuide das reclamações dos clientes de forma rápida e correta.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'Esse é o pior pesadelo de um dono de loja.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Um cliente descontente critica o seu negócio nas redes sociais. Você entra num clima de crise imediato, tentando salvar a sua reputação à qualquer custo.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Não importa muito se a crítica tem fundamento ou não tem. A prevenção é o melhor remédio.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Não importa muito se a crítica tem fundamento ou não tem. A prevenção é o melhor remédio. ',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Resolver reclamações com rápidez e eficácia pode significar um imenso fardo para o seu pequeno negócio. Quanto mais os clientes esperam por uma reposta, mais irritados eles ficam, mesmo que você esteja na frente do computador todos os dias, 24/7.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Deixe que a gente cuide das reclamações dos clientes, tirando esse peso das suas costas. Graças ao aplicativo, que já ganhou vários prêmios internacionalmente reconhecidos, os seus clientes vão saber que você garante a qualidade do seu produto e eles confiarão no seu negócio.',
|
71 |
+
'Configure Youstice for your website' => 'Configurar Youstice para o seu site',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'A chave API é para o ambiente de teste (Sandbox) ou para a versão original?',
|
73 |
+
'Sandbox' => 'Ambiente de teste (Sandbox)',
|
74 |
+
'Live' => 'Versão original',
|
75 |
+
'API Key of your shop' => 'Chave de API da sua loja',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'Para fins de teste, por favor, usar a nossa Sandbox (ambiente de teste). Tenha em mente que existem diferentes APIs para Sandbox e ambientes live. Para começar a usar a Sandbox (ambiente de teste) e obter a API, você precisa se',
|
77 |
+
'register specifically for Sandbox' => 'cadastrar especificamente para a Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'OBTENHA A SUA API KEY',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Sua chave de API pode ser encontrada no aplicativo Youstice. Entre na Youstice',
|
80 |
+
'or' => 'ou',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'vá ao menu de lojas, clique na sua loja e veja a chave de API na parte inferior da página.',
|
82 |
+
'Need some help?' => 'Need some help?',
|
83 |
+
'Our support team is here for you' => 'Our support team is here for you',
|
84 |
+
'Filing a claim without login' => 'INICIANDO UMA RECLAMAÇÃO SEM LOGIN',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Há também a opção de copiar e colar o código abaixo em qualquer lugar no seu site, Se você quiser permitir que os seus clientes iniciem uma reclamação sem fazer o login, utilizando apenas o email e o número da encomenda.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.',
|
87 |
+
'How the Youstice plugin works' => 'COMO FUNCIONA O PUGLIN DA YOUSTICE?',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'Um novo botão ‘Você gostaria de iniciar uma reclamação?’ aparece na encomenda de cada cliente.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'Os clientes podem usar essa opção para relatar um problema relacionado ou não à uma encomenda específica.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Também é possível relatar problema em um item específico da encomenda.',
|
91 |
+
'Screenshots' => 'IMAGENS',
|
92 |
+
"SAVE" => "SALVAR",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/ru.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Russian translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Хотите предъявить претензию?",
|
12 |
+
"Order number" => "Номер заказа",
|
13 |
+
"File a complaint" => "Предъявить претензию",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Хотите предъявить претензию и сообщить о Вашей проблеме ",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "В случае если вы хотите предъявить претензию по товару или услугам, пожалуйста, кликните на эту ссылку.",
|
16 |
+
"Continue" => "Далее",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Товары в Вашем заказе (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Заказ",
|
21 |
+
"Report a problem" => "Предъявить претензию",
|
22 |
+
"Report a problem unrelated to your orders" => "Сообщить о проблеме не кассающейся Ваших заказов",
|
23 |
+
"Problem reported" => "Проблема была сообщена",
|
24 |
+
"%d days %d hours" => "%d дней %d часов",
|
25 |
+
"%d ongoing cases" => "%d текущие споры",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Предстоит реализация",
|
28 |
+
"Respond to retailer" => "Ответить розничному торговцу",
|
29 |
+
"Waiting for decision" => "В ожидании принятия решения",
|
30 |
+
"Escalated to ODR" => "Приняты более серьезные меры при помощи поставщика услуг по ОУС",
|
31 |
+
"Waiting for retailer's response" => "В ожидании ответа розничного торговца",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Юстис",
|
35 |
+
"Your online justice" => "Your online justice",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "We help customers and retailers resolve shopping issues quickly and effectively.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice is a global online application for customers and retailers",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "It allows quick and efficient communication between shops and customers",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Complaints are resolved in just a few clicks.",
|
40 |
+
"Yes" => "Да",
|
41 |
+
"No" => "Нет",
|
42 |
+
"Products" => "Products",
|
43 |
+
"Services" => "Services",
|
44 |
+
"Settings" => "Settings",
|
45 |
+
"Api Key" => "Api Key",
|
46 |
+
"Use sandbox environment" => "Use sandbox environment",
|
47 |
+
"This e-shop sells" => "This e-shop sells",
|
48 |
+
"Default language" => "Default language",
|
49 |
+
"Auto detection" => "Auto detection",
|
50 |
+
"Are you sure you want to uninstall?" => "Вы уверены, что хотите удалить?",
|
51 |
+
"Settings were saved successfully." => "Настройки успешно сохранены.",
|
52 |
+
"Invalid API KEY" => "Недействительный API-ключ",
|
53 |
+
"Invalid Configuration value" => "Недействительное значение конфигурации",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Повысите удовлетворение клиентов и cтаньте доверенным продавцом. Договаривайтесь и решите претензии клиентов путём нескольких кликов мышкой",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Решите претензии клиентов путём нескольких кликов мышкой.',
|
58 |
+
'For more information' => 'Для получения дополнительной информации',
|
59 |
+
'about Youstice visit' => 'о Юстис, пожалуйста, посетите сайт',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Чтобы начать работу с Юстис Вам нужно всего несколько минут',
|
61 |
+
'Already have a Youstice account?' => 'У Вас уже есть счет на Юстис?',
|
62 |
+
'START FREE TRIAL' => 'НАЧАТЬ ИСПОЛЬЗОВАТЬ БЕСПЛАТНУЮ ПРОБНУЮ ВЕРСИЮ ',
|
63 |
+
'Stop scathing reviews' => 'Предотвратите уничтожающие отзывы.',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Предотвратите уничтожающие отзывы. Работайте с претензиями Ваших клиентов быстро и правильно. ',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'Это худший кошмар владельцев магазинов.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Недовольный клиент критикует Ваш бизнес в социальных сетях. Вы мгновенно брошены в кризисный режим, пытаясь, как можно лучше, сохранить свою репутацию.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Не играет большую роль, обоснована ли критика или нет. Профилактика является лучшим лекарством.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Претензии Ваших клиентов можно решить эффективно. Вам нужен только правильный инструмент.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Регулирование претензий быстро и эффективно может взвалить тяжелое бремя на Ваш мелкий бизнес. Чем дольше клиенты ждут Вашего ответа, тем более раздражёнными они становятся. И всё таки – Вы не можете сидеть перед экраном Вашего компьютера круглосуточно. ',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Позвольте нам взять на себя страдания от регулирования претензий клиентов. Благодаря нашему получаемому разного вида награды приложению, Ваши клиенты поймут, что Вы защищаете качество своей продукции и будут доверять Вашей компании.',
|
71 |
+
'Configure Youstice for your website' => 'Конфигурировать Юстис для вашего сайта',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'API-ключ для среды Live или Sandbox?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => 'API-ключ Вашего магазина ',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'В целях тестирования используйте нашу среду «Песочница». Пожалуйста, обратите внимание на то, что существуют разные API ключи для среды Онлайн или Песочница. Чтобы начать использовать Песочницу и получить соответствующий API ключ, необходимо',
|
77 |
+
'register specifically for Sandbox' => 'зарегистрироваться для Песочницы',
|
78 |
+
'GET YOUR API KEY' => 'ПОЛУЧИТЬ API КЛЮЧ',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Ваш API-ключ найдете в приложении Юстис. Входите в Юстис',
|
80 |
+
'or' => 'или',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'откройте меню МАГАЗИНЫ, кликните на свой магазин и Вы увидиие API-ключ внизу страницы.',
|
82 |
+
'Need some help?' => 'Нужна помощь?',
|
83 |
+
'Our support team is here for you' => 'Наша команда помощников здесь для вас',
|
84 |
+
'Filing a claim without login' => 'ПРЕДЪЯВИТЕ ПРЕТЕНЗИЮ БЕЗ НЕОБХОДИМОСТИ ВХОДА',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Факультативно можно скопировать и вставить нижеуказанный код на любое место на Вашем веб-сайте, если Вы желаете предоставить Вашим клиентам возможность предъявлять претензии без входа в систему, путём введения электронного адреса клиента и номера заказа.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Свободно пользуйтесь этой ссылкой на социальных сетях, активно распространяйте ее на страницах как Facebook, Google+, Twitter и др. Это поможет перенаправить отрицательные мнения и потенциальные претензии прямо в Юстис и таким образом Ваша веб-страница останется чистой.',
|
87 |
+
'How the Youstice plugin works' => 'КАК РАБОТАЕТ МОДУЛЬ ЮСТИС',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'Новая кнопка «Желаете ли Вы предъявить претензию?» появляется в истории заказов каждого клиента.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'Клиент может пользоваться этой возможностью для того, чтобы сообщить о конкретной проблеме, касающейся определённого заказа (или без его определения).',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Также возможно сообщить о проблеме, связанной с определённым товаром в рамках отдельных заказов.',
|
91 |
+
'Screenshots' => 'СКРИНШОТЫ (Снимки экрана)',
|
92 |
+
"SAVE" => "СОХРАНИТЬ",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/SDK/languageStrings/sk.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Local Slovak translations
|
4 |
+
*
|
5 |
+
* @author Youstice
|
6 |
+
* @copyright (c) 2014, Youstice
|
7 |
+
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
return array(
|
11 |
+
"Would you like to file a complaint?" => "Chceli by ste nahlásiť sťažnosť?",
|
12 |
+
"Order number" => "Číslo objednávky",
|
13 |
+
"File a complaint" => "Nahlásiť sťažnosť",
|
14 |
+
"Would you like to file a complaint and report on your shopping issue? Simply enter the details below:" => "Chcete podať sťažnosť a nahlásiť váš problém s nakupovaním? Stačí vyplniť tieto údaje:",
|
15 |
+
"In case you want to complain about a product or service, please follow this link." => "Ak si želáte podať sťažnosť na produkt alebo službu, prosím kliknite na tento odkaz.",
|
16 |
+
"Continue" => "Pokračovať",
|
17 |
+
//orderDetail
|
18 |
+
"Products in your order (%d)" => "Produkty v objednávke (%d)",
|
19 |
+
//buttons
|
20 |
+
"Order" => "Objednávka",
|
21 |
+
"Report a problem" => "Nahlásiť problém",
|
22 |
+
"Report a problem unrelated to your orders" => "Nahlásiť problém netýkajúci sa objednávok",
|
23 |
+
"Problem reported" => "Problém bol nahlásený",
|
24 |
+
"%d days %d hours" => "%d dní %d hodín",
|
25 |
+
"%d ongoing cases" => "Nahlásenia: %d",
|
26 |
+
//button's statuses
|
27 |
+
"To be implemented" => "Implementuje sa",
|
28 |
+
"Respond to retailer" => "Zaslaná odpoveď obchodníkovi",
|
29 |
+
"Waiting for decision" => "Čakanie na rozhodnutie",
|
30 |
+
"Escalated to ODR" => "Poslané na ODR",
|
31 |
+
"Waiting for retailer's response" => "Čakanie na odpoveď od obchodníka",
|
32 |
+
|
33 |
+
//admin
|
34 |
+
"Youstice" => "Youstice",
|
35 |
+
"Your online justice" => "Vaša online justícia",
|
36 |
+
"We help customers and retailers resolve shopping issues quickly and effectively." => "Pomáhame spotrebiteľom a predajcom rýchlo a efektívne riešiť problémy spojené s nakupovaním.",
|
37 |
+
"Youstice is a global online application for customers and retailers" => "Youstice je globálna online aplikácia pre spotrebiteľov a predajcov",
|
38 |
+
"It allows quick and efficient communication between shops and customers" => "Umožňuje rýchlu a efektívnu komunikáciu medzi obchodmi a kupujúcimi.",
|
39 |
+
"Complaints are resolved in just a few clicks." => "Sťažnosti je možné vyriešiť niekoľkými kliknutiami myšou.",
|
40 |
+
"Yes" => "Áno",
|
41 |
+
"No" => "Nie",
|
42 |
+
"Products" => "Produkty",
|
43 |
+
"Services" => "Služby",
|
44 |
+
"Settings" => "Nastavenia",
|
45 |
+
"Api Key" => "Api Kľúč",
|
46 |
+
"Use sandbox environment" => "Používať testovacie prostredie",
|
47 |
+
"This e-shop sells" => "Tento e-shop predáva",
|
48 |
+
"Default language" => "Predvolený jazyk",
|
49 |
+
"Auto detection" => "Automatická detekcia",
|
50 |
+
"Are you sure you want to uninstall?" => "Naozaj si želáte odinštalovať?",
|
51 |
+
"Settings were saved successfully." => "Nastavenia boli úspešne uložené.",
|
52 |
+
"Invalid API KEY" => "Neplatný API kľúč",
|
53 |
+
"Invalid Configuration value" => "Neplatná hodnota v nastaveniach",
|
54 |
+
|
55 |
+
//NEW ADMIN
|
56 |
+
"Increase customer satisfaction and become a trusted retailer. Negotiate and resolve customer complaints just in a few clicks" => "Maximalizujte spokojnosť zákazníkov a staňte sa dôveryhodným predajcom. Vyjednávajte a vyriešte sťažnosti len niekoľkými klikmi",
|
57 |
+
'Resolve customer complaints in a few clicks.' => 'Vyriešte sťažnosti niekoľkými klikmi.',
|
58 |
+
'For more information' => 'Pre viac informácií',
|
59 |
+
'about Youstice visit' => 'o Youstice navštívte',
|
60 |
+
'It only takes a few minutes to get started with Youstice.' => 'Začať s Youstice zaberie len niekoľko minút.',
|
61 |
+
'Already have a Youstice account?' => 'Ste už zaregistrovaný v Youstice?',
|
62 |
+
'START FREE TRIAL' => 'REGISTRUJTE SA',
|
63 |
+
'Stop scathing reviews' => 'Dosť bolo jedovatých recenzií',
|
64 |
+
'Stop scathing reviews. Handle customer complaints fast and right.' => 'Dosť bolo jedovatých recenzií. Vyriešte zákaznícke sťažnosti rýchlo a správne.',
|
65 |
+
'It’s a storeowner’s worst nightmare.' => 'Je to nočná mora všetkých obchodníkov.',
|
66 |
+
'A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.' => 'Nahnevaný zákazník kritizuje Vašu firmu na sociálnych sieťach. Ihneď Vás to postaví na nohy a robíte čo môžete, aby ste nestratili reputáciu.',
|
67 |
+
'It matters little whether the criticism is justified. Prevention is the best cure.' => 'Nie je ale dôležité, či je kritika oprávnená. Najlepším riešením je správna prevencia.',
|
68 |
+
'You can resolve customer complaints effectively. You just need the right tool.' => 'Sťažnosti sa naozaj dajú riešiť efektívne. Stačí k tomu iba správny nástroj.',
|
69 |
+
'Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.' => 'Riešenie sťažností rýchlo a efektívne môže Vašu firmu poriadne zaťažiť, najmä ak to chcete robiť poriadne. O čo dlhšie budú zákazníci čakať na odpoveď, o to viac budú nahnevaní. Aj keby ste sa snažili najlepšie ako to ide, nemôžete vysedávať za obrazovkou počítača 24 hodín denne, 7 dní v týždni.',
|
70 |
+
'Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.' => 'Dovoľte nám z vás sňať bremeno riešenie zákazníckych sťažností. Vďaka našej aplikácii, ktorá získala množstvo ocenení, budú Vaši zákazníci vedieť, že za svojimi službami stojíte a budú Vašej firme viac dôverovať.',
|
71 |
+
'Configure Youstice for your website' => 'Nastavte Youstice pre vašu stránku',
|
72 |
+
'Is the API key for Live or Sandbox environment?' => 'API kľúč je pre Live alebo Sandbox prostredie?',
|
73 |
+
'Sandbox' => 'Sandbox',
|
74 |
+
'Live' => 'Live',
|
75 |
+
'API Key of your shop' => 'API Kľúč vášho obchodu',
|
76 |
+
'For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to' => 'Pre testovacie účely používajte náš Sandbox - pieskovisko. Prosím berte v úvahu, že pre ostré a testovacie prostredie sa používajú rôzne API kľúče. Aby ste mohli začať používať Sandbox a získať tak príslušný API kľúč, ',
|
77 |
+
'register specifically for Sandbox' => 'registrujte sa špecificky pre Sandbox',
|
78 |
+
'GET YOUR API KEY' => 'GET YOUR API KEY',
|
79 |
+
'Your API key can be found in Youstice application. Log in to Youstice' => 'Váš API kľúč je uvedený v Youstice aplikácii. Prihláste sa do Youstice',
|
80 |
+
'or' => 'alebo',
|
81 |
+
'go to menu SHOPS, click on your shop and see API key on the bottom of the page.' => 'choďte do menu OBCHODY, kliknite na konkrétny obchod a API kľúč nájdete v spodnej časti stránky.',
|
82 |
+
'Need some help?' => 'Potrebujete pomoc?',
|
83 |
+
'Our support team is here for you' => 'Tím zákazníckej podpory je tu pre Vás',
|
84 |
+
'Filing a claim without login' => 'Zadať sťažnosť bez prihlásenia',
|
85 |
+
'Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.' => 'Alternatívne, kopírujte a vložte kód nižšie na akékoľvek miesto na Vašej stránke, aby ste mohli umožniť Vašim zákazníkom zadať sťažnosti bez prihlásenia, t.j. bez jeho e-mailovej adresy a čísla objednávky.',
|
86 |
+
'Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.' => 'Používajte túto linku aj na sociálnych sietiach. Pri proaktívnom šírení na Google-Facebook-Twitter vám pomôže presmerovať záporné názory a sťažnosti na Youstice a nechať vašu stenu čistú.',
|
87 |
+
'How the Youstice plugin works' => 'Ako funguje Youstice plugin?',
|
88 |
+
'New button ‘Would you like to file a complaint?’ appears in an order history of each customer.' => 'Nové tlačidlo "Chcete podať sťažnosť?" sa zobrazí všetkým zákazníkom v histórii objednávok.',
|
89 |
+
'The customer can use this option to report a problem, whether related to a specific order or not.' => 'Zákazník môže zvoliť túto možnosť na nahlásenie problému, bez ohľadu na to, či sa viaže na konkrétnu objednávku alebo nie.',
|
90 |
+
'It is also possible to report a problem with a specific item within an order.' => 'Je tiež možné nahlásiť problém ohľadom konkrétnej položky, ktorá je súčasťou objednávky.',
|
91 |
+
'Screenshots' => 'Screenshoty',
|
92 |
+
"SAVE" => "ULOŽIŤ",
|
93 |
+
);
|
app/code/community/Youstice/YousticeResolutionSystem/controllers/AdminController.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Description of Youstice_YousticeResolutionSystem_AdminController
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Youstice_YousticeResolutionSystem_AdminController extends Mage_Adminhtml_Controller_Action {
|
8 |
+
|
9 |
+
public function indexAction() {
|
10 |
+
$this->loadLayout();
|
11 |
+
|
12 |
+
$this->_setActiveMenu('youstice_yousticeresolutionsystem');
|
13 |
+
|
14 |
+
$this->renderLayout();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function saveAction() {
|
18 |
+
$params = $this->getRequest()->getPost();
|
19 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton')->get();
|
20 |
+
|
21 |
+
$validApiKey = $this->checkApiKey($params['api_key'], $params['use_sandbox']);
|
22 |
+
|
23 |
+
if(!$validApiKey) {
|
24 |
+
Mage::getSingleton('core/session')->addError($api->t('Invalid API KEY'));
|
25 |
+
$this->_redirect('youstice/admin');
|
26 |
+
}
|
27 |
+
|
28 |
+
Mage::getModel('core/config')->saveConfig('youstice/api_key', $params['api_key']);
|
29 |
+
Mage::getModel('core/config')->saveConfig('youstice/use_sandbox', $params['use_sandbox']);
|
30 |
+
//Mage::getModel('core/config')->saveConfig('youstice/shop_sells', $params['shop_sells']);
|
31 |
+
Mage::getModel('core/config')->saveConfig('youstice/default_language', $params['default_language']);
|
32 |
+
|
33 |
+
Mage::getConfig()->reinit();
|
34 |
+
Mage::app()->reinitStores();
|
35 |
+
|
36 |
+
|
37 |
+
Mage::getSingleton('core/session')->addSuccess($api->t('Settings were saved successfully.'));
|
38 |
+
$this->_redirect('youstice/admin');
|
39 |
+
}
|
40 |
+
|
41 |
+
//ajax
|
42 |
+
public function checkApiKeyAction() {
|
43 |
+
$params = $this->getRequest()->getPost();
|
44 |
+
|
45 |
+
$result = $this->checkApiKey($params['api_key'], $params['use_sandbox']);
|
46 |
+
|
47 |
+
exit(json_encode(array('result' => $result)));
|
48 |
+
}
|
49 |
+
|
50 |
+
private function checkApiKey($apiKey, $useSandbox) {
|
51 |
+
if (!trim($apiKey))
|
52 |
+
return false;
|
53 |
+
|
54 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton')->get();
|
55 |
+
|
56 |
+
$api->setApiKey($apiKey, $useSandbox);
|
57 |
+
$api->runWithoutUpdates();
|
58 |
+
|
59 |
+
$result = false;
|
60 |
+
|
61 |
+
try {
|
62 |
+
$result = $api->checkApiKey();
|
63 |
+
}
|
64 |
+
catch(Exception $e) {
|
65 |
+
$result = false;
|
66 |
+
}
|
67 |
+
|
68 |
+
return $result;
|
69 |
+
}
|
70 |
+
|
71 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/controllers/IndexController.php
ADDED
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Description of Youstice_YousticeResolutionSystem_IndexController
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Youstice_YousticeResolutionSystem_IndexController extends Mage_Core_Controller_Front_Action {
|
8 |
+
|
9 |
+
protected $api;
|
10 |
+
protected $customer_id;
|
11 |
+
|
12 |
+
public function preDispatch() {
|
13 |
+
parent::preDispatch();
|
14 |
+
|
15 |
+
$this->api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton');
|
16 |
+
|
17 |
+
$this->authenticateUser();
|
18 |
+
$this->api->get()->setUserId($this->customer_id);
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getReportClaimsPageAction() {
|
22 |
+
if ($this->api->getCustomerId() !== null)
|
23 |
+
$this->_redirectUrl(Mage::getUrl('sales/order/history'));
|
24 |
+
|
25 |
+
$this->loadLayout();
|
26 |
+
|
27 |
+
$content = $this->getLayout()->createBlock('page/html')->setName('reportClaims')->setTemplate('youstice/reportClaims.phtml');
|
28 |
+
$this->getLayout()->getBlock('content')->append($content);
|
29 |
+
|
30 |
+
$ogTags = $this->getLayout()->createBlock('page/html')->setName('reportClaimsOgTags')->setTemplate('youstice/reportClaimsOgTags.phtml');
|
31 |
+
$this->getLayout()->getBlock('head')
|
32 |
+
->append($ogTags)
|
33 |
+
->addJs('youstice/reportClaims.js', 'name=last'); //name allows to add this script before jquery
|
34 |
+
|
35 |
+
$this->renderLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getReportClaimsPagePostAction() {
|
39 |
+
$order_number = $this->getOrderNumber();
|
40 |
+
|
41 |
+
if (!$this->customer_id) {
|
42 |
+
echo json_encode(array('error' => 'Invalid email'));
|
43 |
+
exit;
|
44 |
+
}
|
45 |
+
|
46 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_number);
|
47 |
+
|
48 |
+
if ($order->getId()) {
|
49 |
+
$shop_order = $this->createShopOrder($order);
|
50 |
+
|
51 |
+
$html = $this->api->get()->getOrderDetailHtml($shop_order);
|
52 |
+
echo json_encode(array('orderDetail' => $html));
|
53 |
+
exit;
|
54 |
+
}
|
55 |
+
|
56 |
+
//order number not found in customer's orders
|
57 |
+
echo json_encode(array('error' => 'Email or order number not found'));
|
58 |
+
exit;
|
59 |
+
}
|
60 |
+
|
61 |
+
protected function authenticateUser() {
|
62 |
+
if ($this->api->getCustomerId() !== null) {
|
63 |
+
$this->customer_id = $this->api->getCustomerId();
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
$email = $this->getRequest()->getParam('email');
|
68 |
+
|
69 |
+
if (!Zend_Validate::is($email, 'EmailAddress'))
|
70 |
+
return;
|
71 |
+
|
72 |
+
$customer = Mage::getModel("customer/customer");
|
73 |
+
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
|
74 |
+
$customer->loadByEmail($email);
|
75 |
+
|
76 |
+
if ($customer->getId() !== null) {
|
77 |
+
$this->customer_id = $customer->getId();
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function getOrderNumber() {
|
82 |
+
return preg_replace('/[^\w\d]/ui', '', $this->getRequest()->getParam('orderNumber'));
|
83 |
+
}
|
84 |
+
|
85 |
+
public function getShowButtonsHtmlAction() {
|
86 |
+
echo $this->api->get()->getShowButtonsWidgetHtml();
|
87 |
+
$this->api->get()->orderHistoryViewed();
|
88 |
+
}
|
89 |
+
|
90 |
+
public function getLogoWidgetAction() {
|
91 |
+
echo $this->api->get()->getLogoWidgetHtml(Mage::getUrl('youstice/index/getReportClaimsPage'));
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getWebReportButtonAction() {
|
95 |
+
echo $this->api->get()->getWebReportButtonHtml(Mage::getUrl('youstice/index/createWebReport/'));
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getOrdersButtonsAction() {
|
99 |
+
|
100 |
+
$params = $this->getRequest()->getParams();
|
101 |
+
foreach ($params['order_ids'] as $orderId) {
|
102 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
103 |
+
|
104 |
+
if ($this->api->getCustomerId() !== $order['customer_id'])
|
105 |
+
continue;
|
106 |
+
|
107 |
+
$shopOrder = $this->createShopOrder($orderId);
|
108 |
+
|
109 |
+
$orderDetailUrl = Mage::getUrl('youstice/index/getOrderDetail', array('_query' => 'order_id=' . $orderId));
|
110 |
+
|
111 |
+
$response[$orderId] = $this->api->get()->getOrderDetailButtonHtml($orderDetailUrl, $shopOrder);
|
112 |
+
}
|
113 |
+
|
114 |
+
echo json_encode($response);
|
115 |
+
}
|
116 |
+
|
117 |
+
public function getProductsButtonsAction() {
|
118 |
+
$params = $this->getRequest()->getParams();
|
119 |
+
$orderId = $params['order_id'];
|
120 |
+
|
121 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
122 |
+
|
123 |
+
if ($this->api->getCustomerId() !== $order['customer_id'])
|
124 |
+
exit;
|
125 |
+
|
126 |
+
$shopOrder = $this->createShopOrder($orderId);
|
127 |
+
$products = $shopOrder->getProducts();
|
128 |
+
|
129 |
+
if (count($products) === 0)
|
130 |
+
exit;
|
131 |
+
|
132 |
+
$response = array();
|
133 |
+
foreach ($products as $shopProduct) {
|
134 |
+
$productSku = $shopProduct->getId();
|
135 |
+
|
136 |
+
$params = array('order_id' => $orderId, 'product_sku' => $productSku);
|
137 |
+
$link = Mage::getUrl('youstice/index/createProductReport', array('_query' => $params));
|
138 |
+
|
139 |
+
$response[$productSku] = $this->api->get()->getProductReportButtonHtml($link, $productSku, $orderId);
|
140 |
+
}
|
141 |
+
|
142 |
+
echo json_encode($response);
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getOrderDetailAction() {
|
146 |
+
$params = $this->getRequest()->getParams();
|
147 |
+
$orderId = (int)$params['order_id'];
|
148 |
+
|
149 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
150 |
+
|
151 |
+
if ($this->api->getCustomerId() !== $order['customer_id'])
|
152 |
+
exit;
|
153 |
+
|
154 |
+
$shopOrder = $this->createShopOrder($order);
|
155 |
+
|
156 |
+
echo $this->api->get()->getOrderDetailHtml($shopOrder);
|
157 |
+
}
|
158 |
+
|
159 |
+
public function createWebReportAction() {
|
160 |
+
try {
|
161 |
+
$redirectUrl = $this->api->get()->createWebReport();
|
162 |
+
} catch (\Exception $e) {
|
163 |
+
exit('Connection to remote server failed, please <a href="#" onClick="history.go(0)">try again</a> later');
|
164 |
+
}
|
165 |
+
|
166 |
+
$this->_redirectUrl($redirectUrl);
|
167 |
+
}
|
168 |
+
|
169 |
+
public function createOrderReportAction() {
|
170 |
+
//logged out reporting
|
171 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
172 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderNumber());
|
173 |
+
else {
|
174 |
+
$order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
|
175 |
+
|
176 |
+
if ($this->api->getCustomerId() !== $order['customer_id'])
|
177 |
+
exit;
|
178 |
+
}
|
179 |
+
|
180 |
+
$shopOrder = $this->createShopOrder($order->getId());
|
181 |
+
|
182 |
+
if ($order->getCustomerId() !== $this->customer_id)
|
183 |
+
exit('Order not found');
|
184 |
+
|
185 |
+
try {
|
186 |
+
$link = $this->api->get()->createOrderReport($shopOrder);
|
187 |
+
} catch (\Exception $e) {
|
188 |
+
exit('Connection to remote server failed, please <a href="#" onClick="history.go(0)">try again</a> later');
|
189 |
+
}
|
190 |
+
|
191 |
+
$this->_redirectUrl($link);
|
192 |
+
}
|
193 |
+
|
194 |
+
public function createProductReportAction() {
|
195 |
+
//logged out reporting
|
196 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
197 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderNumber());
|
198 |
+
else {
|
199 |
+
$order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
|
200 |
+
|
201 |
+
if ($this->api->getCustomerId() !== $order['customer_id'])
|
202 |
+
exit;
|
203 |
+
}
|
204 |
+
|
205 |
+
$productSku = $this->getRequest()->getParam('product_sku');
|
206 |
+
|
207 |
+
$shopOrder = $this->createShopOrder($order->getId());
|
208 |
+
|
209 |
+
$shopProducts = $shopOrder->getProducts();
|
210 |
+
|
211 |
+
if ($order->getCustomerId() === $this->customer_id) {
|
212 |
+
foreach ($shopProducts as $shopProduct) {
|
213 |
+
if ($shopProduct->getId() == $productSku) {
|
214 |
+
try {
|
215 |
+
$link = $this->api->get()->createProductReport($shopProduct);
|
216 |
+
} catch (\Exception $e) {
|
217 |
+
exit('Connection to remote server failed, please <a href="#" onClick="history.go(0)">try again</a> later');
|
218 |
+
}
|
219 |
+
|
220 |
+
$this->_redirectUrl($link);
|
221 |
+
}
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
echo('Product not found');
|
226 |
+
}
|
227 |
+
|
228 |
+
protected function createShopOrder($order) {
|
229 |
+
if (!$order instanceof Mage_Sales_Model_Order)
|
230 |
+
$order = Mage::getModel('sales/order')->load($order);
|
231 |
+
|
232 |
+
$products = $order->getAllItems();
|
233 |
+
|
234 |
+
$deliveryDate = 0;
|
235 |
+
/** @var $shipment Mage_Sales_Model_Order_Shipment */
|
236 |
+
foreach ($order->getShipmentsCollection() as $shipment) {
|
237 |
+
$deliveryDate = $shipment->getCreatedAt();
|
238 |
+
}
|
239 |
+
|
240 |
+
$shopOrder = Youstice_ShopOrder::create()
|
241 |
+
->setDescription('not provided')
|
242 |
+
->setName('#' . $order['increment_id'])
|
243 |
+
->setCurrency($order['order_currency_code'])
|
244 |
+
->setPrice((float) $order['grand_total'])
|
245 |
+
->setId($order->getId())
|
246 |
+
->setDeliveryDate($deliveryDate)
|
247 |
+
->setOrderDate($order['created_at'])
|
248 |
+
->setOtherInfo(json_encode($order->getData()))
|
249 |
+
->setHref($this->createOrderReportHref($order->getId()));
|
250 |
+
|
251 |
+
foreach ($products as $product) {
|
252 |
+
$shopProduct = $this->createShopProduct($product, $order->getId());
|
253 |
+
$shopProduct->setCurrency($order['order_currency_code']);
|
254 |
+
$shopProduct->setDeliveryDate($deliveryDate);
|
255 |
+
$shopProduct->setOrderDate($order['created_at']);
|
256 |
+
|
257 |
+
$shopOrder->addProduct($shopProduct);
|
258 |
+
}
|
259 |
+
|
260 |
+
return $shopOrder;
|
261 |
+
}
|
262 |
+
|
263 |
+
protected function createShopProduct($product, $orderId) {
|
264 |
+
$productObj = Mage::getModel('catalog/product')->load($product->getProductId());
|
265 |
+
$productSku = $product->getSku();
|
266 |
+
|
267 |
+
$shopProduct = Youstice_ShopProduct::create()
|
268 |
+
->setDescription($productObj->description)
|
269 |
+
->setName($product->getName())
|
270 |
+
->setPrice((float) $product->getPrice())
|
271 |
+
->setId($productSku)
|
272 |
+
->setOtherInfo(json_encode($product->getData()));
|
273 |
+
|
274 |
+
//add image if exists
|
275 |
+
if (strlen($productObj['image']) && $productObj['image'] != 'no_selection') {
|
276 |
+
$imagePath = Mage::getBaseDir('media') . '/catalog/product' . $productObj['image'];
|
277 |
+
$shopProduct->setImagePath($imagePath);
|
278 |
+
}
|
279 |
+
|
280 |
+
$shopProduct->setOrderId($orderId);
|
281 |
+
$shopProduct->setHref($this->createProductReportHref($orderId, $productSku));
|
282 |
+
|
283 |
+
return $shopProduct;
|
284 |
+
}
|
285 |
+
|
286 |
+
protected function createOrderReportHref($orderId) {
|
287 |
+
//logged out reporting
|
288 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
289 |
+
$params = array('email' => $this->getRequest()->getParam('email'), 'orderNumber' => $this->getRequest()->getParam('orderNumber'));
|
290 |
+
else
|
291 |
+
$params = array('order_id' => $orderId);
|
292 |
+
|
293 |
+
$href = Mage::getUrl('youstice/index/createOrderReport', array('_query' => $params));
|
294 |
+
return $href;
|
295 |
+
}
|
296 |
+
|
297 |
+
protected function createProductReportHref($orderId, $productId) {
|
298 |
+
//logged out reporting
|
299 |
+
if (!Mage::getSingleton('customer/session')->isLoggedIn())
|
300 |
+
$params = array('email' => $this->getRequest()->getParam('email'), 'orderNumber' => $this->getRequest()->getParam('orderNumber'));
|
301 |
+
else
|
302 |
+
$params = array('order_id' => $orderId);
|
303 |
+
|
304 |
+
$params = array_merge(array('product_sku' => $productId), $params);
|
305 |
+
$href = Mage::getUrl('youstice/index/createProductReport', array('_query' => $params));
|
306 |
+
|
307 |
+
return $href;
|
308 |
+
}
|
309 |
+
|
310 |
+
}
|
app/code/community/Youstice/YousticeResolutionSystem/etc/adminhtml.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<youstice_yousticeresolutionsystem>
|
5 |
+
<title>Youstice</title>
|
6 |
+
<sort_order>75</sort_order>
|
7 |
+
<action>youstice/admin/index</action>
|
8 |
+
<depends>
|
9 |
+
<module>Youstice_YousticeResolutionSystem</module>
|
10 |
+
</depends>
|
11 |
+
</youstice_yousticeresolutionsystem>
|
12 |
+
</menu>
|
13 |
+
</config>
|
app/code/community/Youstice/YousticeResolutionSystem/etc/config.xml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Youstice_YousticeResolutionSystem>
|
6 |
+
<version>1.3.3</version>
|
7 |
+
</Youstice_YousticeResolutionSystem>
|
8 |
+
</modules>
|
9 |
+
|
10 |
+
<global>
|
11 |
+
<resources>
|
12 |
+
<youstice_setup>
|
13 |
+
<setup>
|
14 |
+
<module>Youstice_YousticeResolutionSystem</module>
|
15 |
+
</setup>
|
16 |
+
</youstice_setup>
|
17 |
+
</resources>
|
18 |
+
</global>
|
19 |
+
|
20 |
+
<frontend>
|
21 |
+
<routers>
|
22 |
+
<youstice_yousticeresolutionsystem>
|
23 |
+
<use>standard</use>
|
24 |
+
<args>
|
25 |
+
<module>Youstice_YousticeResolutionSystem</module>
|
26 |
+
<frontName>youstice</frontName>
|
27 |
+
</args>
|
28 |
+
</youstice_yousticeresolutionsystem>
|
29 |
+
</routers>
|
30 |
+
<layout>
|
31 |
+
<updates>
|
32 |
+
<youstice_yousticeresolutionsystem>
|
33 |
+
<file>youstice_layout_update.xml</file>
|
34 |
+
</youstice_yousticeresolutionsystem>
|
35 |
+
</updates>
|
36 |
+
</layout>
|
37 |
+
</frontend>
|
38 |
+
|
39 |
+
<admin>
|
40 |
+
<routers>
|
41 |
+
<youstice_admin>
|
42 |
+
<use>admin</use>
|
43 |
+
<args>
|
44 |
+
<module>Youstice_YousticeResolutionSystem</module>
|
45 |
+
<frontName>youstice</frontName>
|
46 |
+
</args>
|
47 |
+
</youstice_admin>
|
48 |
+
</routers>
|
49 |
+
</admin>
|
50 |
+
|
51 |
+
<adminhtml>
|
52 |
+
<layout>
|
53 |
+
<updates>
|
54 |
+
<youstice_admin>
|
55 |
+
<file>youstice_layout_update.xml</file>
|
56 |
+
</youstice_admin>
|
57 |
+
</updates>
|
58 |
+
</layout>
|
59 |
+
|
60 |
+
</adminhtml>
|
61 |
+
|
62 |
+
</config>
|
app/code/community/Youstice/YousticeResolutionSystem/sql/youstice_setup/mysql4-install-0.9.8.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$this->setConfigData('youstice/api_key', '');
|
4 |
+
$this->setConfigData('youstice/use_sandbox', 1);
|
5 |
+
$this->setConfigData('youstice/shop_sells', 'product');
|
6 |
+
$this->setConfigData('youstice/default_language', 'en');
|
7 |
+
|
8 |
+
Mage::getConfig()->reinit();
|
9 |
+
Mage::app()->reinitStores();
|
10 |
+
|
11 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton');
|
12 |
+
|
13 |
+
$api->get()->install();
|
app/design/adminhtml/default/default/layout/youstice_layout_update.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<youstice_admin_admin_index>
|
5 |
+
<reference name="content">
|
6 |
+
<block type="core/template" name="youstice" template="youstice/adminForm.phtml" />
|
7 |
+
</reference>
|
8 |
+
<reference name="head">
|
9 |
+
<action method="addCss">
|
10 |
+
<name>yousticeAdmin.css</name>
|
11 |
+
</action>
|
12 |
+
<action method="addJs">
|
13 |
+
<script>youstice/jquery.min.js</script>
|
14 |
+
</action>
|
15 |
+
<action method="addJs">
|
16 |
+
<name>youstice/jquery.fancybox.js</name>
|
17 |
+
</action>
|
18 |
+
<action method="addJs">
|
19 |
+
<script>youstice/admin.js</script>
|
20 |
+
</action>
|
21 |
+
</reference>
|
22 |
+
</youstice_admin_admin_index>
|
23 |
+
</layout>
|
app/design/adminhtml/default/default/template/youstice/adminForm.phtml
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton')->get();
|
3 |
+
$apiKey = Mage::getStoreConfig('youstice/api_key');
|
4 |
+
$useSandbox = Mage::getStoreConfig('youstice/use_sandbox');
|
5 |
+
//$shopSells = Mage::getStoreConfig('youstice/shop_sells');
|
6 |
+
$defaultLanguage = Mage::getStoreConfig('youstice/default_language');
|
7 |
+
$api->setLanguage($defaultLanguage ? : 'en');
|
8 |
+
$reportClaimsLink = $this->getUrl('', array('_absolute' => true, '_secure' => true, '_direct' => 'youstice/index/getReportClaimsPage', '_nosid' => true));
|
9 |
+
?>
|
10 |
+
|
11 |
+
<form class="yContainer" action="<?php echo $this->getUrl('youstice/admin/save') ?>" method="post">
|
12 |
+
<div class="logoLeft">
|
13 |
+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ0AAABACAMAAAA3fdI8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAxRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDEwOUQ5REZENDQ4MTFFM0I4RTI5QTlBOTUzQzk2NzQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDEwOUQ5REVENDQ4MTFFM0I4RTI5QTlBOTUzQzk2NzQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9z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UNrPQbl7l7h933/bnJuzcNvWlQG5jupSLCWsfAktG91u/gznux1onwzm5GD3p5LLLD2EDDFtH4TgfDeo16Z/QGBPiiKgo04N8Zvpivw4WAXqDh4NSJ6ihr/MaAgCWsV+c32COb7z9xJQ4tY7CJM7qxjS2aRmMwp3+pYEaIBmbUiWFTp2Je0zH2BTubTmzMVGyjCGjoPJ5xG2OpEDS8JmK2/2vn0IvdbYWMwb5/1NvSjS1RMYIIUWG/Ohr/OfX+D6TEIy8dr+8AiMhhauu9li7UGuyMRKLWxzbjobHqfN/r5aQzw6kVGq1vyxgV2BmFwEQjzKlF1NnqcM+rS9SLdeo4XfDyHQMbN2p2iUTfs95EGk6tUrcArxD4mo8faxJfq283egesejTBf6H1jx8TTswX4cLGwJF2aB84Gt067KLZA8s9kmPfPBoqRhf+6pltW757fcaw/xlpTvzLX6JKN/Z3o/F3md94S+OtJPp/AQYA+87vvNe+Yy0AAAAASUVORK5CYII="/>
|
14 |
+
<p><?= $api->t('Resolve customer complaints in a few clicks.') ?></p>
|
15 |
+
</div>
|
16 |
+
<div class="logoRight">
|
17 |
+
<a href="http://www.youstice.com/?utm_source=eshop&utm_medium=cpc&utm_content=magento_weblink&utm_campaign=plugins" class="roundedAnchor" target="_blank">
|
18 |
+
<span><?= $api->t('For more information') ?></span>
|
19 |
+
<span><?= $api->t('about Youstice visit') ?></span>
|
20 |
+
<span class="anchor">www.youstice.com</span>
|
21 |
+
</a>
|
22 |
+
<a href="http://support.youstice.com/?utm_source=eshop&utm_medium=cpc&utm_content=magento_weblink&utm_campaign=plugins" class="roundedAnchor" target="_blank">
|
23 |
+
<span><?= $api->t('Need some help?') ?></span>
|
24 |
+
<span><?= $api->t('Our support team is here for you') ?>.</span>
|
25 |
+
<span class="anchor">support.youstice.com</span>
|
26 |
+
</a>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<hr>
|
30 |
+
|
31 |
+
<div class="loginInfo">
|
32 |
+
<p><?= $api->t('It only takes a few minutes to get started with Youstice.') ?></p>
|
33 |
+
<p><?= $api->t('Already have a Youstice account?') ?>
|
34 |
+
<input type="radio" name="have_account" id="haveAccountNo" value="0" checked="checked">
|
35 |
+
<label for="haveAccountNo"><?= $api->t('No') ?></label>
|
36 |
+
<input type="radio" name="have_account" id="haveAccountYes" value="1">
|
37 |
+
<label for="haveAccountYes"><?= $api->t('Yes') ?></label>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div class="yBlock stopScathingReviews">
|
42 |
+
<hr>
|
43 |
+
<h2><?= $api->t('Stop scathing reviews') ?></h2>
|
44 |
+
<a href="https://app.youstice.com/blox-odr/generix/odr/en/app2/_subscription_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins" target="_blank" class="roundedAnchor centered"><?= $api->t('START FREE TRIAL') ?></a>
|
45 |
+
<div class="left">
|
46 |
+
<h3><?= $api->t('Stop scathing reviews. Handle customer complaints fast and right.') ?></h3>
|
47 |
+
<p><?= $api->t('It’s a storeowner’s worst nightmare.') ?></p>
|
48 |
+
<p><?= $api->t('A disgruntled customer criticizes your business on social media. You are instantly thrown into crisis mode, trying as best you can to save your reputation.') ?></p>
|
49 |
+
<p><?= $api->t('It matters little whether the criticism is justified. Prevention is the best cure.') ?></p>
|
50 |
+
|
51 |
+
<h3><?= $api->t('You can resolve customer complaints effectively. You just need the right tool.') ?></h3>
|
52 |
+
<p><?= $api->t('Resolving complaints rapidly and effectively can place a heavy burden on your small business. The longer customers wait for your reply, the angrier they get. Yet you can’t be behind your computer screen 24/7.') ?></p>
|
53 |
+
<p><?= $api->t('Let us take the pain out of handling customer complaints. Thanks to our award-winning app, your customers know that you stand by your products and they trust your business.') ?></p>
|
54 |
+
</div>
|
55 |
+
<div class="right">
|
56 |
+
<div class="imgHelper"></div>
|
57 |
+
<img src="//www.youstice.com/images/yousticeimg/screenshots/laptop_with_coffee.jpg">
|
58 |
+
</div>
|
59 |
+
<div class="clear"></div>
|
60 |
+
<a href="https://app.youstice.com/blox-odr/generix/odr/en/app2/_subscription_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins" target="_blank" class="roundedAnchor centered"><?= $api->t('START FREE TRIAL') ?></a>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<div class="yConfiguration">
|
64 |
+
<hr>
|
65 |
+
<h2><?= $api->t('Configure Youstice for your website') ?></h2>
|
66 |
+
<div class="row">
|
67 |
+
<label for="useSandbox"><?= $api->t('Is the API key for Live or Sandbox environment?') ?></label>
|
68 |
+
<select id="useSandbox" name="use_sandbox">
|
69 |
+
<option value="1"<?= $useSandbox != 0 ? ' selected' : '' ?>><?= $api->t('Sandbox') ?></option>
|
70 |
+
<option value="0"<?= $useSandbox == 0 ? ' selected' : '' ?>><?= $api->t('Live') ?></option>
|
71 |
+
</select>
|
72 |
+
</div>
|
73 |
+
<div class="row onSandbox">
|
74 |
+
<p>
|
75 |
+
<?= $api->t('For testing purposes use our Sandbox environment. Please keep in mind that there are different API keys for Sandbox and Live environments. To start using Sandbox and get the matching API key you need to') ?>
|
76 |
+
<a href="https://app-sand.youstice.com/blox-odr13/generix/odr/<?= $defaultLanguage ?>/app2/_shopConfiguration_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins" target="_blank"><?= $api->t('register specifically for Sandbox') ?>.</a>
|
77 |
+
</p>
|
78 |
+
</div>
|
79 |
+
<div class="row">
|
80 |
+
<label for="apiKey"><?= $api->t('API Key of your shop') ?></label>
|
81 |
+
<input id="apiKey" type="text" name="api_key" value="<?= $apiKey ?>">
|
82 |
+
<a class="roundedAnchor style2" href="#" id="yGetApiKey"><?= $api->t('GET YOUR API KEY') ?></a>
|
83 |
+
</div>
|
84 |
+
<div class="row">
|
85 |
+
<label for="defaultLanguage"><?= $api->t('Default language') ?></label>
|
86 |
+
<select id="defaultLanguage" name="default_language">
|
87 |
+
<option value="0"<?= is_null($defaultLanguage) ? ' selected' : '' ?>><?= $api->t('Auto detection') ?></option>
|
88 |
+
<option value="cs"<?= $defaultLanguage == 'cs' ? ' selected' : '' ?>>Czech</option>
|
89 |
+
<option value="en"<?= $defaultLanguage == 'en' ? ' selected' : '' ?>>English</option>
|
90 |
+
<option value="fr"<?= $defaultLanguage == 'fr' ? ' selected' : '' ?>>French</option>
|
91 |
+
<option value="de"<?= $defaultLanguage == 'de' ? ' selected' : '' ?>>German</option>
|
92 |
+
<option value="pt"<?= $defaultLanguage == 'pt' ? ' selected' : '' ?>>Portuguese</option>
|
93 |
+
<option value="ru"<?= $defaultLanguage == 'ru' ? ' selected' : '' ?>>Russian</option>
|
94 |
+
<option value="sk"<?= $defaultLanguage == 'sk' ? ' selected' : '' ?>>Slovak</option>
|
95 |
+
<option value="es"<?= $defaultLanguage == 'es' ? ' selected' : '' ?>>Spanish</option>
|
96 |
+
</select>
|
97 |
+
</div>
|
98 |
+
<div class="row">
|
99 |
+
<label></label>
|
100 |
+
<a class="roundedAnchor style2 save" href="#"><?= $api->t('SAVE') ?></a>
|
101 |
+
</div>
|
102 |
+
<p>
|
103 |
+
<?= $api->t('Your API key can be found in Youstice application. Log in to Youstice') ?>
|
104 |
+
(<a href="https://app.youstice.com/blox-odr/generix/odr/<?= $defaultLanguage ? : 'en' ?>/app2/_shopConfiguration_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins" target="_blank"><?= $api->t('Live') ?></a>
|
105 |
+
<?= $api->t('or') ?>
|
106 |
+
<a href="https://app-sand.youstice.com/blox-odr13/generix/odr/<?= $defaultLanguage ? : 'en' ?>/app2/_shopConfiguration_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins" target="_blank"><?= $api->t('Sandbox') ?></a>),
|
107 |
+
<?= $api->t('go to menu SHOPS, click on your shop and see API key on the bottom of the page.') ?>
|
108 |
+
</p>
|
109 |
+
<p class="empty"> </p>
|
110 |
+
<p>
|
111 |
+
<b><?= $api->t('Need some help?') ?></b><br />
|
112 |
+
<?= $api->t('Our support team is here for you') ?>: <a href="http://support.youstice.com/?utm_source=eshop&utm_medium=cpc&utm_content=magento_weblink&utm_campaign=plugins" target="_blank">support.youstice.com</a>
|
113 |
+
</p>
|
114 |
+
</div>
|
115 |
+
|
116 |
+
<div class="yConfiguration">
|
117 |
+
<hr>
|
118 |
+
<h2><?= $api->t('Filing a claim without login') ?></h2>
|
119 |
+
<label for="reportClaimsPageLink"><b><?= $api->t('Optionally, copy & paste the code below to any place on your website if you want to allow your customers to file claims without logging in based on the customer’s email address and order reference.') ?></b></label>
|
120 |
+
<p><?= $api->t('Feel free to use this link on social networks. Post it proactively on Facebook, Google+, Twitter, etc. It will help to redirect negative opinions and potential complaints into Youstice and keep your wall clean.') ?></p>
|
121 |
+
<input id="reportClaimsPageLink" type="text" name="anonymous_report" onclick="select()" value="<?= $reportClaimsLink ?>">
|
122 |
+
<div class="clear"></div>
|
123 |
+
</div>
|
124 |
+
|
125 |
+
<div class="yBlock howItWorks">
|
126 |
+
<hr>
|
127 |
+
<h2><?= $api->t('How the Youstice plugin works') ?></h2>
|
128 |
+
<p>
|
129 |
+
<a href="<?= $this->getSkinUrl('images/youstice/screenshot_1.png') ?>" target="_blank" rel="screenshot">
|
130 |
+
<img src="<?= $this->getSkinUrl('images/youstice/screenshot_1.png') ?>">
|
131 |
+
</a>
|
132 |
+
<span><?= $api->t('New button ‘Would you like to file a complaint?’ appears in an order history of each customer.') ?></span>
|
133 |
+
</p>
|
134 |
+
<p class="right">
|
135 |
+
<a href="<?= $this->getSkinUrl('images/youstice/screenshot_2.png') ?>" target="_blank" rel="screenshot">
|
136 |
+
<img src="<?= $this->getSkinUrl('images/youstice/screenshot_2.png') ?>">
|
137 |
+
</a>
|
138 |
+
<span><?= $api->t('The customer can use this option to report a problem, whether related to a specific order or not.') ?></span>
|
139 |
+
</p>
|
140 |
+
<p>
|
141 |
+
<a href="<?= $this->getSkinUrl('images/youstice/screenshot_3.png') ?>" target="_blank" rel="screenshot">
|
142 |
+
<img src="<?= $this->getSkinUrl('images/youstice/screenshot_3.png') ?>">
|
143 |
+
</a>
|
144 |
+
<span><?= $api->t('It is also possible to report a problem with a specific item within an order.') ?></span>
|
145 |
+
</p>
|
146 |
+
<div class="clear"></div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div class="yBlock screenshots">
|
150 |
+
<hr>
|
151 |
+
<h2><?= $api->t('Screenshots') ?></h2>
|
152 |
+
<a href="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_1.jpg" target="_blank" rel="screenshotRemote">
|
153 |
+
<img src="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_small_1.jpg">
|
154 |
+
</a>
|
155 |
+
<a href="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_2.jpg" targer="_blank" rel="screenshotRemote">
|
156 |
+
<img src="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_small_2.jpg">
|
157 |
+
</a>
|
158 |
+
<a href="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_3.jpg" target="_blank" rel="screenshotRemote">
|
159 |
+
<img src="//www.youstice.com/images/yousticeimg/screenshots/app_screenshot_remote_small_3.jpg">
|
160 |
+
</a>
|
161 |
+
<div class="clear"></div>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
165 |
+
</form>
|
166 |
+
|
167 |
+
|
168 |
+
<link rel="stylesheet" href="<?= Mage::getDesign()->getSkinUrl('css/fancybox/jquery.fancybox.css', array('_area' => 'frontend')) ?>" type="text/css" media="screen" />
|
169 |
+
<script type="text/javascript">
|
170 |
+
var sandUrl = 'https://app-sand.youstice.com/blox-odr13/generix/odr/<?= $defaultLanguage ? : 'en' ?>/app2/_shopConfiguration_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins';
|
171 |
+
var liveUrl = 'https://app.youstice.com/blox-odr/generix/odr/<?= $defaultLanguage ? : 'en' ?>/app2/_shopConfiguration_?utm_source=eshop&utm_medium=cpc&utm_content=magento_signup&utm_campaign=plugins';
|
172 |
+
var checkApiKeyUrl = '<?php echo Mage::getModel('adminhtml/url')->getUrl('youstice/admin/checkApiKey') ?>?isAjax=true';
|
173 |
+
var languageSelectedDefault = '<?= $defaultLanguage ?>'
|
174 |
+
var errorHtml = '<ul class="messages"><li class="error-msg"><?= $api->t('Invalid API KEY') ?></li></ul>';
|
175 |
+
|
176 |
+
<?php if (strlen(trim($apiKey))): ?>
|
177 |
+
jQuery(document).ready(function($) {
|
178 |
+
$('#haveAccountYes').click();
|
179 |
+
});
|
180 |
+
<?php endif; ?>
|
181 |
+
</script>
|
app/design/frontend/base/default/layout/youstice_layout_update.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block name="youstice" type="core/template" template="youstice/baseUrl.phtml" />
|
6 |
+
<action method="addJs">
|
7 |
+
<script>youstice/jquery.min.js</script>
|
8 |
+
</action>
|
9 |
+
<action method="addJs">
|
10 |
+
<name>youstice/jquery.fancybox.js</name>
|
11 |
+
<params><![CDATA[name="js001_first"]]></params>
|
12 |
+
</action>
|
13 |
+
<action method="addJs">
|
14 |
+
<name>youstice/logoWidget.js</name>
|
15 |
+
</action>
|
16 |
+
<action method="addCss">
|
17 |
+
<script>css/fancybox/jquery.fancybox.css</script>
|
18 |
+
</action>
|
19 |
+
<action method="addCss">
|
20 |
+
<script>css/youstice.css</script>
|
21 |
+
</action>
|
22 |
+
<action method="addCss">
|
23 |
+
<script>css/youstice_magento.css</script>
|
24 |
+
</action>
|
25 |
+
</reference>
|
26 |
+
</default>
|
27 |
+
|
28 |
+
<customer_account_index>
|
29 |
+
<reference name="head">
|
30 |
+
<action method="addJs">
|
31 |
+
<name>youstice/orders.js</name>
|
32 |
+
<params><![CDATA[name="js001_first"]]></params>
|
33 |
+
</action>
|
34 |
+
</reference>
|
35 |
+
</customer_account_index>
|
36 |
+
<sales_order_history>
|
37 |
+
<reference name="head">
|
38 |
+
<action method="addJs">
|
39 |
+
<name>youstice/orders.js</name>
|
40 |
+
<params><![CDATA[name="js001_first"]]></params>
|
41 |
+
</action>
|
42 |
+
</reference>
|
43 |
+
</sales_order_history>
|
44 |
+
<sales_order_view>
|
45 |
+
<reference name="head">
|
46 |
+
<action method="addJs">
|
47 |
+
<name>youstice/products.js</name>
|
48 |
+
<params><![CDATA[name="js001_first"]]></params>
|
49 |
+
</action>
|
50 |
+
</reference>
|
51 |
+
</sales_order_view>
|
52 |
+
</layout>
|
app/design/frontend/base/default/template/youstice/baseUrl.phtml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$baseUrl = Mage::getUrl('youstice', array('_nosid' => true));
|
3 |
+
?>
|
4 |
+
<script type="text/javascript">
|
5 |
+
var BASE_URL = '<?php echo $baseUrl ?>';
|
6 |
+
</script>
|
app/design/frontend/base/default/template/youstice/reportClaims.phtml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton');
|
3 |
+
|
4 |
+
echo $api->get()->getReportClaimsFormHtml();
|
app/design/frontend/base/default/template/youstice/reportClaimsOgTags.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$api = Mage::getSingleton('Youstice_YousticeResolutionSystem_Helper_ApiSingleton')->get();
|
3 |
+
|
4 |
+
$titleString = Mage::app()->getStore()->getName() . ' - Youstice - ' . $api->t('File a complaint');
|
5 |
+
$html = '<meta property="og:title" content="' . $titleString . '" />';
|
6 |
+
$html .= '<meta property="og:type" content="website" />';
|
7 |
+
$html .= '<meta property="og:url" content="' . $this->getUrl('youstice/index/getReportClaimsPage') . '" />';
|
8 |
+
$html .= '<meta property="og:image" content="' . Mage::getDesign()->getSkinUrl('images/youstice/logo.png') . '" />';
|
9 |
+
|
10 |
+
$description_text = $api->t("In case you want to complain about a product or service, please follow this link.");
|
11 |
+
$html .= '<meta property="og:description" content="' . $description_text . '" />';
|
12 |
+
echo $html;
|
app/etc/modules/Youstice_YousticeResolutionSystem.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Youstice_YousticeResolutionSystem>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
</Youstice_YousticeResolutionSystem>
|
9 |
+
</modules>
|
10 |
+
</config>
|
js/youstice/admin.js
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
$('input[name="have_account"]').change(function() {
|
4 |
+
changeBlocksVisibility($(this).val() == 1);
|
5 |
+
});
|
6 |
+
|
7 |
+
$('select#useSandbox').change(function() {
|
8 |
+
changeSandboxText();
|
9 |
+
});
|
10 |
+
|
11 |
+
function changeSandboxText() {
|
12 |
+
if ($('select#useSandbox').val() == 1) {
|
13 |
+
$('.row.onSandbox').show();
|
14 |
+
}
|
15 |
+
else {
|
16 |
+
$('.row.onSandbox').hide()
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
changeSandboxText();
|
21 |
+
changeBlocksVisibility($('input[name="have_account"]').val() == 1);
|
22 |
+
|
23 |
+
$('#yGetApiKey').click(function(e) {
|
24 |
+
e.preventDefault();
|
25 |
+
var win;
|
26 |
+
if ($('#useSandbox').val() == 1) {
|
27 |
+
win = window.open(sandUrl, '_blank');
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
win = window.open(liveUrl, '_blank');
|
31 |
+
}
|
32 |
+
|
33 |
+
win.focus();
|
34 |
+
});
|
35 |
+
|
36 |
+
$('.yBlock.screenshots a[rel="screenshotRemote"]').fancybox();
|
37 |
+
$('.yBlock.howItWorks a[rel="screenshot"]').fancybox();
|
38 |
+
|
39 |
+
jQuery('a.save').click(function(e) {
|
40 |
+
e.preventDefault();
|
41 |
+
saveSettings();
|
42 |
+
});
|
43 |
+
});
|
44 |
+
|
45 |
+
function saveSettings() {
|
46 |
+
jQuery('.messages').remove();
|
47 |
+
jQuery.post(checkApiKeyUrl, {form_key: window.FORM_KEY, api_key: jQuery('#apiKey').val(), use_sandbox: jQuery('#useSandbox').val()},
|
48 |
+
function(response) {
|
49 |
+
if (response.result !== true) {
|
50 |
+
showError();
|
51 |
+
jQuery('html, body').animate({
|
52 |
+
scrollTop: jQuery(".yConfiguration").first().offset().top
|
53 |
+
}, 2000);
|
54 |
+
}
|
55 |
+
else {
|
56 |
+
jQuery('.yContainer').submit();
|
57 |
+
}
|
58 |
+
}, 'json');
|
59 |
+
}
|
60 |
+
|
61 |
+
function changeBlocksVisibility(haveAccount) {
|
62 |
+
jQuery('.yBlock, .yConfiguration').show();
|
63 |
+
if (haveAccount) {
|
64 |
+
jQuery('.yBlock.screenshots, .yBlock.stopScathingReviews').hide();
|
65 |
+
}
|
66 |
+
else {
|
67 |
+
jQuery('.yConfiguration').hide();
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
function showError() {
|
72 |
+
jQuery('.roundedAnchor.save').after(errorHtml);
|
73 |
+
jQuery('html, body').animate({
|
74 |
+
scrollTop: jQuery(".yConfiguration").first().offset().top
|
75 |
+
}, 2000);
|
76 |
+
}
|
js/youstice/jquery.fancybox.js
ADDED
@@ -0,0 +1,2020 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* fancyBox - jQuery Plugin
|
3 |
+
* version: 2.1.5 (Fri, 14 Jun 2013)
|
4 |
+
* @requires jQuery v1.6 or later
|
5 |
+
*
|
6 |
+
* Examples at http://fancyapps.com/fancybox/
|
7 |
+
* License: www.fancyapps.com/fancybox/#license
|
8 |
+
*
|
9 |
+
* Copyright 2012 Janis Skarnelis - janis@fancyapps.com
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
|
13 |
+
(function (window, document, $, undefined) {
|
14 |
+
"use strict";
|
15 |
+
|
16 |
+
var H = $("html"),
|
17 |
+
W = $(window),
|
18 |
+
D = $(document),
|
19 |
+
F = $.fancybox = function () {
|
20 |
+
F.open.apply( this, arguments );
|
21 |
+
},
|
22 |
+
IE = navigator.userAgent.match(/msie/i),
|
23 |
+
didUpdate = null,
|
24 |
+
isTouch = document.createTouch !== undefined,
|
25 |
+
|
26 |
+
isQuery = function(obj) {
|
27 |
+
return obj && obj.hasOwnProperty && obj instanceof $;
|
28 |
+
},
|
29 |
+
isString = function(str) {
|
30 |
+
return str && $.type(str) === "string";
|
31 |
+
},
|
32 |
+
isPercentage = function(str) {
|
33 |
+
return isString(str) && str.indexOf('%') > 0;
|
34 |
+
},
|
35 |
+
isScrollable = function(el) {
|
36 |
+
return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
|
37 |
+
},
|
38 |
+
getScalar = function(orig, dim) {
|
39 |
+
var value = parseInt(orig, 10) || 0;
|
40 |
+
|
41 |
+
if (dim && isPercentage(orig)) {
|
42 |
+
value = F.getViewport()[ dim ] / 100 * value;
|
43 |
+
}
|
44 |
+
|
45 |
+
return Math.ceil(value);
|
46 |
+
},
|
47 |
+
getValue = function(value, dim) {
|
48 |
+
return getScalar(value, dim) + 'px';
|
49 |
+
};
|
50 |
+
|
51 |
+
$.extend(F, {
|
52 |
+
// The current version of fancyBox
|
53 |
+
version: '2.1.5',
|
54 |
+
|
55 |
+
defaults: {
|
56 |
+
padding : 15,
|
57 |
+
margin : 20,
|
58 |
+
|
59 |
+
width : 800,
|
60 |
+
height : 600,
|
61 |
+
minWidth : 100,
|
62 |
+
minHeight : 100,
|
63 |
+
maxWidth : 9999,
|
64 |
+
maxHeight : 9999,
|
65 |
+
pixelRatio: 1, // Set to 2 for retina display support
|
66 |
+
|
67 |
+
autoSize : true,
|
68 |
+
autoHeight : false,
|
69 |
+
autoWidth : false,
|
70 |
+
|
71 |
+
autoResize : true,
|
72 |
+
autoCenter : !isTouch,
|
73 |
+
fitToView : true,
|
74 |
+
aspectRatio : false,
|
75 |
+
topRatio : 0.5,
|
76 |
+
leftRatio : 0.5,
|
77 |
+
|
78 |
+
scrolling : 'auto', // 'auto', 'yes' or 'no'
|
79 |
+
wrapCSS : '',
|
80 |
+
|
81 |
+
arrows : true,
|
82 |
+
closeBtn : true,
|
83 |
+
closeClick : false,
|
84 |
+
nextClick : false,
|
85 |
+
mouseWheel : true,
|
86 |
+
autoPlay : false,
|
87 |
+
playSpeed : 3000,
|
88 |
+
preload : 3,
|
89 |
+
modal : false,
|
90 |
+
loop : true,
|
91 |
+
|
92 |
+
ajax : {
|
93 |
+
dataType : 'html',
|
94 |
+
headers : { 'X-fancyBox': true }
|
95 |
+
},
|
96 |
+
iframe : {
|
97 |
+
scrolling : 'auto',
|
98 |
+
preload : true
|
99 |
+
},
|
100 |
+
swf : {
|
101 |
+
wmode: 'transparent',
|
102 |
+
allowfullscreen : 'true',
|
103 |
+
allowscriptaccess : 'always'
|
104 |
+
},
|
105 |
+
|
106 |
+
keys : {
|
107 |
+
next : {
|
108 |
+
13 : 'left', // enter
|
109 |
+
34 : 'up', // page down
|
110 |
+
39 : 'left', // right arrow
|
111 |
+
40 : 'up' // down arrow
|
112 |
+
},
|
113 |
+
prev : {
|
114 |
+
8 : 'right', // backspace
|
115 |
+
33 : 'down', // page up
|
116 |
+
37 : 'right', // left arrow
|
117 |
+
38 : 'down' // up arrow
|
118 |
+
},
|
119 |
+
close : [27], // escape key
|
120 |
+
play : [32], // space - start/stop slideshow
|
121 |
+
toggle : [70] // letter "f" - toggle fullscreen
|
122 |
+
},
|
123 |
+
|
124 |
+
direction : {
|
125 |
+
next : 'left',
|
126 |
+
prev : 'right'
|
127 |
+
},
|
128 |
+
|
129 |
+
scrollOutside : true,
|
130 |
+
|
131 |
+
// Override some properties
|
132 |
+
index : 0,
|
133 |
+
type : null,
|
134 |
+
href : null,
|
135 |
+
content : null,
|
136 |
+
title : null,
|
137 |
+
|
138 |
+
// HTML templates
|
139 |
+
tpl: {
|
140 |
+
wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
|
141 |
+
image : '<img class="fancybox-image" src="{href}" alt="" />',
|
142 |
+
iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
|
143 |
+
error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
|
144 |
+
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
|
145 |
+
next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
|
146 |
+
prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
|
147 |
+
},
|
148 |
+
|
149 |
+
// Properties for each animation type
|
150 |
+
// Opening fancyBox
|
151 |
+
openEffect : 'fade', // 'elastic', 'fade' or 'none'
|
152 |
+
openSpeed : 250,
|
153 |
+
openEasing : 'swing',
|
154 |
+
openOpacity : true,
|
155 |
+
openMethod : 'zoomIn',
|
156 |
+
|
157 |
+
// Closing fancyBox
|
158 |
+
closeEffect : 'fade', // 'elastic', 'fade' or 'none'
|
159 |
+
closeSpeed : 250,
|
160 |
+
closeEasing : 'swing',
|
161 |
+
closeOpacity : true,
|
162 |
+
closeMethod : 'zoomOut',
|
163 |
+
|
164 |
+
// Changing next gallery item
|
165 |
+
nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
166 |
+
nextSpeed : 250,
|
167 |
+
nextEasing : 'swing',
|
168 |
+
nextMethod : 'changeIn',
|
169 |
+
|
170 |
+
// Changing previous gallery item
|
171 |
+
prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
172 |
+
prevSpeed : 250,
|
173 |
+
prevEasing : 'swing',
|
174 |
+
prevMethod : 'changeOut',
|
175 |
+
|
176 |
+
// Enable default helpers
|
177 |
+
helpers : {
|
178 |
+
overlay : true,
|
179 |
+
title : true
|
180 |
+
},
|
181 |
+
|
182 |
+
// Callbacks
|
183 |
+
onCancel : $.noop, // If canceling
|
184 |
+
beforeLoad : $.noop, // Before loading
|
185 |
+
afterLoad : $.noop, // After loading
|
186 |
+
beforeShow : $.noop, // Before changing in current item
|
187 |
+
afterShow : $.noop, // After opening
|
188 |
+
beforeChange : $.noop, // Before changing gallery item
|
189 |
+
beforeClose : $.noop, // Before closing
|
190 |
+
afterClose : $.noop // After closing
|
191 |
+
},
|
192 |
+
|
193 |
+
//Current state
|
194 |
+
group : {}, // Selected group
|
195 |
+
opts : {}, // Group options
|
196 |
+
previous : null, // Previous element
|
197 |
+
coming : null, // Element being loaded
|
198 |
+
current : null, // Currently loaded element
|
199 |
+
isActive : false, // Is activated
|
200 |
+
isOpen : false, // Is currently open
|
201 |
+
isOpened : false, // Have been fully opened at least once
|
202 |
+
|
203 |
+
wrap : null,
|
204 |
+
skin : null,
|
205 |
+
outer : null,
|
206 |
+
inner : null,
|
207 |
+
|
208 |
+
player : {
|
209 |
+
timer : null,
|
210 |
+
isActive : false
|
211 |
+
},
|
212 |
+
|
213 |
+
// Loaders
|
214 |
+
ajaxLoad : null,
|
215 |
+
imgPreload : null,
|
216 |
+
|
217 |
+
// Some collections
|
218 |
+
transitions : {},
|
219 |
+
helpers : {},
|
220 |
+
|
221 |
+
/*
|
222 |
+
* Static methods
|
223 |
+
*/
|
224 |
+
|
225 |
+
open: function (group, opts) {
|
226 |
+
if (!group) {
|
227 |
+
return;
|
228 |
+
}
|
229 |
+
|
230 |
+
if (!$.isPlainObject(opts)) {
|
231 |
+
opts = {};
|
232 |
+
}
|
233 |
+
|
234 |
+
// Close if already active
|
235 |
+
if (false === F.close(true)) {
|
236 |
+
return;
|
237 |
+
}
|
238 |
+
|
239 |
+
// Normalize group
|
240 |
+
if (!$.isArray(group)) {
|
241 |
+
group = isQuery(group) ? $(group).get() : [group];
|
242 |
+
}
|
243 |
+
|
244 |
+
// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
|
245 |
+
$.each(group, function(i, element) {
|
246 |
+
var obj = {},
|
247 |
+
href,
|
248 |
+
title,
|
249 |
+
content,
|
250 |
+
type,
|
251 |
+
rez,
|
252 |
+
hrefParts,
|
253 |
+
selector;
|
254 |
+
|
255 |
+
if ($.type(element) === "object") {
|
256 |
+
// Check if is DOM element
|
257 |
+
if (element.nodeType) {
|
258 |
+
element = $(element);
|
259 |
+
}
|
260 |
+
|
261 |
+
if (isQuery(element)) {
|
262 |
+
obj = {
|
263 |
+
href : element.data('fancybox-href') || element.attr('href'),
|
264 |
+
title : element.data('fancybox-title') || element.attr('title'),
|
265 |
+
isDom : true,
|
266 |
+
element : element
|
267 |
+
};
|
268 |
+
|
269 |
+
if ($.metadata) {
|
270 |
+
$.extend(true, obj, element.metadata());
|
271 |
+
}
|
272 |
+
|
273 |
+
} else {
|
274 |
+
obj = element;
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
href = opts.href || obj.href || (isString(element) ? element : null);
|
279 |
+
title = opts.title !== undefined ? opts.title : obj.title || '';
|
280 |
+
|
281 |
+
content = opts.content || obj.content;
|
282 |
+
type = content ? 'html' : (opts.type || obj.type);
|
283 |
+
|
284 |
+
if (!type && obj.isDom) {
|
285 |
+
type = element.data('fancybox-type');
|
286 |
+
|
287 |
+
if (!type) {
|
288 |
+
rez = element.prop('class').match(/fancybox\.(\w+)/);
|
289 |
+
type = rez ? rez[1] : null;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
if (isString(href)) {
|
294 |
+
// Try to guess the content type
|
295 |
+
if (!type) {
|
296 |
+
if (F.isImage(href)) {
|
297 |
+
type = 'image';
|
298 |
+
|
299 |
+
} else if (F.isSWF(href)) {
|
300 |
+
type = 'swf';
|
301 |
+
|
302 |
+
} else if (href.charAt(0) === '#') {
|
303 |
+
type = 'inline';
|
304 |
+
|
305 |
+
} else if (isString(element)) {
|
306 |
+
type = 'html';
|
307 |
+
content = element;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
// Split url into two pieces with source url and content selector, e.g,
|
312 |
+
// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
|
313 |
+
if (type === 'ajax') {
|
314 |
+
hrefParts = href.split(/\s+/, 2);
|
315 |
+
href = hrefParts.shift();
|
316 |
+
selector = hrefParts.shift();
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
if (!content) {
|
321 |
+
if (type === 'inline') {
|
322 |
+
if (href) {
|
323 |
+
content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
|
324 |
+
|
325 |
+
} else if (obj.isDom) {
|
326 |
+
content = element;
|
327 |
+
}
|
328 |
+
|
329 |
+
} else if (type === 'html') {
|
330 |
+
content = href;
|
331 |
+
|
332 |
+
} else if (!type && !href && obj.isDom) {
|
333 |
+
type = 'inline';
|
334 |
+
content = element;
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
$.extend(obj, {
|
339 |
+
href : href,
|
340 |
+
type : type,
|
341 |
+
content : content,
|
342 |
+
title : title,
|
343 |
+
selector : selector
|
344 |
+
});
|
345 |
+
|
346 |
+
group[ i ] = obj;
|
347 |
+
});
|
348 |
+
|
349 |
+
// Extend the defaults
|
350 |
+
F.opts = $.extend(true, {}, F.defaults, opts);
|
351 |
+
|
352 |
+
// All options are merged recursive except keys
|
353 |
+
if (opts.keys !== undefined) {
|
354 |
+
F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
|
355 |
+
}
|
356 |
+
|
357 |
+
F.group = group;
|
358 |
+
|
359 |
+
return F._start(F.opts.index);
|
360 |
+
},
|
361 |
+
|
362 |
+
// Cancel image loading or abort ajax request
|
363 |
+
cancel: function () {
|
364 |
+
var coming = F.coming;
|
365 |
+
|
366 |
+
if (!coming || false === F.trigger('onCancel')) {
|
367 |
+
return;
|
368 |
+
}
|
369 |
+
|
370 |
+
F.hideLoading();
|
371 |
+
|
372 |
+
if (F.ajaxLoad) {
|
373 |
+
F.ajaxLoad.abort();
|
374 |
+
}
|
375 |
+
|
376 |
+
F.ajaxLoad = null;
|
377 |
+
|
378 |
+
if (F.imgPreload) {
|
379 |
+
F.imgPreload.onload = F.imgPreload.onerror = null;
|
380 |
+
}
|
381 |
+
|
382 |
+
if (coming.wrap) {
|
383 |
+
coming.wrap.stop(true, true).trigger('onReset').remove();
|
384 |
+
}
|
385 |
+
|
386 |
+
F.coming = null;
|
387 |
+
|
388 |
+
// If the first item has been canceled, then clear everything
|
389 |
+
if (!F.current) {
|
390 |
+
F._afterZoomOut( coming );
|
391 |
+
}
|
392 |
+
},
|
393 |
+
|
394 |
+
// Start closing animation if is open; remove immediately if opening/closing
|
395 |
+
close: function (event) {
|
396 |
+
F.cancel();
|
397 |
+
|
398 |
+
if (false === F.trigger('beforeClose')) {
|
399 |
+
return;
|
400 |
+
}
|
401 |
+
|
402 |
+
F.unbindEvents();
|
403 |
+
|
404 |
+
if (!F.isActive) {
|
405 |
+
return;
|
406 |
+
}
|
407 |
+
|
408 |
+
if (!F.isOpen || event === true) {
|
409 |
+
$('.fancybox-wrap').stop(true).trigger('onReset').remove();
|
410 |
+
|
411 |
+
F._afterZoomOut();
|
412 |
+
|
413 |
+
} else {
|
414 |
+
F.isOpen = F.isOpened = false;
|
415 |
+
F.isClosing = true;
|
416 |
+
|
417 |
+
$('.fancybox-item, .fancybox-nav').remove();
|
418 |
+
|
419 |
+
F.wrap.stop(true, true).removeClass('fancybox-opened');
|
420 |
+
|
421 |
+
F.transitions[ F.current.closeMethod ]();
|
422 |
+
}
|
423 |
+
},
|
424 |
+
|
425 |
+
// Manage slideshow:
|
426 |
+
// $.fancybox.play(); - toggle slideshow
|
427 |
+
// $.fancybox.play( true ); - start
|
428 |
+
// $.fancybox.play( false ); - stop
|
429 |
+
play: function ( action ) {
|
430 |
+
var clear = function () {
|
431 |
+
clearTimeout(F.player.timer);
|
432 |
+
},
|
433 |
+
set = function () {
|
434 |
+
clear();
|
435 |
+
|
436 |
+
if (F.current && F.player.isActive) {
|
437 |
+
F.player.timer = setTimeout(F.next, F.current.playSpeed);
|
438 |
+
}
|
439 |
+
},
|
440 |
+
stop = function () {
|
441 |
+
clear();
|
442 |
+
|
443 |
+
D.unbind('.player');
|
444 |
+
|
445 |
+
F.player.isActive = false;
|
446 |
+
|
447 |
+
F.trigger('onPlayEnd');
|
448 |
+
},
|
449 |
+
start = function () {
|
450 |
+
if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
|
451 |
+
F.player.isActive = true;
|
452 |
+
|
453 |
+
D.bind({
|
454 |
+
'onCancel.player beforeClose.player' : stop,
|
455 |
+
'onUpdate.player' : set,
|
456 |
+
'beforeLoad.player' : clear
|
457 |
+
});
|
458 |
+
|
459 |
+
set();
|
460 |
+
|
461 |
+
F.trigger('onPlayStart');
|
462 |
+
}
|
463 |
+
};
|
464 |
+
|
465 |
+
if (action === true || (!F.player.isActive && action !== false)) {
|
466 |
+
start();
|
467 |
+
} else {
|
468 |
+
stop();
|
469 |
+
}
|
470 |
+
},
|
471 |
+
|
472 |
+
// Navigate to next gallery item
|
473 |
+
next: function ( direction ) {
|
474 |
+
var current = F.current;
|
475 |
+
|
476 |
+
if (current) {
|
477 |
+
if (!isString(direction)) {
|
478 |
+
direction = current.direction.next;
|
479 |
+
}
|
480 |
+
|
481 |
+
F.jumpto(current.index + 1, direction, 'next');
|
482 |
+
}
|
483 |
+
},
|
484 |
+
|
485 |
+
// Navigate to previous gallery item
|
486 |
+
prev: function ( direction ) {
|
487 |
+
var current = F.current;
|
488 |
+
|
489 |
+
if (current) {
|
490 |
+
if (!isString(direction)) {
|
491 |
+
direction = current.direction.prev;
|
492 |
+
}
|
493 |
+
|
494 |
+
F.jumpto(current.index - 1, direction, 'prev');
|
495 |
+
}
|
496 |
+
},
|
497 |
+
|
498 |
+
// Navigate to gallery item by index
|
499 |
+
jumpto: function ( index, direction, router ) {
|
500 |
+
var current = F.current;
|
501 |
+
|
502 |
+
if (!current) {
|
503 |
+
return;
|
504 |
+
}
|
505 |
+
|
506 |
+
index = getScalar(index);
|
507 |
+
|
508 |
+
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
|
509 |
+
F.router = router || 'jumpto';
|
510 |
+
|
511 |
+
if (current.loop) {
|
512 |
+
if (index < 0) {
|
513 |
+
index = current.group.length + (index % current.group.length);
|
514 |
+
}
|
515 |
+
|
516 |
+
index = index % current.group.length;
|
517 |
+
}
|
518 |
+
|
519 |
+
if (current.group[ index ] !== undefined) {
|
520 |
+
F.cancel();
|
521 |
+
|
522 |
+
F._start(index);
|
523 |
+
}
|
524 |
+
},
|
525 |
+
|
526 |
+
// Center inside viewport and toggle position type to fixed or absolute if needed
|
527 |
+
reposition: function (e, onlyAbsolute) {
|
528 |
+
var current = F.current,
|
529 |
+
wrap = current ? current.wrap : null,
|
530 |
+
pos;
|
531 |
+
|
532 |
+
if (wrap) {
|
533 |
+
pos = F._getPosition(onlyAbsolute);
|
534 |
+
|
535 |
+
if (e && e.type === 'scroll') {
|
536 |
+
delete pos.position;
|
537 |
+
|
538 |
+
wrap.stop(true, true).animate(pos, 200);
|
539 |
+
|
540 |
+
} else {
|
541 |
+
wrap.css(pos);
|
542 |
+
|
543 |
+
current.pos = $.extend({}, current.dim, pos);
|
544 |
+
}
|
545 |
+
}
|
546 |
+
},
|
547 |
+
|
548 |
+
update: function (e) {
|
549 |
+
var type = (e && e.type),
|
550 |
+
anyway = !type || type === 'orientationchange';
|
551 |
+
|
552 |
+
if (anyway) {
|
553 |
+
clearTimeout(didUpdate);
|
554 |
+
|
555 |
+
didUpdate = null;
|
556 |
+
}
|
557 |
+
|
558 |
+
if (!F.isOpen || didUpdate) {
|
559 |
+
return;
|
560 |
+
}
|
561 |
+
|
562 |
+
didUpdate = setTimeout(function() {
|
563 |
+
var current = F.current;
|
564 |
+
|
565 |
+
if (!current || F.isClosing) {
|
566 |
+
return;
|
567 |
+
}
|
568 |
+
|
569 |
+
F.wrap.removeClass('fancybox-tmp');
|
570 |
+
|
571 |
+
if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
|
572 |
+
F._setDimension();
|
573 |
+
}
|
574 |
+
|
575 |
+
if (!(type === 'scroll' && current.canShrink)) {
|
576 |
+
F.reposition(e);
|
577 |
+
}
|
578 |
+
|
579 |
+
F.trigger('onUpdate');
|
580 |
+
|
581 |
+
didUpdate = null;
|
582 |
+
|
583 |
+
}, (anyway && !isTouch ? 0 : 300));
|
584 |
+
},
|
585 |
+
|
586 |
+
// Shrink content to fit inside viewport or restore if resized
|
587 |
+
toggle: function ( action ) {
|
588 |
+
if (F.isOpen) {
|
589 |
+
F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
|
590 |
+
|
591 |
+
// Help browser to restore document dimensions
|
592 |
+
if (isTouch) {
|
593 |
+
F.wrap.removeAttr('style').addClass('fancybox-tmp');
|
594 |
+
|
595 |
+
F.trigger('onUpdate');
|
596 |
+
}
|
597 |
+
|
598 |
+
F.update();
|
599 |
+
}
|
600 |
+
},
|
601 |
+
|
602 |
+
hideLoading: function () {
|
603 |
+
D.unbind('.loading');
|
604 |
+
|
605 |
+
$('#fancybox-loading').remove();
|
606 |
+
},
|
607 |
+
|
608 |
+
showLoading: function () {
|
609 |
+
var el, viewport;
|
610 |
+
|
611 |
+
F.hideLoading();
|
612 |
+
|
613 |
+
el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
|
614 |
+
|
615 |
+
// If user will press the escape-button, the request will be canceled
|
616 |
+
D.bind('keydown.loading', function(e) {
|
617 |
+
if ((e.which || e.keyCode) === 27) {
|
618 |
+
e.preventDefault();
|
619 |
+
|
620 |
+
F.cancel();
|
621 |
+
}
|
622 |
+
});
|
623 |
+
|
624 |
+
if (!F.defaults.fixed) {
|
625 |
+
viewport = F.getViewport();
|
626 |
+
|
627 |
+
el.css({
|
628 |
+
position : 'absolute',
|
629 |
+
top : (viewport.h * 0.5) + viewport.y,
|
630 |
+
left : (viewport.w * 0.5) + viewport.x
|
631 |
+
});
|
632 |
+
}
|
633 |
+
},
|
634 |
+
|
635 |
+
getViewport: function () {
|
636 |
+
var locked = (F.current && F.current.locked) || false,
|
637 |
+
rez = {
|
638 |
+
x: W.scrollLeft(),
|
639 |
+
y: W.scrollTop()
|
640 |
+
};
|
641 |
+
|
642 |
+
if (locked) {
|
643 |
+
rez.w = locked[0].clientWidth;
|
644 |
+
rez.h = locked[0].clientHeight;
|
645 |
+
|
646 |
+
} else {
|
647 |
+
// See http://bugs.jquery.com/ticket/6724
|
648 |
+
rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
|
649 |
+
rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
|
650 |
+
}
|
651 |
+
|
652 |
+
return rez;
|
653 |
+
},
|
654 |
+
|
655 |
+
// Unbind the keyboard / clicking actions
|
656 |
+
unbindEvents: function () {
|
657 |
+
if (F.wrap && isQuery(F.wrap)) {
|
658 |
+
F.wrap.unbind('.fb');
|
659 |
+
}
|
660 |
+
|
661 |
+
D.unbind('.fb');
|
662 |
+
W.unbind('.fb');
|
663 |
+
},
|
664 |
+
|
665 |
+
bindEvents: function () {
|
666 |
+
var current = F.current,
|
667 |
+
keys;
|
668 |
+
|
669 |
+
if (!current) {
|
670 |
+
return;
|
671 |
+
}
|
672 |
+
|
673 |
+
// Changing document height on iOS devices triggers a 'resize' event,
|
674 |
+
// that can change document height... repeating infinitely
|
675 |
+
W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
|
676 |
+
|
677 |
+
keys = current.keys;
|
678 |
+
|
679 |
+
if (keys) {
|
680 |
+
D.bind('keydown.fb', function (e) {
|
681 |
+
var code = e.which || e.keyCode,
|
682 |
+
target = e.target || e.srcElement;
|
683 |
+
|
684 |
+
// Skip esc key if loading, because showLoading will cancel preloading
|
685 |
+
if (code === 27 && F.coming) {
|
686 |
+
return false;
|
687 |
+
}
|
688 |
+
|
689 |
+
// Ignore key combinations and key events within form elements
|
690 |
+
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
|
691 |
+
$.each(keys, function(i, val) {
|
692 |
+
if (current.group.length > 1 && val[ code ] !== undefined) {
|
693 |
+
F[ i ]( val[ code ] );
|
694 |
+
|
695 |
+
e.preventDefault();
|
696 |
+
return false;
|
697 |
+
}
|
698 |
+
|
699 |
+
if ($.inArray(code, val) > -1) {
|
700 |
+
F[ i ] ();
|
701 |
+
|
702 |
+
e.preventDefault();
|
703 |
+
return false;
|
704 |
+
}
|
705 |
+
});
|
706 |
+
}
|
707 |
+
});
|
708 |
+
}
|
709 |
+
|
710 |
+
if ($.fn.mousewheel && current.mouseWheel) {
|
711 |
+
F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
|
712 |
+
var target = e.target || null,
|
713 |
+
parent = $(target),
|
714 |
+
canScroll = false;
|
715 |
+
|
716 |
+
while (parent.length) {
|
717 |
+
if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
|
718 |
+
break;
|
719 |
+
}
|
720 |
+
|
721 |
+
canScroll = isScrollable( parent[0] );
|
722 |
+
parent = $(parent).parent();
|
723 |
+
}
|
724 |
+
|
725 |
+
if (delta !== 0 && !canScroll) {
|
726 |
+
if (F.group.length > 1 && !current.canShrink) {
|
727 |
+
if (deltaY > 0 || deltaX > 0) {
|
728 |
+
F.prev( deltaY > 0 ? 'down' : 'left' );
|
729 |
+
|
730 |
+
} else if (deltaY < 0 || deltaX < 0) {
|
731 |
+
F.next( deltaY < 0 ? 'up' : 'right' );
|
732 |
+
}
|
733 |
+
|
734 |
+
e.preventDefault();
|
735 |
+
}
|
736 |
+
}
|
737 |
+
});
|
738 |
+
}
|
739 |
+
},
|
740 |
+
|
741 |
+
trigger: function (event, o) {
|
742 |
+
var ret, obj = o || F.coming || F.current;
|
743 |
+
|
744 |
+
if (!obj) {
|
745 |
+
return;
|
746 |
+
}
|
747 |
+
|
748 |
+
if ($.isFunction( obj[event] )) {
|
749 |
+
ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
|
750 |
+
}
|
751 |
+
|
752 |
+
if (ret === false) {
|
753 |
+
return false;
|
754 |
+
}
|
755 |
+
|
756 |
+
if (obj.helpers) {
|
757 |
+
$.each(obj.helpers, function (helper, opts) {
|
758 |
+
if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
|
759 |
+
F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
|
760 |
+
}
|
761 |
+
});
|
762 |
+
}
|
763 |
+
|
764 |
+
D.trigger(event);
|
765 |
+
},
|
766 |
+
|
767 |
+
isImage: function (str) {
|
768 |
+
return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
|
769 |
+
},
|
770 |
+
|
771 |
+
isSWF: function (str) {
|
772 |
+
return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
|
773 |
+
},
|
774 |
+
|
775 |
+
_start: function (index) {
|
776 |
+
var coming = {},
|
777 |
+
obj,
|
778 |
+
href,
|
779 |
+
type,
|
780 |
+
margin,
|
781 |
+
padding;
|
782 |
+
|
783 |
+
index = getScalar( index );
|
784 |
+
obj = F.group[ index ] || null;
|
785 |
+
|
786 |
+
if (!obj) {
|
787 |
+
return false;
|
788 |
+
}
|
789 |
+
|
790 |
+
coming = $.extend(true, {}, F.opts, obj);
|
791 |
+
|
792 |
+
// Convert margin and padding properties to array - top, right, bottom, left
|
793 |
+
margin = coming.margin;
|
794 |
+
padding = coming.padding;
|
795 |
+
|
796 |
+
if ($.type(margin) === 'number') {
|
797 |
+
coming.margin = [margin, margin, margin, margin];
|
798 |
+
}
|
799 |
+
|
800 |
+
if ($.type(padding) === 'number') {
|
801 |
+
coming.padding = [padding, padding, padding, padding];
|
802 |
+
}
|
803 |
+
|
804 |
+
// 'modal' propery is just a shortcut
|
805 |
+
if (coming.modal) {
|
806 |
+
$.extend(true, coming, {
|
807 |
+
closeBtn : false,
|
808 |
+
closeClick : false,
|
809 |
+
nextClick : false,
|
810 |
+
arrows : false,
|
811 |
+
mouseWheel : false,
|
812 |
+
keys : null,
|
813 |
+
helpers: {
|
814 |
+
overlay : {
|
815 |
+
closeClick : false
|
816 |
+
}
|
817 |
+
}
|
818 |
+
});
|
819 |
+
}
|
820 |
+
|
821 |
+
// 'autoSize' property is a shortcut, too
|
822 |
+
if (coming.autoSize) {
|
823 |
+
coming.autoWidth = coming.autoHeight = true;
|
824 |
+
}
|
825 |
+
|
826 |
+
if (coming.width === 'auto') {
|
827 |
+
coming.autoWidth = true;
|
828 |
+
}
|
829 |
+
|
830 |
+
if (coming.height === 'auto') {
|
831 |
+
coming.autoHeight = true;
|
832 |
+
}
|
833 |
+
|
834 |
+
/*
|
835 |
+
* Add reference to the group, so it`s possible to access from callbacks, example:
|
836 |
+
* afterLoad : function() {
|
837 |
+
* this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
|
838 |
+
* }
|
839 |
+
*/
|
840 |
+
|
841 |
+
coming.group = F.group;
|
842 |
+
coming.index = index;
|
843 |
+
|
844 |
+
// Give a chance for callback or helpers to update coming item (type, title, etc)
|
845 |
+
F.coming = coming;
|
846 |
+
|
847 |
+
if (false === F.trigger('beforeLoad')) {
|
848 |
+
F.coming = null;
|
849 |
+
|
850 |
+
return;
|
851 |
+
}
|
852 |
+
|
853 |
+
type = coming.type;
|
854 |
+
href = coming.href;
|
855 |
+
|
856 |
+
if (!type) {
|
857 |
+
F.coming = null;
|
858 |
+
|
859 |
+
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
|
860 |
+
if (F.current && F.router && F.router !== 'jumpto') {
|
861 |
+
F.current.index = index;
|
862 |
+
|
863 |
+
return F[ F.router ]( F.direction );
|
864 |
+
}
|
865 |
+
|
866 |
+
return false;
|
867 |
+
}
|
868 |
+
|
869 |
+
F.isActive = true;
|
870 |
+
|
871 |
+
if (type === 'image' || type === 'swf') {
|
872 |
+
coming.autoHeight = coming.autoWidth = false;
|
873 |
+
coming.scrolling = 'visible';
|
874 |
+
}
|
875 |
+
|
876 |
+
if (type === 'image') {
|
877 |
+
coming.aspectRatio = true;
|
878 |
+
}
|
879 |
+
|
880 |
+
if (type === 'iframe' && isTouch) {
|
881 |
+
coming.scrolling = 'scroll';
|
882 |
+
}
|
883 |
+
|
884 |
+
// Build the neccessary markup
|
885 |
+
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
|
886 |
+
|
887 |
+
$.extend(coming, {
|
888 |
+
skin : $('.fancybox-skin', coming.wrap),
|
889 |
+
outer : $('.fancybox-outer', coming.wrap),
|
890 |
+
inner : $('.fancybox-inner', coming.wrap)
|
891 |
+
});
|
892 |
+
|
893 |
+
$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
|
894 |
+
coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
|
895 |
+
});
|
896 |
+
|
897 |
+
F.trigger('onReady');
|
898 |
+
|
899 |
+
// Check before try to load; 'inline' and 'html' types need content, others - href
|
900 |
+
if (type === 'inline' || type === 'html') {
|
901 |
+
if (!coming.content || !coming.content.length) {
|
902 |
+
return F._error( 'content' );
|
903 |
+
}
|
904 |
+
|
905 |
+
} else if (!href) {
|
906 |
+
return F._error( 'href' );
|
907 |
+
}
|
908 |
+
|
909 |
+
if (type === 'image') {
|
910 |
+
F._loadImage();
|
911 |
+
|
912 |
+
} else if (type === 'ajax') {
|
913 |
+
F._loadAjax();
|
914 |
+
|
915 |
+
} else if (type === 'iframe') {
|
916 |
+
F._loadIframe();
|
917 |
+
|
918 |
+
} else {
|
919 |
+
F._afterLoad();
|
920 |
+
}
|
921 |
+
},
|
922 |
+
|
923 |
+
_error: function ( type ) {
|
924 |
+
$.extend(F.coming, {
|
925 |
+
type : 'html',
|
926 |
+
autoWidth : true,
|
927 |
+
autoHeight : true,
|
928 |
+
minWidth : 0,
|
929 |
+
minHeight : 0,
|
930 |
+
scrolling : 'no',
|
931 |
+
hasError : type,
|
932 |
+
content : F.coming.tpl.error
|
933 |
+
});
|
934 |
+
|
935 |
+
F._afterLoad();
|
936 |
+
},
|
937 |
+
|
938 |
+
_loadImage: function () {
|
939 |
+
// Reset preload image so it is later possible to check "complete" property
|
940 |
+
var img = F.imgPreload = new Image();
|
941 |
+
|
942 |
+
img.onload = function () {
|
943 |
+
this.onload = this.onerror = null;
|
944 |
+
|
945 |
+
F.coming.width = this.width / F.opts.pixelRatio;
|
946 |
+
F.coming.height = this.height / F.opts.pixelRatio;
|
947 |
+
|
948 |
+
F._afterLoad();
|
949 |
+
};
|
950 |
+
|
951 |
+
img.onerror = function () {
|
952 |
+
this.onload = this.onerror = null;
|
953 |
+
|
954 |
+
F._error( 'image' );
|
955 |
+
};
|
956 |
+
|
957 |
+
img.src = F.coming.href;
|
958 |
+
|
959 |
+
if (img.complete !== true) {
|
960 |
+
F.showLoading();
|
961 |
+
}
|
962 |
+
},
|
963 |
+
|
964 |
+
_loadAjax: function () {
|
965 |
+
var coming = F.coming;
|
966 |
+
|
967 |
+
F.showLoading();
|
968 |
+
|
969 |
+
F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
|
970 |
+
url: coming.href,
|
971 |
+
error: function (jqXHR, textStatus) {
|
972 |
+
if (F.coming && textStatus !== 'abort') {
|
973 |
+
F._error( 'ajax', jqXHR );
|
974 |
+
|
975 |
+
} else {
|
976 |
+
F.hideLoading();
|
977 |
+
}
|
978 |
+
},
|
979 |
+
success: function (data, textStatus) {
|
980 |
+
if (textStatus === 'success') {
|
981 |
+
coming.content = data;
|
982 |
+
|
983 |
+
F._afterLoad();
|
984 |
+
}
|
985 |
+
}
|
986 |
+
}));
|
987 |
+
},
|
988 |
+
|
989 |
+
_loadIframe: function() {
|
990 |
+
var coming = F.coming,
|
991 |
+
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
|
992 |
+
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
|
993 |
+
.attr('src', coming.href);
|
994 |
+
|
995 |
+
// This helps IE
|
996 |
+
$(coming.wrap).bind('onReset', function () {
|
997 |
+
try {
|
998 |
+
$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
|
999 |
+
} catch (e) {}
|
1000 |
+
});
|
1001 |
+
|
1002 |
+
if (coming.iframe.preload) {
|
1003 |
+
F.showLoading();
|
1004 |
+
|
1005 |
+
iframe.one('load', function() {
|
1006 |
+
$(this).data('ready', 1);
|
1007 |
+
|
1008 |
+
// iOS will lose scrolling if we resize
|
1009 |
+
if (!isTouch) {
|
1010 |
+
$(this).bind('load.fb', F.update);
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
// Without this trick:
|
1014 |
+
// - iframe won't scroll on iOS devices
|
1015 |
+
// - IE7 sometimes displays empty iframe
|
1016 |
+
$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
|
1017 |
+
|
1018 |
+
F._afterLoad();
|
1019 |
+
});
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
coming.content = iframe.appendTo( coming.inner );
|
1023 |
+
|
1024 |
+
if (!coming.iframe.preload) {
|
1025 |
+
F._afterLoad();
|
1026 |
+
}
|
1027 |
+
},
|
1028 |
+
|
1029 |
+
_preloadImages: function() {
|
1030 |
+
var group = F.group,
|
1031 |
+
current = F.current,
|
1032 |
+
len = group.length,
|
1033 |
+
cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
|
1034 |
+
item,
|
1035 |
+
i;
|
1036 |
+
|
1037 |
+
for (i = 1; i <= cnt; i += 1) {
|
1038 |
+
item = group[ (current.index + i ) % len ];
|
1039 |
+
|
1040 |
+
if (item.type === 'image' && item.href) {
|
1041 |
+
new Image().src = item.href;
|
1042 |
+
}
|
1043 |
+
}
|
1044 |
+
},
|
1045 |
+
|
1046 |
+
_afterLoad: function () {
|
1047 |
+
var coming = F.coming,
|
1048 |
+
previous = F.current,
|
1049 |
+
placeholder = 'fancybox-placeholder',
|
1050 |
+
current,
|
1051 |
+
content,
|
1052 |
+
type,
|
1053 |
+
scrolling,
|
1054 |
+
href,
|
1055 |
+
embed;
|
1056 |
+
|
1057 |
+
F.hideLoading();
|
1058 |
+
|
1059 |
+
if (!coming || F.isActive === false) {
|
1060 |
+
return;
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
if (false === F.trigger('afterLoad', coming, previous)) {
|
1064 |
+
coming.wrap.stop(true).trigger('onReset').remove();
|
1065 |
+
|
1066 |
+
F.coming = null;
|
1067 |
+
|
1068 |
+
return;
|
1069 |
+
}
|
1070 |
+
|
1071 |
+
if (previous) {
|
1072 |
+
F.trigger('beforeChange', previous);
|
1073 |
+
|
1074 |
+
previous.wrap.stop(true).removeClass('fancybox-opened')
|
1075 |
+
.find('.fancybox-item, .fancybox-nav')
|
1076 |
+
.remove();
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
F.unbindEvents();
|
1080 |
+
|
1081 |
+
current = coming;
|
1082 |
+
content = coming.content;
|
1083 |
+
type = coming.type;
|
1084 |
+
scrolling = coming.scrolling;
|
1085 |
+
|
1086 |
+
$.extend(F, {
|
1087 |
+
wrap : current.wrap,
|
1088 |
+
skin : current.skin,
|
1089 |
+
outer : current.outer,
|
1090 |
+
inner : current.inner,
|
1091 |
+
current : current,
|
1092 |
+
previous : previous
|
1093 |
+
});
|
1094 |
+
|
1095 |
+
href = current.href;
|
1096 |
+
|
1097 |
+
switch (type) {
|
1098 |
+
case 'inline':
|
1099 |
+
case 'ajax':
|
1100 |
+
case 'html':
|
1101 |
+
if (current.selector) {
|
1102 |
+
content = $('<div>').html(content).find(current.selector);
|
1103 |
+
|
1104 |
+
} else if (isQuery(content)) {
|
1105 |
+
if (!content.data(placeholder)) {
|
1106 |
+
content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
|
1107 |
+
}
|
1108 |
+
|
1109 |
+
content = content.show().detach();
|
1110 |
+
|
1111 |
+
current.wrap.bind('onReset', function () {
|
1112 |
+
if ($(this).find(content).length) {
|
1113 |
+
content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
|
1114 |
+
}
|
1115 |
+
});
|
1116 |
+
}
|
1117 |
+
break;
|
1118 |
+
|
1119 |
+
case 'image':
|
1120 |
+
content = current.tpl.image.replace('{href}', href);
|
1121 |
+
break;
|
1122 |
+
|
1123 |
+
case 'swf':
|
1124 |
+
content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
|
1125 |
+
embed = '';
|
1126 |
+
|
1127 |
+
$.each(current.swf, function(name, val) {
|
1128 |
+
content += '<param name="' + name + '" value="' + val + '"></param>';
|
1129 |
+
embed += ' ' + name + '="' + val + '"';
|
1130 |
+
});
|
1131 |
+
|
1132 |
+
content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
|
1133 |
+
break;
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
if (!(isQuery(content) && content.parent().is(current.inner))) {
|
1137 |
+
current.inner.append( content );
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// Give a chance for helpers or callbacks to update elements
|
1141 |
+
F.trigger('beforeShow');
|
1142 |
+
|
1143 |
+
// Set scrolling before calculating dimensions
|
1144 |
+
current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
|
1145 |
+
|
1146 |
+
// Set initial dimensions and start position
|
1147 |
+
F._setDimension();
|
1148 |
+
|
1149 |
+
F.reposition();
|
1150 |
+
|
1151 |
+
F.isOpen = false;
|
1152 |
+
F.coming = null;
|
1153 |
+
|
1154 |
+
F.bindEvents();
|
1155 |
+
|
1156 |
+
if (!F.isOpened) {
|
1157 |
+
$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
|
1158 |
+
|
1159 |
+
} else if (previous.prevMethod) {
|
1160 |
+
F.transitions[ previous.prevMethod ]();
|
1161 |
+
}
|
1162 |
+
|
1163 |
+
F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
|
1164 |
+
|
1165 |
+
F._preloadImages();
|
1166 |
+
},
|
1167 |
+
|
1168 |
+
_setDimension: function () {
|
1169 |
+
var viewport = F.getViewport(),
|
1170 |
+
steps = 0,
|
1171 |
+
canShrink = false,
|
1172 |
+
canExpand = false,
|
1173 |
+
wrap = F.wrap,
|
1174 |
+
skin = F.skin,
|
1175 |
+
inner = F.inner,
|
1176 |
+
current = F.current,
|
1177 |
+
width = current.width,
|
1178 |
+
height = current.height,
|
1179 |
+
minWidth = current.minWidth,
|
1180 |
+
minHeight = current.minHeight,
|
1181 |
+
maxWidth = current.maxWidth,
|
1182 |
+
maxHeight = current.maxHeight,
|
1183 |
+
scrolling = current.scrolling,
|
1184 |
+
scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
|
1185 |
+
margin = current.margin,
|
1186 |
+
wMargin = getScalar(margin[1] + margin[3]),
|
1187 |
+
hMargin = getScalar(margin[0] + margin[2]),
|
1188 |
+
wPadding,
|
1189 |
+
hPadding,
|
1190 |
+
wSpace,
|
1191 |
+
hSpace,
|
1192 |
+
origWidth,
|
1193 |
+
origHeight,
|
1194 |
+
origMaxWidth,
|
1195 |
+
origMaxHeight,
|
1196 |
+
ratio,
|
1197 |
+
width_,
|
1198 |
+
height_,
|
1199 |
+
maxWidth_,
|
1200 |
+
maxHeight_,
|
1201 |
+
iframe,
|
1202 |
+
body;
|
1203 |
+
|
1204 |
+
// Reset dimensions so we could re-check actual size
|
1205 |
+
wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
|
1206 |
+
|
1207 |
+
wPadding = getScalar(skin.outerWidth(true) - skin.width());
|
1208 |
+
hPadding = getScalar(skin.outerHeight(true) - skin.height());
|
1209 |
+
|
1210 |
+
// Any space between content and viewport (margin, padding, border, title)
|
1211 |
+
wSpace = wMargin + wPadding;
|
1212 |
+
hSpace = hMargin + hPadding;
|
1213 |
+
|
1214 |
+
origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
|
1215 |
+
origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
|
1216 |
+
|
1217 |
+
if (current.type === 'iframe') {
|
1218 |
+
iframe = current.content;
|
1219 |
+
|
1220 |
+
if (current.autoHeight && iframe.data('ready') === 1) {
|
1221 |
+
try {
|
1222 |
+
if (iframe[0].contentWindow.document.location) {
|
1223 |
+
inner.width( origWidth ).height(9999);
|
1224 |
+
|
1225 |
+
body = iframe.contents().find('body');
|
1226 |
+
|
1227 |
+
if (scrollOut) {
|
1228 |
+
body.css('overflow-x', 'hidden');
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
origHeight = body.outerHeight(true);
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
} catch (e) {}
|
1235 |
+
}
|
1236 |
+
|
1237 |
+
} else if (current.autoWidth || current.autoHeight) {
|
1238 |
+
inner.addClass( 'fancybox-tmp' );
|
1239 |
+
|
1240 |
+
// Set width or height in case we need to calculate only one dimension
|
1241 |
+
if (!current.autoWidth) {
|
1242 |
+
inner.width( origWidth );
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
if (!current.autoHeight) {
|
1246 |
+
inner.height( origHeight );
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
if (current.autoWidth) {
|
1250 |
+
origWidth = inner.width();
|
1251 |
+
}
|
1252 |
+
|
1253 |
+
if (current.autoHeight) {
|
1254 |
+
origHeight = inner.height();
|
1255 |
+
}
|
1256 |
+
|
1257 |
+
inner.removeClass( 'fancybox-tmp' );
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
width = getScalar( origWidth );
|
1261 |
+
height = getScalar( origHeight );
|
1262 |
+
|
1263 |
+
ratio = origWidth / origHeight;
|
1264 |
+
|
1265 |
+
// Calculations for the content
|
1266 |
+
minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
|
1267 |
+
maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
|
1268 |
+
|
1269 |
+
minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
|
1270 |
+
maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
|
1271 |
+
|
1272 |
+
// These will be used to determine if wrap can fit in the viewport
|
1273 |
+
origMaxWidth = maxWidth;
|
1274 |
+
origMaxHeight = maxHeight;
|
1275 |
+
|
1276 |
+
if (current.fitToView) {
|
1277 |
+
maxWidth = Math.min(viewport.w - wSpace, maxWidth);
|
1278 |
+
maxHeight = Math.min(viewport.h - hSpace, maxHeight);
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
maxWidth_ = viewport.w - wMargin;
|
1282 |
+
maxHeight_ = viewport.h - hMargin;
|
1283 |
+
|
1284 |
+
if (current.aspectRatio) {
|
1285 |
+
if (width > maxWidth) {
|
1286 |
+
width = maxWidth;
|
1287 |
+
height = getScalar(width / ratio);
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
if (height > maxHeight) {
|
1291 |
+
height = maxHeight;
|
1292 |
+
width = getScalar(height * ratio);
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
if (width < minWidth) {
|
1296 |
+
width = minWidth;
|
1297 |
+
height = getScalar(width / ratio);
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
if (height < minHeight) {
|
1301 |
+
height = minHeight;
|
1302 |
+
width = getScalar(height * ratio);
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
} else {
|
1306 |
+
width = Math.max(minWidth, Math.min(width, maxWidth));
|
1307 |
+
|
1308 |
+
if (current.autoHeight && current.type !== 'iframe') {
|
1309 |
+
inner.width( width );
|
1310 |
+
|
1311 |
+
height = inner.height();
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
height = Math.max(minHeight, Math.min(height, maxHeight));
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
// Try to fit inside viewport (including the title)
|
1318 |
+
if (current.fitToView) {
|
1319 |
+
inner.width( width ).height( height );
|
1320 |
+
|
1321 |
+
wrap.width( width + wPadding );
|
1322 |
+
|
1323 |
+
// Real wrap dimensions
|
1324 |
+
width_ = wrap.width();
|
1325 |
+
height_ = wrap.height();
|
1326 |
+
|
1327 |
+
if (current.aspectRatio) {
|
1328 |
+
while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
|
1329 |
+
if (steps++ > 19) {
|
1330 |
+
break;
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
height = Math.max(minHeight, Math.min(maxHeight, height - 10));
|
1334 |
+
width = getScalar(height * ratio);
|
1335 |
+
|
1336 |
+
if (width < minWidth) {
|
1337 |
+
width = minWidth;
|
1338 |
+
height = getScalar(width / ratio);
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
if (width > maxWidth) {
|
1342 |
+
width = maxWidth;
|
1343 |
+
height = getScalar(width / ratio);
|
1344 |
+
}
|
1345 |
+
|
1346 |
+
inner.width( width ).height( height );
|
1347 |
+
|
1348 |
+
wrap.width( width + wPadding );
|
1349 |
+
|
1350 |
+
width_ = wrap.width();
|
1351 |
+
height_ = wrap.height();
|
1352 |
+
}
|
1353 |
+
|
1354 |
+
} else {
|
1355 |
+
width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
|
1356 |
+
height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
|
1357 |
+
}
|
1358 |
+
}
|
1359 |
+
|
1360 |
+
if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
|
1361 |
+
width += scrollOut;
|
1362 |
+
}
|
1363 |
+
|
1364 |
+
inner.width( width ).height( height );
|
1365 |
+
|
1366 |
+
wrap.width( width + wPadding );
|
1367 |
+
|
1368 |
+
width_ = wrap.width();
|
1369 |
+
height_ = wrap.height();
|
1370 |
+
|
1371 |
+
canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
|
1372 |
+
canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
|
1373 |
+
|
1374 |
+
$.extend(current, {
|
1375 |
+
dim : {
|
1376 |
+
width : getValue( width_ ),
|
1377 |
+
height : getValue( height_ )
|
1378 |
+
},
|
1379 |
+
origWidth : origWidth,
|
1380 |
+
origHeight : origHeight,
|
1381 |
+
canShrink : canShrink,
|
1382 |
+
canExpand : canExpand,
|
1383 |
+
wPadding : wPadding,
|
1384 |
+
hPadding : hPadding,
|
1385 |
+
wrapSpace : height_ - skin.outerHeight(true),
|
1386 |
+
skinSpace : skin.height() - height
|
1387 |
+
});
|
1388 |
+
|
1389 |
+
if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
|
1390 |
+
inner.height('auto');
|
1391 |
+
}
|
1392 |
+
},
|
1393 |
+
|
1394 |
+
_getPosition: function (onlyAbsolute) {
|
1395 |
+
var current = F.current,
|
1396 |
+
viewport = F.getViewport(),
|
1397 |
+
margin = current.margin,
|
1398 |
+
width = F.wrap.width() + margin[1] + margin[3],
|
1399 |
+
height = F.wrap.height() + margin[0] + margin[2],
|
1400 |
+
rez = {
|
1401 |
+
position: 'absolute',
|
1402 |
+
top : margin[0],
|
1403 |
+
left : margin[3]
|
1404 |
+
};
|
1405 |
+
|
1406 |
+
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
|
1407 |
+
rez.position = 'fixed';
|
1408 |
+
|
1409 |
+
} else if (!current.locked) {
|
1410 |
+
rez.top += viewport.y;
|
1411 |
+
rez.left += viewport.x;
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
|
1415 |
+
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
|
1416 |
+
|
1417 |
+
return rez;
|
1418 |
+
},
|
1419 |
+
|
1420 |
+
_afterZoomIn: function () {
|
1421 |
+
var current = F.current;
|
1422 |
+
|
1423 |
+
if (!current) {
|
1424 |
+
return;
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
F.isOpen = F.isOpened = true;
|
1428 |
+
|
1429 |
+
F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
|
1430 |
+
|
1431 |
+
F.update();
|
1432 |
+
|
1433 |
+
// Assign a click event
|
1434 |
+
if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
|
1435 |
+
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
|
1436 |
+
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
|
1437 |
+
e.preventDefault();
|
1438 |
+
|
1439 |
+
F[ current.closeClick ? 'close' : 'next' ]();
|
1440 |
+
}
|
1441 |
+
});
|
1442 |
+
}
|
1443 |
+
|
1444 |
+
// Create a close button
|
1445 |
+
if (current.closeBtn) {
|
1446 |
+
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
|
1447 |
+
e.preventDefault();
|
1448 |
+
|
1449 |
+
F.close();
|
1450 |
+
});
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
// Create navigation arrows
|
1454 |
+
if (current.arrows && F.group.length > 1) {
|
1455 |
+
if (current.loop || current.index > 0) {
|
1456 |
+
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
|
1457 |
+
}
|
1458 |
+
|
1459 |
+
if (current.loop || current.index < F.group.length - 1) {
|
1460 |
+
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
|
1461 |
+
}
|
1462 |
+
}
|
1463 |
+
|
1464 |
+
F.trigger('afterShow');
|
1465 |
+
|
1466 |
+
// Stop the slideshow if this is the last item
|
1467 |
+
if (!current.loop && current.index === current.group.length - 1) {
|
1468 |
+
F.play( false );
|
1469 |
+
|
1470 |
+
} else if (F.opts.autoPlay && !F.player.isActive) {
|
1471 |
+
F.opts.autoPlay = false;
|
1472 |
+
|
1473 |
+
F.play();
|
1474 |
+
}
|
1475 |
+
},
|
1476 |
+
|
1477 |
+
_afterZoomOut: function ( obj ) {
|
1478 |
+
obj = obj || F.current;
|
1479 |
+
|
1480 |
+
$('.fancybox-wrap').trigger('onReset').remove();
|
1481 |
+
|
1482 |
+
$.extend(F, {
|
1483 |
+
group : {},
|
1484 |
+
opts : {},
|
1485 |
+
router : false,
|
1486 |
+
current : null,
|
1487 |
+
isActive : false,
|
1488 |
+
isOpened : false,
|
1489 |
+
isOpen : false,
|
1490 |
+
isClosing : false,
|
1491 |
+
wrap : null,
|
1492 |
+
skin : null,
|
1493 |
+
outer : null,
|
1494 |
+
inner : null
|
1495 |
+
});
|
1496 |
+
|
1497 |
+
F.trigger('afterClose', obj);
|
1498 |
+
}
|
1499 |
+
});
|
1500 |
+
|
1501 |
+
/*
|
1502 |
+
* Default transitions
|
1503 |
+
*/
|
1504 |
+
|
1505 |
+
F.transitions = {
|
1506 |
+
getOrigPosition: function () {
|
1507 |
+
var current = F.current,
|
1508 |
+
element = current.element,
|
1509 |
+
orig = current.orig,
|
1510 |
+
pos = {},
|
1511 |
+
width = 50,
|
1512 |
+
height = 50,
|
1513 |
+
hPadding = current.hPadding,
|
1514 |
+
wPadding = current.wPadding,
|
1515 |
+
viewport = F.getViewport();
|
1516 |
+
|
1517 |
+
if (!orig && current.isDom && element.is(':visible')) {
|
1518 |
+
orig = element.find('img:first');
|
1519 |
+
|
1520 |
+
if (!orig.length) {
|
1521 |
+
orig = element;
|
1522 |
+
}
|
1523 |
+
}
|
1524 |
+
|
1525 |
+
if (isQuery(orig)) {
|
1526 |
+
pos = orig.offset();
|
1527 |
+
|
1528 |
+
if (orig.is('img')) {
|
1529 |
+
width = orig.outerWidth();
|
1530 |
+
height = orig.outerHeight();
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
} else {
|
1534 |
+
pos.top = viewport.y + (viewport.h - height) * current.topRatio;
|
1535 |
+
pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
if (F.wrap.css('position') === 'fixed' || current.locked) {
|
1539 |
+
pos.top -= viewport.y;
|
1540 |
+
pos.left -= viewport.x;
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
pos = {
|
1544 |
+
top : getValue(pos.top - hPadding * current.topRatio),
|
1545 |
+
left : getValue(pos.left - wPadding * current.leftRatio),
|
1546 |
+
width : getValue(width + wPadding),
|
1547 |
+
height : getValue(height + hPadding)
|
1548 |
+
};
|
1549 |
+
|
1550 |
+
return pos;
|
1551 |
+
},
|
1552 |
+
|
1553 |
+
step: function (now, fx) {
|
1554 |
+
var ratio,
|
1555 |
+
padding,
|
1556 |
+
value,
|
1557 |
+
prop = fx.prop,
|
1558 |
+
current = F.current,
|
1559 |
+
wrapSpace = current.wrapSpace,
|
1560 |
+
skinSpace = current.skinSpace;
|
1561 |
+
|
1562 |
+
if (prop === 'width' || prop === 'height') {
|
1563 |
+
ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
|
1564 |
+
|
1565 |
+
if (F.isClosing) {
|
1566 |
+
ratio = 1 - ratio;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
padding = prop === 'width' ? current.wPadding : current.hPadding;
|
1570 |
+
value = now - padding;
|
1571 |
+
|
1572 |
+
F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
|
1573 |
+
F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
|
1574 |
+
}
|
1575 |
+
},
|
1576 |
+
|
1577 |
+
zoomIn: function () {
|
1578 |
+
var current = F.current,
|
1579 |
+
startPos = current.pos,
|
1580 |
+
effect = current.openEffect,
|
1581 |
+
elastic = effect === 'elastic',
|
1582 |
+
endPos = $.extend({opacity : 1}, startPos);
|
1583 |
+
|
1584 |
+
// Remove "position" property that breaks older IE
|
1585 |
+
delete endPos.position;
|
1586 |
+
|
1587 |
+
if (elastic) {
|
1588 |
+
startPos = this.getOrigPosition();
|
1589 |
+
|
1590 |
+
if (current.openOpacity) {
|
1591 |
+
startPos.opacity = 0.1;
|
1592 |
+
}
|
1593 |
+
|
1594 |
+
} else if (effect === 'fade') {
|
1595 |
+
startPos.opacity = 0.1;
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
F.wrap.css(startPos).animate(endPos, {
|
1599 |
+
duration : effect === 'none' ? 0 : current.openSpeed,
|
1600 |
+
easing : current.openEasing,
|
1601 |
+
step : elastic ? this.step : null,
|
1602 |
+
complete : F._afterZoomIn
|
1603 |
+
});
|
1604 |
+
},
|
1605 |
+
|
1606 |
+
zoomOut: function () {
|
1607 |
+
var current = F.current,
|
1608 |
+
effect = current.closeEffect,
|
1609 |
+
elastic = effect === 'elastic',
|
1610 |
+
endPos = {opacity : 0.1};
|
1611 |
+
|
1612 |
+
if (elastic) {
|
1613 |
+
endPos = this.getOrigPosition();
|
1614 |
+
|
1615 |
+
if (current.closeOpacity) {
|
1616 |
+
endPos.opacity = 0.1;
|
1617 |
+
}
|
1618 |
+
}
|
1619 |
+
|
1620 |
+
F.wrap.animate(endPos, {
|
1621 |
+
duration : effect === 'none' ? 0 : current.closeSpeed,
|
1622 |
+
easing : current.closeEasing,
|
1623 |
+
step : elastic ? this.step : null,
|
1624 |
+
complete : F._afterZoomOut
|
1625 |
+
});
|
1626 |
+
},
|
1627 |
+
|
1628 |
+
changeIn: function () {
|
1629 |
+
var current = F.current,
|
1630 |
+
effect = current.nextEffect,
|
1631 |
+
startPos = current.pos,
|
1632 |
+
endPos = { opacity : 1 },
|
1633 |
+
direction = F.direction,
|
1634 |
+
distance = 200,
|
1635 |
+
field;
|
1636 |
+
|
1637 |
+
startPos.opacity = 0.1;
|
1638 |
+
|
1639 |
+
if (effect === 'elastic') {
|
1640 |
+
field = direction === 'down' || direction === 'up' ? 'top' : 'left';
|
1641 |
+
|
1642 |
+
if (direction === 'down' || direction === 'right') {
|
1643 |
+
startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
|
1644 |
+
endPos[ field ] = '+=' + distance + 'px';
|
1645 |
+
|
1646 |
+
} else {
|
1647 |
+
startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
|
1648 |
+
endPos[ field ] = '-=' + distance + 'px';
|
1649 |
+
}
|
1650 |
+
}
|
1651 |
+
|
1652 |
+
// Workaround for http://bugs.jquery.com/ticket/12273
|
1653 |
+
if (effect === 'none') {
|
1654 |
+
F._afterZoomIn();
|
1655 |
+
|
1656 |
+
} else {
|
1657 |
+
F.wrap.css(startPos).animate(endPos, {
|
1658 |
+
duration : current.nextSpeed,
|
1659 |
+
easing : current.nextEasing,
|
1660 |
+
complete : F._afterZoomIn
|
1661 |
+
});
|
1662 |
+
}
|
1663 |
+
},
|
1664 |
+
|
1665 |
+
changeOut: function () {
|
1666 |
+
var previous = F.previous,
|
1667 |
+
effect = previous.prevEffect,
|
1668 |
+
endPos = { opacity : 0.1 },
|
1669 |
+
direction = F.direction,
|
1670 |
+
distance = 200;
|
1671 |
+
|
1672 |
+
if (effect === 'elastic') {
|
1673 |
+
endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
previous.wrap.animate(endPos, {
|
1677 |
+
duration : effect === 'none' ? 0 : previous.prevSpeed,
|
1678 |
+
easing : previous.prevEasing,
|
1679 |
+
complete : function () {
|
1680 |
+
$(this).trigger('onReset').remove();
|
1681 |
+
}
|
1682 |
+
});
|
1683 |
+
}
|
1684 |
+
};
|
1685 |
+
|
1686 |
+
/*
|
1687 |
+
* Overlay helper
|
1688 |
+
*/
|
1689 |
+
|
1690 |
+
F.helpers.overlay = {
|
1691 |
+
defaults : {
|
1692 |
+
closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
|
1693 |
+
speedOut : 200, // duration of fadeOut animation
|
1694 |
+
showEarly : true, // indicates if should be opened immediately or wait until the content is ready
|
1695 |
+
css : {}, // custom CSS properties
|
1696 |
+
locked : !isTouch, // if true, the content will be locked into overlay
|
1697 |
+
fixed : true // if false, the overlay CSS position property will not be set to "fixed"
|
1698 |
+
},
|
1699 |
+
|
1700 |
+
overlay : null, // current handle
|
1701 |
+
fixed : false, // indicates if the overlay has position "fixed"
|
1702 |
+
el : $('html'), // element that contains "the lock"
|
1703 |
+
|
1704 |
+
// Public methods
|
1705 |
+
create : function(opts) {
|
1706 |
+
opts = $.extend({}, this.defaults, opts);
|
1707 |
+
|
1708 |
+
if (this.overlay) {
|
1709 |
+
this.close();
|
1710 |
+
}
|
1711 |
+
|
1712 |
+
this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
|
1713 |
+
this.fixed = false;
|
1714 |
+
|
1715 |
+
if (opts.fixed && F.defaults.fixed) {
|
1716 |
+
this.overlay.addClass('fancybox-overlay-fixed');
|
1717 |
+
|
1718 |
+
this.fixed = true;
|
1719 |
+
}
|
1720 |
+
},
|
1721 |
+
|
1722 |
+
open : function(opts) {
|
1723 |
+
var that = this;
|
1724 |
+
|
1725 |
+
opts = $.extend({}, this.defaults, opts);
|
1726 |
+
|
1727 |
+
if (this.overlay) {
|
1728 |
+
this.overlay.unbind('.overlay').width('auto').height('auto');
|
1729 |
+
|
1730 |
+
} else {
|
1731 |
+
this.create(opts);
|
1732 |
+
}
|
1733 |
+
|
1734 |
+
if (!this.fixed) {
|
1735 |
+
W.bind('resize.overlay', $.proxy( this.update, this) );
|
1736 |
+
|
1737 |
+
this.update();
|
1738 |
+
}
|
1739 |
+
|
1740 |
+
if (opts.closeClick) {
|
1741 |
+
this.overlay.bind('click.overlay', function(e) {
|
1742 |
+
if ($(e.target).hasClass('fancybox-overlay')) {
|
1743 |
+
if (F.isActive) {
|
1744 |
+
F.close();
|
1745 |
+
} else {
|
1746 |
+
that.close();
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
return false;
|
1750 |
+
}
|
1751 |
+
});
|
1752 |
+
}
|
1753 |
+
|
1754 |
+
this.overlay.css( opts.css ).show();
|
1755 |
+
},
|
1756 |
+
|
1757 |
+
close : function() {
|
1758 |
+
var scrollV, scrollH;
|
1759 |
+
|
1760 |
+
W.unbind('resize.overlay');
|
1761 |
+
|
1762 |
+
if (this.el.hasClass('fancybox-lock')) {
|
1763 |
+
$('.fancybox-margin').removeClass('fancybox-margin');
|
1764 |
+
|
1765 |
+
scrollV = W.scrollTop();
|
1766 |
+
scrollH = W.scrollLeft();
|
1767 |
+
|
1768 |
+
this.el.removeClass('fancybox-lock');
|
1769 |
+
|
1770 |
+
W.scrollTop( scrollV ).scrollLeft( scrollH );
|
1771 |
+
}
|
1772 |
+
|
1773 |
+
$('.fancybox-overlay').remove().hide();
|
1774 |
+
|
1775 |
+
$.extend(this, {
|
1776 |
+
overlay : null,
|
1777 |
+
fixed : false
|
1778 |
+
});
|
1779 |
+
},
|
1780 |
+
|
1781 |
+
// Private, callbacks
|
1782 |
+
|
1783 |
+
update : function () {
|
1784 |
+
var width = '100%', offsetWidth;
|
1785 |
+
|
1786 |
+
// Reset width/height so it will not mess
|
1787 |
+
this.overlay.width(width).height('100%');
|
1788 |
+
|
1789 |
+
// jQuery does not return reliable result for IE
|
1790 |
+
if (IE) {
|
1791 |
+
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
|
1792 |
+
|
1793 |
+
if (D.width() > offsetWidth) {
|
1794 |
+
width = D.width();
|
1795 |
+
}
|
1796 |
+
|
1797 |
+
} else if (D.width() > W.width()) {
|
1798 |
+
width = D.width();
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
this.overlay.width(width).height(D.height());
|
1802 |
+
},
|
1803 |
+
|
1804 |
+
// This is where we can manipulate DOM, because later it would cause iframes to reload
|
1805 |
+
onReady : function (opts, obj) {
|
1806 |
+
var overlay = this.overlay;
|
1807 |
+
|
1808 |
+
$('.fancybox-overlay').stop(true, true);
|
1809 |
+
|
1810 |
+
if (!overlay) {
|
1811 |
+
this.create(opts);
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
if (opts.locked && this.fixed && obj.fixed) {
|
1815 |
+
if (!overlay) {
|
1816 |
+
this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
obj.locked = this.overlay.append( obj.wrap );
|
1820 |
+
obj.fixed = false;
|
1821 |
+
}
|
1822 |
+
|
1823 |
+
if (opts.showEarly === true) {
|
1824 |
+
this.beforeShow.apply(this, arguments);
|
1825 |
+
}
|
1826 |
+
},
|
1827 |
+
|
1828 |
+
beforeShow : function(opts, obj) {
|
1829 |
+
var scrollV, scrollH;
|
1830 |
+
|
1831 |
+
if (obj.locked) {
|
1832 |
+
if (this.margin !== false) {
|
1833 |
+
$('*').filter(function(){
|
1834 |
+
return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
|
1835 |
+
}).addClass('fancybox-margin');
|
1836 |
+
|
1837 |
+
this.el.addClass('fancybox-margin');
|
1838 |
+
}
|
1839 |
+
|
1840 |
+
scrollV = W.scrollTop();
|
1841 |
+
scrollH = W.scrollLeft();
|
1842 |
+
|
1843 |
+
this.el.addClass('fancybox-lock');
|
1844 |
+
|
1845 |
+
W.scrollTop( scrollV ).scrollLeft( scrollH );
|
1846 |
+
}
|
1847 |
+
|
1848 |
+
this.open(opts);
|
1849 |
+
},
|
1850 |
+
|
1851 |
+
onUpdate : function() {
|
1852 |
+
if (!this.fixed) {
|
1853 |
+
this.update();
|
1854 |
+
}
|
1855 |
+
},
|
1856 |
+
|
1857 |
+
afterClose: function (opts) {
|
1858 |
+
// Remove overlay if exists and fancyBox is not opening
|
1859 |
+
// (e.g., it is not being open using afterClose callback)
|
1860 |
+
//if (this.overlay && !F.isActive) {
|
1861 |
+
if (this.overlay && !F.coming) {
|
1862 |
+
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
|
1863 |
+
}
|
1864 |
+
}
|
1865 |
+
};
|
1866 |
+
|
1867 |
+
/*
|
1868 |
+
* Title helper
|
1869 |
+
*/
|
1870 |
+
|
1871 |
+
F.helpers.title = {
|
1872 |
+
defaults : {
|
1873 |
+
type : 'float', // 'float', 'inside', 'outside' or 'over',
|
1874 |
+
position : 'bottom' // 'top' or 'bottom'
|
1875 |
+
},
|
1876 |
+
|
1877 |
+
beforeShow: function (opts) {
|
1878 |
+
var current = F.current,
|
1879 |
+
text = current.title,
|
1880 |
+
type = opts.type,
|
1881 |
+
title,
|
1882 |
+
target;
|
1883 |
+
|
1884 |
+
if ($.isFunction(text)) {
|
1885 |
+
text = text.call(current.element, current);
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
if (!isString(text) || $.trim(text) === '') {
|
1889 |
+
return;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
|
1893 |
+
|
1894 |
+
switch (type) {
|
1895 |
+
case 'inside':
|
1896 |
+
target = F.skin;
|
1897 |
+
break;
|
1898 |
+
|
1899 |
+
case 'outside':
|
1900 |
+
target = F.wrap;
|
1901 |
+
break;
|
1902 |
+
|
1903 |
+
case 'over':
|
1904 |
+
target = F.inner;
|
1905 |
+
break;
|
1906 |
+
|
1907 |
+
default: // 'float'
|
1908 |
+
target = F.skin;
|
1909 |
+
|
1910 |
+
title.appendTo('body');
|
1911 |
+
|
1912 |
+
if (IE) {
|
1913 |
+
title.width( title.width() );
|
1914 |
+
}
|
1915 |
+
|
1916 |
+
title.wrapInner('<span class="child"></span>');
|
1917 |
+
|
1918 |
+
//Increase bottom margin so this title will also fit into viewport
|
1919 |
+
F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
|
1920 |
+
break;
|
1921 |
+
}
|
1922 |
+
|
1923 |
+
title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
|
1924 |
+
}
|
1925 |
+
};
|
1926 |
+
|
1927 |
+
// jQuery plugin initialization
|
1928 |
+
$.fn.fancybox = function (options) {
|
1929 |
+
var index,
|
1930 |
+
that = $(this),
|
1931 |
+
selector = this.selector || '',
|
1932 |
+
run = function(e) {
|
1933 |
+
var what = $(this).blur(), idx = index, relType, relVal;
|
1934 |
+
|
1935 |
+
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
|
1936 |
+
relType = options.groupAttr || 'data-fancybox-group';
|
1937 |
+
relVal = what.attr(relType);
|
1938 |
+
|
1939 |
+
if (!relVal) {
|
1940 |
+
relType = 'rel';
|
1941 |
+
relVal = what.get(0)[ relType ];
|
1942 |
+
}
|
1943 |
+
|
1944 |
+
if (relVal && relVal !== '' && relVal !== 'nofollow') {
|
1945 |
+
what = selector.length ? $(selector) : that;
|
1946 |
+
what = what.filter('[' + relType + '="' + relVal + '"]');
|
1947 |
+
idx = what.index(this);
|
1948 |
+
}
|
1949 |
+
|
1950 |
+
options.index = idx;
|
1951 |
+
|
1952 |
+
// Stop an event from bubbling if everything is fine
|
1953 |
+
if (F.open(what, options) !== false) {
|
1954 |
+
e.preventDefault();
|
1955 |
+
}
|
1956 |
+
}
|
1957 |
+
};
|
1958 |
+
|
1959 |
+
options = options || {};
|
1960 |
+
index = options.index || 0;
|
1961 |
+
|
1962 |
+
if (!selector || options.live === false) {
|
1963 |
+
that.unbind('click.fb-start').bind('click.fb-start', run);
|
1964 |
+
|
1965 |
+
} else {
|
1966 |
+
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
|
1967 |
+
}
|
1968 |
+
|
1969 |
+
this.filter('[data-fancybox-start=1]').trigger('click');
|
1970 |
+
|
1971 |
+
return this;
|
1972 |
+
};
|
1973 |
+
|
1974 |
+
// Tests that need a body at doc ready
|
1975 |
+
D.ready(function() {
|
1976 |
+
var w1, w2;
|
1977 |
+
|
1978 |
+
if ( $.scrollbarWidth === undefined ) {
|
1979 |
+
// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
|
1980 |
+
$.scrollbarWidth = function() {
|
1981 |
+
var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
|
1982 |
+
child = parent.children(),
|
1983 |
+
width = child.innerWidth() - child.height( 99 ).innerWidth();
|
1984 |
+
|
1985 |
+
parent.remove();
|
1986 |
+
|
1987 |
+
return width;
|
1988 |
+
};
|
1989 |
+
}
|
1990 |
+
|
1991 |
+
if ( $.support.fixedPosition === undefined ) {
|
1992 |
+
$.support.fixedPosition = (function() {
|
1993 |
+
var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
|
1994 |
+
fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
|
1995 |
+
|
1996 |
+
elem.remove();
|
1997 |
+
|
1998 |
+
return fixed;
|
1999 |
+
}());
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
$.extend(F.defaults, {
|
2003 |
+
scrollbarWidth : $.scrollbarWidth(),
|
2004 |
+
fixed : $.support.fixedPosition,
|
2005 |
+
parent : $('body')
|
2006 |
+
});
|
2007 |
+
|
2008 |
+
//Get real width of page scroll-bar
|
2009 |
+
w1 = $(window).width();
|
2010 |
+
|
2011 |
+
H.addClass('fancybox-lock-test');
|
2012 |
+
|
2013 |
+
w2 = $(window).width();
|
2014 |
+
|
2015 |
+
H.removeClass('fancybox-lock-test');
|
2016 |
+
|
2017 |
+
$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
|
2018 |
+
});
|
2019 |
+
|
2020 |
+
}(window, document, jQuery));
|
js/youstice/jquery.min.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
|
2 |
+
if(!window.jQuery) {
|
3 |
+
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
|
4 |
+
}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
|
5 |
+
},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
|
6 |
+
jQuery.noConflict();
|
7 |
+
}
|
js/youstice/logoWidget.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
//show logoWidget
|
4 |
+
$.get(BASE_URL + 'index/getLogoWidget', function(data) {
|
5 |
+
$('body').append(data);
|
6 |
+
});
|
7 |
+
});
|
js/youstice/orders.js
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function showAjaxSpinner(where) {
|
3 |
+
jQuery(where).append('<div class="y-ajax-spinner"></div>');
|
4 |
+
}
|
5 |
+
|
6 |
+
function removeAjaxSpinner(where) {
|
7 |
+
jQuery(where).find('.y-ajax-spinner').remove();
|
8 |
+
}
|
9 |
+
|
10 |
+
jQuery(document).ready(function($) {
|
11 |
+
|
12 |
+
//button to start showing buttons
|
13 |
+
$('h1').after('<div id="y-main" \>');
|
14 |
+
showAjaxSpinner('#y-main');
|
15 |
+
$.get(BASE_URL + 'index/getShowButtonsHtml', function(data) {
|
16 |
+
removeAjaxSpinner('#y-main');
|
17 |
+
$('#y-main').append(data);
|
18 |
+
|
19 |
+
if ($(data).data('has-reports'))
|
20 |
+
showButtons();
|
21 |
+
});
|
22 |
+
|
23 |
+
//start showing buttons
|
24 |
+
$(document).on('click', 'a.yrsShowButtons', function(e) {
|
25 |
+
e.preventDefault();
|
26 |
+
showButtons();
|
27 |
+
});
|
28 |
+
|
29 |
+
function showButtons() {
|
30 |
+
$('a.yrsShowButtons').remove();
|
31 |
+
showAjaxSpinner('#y-main');
|
32 |
+
|
33 |
+
$.get(BASE_URL + 'index/getWebReportButton', function(data) {
|
34 |
+
removeAjaxSpinner('#y-main');
|
35 |
+
$('#y-main').append(data);
|
36 |
+
});
|
37 |
+
|
38 |
+
showOrdersButtons();
|
39 |
+
}
|
40 |
+
|
41 |
+
function showOrdersButtons() {
|
42 |
+
var orderIds = [];
|
43 |
+
|
44 |
+
$('#my-orders-table tr:gt(0)').each(function() {
|
45 |
+
var anchor = $(this).find('td a:first-of-type');
|
46 |
+
var href = anchor.attr('href');
|
47 |
+
var hrefParts = href.split('/');
|
48 |
+
|
49 |
+
var orderId = hrefParts[hrefParts.length - 2];
|
50 |
+
|
51 |
+
$(this).find('td:first').append('<div id="yousticeOrderButton-' + orderId + '" />');
|
52 |
+
showAjaxSpinner('#yousticeOrderButton-' + orderId);
|
53 |
+
|
54 |
+
if (!isNaN(orderId))
|
55 |
+
orderIds.push(orderId);
|
56 |
+
});
|
57 |
+
|
58 |
+
$.get(BASE_URL + 'index/getOrdersButtons', {"order_ids": orderIds}, function(data) {
|
59 |
+
for (key in data) {
|
60 |
+
$('#yousticeOrderButton-' + key).html(data[key]);
|
61 |
+
}
|
62 |
+
|
63 |
+
$('.yrsButton-plus, .yrsOrderDetailButton, .yrsButton-order-detail').click(function(e) {
|
64 |
+
$this = $(this);
|
65 |
+
e.preventDefault();
|
66 |
+
$.fancybox({
|
67 |
+
autoDimension: true,
|
68 |
+
href: $this.attr('href'),
|
69 |
+
type: 'ajax',
|
70 |
+
closeBtn: false
|
71 |
+
});
|
72 |
+
return false;
|
73 |
+
});
|
74 |
+
}, 'json');
|
75 |
+
}
|
76 |
+
|
77 |
+
//reload orderDetail
|
78 |
+
$(document).on('click', '.yrsButton:not(.yrsButton-order-detail):not(.yrsOrderDetailButton)'
|
79 |
+
+ ':not(.yrsButton-plus):not(.yrsButton-close):not(.yrsShowButtons)', function(e) {
|
80 |
+
setTimeout(function() {
|
81 |
+
window.location.reload();
|
82 |
+
}, 300);
|
83 |
+
});
|
84 |
+
|
85 |
+
//hide orderDetail
|
86 |
+
$(document).on('click', '.yrsButton-close', function(e) {
|
87 |
+
e.preventDefault();
|
88 |
+
$.fancybox.close();
|
89 |
+
});
|
90 |
+
});
|
js/youstice/products.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
var currentLink = window.location.href;
|
3 |
+
var linkParts = currentLink.split('/');
|
4 |
+
var orderId = linkParts[linkParts.length - 2];
|
5 |
+
|
6 |
+
$('#my-orders-table tr:gt(0)').each(function() {
|
7 |
+
var firstTd = $(this).find('td:first-of-type');
|
8 |
+
//not tfoot, only tbody
|
9 |
+
if(firstTd.find('h3').length === 0)
|
10 |
+
return true;
|
11 |
+
var sku = firstTd.next('td').html();
|
12 |
+
$('<div id="yousticeProductButton-'+sku+'" />').appendTo(firstTd);
|
13 |
+
showAjaxSpinner('#yousticeProductButton-'+sku);
|
14 |
+
});
|
15 |
+
|
16 |
+
$.getJSON(BASE_URL + 'index/getProductsButtons', {"order_id": orderId}, function(data) {
|
17 |
+
for (key in data) {
|
18 |
+
$('#yousticeProductButton-' + key).html(data[key]);
|
19 |
+
}
|
20 |
+
});
|
21 |
+
|
22 |
+
});
|
23 |
+
|
24 |
+
function showAjaxSpinner(where) {console.log(where);
|
25 |
+
jQuery(where).append('<div class="y-ajax-spinner"></div>');
|
26 |
+
}
|
js/youstice/reportClaims.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function($) {
|
2 |
+
$('form#yReportClaims').submit(function(e) {
|
3 |
+
e.preventDefault();
|
4 |
+
|
5 |
+
$('form#yReportClaims').find('p').remove();
|
6 |
+
$('.y-ajax-spinner').remove();
|
7 |
+
$(this).append('<div class="y-ajax-spinner"></div>');
|
8 |
+
|
9 |
+
$.ajax({
|
10 |
+
url: BASE_URL + 'index/getReportClaimsPagePost',
|
11 |
+
type: 'post',
|
12 |
+
dataType: 'json',
|
13 |
+
data: $(this).serialize(),
|
14 |
+
success: function(data) {
|
15 |
+
$('.y-ajax-spinner').remove();
|
16 |
+
//error occured
|
17 |
+
if(data.orderDetail == undefined) {
|
18 |
+
$('form#yReportClaims').find('p').remove();
|
19 |
+
$('form#yReportClaims').append('<p>'+data.error+'</p>');
|
20 |
+
}
|
21 |
+
//ok, show order detail
|
22 |
+
else {
|
23 |
+
$('form#yReportClaims').find('p').remove();
|
24 |
+
$.fancybox({
|
25 |
+
autoDimension: true,
|
26 |
+
content: data.orderDetail,
|
27 |
+
closeBtn: false
|
28 |
+
});
|
29 |
+
}
|
30 |
+
},
|
31 |
+
error: function(data) {
|
32 |
+
$('form#yReportClaims').find('p').remove();
|
33 |
+
$('.y-ajax-spinner').remove();
|
34 |
+
$('form#yReportClaims').append('<p>An error occured while sending data, try again later</p>');
|
35 |
+
}
|
36 |
+
});
|
37 |
+
});
|
38 |
+
|
39 |
+
//hide orderDetail
|
40 |
+
$(document).on('click', '.yrsButton-close', function(e) {
|
41 |
+
e.preventDefault();
|
42 |
+
$.fancybox.close();
|
43 |
+
});
|
44 |
+
});
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Youstice</name>
|
4 |
+
<version>1.3.7</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Add buttons for reporting claims</summary>
|
10 |
+
<description>Your online youstice</description>
|
11 |
+
<notes>Retail version of the youstice resolution system package</notes>
|
12 |
+
<authors><author><name>Youstice</name><user>Youstice</user><email>info@youstice.com</email></author></authors>
|
13 |
+
<date>2014-12-01</date>
|
14 |
+
<time>19:44:19</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Youstice"><dir name="YousticeResolutionSystem"><dir name="Helper"><file name="ApiSingleton.php" hash="37f05528eca3a4ae9dd156831e3a09a5"/></dir><dir name="SDK"><file name="Api.php" hash="e6520900b63f09a0b108a8e305473748"/><dir name="Helpers"><file name="HelperFunctions.php" hash="6b617b0dd77c96cb7c6ed52fd15b01a6"/><file name="LanguageCodes.php" hash="488fc1c06161aab5cbcb580377eea934"/></dir><file name="Local.php" hash="390bbe4fc9b244d4b6042041f361bfa5"/><file name="LocalInterface.php" hash="fcfc41d1ea328c20f54fc1baa94b673e"/><dir name="Providers"><file name="SessionProvider.php" hash="90d811d9d73a0651af38c2df00b91467"/><file name="SessionProviderInterface.php" hash="3ade50afbcedc08f75880735d8d2d5ab"/></dir><file name="Remote.php" hash="0f855abefc77db5b39473fc02bb573cd"/><dir name="Reports"><file name="BaseReport.php" hash="e78e9b72a9ee74ec85cb0b999770a660"/><file name="OrderReport.php" hash="668d077abe681e561b241af863eb593e"/><file name="ProductReport.php" hash="d80b87d96e692be612797f5093daaff0"/><file name="WebReport.php" hash="a4059750c3b4bdb3678048a11fe35ec2"/></dir><file name="Request.php" hash="a98a6da248643ff7566a437c554852fb"/><file name="ShopItem.php" hash="6ca5e4db6310e70ff7af47e4b68db893"/><file name="ShopOrder.php" hash="93022b12b71a6d569f28c46bfdf149d0"/><file name="ShopProduct.php" hash="c3d4fac07e260945e8add8907d1acf33"/><file name="SimpleApi.php" hash="8cd5fd640fc4638f94728e2df17bc96d"/><file name="Tools.php" hash="cd5150d93f83d31effa08449499c9b71"/><file name="Translator.php" hash="72dec403567aecb42b754f228cc98cd9"/><dir name="Widgets"><file name="OrderDetail.php" hash="7dcee72310b3d78af5db714307a33c47"/><file name="OrderDetailButton.php" hash="4f5cb8942b95a7c907dcfc3cd2bd6301"/><file name="OrderReportButton.php" hash="b0a3f58aa55023d9a42bdfbc8dcd1f9a"/><file name="ProductReportButton.php" hash="cb97d9630a9ba947f5fb560d42797628"/><file name="ReportClaimsForm.php" hash="fb95a3dce472b26442cfe8a2e32afe61"/><file name="ShowButtons.php" hash="8c5104a61e0d4911838f289b13d965ef"/><file name="WebReportButton.php" hash="109aee1464d97f4591adac8201b30691"/></dir><dir name="languageStrings"><file name="cs.php" hash="137d169ec9d269424dfcd44f2bc769db"/><file name="de.php" hash="1b66bca822920d65cd4e12134563d224"/><file name="en.php" hash="dfc069713347240cfba4e816bfe650eb"/><file name="es.php" hash="cf09b06a66b4de31dfd29864c7e6228c"/><file name="fr.php" hash="8f86d317f50747741f7cfe5df77e2916"/><file name="pt.php" hash="410fb0ae6a938454c1ba097ba176c4a1"/><file name="ru.php" hash="0c0f9910d427fb69c3b9feb7cdab1625"/><file name="sk.php" hash="0984ad5170a1ec501003ab5ffac7c270"/></dir></dir><dir name="controllers"><file name="AdminController.php" hash="d4e954f584344af090a8ff76dc2b2fcf"/><file name="IndexController.php" hash="ffb2085247624302999c90bf754d869d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cedaa07c7d693302a23daaad79fcca3d"/><file name="config.xml" hash="4bec55f4cbb26f9d8cc22c98164ab5bd"/></dir><dir name="sql"><dir name="youstice_setup"><file name="mysql4-install-0.9.8.php" hash="819cb1bb6743e9765910c1123ab3d4e2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="youstice_layout_update.xml" hash="1cb43a482e15bea8cd356999d8b66f3e"/></dir><dir name="template"><dir name="youstice"><file name="baseUrl.phtml" hash="3d4dacc70fad8853838edb17774750a3"/><file name="reportClaims.phtml" hash="91251ca1bb8a9e6f6453ca7e979f53fb"/><file name="reportClaimsOgTags.phtml" hash="c149c54db5885d8045eff405dac24c2e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="youstice_layout_update.xml" hash="f5a64acda38bcb12c039fe13f340f9de"/></dir><dir name="template"><dir name="youstice"><file name="adminForm.phtml" hash="addd6f35040d09fceef377790bd0ba08"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Youstice_YousticeResolutionSystem.xml" hash="96f910a20f7fa55ccd25f82da9974341"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="youstice.css" hash="f3097f288d6a174cac14afc90a692bb9"/><file name="youstice_magento.css" hash="9a88cdb943794db3fa4d2f171ce83d63"/><dir name="fancybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancybox_loading.gif" hash="328cc0f6c78211485058d460e80f4fa8"/><file name="fancybox_loading@2x.gif" hash="f92938639fa894a0e8ded1c3368abe98"/><file name="fancybox_overlay.png" hash="77aeaa52715b898b73c74d68c630330e"/><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="fancybox_sprite@2x.png" hash="ed9970ce22242421e66ff150aa97fe5f"/><file name="jquery.fancybox.css" hash="6c55951ce1e3115711f63f99b7501f3a"/></dir></dir><dir name="images"><dir name="youstice"><file name="logo.png" hash="64c2b8699997d46dce66e75da28c247b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><file name="yousticeAdmin.css" hash="e2cd7aaae3dbac09a16d32221a187e14"/><dir name="images"><dir name="youstice"><file name="screenshot_1.png" hash="fd032fb3ccdc167ed588e6a962acc973"/><file name="screenshot_2.png" hash="b9c9308c0ea193cbf84d70b4635d1f22"/><file name="screenshot_3.png" hash="defd41dc513159eb5a58c26d95030fc4"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="youstice"><file name="admin.js" hash="a0d2339fd61c538eae13e731a961f795"/><file name="jquery.fancybox.js" hash="921e9cb04ad6e2559869ec845c5be39b"/><file name="jquery.min.js" hash="96ef50d4f9b32f3413c46f83c12b279e"/><file name="logoWidget.js" hash="92e0f982382f4dd47b3db05304139b5e"/><file name="orders.js" hash="60a014f7326bde99c9f587d73a8f41ba"/><file name="products.js" hash="506e5927f922cbeb2f006f575bdad9ad"/><file name="reportClaims.js" hash="2f3fce230dfc8a1c359f43df04fd83dc"/></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>10.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/images/youstice/screenshot_1.png
ADDED
Binary file
|
skin/adminhtml/default/default/images/youstice/screenshot_2.png
ADDED
Binary file
|
skin/adminhtml/default/default/images/youstice/screenshot_3.png
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.yContainer {
|
2 |
+
max-width: 960px;
|
3 |
+
margin: 0 auto;
|
4 |
+
display: block;
|
5 |
+
background: #fff;
|
6 |
+
padding: 20px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.yContainer label {
|
10 |
+
float: none;
|
11 |
+
font-weight: normal;
|
12 |
+
}
|
13 |
+
|
14 |
+
.yContainer a {
|
15 |
+
color: #3668c9;
|
16 |
+
text-decoration: underline;
|
17 |
+
}
|
18 |
+
|
19 |
+
.yContainer a.roundedAnchor {
|
20 |
+
display: inline-block;
|
21 |
+
font-weight: bold;
|
22 |
+
text-decoration: none;
|
23 |
+
text-align: center;
|
24 |
+
padding: 6px 22px;
|
25 |
+
border: 1px solid #680568;
|
26 |
+
color: #000;
|
27 |
+
border-radius: 8px;
|
28 |
+
}
|
29 |
+
|
30 |
+
.yContainer a.roundedAnchor.centered {
|
31 |
+
display: block;
|
32 |
+
margin: 0 auto;
|
33 |
+
max-width: 120px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.yContainer p {
|
37 |
+
font-size: 1.1em;
|
38 |
+
}
|
39 |
+
|
40 |
+
.yContainer p.empty {
|
41 |
+
margin: 0;
|
42 |
+
padding: 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
.yContainer p:last-child {
|
46 |
+
margin-bottom: 0;
|
47 |
+
padding-bottom: 0;
|
48 |
+
}
|
49 |
+
|
50 |
+
.yContainer .logoLeft {
|
51 |
+
float: left;
|
52 |
+
min-width: 290px;
|
53 |
+
padding: 12px 0 32px;
|
54 |
+
}
|
55 |
+
|
56 |
+
.yContainer .logoLeft p {
|
57 |
+
padding: 0 0 0 12px;
|
58 |
+
}
|
59 |
+
|
60 |
+
.yContainer .logoRight {
|
61 |
+
float: right;
|
62 |
+
margin-bottom: 20px;
|
63 |
+
}
|
64 |
+
|
65 |
+
.yContainer .logoRight a {
|
66 |
+
display: block;
|
67 |
+
margin-top: 16px;
|
68 |
+
padding: 6px 22px;
|
69 |
+
-webkit-box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
70 |
+
-moz-box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
71 |
+
box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
72 |
+
font-weight: normal;
|
73 |
+
}
|
74 |
+
|
75 |
+
.yContainer .logoRight a span {
|
76 |
+
display: block;
|
77 |
+
padding-top: 4px;
|
78 |
+
color: #585A69;
|
79 |
+
}
|
80 |
+
|
81 |
+
.yContainer .logoRight a span:first-child {
|
82 |
+
color: #7d277d;
|
83 |
+
font-weight: bold;
|
84 |
+
display: block;
|
85 |
+
padding: 0;
|
86 |
+
}
|
87 |
+
|
88 |
+
.yContainer .logoRight a span.anchor {
|
89 |
+
display: block;
|
90 |
+
clear: left;
|
91 |
+
font-weight: normal;
|
92 |
+
color: #3668c9;
|
93 |
+
text-decoration: underline;
|
94 |
+
}
|
95 |
+
|
96 |
+
.yContainer hr {
|
97 |
+
width: calc(100% + 20px);
|
98 |
+
position: relative;
|
99 |
+
left: -10px;
|
100 |
+
display: block;
|
101 |
+
clear: both;
|
102 |
+
height: 0;
|
103 |
+
border-bottom: 1px solid #989898;
|
104 |
+
border-top: 1px solid #b0b0b0;
|
105 |
+
margin: 0;
|
106 |
+
}
|
107 |
+
|
108 |
+
.yContainer .loginInfo {
|
109 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAlCAYAAAAjt+tHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gkaFAQifHeNOQAAAlNJREFUWMO1mL9rFUEQxz97PI3B+AsMKWJnYWlExEIQbEJaC9OmSRvETps0/gVipYWtgqWVgpWC2tgoMaBYWPmDJE2EaN7d2uzBuMzs7t27DCzcvdudz/f2x8zcg+52CrgD7AJNaL+B28A8B2wXBNRqjw4KfklAvAGvQ3sJHB8SvhrBNQHjSMiDoeDzEUgTEMPb68tDCNhUBJTAG+DTpPCrmTUfJ4S0M3V+EgEvCtd8rDxvxz1PAaqMgJHxeyPGymuv9J2aRMAJ5TefgFdK3xngSF8Bx6I384DrACcIONlXwC+xll3gUsQ28L2vgD/iTZwClKIwZmC/zyZr7ZuA+wzcK9cuxJHedi2K8U1Bk31r4MykweitAveF8JtDhOKFKNCUJqOnQ2bD5R7J6PTQ9cC6IaBWhNwvdVoV9hsBO+FMe7HLGyU2bAFfCk5Ysc0Aez2S0R5wNxEnimwa+JhZc6seaGfqa/DTyY4CSyGElqy5rAG0o/oXuN6lCLEc5eA+ExvWcvBZBeqVSGjBfSYw1eEFTXuTcJRac58ZJ4W8Bw5p8LOZc14XbLjUm0th92K4C8piZ5aTVG5IwWW//+yK0ikFL01GqVlalwI+FKxd12SUG/cZOOzC9DdRiHVGJeSie4wSTYt+TgnfcxUwpwBSQnJVsksI8dHzWxWwqAyUcGc4spJRrkqWQkYV8DNUv33g2vdBbrZavz+Ah/LhDeBdwRnvmozijfk41IlmlpwCVoDXHQqQXDJ6BZwjsTNzX0cL4R+Si2GmRoavfeAJsBHun4V0bto/ydIVRUzvSjcAAAAASUVORK5CYII=);
|
110 |
+
background-position: 10px 50%;
|
111 |
+
background-repeat: no-repeat;
|
112 |
+
padding: 16px 0 22px 65px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.yContainer .loginInfo p {
|
116 |
+
margin: 0;
|
117 |
+
padding: 0;
|
118 |
+
}
|
119 |
+
|
120 |
+
.yContainer .loginInfo p:first-of-type {
|
121 |
+
font-weight: bold;
|
122 |
+
padding-bottom: 14px;
|
123 |
+
}
|
124 |
+
|
125 |
+
.yContainer .loginInfo input:first-of-type {
|
126 |
+
margin-left: 20px;
|
127 |
+
}
|
128 |
+
|
129 |
+
.yContainer .yBlock {
|
130 |
+
padding: 0 10px 30px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.yContainer .yBlock h2, .yContainer .yConfiguration h2 {
|
134 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA6CAYAAADspTpvAAAABHNCSVQICAgIfAhkiAAAB9VJREFUaIHtWktv29gV/s6lrRgFArHxGEmbAFYKzF5eddrNyLuim8q/wMqq6GNKK47sZNyAJjyJYTuOrA6SrZ1lV1ZWxays2bUrez9to6BNAXeQRJ5HET94vy4oUqQkeyyZJlrAB4JA6fKe+3333vO4hwQu5EIu5P9ZJMnByu8vZwUDm6KQEQigsfa7L4rFJDEYSQ1UHi2bomQbCteCPxU++PmVn5l/evPZZ0nhUEkNpFOHeQpNkgABel/QYCEpDAAwkNhIrphUBETQZJywQXmS2Aor96jqrSpBEgBAEgSqSWEAEiRcfHmvDo1bJBuER5pkDQcqUaeVGGEAUO5gNWzDJOvFl8VGohiSHOwQ7/IUmP4Kg8iXR8tmkhgSJQxFy7dhAqDQ1Ma7fKIQkhpoefRBlpAsvc0cOC8XYieFAUgyDgssBM4KPm0IkFkZXcwlhSMRwvaobRIoMAhJvg0311vJZBI4gIQIX9JGISAHtGwYwQQUFkcXM0lgSYQwBZZHDsGqRpwXCAVdSALLuRNeuGHnAWQYrDBBjTVN3YgQl2S29fmvMGXSX0mfnOwfVqhRCTsvgJnF0QeF84bT9fAwm57NqBQKACAK9Ye7Sxv9KLev2hkq5MOHBVKqc7t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LD2XMaWnMnmsIyFxdGIEbCroGcvzp+Gqhct9bt3tmRUmF2eDrXrU3DfR7JzyFZ++psJi6csREWyi/ChwCtdX1pr1IP3zM9PJ2bGSltA1gXw9iaHZkpW2kr8uRBAbX2/FzDyMWFMzbCBHJsVjaaq1zz26y0ZZaGb68bIlsgs75jE3BqKJV6MTtSKvj3PthdqrWfhLTgw7hwxkLYSv823+U4+DkA3L5iFQYM9QJAIWLfQS0LpgDrd0dKW6WRUhYAqHU16rx0Lg6cQExxeMr8qAzIVDjNdDXGlRJbieQipxvghOKCgKQDAEqUHS4uQLtjceTpsbwBEHjS4Km+QClseWUdQpo1PK+Ih4YQDkQ+hDDvt3mnPACADaDhmwf8Ni+bOzPhM29pC5ZJIovgvY22rR1yPtCsHrl67NGbx2srr1cnhJggWW+P3wDMaOUEAOOx4zMT1pcP8wA6yYUIaLLuupxYfbs2UQl57uXXq9WDI3dMu9rpZt9h56Vjisdnd1oikZlvd15ezQpjlb1K13c5KnuVxurb8jwOj8aoUevcJR5xETGPi929yJltWICuILRmTR3pYuU/T09ldyt7lR0A46UrtwtaUBaB2W7f2hurdka8/Yn1vV9n9YBMishUpIFokLr46ddPN/rWnbbMlDLKMKTggfR9OuuaeKaA2tLr1Vo/uvsi/NHl38yL6nxyT3JDfTVQrCCe2tZ02sopQ5WhVBaI1pypubb8+lHPbwD1TNi69MsMhwZfdDSQO3/46slYr/pOI9NXim+ViNkRvw8Ob7anr98lPTuto4GBTNcGkWzX/+MQgdnt4cCxWE6Q+B6XEudSogUA6mahPlRcIAB1pHoes2fCT759UgPZ4XlJVnrVdVohWGlPTjRZXdnrPdXs6/XhD/Z/+kde0tcAaQCog9r59OunZy7NHid/fveX2k9SP35JgSlAXZPPHr9Z+9V5jXchF3IhF/I/I/8Fq3LtZwfHlSkAAAAASUVORK5CYII=);
|
135 |
+
background-repeat: no-repeat;
|
136 |
+
background-size : 38px;
|
137 |
+
line-height: 38px;
|
138 |
+
margin: 9px 0 14px;
|
139 |
+
color: #7d277d;
|
140 |
+
padding-left: 65px;
|
141 |
+
font-weight: normal;
|
142 |
+
text-transform: uppercase;
|
143 |
+
}
|
144 |
+
|
145 |
+
.yContainer .yBlock.yHidden h2 {
|
146 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA6CAYAAADspTpvAAAABHNCSVQICAgIfAhkiAAABcdJREFUaIHtWr1uG0cQntkjCAHU6ZjCoHG3huk3kLp0prqkCvUEprq4slWltPQEkstUlMtUpqsklegunZgnEAPsHuIqpJYELMu3k0JH43Tco3nH4yIB+FW63dXON/szOz8E2GCDDf7PQJvCfN/fZYy9RcQmAAARnQkhjmxycGwJ8jyvvrW1dYmID2dtiPjtzs5O/fr6+ndbPJgtQbVarY2IdUNXxxYHAIsKZyhrHdYU/vz5cy+jK6t9LbB2h6fT6Wh7e/svRGwh4hYAABH1lVKHNzc3H23xsLbDAADT6TS9m8PxeDyyycGqwgbD1fY8z+rdtqowY+xF8hsR67VarW2Vgy1Bvu/vIuLuHAHGXtniAGBR4fTuzoCIzSAIWtZ42BDieV4dETtZ/Yj4zAYPAEsKb29vdxb1I2Kn0Wg0bXCxojAiGo9zEpVKpWOByvoV5py3Z9HRDER0RkT33l9bx3rtChPRnCK3t7evieh1sg0Rm77vd9bNxxgPNxqN5uyIEdEwDMPzIpM3Go1mtVq9SrZprXtSygNTHxH1hRD7RWQBfHn62vFcvTAMB+kxcwrHQfpF0iMionMhxGFeApzzU0R8mWwjogMhRC/u76at96dPn558+PBhmFeW7/sdx3G6ybYoig7TmzWnMOf80uQgRFF0iIhDgDsPiYi+jEHExwDQTAxvpu8twN1pEUI8mX0HQdBijF2YFCCiAQCMEt/vU0P69xRBfJsOQYloJIT45t64tKBHjx6RiUAZ0FofSSnPkm2c8yvT4pQoc19K2Z99zxmteGVLBxGNJpPJuYHQyTrkzTCZTO7pY7LS6yLQM4WC0+m0l36iygIRnaVlGq107Nu+iO/qOyIaMcZOTWkaIholnph+st1kJZdB0rc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AABJRU5ErkJggg==);
|
147 |
+
color: #7f7f7f;
|
148 |
+
}
|
149 |
+
|
150 |
+
.yContainer .yBlock h3 {
|
151 |
+
color: #7d277d;
|
152 |
+
margin: 0;
|
153 |
+
}
|
154 |
+
|
155 |
+
.yContainer .yBlock .left h3:last-of-type {
|
156 |
+
margin-top: 35px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.yContainer .yBlock a {
|
160 |
+
padding: 9px 60px;
|
161 |
+
color: #7d277d;
|
162 |
+
}
|
163 |
+
|
164 |
+
.yContainer .yBlock p {
|
165 |
+
margin: 0 0 12px;
|
166 |
+
}
|
167 |
+
|
168 |
+
.yContainer .yBlock img {
|
169 |
+
-webkit-box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.76);
|
170 |
+
-moz-box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.76);
|
171 |
+
box-shadow: 0px 0px 20px 0px rgba(50, 50, 50, 0.76);
|
172 |
+
}
|
173 |
+
|
174 |
+
.yContainer .yBlock .left, .yContainer .yBlock .right {
|
175 |
+
display: inline-block;
|
176 |
+
margin: 25px 0;
|
177 |
+
min-height: 315px;
|
178 |
+
}
|
179 |
+
|
180 |
+
.yContainer .yBlock div.left {
|
181 |
+
float: left;
|
182 |
+
width: 55%;
|
183 |
+
}
|
184 |
+
|
185 |
+
.yContainer .yBlock div.right {
|
186 |
+
float: right;
|
187 |
+
width: 45%;
|
188 |
+
height: 315px;
|
189 |
+
text-align: right;
|
190 |
+
}
|
191 |
+
|
192 |
+
.yContainer .yBlock .right .imgHelper {
|
193 |
+
display: inline-block;
|
194 |
+
height: 100%;
|
195 |
+
vertical-align: middle;
|
196 |
+
}
|
197 |
+
|
198 |
+
.yContainer .yBlock .right img {
|
199 |
+
width: 80%;
|
200 |
+
}
|
201 |
+
|
202 |
+
.yContainer .yBlock.howItWorks {
|
203 |
+
height: 512px;
|
204 |
+
padding: 0;
|
205 |
+
margin-bottom: 50px;
|
206 |
+
}
|
207 |
+
|
208 |
+
.yContainer .yBlock.howItWorks p {
|
209 |
+
display: inline-block;
|
210 |
+
width: 100%;
|
211 |
+
position: relative;
|
212 |
+
}
|
213 |
+
|
214 |
+
.yContainer .yBlock.howItWorks p + p {
|
215 |
+
top: -53px;
|
216 |
+
}
|
217 |
+
|
218 |
+
.yContainer .yBlock.howItWorks p + p + p {
|
219 |
+
top: -230px;
|
220 |
+
}
|
221 |
+
|
222 |
+
.yContainer .yBlock.howItWorks p img {
|
223 |
+
width: 40%;
|
224 |
+
margin-right: 50px;
|
225 |
+
float: left;
|
226 |
+
}
|
227 |
+
|
228 |
+
.yContainer .yBlock.howItWorks p a {
|
229 |
+
padding: 0;
|
230 |
+
}
|
231 |
+
|
232 |
+
.yContainer .yBlock.howItWorks p span {
|
233 |
+
margin: 72px 0;
|
234 |
+
display: block;
|
235 |
+
}
|
236 |
+
|
237 |
+
.yContainer .yBlock.howItWorks p:first-of-type span {
|
238 |
+
margin: 55px 0 72px;
|
239 |
+
}
|
240 |
+
|
241 |
+
.yContainer .yBlock.howItWorks p.right img {
|
242 |
+
float: right;
|
243 |
+
margin: 0 0 0 50px;
|
244 |
+
}
|
245 |
+
|
246 |
+
.yContainer .yBlock.screenshots {
|
247 |
+
text-align: justify;
|
248 |
+
margin-top: 20px;
|
249 |
+
}
|
250 |
+
|
251 |
+
.yContainer .yBlock.screenshots a {
|
252 |
+
width: 33%;
|
253 |
+
height: 220px;
|
254 |
+
padding: 0;
|
255 |
+
display: inline-block;
|
256 |
+
overflow: hidden;
|
257 |
+
}
|
258 |
+
|
259 |
+
.yContainer .yBlock.screenshots a img {
|
260 |
+
width: 350px;
|
261 |
+
}
|
262 |
+
|
263 |
+
.yContainer .yConfiguration {
|
264 |
+
margin-bottom: 18px;
|
265 |
+
}
|
266 |
+
|
267 |
+
.yContainer .yConfiguration .row {
|
268 |
+
min-height: 32px;
|
269 |
+
}
|
270 |
+
|
271 |
+
.yContainer .yConfiguration .row.onSandbox {
|
272 |
+
min-height: 0;
|
273 |
+
margin: 12px 0 14px;
|
274 |
+
}
|
275 |
+
|
276 |
+
.yContainer .yConfiguration .row label {
|
277 |
+
clear: both;
|
278 |
+
display: block;
|
279 |
+
float: left;
|
280 |
+
margin: 0 30px 0 4px;
|
281 |
+
padding-top: 5px;
|
282 |
+
width: 320px;
|
283 |
+
text-align: right;
|
284 |
+
}
|
285 |
+
|
286 |
+
.yContainer .yConfiguration select, .yContainer .yConfiguration input {
|
287 |
+
padding: 6px 22px;
|
288 |
+
border: 1px solid #680568;
|
289 |
+
border-radius: 4px;
|
290 |
+
text-align: left;
|
291 |
+
background: #fff;
|
292 |
+
padding: 2px;
|
293 |
+
}
|
294 |
+
|
295 |
+
.yContainer .yConfiguration label[for="reportClaimsPageLink"] {
|
296 |
+
display: block;
|
297 |
+
width: auto;
|
298 |
+
text-align: left;
|
299 |
+
margin-bottom: 10px;
|
300 |
+
}
|
301 |
+
|
302 |
+
.yContainer .yConfiguration input#reportClaimsPageLink {
|
303 |
+
display: block;
|
304 |
+
width: 72%;
|
305 |
+
margin-top: 15px;
|
306 |
+
text-align: center;
|
307 |
+
float: left;
|
308 |
+
}
|
309 |
+
|
310 |
+
.yContainer .yConfiguration input {
|
311 |
+
width: 260px;
|
312 |
+
}
|
313 |
+
|
314 |
+
.yContainer .yConfiguration input#apiKey {
|
315 |
+
margin-right: 12px;
|
316 |
+
}
|
317 |
+
|
318 |
+
.yContainer a.roundedAnchor.style2 {
|
319 |
+
background: #680568;
|
320 |
+
color: #fff;
|
321 |
+
border: 1px solid #fff;
|
322 |
+
margin-bottom: 17px;
|
323 |
+
font-weight: normal;
|
324 |
+
-webkit-box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
325 |
+
-moz-box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
326 |
+
box-shadow: 0px 0px 10px 0px rgba(50, 50, 50, 0.76);
|
327 |
+
border-radius: 6px;
|
328 |
+
}
|
329 |
+
|
330 |
+
|
331 |
+
.clear {
|
332 |
+
width: 100%;
|
333 |
+
display: block;
|
334 |
+
clear: both;
|
335 |
+
}
|
skin/frontend/base/default/css/fancybox/blank.gif
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/fancybox_loading.gif
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/fancybox_loading@2x.gif
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/fancybox_overlay.png
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/fancybox_sprite.png
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/fancybox_sprite@2x.png
ADDED
Binary file
|
skin/frontend/base/default/css/fancybox/jquery.fancybox.css
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
2 |
+
.fancybox-wrap,
|
3 |
+
.fancybox-skin,
|
4 |
+
.fancybox-outer,
|
5 |
+
.fancybox-inner,
|
6 |
+
.fancybox-image,
|
7 |
+
.fancybox-wrap iframe,
|
8 |
+
.fancybox-wrap object,
|
9 |
+
.fancybox-nav,
|
10 |
+
.fancybox-nav span,
|
11 |
+
.fancybox-tmp
|
12 |
+
{
|
13 |
+
padding: 0;
|
14 |
+
margin: 0;
|
15 |
+
border: 0;
|
16 |
+
outline: none;
|
17 |
+
vertical-align: top;
|
18 |
+
}
|
19 |
+
|
20 |
+
.fancybox-wrap {
|
21 |
+
position: absolute;
|
22 |
+
top: 0;
|
23 |
+
left: 0;
|
24 |
+
z-index: 8020;
|
25 |
+
}
|
26 |
+
|
27 |
+
.fancybox-skin {
|
28 |
+
position: relative;
|
29 |
+
background: #f9f9f9;
|
30 |
+
color: #444;
|
31 |
+
text-shadow: none;
|
32 |
+
-webkit-border-radius: 4px;
|
33 |
+
-moz-border-radius: 4px;
|
34 |
+
border-radius: 4px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.fancybox-opened {
|
38 |
+
z-index: 8030;
|
39 |
+
}
|
40 |
+
|
41 |
+
.fancybox-opened .fancybox-skin {
|
42 |
+
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
43 |
+
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
44 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
45 |
+
}
|
46 |
+
|
47 |
+
.fancybox-outer, .fancybox-inner {
|
48 |
+
position: relative;
|
49 |
+
}
|
50 |
+
|
51 |
+
.fancybox-inner {
|
52 |
+
overflow: hidden;
|
53 |
+
}
|
54 |
+
|
55 |
+
.fancybox-type-iframe .fancybox-inner {
|
56 |
+
-webkit-overflow-scrolling: touch;
|
57 |
+
}
|
58 |
+
|
59 |
+
.fancybox-error {
|
60 |
+
color: #444;
|
61 |
+
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
62 |
+
margin: 0;
|
63 |
+
padding: 15px;
|
64 |
+
white-space: nowrap;
|
65 |
+
}
|
66 |
+
|
67 |
+
.fancybox-image, .fancybox-iframe {
|
68 |
+
display: block;
|
69 |
+
width: 100%;
|
70 |
+
height: 100%;
|
71 |
+
}
|
72 |
+
|
73 |
+
.fancybox-image {
|
74 |
+
max-width: 100%;
|
75 |
+
max-height: 100%;
|
76 |
+
}
|
77 |
+
|
78 |
+
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
79 |
+
background-image: url('fancybox_sprite.png');
|
80 |
+
}
|
81 |
+
|
82 |
+
#fancybox-loading {
|
83 |
+
position: fixed;
|
84 |
+
top: 50%;
|
85 |
+
left: 50%;
|
86 |
+
margin-top: -22px;
|
87 |
+
margin-left: -22px;
|
88 |
+
background-position: 0 -108px;
|
89 |
+
opacity: 0.8;
|
90 |
+
cursor: pointer;
|
91 |
+
z-index: 8060;
|
92 |
+
}
|
93 |
+
|
94 |
+
#fancybox-loading div {
|
95 |
+
width: 44px;
|
96 |
+
height: 44px;
|
97 |
+
background: url('fancybox_loading.gif') center center no-repeat;
|
98 |
+
}
|
99 |
+
|
100 |
+
.fancybox-close {
|
101 |
+
position: absolute;
|
102 |
+
top: -18px;
|
103 |
+
right: -18px;
|
104 |
+
width: 36px;
|
105 |
+
height: 36px;
|
106 |
+
cursor: pointer;
|
107 |
+
z-index: 8040;
|
108 |
+
}
|
109 |
+
|
110 |
+
.fancybox-nav {
|
111 |
+
position: absolute;
|
112 |
+
top: 0;
|
113 |
+
width: 40%;
|
114 |
+
height: 100%;
|
115 |
+
cursor: pointer;
|
116 |
+
text-decoration: none;
|
117 |
+
background: transparent url('blank.gif'); /* helps IE */
|
118 |
+
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
119 |
+
z-index: 8040;
|
120 |
+
}
|
121 |
+
|
122 |
+
.fancybox-prev {
|
123 |
+
left: 0;
|
124 |
+
}
|
125 |
+
|
126 |
+
.fancybox-next {
|
127 |
+
right: 0;
|
128 |
+
}
|
129 |
+
|
130 |
+
.fancybox-nav span {
|
131 |
+
position: absolute;
|
132 |
+
top: 50%;
|
133 |
+
width: 36px;
|
134 |
+
height: 34px;
|
135 |
+
margin-top: -18px;
|
136 |
+
cursor: pointer;
|
137 |
+
z-index: 8040;
|
138 |
+
visibility: hidden;
|
139 |
+
}
|
140 |
+
|
141 |
+
.fancybox-prev span {
|
142 |
+
left: 10px;
|
143 |
+
background-position: 0 -36px;
|
144 |
+
}
|
145 |
+
|
146 |
+
.fancybox-next span {
|
147 |
+
right: 10px;
|
148 |
+
background-position: 0 -72px;
|
149 |
+
}
|
150 |
+
|
151 |
+
.fancybox-nav:hover span {
|
152 |
+
visibility: visible;
|
153 |
+
}
|
154 |
+
|
155 |
+
.fancybox-tmp {
|
156 |
+
position: absolute;
|
157 |
+
top: -99999px;
|
158 |
+
left: -99999px;
|
159 |
+
visibility: hidden;
|
160 |
+
max-width: 99999px;
|
161 |
+
max-height: 99999px;
|
162 |
+
overflow: visible !important;
|
163 |
+
}
|
164 |
+
|
165 |
+
/* Overlay helper */
|
166 |
+
|
167 |
+
.fancybox-lock {
|
168 |
+
overflow: hidden !important;
|
169 |
+
width: auto;
|
170 |
+
}
|
171 |
+
|
172 |
+
.fancybox-lock body {
|
173 |
+
overflow: hidden !important;
|
174 |
+
}
|
175 |
+
|
176 |
+
.fancybox-lock-test {
|
177 |
+
overflow-y: hidden !important;
|
178 |
+
}
|
179 |
+
|
180 |
+
.fancybox-overlay {
|
181 |
+
position: absolute;
|
182 |
+
top: 0;
|
183 |
+
left: 0;
|
184 |
+
overflow: hidden;
|
185 |
+
display: none;
|
186 |
+
z-index: 8010;
|
187 |
+
background: url('fancybox_overlay.png');
|
188 |
+
}
|
189 |
+
|
190 |
+
.fancybox-overlay-fixed {
|
191 |
+
position: fixed;
|
192 |
+
bottom: 0;
|
193 |
+
right: 0;
|
194 |
+
}
|
195 |
+
|
196 |
+
.fancybox-lock .fancybox-overlay {
|
197 |
+
overflow: auto;
|
198 |
+
overflow-y: scroll;
|
199 |
+
}
|
200 |
+
|
201 |
+
/* Title helper */
|
202 |
+
|
203 |
+
.fancybox-title {
|
204 |
+
visibility: hidden;
|
205 |
+
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
206 |
+
position: relative;
|
207 |
+
text-shadow: none;
|
208 |
+
z-index: 8050;
|
209 |
+
}
|
210 |
+
|
211 |
+
.fancybox-opened .fancybox-title {
|
212 |
+
visibility: visible;
|
213 |
+
}
|
214 |
+
|
215 |
+
.fancybox-title-float-wrap {
|
216 |
+
position: absolute;
|
217 |
+
bottom: 0;
|
218 |
+
right: 50%;
|
219 |
+
margin-bottom: -35px;
|
220 |
+
z-index: 8050;
|
221 |
+
text-align: center;
|
222 |
+
}
|
223 |
+
|
224 |
+
.fancybox-title-float-wrap .child {
|
225 |
+
display: inline-block;
|
226 |
+
margin-right: -100%;
|
227 |
+
padding: 2px 20px;
|
228 |
+
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
229 |
+
background: rgba(0, 0, 0, 0.8);
|
230 |
+
-webkit-border-radius: 15px;
|
231 |
+
-moz-border-radius: 15px;
|
232 |
+
border-radius: 15px;
|
233 |
+
text-shadow: 0 1px 2px #222;
|
234 |
+
color: #FFF;
|
235 |
+
font-weight: bold;
|
236 |
+
line-height: 24px;
|
237 |
+
white-space: nowrap;
|
238 |
+
}
|
239 |
+
|
240 |
+
.fancybox-title-outside-wrap {
|
241 |
+
position: relative;
|
242 |
+
margin-top: 10px;
|
243 |
+
color: #fff;
|
244 |
+
}
|
245 |
+
|
246 |
+
.fancybox-title-inside-wrap {
|
247 |
+
padding-top: 10px;
|
248 |
+
}
|
249 |
+
|
250 |
+
.fancybox-title-over-wrap {
|
251 |
+
position: absolute;
|
252 |
+
bottom: 0;
|
253 |
+
left: 0;
|
254 |
+
color: #fff;
|
255 |
+
padding: 10px;
|
256 |
+
background: #000;
|
257 |
+
background: rgba(0, 0, 0, .8);
|
258 |
+
}
|
259 |
+
|
260 |
+
/*Retina graphics!*/
|
261 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
262 |
+
only screen and (min--moz-device-pixel-ratio: 1.5),
|
263 |
+
only screen and (min-device-pixel-ratio: 1.5){
|
264 |
+
|
265 |
+
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
266 |
+
background-image: url('fancybox_sprite@2x.png');
|
267 |
+
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
|
268 |
+
}
|
269 |
+
|
270 |
+
#fancybox-loading div {
|
271 |
+
background-image: url('fancybox_loading@2x.gif');
|
272 |
+
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
|
273 |
+
}
|
274 |
+
}
|
skin/frontend/base/default/css/youstice.css
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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] {
|
6 |
+
clear: left;
|
7 |
+
display: block;
|
8 |
+
margin: 4px 0;
|
9 |
+
}
|
10 |
+
|
11 |
+
form#yReportClaims input {
|
12 |
+
width: calc(100% - 14px);
|
13 |
+
padding: 6px;
|
14 |
+
}
|
15 |
+
|
16 |
+
form#yReportClaims input[type="submit"] {
|
17 |
+
width: auto;
|
18 |
+
margin: 6px 0 0;
|
19 |
+
}
|
20 |
+
|
21 |
+
form#yReportClaims p {
|
22 |
+
margin: 14px 0;
|
23 |
+
color: #ED1C2D;
|
24 |
+
}
|
25 |
+
|
26 |
+
.orderDetailButtonWrap {
|
27 |
+
position: absolute;
|
28 |
+
}
|
29 |
+
|
30 |
+
.orderDetailButtonWrap:hover .popup {
|
31 |
+
visibility: visible;
|
32 |
+
opacity: 1;
|
33 |
+
transition-delay:0s;
|
34 |
+
}
|
35 |
+
|
36 |
+
.orderDetailButtonWrap .popup {
|
37 |
+
visibility: hidden;
|
38 |
+
-webkit-transition: visibility 0s linear 0.5s,opacity 0.5s linear;
|
39 |
+
transition: visibility 0s linear 0.5s,opacity 0.5s linear;
|
40 |
+
opacity: 0;
|
41 |
+
position: absolute;
|
42 |
+
left: -13px;
|
43 |
+
top: 47px;
|
44 |
+
background: #fff;
|
45 |
+
border: 1px solid #9f9f9f;
|
46 |
+
border-radius: 7px;
|
47 |
+
-moz-border-radius: 7px;
|
48 |
+
padding: 0 7px 7px;
|
49 |
+
z-index: 9999;
|
50 |
+
}
|
51 |
+
|
52 |
+
.orderDetailButtonWrap .popup:after {
|
53 |
+
content: "";
|
54 |
+
clear: left;
|
55 |
+
display: block;
|
56 |
+
}
|
57 |
+
|
58 |
+
.orderDetailButtonWrap .popup > span {
|
59 |
+
display: block;
|
60 |
+
width: 14px;
|
61 |
+
height: 8px;
|
62 |
+
left: 20px;
|
63 |
+
position: relative;
|
64 |
+
top: -8px;
|
65 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAIAAABGc1mbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQdFhwqlnS1NAAAAOdJREFUGNNNUL3KwkAQnL3GwpO0FhbWRsQqqZNHyXPpy3gkHCmshEBeQEKqBLu73f2KQ/mmWpgfdoZCCABUVVWJSESmadrtdtZaESEiIgJAREZERERVAcQY13V1zj0ejxBC8idWRIx+wcwxRufc9Xrd7/d93/8oAABMMjGziHjvD4dDnudlWW42m3EcmfkXZAAk9TAM1tqiKFLG6XR6Pp/zPKcPAZiU936/X6/X5XJJFQFkWVZVVdd1n88naYyqLsviva/rervdprLJcDwez+dz27YhBGam2+1GRE3T4Iu02v/7fr8D+AOWLcJY1g8deQAAAABJRU5ErkJggg==);
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
.orderDetailButtonWrap .popup .yrsButton {
|
70 |
+
float: left;
|
71 |
+
clear: left;
|
72 |
+
margin-top: 8px;
|
73 |
+
}
|
74 |
+
|
75 |
+
.orderDetailButtonWrap .popup .yrsButton:first-of-type { margin-top: 0; }
|
76 |
+
|
77 |
+
.orderDetailWrap {
|
78 |
+
min-width: 790px;
|
79 |
+
min-height: 320px;
|
80 |
+
margin: 8px;
|
81 |
+
font-family:"Times New Roman", Times, serif;
|
82 |
+
color: #000;
|
83 |
+
}
|
84 |
+
|
85 |
+
.orderDetailWrap h1 {
|
86 |
+
margin: 0 0 20px 0;
|
87 |
+
padding: 0;
|
88 |
+
font-size: 32px;
|
89 |
+
line-height: normal;
|
90 |
+
}
|
91 |
+
|
92 |
+
.orderDetailWrap h2 {
|
93 |
+
padding: 0;
|
94 |
+
margin: 20px 0;
|
95 |
+
font-size: 22px;
|
96 |
+
line-height: normal;
|
97 |
+
}
|
98 |
+
|
99 |
+
.orderDetailWrap h1, .orderDetailWrap h2 {
|
100 |
+
text-align: left;
|
101 |
+
font-weight: bold;
|
102 |
+
color: #000;
|
103 |
+
}
|
104 |
+
|
105 |
+
.orderDetailWrap table {
|
106 |
+
font-size: 15px
|
107 |
+
}
|
108 |
+
|
109 |
+
.orderDetailWrap .topRightWrap {
|
110 |
+
position: absolute;
|
111 |
+
top: 10px;
|
112 |
+
right: 15px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.orderDetailWrap .yrsOrderButton {
|
116 |
+
display: table-cell;
|
117 |
+
}
|
118 |
+
|
119 |
+
.orderDetailWrap span.space {
|
120 |
+
display: table-cell;
|
121 |
+
padding: 0 10px;
|
122 |
+
}
|
123 |
+
|
124 |
+
.orderDetailWrap .yrsButton-close {
|
125 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAANCAIAAAD5fKMWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUDCwoQ1bjgbgAAAXpJREFUKM8tz0tuU0EURdF9br3nRMk8oBM7IkwJIf8UMxKUOPFHMCUUkA1DQeDUq3tomP5q7K2Ht5+LunIp16EOKjQcFhAdrdKrb11X6p+TKJ0kXcfs2wLzfPPgFgiLyKxEXLTlYUV6f/dc/7YIZ7wmxsrlr/vSh4WMIy9GsfixAixlMxCNUmvbv3sSgWN+uO+7kIMuPhxnEpC7ybrVBELO0tpwys3tGrCYHpejq255/BQuiO14m3WwAIKQVWzlKXeTtRgEH79PBULb8boNr5wlhEgLKy2yan/3BbCjwf79Jl+xjTsxAGGAKJZIj3L6ModIUcz0ZVb6CHVNDQcQYXDNpO+7xWGBwXy926A0MTsuVQiZc02jKEZxzfRwj4XYTtbD77a72Z7N/Oeq9OW/7pQasXhZppG0HT+3YUjV1tpm/GiBmR9WGgUQg6OUgBJiN9n4dJIJ95XM1naTRwm7dQpAT28eU/Xy6nKorrU6FA4xnLcAjaJT1FNC/gOFjNemiqdF4QAAAABJRU5ErkJggg==);
|
126 |
+
display: table-cell;
|
127 |
+
cursor: pointer;
|
128 |
+
}
|
129 |
+
|
130 |
+
.orderDetailWrap table {
|
131 |
+
width: 100%;
|
132 |
+
border-collapse: collapse;
|
133 |
+
border: 0;
|
134 |
+
}
|
135 |
+
|
136 |
+
.orderDetailWrap table tr {
|
137 |
+
border: 0;
|
138 |
+
}
|
139 |
+
|
140 |
+
.orderDetailWrap table tr td {
|
141 |
+
padding: 7px 5px 7px 5px;
|
142 |
+
vertical-align: middle;
|
143 |
+
text-align: left;
|
144 |
+
border: 0;
|
145 |
+
}
|
146 |
+
|
147 |
+
.orderDetailWrap table tr td:last-child {
|
148 |
+
width: 250px;
|
149 |
+
font-size: 11px;
|
150 |
+
}
|
151 |
+
|
152 |
+
.orderDetailWrap table tr td:last-child a { float: right; }
|
153 |
+
|
154 |
+
.orderDetailWrap table tr:first-child {
|
155 |
+
border-top: 1px solid gray;
|
156 |
+
}
|
157 |
+
|
158 |
+
.orderDetailWrap table tr {
|
159 |
+
border-bottom: 1px solid gray;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* BUTTONS
|
164 |
+
*/
|
165 |
+
|
166 |
+
.yrsButton {
|
167 |
+
display: inline-block;
|
168 |
+
background: #92278f 12px 9px no-repeat;
|
169 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09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ACSVs1vDhQRsGoCAETl4lqQS5PRxKxUVEe5i2e8ci7R1fu1wQooUxdq4BecTOhcDRk0qkXmWX5P7xE2NkXw6zmkwxJi6Is0nbVPUGwiDNpcbgcwBmJUxh/Pgoyiymb4P/I7RuRIYqq7aW1Ww9r9uWZTln8lKmExhLxVhynuxNw7S1nObYqRl13dVGkbow0uVCUFlRmtKLaecwPS9F4BOAWQ/hIAiZ3JQH6DpLt0+L8eQMsRPj4kdFzDcqmfw5FKl1BEniZOEfC8wJwqj8yV2GM2YkMOSQQV7Q8JFBJCWkZyBUIEvfWSsWKSnGm5Vt6ibCLoxa3rZOCtVCU24l1+Tb55sCkAIkn4FcPBaqhItaKt/sKeefAkmB2G8rP+WmUOhHXwnDMVNkz+/lPxOQUKKvBrYcRbtmCvkCip6NTkK4GyDFdFTQFf1mKiaugg7469M3JDj7AbeZcPP0B7fXjVrft18CQldRQRJNQagmSCTIV/g8EPoXhO1k9pfcw5ayVxiOfUmyWZBXr63lZgcgMCDC7PweqvNXCsiAEKD0Aw/PPwiUHvRHQZje7HJuyjZtZJpm40jtkGYZ1nYgQzUQSKc+u5z9Bh2f5cq9Jf5DwiDJG1RNgZzky2rKmlcz6gUgoq++aEl3x3vZdbANoN75Wy5NUqt8FT6EafwEWoCCMHWnFaBlSL9BlbT7p8Zfyz/l3/x+3g9uXrT2HuCtDxuEVjNxcixBqrO5KlseOzcsfZFAWMTUP5u/AgwAXbTAlNaE4y8AAAAASUVORK5CYII=);
|
170 |
+
color: #fff;
|
171 |
+
text-decoration: none;
|
172 |
+
font-family: Arial, Helvetica, sans-serif;
|
173 |
+
font-size: 16px;
|
174 |
+
font-size: 1.2em;
|
175 |
+
padding: 10px 21px 10px 42px;
|
176 |
+
font-weight: normal;
|
177 |
+
line-height: 1em;
|
178 |
+
|
179 |
+
border: 1px solid #3c193a;
|
180 |
+
border-radius: 7px;
|
181 |
+
-moz-border-radius: 7px;
|
182 |
+
white-space:nowrap;
|
183 |
+
}
|
184 |
+
|
185 |
+
.yrsButton:hover { text-decoration: none; color: #fff; }
|
186 |
+
|
187 |
+
.yrsButton:active, .yrsButton:visited { color: #fff; }
|
188 |
+
|
189 |
+
.yrsButton-with-time {
|
190 |
+
padding: 5px 21px 5px 42px;
|
191 |
+
}
|
192 |
+
|
193 |
+
.yrsButton span {
|
194 |
+
color: #fff;
|
195 |
+
float: left;
|
196 |
+
clear: left;
|
197 |
+
font-size: 1.0em;
|
198 |
+
}
|
199 |
+
|
200 |
+
.yrsButton span:last-child {
|
201 |
+
font-size: 12px;
|
202 |
+
}
|
203 |
+
|
204 |
+
.yrsButton-order-detail {
|
205 |
+
background: #fff 10px 9px no-repeat;
|
206 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAASCAYAAAC5DOVpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iI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96e22qkpwdJxXsRT+ojktEa3EOBGzQxJktPlAvK8jVmM1u4Dtf6z2X+lllUz6oCLgN+ALZpNty6xi8BBgDNZ1wW8CyG2AAAAABJRU5ErkJggg==);
|
207 |
+
border-color: #a4a4a4;
|
208 |
+
color: #92278f;
|
209 |
+
}
|
210 |
+
|
211 |
+
.yrsButton-order-detail:active, .yrsButton-order-detail:visited {color: #92278f;}
|
212 |
+
|
213 |
+
.yrsButton-order-detail:hover {
|
214 |
+
color: #92278f;
|
215 |
+
}
|
216 |
+
|
217 |
+
.yrsButton-plus, .yrsButton-close {
|
218 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUBCjk5yKq/jgAAAQdJREFUKM91kctRQzEUQ4/kl1YgxfEpBSYpjqGVJJZY+GXBELSyry2NrqTT8wfQVhKKGC9f7xTE+fjJbxgoE4+2xaQACo9gwB2kVkUqAOo++r0BdVRHdoDlApGH2lYs1yEG0HJSV6CMUmU5tLh1KJPYDtEkFANiUs+KDKx6qm1bqeCVzCQDt1M1VqgRhGgDIg0EkSgay7HG2sFody2pLaSgej22SITemQYgQTo9naVL95Hbvn2/Lq3z8bQOQdYs21ZfyqYGjNvcwJRS8FpHQTVic9YtCp3TGvcUW65okOnhtmq2impRs/TZe7FYzNEAKnuuAVObQ7kSz/+7hHmoblhd4ZqxWv2DH3m7rK6GBJR8AAAAAElFTkSuQmCC);
|
219 |
+
background-position: center;
|
220 |
+
text-indent: -9999px;
|
221 |
+
width: 36px;
|
222 |
+
height: 36px;
|
223 |
+
height: 33px;
|
224 |
+
color: #fff;
|
225 |
+
margin-left: 10px;
|
226 |
+
padding: 0 ;
|
227 |
+
vertical-align: top;
|
228 |
+
|
229 |
+
}
|
230 |
+
|
231 |
+
.yrsButton-problem-reported {
|
232 |
+
opacity: 0.4
|
233 |
+
}
|
234 |
+
|
235 |
+
/* ORANGE */
|
236 |
+
.yrsButton-escalated-to-odr {
|
237 |
+
background-color: #f67130;
|
238 |
+
border-color: #d5473b;
|
239 |
+
}
|
240 |
+
|
241 |
+
/* YELLOW */
|
242 |
+
.yrsButton-waiting-for-decision {
|
243 |
+
background-color: #e79f22;
|
244 |
+
border-color: #bd7100;
|
245 |
+
}
|
246 |
+
|
247 |
+
/* GREEN */
|
248 |
+
.yrsButton-to-be-implemented, .yrsButton-waiting-for-retailer-s-response {
|
249 |
+
background-color: #367f3a;
|
250 |
+
border-color: #116e42
|
251 |
+
}
|
252 |
+
|
253 |
+
.y-ajax-spinner {
|
254 |
+
display: inline-block;
|
255 |
+
min-width: 170px;
|
256 |
+
min-height: 32px;
|
257 |
+
background-image: url(data:image/gif;base64,R0lGODlhEAAQAPIAAP///4wjiePK4qlbp4wjibd3tsaTxM2gzCH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==);
|
258 |
+
background-position: center;
|
259 |
+
background-repeat: no-repeat;
|
260 |
+
}
|
skin/frontend/base/default/css/youstice_magento.css
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
form#yReportClaims {
|
2 |
+
display: block;
|
3 |
+
}
|
4 |
+
|
5 |
+
[id*="yousticeOrderButton-"] {
|
6 |
+
min-width: 230px;
|
7 |
+
min-height: 44px
|
8 |
+
}
|
9 |
+
|
10 |
+
[id*="yousticeOrderButton-"]:empty {
|
11 |
+
min-width: 0;
|
12 |
+
min-height: 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
.order-items h3, [id*="yousticeProductButton-"] {
|
16 |
+
display: table-cell;
|
17 |
+
}
|
18 |
+
|
19 |
+
[id*="yousticeProductButton-"] {
|
20 |
+
padding-left: 25px;
|
21 |
+
}
|
22 |
+
|
23 |
+
#y-main {
|
24 |
+
padding-bottom: 20px;
|
25 |
+
}
|
26 |
+
|
27 |
+
#y-main {
|
28 |
+
margin-top: 16px;
|
29 |
+
}
|
30 |
+
|
31 |
+
.y-ajax-spinner {
|
32 |
+
min-height: 30px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.yrsButton {
|
36 |
+
text-transform: none !important;
|
37 |
+
font-family: Arial, Helvetica, sans-serif !important;
|
38 |
+
}
|
skin/frontend/base/default/images/youstice/logo.png
ADDED
Binary file
|