This commit is contained in:
2025-09-25 03:03:31 +05:00
commit ae480cf2f6
2768 changed files with 1485826 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -0,0 +1 @@
<svg width="80" height="80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-infinity" style="background:0 0"><path fill="none" d="M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40C88.6 30 95 43.3 95 50s-6.4 20-19.3 20c-19.3 0-32.1-40-51.4-40z" stroke="#333" stroke-width="2" stroke-dasharray="2.5658892822265624 2.5658892822265624"><animate attributeName="stroke-dashoffset" calcMode="linear" values="0;256.58892822265625" keyTimes="0;1" dur="1" begin="0s" repeatCount="indefinite"/></path></svg>

After

Width:  |  Height:  |  Size: 564 B

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

View File

@@ -0,0 +1,3 @@
$(function () {
})();

View File

@@ -0,0 +1,362 @@
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
});
document.addEventListener('DOMContentLoaded', function(e) {
Event.listen('cartsUpdatedFromSidebar', event => {
showProductShowButton();
})
let pageURL = new URL(location);
if (pageURL.searchParams.has('sorting')) {
document.getElementById('SortBy').value = pageURL.searchParams.get('sorting');
}
let productPerPageSelect = document.getElementById('show-product-count-select');
if (pageURL.searchParams.has('perPage')) {
productPerPageSelect.value = pageURL.searchParams.get('perPage');
} else {
if (productPerPageSelect) {
productPerPageSelect.value = 32;
}
}
});
function subscribeUserToNewsletter(event) {
event.preventDefault();
$.ajax({
method: event.target.method,
url: event.target.action,
data: Object.fromEntries(new FormData(event.target).entries()),
success: (response) => {
Swal.fire('Üstünlikli goşuldy', '', 'success');
},
error: (exception) => {
Swal.fire('Üstünlikli goşuldy', '', 'success') ;
}
});
}
function loginAction(event) {
event.preventDefault();
// let phoneINPUT = document.getElementById('PopupCustomerPhoneContainer');
let verificationINPUT = document.getElementById('PopupCustomerVerificationCodeContainer');
$.ajax({
method: event.target.method,
url: window.Lara.routes.auth.twoFactor,
data: Object.fromEntries(new FormData(event.target).entries()),
success(response) {
console.log({response});
if (response.message == 'Login') {
window.location.reload(true);
}
if (response.message != 'success') {
return;
}
verificationINPUT.classList.remove('d-none');
verificationINPUT.setAttribute('required', 'required');
},
error(exception) {
console.log({exception});
// Swal.fire('Üstünlikli goşuldy', '', 'success') ;
},
done(data) {
console.log({a: data});
}
});
}
function updateLikeCount() {
let wishlistCount = document.getElementById('wishlist-count');
// let sidebarWishlistCount = document.getElementById('sidebar-wishlist-count');
$.ajax({
method: 'POST',
url: window.Lara.routes.products.likeCount,
data: {_token: document.querySelector('meta[name=csrf-token]').getAttribute('value')},
success: (response) => {
wishlistCount.innerText = response.count;
},
error: (exception) => {
console.log({exception});
}
});
}
function toggleProductLike(event, elem, id) {
event.preventDefault();
if (! window.Lara.auth.status) {
return;
}
let formData = {
id: id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
};
$.ajax({
method: 'POST',
url: window.Lara.routes.products.like,
data: formData,
success: (response) => {
if (response.attached) {
document.getElementById(id + '-favourite-icon-dislike')?.classList.add('d-none');
document.getElementById(id + '-favourite-icon-like')?.classList.remove('d-none');
Toast.fire({
icon: 'success',
title: window.Lara.translations.favouries.liked
})
} else {
document.getElementById(id + '-favourite-icon-dislike')?.classList.remove('d-none');
document.getElementById(id + '-favourite-icon-like')?.classList.add('d-none');
Toast.fire({
icon: 'info',
title: window.Lara.translations.favouries.unliked
})
}
Event.fire('likesUpdated');
},
error: (exception) => {
console.log({exception});
}
});
}
function toggleLikeProductShowButton(event, product_id) {
let addToLikeButtonMessage = document.getElementById('add-to-like-button-message');
let addedToLikeButtonMessage = document.getElementById('added-to-like-button-message');
toggleProductLike(event, event.target, product_id);
if (addToLikeButtonMessage.classList.contains('d-none')) {
addToLikeButtonMessage.classList.remove('d-none');
addToLikeButtonMessage.classList.add('d-flex');
addedToLikeButtonMessage.classList.remove('d-flex');
addedToLikeButtonMessage.classList.add('d-none');
} else {
addToLikeButtonMessage.classList.add('d-none');
addToLikeButtonMessage.classList.remove('d-flex');
addedToLikeButtonMessage.classList.add('d-flex');
addedToLikeButtonMessage.classList.remove('d-none');
}
}
function addToCart(product_id, with_count) {
if (! window.Lara.auth.status) {
return;
}
let quantity = with_count ? document.getElementById('product-quantity')?.value : null;
product_id = window.Lara.productOnCart ? window.Lara.productOnCart : product_id;
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
quantity: quantity
};
$.ajax({
method: 'POST',
url: window.Lara.routes.carts.add,
data: formData,
success: (response) => {
Event.fire('cartsUpdated');
},
error: (exception) => {
if (exception.status == 422) {
if (validationMessage = exception.responseJSON.data.validations['product_out_of_stock_count']) {
alert(validationMessage);
}
}
}
});
}
function removeCartItem(product_id) {
if (! window.Lara.auth.status) {
return;
}
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
};
fetch(window.Lara.routes.carts.remove, {
method: 'POST',
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
credentials: 'same-origin',
body: JSON.stringify(formData)
}).then(response => response.json())
.then(data => {
Event.fire('cartsUpdated');
});
}
function updateCart(product_id, increment_by_one) {
if (! window.Lara.auth.status) {
return;
}
let quantity = new Number(document.getElementById('product-quantity')?.value);
if (increment_by_one || quantity == 0) {
quantity += 1;
}
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
quantity: quantity
};
$.ajax({
method: 'POST',
url: window.Lara.routes.carts.update,
data: formData,
success: (response) => {
Event.fire('cartsUpdated');
},
error: (exception) => {
console.log({exception});
}
});
}
function updateProductShowButton() {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
addToCartMessage.classList.remove('d-flex');
addToCartMessage.classList.add('d-none');
removeFromCartMessage.classList.remove('d-none');
removeFromCartMessage.classList.add('d-flex');
removeTrashIcon.classList.remove('d-none');
}
function showProductShowButton() {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
let productQuantity = document.getElementById('product-quantity');
addToCartMessage.classList.remove('d-none');
addToCartMessage.classList.add('d-flex');
removeFromCartMessage.classList.remove('d-flex');
removeFromCartMessage.classList.add('d-none');
removeTrashIcon.classList.add('d-none');
productQuantity.value = 1;
}
function productShowCounterChanged(product_id, event) {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
if (! addToCartMessage.classList.contains('d-flex')) {
updateCart(product_id, event.type == 'click');
}
}
async function postData(url = '', data = {}) {
const response = await fetch(url, {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
referrerPolicy: 'no-referrer',
body: JSON.stringify(data)
});
return response.json();
}
async function globalSearch(q) {
let response = await fetch(window.Lara.routes.app.globalSearch + '?q=' + q);
return response.json();
}
function addSorting(value) {
addUrlParam('sorting', value);
}
function addUrlParam(key, value, update = true) {
let pageURL = new URL(location);
pageURL.searchParams.delete(key)
pageURL.searchParams.append(key, value);
if (update) {
location.href = pageURL.href;
}
}
function sideScroll(element,direction,speed,distance,step){
scrollAmount = 0;
var slideTimer = setInterval(function(){
if (direction == 'left'){
element.scrollLeft -= step;
} else {
element.scrollLeft += step;
}
scrollAmount += step;
if (scrollAmount >= distance) {
window.clearInterval(slideTimer);
}
}, speed);
}
function scrollToClosest(position, elem, selector, points = 1000) {
if (position == 'left') {
let box = $(elem).parent().find(selector);
let x = ((box.width() / 2)) + box.scrollLeft();
box.animate({
scrollLeft: x,
});
// $(elem).parent().find(selector).scrollLeft(-points);
} else {
// $(elem).parent().find(selector).scrollLeft(+points);
}
}
// function orderDeliveryTimeChanged(event) {
// let clientTime = document.getElementById('order-client-time-container');
// if (event.target.value == 'standart') {
// clientTime.classList.remove('d-none');
// } else {
// clientTime.classList.add('d-none');
// }
// }

View File

@@ -0,0 +1 @@
createApp({data:function(){return{locale:window.Lara.locale,routes:window.Lara.routes,likedProducts:[],wishlist_count:0}},methods:{routeFor:function(t){return this.routes.products.show.replace("slug",t)},imageFor:function(t){return t+" 1x, "+t+" 2x"},getLikedProducts:function(){var t=this;fetch(this.routes.user.likesCount).then((function(t){return t.json()})).then((function(e){t.wishlist_count=e.count,document.getElementById("wishlist-count").innerText=e.count,Array.from(document.getElementsByClassName("favourites-icon-count")).forEach((function(t){t.innerText=e.count}))})),fetch(this.routes.user.likes).then((function(t){return t.json()})).then((function(e){t.likedProducts=e.data}))},clearWishlist:function(){this.likedProducts=[],this.wishlist_count=0,postData(this.routes.likes.clear,{_token:document.querySelector("meta[name=csrf-token]").getAttribute("value")}).then((function(t){return"success"==t.message?location.reload(!0):""}))}},mounted:function(){var t=this;window.Lara.auth.status&&this.getLikedProducts(),Event.listen("likesUpdated",(function(e){t.getLikedProducts()})),Event.listen("clearWishlist",(function(e){t.clearWishlist()}))}}).mount("#likes-sidebar");

View File

@@ -0,0 +1 @@
createApp({data:function(){return{routes:window.Lara.routes,locale:window.Lara.locale,all_categories:window.Lara.navigation.categories,categories_dropdown_hidden:!0,categories_to_show:new Object,activeLinks:[]}},methods:{hideCategoryDropdown:function(){this.categories_dropdown_hidden=!0},showCategoriesDropdown:function(){this.categories_dropdown_hidden=!1},showCategoriesFor:function(o){var t=this;this.categories_to_show=this.all_categories.find((function(t){return t.id==o})),this.all_categories.forEach((function(o){return t.activeLinks[o.slug]=!1})),this.activeLinks[this.categories_to_show.slug]=!0},categoryShowRouteFor:function(o){return this.routes.categories.products.replace("slug",o)}},mounted:function(){var o=this;this.all_categories.forEach((function(t,e){0==e?(o.categories_to_show=t,o.activeLinks[t.slug]=!0):o.activeLinks[t.slug]=!1})),Event.listen("showCategoriesDropdownEvent",(function(){o.showCategoriesDropdown()}))}}).mount("#categories-navigation");

View File

@@ -0,0 +1 @@
document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("pagination-next"),a=document.querySelector('div[data-widget="carousel-container"]');if(e){var n=!1,t=!1;elementAppeared(e,(function(){if(!n&&!t){n=!0,e.innerText="Ýüklenilýär";var r=new URL(location.href);r.searchParams.set("page",new URL(e.href).searchParams.get("page")),r.searchParams.has("sorting")&&r.searchParams.set("sorting",r.searchParams.get("sorting")),history.pushState({},"",r.href),$.ajax(location.href,{success:function(r){r.pagination.next_page_url||(e.style.display="none",t=!0),e.href=r.pagination.next_page_url,a.insertAdjacentHTML("beforeend",r.products),n=!1,new LazyLoad({elements_selector:".lazyload",threshold:100})}})}}))}}));

View File

@@ -0,0 +1,9 @@
$(document).ready(function () {
$('#PopupCustomerPhone').inputmask("+(\\9\\93)-69-99-99-99");
$('#ContactFormPhone').inputmask("+(\\9\\93)-69-99-99-99");
})
function maskMe(el) {
$(el).inputmask("+(\\9\\93)-69-99-99-99")
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
theme.ButtonsBlocksVisibility = function() {
function ButtonsBlocksVisibility() {
this.selectors = {
buttons: '.js-button-block-visibility'
};
this.load();
};
ButtonsBlocksVisibility.prototype = $.extend({}, ButtonsBlocksVisibility.prototype, {
load: function() {
$('[data-block-visibility]').each(function () {
var $this = $(this),
name = $this.attr('data-block-visibility');
if(window.location.href.indexOf(name) != -1) {
$this.removeClass('d-none-important');
$this.find('[data-block-visibility-focus]').focus();
}
});
$body.on('click', this.selectors.buttons, function (e) {
var $this = $(this),
name = $this.attr('data-block-link'),
$block = $('[data-block-visibility="' + name + '"]');
if($block.length) {
var close_popup = $this.attr('data-action-close-popup');
$block[$this.attr('data-action') === 'close' ? 'addClass' : $this.attr('data-action') === 'open' ? 'removeClass' : 'toggleClass']('d-none-important');
if(close_popup) theme.Popups.closeByName(close_popup);
if(!$block.hasClass('d-none-important')) $block.find('[data-block-visibility-focus]').focus();
e.preventDefault();
return false;
}
});
}
});
theme.ButtonsBlocksVisibility = new ButtonsBlocksVisibility;
};
$(function() {
theme.ButtonsBlocksVisibility();
});

View File

@@ -0,0 +1 @@
theme.ButtonsBlocksVisibility=function(){function t(){this.selectors={buttons:".js-button-block-visibility"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){$("[data-block-visibility]").each(function(){var t=$(this),i=t.attr("data-block-visibility");-1!=window.location.href.indexOf(i)&&(t.removeClass("d-none-important"),t.find("[data-block-visibility-focus]").focus())}),$body.on("click",this.selectors.buttons,function(t){var i=$(this),o=i.attr("data-block-link"),s=$('[data-block-visibility="'+o+'"]');if(s.length){var a=i.attr("data-action-close-popup");return s["close"===i.attr("data-action")?"addClass":"open"===i.attr("data-action")?"removeClass":"toggleClass"]("d-none-important"),a&&theme.Popups.closeByName(a),s.hasClass("d-none-important")||s.find("[data-block-visibility-focus]").focus(),t.preventDefault(),!1}})}}),theme.ButtonsBlocksVisibility=new t},$(function(){theme.ButtonsBlocksVisibility()});

View File

@@ -0,0 +1,24 @@
theme.Collections = function() {
function Collections() {
this.dom = {
$collections: $('.js-collections')
};
if(this.dom.$collections.length) {
this.load();
}
};
Collections.prototype = $.extend({}, Collections.prototype, {
load: function () {
}
});
theme.Collections = new Collections;
};
$(function() {
theme.Collections();
});

View File

@@ -0,0 +1 @@
theme.Collections=function(){function o(){this.dom={$collections:$(".js-collections")},this.dom.$collections.length&&this.load()}o.prototype=$.extend({},o.prototype,{load:function(){}}),theme.Collections=new o},$(function(){theme.Collections()});

View File

@@ -0,0 +1,28 @@
theme.DynamicCheckout = function() {
function DynamicCheckout() {
this.load();
};
DynamicCheckout.prototype = $.extend({}, DynamicCheckout.prototype, {
load: function() {
function update() {
var $this = $(this),
$dynamic_checkout = $this.parents('.js-dynamic-checkout'),
$button_wrapper = $dynamic_checkout.find('[data-js-dynamic-checkout-button-wrapper]');
$button_wrapper[$this.is(':checked') ? 'removeClass' : 'addClass']('disabled');
};
$body.on('change', '.js-dynamic-checkout [data-js-dynamic-checkout-confirmation]', update);
$('.js-dynamic-checkout [data-js-dynamic-checkout-confirmation]').each(update);
}
});
theme.DynamicCheckout = new DynamicCheckout;
};
$(function() {
theme.DynamicCheckout();
});

View File

@@ -0,0 +1 @@
theme.DynamicCheckout=function(){function c(){this.load()}c.prototype=$.extend({},c.prototype,{load:function(){function c(){var c=$(this);c.parents(".js-dynamic-checkout").find("[data-js-dynamic-checkout-button-wrapper]")[c.is(":checked")?"removeClass":"addClass"]("disabled")}$body.on("change",".js-dynamic-checkout [data-js-dynamic-checkout-confirmation]",c),$(".js-dynamic-checkout [data-js-dynamic-checkout-confirmation]").each(c)}}),theme.DynamicCheckout=new c},$(function(){theme.DynamicCheckout()});

View File

@@ -0,0 +1,55 @@
theme.Masonry = function() {
function Masonry() {
jQueryBridget('masonry', window.Masonry, $);
this.load();
};
Masonry.prototype = $.extend({}, Masonry.prototype, {
load: function() {
this.init();
},
init: function (is_first) {
var _ = this,
$masonry = $('.masonry'),
params = {
itemSelector: '[class*="col-"]'
};
this.$masonry = $masonry;
function load() {
$masonry.masonry(params).removeClass('invisible');
setTimeout(function () {
_.update();
}, 100);
};
if(is_first) {
load();
} else {
$(function () {
load();
$(window).on('load', function () {
_.update();
});
});
}
},
update: function () {
this.$masonry.masonry('layout');
},
destroy: function () {
this.$masonry.masonry('destroy');
}
});
theme.Masonry = new Masonry;
};
$(function() {
theme.Masonry();
});

View File

@@ -0,0 +1 @@
theme.Masonry=function(){function n(){jQueryBridget("masonry",window.Masonry,$),this.load()}n.prototype=$.extend({},n.prototype,{load:function(){this.init()},init:function(n){var o=this,t=$(".masonry"),i={itemSelector:'[class*="col-"]'};function e(){t.masonry(i).removeClass("invisible"),setTimeout(function(){o.update()},100)}this.$masonry=t,n?e():$(function(){e(),$(window).on("load",function(){o.update()})})},update:function(){this.$masonry.masonry("layout")},destroy:function(){this.$masonry.masonry("destroy")}}),theme.Masonry=new n},$(function(){theme.Masonry()});

View File

@@ -0,0 +1,301 @@
theme.Notifications = function() {
function Notifications() {
this.selectors = {
elems: '.js-notification'
};
this.settings = {
close_limit: 40,
translate_limit: 50,
opacity_limit: 0.4
};
this.load();
};
Notifications.prototype = $.extend({}, Notifications.prototype, {
load: function() {
var _ = this,
dif;
$body.on('mousedown', this.selectors.elems, function(e) {
if(e.target.tagName === 'A' || $(e.target).parents('[data-js-action]').length) {
return;
}
_.is_holded = true;
var $this = $(this),
start_posX = e.screenX;
dif = 0;
$this.addClass('animate');
setTimeout(function () {
$this.addClass('pressed');
}, 0);
$body.on('mousemove.notification', function(e) {
var posX = e.screenX,
set_posX = Math.min(start_posX + _.settings.translate_limit, Math.max(start_posX - _.settings.translate_limit, posX));
dif = set_posX - start_posX;
$this.removeClass('animate');
setTimeout(function () {
$this.css({
transform: 'translateX(' + dif + 'px) scale(0.95)',
opacity: Math.max((_.settings.translate_limit - Math.abs(dif)) / _.settings.translate_limit, _.settings.opacity_limit)
});
}, 0);
setTimeout(function () {
$this.addClass('animate');
}, 0);
});
$body.one('mouseup.notification', function() {
$this.trigger('mouseup');
});
e.preventDefault();
return false;
});
$body.on('mouseup', this.selectors.elems, function() {
var $this = $(this);
_.is_holded = false;
$body.unbind('mousemove.notification mouseup.notification');
setTimeout(function () {
if(Math.abs(dif) > _.settings.close_limit) {
var $notification = $this.find('[data-js-notification-inner]'),
$btn_close = $notification.find('[data-js-action="close"]').first();
if($notification.hasClass('d-none')) {
return;
}
$this.one('transitionend', function() {
dif = 0;
$this.trigger('mouseup').trigger('transitionend');
$btn_close.trigger('click');
$notification.trigger('transitionend');
$this.trigger('onpressedend');
});
$this.css({
transform: 'translateX(' + (dif + 20) + 'px) scale(0.95)',
opacity: 0
});
} else {
$this.removeClass('pressed');
$this.one('transitionend' ,function () {
$this.removeClass('animate');
$this.trigger('onpressedend');
});
$this.css({
transform: '',
opacity: ''
});
}
if($this.css('transition-duration') === '0s') {
$this.trigger('transitionend');
}
}, 0);
});
$body.on('close', this.selectors.elems, function() {
var $this = $(this);
$body.unbind('mousemove.notification');
$this.trigger('mouseup').trigger('transitionend');
});
},
_cookies: function($container) {
var _ = this,
$notification = $container.find('.js-notification-cookies');
if($notification.length) {
var $btn_close = $notification.find('[data-js-action="close"]'),
cookie = $.cookie('notification-cookies'),
show_once = $notification.attr('data-js-show-once'),
delay = +$notification.attr('data-js-delay'),
cookies_life = +$notification.attr('data-js-cookies-life');
if(cookie !== 'off') {
setTimeout(function () {
_._show($notification, function () {
$btn_close.one('click', function() {
if(show_once === 'true') {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('notification-cookies', 'off', {
expires: date,
path: '/'
});
}
$(this).off();
_._hide($notification, function () {
$notification.remove();
});
});
});
}, delay * 1000);
}
return $btn_close;
}
},
_products: function($container) {
var _ = this,
$notification = $container.find('.js-notification-products');
if(!$notification.length) {
return;
}
var $btns_close = $notification.find('[data-js-action="close"]'),
$items = $notification.find('[data-js-notification-products-item]'),
delay = +$notification.attr('data-js-delay'),
interval_min = +$notification.attr('data-js-interval-min'),
interval_max = +$notification.attr('data-js-interval-max'),
max_time_life = +$notification.attr('data-js-max-time-life'),
$current_item,
interval_random,
max_time_life_interval;
function randomInteger(min, max) {
return Math.round(min - 0.5 + Math.random() * (max - min + 1));
};
function hide() {
_._hide($notification, function () {
autoplay();
});
};
function autoplay() {
clearInterval(max_time_life_interval);
if(!$notification.hasClass('d-none') || _.is_holded) {
if(_.is_holded) {
$notification.parents('.js-notification').one('onpressedend', function() {
hide();
});
} else if($notification.is(':hover')) {
$notification.one('mouseleave', function() {
hide();
});
} else {
hide();
}
} else {
$current_item = $items.eq(randomInteger(0, $items.length - 1));
interval_random = randomInteger(interval_min, interval_max);
$items.addClass('d-none');
$current_item.removeClass('d-none');
_._show($notification, function () {
setTimeout(function () {
autoplay();
}, interval_random * 1000);
if(max_time_life !== 0) {
max_time_life_interval = setTimeout(function () {
_._hide($notification);
}, max_time_life * 1000);
}
}, function(onVisible) {
onVisible();
});
}
};
setTimeout(function () {
autoplay();
}, delay * 1000);
$btns_close.on('click', function() {
_._hide($notification);
});
return $btns_close;
},
_show: function ($notification, callback, beforeShow) {
$notification.unbind('transitionend');
if(callback) {
$notification.one('transitionend', function () {
callback();
});
}
$notification.removeClass('d-none');
$notification.addClass('animate');
function onVisible() {
setTimeout(function () {
$notification.addClass('visible');
}, 0);
if($notification.css('transition-duration') === '0s') {
$notification.trigger('transitionend');
}
};
if(beforeShow) {
beforeShow(onVisible);
} else {
onVisible();
}
},
_hide: function ($notification, callback) {
$notification.unbind('transitionend');
$notification.one('transitionend', function () {
$notification.addClass('d-none').removeClass('animate').removeAttr('style');
$notification.parents('.js-notification').trigger('close');
if(callback) {
callback();
}
});
$notification.removeClass('visible');
if($notification.css('transition-duration') === '0s') {
$notification.trigger('transitionend');
}
},
init: function ($container) {
this._products($container);
this._cookies($container);
},
destroy: function ($container) {
$container.find('.js-notification-cookies, .js-notification-products').find('[data-js-action="close"]').off();
}
});
theme.Notifications = new Notifications;
};
$(function() {
theme.Notifications();
});

