1;(function($){ 2 3 'use strict'; 4 5 $(function(){ 6 7 /* ---------------------------------------------------- */ 8 /* Revolution slider */ 9 /* ---------------------------------------------------- */ 10 11 if ($('#header').hasClass('style-2')) { 12 13 if ($('#rev-slider').length) { 14 jQuery("#rev-slider").revolution({ 15 sliderType:"standard", 16 spinner: "spinner3", 17 responsiveLevels: [4096,1024,778,480], 18 delay:6000, 19 navigation: { 20 arrows:{ 21 enable:true, 22 left: { 23 container:"slider", 24 h_align:"left", 25 v_align:"center", 26 h_offset:30, 27 v_offset:0 28 }, 29 right: { 30 container:"slider", 31 h_align:"right", 32 v_align:"center", 33 h_offset:30, 34 v_offset:0 35 } 36 }, 37 bullets:{ 38 style:"", 39 enable: true, 40 container: "slider", 41 hide_onmobile: false, 42 hide_onleave: false, 43 hide_delay: 200, 44 hide_under: 0, 45 hide_over: 9999, 46 tmp:'<span class="circle-bullet"></span>', 47 direction:"horisontal", 48 space: 10, 49 h_align: "center", 50 v_align: "bottom", 51 v_offset: 20 52 } 53 }, 54 gridwidth:1170, 55 gridheight:740 56 }); 57 58 } 59 60 } 61 62 else{ 63 64 if ($('#rev-slider').length) { 65 jQuery("#rev-slider").revolution({ 66 sliderType:"standard", 67 spinner: "spinner3", 68 responsiveLevels: [4096,1024,778,480], 69 delay:6000, 70 navigation: { 71 arrows:{
72 enable:true, 73 left: { 74 container:"slider", 75 h_align:"left", 76 v_align:"center", 77 h_offset:30, 78 v_offset:0 79 }, 80 right: { 81 container:"slider", 82 h_align:"right", 83 v_align:"center", 84 h_offset:30, 85 v_offset:0 86 } 87 }, 88 bullets:{ 89 style:"", 90 enable: true, 91 container: "slider", 92 hide_onmobile: false, 93 hide_onleave: false, 94 hide_delay: 200, 95 hide_under: 0, 96 hide_over: 9999, 97 tmp:'<span class="circle-bullet"></span>', 98 direction:"horisontal", 99 space: 10, 100 h_align: "center", 101 v_align: "bottom", 102 v_offset: 20 103 } 104 }, 105 gridwidth:1170, 106 gridheight:450 107 }); 108 109 } 110 111 } 112 113 /* ---------------------------------------------------- */ 114 /* Gallery carousel */ 115 /* ---------------------------------------------------- */ 116 117 $.mad_global.mad_init_carousel(); 118 119 /* ---------------------------------------------------- */ 120 /* Tabs */ 121 /* ---------------------------------------------------- */ 122 123 $(window).on("load",function(){ 124 125 var tabs = $('.tabs-section'); 126 if(tabs.length){ 127 tabs.tabs({ 128 beforeActivate: function(event, ui) { 129 var hash = ui.newTab.children("li a").attr("href"); 130 }, 131 hide : { 132 effect : "fadeOut", 133 duration : 450 134 }, 135 show : { 136 effect : "fadeIn", 137 duration : 450 138 }, 139 updateHash : false 140 }); 141 } 142 143 if($('ul.smooth_tabs').length){ 144 $('ul.smooth_tabs li:first').addClass('ui-tabs-active'); 145 146 $('ul.smooth_tabs li a').on("click", function(){ 147 $('ul.smooth_tabs').find('li').removeClass('ui-tabs-active'); 148 $(this).parent('li').addClass("ui-tabs-active"); 149 150 var x = $(this).attr('href'); 151 $(".smooth_item").removeClass('current_catalog_item'); 152 $(".tabs_content ").children('h3').removeClass('current_catalog_item'); 153 $(x).addClass('current_catalog_item'); 154 }); 155 } 156 157 }); 158 159 /* ---------------------------------------------------- */ 160 /* Newsletter */ 161 /* ---------------------------------------------------- */ 162 163 var subscribe = $('[id^="newsletter"]'); 164 subscribe.append('<div class="message-container-subscribe"></div>'); 165 var message = $('.message-container-subscribe'),text; 166 167 subscribe.on('submit',function(e){ 168 var self = $(this); 169 170 if(self.find('input[type="email"]').val() == ''){ 171 text = "Please enter your e-mail!"; 172 message.html('<div class="alert-box warning"><p>'+text+'</p></div>') 173 .slideDown() 174 .delay(4000) 175 .slideUp(function(){ 176 $(this).html(""); 177 }); 178 179 }else{ 180 self.find('span.error').hide(); 181 $.ajax({
182 type: "POST", 183 url: "bat/newsletter.php", 184 data: self.serialize(), 185 success: function(data){ 186 if(data == '1'){ 187 text = "Your email has been sent successfully!"; 188 message.html('<div class="alert-box success"><p>'+text+'</p></div>') 189 .slideDown() 190 .delay(4000) 191 .slideUp(function(){ 192 $(this).html(""); 193 }) 194 .prevAll('input[type="email"]').val(""); 195 }else{ 196 text = "Invalid email address!"; 197 message.html('<div class="alert-box error"></i><p>'+text+'</p></div>') 198 .slideDown() 199 .delay(4000) 200 .slideUp(function(){ 201 $(this).html(""); 202 }); 203 } 204 } 205 }); 206 } 207 e.preventDefault(); 208 }); 209 210 /* ---------------------------------------------------- */ 211 /* Loader */ 212 /* ---------------------------------------------------- */ 213 214 $("body").queryLoader2({ 215 backgroundColor: '#fff', 216 barColor : '#d10a11', 217 barHeight: 4, 218 deepSearch:true, 219 minimumTime:1000, 220 onComplete: function(){ 221 $(".loader").fadeOut('200'); 222 } 223 }); 224 225 /* ---------------------------------------------------- */ 226 /* Sticky menu */ 227 /* ---------------------------------------------------- */ 228 229 $('body').Temp({ 230 sticky: true 231 }); 232 233 /* ---------------------------------------------------- */ 234 /* SmoothScroll */ 235 /* ---------------------------------------------------- */ 236 237 try { 238 $.browserSelector(); 239 var $html = $('html'); 240 if ( $html.hasClass('chrome') || $html.hasClass('ie11') || $html.hasClass('ie10') ) { 241 $.smoothScroll(); 242 } 243 } catch(err) {} 244 245 /* ---------------------------------------------------- */ 246 /* Fancybox */ 247 /* ---------------------------------------------------- */ 248 249 if ($('a.fancy-gallery').length) { 250 $('a.fancy-gallery').fancybox(); 251 } 252 253 if ($('a.fancy-video').length) { 254 $("a.fancy-video").on("click", function(){ 255 $.fancybox({ 256 href: this.href, 257 type: $(this).data("type") 258 }); // fancybox 259 return false; 260 }); // on 261 } 262 263 /* ---------------------------------------------------- */ 264 /* Custom Select */ 265 /* ---------------------------------------------------- */ 266 267 if ($('.custom-select').length) { 268 $('.custom-select').mad_custom_select(); 269 } 270 271 /* ---------------------------------------------------- */ 272 /* Price Scale */ 273 /* ---------------------------------------------------- */ 274 275 var slider; 276 if($('#price').length){ 277 slider = $('#price').slider({ 278 animate: true, 279 range: true, 280 values: [ 20, 400 ], 281 min: 0, 282 max: 500, 283 slide : function(event ,ui){ 284 $('.range-values').find('.first-limit').val('$' + ui.values[0]); 285 $('.range-values').find('.last-limit').val('$' + ui.values[1]); 286 } 287 }); 288 } 289 if($('#distance').length){ 290 slider = $( "#distance" ).slider({ 291 animate: true, 292 value: 0, 293 min: 0, 294 max: 1000, 295 step: 1, 296 slide: function( event, ui ) { 297 $( "#amount" ).val( ui.value + " km" ); 298 $( "#total" ).val( "Total: $ " + ui.value ); 299 } 300 }); 301 $( "#amount" ).val( $( "#distance" ).slider( "value" ) + " km" ); 302 $( "#total" ).val( "Total: $ " + $( "#distance" ).slider( "value" ) ); 303 } 304 305 306 /* ---------------------------------------------------- */ 307 /* Accordion & Toggle */ 308 /* ---------------------------------------------------- */ 309 310 var aItem = $('.accordion:not(.toggle) .accordion-item'), 311 link = aItem.find('.a-title'), 312 $label = aItem.find('label'), 313 aToggleItem = $('.accordion.toggle .accordion-item'), 314 tLink = aToggleItem.find('.a-title'); 315 316 aItem.add(aToggleItem).children('.a-title').not('.active').next().hide(); 317 318 function triggerAccordeon($item) { 319 $item 320 .addClass('active') 321 .next().stop().slideDown() 322 .parent().siblings() 323 .children('.a-title') 324 .removeClass('active') 325 .next().stop().slideUp(); 326 } 327 328 329 if ($label.length) { 330 $label.on('click',function(){ 331 triggerAccordeon($(this).closest('.a-title')) 332 }); 333 } else { 334 link.on('click',function(){ 335 triggerAccordeon($(this)) 336 }); 337 } 338 339 tLink.on('click',function(){ 340 $(this).toggleClass('active') 341 .next().stop().slideToggle(); 342 343 }); 344 345 /* ---------------------------------------------------- */ 346 /* Quantity */ 347 /* ---------------------------------------------------- */ 348 349 var q = $('.quantity'); 350 351 q.each(function(){ 352 var $this = $(this), 353 button = $this.children('button'), 354 input = $this.children('input[type="text"]'), 355 val = +input.val(); 356 357 button.on('click',function(){
358 if($(this).hasClass('qty-minus')){ 359 if(val === 1) return false; 360 input.val(--val); 361 } 362 else{ 363 input.val(++val); 364 } 365 }); 366 }); 367 368 /* ---------------------------------------------------- */ 369 /* Contact Form */ 370 /* ---------------------------------------------------- */ 371 372 if ($('#contact-form').length){ 373 374 var cf = $('#contact-form'); 375 cf.append('<div class="message-container"></div>'); 376 377 cf.on("submit",function(event){ 378 379 var self = $(this),text; 380 381 var request = $.ajax({ 382 url:"bat/mail.php", 383 type : "post", 384 data : self.serialize() 385 }); 386 387 request.then(function(data){ 388 if(data == "1"){ 389 390 text = "Your message has been sent successfully!"; 391 392 cf.find('input:not([type="submit"]),textarea').val(''); 393 394 $('.message-container').html('<div class="alert-box success"><i class="icon-smile"></i><p>'+text+'</p></div>') 395 .delay(150) 396 .slideDown(300) 397 .delay(4000) 398 .slideUp(300,function(){ 399 $(this).html(""); 400 }); 401 402 } 403 else{ 404 if(cf.find('textarea').val().length < 20){ 405 text = "Message must contain at least 20 characters!" 406 } 407 if(cf.find('input').val() == ""){ 408 text = "All required fields must be filled!"; 409 } 410 $('.message-container').html('<div class="alert-box error"><i class="icon-warning"></i><p>'+text+'</p></div>') 411 .delay(150) 412 .slideDown(300) 413 .delay(4000) 414 .slideUp(300,function(){ 415 $(this).html(""); 416 }); 417 } 418 },function(){ 419 $('.message-container').html('<div class="alert-box error"><i class="icon-warning"></i><p>Connection to server failed!</p></div>') 420 .delay(150) 421 .slideDown(300) 422 .delay(4000) 423 .slideUp(300,function(){ 424 $(this).html(""); 425 }); 426 }); 427 428 event.preventDefault(); 429 430 }); 431 432 } 433 434 /* ---------------------------------------------------- */ 435 /* Main elements run */ 436 /* ---------------------------------------------------- */ 437 438 $.mad_core.run(); 439 440 /* ---------------------------------------------------- */ 441 /* Demo switcher */ 442 /* ---------------------------------------------------- */ 443 444 $(window).on("load",function(){ 445 446 $(".btn-demo").on('click',function() { 447 $('.demo-sw').toggleClass('open'); 448 return false; 449 }); 450 451 var $win = $('.wrapper-container'); // or $box parent container 452 var $box = $(".demo-sw"); 453 var $sb = $(".btn-demo"); 454 455 $win.on("click.Bst", function(event){ 456 if ( 457 $box.has(event.target).length == 0 //checks if descendants of $box was clicked 458 && 459 !$box.is(event.target) //checks if the $box itself was clicked 460 && 461 !$sb.is(event.target) //checks if the $box itself was clicked 462 ){ 463 $('.demo-sw').removeClass('open');; 464 } 465 }); 466 467 }); 468 469 /* ---------------------------------------------------- */ 470 /* Animate a regular anchor navigation */ 471 /* ---------------------------------------------------- */ 472 473 if ($('a.animated').length) { 474 475 $('body').localScroll({ 476 hash: true, 477 filter: '.animated', 478 onBefore: function(){ 479 this.offset = -200; 480 } 481 }); 482 483 } 484 485 /* ---------------------------------------------------- */ 486 /* Elevate zoom */ 487 /* ---------------------------------------------------- */ 488 489 if($('[data-zoom-image]').length){ 490 491 var button = $('.qv-preview'); 492 493 $("#zoom-image").elevateZoom({ 494 gallery:'thumbnails', 495 galleryActiveClass: 'active', 496 zoomType: "inner", 497 cursor: "crosshair", 498 responsive:true, 499 zoomWindowFadeIn: 500, 500 zoomWindowFadeOut: 500, 501 easing:true, 502 lensFadeIn: 500, 503 lensFadeOut: 500 504 }); 505 506 button.on("click", function(e){ 507 var ez = $('#zoom-image').data('elevateZoom'); 508 $.fancybox(ez.getGalleryList()); 509 e.preventDefault(); 510 }); 511 512 } 513 514 515 /* ---------------------------------------------------- */ 516 /* Google Maps */ 517 /* ---------------------------------------------------- */ 518 519 if ($('#googleMap').length) { 520 521 $(document).ready(function() { 522 523 function loadMap() { 524 var mapProp = { 525 center: {lat: 51.503454, lng: -0.124755}, 526 zoom:15, 527 mapTypeId:google.maps.MapTypeId.ROADMAP, 528 styles : [{featureType:'all',stylers:[{saturation:-100},{gamma:0.0}]}] 529 530 }; 531 532 var map = document.getElementById('googleMap'); 533 534 if(map !== null){ 535 536 var map = new google.maps.Map(document.getElementById("googleMap"),mapProp); 537 538 } 539 540 setMarkers(map); 541 542 } 543 var marks = [ 544 ['first', 51.503454,-0.101562], 545 ['second', 51.501454,-0.124755], 546 ['third', 51.499633,-0.148755] 547 ]; 548 549 function setMarkers(map) { 550 551 for (var i = 0; i < marks.length; i++) { 552 var mark = marks[i]; 553 var marker = new google.maps.Marker({ 554 position: {lat: mark[1], lng: mark[2]}, 555 map: map, 556 icon: 'images/map_marker.png',
557 title: mark[0], 558 zIndex: mark[3] 559 }); 560 } 561 } 562 google.maps.event.addDomListener(window, 'load', loadMap); 563 564 }); 565 566 } 567 568 }); 569 570})(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.