1'use strict'; 2(function ($, window, document) { 3 var pluginName = "Aisconverse", 4 defaults = { 5 sliderFx: 'crossfade', // Slider effect. Can be 'scroll', 6 // 'fade', 'crossfade', 'directscroll', 7 // 'uncover', 'uncover-fade' 8 sliderInterval: 6000, // Interval 9 sliderAuto: false, // Default auto sliding 10 speedAnimation: 500, // Default speed of the animation 11 defFx: 'easeInSine', // Default animate Fx 12 scrollTopButtonOffset: 500, // when scrollTop Button will show 13 successText: 'You have successfully subscribed', // text after successful subscribing 14 errorText: 'Please, enter a valid email', // text, if email is invalid 15 collapseMenuWidth: 991, // Browser width, when menu 16 // will collapse 17 flickrId: '36587311@N08', // Flickr Account ID 18 instagrammId: 3677038064, // Instagram Account ID 19 markersColor: ['#DA3636', '#323232', '#7F7F7F'] // map markers color 20 }, 21 $win = $(window), 22 $htmlBody = $('html, body'), 23 onMobile = false; 24 25 // The plugin constructor 26 function Plugin(element, options) { 27 var that = this; 28 that.element = $(element); 29 that.options = $.extend({}, defaults, options); 30 31 if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 32 onMobile = true; 33 $(document.body).addClass('is-mobile'); 34 } else { 35 $(document.body).addClass('no-mobile'); 36 } 37 38 that.init(); 39 $win.appear(); 40 41 $win.load(function () { 42 that.preloader.fadeOut(defaults.speedAnimation); 43 44 that.activate(); 45 that.dropMenu(); 46 that.moveMenu(); 47 that.megaMenu(); 48 that.truncAny(); 49 that.fMiddle(); 50 that.scrll(); 51 that.countUp(); 52 that.instagramm(); 53 that.flickr(); 54 that.priceSlider(); 55 that.ratings(); 56 that.subscribeForm(); 57 that.contactForm(); 58 that.vCharts(); 59 that.pieCharts(); 60 that.faqNav(); 61 that.magnificPopup(); 62 that.masonryMix(); 63 that.contactMap(); 64 that.sliders('.slider .slider'); 65 that.sliders(); 66 that.sliderRevolution(); 67 68 setTimeout(function () { 69 that.rez(); 70 that.isotopeMix(); 71 }, 350); 72 73 $('.nav-nobg').on('show.bs.collapse', function(){ 74 $('header.header').removeClass('header-nobg'); 75 }); 76 77 $('.nav-nobg').on('hidden.bs.collapse', function(){ 78 $('header.header').addClass('header-nobg'); 79 }); 80 81 82 $('.slider-scroll').on('click', function() { 83 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 84 var target = $(this.hash); 85 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 86 if (target.length) { 87 $('html,body').animate({ 88 scrollTop: target.offset().top 89 }, 1000); 90 return false; 91 } 92 } 93 }); 94 95 96 97 98 if($('#tweet-feed').size() > 0) { 99 100 var tweetConfig = { 101 "id": '686883871074422784', 102 "domId": 'tweet-feed', 103 "maxTweets": 1, 104 "showUser": false, 105 "showImages": false, 106 "showRetweet": false, 107 "showInteraction": false, 108 "showTime": false, 109 "enableLinks": true 110 }; 111 twitterFetcher.fetch(tweetConfig); 112 } 113
114 if($('#tweet-feed1').size() > 0) { 115 var tweetConfig1 = { 116 "id": '686883871074422784', 117 "domId": 'tweet-feed1', 118 "maxTweets": 1, 119 "showUser": false, 120 "showImages": false, 121 "showRetweet": false, 122 "showInteraction": false, 123 "showTime": false, 124 "enableLinks": true 125 }; 126 twitterFetcher.fetch(tweetConfig1); 127 } 128 129 130 131 132 }).scroll(function () { 133 that.scrll(); 134 that.countUp(); 135 that.parallaxBG(); 136 }).resize(function(){ 137 that.rez(); 138 that.fMiddle(); 139 that.megaMenu(); 140 141 if($win.width() > 995 && $('.nav-nobg').is(':visible')) { 142 $('header.header').addClass('header-nobg'); 143 } 144 145 }); 146 } 147 148 Plugin.prototype = { 149 init: function () { 150 this.body = $(document.body); 151 this.preloader = $('.preloader'); 152 this.wrapper = $('.wrapper'); 153 this.header = $('.header'); 154 this.headerSidebar = $('.header-sidebar'); 155 this.footer = $('.footer'); 156 this.slider = $('.slider'); 157 this.banner = $('.banner'); 158 this.fullscreen = $('.fullscreen'); 159 this.vmiddle = $('.middle'); 160 this.gallery = $('.gallery'); 161 this.internalLinks = $('.internal'); 162 this.expandLink = $('.expand-link'); 163 this.collapseLink = $('.collapse-link'); 164 this.audio = $('audio'); 165 this.chart = $('.chart'); 166 this.select = $('select'); 167 this.timer = $('.countdown'); 168 this.counting = $('.counting'); 169 this.map = $('.google-map'); 170 this.mapAbsolute = $('[class*=google-map-absolute]'); 171 this.modal = $('.modal'); 172 this.countup = $('.countup'); 173 this.quantity = $('.product-quantity'); 174 this.parallax = $('[data-type="parallax"]'); 175 this.dataToggle = $('[data-toggle]'); 176 177 this.mixWrap = $('.mix-wrap'); 178 179 this.magnific = $('.magnific'); 180 this.magnificWrap = $('.magnific-wrap'); 181 this.magnificGallery = $('.magnific-gallery'); 182 this.magnificVideo = $('.magnific-video'); 183 184 this.masonryWrap = $('.masonry-wrap'); 185 this.isotopeWrap = $('.isotope-wrap'); 186 187 this.cornerLink = $('.corner-link'); 188 189 this.card = $('.card'); 190 191 this.imgWrap = $('.img-wrap'); 192 193 this.animateBlock = $('[data-animate]'); 194 this.hoverBlock = $('[data-hover]'); 195 196 this.clients = $('.clients'); 197 198 this.rating = $('.raty'); 199 200 this.instafeed = $('#instafeed'); 201 this.flickrfeed = $('#flickrfeed'); 202 203 this.verticalChart = $('.vertical-chart'); 204 this.pieChart = $('.pie-chart'); 205 206 this.widgetSubscrire = $('.widget_subscrire'); 207 this.subscribe = this.widgetSubscrire.find('form'); 208 209 this.loadmore = $('.load-more'); 210 211 this.dropdownToggle = $('.dropdown-toggle'); 212 this.dropdown = $('.dropdown'); 213 this.navbar = $('.navbar'); 214 this.navbarCollapse = $('.navbar-collapse'); 215 this.navbarToggle = $('.navbar-toggle'); 216 this.navbarToggleModal = $('.navbar-toggle-modal'); 217 218 this.dataPopover = $('[data-toggle="popover"]'); 219 this.widgetbarToggle = $('.widgetbar-toggle'); 220 }, 221 activate: function () { 222 var instance = this, 223 spd = instance.options.speedAnimation; 224 225 instance.internalLinks.on('click', function(e){ 226 e.preventDefault(); 227 var $this = $(this), 228 url = $this.attr('href').replace('#', ''), 229 $url = $('#' + url), 230 urlTop; 231 232 if ($url.length){ 233 urlTop = $url.offset().top; 234 } else { 235 urlTop = $('[name="'+ url +'"]').offset().top; 236 } 237 238 $htmlBody.stop(true, true).animate({ scrollTop: urlTop }, spd, instance.options.defFx); 239 }); 240 241 // Custom Select 242 if (instance.select.length > 0){ 243 instance.select.chosen({ 244 width: '100%' 245 }); 246 } 247 248 if (instance.audio.length > 0){ 249 instance.audio.mediaelementplayer(); 250 } 251 252 if (instance.dataPopover.length > 0) { 253 instance.dataPopover.popover({ 254 trigger: 'hover focus' 255 }); 256 257 instance.dataPopover.on('show.bs.popover', function () { 258 var self = $(this), 259 popoverColor = self.data('color'); 260 261 if (popoverColor) { 262 setTimeout(function () { 263 self.parent().find('.popover').addClass('popover-color popover-' + popoverColor); 264 }, 0); 265 } 266 }) 267 } 268 269 instance.cornerLink.on('click', function (e) { 270 e.preventDefault(); 271 272 var self = $(this), 273 p = self.parent(), 274 container = p.find('.container'); 275 276 self.toggleClass('vis'); 277 container.stop(true, true).slideToggle(spd); 278 }); 279 280 // Product Incrementers 281 instance.quantity.find('a').on('click', function(e) { 282 e.preventDefault(); 283 284 var el = $(this), 285 inpt = el.parent().find('input'), 286 oldValue = inpt.val(), 287 newVal; 288 289 if (el.hasClass('plus')) { 290 newVal = parseFloat(oldValue) + 1; 291 } else if (el.hasClass('minus')) { 292 newVal = (oldValue > 1) ? parseFloat(oldValue) - 1 : 1; 293 } 294 295 inpt.val(newVal); 296 }); 297 298 $('.single-product-page-cart-form select').on('change', function () { 299 $('.collapse-group').slideDown(spd); 300 }); 301 302 $('.collapse-group .reset').on('click', function (e) { 303 e.preventDefault(); 304
305 $(this).parents('.collapse-group').slideUp(spd); 306 $('.single-product-page-cart-form select').val('').trigger("chosen:updated"); 307 }); 308 309 $('.cart .remove').on('click', function (e) { 310 e.preventDefault(); 311 var $this = $(this); 312 313 $this.parents('tr').fadeOut(spd, function () { 314 $(this).remove(); 315 }); 316 }); 317 318 if (instance.header.hasClass('header-vertical') && !instance.header.hasClass('header-vertical-hover')){ 319 instance.body.addClass('is-header-vertical'); 320 } 321 322 if (instance.header.hasClass('header-left')){ 323 instance.body.addClass('is-header-left'); 324 } else if (instance.header.hasClass('header-right')){ 325 instance.body.addClass('is-header-right'); 326 } 327 328 instance.animateBlock.on('appear', function () { 329 var t = $(this), 330 fx = t.data('animate'); 331 332 t.parent().css('position', 'relative'); 333 t.addClass('animated ' + fx); 334 }).appear(); 335 336 instance.animateBlock.on('click', function(e){ 337 var self = $(this), 338 ani = self.data('animate'); 339 340 if (self.hasClass('animate-toggle')){ 341 e.preventDefault(); 342 self.removeClass('animated').removeClass(ani); 343 } 344 345 setTimeout(function () { 346 self.addClass('animated').addClass(ani); 347 }, spd / 2); 348 }); 349 350 instance.hoverBlock.on( 351 { 352 'mouseenter': function () { 353 var self = $(this), 354 ani = self.data('hover'); 355 356 self.addClass('animated').addClass(ani); 357 }, 358 'mouseleave': function () { 359 var self = $(this), 360 ani = self.data('hover'); 361 362 setTimeout(function () { 363 self.removeClass('animated').removeClass(ani); 364 }, spd); 365 } 366 } 367 ); 368 369 instance.card.hover(function () { 370 var self = $(this), 371 hoverBl = self.find('[data-hover]'), 372 ani = hoverBl.data('hover'); 373 374 if (!self.hasClass('front')) { 375 self.toggleClass('hover'); 376 } 377 378 if (hoverBl.length > 0) { 379 hoverBl.toggleClass('animated').toggleClass(ani); 380 } 381 }); 382 383 // Hide sidebar menu when click in outside 384 $(document).mouseup(function (e){ 385 if (!instance.headerSidebar.is(e.target) 386 && instance.headerSidebar.has(e.target).length === 0 387 && instance.headerSidebar.hasClass('in')) { 388 instance.headerSidebar.collapse('hide'); 389 } 390 }); 391 392 instance.loadmore.on('click', function(e) { 393 e.preventDefault(); 394 var self = $(this), 395 path = self.attr('href'), 396 addmsnry; 397 398 instance.masonryWrap.append('<div class="next-posts">'); 399 400 $('.next-posts:last').load(path, function() { 401 402 var that = $(this); 403 404 setTimeout(function() { 405 addmsnry = new Masonry(instance.masonryWrap[0], { 406 itemSelector: '.msnr' 407 }); 408 }, 100); 409 410 self.attr('href', 'msnr-2.html'); 411 412 if (path === 'msnr-2.html'){ 413 self.parent().hide(); 414 } 415 416 that.animate({'opacity': 1}, spd); 417 418 if (that.find('audio').length > 0) { 419 that.find('audio').mediaelementplayer({ 420 audioWidth: '100%' 421 }); 422 } 423 424 if (that.find('.slider').length > 0) { 425 setTimeout(function () { 426 instance.sliders(); 427 }, spd / 2); 428 } 429 430 }); 431 }); 432 433 }, 434 isotopeMix: function () { 435 var instance = this; 436 437 instance.mixWrap.each(function () { 438 var that = $(this); 439 440 var $iso = that.find(instance.isotopeWrap).isotope({ 441 itemSelector: '.mix', 442 layoutMode: 'masonry', 443 transitionDuration: '0.3s', 444 transformsEnabled: false, 445 getSortData: { 446 category: '[data-category]', 447 name: '[data-name]', 448 date: function(itemElem) { 449 var dateNum = $(itemElem).data('date'); 450 return Date.parse(dateNum); 451 } 452 } 453 }); 454 455 instance.dataToggle.on('click', function () { 456 setTimeout(function () { 457 $iso.isotope(); 458 }, 315); 459 }); 460 461 that.find(instance.select).on('change', function () { 462 var self = $(this), 463 sortValue = self.val(); 464 465 $iso.isotope({ sortBy: sortValue });
466 }).change(); 467 468 that.find('.mix-category li a').on('click', function (e) { 469 var self = $(this), 470 fltr = self.data('filter'); 471 472 e.preventDefault(); 473 474 self.parent().addClass('active') 475 .siblings().removeClass('active'); 476 477 if (self.parents('.mix-wrap').find(instance.isotopeWrap).length > 0){ 478 $iso.isotope({ filter: fltr }); 479 } 480 481 }); 482 }); 483 }, 484 masonryMix: function () { 485 var instance = this; 486 487 if (instance.masonryWrap.length > 0){ 488 instance.masonryWrap.each(function () { 489 var posts = $(this)[0], 490 msnry; 491 492 setTimeout(function () { 493 msnry = new Masonry(posts, { 494 itemSelector: '.msnr', 495 columnWidth: '.msnr', 496 }); 497 }, instance.options.speedAnimation/2); 498 }); 499 } 500 }, 501 magnificPopup: function () { 502 var instance = this; 503 504 instance.magnificWrap.each(function() { 505 var $this = $(this); 506 507 $this.find(instance.magnific).magnificPopup({ 508 type: 'image', 509 tLoading: '', 510 gallery: { 511 enabled: true, 512 navigateByImgClick: true 513 }, 514 image: { 515 titleSrc: function (item) { 516 return item.el.attr('title'); 517 } 518 } 519 }); 520 }); 521 522 instance.magnificVideo.on('click', function(e) { 523 e.preventDefault(); 524 525 var $this = $(this), 526 url = $this.attr('href'); 527 528 $.magnificPopup.open({ 529 items: { 530 src: url, 531 type: 'iframe', 532 fixedContentPos: true 533 } 534 }); 535 }); 536 537 instance.magnificGallery.on('click', function(e) { 538 e.preventDefault(); 539 540 var $this = $(this), 541 items = [], 542 im = $this.data('gallery'), 543 imA = im.split(','), 544 imL = imA.length, 545 titl = $this.attr('title'); 546 547 for (var i = 0; i < imL; i++){ 548 items.push({ 549 src: imA[i] 550 }); 551 } 552 553 $.magnificPopup.open({ 554 items: items, 555 type: 'image', 556 gallery: { 557 enabled: true 558 }, 559 image: { 560 titleSrc: function () { 561 return titl; 562 } 563 } 564 }); 565 }); 566 }, 567 ratings: function () { 568 var instance = this; 569 570 if (instance.rating.length > 0) { 571 instance.rating.raty({ 572 half: true, 573 starType: 'i', 574 readOnly: function () { 575 return $(this).data('readonly'); 576 }, 577 score: function () { 578 return $(this).data('score'); 579 }, 580 starOff: 'fa fa-star star-off', 581 starOn: 'fa fa-star', 582 starHalf: 'fa fa-star-half-o' 583 }); 584 } 585 }, 586 truncAny: function () { 587 var truncateElArray = [/*{ 588 el : $('.figure-info h4'), 589 height: 60 590 }*/]; 591 592 for (var i = 0; i < truncateElArray.length; i++){ 593 truncateElArray[i].el.dotdotdot({ 594 watch: "window", 595 wrap: 'word', 596 height: truncateElArray[i].height, 597 callback: function() { 598 $(this).addClass('truncated'); 599 } 600 }); 601 } 602 }, 603 dropMenu: function () { 604 var instance = this; 605 606 instance.navbarToggleModal.on('click', function () { 607 instance.body.toggleClass('overlaymenu'); 608 $('.navbar-modal').stop(true, true).fadeToggle(instance.options.speedAnimation / 2); 609 $('.navbar-nav').toggleClass('in'); 610 }); 611 612 $('.navbar-modal .dropdown').on({ 613 'show.bs.dropdown': function () { 614 var self = $(this); 615 self.find('.dropdown-menu').first().stop(true, true).slideDown(instance.options.speedAnimation / 2); 616 }, 617 'hide.bs.dropdown': function () { 618 var self = $(this); 619 self.find('.dropdown-menu').first().stop(true, true).slide
619Up(instance.options.speedAnimation / 2); 620 } 621 }); 622 623 $('.navbar-modal').find('.dropdown-menu:not(.sub-menu) a').on('click', function(){ 624 instance.preloader.show(); 625 }); 626 627 628 $('.dropdown-menu.sub-menu > li.dropdown > a').on('click', function (e) { 629 var self = $(this), 630 current= self.next(), 631 grandparent= self.parent().parent(); 632 633 grandparent.find(".sub-menu:visible").not(current).stop(true, true).slideUp(instance.options.speedAnimation / 2); 634 current.stop(true, true).slideToggle(instance.options.speedAnimation / 2); 635 636 e.stopPropagation(); 637 e.preventDefault(); 638 }); 639 640 $('.dropdown-menu:not(.sub-menu) > li > a').on('click', function () { 641 var root = $(this).closest('.dropdown'); 642 643 root.find('.sub-menu:visible').stop(true, true).slideUp(instance.options.speedAnimation / 2); 644 }); 645 646 instance.navbar.find(instance.dropdownToggle).on('mousedown', function () { 647 var self = $(this), 648 ww = $win.width(), 649 nxt = self.next(), 650 nw = nxt.outerWidth(true), 651 w = self.outerWidth(true), 652 lp = self.offset().left; 653 654 if ((lp + w + nw) > ww){ 655 nxt.addClass('reverse-list'); 656 } 657 }); 658 659 instance.dropdown.on('hide.bs.dropdown', function () { 660 $('.dropdown-menu').removeClass('reverse-list'); 661 }); 662 663 $('.pagetitle .dropdown').on('show.bs.dropdown', function () { 664 var self = $(this), 665 ww = $win.width(), 666 dropd = self.find('.dropdown-menu'), 667 dw = dropd.outerWidth(true), 668 dleft = self.offset().left; 669 670 if (ww < (dleft + dw)){ 671 dropd.addClass('reverse-list'); 672 } 673 }) 674 }, 675 moveMenu: function () { 676 var instance = this, 677 hw = instance.header.outerWidth(true); 678 679 if (instance.header.hasClass('header-vertical-move')) { 680 if (instance.body.hasClass('is-move-menu')) { 681 animateMenu('close'); 682 683 } else { 684 animateMenu('open'); 685 } 686 } 687 688 if (instance.header.hasClass('header-vertical-move')) { 689 instance.navbarToggle.on('click', function () { 690 if (instance.body.hasClass('is-move-menu')) { 691 animateMenu('close'); 692 693 } else { 694 animateMenu('open'); 695 } 696 }); 697 } 698 699 function animateMenu(t) { 700 if(t === 'open') { 701 instance.body.addClass('is-move-menu'); 702 if (instance.header.hasClass('header-left')) { 703 instance.header.animate({left: 0}, instance.options.speedAnimation); 704 instance.body.animate({marginRight: -hw, marginLeft: hw}, instance.options.speedAnimation); 705 } else if (instance.header.hasClass('header-right')){ 706 instance.header.animate({right: 0}, instance.options.speedAnimation); 707 instance.body.animate({marginLeft: -hw, marginRight: hw}, instance.options.speedAnimation); 708 } 709 } 710 711 if(t === 'close') { 712 instance.body.removeClass('is-move-menu'); 713 instance.body.animate({marginRight: 0, marginLeft: 0}, instance.options.speedAnimation); 714 if (instance.header.hasClass('header-left')) { 715 instance.header.animate({left: -hw}, instance.options.speedAnimation); 716 } else if (instance.header.hasClass('header-right')){ 717 instance.header.animate({right: -hw}, instance.options.speedAnimation); 718 } 719 } 720 } 721 }, 722 sliders: function(sliderContent){ 723 var instance = this; 724 725 if (sliderContent === '' || sliderContent === null || sliderContent === undefined){ 726 sliderContent = '.slider'; 727 } 728 729 sliderContent = $(sliderContent); 730 731 if (instance.slider.length > 0){ 732 sliderContent.each(function(e) { 733 var $this = $(this), 734 slidewrap = $this.find('ul:first'), 735 sliderFx = slidewrap.data('fx'), 736 sliderAuto = slidewrap.data('auto'), 737 sliderTimeout = slidewrap.data('timeout'), 738 sliderSpeedAnimation = slidewrap.data('speed-animation'), 739 sliderCircular = slidewrap.data('circular'), 740 sliderOrient = ($this.hasClass('vertical') && instance.body.hasClass('fullpage')) ? true : false, 741 sliderScrollItems = slidewrap.data('scroll-items'), 742 sliderMaxItems = slidewrap.data('max-items'), 743 sliderPrefix = '#slider-', 744 sliderDirection = ($this.hasClass('vertical')) ? 'up' : 'left', 745 sliderItems = (!$this.hasClass('oneslider')) ? 746 { 747 height: 'variable', 748 visible: { 749 min: 1, 750 max: sliderMaxItems ? sliderMaxItems : 6 751 } 752 } : 753 { 754 visible: { 755 min: 1, 756 max: 1 757 }, 758 width : 870 759 }; 760 761 $this.attr('id', 'slider-' + e); 762 763 slidewrap.carouFredSel({ 764 direction : sliderDirection, 765 responsive: true, 766 width: 'variable', 767 infinite : (typeof sliderCircular) ? sliderCircular : true, 768 circular : (typeof sliderCircular) ? sliderCircular : true, 769 auto : sliderAuto ? sliderAuto : instance.options.sliderAuto, 770 scroll : { 771 fx : sliderFx ? sliderFx : instance.options.sliderFx, 772 easing : "linear", 773 duration : sliderSpeedAnimation ? sliderSpeedAnimation : instance.options.speedAnimation, 774 timeoutDuration: sliderTimeout ? sliderTimeout : instance.options.sliderInterval, 775 items : sliderScrollItems ? sliderScrollItems : 'page', 776 onBefore : function (data) { 777 var that = $(this), 778 thatClass = that.find('li:first').attr('class') ? that.find('li:first').attr('class') : '', 779 oldItems = $(data.items.old), 780 visItems = $(data.items.visible), 781 oldAnimated = oldItems.find('[data-animate]'); 782 783 if (!onMobile) { 784 if (visItems.find('video').length > 0) { 785 visItems.find('video').get(0).play(); 786 } 787 } 788 789 if (oldAnimated.length > 0){ 790 that.parent().removeClass().addClass('carousel-wrap ' + thatClass); 791 792 that.parent().find('ul:last [data-animate]').removeClass('animated'); 793 794 setTimeout(function () { 795 oldAnimated.each(function () { 796 var eachThis = $(this), 797 animateFx = eachThis.data('animate'); 798 eachThis.removeClass(animateFx).removeClass('animated'); 799 }); 800 }, instance.options.speedAnimation); 801 } 802 803 that.find('.no-before').removeClass('no-before'); 804 }, 805 onAfter : function (data) { 806 var that = $(this), 807 par = that.parents('.slider'), 808 visItem = $(data.items.visible), 809 visItemLength = visItem.length, 810 visAnimated = visItem.find('[data-animate]'); 811 812 if (par.hasClass('steps-1') || par.hasClass('steps-2') || par.hasClass('steps-4') || par.hasClass('steps-5') || par.hasClass('steps-6')) { 813 that.find('li').filter(':nth-child('+ visItemLength +'n+'+ (visItemLength+1) +')').addClass('no-before'); 814 that.find('li:first-child').addClass('no-before'); 815 } 816 817 if (visAnimated.length > 0){ 818 that.parent().removeClass().addClass('carousel-wrap'); 819 820 visAnimated.each(function () { 821 var eachThis = $(this), 822 animateFx = eachThis.data('animate'); 823 eachThis.addClass(animateFx).addClass('animated'); 824 }); 825 } 826 } 827 }, 828 onCreate : function (data) { 829 var visItem = $(data.items), 830 visItemLength = visItem.length; 831 832 $('[class*=steps].slider li:first-child').addClass('step-1'); 833 834 if ($this.hasClass('steps-1') || $this.hasClass('steps-2') || $this.hasClass('steps-4') || $this.hasClass('steps-5') || $this.hasClass('steps-6')) { 835 $this.find('li').filter(':nth-child('+ visItemLength +'n+'+ (visItemLength+1) +')').addClass('no-before'); 836 $this.find('li:first-child').addClass('no-before'); 837 } 838 839 if (!onMobile) { 840 if (visItem.find('video').length > 0) { 841 visItem.find('video').get(0).play(); 842 } 843 } 844 }, 845 items : sliderItems, 846 swipe : { 847 onTouch: true, 848 onMouse: false 849 }, 850 prev : $(sliderPrefix + e + ' .slider-arrow-prev'), 851 next : $(sliderPrefix + e + ' .slider-arrow-next'), 852 pagination: { 853 container : $(sliderPrefix + e + ' > .slider-pagination') 854 }, 855 mousewheel: sliderOrient 856 },{ 857 onWindowResize: 'throttle', 858 wrapper: { 859 classname: 'carousel-wrap' 860 } 861 }).parent().css('margin', 'auto'); 862 }); 863 } 864 }, 865 sliderRevolution: function(){ 866 var instance = this, 867 revolutionTabs = $('.banner-tabs'); 868 869 if (instance.banner.length > 0) { 870 871 instance.banner.each(function () { 872 var $this = $(this); 873 874 $this.revolution({ 875 autoplay: ($this.data('auto')) ? $this.data('auto') : false, 876 delay : ($this.data('timeout')) ? $this.data('timeout') : "9000", 877 startwidth : 1110, 878 startheight : ($this.data('startheight')) ? $this.data('startheight') : 550, 879 startWithSlide: 0, 880 881 fullScreenAlignForce: "off", 882 autoHeight : "off", 883 minHeight : "off", 884 885 shuffle: "off", 886 887 onHoverStop: "off", 888 889 stopAtSlide: ($this.data('stopatslide')) ? $this.data('stopatslide') : -1, 890 stopAfterLoops: ($this.data('stopafterloops')) ? $this.data('stopafterloops') : -1, 891 892 thumbWidth : ($this.data('thumbwidth')) ? $this.data('thumbwidth') : 90,
893 thumbHeight: ($this.data('thumbheight')) ? $this.data('thumbheight') : 60, 894 thumbAmount: ($this.data('thumbamount')) ? $this.data('thumbamount') : 3, 895 896 hideThumbsOnMobile : "off", 897 hideNavDelayOnMobile : 1500, 898 hideBulletsOnMobile : "off", 899 hideArrowsOnMobile : "off", 900 hideThumbsUnderResoluition: 0, 901 902 hideThumbs : 0, 903 hideTimerBar: ($this.data('hidetimerbar')) ? $this.data('hidetimerbar') : "on", 904 905 keyboardNavigation: "on", 906 907 navigationType : ($this.data('navigationtype')) ? $this.data('navigationtype') : "bullet", 908 navigationArrows: ($this.data('navigationarrows')) ? $this.data('navigationarrows') : "solo", 909 navigationStyle : ($this.data('navigationstyle')) ? $this.data('navigationstyle') : "round", 910 911 navigationHAlign : ($this.data('navigationhalign')) ? $this.data('navigationhalign') : "center", 912 navigationVAlign : ($this.data('navigationvalign')) ? $this.data('navigationvalign') : "bottom", 913 navigationHOffset: ($this.data('navigationhoffset')) ? $this.data('navigationhoffset') : 0, 914 navigationVOffset: ($this.data('navigationvoffset')) ? $this.data('navigationvoffset') : 35, 915 916 soloArrowLeftHalign : ($this.data('soloarrowlefthalign')) ? $this.data('soloarrowlefthalign') : "left", 917 soloArrowLeftValign : ($this.data('soloarrowleftvalign')) ? $this.data('soloarrowleftvalign') : "center", 918 soloArrowLeftHOffset: ($this.data('soloarrowlefthoffset')) ? $this.data('soloarrowlefthoffset') : -2, 919 soloArrowLeftVOffset: ($this.data('soloarrowleftvoffset')) ? $this.data('soloarrowleftvoffset') : 0, 920 921 soloArrowRightHalign : ($this.data('soloarrowrighthalign')) ? $this.data('soloarrowrighthalign') : "right", 922 soloArrowRightValign : ($this.data('soloarrowrightvalign')) ? $this.data('soloarrowrightvalign') : "center", 923 soloArrowRightHOffset: ($this.data('soloarrowrighthoffset')) ? $this.data('soloarrowrighthoffset') : -2, 924 soloArrowRightVOffset: ($this.data('soloarrowrightvoffset')) ? $this.data('soloarrowrightvoffset') : 0, 925 926 //drag_block_vert: false, 927 928 //touchenabled : "on", 929 //swipe_velocity : "0.7", 930 //swipe_max_touches : "1", 931 //swipe_min_touches : "1", 932 //drag_block_vertical: "false", 933 934 parallax : ($this.data('parallax')) ? $this.data('parallax') : "mouse", 935 parallaxBgFreeze : ($this.data('parallaxbgfreeze')) ? $this.data('parallaxbgfreeze') : "on", 936 parallaxLevels : ($this.data('parallaxlevels')) ? $this.data('parallaxlevels') : [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], 937 938 dottedOverlay: ($this.data('dottedoverlay')) ? $this.data('dottedoverlay') : "none", 939 spinned: "spinner0", 940 941 fullWidth : ($this.data('fullwidth')) ? $this.data('fullwidth') : "off", 942 forceFullWidth : ($this.data('forcefullwidth')) ? $this.data('forcefullwidth') : "off", 943 fullScreen : ($this.data('fullscreen')) ? $this.data('fullscreen') : "off", 944 fullScreenOffsetContainer: ($this.data('fullscreenoffsetcontainer')) ? $this.data('fullscreenoffsetcontainer') : "", 945 946 shadow: 0 947 }); 948 949 revolutionTabs.on('click', 'a', function (e) { 950 e.preventDefault(); 951 952 var self = $(this), 953 indx = self.parent().index() + 1; 954 955 $this.revshowslide(indx); 956 self.parent().addClass('selected').siblings().removeClass('selected'); 957 }); 958 959 $this.bind("revolution.slide.onchange",function (e,data) { 960 var slideIndx = data.slideIndex - 1; 961 962 revolutionTabs.find('li').eq(slideIndx).addClass('selected').siblings().removeClass('selected'); 963 }); 964 }); 965 } 966 }, 967 pieCharts: function () { 968 var instance = this; 969 970 if (instance.pieChart.length > 0){ 971 instance.pieChart.each(function () { 972 var $this = $(this), 973 barColor = $this.data('bar-color') ? $this.data('bar-color') : false, 974 trackColor = $this.data('track-color'), 975 lineWidth = $this.data('line-width') ? $this.data('line-width') : 6; 976 977 $this.on('appear', function () { 978 $this.animate({'opacity': 1}, instance.options.speedAnimation); 979 $this.easyPieChart({ 980 barColor: barColor, 981 trackColor: trackColor, 982 lineWidth: lineWidth, 983 animate: instance.options.speedAnimation * 4, 984 onStep: function (from, to, percent) { 985 if (!$(this.el).hasClass('pie-icon')) { 986 $(this.el).find('.pie-percent').text(Math.round(percent)); 987 } 988 } 989 }); 990 }).appear(); 991 992 993 }); 994 } 995 }, 996 vCharts: function () { 997 var instance = this; 998 999 if (instance.verticalChart.length > 0) { 1000 instance.verticalChart.each(function (e) { 1001 var $this = $(this), 1002 pColors = $this.data('colors'), 1003 pPostfix = $this.data('postfix'), 1004 pData = $this.data('value'); 1005 1006 $this.attr('id', 'bar-' + e); 1007 1008 $this.on('appear', function () { 1009 if ($this.children().length === 0) { 1010 $this.jqBarGraph({ 1011 data: [ 1012 [pData] 1013 ], 1014 colors: [pColors], 1015 postfix: pPostfix, 1016 height: 240 1017 }); 1018 } 1019 }).appear(); 1020 }); 1021 } 1022 }, 1023 countUp: function () { 1024 var instance = this, 1025 obj = { 1026 delay: 40, 1027 signPosition: 'after', 1028 orderSeparator: '.', 1029 decimalSeparator: ',' 1030 }; 1031 1032 if (instance.countup.length > 0) { 1033 instance.countup.each(function () { 1034 var self = $(this); 1035 1036 if (!self.hasClass('countup-fix')){ 1037 self.hsCounter(obj); 1038 } 1039 }); 1040 } 1041 }, 1042 fMiddle: function () { 1043 var instance = this; 1044 1045 instance.vmiddle.each(function () { 1046 var $this = $(this); 1047 if ( !$this.prev().length ){ 1048 $this.css({ 1049 'marginTop' : ($this.parent().outerHeight() - $this.outerHeight())/2 1050 }); 1051 } else{ 1052 $this.css({ 1053 'marginTop' : ($this.parent().height() - $this.height())/2 - $this.prev().css('paddingTop').replace('px','') 1054 }); 1055 } 1056 1057 }); 1058 }, 1059 parallaxBG: function () { 1060 var instance = this; 1061 1062 instance.parallax.each(function(){ 1063 var self = $(this), 1064 yPos = -($win.scrollTop() * self.data('speed')), 1065 coords = '50% '+ yPos + 'px'; 1066 1067 if ($win.width() >= 768) { 1068 self.css({backgroundPosition: coords}
1068); 1069 } else { 1070 self.css({backgroundPosition: '50% 50%'}); 1071 } 1072 }); 1073 1074 }, 1075 instagramm: function () { 1076 var instance = this; 1077 1078 if (instance.instafeed.length){ 1079 var linkTemplate = "{{link}}", 1080 imgTemplate = "{{image}}", 1081 userFeed = new Instafeed({ 1082 get: 'user', 1083 userId: instance.options.instagrammId, 1084 limit: 6, 1085 accessToken: '3677038064.1677ed0.1fac723f09c8482c9c6bf406a2041331', 1086 template: '<a href='+ linkTemplate +' target="_blank"><img alt="" src='+ imgTemplate +' /></a>' 1087 }); 1088 userFeed.run(); 1089 } 1090 }, 1091 flickr: function () { 1092 var instance = this; 1093 1094 if (instance.flickrfeed.length){ 1095 var imgBTemplate = "{{image_b}}", 1096 imgSTemplate = "{{image_s}}"; 1097 1098 instance.flickrfeed.jflickrfeed({ 1099 limit: 6, 1100 qstrings: { 1101 id: instance.options.flickrId 1102 }, 1103 itemTemplate: '<a href='+ imgBTemplate +' target="_blank"><img alt="{{title}}" src='+ imgSTemplate +' /></a>' 1104 }); 1105 } 1106 }, 1107 faqNav: function () { 1108 var instance = this, 1109 faq = $('.faq'), 1110 faqBody = faq.find('.panel-body'); 1111 1112 if (faqBody.length > 0) { 1113 faqBody.collapse({toggle: false}); 1114 } 1115 1116 instance.expandLink.on('click', function(e){ 1117 e.preventDefault(); 1118 faqBody.collapse('show'); 1119 faq.find('[data-toggle]').removeClass('collapsed'); 1120 }); 1121 1122 instance.collapseLink.on('click', function(e){ 1123 e.preventDefault(); 1124 faqBody.collapse({toggle: false}); 1125 faqBody.collapse('hide'); 1126 faq.find('[data-toggle]').addClass('collapsed'); 1127 }); 1128 }, 1129 priceSlider: function () { 1130 var slider = $('.price_slider'), 1131 label = $('.price_label'), 1132 from = label.find('.from'), 1133 to = label.find('.to'); 1134 1135 slider.slider({ 1136 range: true, 1137 min: 0, 1138 max: 1000, 1139 values: [10, 590], 1140 slide: function( event, ui ) { 1141 from.html('$' + ui.values[0]); 1142 to.html('$' + ui.values[1]); 1143 } 1144 }); 1145 from.val('$' + slider.slider( 'values', 0)); 1146 to.val('$' + slider.slider( 'values', 1)); 1147 }, 1148 scrll: function () { 1149 var instance = this, 1150 wh = $win.height(), 1151 scrTop = $win.scrollTop(), 1152 hh = instance.header.outerHeight(true), 1153 toggleTop = instance.widgetbarToggle.data('top-position'); 1154 1155 if ($win.scrollTop() > 130){ 1156 instance.widgetbarToggle.css('top', 50); 1157 $('.is-header-vertical').find(instance.widgetbarToggle).css('top', 50); 1158 } else{ 1159 instance.widgetbarToggle.css('top', toggleTop); 1160 } 1161 1162 // Header Bottom Sticky 1163 if (instance.header.hasClass('header-sticky')){ 1164 if (instance.header.hasClass('navbar-fixed-bottom')) { 1165 if (instance.header.hasClass('header-sticky-hidden')){ 1166 instance.header.css('bottom', scrTop); 1167 } else { 1168 if (scrTop >= (wh - hh)) { 1169 instance.header 1170 .addClass('navbar-fixed-top') 1171 .removeAttr('style'); 1172 } else { 1173 instance.header 1174 .removeClass('navbar-fixed-top') 1175 .css('bottom', scrTop); 1176 } 1177 } 1178 } 1179 } 1180 1181 // Header Bottom Hidden 1182 if (instance.header.hasClass('header-bottom-hidden')) { 1183 if (instance.header.hasClass('navbar-fixed-bottom')) { 1184 instance.header.css('bottom', -hh); 1185 1186 if (scrTop >= 0 && scrTop < hh) { 1187 instance.header.css('bottom', (scrTop - hh)); 1188 } else { 1189 if (instance.header.hasClass('header-sticky-hidden')) { 1190 instance.header.css('bottom', (scrTop - hh)); 1191 1192 if (instance.header.hasClass('header-sticky')) { 1193 if (scrTop >= wh) { 1194 instance.header 1195 .addClass('navbar-fixed-top') 1196 .removeAttr('style'); 1197 } else { 1198 instance.header 1199 .removeClass('navbar-fixed-top') 1200 .css('bottom', (scrTop - hh)); 1201 } 1202 } 1203 } else { 1204 instance.header.css('bottom', 0); 1205 } 1206 } 1207 } 1208 } 1209 }, 1210 megaMenu: function () { 1211 var instance = this, 1212 ww = $win.width(); 1213 1214 if (!instance.header.hasClass('header-vertical')) { 1215 if (ww <= instance.options.collapseMenuWidth) { 1216 if (instance.navbar.length > 0) {
1217 instance.navbar.superfish('destroy'); 1218 } 1219 } else { 1220 instance.navbarCollapse.removeClass('in'); 1221 if (instance.navbar.length > 0 && $('body').hasClass('no-mobile')) { 1222 instance.navbar.superfish({ 1223 delay: 100, 1224 animation: { 1225 opacity:'show', 1226 marginTop: 0, 1227 marginBottom: 0 1228 }, 1229 animationOut: { 1230 opacity:'hide', 1231 marginTop: '15px', 1232 marginBottom: '15px' 1233 }, 1234 speed: 'fast', 1235 speedOut: 'fast', 1236 onBeforeShow: function () { 1237 var self = this, 1238 pr = self.prev(), 1239 winW = $win.width(), 1240 pw = pr.outerWidth(), 1241 w = self.outerWidth(), 1242 lp = (self.prev().length > 0) ? self.prev().offset().left : 0; 1243 1244 if ((lp + w + pw) > winW){ 1245 //console.log(lp, w, pw) 1246 //console.log(winW) 1247 self.parent().find('.dropdown-menu').addClass('reverse-list'); 1248 } 1249 }, 1250 onHide: function () { 1251 //console.log(this) 1252 this.removeClass('reverse-list'); 1253 } 1254 }); 1255 } 1256 } 1257 } 1258 }, 1259 contactMap: function () { 1260 var instance = this, 1261 marker, 1262 modalMapLink = $('.a-map'), 1263 modalMapClose = $('.map-close'), 1264 infowindow = null; 1265 1266 if (instance.map.length > 0) { 1267 $.each(instance.map, function (index, map) { 1268 var mapContainer = $(map).find('.google-map-container'), 1269 mapDataCenter = mapContainer.data('center').split(','), 1270 mapDataMarkers = mapContainer.data('markers').split('; '), 1271 mapOptions = { 1272 zoom: mapContainer.data('zoom'), 1273 scrollwheel: false, 1274 panControl: mapContainer.data('pan-control') ? mapContainer.data('pan-control') : false, 1275 navigationControl: mapContainer.data('navigation-control') ? mapContainer.data('navigation-control') : false, 1276 mapTypeControl: mapContainer.data('map-type-control') ? mapContainer.data('map-type-control') : false, 1277 scaleControl: mapContainer.data('scale-control') ? mapContainer.data('scale-control') : false, 1278 draggable: true, 1279 zoomControl: true, 1280 zoomControlOptions: { 1281 style: google.maps.ZoomControlStyle.SMALL, 1282 position: google.maps.ControlPosition.LEFT_CENTER 1283 }, 1284 center: new google.maps.LatLng(mapDataCenter[0], mapDataCenter[1]), 1285 styles: mapContainer.data('style') ? mapContainer.data('style') : [] 1286 }, 1287 googleMap = new google.maps.Map(mapContainer.get(0), mapOptions), 1288 i = 0, 1289 markerLength = mapContainer.data('markers').split('; ').length, 1290 markerColor = instance.options.markersColor ? instance.options.markersColor : instance.options.markersColor[0]; 1291 1292 infowindow = new google.maps.InfoWindow(); 1293 1294 for (i; i < markerLength; i++) { 1295 marker = new google.maps.Marker({ 1296 map: googleMap, 1297 position: new google.maps.LatLng(mapDataMarkers[i].split(',')[0], mapDataMarkers[i].split(',')[1]), 1298 icon: { 1299 path: fontawesome.markers.MAP_MARKER, 1300 scale: 0.65, 1301 fillColor: markerColor[i], 1302 fillOpacity: 1, 1303 strokeColor: markerColor[i], 1304 anchor: new google.maps.Point(15, -5) 1305 } 1306 }); 1307 1308 google.maps.event.addListener(marker, 'click', function () { 1309 infowindow.setContent('<p>' + this.position.A + ', ' + this.position.F + '</p>'); 1310 infowindow.open(googleMap, this); 1311 }); 1312 } 1313 1314 mapContainer.parents('.map-wrap').find(modalMapLink).on('click', function () { 1315 1316 var self = $(this), 1317 popupContainer = $(self.attr('href')), 1318 mapPopup = popupContainer.find('.google-map-popup'); 1319 1320 setTimeout(function () { 1321 var googlePopup = new google.maps.Map(mapPopup.get(0), mapOptions); 1322 for (i = 0; i < markerLength; i++) { 1323 marker = new google.maps.Marker({ 1324 map: googlePopup, 1325 position: new google.maps.LatLng(mapDataMarkers[i].split(',')[0], mapDataMarkers[i].split(',')[1]), 1326 icon: { 1327 path: fontawesome.markers.MAP_MARKER, 1328 scale: 0.65, 1329 fillColor: markerColor[i], 1330 fillOpacity: 1, 1331 strokeColor: markerColor[i], 1332 anchor: new google.maps.Point(15, -5) 1333 } 1334 }); 1335 1336 google.maps.event.addListener(marker, 'click', function () { 1337 infowindow.setContent('<p>' + this.position.A + ', ' + this.position.F + '</p>'); 1338 infowindow.open(googlePopup, this); 1339 }); 1340 } 1341 }, 150); 1342 }); 1343 }); 1344 } 1345 1346 modalMapClose.on('click', function () { 1347 $('.google-map-popup').removeAttr('style').children().remove(); 1348 }); 1349 }, 1350 rez: function () { 1351 var instance = this, 1352 ww = $win.width(), 1353 wh = $win.height(), 1354 hh = instance.header.outerHeight(), 1355 $container = $('.container'), 1356 containerWidth = $container.outerWidth(), 1357 sliderArrow = $('.slider-arrow'), 1358 mVis = function () { 1359 //instance.body.removeClass('no-menu').addClass('is-menu'); 1360 $('.navbar-collapse').removeClass('collapse'); 1361 }, 1362 mHid = function () { 1363 //instance.body.removeClass('is-menu').addClass('no-menu'); 1364 $('.navbar-collapse').addClass('collapse'); 1365 }; 1366 1367 if (ww > instance.options.collapseMenuWidth) { 1368 mVis(); 1369 } else { 1370 mHid(); 1371 } 1372 1373 if (instance.body.hasClass('is-header-vertical') && !instance.header.hasClass('header-vertical-move')){ 1374 if (ww < 1200){ 1375 $('.header-vertical').removeClass('in'); 1376 instance.wrapper.removeClass('wrapper-margin'); 1377 instance.footer.removeClass('footer-margin'); 1378 instance.header.find(instance.navbarToggle).addClass('visible'); 1379 } else{ 1380 $('.header-vertical').addClass('in'); 1381 instance.wrapper.addClass('wrapper-margin'); 1382 instance.footer.addClass('footer-margin'); 1383 instance.header.find(instance.navbarToggle).removeClass('visible'); 1384 } 1385 } 1386 1387 instance.imgWrap.each(function () { 1388 var self = $(this), 1389 pa = self.parent(), 1390 pH = pa.outerHeight(true); 1391 1392 if ($win.width() > 767) { 1393 self.removeAttr('style'); 1394 self.height(pH); 1395 } else { 1396 self.removeAttr('style'); 1397 } 1398 }); 1399 1400 instance.mapAbsolute.each(function () { 1401 var $this = $(this), 1402 $c = $this.parents('.container'), 1403 cW = $c.outerWidth(), 1404 cwCol = $this.parents('[class*=col-]'), 1405 cwWidth = cwCol.outerWidth(); 1406 1407 $this.width((ww - cW) / 2 + cW * cwWidth / cW); 1408 instance.contactMap();
1409 }); 1410 1411 sliderArrow.each(function () { 1412 var that = $(this), 1413 sliderArrowWidth = that.width(), 1414 marginOffset = (ww - containerWidth) / 4 - sliderArrowWidth / 2; 1415 1416 if(marginOffset < 0) { 1417 marginOffset = 15; 1418 } 1419 1420 if (that.hasClass('slider-arrow-prev') && that.hasClass('arrow-margin')){ 1421 that.css('marginLeft', marginOffset); 1422 } else if (that.hasClass('slider-arrow-next') && that.hasClass('arrow-margin')) { 1423 that.css('marginRight', marginOffset); 1424 } 1425 }); 1426 1427 instance.slider.each(function () { 1428 var that = $(this), 1429 list = that.find('ul'), 1430 maxItems = list.data('max-items') ? list.data('max-items') : 1; 1431 1432 if (ww > 768 && ww <= 992) { 1433 list.trigger('configuration', [ 1434 'items', { 1435 visible: { 1436 max: (maxItems < 3) ? maxItems : 3 1437 } 1438 }], true); 1439 } else if (ww > 639 && ww <= 767) { 1440 list.trigger('configuration', [ 1441 'items', { 1442 visible: { 1443 max: (maxItems < 2) ? maxItems : 2 1444 } 1445 }], true); 1446 } else if (ww <= 639) { 1447 list.trigger('configuration', [ 1448 'items', { 1449 visible: { 1450 max: 1 1451 } 1452 }], true); 1453 } else { 1454 list.trigger('configuration', [ 1455 'items', { 1456 visible: { 1457 max: maxItems 1458 } 1459 }], true); 1460 } 1461 1462 if (that.hasClass('oneslider')){ 1463 list.trigger('configuration', [ 1464 'items', { 1465 visible: { 1466 max: 1 1467 } 1468 }], true); 1469 } 1470 }); 1471 1472 //instance.wrapper.css('minHeight', wh - hh - (instance.footer.outerHeight(true) || 0)); 1473 }, 1474 subscribeForm: function () { 1475 var instance = this; 1476 1477 if (instance.subscribe.length === 1) { 1478 instance.subscribe.find('input[type=email]').on('keyup', function () { 1479 var sucBlock = $('.success-block'); 1480 if (sucBlock.is(':visible')) sucBlock.css('display', 'none'); 1481 }); 1482 1483 instance.subscribe.validatr({ 1484 showall: true, 1485 location: 'top', 1486 template: '<div class="error-email">' + instance.options.errorText + '</div>', 1487 valid: function () { 1488 var form = instance.subscribe, 1489 msgwrap = $('.feedback-success'), 1490 url = form.attr('action'), 1491 email = form.find('input[type=email]'); 1492 1493 url = url.replace('/post?', '/post-json?').concat('&c=?'); 1494 1495 var data = {}; 1496 var dataArray = form.serializeArray(); 1497 1498 $.each(dataArray, function (index, item) { 1499 data[item.name] = item.value; 1500 }); 1501 1502 $.ajax({
1503 url: url, 1504 data: data, 1505 success: function (resp) { 1506 var successText = instance.options.successText; 1507 1508 function notHide() { 1509 form.attr('style', ' '); 1510 } 1511 1512 if (resp.result === 'success') { 1513 msgwrap.show().addClass('scale').find('span').html(successText); 1514 instance.notyOut(); 1515 setTimeout(notHide, 0); 1516 } else { 1517 setTimeout(notHide, 0); 1518 var msg; 1519 try { 1520 var parts = resp.msg.split(' - ', 2); 1521 if (parts[1] === undefined) { 1522 msg = resp.msg; 1523 } else { 1524 var i = parseInt(parts[0], 10); 1525 if (i.toString() === parts[0]) { 1526 msg = parts[1]; 1527 } else { 1528 msg = resp.msg; 1529 } 1530 } 1531 } catch (e) { 1532 msg = resp.msg; 1533 } 1534 msgwrap.show().addClass('scale has-error').find('span').html(msg); 1535 instance.notyOut(); 1536 } 1537 form.slideUp(0, function () { 1538 msgwrap.slideDown(); 1539 }); 1540 }, 1541 dataType: 'jsonp', 1542 error: function (resp, text) { 1543 alert('Oops! AJAX error: ' + text); 1544 } 1545 }); 1546 return false; 1547 } 1548 }); 1549 } 1550 }, 1551 contactForm: function () { 1552 var forms = $('.contact-form'), 1553 emailValidationRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 1554 1555 if (forms.length) { 1556 $.each(forms, function (form_index, form) { 1557 form = $(form); 1558 form.find('input, textarea').not('[type="radio"]').focusout(function () { 1559 var self = $(this), 1560 required = self.attr('required') ? true : false; 1561 1562 if (self.attr('type') == 'email') { 1563 if ((required && self.val() === '') || (self.val() && !emailValidationRegex.test(self.val()))) { 1564 self.parent().addClass('has-error'); 1565 } 1566 } else { 1567 1568 if (required && self.val() === '') { 1569 self.parent().addClass('has-error'); 1570 } 1571 } 1572 }).focusin(function () { 1573 $(this).parent().removeClass('has-error'); 1574 }); 1575 1576 form.find('input[type="radio"]').on('change', function () { 1577 var self = $(this), 1578 required = self.attr('required') ? true : false; 1579 1580 if (required && self.val() === '') { 1581 self.parent().addClass('has-error'); 1582 } 1583 }); 1584 1585 form.find('select').on('change', function () { 1586 var self = $(this), 1587 required = self.attr('required') ? true : false; 1588 1589 self.parent().removeClass('has-error'); 1590 1591 if (required && self.val() === '') { 1592 self.parent().addClass('has-error'); 1593 } 1594 }); 1595 1596 form.on('submit', function () { 1597 var hasErrors = false, 1598 form = $(this); 1599 1600 $.each(form.find('input, textarea').not('[type="radio"]'), function (index, input) { 1601 var self = $(input), 1602 required = self.attr('required') ? true : false; 1603 1604 if (self.attr('type') == 'email') { 1605 if ((required && self.val() === '') || (self.val() && !emailValidationRegex.test(self.val()))) { 1606 hasErrors = true; 1607 self.parent().addClass('has-error'); 1608 } 1609 } else { 1610 if (required && self.val() === '') { 1611 hasErrors = true; 1612 self.parent().addClass('has-error'); 1613 } 1614 } 1615 }); 1616 1617 $.each(form.find('select'), function (index, input) { 1618 var self = $(input), 1619 required = self.attr('required') ? true : false; 1620 1621 if (required && self.val() === '') { 1622 hasErrors = true; 1623 self.parent().addClass('has-error'); 1624 } 1625 }); 1626 1627 $.each(form.find('input[type="radio"]'), function (index, input) { 1628 var self = $(input), 1629 required = self.attr('required') ? true : false; 1630 1631 if (required && self.val() === '') { 1632 hasErrors = true; 1633 self.parent().addClass('has-error'); 1634 } 1635 }); 1636 1637 var inputs_data = {}; 1638 1639 $.each(form.find('input, textarea, select'), function (index, input) { 1640 input = $(input); 1641 1642 if (input.attr('name')) { 1643 inputs_data[input.attr('name')] = { 1644 required: input.attr('required'), 1645 value: input.val(), 1646 type: input.attr('type') 1647 }; 1648 } 1649 }); 1650 1651 if (!hasErrors) { 1652 $.ajax({
1653 type: 'POST', 1654 url: form.attr('action'), 1655 data: inputs_data, 1656 dataType: 'json' 1657 }).done(function (answer) { 1658 if ((typeof answer.status != 'undefined') && (answer.status == 'ok')) { 1659 form[0].reset(); 1660 $('.succs-msg').fadeIn().css("display", "inline-block"); 1661 } else { 1662 alert('Message was not sent. Server-side error!'); 1663 } 1664 }).fail(function () { 1665 alert('Message was not sent. Client error or Internet connection problems.'); 1666 }); 1667 } 1668 return false; 1669 }); 1670 }); 1671 } 1672 }, 1673 scrollbarWidth: function () { 1674 var a, 1675 b, 1676 c; 1677 1678 if (c === undefined) { 1679 a = $('<div style="width:50px; height:50px; overflow:auto;"><div/>').appendTo('body'); 1680 b = a.children(); 1681 c = b.innerWidth() - b.height(99).innerWidth(); 1682 a.remove(); 1683 } 1684 return c; 1685 } 1686 }; 1687 1688 $.fn[pluginName] = function (options) { 1689 return this.each(function () { 1690 if (!$.data(this, "plugin_" + pluginName)) { 1691 $.data(this, "plugin_" + pluginName, 1692 new Plugin(this, options)); 1693 } 1694 }); 1695 }; 1696})(jQuery, window, document); 1697 1698(function ($) { 1699 $(document.body).Aisconverse(); 1700 1701 // *** IE9 placeholder *** // 1702 if (document.all && !window.atob) { 1703 $('[placeholder]').focus(function () { 1704 var input = $(this); 1705 if (input.val() == input.attr('placeholder')) { 1706 input.val(''); 1707 input.removeClass('placeholder'); 1708 } 1709 }).blur(function () { 1710 var input = $(this); 1711 if (input.val() === '' || input.val() === input.attr('placeholder')) { 1712 input.addClass('placeholder'); 1713 input.val(input.attr('placeholder')); 1714 } 1715 }).blur().parents('form').submit(function () { 1716 $(this).find('[placeholder]').each(function () { 1717 var input = $(this); 1718 if (input.val() == input.attr('placeholder')) { 1719 input.val(''); 1720 } 1721 }); 1722 }); 1723 } 1724})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.