View File

@@ -0,0 +1 @@
theme.Notifications=function(){function t(){this.selectors={elems:".js-notification"},this.settings={close_limit:40,translate_limit:50,opacity_limit:.4},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var s,a=this;$body.on("mousedown",this.selectors.elems,function(t){if("A"!==t.target.tagName&&!$(t.target).parents("[data-js-action]").length){a.is_holded=!0;var e=$(this),o=t.screenX;return s=0,e.addClass("animate"),setTimeout(function(){e.addClass("pressed")},0),$body.on("mousemove.notification",function(t){var i=t.screenX,n=Math.min(o+a.settings.translate_limit,Math.max(o-a.settings.translate_limit,i));s=n-o,e.removeClass("animate"),setTimeout(function(){e.css({transform:"translateX("+s+"px) scale(0.95)",opacity:Math.max((a.settings.translate_limit-Math.abs(s))/a.settings.translate_limit,a.settings.opacity_limit)})},0),setTimeout(function(){e.addClass("animate")},0)}),$body.one("mouseup.notification",function(){e.trigger("mouseup")}),t.preventDefault(),!1}}),$body.on("mouseup",this.selectors.elems,function(){var n=$(this);a.is_holded=!1,$body.unbind("mousemove.notification mouseup.notification"),setTimeout(function(){if(Math.abs(s)>a.settings.close_limit){var t=n.find("[data-js-notification-inner]"),i=t.find('[data-js-action="close"]').first();if(t.hasClass("d-none"))return;n.one("transitionend",function(){s=0,n.trigger("mouseup").trigger("transitionend"),i.trigger("click"),t.trigger("transitionend"),n.trigger("onpressedend")}),n.css({transform:"translateX("+(s+20)+"px) scale(0.95)",opacity:0})}else n.removeClass("pressed"),n.one("transitionend",function(){n.removeClass("animate"),n.trigger("onpressedend")}),n.css({transform:"",opacity:""});"0s"===n.css("transition-duration")&&n.trigger("transitionend")},0)}),$body.on("close",this.selectors.elems,function(){var t=$(this);$body.unbind("mousemove.notification"),t.trigger("mouseup").trigger("transitionend")})},_cookies:function(t){var n=this,e=t.find(".js-notification-cookies");if(e.length){var i=e.find('[data-js-action="close"]'),o=$.cookie("notification-cookies"),s=e.attr("data-js-show-once"),a=+e.attr("data-js-delay"),r=+e.attr("data-js-cookies-life");return"off"!==o&&setTimeout(function(){n._show(e,function(){i.one("click",function(){if("true"===s){var t=new Date,i=864e5*r;t.setTime(t.getTime()+i),$.cookie("notification-cookies","off",{expires:t,path:"/"})}$(this).off(),n._hide(e,function(){e.remove()})})})},1e3*a),i}},_products:function(t){var i=this,n=t.find(".js-notification-products");if(n.length){var e,o,s,a=n.find('[data-js-action="close"]'),r=n.find("[data-js-notification-products-item]"),c=+n.attr("data-js-delay"),d=+n.attr("data-js-interval-min"),f=+n.attr("data-js-interval-max"),u=+n.attr("data-js-max-time-life");return setTimeout(function(){h()},1e3*c),a.on("click",function(){i._hide(n)}),a}function l(t,i){return Math.round(t-.5+Math.random()*(i-t+1))}function m(){i._hide(n,function(){h()})}function h(){clearInterval(s),!n.hasClass("d-none")||i.is_holded?i.is_holded?n.parents(".js-notification").one("onpressedend",function(){m()}):n.is(":hover")?n.one("mouseleave",function(){m()}):m():(e=r.eq(l(0,r.length-1)),o=l(d,f),r.addClass("d-none"),e.removeClass("d-none"),i._show(n,function(){setTimeout(function(){h()},1e3*o),0!==u&&(s=setTimeout(function(){i._hide(n)},1e3*u))},function(t){t()}))}},_show:function(t,i,n){function e(){setTimeout(function(){t.addClass("visible")},0),"0s"===t.css("transition-duration")&&t.trigger("transitionend")}t.unbind("transitionend"),i&&t.one("transitionend",function(){i()}),t.removeClass("d-none"),t.addClass("animate"),n?n(e):e()},_hide:function(t,i){t.unbind("transitionend"),t.one("transitionend",function(){t.addClass("d-none").removeClass("animate").removeAttr("style"),t.parents(".js-notification").trigger("close"),i&&i()}),t.removeClass("visible"),"0s"===t.css("transition-duration")&&t.trigger("transitionend")},init:function(t){this._products(t),this._cookies(t)},destroy:function(t){t.find(".js-notification-cookies, .js-notification-products").find('[data-js-action="close"]').off()}}),theme.Notifications=new t},$(function(){theme.Notifications()});

View File

@@ -0,0 +1,137 @@
theme.Parallax = function() {
function Parallax() {
this.load();
};
Parallax.prototype = $.extend({}, Parallax.prototype, {
load: function () {
$.widget( 'ui.parallax', {
options: {
ratio: 1.2
},
params: {},
_create: function() {
var _ = this;
this.params.start_width = this.element.width();
this.params.start_height = this.element.height();
this.params.start_ratio_height = this.params.start_height / this.params.start_width;
this._setOption('ratio', this.element.data('ratio'), true);
this._setOption('height', this.element.data('height'), true);
this._setOption('minHeight', this.element.data('min-height'), true);
if(this.options.height) {
var height_arr = this.options.height.split(',');
this.options.height = {
xs: height_arr[4],
sm: height_arr[3],
md: height_arr[2],
lg: height_arr[1],
xl: height_arr[0]
};
} else {
this.element.css({
paddingTop: _.params.start_ratio_height * 100 + '%'
});
}
if(this.options.minHeight) {
this.element.css({
minHeight: this.options.minHeight + 'px'
});
}
this.$content = this.element.children().first();
this._calculateSize();
this._calculatePosition();
this.element.css({
overflow: 'hidden',
position: 'relative'
});
this.$content.css({
position: 'absolute',
top: '0',
left: '50%',
transform: 'translateX(-50%)'
});
$window.on('theme.resize.parallax', function () {
_._calculateSize();
_._calculatePosition();
});
$window.on('scroll.parallax', function () {
_._calculatePosition();
});
this.element.addClass('parallax--init');
},
_calculateSize: function() {
this.params.current_width = this.element.width();
if(this.options.height) {
this.element.css({
paddingTop: this.options.height[theme.current.bp]
});
}
this.params.current_height = this.element.height();
this.params.current_scale_width = this.params.current_width * this.options.ratio;
this.params.current_scale_height = this.params.current_height * this.options.ratio;
this.params.stroke_scroll = this.params.current_height + window.innerHeight;
this.params.stroke_content = this.params.current_scale_height - this.params.current_height;
this.params.stroke_ratio = this.params.stroke_scroll / this.params.stroke_content;
this.$content.width(this.params.current_scale_width);
},
_calculatePosition: function() {
this.params.stroke_current = this.params.stroke_scroll - this.element[0].getBoundingClientRect().bottom;
this.params.stroke_current = Math.max(this.params.stroke_current, 0);
this.params.stroke_current = Math.min(this.params.stroke_current, this.params.stroke_scroll);
this.params.current_top = this.params.stroke_content * -1 + (this.params.stroke_current / this.params.stroke_ratio);
this.$content.css({
transform: 'translate(-50%, ' + this.params.current_top + 'px)'
});
},
_init: function () {
},
_setOption: function(key, value) {
$.Widget.prototype._setOption.apply(this, arguments);
},
destroy: function() {
$window.unbind('theme.resize.parallax scroll.parallax');
$.Widget.prototype.destroy.call(this);
}
});
},
init: function($parallax) {
if(!$parallax.hasClass('parallax--init')) {
$parallax.parallax();
}
},
destroy: function ($parallax) {
if($parallax.hasClass('parallax--init')) {
$parallax.parallax('destroy');
}
}
});
theme.Parallax = new Parallax;
};
$(function() {
theme.Parallax();
});

View File

@@ -0,0 +1 @@
theme.Parallax=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){$.widget("ui.parallax",{options:{ratio:1.2},params:{},_create:function(){var t=this;if(this.params.start_width=this.element.width(),this.params.start_height=this.element.height(),this.params.start_ratio_height=this.params.start_height/this.params.start_width,this._setOption("ratio",this.element.data("ratio"),!0),this._setOption("height",this.element.data("height"),!0),this._setOption("minHeight",this.element.data("min-height"),!0),this.options.height){var i=this.options.height.split(",");this.options.height={xs:i[4],sm:i[3],md:i[2],lg:i[1],xl:i[0]}}else this.element.css({paddingTop:100*t.params.start_ratio_height+"%"});this.options.minHeight&&this.element.css({minHeight:this.options.minHeight+"px"}),this.$content=this.element.children().first(),this._calculateSize(),this._calculatePosition(),this.element.css({overflow:"hidden",position:"relative"}),this.$content.css({position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}),$window.on("theme.resize.parallax",function(){t._calculateSize(),t._calculatePosition()}),$window.on("scroll.parallax",function(){t._calculatePosition()}),this.element.addClass("parallax--init")},_calculateSize:function(){this.params.current_width=this.element.width(),this.options.height&&this.element.css({paddingTop:this.options.height[theme.current.bp]}),this.params.current_height=this.element.height(),this.params.current_scale_width=this.params.current_width*this.options.ratio,this.params.current_scale_height=this.params.current_height*this.options.ratio,this.params.stroke_scroll=this.params.current_height+window.innerHeight,this.params.stroke_content=this.params.current_scale_height-this.params.current_height,this.params.stroke_ratio=this.params.stroke_scroll/this.params.stroke_content,this.$content.width(this.params.current_scale_width)},_calculatePosition:function(){this.params.stroke_current=this.params.stroke_scroll-this.element[0].getBoundingClientRect().bottom,this.params.stroke_current=Math.max(this.params.stroke_current,0),this.params.stroke_current=Math.min(this.params.stroke_current,this.params.stroke_scroll),this.params.current_top=-1*this.params.stroke_content+this.params.stroke_current/this.params.stroke_ratio,this.$content.css({transform:"translate(-50%, "+this.params.current_top+"px)"})},_init:function(){},_setOption:function(t,i){$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){$window.unbind("theme.resize.parallax scroll.parallax"),$.Widget.prototype.destroy.call(this)}})},init:function(t){t.hasClass("parallax--init")||t.parallax()},destroy:function(t){t.hasClass("parallax--init")&&t.parallax("destroy")}}),theme.Parallax=new t},$(function(){theme.Parallax()});

View File

@@ -0,0 +1,60 @@
theme.PopupSubscription = function() {
function PopupSubscription() {
this.settings = {
popup_name: 'subscription'
};
this.selectors = {
popup: '.popup-subscription'
};
this.load();
};
PopupSubscription.prototype = $.extend({}, PopupSubscription.prototype, {
load: function() {
var $popup = theme.Popups.getByName(this.settings.popup_name);
if($body.attr('id') !== 'index') {
return;
}
if($popup.length) {
var $subscription = $(this.selectors.popup),
cookie = $.cookie('subscription');
if(cookie !== 'off') {
var $dont_show = $subscription.find('[data-js-popup-subscription-dont-show]'),
show_once = $subscription.attr('data-js-show-once') || false,
delay = +$subscription.attr('data-js-delay') || 3,
cookies_life = +$subscription.attr('data-js-cookies-life') || 1;
theme.Popups.addHandler(this.settings.popup_name, 'close.after', function() {
if(show_once === 'true' || $dont_show.is(':checked')) {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('subscription', 'off', {
expires: date,
path: '/'
});
}
});
setTimeout(function () {
theme.Popups.callByName('subscription');
}, delay * 1000);
}
}
}
});
theme.PopupSubscription = new PopupSubscription;
};
$(function() {
theme.PopupSubscription();
});

View File

@@ -0,0 +1 @@
theme.PopupSubscription=function(){function t(){this.settings={popup_name:"subscription"},this.selectors={popup:".popup-subscription"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=theme.Popups.getByName(this.settings.popup_name);if("index"===$body.attr("id")&&t.length){var e=$(this.selectors.popup);if("off"!==$.cookie("subscription")){var o=e.find("[data-js-popup-subscription-dont-show]"),i=e.attr("data-js-show-once")||!1,p=+e.attr("data-js-delay")||3,s=+e.attr("data-js-cookies-life")||1;theme.Popups.addHandler(this.settings.popup_name,"close.after",function(){if("true"===i||o.is(":checked")){var t=new Date,e=864e5*s;t.setTime(t.getTime()+e),$.cookie("subscription","off",{expires:t,path:"/"})}}),setTimeout(function(){theme.Popups.callByName("subscription")},1e3*p)}}}}),theme.PopupSubscription=new t},$(function(){theme.PopupSubscription()});

View File

@@ -0,0 +1,169 @@
theme.Presentation = function() {
function Presentation() {
this.settings = {
sections_control_container: [
'header',
'gallery',
'home-builder',
'information-line',
'footer'
],
actions: ['container', 'rtl', 'animation']
};
this.dom = {
$presentation: $('.js-presentation')
};
this.load();
};
Presentation.prototype = $.extend({}, Presentation.prototype, {
load: function() {
var _ = this,
animations = {};
for(var key in theme.animations) {
animations[key] = {};
for(var k in theme.animations[key]) {
animations[key][k] = theme.animations[key][k];
}
}
function toggleState(action, enable) {
if(action === 'container') {
$.each(_.settings.sections_control_container, function() {
$('[data-section-type="' + this + '"]').each(function () {
var $this = $(this);
if(enable) {
if($this.hasClass('container')) {
$this.attr('data-has-container', true);
}
$this.addClass('container presentation-container-enabled');
if($this.attr('data-boxed-without-paddings') === 'true') {
$this.addClass('px-0');
}
} else {
if(!$this[0].hasAttribute('data-has-container')) {
$this.removeClass();
} else {
$this.removeAttr('data-has-container');
}
if($this.attr('data-boxed-without-paddings') === 'true') {
$this.removeClass('px-0');
}
$this.removeClass('presentation-container-enabled');
}
});
});
$window.trigger('resize');
if(theme.Masonry) {
theme.Masonry.update();
}
} else if(action === 'rtl') {
$html.attr('dir', enable ? 'rtl' : 'ltr');
theme.rtl = enable;
$('.slick-slider.slick-initialized').not('.slick-vertical').each(function () {
var $this = $(this),
options = $this.slick('getSlick').originalSettings;
options.rtl = theme.rtl;
$this.slick('unslick');
$this.slick(options);
});
$window.trigger('resize');
} else if(action === 'animation') {
$body[enable ? 'addClass' : 'removeClass']('theme-css-animate');
if(enable) {
for(var key in animations) {
for(var k in animations[key]) {
theme.animations[key][k] = animations[key][k];
}
}
} else {
theme.animations.tooltip.show_duration = 0;
theme.animations.tooltip.hide_duration = 0;
theme.animations.sticky_header.duration = 0;
theme.animations.header_tape.duration = 0;
theme.animations.menu.duration = 0;
theme.animations.dropdown.duration = 0;
theme.animations.accordion.duration = 0;
theme.animations.tabs.duration = 0;
theme.animations.tabs.scroll_duration = 0;
theme.animations.backtotop.scroll_duration = 0;
}
}
};
$.each(this.settings.actions, function(i, v) {
var $button = _.dom.$presentation.find('[data-js-action="' + this + '"]');
if($.cookie('presentation-' + this) === 'enabled' && $button.attr('data-invert') !== 'true' && !$button.is(':checked')) {
toggleState(v, true);
$button.prop('checked', 'checked');
} else if($.cookie('presentation-' + this) === 'enabled' && $button.attr('data-invert') === 'true' && $button.is(':checked')) {
toggleState(v, false);
$button.removeAttr('checked');
}
});
this.dom.$presentation.on('change', '[data-js-action]', function() {
var $this = $(this),
action = $this.attr('data-js-action'),
enable = $this.is(':checked'),
state = enable;
if($this.attr('data-invert') === 'true') {
state = !state;
}
$.cookie('presentation-' + action, state ? 'enabled' : null, {
expires: 60 * 60 * 1000,
path: '/'
});
setTimeout(function() {
toggleState(action, enable);
}, theme.animations.css.duration * 1000);
});
this.dom.$presentation.on('click', '[data-js-presentation-close]', function() {
if(_.dom.$presentation.hasClass('open')) {
_.dom.$presentation.removeClass('open');
} else {
_.dom.$presentation.addClass('open');
}
});
theme.Global.responsiveHandler({
namespace: '.presentation',
element: this.dom.$presentation,
on_desktop: true,
events: {
'mouseenter mouseleave': function(e) {
_.dom.$presentation[e.type === 'mouseenter' ? 'addClass' : 'removeClass']('open');
}
}
});
}
});
theme.Presentation = new Presentation;
};
$(function() {
theme.Presentation();
});

View File

