1/* 2 * To change this template, choose Tools | Templates 3 * and open the template in the editor. 4 */ 5(function($) { 6 $.expr[":"].onScreen = function(elem) { 7 var $window = $(window); 8 var viewport_top = $window.scrollTop() 9 var viewport_height = $window.height() 10 var viewport_bottom = viewport_top + viewport_height 11 var $elem = $(elem) 12 var top = $elem.offset().top 13 var height = $elem.height() 14 var bottom = top + height 15 16 return (top >= viewport_top && top < viewport_bottom) || 17 (bottom > viewport_top && bottom <= viewport_bottom) || 18 (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom) 19 } 20})(jQuery); 21 22jQuery(document).ready(function($){ 23 $(window).scroll( function (){ 24 $('.animate').filter(":onScreen").not('.load').each(function(i){ 25 var $this=$(this); 26 var ind = i * 100; 27 var docViewTop = $(window).scrollTop(); 28 var docViewBottom = docViewTop + $(window).height(); 29 var elemTop = $this.offset().top; 30 if (docViewBottom >= elemTop) { 31 setTimeout(function(){ 32 $this.trigger('load'); 33 }, ind); 34 } 35 }); 36 //End function 37 }); 38 $('.animate').on('load',function(){ 39 $(this).addClass('load'); 40 }); 41 $('.form_field').click(function(){ 42 $(this).removeAttr('style'); 43 }); 44}); 45 46jQuery(document).ready(function($){ 47 48 $('.v_parallax_block').each(function(){ 49 var $bgobj = $(this); 50 var i = parseInt($bgobj.attr('data-scroll')); 51 var rev = parseInt($bgobj.attr('data-rev')); 52 var ptop = $bgobj.parent().position().top; 53 var adjust = parseInt($bgobj.attr('data-adjust')); 54 var height = $bgobj.height(); 55 56 var v_parallax_block_height = $bgobj.find('.parallax_content').height(); 57 if(height<v_parallax_block_height) 58 height = v_parallax_block_height; 59 60 61 if(rev == 2){ 62 63 }else{ 64 var $parent = $bgobj.parent().parent(); 65 if($parent.hasClass('stripe')){ 66 $parent.css('height',height+'px'); 67 } 68 } 69 70 $(window).scroll(function(e) { 71 e.preventDefault(); 72 var $window = jQuery(window); 73 var yPos = Math.round((($window.scrollTop())/i)); 74 var coords; 75 if(rev != undefined){ 76 if(rev == 2){ 77 yPos = Math.round((($window.scrollTop()-ptop)/i)); 78 $bgobj.parent().css('-webkit-transform', 'translateY('+yPos+'px)'); 79 $bgobj.parent().css('transform', 'translateY('+yPos+'px)'); 80 }else if(rev == 1){ 81 yPos = yPos - adjust; 82 coords = '50% '+yPos+ 'px'; 83 $bgobj.css('background-position', coords); 84 }else{ 85 yPos = adjust - yPos; 86 coords = '50% '+yPos + 'px';//console.log(coords); 87 $bgobj.css('background-position', coords); 88 } 89 } 90 }); 91 }); 92 93 $('section.stripe').each(function(){ 94 var style = $(this).find('.v_column.stripe_container .v_module').attr('data-class'); 95 if(style){style='stripe '+style; 96 $(this).find('.v_column.stripe .v_module').removeAttr('data-class'); 97 $(this).attr('class',style); 98 } 99 var style = $(this).find('.v_column.stripe .v_module').attr('data-class'); 100 if(style){style='stripe '+style; 101 $(this).find('.v_column.stripe .v_module').removeAttr('data-class'); 102 $(this).attr('class',style); 103 } 104 }); 105}); 106 107jQuery(document).ready(function($){ 108 109$('.nav-tabs').each(function(){ 110 if(!$(this).find('li').hasClass('active')){ 111 $(this).find('a:first').tab('show'); 112 $(this).find('li:first').addClass('active'); 113 } 114}); 115 116$('.nav-tabs a').click(function (e) { 117 e.preventDefault(); 118 if((typeof $().tab == 'function')){ 119 $(this).tab('show'); 120 } 121}); 122$('.accordion').each(function(){ 123 if($(this).hasClass('load_first')){ 124 $(this).find('.accordion-group:first-child').addClass('check_load_first'); 125 $(this).find('.accordion-group:first-child .accordion-toggle').trigger('click'); 126 } 127}); 128jQuery(document).ready(function($){ 129 if($('.accordion-group.panel').is(':not(.check_load_first)')){ 130 $('.accordion').on('shown.bs.collapse', function () { 131 var offset = $(this).find('.collapse.in').prev('.accordion-heading'); 132 if(offset) { 133 $('html,body').animate({ 134 scrollTop: $(offset).offset().top -150 135 }, 500); 136 } 137 }); 138 } 139}); 140$('.image_slider').each(function(){ 141 $(this).flexslider({ 142 prevText: "<i class='icon-arrow-1-left'></i>", 143 nextText: "<i class='icon-arrow-1-right'></i>", 144 }); 145}); 146 147if ($.isFunction($.fn.magnificPopup)) { 148$('.ajax-popup-link').magnificPopup({ 149 type: 'ajax', 150 alignTop: true, 151 fixedContentPos: true, 152 fixedBgPos: true, 153 overflowY: 'auto', 154 closeBtnInside: true, 155 preloader: false, 156 midClick: true, 157 removalDelay: 300, 158 mainClass: 'my-mfp-zoom-in' 159}); 160 161jQuery('.pop').magnificPopup({ 162 type: 'image', 163 gallery:{ 164 enabled:true 165 } 166}); 167 168jQuery('.gallery').magnificPopup({ 169 delegate: 'a',
170 type: 'image', 171 tLoading: 'Loading image #%curr%...', 172 mainClass: 'mfp-img-mobile', 173 gallery: { 174 enabled: true, 175 navigateByImgClick: true, 176 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 177 }, 178 image: { 179 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 180 titleSrc: function(item) { 181 return item.el.attr('title'); 182 } 183 } 184}); 185}; 186$('.knob').each(function(){ 187 var $this = $(this).find('.dial'); 188 var myVal = $this.val(); 189 $this.knob({ 190 draw : function () { 191 // "tron" case 192 if(this.$.data('skin') == 'tron') { 193 var a = this.angle(this.cv) // Angle 194 , sa = this.startAngle // Previous start angle 195 , sat = this.startAngle // Start angle 196 , ea // Previous end angle 197 , eat = sat + a // End angle 198 , r = true; 199 200 this.g.lineWidth = this.lineWidth; 201 this.o.cursor 202 && (sat = eat - 0.3) 203 && (eat = eat + 0.3); 204 205 if (this.o.displayPrevious) { 206 ea = this.startAngle + this.angle(this.value); 207 this.o.cursor 208 && (sa = ea - 0.3) 209 && (ea = ea + 0.3); 210 this.g.beginPath(); 211 this.g.strokeStyle = this.previousColor; 212 this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false); 213 this.g.stroke(); 214 } 215 216 this.g.beginPath(); 217 this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ; 218 this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false); 219 this.g.stroke(); 220 221 this.g.lineWidth = 2; 222 this.g.beginPath(); 223 this.g.strokeStyle = this.o.fgColor; 224 this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false); 225 this.g.stroke(); 226 227 return false; 228 } 229 } 230 }); 231 $({ 232 value: 0 233 }).animate({ 234 235 value: myVal 236 }, { 237 duration: 2400, 238 easing: 'swing', 239 step: function () { 240 $this.val(Math.ceil(this.value)).trigger('change'); 241 242 } 243 }) 244 }); 245 246}); 247 248//AJAX CONTACT FORM 249jQuery(document).ready(function ($) { 250 // SUBSCRIPTION FORM AJAX HANDLE 251 $( 'body' ).delegate( '.form .form_submit', 'click', function(event){ 252 event.preventDefault(); 253 var parent = $(this).parent(); 254 var $response= parent.find(".response"); 255 var nonce = $response.attr('data-security'); 256 var error= ''; 257 var to = [] 258 var data = []; 259 var label = []; 260 var regex = []; 261 var to = parent.attr('data-to'); 262 var subject = parent.attr('data-subject'); 263 regex['email'] = /^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i; 264 regex['phone'] = /[A-Z0-9]{7}|[A-Z0-9][A-Z0-9-]{7}/i; 265 regex['numeric'] = /^[0-9]+$/i; 266 regex['captcha'] = /^[0-9]+$/i; 267 regex['required'] = /([^\s])/; 268 var i=0; 269 270 parent.find('.form_field').each(function(){ 271 i++; 272 var validate=$(this).attr('data-validate'); 273 var value = $(this).val(); 274 275 if(!value.match(regex[validate])){ 276 error += ' '+vibe_shortcode_strings.invalid_string+$(this).attr('placeholder'); 277 $(this).css('border-color','#e16038'); 278 }else{ 279 data[i]=value; 280 label[i]=$(this).attr('placeholder'); 281 if(parent.hasClass('isocharset')){ 282 label[i]=encodeURI(label[i]); 283 data[i]=encodeURI(value); 284 } 285 286 } 287 if(validate === 'captcha' && error === ""){ 288 var $num = $(this).attr('id'); 289 var $sum=$(this).closest('.math-sum'); 290 var num1 = parseInt($('#'+$num+'-1').text()); 291 var num2 = parseInt($('#'+$num+'-2').text()); 292 var sumval = parseInt($(this).val()); 293 if( sumval != (num1+num2)) 294 error += vibe_shortcode_strings.captcha_mismatch; 295 } 296 }); 297 298 if (error !== "") { 299 $response.fadeIn("slow"); 300 $response.html("<span style='color:#D03922;'>"+vibe_shortcode_strings.error_string+" " + error + "</span>"); 301 } else { 302 $response.css("display", "block"); 303 $response.html("<span style='color:#0E7A00;'>
303"+vibe_shortcode_strings.sending_mail+"... </span>"); 304 $response.fadeIn("slow"); 305 setTimeout(function(){sendmail(to,subject,data,label,parent,nonce);}, 2000); 306 } 307 308 return false; 309 }); 310 311 function sendmail(to,subject,formdata,labels,parent,nonce) { 312 var $response= parent.find(".response"); 313 var isocharset = false; 314 315 if(parent.hasClass('isocharset')) 316 isocharset=true; 317 318 $.ajax({ 319 type: "POST", 320 url: ajaxurl, 321 data: { action: 'vibe_form_submission', 322 to: to, 323 subject : subject, 324 data:JSON.stringify(formdata), 325 label:JSON.stringify(labels), 326 isocharset:isocharset, 327 security:nonce 328 }, 329 cache: false, 330 success: function (html) { 331 console.log(html); 332 $response.fadeIn("slow"); 333 $response.html(html); 334 if(html.indexOf('<span') === 0) { 335 parent.find('textarea').val(''); 336 parent.find('input[type="text"]').val(''); 337 } 338 setTimeout(function(){$response.fadeOut("slow");}, 10000); 339 } 340 }); 341 } 342 343}); 344 345jQuery(document).load(function($){ 346 $('.mejs-container').each(function(){ 347 $(this).addClass('mejs-mejskin'); 348 }); 349}); 350 351 352jQuery(document).ready(function ($) { 353 if ($.isFunction($.fn.flexslider)) { 354 355 $('.image_slider').each(function(){ 356 $(this).flexslider({ 357 prevText: "<i class='icon-arrow-1-left'></i>", 358 nextText: "<i class='icon-arrow-1-right'></i>", 359 }); 360 }); 361 362 363 364 $('.vibe_carousel.flexslider').each(function(){ 365 366 var $this = $(this); 367 if($(this).find('.slides').length){ 368 var dnav = parseInt($this.attr('data-directionnav')); 369 if (typeof dnav === typeof undefined || dnav === false) { 370 dnav = 1; 371 } 372 $this.flexslider({ 373 animation: "slide", 374 controlNav: parseInt($this.attr('data-controlnav')), 375 directionNav: dnav, 376 animationLoop: parseInt($this.attr('data-autoslide')), 377 slideshow: parseInt($this.attr('data-autoslide')), 378 itemWidth:parseInt($this.attr('data-block-width')), 379 itemMargin:30, 380 minItems:parseInt($this.attr('data-block-min')), 381 maxItems:parseInt($this.attr('data-block-max')), 382 prevText: "<i class='icon-arrow-1-left'></i>", 383 nextText: "<i class='icon-arrow-1-right'></i>", 384 move:parseInt($this.attr('data-block-move')), 385 start: function(slider){ 386 $(slider).removeClass('loading'); 387 }, 388 before:function(slider){ 389 console.log(slider); 390 }, 391 after: function(slider){ 392 console.log(slider); 393 } 394 }); 395 } 396 if($this.hasClass('woocommerce')){ 397 $this.flexslider({ 398 selector: ".products > li", 399 animation: "slide", 400 controlNav: false, 401 directionNav: true, 402 animationLoop: false, 403 slideshow: false, 404 minItems:1, 405 maxItems:1, 406 itemWidth:100, 407 itemMargin:0, 408 prevText: "<i class='icon-arrow-1-left'></i>", 409 nextText: "<i class='icon-arrow-1-right'></i>", 410 }); 411 } 412 if($this.find('.woocommerce').length){ 413 $this.find('.woocommerce').flexslider({ 414 selector: ".products > li", 415 animation: "slide", 416 controlNav: false, 417 directionNav: true, 418 animationLoop: false, 419 slideshow: false, 420 minItems:1, 421 maxItems:1, 422 itemWidth:100, 423 itemMargin:0, 424 prevText: "<i class='icon-arrow-1-left'></i>", 425 nextText: "<i class='icon-arrow-1-right'></i>", 426 }); 427 } 428 }); 429} 430}); 431 432 433/*======= FILTERABLE=======*/ 434 435jQuery(window).load(function ($) { 436 var $ = jQuery; 437 $('.custom_post_filterable').each(function(){ 438 var $container = $(this).find('.filterableitems_container'), 439 $filtersdiv = $(this).find('.vibe_filterable'), 440 $checkboxes = $(this).find('.vibe_filterable a'); 441 442 if(jQuery.fn.imagesLoaded){ 443 $container.imagesLoaded( function(){ 444 $container.isotope({ 445 itemSelector: '.filteritem' 446 }); 447 }); 448 } else{ 449 $container.isotope({ 450 itemSelector: '.filteritem' 451 }); 452 } 453 454 $checkboxes.click(function(event){ 455 event.preventDefault(); 456 var me = $(this); 457 $filtersdiv.find('.active').removeClass(); 458 var filters = me.attr('data-filter'); 459 me.parent().addClass('active'); 460 $container.isotope({filter: filters}); 461 }); 462 463 $('.vibe_filterable a:first').trigger('click'); 464 $('.vibe_filterable a:first').parent().addClass('active'); 465 }); 466}); 467 468jQuery(window).load(function ($) { 469 470 471jQuery('.grid.masonry').each(function($){ 472 473var $container = jQuery(this); 474$container.imagesLoaded( function(){ 475 476 var width= parseInt($container.attr('data-width')); 477 var gutter= parseInt($container.attr('data-gutter')); 478 if(jQuery('body').hasClass('rtl')){ 479 $container.isotope({ 480 itemSelector: '.grid-item', 481 columnWidth: width, 482 gutterWidth: gutter, 483 layoutMode: 'masonry', 484 isRTL:true, 485 }); 486 }else{ 487 $container.isotope({ 488 itemSelector: '.grid-item', 489 columnWidth: width, 490 gutterWidth: gutter, 491 layoutMode: 'masonry', 492 }); 493 } 494 495 496 }); 497 }); 498}); 499 500jQuery(document).ready(function ($) { 501 502 $('.fitvids').each(function(){ 503 $(this).fitVids(); 504 }); 505 506 if($('.vibe_grid').length && $('.vibe_grid').hasClass('inifnite_scroll')){ 507 508 var $this= $('.vibe_grid.inifnite_scroll:not(.loaded)'); 509 var end = $this.parent().find('.end_grid'); 510 var load = $this.parent().find('.load_grid'); 511 var args = $this.find('.wp_query_args').html(); 512 var max = parseInt($this.find('.wp_query_args').attr('data-max-pages')); 513 514 var top = $('.vibe_grid.inifnite_scroll:not(.loaded) li:last').offset().top -500; 515 var rel = parseInt($('.vibe_grid.inifnite_scroll:not(.loaded)').attr('data-page')); 516 517 $(window).data('ajaxready', true).scroll(function(e) { 518 519 if ($(window).data('ajaxready') == false) return; 520 521 if(!$('.vibe_grid.inifnite_scroll').hasClass('loaded')) 522 top = $('.vibe_grid.inifnite_scroll:not(.loaded) li:last').offset().top -500; 523 else 524 rel = max; 525 526 if ($(window).scrollTop() >= top && rel < max ) { 527 528 $(window).data('ajaxready', false); 529 530 531 $.ajax({ 532 type: "POST", 533 url: ajaxurl, 534 data: {action: 'grid_scroll', 535 args: args, 536 page: rel 537 }, 538 cache: false, 539 success: function (html) { 540 541 if(html){ 542 rel++; 543 $this.attr('data-page',rel); 544 if($this.hasClass('masonry')){ 545 $('.vibe_grid.inifnite_scroll .grid.masonry').isotope('insert',$(html)); 546 $('.vibe_grid.inifnite_scroll .grid.masonry').imagesLoaded( function(){ 547 $('.vibe_grid.inifnite_scroll .grid.masonry').isotope('layout'); 548 }); 549 }else{ 550 $('.vibe_grid.inifnite_scroll:not(.loaded)>.grid>li:last').after(html); 551 } 552 } 553 $(window).data('ajaxready', true); 554 555 } 556 }); 557 }else{ 558 if(rel == max){ 559 end.fadeIn(200); 560 load.fadeOut(200); 561 $this.addClass('loaded'); 562 } 563 } 564 }); 565 } 566}); 567 568jQuery(document).ready(function($){ 569 // Uploading files 570 var zip_uploader; 571 jQuery('#upload_zip_button').on('click', function( event ){ 572 event.preventDefault(); 573 var url = $(this).attr('data-admin-url')+'media-upload.php?type=upload&tab=upload&TB_iframe=1'; 574 tb_show('Upload ZIP package', url ); 575 }); 576}); 577 578jQuery(document).ready(function($){ 579 $('.submit_registration_form').on('click',function(event){ 580 event.preventDefault(); 581 window.onbeforeunload = null; 582 var $this = $(this); 583 var parent = $this.closest('.wplms_registration_form'); 584 parent.find('.message').remove(); 585 if($this.hasClass('loading')) 586 return; 587 588 $('.field_error').each(function(){$(this).removeClass('field_error')}); 589 $this.addClass('loading'); 590 591 var settings = []; 592 parent.find('input,textarea,select').each(function(){ 593 if($(this).is(':radio')){ 594 if($(this).is(':checked')){ 595 var data = {id:$(this).attr('name'),value: $(this).val()}; 596 } 597 }else if($(this).is(':checkbox')){ 598 if($(this).is(':checked')){ 599 var data = {id:$(this).attr('name'),value: $(this).val()}; 600 } 601 }else if($(this).is('select')){ 602 var data = {id:$(this).attr('name'),value: $(this).val()}; 603 }else if($(this).is('input')){ 604 var data = {id:$(this).attr('name'),value: $(this).val()}; 605 }else if($(this).is('textarea')){ 606 if($(this).hasClass('wp-editor-area') && $(this).attr('aria-hidden') == 'true'){ 607 var data = {id:$(this).attr('name'),value:tinyMCE.get($(this).attr('id')).getContent({format : 'raw'})}; 608 }else{ 609 var data = {id:$(this).attr('name'),value: $(this).val()}; 610 } 611 } 612 if(data) 613 settings.push(data); 614 }); 615 var response=''; 616 if(typeof grecaptcha != 'undefined' && $('.g-recaptcha').length != 0){ 617 response = grecaptcha.getResponse(); 618 if(response.length == 0){ 619 parent.append('<div class="message">'+vibe_shortcode_strings.captcha_mismatch+'</div>'); 620 $this.removeClass('loading'); 621 return; 622 } 623 } 624 625 $.ajax({ 626 type: "POST", 627 url: ajaxurl, 628 data: { action: 'wplms_register_user', 629 name : $this.parent().parent().closest('.wplms_registration_form').data('form-name'), 630 security: $('#_wpnonce').val(), 631 settings:JSON.stringify(settings) 632 }, 633 cache: false, 634 success: function (html) { 635 $this.removeClass('loading'); 636 parent.append(html); 637 $('.field_error .message.error').click(function(){$(this).fadeOut(100);}); 638 } 639 }); 640 }); 641}); 642
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.