1/** 2 3* Template Name: Medilab - v2.1.1 4 5* Template URL: https://bootstrapmade.com/medilab-free-medical-bootstrap-theme/ 6 7* Author: BootstrapMade.com 8 9* License: https://bootstrapmade.com/license/ 10 11*/ 12 13!(function ($) { 14 15 "use strict"; 16 17 18 19 new WOW().init(); 20 21 // Preloader 22 /* 23 $(window).on('load', function() { 24 if ($('#preloader').length) { 25 26 $('#preloader').delay(100).fadeOut('slow', function() { 27 28 $(this).remove(); 29 30 }); 31 32 } 33 34 }); 35 */ 36 37 38 // Activate smooth scroll on page load with hash links in the url 39 40 $(document).ready(function () { 41 42 $('#block-superfish-1 .sf-depth-1').addClass('drop-down'); 43 44 $('#block-superfish-1 .sf-item-2.sf-depth-1').addClass('purpleBorder'); 45 46 $('#block-superfish-1 .sf-item-3.sf-depth-1').addClass('greenBorder'); 47 48 $('#block-superfish-1 .sf-item-4.sf-depth-1').addClass('yellowBorder'); 49 50 $('#block-superfish-1 .sf-item-5.sf-depth-1').removeClass('drop-down'); 51 52 $('#block-menu-menu-footer-menu ul.menu').removeClass(); 53 54 $('#block-superfish-1 .sf-depth-1.sf-no-children').removeClass('drop-down'); 55 $('#block-superfish-1 .sf-depth-1.sf-with-ul').attr('href', 'javascript:void(0)'); 56 57 if (window.location.hash) { 58 59 var initial_nav = window.location.hash; 60 61 if ($(initial_nav).length) { 62 console.log(initial_nav) 63 var scrollto = $(initial_nav).offset().top - 100; 64 65 $('html, body').animate({ 66 67 scrollTop: scrollto 68 69 }, 1500, 'easeInOutExpo'); 70 71 } 72 73 } 74 75 76 77 jQuery("#block-superfish-1 a[href*='#']:not([href='#'])").click(function (e) { 78 79 var hash = this.hash; 80 var section = jQuery(hash); 81 82 if (jQuery(hash).length > 0) { 83 e.preventDefault(); 84 85 86 if (hash) { 87 var scrollTopPosition = 100; 88 jQuery('html, body').animate({ 89 scrollTop: section.offset().top - scrollTopPosition 90 }, 1000, 'swing', function () { 91 history.replaceState({}, "", hash); 92 }); 93 return false; 94 } 95 96 } 97 }); 98 99 100 101 jQuery(document).on('click', '.CopyURL', function (event) { 102 var shareURL = jQuery(this).data('href'); 103 jQuery('#shareModal input').val(shareURL); 104 jQuery('#emailbtn').attr('href', 'mailto:?subject=Share Catalog&body=' + shareURL); 105 106 }); 107 108 var $temp = jQuery("<input>"); 109 jQuery.fn.modal.Constructor.prototype.enforceFocus = function () { }; 110 111 jQuery(document).on('click', '#copybtn', function (event) { 112 var clipboardText = ""; 113 clipboardText = jQuery('#shareModal input#inputToEmail').val(); 114 jQuery("body").append($temp); 115 $temp.val(clipboardText).select(); 116 document.execCommand("copy"); 117 $temp.remove(); 118 // copyToClipboard( clipboardText ); 119 120 }); 121 122 123 function copyToClipboard(text) { 124 125 var textArea = document.createElement("textarea"); 126 textArea.value = text; 127 document.body.appendChild(textArea); 128 textArea.select(); 129 130 try { 131 var successful = document.execCommand('copy'); 132 var msg = successful ? 'successful' : 'unsuccessful'; 133 console.log('Copying text command was ' + msg); 134 } catch (err) { 135 console.log('Oops, unable to copy', err); 136 } 137 document.body.removeChild(textArea); 138 } 139 140 // Mobile Navigation 141 142 if ($('.nav-menu').length) { 143 144 var $mobile_nav = $('.nav-menu').clone().prop({ 145 class: 'mobile-nav' 146 }); 147 $('#header').append($mobile_nav); 148 $('#header').prepend('<button type="button" class="mobile-nav-toggle"><i class="icofont-navigation-menu"></i></button>'); 149 $('#header').append('<div class="mobile-nav-overly"></div>'); 150 jQuery('.mobile-nav #menu-450-1, .mobile-nav #menu-452-1').wrapAll('<ul id="superfish-1" class="menu secound-menu sf-menu sf-main-menu1" ></ul>'); 151 jQuery('.mobile-nav #menu-549-1, .mobile-nav #menu-550-1, .mobile-nav #menu-551-1').wrapAll('<ul id="upperButtons" class="menu secound-menu upperButtons" ></ul>'); 152 setTimeout(function () { 153 console.log(jQuery('#superfish-1.secound-menu')); 154 var element = jQuery('#superfish-1.secound-menu.sf-main-menu1').detach(); 155 var element2 = jQuery('#upperButtons.secound-menu.upperButtons').detach(); 156 jQuery('.mobile-nav #block-superfish-1').append(element); 157 jQuery('.mobile-nav #block-superfish-1').prepend(element2); 158 }, 500); 159 $(document).on('click', '.mobile-nav-toggle', function (e) { 160 $('#header').toggleClass('mobile-nav-active'); 161 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 162 163 $('.mobile-nav-overly').toggle(); 164 165 }); 166 167 168 169 $(document).on('click', '.mobile-nav .drop-down > a', function (e) { 170 171 e.preventDefault(); 172 173 $(this).next().slideToggle(300); 174 175 $(this).parent().toggleClass('active'); 176 177 }); 178 179 180 $(document).on('click', '.mobile-nav-overly', function (e) { 181 182 $('#header').removeClass('mobile-nav-active'); 183 $('.mobile-nav-overly').fadeOut(); 184 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 185 }); 186 187 188 $(document).click(function (e) { 189 190 var container = $(".mobile-nav, .mobile-nav-toggle"); 191 192 if (!container.is(e.target) && container.has(e.target).length === 0) { 193 194 if ($('body').hasClass('mobile-nav-active')) { 195 196 $('body').removeClass('mobile-nav-active'); 197 198 $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close'); 199 200 $('.mobile-nav-overly').fadeOut(); 201 202 } 203 204 } 205 206 }); 207 208 } else if ($(".mobile-nav, .mobile-nav-toggle").length) { 209 210 $(".mobile-nav, .mobile-nav-toggle").hide(); 211 212 } 213 214 // Toggle .header-scrolled class to #header when page is scrolled 215 216 $(window).scroll(function () { 217 218 if ($(this).scrollTop() > 100) { 219 220 $('#header').addClass('header-scrolled'); 221 222 $('#topbar').addClass('topbar-scrolled'); 223 224 } else { 225 226 $('#header').removeClass('header-scrolled'); 227 228 $('#topbar').removeClass('topbar-scrolled'); 229 230 } 231 232 });
233 234 235 236 if ($(window).scrollTop() > 100) { 237 238 $('#header').addClass('header-scrolled'); 239 240 $('#topbar').addClass('topbar-scrolled'); 241 242 } 243 244 // Back to top button 245 246 $(window).scroll(function () { 247 248 if ($(this).scrollTop() > 100) { 249 250 $('.back-to-top').fadeIn('slow'); 251 252 } else { 253 254 $('.back-to-top').fadeOut('slow'); 255 256 } 257 258 }); 259 260 261 262 $('.back-to-top').click(function () { 263 264 $('html, body').animate({ 265 266 scrollTop: 0 267 268 }, 1500, 'easeInOutExpo'); 269 270 return false; 271 272 }); 273 274 275 276 // Testimonials carousel (uses the Owl Carousel library) 277 278 $(".testimonials-carousel").owlCarousel({ 279 280 autoplay: true, 281 282 autoplayHoverPause: true, 283 284 autoplayTimeout: 5000, 285 286 dots: true, 287 288 loop: true, 289 290 responsive: { 291 292 0: { 293 294 items: 1 295 296 }, 297 298 768: { 299 300 items: 1 301 302 }, 303 304 900: { 305 306 items: 1 307 308 } 309 310 } 311 312 }); 313 314 315 316 $('.venobox').venobox({ 317 framewidth: '96vh', // default: '' 318 // frameheight: '60vh', // default: '' 319 border: '10px', // default: '0' 320 titleattr: 'data-title', // default: 'title' 321 numeratio: true, // default: false 322 infinigall: true, // default: false 323 }); 324 325 setTimeout(function() { 326 var total = jQuery('#block-block-30 .thumbTestimonials img').length; 327 var rand_no = Math.floor( Math.random() * (total - 2) ); 328 //console.log('rand_no : '+rand_no); 329 //jQuery('#block-block-30 .thumbTestimonials .testimonialInnerDiv').not('.slick-current').removeClass('.slick-active'); 330 //jQuery('#block-block-30 .thumbTestimonials .testimonialInnerDiv').eq(rand_no).addClass('.slick-active'); 331 //jQuery('#block-block-30 .thumbTestimonials .testimonialInnerDiv').eq(rand_no + 1).addClass('.slick-active'); 332 var clone_fslide = jQuery('#block-block-30 .testimonialImg.MJ_Melling').closest('.testimonialInnerDiv').clone(); 333 jQuery('#block-block-30 .testimonialImg.MJ_Melling').closest('.testimonialInnerDiv').remove(); 334 jQuery('#block-block-30 .testimonialInnerDiv').eq(rand_no).after(clone_fslide); 335 var rand_no_f2 = 0; 336 var rand_no_f = rand_no_f2 = Math.floor(Math.random() * 3); 337 var rand_no_f_cok = getCookie("rand_no_f"); 338 //console.log('old cookie : '+rand_no_f_cok); 339 //console.log(' before rand_no_f : '+ rand_no_f); 340 setCookie('rand_no_f', rand_no_f, 30); 341 //setCookie('rand_no_f', rand_no_f, 30); 342 if (rand_no_f_cok != "") { 343 if(rand_no_f == 3 && rand_no_f_cok != rand_no_f) { 344 rand_no_f = rand_no - 1; 345 } else if(rand_no_f == 2 && rand_no_f_cok != rand_no_f) { 346 rand_no_f = rand_no; 347 } else if(rand_no_f == 1 && rand_no_f_cok != rand_no_f) { 348 rand_no_f = rand_no - 1; 349 } else if(rand_no_f == 0 && rand_no_f_cok != rand_no_f) { 350 rand_no_f = rand_no + 1; 351 } else if(rand_no_f == 0) { 352 rand_no_f = rand_no + 1; 353 } else { 354 if(rand_no_f_cok == rand_no_f2 && rand_no_f_cok == 1) 355 rand_no_f = rand_no + 1; 356 else if(rand_no_f_cok == rand_no_f2 && rand_no_f_cok == 2) 357 rand_no_f = rand_no - 1; 358 else if(rand_no_f_cok == rand_no_f2 && rand_no_f_cok == 3) 359 rand_no_f = rand_no - 2; 360 else 361 rand_no_f = rand_no; 362 } 363 } else { 364 if(rand_no_f_cok == rand_no_f) 365 rand_no_f = 2; 366 setCookie('rand_no_f', rand_no_f, 30); 367 } 368 369 //console.log('rand_no : '+rand_no + ' ==== rand_no_f : '+rand_no_f); 370 jQuery('#block-block-30 .thumbTestimonials').slick({ 371 infinite: true, 372 slidesToShow: 3, 373 slidesToScroll: 1, 374 responsive: [ 375 { 376 breakpoint: 1025, 377 settings: { 378 slidesToShow: 2 379 } 380 }, 381 { 382 breakpoint: 991, 383 settings: { 384 slidesToShow: 2 385 } 386 }, 387 { 388 breakpoint: 600, 389 settings: { 390 slidesToShow: 1 391 } 392 }, 393 { 394 breakpoint: 480, 395 settings: { 396 slidesToShow: 1 397 } 398 } 399 400 ] 401 }
401).slick('slickGoTo', rand_no_f); 402 setTimeout(function() { 403 if(!jQuery('#block-block-30 .testimonialImg.MJ_Melling').closest('.testimonialInnerDiv').hasClass('slick-active')) { 404 console.log('another slick...'); 405 var index_mj = jQuery('#block-block-30 .testimonialImg.MJ_Melling').closest('.testimonialInnerDiv').attr('data-slick-index'); 406 jQuery('#block-block-30 .thumbTestimonials').slick('unslick'); 407 jQuery('#block-block-30 .thumbTestimonials').slick({ 408 infinite: true, 409 slidesToShow: 3, 410 slidesToScroll: 1, 411 responsive: [ 412 { 413 breakpoint: 1025, 414 settings: { 415 slidesToShow: 2 416 } 417 }, 418 { 419 breakpoint: 991, 420 settings: { 421 slidesToShow: 2 422 } 423 }, 424 { 425 breakpoint: 600, 426 settings: { 427 slidesToShow: 1 428 } 429 }, 430 { 431 breakpoint: 480, 432 settings: { 433 slidesToShow: 1 434 } 435 } 436 437 ] 438 }).slick('slickGoTo', index_mj); 439 } 440 }, 100); 441 }, 300); 442 443 /*$('#block-block-30 .thumbTestimonials').slick({ 444 infinite: true, 445 slidesToShow: 3, 446 slidesToScroll: 1, 447 responsive: [ 448 { 449 breakpoint: 1025, 450 settings: { 451 slidesToShow: 2 452 } 453 }, 454 { 455 breakpoint: 991, 456 settings: { 457 slidesToShow: 2 458 } 459 }, 460 { 461 breakpoint: 600, 462 settings: { 463 slidesToShow: 1 464 } 465 }, 466 { 467 breakpoint: 480, 468 settings: { 469 slidesToShow: 1 470 } 471 } 472 473 ] 474 });*/ 475 476 $('#block-block-11 .slider-nav').slick({ 477 slidesToShow: 2, 478 slidesToScroll: 1, 479 480 dots: true, 481 482 focusOnSelect: true, 483 484 autoplay: true, 485 responsive: [ 486 { 487 breakpoint: 1441, 488 settings: { 489 slidesToShow: 2 490 } 491 }, 492 { 493 breakpoint: 1280, 494 settings: { 495 slidesToShow: 2 496 } 497 }, 498 { 499 breakpoint: 1025, 500 settings: { 501 slidesToShow: 1 502 } 503 }, 504 { 505 breakpoint: 991, 506 settings: { 507 slidesToShow: 1 508 } 509 }, 510 { 511 breakpoint: 600, 512 settings: { 513 slidesToShow: 1 514 } 515 }, 516 { 517 breakpoint: 480, 518 settings: { 519 slidesToShow: 1 520 } 521 } 522 523 ] 524 525 }); 526 527 $('.existing-technologies .slider-nav').slick({ 528 slidesToShow: 4, 529 slidesToScroll: 1, 530 531 dots: true, 532 533 focusOnSelect: true, 534 535 autoplay: true, 536 responsive: [ 537 { 538 breakpoint: 1441, 539 settings: { 540 slidesToShow: 4 541 } 542 }, 543 { 544 breakpoint: 1280, 545 settings: { 546 slidesToShow: 3 547 } 548 }, 549 { 550 breakpoint: 1025, 551 settings: { 552 slidesToShow: 3 553 } 554 }, 555 { 556 breakpoint: 991, 557 settings: { 558 slidesToShow: 3 559 } 560 }, 561 { 562 breakpoint: 600, 563 settings: { 564 slidesToShow: 2 565 } 566 }, 567 { 568 breakpoint: 480, 569 settings: { 570 slidesToShow: 1 571 } 572 } 573 574 ] 575 576 }); 577 578 var audio; 579 580 $(".page-node-65 .language").click(function () { 581 var audioSRC = $(this).data('audio'); 582 playAudioData(audioSRC); 583 }); 584 585 $(".page-node-34 .language").click(function () { 586 var audioSRC = $(this).data('audio'); 587 playAudioData(audioSRC); 588 });
589 /* 590 setTimeout(function({ 591 setReplaceMenuPoster(); 592 }, 200); 593 */ 594 function playAudioData(audioSRC) { 595 var audioFullSRC = "https://openlightbox.com" + "/" + audioSRC; 596 $('#audioWL').attr('src', audioFullSRC); 597 loadAndPlay('#audioWL'); 598 audio.on("ended", function (e) { 599 if (audio) { 600 pauseAudio(); 601 audio.prop("currentTime", 0); 602 audio.off(); 603 } 604 }); 605 } 606 607 608 function startAudio() { 609 610 var loadmetadata = function () { 611 612 613 duration = audio.get(0).duration; 614 duration *= 1000; 615 616 if (typeof duration != 'undefined') { 617 if (self.audioTimeOutId !== null) { 618 if (self.onEndPlayAudio !== null) { 619 //onEndPlayAudio(); 620 } 621 } 622 clearInterval(self.audioTimeOutId); 623 self.audioTimeOutId = setTimeout(function () { 624 self.audioTimeOutId = null; 625 if (self.onEndPlayAudio !== null) { 626 //onEndPlayAudio(); 627 } 628 629 }, duration); 630 } 631 632 } 633 634 audio.trigger('play'); 635 636 audio.bind("loadedmetadata", loadmetadata); 637 } 638 639 640 function pauseAudio() { 641 audio.trigger('pause'); 642 } 643 644 function stopAudio() { 645 pauseAudio(); 646 audio.prop("currentTime", 0); 647 } 648 649 function loadAudio() { 650 audio.trigger('load'); 651 } 652 653 654 function loadAndPlay(selector) { 655 656 657 if (audio) { 658 pauseAudio(); 659 } 660 audio = $(selector); 661 loadAudio(); 662 startAudio(); 663 664 665 var a = audio[0]; 666 var isPlaying; 667 if (a.play instanceof Function) 668 isPlaying = function (audio) { 669 return !audio.paused; 670 }; 671 else { 672 a = $(audio).find('object')[0]; 673 isPlaying = function (audio) { 674 return audio.playState == 3; 675 }; 676 a.play = function () { 677 this.controls.play(); 678 }; 679 a.pause = function () { 680 this.controls.pause(); 681 }; 682 } 683 a.play(); 684 685 686 } 687 688 689 }); 690 691 692})(jQuery); 693 694function setCookie(cname, cvalue, exdays = 7) { 695 const d = new Date(); 696 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 697 let expires = "expires="+d.toUTCString(); 698 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 699} 700 701function getCookie(cname) { 702 let name = cname + "="; 703 let ca = document.cookie.split(';'); 704 for(let i = 0; i < ca.length; i++) { 705 let c = ca[i]; 706 while (c.charAt(0) == ' ') { 707 c = c.substring(1); 708 } 709 if (c.indexOf(name) == 0) { 710 return c.substring(name.length, c.length); 711 } 712 } 713 return ""; 714} 715 716function setReplaceMenuPoster() { 717 jQuery("a[href*='content/posters']").attr("href", "https://openlightbox.com/posters"); 718}
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.