@@ -0,0 +1 @@
theme.Presentation=function(){function t(){this.settings={sections_control_container:["header","gallery","home-builder","information-line","footer"],actions:["container","rtl","animation"]},this.dom={$presentation:$(".js-presentation")},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var i=this,o={};for(var t in theme.animations)for(var e in o[t]={},theme.animations[t])o[t][e]=theme.animations[t][e];function s(t,e){if("container"===t)$.each(i.settings.sections_control_container,function(){$('[data-section-type="'+this+'"]').each(function(){var t=$(this);e?(t.hasClass("container")&&t.attr("data-has-container",!0),t.addClass("container presentation-container-enabled"),"true"===t.attr("data-boxed-without-paddings")&&t.addClass("px-0")):(t[0].hasAttribute("data-has-container")?t.removeAttr("data-has-container"):t.removeClass(),"true"===t.attr("data-boxed-without-paddings")&&t.removeClass("px-0"),t.removeClass("presentation-container-enabled"))})}),$window.trigger("resize"),theme.Masonry&&theme.Masonry.update();else if("rtl"===t)$html.attr("dir",e?"rtl":"ltr"),theme.rtl=e,$(".slick-slider.slick-initialized").not(".slick-vertical").each(function(){var t=$(this),e=t.slick("getSlick").originalSettings;e.rtl=theme.rtl,t.slick("unslick"),t.slick(e)}),$window.trigger("resize");else if("animation"===t)if($body[e?"addClass":"removeClass"]("theme-css-animate"),e)for(var n in o)for(var a in o[n])theme.animations[n][a]=o[n][a];else theme.animations.tooltip.show_duration=0,theme.animations.tooltip.hide_duration=0,theme.animations.sticky_header.duration=0,theme.animations.header_tape.duration=0,theme.animations.menu.duration=0,theme.animations.dropdown.duration=0,theme.animations.accordion.duration=0,theme.animations.tabs.duration=0,theme.animations.tabs.scroll_duration=0,theme.animations.backtotop.scroll_duration=0}$.each(this.settings.actions,function(t,e){var n=i.dom.$presentation.find('[data-js-action="'+this+'"]');"enabled"!==$.cookie("presentation-"+this)||"true"===n.attr("data-invert")||n.is(":checked")?"enabled"===$.cookie("presentation-"+this)&&"true"===n.attr("data-invert")&&n.is(":checked")&&(s(e,!1),n.removeAttr("checked")):(s(e,!0),n.prop("checked","checked"))}),this.dom.$presentation.on("change","[data-js-action]",function(){var t=$(this),e=t.attr("data-js-action"),n=t.is(":checked"),a=n;"true"===t.attr("data-invert")&&(a=!a),$.cookie("presentation-"+e,a?"enabled":null,{expires:36e5,path:"/"}),setTimeout(function(){s(e,n)},1e3*theme.animations.css.duration)}),this.dom.$presentation.on("click","[data-js-presentation-close]",function(){i.dom.$presentation.hasClass("open")?i.dom.$presentation.removeClass("open"):i.dom.$presentation.addClass("open")}),theme.Global.responsiveHandler({namespace:".presentation",element:this.dom.$presentation,on_desktop:!0,events:{"mouseenter mouseleave":function(t){i.dom.$presentation["mouseenter"===t.type?"addClass":"removeClass"]("open")}}})}}),theme.Presentation=new t},$(function(){theme.Presentation()});

View File

@@ -0,0 +1,68 @@
theme.ProductFootbar = function() {
function ProductFootbar() {
};
ProductFootbar.prototype = $.extend({}, ProductFootbar.prototype, {
duration: function () {
return theme.animations.footbar_product.duration * 1000;
},
init: function($container) {
var _ = this,
$footbar = $container.find('.js-footbar-product'),
$limit = $('[data-js-footbar-product-limit]');
if($footbar.length && $limit.length) {
$window.on('theme.resize.productFootbar scroll.productFootbar', function () {
_._update($footbar, $limit);
});
this._update($footbar, $limit);
}
},
_update: function ($footbar, $limit) {
var limit = $limit[0].getBoundingClientRect(),
topSpacing = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
if(limit.top < topSpacing && !$footbar.hasClass('show')) {
$footbar.addClass('show animate');
$footbar.velocity('stop', true);
$footbar.velocity('slideDown', {
duration: this.duration(),
begin: function () {
setTimeout(function () {
$footbar.addClass('visible');
}, 0);
},
complete: function () {
$footbar.removeAttr('style');
}
});
} else if(limit.top >= topSpacing && $footbar.hasClass('visible')) {
$footbar.velocity('stop', true);
$footbar.velocity('slideUp', {
duration: this.duration(),
begin: function () {
$footbar.removeClass('visible');
},
complete: function () {
$footbar.removeClass('show animate').removeAttr('style');
}
});
}
},
destroy: function () {
$window.unbind('theme.resize.productFootbar scroll.productFootbar');
}
});
theme.ProductFootbar = new ProductFootbar;
};
$(function() {
theme.ProductFootbar();
});

View File

@@ -0,0 +1 @@
theme.ProductFootbar=function(){function t(){}t.prototype=$.extend({},t.prototype,{duration:function(){return 1e3*theme.animations.footbar_product.duration},init:function(t){var o=this,e=t.find(".js-footbar-product"),i=$("[data-js-footbar-product-limit]");e.length&&i.length&&($window.on("theme.resize.productFootbar scroll.productFootbar",function(){o._update(e,i)}),this._update(e,i))},_update:function(t,o){var e=o[0].getBoundingClientRect(),i=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;e.top<i&&!t.hasClass("show")?(t.addClass("show animate"),t.velocity("stop",!0),t.velocity("slideDown",{duration:this.duration(),begin:function(){setTimeout(function(){t.addClass("visible")},0)},complete:function(){t.removeAttr("style")}})):e.top>=i&&t.hasClass("visible")&&(t.velocity("stop",!0),t.velocity("slideUp",{duration:this.duration(),begin:function(){t.removeClass("visible")},complete:function(){t.removeClass("show animate").removeAttr("style")}}))},destroy:function(){$window.unbind("theme.resize.productFootbar scroll.productFootbar")}}),theme.ProductFootbar=new t},$(function(){theme.ProductFootbar()});

View File

@@ -0,0 +1,108 @@
theme.ProductsView = function() {
function ProductsView() {
this.selectors = {
view: '.js-products-view'
};
this.init();
};
ProductsView.prototype = $.extend({}, ProductsView.prototype, {
init: function() {
var _ = this,
obj_view = localStorage.getItem('products-view');
if(window.location.href.indexOf('products-view=reset') !== -1) {
obj_view = null;
localStorage.setItem('products-view', null);
}
if(obj_view) {
var $wrappers = $(this.selectors.view + ' [data-js-products-grid-buttons]');
obj_view = JSON.parse(obj_view);
$wrappers.each(function () {
var $wrapper = $(this),
is_default = true;
$.each(obj_view, function (k, v) {
if($wrapper.attr('data-value-' + k) !== v) {
var active_attr = 'data-active-' + k;
$wrapper.attr('data-value-' + k, v);
$wrapper.find('[data-value]').removeAttr(active_attr);
$wrapper.find('[data-value="' + v + '"]').attr(active_attr, true);
is_default = false;
}
});
if(!is_default) {
_.update($wrapper);
}
});
}
$body.on('click', this.selectors.view + ' [data-js-products-grid-buttons] [data-value]', function() {
var $this = $(this),
$wrapper = $this.parents('[data-js-products-grid-buttons]'),
value = $this.attr('data-value'),
bp = theme.current.bp,
active_attr = 'data-active-' + bp;
if(!$this[0].hasAttribute(active_attr)) {
var obj_values = {};
$wrapper.find('[data-value]').removeAttr(active_attr);
$this.attr(active_attr, true);
$wrapper.attr('data-value-' + bp, value);
_.update($wrapper);
$.each(theme.breakpoints.values, function (k, v) {
obj_values[k] = $wrapper.attr('data-value-' + k);
});
localStorage.setItem('products-view', JSON.stringify(obj_values));
}
});
},
update: function ($wrapper) {
var $products = $wrapper.parents(this.selectors.view).find('[data-js-products]'),
$buttons = $('[data-js-products-grid-buttons]'),
grid_class = '';
if(!$buttons.length) {
return;
}
$.each(theme.breakpoints.values, function(k) {
var grid_value = $buttons.attr('data-value-' + k),
column_size = (grid_value === 'list' ? 12 : 12 / +grid_value);
$products[+grid_value === 1 ? 'addClass' : 'removeClass']('products-view-centered-' + k);
$products[grid_value === 'list' ? 'addClass' : 'removeClass']('products-view-list-' + k);
grid_class += ' col-';
if(k !== 'xs') {
grid_class += k + '-';
}
grid_class += column_size;
});
$products.find('[data-js-product]').parent().attr('class', grid_class);
$window.trigger('checkImages');
}
});
theme.ProductsView = new ProductsView;
};
$(function() {
theme.ProductsView();
});

View File

@@ -0,0 +1 @@
theme.ProductsView=function(){function t(){this.selectors={view:".js-products-view"},this.init()}t.prototype=$.extend({},t.prototype,{init:function(){var o=this,t=localStorage.getItem("products-view");if(-1!==window.location.href.indexOf("products-view=reset")&&(t=null,localStorage.setItem("products-view",null)),t){var a=$(this.selectors.view+" [data-js-products-grid-buttons]");t=JSON.parse(t),a.each(function(){var s=$(this),r=!0;$.each(t,function(t,a){if(s.attr("data-value-"+t)!==a){var e="data-active-"+t;s.attr("data-value-"+t,a),s.find("[data-value]").removeAttr(e),s.find('[data-value="'+a+'"]').attr(e,!0),r=!1}}),r||o.update(s)})}$body.on("click",this.selectors.view+" [data-js-products-grid-buttons] [data-value]",function(){var t=$(this),e=t.parents("[data-js-products-grid-buttons]"),a=t.attr("data-value"),s=theme.current.bp,r="data-active-"+s;if(!t[0].hasAttribute(r)){var i={};e.find("[data-value]").removeAttr(r),t.attr(r,!0),e.attr("data-value-"+s,a),o.update(e),$.each(theme.breakpoints.values,function(t,a){i[t]=e.attr("data-value-"+t)}),localStorage.setItem("products-view",JSON.stringify(i))}})},update:function(t){var s=t.parents(this.selectors.view).find("[data-js-products]"),r=$("[data-js-products-grid-buttons]"),i="";r.length&&($.each(theme.breakpoints.values,function(t){var a=r.attr("data-value-"+t),e="list"===a?12:12/+a;s[1==+a?"addClass":"removeClass"]("products-view-centered-"+t),s["list"===a?"addClass":"removeClass"]("products-view-list-"+t),i+=" col-","xs"!==t&&(i+=t+"-"),i+=e}),s.find("[data-js-product]").parent().attr("class",i),$window.trigger("checkImages"))}}),theme.ProductsView=new t},$(function(){theme.ProductsView()});

View File

@@ -0,0 +1,73 @@
theme.RangeOfPrice = function() {
function RangeOfPrice() {
this.dom = {};
};
RangeOfPrice.prototype = $.extend({}, RangeOfPrice.prototype, {
init: function() {
this.dom.$range = $('.js-range-of-price');
if(this.dom.$range.length) {
var params = {
type: "double",
force_edges: true,
prettify: function (data) {
return data;
}
};
if (Currency) {
this.dom.$range.on('change', function () {
theme.ProductCurrency.update();
});
$.extend(params, {
onStart: function () {
setTimeout(function () {
theme.ProductCurrency.update();
}, 0);
},
onFinish: function () {
theme.ProductCurrency.update();
}
});
}
this.dom.$range.ionRangeSlider(params);
}
},
destroy: function () {
if(this.dom.$range && this.dom.$range.data('ionRangeSlider')) {
this.dom.$range.ionRangeSlider('destroy');
delete this.dom;
}
},
update: function(from, to) {
if(this.dom.$range) {
var api = this.dom.$range.data('ionRangeSlider');
api.update({
from: from,
to: to
});
}
},
reset: function() {
if(this.dom.$range.length) {
var api = this.dom.$range.data('ionRangeSlider');
api.update({
from: api.result.min,
to: api.result.max
});
}
}
});
theme.RangeOfPrice = new RangeOfPrice;
};
$(function() {
theme.RangeOfPrice();
});

View File

@@ -0,0 +1 @@
theme.RangeOfPrice=function(){function e(){this.dom={}}e.prototype=$.extend({},e.prototype,{init:function(){if(this.dom.$range=$(".js-range-of-price"),this.dom.$range.length){var e={type:"double",force_edges:!0,prettify:function(e){return e}};Currency&&(this.dom.$range.on("change",function(){theme.ProductCurrency.update()}),$.extend(e,{onStart:function(){setTimeout(function(){theme.ProductCurrency.update()},0)},onFinish:function(){theme.ProductCurrency.update()}})),this.dom.$range.ionRangeSlider(e)}},destroy:function(){this.dom.$range&&this.dom.$range.data("ionRangeSlider")&&(this.dom.$range.ionRangeSlider("destroy"),delete this.dom)},update:function(e,t){this.dom.$range&&this.dom.$range.data("ionRangeSlider").update({from:e,to:t})},reset:function(){if(this.dom.$range.length){var e=this.dom.$range.data("ionRangeSlider");e.update({from:e.result.min,to:e.result.max})}}}),theme.RangeOfPrice=new e},$(function(){theme.RangeOfPrice()});

View File

@@ -0,0 +1,69 @@
theme.ShippingRatesCalculation = function() {
function ShippingRatesCalculation() {
this.load();
};
ShippingRatesCalculation.prototype = $.extend({}, ShippingRatesCalculation.prototype, {
load: function() {
var $calculator = $('#shipping-calculator');
if($calculator.length) {
var $info = $('.shipping-calculator-info');
Shopify.Cart.ShippingCalculator.show({
submitButton: theme.strings.shippingCalcSubmitButton,
submitButtonDisabled: theme.strings.shippingCalcSubmitButtonDisabled,
customerIsLoggedIn: theme.strings.shippingCalcCustomerIsLoggedIn,
moneyFormat: theme.strings.shippingCalcMoneyFormat
});
$calculator.on('updated', function () {
setTimeout(function () {
var $result = $('#shipping-rates-feedback.success'),
html = $result.text(),
data = {
zip: $('#address_zip').val(),
province: $('#address_province').val(),
country: $('#address_country').val()
},
info = '';
$result.html(html);
var $price = $('<span>').addClass('price'),
$money = $result.find('span');
$money.replaceWith($price);
$price.append($money);
theme.ProductCurrency.update();
if($('#shipping-rates-feedback.success').length) {
$.each(data, function () {
if(this) {
if(info) info += ', ';
info += this;
}
});
$info.text(theme.strings.cart.general.shipping_calculator_data_info.replace('{{ data }}', info)).fadeIn({
complete: function () {
$info.removeAttr('style');
}
}).removeClass('d-none');
} else {
$info.text('').addClass('d-none');
}
}, 100);
});
}
}
});
theme.ShippingRatesCalculation = new ShippingRatesCalculation;
};
$(function() {
theme.ShippingRatesCalculation();
});

View File

@@ -0,0 +1 @@
theme.ShippingRatesCalculation=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=$("#shipping-calculator");if(t.length){var o=$(".shipping-calculator-info");Shopify.Cart.ShippingCalculator.show({submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,customerIsLoggedIn:theme.strings.shippingCalcCustomerIsLoggedIn,moneyFormat:theme.strings.shippingCalcMoneyFormat}),t.on("updated",function(){setTimeout(function(){var t=$("#shipping-rates-feedback.success"),e=t.text(),n={zip:$("#address_zip").val(),province:$("#address_province").val(),country:$("#address_country").val()},i="";t.html(e);var a=$("<span>").addClass("price"),s=t.find("span");s.replaceWith(a),a.append(s),theme.ProductCurrency.update(),$("#shipping-rates-feedback.success").length?($.each(n,function(){this&&(i&&(i+=", "),i+=this)}),o.text(theme.strings.cart.general.shipping_calculator_data_info.replace("{{ data }}",i)).fadeIn({complete:function(){o.removeAttr("style")}}).removeClass("d-none")):o.text("").addClass("d-none")},100)})}}}),theme.ShippingRatesCalculation=new t},$(function(){theme.ShippingRatesCalculation()});

View File

@@ -0,0 +1,221 @@
theme.StickyHeader = function() {
function StickyHeader() {
};
StickyHeader.prototype = $.extend({}, StickyHeader.prototype, {
init: function($sticky, params) {
var effect = $sticky.attr('data-sticky-effect') || 1;
if ($sticky.length) {
var stickyHeader = {
_create: function() {
var _ = this,
$elem = this.bindings,
$sticky_m = $elem.find(this.options.mobile && this.options.mobile.sticky ? this.options.mobile.sticky : ''),
$sticky_d = $elem.find(this.options.desktop && this.options.desktop.sticky ? this.options.desktop.sticky : ''),
$spacer_m = $('<div>').addClass('header__spacer header__spacer--m').insertBefore($sticky_m),
$spacer_d = $('<div>').addClass('header__spacer header__spacer--d').insertBefore($sticky_d);
this.sticky_class = 'header__content--sticky';
function fix() {
_._fix(_.$sticky, _.$spacer);
_._move(_.options[_.bp]);
};
function unfix() {
_._unfix(_.$sticky, _.$spacer);
_._return(_.options[_.bp]);
};
function on_resize() {
var is_desktop = theme.current.is_desktop;
_.bp = is_desktop ? 'desktop' : 'mobile';
_.$sticky = is_desktop ? $sticky_d : $sticky_m;
_.$spacer = is_desktop ? $spacer_d : $spacer_m;
if(!_.$sticky.length) return;
if (is_desktop) {
$spacer_m.removeClass('header__spacer--visible');
$spacer_d.addClass('header__spacer--visible');
if ($sticky_m.hasClass(_.sticky_class)) {
_._unfix($sticky_m, $spacer_m);
_._return(_.options.mobile);
}
} else {
$spacer_d.removeClass('header__spacer--visible');
$spacer_m.addClass('header__spacer--visible');
if ($sticky_d.hasClass(_.sticky_class)) {
_._unfix($sticky_d, $spacer_d);
_._return(_.options.desktop);
}
}
};
function on_scroll() {
if(!_.$sticky.length) return;
var limit = _.options[_.bp].limit ? _.options[_.bp].limit : 0,
spacer_pos = _.$spacer[0].getBoundingClientRect();
if (limit === 'bottom') {
limit = _.$sticky.hasClass(_.sticky_class) ? _.$spacer.innerHeight() : _.$sticky.innerHeight();
}
limit *= -1;
if (spacer_pos.top < limit) {
if (!_.$sticky.hasClass(_.sticky_class)) {
fix();
}
if(!ie) {
_._check_height(_.$sticky, _.options[_.bp]);
}
} else {
if (_.$sticky.hasClass(_.sticky_class)) {
unfix();
}
}
};
on_resize();
on_scroll();
$window.on({
'theme.resize.stickyHeader': function() {
on_resize();
on_scroll();
},
'scroll.stickyHeader': on_scroll
});
},
_fix: function($sticky, $spacer) {
var height = $sticky.innerHeight();
$spacer.height(height);
if(this.options[this.bp].fade) {
$sticky.css({ 'opacity': 0 }).velocity({ 'opacity': theme.animations.sticky_header.opacity }, this.options[this.bp].duration());
}
$sticky.addClass(this.sticky_class);
},
_unfix: function($sticky, $spacer) {
$spacer.removeAttr('style');
if(this.options[this.bp].fade) {
$sticky.velocity('stop', true);
}
$sticky.removeAttr('style').removeClass(this.sticky_class);
},
_move: function(obj) {
if (!obj.move) return;
$.each(obj.move, function() {
var $elem = $(this.elem),
$to = $(this.to),
method = this.method || 'append';
this.$elem = $elem;
this.$parent = $elem.parent();
$to[method]($elem);
});
},
_return: function(obj) {
if (!obj.move) return;
$.each(obj.move, function() {
var method = this.method || 'append';
this.$parent[method](this.$elem);
this.$elem = null;
this.$parent = null;
});
},
_check_height: function($sticky, obj) {
if(!obj.height) return;
var spacer_pos = this.$spacer[0].getBoundingClientRect(),
height = spacer_pos.bottom <= obj.height ? obj.height : spacer_pos.bottom;
$sticky.css({ 'min-height': height });
},
getStickyHeight: function() {
return this.options[this.bp] ? (this.options[this.bp].height || $(this.options[this.bp].sticky).innerHeight()) : 0;
},
destroy: function() {
$(window).unbind('resize.stickyHeader scroll.stickyHeader');
$.Widget.prototype.destroy.call(this);
}
};
$.widget('ui.stickyHeader', stickyHeader);
$sticky.stickyHeader(params);
this.$sticky = $sticky;
return {
destroy: function() {
$sticky.stickyHeader('destroy');
}
};
}
}
});
theme.StickyHeader = new StickyHeader;
};
$(function() {
theme.StickyHeader();
});
/*DOCUMENTATION*/
//params example
/*
{
bp: 1024,
mobile: {
sticky: '.tt-header__nav',
limit: 400,
fade: true,
duration: 400
},
desktop: {
sticky: '.tt-header__menu',
height: 60,
move: [
{
elem: '.tt-header__sidebar',
to: '.tt-header__menu',
method: 'append'
}
]
}
}
//params info
bp - responsive breakpoint (number)
mobile, desktop - breakpoint params (object)
bp.sticky - sticky element (selector)
bp.limit - breakpoint to start sticky (number, 'bottom')
bp.height - change sticky element height (number)
bp.fade - fade effect (bool)
bp.duration - effects duration (number)
bp.move - move elements inside sticky (array of objects)
bp.move.elem - items that are moved (selector)
bp.move.to - element to which to move (selector)
bp.move.method - jquery method move (string)
*/

View File

