uawdijnntqw1x1x1
IP : 216.73.216.163
Hostname : yjpwxulqtt
Kernel : Linux yjpwxulqtt 5.15.0-126-generic #136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
OS : Linux
PATH:
/
home
/
user
/
web
/
pansionat-v-yaroslavle.ru
/
public_html
/
.
/
bitrix
/
templates
/
-new-year
/
js
/
general.js
/
/
CheckTopMenuDotted = function(){ var menu = $('nav.mega-menu'); var menuMoreItem = menu.find('td.js-dropdown'); if(menu.parents('.collapse').css('display') == 'none'){ return false; } var block_w = menu.closest('div').actual('width'); var menu_w = menu.find('table').actual('outerWidth'); var afterHide = false; var h_block=h_block_top=0; while(menu_w > block_w) { menuItemOldSave = menu.find('td').not('.nosave').last(); if(menuItemOldSave.length){ menuMoreItem.show(); // if(menuItemOldSave.find('.wrap > a').length){ // h_block=menuItemOldSave.find('.wrap > a').actual( 'outerHeight' )-15; h_block=39; // } if(menuItemOldSave.find('.wrap .dropdown-menu').length){ h_block_top=menuItemOldSave.find('.wrap .dropdown-menu').actual( 'outerHeight' ); h_block_top=h_block_top/2; } menuItemNewSave = '<li class="' + (menuItemOldSave.hasClass('dropdown') ? 'dropdown-submenu ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + menu_w + '" style="height:'+h_block+'px"><div class="slide_wrapp" style="padding-bottom:'+h_block_top+'px">' + menuItemOldSave.find('.wrap').html() + '</div></li>'; menuItemOldSave.remove(); menuMoreItem.find('> .wrap > .dropdown-menu').prepend(menuItemNewSave); menu_w = menu.find('table').actual('outerWidth'); afterHide = true; } else{ break; } } if(!afterHide) { do { var menuItemOldSaveCnt = menuMoreItem.find('.dropdown-menu').find('li').length; menuItemOldSave = menuMoreItem.find('.dropdown-menu').find('li').first(); if(!menuItemOldSave.length) { menuMoreItem.hide(); break; } else { var hideWidth = menuItemOldSave.attr('data-hidewidth'); if(hideWidth > block_w) { break } else { // menuItemOldSave.replace() console.log(menuItemOldSave.html()); menuItemNewSave = '<td class="' + (menuItemOldSave.hasClass('dropdown-submenu') ? 'dropdown ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + block_w + '"><div class="wrap">' + menuItemOldSave.html() + '</div></td>'; menuItemOldSave.remove(); $(menuItemNewSave).insertBefore(menu.find('td.js-dropdown')); if(!menuItemOldSaveCnt) { menuMoreItem.hide(); break; } } } menu_w = menu.find('table').actual('outerWidth'); } while(menu_w <= block_w); } menu.find('td').css('visibility', 'visible'); return false; } CheckTopVisibleMenu = function(that) { var dropdownMenu = $('.dropdown-menu:not(.fixed_menu_ext):visible').last(); if(dropdownMenu.length){ dropdownMenu.find('a').css('white-space', ''); dropdownMenu.css('left', ''); dropdownMenu.css('right', ''); dropdownMenu.removeClass('toright'); var dropdownMenu_left = dropdownMenu.offset().left; if(typeof(dropdownMenu_left) != 'undefined'){ var menu = dropdownMenu.parents('.mega-menu'); var menu_width = menu.outerWidth(); var menu_left = menu.offset().left; var menu_right = menu_left + menu_width; var isToRight = dropdownMenu.parents('.toright').length > 0; var parentsDropdownMenus = dropdownMenu.parents('.dropdown-menu:not(.fixed_menu_ext)'); var isHasParentDropdownMenu = parentsDropdownMenus.length > 0; if(isHasParentDropdownMenu){ var parentDropdownMenu_width = parentsDropdownMenus.first().outerWidth(); var parentDropdownMenu_left = parentsDropdownMenus.first().offset().left; var parentDropdownMenu_right = parentDropdownMenu_width + parentDropdownMenu_left; } if(parentDropdownMenu_right + dropdownMenu.outerWidth() > menu_right){ dropdownMenu.find('a').css('white-space', 'normal'); } var dropdownMenu_width = dropdownMenu.outerWidth(); var dropdownMenu_right = dropdownMenu_left + dropdownMenu_width; if(dropdownMenu_right > menu_right || isToRight){ var addleft = 0; addleft = menu_right - dropdownMenu_right; if(isHasParentDropdownMenu || isToRight){ dropdownMenu.css('left', 'auto'); dropdownMenu.css('right', '100%'); dropdownMenu.addClass('toright'); } else{ var dropdownMenu_curLeft = parseInt(dropdownMenu.css('left')); dropdownMenu.css('left', (dropdownMenu_curLeft + addleft) + 'px'); } } } } } CheckPopupTop = function(){ var popup = $('.jqmWindow.show'); if(popup.length){ var documentScollTop = $(document).scrollTop(); var windowHeight = $(window).height(); var popupTop = parseInt(popup.css('top')); var popupHeight = popup.height(); var popupWidth = parseInt(popup.css('width')); if(windowHeight >= popupHeight){ // center popupTop = (windowHeight - popupHeight) / 2; } else{ if(documentScollTop > documentScrollTopLast){ // up popupTop -= documentScollTop - documentScrollTopLast; } else if(documentScollTop < documentScrollTopLast){ // down popupTop += documentScrollTopLast - documentScollTop; } if(popupTop + popupHeight < windowHeight){ // bottom popupTop = windowHeight - popupHeight; } else if(popupTop > 0){ // top popupTop = 0; } } console.log(-popupWidth/2); popup.css('margin-left', -popupWidth/2 + 'px'); popup.css('top', popupTop + 'px'); } } CheckMainBannerSliderVText = function(slider){ if(slider.parents('.banners-big').length){ var sh = slider.height(); slider.find('.item').each(function() { var curSlideTextInner = $(this).find('.text .inner'); if(curSlideTextInner.length){ var ith = curSlideTextInner.actual('height'); var p = (ith >= sh ? 0 : Math.floor((sh - ith) / 2)); curSlideTextInner.css('padding-top', p + 'px'); } }); } } /*CheckStickyFooter = function() { var browserHeight = $(window).height(), footerOuterHeight = $('footer').outerHeight(true), mainHeightMarginPaddingBorder = $('.body').outerHeight(true) - $('.body').height(); $('.body').css({ 'min-height': browserHeight - footerOuterHeight - mainHeightMarginPaddingBorder, }); };*/ CheckStickyFooter = function() { $(window).resize(function() { // BX.addCustomEvent('onWindowResize', function(eventdata) { try{ var footerHeight = $('footer').outerHeight(), vheight=0; ignoreResize.push(true); $('footer').css('margin-top', '-' + footerHeight + 'px'); $('.body').css('margin-bottom', '-' + footerHeight + 'px'); if(!$('.body').hasClass('index')){ vheight=60; } /*if($('.body').hasClass('detail_page')){ vheight=0; }*/ $('.main').css('padding-bottom', footerHeight + vheight + 'px'); // 25px ignoreResize.pop(); } catch(e){} }); } getGridSize = function(counts) { var z = parseInt($('.body_media').css('top')), counts_item=1; counts_item=(z == 2 ? counts[0] : z == 1 ? counts[1] : counts[2]); if(counts[3] && z==3) counts_item=1; return counts_item; } CheckFlexSlider = function(){ $('.flexslider:not(.thmb)').each(function(){ var slider = $(this); slider.resize(); var counts = slider.data('flexslider').vars.counts; if(typeof(counts) != 'undefined'){ var cnt = getGridSize(counts); var to0 = (cnt != slider.data('flexslider').vars.minItems || cnt != slider.data('flexslider').vars.maxItems || cnt != slider.data('flexslider').vars.move); if(to0){ slider.data('flexslider').vars.minItems = cnt; slider.data('flexslider').vars.maxItems = cnt; slider.data('flexslider').vars.move = cnt; slider.flexslider(0); slider.resize(); slider.resize(); // twise! } } }); } CheckHeaderFixed = function(){ var header = $('header.canfixed'); if(header.length){ var headerLogoAndMenuRow = header.find('.logo_and_menu-row'); if(headerLogoAndMenuRow.length){ var isHeaderFixed = false; var headerCanFix = true; var headerFixedHeight = 53; var headerNormalHeight = headerLogoAndMenuRow.actual('outerHeight'); var headerDiffHeight = headerNormalHeight - headerFixedHeight; var mobileBtnMenu = $('.btn.btn-responsive-nav'); $(window).scroll(function(){ var headerTop = $('#panel:visible').outerHeight(); var scrollTop = $(window).scrollTop(); if(!isHeaderFixed){ headerNormalHeight = headerLogoAndMenuRow.actual('outerHeight'); headerDiffHeight = headerNormalHeight - headerFixedHeight; } headerCanFix = !mobileBtnMenu.is(':visible') && !$('.dropdown-menu:not(.fixed_menu_ext):visible').length; if(!isHeaderFixed){ if((scrollTop > headerNormalHeight + headerTop) && headerCanFix){ isHeaderFixed = true; var headerNext = header.next(); if(headerNext.length){ var mt = parseInt(headerNext.css('margin-top')); } header.css('top', '-' + headerNormalHeight + 'px'); header.addClass('fixed'); if(headerNext.length){ headerNext.css('margin-top', headerNormalHeight + mt + 'px'); } header.delay(0).animate({top: '0'}, 300); } } else if(isHeaderFixed || !headerCanFix){ if((scrollTop <= headerDiffHeight + headerTop) || !headerCanFix){ isHeaderFixed = false; header.removeClass('fixed'); var headerNext = header.next(); if(headerNext.length){ headerNext.css('margin-top', ''); } CheckTopMenuDotted(); } } }); } } } CheckObjectsSizes = function() { $('.container iframe,.container object,.container video').each(function() { var height_attr = $(this).attr('height'); var width_attr = $(this).attr('width'); if (height_attr && width_attr) { $(this).css('height', $(this).outerWidth() * height_attr / width_attr); } }); } CheckFilterSeletSizes = function() { $('.bx_filter_select_block').each(function(){ var popup=$("#smartFilterDropDown"+$(this).data('id')); if(popup.length){ popup.css({'width':$(this).css('width')}); } }) } scrollToTop = function(){ if(arResortOptions['THEME']['SCROLLTOTOP_TYPE'] !== 'NONE'){ var _isScrolling = false; // Append Button $('body').append($('<a />').addClass('scroll-to-top ' + arResortOptions['THEME']['SCROLLTOTOP_TYPE'] + ' ' + arResortOptions['THEME']['SCROLLTOTOP_POSITION']).attr({'href': '#', 'id': 'scrollToTop'})); $('#scrollToTop').click(function(e){ e.preventDefault(); $('body, html').animate({scrollTop : 0}, 500); return false; }); // Show/Hide Button on Window Scroll event. /* $(window).scroll(function(){ if(!_isScrolling) { _isScrolling = true; var bottom = 23, scrollVal = $(window).scrollTop(), windowHeight = $(window).height(), footerOffset = $('footer').offset().top; if(scrollVal > 150){ $('#scrollToTop').stop(true, true).addClass('visible'); _isScrolling = false; } else{ $('#scrollToTop').stop(true, true).removeClass('visible'); _isScrolling = false; } //CheckScrollToTop(); } });*/ } } CheckScrollToTop = function(){ var bottom = 23, scrollVal = $(window).scrollTop(), windowHeight = $(window).height(), footerOffset = $('footer').offset().top; if(scrollVal + windowHeight > footerOffset){ $('#scrollToTop').css('bottom', bottom + scrollVal + windowHeight - footerOffset); } else if(parseInt($('#scrollToTop').css('bottom')) > bottom){ $('#scrollToTop').css('bottom', bottom); } } $.fn.equalizeHeights = function( outer, classNull, minHeight ){ var maxHeight = this.map( function( i, e ){ var minus_height=0, calc_height=0; if(classNull!==false){ minus_height=parseInt($(e).find(classNull).actual('outerHeight')); } if(minus_height) minus_height+=12; $(e).css('height', ''); if( outer == true ){ calc_height=$(e).actual('outerHeight')-minus_height; }else{ calc_height=$(e).actual('height')-minus_height; } if(minHeight!==false){ if(calc_height<minHeight){ calc_height+=(minHeight-calc_height); } if(window.matchMedia('(max-width: 520px)').matches){ calc_height=300; } if(window.matchMedia('(max-width: 400px)').matches){ calc_height=200; } } return calc_height; }).get(); for(var i = 0, c = maxHeight.length; i < c; ++i){ if(maxHeight[i] % 2){ --maxHeight[i]; } } return this.height( Math.max.apply( this, maxHeight ) ); } $.fn.sliceHeight = function( options ){ function _slice(el){ el.each(function() { $(this).css('line-height', ''); $(this).css('height', ''); }); if(typeof(options.autoslicecount) == 'undefined' || options.autoslicecount !== false){ var elw = (el.first().hasClass('item') ? el.first().outerWidth() : el.first().parents('.item').outerWidth()); var elsw = el.first().parents('.items').outerWidth(); if(!elsw){ elsw = el.first().parents('.row').outerWidth(); } if(elsw && elw){ options.slice = Math.floor(elsw / elw); } } if(options.slice){ for(var i = 0; i < el.length; i += options.slice){ $(el.slice(i, i + options.slice)).equalizeHeights(options.outer, options.classNull, options.minHeight); } } if(options.lineheight){ var lineheightAdd = parseInt(options.lineheight); if(isNaN(lineheightAdd)){ lineheightAdd = 0; } el.each(function() { $(this).css('line-height', ($(this).actual('height') + lineheightAdd) + 'px'); }); } } var options = $.extend({ slice: null, outer: false, lineheight: false, autoslicecount: true, classNull: false, minHeight: false, options: false, }, options); var el = $(this); _slice(el); BX.addCustomEvent('onWindowResize', function(eventdata) { ignoreResize.push(true); _slice(el); if(options.opacity=="Y"){ el.each(function() { $(this).css('opacity', '1'); }); } ignoreResize.pop(); }); } waitingExists = function(selector, delay, callback){ if(typeof(callback) !== 'undefined' && selector.length && delay > 0){ delay = parseInt(delay); delay = (delay < 0 ? 0 : delay); if(!$(selector).length){ setTimeout(function(){ waitingExists(selector, delay, callback); }, delay); } else{ callback(); } } } waitingNotExists = function(selectorExists, selectorNotExists, delay, callback){ if(typeof(callback) !== 'undefined' && selectorExists.length && selectorNotExists.length && delay > 0){ delay = parseInt(delay); delay = (delay < 0 ? 0 : delay); setTimeout(function(){ if(selectorExists.length && !$(selectorNotExists).length){ callback(); } }, delay); } } function onLoadjqm(hash){ var name = $(hash.t).data('name'), top = (($(window).height() > hash.w.height()) ? Math.floor(($(window).height() - hash.w.height()) / 2) : 0) + 'px'; $.each($(hash.t).get(0).attributes, function(index, attr){ if(/^data\-autoload\-(.+)$/.test(attr.nodeName)){ var key = attr.nodeName.match(/^data\-autoload\-(.+)$/)[1]; var el = $('input[name="'+key.toUpperCase()+'"]'); el.val( $(hash.t).data('autoload-'+key) );//.attr('readonly', 'readonly'); el.attr('title', el.val()); } }); if($(hash.t).data('autohide')){ $(hash.w).data('autohide', $(hash.t).data('autohide')); } if(name == 'order_product'){ if($(hash.t).data('product')) { $('input[name="PRODUCT"]').val($(hash.t).data('product')).attr('readonly', 'readonly').attr('title', $('input[name="PRODUCT"]').val()); } } if(name == 'question'){ if($(hash.t).data('product')) { $('input[name="NEED_PRODUCT"]').val($(hash.t).data('product')).attr('readonly', 'readonly').attr('title', $('input[name="NEED_PRODUCT"]').val()); } } hash.w.addClass('show').css({'margin-left': '-' + Math.floor(hash.w.width() / 2) + 'px', 'top': top, 'opacity': 1}); } function onHide(hash){ if($(hash.w).data('autohide')){ eval($(hash.w).data('autohide')); } hash.w.css('opacity', 0).hide(); hash.w.empty(); hash.o.remove(); hash.w.removeClass('show'); } $.fn.jqmEx = function(){ $(this).each(function(){ var _this = $(this); var name = _this.data('name'); console.log("2323"); if(name.length){ var script = arResortOptions['SITE_DIR'] + 'ajax/form.php'; var paramsStr = ''; var trigger = ''; var arTriggerAttrs = {}; $.each(_this.get(0).attributes, function(index, attr){ var attrName = attr.nodeName; var attrValue = _this.attr(attrName); trigger += '[' + attrName + '=\"' + attrValue + '\"]'; arTriggerAttrs[attrName] = attrValue; if(/^data\-param\-(.+)$/.test(attrName)){ var key = attrName.match(/^data\-param\-(.+)$/)[1]; paramsStr += key + '=' + attrValue + '&'; } }); var triggerAttrs = JSON.stringify(arTriggerAttrs); var encTriggerAttrs = encodeURIComponent(triggerAttrs); script += '?' + paramsStr + 'data-trigger=' + encTriggerAttrs; if(!$('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').length){ if(_this.attr('disabled') != 'disabled'){ $('body').find('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').remove(); $('body').append('<div class="' + name + '_frame jqmWindow" style="width:500px" data-trigger="' + encTriggerAttrs + '"></div>'); $('.' + name + '_frame[data-trigger="' + encTriggerAttrs + '"]').jqm({trigger: trigger, onLoad: function(hash){onLoadjqm(hash);}, onHide: function(hash){onHide(hash);}, ajax:script}); } } } }); } InitFlexSlider = function() { $('.flexslider:not(.thmb):not(.flexslider-init)').each(function(){ var slider = $(this); var options; var defaults = { animationLoop: false, controlNav: false, directionNav: true, animation: "slide" } var config = $.extend({}, defaults, options, slider.data('plugin-options')); if(typeof(config.counts) != 'undefined' && config.direction !== 'vertical'){ config.maxItems = getGridSize(config.counts); config.minItems = getGridSize(config.counts); config.move = getGridSize(config.counts); config.itemWidth = 200; } config.after = config.start = function(slider){ var eventdata = {slider: slider}; BX.onCustomEvent('onSlide', [eventdata]); } config.end = function(slider){ var eventdata = {slider: slider}; BX.onCustomEvent('onSlideEnd', [eventdata]); } slider.flexslider(config).addClass('flexslider-init'); if(config.controlNav) slider.addClass('flexslider-control-nav'); if(config.directionNav) slider.addClass('flexslider-direction-nav'); }); } /* clickTouchLink=function(selector, parent, className) { $(selector).on('click', function(e) { selector.closest(parent).removeClass(className); if (!selector.closest(parent).hasClass(className)) { } }); }*/ touchBlock=function(selector){ $(selector).each(function(){ var th=$(this); th.on('touchend', function(e) { if(!th.parent().hasClass('touch_class')){ e.preventDefault(); e.stopPropagation(); th.parents().find('.touch_class').removeClass('touch_class'); th.parent().addClass('touch_class'); /*$('.child').css({'display':'none'}); th.find('.child').css({'display':'block'});*/ } }) }) } clickTouchLink = function(el, parent, item) { el.on('click', function(e) { var th = $(this); if (!th.hasClass('move_link')) { e.preventDefault(); $('.move_link').removeClass('move_link'); th.addClass('move_link'); th.hover(); }else{ var href = th.find('a').attr('href'); window.location.href = href; } }); } $(document).ready(function(){ /*check mobile device*/ if (device.mobile() || device.tablet()) { clickTouchLink($('.catalog.sections .item'), '.catalog.sections', '.item'); clickTouchLink($('.item-views.portfolio .item'), '.item-views.portfolio', '.item'); clickTouchLink($('.mega-menu table td>.wrap'), '.mega-menu', '>.wrap'); clickTouchLink($('ul.dropdown-menu>.dropdown-submenu>li'), '.wrap', '.dropdown-submenu>li'); } scrollToTop(); CheckStickyFooter(); CheckHeaderFixed(); CheckTopMenuDotted(); setTimeout(function() {$(window).resize();}, 350); // need to check resize flexslider & menu $(window).scroll(); $('.blink img').blink(); waitingNotExists('#bx-composite-banner .bx-composite-btn', '#footer .col-sm-3.hidden-md.hidden-lg #bx-composite-banner .bx-composite-btn', 500, function() { $('#footer .col-sm-3.hidden-md.hidden-lg #bx-composite-banner').html($('#bx-composite-banner .bx-composite-btn').parent().html()); }); $.extend( $.validator.messages, { required: BX.message('JS_REQUIRED'), email: BX.message('JS_FORMAT'), equalTo: BX.message('JS_PASSWORD_COPY'), minlength: BX.message('JS_PASSWORD_LENGTH'), remote: BX.message('JS_ERROR') }); $.validator.addMethod( 'regexp', function( value, element, regexp ){ var re = new RegExp( regexp ); return this.optional( element ) || re.test( value ); }, BX.message('JS_FORMAT') ); $.validator.addMethod( 'filesize', function( value, element, param ){ return this.optional( element ) || ( element.files[0].size <= param ) }, BX.message('JS_FILE_SIZE') ); $.validator.addMethod( 'date', function( value, element, param ) { var status = false; if(!value || value.length <= 0){ status = false; } else{ var re = new RegExp('^([0-9]{2})(.)([0-9]{2})(.)([0-9]{4})$'); var matches = re.exec(value); if(matches){ var composedDate = new Date(matches[5], (matches[3] - 1), matches[1]); status = ((composedDate.getMonth() == (matches[3] - 1)) && (composedDate.getDate() == matches[1]) && (composedDate.getFullYear() == matches[5])); } } return status; }, BX.message('JS_DATE') ); $.validator.addMethod( 'datetime', function( value, element, param ) { var status = false; if(!value || value.length <= 0){ status = false; } else{ var re = new RegExp('^([0-9]{2})(.)([0-9]{2})(.)([0-9]{4}) ([0-9]{1,2}):([0-9]{1,2})$'); var matches = re.exec(value); if(matches){ var composedDate = new Date(matches[5], (matches[3] - 1), matches[1], matches[6], matches[7]); status = ((composedDate.getMonth() == (matches[3] - 1)) && (composedDate.getDate() == matches[1]) && (composedDate.getFullYear() == matches[5]) && (composedDate.getHours() == matches[6]) && (composedDate.getMinutes() == matches[7])); } } return status; }, BX.message('JS_DATETIME') ); $.validator.addMethod( 'extension', function(value, element, param){ param = typeof param === 'string' ? param.replace(/,/g, '|') : 'png|jpe?g|gif'; return this.optional(element) || value.match(new RegExp('.(' + param + ')$', 'i')); }, BX.message('JS_FILE_EXT') ); $.validator.addMethod( 'captcha', function( value, element, params ){ return $.validator.methods.remote.call(this, value, element,{ url: arResortOptions['SITE_DIR'] + 'ajax/check-captcha.php', type: 'post', data:{ captcha_word: value, captcha_sid: function(){ return $(element).closest('form').find('input[name="captcha_sid"]').val(); } } }); }, BX.message('JS_ERROR') ); /*reload captcha*/ $('body').on( 'click', '.refresh', function(e){ e.preventDefault(); $.ajax({ url: arResortOptions['SITE_DIR'] + 'ajax/captcha.php' }).done(function(text){ $('.captcha_sid').val(text); $('.captcha_img').attr('src', '/bitrix/tools/captcha.php?captcha_sid=' + text); }); }); $.validator.addClassRules({ 'phone':{ regexp: arResortOptions['THEME']['VALIDATE_PHONE_MASK'] }, 'confirm_password':{ equalTo: 'input[name="REGISTER\[PASSWORD\]"]', minlength: 6 }, 'password':{ minlength: 6 }, 'inputfile':{ extension: arResortOptions['THEME']['VALIDATE_FILE_EXT'], filesize: 5000000 }, 'datetime':{ datetime: '' }, 'captcha':{ captcha: '' } }); InitFlexSlider(); // for check flexslider bug in composite mode waitingNotExists('.detail .galery #slider', '.detail .galery #slider .flex-viewport', 1000, function() { InitFlexSlider(); setTimeout(function() { $(window).resize(); }, 350); }); /*check mobile browser*/ if(jQuery.browser.mobile || device.tablet()){ $('.style-switcher').addClass('hidden'); $('.hint span').remove(); $('*[data-event="jqm"]').live('click', function(e){ e.preventDefault(); var _this = $(this); var name = _this.data('name'); if(name.length){ var script = arResortOptions['SITE_DIR'] + 'form/'; var paramsStr = ''; var arTriggerAttrs = {}; $.each(_this.get(0).attributes, function(index, attr){ var attrName = attr.nodeName; var attrValue = _this.attr(attrName); arTriggerAttrs[attrName] = attrValue; if(/^data\-param\-(.+)$/.test(attrName)){ var key = attrName.match(/^data\-param\-(.+)$/)[1]; paramsStr += key + '=' + attrValue + '&'; } }); var triggerAttrs = JSON.stringify(arTriggerAttrs); var encTriggerAttrs = encodeURIComponent(triggerAttrs); script += '?name=' + name + '&' + paramsStr + 'data-trigger=' + encTriggerAttrs; location.href = script; } }); /*$('.fancybox').removeClass('fancybox');*/ $('.footer_button').css('display','none'); /*touchBlock('.sections.front .item a'); touchBlock('.portfolio.front .item a');*/ } else{ $('*[data-event="jqm"]').live('click', function(e){ e.preventDefault(); $(this).jqmEx(); $(this).trigger('click'); }); } /*touch event*/ document.addEventListener('touchend', function(event) { if(!$(event.target).closest('.menu_item_l1').length){ $('.front .item').removeClass('touch_class'); } }, false); $('a.fancybox:has(img)').fancybox({ tpl:{ closeBtn : '<a title="'+BX.message('FANCY_CLOSE')+'" class="fancybox-item fancybox-close" href="javascript:;"></a>', next : '<a title="'+BX.message('FANCY_NEXT')+'" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev : '<a title="'+BX.message('FANCY_PREV')+'" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>' } }); $('a.fancybox_ext').fancybox({ tpl:{ closeBtn : '<a title="'+BX.message('FANCY_CLOSE')+'" class="fancybox-item fancybox-close" href="javascript:;"></a>', next : '<a title="'+BX.message('FANCY_NEXT')+'" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev : '<a title="'+BX.message('FANCY_PREV')+'" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>' } }); /*licence fancy*/ $(document).on('click', '.fancy_gallery', function(e){ e.preventDefault(); var arPict=[]; arPict.push({ 'href':$(this).attr('href'), 'title':$(this).attr('title'), }); $(this).closest('.image').find('.popup_gallery .img').each(function(){ // arPict.push($(this).data('big')); arPict.push({ 'href':$(this).data('big'), 'title':$(this).data('title'), }); }) $.fancybox(arPict, { openEffect : 'fade', closeEffect : 'fade', nextEffect : 'fade', prevEffect : 'fade', //'type' : 'image', tpl:{ closeBtn : '<a title="'+BX.message('FANCY_CLOSE')+'" class="fancybox-item fancybox-close" href="javascript:;"></a>', next : '<a title="'+BX.message('FANCY_NEXT')+'" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev : '<a title="'+BX.message('FANCY_PREV')+'" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>' }, }); }) // Responsive Menu Events var addActiveClass = false; $('#mainMenu li.dropdown > a, #mainMenu li.dropdown-submenu > a').on('click', function(e){ e.preventDefault(); // if($(window).width() > 979) return; addActiveClass = $(this).parent().hasClass('resp-active'); $('#mainMenu').find('.resp-active').removeClass('resp-active'); if(!addActiveClass){ $(this).parents("li").addClass("resp-active"); } }); if($('.styled-block .row > div.col-md-3').length){ BX.addCustomEvent('onWindowResize', function(eventdata) { try{ ignoreResize.push(true); $('.styled-block .row > div.col-md-3').each(function() { $(this).css({'height': '', 'line-height': ''}); var z = parseInt($('.body_media').css('top')); if(z > 0){ var rowHeight = $(this).parents('.row').first().actual('outerHeight'); $(this).css({'height': rowHeight + 'px'}); // $(this).css({'height': rowHeight + 'px', 'line-height' : rowHeight + 'px'}); } }); } catch(e){} finally{ ignoreResize.pop(); } }); } if($('.order-block').length){ BX.addCustomEvent('onWindowResize', function(eventdata) { try{ ignoreResize.push(true); $('.order-block').each(function() { var cols = $(this).find('.row > div'); if(cols.length){ var colFirst = cols.first(); var colLast = cols.last(); var colText = colLast.find('.text'); var bText = colText.length; var bOnlyText = cols.length === 1 && bText; var bPrice = colFirst.find('.price').length; var z = parseInt($('.body_media').css('top')); cols.css({'height': '', 'padding-top': '', 'padding-bottom': ''}); colText.css({'height': '', 'padding-top': '', 'padding-bottom': ''}); if((!bPrice && z > 0) || (bPrice && z > 1)){ var minHeight = 83; if(!bOnlyText){ var colFirst_height = colFirst.outerHeight(); colFirst_height = colFirst_height >= minHeight ? colFirst_height : minHeight; } if(bText){ var colLast_height = colLast.outerHeight(); colLast_height = colLast_height >= minHeight ? colLast_height : minHeight; } var colMax_height = (bText ? (!bOnlyText ? (colLast_height >= colFirst_height ? colLast_height : colFirst_height) : colLast_height) : colFirst_height); if(!bOnlyText){ var textPadding = 22 + (colMax_height - colFirst.outerHeight()) / 2; colFirst.css({'padding-top': textPadding + 'px', 'padding-bottom': textPadding + 'px', 'height': colMax_height + 'px'}); } if(bText){ colLast.css({'height': colMax_height + 'px'}); var textPadding = 22 + (colMax_height - colText.outerHeight()) / 2; colText.css({'padding-top': textPadding + 'px', 'padding-bottom': textPadding + 'px', 'height': colMax_height + 'px'}); } } } }); } catch(e){} finally{ ignoreResize.pop(); } }); } $(document).on('click', '.mega-menu .dropdown-menu', function(e){ e.stopPropagation() }); $(document).on('click', '.mega-menu .dropdown-toggle.more-items', function(e){ e.preventDefault(); }); $('.table-menu .dropdown,.table-menu .dropdown-submenu,.table-menu .dropdown-toggle').live('mouseenter', function() { CheckTopVisibleMenu(); }); var n = 0; $('.flex-viewport .item').on('mouseenter', function(){ $(this).closest('.flexslider').find('.flex-control-nav').toggleClass('noz'); $(this).closest('.flexslider').find('.flex-control-nav').css('z-index','0'); }) $('.flex-viewport .item').on('mouseleave', function(){ $(this).closest('.flexslider').find('.flex-control-nav').toggleClass('noz'); $(this).closest('.flexslider').find('.flex-control-nav').css('z-index','2'); }) $('.mega-menu .search-item, .menu-row #title-search .fa-close').live('click', function(e) { e.preventDefault(); $('.menu-row .header_search').toggleClass('hide'); }); $('.menu-row .search input').live('keyup', function(e) { var inputValue = $(this).val(); $('.header_search .search input').val(inputValue); $('.logo_and_menu-row .logo-row .search-input-div input').val(inputValue); if(e.keyCode == 13){ $('.header_search .search form').submit(); } }); $('.menu-row .search-button-div button').live('click', function(e) { e.preventDefault(); var inputValue = $(this).parents().find('input').val(); $('.header_search .search input').val(inputValue); $('.header_search .search form').submit(); }); $('.filter .calendar').live('click', function() { var button = $(this).next(); if(button.hasClass('calendar-icon')){ button.trigger('click'); } }); /* toggle */ var $this = this, previewParClosedHeight = 25; $('section.toggle > label').prepend($('<i />').addClass('fa fa-plus')); $('section.toggle > label').prepend($('<i />').addClass('fa fa-minus')); $('section.toggle.active > p').addClass('preview-active'); $('section.toggle.active > div.toggle-content').slideDown(350, function() {}); $('section.toggle > label').click(function(e){ var parentSection = $(this).parent(), parentWrapper = $(this).parents('div.toogle'), previewPar = false, isAccordion = parentWrapper.hasClass('toogle-accordion'); if(isAccordion && typeof(e.originalEvent) != 'undefined') { parentWrapper.find('section.toggle.active > label').trigger('click'); } parentSection.toggleClass('active'); // Preview Paragraph if( parentSection.find('> p').get(0) ){ previewPar = parentSection.find('> p'); var previewParCurrentHeight = previewPar.css('height'); previewPar.css('height', 'auto'); var previewParAnimateHeight = previewPar.css('height'); previewPar.css('height', previewParCurrentHeight); } // Content var toggleContent = parentSection.find('> div.toggle-content'); if( parentSection.hasClass('active') ){ $(previewPar).animate({ height: previewParAnimateHeight }, 350, function() { $(this).addClass('preview-active'); }); toggleContent.slideDown(350, function() {}); } else{ $(previewPar).animate({ height: previewParClosedHeight }, 350, function() { $(this).removeClass('preview-active'); }); toggleContent.slideUp(350, function() {}); } }); /* accordion */ $('.accordion-head').on('click', function(e){ e.preventDefault(); if(!$(this).next().hasClass('collapsing')){ $(this).toggleClass('accordion-open'); $(this).toggleClass('accordion-close'); } }); /* progress bar */ $('[data-appear-progress-animation]').each(function(){ var $this = $(this); $this.appear(function(){ var delay = ($this.attr('data-appear-animation-delay') ? $this.attr('data-appear-animation-delay') : 1); if( delay > 1 ) $this.css('animation-delay', delay + 'ms'); $this.addClass($this.attr('data-appear-animation')); setTimeout(function(){ $this.animate({ width: $this.attr('data-appear-progress-animation') }, 1500, 'easeOutQuad', function() { $this.find('.progress-bar-tooltip').animate({ opacity: 1 }, 500, 'easeOutQuad'); }); }, delay); }, {accX: 0, accY: -50}); }); $('a[rel=tooltip]').tooltip(); $('span[data-toggle=tooltip]').tooltip(); $('select.sort').live('change', function(){ location.href = $(this).val(); }); setTimeout(function(th){ $('.catalog.group.list .item').each(function(){ var th = $(this); if((tmp = th.find('.image').outerHeight() - th.find('.text_info').outerHeight()) > 0){ th.find('.text_info .titles').height(th.find('.text_info .titles').outerHeight() + tmp); } }) }, 50); /*item galery*/ $('.thumbs .item a').live('click', function(e){ e.preventDefault(); $('.thumbs .item').removeClass('current'); $(this).closest('.item').toggleClass('current'); $('.slides li' + $(this).attr('href')).addClass('current').siblings().removeClass('current'); }); $('header.fixed .btn-responsive-nav').live('click', function() { $('html, body').animate({scrollTop: 0}, 400); }); $('.more_block span').live('click', function() { var content_offset=$('.detail .scroll_block').offset(); $('html, body').animate({scrollTop: content_offset.top-53}, 400); }); $('body').on('click', '.form .refresh-page', function(){ location.href = location.href; }); /*animate increment*/ $('.spincrement1').counterUp({ delay: 80, time: 1000 }); $('.bx_filter_input_container input[type=text]').numeric({allow:"."}); $('.top_menu_fixed_js').appendTo($('.fixed_menu .menu_wr.mega-menu')) }); // Events var timerScroll = false, ignoreScroll = [], documentScrollTopLast = $(document).scrollTop(); $(window).scroll(function(){ CheckPopupTop(); if(!ignoreScroll.length){ if(timerScroll){ clearTimeout(timerScroll); timerScroll = false; } timerScroll = setTimeout(function(){ BX.onCustomEvent('onWindowScroll', false); }, 100); } documentScrollTopLast = $(document).scrollTop(); }); var timerResize = false, ignoreResize = []; $(window).resize(function(){ CheckPopupTop(); //CheckScrollToTop(); if(!ignoreResize.length){ if(timerResize){ clearTimeout(timerResize); timerResize = false; } timerResize = setTimeout(function(){ BX.onCustomEvent('onWindowResize', false); }, 100); } documentScrollTopLast = $(document).scrollTop(); }); BX.addCustomEvent('onWindowScroll', function(eventdata) { try{ ignoreScroll.push(true); } catch(e){} finally{ ignoreScroll.pop(); } }); BX.addCustomEvent('onWindowResize', function(eventdata) { try{ ignoreResize.push(true); CheckTopMenuDotted(); CheckTopVisibleMenu(); CheckFlexSlider(); CheckMainBannerSliderVText($('.banners-big .flexslider')); CheckObjectsSizes(); CheckFilterSeletSizes(); } catch(e){} finally{ ignoreResize.pop(); } }); BX.addCustomEvent('onSlide', function(eventdata) { try{ ignoreResize.push(true); if(eventdata){ var slider = eventdata.slider; if(slider){ // add classes .curent & .shown to slide slider.find('.item').removeClass('current'); var curSlide = slider.find('.item.flex-active-slide'); var curSlideId = curSlide.attr('id'); curSlide.addClass('current'); if(curSlide.hasClass('shown')){ slider.find('.item.clone[id=' + curSlideId + '_clone]').addClass('shown'); } curSlide.addClass('shown'); slider.resize(); // set main banners text vertical center CheckMainBannerSliderVText(slider); } } } catch(e){} finally{ ignoreResize.pop(); } }); BX.addCustomEvent('onSlideEnd', function(eventdata) { try{ ignoreResize.push(true); if(eventdata){ var slider = eventdata.slider; if(slider){ } } } catch(e){} finally{ ignoreResize.pop(); } });
/home/user/web/pansionat-v-yaroslavle.ru/public_html/./bitrix/templates/-new-year/js/general.js