From 0094ae476db509a7c2ebb32adbfe6b2cbcb57873 Mon Sep 17 00:00:00 2001 From: yarik Date: Fri, 2 Sep 2016 16:39:17 +0300 Subject: [PATCH] JS fixes. --- frontend/assets/AppAsset.php | 4 ++-- frontend/views/catalog/product.php | 11 ++--------- frontend/views/layouts/main.php | 2 -- frontend/web/js/js_footer.js | 798 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ frontend/web/js/js_head.js | 3233 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- frontend/web/js/script.js | 2 -- 6 files changed, 4 insertions(+), 4046 deletions(-) diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 39bf07e..6c77713 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -23,7 +23,7 @@ class AppAsset extends AssetBundle 'http://fonts.googleapis.com/css?family=Roboto:400,300,700&subset=latin,cyrillic-ext', ]; public $js = [ - 'js/js_head.js', + //'js/js_head.js', //'js/js_footer.js', '/js/artbox_basket.js', 'js/script.js', @@ -31,7 +31,7 @@ class AppAsset extends AssetBundle public $depends = [ 'yii\web\JqueryAsset', 'sersid\owlcarousel\Asset', - + 'yii\bootstrap\BootstrapPluginAsset', ]; public function init() { diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php index 2ff122d..6b37759 100755 --- a/frontend/views/catalog/product.php +++ b/frontend/views/catalog/product.php @@ -4,7 +4,7 @@ use common\components\artboximage\ArtboxImageHelper; use frontend\assets\FotoramaAsset; use frontend\widgets\Seo; use common\modules\comment\widgets\CommentWidget; -FotoramaAsset::register($this); +//FotoramaAsset::register($this); $this->params[ 'seo' ][ 'key' ] = $category->name; $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $product->fullname; $this->params[ 'seo' ][ 'h1' ] = !empty( Seo::widget([ 'row' => 'h1' ]) ) ? Seo::widget([ 'row' => 'h1' ]) : $product->fullname; @@ -542,11 +542,4 @@ $this->params[ 'breadcrumbs' ][] = $product->fullname . ' #' . $product->enabled

-
- - - - - - - +
beginPage () ?> diff --git a/frontend/web/js/js_footer.js b/frontend/web/js/js_footer.js index a00dad9..e69de29 100755 --- a/frontend/web/js/js_footer.js +++ b/frontend/web/js/js_footer.js @@ -1,798 +0,0 @@ -var ga_exist = false; -console.log('GA: ' + typeof ga); -if (typeof ga == "undefined") { - console.log('GA is not function and not detected'); -} -$(".btn-product-details").click(function(e) { - var raw_data = $(this).closest(".item_container").attr("data-json"); - if (!is_undef(raw_data) && raw_data != '') { - if (e.preventDefault) e.preventDefault(); - if (e.stopPropagation) e.stopPropagation(); - e.cancelBubble = true; - e.returnValue = false; - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - ga('ec:addProduct', { - 'id': data.id, - 'name': data.model, - 'category': data.categoryPath, - 'brand': data.brand, - 'prodType': data.prod_type, - 'position': data.posIndex - }); - ga('ec:setAction', 'click', { - 'list': data.listType - }); - var tmp_url = data.url; - if (ga.hasOwnProperty('loaded') && ga.loaded === true) { - ga('send', 'event', { - 'eventCategory': 'UX', - 'eventAction': 'productDetailsClick', - 'eventLabel': tmp_url, - 'eventValue': 1, - 'hitCallback': function() { - console.log(tmp_url); - document.location = data.url; - } - }); - } else { - console.log('No GA'); - document.location = tmp_url; - } - } -}); -$(document).ready(function() { - console.log('Ready GA: ' + typeof ga); - ga_exist = (typeof ga === "function"); - $('.catalog_item .item_container').each(function() { - var raw_data = $(this).attr("data-json"); - if (!is_undef(raw_data) && raw_data != '') { - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - ga('ec:addImpression', { - 'id': data.id, - 'name': data.model, - 'category': data.categoryPath, - 'brand': data.brand, - 'prodType': data.prod_type, - 'list': data.listType, - 'position': data.posIndex - }); - } - }); -}); - -function ga_cart_remove(raw_data) { - if (!is_undef(raw_data) && raw_data != '') { - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - console.log('remove data:', data); - ga('ec:addProduct', { - 'id': data.id, - 'name': data.model, - 'price': data.price, - 'brand': data.brand, - 'category': data.categoryPath, - 'prodType': data.prod_type, - 'position': data.position, - 'quantity': $("input[id=qty_" + data.id + ']').val() - }); - ga("ec:setAction", "remove"); - ga("send", "event", "UX", "click", "removeFromCart"); - } -} - -function ga_cart_add(raw_data) { - if (!is_undef(raw_data) && raw_data != '') { - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - console.log('add data:', data); - var modalBox = $('#buyForm'); - ga('ec:addProduct', { - 'id': data.id, - 'name': data.model, - 'category': data.categoryPath, - 'brand': data.brand, - 'prodType': data.prod_type, - 'price': data.price, - 'quantity': $("input.prod_count", modalBox).val() - }); - ga('ec:setAction', 'add'); - ga('send', 'event', 'UX', 'click', 'addToCart'); - } -} - -function ga_order_preview() { - var is_cart_empty = 1; - $('.order_item').each(function() { - var raw_data = $(this).attr("data-json"); - if (!is_undef(raw_data) && raw_data != '') { - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - console.log('add data:', data); - ga('ec:addProduct', { - 'id': data.id, - 'name': data.model, - 'price': data.price, - 'brand': data.brand, - 'category': data.categoryPath, - 'prodType': data.prod_type, - 'position': data.position, - 'quantity': $("input[id=qty_" + data.id + ']').val() - }); - is_cart_empty = 0; - } - }); - if (is_cart_empty == 0) - ga("ec:setAction", "checkout", { - "step": 1 - }); -} - -function ga_order_submit() { - var is_cart_empty = 1; - $('.order_item').each(function() { - var raw_data = $(this).attr("data-json"); - if (!is_undef(raw_data) && raw_data != '') { - var raw_data = decodeURIComponent(raw_data); - var data = JSON.parse(raw_data); - console.log('add data:', data); - ga('ec:addProduct', { - 'id': data.id, - 'name': data.model, - 'price': data.price, - 'brand': data.brand, - 'category': data.categoryPath, - 'prodType': data.prod_type, - 'position': data.position, - 'quantity': $("input[id=qty_" + data.id + ']').val() - }); - is_cart_empty = 0; - } - }); -}; -var cart_items = new Array(); -var debug_cart = false; -debug_cart = true; -$(document).ready(function() { - $('.buy_button').on('click', function() { - var cart = $('#top-cart'); - var modalBox = $('#buyForm'); - if (!$(this).hasClass("btn-large") && !$(this).hasClass("btnBuy")) { - var imgtodrag = $(this).parent().parent('.img').find("img").eq(0); - } - if (typeof imgtodrag == 'object' && typeof imgtodrag.offset() !== 'undefined') { - var imgclone = imgtodrag.clone().offset({ - top: imgtodrag.offset().top, - left: imgtodrag.offset().left - }).css({ - 'opacity': '0.5', - 'position': 'absolute', - 'height': '150px', - 'width': '150px', - 'z-index': '100' - }).appendTo($('body')).animate({ - 'top': cart.offset().top + 10, - 'left': cart.offset().left + 10, - 'width': 75, - 'height': 75 - }, 1000, 'easeInOutExpo'); - setTimeout(function() { - cart.effect("shake", { - times: 2 - }, 200); - }, 1500); - imgclone.animate({ - 'width': 0, - 'height': 0 - }, function() { - $(this).detach() - }); - } - var prod_id = $(this).prop('lang'); - console.log('prod_id:' + prod_id); - $("#prod_id", modalBox).val(prod_id); - var prod_count = 0; - if (typeof cart_items[prod_id] !== 'undefined') prod_count = parseInt(cart_items[prod_id]); - if (debug_cart) console.log(cart_items[prod_id] + 'prod_count:' + prod_count); - $("input.prod_count", modalBox).val(prod_count); - $('.plus', modalBox).click(); - - - $(".tovar .title", modalBox).html('hfdhfg'); - - - $(".total_prod", modalBox).html('hgjhgjghk'); - update_count_basket(4, 54); - - //save_cart($("#prod_id", modalBox).val(), $("input.prod_count", modalBox).val()); - $(this).html('Купить еще'); - if (ga_exist) { - var raw_data = $(this).closest(".item_container").attr("data-json"); - ga_cart_add(raw_data); - } - }); - $.mask.definitions['~'] = '[+-]'; - $('.customerphone, .phone').mask('+380 (99) 999-99-99', { - completed: function() { - $("button, .btn", $(this).parent()).removeClass('disabled'); - } - }); - $('.phone_short').mask('(099)999-99-99', { - completed: function() { - $("button, .btn", $(this).parent()).removeClass('disabled'); - } - }); - $('#buy_back_call_submit').bind('click', function() { - var modalBox = $('#buyForm'); - var prod_id = $("#prod_id", modalBox).val(); - var phone_el = $("input[name=customerphone]", modalBox); - var tmp_phone = $(phone_el).val(); - if (empty(tmp_phone)) { - $(phone_el).focus(); - alert('Пожалуйста введите номер телефона!'); - } else { - send_feedback(tmp_phone, 'prod_id:' + prod_id, { - 'type': 'fastOrder' - }); - } - if (debug_cart) - console.log(prod_id); - }); - $('.fast_order_form .btn').bind('click', function() { - var modalBox = $('#buyForm'); - var phone_el = $(".fast_order_form input[name=phone]"); - var tmp_phone = $(phone_el).val(); - var prod_id = $(this).prop('lang'); - if (empty(tmp_phone)) { - $(phone_el).focus(); - alert('Пожалуйста введите номер телефона!'); - } else { - if (typeof ga == "function") ga('send', 'event', 'Карточка товара', 'Купить в 1 клик'); - send_feedback(tmp_phone, 'prod_id:' + prod_id, { - 'type': 'fastOrder' - }); - } - }); -}); - -function save_cart(prod_id, prod_count, sender) { - var cart = $('#top-cart'); - var modalBox = $('#buyForm'); - if (!sender) sender = modalBox; - cart_items[prod_id] = prod_count; - JsHttpRequest.query('hr_gate.php?test=500&r=' + Math.random(), { - 'sp': "prod_in_basket", - 'prod_id': prod_id, - 'prod_count': prod_count - }, function(result, errors) { - if (errors) console.log('Errors: ' + errors); - if (result) { - if (debug_cart) - console.log(result); - if (result.prod_info) { - var prod = result.prod_info; - if (debug_cart) console.log(prod); - if (typeof prod === 'object') { - var modelTitle = ((prod.prod_type) ? prod.prod_type + '
' : '') + prod.brand + ' ' + prod.model; - $(".tovar .title", modalBox).html(modelTitle); - var tmp_count = parseInt($("input.prod_count", sender).val()); - if (debug_cart) console.log('count: ' + tmp_count); - $(".total_prod", sender).html(format_money(tmp_count * parseFloat(prod.price))); - if (prod.photo_path) { - var photo = prod.photo_path; - if (debug_cart) console.log('photo: ' + photo); - $(".tovar img", modalBox).prop('src', photo); - } - } - } - if (result.count_prod && result.total_sum) { - update_count_basket(result.count_prod, result.total_sum); - } - } - }, true); -} - -function update_count_basket(count, sum) { - console.log(count + ' s:' + sum); - var cart = $('#top-cart'); - var modalBox = $('#buyForm'); - if (count > 0) { - var sum_str = format_money(sum); - cart.find('.btn.btn-cart').addClass('not_empty'); - cart.find('#top-cart-content').html('В корзине' + count + ' товар' + ((count > 4) ? 'ов' : ((count > 1) ? 'а' : '')) + '
на ' + sum_str + '
оформить покупку
'); - $(".cart_count", modalBox).html(count); - $(".cart_total").html(sum_str); - } else { - cart.find('.btn.btn-cart').removeClass('not_empty'); - cart.find('#top-cart-content').html('

Корзина пуста

'); - $(".cart_count", modalBox).html('--'); - $(".cart_total").html('--'); - } - if (sum < 1000) var free_delivery = "Для бесплатной доставки осталось добавить в заказ товаров на " + format_money(1000 - sum) + " "; - else var free_delivery = "Бесплатная доставка!!!"; - $('.dostavka').html(free_delivery + '

'); -}; -jQuery(function($) {}); - -function send_feedback(tel, reason, opt) { - var feedback_type = ''; - if (opt && opt.type) feedback_type = opt.type; - console.log(tel + ' | ' + reason + ' | ' + opt); - if (typeof ga == "function") ga('send', 'event', 'callback', 'click'); - JsHttpRequest.query('hr_gate.php?test=500&r=' + Math.random(), { - 'sp': "callback", - 'tel': tel, - 'feedback_type': feedback_type, - 'reason': reason, - 'href': location.href - }, function(result, errors) { - if (errors) console.log('errors: ' + errors); - var msg = ''; - if (result) { - $('#errormessage').hide(); - msg = 'Спасибо за обращение. Наши менеджеры свяжуться с Вами в ближайшее время'; - } else { - $('#errormessage').hide(); - msg = 'Извините. Сервис временно не доступен'; - } - alert(msg); - }, true); -} -$(document).ready(function() { - $('#header_feedback .btn').click(function(event) { - tel = $('#header_feedback input[name=phone]').val(); - var reason = ''; - console.log('callback :: tel:' + tel + ' reason: ' + reason); - if (tel == '') { - $('#errormessage').show(); - console.log('feedback error'); - } else { - $('#errormessage').hide(); - send_feedback(tel, reason); - } - }); -});; - -function onRegistrationFormSubmit(form) { - if (!empty(form)) { - form.submit(); - return true; - $("#botmena").click(); - result_msg = "Успешно зарегистрирован!"; - $().message(result_msg); - } else alert('Form empty'); - return false; -} -$(document).ready(function() {});; -jQuery(function($) { - $.mask.definitions['~'] = '[+-]'; - $('#pc_phone').mask('+380 (99) 999-99-99'); - $('#pc_code').mask('9999'); -}); -$(document).ready(function() { - $('#btnPromoBuy').click(function(event) { - login = $('#popup_getpromoprod #pc_login').val(); - phone = $('#popup_getpromoprod #pc_phone').val(); - code = $('#popup_getpromoprod #pc_code').val(); - err_msg = $('#popup_getpromoprod #errormessage'); - err_msg_promo = $('#popup_getpromoprod #errormessagepromo'); - $(err_msg_promo).hide(); - if (empty(login) || empty(phone) || empty(code)) { - $(err_msg).show(); - return; - } else if (!in_array(code, new Array(1001, 2002, 3003, 4004))) { - $(err_msg_promo).show(); - return; - } else { - $(err_msg).hide(); - JsHttpRequest.query('hr_gate.php?test=500&r=' + Math.random(), { - 'sp': "promoprod", - 'login': login, - 'phone': phone, - 'code': code, - 'href': location.href - }, function(result, errors) { - if (errors) alert(errors); - if (result) { - $(err_msg).hide(); - $('#promoprodTbl').html('

Ваша заявка принята. Ваш код "' + result.code + '"
В ближайшее время менеджер с Вами свяжется.

'); - } else { - $(err_msg).hide(); - $('#promoprodTbl').html('

Извините.
Сервис временно не доступен

'); - } - }, true); - } - }); -});; -$(document).ready(function() { - $('#toogle_seo_text').after('Развернуть текст'); - $('#toogle_seo_text').css('display', 'none'); - $('#toogle_seo_button').click(function() { - if ($('#toogle_seo_text').is(":hidden")) { - $('#toogle_seo_text').show(1500); - $('#toogle_seo_button').html("Свернуть текст"); - } else { - $('#toogle_seo_text').hide(1500); - $('#toogle_seo_button').html("Развернуть текст"); - } - }); -});; -$(document).ready(function() { - $('a:not([href-data=""])').each(function() { - $(this).attr('href', $(this).attr('href-data')); - }); -});; -var compareWindow; -var new_window = ''; -var name_cookie = 'compare_id'; -$(document).ready(function() { - $("a.compare_href, a.compare_menu, a.compare_delete_basket").css('display', "inline"); - check_id_compare(); - var a; - if (getCookie(name_cookie)) a = explode(',', getCookie(name_cookie)); - if (a) { - $('a.compare_menu').html("В корзине сравнения: " + a.length + " тов."); - $('a.compare_basket').html('Сравнить товары (' + a.length + ' шт.)').attr('href', '?p=compare&' + name_cookie + '=' + getCookie(name_cookie)); - $('a.compare_delete_basket').html('').attr('href', ""); - } - $('a.compare_menu').bind('click', function() { - if (getCookie(name_cookie)) a = explode(',', getCookie(name_cookie)); - if ($.cookie(name_cookie)) { - compareWindow = open('?p=compare&' + name_cookie + '=' + getCookie(name_cookie), 'compareWindow', 'scrollbars=1'); - } - }); - $('a.close_compare').bind('click', function() { - window.close(); - }); - $('a.compare_delete').bind('click', function() { - var t = get_current_compare($(this).attr('name')); - if (t['data']) { - set_cookie(name_cookie, t['data']); - $(this).attr('href', '?p=compare&' + name_cookie + '=' + t['data']); - if (window.opener && !window.opener.closed) window.opener.check_id_compare(); - } else { - set_cookie(name_cookie, ";"); - if (window.opener && !window.opener.closed) window.opener.check_id_compare(); - window.close(); - delete(compareWindow); - } - }); - $('a.compare_delete_basket').bind('click', function() { - set_cookie(name_cookie, ";"); - $('a.compare_menu').html('Сравнить товары (0 шт.)'); - $('a.go_to_compare').each(function() { - if ($(this).attr('lang')) $(this).html("Сравнить"); - else $(this).html("Сравнить товар"); - $(this).attr('class', 'compare_href'); - $(this).unbind(); - bind_event_compare(); - }); - return false; - }); - $('a.compare_zakaz').bind('mouseover', function() { - var id_img = $(this).attr('name'); - $('img#' + id_img).attr('src', '/images/compare/basket_h.png'); - }); - $('a.compare_zakaz').bind('mouseout', function() { - var id_img = $(this).attr('name'); - $('img#' + id_img).attr('src', '/images/compare/basket.png'); - }); -}); - -function bind_event_compare() { - $('a.compare_href').bind('click', function() { - var length = set_cookie_s(name_cookie, $(this).attr('name')); - $('a.compare_menu').html("В корзине сравнения: " + length + " тов.") - $('a.compare_delete_basket').html('').attr('href', ""); - check_id_compare(); - compareWindow = openWindowAdv('?p=compare&' + name_cookie + '=' + getCookie(name_cookie), 'compareWindow'); - return false; - }); -} - -function check_id_compare() { - var a; - if (getCookie(name_cookie)) a = explode(',', getCookie(name_cookie)); - if (a) { - $('a.compare_href').each(function() { - if ($.inArray($(this).attr('name'), a) > -1) { - $(this).html('К сравнению'); - $(this).attr('class', 'go_to_compare compare'); - $(this).unbind(); - $(this).bind('click', function() { - compareWindow = openWindowAdv('?p=compare&' + name_cookie + '=' + getCookie(name_cookie), 'compareWindow'); - }); - } else { - if ($(this).attr('lang')) $(this).html("Сравнить"); - else $(this).html("Сравнить товар"); - } - }); - $('a.go_to_compare').each(function() { - if ($.inArray($(this).attr('name'), a) < 0) { - $(this).unbind(); - if ($(this).attr('lang')) $(this).html("Сравнить"); - else $(this).html("Сравнить товар"); - $(this).attr('class', 'compare_href'); - } else { - $(this).unbind(); - $(this).bind('click', function() { - compareWindow = openWindowAdv('?p=compare&' + name_cookie + '=' + getCookie(name_cookie), 'compareWindow'); - }); - } - }); - $('a.compare_menu').html("В корзине сравнения: " + a.length + " тов."); - } else { - $('a.compare_menu').html("В корзине сравнения: 0 тов."); - $('a.go_to_compare').each(function() { - $(this).unbind(); - if ($(this).attr('lang')) $(this).html("Сравнить"); - else $(this).html("Сравнить товар"); - $(this).attr('class', 'compare_href'); - }); - } - bind_event_compare(); -} - -function get_current_compare(delete_prod_number) { - var a; - if (getCookie(name_cookie)) a = explode(',', getCookie(name_cookie)); - var d = ''; - var x = 0; - if (a) { - for (var b = 0; b < a.length; b++) { - if (a[b] != delete_prod_number) { - d += a[b] + ','; - x++; - } - } - var data = []; - data['count'] = x; - data['data'] = d.substr(0, d.length - 1); - return data; - } else { - return ''; - } -} - -function set_cookie_s(name, value) { - var a = Array(0); - if (getCookie(name)) a = explode(',', getCookie(name)); - a.push(value); - var len = unique(a); - set_cookie(name, implode(',', len)); - return len.length; -} - -function set_cookie(name, value) { - if (empty(name)) return; - var cookie_clause = name + "=" + value; - if (window.opener && !window.opener.closed) { - try { - window.opener.document.cookie = cookie_clause; - } catch (e) { - document.cookie = cookie_clause; - } - } else document.cookie = cookie_clause; - return true; -} - -function getCookie(name) { - if (window.opener && !window.opener.closed) { - try { - var cookie = " " + window.opener.document.cookie; - } catch (e) { - var cookie = " " + document.cookie; - } - } else var cookie = " " + document.cookie; - var search = " " + name + "="; - var setStr = null; - var offset = 0; - var end = 0; - if (cookie.length > 0) { - offset = cookie.indexOf(search); - if (offset != -1) { - offset += search.length; - end = cookie.indexOf(";", offset) - if (end == -1) { - end = cookie.length; - } - setStr = unescape(cookie.substring(offset, end)); - } - } - return (setStr); -} - -function implode(glue, pieces) { - return ((pieces instanceof Array) ? pieces.join(glue) : pieces); -} - -function explode(delimiter, string, limit) { - var emptyArray = { - 0: '' - }; - if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') { - return null; - } - if (delimiter === '' || delimiter === false || delimiter === null) { - return false; - } - if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') { - return emptyArray; - } - if (delimiter === true) { - delimiter = '1'; - } - if (!limit) { - return string.toString().split(delimiter.toString()); - } else { - var splitted = string.toString().split(delimiter.toString()); - var partA = splitted.splice(0, limit - 1); - var partB = splitted.join(delimiter.toString()); - partA.push(partB); - return partA; - } -} - -function unique(arrayName) { - var newArray = new Array(); - label: for (var i = 0; i < arrayName.length; i++) { - for (var j = 0; j < newArray.length; j++) { - if (newArray[j] == arrayName[i]) continue label; - } - newArray[newArray.length] = arrayName[i]; - } - return newArray; -} - -function openWindowAdv(url, wnd) { - var theName = null; - theName = wnd; - eval('var wind=' + wnd + ';'); - if (!theName || theName.closed || !is_object(wind) || wind.closed) { - var windowHeight, windowWidth, windowTop, windowLeft; - windowHeight = $(window).height(); - windowWidth = $(window).width(); - windowTop = 0; - windowLeft = 0; - var varStore = ""; - varStore = varStore + "width=" + windowWidth; - varStore = varStore + ",height=" + windowHeight; - varStore = varStore + ",resizable=" + "1"; - varStore = varStore + ",scrollbars=" + "1"; - varStore = varStore + ",menubar=" + "0"; - varStore = varStore + ",toolbar=" + "0"; - varStore = varStore + ",directories=" + "0"; - varStore = varStore + ",location=" + "0"; - varStore = varStore + ",status=" + "0"; - varStore = varStore + ",left=" + windowLeft; - varStore = varStore + ",top=" + windowTop; - varStore = varStore + ",ScreenX=" + windowLeft; - varStore = varStore + ",ScreenY=" + windowTop; - wind = window.open(url, theName, varStore) - wind.focus(); - } else { - wind.focus(); - } - return wind; -}; -$(document).ready(function() { - var count = 5; - var def_val = 0; - var title_txt = "Поставить "; - $('div.rate').each(function() { - var id_prod = 0; - var param = $(this).attr('name').split(','); - for (q in param) { - var data = param[q].split('.'); - if (data[0] == 'count') count = data[1]; - if (data[0] == 'def_val') def_val = data[1]; - if (data[0] == 'id_prod') id_prod = data[1]; - } - render($(this), count, def_val, id_prod); - }); - - function render(elem, c, v, id_prod) { - $(elem).html(''); - var color; - if (v < 0) { - color = 'red'; - $('span[name=rate_' + id_prod + ']').html(v); - } else { - color = 'green'; - $('span[name=rate_' + id_prod + ']').html('+' + v); - } - var pos = position_start(c, v); - var counter = Math.abs(v); - for (var x = 0; x < (c * 2); x++) { - var css_class = "passive"; - if (x >= pos && counter > 0) { - css_class = color; - counter--; - } else css_class = "passive"; - var pos_rate = ((x - c) >= 0) ? "+" + (x - c + 1) : x - c; - css_class = ((x % 2 == 1) ? css_class + '2' : css_class + '1'); - var otstup = ((x % 2 == 1) ? ' ' : ''); - $(elem).append(''); - } - bind_stars(id_prod); - } - - function position_start(count_stars, rate) { - count_stars = parseInt(count_stars); - if (rate < 0) { - var result = count_stars - Math.abs(rate); - if (result > 0) return result; - else return 0; - } else { - return count_stars; - } - } - - function paint_stars(pos_start, length, id_prod, color, curr_css_class) { - var current_arr_stars = Array(0); - var arr_stars = $('div#rate_' + id_prod + ' a[name=a_rate]'); - for (var x = pos_start; x < (parseInt(pos_start) + parseInt(length)); x++) { - var css_class; - if (color != '') { - css_class = ((x % 2 == 1) ? color + '2' : color + '1'); - } else { - css_class = (curr_css_class != '') ? curr_css_class : ''; - } - current_arr_stars[x] = $(arr_stars[x]).attr('class'); - $(arr_stars[x]).removeClass().addClass(css_class); - } - return current_arr_stars; - } - - function bind_stars(id_prod) { - $('div#rate_' + id_prod + ' a[name=a_rate]').each(function() { - var data = $(this).attr('lang').split(':'); - if (parseInt(data[0]) == 0 || parseInt(data[1]) == 0) return 0; - $(this).attr('title', title_txt + data[0]); - var current_arr_stars = Array(0); - $(this).bind('mouseover', function() { - var rate = $(this).attr('lang').split(':'); - if (parseInt(rate[0]) == 0) return 0; - var color; - var pos; - if (rate[0] < 0) { - color = 'red'; - pos = (Math.abs(rate[0]) < count) ? count - Math.abs(rate[0]) : 0; - } else { - color = 'green'; - pos = count; - } - current_arr_stars = paint_stars(pos, Math.abs(rate[0]), data[1], color, ''); - }); - $(this).bind('mouseout', function() { - if (current_arr_stars.length > 0) { - for (q in current_arr_stars) { - paint_stars(q, 1, data[1], '', current_arr_stars[q]); - } - } - }); - $(this).bind('click', function() { - var id = data[1]; - JsHttpRequest.query('hr_gate.php?test=500&r=' + Math.random(), { - 'sp': "rate", - 'id': id, - 'abs': data[0] - }, function(result, errors) { - if (errors) alert(errors); - if (result) { - if (result.yet_voting > 0) { - alert('Вы уже голосовали!'); - return; - } - if (result.not_registered > 0) { - alert('Чтобы проголосовать Вам необходимо зарегистрироваться!'); - return; - } - if (result.new_data) render($('div#rate_' + id), result.new_data.count, result.new_data.rate, id); - } - }, true); - }) - }); - } -}); \ No newline at end of file diff --git a/frontend/web/js/js_head.js b/frontend/web/js/js_head.js index a9f3e65..e69de29 100644 --- a/frontend/web/js/js_head.js +++ b/frontend/web/js/js_head.js @@ -1,3233 +0,0 @@ -/* Minify: at least one missing file. See http://code.google.com/p/minify/wiki/Debugging */ - -; -var matched, browser; -jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || []; - return { - browser: match[1] || "", - version: match[2] || "0" - }; -}; -matched = jQuery.uaMatch(navigator.userAgent); -browser = {}; -if (matched.browser) { - browser[matched.browser] = true; - browser.version = matched.version; -} -if (browser.chrome) { - browser.webkit = true; -} else if (browser.webkit) { - browser.safari = true; -} -jQuery.browser = browser;; -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -/*! - * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=a28fbf72a29cf7f8dd3e) - * Config saved to config.json and https://gist.github.com/a28fbf72a29cf7f8dd3e - */ -if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(t) { - "use strict"; - var e = t.fn.jquery.split(" ")[0].split("."); - if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1) throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher") -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var i = t(this), - n = i.data("bs.alert"); - n || i.data("bs.alert", n = new o(this)), "string" == typeof e && n[e].call(i) - }) - } - var i = '[data-dismiss="alert"]', - o = function(e) { - t(e).on("click", i, this.close) - }; - o.VERSION = "3.3.5", o.TRANSITION_DURATION = 150, o.prototype.close = function(e) { - function i() { - a.detach().trigger("closed.bs.alert").remove() - } - var n = t(this), - s = n.attr("data-target"); - s || (s = n.attr("href"), s = s && s.replace(/.*(?=#[^\s]*$)/, "")); - var a = t(s); - e && e.preventDefault(), a.length || (a = n.closest(".alert")), a.trigger(e = t.Event("close.bs.alert")), e.isDefaultPrevented() || (a.removeClass("in"), t.support.transition && a.hasClass("fade") ? a.one("bsTransitionEnd", i).emulateTransitionEnd(o.TRANSITION_DURATION) : i()) - }; - var n = t.fn.alert; - t.fn.alert = e, t.fn.alert.Constructor = o, t.fn.alert.noConflict = function() { - return t.fn.alert = n, this - }, t(document).on("click.bs.alert.data-api", i, o.prototype.close) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.button"), - s = "object" == typeof e && e; - n || o.data("bs.button", n = new i(this, s)), "toggle" == e ? n.toggle() : e && n.setState(e) - }) - } - var i = function(e, o) { - this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, o), this.isLoading = !1 - }; - i.VERSION = "3.3.5", i.DEFAULTS = { - loadingText: "loading..." - }, i.prototype.setState = function(e) { - var i = "disabled", - o = this.$element, - n = o.is("input") ? "val" : "html", - s = o.data(); - e += "Text", null == s.resetText && o.data("resetText", o[n]()), setTimeout(t.proxy(function() { - o[n](null == s[e] ? this.options[e] : s[e]), "loadingText" == e ? (this.isLoading = !0, o.addClass(i).attr(i, i)) : this.isLoading && (this.isLoading = !1, o.removeClass(i).removeAttr(i)) - }, this), 0) - }, i.prototype.toggle = function() { - var t = !0, - e = this.$element.closest('[data-toggle="buttons"]'); - if (e.length) { - var i = this.$element.find("input"); - "radio" == i.prop("type") ? (i.prop("checked") && (t = !1), e.find(".active").removeClass("active"), this.$element.addClass("active")) : "checkbox" == i.prop("type") && (i.prop("checked") !== this.$element.hasClass("active") && (t = !1), this.$element.toggleClass("active")), i.prop("checked", this.$element.hasClass("active")), t && i.trigger("change") - } else this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active") - }; - var o = t.fn.button; - t.fn.button = e, t.fn.button.Constructor = i, t.fn.button.noConflict = function() { - return t.fn.button = o, this - }, t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(i) { - var o = t(i.target); - o.hasClass("btn") || (o = o.closest(".btn")), e.call(o, "toggle"), t(i.target).is('input[type="radio"]') || t(i.target).is('input[type="checkbox"]') || i.preventDefault() - }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(e) { - t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type)) - }) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.carousel"), - s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof e && e), - a = "string" == typeof e ? e : s.slide; - n || o.data("bs.carousel", n = new i(this, s)), "number" == typeof e ? n.to(e) : a ? n[a]() : s.interval && n.pause().cycle() - }) - } - var i = function(e, i) { - this.$element = t(e), this.$indicators = this.$element.find(".carousel-indicators"), this.options = i, this.paused = null, this.sliding = null, this.interval = null, this.$active = null, this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this)) - }; - i.VERSION = "3.3.5", i.TRANSITION_DURATION = 600, i.DEFAULTS = { - interval: 5e3, - pause: "hover", - wrap: !0, - keyboard: !0 - }, i.prototype.keydown = function(t) { - if (!/input|textarea/i.test(t.target.tagName)) { - switch (t.which) { - case 37: - this.prev(); - break; - case 39: - this.next(); - break; - default: - return - } - t.preventDefault() - } - }, i.prototype.cycle = function(e) { - return e || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)), this - }, i.prototype.getItemIndex = function(t) { - return this.$items = t.parent().children(".item"), this.$items.index(t || this.$active) - }, i.prototype.getItemForDirection = function(t, e) { - var i = this.getItemIndex(e), - o = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1; - if (o && !this.options.wrap) return e; - var n = "prev" == t ? -1 : 1, - s = (i + n) % this.$items.length; - return this.$items.eq(s) - }, i.prototype.to = function(t) { - var e = this, - i = this.getItemIndex(this.$active = this.$element.find(".item.active")); - return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() { - e.to(t) - }) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t)) - }, i.prototype.pause = function(e) { - return e || (this.paused = !0), this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this - }, i.prototype.next = function() { - return this.sliding ? void 0 : this.slide("next") - }, i.prototype.prev = function() { - return this.sliding ? void 0 : this.slide("prev") - }, i.prototype.slide = function(e, o) { - var n = this.$element.find(".item.active"), - s = o || this.getItemForDirection(e, n), - a = this.interval, - r = "next" == e ? "left" : "right", - l = this; - if (s.hasClass("active")) return this.sliding = !1; - var h = s[0], - d = t.Event("slide.bs.carousel", { - relatedTarget: h, - direction: r - }); - if (this.$element.trigger(d), !d.isDefaultPrevented()) { - if (this.sliding = !0, a && this.pause(), this.$indicators.length) { - this.$indicators.find(".active").removeClass("active"); - var p = t(this.$indicators.children()[this.getItemIndex(s)]); - p && p.addClass("active") - } - var c = t.Event("slid.bs.carousel", { - relatedTarget: h, - direction: r - }); - return t.support.transition && this.$element.hasClass("slide") ? (s.addClass(e), s[0].offsetWidth, n.addClass(r), s.addClass(r), n.one("bsTransitionEnd", function() { - s.removeClass([e, r].join(" ")).addClass("active"), n.removeClass(["active", r].join(" ")), l.sliding = !1, setTimeout(function() { - l.$element.trigger(c) - }, 0) - }).emulateTransitionEnd(i.TRANSITION_DURATION)) : (n.removeClass("active"), s.addClass("active"), this.sliding = !1, this.$element.trigger(c)), a && this.cycle(), this - } - }; - var o = t.fn.carousel; - t.fn.carousel = e, t.fn.carousel.Constructor = i, t.fn.carousel.noConflict = function() { - return t.fn.carousel = o, this - }; - var n = function(i) { - var o, n = t(this), - s = t(n.attr("data-target") || (o = n.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, "")); - if (s.hasClass("carousel")) { - var a = t.extend({}, s.data(), n.data()), - r = n.attr("data-slide-to"); - r && (a.interval = !1), e.call(s, a), r && s.data("bs.carousel").to(r), i.preventDefault() - } - }; - t(document).on("click.bs.carousel.data-api", "[data-slide]", n).on("click.bs.carousel.data-api", "[data-slide-to]", n), t(window).on("load", function() { - t('[data-ride="carousel"]').each(function() { - var i = t(this); - e.call(i, i.data()) - }) - }) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - var i = e.attr("data-target"); - i || (i = e.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")); - var o = i && t(i); - return o && o.length ? o : e.parent() - } - - function i(i) { - i && 3 === i.which || (t(n).remove(), t(s).each(function() { - var o = t(this), - n = e(o), - s = { - relatedTarget: this - }; - n.hasClass("open") && (i && "click" == i.type && /input|textarea/i.test(i.target.tagName) && t.contains(n[0], i.target) || (n.trigger(i = t.Event("hide.bs.dropdown", s)), i.isDefaultPrevented() || (o.attr("aria-expanded", "false"), n.removeClass("open").trigger("hidden.bs.dropdown", s)))) - })) - } - - function o(e) { - return this.each(function() { - var i = t(this), - o = i.data("bs.dropdown"); - o || i.data("bs.dropdown", o = new a(this)), "string" == typeof e && o[e].call(i) - }) - } - var n = ".dropdown-backdrop", - s = '[data-toggle="dropdown"]', - a = function(e) { - t(e).on("click.bs.dropdown", this.toggle) - }; - a.VERSION = "3.3.5", a.prototype.toggle = function(o) { - var n = t(this); - if (!n.is(".disabled, :disabled")) { - var s = e(n), - a = s.hasClass("open"); - if (i(), !a) { - "ontouchstart" in document.documentElement && !s.closest(".navbar-nav").length && t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click", i); - var r = { - relatedTarget: this - }; - if (s.trigger(o = t.Event("show.bs.dropdown", r)), o.isDefaultPrevented()) return; - n.trigger("focus").attr("aria-expanded", "true"), s.toggleClass("open").trigger("shown.bs.dropdown", r) - } - return !1 - } - }, a.prototype.keydown = function(i) { - if (/(38|40|27|32)/.test(i.which) && !/input|textarea/i.test(i.target.tagName)) { - var o = t(this); - if (i.preventDefault(), i.stopPropagation(), !o.is(".disabled, :disabled")) { - var n = e(o), - a = n.hasClass("open"); - if (!a && 27 != i.which || a && 27 == i.which) return 27 == i.which && n.find(s).trigger("focus"), o.trigger("click"); - var r = " li:not(.disabled):visible a", - l = n.find(".dropdown-menu" + r); - if (l.length) { - var h = l.index(i.target); - 38 == i.which && h > 0 && h--, 40 == i.which && h < l.length - 1 && h++, ~h || (h = 0), l.eq(h).trigger("focus") - } - } - } - }; - var r = t.fn.dropdown; - t.fn.dropdown = o, t.fn.dropdown.Constructor = a, t.fn.dropdown.noConflict = function() { - return t.fn.dropdown = r, this - }, t(document).on("click.bs.dropdown.data-api", i).on("click.bs.dropdown.data-api", ".dropdown form", function(t) { - t.stopPropagation() - }).on("click.bs.dropdown.data-api", s, a.prototype.toggle).on("keydown.bs.dropdown.data-api", s, a.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", a.prototype.keydown) -}(jQuery), + function(t) { - "use strict"; - - function e(e, o) { - return this.each(function() { - var n = t(this), - s = n.data("bs.modal"), - a = t.extend({}, i.DEFAULTS, n.data(), "object" == typeof e && e); - s || n.data("bs.modal", s = new i(this, a)), "string" == typeof e ? s[e](o) : a.show && s.show(o) - }) - } - var i = function(e, i) { - this.options = i, this.$body = t(document.body), this.$element = t(e), this.$dialog = this.$element.find(".modal-dialog"), this.$backdrop = null, this.isShown = null, this.originalBodyPad = null, this.scrollbarWidth = 0, this.ignoreBackdropClick = !1, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, t.proxy(function() { - this.$element.trigger("loaded.bs.modal") - }, this)) - }; - i.VERSION = "3.3.5", i.TRANSITION_DURATION = 300, i.BACKDROP_TRANSITION_DURATION = 150, i.DEFAULTS = { - backdrop: !0, - keyboard: !0, - show: !0 - }, i.prototype.toggle = function(t) { - return this.isShown ? this.hide() : this.show(t) - }, i.prototype.show = function(e) { - var o = this, - n = t.Event("show.bs.modal", { - relatedTarget: e - }); - this.$element.trigger(n), this.isShown || n.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.setScrollbar(), this.$body.addClass("modal-open"), this.escape(), this.resize(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', t.proxy(this.hide, this)), this.$dialog.on("mousedown.dismiss.bs.modal", function() { - o.$element.one("mouseup.dismiss.bs.modal", function(e) { - t(e.target).is(o.$element) && (o.ignoreBackdropClick = !0) - }) - }), this.backdrop(function() { - var n = t.support.transition && o.$element.hasClass("fade"); - o.$element.parent().length || o.$element.appendTo(o.$body), o.$element.show().scrollTop(0), o.adjustDialog(), n && o.$element[0].offsetWidth, o.$element.addClass("in"), o.enforceFocus(); - var s = t.Event("shown.bs.modal", { - relatedTarget: e - }); - n ? o.$dialog.one("bsTransitionEnd", function() { - o.$element.trigger("focus").trigger(s) - }).emulateTransitionEnd(i.TRANSITION_DURATION) : o.$element.trigger("focus").trigger(s) - })) - }, i.prototype.hide = function(e) { - e && e.preventDefault(), e = t.Event("hide.bs.modal"), this.$element.trigger(e), this.isShown && !e.isDefaultPrevented() && (this.isShown = !1, this.escape(), this.resize(), t(document).off("focusin.bs.modal"), this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), this.$dialog.off("mousedown.dismiss.bs.modal"), t.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", t.proxy(this.hideModal, this)).emulateTransitionEnd(i.TRANSITION_DURATION) : this.hideModal()) - }, i.prototype.enforceFocus = function() { - t(document).off("focusin.bs.modal").on("focusin.bs.modal", t.proxy(function(t) { - this.$element[0] === t.target || this.$element.has(t.target).length || this.$element.trigger("focus") - }, this)) - }, i.prototype.escape = function() { - this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", t.proxy(function(t) { - 27 == t.which && this.hide() - }, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal") - }, i.prototype.resize = function() { - this.isShown ? t(window).on("resize.bs.modal", t.proxy(this.handleUpdate, this)) : t(window).off("resize.bs.modal") - }, i.prototype.hideModal = function() { - var t = this; - this.$element.hide(), this.backdrop(function() { - t.$body.removeClass("modal-open"), t.resetAdjustments(), t.resetScrollbar(), t.$element.trigger("hidden.bs.modal") - }) - }, i.prototype.removeBackdrop = function() { - this.$backdrop && this.$backdrop.remove(), this.$backdrop = null - }, i.prototype.backdrop = function(e) { - var o = this, - n = this.$element.hasClass("fade") ? "fade" : ""; - if (this.isShown && this.options.backdrop) { - var s = t.support.transition && n; - if (this.$backdrop = t(document.createElement("div")).addClass("modal-backdrop " + n).appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", t.proxy(function(t) { - return this.ignoreBackdropClick ? void(this.ignoreBackdropClick = !1) : void(t.target === t.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide())) - }, this)), s && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !e) return; - s ? this.$backdrop.one("bsTransitionEnd", e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : e() - } else if (!this.isShown && this.$backdrop) { - this.$backdrop.removeClass("in"); - var a = function() { - o.removeBackdrop(), e && e() - }; - t.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : a() - } else e && e() - }, i.prototype.handleUpdate = function() { - this.adjustDialog() - }, i.prototype.adjustDialog = function() { - var t = this.$element[0].scrollHeight > document.documentElement.clientHeight; - this.$element.css({ - paddingLeft: !this.bodyIsOverflowing && t ? this.scrollbarWidth : "", - paddingRight: this.bodyIsOverflowing && !t ? this.scrollbarWidth : "" - }) - }, i.prototype.resetAdjustments = function() { - this.$element.css({ - paddingLeft: "", - paddingRight: "" - }) - }, i.prototype.checkScrollbar = function() { - var t = window.innerWidth; - if (!t) { - var e = document.documentElement.getBoundingClientRect(); - t = e.right - Math.abs(e.left) - } - this.bodyIsOverflowing = document.body.clientWidth < t, this.scrollbarWidth = this.measureScrollbar() - }, i.prototype.setScrollbar = function() { - var t = parseInt(this.$body.css("padding-right") || 0, 10); - this.originalBodyPad = document.body.style.paddingRight || "", this.bodyIsOverflowing && this.$body.css("padding-right", t + this.scrollbarWidth) - }, i.prototype.resetScrollbar = function() { - this.$body.css("padding-right", this.originalBodyPad) - }, i.prototype.measureScrollbar = function() { - var t = document.createElement("div"); - t.className = "modal-scrollbar-measure", this.$body.append(t); - var e = t.offsetWidth - t.clientWidth; - return this.$body[0].removeChild(t), e - }; - var o = t.fn.modal; - t.fn.modal = e, t.fn.modal.Constructor = i, t.fn.modal.noConflict = function() { - return t.fn.modal = o, this - }, t(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(i) { - var o = t(this), - n = o.attr("href"), - s = t(o.attr("data-target") || n && n.replace(/.*(?=#[^\s]+$)/, "")), - a = s.data("bs.modal") ? "toggle" : t.extend({ - remote: !/#/.test(n) && n - }, s.data(), o.data()); - o.is("a") && i.preventDefault(), s.one("show.bs.modal", function(t) { - t.isDefaultPrevented() || s.one("hidden.bs.modal", function() { - o.is(":visible") && o.trigger("focus") - }) - }), e.call(s, a, this) - }) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.tooltip"), - s = "object" == typeof e && e; - (n || !/destroy|hide/.test(e)) && (n || o.data("bs.tooltip", n = new i(this, s)), "string" == typeof e && n[e]()) - }) - } - var i = function(t, e) { - this.type = null, this.options = null, this.enabled = null, this.timeout = null, this.hoverState = null, this.$element = null, this.inState = null, this.init("tooltip", t, e) - }; - i.VERSION = "3.3.5", i.TRANSITION_DURATION = 150, i.DEFAULTS = { - animation: !0, - placement: "top", - selector: !1, - template: '', - trigger: "hover focus", - title: "", - delay: 0, - html: !1, - container: !1, - viewport: { - selector: "body", - padding: 0 - } - }, i.prototype.init = function(e, i, o) { - if (this.enabled = !0, this.type = e, this.$element = t(i), this.options = this.getOptions(o), this.$viewport = this.options.viewport && t(t.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport), this.inState = { - click: !1, - hover: !1, - focus: !1 - }, this.$element[0] instanceof document.constructor && !this.options.selector) throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!"); - for (var n = this.options.trigger.split(" "), s = n.length; s--;) { - var a = n[s]; - if ("click" == a) this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this)); - else if ("manual" != a) { - var r = "hover" == a ? "mouseenter" : "focusin", - l = "hover" == a ? "mouseleave" : "focusout"; - this.$element.on(r + "." + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this)) - } - } - this.options.selector ? this._options = t.extend({}, this.options, { - trigger: "manual", - selector: "" - }) : this.fixTitle() - }, i.prototype.getDefaults = function() { - return i.DEFAULTS - }, i.prototype.getOptions = function(e) { - return e = t.extend({}, this.getDefaults(), this.$element.data(), e), e.delay && "number" == typeof e.delay && (e.delay = { - show: e.delay, - hide: e.delay - }), e - }, i.prototype.getDelegateOptions = function() { - var e = {}, - i = this.getDefaults(); - return this._options && t.each(this._options, function(t, o) { - i[t] != o && (e[t] = o) - }), e - }, i.prototype.enter = function(e) { - var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type); - return i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), e instanceof t.Event && (i.inState["focusin" == e.type ? "focus" : "hover"] = !0), i.tip().hasClass("in") || "in" == i.hoverState ? void(i.hoverState = "in") : (clearTimeout(i.timeout), i.hoverState = "in", i.options.delay && i.options.delay.show ? void(i.timeout = setTimeout(function() { - "in" == i.hoverState && i.show() - }, i.options.delay.show)) : i.show()) - }, i.prototype.isInStateTrue = function() { - for (var t in this.inState) - if (this.inState[t]) return !0; - return !1 - }, i.prototype.leave = function(e) { - var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type); - return i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), e instanceof t.Event && (i.inState["focusout" == e.type ? "focus" : "hover"] = !1), i.isInStateTrue() ? void 0 : (clearTimeout(i.timeout), i.hoverState = "out", i.options.delay && i.options.delay.hide ? void(i.timeout = setTimeout(function() { - "out" == i.hoverState && i.hide() - }, i.options.delay.hide)) : i.hide()) - }, i.prototype.show = function() { - var e = t.Event("show.bs." + this.type); - if (this.hasContent() && this.enabled) { - this.$element.trigger(e); - var o = t.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); - if (e.isDefaultPrevented() || !o) return; - var n = this, - s = this.tip(), - a = this.getUID(this.type); - this.setContent(), s.attr("id", a), this.$element.attr("aria-describedby", a), this.options.animation && s.addClass("fade"); - var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement, - l = /\s?auto?\s?/i, - h = l.test(r); - h && (r = r.replace(l, "") || "top"), s.detach().css({ - top: 0, - left: 0, - display: "block" - }).addClass(r).data("bs." + this.type, this), this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element), this.$element.trigger("inserted.bs." + this.type); - var d = this.getPosition(), - p = s[0].offsetWidth, - c = s[0].offsetHeight; - if (h) { - var f = r, - u = this.getPosition(this.$viewport); - r = "bottom" == r && d.bottom + c > u.bottom ? "top" : "top" == r && d.top - c < u.top ? "bottom" : "right" == r && d.right + p > u.width ? "left" : "left" == r && d.left - p < u.left ? "right" : r, s.removeClass(f).addClass(r) - } - var g = this.getCalculatedOffset(r, d, p, c); - this.applyPlacement(g, r); - var m = function() { - var t = n.hoverState; - n.$element.trigger("shown.bs." + n.type), n.hoverState = null, "out" == t && n.leave(n) - }; - t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", m).emulateTransitionEnd(i.TRANSITION_DURATION) : m() - } - }, i.prototype.applyPlacement = function(e, i) { - var o = this.tip(), - n = o[0].offsetWidth, - s = o[0].offsetHeight, - a = parseInt(o.css("margin-top"), 10), - r = parseInt(o.css("margin-left"), 10); - isNaN(a) && (a = 0), isNaN(r) && (r = 0), e.top += a, e.left += r, t.offset.setOffset(o[0], t.extend({ - using: function(t) { - o.css({ - top: Math.round(t.top), - left: Math.round(t.left) - }) - } - }, e), 0), o.addClass("in"); - var l = o[0].offsetWidth, - h = o[0].offsetHeight; - "top" == i && h != s && (e.top = e.top + s - h); - var d = this.getViewportAdjustedDelta(i, e, l, h); - d.left ? e.left += d.left : e.top += d.top; - var p = /top|bottom/.test(i), - c = p ? 2 * d.left - n + l : 2 * d.top - s + h, - f = p ? "offsetWidth" : "offsetHeight"; - o.offset(e), this.replaceArrow(c, o[0][f], p) - }, i.prototype.replaceArrow = function(t, e, i) { - this.arrow().css(i ? "left" : "top", 50 * (1 - t / e) + "%").css(i ? "top" : "left", "") - }, i.prototype.setContent = function() { - var t = this.tip(), - e = this.getTitle(); - t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e), t.removeClass("fade in top bottom left right") - }, i.prototype.hide = function(e) { - function o() { - "in" != n.hoverState && s.detach(), n.$element.removeAttr("aria-describedby").trigger("hidden.bs." + n.type), e && e() - } - var n = this, - s = t(this.$tip), - a = t.Event("hide.bs." + this.type); - return this.$element.trigger(a), a.isDefaultPrevented() ? void 0 : (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one("bsTransitionEnd", o).emulateTransitionEnd(i.TRANSITION_DURATION) : o(), this.hoverState = null, this) - }, i.prototype.fixTitle = function() { - var t = this.$element; - (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "") - }, i.prototype.hasContent = function() { - return this.getTitle() - }, i.prototype.getPosition = function(e) { - e = e || this.$element; - var i = e[0], - o = "BODY" == i.tagName, - n = i.getBoundingClientRect(); - null == n.width && (n = t.extend({}, n, { - width: n.right - n.left, - height: n.bottom - n.top - })); - var s = o ? { - top: 0, - left: 0 - } : e.offset(), - a = { - scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop() - }, - r = o ? { - width: t(window).width(), - height: t(window).height() - } : null; - return t.extend({}, n, a, r, s) - }, i.prototype.getCalculatedOffset = function(t, e, i, o) { - return "bottom" == t ? { - top: e.top + e.height, - left: e.left + e.width / 2 - i / 2 - } : "top" == t ? { - top: e.top - o, - left: e.left + e.width / 2 - i / 2 - } : "left" == t ? { - top: e.top + e.height / 2 - o / 2, - left: e.left - i - } : { - top: e.top + e.height / 2 - o / 2, - left: e.left + e.width - } - }, i.prototype.getViewportAdjustedDelta = function(t, e, i, o) { - var n = { - top: 0, - left: 0 - }; - if (!this.$viewport) return n; - var s = this.options.viewport && this.options.viewport.padding || 0, - a = this.getPosition(this.$viewport); - if (/right|left/.test(t)) { - var r = e.top - s - a.scroll, - l = e.top + s - a.scroll + o; - r < a.top ? n.top = a.top - r : l > a.top + a.height && (n.top = a.top + a.height - l) - } else { - var h = e.left - s, - d = e.left + s + i; - h < a.left ? n.left = a.left - h : d > a.right && (n.left = a.left + a.width - d) - } - return n - }, i.prototype.getTitle = function() { - var t, e = this.$element, - i = this.options; - return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title) - }, i.prototype.getUID = function(t) { - do t += ~~(1e6 * Math.random()); while (document.getElementById(t)); - return t - }, i.prototype.tip = function() { - if (!this.$tip && (this.$tip = t(this.options.template), 1 != this.$tip.length)) throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!"); - return this.$tip - }, i.prototype.arrow = function() { - return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") - }, i.prototype.enable = function() { - this.enabled = !0 - }, i.prototype.disable = function() { - this.enabled = !1 - }, i.prototype.toggleEnabled = function() { - this.enabled = !this.enabled - }, i.prototype.toggle = function(e) { - var i = this; - e && (i = t(e.currentTarget).data("bs." + this.type), i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i))), e ? (i.inState.click = !i.inState.click, i.isInStateTrue() ? i.enter(i) : i.leave(i)) : i.tip().hasClass("in") ? i.leave(i) : i.enter(i) - }, i.prototype.destroy = function() { - var t = this; - clearTimeout(this.timeout), this.hide(function() { - t.$element.off("." + t.type).removeData("bs." + t.type), t.$tip && t.$tip.detach(), t.$tip = null, t.$arrow = null, t.$viewport = null - }) - }; - var o = t.fn.tooltip; - t.fn.tooltip = e, t.fn.tooltip.Constructor = i, t.fn.tooltip.noConflict = function() { - return t.fn.tooltip = o, this - } -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.popover"), - s = "object" == typeof e && e; - (n || !/destroy|hide/.test(e)) && (n || o.data("bs.popover", n = new i(this, s)), "string" == typeof e && n[e]()) - }) - } - var i = function(t, e) { - this.init("popover", t, e) - }; - if (!t.fn.tooltip) throw new Error("Popover requires tooltip.js"); - i.VERSION = "3.3.5", i.DEFAULTS = t.extend({}, t.fn.tooltip.Constructor.DEFAULTS, { - placement: "right", - trigger: "click", - content: "", - template: '' - }), i.prototype = t.extend({}, t.fn.tooltip.Constructor.prototype), i.prototype.constructor = i, i.prototype.getDefaults = function() { - return i.DEFAULTS - }, i.prototype.setContent = function() { - var t = this.tip(), - e = this.getTitle(), - i = this.getContent(); - t.find(".popover-title")[this.options.html ? "html" : "text"](e), t.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof i ? "html" : "append" : "text"](i), t.removeClass("fade top bottom left right in"), t.find(".popover-title").html() || t.find(".popover-title").hide() - }, i.prototype.hasContent = function() { - return this.getTitle() || this.getContent() - }, i.prototype.getContent = function() { - var t = this.$element, - e = this.options; - return t.attr("data-content") || ("function" == typeof e.content ? e.content.call(t[0]) : e.content) - }, i.prototype.arrow = function() { - return this.$arrow = this.$arrow || this.tip().find(".arrow") - }; - var o = t.fn.popover; - t.fn.popover = e, t.fn.popover.Constructor = i, t.fn.popover.noConflict = function() { - return t.fn.popover = o, this - } -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.tab"); - n || o.data("bs.tab", n = new i(this)), "string" == typeof e && n[e]() - }) - } - var i = function(e) { - this.element = t(e) - }; - i.VERSION = "3.3.5", i.TRANSITION_DURATION = 150, i.prototype.show = function() { - var e = this.element, - i = e.closest("ul:not(.dropdown-menu)"), - o = e.data("target"); - if (o || (o = e.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, "")), !e.parent("li").hasClass("active")) { - var n = i.find(".active:last a"), - s = t.Event("hide.bs.tab", { - relatedTarget: e[0] - }), - a = t.Event("show.bs.tab", { - relatedTarget: n[0] - }); - if (n.trigger(s), e.trigger(a), !a.isDefaultPrevented() && !s.isDefaultPrevented()) { - var r = t(o); - this.activate(e.closest("li"), i), this.activate(r, r.parent(), function() { - n.trigger({ - type: "hidden.bs.tab", - relatedTarget: e[0] - }), e.trigger({ - type: "shown.bs.tab", - relatedTarget: n[0] - }) - }) - } - } - }, i.prototype.activate = function(e, o, n) { - function s() { - a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), r ? (e[0].offsetWidth, e.addClass("in")) : e.removeClass("fade"), e.parent(".dropdown-menu").length && e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), n && n() - } - var a = o.find("> .active"), - r = n && t.support.transition && (a.length && a.hasClass("fade") || !!o.find("> .fade").length); - a.length && r ? a.one("bsTransitionEnd", s).emulateTransitionEnd(i.TRANSITION_DURATION) : s(), a.removeClass("in") - }; - var o = t.fn.tab; - t.fn.tab = e, t.fn.tab.Constructor = i, t.fn.tab.noConflict = function() { - return t.fn.tab = o, this - }; - var n = function(i) { - i.preventDefault(), e.call(t(this), "show") - }; - t(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', n).on("click.bs.tab.data-api", '[data-toggle="pill"]', n) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - return this.each(function() { - var o = t(this), - n = o.data("bs.affix"), - s = "object" == typeof e && e; - n || o.data("bs.affix", n = new i(this, s)), "string" == typeof e && n[e]() - }) - } - var i = function(e, o) { - this.options = t.extend({}, i.DEFAULTS, o), this.$target = t(this.options.target).on("scroll.bs.affix.data-api", t.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", t.proxy(this.checkPositionWithEventLoop, this)), this.$element = t(e), this.affixed = null, this.unpin = null, this.pinnedOffset = null, this.checkPosition() - }; - i.VERSION = "3.3.5", i.RESET = "affix affix-top affix-bottom", i.DEFAULTS = { - offset: 0, - target: window - }, i.prototype.getState = function(t, e, i, o) { - var n = this.$target.scrollTop(), - s = this.$element.offset(), - a = this.$target.height(); - if (null != i && "top" == this.affixed) return i > n ? "top" : !1; - if ("bottom" == this.affixed) return null != i ? n + this.unpin <= s.top ? !1 : "bottom" : t - o >= n + a ? !1 : "bottom"; - var r = null == this.affixed, - l = r ? n : s.top, - h = r ? a : e; - return null != i && i >= n ? "top" : null != o && l + h >= t - o ? "bottom" : !1 - }, i.prototype.getPinnedOffset = function() { - if (this.pinnedOffset) return this.pinnedOffset; - this.$element.removeClass(i.RESET).addClass("affix"); - var t = this.$target.scrollTop(), - e = this.$element.offset(); - return this.pinnedOffset = e.top - t - }, i.prototype.checkPositionWithEventLoop = function() { - setTimeout(t.proxy(this.checkPosition, this), 1) - }, i.prototype.checkPosition = function() { - if (this.$element.is(":visible")) { - var e = this.$element.height(), - o = this.options.offset, - n = o.top, - s = o.bottom, - a = Math.max(t(document).height(), t(document.body).height()); - "object" != typeof o && (s = n = o), "function" == typeof n && (n = o.top(this.$element)), "function" == typeof s && (s = o.bottom(this.$element)); - var r = this.getState(a, e, n, s); - if (this.affixed != r) { - null != this.unpin && this.$element.css("top", ""); - var l = "affix" + (r ? "-" + r : ""), - h = t.Event(l + ".bs.affix"); - if (this.$element.trigger(h), h.isDefaultPrevented()) return; - this.affixed = r, this.unpin = "bottom" == r ? this.getPinnedOffset() : null, this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix", "affixed") + ".bs.affix") - } - "bottom" == r && this.$element.offset({ - top: a - e - s - }) - } - }; - var o = t.fn.affix; - t.fn.affix = e, t.fn.affix.Constructor = i, t.fn.affix.noConflict = function() { - return t.fn.affix = o, this - }, t(window).on("load", function() { - t('[data-spy="affix"]').each(function() { - var i = t(this), - o = i.data(); - o.offset = o.offset || {}, null != o.offsetBottom && (o.offset.bottom = o.offsetBottom), null != o.offsetTop && (o.offset.top = o.offsetTop), e.call(i, o) - }) - }) -}(jQuery), + function(t) { - "use strict"; - - function e(e) { - var i, o = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, ""); - return t(o) - } - - function i(e) { - return this.each(function() { - var i = t(this), - n = i.data("bs.collapse"), - s = t.extend({}, o.DEFAULTS, i.data(), "object" == typeof e && e); - !n && s.toggle && /show|hide/.test(e) && (s.toggle = !1), n || i.data("bs.collapse", n = new o(this, s)), "string" == typeof e && n[e]() - }) - } - var o = function(e, i) { - this.$element = t(e), this.options = t.extend({}, o.DEFAULTS, i), this.$trigger = t('[data-toggle="collapse"][href="#' + e.id + '"],[data-toggle="collapse"][data-target="#' + e.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle() - }; - o.VERSION = "3.3.5", o.TRANSITION_DURATION = 350, o.DEFAULTS = { - toggle: !0 - }, o.prototype.dimension = function() { - var t = this.$element.hasClass("width"); - return t ? "width" : "height" - }, o.prototype.show = function() { - if (!this.transitioning && !this.$element.hasClass("in")) { - var e, n = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); - if (!(n && n.length && (e = n.data("bs.collapse"), e && e.transitioning))) { - var s = t.Event("show.bs.collapse"); - if (this.$element.trigger(s), !s.isDefaultPrevented()) { - n && n.length && (i.call(n, "hide"), e || n.data("bs.collapse", null)); - var a = this.dimension(); - this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; - var r = function() { - this.$element.removeClass("collapsing").addClass("collapse in")[a](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") - }; - if (!t.support.transition) return r.call(this); - var l = t.camelCase(["scroll", a].join("-")); - this.$element.one("bsTransitionEnd", t.proxy(r, this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l]); - } - } - } - }, o.prototype.hide = function() { - if (!this.transitioning && this.$element.hasClass("in")) { - var e = t.Event("hide.bs.collapse"); - if (this.$element.trigger(e), !e.isDefaultPrevented()) { - var i = this.dimension(); - this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; - var n = function() { - this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") - }; - return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(n, this)).emulateTransitionEnd(o.TRANSITION_DURATION) : n.call(this) - } - } - }, o.prototype.toggle = function() { - this[this.$element.hasClass("in") ? "hide" : "show"]() - }, o.prototype.getParent = function() { - return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function(i, o) { - var n = t(o); - this.addAriaAndCollapsedClass(e(n), n) - }, this)).end() - }, o.prototype.addAriaAndCollapsedClass = function(t, e) { - var i = t.hasClass("in"); - t.attr("aria-expanded", i), e.toggleClass("collapsed", !i).attr("aria-expanded", i) - }; - var n = t.fn.collapse; - t.fn.collapse = i, t.fn.collapse.Constructor = o, t.fn.collapse.noConflict = function() { - return t.fn.collapse = n, this - }, t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(o) { - var n = t(this); - n.attr("data-target") || o.preventDefault(); - var s = e(n), - a = s.data("bs.collapse"), - r = a ? "toggle" : n.data(); - i.call(s, r) - }) -}(jQuery), + function(t) { - "use strict"; - - function e(i, o) { - this.$body = t(document.body), this.$scrollElement = t(t(i).is(document.body) ? window : i), this.options = t.extend({}, e.DEFAULTS, o), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", t.proxy(this.process, this)), this.refresh(), this.process() - } - - function i(i) { - return this.each(function() { - var o = t(this), - n = o.data("bs.scrollspy"), - s = "object" == typeof i && i; - n || o.data("bs.scrollspy", n = new e(this, s)), "string" == typeof i && n[i]() - }) - } - e.VERSION = "3.3.5", e.DEFAULTS = { - offset: 10 - }, e.prototype.getScrollHeight = function() { - return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) - }, e.prototype.refresh = function() { - var e = this, - i = "offset", - o = 0; - this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight(), t.isWindow(this.$scrollElement[0]) || (i = "position", o = this.$scrollElement.scrollTop()), this.$body.find(this.selector).map(function() { - var e = t(this), - n = e.data("target") || e.attr("href"), - s = /^#./.test(n) && t(n); - return s && s.length && s.is(":visible") && [ - [s[i]().top + o, n] - ] || null - }).sort(function(t, e) { - return t[0] - e[0] - }).each(function() { - e.offsets.push(this[0]), e.targets.push(this[1]) - }) - }, e.prototype.process = function() { - var t, e = this.$scrollElement.scrollTop() + this.options.offset, - i = this.getScrollHeight(), - o = this.options.offset + i - this.$scrollElement.height(), - n = this.offsets, - s = this.targets, - a = this.activeTarget; - if (this.scrollHeight != i && this.refresh(), e >= o) return a != (t = s[s.length - 1]) && this.activate(t); - if (a && e < n[0]) return this.activeTarget = null, this.clear(); - for (t = n.length; t--;) a != s[t] && e >= n[t] && (void 0 === n[t + 1] || e < n[t + 1]) && this.activate(s[t]) - }, e.prototype.activate = function(e) { - this.activeTarget = e, this.clear(); - var i = this.selector + '[data-target="' + e + '"],' + this.selector + '[href="' + e + '"]', - o = t(i).parents("li").addClass("active"); - o.parent(".dropdown-menu").length && (o = o.closest("li.dropdown").addClass("active")), o.trigger("activate.bs.scrollspy") - }, e.prototype.clear = function() { - t(this.selector).parentsUntil(this.options.target, ".active").removeClass("active") - }; - var o = t.fn.scrollspy; - t.fn.scrollspy = i, t.fn.scrollspy.Constructor = e, t.fn.scrollspy.noConflict = function() { - return t.fn.scrollspy = o, this - }, t(window).on("load.bs.scrollspy.data-api", function() { - t('[data-spy="scroll"]').each(function() { - var e = t(this); - i.call(e, e.data()) - }) - }) -}(jQuery), + function(t) { - "use strict"; - - function e() { - var t = document.createElement("bootstrap"), - e = { - WebkitTransition: "webkitTransitionEnd", - MozTransition: "transitionend", - OTransition: "oTransitionEnd otransitionend", - transition: "transitionend" - }; - for (var i in e) - if (void 0 !== t.style[i]) return { - end: e[i] - }; - return !1 - } - t.fn.emulateTransitionEnd = function(e) { - var i = !1, - o = this; - t(this).one("bsTransitionEnd", function() { - i = !0 - }); - var n = function() { - i || t(o).trigger(t.support.transition.end) - }; - return setTimeout(n, e), this - }, t(function() { - t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { - bindType: t.support.transition.end, - delegateType: t.support.transition.end, - handle: function(e) { - return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0 - } - }) - }) -}(jQuery);; - -function openWindow(theURL, winName, features) { - if (!features) features = "status=yes,toolbar=no,menubar=no,location=no"; - return window.open(theURL, winName, features); -} - -function load_script(href) { - if (typeof jQuery != 'undefined') { - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = href; - $("head").append(script); - } else - with(document) { - var span = null; - span = body.appendChild(createElement("SPAN")); - span.style.display = 'none'; - span.innerHTML = 'Text for IE.'; - setTimeout(function() { - var s = span.getElementsByTagName("script")[0]; - s.language = "JavaScript"; - if (s.setAttribute) s.setAttribute('src', href); - else s.src = href; - }, 10); - } -} - -function initModules(paramArr) { - if (empty(paramArr.arr)) return; - var modules = paramArr.arr; - var base_dir = ''; - if (!empty(paramArr.base)) base_dir = paramArr.base; - for (var i = 0; i < modules.length; i++) { - var curr = modules[i]; - if (curr.indexOf('.js') <= 0 && curr.indexOf('.inc') <= 0) curr = curr + '.js'; - load_script(base_dir + curr); - } -} - -function printEmail(str, title) { - if (empty(str)) return; - if (empty(title)) title = str; - document.write('' + title + ''); -} - -function getFlashVer() { - var f = "-", - n = navigator; - if (n.plugins && n.plugins.length) { - for (var ii = 0; ii < n.plugins.length; ii++) { - if (n.plugins[ii].name.indexOf('Shockwave Flash') != -1) { - f = n.plugins[ii].description.split('Shockwave Flash ')[1]; - break; - } - } - } else if (window.ActiveXObject) { - for (var ii = 12; ii >= 2; ii--) { - try { - var fl = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + ii + "');"); - if (fl) { - f = ii + '.0'; - break; - } - } catch (e) {} - } - } - return f; -} - -function empty(variable) { - if (typeof(variable) == 'undefined') return true; - if (variable == '' || variable == 0 || variable == '0' || !variable) return true; - return false; -} - -function is_undef(variable) { - if (typeof(variable) == 'undefined') return true; - return false; -} - -function is_array() { - if (typeof arguments[0] == 'object') { - var criterion = arguments[0].constructor.toString().match(/array/i); - return (criterion != null); - } - return false; -} - -function is_hash() { - if (typeof arguments[0] == 'object') { - var non_empty = false; - for (var k in arguments[0]) - if (!is_undef(k) || !is_undef(arguments[0][k])) { - non_empty = true; - break; - } - var criterion = arguments[0].constructor.toString().match(/object\(\)/i) && non_empty; - return (criterion != null); - } - return false; -} - -function array_search(needle, haystack) { - if (typeof(needle) == 'undefined' || typeof(haystack) == 'undefined') return false; - if (typeof(haystack.length) == 'undefined' || needle == false) return false; - for (var i = 0; i <= haystack.length - 1; i++) - if (needle == haystack[i]) return i; - return -1; -} - -function in_array(needle, haystack) { - if (typeof(needle) == 'undefined' || typeof(haystack) == 'undefined') return false; - if (typeof(haystack.length) == 'undefined' || !needle) return false; - for (var i = 0; i <= haystack.length - 1; i++) - if (needle == haystack[i]) return true; - return false; -} - -function is_obj(variable) { - if (typeof(variable) == 'object') return true; - return false; -} - -function is_object(variable) { - return is_obj(variable); -} - -function getElement(e, f) { - f = (f) ? f : self; - if (document.getElementById) return f.document.getElementById(e); - if (document.layers) { - f = (f) ? f : self; - if (f.document.layers[e]) { - return f.document.layers[e]; - } - for (W = 0; i < f.document.layers.length; W++) { - return (getElement(e, f.document.layers[W])); - } - } - if (document.all) { - return f.document.all[e]; - } - return false; -} - -function getElementByMask(mask, container) { - if (empty(container)) { - container = document.getElementsByTagName('body')[0]; - } - if (!empty(container)) { - var out_array = new Array(); - var arr = container.childNodes; - var out_array = arr; - var str = ''; - if (!empty(arr)) - for (var i = 0; i < arr.length; i++) - if (!empty(arr[i])) { - var new_el_arr = getElementByMask(mask, arr[i]); - if (new_el_arr) - for (var j = 0; j < new_el_arr.length; i++) - if (!empty(new_el_arr[j])) { - new_el = new_el_arr[j]; - if (!empty(new_el.id) && IsContain(mask, new_el.id)) { - out_array.push(new_el_arr[j]); - } - } - } - if (!empty(out_array)) return out_array; - } - return false; -} -arrPrototypeReserved = ["sizeOf", "show"]; - -function show_array(arr) { - var str = ''; - for (var k in arr) { - str = str + k + "=>" + arr[k] + ', '; - } - if (str.length > 0) str = str.substring(0, str.length - 2); - alert(str); -} - -function init_arr_from_str(str) { - if (!empty(str)) { - var tmp_arr = str.split(","); - var out_arr = new Array(); - for (var k in tmp_arr) - if (!empty(tmp_arr[k])) { - var tmp_arr2 = tmp_arr[k].split(":"); - out_arr[tmp_arr2[0]] = tmp_arr2[1]; - } - return out_arr; - } - return false; -} - -function IsContain(needle, s) { - var re = new RegExp(needle, "i"); - return re.test(s); -} - -function strip_tags() { - var re = /<\S[^><]*>/g - return arguments[0].replace(re, ""); -} - -function el_value(el) { - var ret_val = false; - if (!empty(el.type)) { - var tmp = el.type; - if (tmp.indexOf('select') > -1) { - if (el.selectedIndex != -1) return el.options[el.selectedIndex].value; - } else if (tmp.indexOf('radio') > -1) { - var tmp_form = el.form; - var radioGrp = tmp_form[el.name]; - for (var i = 0; i < radioGrp.length; i++) { - if (radioGrp[i].checked) { - return radioGrp[i].value; - } - } - } - } - if (typeof(el.value) != 'undefined') return el.value; - return ret_val; -} - -function addEvent(elm, evType, fn, useCapture) { - useCapture = useCapture || false; - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } else if (elm.attachEvent) { - var r = elm.attachEvent('on' + evType, fn); - return r; - } else { - elm['on' + evType] = fn; - } -} - -function fix_inline_links() { - var tmp_els = document.getElementsByTagName("a"); - var base_url = document.getElementsByTagName('base')[0].href; - var curr_url = location.href; - if (curr_url.indexOf("#") >= 0) { - curr_url = curr_url.substring(0, curr_url.indexOf("#")); - } - var curr_el, tmp_str; - if (!empty(tmp_els) && !empty(base_url)) - for (var i = 0; i < tmp_els.length; i++) { - curr_el = tmp_els[i]; - if (!empty(curr_el.href)) { - tmp_str = curr_el.href; - if (tmp_str.indexOf("#") >= 0) { - if (tmp_str.indexOf(base_url) >= 0) { - tmp_str = tmp_str.substr(base_url.length); - if (tmp_str.indexOf("#") == 0) curr_el.href = curr_url + tmp_str; - } - } - } - } -} - -function clear_fields_requireness(selector) { - if (empty(selector)) return; - $(selector).each(function() { - var el_id = $(this).attr('id'); - var i = 0; - while (el_id.lastIndexOf("_") > -1) { - if (el_id[el_id.length - 1] != "_" || i > 100) break; - el_id = el_id.substr(0, el_id.length - 1); - i++; - } - $(this).attr('id', el_id); - }); -}; -debugMode = false; -requesterName = "IBS support"; -var min_pwd_length = 4; -var lng; -var errMsgs = new Array(); -errMsgs[1] = '���������� ��������� ��� ����������� ���� "'; -var el_first; -var elTitles = new Array(); -elTitles["login"] = "Login"; -elTitles["pwd"] = "Password"; -elTitles["pwdconf"] = "Password Confirmation"; -elTitles["firstName"] = "���"; -elTitles["lastName"] = "�������"; -elTitles["city"] = "�����"; -elTitles["suburb"] = "Suburb"; -elTitles["strAddress"] = "������"; -elTitles["phoneBusiness"] = "Business Phone Number"; -elTitles["email"] = "Email"; -elTitles["fio"] = "���"; -elTitles["phone"] = "�������"; -var timeout2 = null; -var of = document.form1; -var scr = window.screen; - -function init() { - var of = document.form1; -} - -function unmake_required(el) { - if (!is_obj(el) && !empty(el)) el = getElement(el); - if (empty(el)) return; - var id = el.id; - if (!empty(id)) { - if (id.substr(id.length - 1, 1) == "_") el.id = id.substr(0, id.length - 1); - } - return true; -} - -function make_required(el) { - if (!is_obj(el) && !empty(el)) el = getElement(el); - if (empty(el)) return; - var id = el.id; - if (!empty(id)) { - if (id.substr(id.length - 1, 1) != "_") el.id = id + '_'; - } - return true; -} - -function focusEmpty(of) { - var empty_el_arr = new Array(); - var ee_count = 0; - var found = false; - el_first = null; - for (var i = 0; i < of.elements.length; i++) { - el = of.elements[i]; - elID = of.elements[i].id; - if (elID.substr(elID.length - 1, 1) == "_") { - var elValue = el_value(el); - if (elValue == false || elValue == '') { - found = true; - if (el_first == null) el_first = el; - empty_el_arr[ee_count] = el.name; - ee_count = ee_count + 1; - } else { - el.className = ''; - } - } - } - if (found == true) { - var recipient = document.getElementById('err_reporter'); - if (recipient) { - var list = ''; - for (var i = 0; i < empty_el_arr.length; i++) { - if (elTitles[empty_el_arr[i]]) - list = list + (elTitles[empty_el_arr[i]] || empty_el_arr[i]) + ', '; - } - if (list != '') recipient.innerHTML = shellErrMsg(errMsgs[1]) + list.substr(0, list.length - 2) + '" !

'; - window.status = strip_tags(recipient.innerHTML); - } - var anchor_to = '#top_a'; - var new_loc = location.href; - if (new_loc.indexOf(anchor_to) <= 0) { - new_loc = new_loc + anchor_to; - } - window.location.href = new_loc; - if (el_first.style) el_first.className = "input_hl"; - if (timeout2) clearTimeout(timeout2); - timeout2 = setTimeout("el_first.focus();", 400); - return 0; - } - return 1; -} - -function shellErrMsg(msg) { - return '' + msg + ''; -} - -function onSubmit(obj) { - if (typeof(obj) == 'string') obj = getElement(obj); - if (typeof(obj.form) == 'undefined') return false; - var of = obj.form; - if (focusEmpty(of) == 1) { - of.submit(); - return true; - } - return false; -} - -function onSubmit_a(form) { - var of = document.forms[form]; - if (focusEmpty(of) == 1) { - of.submit(); - } -} - -function onCancel() { - var nav_path = (PathTo) ? PathTo : 'index.php'; - if (!empty(PathTo)) location.href = PathTo; -} - -function checkEmail(obj) { - var oEmail = obj.form.email; - var email = oEmail.value; - if (lng == 'ru') { - err_msg = "E-mail ����� �������� ������! ��������� ���������� ����"; - } else if (lng == 'ua') { - err_msg = "E-mail �� ������� ������! �������� ����-����� ��� �����"; - } else { - err_msg = "Incorrect email format! Please reenter"; - } - if (oEmail.value) { - var parts = email.split("@"); - if ((parts.length != 2) || (!parts[0]) || (!parts[1])) { - alert(err_msg); - oEmail.focus(); - return false; - } else { - var domain_parts = parts[1].split("."); - if (domain_parts.length < 2) { - alert(err_msg); - oEmail.focus(); - return false; - } - confEmail = getElement('emailconf_'); - if (!empty(confEmail) && email != confEmail.value) { - alert(err_msg); - confEmail.focus(); - return false; - } - return true; - } - } else { - return true; - } -} - -function checkPwd(obj) { - var oPwd = obj.form.pwd; - var oPwdconf = obj.form.pwdconf; - var pwd = oPwd.value; - if ((pwd != '')) { - if (pwd.length < min_pwd_length) { - if (lng == 'ru') { - err_msg = "������ ������ ������ " + min_pwd_length + " ��������! ���������� ������� ������ ������� ������"; - } else if (lng == 'ua') { - err_msg = "������� ������ ����� " + min_pwd_length + " �������! ����-����� ������ ������ ������"; - } else { - err_msg = "Password length less than " + min_pwd_length + " characters! Please enter longer password"; - } - alert(err_msg); - oPwd.focus(); - return false; - } else { - if (pwd != oPwdconf.value) { - if (lng == 'ru') { - err_msg = "������ � ��� ������������� �� ���������! ������� ���������� ���������� ������"; - } else if (lng == 'ua') { - err_msg = "������ �� ���� ����������� �� ����������! ������ ����-����� �������� �����"; - } else { - err_msg = "Password and password confirmation aren`t equal! Please enter identical passwords"; - } - alert(err_msg); - oPwd.focus(); - return false; - } else { - return true; - } - } - } else { - return true; - } -} - -function doReset() { - form1.reset(); - init(); -} -var rusChars = new Array('�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�'); -var transChars = new Array('#', 'a', 'b', 'v', 'g', 'd', 'e', 'yo', 'zh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'kh', 'ts', 'ch', 'sh', 'shch', 'e', 'yu', 'ya', 'y', '', '', 'ye', 'i', 'yi'); - -function convert(from) { - if (empty(from)) return; - from = from.toLowerCase(); - var to = ""; - var len = from.length; - var character, isRus; - for (i = 0; i < len; i++) { - character = from.charAt(i, 1); - isRus = false; - j = array_search(character, rusChars); - if (j > -1 && j != false) isRus = true; - to += (isRus) ? transChars[j] : character; - } - return to; -} - -function str2tid(str) { - if (str == '') return false; - str = str.replace(/\s{1,}/gi, "_"); - str = convert(str); - str = str.replace(/[^a-zA-Z0-9_]/gi, ""); - return str; -} - -function IsContain(needle, s) { - var re = new RegExp(needle, "i"); - return re.test(s); -}; -var base_url = $("base").attr("href"); -tmp = $("link[rel=stylesheet]").attr("href"); -if (!empty(tmp)) var domain_url = tmp.substr(0, tmp.indexOf("res/")); - -jQuery.extend({ - setHomepage: function(url) { - if (document.all) { - document.body.style.behavior = 'url(#default#homepage)'; - document.body.setHomePage(url); - } else if (window.sidebar) { - if (window.netscape) { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - } catch (e) { - var strTemp = ''; - strTemp += "this action was aviod by your browser,"; - strTemp += "if you want to enable,please enter about:config in your address line,"; - strTemp += "and change the value of signed.applets.codebase_principal_support to true"; - alert(strTemp); - } - } - var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); - prefs.setCharPref('browser.startup.homepage', url); - } - } -});; -$(document).ready(function() { - $(".button").hover(function() { - $(".cc", $(this)).addClass("cc_h"); - $(".rr", $(this)).addClass("rr_h"); - $(".ll", $(this)).addClass("ll_h"); - }, function() { - $(".cc_h", $(this)).removeClass("cc_h"); - $(".rr_h", $(this)).removeClass("rr_h"); - $(".ll_h", $(this)).removeClass("ll_h"); - }); -});; -var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, currentOpts = {};; -(function($) { - var - selectedIndex = 0, - selectedOpts = {}, - selectedArray = [], - currentIndex = 0, - currentArray = [], - ajaxLoader = null, - imgPreloader = new Image(), - imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, - swfRegExp = /[^\.]\.(swf)\s*$/i, - loadingTimer, loadingFrame = 1, - titleHeight = 0, - titleStr = '', - start_pos, final_pos, busy = false, - fx = $.extend($('
')[0], { - prop: 0 - }), - isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest, - _abort = function() { - loading.hide(); - imgPreloader.onerror = imgPreloader.onload = null; - if (ajaxLoader) { - ajaxLoader.abort(); - } - tmp.empty(); - }, - _error = function() { - if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { - loading.hide(); - busy = false; - return; - } - selectedOpts.titleShow = false; - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - tmp.html('

The requested content cannot be loaded.
Please try again later.

'); - _process_inline(); - }, - _start = function() { - var obj = selectedArray[selectedIndex], - href, type, title, str, emb, ret; - _abort(); - selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); - ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); - if (ret === false) { - busy = false; - return; - } else if (typeof ret == 'object') { - selectedOpts = $.extend(selectedOpts, ret); - } - title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; - if (obj.nodeName && !selectedOpts.orig) { - selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); - } - if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { - title = selectedOpts.orig.attr('alt'); - } - href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; - if ((/^(?:javascript)/i).test(href) || href == '#') { - href = null; - } - if (selectedOpts.type) { - type = selectedOpts.type; - if (!href) { - href = selectedOpts.content; - } - } else if (selectedOpts.content) { - type = 'html'; - } else if (href) { - if (href.match(imgRegExp)) { - type = 'image'; - } else if (href.match(swfRegExp)) { - type = 'swf'; - } else if ($(obj).hasClass("iframe")) { - type = 'iframe'; - } else if (href.indexOf("#") === 0) { - type = 'inline'; - } else { - type = 'ajax'; - } - } - if (!type) { - _error(); - return; - } - if (type == 'inline') { - obj = href.substr(href.indexOf("#")); - type = $(obj).length > 0 ? 'inline' : 'ajax'; - } - selectedOpts.type = type; - selectedOpts.href = href; - selectedOpts.title = title; - if (selectedOpts.autoDimensions) { - if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - } else { - selectedOpts.autoDimensions = false; - } - } - if (selectedOpts.modal) { - selectedOpts.overlayShow = true; - selectedOpts.hideOnOverlayClick = false; - selectedOpts.hideOnContentClick = false; - selectedOpts.enableEscapeButton = false; - selectedOpts.showCloseButton = false; - } - selectedOpts.padding = parseInt(selectedOpts.padding, 10); - selectedOpts.margin = parseInt(selectedOpts.margin, 10); - tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); - $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { - $(this).replaceWith(content.children()); - }); - switch (type) { - case 'html': - tmp.html(selectedOpts.content); - _process_inline(); - break; - case 'inline': - if ($(obj).parent().is('#fancybox-content') === true) { - busy = false; - return; - } - $('
').hide().insertBefore($(obj)).bind('fancybox-cleanup', function() { - $(this).replaceWith(content.children()); - }).bind('fancybox-cancel', function() { - $(this).replaceWith(tmp.children()); - }); - $(obj).appendTo(tmp); - _process_inline(); - break; - case 'image': - busy = false; - $.fancybox.showActivity(); - imgPreloader = new Image(); - imgPreloader.onerror = function() { - _error(); - }; - imgPreloader.onload = function() { - busy = true; - imgPreloader.onerror = imgPreloader.onload = null; - _process_image(); - }; - imgPreloader.src = href; - break; - case 'swf': - selectedOpts.scrolling = 'no'; - str = ''; - emb = ''; - $.each(selectedOpts.swf, function(name, val) { - str += ''; - emb += ' ' + name + '="' + val + '"'; - }); - str += ''; - tmp.html(str); - _process_inline(); - break; - case 'ajax': - busy = false; - $.fancybox.showActivity(); - selectedOpts.ajax.win = selectedOpts.ajax.success; - ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { - url: href, - data: selectedOpts.ajax.data || {}, - error: function(XMLHttpRequest, textStatus, errorThrown) { - if (XMLHttpRequest.status > 0) { - _error(); - } - }, - success: function(data, textStatus, XMLHttpRequest) { - var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; - if (o.status == 200) { - if (typeof selectedOpts.ajax.win == 'function') { - ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); - if (ret === false) { - loading.hide(); - return; - } else if (typeof ret == 'string' || typeof ret == 'object') { - data = ret; - } - } - tmp.html(data); - _process_inline(); - } - } - })); - break; - case 'iframe': - _show(); - break; - } - }, - _process_inline = function() { - var - w = selectedOpts.width, - h = selectedOpts.height; - if (w.toString().indexOf('%') > -1) { - w = parseInt(($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; - } else { - w = w == 'auto' ? 'auto' : w + 'px'; - } - if (h.toString().indexOf('%') > -1) { - h = parseInt(($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; - } else { - h = h == 'auto' ? 'auto' : h + 'px'; - } - tmp.wrapInner('
'); - selectedOpts.width = tmp.width(); - selectedOpts.height = tmp.height(); - _show(); - }, - _process_image = function() { - selectedOpts.width = imgPreloader.width; - selectedOpts.height = imgPreloader.height; - $("").attr({ - 'id': 'fancybox-img', - 'src': imgPreloader.src, - 'alt': selectedOpts.title - }).appendTo(tmp); - _show(); - }, - _show = function() { - var pos, equal; - loading.hide(); - if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - $.event.trigger('fancybox-cancel'); - busy = false; - return; - } - busy = true; - $(content.add(overlay)).unbind(); - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { - wrap.css('height', wrap.height()); - } - currentArray = selectedArray; - currentIndex = selectedIndex; - currentOpts = selectedOpts; - if (currentOpts.overlayShow) { - overlay.css({ - 'background-color': currentOpts.overlayColor, - 'opacity': currentOpts.overlayOpacity, - 'cursor': currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', - 'height': $(document).height() - }); - if (!overlay.is(':visible')) { - if (isIE6) { - $('select:not(#fancybox-tmp select)').filter(function() { - return this.style.visibility !== 'hidden'; - }).css({ - 'visibility': 'hidden' - }).one('fancybox-cleanup', function() { - this.style.visibility = 'inherit'; - }); - } - overlay.show(); - } - } else { - overlay.hide(); - } - final_pos = _get_zoom_to(); - _process_title(); - if (wrap.is(":visible")) { - $(close.add(nav_left).add(nav_right)).hide(); - pos = wrap.position(), start_pos = { - top: pos.top, - left: pos.left, - width: wrap.width(), - height: wrap.height() - }; - equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); - content.fadeTo(currentOpts.changeFade, 0.3, function() { - var finish_resizing = function() { - content.html(tmp.contents()).fadeTo(currentOpts.changeFade, 1, _finish); - }; - $.event.trigger('fancybox-change'); - content.empty().removeAttr('filter').css({ - 'border-width': currentOpts.padding, - 'width': final_pos.width - currentOpts.padding * 2, - 'height': selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }); - if (equal) { - finish_resizing(); - } else { - fx.prop = 0; - $(fx).animate({ - prop: 1 - }, { - duration: currentOpts.changeSpeed, - easing: currentOpts.easingChange, - step: _draw, - complete: finish_resizing - }); - } - }); - return; - } - wrap.removeAttr("style"); - content.css('border-width', currentOpts.padding); - if (currentOpts.transitionIn == 'elastic') { - start_pos = _get_zoom_from(); - content.html(tmp.contents()); - wrap.show(); - if (currentOpts.opacity) { - final_pos.opacity = 0; - } - fx.prop = 0; - $(fx).animate({ - prop: 1 - }, { - duration: currentOpts.speedIn, - easing: currentOpts.easingIn, - step: _draw, - complete: _finish - }); - return; - } - if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { - title.show(); - } - content.css({ - 'width': final_pos.width - currentOpts.padding * 2, - 'height': selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }).html(tmp.contents()); - wrap.css(final_pos).fadeIn(currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish); - }, - _format_title = function(title) { - if (title && title.length) { - if (currentOpts.titlePosition == 'float') { - return '
' + title + '
'; - } - return '
' + title + '
'; - } - return false; - }, - _process_title = function() { - titleStr = currentOpts.title || ''; - titleHeight = 0; - title.empty().removeAttr('style').removeClass(); - if (currentOpts.titleShow === false) { - title.hide(); - return; - } - titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); - if (!titleStr || titleStr === '') { - title.hide(); - return; - } - title.addClass('fancybox-title-' + currentOpts.titlePosition).html(titleStr).appendTo('body').show(); - switch (currentOpts.titlePosition) { - case 'inside': - title.css({ - 'width': final_pos.width - (currentOpts.padding * 2), - 'marginLeft': currentOpts.padding, - 'marginRight': currentOpts.padding - }); - titleHeight = title.outerHeight(true); - title.appendTo(outer); - final_pos.height += titleHeight; - break; - case 'over': - title.css({ - 'marginLeft': currentOpts.padding, - 'width': final_pos.width - (currentOpts.padding * 2), - 'bottom': currentOpts.padding - }).appendTo(outer); - break; - case 'float': - title.css('left', parseInt((title.width() - final_pos.width - 40) / 2, 10) * -1).appendTo(wrap); - break; - default: - title.css({ - 'width': final_pos.width - (currentOpts.padding * 2), - 'paddingLeft': currentOpts.padding, - 'paddingRight': currentOpts.padding - }).appendTo(wrap); - break; - } - title.hide(); - }, - _set_navigation = function() { - if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { - $(document).bind('keydown.fb', function(e) { - if (e.keyCode == 27 && currentOpts.enableEscapeButton) { - e.preventDefault(); - $.fancybox.close(); - } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { - e.preventDefault(); - $.fancybox[e.keyCode == 37 ? 'prev' : 'next'](); - } - }); - } - if (!currentOpts.showNavArrows) { - nav_left.hide(); - nav_right.hide(); - return; - } - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { - nav_left.show(); - } - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length - 1)) { - nav_right.show(); - } - }, - _finish = function() { - if (!$.support.opacity) { - content.get(0).style.removeAttribute('filter'); - wrap.get(0).style.removeAttribute('filter'); - } - if (selectedOpts.autoDimensions) { - content.css('height', 'auto'); - } - wrap.css('height', 'auto'); - if (titleStr && titleStr.length) { - title.show(); - } - if (currentOpts.showCloseButton) { - close.show(); - } - _set_navigation(); - if (currentOpts.hideOnContentClick) { - content.bind('click', $.fancybox.close); - } - if (currentOpts.hideOnOverlayClick) { - overlay.bind('click', $.fancybox.close); - } - $(window).bind("resize.fb", $.fancybox.resize); - if (currentOpts.centerOnScroll) { - $(window).bind("scroll.fb", $.fancybox.center); - } - if (currentOpts.type == 'iframe') { - $('').appendTo(content); - } - wrap.show(); - busy = false; - $.fancybox.center(); - currentOpts.onComplete(currentArray, currentIndex, currentOpts); - _preload_images(); - }, - _preload_images = function() { - var href, objNext; - if ((currentArray.length - 1) > currentIndex) { - href = currentArray[currentIndex + 1].href; - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - if (currentIndex > 0) { - href = currentArray[currentIndex - 1].href; - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - }, - _draw = function(pos) { - var dim = { - width: parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), - height: parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), - top: parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), - left: parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) - }; - if (typeof final_pos.opacity !== 'undefined') { - dim.opacity = pos < 0.5 ? 0.5 : pos; - } - wrap.css(dim); - content.css({ - 'width': dim.width - currentOpts.padding * 2, - 'height': dim.height - (titleHeight * pos) - currentOpts.padding * 2 - }); - }, - _get_viewport = function() { - return [$(window).width() - (currentOpts.margin * 2), $(window).height() - (currentOpts.margin * 2), $(document).scrollLeft() + currentOpts.margin, $(document).scrollTop() + currentOpts.margin]; - }, - _get_zoom_to = function() { - var view = _get_viewport(), - to = {}, - resize = currentOpts.autoScale, - double_padding = currentOpts.padding * 2, - ratio; - if (currentOpts.width.toString().indexOf('%') > -1) { - to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); - } else { - to.width = currentOpts.width + double_padding; - } - if (currentOpts.height.toString().indexOf('%') > -1) { - to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); - } else { - to.height = currentOpts.height + double_padding; - } - if (resize && (to.width > view[0] || to.height > view[1])) { - if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { - ratio = (currentOpts.width) / (currentOpts.height); - if ((to.width) > view[0]) { - to.width = view[0]; - to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); - } - if ((to.height) > view[1]) { - to.height = view[1]; - to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); - } - } else { - to.width = Math.min(to.width, view[0]); - to.height = Math.min(to.height, view[1]); - } - } - to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); - to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); - return to; - }, - _get_obj_pos = function(obj) { - var pos = obj.offset(); - pos.top += parseInt(obj.css('paddingTop'), 10) || 0; - pos.left += parseInt(obj.css('paddingLeft'), 10) || 0; - pos.top += parseInt(obj.css('border-top-width'), 10) || 0; - pos.left += parseInt(obj.css('border-left-width'), 10) || 0; - pos.width = obj.width(); - pos.height = obj.height(); - return pos; - }, - _get_zoom_from = function() { - var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, - from = {}, - pos, view; - if (orig && orig.length) { - pos = _get_obj_pos(orig); - from = { - width: pos.width + (currentOpts.padding * 2), - height: pos.height + (currentOpts.padding * 2), - top: pos.top - currentOpts.padding - 20, - left: pos.left - currentOpts.padding - 20 - }; - } else { - view = _get_viewport(); - from = { - width: currentOpts.padding * 2, - height: currentOpts.padding * 2, - top: parseInt(view[3] + view[1] * 0.5, 10), - left: parseInt(view[2] + view[0] * 0.5, 10) - }; - } - return from; - }, - _animate_loading = function() { - if (!loading.is(':visible')) { - clearInterval(loadingTimer); - return; - } - $('div', loading).css('top', (loadingFrame * -40) + 'px'); - loadingFrame = (loadingFrame + 1) % 12; - }; - $.fn.fancybox = function(options) { - if (!$(this).length) { - return this; - } - $(this).data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))).unbind('click.fb').bind('click.fb', function(e) { - e.preventDefault(); - if (busy) { - return; - } - busy = true; - $(this).blur(); - selectedArray = []; - selectedIndex = 0; - var rel = $(this).attr('rel') || ''; - if (!rel || rel == '' || rel === 'nofollow') { - selectedArray.push(this); - } else { - selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); - selectedIndex = selectedArray.index(this); - } - _start(); - return; - }); - return this; - }; - $.fancybox = function(obj) { - var opts; - if (busy) { - return; - } - busy = true; - opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; - selectedArray = []; - selectedIndex = parseInt(opts.index, 10) || 0; - if ($.isArray(obj)) { - for (var i = 0, j = obj.length; i < j; i++) { - if (typeof obj[i] == 'object') { - $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); - } else { - obj[i] = $({}).data('fancybox', $.extend({ - content: obj[i] - }, opts)); - } - } - selectedArray = jQuery.merge(selectedArray, obj); - } else { - if (typeof obj == 'object') { - $(obj).data('fancybox', $.extend({}, opts, obj)); - } else { - obj = $({}).data('fancybox', $.extend({ - content: obj - }, opts)); - } - selectedArray.push(obj); - } - if (selectedIndex > selectedArray.length || selectedIndex < 0) { - selectedIndex = 0; - } - _start(); - }; - $.fancybox.showActivity = function() { - clearInterval(loadingTimer); - loading.show(); - loadingTimer = setInterval(_animate_loading, 66); - }; - $.fancybox.hideActivity = function() { - loading.hide(); - }; - $.fancybox.next = function() { - return $.fancybox.pos(currentIndex + 1); - }; - $.fancybox.prev = function() { - return $.fancybox.pos(currentIndex - 1); - }; - $.fancybox.pos = function(pos) { - if (busy) { - return; - } - pos = parseInt(pos); - selectedArray = currentArray; - if (pos > -1 && pos < currentArray.length) { - selectedIndex = pos; - _start(); - } else if (currentOpts.cyclic && currentArray.length > 1) { - selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; - _start(); - } - return; - }; - $.fancybox.cancel = function() { - if (busy) { - return; - } - busy = true; - $.event.trigger('fancybox-cancel'); - _abort(); - selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); - busy = false; - }; - $.fancybox.close = function() { - if (busy || wrap.is(':hidden')) { - return; - } - busy = true; - if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - busy = false; - return; - } - _abort(); - $(close.add(nav_left).add(nav_right)).hide(); - $(content.add(overlay)).unbind(); - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); - if (currentOpts.titlePosition !== 'inside') { - title.empty(); - } - wrap.stop(); - - function _cleanup() { - overlay.fadeOut('fast'); - title.empty().hide(); - wrap.hide(); - $.event.trigger('fancybox-cleanup'); - content.empty(); - currentOpts.onClosed(currentArray, currentIndex, currentOpts); - currentArray = selectedOpts = []; - currentIndex = selectedIndex = 0; - currentOpts = selectedOpts = {}; - busy = false; - } - if (currentOpts.transitionOut == 'elastic') { - start_pos = _get_zoom_from(); - var pos = wrap.position(); - final_pos = { - top: pos.top, - left: pos.left, - width: wrap.width(), - height: wrap.height() - }; - if (currentOpts.opacity) { - final_pos.opacity = 1; - } - title.empty().hide(); - fx.prop = 1; - $(fx).animate({ - prop: 0 - }, { - duration: currentOpts.speedOut, - easing: currentOpts.easingOut, - step: _draw, - complete: _cleanup - }); - } else { - wrap.fadeOut(currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); - } - }; - $.fancybox.resize = function() { - if (overlay.is(':visible')) { - overlay.css('height', $(document).height()); - } - $.fancybox.center(true); - }; - $.fancybox.center = function() { - var view, align; - if (busy) { - return; - } - align = arguments[0] === true ? 1 : 0; - view = _get_viewport(); - if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { - return; - } - wrap.stop().animate({ - 'top': parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), - 'left': parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) - }, typeof arguments[0] == 'number' ? arguments[0] : 200); - }; - $.fancybox.init = function() { - if ($("#fancybox-wrap").length) { - return; - } - tmp = $('
'); - loading = $('
'); - overlay = $('
'); - wrap = $('
'); - $('body').append(tmp, loading, overlay, wrap); - outer = $('
').append('
').appendTo(wrap); - outer.append(content = $('
'), close = $(''), title = $('
'), nav_left = $(''), nav_right = $('')); - close.click($.fancybox.close); - loading.click($.fancybox.cancel); - nav_left.click(function(e) { - e.preventDefault(); - $.fancybox.prev(); - }); - nav_right.click(function(e) { - e.preventDefault(); - $.fancybox.next(); - }); - if ($.fn.mousewheel) { - wrap.bind('mousewheel.fb', function(e, delta) { - if (busy) { - e.preventDefault(); - } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { - e.preventDefault(); - $.fancybox[delta > 0 ? 'prev' : 'next'](); - } - }); - } - if (!$.support.opacity) { - wrap.addClass('fancybox-ie'); - } - if (isIE6) { - loading.addClass('fancybox-ie6'); - wrap.addClass('fancybox-ie6'); - $('').prependTo(outer); - } - }; - $.fn.fancybox.defaults = { - padding: 10, - margin: 40, - opacity: false, - modal: false, - cyclic: false, - scrolling: 'auto', - width: 560, - height: 340, - autoScale: true, - autoDimensions: true, - centerOnScroll: false, - ajax: {}, - swf: { - wmode: 'transparent' - }, - hideOnOverlayClick: true, - hideOnContentClick: false, - overlayShow: true, - overlayOpacity: 0.7, - overlayColor: '#777', - titleShow: true, - titlePosition: 'float', - titleFormat: null, - titleFromAlt: false, - transitionIn: 'fade', - transitionOut: 'fade', - speedIn: 300, - speedOut: 300, - changeSpeed: 300, - changeFade: 'fast', - easingIn: 'swing', - easingOut: 'swing', - showCloseButton: true, - showNavArrows: true, - enableEscapeButton: true, - enableKeyboardNav: true, - onStart: function() {}, - onCancel: function() {}, - onComplete: function() {}, - onCleanup: function() {}, - onClosed: function() {}, - onError: function() {} - }; - $(document).ready(function() { - $.fancybox.init(); - }); -})(jQuery);; -eval(function(p, a, c, k, e, r) { - e = function(c) { - return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) - }; - if (!''.replace(/^/, String)) { - while (c--) r[e(c)] = k[c] || e(c); - k = [function(e) { - return r[e] - }]; - e = function() { - return '\\w+' - }; - c = 1 - }; - while (c--) - if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); - return p -}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t 1) { - $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass); - for (var i = 0; i < elements.length; i++) { - $(elements[i]).css('z-index', String(elements.length - i)).css('position', 'absolute').hide(); - }; - if (settings.type == "sequence") { - setTimeout(function() { - $.innerfade.next(elements, settings, 1, 0); - }, settings.timeout); - $(elements[0]).show(); - } else if (settings.type == "random") { - var last = Math.floor(Math.random() * (elements.length)); - setTimeout(function() { - do { - current = Math.floor(Math.random() * (elements.length)); - } while (last == current); - $.innerfade.next(elements, settings, current, last); - }, settings.timeout); - $(elements[last]).show(); - } else if (settings.type == 'random_start') { - settings.type = 'sequence'; - var current = Math.floor(Math.random() * (elements.length)); - setTimeout(function() { - $.innerfade.next(elements, settings, (current + 1) % elements.length, current); - }, settings.timeout); - $(elements[current]).show(); - } else { - alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\''); - } - } - }; - $.innerfade.next = function(elements, settings, current, last) { - if (settings.animationtype == 'slide') { - $(elements[last]).slideUp(settings.speed); - $(elements[current]).slideDown(settings.speed); - } else if (settings.animationtype == 'fade') { - $(elements[last]).fadeOut(settings.speed); - $(elements[current]).fadeIn(settings.speed, function() { - removeFilter($(this)[0]); - }); - } else - alert('Innerfade-animationtype must either be \'slide\' or \'fade\''); - if (settings.type == "sequence") { - if ((current + 1) < elements.length) { - current = current + 1; - last = current - 1; - } else { - current = 0; - last = elements.length - 1; - } - } else if (settings.type == "random") { - last = current; - while (current == last) - current = Math.floor(Math.random() * elements.length); - } else - alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\''); - setTimeout((function() { - $.innerfade.next(elements, settings, current, last); - }), settings.timeout); - }; -})(jQuery); - -function removeFilter(element) { - if (element.style.removeAttribute) { - element.style.removeAttribute('filter'); - } -}; -jQuery.fn.extend({ - everyTime: function(interval, label, fn, times, belay) { - return this.each(function() { - jQuery.timer.add(this, interval, label, fn, times, belay); - }); - }, - oneTime: function(interval, label, fn) { - return this.each(function() { - jQuery.timer.add(this, interval, label, fn, 1); - }); - }, - stopTime: function(label, fn) { - return this.each(function() { - jQuery.timer.remove(this, label, fn); - }); - } -}); -jQuery.extend({ - timer: { - guid: 1, - global: {}, - regex: /^([0-9]+)\s*(.*s)?$/, - powers: { - 'ms': 1, - 'cs': 10, - 'ds': 100, - 's': 1000, - 'das': 10000, - 'hs': 100000, - 'ks': 1000000 - }, - timeParse: function(value) { - if (value == undefined || value == null) - return null; - var result = this.regex.exec(jQuery.trim(value.toString())); - if (result[2]) { - var num = parseInt(result[1], 10); - var mult = this.powers[result[2]] || 1; - return num * mult; - } else { - return value; - } - }, - add: function(element, interval, label, fn, times, belay) { - var counter = 0; - if (jQuery.isFunction(label)) { - if (!times) - times = fn; - fn = label; - label = interval; - } - interval = jQuery.timer.timeParse(interval); - if (typeof interval != 'number' || isNaN(interval) || interval <= 0) - return; - if (times && times.constructor != Number) { - belay = !!times; - times = 0; - } - times = times || 0; - belay = belay || false; - if (!element.$timers) - element.$timers = {}; - if (!element.$timers[label]) - element.$timers[label] = {}; - fn.$timerID = fn.$timerID || this.guid++; - var handler = function() { - if (belay && this.inProgress) - return; - this.inProgress = true; - if ((++counter > times && times !== 0) || fn.call(element, counter) === false) - jQuery.timer.remove(element, label, fn); - this.inProgress = false; - }; - handler.$timerID = fn.$timerID; - if (!element.$timers[label][fn.$timerID]) - element.$timers[label][fn.$timerID] = window.setInterval(handler, interval); - if (!this.global[label]) - this.global[label] = []; - this.global[label].push(element); - }, - remove: function(element, label, fn) { - var timers = element.$timers, - ret; - if (timers) { - if (!label) { - for (label in timers) - this.remove(element, label, fn); - } else if (timers[label]) { - if (fn) { - if (fn.$timerID) { - window.clearInterval(timers[label][fn.$timerID]); - delete timers[label][fn.$timerID]; - } - } else { - for (var fn in timers[label]) { - window.clearInterval(timers[label][fn]); - delete timers[label][fn]; - } - } - for (ret in timers[label]) break; - if (!ret) { - ret = null; - delete timers[label]; - } - } - for (ret in timers) break; - if (!ret) - element.$timers = null; - } - } - } -});; -$(document).ready(function() { - $("#search_str_").keyup(function() { - var qstr = $(this).val(); - if (qstr.length > 1) { - $.ajax({ - type: "POST", - url: "/ajax/quick_search.php", - data: "qstr=" + qstr, - success: function(html) { - $("#out_qsearch").html(html); - $("#out_qsearch").show(); - } - }); - } else { - $("#out_qsearch").html(""); - } - }); - $("#sform").mouseenter(function() { - $("#out_qsearch").show(); - }); - $("#sform").mouseleave(function() { - $("#out_qsearch").hide(); - }); -});; - - -! function(a) { - "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery) -} -(function(a) { - var b, c = navigator.userAgent, - d = /iphone/i.test(c), - e = /chrome/i.test(c), - f = /android/i.test(c); - a.mask = { - definitions: { - 9: "[0-9]", - a: "[A-Za-z]", - "*": "[A-Za-z0-9]" - }, - autoclear: !0, - dataName: "rawMaskFn", - placeholder: "_" - }, a.fn.extend({ - caret: function(a, b) { - var c; - if (0 !== this.length && !this.is(":hidden")) return "number" == typeof a ? (b = "number" == typeof b ? b : a, this.each(function() { - this.setSelectionRange ? this.setSelectionRange(a, b) : this.createTextRange && (c = this.createTextRange(), c.collapse(!0), c.moveEnd("character", b), c.moveStart("character", a), c.select()) - })) : (this[0].setSelectionRange ? (a = this[0].selectionStart, b = this[0].selectionEnd) : document.selection && document.selection.createRange && (c = document.selection.createRange(), a = 0 - c.duplicate().moveStart("character", -1e5), b = a + c.text.length), { - begin: a, - end: b - }) - }, - unmask: function() { - return this.trigger("unmask") - }, - mask: function(c, g) { - var h, i, j, k, l, m, n, o; - if (!c && this.length > 0) { - h = a(this[0]); - var p = h.data(a.mask.dataName); - return p ? p() : void 0 - } - return g = a.extend({ - autoclear: a.mask.autoclear, - placeholder: a.mask.placeholder, - completed: null - }, g), i = a.mask.definitions, j = [], k = n = c.length, l = null, a.each(c.split(""), function(a, b) { - "?" == b ? (n--, k = a) : i[b] ? (j.push(new RegExp(i[b])), null === l && (l = j.length - 1), k > a && (m = j.length - 1)) : j.push(null) - }), this.trigger("unmask").each(function() { - function h() { - if (g.completed) { - for (var a = l; m >= a; a++) - if (j[a] && C[a] === p(a)) return; - g.completed.call(B) - } - } - - function p(a) { - return g.placeholder.charAt(a < g.placeholder.length ? a : 0) - } - - function q(a) { - for (; ++a < n && !j[a];); - return a - } - - function r(a) { - for (; --a >= 0 && !j[a];); - return a - } - - function s(a, b) { - var c, d; - if (!(0 > a)) { - for (c = a, d = q(b); n > c; c++) - if (j[c]) { - if (!(n > d && j[c].test(C[d]))) break; - C[c] = C[d], C[d] = p(d), d = q(d) - } - z(), B.caret(Math.max(l, a)) - } - } - - function t(a) { - var b, c, d, e; - for (b = a, c = p(a); n > b; b++) - if (j[b]) { - if (d = q(b), e = C[b], C[b] = c, !(n > d && j[d].test(e))) break; - c = e - } - } - - function u() { - var a = B.val(), - b = B.caret(); - if (o && o.length && o.length > a.length) { - for (A(!0); b.begin > 0 && !j[b.begin - 1];) b.begin--; - if (0 === b.begin) - for (; b.begin < l && !j[b.begin];) b.begin++; - B.caret(b.begin, b.begin) - } else { - for (A(!0); b.begin < n && !j[b.begin];) b.begin++; - B.caret(b.begin, b.begin) - } - h() - } - - function v() { - A(), B.val() != E && B.change() - } - - function w(a) { - if (!B.prop("readonly")) { - var b, c, e, f = a.which || a.keyCode; - o = B.val(), 8 === f || 46 === f || d && 127 === f ? (b = B.caret(), c = b.begin, e = b.end, e - c === 0 && (c = 46 !== f ? r(c) : e = q(c - 1), e = 46 === f ? q(e) : e), y(c, e), s(c, e - 1), a.preventDefault()) : 13 === f ? v.call(this, a) : 27 === f && (B.val(E), B.caret(0, A()), a.preventDefault()) - } - } - - function x(b) { - if (!B.prop("readonly")) { - var c, d, e, g = b.which || b.keyCode, - i = B.caret(); - if (!(b.ctrlKey || b.altKey || b.metaKey || 32 > g) && g && 13 !== g) { - if (i.end - i.begin !== 0 && (y(i.begin, i.end), s(i.begin, i.end - 1)), c = q(i.begin - 1), n > c && (d = String.fromCharCode(g), j[c].test(d))) { - if (t(c), C[c] = d, z(), e = q(c), f) { - var k = function() { - a.proxy(a.fn.caret, B, e)() - }; - setTimeout(k, 0) - } else B.caret(e); - i.begin <= m && h() - } - b.preventDefault() - } - } - } - - function y(a, b) { - var c; - for (c = a; b > c && n > c; c++) j[c] && (C[c] = p(c)) - } - - function z() { - B.val(C.join("")) - } - - function A(a) { - var b, c, d, e = B.val(), - f = -1; - for (b = 0, d = 0; n > b; b++) - if (j[b]) { - for (C[b] = p(b); d++ < e.length;) - if (c = e.charAt(d - 1), j[b].test(c)) { - C[b] = c, f = b; - break - } - if (d > e.length) { - y(b + 1, n); - break - } - } else C[b] === e.charAt(d) && d++, k > b && (f = b); - return a ? z() : k > f + 1 ? g.autoclear || C.join("") === D ? (B.val() && B.val(""), y(0, n)) : z() : (z(), B.val(B.val().substring(0, f + 1))), k ? b : l - } - var B = a(this), - C = a.map(c.split(""), function(a, b) { - return "?" != a ? i[a] ? p(b) : a : void 0 - }), - D = C.join(""), - E = B.val(); - B.data(a.mask.dataName, function() { - return a.map(C, function(a, b) { - return j[b] && a != p(b) ? a : null - }).join("") - }), B.one("unmask", function() { - B.off(".mask").removeData(a.mask.dataName) - }).on("focus.mask", function() { - if (!B.prop("readonly")) { - clearTimeout(b); - var a; - E = B.val(), a = A(), b = setTimeout(function() { - B.get(0) === document.activeElement && (z(), a == c.replace("?", "").length ? B.caret(0, a) : B.caret(a)) - }, 10) - } - }).on("blur.mask", v).on("keydown.mask", w).on("keypress.mask", x).on("input.mask paste.mask", function() { - B.prop("readonly") || setTimeout(function() { - var a = A(!0); - B.caret(a), h() - }, 0) - }), e && f && B.off("input.mask").on("input.mask", u), A() - }) - } - }) -});; -$(document).ready(function() { - $(window).scroll(function() { - if ($(this).scrollTop() >= 200) { - $('.up_arr').css('display', 'block'); - } else { - $('.up_arr').css('display', 'none'); - } - }); - $(".up_arr").on("click", function() { - $("html, body").animate({ - scrollTop: 0 - }, 'slow'); - return false; - }); -// $(document).on("click", '.plus', function() { -// var input = $(this).parent().find('input'); -// var sp = parseFloat($(input).val()); -// if (sp > 100) { -// $(this).parent().find('.minus').attr('class', '').addClass('plus-disabled'); -// $(input).val(sp + 1); -// } else if (sp >= 0 && sp < 100) { -// $(this).parent().find('.minus-disabled').attr('class', '').addClass('minus'); -// $(input).val(sp + 1); -// } -// if (typeof save_cart == 'function') { -// if (!$(input).hasClass('qtyInput')) { -// save_cart($("#buyForm #prod_id").val(), $("#buyForm input.prod_count").val()); -// } else { -// save_cart($(input).prop('lang'), $(input).val(), $(this).closest("table.order_details")); -// } -// } -// }); -// $(document).on("click", '.minus', function() { -// var input = $(this).parent().find('input'); -// var sp = parseFloat($(input).val()); -// if (sp > 2 && sp < 100) { -// $(input).val(sp - 1); -// } else if (sp = 2) { -// $(this).parent().find('.minus').attr('class', '').addClass('minus-disabled'); -// $(input).val(sp - 1); -// } -// if (typeof save_cart == 'function') -// if (!$(input).hasClass('qtyInput')) { -// save_cart($("#buyForm #prod_id").val(), $("#buyForm input.prod_count").val()); -// } else { -// save_cart($(input).prop('lang'), $(input).val(), $(this).closest("table.order_details")); -// } -// }); -// $(".count_choise input").keydown(function(e) { -// if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 || (e.keyCode == 65 && e.ctrlKey === true) || (e.keyCode >= 35 && e.keyCode <= 39)) { -// return; -// } -// if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { -// e.preventDefault(); -// } -// }); - $('.properties_block .block_title').on('click', function() { - properties_block = $(this).parent(); - if (properties_block.hasClass('closed')) { - properties_block.removeClass('closed'); - properties_block.addClass('opened'); - properties_block.find('.chechboxes').show(100); - } else { - properties_block.removeClass('opened'); - properties_block.addClass('closed'); - properties_block.find('.chechboxes').hide(100); - } - }); - $('#header_feedback form button').on('click', function() { - $('#header_feedback form input').css('display', 'inline-block'); - $(this).html('Перезвоните мне '); - return false; - }); - $('.img_part').height($('.info').height()); - currentScroll = $(window).scrollTop(); - if (currentScroll > 0) { - $('#top-cart-content').addClass('small-cart'); - } else { - $('#top-cart-content').removeClass('small-cart'); - } - $(window).scroll(function() { - currentScroll = $(window).scrollTop(); - if (currentScroll > 0) { - $('#top-cart-content').addClass('small-cart'); - } else { - $('#top-cart-content').removeClass('small-cart'); - } - }); - $(".bsales").mouseover(function() { - $("#bs_box").animate({ - "opacity": 1 - }, 300); - }); - $(".bsales").mouseleave(function() { - $("#bs_box").animate({ - "opacity": 0 - }, 300); - }); - prev_img_url = $('#catSlider #myCarousel').find('.item.active .cat-slide-part img').attr('src'); - next_img_url = $('#catSlider #myCarousel').find('.item.active .cat-slide-part img').attr('src'); - $('#catSlider #myCarousel').find('.img-nav.img-prev').attr('src', prev_img_url); - $('#catSlider #myCarousel').find('.img-nav.img-next').attr('src', next_img_url); - $('#myCarousel').carousel({ - interval: 10000 - }); - $('#catSlider #myCarousel').bind('slide.bs.carousel', function(e) { - prev_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); - next_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); - $(this).find('.img-nav.img-prev').attr('src', prev_img_url); - $(this).find('.img-nav.img-next').attr('src', next_img_url); - }); - - - prev_img_url = $('#catSlider #topCarousel').find('.item.active .cat-slide-part img').attr('src'); - next_img_url = $('#catSlider #topCarousel').find('.item.active .cat-slide-part img').attr('src'); - $('#catSlider #topCarousel').find('.img-nav.img-prev').attr('src', prev_img_url); - $('#catSlider #topCarousel').find('.img-nav.img-next').attr('src', next_img_url); - $('#topCarousel').carousel({ - interval: 10000 - }); - $('#catSlider #topCarousel').bind('slide.bs.carousel', function(e) { - prev_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); - next_img_url = $(this).find('.item.active .cat-slide-part img').attr('src'); - $(this).find('.img-nav.img-prev').attr('src', prev_img_url); - $(this).find('.img-nav.img-next').attr('src', next_img_url); - }); - - - - $('ul.view_type .view_mini_table').on('click', function() { - $('.catalog_product_list').removeClass('view_list'); - $('.catalog_product_list').addClass('view_mini_table'); - $(this).addClass('selected'); - $('.view_table').removeClass('selected'); - $('.view_list').removeClass('selected'); - }); - $('ul.view_type .view_table').on('click', function() { - $('.catalog_product_list').removeClass('view_mini_table'); - $('.catalog_product_list').removeClass('view_list'); - $(this).addClass('selected'); - $('.view_mini_table').removeClass('selected'); - $('.view_list').removeClass('selected'); - }); - $('ul.view_type .view_list').on('click', function() { - $('.catalog_product_list').removeClass('view_mini_table'); - $('.catalog_product_list').addClass('view_list'); - $(this).addClass('selected'); - $('.view_table').removeClass('selected'); - $('.view_mini_table').removeClass('selected'); - }); - $('.phone-select').click(function() { - $('.dropdown-popup.popup-phone-operators').slideToggle(); - return false; - }); - $('.phone-select-header').click(function() { - $('.dropdown-popup-header.popup-phone-operators-header').slideToggle(); - return false; - }); - $(':not(.phone-select)').click(function() { - $('.dropdown-popup.popup-phone-operators').hide(); - }); - $(':not(.phone-select-header)').click(function() { - $('.dropdown-popup-header.popup-phone-operators-header').hide(); - }); - $('.city-phone').click(function() { - $('.dropdown-popup.popup-city-phones').slideToggle(); - return false; - }); - $('.city-phone-header').click(function() { - $('.dropdown-popup-header.popup-city-phones-header').slideToggle(); - return false; - }); - $(':not(.city-phone)').click(function() { - $('.dropdown-popup.popup-city-phones').hide(); - }); - $(':not(.city-phone-header)').click(function() { - $('.dropdown-popup-header.popup-city-phones-header').hide(); - }); - $('.popup-city-phones .kiev').click(function() { - $('.city_block_har').hide(); - $('.city_block_kiev').show(); - $('.call_block_title .city-phone').html('Киевe'); - }); - $('.popup-city-phones-header .kiev').click(function() { - $('.city_block_har_header').hide(); - $('.city_block_kiev_header').show(); - $('.call_block_header_title .city-phone-header').html('Киев'); - }); - $('.popup-city-phones .har').click(function() { - $('.city_block_kiev').hide(); - $('.city_block_har').show(); - $('.call_block_title .city-phone').html('Харькове'); - }); - $('.popup-city-phones-header .har').click(function() { - $('.city_block_kiev_header').hide(); - $('.city_block_har_header').show(); - $('.call_block_header_title .city-phone-header').html('Харьков'); - }); - $('.popup-phone-operators .life').click(function() { - $('.popup-phone-operators p').show(); - $(this).hide(); - $('.call_block .phones .phone').addClass('hide-operator'); - $('.call_block .phones .phone.life').removeClass('hide-operator'); - $('.phone-select > span').first().removeClass().addClass('select-left-life'); - }); - $('.popup-phone-operators-header .life').click(function() { - $('.popup-phone-operators-header p').show(); - $(this).hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.life').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-life'); - }); - $('.popup-phone-operators .kstar').click(function() { - $('.popup-phone-operators p').show(); - $(this).hide(); - $('.call_block .phones .phone').addClass('hide-operator'); - $('.call_block .phones .phone.kstar').removeClass('hide-operator'); - $('.phone-select > span').first().removeClass().addClass('select-left-kstar'); - }); - $('.popup-phone-operators-header .kstar').click(function() { - $('.popup-phone-operators-header p').show(); - $(this).hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.kstar').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-kstar'); - }); - $('.popup-phone-operators .landline').click(function() { - $('.popup-phone-operators p').show(); - $(this).hide(); - $('.call_block .phones .phone').addClass('hide-operator'); - $('.call_block .phones .phone.landline').removeClass('hide-operator'); - $('.phone-select > span').first().removeClass().addClass('select-left-landline'); - }); - $('.popup-phone-operators-header .landline').click(function() { - $('.popup-phone-operators-header p').show(); - $(this).hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.landline').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-landline'); - }); - $('.popup-phone-operators .mts').click(function() { - $('.popup-phone-operators p').show(); - $(this).hide(); - $('.call_block .phones .phone').addClass('hide-operator'); - $('.call_block .phones .phone.mts').removeClass('hide-operator'); - $('.phone-select > span').first().removeClass().addClass('select-left-mts'); - }); - $('.popup-phone-operators-header .mts').click(function() { - $('.popup-phone-operators-header p').show(); - $(this).hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.mts').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-mts'); - }); - $('.popup-phone-operators-header p').click(function() { - $('.phone-select-header').addClass('wasclicked'); - }); - - function changePhone() { - if (!$('.phone-select-header').hasClass('wasclicked')) { - operator = $('.city_blocks_header .city_block_kiev_header .phone-select-header span').first().attr('class'); - if (operator == 'select-left-landline') { - $('.popup-phone-operators-header p').show(); - $('.popup-phone-operators-header .mts').hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.mts').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-mts'); - } else if (operator == 'select-left-mts') { - $('.popup-phone-operators-header p').show(); - $('.popup-phone-operators-header .kstar').hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.kstar').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-kstar'); - } else { - $('.popup-phone-operators-header p').show(); - $('.popup-phone-operators-header .landline').hide(); - $('.call_block_header .phones-header .phone').addClass('hide-operator'); - $('.call_block_header .phones-header .phone.landline').removeClass('hide-operator'); - $('.phone-select-header > span:first-child').removeClass().addClass('select-left-landline'); - } - } - } - $(function() { - setInterval(changePhone, 15000); - }); -}); - -function format_money(sum, format) { - if (typeof format === 'undefined') format = false; - sum = parseFloat(sum).toFixed(2); - sum = sum.toString(); - sum = sum.replace(/\,/g, "."); - var parts = sum.split("."); - var out = parts[0] + ((!format) ? ' грн. ' : '.'); - if (parts[1]) out = out + parts[1].substr(0, 2) + ((!format) ? ' коп.' : ' грн. '); - return out; -}; -/*! - Zoom 1.7.14 - license: MIT - http://www.jacklmoore.com/zoom - */ -(function($) { - var defaults = { - url: false, - callback: false, - target: false, - duration: 120, - on: "mouseover", - touch: true, - onZoomIn: false, - onZoomOut: false, - magnify: 1 - }; - $.zoom = function(target, source, img, magnify) { - var targetHeight, targetWidth, sourceHeight, sourceWidth, xRatio, yRatio, offset, $target = $(target), - position = $target.css("position"), - $source = $(source); - $target.css("position", /(absolute|fixed)/.test(position) ? position : "relative"); - $target.css("overflow", "hidden"); - img.style.width = img.style.height = ""; - $(img).addClass("zoomImg").css({ - position: "absolute", - top: 0, - left: 0, - opacity: 0, - width: img.width * magnify, - height: img.height * magnify, - border: "none", - maxWidth: "none", - maxHeight: "none" - }).appendTo(target); - return { - init: function() { - targetWidth = $target.outerWidth(); - targetHeight = $target.outerHeight(); - if (source === $target[0]) { - sourceWidth = targetWidth; - sourceHeight = targetHeight - } else { - sourceWidth = $source.outerWidth(); - sourceHeight = $source.outerHeight() - } - xRatio = (img.width - targetWidth) / sourceWidth; - yRatio = (img.height - targetHeight) / sourceHeight; - offset = $source.offset() - }, - move: function(e) { - var left = e.pageX - offset.left, - top = e.pageY - offset.top; - top = Math.max(Math.min(top, sourceHeight), 0); - left = Math.max(Math.min(left, sourceWidth), 0); - img.style.left = left * -xRatio + "px"; - img.style.top = top * -yRatio + "px" - } - } - }; - $.fn.zoom = function(options) { - return this.each(function() { - var settings = $.extend({}, defaults, options || {}), - target = settings.target || this, - source = this, - $source = $(source), - $target = $(target), - img = document.createElement("img"), - $img = $(img), - mousemove = "mousemove.zoom", - clicked = false, - touched = false, - $urlElement; - if (!settings.url) { - $urlElement = $source.find("img"); - if ($urlElement[0]) { - settings.url = $urlElement.data("src") || $urlElement.attr("src") - } - if (!settings.url) { - return - } - }(function() { - var position = $target.css("position"); - var overflow = $target.css("overflow"); - $source.one("zoom.destroy", function() { - $source.off(".zoom"); - $target.css("position", position); - $target.css("overflow", overflow); - $img.remove() - }) - })(); - img.onload = function() { - var zoom = $.zoom(target, source, img, settings.magnify); - - function start(e) { - zoom.init(); - zoom.move(e); - $img.stop().fadeTo($.support.opacity ? settings.duration : 0, 1, $.isFunction(settings.onZoomIn) ? settings.onZoomIn.call(img) : false) - } - - function stop() { - $img.stop().fadeTo(settings.duration, 0, $.isFunction(settings.onZoomOut) ? settings.onZoomOut.call(img) : false) - } - if (settings.on === "grab") { - $source.on("mousedown.zoom", function(e) { - if (e.which === 1) { - $(document).one("mouseup.zoom", function() { - stop(); - $(document).off(mousemove, zoom.move) - }); - start(e); - $(document).on(mousemove, zoom.move); - e.preventDefault() - } - }) - } else if (settings.on === "click") { - $source.on("click.zoom", function(e) { - if (clicked) { - return - } else { - clicked = true; - start(e); - $(document).on(mousemove, zoom.move); - $(document).one("click.zoom", function() { - stop(); - clicked = false; - $(document).off(mousemove, zoom.move) - }); - return false - } - }) - } else if (settings.on === "toggle") { - $source.on("click.zoom", function(e) { - if (clicked) { - stop() - } else { - start(e) - } - clicked = !clicked - }) - } else if (settings.on === "mouseover") { - zoom.init(); - $source.on("mouseenter.zoom", start).on("mouseleave.zoom", stop).on(mousemove, zoom.move) - } - if (settings.touch) { - $source.on("touchstart.zoom", function(e) { - e.preventDefault(); - if (touched) { - touched = false; - stop() - } else { - touched = true; - start(e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]) - } - }).on("touchmove.zoom", function(e) { - e.preventDefault(); - zoom.move(e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]) - }) - } - if ($.isFunction(settings.callback)) { - settings.callback.call(img) - } - }; - img.src = settings.url - }) - }; - $.fn.zoom.defaults = defaults -})(window.jQuery); \ No newline at end of file diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 0794d0c..f54add0 100755 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -66,8 +66,6 @@ $(document).on('click', '#ordersFrom .cart_remove', function(e) { /*end order basket form js logic*/ - - $(document).on('click', '.buy_button', function(e) { e.preventDefault(); var product_variant_id = $(this).data('id'); -- libgit2 0.21.4