@@ -0,0 +1 @@
theme.StickyHeader=function(){function t(){}t.prototype=$.extend({},t.prototype,{init:function(t,i){t.attr("data-sticky-effect");if(t.length){var e={_create:function(){var e=this,t=this.bindings,i=t.find(this.options.mobile&&this.options.mobile.sticky?this.options.mobile.sticky:""),s=t.find(this.options.desktop&&this.options.desktop.sticky?this.options.desktop.sticky:""),o=$("<div>").addClass("header__spacer header__spacer--m").insertBefore(i),n=$("<div>").addClass("header__spacer header__spacer--d").insertBefore(s);function c(){var t=theme.current.is_desktop;e.bp=t?"desktop":"mobile",e.$sticky=t?s:i,e.$spacer=t?n:o,e.$sticky.length&&(t?(o.removeClass("header__spacer--visible"),n.addClass("header__spacer--visible"),i.hasClass(e.sticky_class)&&(e._unfix(i,o),e._return(e.options.mobile))):(n.removeClass("header__spacer--visible"),o.addClass("header__spacer--visible"),s.hasClass(e.sticky_class)&&(e._unfix(s,n),e._return(e.options.desktop))))}function a(){if(e.$sticky.length){var t=e.options[e.bp].limit?e.options[e.bp].limit:0,i=e.$spacer[0].getBoundingClientRect();"bottom"===t&&(t=e.$sticky.hasClass(e.sticky_class)?e.$spacer.innerHeight():e.$sticky.innerHeight()),t*=-1,i.top<t?(e.$sticky.hasClass(e.sticky_class)||(e._fix(e.$sticky,e.$spacer),e._move(e.options[e.bp])),ie||e._check_height(e.$sticky,e.options[e.bp])):e.$sticky.hasClass(e.sticky_class)&&(e._unfix(e.$sticky,e.$spacer),e._return(e.options[e.bp]))}}this.sticky_class="header__content--sticky",c(),a(),$window.on({"theme.resize.stickyHeader":function(){c(),a()},"scroll.stickyHeader":a})},_fix:function(t,i){var e=t.innerHeight();i.height(e),this.options[this.bp].fade&&t.css({opacity:0}).velocity({opacity:theme.animations.sticky_header.opacity},this.options[this.bp].duration()),t.addClass(this.sticky_class)},_unfix:function(t,i){i.removeAttr("style"),this.options[this.bp].fade&&t.velocity("stop",!0),t.removeAttr("style").removeClass(this.sticky_class)},_move:function(t){t.move&&$.each(t.move,function(){var t=$(this.elem),i=$(this.to),e=this.method||"append";this.$elem=t,this.$parent=t.parent(),i[e](t)})},_return:function(t){t.move&&$.each(t.move,function(){var t=this.method||"append";this.$parent[t](this.$elem),this.$elem=null,this.$parent=null})},_check_height:function(t,i){if(i.height){var e=this.$spacer[0].getBoundingClientRect(),s=e.bottom<=i.height?i.height:e.bottom;t.css({"min-height":s})}},getStickyHeight:function(){return this.options[this.bp]?this.options[this.bp].height||$(this.options[this.bp].sticky).innerHeight():0},destroy:function(){$(window).unbind("resize.stickyHeader scroll.stickyHeader"),$.Widget.prototype.destroy.call(this)}};return $.widget("ui.stickyHeader",e),t.stickyHeader(i),this.$sticky=t,{destroy:function(){t.stickyHeader("destroy")}}}}}),theme.StickyHeader=new t},$(function(){theme.StickyHeader()});

View File

@@ -0,0 +1,112 @@
theme.StickySidebar = function() {
function StickySidebar() {
this.selectors = {
elements: '.js-sticky-sidebar'
};
};
StickySidebar.prototype = $.extend({}, StickySidebar.prototype, {
init: function ($container, is_parent) {
if(edge || ie) {
return;
}
var $sticky = $container[is_parent ? 'parents' : 'find'](this.selectors.elements);
if($sticky.length) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
function calculate($sticky) {
$sticky.each(function () {
var $this = $(this),
$inner = $this.find('[data-sticky-sidebar-inner]');
if(theme.current.is_desktop) {
if(!$this.hasClass('initialize')) {
var $parent = $this.parents('[data-sticky-sidebar-parent]'),
topSpacing = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0,
bottomSpacing = 0,
own_topSpacing = $this.attr('data-top-spacing'),
own_bottomSpacing = $this.attr('data-bottom-spacing');
if(own_topSpacing !== undefined) {
topSpacing += +own_topSpacing;
}
if(own_bottomSpacing !== undefined) {
bottomSpacing += +own_bottomSpacing;
}
$this.stickySidebar({
containerSelector: $parent,
innerWrapperSelector: $inner,
topSpacing: topSpacing,
bottomSpacing: bottomSpacing
}).addClass('initialize active');
} else if(!$this.hasClass('active')) {
$this.stickySidebar('updateSticky');
$this.addClass('active');
}
} else {
if($this.hasClass('initialize active')) {
$this.stickySidebar('destroy');
$this.removeClass('initialize active');
$this.removeAttr('style');
$inner.removeAttr('style');
}
}
});
};
$window.on('theme.changed.breakpoint.sticky-sidebar', function () {
calculate($sticky);
});
calculate($sticky);
}
},
update: function ($sticky) {
if(edge || ie) {
return;
}
if($sticky.length && theme.current.is_desktop) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
$sticky.each(function() {
var $this = $(this);
if($this.hasClass('initialize active')) {
$this.stickySidebar('updateSticky');
}
});
}
},
destroy: function ($container, is_parent) {
if(edge || ie) {
return;
}
var $sticky = $container[is_parent ? 'parents' : 'find'](this.selectors.elements);
if($sticky.length && $sticky.hasClass('initialize')) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
$window.unbind('theme.changed.breakpoint.sticky-sidebar');
$sticky.stickySidebar('destroy');
}
}
});
theme.StickySidebar = new StickySidebar;
};
$(function() {
theme.StickySidebar();
});

View File

@@ -0,0 +1 @@
theme.StickySidebar=function(){function e(){this.selectors={elements:".js-sticky-sidebar"}}e.prototype=$.extend({},e.prototype,{init:function(e,t){if(!edge&&!ie){var i=e[t?"parents":"find"](this.selectors.elements);if(i.length){if(moz&&i[0].hasAttribute("data-disable-moz"))return;function a(e){e.each(function(){var e=$(this),t=e.find("[data-sticky-sidebar-inner]");if(theme.current.is_desktop)if(e.hasClass("initialize"))e.hasClass("active")||(e.stickySidebar("updateSticky"),e.addClass("active"));else{var i=e.parents("[data-sticky-sidebar-parent]"),a=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0,s=0,n=e.attr("data-top-spacing"),r=e.attr("data-bottom-spacing");void 0!==n&&(a+=+n),void 0!==r&&(s+=+r),e.stickySidebar({containerSelector:i,innerWrapperSelector:t,topSpacing:a,bottomSpacing:s}).addClass("initialize active")}else e.hasClass("initialize active")&&(e.stickySidebar("destroy"),e.removeClass("initialize active"),e.removeAttr("style"),t.removeAttr("style"))})}$window.on("theme.changed.breakpoint.sticky-sidebar",function(){a(i)}),a(i)}}},update:function(e){if(!edge&&!ie&&e.length&&theme.current.is_desktop){if(moz&&e[0].hasAttribute("data-disable-moz"))return;e.each(function(){var e=$(this);e.hasClass("initialize active")&&e.stickySidebar("updateSticky")})}},destroy:function(e,t){if(!edge&&!ie){var i=e[t?"parents":"find"](this.selectors.elements);if(i.length&&i.hasClass("initialize")){if(moz&&i[0].hasAttribute("data-disable-moz"))return;$window.unbind("theme.changed.breakpoint.sticky-sidebar"),i.stickySidebar("destroy")}}}}),theme.StickySidebar=new e},$(function(){theme.StickySidebar()});

View File

@@ -0,0 +1,361 @@
theme.Tabs = function() {
function Tabs() {
this.selectors = {
elements: '[data-js-tabs]'
};
this.load();
};
Tabs.prototype = $.extend({}, Tabs.prototype, {
init: function ($tabs) {
var $tabs = $tabs || $('.js-tabs').not('.tabs--init');
var tabsObj = {
singleOpen: true,
anim_tab_duration: function () {
return theme.animations.tabs.duration * 1000;
},
anim_scroll_duration: function () {
return theme.animations.tabs.scroll_duration * 1000;
},
toggleOnDesktop: true,
scrollToOpenMobile: true,
effect: 'slide',
offsetTop: '.header__content.header__content--sticky'
};
if($tabs.hasClass('product-tabs')) {
tabsObj = $.extend(tabsObj, {
goToTab: [
{
elem: '.spr-badge-caption',
tab: 'reviews'
}
]
});
}
$tabs.ttTabs(tabsObj);
},
load: function() {
$.fn.ttTabs = function (options) {
function ttTabs(tabs) {
var $tabs = $(tabs),
$head = $tabs.find('[data-js-tabs-head]'),
$slider = $tabs.find('[data-js-tabs-slider]'),
$head_btns = $tabs.find('[data-js-tabs-btn]'),
$body_btns = $tabs.find('[data-js-tabs-btn-mobile]'),
$body_tabs = $tabs.find('[data-js-tabs-tab]'),
$btn_prev = $tabs.find('[data-js-tabs-nav-prev]'),
$btn_next = $tabs.find('[data-js-tabs-nav-next]'),
breakpoint = 1024,
type = $tabs.attr('data-type'),
scrollToOpenMobile = (options.scrollToOpenMobile !== undefined) ? options.scrollToOpenMobile : true,
singleOpen = (options.singleOpen !== undefined) ? options.singleOpen : true,
toggleOnDesktop = (options.toggleOnDesktop !== undefined) ? options.toggleOnDesktop : true,
effect = (options.effect !== undefined) ? options.effect : 'slide',
goToTab = options.goToTab;
function _closeTab($btn, data) {
var $animElem,
this_effect = data.effect || effect,
anim_obj = {
duration: options.anim_tab_duration(),
complete: function () {
$(this).removeAttr('style');
}
};
function _anim_func($animElem) {
switch(this_effect) {
case 'toggle':
$animElem.hide().removeAttr('style');
break;
case 'slide':
$animElem.velocity('slideUp', anim_obj);
break;
default:
$animElem.velocity('slideUp', anim_obj);
}
};
if(data.desktop || singleOpen) {
$head_btns.removeClass('active');
$animElem = $body_tabs.filter('.active').removeClass('active').find('[data-js-tabs-content]').stop();
_anim_func($animElem);
} else {
var index = $head_btns.index($btn);
$btn.removeClass('active');
$animElem = $body_tabs.eq(index).removeClass('active').find('[data-js-tabs-content]').stop();
_anim_func($animElem);
}
};
function _openTab($btn, data) {
var index = $head_btns.index($btn),
$body_tab_act = $body_tabs.eq(index),
$animElem,
$sticky = $('.js-sticky-sidebar'),
this_effect = data.effect || effect,
anim_obj = {
duration: options.anim_tab_duration(),
progress: function () {
if(theme.StickySidebar) {
theme.StickySidebar.update($sticky);
}
},
complete: function () {
if(data.after) {
data.after($body_tab_act);
}
if(theme.StickySidebar) {
theme.StickySidebar.update($sticky);
}
}
};
function _anim_func($animElem) {
if($slider.hasClass('slick-initialized')) {
var btn_l = $btn.last().get(0).getBoundingClientRect().left,
btn_r = $btn.last().get(0).getBoundingClientRect().right,
slider_l = $slider.get(0).getBoundingClientRect().left,
slider_r = $slider.get(0).getBoundingClientRect().right;
if(btn_r > slider_r) $slider.slick('slickNext');
else if(btn_l < slider_l) $slider.slick('slickPrev');
}
switch(this_effect) {
case 'toggle':
$animElem.show();
if(data.after) {
data.after($body_tab_act);
}
break;
case 'slide':
$animElem.velocity('slideDown', anim_obj);
break;
default:
$animElem.velocity('slideDown', anim_obj);
}
};
$btn.addClass('active');
$animElem = $body_tab_act.addClass('active').find('> div').stop();
_anim_func($animElem);
};
function _toTab(tab) {
var wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
$btn = $head_btns.filter('[data-tab="' + tab + '"]');
function afterOpen() {
var tob_t = type === 'horizontal' && desktop ? $tabs.offset().top : $body_btns.eq($head_btns.index($btn)).offset().top,
header_h = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
$('html, body').velocity( 'scroll' , {
offset: tob_t - header_h,
duration: options.anim_scroll_duration()
});
};
if(!$btn.hasClass('active')) {
_closeTab($btn, {
desktop: desktop,
effect: 'toggle'
});
_openTab($btn, {
desktop: desktop,
effect: 'toggle',
after: function () {
afterOpen();
}
});
} else {
afterOpen();
}
};
function _btn_disabled(currentSlide) {
var btn_last_r = $head_btns.last().get(0).getBoundingClientRect().right,
slider_r = $slider.get(0).getBoundingClientRect().right;
if(currentSlide === 0) $btn_prev.addClass('disabled');
else $btn_prev.removeClass('disabled');
if(btn_last_r <= slider_r) $btn_next.addClass('disabled');
else $btn_next.removeClass('disabled');
};
function _slider_init() {
if($slider.hasClass('slick-initialized')) return;
$head.addClass('tabs__head--slider');
$slider.slick({
infinite: false,
slidesToShow: 1,
variableWidth: true,
draggable: false,
dots: false,
arrows: false
});
$btn_prev.addClass('disabled');
$slider.on('afterChange', function(e, slick, currentSlide) {
_btn_disabled(currentSlide);
});
$btn_prev.on('click', function() {
if($(this).hasClass('disabled')) return;
$slider.slick('slickPrev');
});
$btn_next.on('click', function() {
if($(this).hasClass('disabled')) return;
$slider.slick('slickNext');
});
};
function _slider_destroy() {
if(!$slider.hasClass('slick-initialized')) return;
$($slider, $btn_prev, $btn_next).off();
$slider.slick('unslick');
$head.removeClass('tabs__head--slider');
};
$head_btns.on('click', function (e, trigger) {
var $this = $(this),
wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
trigger = (trigger === 'trigger') ? true : false;
if($this.hasClass('active')) {
if(desktop && !toggleOnDesktop) return;
_closeTab($this, {
desktop: desktop
});
} else {
_closeTab($this, {
desktop: desktop
});
_openTab($this, {
desktop: desktop,
after: function ($body_tab_act) {
if (!desktop && !trigger && scrollToOpenMobile) {
var tob_t = $body_tab_act.find('[data-js-tabs-btn-mobile]').offset().top,
header_h = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
$('html, body').velocity('stop').velocity('scroll', {
offset: tob_t - header_h,
duration: options.anim_scroll_duration()
});
}
}
});
}
});
$body_btns.on('click', function () {
var $this = $(this),
$parent = $this.parent(),
index = $body_tabs.index($parent);
$head_btns.eq(index).trigger('click');
});
if($.isArray(goToTab) && goToTab.length) {
$(goToTab).each(function () {
var _ = this;
$body.on('click', this.elem, function (e) {
_toTab(_.tab, _.scrollTo, _.focus);
e.preventDefault();
return false;
});
});
}
if(type === 'horizontal') {
$(window).on('theme.resize updateTabs', function () {
var wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
head_w = $slider.innerWidth(),
btns_w = 0;
$head_btns.each(function () {
btns_w += $(this).innerWidth();
});
if(desktop) {
var $btn_act = $head_btns.filter('.active');
if(!singleOpen && $btn_act.length > 1) {
var $save_active = $btn_act.first();
_closeTab('', {
desktop: desktop
});
_openTab($save_active, {
desktop: desktop
});
}
if(btns_w > head_w) {
_slider_init();
if($slider.hasClass('slick-initialized')) {
setTimeout(function() {
_btn_disabled($head_btns.index($('[data-js-tabs-btn].slick-current')));
}, 0);
}
} else {
_slider_destroy();
}
} else {
_slider_destroy();
}
});
}
$head_btns.filter('[data-active="true"]').trigger('click', ['trigger']);
$(window).trigger('updateTabs');
$tabs.addClass('tabs--init');
return $tabs;
};
$(this).each(function() {
new ttTabs(this);
});
};
this.init();
}
});
theme.Tabs = new Tabs;
};
$(function() {
theme.Tabs();
});

View File

@@ -0,0 +1 @@
theme.Tabs=function(){function t(){this.selectors={elements:"[data-js-tabs]"},this.load()}t.prototype=$.extend({},t.prototype,{init:function(t){var e={singleOpen:!0,anim_tab_duration:function(){return 1e3*theme.animations.tabs.duration},anim_scroll_duration:function(){return 1e3*theme.animations.tabs.scroll_duration},toggleOnDesktop:!0,scrollToOpenMobile:!0,effect:"slide",offsetTop:".header__content.header__content--sticky"};(t=t||$(".js-tabs").not(".tabs--init")).hasClass("product-tabs")&&(e=$.extend(e,{goToTab:[{elem:".spr-badge-caption",tab:"reviews"}]})),t.ttTabs(e)},load:function(){$.fn.ttTabs=function(w){function t(t){var n=$(t),o=n.find("[data-js-tabs-head]"),c=n.find("[data-js-tabs-slider]"),r=n.find("[data-js-tabs-btn]"),d=n.find("[data-js-tabs-btn-mobile]"),f=n.find("[data-js-tabs-tab]"),l=n.find("[data-js-tabs-nav-prev]"),h=n.find("[data-js-tabs-nav-next]"),u=1024,b=n.attr("data-type"),g=void 0===w.scrollToOpenMobile||w.scrollToOpenMobile,k=void 0===w.singleOpen||w.singleOpen,v=void 0===w.toggleOnDesktop||w.toggleOnDesktop,p=void 0!==w.effect?w.effect:"slide",e=w.goToTab;function m(t,e){var i=e.effect||p,a={duration:w.anim_tab_duration(),complete:function(){$(this).removeAttr("style")}};function s(t){switch(i){case"toggle":t.hide().removeAttr("style");break;case"slide":t.velocity("slideUp",a);break;default:t.velocity("slideUp",a)}}if(e.desktop||k)r.removeClass("active"),s(f.filter(".active").removeClass("active").find("[data-js-tabs-content]").stop());else{var n=r.index(t);t.removeClass("active"),s(f.eq(n).removeClass("active").find("[data-js-tabs-content]").stop())}}function y(s,n){var t=r.index(s),o=f.eq(t),e=$(".js-sticky-sidebar"),d=n.effect||p,l={duration:w.anim_tab_duration(),progress:function(){theme.StickySidebar&&theme.StickySidebar.update(e)},complete:function(){n.after&&n.after(o),theme.StickySidebar&&theme.StickySidebar.update(e)}};s.addClass("active"),function(t){if(c.hasClass("slick-initialized")){var e=s.last().get(0).getBoundingClientRect().left,i=s.last().get(0).getBoundingClientRect().right,a=c.get(0).getBoundingClientRect().left;c.get(0).getBoundingClientRect().right<i?c.slick("slickNext"):e<a&&c.slick("slickPrev")}switch(d){case"toggle":t.show(),n.after&&n.after(o);break;case"slide":t.velocity("slideDown",l);break;default:t.velocity("slideDown",l)}}(o.addClass("active").find("> div").stop())}function C(t){var e=r.last().get(0).getBoundingClientRect().right,i=c.get(0).getBoundingClientRect().right;0===t?l.addClass("disabled"):l.removeClass("disabled"),e<=i?h.addClass("disabled"):h.removeClass("disabled")}function _(){c.hasClass("slick-initialized")&&($(c,l,h).off(),c.slick("unslick"),o.removeClass("tabs__head--slider"))}return r.on("click",function(t,a){var e=$(this),i=window.innerWidth,s=u<i;a="trigger"===a;if(e.hasClass("active")){if(s&&!v)return;m(e,{desktop:s})}else m(e,{desktop:s}),y(e,{desktop:s,after:function(t){if(!s&&!a&&g){var e=t.find("[data-js-tabs-btn-mobile]").offset().top,i=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;$("html, body").velocity("stop").velocity("scroll",{offset:e-i,duration:w.anim_scroll_duration()})}}})}),d.on("click",function(){var t=$(this).parent(),e=f.index(t);r.eq(e).trigger("click")}),$.isArray(e)&&e.length&&$(e).each(function(){var e=this;$body.on("click",this.elem,function(t){return function(t){var e=window.innerWidth,i=u<e,a=r.filter('[data-tab="'+t+'"]');function s(){var t="horizontal"===b&&i?n.offset().top:d.eq(r.index(a)).offset().top,e=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;$("html, body").velocity("scroll",{offset:t-e,duration:w.anim_scroll_duration()})}a.hasClass("active")?s():(m(a,{desktop:i,effect:"toggle"}),y(a,{desktop:i,effect:"toggle",after:function(){s()}}))}(e.tab,e.scrollTo,e.focus),t.preventDefault(),!1})}),"horizontal"===b&&$(window).on("theme.resize updateTabs",function(){var t=window.innerWidth,e=u<t,i=c.innerWidth(),a=0;if(r.each(function(){a+=$(this).innerWidth()}),e){var s=r.filter(".active");if(!k&&1<s.length){var n=s.first();m("",{desktop:e}),y(n,{desktop:e})}i<a?(c.hasClass("slick-initialized")||(o.addClass("tabs__head--slider"),c.slick({infinite:!1,slidesToShow:1,variableWidth:!0,draggable:!1,dots:!1,arrows:!1}),l.addClass("disabled"),c.on("afterChange",function(t,e,i){C(i)}),l.on("click",function(){$(this).hasClass("disabled")||c.slick("slickPrev")}),h.on("click",function(){$(this).hasClass("disabled")||c.slick("slickNext")})),c.hasClass("slick-initialized")&&setTimeout(function(){C(r.index($("[data-js-tabs-btn].slick-current")))},0)):_()}else _()}),r.filter('[data-active="true"]').trigger("click",["trigger"]),$(window).trigger("updateTabs"),n.addClass("tabs--init"),n}$(this).each(function(){new t(this)})},this.init()}}),theme.Tabs=new t},$(function(){theme.Tabs()});

