https://montclairlibrary.org/wp-content/plugins/goodlayers-core/include/js/page-builder.js?ver=6.6.9
1/* start page builder */ 2(function($){ 3 "use strict"; 4 5 // Detect Mobile Device 6 var gdlr_core_mobile = false; 7 if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/BlackBerry/i) || 8 navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/Windows Phone/i) ){ 9 gdlr_core_mobile = true; 10 }else{ 11 gdlr_core_mobile = false; 12 } 13 14 // Detect Screen 15 var gdlr_core_display = 'desktop'; 16 if( typeof(window.matchMedia) == 'function' ){ 17 $(window).on('resize themename-set-display gdlr-core-element-resize', function(){ 18 if( window.matchMedia('(max-width: 419px)').matches ){ 19 gdlr_core_display = 'mobile-portrait'; 20 }else if( window.matchMedia('(max-width: 767px)').matches ){ 21 gdlr_core_display = 'mobile-landscape' 22 }else if( window.matchMedia('(max-width: 959px)').matches ){ 23 gdlr_core_display = 'tablet' 24 }else{ 25 gdlr_core_display = 'desktop'; 26 } 27 }); 28 $(window).trigger('themename-set-display'); 29 }else{ 30 $(window).on('resize themename-set-display gdlr-core-element-resize', function(){ 31 if( $(window).innerWidth() <= 419 ){ 32 gdlr_core_display = 'mobile-portrait'; 33 }else if( $(window).innerWidth() <= 767 ){ 34 gdlr_core_display = 'mobile-landscape' 35 }else if( $(window).innerWidth() <= 959 ){ 36 gdlr_core_display = 'tablet' 37 }else{ 38 gdlr_core_display = 'desktop'; 39 } 40 }); 41 $(window).trigger('themename-set-display'); 42 } 43 44 // set cookie 45 function gdlr_core_set_cookie( cname, cvalue, expires ){ 46 if( typeof(expires) != 'undefined' ){ 47 if( expires == 0 ){ 48 expires = 86400; 49 } 50 51 var now = new Date(); 52 var new_time = now.getTime() + (parseInt(expires) * 1000); 53 now.setTime(new_time); 54 55 expires = now.toGMTString(); 56 } 57 58 document.cookie = cname + "=" + encodeURIComponent(cvalue) + "; expires=" + expires + "; path=/"; 59 } 60 61 // script for normal content 62 $.fn.gdlr_core_content_script = function( filter_elem, document_ready ){ 63 64 $(this).gdlr_core_fluid_video( filter_elem ); 65 66 // audio 67 if( !document_ready && typeof($.fn.mediaelementplayer) == 'function' ){ 68 var wpme_settings = { 69 "stretching": "responsive" 70 }; 71 if( typeof(_wpmejsSettings) !== 'undefined' ){ 72 wpme_settings.pluginPath = _wpmejsSettings.pluginPath; 73 } 74 75 $(this).find('audio, video').mediaelementplayer(wpme_settings); 76 } 77 78 return $(this); 79 } 80 81 // responsive video 82 $.fn.gdlr_core_fluid_video = function( filter_elem ){ 83 84 if( typeof(filter_elem) == 'undefined' ){ 85 var elem = $(this).find('iframe[src*="youtube"], iframe[src*="vimeo"]'); 86 }else{ 87 var elem = filter_elem.filter('iframe[src*="youtube"], iframe[src*="vimeo"]'); 88 } 89 90 elem.each(function(){ 91 92 // ignore if inside slider 93 if( $(this).closest('.ls-container, .master-slider').length <= 0 ){ 94 if( ($(this).is('embed') && $(this).parent('object').length) || $(this).parent('.gdlr-core-fluid-video-wrapper').length ){ return; } 95 if( !$(this).attr('id') ){ $(this).attr('id', 'gdlr-video-' + Math.floor(Math.random()*999999)); } 96 97 var ratio = $(this).height() / $(this).width(); 98 $(this).removeAttr('height').removeAttr('width'); 99 100 try{ 101 $(this).wrap('<div class="gdlr-core-fluid-video-wrapper"></div>').parent().css('padding-top', (ratio * 100)+"%"); 102 $(this).attr('src', $(this).attr('src')); 103 }catch(e){} 104 } 105 }); 106 107 return $(this); 108 } 109 110 // ajax mejs 111 $.fn.gdlr_core_mejs_ajax = function(){ 112 if( typeof($.fn.mediaelementplayer) == 'function' ){ 113 114 var wpme_settings = {}; 115 if( typeof(_wpmejsSettings) !== 'undefined' ){ wpme_settings.pluginPath = _wpmejsSettings.pluginPath; } 116 $(this).find('audio, video').mediaelementplayer(wpme_settings); 117 118 } 119 } 120 121 // counter item 122 $.fn.gdlr_core_counter_item = function( filter_elem ){ 123 124 if( typeof(filter_elem) == 'undefined' ){ 125 var elem = $(this).find('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]'); 126 }else{ 127 var elem = filter_elem.filter('.gdlr-core-counter-item-count[data-counter-start][data-counter-end]'); 128 } 129 130 elem.each(function(){ 131 var counter_item = $(this); 132 var start_num = parseInt($(this).attr('data-counter-start')); 133 var end_num = parseInt($(this).attr('data-counter-end')); 134 var duration_time = ($(this).attr('data-duration'))? parseInt($(this).attr('data-duration')): 4000; 135 136 if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > counter_item.offset().top ){ 137 $({ counter_num: start_num }).animate({ counter_num: end_num }, { duration: duration_time, easing: 'easeOutExpo', 138 step: function(){ 139 counter_item.html( Math.ceil(this.counter_num) ); 140 } 141 }); 142 }else{ 143 $(window).scroll(function( e ){ 144 if( $(this).scrollTop() + $(window).height() > counter_item.offset().top ){ 145 $({ counter_num: start_num }).animate({ counter_num: end_num }, { duration: duration_time, easing: 'easeOutExpo', 146 step: function(){ 147 counter_item.html( Math.ceil(this.counter_num) ); 148 } 149 });
150 151 $(this).unbind('scroll', e.handleObj.handler, e); 152 } 153 }); 154 } 155 }); 156 } 157 158 // typed animation item 159 $.fn.gdlr_core_typed_animation = function( filter_elem ){ 160 161 if( typeof(filter_elem) == 'undefined' ){ 162 var elem = $(this).find('.gdlr-core-type-animation-item-animated[data-animation-text]'); 163 }else{ 164 var elem = filter_elem.filter('.gdlr-core-type-animation-item-animated[data-animation-text]'); 165 } 166 167 elem.each(function(){ 168 169 var animation_text = JSON.parse($(this).attr('data-animation-text')); 170 171 if( typeof($.fn.typed) == 'function' && animation_text && animation_text.length > 0 ){ 172 $(this).typed({ 173 strings: animation_text, 174 typeSpeed: 50, 175 loop: true 176 }); 177 } 178 }); 179 } 180 181 // countdown item 182 $.fn.gdlr_core_countdown_item = function( filter_elem ){ 183 184 if( typeof(filter_elem) == 'undefined' ){ 185 var elem = $(this).find('.gdlr-core-countdown-wrap'); 186 }else{ 187 var elem = filter_elem.filter('.gdlr-core-countdown-wrap'); 188 } 189 190 elem.each(function(){ 191 var day_field = $(this).find('.gdlr-core-day'); 192 var day = parseInt(day_field.text()); 193 194 var hrs_field = $(this).find('.gdlr-core-hrs'); 195 var hrs = parseInt(hrs_field.text()); 196 197 var min_field = $(this).find('.gdlr-core-min'); 198 var min = parseInt(min_field.text()); 199 200 var sec_field = $(this).find('.gdlr-core-sec'); 201 var sec = parseInt(sec_field.text()); 202 203 $(window).load(function(){ 204 sec_field.text('00'); 205 sec_field.css('width', sec_field.width()); 206 sec_field.text(sec); 207 }); 208 209 var i = setInterval(function(){ 210 if( sec > 0 ){ 211 sec--; 212 }else{ 213 sec = 59; 214 if( min > 0 ){ 215 min--; 216 }else{ 217 min = 59; 218 if( hrs > 0 ){ 219 hrs--; 220 }else{ 221 hrs = 24; 222 if( day > 0 ){ 223 day--; 224 }else{ 225 day = 0; 226 hrs = 0; 227 min = 0; 228 sec = 0; 229 clearInterval(i); 230 } 231 day_field.text(day); 232 } 233 hrs_field.text(hrs); 234 } 235 min_field.text(min); 236 } 237 sec_field.text(sec); 238 }, 1000); 239 }); 240 } 241 242 // accordion 243 $.fn.gdlr_core_accordion = function( filter_elem ){ 244 245 if( typeof(filter_elem) == 'undefined' ){ 246 var elem_title = $(this).find('.gdlr-core-accordion-item-title'); 247 var elem_icon = $(this).find('.gdlr-core-accordion-item-icon'); 248 }else{ 249 var elem_title = filter_elem.filter('.gdlr-core-accordion-item-title'); 250 var elem_icon = filter_elem.filter('.gdlr-core-accordion-item-icon'); 251 } 252 253 elem_title.click(function(){ 254 $(this).siblings('.gdlr-core-accordion-item-content').slideDown(200); 255 256 var item_tab = $(this).closest('.gdlr-core-accordion-item-tab'); 257 if( item_tab.hasClass('gdlr-core-active') ){ 258 if( item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all') ){ 259 item_tab.removeClass('gdlr-core-active') 260 .find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200); 261 } 262 }else{ 263 item_tab.addClass('gdlr-core-active') 264 .siblings('.gdlr-core-active').removeClass('gdlr-core-active') 265 .find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200); 266 } 267 }); 268 elem_icon.click(function(){ 269 $(this).siblings('.gdlr-core-accordion-item-content-wrapper').children('.gdlr-core-accordion-item-content').slideDown(200); 270 271 var item_tab = $(this).closest('.gdlr-core-accordion-item-tab'); 272 if( item_tab.hasClass('gdlr-core-active') ){ 273 if( item_tab.closest('.gdlr-core-accordion-item').hasClass('gdlr-core-allow-close-all') ){ 274 item_tab.removeClass('gdlr-core-active') 275 .find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200); 276 } 277 }else{ 278 item_tab.addClass('gdlr-core-active') 279 .siblings('.gdlr-core-active').removeClass('gdlr-core-active') 280 .find('.gdlr-core-accordion-item-content').css({display: 'block'}).slideUp(200); 281 } 282 }); 283 } 284 285 // toggle_box 286 $.fn.gdlr_core_toggle_box = function( filter_elem ){ 287 288 if( typeof(filter_elem) == 'undefined' ){ 289 var elem_title = $(this).find('.gdlr-core-toggle-box-item-title'); 290 var elem_icon = $(this).find('.gdlr-core-toggle-box-item-icon'); 291 }else{ 292 var elem_title = filter_elem.filter('.gdlr-core-toggle-box-item-title'); 293 var elem_icon = filter_elem.filter('.gdlr-core-toggle-box-item-icon'); 294 } 295 296 elem_title.click(function(){ 297 var toggle_parent = $(this).closest('.gdlr-core-toggle-box-item-tab'); 298 if( toggle_parent.hasClass('gdlr-core-active') ){ 299 300 toggle_parent.removeClass('gdlr-core-active'); 301 $(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200); 302 303 }else{ 304 305 toggle_parent.addClass('gdlr-core-active'); 306 $(this).siblings('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200); 307 } 308 }); 309 elem_icon.click(function(){ 310 var toggle_parent = $(this).closest('.gdlr-core-toggle-box-item-tab'); 311 if( toggle_parent.hasClass('gdlr-core-active') ){ 312 toggle_parent.removeClass('gdlr-core-active'); 313 $(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'block'}).slideUp(200); 314 315 }else{ 316 toggle_parent.addClass('gdlr-core-active'); 317 $(this).siblings('.gdlr-core-toggle-box-item-content-wrapper').children('.gdlr-core-toggle-box-item-content').css({display: 'none'}).slideDown(200); 318 } 319 }); 320 } 321 322 // alert box 323 $.fn.gdlr_core_alert_box_item = function( filter_elem ){ 324 325 if( typeof(filter_elem) == 'undefined' ){ 326 var elem = $(this).find('.gdlr-core-alert-box-remove'); 327 }else{ 328 var elem = filter_elem.filter('.gdlr-core-alert-box-remove'); 329 } 330 331 elem.click(function(){ 332 $(this).closest('.gdlr-core-alert-box-item').slideUp(400, 'easeOutQuart', function(){ 333 $(this).remove(); 334 }); 335 }); 336 } 337 338 // particle background 339 $.fn.gdlr_core_particle_background = function( filter_elem ){ 340 341 if( typeof(filter_elem) == 'undefined' ){ 342 var elem = $(this).find('.gdlr-core-particle-bg'); 343 }else{ 344 var elem = filter_elem.filter('.gdlr-core-particle-bg'); 345 } 346 347 elem.each(function(){ 348 if( typeof(window.gdlr_particle_bg_id) == 'undefined' ){ 349 window.gdlr_particle_bg_id = 1; 350 }else{ 351 window.gdlr_particle_bg_id++; 352 } 353 354 var item_id = 'gdlr-core-particle' + window.gdlr_particle_bg_id; 355 $(this).attr('id', item_id); 356 357 particlesJS(item_id, { 358 "particles": { 359 "number": { 360 "value": 40, 361 "density": {"enable": true,"value_area": 1500} 362 }, 363 "color": {"value": "#ffffff"}, 364 "shape": { 365 "type": "circle", 366 "stroke": {"width": 0,"color": "#000000"}, 367 "polygon": {"nb_sides": 5}, 368 "image": {"src": "img/github.svg","width": 100,"height": 100} 369 }, 370 "opacity": { 371 "value": 0.8, 372 "random": false, 373 "anim": {"enable": false,"speed": 0.6,"opacity_min": 0.1,"sync": false} 374 }, 375 "size": { 376 "value": 2, 377 "random": true, 378 "anim": {"enable": false,"speed": 80,"size_min": 0.1,"sync": false} 379 }, 380 "line_linked": {"enable": true,"distance": 300,"color": "#ffffff","opacity": 0.4,"width": 2}, 381 "move": { 382 "enable": true, 383 "speed": 12, 384 "direction": "none", 385 "random": false, 386 "straight": false, 387 "out_mode": "out", 388 "bounce": false, 389 "attract": {"enable": false,"rotateX": 600,"rotateY": 1200} 390 } 391 }, 392 "interactivity": { 393 "detect_on": "canvas", 394 "events": { 395 "onhover": {"enable": false,"mode": "repulse"}, 396 "onclick": {"enable": false,"mode": "push"}, 397 "resize": true 398 }, 399 "modes": { 400 "grab": {"distance": 800,"line_linked": {"opacity": 1}}, 401 "bubble": {"distance": 800,"size": 80,"duration": 2,"opacity": 0.8,"
401speed": 3}, 402 "repulse": {"distance": 400,"duration": 0.4}, 403 "push": {"particles_nb": 4}, 404 "remove": {"particles_nb": 2} 405 } 406 }, 407 "retina_detect": true 408 }); 409 }); 410 411 return $(this); 412 } 413 414 // parallax background 415 $.fn.gdlr_core_parallax_background = function( filter_elem ){ 416 417 if( typeof(filter_elem) == 'undefined' ){ 418 var elem = $(this).find('.gdlr-core-parallax'); 419 }else{ 420 var elem = filter_elem.filter('.gdlr-core-parallax'); 421 } 422 423 elem.each(function(){ 424 new gdlr_core_parallax($(this)); 425 }); 426 427 return $(this); 428 } 429 430 var gdlr_core_parallax = function(t){ 431 432 this.wrapper_bg = t; 433 this.wrapper = t.parent(); // background-wrap 434 435 this.parallax_speed = parseFloat(t.attr('data-parallax-speed')); 436 437 this.init(); 438 } 439 gdlr_core_parallax.prototype = { 440 441 init: function(){ 442 443 var t = this; 444 445 // scroll event 446 if( t.parallax_speed != 0 ){ 447 t.set_extra_height(); 448 t.set_background_position(t); 449 $(window).on('load resize gdlr-core-element-resize', function(){ 450 t.set_extra_height($(this)); 451 t.set_background_position(t); 452 }); 453 454 $(window).on('scroll', function(){ 455 t.set_background_position(t); 456 }); 457 } 458 459 if( gdlr_core_mobile ){ 460 t.wrapper_bg.children('[data-background-type="video"]').remove(); 461 462 if( t.wrapper_bg.attr('data-video-fallback') ){ 463 t.wrapper_bg.css('background-image', 'url(' + t.wrapper_bg.attr('data-video-fallback') + ')') 464 } 465 }else{ 466 t.wrapper_bg.children('[data-background-type="video"]').each(function(){ 467 if( t.parallax_speed == 0 ){ 468 t.set_extra_height(); 469 t.set_background_position(t); 470 $(window).on('load resize gdlr-core-element-resize', function(){ 471 t.set_extra_height($(this)); 472 t.set_background_position(t); 473 }); 474 } 475 476 // script for muting the vimeo/youtube player 477 $(this).find('iframe').each(function(){ 478 if( $(this).attr('data-player-type') == 'vimeo' ){ 479 var player = $f($(this)[0]); 480 481 player.addEvent('ready', function() { 482 player.api('setVolume', 0); 483 }); 484 }else if( $(this).attr('data-player-type') == 'youtube' ){ 485 486 // assign the script 487 if( $('body').children('#gdlr-core-youtube-api').length == 0 ){ 488 $('body').append('<script src="https://www.youtube.com/iframe_api" id="gdlr-core-youtube-api" ></script>'); 489 } 490 491 // store to global variable 492 if( typeof(window.gdlr_core_ytb) == 'undefined' ){ 493 window.gdlr_core_ytb = [$(this)[0]]; 494 }else{ 495 window.gdlr_core_ytb.push($(this)[0]); 496 } 497 498 // script loading action 499 window.onYouTubeIframeAPIReady = function(){ 500 for( var key in window.gdlr_core_ytb ){ 501 new YT.Player(gdlr_core_ytb[key],{ 502 events: { 503 'onReady': function(e){ 504 e.target.mute(); 505 } 506 } 507 }); 508 } 509 } 510 } 511 }); 512 }); 513 } // else gdlr_core_mobile 514 515 }, // init 516 517 set_extra_height: function(){ 518 519 var t = this; 520 521 var new_height = t.wrapper.outerHeight(); 522 if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ){ 523 t.wrapper_bg.css({'transform': ''}); 524 }else{ 525 if( t.parallax_speed > 0){ 526 new_height += (($(window).height() - t.wrapper.outerHeight()) * t.parallax_speed); 527 }else if( t.parallax_speed < 0){ 528 new_height += (($(window).height() + t.wrapper.outerHeight()) * Math.abs(t.parallax_speed)); 529 } 530 } 531 t.wrapper_bg.css({height: new_height}); 532 533 // set video height 534 var ratio = parseInt(gdlr_core_pbf.video.width) / parseInt(gdlr_core_pbf.video.height); 535 t.wrapper_bg.children('[data-background-type="video"]').each(function(){ 536 if( (t.wrapper_bg.width() / t.wrapper_bg.height()) > ratio ){ 537 var v_height = t.wrapper_bg.width() / ratio; 538 var v_margin = (t.wrapper_bg.height() - v_height) / 2; 539 $(this).css({width: t.wrapper_bg.width(), height: v_height, 'margin-left': 0, 'margin-top': v_margin}); 540 }else{ 541 var v_width = t.wrapper_bg.height() * ratio; 542 var v_margin = (t.wrapper_bg.width() - v_width) / 2; 543 $(this).css({width: v_width, height: t.wrapper_bg.height(), 'margin-left': v_margin, 'margin-top': 0}); 544 } 545 }); 546 547 }, // set_extra_height 548 549 set_background_position: function( t ){ 550 551 if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ) return; 552 553 var wrapper_top = t.wrapper.offset().top; 554 var scroll_pos = $(window).scrollTop(); 555 556 if( scroll_pos + $(window).height() > wrapper_top && 557 scroll_pos < wrapper_top + t.wrapper.outerHeight() ){ 558 559 if( t.parallax_speed > 0 ){ 560 t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() - wrapper_top) * t.parallax_speed) + 'px)'}); 561 }else if( t.parallax_speed < 0 ){ 562 t.wrapper_bg.css({'transform': 'translate(0px, ' + (($(window).scrollTop() + $(window).height() - wrapper_top) * t.parallax_speed) + 'px)'}); 563 } 564 } 565 } 566 }; // gdlr_core_parallax 567 568 // ux animation 569 var gdlr_core_ux = function( container, filter_elem ){ 570 571 if( typeof(filter_elem) == 'undefined' ){ 572 this.elem = container.find('[data-gdlr-animation]'); 573 }else{ 574 this.elem = filter_elem.filter('[data-gdlr-animation]'); 575 this.preload = filter_elem.filter('.gdlr-core-page-preload'); 576 } 577 578 this.ux_items = []; 579 this.ux_item_length = 0; 580 581 this.init(); 582 583 } // gdlr_core_ux 584 gdlr_core_ux.prototype = { 585 586 init: function(){ 587 588 var t = this; 589 590 t.ux_item_length = t.elem.each(function(){ 591 var ux_item = $(this); 592 var ux_item_offset = 0.8; 593 if( $(this).attr('data-gdlr-animation-offset') ){ 594 ux_item_offset = parseFloat($(this).attr('data-gdlr-animation-offset')); 595 } 596 597 // check item at the first time the page is loaded 598 if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > ux_item.offset().top ){ 599 t.ux_items.push(ux_item); 600 601 // check the item on scroll event 602 }else{ 603 $(window).scroll(function(e){
604 if( $(window).scrollTop() + ($(window).height() * ux_item_offset) > ux_item.offset().top ){ 605 t.ux_items.push(ux_item); 606 $(window).unbind('scroll', e.handleObj.handler, e); 607 } 608 }); 609 } 610 }).length; 611 612 if( typeof(t.preload) != 'undefined' && t.preload.length ){ 613 $(window).load(function(){ 614 var preload_time = t.preload.attr('data-animation-time'); 615 if( !preload_time ){ preload_time = 0; } 616 617 setTimeout(function(){ 618 t.animate(); 619 }, preload_time); 620 }); 621 }else{ 622 t.animate(); 623 } 624 625 }, 626 627 animate: function(){ 628 629 var t = this; 630 631 // run the ux in order with delay 632 var ux_interval = setInterval(function(){ 633 634 while( t.ux_items.length > 0 ){ 635 636 // animate the ux item 637 var ux_animate = t.ux_items.shift(); 638 var animation_duration = '600ms'; 639 if( ux_animate.attr('data-gdlr-animation-duration') ){ 640 animation_duration = ux_animate.attr('data-gdlr-animation-duration'); 641 } 642 643 ux_animate.css({ 'animation-duration': animation_duration }); 644 ux_animate.addClass(ux_animate.attr('data-gdlr-animation')); 645 646 // remove selector 647 setTimeout(function(){ 648 ux_animate.css({ 'animation-duration': '' }) 649 .removeClass(ux_animate.attr('data-gdlr-animation')) 650 .removeAttr('data-gdlr-animation'); 651 }, parseInt(animation_duration)); 652 653 t.ux_item_length--; 654 655 // if item is inside the screen break while loop 656 if( $(window).scrollTop() < ux_animate.offset().top + ux_animate.outerHeight() ){ 657 break; 658 } 659 } 660 661 if( t.ux_item_length <= 0 ){ 662 clearInterval(ux_interval); 663 } 664 }, 200); 665 666 } 667 668 }; // gdlr_core_ux.prototype 669 $.fn.gdlr_core_ux = function( filter_elem ){ 670 new gdlr_core_ux( $(this), filter_elem ); 671 672 return $(this); 673 } 674 675 // skill bar 676 $.fn.gdlr_core_skill_bar = function( filter_elem ){ 677 678 if( typeof(filter_elem) == 'undefined' ){ 679 var elem = $(this).find('.gdlr-core-skill-bar-filled'); 680 }else{ 681 var elem = filter_elem.filter('.gdlr-core-skill-bar-filled'); 682 } 683 684 elem.each(function(){ 685 var t = $(this); 686 687 if( (gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') || $(window).scrollTop() + $(window).height() > t.offset().top ){ 688 t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}); 689 }else{ 690 $(window).scroll(function(e){ 691 if( $(window).scrollTop() + $(window).height() > t.offset().top ){ 692 t.animate({width: parseInt(t.attr('data-width')) + '%'}, {duration: 1200, easing: 'easeOutQuart'}); 693 $(window).unbind('scroll', e.handleObj.handler, e); 694 } 695 }); 696 } 697 }); 698 } 699 700 // divider width 701 $.fn.gdlr_core_divider = function( filter_elem ){ 702 703 if( typeof(filter_elem) == 'undefined' ){ 704 var elem = $(this).find('.gdlr-core-divider-item-with-icon-inner'); 705 }else{ 706 var elem = filter_elem.filter('.gdlr-core-divider-item-with-icon-inner'); 707 } 708 709 elem.each(function(){ 710 var divider_elem = $(this); 711 var icon_width = divider_elem.children('i, img').outerWidth(); 712 var divider_width = (divider_elem.width() - icon_width) / 2; 713 $(this).children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){ 714 $(this).css('margin-top', -$(this).outerHeight()/2); 715 }); 716 717 $(window).on('resize gdlr-core-element-resize', function(){ 718 icon_width = divider_elem.children('i, img').outerWidth(); 719 divider_width = (divider_elem.width() - icon_width) / 2; 720 divider_elem.children('.gdlr-core-divider-line').css({ width: divider_width }).each(function(){ 721 $(this).css('margin-top', -$(this).outerHeight()/2); 722 }); 723 }); 724 }); 725 726 } 727 728 window.gdlr_core_sidebar_wrapper = function( container, filter_elem ){ 729 730 if( typeof(filter_elem) == 'undefined' ){ 731 this.elem = container.find('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container'); 732 }else{
733 this.elem = filter_elem.filter('.gdlr-core-page-builder-wrapper-sidebar-container, .gdlr-core-pbf-sidebar-container'); 734 } 735 736 this.init(); 737 738 } 739 gdlr_core_sidebar_wrapper.prototype = { 740 741 init: function(){ 742 743 var t = this; 744 745 t.set_height(); 746 $(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); }); 747 }, 748 749 set_height: function(){ 750 751 var t = this; 752 753 t.elem.each(function(){ 754 if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ) return; 755 756 var sidebar_elem = $(this).find('.gdlr-core-pbf-sidebar-padding'); 757 var max_height = 0; 758 759 // determine max height 760 sidebar_elem.css('min-height', '').each(function(){ 761 if( $(this).outerHeight() > max_height ){ 762 max_height = $(this).outerHeight(); 763 } 764 }); 765 766 // set the height 767 sidebar_elem.css('min-height', max_height); 768 769 }); 770 771 } 772 773 }; 774 775 // title divider width 776 $.fn.gdlr_core_title_divider = function( filter_elem ){ 777 778 if( typeof(filter_elem) == 'undefined' ){ 779 var elem = $(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider'); 780 }else{ 781 var elem = filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-divider'); 782 } 783 784 elem.each(function(){ 785 var t = $(this); 786 var title_width = t.children('.gdlr-core-title-item-title').outerWidth(true); 787 var divider_num = t.children('.gdlr-core-title-item-divider').length; 788 divider_num = (divider_num)? divider_num: 1; 789 790 var divider_width = (t.width() - title_width) / divider_num; 791 792 // for right divider with link text 793 if( divider_num == 1 ){ 794 var right_pos = t.children('.gdlr-core-title-item-link').outerWidth() + 20; 795 t.children('.gdlr-core-title-item-divider').css({ width: (divider_width - right_pos), right: right_pos }); 796 }else{ 797 t.children('.gdlr-core-title-item-divider').css({ width: divider_width }); 798 } 799 800 $(window).on('resize gdlr-core-element-resize', function(){ 801 title_width = t.children('.gdlr-core-title-item-title').outerWidth(true); 802 divider_width = (t.width() - title_width) / divider_num; 803 804 // for right divider with link text 805 if( divider_num == 1 ){ 806 right_pos = t.children('.gdlr-core-title-item-link').outerWidth() + 20; 807 t.children('.gdlr-core-title-item-divider').css({ width: (divider_width - right_pos), right: right_pos }); 808 }else{ 809 t.children('.gdlr-core-title-item-divider').css({ width: divider_width }); 810 } 811 }); 812 }); 813 814 if( typeof(filter_elem) == 'undefined' ){ 815 var elem2 = $(this).find('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text'); 816 }else{ 817 var elem2 = filter_elem.filter('.gdlr-core-title-item-title-wrap.gdlr-core-with-link-text'); 818 } 819 elem2.each(function(){ 820 var t = $(this); 821 var title_width = t.children('.gdlr-core-title-item-title').outerWidth(true); 822 var right_pos = t.children('.gdlr-core-title-item-link').outerWidth(); 823 824 if( t.width() < title_width + right_pos ){ 825 t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow'); 826 }else{ 827 t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow'); 828 } 829 830 $(window).on('resize gdlr-core-element-resize', function(){ 831 if( t.width() < title_width + right_pos ){ 832 t.children('.gdlr-core-title-item-link').addClass('gdlr-core-overflow'); 833 }else{ 834 t.children('.gdlr-core-title-item-link').removeClass('gdlr-core-overflow'); 835 } 836 }); 837 838 }); 839 840 } 841 842 $.fn.gdlr_core_flipbox = function( filter_elem ){ 843 if(typeof($.fn.flip) == 'function'){ 844 845 if( typeof(filter_elem) == 'undefined' ){ 846 var elem = $(this).find('.gdlr-core-flipbox'); 847 }else{ 848 var elem = filter_elem.filter('.gdlr-core-flipbox'); 849 } 850 851 elem.each(function(){ 852 var flipbox_obj = $(this).flip({ 853 axis: 'y', 854 trigger: 'hover', 855 autoSize: false, 856 front: '.gdlr-core-flipbox-front', 857 back: '.gdlr-core-flipbox-back' 858 }); 859 860 $(this).find('.gdlr-core-flipbox-back a').click(function(){ 861 if( flipbox_obj.data('flip-model') ){ 862 flipbox_obj.data('flip-model').unflip(); 863 } 864 }); 865 866 $(this).addClass('gdlr-core-after-init'); 867 }); 868 } 869 870 return $(this); 871 } 872 873 // marquee 874 $.fn.gdlr_core_marquee = function( filter_elem ){ 875 if( typeof(filter_elem) == 'undefined' ){ 876 var elem = $(this).find('.gdlr-core-marquee'); 877 }else{ 878 var elem = filter_elem.filter('.gdlr-core-marquee'); 879 } 880 881 elem.each(function(){ 882 var speed = $(this).attr('data-speed')? parseFloat($(this).attr('data-speed')): 10000; 883 var direction = $(this).attr('data-direction')? parseFloat($(this).attr('data-direction')): 'left'; 884 885 $(this).marquee({ 886 //time in milliseconds before the marquee will start animating 887 delayBeforeStart: 0, 888 //speed in milliseconds of the marquee 889 duration: speed, 890 //gap in pixels between the tickers 891 gap: 50, 892 //'left' or 'right' 893 direction: direction, 894 //true or false - should the marquee be duplicated to show an effect of continues flow 895 duplicated: true, 896 // the marquee is visible initially positioned next to the border towards it will be moving 897 startVisible: true 898 }); 899 }); 900 901 return $(this); 902 } 903 904 // pie chart
905 function gdlr_core_skill_circle_height(t){ 906 t.children('.gdlr-core-skill-circle-content').each(function(){ 907 $(this).css({'margin-top': -$(this).outerHeight()/2}); 908 }); 909 t.css({'max-width': t.parent().width(), 'max-height': t.parent().width()}); 910 } 911 $.fn.gdlr_core_pie_chart = function(){ 912 if(typeof($.fn.easyPieChart) == 'function'){ 913 $(this).easyPieChart({ 914 animate: parseInt($(this).attr('data-duration')), 915 lineWidth: parseInt($(this).attr('data-line-width')), 916 size: parseInt($(this).attr('data-width')), 917 barColor: $(this).attr('data-filled-color'), 918 trackColor: $(this).attr('data-filled-background'), 919 scaleColor: false, 920 lineCap: 'square' 921 }); 922 } 923 } 924 $.fn.gdlr_core_skill_circle = function( filter_elem ){ 925 926 if( typeof(filter_elem) == 'undefined' ){ 927 var elem = $(this).find('.gdlr-core-skill-circle'); 928 }else{ 929 var elem = filter_elem.filter('.gdlr-core-skill-circle'); 930 } 931 932 elem.each(function(){ 933 var t = $(this); 934 935 // for responsive 936 gdlr_core_skill_circle_height(t); 937 $(window).on('resize gdlr-core-element-resize', function(){ gdlr_core_skill_circle_height(t); }); 938 939 // scroll action 940 if( $(window).scrollTop() + $(window).height() > t.offset().top ){ 941 t.gdlr_core_pie_chart(); 942 }else{ 943 $(window).scroll(function(e){ 944 if( $(window).scrollTop() + $(window).height() > t.offset().top ){ 945 t.gdlr_core_pie_chart(); 946 $(window).unbind('scroll', e.handleObj.handler, e); 947 } 948 }); 949 } 950 }); 951 } 952 953 // chart.js 954 $.fn.gdlr_core_chart_js = function( filter_elem ){ 955 956 if( typeof(filter_elem) == 'undefined' ){ 957 var elem = $(this).find('.gdlr-core-chart-js'); 958 }else{ 959 var elem = filter_elem.filter('.gdlr-core-chart-js'); 960 } 961 962 if( typeof(window.gdlr_core_chart_js_id) == 'undefined' ){ 963 window.gdlr_core_chart_js_id = 0; 964 } 965 966 elem.each(function(){ 967 968 var data = []; 969 var options = []; 970 if( $(this).attr('data-content') ){ 971 data = JSON.parse($(this).attr('data-content')); 972 } 973 if( $(this).attr('data-options') ){ 974 options = JSON.parse($(this).attr('data-options')); 975 } 976 977 new Chart($(this), { 978 type: $(this).attr('data-type')? $(this).attr('data-type'): 'pie', 979 data: data, 980 options: options 981 }); 982 983 }); 984 985 } // gdlr_core_chart_js 986 987 // tab 988 $.fn.gdlr_core_tab = function( filter_elem ){ 989 990 if( typeof(filter_elem) == 'undefined' ){ 991 var elem = $(this).find('.gdlr-core-tab-item, .gdlr-core-roadmap-item'); 992 }else{ 993 var elem = filter_elem.filter('.gdlr-core-tab-item, .gdlr-core-roadmap-item'); 994 } 995 996 elem.each(function(){ 997 998 // click action 999 $(this).find('.gdlr-core-tab-item-title, .gdlr-core-roadmap-item-head').click(function(){ 1000 if( $(this).hasClass('gdlr-core-active') ) return; 1001 1002 var tab_id = $(this).attr('data-tab-id'); 1003 1004 $(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1005 $(this).parent().siblings('.gdlr-core-tab-item-content-wrap, .gdlr-core-roadmap-item-content-wrap') 1006 .children('[data-tab-id="' + tab_id + '"]').fadeIn(200) 1007 .siblings().hide(); 1008 }); 1009 1010 // hover action 1011 if( !(gdlr_core_mobile || gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait') && 1012 $(this).is('.gdlr-core-tab-style2-horizontal, .gdlr-core-tab-style2-vertical') ){ 1013 1014 var horizontal = $(this).is('.gdlr-core-tab-style2-horizontal'); 1015 var hover_line = $(this).find('.gdlr-core-tab-item-title-line'); 1016 var hover_line_w = 0; 1017 var hover_line_l = 0; 1018 1019 // initiate 1020 $(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){ 1021 if( horizontal ){ 1022 hover_line_w = $(this).outerWidth(); 1023 hover_line_l = $(this).position().left; 1024 hover_line.css({ width: hover_line_w, left: hover_line_l }); 1025 }else{ 1026 hover_line_w = $(this).outerHeight(); 1027 hover_line_l = $(this).position().top; 1028 hover_line.css({ height: hover_line_w, top: hover_line_l });
1029 } 1030 }); 1031 $(window).on('resize gdlr-core-element-resize', function(){ 1032 $(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-active').each(function(){ 1033 if( horizontal ){ 1034 hover_line_w = $(this).outerWidth(); 1035 hover_line_l = $(this).position().left; 1036 hover_line.css({ width: hover_line_w, left: hover_line_l }); 1037 }else{ 1038 hover_line_w = $(this).outerHeight(); 1039 hover_line_l = $(this).position().top; 1040 hover_line.css({ height: hover_line_w, top: hover_line_l }); 1041 } 1042 }); 1043 }); 1044 1045 // animate 1046 $(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').hover(function(){ 1047 if( horizontal ){ 1048 hover_line.animate({ width: $(this).outerWidth(), left: $(this).position().left }, { duration: 300, easing: 'easeOutQuart', queue: false }); 1049 }else{ 1050 hover_line.animate({ height: $(this).outerHeight(), top: $(this).position().top }, { duration: 300, easing: 'easeOutQuart', queue: false }); 1051 } 1052 }, function(){ 1053 if( horizontal ){ 1054 hover_line.animate({ width: hover_line_w, left: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false }); 1055 }else{ 1056 hover_line.animate({ height: hover_line_w, top: hover_line_l }, { duration: 300, easing: 'easeOutQuart', queue: false }); 1057 } 1058 }); 1059 1060 // click 1061 $(this).children('.gdlr-core-tab-item-title-wrap').children('.gdlr-core-tab-item-title').click(function(){ 1062 if( horizontal ){ 1063 hover_line_w = $(this).outerWidth(); 1064 hover_line_l = $(this).position().left; 1065 hover_line.css({ width: hover_line_w, left: hover_line_l }); 1066 }else{ 1067 hover_line_w = $(this).outerHeight(); 1068 hover_line_l = $(this).position().top; 1069 hover_line.css({ height: hover_line_w, top: hover_line_l }); 1070 } 1071 }); 1072 } 1073 }); 1074 } // gdlr_core_tab 1075 1076 $.fn.gdlr_core_sly = function( filter_elem ){ 1077 1078 if( typeof(filter_elem) == 'undefined' ){ 1079 var elem = $(this).find('.gdlr-core-sly-slider'); 1080 }else{ 1081 var elem = filter_elem.filter('.gdlr-core-sly-slider'); 1082 } 1083 1084 elem.addClass('gdlr-core-after-init').each(function(){ 1085 var sly_slider = $(this); 1086 1087 sly_slider.sly({ 1088 horizontal: 1, 1089 itemNav: 'basic', 1090 smart: 1, 1091 activateOn: 'click', 1092 mouseDragging: 1, 1093 touchDragging: 1, 1094 releaseSwing: 1, 1095 startAt: 0, 1096 scrollBy: 1, 1097 speed: 1000, 1098 elasticBounds: 1, 1099 easing: 'easeOutQuart', 1100 dragHandle: 1, 1101 dynamicHandle: 1, 1102 clickBar: 1, 1103 scrollBar: $(this).siblings('.gdlr-core-sly-scroll') 1104 }); 1105 $(window).on('resize gdlr-core-element-resize', function(){ sly_slider.sly('reload'); }); 1106 }); 1107 1108 return $(this); 1109 1110 } // gdlr-core_sly 1111 1112 $.fn.gdlr_core_flexslider = function( filter_elem ){ 1113 1114 if( typeof(filter_elem) == 'undefined' ){ 1115 var elem = $(this).find('.gdlr-core-flexslider'); 1116 }else{ 1117 var elem = filter_elem.filter('.gdlr-core-flexslider'); 1118 } 1119 1120 elem.each(function(){ 1121 1122 var flex_attr = { 1123 useCSS: false, 1124 animation: 'fade', 1125 animationLoop: true, 1126 prevText: '<i class="arrow_carrot-left"></i>', 1127 nextText: '<i class="arrow_carrot-right"></i>' 1128 }; 1129 1130 if( $(this).find('.gdlr-core-flexslider').length > 0 ){ 1131 $(this).children('ul.slides').addClass('parent-slides'); 1132 flex_attr.selector = '.parent-slides > li'; 1133 } 1134 1135 // variable settings 1136 if( $(this).attr('data-disable-autoslide') ){ 1137 flex_attr.slideshow = false; 1138 } 1139 if( $(this).attr('data-pausetime') ){ 1140 flex_attr.slideshowSpeed = parseInt($(this).attr('data-pausetime')); 1141 } 1142 if( $(this).attr('data-slidespeed') ){ 1143 flex_attr.animationSpeed = parseInt($(this).attr('data-slidespeed')); 1144 }else{ 1145 flex_attr.animationSpeed = 500; 1146 } 1147 1148 // for carousel 1149 if( $(this).attr('data-type') == 'carousel' ){ 1150 flex_attr.move = $(this).attr('data-move')? parseInt($(this).attr('data-move')): 1; 1151 flex_attr.animation = 'slide'; 1152 1153 // determine the spaces 1154 var column_num = parseInt($(this).attr('data-column')); 1155 flex_attr.itemMargin = 2 * parseInt($(this).children('ul.slides').children('li:first-child').css('margin-right')); 1156 flex_attr.itemWidth = (($(this).width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin); 1157 1158 flex_attr.minItems = column_num; 1159 flex_attr.maxItems = column_num; 1160 1161 var t = $(this); 1162 $(window).on('resize gdlr-core-element-resize', function(){ 1163 if( t.data('goodlayers_flexslider') ){ 1164 var newWidth = ((t.width() + flex_attr.itemMargin) / column_num) - (flex_attr.itemMargin); 1165 t.data('goodlayers_flexslider').editItemWidth(newWidth); 1166 } 1167 }); 1168 1169 }else if( $(this).attr('data-effect') ){ 1170 if( $(this).attr('data-effect') == 'kenburn' ){ 1171 flex_attr.animation = 'fade'; 1172 }else{ 1173 flex_attr.animation = $(this).attr('data-effect'); 1174 } 1175 } 1176 1177 // for navigation 1178 if( !$(this).attr('data-nav') || $(this).attr('data-nav') == 'both' || $(this).attr('data-nav') == 'navigation' || $(this).attr('data-nav') == 'navigation-outer' ){ 1179 if( $(this).attr('data-nav-parent') ){ 1180 1181 if( $(this).attr('data-nav-type') == 'custom' ){ 1182 flex_attr.customDirectionNav = $(this).closest('.' + $(this).attr('data-nav-parent')).find('.flex-prev, .flex-next'); 1183 }else{ 1184 $(this).closest('.' + $(this).attr('data-nav-parent')).each(function(){ 1185 var flex_nav = $('<ul class="flex-direction-nav">' + 1186 '<li class="flex-nav-prev">
1186<a class="flex-prev" href="#"><i class="arrow_carrot-left"></i></a></li>' + 1187 '<li class="flex-nav-next"><a class="flex-next" href="#"><i class="arrow_carrot-right"></i></a></li>' + 1188 '</ul>'); 1189 1190 var flex_nav_position = $(this).find('.gdlr-core-flexslider-nav'); 1191 if( flex_nav_position.length ){ 1192 flex_nav_position.append(flex_nav); 1193 flex_attr.customDirectionNav = flex_nav.find('.flex-prev, .flex-next'); 1194 } 1195 }); 1196 } 1197 } 1198 }else{ 1199 flex_attr.directionNav = false; 1200 } 1201 if( $(this).attr('data-nav') == 'both' || $(this).attr('data-nav') == 'bullet' ){ 1202 flex_attr.controlNav = true; 1203 }else{ 1204 flex_attr.controlNav = false; 1205 } 1206 1207 // for thumbnail 1208 if( $(this).attr('data-thumbnail') ){ 1209 var thumbnail_slide = $(this).siblings('.gdlr-core-sly-slider'); 1210 1211 flex_attr.manualControls = thumbnail_slide.find('ul.slides li') 1212 flex_attr.controlNav = true; 1213 } 1214 1215 // center the navigation 1216 // add active class for kenburn effects 1217 if( $(this).attr('data-vcenter-nav') ){ 1218 flex_attr.start = function(slider){ 1219 if( slider.directionNav ){ 1220 $(window).on('resize gdlr-core-element-resize', function(){ 1221 slider.directionNav.each(function(){ 1222 var margin = -(slider.height() + $(this).outerHeight()) / 2; 1223 $(this).css('margin-top', margin); 1224 }); 1225 }); 1226 } 1227 if( typeof(slider.slides) != 'undefined' ){ 1228 $(window).trigger('gdlr-core-element-resize'); 1229 slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1230 } 1231 }; 1232 }else{ 1233 flex_attr.start = function(slider){ 1234 if( typeof(slider.slides) != 'undefined' ){ 1235 $(window).trigger('gdlr-core-element-resize'); 1236 slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1237 } 1238 } 1239 } 1240 1241 // add the action for class 1242 flex_attr.after = function(slider){ 1243 slider.slides.filter('.flex-active-slide').addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1244 } 1245 1246 // add outer frame class 1247 if( $(this).find('.gdlr-core-outer-frame-element').length > 0 ){ 1248 $(this).addClass('gdlr-core-with-outer-frame-element'); 1249 } 1250 1251 $(this).goodlayers_flexslider(flex_attr); 1252 }); 1253 1254 return $(this); 1255 1256 } // gdlr-core-flexslier 1257 1258 $.fn.gdlr_core_isotope = function( filter_elem ){ 1259 1260 if(typeof($.fn.isotope) == 'function'){ 1261 1262 if( typeof(filter_elem) == 'undefined' ){ 1263 var elem = $(this).find('[data-layout="masonry"]'); 1264 }else{ 1265 var elem = filter_elem.filter('[data-layout="masonry"]'); 1266 } 1267 1268 elem.each(function(){ 1269 1270 var t = $(this); 1271 var columnSize = t.width() / 60; 1272 1273 t.isotope({ 1274 itemSelector: '.gdlr-core-item-list', 1275 layoutMode: 'masonry', 1276 masonry:{ 1277 columnWidth: columnSize 1278 } 1279 }); 1280 t.isotope(); 1281 1282 t.children('.gdlr-core-item-list').gdlr_core_animate_list_item(); 1283 1284 // resize event 1285 $(window).on('resize gdlr-core-element-resize', function(){ 1286 1287 columnSize = t.width() / 60; 1288 1289 t.isotope({ 1290 masonry:{ 1291 columnWidth: columnSize 1292 } 1293 }); 1294 }); 1295 }); 1296 1297 } 1298 1299 return $(this); 1300 1301 } // gdlr-core-isotope 1302 $.fn.gdlr_core_animate_list_item = function(){ 1303 1304 var ux_items = $(this).get(); 1305 1306 // run the ux in order with delay 1307 var ux_interval = setInterval(function(){ 1308 1309 if( ux_items.length > 0 ){ 1310 // animate the ux item 1311 var ux_animate = $(ux_items.shift()); 1312 var animation_duration = '600ms'; 1313 1314 ux_animate.css({'animation-duration': animation_duration}); 1315 ux_animate.addClass('gdlr-core-animate'); 1316 1317 // remove selector 1318 setTimeout(function(){ 1319 ux_animate.css({'animation-duration': ''}) 1320 .addClass('gdlr-core-animate-end') 1321 .removeClass('gdlr-core-animate gdlr-core-animate-init'); 1322 }, parseInt(animation_duration)); 1323 1324 }else{ 1325 clearInterval(ux_interval); 1326 } 1327 }, 200); 1328 1329 } 1330 1331 $.fn.gdlr_core_lightbox = function( filter_elem ){ 1332 1333 // ilightbox 1334 if( typeof($.iLightBox) == 'function' ){ 1335 1336 if( typeof(filter_elem) == 'undefined' ){ 1337 var ilightbox = $(this).find('.gdlr-core-ilightbox'); 1338 }else{ 1339 var ilightbox = filter_elem.filter('.gdlr-core-ilightbox'); 1340 } 1341 1342 var ilightbox_atts = {}; 1343 var ilightbox_groups = []; 1344 1345 if( typeof(gdlr_core_pbf.ilightbox_skin) != 'undefined' ){ 1346 ilightbox_atts['skin'] = gdlr_core_pbf.ilightbox_skin; 1347 } 1348 1349 ilightbox.each(function(){ 1350 if( $(this).attr('data-ilightbox-group') ){ 1351 if( ilightbox_groups.indexOf($(this).attr('data-ilightbox-group')) == -1 ){ 1352 ilightbox_groups.push($(this).attr('data-ilightbox-group')); 1353 } 1354 }else{ 1355 $(this).iLightBox(ilightbox_atts); 1356 } 1357 }); 1358 1359 for( var key in ilightbox_groups ){ 1360 $(this).find('.gdlr-core-ilightbox[data-ilightbox-group="' + ilightbox_groups[key] + '"]').iLightBox(ilightbox_atts); 1361 } 1362 } 1363 1364 // lightbox gallery 1365 if( typeof(filter_elem) == 'undefined' ){ 1366 var gallery_lb = $(this).find('[data-gallery-lb]'); 1367 }else{ 1368 var gallery_lb = filter_elem.filter('[data-gallery-lb]'); 1369 } 1370 1371 gallery_lb.click(function(){ 1372 if( typeof($.iLightBox) != 'undefined' ){ 1373 $.iLightBox($(this).data('gallery-lb')); 1374 }else if(typeof(Strip) != 'undefined' ){ 1375 Strip.show($(this).data('gallery-lb')); 1376 } 1377 1378 return false; 1379 }); 1380 1381 1382 // image overlay 1383 if( typeof(filter_elem) == 'undefined' ){
1384 var center_overlay = $(this).find('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon'); 1385 }else{ 1386 var center_overlay = filter_elem.filter('.gdlr-core-image-overlay-center, .gdlr-core-image-overlay-center-icon'); 1387 } 1388 1389 center_overlay.each(function(){ 1390 1391 // for portfolio overlay content style 1392 if( $(this).hasClass('gdlr-core-image-overlay-center') ){ 1393 var overlay_content = $(this).children('.gdlr-core-image-overlay-content'); 1394 var wrap_height = $(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom'))); 1395 1396 var overlay_icon = overlay_content.children('.gdlr-core-portfolio-icon-wrap'); 1397 var icon_margin = (wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2; 1398 if( icon_margin > 20 ){ 1399 overlay_icon.css('margin-bottom', icon_margin); 1400 } 1401 1402 // normal centering 1403 }else{ 1404 var content_offset = 0; 1405 if( $(this).children('.gdlr-core-image-overlay-content-offset').length ){ 1406 content_offset = $(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true); 1407 } 1408 1409 $(this).children('.gdlr-core-image-overlay-content').each(function(){ 1410 $(this).css({ 'margin-top': -( ($(this).outerHeight() + content_offset) / 2 ) }); 1411 }); 1412 } 1413 1414 }); 1415 $(window).on('resize gdlr-core-element-resize', function(){ 1416 center_overlay.each(function(){ 1417 // for portfolio style 1418 if( $(this).hasClass('gdlr-core-image-overlay-center') ){ 1419 var overlay_content = $(this).children('.gdlr-core-image-overlay-content'); 1420 var wrap_height = $(this).outerHeight() - (2 * parseInt(overlay_content.css('bottom'))); 1421 1422 var overlay_icon = overlay_content.children('.gdlr-core-portfolio-icon-wrap'); 1423 var icon_margin = (wrap_height - (overlay_content.outerHeight() - parseInt(overlay_icon.css('margin-bottom')))) / 2; 1424 if( icon_margin > 20 ){ 1425 overlay_icon.css('margin-bottom', icon_margin); 1426 } 1427 1428 // normal centering 1429 }else{ 1430 var content_offset = 0; 1431 if( $(this).children('.gdlr-core-image-overlay-content-offset').length ){ 1432 content_offset = $(this).children('.gdlr-core-image-overlay-content-offset').outerHeight(true); 1433 } 1434 1435 $(this).children('.gdlr-core-image-overlay-content').each(function(){ 1436 $(this).css({ 'margin-top': -( ($(this).outerHeight() + content_offset) / 2 ) }); 1437 }); 1438 } 1439 }); 1440 }); 1441 1442 return $(this); 1443 } 1444 1445 $.fn.gdlr_core_set_image_height = function(){ 1446 1447 var all_image = $(this).find('img'); 1448 1449 all_image.each(function(){ 1450 var img_width = $(this).attr('width'); 1451 var img_height = $(this).attr('height'); 1452 1453 if( img_width && img_height ){ 1454 var parent_item = $(this).parent('.gdlr-core-temp-image-wrap'); 1455 1456 if( parent_item.length ){ 1457 parent_item.height((img_height * $(this).parent().width()) / img_width); 1458 }else{ 1459 parent_item = $('<div class="gdlr-core-temp-image-wrap" ></div>'); 1460 parent_item.css('height', ((img_height * $(this).closest('span, div').width()) / img_width)); 1461 $(this).wrap(parent_item); 1462 } 1463 }else{ 1464 return; 1465 } 1466 }); 1467 $(window).on('resize gdlr-core-element-resize', function(e){ 1468 all_image.each(function(){ 1469 var parent_item = $(this).parent('.gdlr-core-temp-image-wrap'); 1470 1471 if( parent_item.length ){ 1472 $(this).unwrap(); 1473 } 1474 }); 1475 1476 $(window).unbind('resize', e.handleObj.handler, e); 1477 }); 1478 1479 return $(this); 1480 } // gdlr_core_set_image_height 1481 1482 // to set full height wrapper / column 1483 window.gdlr_core_set_full_height = function( container, filter_elem ){ 1484 if( typeof(filter_elem) == 'undefined' ){ 1485 this.elements = container.find('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height'); 1486 }else{ 1487 this.elements = filter_elem.filter('.gdlr-core-wrapper-full-height, .gdlr-core-column-full-height'); 1488 } 1489 1490 if( this.elements.length ){ 1491 this.init(); 1492 } 1493 } 1494 gdlr_core_set_full_height.prototype = { 1495 1496 init: function(){ 1497 1498 var t = this; 1499 1500 t.resize(); 1501 $(window).on('load resize gdlr-core-element-resize', function(){ t.resize(); }); 1502 }, 1503 1504 resize: function(){ 1505 1506 this.elements.each(function(){ 1507 var offset = $(this).attr('data-decrease-height')? parseInt($(this).attr('data-decrease-height')): 0; 1508 1509 $(this).css('min-height', $(window).height() - offset); 1510 1511 if( $(this).hasClass('gdlr-core-full-height-center') ){ 1512 $(this).children('.gdlr-core-full-height-pre-spaces').remove(); 1513 1514 var pre_space = ($(this).height() - $(this).children('.gdlr-core-full-height-content').outerHeight(true)) / 2; 1515 if( pre_space > 0 ){
1516 $(this).prepend($('<div class="gdlr-core-full-height-pre-spaces" ></div>').height(pre_space)); 1517 } 1518 } 1519 }); 1520 1521 } 1522 }; 1523 1524 // sync height among items 1525 window.gdlr_core_sync_height = function( container, filter_elem ){ 1526 1527 // for half height item 1528 this.set_half_height(container); 1529 1530 // sync height 1531 if( typeof(window.gdlr_core_sync_height_elem) != 'undefined' ){ 1532 window.gdlr_core_sync_height_elem.reinit(); 1533 return; 1534 } 1535 window.gdlr_core_sync_height_elem = this; 1536 1537 if( typeof(filter_elem) == 'undefined' ){ 1538 this.elements = container.find('[data-sync-height]'); 1539 }else{ 1540 this.elements = filter_elem.filter('[data-sync-height]'); 1541 } 1542 1543 this.elements_group = []; 1544 this.container = container; 1545 this.init(); 1546 } 1547 gdlr_core_sync_height.prototype = { 1548 1549 init: function(){ 1550 1551 var t = this; 1552 t.group_elements(); 1553 t.set_height(); 1554 1555 $(window).on('load resize gdlr-core-element-resize', function(){ t.set_height(); }); 1556 }, 1557 1558 reinit: function(){ 1559 1560 this.elements = this.container.find('[data-sync-height]'); 1561 this.group_elements(); 1562 this.set_height(); 1563 1564 }, 1565 1566 group_elements: function(){ 1567 1568 var t = this; 1569 1570 // do flipbox first 1571 t.elements.filter('.gdlr-core-flipbox-front').each(function(){ 1572 if( t.elements_group.indexOf($(this).attr('data-sync-height')) == -1 ){ 1573 t.elements_group.push($(this).attr('data-sync-height')); 1574 } 1575 }); 1576 1577 // do the rest elements 1578 t.elements.each(function(){ 1579 if( t.elements_group.indexOf($(this).attr('data-sync-height')) == -1 ){ 1580 t.elements_group.push($(this).attr('data-sync-height')); 1581 } 1582 }); 1583 }, 1584 1585 set_height: function(){ 1586 1587 var t = this; 1588 1589 // revert to default value 1590 t.elements.css('height', 'auto').children('.gdlr-core-sync-height-pre-spaces').remove(); 1591 t.elements.find('.gdlr-core-sync-height-offset').remove(); 1592 1593 var sync_element = t.elements; 1594 if( gdlr_core_display == 'mobile-landscape' || gdlr_core_display == 'mobile-portrait' ){ 1595 sync_element = sync_element.filter('.gdlr-core-flipbox-front, .gdlr-core-flipbox-back'); 1596 } 1597 1598 // setting the height by each group 1599 for( var key in t.elements_group ){ 1600 var max_height = 0; 1601 1602 // determine max height 1603 sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){ 1604 if( $(this).outerHeight() > max_height ){ 1605 max_height = $(this).outerHeight(); 1606 } 1607 }); 1608 1609 // set the height 1610 sync_element.filter('[data-sync-height="' + t.elements_group[key] + '"]').each(function(){ 1611 1612 // set the offset space to the bottom 1613 var offset = parseInt(max_height - $(this).outerHeight()); 1614 var offset_item = $(this).find('[data-sync-height-offset]'); 1615 if( offset_item.length && offset > 0 ){ 1616 $('<div class="gdlr-core-sync-height-offset" ></div>').css('height', offset).insertBefore(offset_item); 1617 } 1618 1619 $(this).css('height', max_height); 1620 1621 // flipbox 1622 if( $(this).hasClass('gdlr-core-flipbox-front') ){ 1623 $(this).parent().css('height', max_height); 1624 } 1625 1626 // center the content if selected 1627 if( $(this).is('[data-sync-height-center]') ){ 1628 var content = $(this).children('.gdlr-core-sync-height-content'); 1629 1630 // determine top padding for centering content 1631 var padding_top = max_height; 1632 if( content.length > 0 ){ 1633 padding_top -= content.outerHeight(); 1634 }else{ 1635 $(this).children().each(function(){ 1636 padding_top -= $(this).outerHeight(); 1637 }); 1638 } 1639 padding_top = padding_top / 2; 1640 padding_top = padding_top - (parseInt($(this).css('padding-top')) + parseInt($(this).css('border-top-width'))); 1641 1642 // insert the spaces 1643 if( padding_top > 0 ){ 1644 var spaces_item = $('<div class="gdlr-core-sync-height-pre-spaces" ></div>').css('padding-top', padding_top); 1645 var space_position = $(this).children('.gdlr-core-sync-height-space-position'); 1646 if( space_position.length > 0 ){ 1647 spaces_item.insertBefore(space_position); 1648 }else{ 1649 $(this).prepend(spaces_item); 1650 } 1651 } 1652 } 1653 1654 }); 1655 } 1656 1657 }, 1658 1659 set_half_height: function( container ){ 1660 1661 container.find('.gdlr-core-half-height').each(function(){ 1662 var temp = $(this); 1663 if( !gdlr_core_mobile && (gdlr_core_display == 'tablet' || gdlr_core_display == 'desktop') ){ 1664 var temp_height = temp.outerHeight(); 1665 temp.gdlr_core_set_image_height(); 1666 temp.css('height', temp_height / 2); 1667 temp.find('img').css('margin-top', -temp_height/4); 1668 } 1669 $(window).on('load resize', function(){ 1670 temp.css('height', 'auto'); 1671 temp.find('img').css('margin-top', '0'); 1672 if( !gdlr_core_mobile && (gdlr_core_display == 'tablet' || gdlr_core_display == 'desktop') ){ 1673 temp_height = temp.outerHeight(); 1674 temp.gdlr_core_set_image_height(); 1675 temp.css('height', temp_height / 2); 1676 temp.find('img').css('margin-top', -temp_height/4); 1677 } 1678 }); 1679 }); 1680 1681 } 1682 1683 }; // gdlr_core_sync_height.prototype 1684
1685 function gdlr_core_ajax_action(ajax_section, name, value){ 1686 1687 var now_loading = $('<div class="gdlr-core-now-loading" ></div>').hide(); 1688 1689 $.ajax({ 1690 type: 'POST', 1691 url: gdlr_core_pbf.ajax_url, 1692 data: { 1693 'action': ajax_section.attr('data-ajax'), 1694 'settings': ajax_section.data('settings'), 1695 'option': { 'name':name, 'value':value } 1696 }, 1697 dataType: 'json', 1698 beforeSend: function(jqXHR, settings){ 1699 // before send action 1700 if( ajax_section.attr('data-target-action') == 'replace' ){ 1701 ajax_section.siblings('.' + ajax_section.attr('data-target')).animate({opacity: 0}, 150); 1702 } 1703 1704 // for portfolio item 1705 if( ajax_section.attr('data-target') == 'gdlr-core-portfolio-item-holder' && 1706 ajax_section.attr('data-target-action') == 'replace' ){ 1707 1708 now_loading.insertBefore( ajax_section.siblings('.gdlr-core-portfolio-item-holder') ); 1709 now_loading.fadeIn(200); 1710 } 1711 }, 1712 error: function(jqXHR, textStatus, errorThrown){ 1713 ajax_section.removeClass('gdlr-core-disable'); 1714 1715 console.log(jqXHR, textStatus, errorThrown); 1716 }, 1717 success: function(data){ 1718 ajax_section.removeClass('gdlr-core-disable'); 1719 1720 if( data.status == 'success' ){ 1721 if( data.content && ajax_section.attr('data-target') ){ 1722 if( ajax_section.attr('data-target-action') == 'append' ){ 1723 var content = $(data.content); 1724 ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){ 1725 1726 if( $(this).attr('data-layout') != 'masonry' || typeof($.fn.isotope) != 'function' ){ 1727 content.addClass('gdlr-core-animate-init'); 1728 } 1729 $(this).append(content); 1730 1731 content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_content_script().gdlr_core_set_image_height(); 1732 new gdlr_core_sync_height(content); 1733 1734 if( $(this).attr('data-layout') == 'masonry' && typeof($.fn.isotope) == 'function' ){ 1735 var addItems = $(this).isotope('addItems', content); 1736 $(this).isotope('layoutItems', addItems, true); 1737 } 1738 1739 content.gdlr_core_animate_list_item(); 1740 }); 1741 1742 if( data.load_more ){ 1743 if( data.load_more != 'none' ){ 1744 var load_more = $(data.load_more); 1745 ajax_section.parent().append(load_more); 1746 load_more.gdlr_core_ajax(load_more); 1747 load_more.css('display', 'none').slideDown(100); 1748 1749 ajax_section.remove(); 1750 }else{ 1751 ajax_section.slideUp(100, function(){ $(this).remove(); }); 1752 } 1753 } 1754 1755 }else if( ajax_section.attr('data-target-action') == 'replace' ){ 1756 var content = $(data.content); 1757 ajax_section.siblings('.' + ajax_section.attr('data-target')).each(function(){ 1758 var fix_height = false; 1759 var current_height = $(this).height(); 1760 1761 if( $(this).attr('data-layout') != 'masonry' || typeof($.fn.isotope) != 'function' ){ 1762 content.addClass('gdlr-core-animate-init'); 1763 } 1764 $(this).empty().append(content); 1765 1766 content.gdlr_core_lightbox().gdlr_core_flexslider().gdlr_core_fluid_video().gdlr_core_set_image_height(); 1767 new gdlr_core_sync_height(content); 1768 1769 if( $(this).attr('data-layout') == 'masonry' && typeof($.fn.isotope) == 'function' ){ 1770 $(this).isotope('destroy'); 1771 $(this).parent().gdlr_core_isotope(); 1772 fix_height = true; 1773 }else{ 1774 content.gdlr_core_animate_list_item(); 1775 } 1776 1777 var new_height = $(this).height(); 1778 $(this).css({height:current_height, opacity:1}).animate({'height':new_height}, {'duration':400, 'easing':'easeOutExpo', 'complete': function(){ 1779 if( !fix_height ){ $(this).css('height',''); } 1780 }}); 1781 }); 1782 1783 // pagination 1784 if( data.pagination ){
1785 ajax_section.siblings('.gdlr-core-pagination').slideUp(100, function(){ $(this).remove(); }); 1786 1787 if( data.pagination != 'none' ){ 1788 var pagination = $(data.pagination); 1789 ajax_section.parent().append(pagination); 1790 pagination.gdlr_core_ajax(pagination); 1791 pagination.css('display', 'none').slideDown(100); 1792 } 1793 } 1794 1795 // load more button 1796 if( data.load_more ){ 1797 ajax_section.siblings('.gdlr-core-load-more-wrap').slideUp(100, function(){ $(this).remove(); }); 1798 1799 if( data.load_more != 'none' ){ 1800 var load_more = $(data.load_more); 1801 ajax_section.parent().append(load_more); 1802 load_more.gdlr_core_ajax(load_more); 1803 load_more.css('display', 'none').slideDown(100); 1804 } 1805 } 1806 1807 } 1808 } 1809 1810 if( typeof(data.settings) != 'undefined' ){ 1811 ajax_section.data('settings', data.settings); 1812 } 1813 1814 now_loading.fadeOut(200, function(){ $(this).remove(); }); 1815 }else{ 1816 console.log(data); 1817 } 1818 } 1819 }); 1820 1821 } // gdlr_core_ajax_action 1822 $.fn.gdlr_core_ajax = function( filter_elem ){ 1823 1824 if( typeof(filter_elem) == 'undefined' ){ 1825 var elem = $(this).find('[data-ajax]'); 1826 }else{ 1827 var elem = filter_elem.filter('[data-ajax]'); 1828 } 1829 1830 elem.each(function(){ 1831 1832 var ajax_section = $(this); 1833 1834 // button click 1835 $(this).on('click', 'a', function(){ 1836 if( $(this).hasClass('gdlr-core-active') || ajax_section.hasClass('gdlr-core-disable') ){ 1837 return false; 1838 } 1839 1840 $(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1841 ajax_section.addClass('gdlr-core-disable'); 1842 1843 var name = $(this).attr('data-ajax-name'); 1844 var value = $(this).attr('data-ajax-value'); 1845 1846 gdlr_core_ajax_action(ajax_section, name, value); 1847 1848 return false; 1849 }); 1850 1851 // filter changed 1852 $(this).on('change', 'select', function(){ 1853 var name = $(this).attr('data-ajax-name'); 1854 var value = $(this).val(); 1855 1856 gdlr_core_ajax_action(ajax_section, name, value); 1857 }); 1858 1859 }); 1860 1861 } // gdlr_core_ajax 1862 $.fn.gdlr_core_ajax_slide_bar = function( filter_elem ){ 1863 if( typeof(filter_elem) == 'undefined' ){ 1864 var elem = $(this).find('[data-ajax]'); 1865 }else{ 1866 var elem = filter_elem.filter('[data-ajax]'); 1867 } 1868 1869 elem.each(function(){ 1870 1871 var ajax_section = $(this); 1872 1873 // filter slide bar 1874 $(this).children('.gdlr-core-filterer-slide-bar').each(function(){ 1875 var slide_bar = $(this); 1876 var active_slide = slide_bar.siblings('.gdlr-core-active'); 1877 slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) }); 1878 1879 $(window).on('load resize', function(){ 1880 active_slide = slide_bar.siblings('.gdlr-core-active'); 1881 slide_bar.css({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) }); 1882 }); 1883 1884 ajax_section.find('a').hover(function(){ 1885 slide_bar.animate({'width': $(this).outerWidth(), 'left': $(this).position().left + parseInt($(this).css('margin-left')) }, {queue: false, duration: 200}); 1886 }, function(){ 1887 active_slide = slide_bar.siblings('.gdlr-core-active'); 1888 slide_bar.animate({'width': active_slide.outerWidth(), 'left': active_slide.position().left + parseInt(active_slide.css('margin-left')) }, {queue: false, duration: 200}); 1889 }); 1890 }); 1891 1892 }); 1893 } 1894 1895 $.fn.gdlr_core_dropdown_tab = function( filter_elem ){ 1896 1897 if( typeof(filter_elem) == 'undefined' ){ 1898 var elem = $(this).find('.gdlr-core-dropdown-tab'); 1899 }else{ 1900 var elem = filter_elem.filter('.gdlr-core-dropdown-tab'); 1901 } 1902 1903 elem.each(function(){ 1904 var tab_title = $(this).children('.gdlr-core-dropdown-tab-title'); 1905 var tab_title_text = tab_title.children('.gdlr-core-head'); 1906 var tab_dropdown = tab_title.children('.gdlr-core-dropdown-tab-head-wrap'); 1907 var tab_content = $(this).children('.gdlr-core-dropdown-tab-content-wrap'); 1908 1909 // dropdown 1910 tab_title.click(function(){ 1911 if( $(this).hasClass('gdlr-core-active') ){ 1912 $(this).removeClass('gdlr-core-active'); 1913 tab_dropdown.hide(); 1914 }else{ 1915 $(this).addClass('gdlr-core-active'); 1916 tab_dropdown.slideDown(200); 1917 } 1918 }); 1919 tab_dropdown.children().click(function(){ 1920 tab_title_text.html($(this).html()); 1921 $(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 1922 1923 var content_active = tab_content.children('[data-index="' + $(this).attr('data-index') + '"]'); 1924 content_active.fadeIn(200).addClass('gdlr-core-active'); 1925 content_active.siblings().hide().removeClass('gdlr-core-active'); 1926 }); 1927 1928 }); 1929 1930 } // gdlr_core_dropdown_tab 1931 1932 if( !gdlr_core_pbf.admin ){
1933 1934 $(document).ready(function(){ 1935 1936 $('body').each(function(){ 1937 1938 // turns image link to open in lightbox 1939 if( $(this).hasClass('gdlr-core-link-to-lightbox') ){ 1940 var image_link = $(this).find('a[href$=".jpg"], a[href$=".png"], a[href$=".gif"]') 1941 .not('.gdlr-core-ilightbox, .strip, [data-rel]') 1942 .addClass('strip gdlr-core-ilightbox'); 1943 $(this).gdlr_core_lightbox( image_link ); 1944 } 1945 1946 var gdlr_core_js = $(this).find('.gdlr-core-js, iframe[src*="youtube"], iframe[src*="vimeo"]'); 1947 1948 // video resizing 1949 $(this).gdlr_core_content_script( gdlr_core_js, true ); 1950 1951 // counter item 1952 $(this).gdlr_core_counter_item( gdlr_core_js ); 1953 1954 // type animation item 1955 $(this).gdlr_core_typed_animation( gdlr_core_js ); 1956 1957 // countdown item 1958 $(this).gdlr_core_countdown_item( gdlr_core_js ); 1959 1960 // alert box item 1961 $(this).gdlr_core_alert_box_item( gdlr_core_js ); 1962 1963 // accordion item 1964 $(this).gdlr_core_accordion( gdlr_core_js ); 1965 1966 // toggle box item 1967 $(this).gdlr_core_toggle_box( gdlr_core_js ); 1968 1969 // divider 1970 $(this).gdlr_core_divider( gdlr_core_js ); 1971 1972 // flipbox 1973 $(this).gdlr_core_flipbox( gdlr_core_js ); 1974 1975 // marquee 1976 $(this).gdlr_core_marquee( gdlr_core_js ); 1977 1978 // chart.js 1979 $(this).gdlr_core_chart_js( gdlr_core_js ); 1980 1981 // skill circle 1982 $(this).gdlr_core_skill_circle( gdlr_core_js ); 1983 1984 // skill bar 1985 $(this).gdlr_core_skill_bar( gdlr_core_js ); 1986 1987 // tab 1988 $(this).gdlr_core_tab( gdlr_core_js ); 1989 1990 // dropdown tab 1991 $(this).gdlr_core_dropdown_tab( gdlr_core_js ); 1992 1993 // lightbox 1994 $(this).gdlr_core_lightbox( gdlr_core_js ); 1995 1996 // ajax action 1997 $(this).gdlr_core_ajax( gdlr_core_js ); 1998 $(this).gdlr_core_ajax_slide_bar( gdlr_core_js ); 1999 2000 // ux animation 2001 // $(this).gdlr_core_ux( gdlr_core_js ); 2002 new gdlr_core_ux( $(this), gdlr_core_js ); 2003 2004 // set height 2005 new gdlr_core_set_full_height( $(this), gdlr_core_js ); 2006 2007 // sidebar wrapper height 2008 new gdlr_core_sidebar_wrapper( $(this), gdlr_core_js ); 2009 2010 // sync height 2011 new gdlr_core_sync_height( $(this), gdlr_core_js ); 2012 2013 // background parallax 2014 $(this).gdlr_core_parallax_background( gdlr_core_js ); 2015 2016 // particle 2017 $(this).gdlr_core_particle_background( gdlr_core_js ); 2018 2019 // privacy box cookie 2020 gdlr_core_js.filter('.gdlr-core-privacy-box-button').on('click', function(){ 2021 var privacy_box_wrap = $(this).closest('.gdlr-core-privacy-box-wrap'); 2022 if( privacy_box_wrap.is('.gdlr-core-pos-bottom-bar, .gdlr-core-pos-top-bar') ){ 2023 privacy_box_wrap.slideUp(200); 2024 }else{ 2025 privacy_box_wrap.fadeOut(250); 2026 } 2027 2028 var cookie_time = $(this).attr('data-cookie-time')? $(this).attr('data-cookie-time'): 2592000; 2029 console.log(cookie_time) 2030 gdlr_core_set_cookie('gdlr-core-privacy-box', 1, cookie_time); 2031 2032 return false; 2033 }); 2034 2035 // gdlr lightbox 2036 gdlr_core_js.filter('[data-gdlr-lb]').each(function(){ 2037 var lb_wrap = $('#' + $(this).data('gdlr-lb')); 2038 if( lb_wrap.length ){ 2039 2040 // open lightbox action 2041 $(this).on('click', function(){ 2042 lb_wrap.fadeIn(200); 2043 return false; 2044 }); 2045 2046 // bind the lightbox close action 2047 lb_wrap.find('.gdlr-core-lightbox-form-close').on('click', function(){ 2048 $(this).closest('.gdlr-core-lightbox-wrapper').fadeOut(); 2049 return false; 2050 }); 2051 } 2052 }); 2053 $(this) 2054 2055 // gdpr form 2056 gdlr_core_js.filter('#gdlr-core-gdpr-form').each(function(){ 2057 2058 // change tab 2059 $(this).on('click', '.gdlr-core-gdlr-form-nav li', function(){ 2060 $(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); 2061 2062 var nav_id = $(this).data('gdlr-nav'); 2063 var content_wrap = $(this).closest('.gdlr-core-gdpr-form-left').siblings('.gdlr-core-gdpr-form-right'); 2064 content_wrap.find('[data-gdlr-nav="' + nav_id + '"]').each(function(){ 2065 $(this).siblings('[data-gdlr-nav]').removeClass('gdlr-core-active').css('display', 'none'); 2066 $(this).fadeIn(200, function(){ $(this).addClass('gdlr-core-active'); }); 2067 });
2068 }); 2069 }); 2070 }); 2071 2072 }); // document.ready 2073 2074 $(window).load(function(){ 2075 2076 $('body').each(function(){ 2077 2078 var gdlr_core_js = $(this).find('.gdlr-core-js-2'); 2079 2080 // title divider 2081 $(this).gdlr_core_title_divider( gdlr_core_js ); 2082 2083 // flexslider 2084 $(this).gdlr_core_flexslider( gdlr_core_js ); 2085 2086 // sly slider 2087 $(this).gdlr_core_sly( gdlr_core_js ); 2088 2089 // isotope 2090 $(this).gdlr_core_isotope( gdlr_core_js ); 2091 2092 }); 2093 2094 }); // window.load 2095 2096 } 2097 2098})(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.