View File

@@ -0,0 +1,55 @@
theme.Tooltip = function() {
function Tooltip() {
this.params = {
size: 'small',
arrow: true,
animation: 'fade',
inertia: false,
duration: [200, 0],
delay: 0,
theme: 'shella'
};
this.load();
};
Tooltip.prototype = $.extend({}, Tooltip.prototype, {
load: function () {
this.params = $.extend(this.params, {
animation: window.theme.animations.tooltip.type,
inertia: window.theme.animations.tooltip.inertia,
touch: false
});
this.init();
},
init: function (obj) {
this.params = $.extend(this.params, {
duration: [window.theme.animations.tooltip.show_duration * 1000, window.theme.animations.tooltip.hide_duration * 1000]
});
if(obj) {
this.params = $.extend(this.params, obj);
}
this.api = tippy('[data-js-tooltip]', this.params);
},
reinit: function (obj) {
this.destroy();
this.init(obj);
},
destroy: function () {
if(this.api) {
this.api.destroyAll();
this.api = null;
}
}
});
theme.Tooltip = new Tooltip;
};
$(function() {
theme.Tooltip();
});

View File

@@ -0,0 +1 @@
theme.Tooltip=function(){function t(){this.params={size:"small",arrow:!0,animation:"fade",inertia:!1,duration:[200,0],delay:0,theme:"shella"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.params=$.extend(this.params,{animation:window.theme.animations.tooltip.type,inertia:window.theme.animations.tooltip.inertia,touch:!1}),this.init()},init:function(t){this.params=$.extend(this.params,{duration:[1e3*window.theme.animations.tooltip.show_duration,1e3*window.theme.animations.tooltip.hide_duration]}),t&&(this.params=$.extend(this.params,t)),this.api=tippy("[data-js-tooltip]",this.params)},reinit:function(t){this.destroy(),this.init(t)},destroy:function(){this.api&&(this.api.destroyAll(),this.api=null)}}),theme.Tooltip=new t},$(function(){theme.Tooltip()});

View File

@@ -0,0 +1,27 @@
theme.Trigger = function() {
function Trigger() {
this.load();
};
Trigger.prototype = $.extend({}, Trigger.prototype, {
load: function () {
var _ = this;
$body.on('click', '[data-js-trigger]', function () {
_.process($(this).attr('data-js-trigger'));
});
},
process: function (id, event) {
event = event || 'click';
$('[data-js-trigger-id="' + id + '"]').trigger(event);
}
});
theme.Trigger = new Trigger;
};
$(function() {
theme.Trigger();
});

View File

@@ -0,0 +1 @@
theme.Trigger=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=this;$body.on("click","[data-js-trigger]",function(){t.process($(this).attr("data-js-trigger"))})},process:function(t,e){e=e||"click",$('[data-js-trigger-id="'+t+'"]').trigger(e)}}),theme.Trigger=new t},$(function(){theme.Trigger()});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,76 @@
// Ion.RangeSlider | version 2.1.4 | https://github.com/IonDen/ion.rangeSlider
;(function(g){"function"===typeof define&&define.amd?define(["jquery"],function(q){g(q,document,window,navigator)}):g(jQuery,document,window,navigator)})(function(g,q,h,t,v){var u=0,p=function(){var a=t.userAgent,b=/msie\s\d+/i;return 0<a.search(b)&&(a=b.exec(a).toString(),a=a.split(" ")[1],9>a)?(g("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,d=[].slice;if("function"!=typeof b)throw new TypeError;var c=d.call(arguments,1),e=function(){if(this instanceof
e){var f=function(){};f.prototype=b.prototype;var f=new f,l=b.apply(f,c.concat(d.call(arguments)));return Object(l)===l?l:f}return b.apply(a,c.concat(d.call(arguments)))};return e});Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var d;if(null==this)throw new TypeError('"this" is null or not defined');var c=Object(this),e=c.length>>>0;if(0===e)return-1;d=+b||0;Infinity===Math.abs(d)&&(d=0);if(d>=e)return-1;for(d=Math.max(0<=d?d:e-Math.abs(d),0);d<e;){if(d in c&&c[d]===a)return d;d++}return-1});
var r=function(a,b,d){this.VERSION="2.1.4";this.input=a;this.plugin_count=d;this.old_to=this.old_from=this.update_tm=this.calc_count=this.current_plugin=0;this.raf_id=this.old_min_interval=null;this.is_update=this.is_key=this.no_diapason=this.force_redraw=this.dragging=!1;this.is_start=!0;this.is_click=this.is_resize=this.is_active=this.is_finish=!1;this.$cache={win:g(h),body:g(q.body),input:g(a),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,
s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]};this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]};this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,
p_single_fake:0,p_single_left:0};var c=this.$cache.input;a=c.prop("value");var e;d={type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!1,keyboard_step:5,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",
postfix:"",max_postfix:"",decorate_both:!0,values_separator:" \u2014 ",input_values_separator:";",disable:!1,onStart:null,onChange:null,onFinish:null,onUpdate:null};c={type:c.data("type"),min:c.data("min"),max:c.data("max"),from:c.data("from"),to:c.data("to"),step:c.data("step"),min_interval:c.data("minInterval"),max_interval:c.data("maxInterval"),drag_interval:c.data("dragInterval"),values:c.data("values"),from_fixed:c.data("fromFixed"),from_min:c.data("fromMin"),from_max:c.data("fromMax"),from_shadow:c.data("fromShadow"),
to_fixed:c.data("toFixed"),to_min:c.data("toMin"),to_max:c.data("toMax"),to_shadow:c.data("toShadow"),prettify_enabled:c.data("prettifyEnabled"),prettify_separator:c.data("prettifySeparator"),force_edges:c.data("forceEdges"),keyboard:c.data("keyboard"),keyboard_step:c.data("keyboardStep"),grid:c.data("grid"),grid_margin:c.data("gridMargin"),grid_num:c.data("gridNum"),grid_snap:c.data("gridSnap"),hide_min_max:c.data("hideMinMax"),hide_from_to:c.data("hideFromTo"),prefix:c.data("prefix"),postfix:c.data("postfix"),
max_postfix:c.data("maxPostfix"),decorate_both:c.data("decorateBoth"),values_separator:c.data("valuesSeparator"),input_values_separator:c.data("inputValuesSeparator"),disable:c.data("disable")};c.values=c.values&&c.values.split(",");for(e in c)c.hasOwnProperty(e)&&(c[e]||0===c[e]||delete c[e]);a&&(a=a.split(c.input_values_separator||b.input_values_separator||";"),a[0]&&a[0]==+a[0]&&(a[0]=+a[0]),a[1]&&a[1]==+a[1]&&(a[1]=+a[1]),b&&b.values&&b.values.length?(d.from=a[0]&&b.values.indexOf(a[0]),d.to=
a[1]&&b.values.indexOf(a[1])):(d.from=a[0]&&+a[0],d.to=a[1]&&+a[1]));g.extend(d,b);g.extend(d,c);this.options=d;this.validate();this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null};this.init()};r.prototype={init:function(a){this.no_diapason=!1;this.coords.p_step=this.convertToPercent(this.options.step,!0);this.target="base";this.toggleInput();this.append();this.setMinMax();
a?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart());this.updateScene()},append:function(){this.$cache.input.before('<span class="irs js-irs-'+this.plugin_count+'"></span>');this.$cache.input.prop("readonly",!0);this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>');
this.$cache.rs=this.$cache.cont.find(".irs");this.$cache.min=this.$cache.cont.find(".irs-min");this.$cache.max=this.$cache.cont.find(".irs-max");this.$cache.from=this.$cache.cont.find(".irs-from");this.$cache.to=this.$cache.cont.find(".irs-to");this.$cache.single=this.$cache.cont.find(".irs-single");this.$cache.bar=this.$cache.cont.find(".irs-bar");this.$cache.line=this.$cache.cont.find(".irs-line");this.$cache.grid=this.$cache.cont.find(".irs-grid");"single"===this.options.type?(this.$cache.cont.append('<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>'),
this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append('<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>'),this.$cache.s_from=this.$cache.cont.find(".from"),
this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler());this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none");this.appendGrid();this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass("irs-disabled"),this.$cache.input[0].disabled=
!1,this.bindEvents());this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var a=this.options.max,b=this.options.to;this.options.from>this.options.min&&b===a?this.$cache.s_from.addClass("type_last"):b<a&&this.$cache.s_to.addClass("type_last")},changeLevel:function(a){switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake);break;case "from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake);
this.$cache.s_from.addClass("state_hover");this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake);this.$cache.s_to.addClass("state_hover");this.$cache.s_to.addClass("type_last");this.$cache.s_from.removeClass("type_last");break;case "both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-
this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append('<span class="irs-disable-mask"></span>');this.$cache.cont.addClass("irs-disabled")},remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off("keydown.irs_"+this.plugin_count);this.$cache.body.off("touchmove.irs_"+this.plugin_count);this.$cache.body.off("mousemove.irs_"+this.plugin_count);this.$cache.win.off("touchend.irs_"+
this.plugin_count);this.$cache.win.off("mouseup.irs_"+this.plugin_count);p&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count));this.$cache.grid_labels=[];this.coords.big=[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){if(!this.no_diapason){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.body.on("mousemove.irs_"+this.plugin_count,
this.pointerMove.bind(this));this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,
"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),
this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+
this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),
this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+
this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));if(this.options.keyboard)this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));p&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))}},
pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX)-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;this.$cache.cont.find(".state_hover").removeClass("state_hover");this.force_redraw=!0;p&&g("*").prop("unselectable",!1);this.updateScene();this.restoreOriginalMinInterval();if(g.contains(this.$cache.cont[0],a.target)||this.dragging)this.is_finish=
!0,this.callOnFinish();this.dragging=!1}},pointerDown:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&("both"===a&&this.setTempMinInterval(),a||(a=this.target),this.current_plugin=this.plugin_count,this.target=a,this.dragging=this.is_active=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=d-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(a),p&&g("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),
this.updateScene())},pointerClick:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(d-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();
this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),
this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},setTempMinInterval:function(){var a=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval);
this.options.min_interval=a},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(a){if(this.options){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent();if(this.coords.w_rs){this.calcPointerPercent();a=this.getHandleX();"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,a=this.getHandleX(),this.target=
this.options.drag_interval?"both_one":this.chooseHandle(a));switch(this.target){case "base":var b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,
this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);this.target=null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.convertToRealPercent(a);this.coords.p_single_real=
this.calcWithStep(this.coords.p_single_real);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(a);this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);
this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);break;case "to":if(this.options.to_fixed)break;this.coords.p_to_real=this.convertToRealPercent(a);this.coords.p_to_real=
this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);
break;case "both":if(this.options.from_fixed||this.options.to_fixed)break;a=this.toFixed(a+.1*this.coords.p_handle);this.coords.p_from_real=this.convertToRealPercent(a)-this.coords.p_gap_left;this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);
this.coords.p_to_real=this.convertToRealPercent(a)+this.coords.p_gap_right;this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case "both_one":if(!this.options.from_fixed&&!this.options.to_fixed){var d=this.convertToRealPercent(a);
a=this.result.to_percent-this.result.from_percent;var c=a/2,b=d-c,d=d+c;0>b&&(b=0,d=b+a);100<d&&(d=100,b=d-a);this.coords.p_from_real=this.calcWithStep(b);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_real=this.calcWithStep(d);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_fake=
this.convertToFakePercent(this.coords.p_to_real)}}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-
this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to]));this.calcMinMax();this.calcLabels()}}},calcPointerPercent:function(){this.coords.w_rs?(0>this.coords.x_pointer||isNaN(this.coords.x_pointer)?
this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(a){return a/(100-this.coords.p_handle)*100},convertToFakePercent:function(a){return a/100*(100-this.coords.p_handle)},getHandleX:function(){var a=100-this.coords.p_handle,b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);0>b?b=0:b>a&&(b=a);return b},calcHandlePercent:function(){this.coords.w_handle=
"single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=
this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=
this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=
this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake))},updateScene:function(){this.raf_id&&
(cancelAnimationFrame(this.raf_id),this.raf_id=null);clearTimeout(this.update_tm);this.update_tm=null;this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);if(this.coords.w_rs){this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),
this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left=
this.coords.p_single_fake+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from);else{this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%";this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+
"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to);this.$cache.input.data("from",this.result.from);this.$cache.input.data("to",this.result.to)}this.old_from===
this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange();if(this.is_key||this.is_click)this.is_click=this.is_key=!1,this.callOnFinish();this.is_finish=this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}}},drawLabels:function(){if(this.options){var a=this.options.values.length,
b=this.options.p_values,d;if(!this.options.hide_from_to)if("single"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left<this.labels.p_min+1?"hidden":"visible",this.$cache.max[0].style.visibility=this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?
(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),d=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from),this.result.from),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to),this.result.to)):a=this.decorate(this._prettify(this.result.from)+
this.options.values_separator+this._prettify(this.result.to),this.result.to),d=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(d);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single_fake;d=this.labels.p_to_left+this.labels.p_to_fake;var c=Math.max(a,d);this.labels.p_from_left+
this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",c=d):(this.$cache.from[0].style.visibility=
"hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",c=Math.max(a,d))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b<this.labels.p_min+1?"hidden":"visible";this.$cache.max[0].style.visibility=c>100-this.labels.p_max-1?"hidden":"visible"}}},drawShadow:function(){var a=this.options,b=this.$cache,d="number"===typeof a.from_min&&
!isNaN(a.from_min),c="number"===typeof a.from_max&&!isNaN(a.from_max),e="number"===typeof a.to_min&&!isNaN(a.to_min),f="number"===typeof a.to_max&&!isNaN(a.to_max);"single"===a.type?a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=d+"%",b.shad_single[0].style.width=
c+"%"):b.shad_single[0].style.display="none":(a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_from[0].style.display="block",b.shad_from[0].style.left=d+"%",b.shad_from[0].style.width=c+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(e||f)?(e=this.convertToPercent(e?a.to_min:a.min),a=this.convertToPercent(f?
a.to_max:a.max)-e,e=this.toFixed(e-this.coords.p_handle/100*e),a=this.toFixed(a-this.coords.p_handle/100*a),e+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=e+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},callOnStart:function(){if(this.options.onStart&&"function"===typeof this.options.onStart)this.options.onStart(this.result)},callOnChange:function(){if(this.options.onChange&&"function"===typeof this.options.onChange)this.options.onChange(this.result)},
callOnFinish:function(){if(this.options.onFinish&&"function"===typeof this.options.onFinish)this.options.onFinish(this.result)},callOnUpdate:function(){if(this.options.onUpdate&&"function"===typeof this.options.onUpdate)this.options.onUpdate(this.result)},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")},convertToPercent:function(a,b){var d=this.options.max-this.options.min;return d?this.toFixed((b?a:a-this.options.min)/(d/100)):(this.no_diapason=!0,0)},convertToValue:function(a){var b=
this.options.min,d=this.options.max,c=b.toString().split(".")[1],e=d.toString().split(".")[1],f,l,g=0,k=0;if(0===a)return this.options.min;if(100===a)return this.options.max;c&&(g=f=c.length);e&&(g=l=e.length);f&&l&&(g=f>=l?f:l);0>b&&(k=Math.abs(b),b=+(b+k).toFixed(g),d=+(d+k).toFixed(g));a=(d-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));k&&(a-=k);k=b?+a.toFixed(b.length):this.toFixed(a);k<this.options.min?
k=this.options.min:k>this.options.max&&(k=this.options.max);return k},calcWithStep:function(a){var b=Math.round(a/this.coords.p_step)*this.coords.p_step;100<b&&(b=100);100===a&&(b=100);return this.toFixed(b)},checkMinInterval:function(a,b,d){var c=this.options;if(!c.min_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);"from"===d?b-a<c.min_interval&&(a=b-c.min_interval):a-b<c.min_interval&&(a=b+c.min_interval);return this.convertToPercent(a)},checkMaxInterval:function(a,b,d){var c=
this.options;if(!c.max_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);"from"===d?b-a>c.max_interval&&(a=b-c.max_interval):a-b>c.max_interval&&(a=b+c.max_interval);return this.convertToPercent(a)},checkDiapason:function(a,b,d){a=this.convertToValue(a);var c=this.options;"number"!==typeof b&&(b=c.min);"number"!==typeof d&&(d=c.max);a<b&&(a=b);a>d&&(a=d);return this.convertToPercent(a)},toFixed:function(a){a=a.toFixed(9);return+a},_prettify:function(a){return this.options.prettify_enabled?
this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,d=a.values,c=d.length,e,f;"string"===typeof a.min&&(a.min=+a.min);"string"===typeof a.max&&
(a.max=+a.max);"string"===typeof a.from&&(a.from=+a.from);"string"===typeof a.to&&(a.to=+a.to);"string"===typeof a.step&&(a.step=+a.step);"string"===typeof a.from_min&&(a.from_min=+a.from_min);"string"===typeof a.from_max&&(a.from_max=+a.from_max);"string"===typeof a.to_min&&(a.to_min=+a.to_min);"string"===typeof a.to_max&&(a.to_max=+a.to_max);"string"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);"string"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<a.min&&(a.max=a.min);if(c)for(a.p_values=
[],a.min=0,a.max=c-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,f=0;f<c;f++)e=+d[f],isNaN(e)?e=d[f]:(d[f]=e,e=this._prettify(e)),a.p_values.push(e);if("number"!==typeof a.from||isNaN(a.from))a.from=a.min;if("number"!==typeof a.to||isNaN(a.from))a.to=a.max;if("single"===a.type)a.from<a.min&&(a.from=a.min),a.from>a.max&&(a.from=a.max);else{if(a.from<a.min||a.from>a.max)a.from=a.min;if(a.to>a.max||a.to<a.min)a.to=a.max;a.from>a.to&&(a.from=a.to)}if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=
1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;"number"===typeof a.from_min&&a.from<a.from_min&&(a.from=a.from_min);"number"===typeof a.from_max&&a.from>a.from_max&&(a.from=a.from_max);"number"===typeof a.to_min&&a.to<a.to_min&&(a.to=a.to_min);"number"===typeof a.to_max&&a.from>a.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.from<b.min||b.from>b.max)b.from=a.from;if(b.to<b.min||b.to>
b.max)b.to=a.to}if("number"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if("number"!==typeof a.max_interval||isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval=a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var d="",c=this.options;c.prefix&&(d+=c.prefix);d+=a;c.max_postfix&&(c.values.length&&a===c.p_values[c.max]?
(d+=c.max_postfix,c.postfix&&(d+=" ")):b===c.max&&(d+=c.max_postfix,c.postfix&&(d+=" ")));c.postfix&&(d+=c.postfix);return d},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent=this.convertToPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.convertToPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},
updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a=this.options,b,d;b=a.max-a.min;var c=a.grid_num,e=0,f=0,g=4,h,k,m=0,n="";this.calcGridMargin();a.grid_snap?(c=b/a.step,e=this.toFixed(a.step/(b/100))):e=this.toFixed(100/c);4<c&&(g=3);7<c&&(g=2);14<c&&(g=1);28<c&&(g=0);for(b=0;b<c+1;b++){h=g;f=this.toFixed(e*b);100<f&&(f=100,h-=2,0>h&&(h=0));this.coords.big[b]=f;k=(f-e*(b-1))/
(h+1);for(d=1;d<=h&&0!==f;d++)m=this.toFixed(f-k*d),n+='<span class="irs-grid-pol small" style="left: '+m+'%"></span>';n+='<span class="irs-grid-pol" style="left: '+f+'%"></span>';m=this.convertToValue(f);m=a.values.length?a.p_values[m]:this._prettify(m);n+='<span class="irs-grid-text js-grid-text-'+b+'" style="left: '+f+'%">'+m+"</span>"}this.coords.big_num=Math.ceil(c+1);this.$cache.cont.addClass("irs-with-grid");this.$cache.grid.html(n);this.cacheGridLabels()}},cacheGridLabels:function(){var a,
b,d=this.coords.big_num;for(b=0;b<d;b++)a=this.$cache.grid.find(".js-grid-text-"+b),this.$cache.grid_labels.push(a);this.calcGridLabels()},calcGridLabels:function(){var a,b;b=[];var d=[],c=this.coords.big_num;for(a=0;a<c;a++)this.coords.big_w[a]=this.$cache.grid_labels[a].outerWidth(!1),this.coords.big_p[a]=this.toFixed(this.coords.big_w[a]/this.coords.w_rs*100),this.coords.big_x[a]=this.toFixed(this.coords.big_p[a]/2),b[a]=this.toFixed(this.coords.big[a]-this.coords.big_x[a]),d[a]=this.toFixed(b[a]+
this.coords.big_p[a]);this.options.force_edges&&(b[0]<-this.coords.grid_gap&&(b[0]=-this.coords.grid_gap,d[0]=this.toFixed(b[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),d[c-1]>100+this.coords.grid_gap&&(d[c-1]=100+this.coords.grid_gap,b[c-1]=this.toFixed(d[c-1]-this.coords.big_p[c-1]),this.coords.big_x[c-1]=this.toFixed(this.coords.big_p[c-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,d);this.calcGridCollision(4,b,d);for(a=0;a<c;a++)b=this.$cache.grid_labels[a][0],
b.style.marginLeft=-this.coords.big_x[a]+"%"},calcGridCollision:function(a,b,d){var c,e,f,g=this.coords.big_num;for(c=0;c<g;c+=a){e=c+a/2;if(e>=g)break;f=this.$cache.grid_labels[e][0];f.style.visibility=d[c]<=b[e]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/
this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(a){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.options=g.extend(this.options,a),this.validate(),this.updateResult(a),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),
this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),g.data(this.input,"ionRangeSlider",null),this.remove(),this.options=this.input=null)}};g.fn.ionRangeSlider=function(a){return this.each(function(){g.data(this,"ionRangeSlider")||g.data(this,"ionRangeSlider",new r(this,a,u++))})};(function(){for(var a=0,b=["ms","moz","webkit","o"],d=0;d<b.length&&!h.requestAnimationFrame;++d)h.requestAnimationFrame=h[b[d]+"RequestAnimationFrame"],h.cancelAnimationFrame=
h[b[d]+"CancelAnimationFrame"]||h[b[d]+"CancelRequestAnimationFrame"];h.requestAnimationFrame||(h.requestAnimationFrame=function(b,d){var f=(new Date).getTime(),g=Math.max(0,16-(f-a)),p=h.setTimeout(function(){b(f+g)},g);a=f+g;return p});h.cancelAnimationFrame||(h.cancelAnimationFrame=function(a){clearTimeout(a)})})()});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"object"==typeof Countries&&(Countries.updateProvinceLabel=function(e,t){if("string"==typeof e&&Countries[e]&&Countries[e].provinces){if("object"!=typeof t&&(t=document.getElementById("address_province_label"),null===t))return;t.innerHTML=Countries[e].label;var r=jQuery(t).parent();r.find("select");r.find(".custom-style-select-box-inner").html(Countries[e].provinces[0])}}),"undefined"==typeof Shopify.Cart&&(Shopify.Cart={}),Shopify.Cart.ShippingCalculator=function(){var _config={submitButton:"Calculate shipping",submitButtonDisabled:"Calculating...",templateId:"shipping-calculator-response-template",wrapperId:"wrapper-response",customerIsLoggedIn:!1,moneyFormat:"${{amount}}"},_render=function(e){var t=jQuery("#"+_config.templateId),r=jQuery("#"+_config.wrapperId);if(t.length&&r.length){var templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var n=Handlebars.compile(jQuery.trim(t.text())),a=n(e);if(jQuery(a).appendTo(r),"undefined"!=typeof Currency&&"function"==typeof Currency.convertAll){var i="";jQuery("[name=currencies]").size()?i=jQuery("[name=currencies]").val():jQuery("#currencies span.selected").size()&&(i=jQuery("#currencies span.selected").attr("data-currency")),""!==i&&Currency.convertAll(shopCurrency,i,"#wrapper-response span.money, #estimated-shipping span.money")}}},_enableButtons=function(){jQuery(".get-rates").removeAttr("disabled").removeClass("disabled").val(_config.submitButton);jQuery("#shipping-calculator").trigger("updated")},_disableButtons=function(){jQuery(".get-rates").val(_config.submitButtonDisabled).attr("disabled","disabled").addClass("disabled")},_getCartShippingRatesForDestination=function(e){var t={type:"POST",url:"/cart/prepare_shipping_rates",data:jQuery.param({shipping_address:e}),success:_pollForCartShippingRatesForDestination(e),error:_onError};jQuery.ajax(t)},_pollForCartShippingRatesForDestination=function(e){var t=function(){jQuery.ajax("/cart/async_shipping_rates",{dataType:"json",success:function(r,n,a){200===a.status?_onCartShippingRatesUpdate(r.shipping_rates,e):setTimeout(t,500)},error:_onError})};return t},_fullMessagesFromErrors=function(e){var t=[];return jQuery.each(e,function(e,r){jQuery.each(r,function(r,n){t.push(e+" "+n)})}),t},_onError=function(XMLHttpRequest,textStatus){jQuery("#estimated-shipping").hide(),jQuery("#estimated-shipping em").empty(),_enableButtons();var feedback="",data=eval("("+XMLHttpRequest.responseText+")");feedback=data.message?data.message+"("+data.status+"): "+data.description:"Error : "+_fullMessagesFromErrors(data).join("; ")+".","Error : country is not supported."===feedback&&(feedback="We do not ship to this destination."),_render({rates:[],errorFeedback:feedback,success:!1}),jQuery("#"+_config.wrapperId).show()},_onCartShippingRatesUpdate=function(e,t){_enableButtons();var r="";if(t.zip&&(r+=t.zip+", "),t.province&&(r+=t.province+", "),r+=t.country,e.length){"0.00"==e[0].price?jQuery("#estimated-shipping em").html("FREE"):jQuery("#estimated-shipping em").html(_formatRate(e[0].price));for(var n=0;n<e.length;n++)e[n].price=_formatRate(e[n].price)}_render({rates:e,address:r,success:!0}),jQuery("#"+_config.wrapperId+", #estimated-shipping").fadeIn()},_formatRate=function(e){function t(e,t){return"undefined"==typeof e?t:e}function r(e,r,n,a){if(r=t(r,2),n=t(n,","),a=t(a,"."),isNaN(e)||null==e)return 0;e=(e/100).toFixed(r);var i=e.split("."),o=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),s=i[1]?a+i[1]:"";return o+s}if("function"==typeof Shopify.formatMoney)return Shopify.formatMoney(e,_config.moneyFormat);"string"==typeof e&&(e=e.replace(".",""));var n="",a=/\{\{\s*(\w+)\s*\}\}/,i=_config.moneyFormat;switch(i.match(a)[1]){case"amount":n=r(e,2);break;case"amount_no_decimals":n=r(e,0);break;case"amount_with_comma_separator":n=r(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":n=r(e,0,".",",")}return i.replace(a,n)};return _init=function(){new Shopify.CountryProvinceSelector("address_country","address_province",{hideElement:"address_province_container"});var e=jQuery("#address_country"),t=jQuery("#address_province_label").get(0);"undefined"!=typeof Countries&&(Countries.updateProvinceLabel(e.val(),t),e.change(function(){Countries.updateProvinceLabel(e.val(),t)})),jQuery(".get-rates").click(function(){_disableButtons(),jQuery("#"+_config.wrapperId).empty().hide();var e={};e.zip=jQuery("#address_zip").val()||"",e.country=jQuery("#address_country").val()||"",e.province=jQuery("#address_province").val()||"",_getCartShippingRatesForDestination(e)}),_config.customerIsLoggedIn&&jQuery(".get-rates:eq(0)").trigger("click")},{show:function(e){e=e||{},jQuery.extend(_config,e),jQuery(function(){_init()})},getConfig:function(){return _config},formatRate:function(e){return _formatRate(e)}}}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,76 @@
theme.ArticleBody = (function() {
function ArticleBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.article-body';
this.onLoad();
};
ArticleBody.prototype = $.extend({}, Section.prototype, ArticleBody.prototype, {
slider: {
init: function ($container) {
var $slider = $container.find('.article-slider'),
$insert = $('#article-slider');
if($insert.length && $slider.length) {
$insert.append($slider);
var $slick = $slider.find('.article-slider__slick'),
$dots = $slider.find('.article-slider__dots'),
autoplay = $slick.attr('data-autoplay') === 'true' ? true : false,
speed = +$slick.attr('data-speed'),
infinite = $slick.attr('data-infinite') === 'true' ? true : false;
$slider.removeClass('d-none');
$slick.slick({
prevArrow: '<div class="slick-prev d-none d-md-flex flex-center position-absolute left-0 ml-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative mr-2">' + theme.Global.getIcon('006', true) + '</i></div>',
nextArrow: '<div class="slick-next d-none d-md-flex flex-center position-absolute right-0 mr-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative ml-3">' + theme.Global.getIcon('007', true) + '</i></div>',
dots: true,
appendDots: $dots,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled m-0 my-15',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
rtl: theme.rtl
});
$slider.removeClass('invisible');
this.$dom = $slick;
}
},
destroy: function () {
if(this.$dom) {
this.$dom.slick('destroy');
this.$dom = null;
}
}
},
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
this.slider.init(this.$container);
},
onUnload: function() {
this.$container.off(this.namespace);
this.slider.destroy();
}
});
return ArticleBody;
})();
$(function() {
theme.sections.register('article-body', theme.ArticleBody);
});

View File

@@ -0,0 +1 @@
theme.ArticleBody=function(){function e(e){this.$container=$(e),this.namespace=".article-body",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{slider:{init:function(e){var t=e.find(".article-slider"),i=$("#article-slider");if(i.length&&t.length){i.append(t);var o=t.find(".article-slider__slick"),n=t.find(".article-slider__dots"),r="true"===o.attr("data-autoplay"),s=+o.attr("data-speed"),l="true"===o.attr("data-infinite");t.removeClass("d-none"),o.slick({prevArrow:'<div class="slick-prev d-none d-md-flex flex-center position-absolute left-0 ml-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative mr-2">'+theme.Global.getIcon("006",!0)+"</i></div>",nextArrow:'<div class="slick-next d-none d-md-flex flex-center position-absolute right-0 mr-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative ml-3">'+theme.Global.getIcon("007",!0)+"</i></div>",dots:!0,appendDots:n,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled m-0 my-15",adaptiveHeight:!0,autoplay:r,autoplaySpeed:s,infinite:l,rtl:theme.rtl}),t.removeClass("invisible"),this.$dom=o}},destroy:function(){this.$dom&&(this.$dom.slick("destroy"),this.$dom=null)}},onLoad:function(){theme.is_loaded&&theme.ImagesLazyLoad.update(),this.slider.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),this.slider.destroy()}}),e}(),$(function(){theme.sections.register("article-body",theme.ArticleBody)});

View File

@@ -0,0 +1,38 @@
theme.BlogBody = (function() {
function BlogBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.blog-body';
this.onLoad();
};
BlogBody.prototype = $.extend({}, Section.prototype, BlogBody.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Masonry) {
theme.Masonry.init(true);
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Masonry) {
theme.Masonry.destroy();
}
}
});
return BlogBody;
})();
$(function() {
theme.sections.register('blog-body', theme.BlogBody);
});

View File

@@ -0,0 +1 @@
theme.BlogBody=function(){function e(e){this.$container=$(e),this.namespace=".blog-body",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Masonry&&theme.Masonry.init(!0))},onUnload:function(){this.$container.off(this.namespace),theme.Masonry&&theme.Masonry.destroy()}}),e}(),$(function(){theme.sections.register("blog-body",theme.BlogBody)});

View File

@@ -0,0 +1,37 @@
theme.BlogSidebar = (function() {
function BlogSidebar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.blog-sidebar';
this.onLoad();
};
BlogSidebar.prototype = $.extend({}, Section.prototype, BlogSidebar.prototype, {
onLoad: function() {
if(theme.StickySidebar) {
theme.StickySidebar.init(this.$container);
}
if(theme.is_loaded) theme.ImagesLazyLoad.update();
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.StickySidebar) {
theme.StickySidebar.destroy(this.$container);
}
}
});
return BlogSidebar;
})();
$(function() {
theme.sections.register('blog-sidebar', theme.BlogSidebar);
});

View File

@@ -0,0 +1 @@
theme.BlogSidebar=function(){function e(e){this.$container=$(e),this.namespace=".blog-sidebar",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.StickySidebar&&theme.StickySidebar.init(this.$container),theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container)}}),e}(),$(function(){theme.sections.register("blog-sidebar",theme.BlogSidebar)});

View File

@@ -0,0 +1,118 @@
theme.CarouselArticles = (function() {
function CarouselArticles(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-articles';
this.onLoad();
};
CarouselArticles.prototype = $.extend({}, Section.prototype, CarouselArticles.prototype, {
onLoad: function() {
var $carousel = this.$container.find('[data-js-carousel]'),
$slick = $carousel.find('[data-js-carousel-slick]');
if($slick.length) {
var $prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item img').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({ top: max_height/2 });
};
$window.on('theme.resize.carousel-articles', arrowsPosition);
}
$slick.on('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-35',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.lg,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-articles');
}
}
});
return CarouselArticles;
})();
$(function() {
theme.sections.register('carousel-articles', theme.CarouselArticles);
});

View File

@@ -0,0 +1 @@
theme.CarouselArticles=function(){function e(e){this.$container=$(e),this.namespace=".carousel-articles",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var e=this.$container.find("[data-js-carousel]"),t=e.find("[data-js-carousel-slick]");if(t.length){var s=e.find("[data-js-carousel-prev]"),a=e.find("[data-js-carousel-next]"),i=s.add(a),o=+e.attr("data-count"),r="true"===e.attr("data-autoplay"),n=+e.attr("data-speed"),l="true"===e.attr("data-infinite"),d="true"===e.attr("data-arrows"),c="true"===e.attr("data-bullets");if(this.$slick=t,d){function u(){var e=0;t.find(".carousel__item img").each(function(){e=Math.max(e,$(this).innerHeight())}),i.css({top:e/2})}$window.on("theme.resize.carousel-articles",u)}t.on("init",function(){d&&u(),e.removeClass("invisible"),theme.Loader.unset(e.parent())}),t.slick({lazyLoad:!1,arrows:d,prevArrow:s,nextArrow:a,dots:c,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-35",adaptiveHeight:!0,autoplay:r,autoplaySpeed:n,infinite:l,slidesToShow:o,slidesToScroll:o,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.lg,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:1,slidesToScroll:1}}]}),theme.is_loaded&&theme.ImagesLazyLoad.update()}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-articles"))}}),e}(),$(function(){theme.sections.register("carousel-articles",theme.CarouselArticles)});

View File

@@ -0,0 +1,125 @@
theme.CarouselBrands = (function() {
function CarouselBrands(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-brands';
this.onLoad();
};
CarouselBrands.prototype = $.extend({}, Section.prototype, CarouselBrands.prototype, {
onLoad: function() {
var $carousel = this.$container.find('[data-js-carousel]'),
$slick = $carousel.find('[data-js-carousel-slick]');
if($slick.length) {
var $prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({ top: max_height/2 });
};
$window.on('theme.resize.carousel-brands', arrowsPosition);
}
$slick.on('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-40',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 5,
slidesToScroll: 5
}
},
{
breakpoint: theme.breakpoints.values.lg,
settings: {
slidesToShow: 4,
slidesToScroll: 4
}
},
{
breakpoint: theme.breakpoints.values.md,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
]
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-brands');
}
}
});
return CarouselBrands;
})();
$(function() {
theme.sections.register('carousel-brands', theme.CarouselBrands);
});

View File

@@ -0,0 +1 @@
theme.CarouselBrands=function(){function e(e){this.$container=$(e),this.namespace=".carousel-brands",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var e=this.$container.find("[data-js-carousel]"),t=e.find("[data-js-carousel-slick]");if(t.length){var s=e.find("[data-js-carousel-prev]"),a=e.find("[data-js-carousel-next]"),o=s.add(a),i=+e.attr("data-count"),n="true"===e.attr("data-autoplay"),r=+e.attr("data-speed"),l="true"===e.attr("data-infinite"),d="true"===e.attr("data-arrows"),c="true"===e.attr("data-bullets");if(this.$slick=t,d){function u(){var e=0;t.find(".carousel__item").each(function(){e=Math.max(e,$(this).innerHeight())}),o.css({top:e/2})}$window.on("theme.resize.carousel-brands",u)}t.on("init",function(){d&&u(),e.removeClass("invisible"),theme.Loader.unset(e.parent())}),t.slick({lazyLoad:!1,arrows:d,prevArrow:s,nextArrow:a,dots:c,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-40",adaptiveHeight:!0,autoplay:n,autoplaySpeed:r,infinite:l,slidesToShow:i,slidesToScroll:i,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:5,slidesToScroll:5}},{breakpoint:theme.breakpoints.values.lg,settings:{slidesToShow:4,slidesToScroll:4}},{breakpoint:theme.breakpoints.values.md,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:2,slidesToScroll:2}}]}),theme.is_loaded&&theme.ImagesLazyLoad.update()}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-brands"))}}),e}(),$(function(){theme.sections.register("carousel-brands",theme.CarouselBrands)});

View File

@@ -0,0 +1,257 @@
theme.CarouselProducts = (function() {
function CarouselProducts(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-products';
this.onLoad();
};
CarouselProducts.prototype = $.extend({}, Section.prototype, CarouselProducts.prototype, {
_checkProduct: function ($slide, beforeAjax) {
var _ = this,
handle = $slide.attr('data-handle');
if(handle) {
if(beforeAjax) {
beforeAjax($slide);
}
$.ajax({
type: 'GET',
url: 'https://' + window.location.hostname + '/products/' + handle,
data: {
view: 'collection'
},
cache: false,
dataType: 'html',
success: function (data) {
var $data = $(data).clone();
$data.find('img').one('load', function () {
$slide.add(_.$slick.find('.slick-cloned[data-handle="' + handle + '"]')).html($data).removeAttr('data-handle');
});
$slide.trigger('loaded');
}
});
return true;
} else {
return false;
}
},
onLoad: function() {
var _ = this,
$carousel = this.$container.find('[data-js-carousel]'),
$slick = this.$container.find('[data-js-carousel-slick]'),
$control = this.$container.find('[data-carousel-control]'),
$products = this.$container.find('[data-carousel-items]'),
xhr = null;
this.$control = $control;
if($slick.length) {
var $slides = $slick.find('> *'),
$prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item img').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({top: max_height / 2});
};
$window.on('theme.resize.carousel-products', arrowsPosition);
}
function initSlick() {
$slick.one('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
var check_before = nextSlide - 1,
check_after = nextSlide + count;
function beforeAjax($slide) {
$slides.unbind('loaded');
$slide.one('loaded', function () {
theme.ProductReview.update();
});
};
_._checkProduct($slick.find('[data-slick-index="' + check_before + '"]'), beforeAjax);
for(var i = check_after; i > currentSlide + 1; i--) {
_._checkProduct($slick.find('[data-slick-index="' + i + '"]'), beforeAjax);
}
});
if(theme.Tooltip) {
$slick.on('afterChange', function () {
theme.Tooltip.init();
});
}
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-7',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: theme.breakpoints.values.md,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
]
});
};
initSlick();
$control.on('click', 'a', function (e) {
var $this = $(this);
if(!$this.hasClass('active')) {
if(xhr) {
xhr.abort();
}
theme.Loader.set($carousel);
$carousel.css({
'min-height': $products.innerHeight()
});
var collection = $this.attr('data-collection');
xhr = $.ajax({
type: 'GET',
url: '/collections/' + collection,
cache: false,
data: {
view: 'carousel',
constraint: 'max_count=' + $products.attr('data-max-count') + '+products_pre_row=' + $products.attr('data-products-pre-row') + '+async_ajax_loading=' + $products.attr('data-async-ajax-loading')
},
dataType: 'html',
success: function (data) {
$carousel.addClass('invisible');
$slick.slick('destroy').off();
$slick.one('init', function () {
$carousel.removeAttr('style');
theme.Loader.unset($carousel);
});
$products.html(data);
$slides = $slick.find('> *');
initSlick();
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
$control.find('a').removeClass('active');
$this.addClass('active');
xhr = null;
}
});
}
e.preventDefault();
return false;
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-products');
}
this.$control.off();
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return CarouselProducts;
})();
$(function() {
theme.sections.register('carousel-products', theme.CarouselProducts);
});

View File

@@ -0,0 +1 @@
theme.CarouselProducts=function(){function t(t){this.$container=$(t),this.namespace=".carousel-products",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_checkProduct:function(a,t){var o=this,i=a.attr("data-handle");return!!i&&(t&&t(a),$.ajax({type:"GET",url:"https://"+window.location.hostname+"/products/"+i,data:{view:"collection"},cache:!1,dataType:"html",success:function(t){var e=$(t).clone();e.find("img").one("load",function(){a.add(o.$slick.find('.slick-cloned[data-handle="'+i+'"]')).html(e).removeAttr("data-handle")}),a.trigger("loaded")}}),!0)},onLoad:function(){var d=this,o=this.$container.find("[data-js-carousel]"),l=this.$container.find("[data-js-carousel-slick]"),i=this.$container.find("[data-carousel-control]"),n=this.$container.find("[data-carousel-items]"),s=null;if(this.$control=i,l.length){var c=l.find("> *"),t=o.find("[data-js-carousel-prev]"),e=o.find("[data-js-carousel-next]"),a=t.add(e),u=+o.attr("data-count"),r="true"===o.attr("data-autoplay"),h=+o.attr("data-speed"),p="true"===o.attr("data-infinite"),f="true"===o.attr("data-arrows"),m="true"===o.attr("data-bullets");if(this.$slick=l,f){function v(){var t=0;l.find(".carousel__item img").each(function(){t=Math.max(t,$(this).innerHeight())}),a.css({top:t/2})}$window.on("theme.resize.carousel-products",v)}function k(){l.one("init",function(){f&&v(),o.removeClass("invisible"),theme.Loader.unset(o.parent())}),l.on("beforeChange",function(t,e,a,o){var i=o-1,n=o+u;function s(t){c.unbind("loaded"),t.one("loaded",function(){theme.ProductReview.update()})}d._checkProduct(l.find('[data-slick-index="'+i+'"]'),s);for(var r=n;a+1<r;r--)d._checkProduct(l.find('[data-slick-index="'+r+'"]'),s)}),theme.Tooltip&&l.on("afterChange",function(){theme.Tooltip.init()}),l.slick({lazyLoad:!1,arrows:f,prevArrow:t,nextArrow:e,dots:m,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-7",adaptiveHeight:!0,autoplay:r,autoplaySpeed:h,infinite:p,slidesToShow:u,slidesToScroll:u,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:theme.breakpoints.values.md,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:2,slidesToScroll:2}}]})}k(),i.on("click","a",function(t){var e=$(this);if(!e.hasClass("active")){s&&s.abort(),theme.Loader.set(o),o.css({"min-height":n.innerHeight()});var a=e.attr("data-collection");s=$.ajax({type:"GET",url:"/collections/"+a,cache:!1,data:{view:"carousel",constraint:"max_count="+n.attr("data-max-count")+"+products_pre_row="+n.attr("data-products-pre-row")+"+async_ajax_loading="+n.attr("data-async-ajax-loading")},dataType:"html",success:function(t){o.addClass("invisible"),l.slick("destroy").off(),l.one("init",function(){o.removeAttr("style"),theme.Loader.unset(o)}),n.html(t),c=l.find("> *"),k(),theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init(),i.find("a").removeClass("active"),e.addClass("active"),s=null}})}return t.preventDefault(),!1}),theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init())}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-products")),this.$control.off(),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("carousel-products",theme.CarouselProducts)});

View File

@@ -0,0 +1,38 @@
theme.CollectionBody = (function() {
function CollectionBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-body';
this.onLoad();
};
CollectionBody.prototype = $.extend({}, Section.prototype, CollectionBody.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return CollectionBody;
})();
$(function() {
theme.sections.register('collection-body', theme.CollectionBody);
});

View File

@@ -0,0 +1 @@
theme.CollectionBody=function(){function o(o){this.$container=$(o),this.namespace=".collection-body",this.onLoad()}return o.prototype=$.extend({},Section.prototype,o.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Tooltip&&theme.Tooltip.init())},onUnload:function(){this.$container.off(this.namespace),theme.Tooltip&&theme.Tooltip.destroy()}}),o}(),$(function(){theme.sections.register("collection-body",theme.CollectionBody)});

View File

@@ -0,0 +1,31 @@
theme.CollectionHead = (function() {
function CollectionHead(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-head';
this.onLoad();
};
CollectionHead.prototype = $.extend({}, Section.prototype, CollectionHead.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
}
});
return CollectionHead;
})();
$(function() {
theme.sections.register('collection-head', theme.CollectionHead);
});

View File

@@ -0,0 +1 @@
theme.CollectionHead=function(){function e(e){this.$container=$(e),this.namespace=".collection-head",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace)}}),e}(),$(function(){theme.sections.register("collection-head",theme.CollectionHead)});

View File

@@ -0,0 +1,56 @@
theme.CollectionSidebar = (function() {
function CollectionSidebar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-sidebar';
this.onLoad();
};
CollectionSidebar.prototype = $.extend({}, Section.prototype, CollectionSidebar.prototype, {
_rangePrice: {
init: function() {
if(theme.RangeOfPrice) {
theme.RangeOfPrice.init();
}
},
destroy: function() {
if(theme.RangeOfPrice) {
theme.RangeOfPrice.destroy();
}
}
},
onLoad: function() {
if(theme.StickySidebar) {
theme.StickySidebar.init(this.$container, true);
}
this._rangePrice.init();
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.StickySidebar) {
theme.StickySidebar.destroy(this.$container, true);
}
this._rangePrice.destroy();
}
});
return CollectionSidebar;
})();
$(function() {
theme.sections.register('collection-sidebar', theme.CollectionSidebar);
});

View File

@@ -0,0 +1 @@
theme.CollectionSidebar=function(){function e(e){this.$container=$(e),this.namespace=".collection-sidebar",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{_rangePrice:{init:function(){theme.RangeOfPrice&&theme.RangeOfPrice.init()},destroy:function(){theme.RangeOfPrice&&theme.RangeOfPrice.destroy()}},onLoad:function(){theme.StickySidebar&&theme.StickySidebar.init(this.$container,!0),this._rangePrice.init(),theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.ProductReview.update())},onUnload:function(){this.$container.off(this.namespace),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container,!0),this._rangePrice.destroy()}}),e}(),$(function(){theme.sections.register("collection-sidebar",theme.CollectionSidebar)});

View File

@@ -0,0 +1,43 @@
theme.Footbar = (function() {
function Footbar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.footbar';
this.onLoad();
};
Footbar.prototype = $.extend({}, Section.prototype, Footbar.prototype, {
onLoad: function() {
if(theme.Notifications) {
theme.Notifications.init(this.$container);
}
if(theme.ProductFootbar) {
theme.ProductFootbar.init(this.$container);
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Notifications) {
theme.Notifications.destroy(this.$container);
}
if(theme.ProductFootbar) {
theme.ProductFootbar.destroy();
}
}
});
return Footbar;
})();
$(function() {
theme.sections.register('footbar', theme.Footbar);
});

View File

@@ -0,0 +1 @@
theme.Footbar=function(){function t(t){this.$container=$(t),this.namespace=".footbar",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{onLoad:function(){theme.Notifications&&theme.Notifications.init(this.$container),theme.ProductFootbar&&theme.ProductFootbar.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),theme.Notifications&&theme.Notifications.destroy(this.$container),theme.ProductFootbar&&theme.ProductFootbar.destroy()}}),t}(),$(function(){theme.sections.register("footbar",theme.Footbar)});

View File

@@ -0,0 +1,153 @@
theme.Footer = (function() {
function Footer(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.footer';
this.onLoad();
};
Footer.prototype = $.extend({}, Section.prototype, Footer.prototype, {
_back_to_top: {
init: function(namespace) {
var _ = this,
$button = $('[data-js-button-back-to-top]'),
namespace = namespace + '.buttonToTop';
if($button.length) {
var bp = $button.attr('data-js-button-back-to-top') || 1000,
duration = function () {
return theme.animations.backtotop.scroll_duration * 1000;
},
is_animate = false,
unbind = true;
$(window).on('scroll' + namespace + ' resize' + namespace, function () {
var scroll_t = pageYOffset || Math.max($('body').scrollTop(), $('html').scrollTop());
if(!$button.attr('data-bind')) {
$button[scroll_t > bp ? 'addClass' : 'removeClass']('show');
}
if(scroll_t > bp && unbind) {
$button.removeAttr('data-bind');
}
});
$button.on('click', function(e) {
if(!is_animate) {
is_animate = true;
var bind = $button.attr('data-bind');
if(bind) {
$('html, body').velocity('stop').velocity( 'scroll' , {
offset: bind,
duration: duration(),
complete: function () {
$button.removeAttr('data-bind');
is_animate = false;
}
});
} else {
var scroll_t = pageYOffset || Math.max($('body').scrollTop(), $('html').scrollTop());
unbind = false;
$button.attr('data-bind', scroll_t);
$('html, body').velocity('stop').velocity( 'scroll' , {
offset: 0,
duration: duration(),
complete: function () {
is_animate = false;
unbind = true;
}
});
}
}
e.preventDefault();
e.stopPropagation();
return false;
});
this.destroy = function() {
$(window).unbind('scroll' + namespace + ' resize' + namespace);
$button.off();
delete _.destroy;
};
}
},
destroy: function() {
if(this.destroy) {
this.destroy();
}
}
},
_fixed: {
init: function ($footer, namespace) {
if($footer.length && $footer[0].hasAttribute('data-js-footer-fixed')) {
var $parent = $footer.parent(),
$main = $('#MainContent');
function calculate() {
var footer_height = $footer.innerHeight(),
can_fix = $main.innerHeight() > footer_height + window.innerHeight;
$footer[can_fix && theme.current.is_desktop ? 'addClass' : 'removeClass']('footer--fixed');
$footer.css({
width: theme.current.is_desktop && $parent.hasClass('container') ? $parent.width() + 'px' : ''
});
$main.css({
marginBottom: can_fix && theme.current.is_desktop ? footer_height + parseInt($footer.css('margin-top')) : ''
});
};
$window.on('theme.resize' + namespace, calculate);
calculate();
}
},
destroy: function (namespace) {
$window.unbind('theme.resize' + namespace);
}
},
onLoad: function() {
var $footer = $('.js-footer');
this._fixed.init($footer, this.namespace);
this._back_to_top.init(this.namespace);
if(theme.is_loaded) {
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
this._fixed.destroy(this.namespace);
this._back_to_top.destroy(this.namespace);
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return Footer;
})();
$(function() {
theme.sections.register('footer', theme.Footer);
});

View File

@@ -0,0 +1 @@
theme.Footer=function(){function t(t){this.$container=$(t),this.namespace=".footer",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_back_to_top:{init:function(t){var o=this,i=$("[data-js-button-back-to-top]");t+=".buttonToTop";if(i.length){var e=i.attr("data-js-button-back-to-top")||1e3,n=function(){return 1e3*theme.animations.backtotop.scroll_duration},s=!1,a=!0;$(window).on("scroll"+t+" resize"+t,function(){var t=pageYOffset||Math.max($("body").scrollTop(),$("html").scrollTop());i.attr("data-bind")||i[e<t?"addClass":"removeClass"]("show"),e<t&&a&&i.removeAttr("data-bind")}),i.on("click",function(t){if(!s){s=!0;var o=i.attr("data-bind");if(o)$("html, body").velocity("stop").velocity("scroll",{offset:o,duration:n(),complete:function(){i.removeAttr("data-bind"),s=!1}});else{var e=pageYOffset||Math.max($("body").scrollTop(),$("html").scrollTop());a=!1,i.attr("data-bind",e),$("html, body").velocity("stop").velocity("scroll",{offset:0,duration:n(),complete:function(){a=!(s=!1)}})}}return t.preventDefault(),t.stopPropagation(),!1}),this.destroy=function(){$(window).unbind("scroll"+t+" resize"+t),i.off(),delete o.destroy}}},destroy:function(){this.destroy&&this.destroy()}},_fixed:{init:function(e,t){if(e.length&&e[0].hasAttribute("data-js-footer-fixed")){var i=e.parent(),n=$("#MainContent");function o(){var t=e.innerHeight(),o=n.innerHeight()>t+window.innerHeight;e[o&&theme.current.is_desktop?"addClass":"removeClass"]("footer--fixed"),e.css({width:theme.current.is_desktop&&i.hasClass("container")?i.width()+"px":""}),n.css({marginBottom:o&&theme.current.is_desktop?t+parseInt(e.css("margin-top")):""})}$window.on("theme.resize"+t,o),o()}},destroy:function(t){$window.unbind("theme.resize"+t)}},onLoad:function(){var t=$(".js-footer");this._fixed.init(t,this.namespace),this._back_to_top.init(this.namespace),theme.is_loaded&&theme.Tooltip&&theme.Tooltip.init()},onUnload:function(){this.$container.off(this.namespace),this._fixed.destroy(this.namespace),this._back_to_top.destroy(this.namespace),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("footer",theme.Footer)});

View File

@@ -0,0 +1,78 @@
theme.Gallery = (function() {
function Gallery(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.gallery';
this.onLoad();
};
Gallery.prototype = $.extend({}, Section.prototype, Gallery.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Masonry) {
theme.Masonry.init(true);
}
}
var $gallery = $('.gallery'),
$fotorama = $gallery.find('.gallery__fotorama');
var fotorama = $fotorama.fotorama({
thumbmargin: 0,
thumbborderwidth: 0
}).data('fotorama');
$fotorama.addClass('d-none-important');
this.fotorama = fotorama;
$('.fotorama__arr--prev').append($('<i>').append(theme.Global.getIcon('006')));
$('.fotorama__arr--next').append($('<i>').append(theme.Global.getIcon('007')));
$('.fotorama__fullscreen-icon').append($('<i>').append(theme.Global.getIcon('164')));
$gallery.on('click', '.gallery__item', function () {
var index = $(this).attr('data-index'),
scroll_t = Math.max($html.scrollTop(), $body.scrollTop());
fotorama.show({
index: index,
time: 0
});
$fotorama.removeClass('d-none-important invisible position-absolute');
fotorama.requestFullScreen();
$html.scrollTop(scroll_t);
});
$fotorama.on('fotorama:fullscreenexit', function () {
$fotorama.addClass('d-none-important invisible position-absolute');
});
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Masonry) {
theme.Masonry.destroy();
}
if(this.fotorama) {
this.fotorama.destroy();
this.fotorama = null;
}
}
});
return Gallery;
})();
$(function() {
theme.sections.register('gallery', theme.Gallery);
});

View File

@@ -0,0 +1 @@
theme.Gallery=function(){function e(e){this.$container=$(e),this.namespace=".gallery",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Masonry&&theme.Masonry.init(!0));var e=$(".gallery"),t=e.find(".gallery__fotorama"),a=t.fotorama({thumbmargin:0,thumbborderwidth:0}).data("fotorama");t.addClass("d-none-important"),this.fotorama=a,$(".fotorama__arr--prev").append($("<i>").append(theme.Global.getIcon("006"))),$(".fotorama__arr--next").append($("<i>").append(theme.Global.getIcon("007"))),$(".fotorama__fullscreen-icon").append($("<i>").append(theme.Global.getIcon("164"))),e.on("click",".gallery__item",function(){var e=$(this).attr("data-index"),o=Math.max($html.scrollTop(),$body.scrollTop());a.show({index:e,time:0}),t.removeClass("d-none-important invisible position-absolute"),a.requestFullScreen(),$html.scrollTop(o)}),t.on("fotorama:fullscreenexit",function(){t.addClass("d-none-important invisible position-absolute")})},onUnload:function(){this.$container.off(this.namespace),theme.Masonry&&theme.Masonry.destroy(),this.fotorama&&(this.fotorama.destroy(),this.fotorama=null)}}),e}(),$(function(){theme.sections.register("gallery",theme.Gallery)});

View File

@@ -0,0 +1,345 @@
theme.Header = (function() {
var selectors = {
menu: '.js-menu'
};
function Header(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.header';
this.onLoad();
};
Header.prototype = $.extend({}, Section.prototype, Header.prototype, {
_tape: function () {
var $tape = this.$container.find('.js-header-tape'),
duration = function () {
return theme.animations.header_tape.duration * 1000;
};
if($tape.length) {
var $btn_close = $tape.find('[data-js-action="close"]'),
cookie = $.cookie('header-tape'),
show_once = $tape.attr('data-js-show-once'),
delay = +$tape.attr('data-js-delay'),
cookies_life = +$tape.attr('data-js-cookies-life');
if(cookie !== 'off') {
setTimeout(function () {
$tape.removeClass('d-none');
$tape.velocity('slideDown', {
duration: duration(),
complete: function () {
$tape.removeAttr('style');
}
});
}, delay * 1000);
$btn_close.on('click', function() {
if(show_once === 'true') {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('header-tape', 'off', {
expires: date,
path: '/'
});
}
$(this).off();
$tape.velocity('slideUp', {
duration: duration(),
complete: function () {
$tape.remove();
}
});
});
}
this._registerHansler($btn_close);
}
},
_menu: {
init: function(namespace) {
var $menu = $(selectors.menu);
if($menu.length) {
this.$menu = $menu;
this.api = theme.Menu.init($menu, {
namespace: namespace
});
}
},
destroy: function() {
if(this.api) {
this.$menu.unbind('mouseenter');
this.api.destroy();
this.api = null;
}
if(this.handler) {
this.handler.destroy();
}
}
},
_sticky: {
init: function() {
var $sticky = $('.js-header-sticky'),
sticky = $sticky.attr('data-js-sticky'),
need_sidebar = $sticky.attr('data-js-desktop-sticky-sidebar');
if($sticky.length) {
var params = {
bp: 1024
};
if(sticky === 'desktop_and_mobile' || sticky === 'desktop') {
$.extend(params, {
desktop: {
sticky: '[data-js-desktop-sticky]',
limit: 'bottom',
fade: true,
duration: function () {
return theme.animations.sticky_header.duration * 1000;
}
}
});
if(need_sidebar === 'true') {
$.extend(params.desktop, {
move: [
{
elem: '[data-js-sticky-replace-element="logo"]',
to: '[data-js-sticky-replace-here="logo"]'
},
{
elem: '[data-js-sticky-replace-element="cart"]',
to: '[data-js-sticky-replace-here="cart"]'
},
{
elem: '[data-js-sticky-replace-element="wishlist"]',
to: '[data-js-sticky-replace-here="wishlist"]'
},
{
elem: '[data-js-sticky-replace-element="compare"]',
to: '[data-js-sticky-replace-here="compare"]'
}
]
});
}
}
if(sticky === 'desktop_and_mobile' || sticky === 'mobile') {
$.extend(params, {
mobile: {
sticky: '[data-js-mobile-sticky]',
limit: 'bottom',
fade: false
}
});
}
if(theme.StickyHeader) {
this.api = theme.StickyHeader.init($sticky, params);
}
}
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
}
},
_languages: {
init: function() {
var _ = this;
$(window).on('load', function() {
var $languages = $('.js-languages-list'),
$weglot = $('.weglot-container').eq(0);
if($languages.length && $weglot.length) {
var $weglot_current = $weglot.find('.wgcurrent'),
$weglot_list = $weglot.find('ul'),
$header_current = $languages.find('.header__btn-language span'),
$header_list = $languages.find('ul');
_.$header_list = $header_list;
function insert() {
var current_html = $weglot_current.find('a').html(),
$span = $('<span>').html(current_html),
$li = $('<li>').addClass('active').attr('data-l', $weglot_current.attr('data-l')).append($span);
$header_current.html(current_html);
$header_list.html('').append($li);
$weglot_list.find('li').each(function() {
var $this = $(this),
$span = $('<span>').html($this.find('a').html()),
$li = $('<li>').attr('data-l', $this.attr('data-l')).append($span);
$header_list.append($li);
});
};
function update() {
var current_code = $weglot_current.attr('data-l'),
current_html = $weglot_current.find('a').html();
$header_current.html(current_html);
$header_list.find('li').removeClass('active').filter('[data-l="' + current_code + '"]').addClass('active');
};
insert();
$languages.removeClass('d-none-important');
$header_list.on('click', 'li:not(.active)', function() {
var $this = $(this);
$weglot_list.find('li[data-l="' + $this.attr('data-l') + '"] a').trigger('click');
update();
$this.parents('[data-js-dropdown]').trigger('hide');
});
}
});
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
if(this.$header_list) {
this.$header_list.off();
}
}
},
_currency: {
init: function(namespace) {
var $currencies = $('.js-currencies-list');
if($currencies.length && theme.ProductCurrency) {
var namespace = namespace + '.currencies',
$current_currency = $currencies.find('[data-current-currency]'),
cookieCurrency;
try {
cookieCurrency = Currency.cookie.read();
} catch(err) {}
function cheackList(currentCurrency) {
var active_button_name;
$currencies.find('li').each(function () {
var $this = $(this);
if ($this.data('currency-code') == currentCurrency) {
$this.addClass('active');
active_button_name = $this.attr('data-button-name') || currentCurrency;
} else {
$this.removeClass('active');
}
});
return active_button_name;
};
if(cookieCurrency != null && cookieCurrency !== Currency.shopCurrency) {
var button_name = cheackList(cookieCurrency);
$current_currency.html(button_name);
}
$currencies.on('click' + namespace, 'li', function (e) {
var $this = $(this);
if(!$this.hasClass('active')) {
var newCurrency = $this.data('currency-code'),
button_name = $this.attr('data-button-name') || newCurrency;
theme.ProductCurrency.setCurrency(newCurrency);
cheackList(newCurrency);
$current_currency.html(button_name);
if(theme.current.is_desktop) {
$this.parents('[data-js-dropdown]').trigger('hide');
} else {
theme.Popups.closeByName('navigation');
}
}
e.preventDefault();
return false;
});
this.api = {
destroy: function() {
$body.unbind('click' + namespace);
}
};
}
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
}
},
onLoad: function() {
if(theme.is_loaded) {
theme.Position.update('menu');
theme.Position.update('currency');
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
theme.StoreLists.updateHeaderCount();
this._menu.init(this.namespace);
this._sticky.init();
this._tape();
this._languages.init();
this._currency.init(this.namespace);
},
onUnload: function() {
this.$container.off(this.namespace);
this._offHanslers();
this._menu.destroy();
this._sticky.destroy();
this._languages.init();
this._currency.destroy();
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return Header;
})();
$(function() {
theme.sections.register('header', theme.Header);
});

View File

@@ -0,0 +1 @@
theme.Header=function(){var i=".js-menu";function t(t){this.$container=$(t),this.namespace=".header",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_tape:function(){var i=this.$container.find(".js-header-tape"),a=function(){return 1e3*theme.animations.header_tape.duration};if(i.length){var t=i.find('[data-js-action="close"]'),e=$.cookie("header-tape"),n=i.attr("data-js-show-once"),s=+i.attr("data-js-delay"),r=+i.attr("data-js-cookies-life");"off"!==e&&(setTimeout(function(){i.removeClass("d-none"),i.velocity("slideDown",{duration:a(),complete:function(){i.removeAttr("style")}})},1e3*s),t.on("click",function(){if("true"===n){var t=new Date,e=864e5*r;t.setTime(t.getTime()+e),$.cookie("header-tape","off",{expires:t,path:"/"})}$(this).off(),i.velocity("slideUp",{duration:a(),complete:function(){i.remove()}})})),this._registerHansler(t)}},_menu:{init:function(t){var e=$(i);e.length&&(this.$menu=e,this.api=theme.Menu.init(e,{namespace:t}))},destroy:function(){this.api&&(this.$menu.unbind("mouseenter"),this.api.destroy(),this.api=null),this.handler&&this.handler.destroy()}},_sticky:{init:function(){var t=$(".js-header-sticky"),e=t.attr("data-js-sticky"),i=t.attr("data-js-desktop-sticky-sidebar");if(t.length){var a={bp:1024};"desktop_and_mobile"!==e&&"desktop"!==e||($.extend(a,{desktop:{sticky:"[data-js-desktop-sticky]",limit:"bottom",fade:!0,duration:function(){return 1e3*theme.animations.sticky_header.duration}}}),"true"===i&&$.extend(a.desktop,{move:[{elem:'[data-js-sticky-replace-element="logo"]',to:'[data-js-sticky-replace-here="logo"]'},{elem:'[data-js-sticky-replace-element="cart"]',to:'[data-js-sticky-replace-here="cart"]'},{elem:'[data-js-sticky-replace-element="wishlist"]',to:'[data-js-sticky-replace-here="wishlist"]'},{elem:'[data-js-sticky-replace-element="compare"]',to:'[data-js-sticky-replace-here="compare"]'}]})),"desktop_and_mobile"!==e&&"mobile"!==e||$.extend(a,{mobile:{sticky:"[data-js-mobile-sticky]",limit:"bottom",fade:!1}}),theme.StickyHeader&&(this.api=theme.StickyHeader.init(t,a))}},destroy:function(){this.api&&(this.api.destroy(),this.api=null)}},_languages:{init:function(){var c=this;$(window).on("load",function(){var t,e,i,a=$(".js-languages-list"),n=$(".weglot-container").eq(0);if(a.length&&n.length){var s=n.find(".wgcurrent"),r=n.find("ul"),o=a.find(".header__btn-language span"),d=a.find("ul");c.$header_list=d,t=s.find("a").html(),e=$("<span>").html(t),i=$("<li>").addClass("active").attr("data-l",s.attr("data-l")).append(e),o.html(t),d.html("").append(i),r.find("li").each(function(){var t=$(this),e=$("<span>").html(t.find("a").html()),i=$("<li>").attr("data-l",t.attr("data-l")).append(e);d.append(i)}),a.removeClass("d-none-important"),d.on("click","li:not(.active)",function(){var t,e,i=$(this);r.find('li[data-l="'+i.attr("data-l")+'"] a').trigger("click"),t=s.attr("data-l"),e=s.find("a").html(),o.html(e),d.find("li").removeClass("active").filter('[data-l="'+t+'"]').addClass("active"),i.parents("[data-js-dropdown]").trigger("hide")})}})},destroy:function(){this.api&&(this.api.destroy(),this.api=null),this.$header_list&&this.$header_list.off()}},_currency:{init:function(t){var a=$(".js-currencies-list");if(a.length&&theme.ProductCurrency){t=t+".currencies";var e,n=a.find("[data-current-currency]");try{e=Currency.cookie.read()}catch(t){}function s(e){var i;return a.find("li").each(function(){var t=$(this);t.data("currency-code")==e?(t.addClass("active"),i=t.attr("data-button-name")||e):t.removeClass("active")}),i}if(null!=e&&e!==Currency.shopCurrency){var i=s(e);n.html(i)}a.on("click"+t,"li",function(t){var e=$(this);if(!e.hasClass("active")){var i=e.data("currency-code"),a=e.attr("data-button-name")||i;theme.ProductCurrency.setCurrency(i),s(i),n.html(a),theme.current.is_desktop?e.parents("[data-js-dropdown]").trigger("hide"):theme.Popups.closeByName("navigation")}return t.preventDefault(),!1}),this.api={destroy:function(){$body.unbind("click"+t)}}}},destroy:function(){this.api&&(this.api.destroy(),this.api=null)}},onLoad:function(){theme.is_loaded&&(theme.Position.update("menu"),theme.Position.update("currency"),theme.Tooltip&&theme.Tooltip.init()),theme.StoreLists.updateHeaderCount(),this._menu.init(this.namespace),this._sticky.init(),this._tape(),this._languages.init(),this._currency.init(this.namespace)},onUnload:function(){this.$container.off(this.namespace),this._offHanslers(),this._menu.destroy(),this._sticky.destroy(),this._languages.init(),this._currency.destroy(),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("header",theme.Header)});

View File

@@ -0,0 +1,176 @@
theme.HomeBuilder = (function() {
function HomeBuilder(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.home-builder';
this.onLoad();
};
HomeBuilder.prototype = $.extend({}, Section.prototype, HomeBuilder.prototype, {
onLoad: function() {
var _ = this,
$slider = this.$container.find('.rev_slider'),
$slider_02 = this.$container.find('.slider'),
$instafeed = this.$container.find('#instafeed'),
$promobox = this.$container.find('.promobox'),
$products = $('.product-featured');
$slider.each(function () {
var $this = $(this),
gridwidth = $this.data('gridwidth').split(','),
gridheight = $this.data('gridheight').split(','),
minheight = $this.data('minheight');
var revapi = $this.show().revolution({
sliderLayout: 'auto',
responsiveLevels: [1259, 1024, 777, 540],
gridwidth: [+gridwidth[0], +gridwidth[1], +gridwidth[2], +gridwidth[3]],
gridheight: [+gridheight[0], +gridheight[1], +gridheight[2], +gridheight[3]],
minHeight: minheight !== undefined ? minheight : false,
visibilityLevels:[1259, 1024, 777, 540],
delay: $this.data('delay') * 1000,
disableProgressBar: 'on',
lazyType: 'single',
spinner: 'none',
navigation: {
arrows: {
enable: $this.data('arrows'),
style: 'uranus',
hide_onleave: false
},
bullets: {
enable: $this.data('bullets'),
h_align: 'center',
v_align: 'bottom',
h_offset: 0,
v_offset: 74,
space: 24,
hide_onleave: false,
tmp: ''
},
touch: {
touchenabled: 'on'
}
},
parallax: {
type: 'mouse',
origo: 'slidercenter',
speed: 400,
levels: [2,4,6,8,10,12,14,16,18,20,25,30,35,40,45,50],
disable_onmobile: 'on'
}
});
_.$container.one('section.unload', function () {
revapi.revkill();
});
});
$slider_02.each(function() {
var $this = $(this),
$slick = $this.find('[data-js-slider-slick]'),
$prev = $this.find('[data-js-slider-prev]'),
$next = $this.find('[data-js-slider-next]'),
speed = +$slick.attr('data-speed') * 1000,
arrows = $slick.attr('data-arrows') === 'true' ? true : false,
bullets = $slick.attr('data-bullets') === 'true' ? true : false;
_.$slick = $slick;
$slick.on('init', function() {
$slick.removeClass('invisible');
theme.Loader.unset($slick.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-none d-lg-flex flex-wrap flex-center position-absolute list-unstyled mt-35',
adaptiveHeight: true,
autoplay: true,
autoplaySpeed: speed,
fade: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
rtl: theme.rtl
});
});
if($instafeed.length) {
var template = $($instafeed.find('template')[0].content).children().html();
var feed = new Instafeed({
get: 'user',
sortBy: 'most-liked',
resolution: "standard_resolution",
userId: $instafeed.data('userid'),
clientId: $instafeed.data('clientid'),
accessToken: $instafeed.data('accesstoken'),
limit: $instafeed.data('limit'),
template: template.replace(/{\\{/g, '{{').replace(/post-link/g, '{{link}}').replace(/post-image/g, '{{image}}'),
after: function () {
theme.ImagesLazyLoad.update();
}
});
$instafeed.html('').removeClass('d-none');
feed.run();
}
if(theme.Parallax && $promobox.length) {
theme.Parallax.init(_.$container.find('.js-parallax'));
}
if($promobox.length || $products.length) {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
if($products.length) {
if(theme.is_loaded) {
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
this.$container.trigger('section.unload');
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
}
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
if(theme.Parallax) {
theme.Parallax.destroy(this.$container.find('.js-parallax'));
}
}
});
return HomeBuilder;
})();
$(function() {
theme.sections.register('home-builder', theme.HomeBuilder);
});

View File

@@ -0,0 +1 @@
theme.HomeBuilder=function(){function e(e){this.$container=$(e),this.namespace=".home-builder",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var s=this,e=this.$container.find(".rev_slider"),t=this.$container.find(".slider"),i=this.$container.find("#instafeed"),a=this.$container.find(".promobox"),n=$(".product-featured");if(e.each(function(){var e=$(this),t=e.data("gridwidth").split(","),i=e.data("gridheight").split(","),a=e.data("minheight"),n=e.show().revolution({sliderLayout:"auto",responsiveLevels:[1259,1024,777,540],gridwidth:[+t[0],+t[1],+t[2],+t[3]],gridheight:[+i[0],+i[1],+i[2],+i[3]],minHeight:void 0!==a&&a,visibilityLevels:[1259,1024,777,540],delay:1e3*e.data("delay"),disableProgressBar:"on",lazyType:"single",spinner:"none",navigation:{arrows:{enable:e.data("arrows"),style:"uranus",hide_onleave:!1},bullets:{enable:e.data("bullets"),h_align:"center",v_align:"bottom",h_offset:0,v_offset:74,space:24,hide_onleave:!1,tmp:""},touch:{touchenabled:"on"}},parallax:{type:"mouse",origo:"slidercenter",speed:400,levels:[2,4,6,8,10,12,14,16,18,20,25,30,35,40,45,50],disable_onmobile:"on"}});s.$container.one("section.unload",function(){n.revkill()})}),t.each(function(){var e=$(this),t=e.find("[data-js-slider-slick]"),i=e.find("[data-js-slider-prev]"),a=e.find("[data-js-slider-next]"),n=1e3*+t.attr("data-speed"),o="true"===t.attr("data-arrows"),l="true"===t.attr("data-bullets");(s.$slick=t).on("init",function(){t.removeClass("invisible"),theme.Loader.unset(t.parent())}),t.slick({lazyLoad:!1,arrows:o,prevArrow:i,nextArrow:a,dots:l,dotsClass:"slick-dots d-none d-lg-flex flex-wrap flex-center position-absolute list-unstyled mt-35",adaptiveHeight:!0,autoplay:!0,autoplaySpeed:n,fade:!0,infinite:!0,slidesToShow:1,slidesToScroll:1,rtl:theme.rtl})}),i.length){var o=$(i.find("template")[0].content).children().html(),l=new Instafeed({get:"user",sortBy:"most-liked",resolution:"standard_resolution",userId:i.data("userid"),clientId:i.data("clientid"),accessToken:i.data("accesstoken"),limit:i.data("limit"),template:o.replace(/{\\{/g,"{{").replace(/post-link/g,"{{link}}").replace(/post-image/g,"{{image}}"),after:function(){theme.ImagesLazyLoad.update()}});i.html("").removeClass("d-none"),l.run()}theme.Parallax&&a.length&&theme.Parallax.init(s.$container.find(".js-parallax")),(a.length||n.length)&&theme.is_loaded&&theme.ImagesLazyLoad.update(),n.length&&theme.is_loaded&&(theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init())},onUnload:function(){this.$container.off(this.namespace),this.$container.trigger("section.unload"),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null),theme.Tooltip&&theme.Tooltip.destroy(),theme.Parallax&&theme.Parallax.destroy(this.$container.find(".js-parallax"))}}),e}(),$(function(){theme.sections.register("home-builder",theme.HomeBuilder)});

View File

@@ -0,0 +1,39 @@
theme.listCollections = (function() {
function listCollections(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.list-collections';
this.onLoad();
};
listCollections.prototype = $.extend({}, Section.prototype, listCollections.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Masonry) {
theme.Masonry.init(true);
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Masonry) {
theme.Masonry.destroy();
}
}
});
return listCollections;
})();
$(function() {
theme.sections.register('list-collections', theme.listCollections);
});

View File

@@ -0,0 +1 @@
theme.listCollections=function(){function t(t){this.$container=$(t),this.namespace=".list-collections",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Masonry&&theme.Masonry.init(!0))},onUnload:function(){this.$container.off(this.namespace),theme.Masonry&&theme.Masonry.destroy()}}),t}(),$(function(){theme.sections.register("list-collections",theme.listCollections)});

View File

@@ -0,0 +1,83 @@
theme.LookBook = (function() {
function LookBook(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.lookbook';
this.onLoad();
};
LookBook.prototype = $.extend({}, Section.prototype, LookBook.prototype, {
onLoad: function() {
var $items = this.$container.find('.lookbook__item');
theme.Global.responsiveHandler({
namespace: '.lookbook',
element: $items,
delegate: '[data-lookbook-picker-button]',
on_desktop: true,
events: {
'click': function() {
var $this = $(this),
$product = $this.parents('[data-lookbook-picker]').find('[data-lookbook-product]');
$this[$this.hasClass('open') ? 'removeClass' : 'addClass']('open');
$product[$this.hasClass('open') ? 'removeClass' : 'addClass']('d-none');
}
}
});
theme.Global.responsiveHandler({
namespace: '.lookbook',
element: $items,
delegate: '[data-lookbook-picker]',
on_desktop: true,
events: {
'mouseenter mouseleave': function(e) {
var $this = $(this),
$btn = $this.find('[data-lookbook-product-button]'),
$product = $this.find('[data-lookbook-product]');
if(!$btn.hasClass('open')) {
$product[e.type === 'mouseenter' ? 'removeClass' : 'addClass']('d-none');
}
}
}
});
theme.Global.responsiveHandler({
namespace: '.lookbook',
element: $items,
delegate: '[data-lookbook-product-close]',
on_desktop: true,
events: {
'click': function() {
$(this).parents('[data-lookbook-picker]').find('[data-lookbook-picker-button]').addClass('open').trigger('click');
}
}
});
if($items.length && theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
this.$container.trigger('section.unload');
this.$container.find('.lookbook__item').unbind();
}
});
return LookBook;
})();
$(function() {
theme.sections.register('lookbook', theme.LookBook);
});

View File

@@ -0,0 +1 @@
theme.LookBook=function(){function o(o){this.$container=$(o),this.namespace=".lookbook",this.onLoad()}return o.prototype=$.extend({},Section.prototype,o.prototype,{onLoad:function(){var o=this.$container.find(".lookbook__item");theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-picker-button]",on_desktop:!0,events:{click:function(){var o=$(this),e=o.parents("[data-lookbook-picker]").find("[data-lookbook-product]");o[o.hasClass("open")?"removeClass":"addClass"]("open"),e[o.hasClass("open")?"removeClass":"addClass"]("d-none")}}}),theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-picker]",on_desktop:!0,events:{"mouseenter mouseleave":function(o){var e=$(this),t=e.find("[data-lookbook-product-button]"),n=e.find("[data-lookbook-product]");t.hasClass("open")||n["mouseenter"===o.type?"removeClass":"addClass"]("d-none")}}}),theme.Global.responsiveHandler({namespace:".lookbook",element:o,delegate:"[data-lookbook-product-close]",on_desktop:!0,events:{click:function(){$(this).parents("[data-lookbook-picker]").find("[data-lookbook-picker-button]").addClass("open").trigger("click")}}}),o.length&&theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace),this.$container.trigger("section.unload"),this.$container.find(".lookbook__item").unbind()}}),o}(),$(function(){theme.sections.register("lookbook",theme.LookBook)});

View File

@@ -0,0 +1,31 @@
theme.PasswordPageContent = (function() {
function PasswordPageContent(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.password-page-content';
this.onLoad();
};
PasswordPageContent.prototype = $.extend({}, Section.prototype, PasswordPageContent.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
}
});
return PasswordPageContent;
})();
$(function() {
theme.sections.register('password-page-content', theme.PasswordPageContent);
});

View File

@@ -0,0 +1 @@
theme.PasswordPageContent=function(){function e(e){this.$container=$(e),this.namespace=".password-page-content",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace)}}),e}(),$(function(){theme.sections.register("password-page-content",theme.PasswordPageContent)});

View File

@@ -0,0 +1,93 @@
theme.ProductPage = (function() {
function ProductPage(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.product-page';
this.onLoad();
}
ProductPage.prototype = $.extend({}, ProductPage.prototype, {
onLoad: function () {
var $product = this.$container.find('[data-js-product]'),
$gallery = $product.find('[data-js-product-gallery]'),
$countdown = $product.find('[data-js-product-countdown] .js-countdown'),
$text_countdown = $product.find('.js-text-countdown'),
$visitors = $product.find('.js-visitors');
if($gallery.length) {
this.$gallery = $gallery;
if(this.$gallery.find('[data-js-product-gallery-main]').attr('data-js-product-gallery-main') === 'mobile') {
function initGallery() {
if(theme.current.is_mobile) {
theme.ProductGallery.init($gallery);
}
};
$window.on('theme.resize', initGallery);
initGallery();
} else {
theme.ProductGallery.init($gallery);
}
}
if(theme.is_loaded) {
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
if($countdown.length) {
theme.ProductCountdown.init($countdown);
}
if($text_countdown.length) {
theme.ProductTextCountdown.init($text_countdown);
}
if($visitors.length) {
theme.ProductVisitors.init($visitors);
}
theme.StoreLists.checkProductStatus($product);
if(theme.Tabs) {
theme.Tabs.init();
}
}
if(theme.StickySidebar) {
theme.StickySidebar.init(this.$container);
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$gallery && this.$gallery.length) {
theme.ProductGallery.destroy(this.$gallery);
this.$gallery = null;
}
if(theme.StickySidebar) {
theme.StickySidebar.destroy(this.$container);
}
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return ProductPage;
})();
$(function() {
theme.sections.register('product-page', theme.ProductPage);
});

View File

@@ -0,0 +1 @@
theme.ProductPage=function(){function t(t){this.$container=$(t),this.namespace=".product-page",this.onLoad()}return t.prototype=$.extend({},t.prototype,{onLoad:function(){var t=this.$container.find("[data-js-product]"),e=t.find("[data-js-product-gallery]"),i=t.find("[data-js-product-countdown] .js-countdown"),o=t.find(".js-text-countdown"),n=t.find(".js-visitors");if(e.length)if(this.$gallery=e,"mobile"===this.$gallery.find("[data-js-product-gallery-main]").attr("data-js-product-gallery-main")){function r(){theme.current.is_mobile&&theme.ProductGallery.init(e)}$window.on("theme.resize",r),r()}else theme.ProductGallery.init(e);theme.is_loaded&&(theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init(),i.length&&theme.ProductCountdown.init(i),o.length&&theme.ProductTextCountdown.init(o),n.length&&theme.ProductVisitors.init(n),theme.StoreLists.checkProductStatus(t),theme.Tabs&&theme.Tabs.init()),theme.StickySidebar&&theme.StickySidebar.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),this.$gallery&&this.$gallery.length&&(theme.ProductGallery.destroy(this.$gallery),this.$gallery=null),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("product-page",theme.ProductPage)});

View File

@@ -0,0 +1,37 @@
theme.SliderRevolution = (function() {
function SliderRevolution(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.slider-revolution';
this.onLoad();
};
SliderRevolution.prototype = $.extend({}, Section.prototype, SliderRevolution.prototype, {
onLoad: function() {
try {
this.revapi = page.RevolutionInit();
} catch(e) {
console.log('JavaScript Error', e);
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.revapi) {
this.revapi.revkill();
}
}
});
return SliderRevolution;
})();
$(function() {
theme.sections.register('slider-revolution', theme.SliderRevolution);
});

View File

@@ -0,0 +1 @@
theme.SliderRevolution=function(){function t(t){this.$container=$(t),this.namespace=".slider-revolution",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{onLoad:function(){try{this.revapi=page.RevolutionInit()}catch(t){console.log("JavaScript Error",t)}},onUnload:function(){this.$container.off(this.namespace),this.revapi&&this.revapi.revkill()}}),t}(),$(function(){theme.sections.register("slider-revolution",theme.SliderRevolution)});

View File

@@ -0,0 +1,40 @@
theme.SortingCollections = (function() {
function SortingCollections(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.sorting-collections';
this.onLoad();
};
SortingCollections.prototype = $.extend({}, Section.prototype, SortingCollections.prototype, {
onLoad: function() {
var $control = this.$container.find('[data-sorting-collections-control]'),
$products = this.$container.find('[data-sorting-collections-items]'),
xhr = null;
this.$control = $control;
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
this.$control.off();
}
});
return SortingCollections;
})();
$(function() {
theme.sections.register('sorting-collections', theme.SortingCollections);
});

Some files were not shown because too many files have changed in this diff Show More