1var $ = jQuery.noConflict(); 2 3$.fn.inlineStyle = function (prop) { 4 return this.prop("style")[$.camelCase(prop)]; 5}; 6 7$.fn.doOnce = function( func ) { 8 this.length && func.apply( this ); 9 return this; 10}; 11 12(function() { 13 var lastTime = 0; 14 var vendors = ['ms', 'moz', 'webkit', 'o']; 15 for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 16 window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; 17 window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] 18 || window[vendors[x]+'CancelRequestAnimationFrame']; 19 } 20 21 if (!window.requestAnimationFrame) 22 window.requestAnimationFrame = function(callback, element) { 23 var currTime = new Date().getTime(); 24 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 25 var id = window.setTimeout(function() { callback(currTime + timeToCall); }, 26 timeToCall); 27 lastTime = currTime + timeToCall; 28 return id; 29 }; 30 31 if (!window.cancelAnimationFrame) 32 window.cancelAnimationFrame = function(id) { 33 clearTimeout(id); 34 }; 35}()); 36 37 38 39function debounce(func, wait, immediate) { 40 var timeout, args, context, timestamp, result; 41 return function() { 42 context = this; 43 args = arguments; 44 timestamp = new Date(); 45 var later = function() { 46 var last = (new Date()) - timestamp; 47 if (last < wait) { 48 timeout = setTimeout(later, wait - last); 49 } else { 50 timeout = null; 51 if (!immediate) result = func.apply(context, args); 52 } 53 }; 54 var callNow = immediate && !timeout; 55 if (!timeout) { 56 timeout = setTimeout(later, wait); 57 } 58 if (callNow) result = func.apply(context, args); 59 return result; 60 }; 61} 62 63 64var requesting = false; 65 66var killRequesting = debounce(function () { 67 requesting = false; 68}, 100); 69 70function onScrollSliderParallax() { 71 if (!requesting) { 72 requesting = true; 73 requestAnimationFrame(function(){ 74 SEMICOLON.slider.sliderParallax(); 75 SEMICOLON.slider.sliderElementsFade(); 76 }); 77 } 78 killRequesting(); 79} 80 81 82 83var SEMICOLON = SEMICOLON || {}; 84 85(function($){ 86 87 // USE STRICT 88 "use strict"; 89 90 SEMICOLON.initialize = { 91 92 init: function(){ 93 94 SEMICOLON.initialize.responsiveClasses(); 95 SEMICOLON.initialize.stickyElements(); 96 SEMICOLON.initialize.goToTop(); 97 SEMICOLON.initialize.lazyLoad(); 98 SEMICOLON.initialize.fullScreen(); 99 SEMICOLON.initialize.verticalMiddle(); 100 SEMICOLON.initialize.lightbox(); 101 SEMICOLON.initialize.resizeVideos(); 102 SEMICOLON.initialize.imageFade(); 103 SEMICOLON.initialize.pageTransition(); 104 SEMICOLON.initialize.dataResponsiveClasses(); 105 SEMICOLON.initialize.dataResponsiveHeights(); 106 SEMICOLON.initialize.stickFooterOnSmall(); 107 SEMICOLON.initialize.stickyFooter(); 108 109 $('.fslider').addClass('preloader2'); 110 111 }, 112 113 responsiveClasses: function(){ 114 115 if( typeof jRespond === 'undefined' ) { 116 console.log('responsiveClasses: jRespond not Defined.'); 117 return true; 118 } 119 120 var jRes = jRespond([ 121 { 122 label: 'smallest', 123 enter: 0, 124 exit: 575 125 },{ 126 label: 'handheld', 127 enter: 576, 128 exit: 767 129 },{ 130 label: 'tablet', 131 enter: 768, 132 exit: 991 133 },{ 134 label: 'laptop', 135 enter: 992, 136 exit: 1199 137 },{ 138 label: 'desktop', 139 enter: 1200, 140 exit: 10000 141 } 142 ]); 143 jRes.addFunc([ 144 { 145 breakpoint: 'desktop', 146 enter: function() { $body.addClass('device-xl'); }, 147 exit: function() { $body.removeClass('device-xl'); } 148 },{ 149 breakpoint: 'laptop', 150 enter: function() { $body.addClass('device-lg'); }, 151 exit: function() { $body.removeClass('device-lg'); } 152 },{ 153 breakpoint: 'tablet', 154 enter: function() { $body.addClass('device-md'); }, 155 exit: function() { $body.removeClass('device-md'); } 156 },{ 157 breakpoint: 'handheld', 158 enter: function() { $body.addClass('device-sm'); }, 159 exit: function() { $body.removeClass('device-sm'); } 160 },{ 161 breakpoint: 'smallest', 162 enter: function() { $body.addClass('device-xs'); }, 163 exit: function() { $body.removeClass('device-xs'); } 164 } 165 ]); 166 }, 167 168 verticalMiddle: function(){ 169 if( $verticalMiddleEl.length > 0 ) { 170 $verticalMiddleEl.each( function(){ 171 var element = $(this), 172 verticalMiddleH = element.outerHeight(), 173 headerHeight = $header.outerHeight(); 174 175 if( element.parents('#slider').length > 0 && !element.hasClass('ignore-header') ) { 176 if( $header.hasClass('transparent-header') && ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) ) { 177 verticalMiddleH = verticalMiddleH - 70; 178 if( $slider.next('#header').length > 0 ) { verticalMiddleH = verticalMiddleH + headerHeight; } 179 } 180 } 181 182 if( $body.hasClass('device-sm') || $body.hasClass('device-xs') ) { 183 if( element.parents('.full-screen').length && !element.parents('.force-full-screen').length ){ 184 if( element.children('.col-padding').length > 0 ) { 185 element.css({ position: 'relative', top: '0', width: 'auto', marginTop: '0' }).addClass('clearfix'); 186 } else { 187 element.css({ position: 'relative', top: '0', width: 'auto', marginTop: '0', paddingTop: '60px', paddingBottom: '60px' }).addClass('clearfix'); 188 } 189 } else { 190 element.css({ position: 'absolute', top: '50%', width: '100%', paddingTop: '0', paddingBottom: '0', marginTop: -(verticalMiddleH/2)+'px' }); 191 } 192 } else { 193 element.css({ position: 'absolute', top: '50%', width: '100%', paddingTop: '0', paddingBottom: '0', marginTop: -(verticalMiddleH/2)+'px' }); 194 } 195 }); 196 } 197 }, 198 199 stickyElements: function(){ 200 if( $siStickyEl.length > 0 ) { 201 var siStickyH = $siStickyEl.outerHeight(); 202 $siStickyEl.css({ marginTop: -(siStickyH/2)+'px' }); 203 } 204 205 if( $dotsMenuEl.length > 0 ) { 206 var opmdStickyH = $dotsMenuEl.outerHeight(); 207 $dotsMenuEl.css({ marginTop: -(opmdStickyH/2)+'px' }); 208 } 209 }, 210 211 goToTop: function(){ 212 var elementScrollSpeed = $goToTopEl.attr('data-speed'), 213 elementScrollEasing = $goToTopEl.attr('data-easing'); 214 215 if( !elementScrollSpeed ) { elementScrollSpeed = 700; } 216 if( !elementScrollEasing ) { elementScrollEasing = 'easeOutQuad'; } 217 218 $goToTopEl.click(function() { 219 $('body,html').stop(true).animate({ 220 'scrollTop': 0 221 }, Number( elementScrollSpeed ), elementScrollEasing ); 222 return false;
223 }); 224 }, 225 226 goToTopScroll: function(){ 227 var elementMobile = $goToTopEl.attr('data-mobile'), 228 elementOffset = $goToTopEl.attr('data-offset'); 229 230 if( !elementOffset ) { elementOffset = 450; } 231 232 if( elementMobile != 'true' && ( $body.hasClass('device-sm') || $body.hasClass('device-xs') ) ) { return true; } 233 234 if( $window.scrollTop() > Number(elementOffset) ) { 235 $goToTopEl.fadeIn(); 236 $body.addClass('gototop-active'); 237 } else { 238 $goToTopEl.fadeOut(); 239 $body.removeClass('gototop-active'); 240 } 241 }, 242 243 fullScreen: function(){ 244 if( $fullScreenEl.length > 0 ) { 245 $fullScreenEl.each( function(){ 246 var element = $(this), 247 scrHeight = window.innerHeight ? window.innerHeight : $window.height(), 248 negativeHeight = element.attr('data-negative-height'); 249 250 if( element.attr('id') == 'slider' ) { 251 var sliderHeightOff = $slider.offset().top; 252 scrHeight = scrHeight - sliderHeightOff; 253 if( element.find('.slider-parallax-inner').length > 0 ) { 254 var transformVal = element.find('.slider-parallax-inner').css('transform'), 255 transformX = transformVal.match(/-?[\d\.]+/g); 256 if( !transformX ) { var transformXvalue = 0; } else { var transformXvalue = transformX[5]; } 257 scrHeight = ( ( window.innerHeight ? window.innerHeight : $window.height() ) + Number( transformXvalue ) ) - sliderHeightOff; 258 } 259 if( $('#slider.with-header').next('#header:not(.transparent-header)').length > 0 && ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) ) { 260 var headerHeightOff = $header.outerHeight(); 261 scrHeight = scrHeight - headerHeightOff; 262 } 263 } 264 if( element.parents('.full-screen').length > 0 ) { scrHeight = element.parents('.full-screen').height(); } 265 266 if( $body.hasClass('device-sm') || $body.hasClass('device-xs') ) { 267 if( !element.hasClass('force-full-screen') ){ scrHeight = 'auto'; } 268 } 269 270 if( negativeHeight ){ scrHeight = scrHeight - Number(negativeHeight); } 271 272 element.css('height', scrHeight); 273 if( element.attr('id') == 'slider' && !element.hasClass('canvas-slider-grid') ) { if( element.has('.swiper-slide') ) { element.find('.swiper-slide').css('height', scrHeight); } } 274 }); 275 } 276 }, 277 278 maxHeight: function(){ 279 if( $commonHeightEl.length > 0 ) { 280 if( $commonHeightEl.hasClass('customjs') ) { return true; } 281 $commonHeightEl.each( function(){ 282 var element = $(this); 283 if( element.find('.common-height').length > 0 ) { 284 SEMICOLON.initialize.commonHeight( element.find('.common-height:not(.customjs)') ); 285 } 286 287 SEMICOLON.initialize.commonHeight( element ); 288 }); 289 } 290 }, 291 292 commonHeight: function( element ){ 293 var maxHeight = 0; 294 element.children('[class*=col-]').each( function(){ 295 var elementChild = $(this).children(); 296 if( elementChild.hasClass('max-height') ){ 297 maxHeight = elementChild.outerHeight(); 298 } else { 299 if (elementChild.outerHeight() > maxHeight) 300 maxHeight = elementChild.outerHeight(); 301 } 302 }); 303 304 element.children('[class*=col-]').each(function() { 305 $(this).height(maxHeight); 306 }); 307 }, 308 309 testimonialsGrid: function(){ 310 if( $testimonialsGridEl.length > 0 ) { 311 if( $body.hasClass('device-md') || $body.hasClass('device-lg') || $body.hasClass('device-xl') ) { 312 var maxHeight = 0; 313 $testimonialsGridEl.each( function(){ 314 $(this).find("li > .testimonial").each(function(){ 315 if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } 316 }); 317 $(this).find("li").height(maxHeight); 318 maxHeight = 0; 319 }); 320 } else { 321 $testimonialsGridEl.find("li").css({ 'height': 'auto' }); 322 } 323 } 324 }, 325 326 lightbox: function(){ 327 328 if( !$().magnificPopup ) { 329 console.log('lightbox: Magnific Popup not Defined.'); 330 return true; 331 } 332 333 var $lightboxImageEl = $('[data-lightbox="image"]'), 334 $lightboxGalleryEl = $('[data-lightbox="gallery"]'), 335 $lightboxIframeEl = $('[data-lightbox="iframe"]'), 336 $lightboxInlineEl = $('[data-lightbox="inline"]'), 337 $lightboxAjaxEl = $('[data-lightbox="ajax"]'), 338 $lightboxAjaxGalleryEl = $('[data-lightbox="ajax-gallery"]'); 339 340 if( $lightboxImageEl.length > 0 ) { 341 $lightboxImageEl.magnificPopup({ 342 type: 'image', 343 closeOnContentClick: true, 344 closeBtnInside: false, 345 fixedContentPos: true, 346 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 347 image: { 348 verticalFit: true 349 } 350 }); 351 } 352 353 if( $lightboxGalleryEl.length > 0 ) { 354 $lightboxGalleryEl.each(function() { 355 var element = $(this); 356 357 if( element.find('a[data-lightbox="gallery-item"]').parent('.clone').hasClass('clone') ) { 358 element.find('a[data-lightbox="gallery-item"]').parent('.clone').find('a[data-lightbox="gallery-item"]').attr('data-lightbox',''); 359 } 360 361 if( element.find('a[data-lightbox="gallery-item"]').parents('.cloned').hasClass('cloned') ) { 362 element.find('a[data-lightbox="gallery-item"]').parents('.cloned').find('a[data-lightbox="gallery-item"]').attr('data-lightbox',''); 363 } 364 365 element.magnificPopup({ 366 delegate: 'a[data-lightbox="gallery-item"]', 367 type: 'image', 368 closeOnContentClick: true, 369 closeBtnInside: false, 370 fixedContentPos: true, 371 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 372 image: { 373 verticalFit: true 374 }, 375 gallery: { 376 enabled: true, 377 navigateByImgClick: true, 378 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 379 } 380 }); 381 }); 382 } 383 384 if( $lightboxIframeEl.length > 0 ) { 385 $lightboxIframeEl.magnificPopup({ 386 disableOn: 600, 387 type: 'iframe', 388 removalDelay: 160, 389 preloader: false,
390 fixedContentPos: false 391 }); 392 } 393 394 if( $lightboxInlineEl.length > 0 ) { 395 $lightboxInlineEl.magnificPopup({ 396 type: 'inline', 397 mainClass: 'mfp-no-margins mfp-fade', 398 closeBtnInside: false, 399 fixedContentPos: true, 400 overflowY: 'scroll' 401 }); 402 } 403 404 if( $lightboxAjaxEl.length > 0 ) { 405 $lightboxAjaxEl.magnificPopup({ 406 type: 'ajax', 407 closeBtnInside: false, 408 callbacks: { 409 ajaxContentAdded: function(mfpResponse) { 410 SEMICOLON.widget.loadFlexSlider(); 411 SEMICOLON.initialize.resizeVideos(); 412 SEMICOLON.widget.masonryThumbs(); 413 }, 414 open: function() { 415 $body.addClass('ohidden'); 416 }, 417 close: function() { 418 $body.removeClass('ohidden'); 419 } 420 } 421 }); 422 } 423 424 if( $lightboxAjaxGalleryEl.length > 0 ) { 425 $lightboxAjaxGalleryEl.magnificPopup({ 426 delegate: 'a[data-lightbox="ajax-gallery-item"]', 427 type: 'ajax', 428 closeBtnInside: false, 429 gallery: { 430 enabled: true, 431 preload: 0, 432 navigateByImgClick: false 433 }, 434 callbacks: { 435 ajaxContentAdded: function(mfpResponse) { 436 SEMICOLON.widget.loadFlexSlider(); 437 SEMICOLON.initialize.resizeVideos(); 438 SEMICOLON.widget.masonryThumbs(); 439 }, 440 open: function() { 441 $body.addClass('ohidden'); 442 }, 443 close: function() { 444 $body.removeClass('ohidden'); 445 } 446 } 447 }); 448 } 449 }, 450 451 modal: function(){ 452 453 if( !$().magnificPopup ) { 454 console.log('modal: Magnific Popup not Defined.'); 455 return true; 456 } 457 458 var $modal = $('.modal-on-load:not(.customjs)'); 459 if( $modal.length > 0 ) { 460 $modal.each( function(){ 461 var element = $(this), 462 elementTarget = element.attr('data-target'), 463 elementTargetValue = elementTarget.split('#')[1], 464 elementDelay = element.attr('data-delay'), 465 elementTimeout = element.attr('data-timeout'), 466 elementAnimateIn = element.attr('data-animate-in'), 467 elementAnimateOut = element.attr('data-animate-out'); 468 469 if( !element.hasClass('enable-cookie') ) { $.removeCookie( elementTargetValue ); } 470 471 if( element.hasClass('enable-cookie') ) { 472 var elementCookie = $.cookie( elementTargetValue ); 473 474 if( typeof elementCookie !== 'undefined' && elementCookie == '0' ) { 475 return true; 476 } 477 } 478 479 if( !elementDelay ) { 480 elementDelay = 1500; 481 } else { 482 elementDelay = Number(elementDelay) + 1500; 483 } 484 485 var t = setTimeout(function() { 486 $.magnificPopup.open({ 487 items: { src: elementTarget }, 488 type: 'inline', 489 mainClass: 'mfp-no-margins mfp-fade', 490 closeBtnInside: true, 491 fixedContentPos: true, 492 removalDelay: 500, 493 callbacks: { 494 open: function(){ 495 if( elementAnimateIn != '' ) { 496 $(elementTarget).addClass( elementAnimateIn + ' animated' ); 497 } 498 }, 499 beforeClose: function(){ 500 if( elementAnimateOut != '' ) { 501 $(elementTarget).removeClass( elementAnimateIn ).addClass( elementAnimateOut ); 502 } 503 }, 504 afterClose: function() { 505 if( elementAnimateIn != '' || elementAnimateOut != '' ) { 506 $(elementTarget).removeClass( elementAnimateIn + ' ' + elementAnimateOut + ' animated' ); 507 } 508 if( element.hasClass('enable-cookie') ) { 509 $.cookie( elementTargetValue, '0' ); 510 } 511 } 512 } 513 }, 0); 514 }, Number(elementDelay) ); 515 516 if( elementTimeout != '' ) { 517 var to = setTimeout(function() { 518 $.magnificPopup.close(); 519 }, Number(elementDelay) + Number(elementTimeout) ); 520 } 521 }); 522 } 523 }, 524 525 resizeVideos: function(){ 526 527 if( !$().fitVids ) { 528 console.log('resizeVideos: FitVids not Defined.'); 529 return true; 530 } 531 532 $("#content,#footer,.slider-element:not(.revslider-wrap),.landing-offer-media,.portfolio-ajax-modal,.mega-menu-column").fitVids({ 533 customSelector: "iframe[src^='http://www.dailymotion.com/embed'], iframe[src*='maps.google.com'], iframe[src*='google.com/maps']", 534 ignore: '.no-fv' 535 }); 536 }, 537 538 imageFade: function(){ 539 $('.image_fade').hover( function(){ 540 $(this).filter(':not(:animated)').animate({opacity: 0.8}, 400); 541 }, function() { 542 $(this).animate({opacity: 1}, 400); 543 }); 544 }, 545 546 blogTimelineEntries: function(){ 547 $('.post-timeline.grid-2').find('.entry').each( function(){ 548 var position = $(this).inlineStyle('left'); 549 if( position == '0px' ) { 550 $(this).removeClass('alt'); 551 } else { 552 $(this).addClass('alt'); 553 } 554 $(this).find('.entry-timeline').fadeIn(); 555 }); 556 557 $('.entry.entry-date-section').next().next().find('.entry-timeline').css({ 'top': '70px' }); 558 }, 559 560 pageTransition: function(){ 561 if( $body.hasClass('no-transition') ) { return true; } 562 563 if( !$().animsition ) { 564 $body.addClass('no-transition'); 565 console.log('pageTransition: Animsition not Defined.'); 566 return true; 567 } 568 569 window.onpageshow = function(event) { 570 if(event.persisted) { 571 window.location.reload(); 572 } 573 }; 574 575 var animationIn = $body.attr('data-animation-in'), 576 animationOut = $body.attr('data-animation-out'), 577 durationIn = $body.attr('data-speed-in'), 578 durationOut = $body.attr('data-speed-out'), 579 timeOutActive = false, 580 loaderTimeOut = $body.attr('data-loader-timeout'), 581 loaderStyle = $body.attr('data-loader'), 582 loaderColor = $body.attr('data-loader-color'), 583 loaderStyleHtml = $body.attr('data-loader-html'), 584 loaderBgStyle = '', 585 loaderBorderStyle = '', 586 loaderBgClass = '', 587 loaderBorderClass = '', 588 loaderBgClass2 = '', 589 loaderBorderClass2 = ''; 590 591 if( !animationIn ) { animationIn = 'fadeIn'; } 592 if( !animationOut ) { animationOut = 'fadeOut'; } 593 if( !durationIn ) { durationIn = 1500; } 594 if( !durationOut ) { durationOut = 800; } 595 if( !loaderStyleHtml ) { loaderStyleHtml = '<div class="css3-spinner-bounce1"></div><div class="css3-spinner-bounce2"></div><div class="css3-spinner-bounce3"></div>'; } 596 597 if( !loaderTimeOut ) { 598 timeOutActive = false;
599 loaderTimeOut = false; 600 } else { 601 timeOutActive = true; 602 loaderTimeOut = Number(loaderTimeOut); 603 } 604 605 if( loaderColor ) { 606 if( loaderColor == 'theme' ) { 607 loaderBgClass = ' bgcolor'; 608 loaderBorderClass = ' border-color'; 609 loaderBgClass2 = ' class="bgcolor"'; 610 loaderBorderClass2 = ' class="border-color"'; 611 } else { 612 loaderBgStyle = ' style="background-color:'+ loaderColor +';"'; 613 loaderBorderStyle = ' style="border-color:'+ loaderColor +';"'; 614 } 615 loaderStyleHtml = '<div class="css3-spinner-bounce1'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-bounce2'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-bounce3'+ loaderBgClass +'"'+ loaderBgStyle +'></div>' 616 } 617 618 if( loaderStyle == '2' ) { 619 loaderStyleHtml = '<div class="css3-spinner-flipper'+ loaderBgClass +'"'+ loaderBgStyle +'></div>'; 620 } else if( loaderStyle == '3' ) { 621 loaderStyleHtml = '<div class="css3-spinner-double-bounce1'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-double-bounce2'+ loaderBgClass +'"'+ loaderBgStyle +'></div>'; 622 } else if( loaderStyle == '4' ) { 623 loaderStyleHtml = '<div class="css3-spinner-rect1'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-rect2'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-rect3'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-rect4'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-rect5'+ loaderBgClass +'"'+ loaderBgStyle +'></div>'; 624 } else if( loaderStyle == '5' ) { 625 loaderStyleHtml = '<div class="css3-spinner-cube1'+ loaderBgClass +'"'+ loaderBgStyle +'></div><div class="css3-spinner-cube2'+ loaderBgClass +'"'+ loaderBgStyle +'></div>'; 626 } else if( loaderStyle == '6' ) { 627 loaderStyleHtml = '<div class="css3-spinner-scaler'+ loaderBgClass +'"'+ loaderBgStyle +'></div>'; 628 } else if( loaderStyle == '7' ) { 629 loaderStyleHtml = '<div class="css3-spinner-grid-pulse"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 630 } else if( loaderStyle == '8' ) { 631 loaderStyleHtml = '<div class="css3-spinner-clip-rotate"><div'+ loaderBorderClass2 + loaderBorderStyle +'></div></div>'; 632 } else if( loaderStyle == '9' ) { 633 loaderStyleHtml = '<div class="css3-spinner-ball-rotate"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 634 } else if( loaderStyle == '10' ) { 635 loaderStyleHtml = '<div class="css3-spinner-zig-zag"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 636 } else if( loaderStyle == '11' ) { 637 loaderStyleHtml = '<div class="css3-spinner-triangle-path"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 638 } else if( loaderStyle == '12' ) { 639 loaderStyleHtml = '<div class="css3-spinner-ball-scale-multiple"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 640 } else if( loaderStyle == '13' ) { 641 loaderStyleHtml = '<div class="css3-spinner-ball-pulse-sync"><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div><div'+ loaderBgClass2 + loaderBgStyle +'></div></div>'; 642 } else if( loaderStyle == '14' ) { 643 loaderStyleHtml = '<div class="css3-spinner-scale-ripple"><div'+ loaderBorderClass2 + loaderBorderStyle +'></div><div'+ loaderBorderClass2 + loaderBorderStyle +'></div><div'+ loaderBorderClass2 + loaderBorderStyle +'></div></div>'; 644 } 645 /* Removed Pre-loader */ 646 /*$wrapper.animsition({ 647 inClass: animationIn,
648 outClass: animationOut, 649 inDuration: Number(durationIn), 650 outDuration: Number(durationOut), 651 //linkElement: '#primary-menu:not(.on-click) ul li a:not([target="_blank"]):not([href*="#"]):not([data-lightbox]):not([href^="mailto"]):not([href^="tel"]):not([href^="sms"]):not([href^="call"])', 652 loading: true, 653 loadingParentElement: 'body', 654 loadingClass: 'css3-spinner', 655 loadingInner: loaderStyleHtml, 656 timeout: timeOutActive, 657 timeoutCountdown: loaderTimeOut, 658 onLoadEvent: true, 659 browser: [ 'animation-duration', '-webkit-animation-duration'], 660 overlay: false, 661 overlayClass: 'animsition-overlay-slide', 662 overlayParentElement: 'body' 663 }); */ 664 }, 665 666 lazyLoad: function() { 667 var lazyLoadEl = $('[data-lazyload]'); 668 669 if( !$().appear ) { 670 console.log('lazyLoad: Appear not Defined.'); 671 return true; 672 } 673 674 if( lazyLoadEl.length > 0 ) { 675 lazyLoadEl.each( function(){ 676 var element = $(this), 677 elementImg = element.attr( 'data-lazyload' ); 678 679 element.attr( 'src', 'images/blank.svg' ).css({ 'background': 'url(images/preloader.gif) no-repeat center center #FFF' }); 680 681 element.appear(function () { 682 element.css({ 'background': 'none' }).removeAttr( 'width' ).removeAttr( 'height' ).attr('src', elementImg); 683 },{accX: 0, accY: 120},'easeInCubic'); 684 }); 685 } 686 }, 687 688 topScrollOffset: function() { 689 /*var topOffsetScroll = 0; 690 691 if( ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) && !SEMICOLON.isMobile.any() ) { 692 if( $header.hasClass('sticky-header') ) { 693 if( $pagemenu.hasClass('dots-menu') ) { topOffsetScroll = 100; } else { topOffsetScroll = 144; } 694 } else { 695 if( $pagemenu.hasClass('dots-menu') ) { topOffsetScroll = 140; } else { topOffsetScroll = 184; } 696 } 697 698 if( !$pagemenu.length ) { 699 if( $header.hasClass('sticky-header') ) { topOffsetScroll = 100; } else { topOffsetScroll = 140; } 700 } 701 } else { 702 topOffsetScroll = 40; 703 } 704 705 return topOffsetScroll; */ 706 }, 707 708 defineColumns: function( element ){ 709 var column = 4, 710 xlCol = element.attr('data-xl-col'), 711 lgCol = element.attr('data-lg-col'), 712 mdCol = element.attr('data-md-col'), 713 smCol = element.attr('data-sm-col'), 714 xsCol = element.attr('data-xs-col'); 715 716 if( element.hasClass('portfolio-full') ) { 717 if( element.hasClass('portfolio-3') ) column = 3; 718 else if( element.hasClass('portfolio-5') ) column = 5; 719 else if( element.hasClass('portfolio-6') ) column = 6; 720 else column = 4; 721 722 if( $body.hasClass('device-md') && ( column == 4 || column == 5 || column == 6 ) ) { 723 column = 3; 724 } else if( $body.hasClass('device-sm') && ( column == 3 || column == 4 || column == 5 || column == 6 ) ) { 725 column = 2; 726 } else if( $body.hasClass('device-xs') ) { 727 column = 1; 728 } 729 730 } else if( element.hasClass('masonry-thumbs') ) { 731 732 if( element.hasClass('grid-2') ) column = 2; 733 else if( element.hasClass('grid-3') ) column = 3; 734 else if( element.hasClass('grid-5') ) column = 5; 735 else if( element.hasClass('grid-6') ) column = 6; 736 else column = 4; 737 738 } 739 740 if( $body.hasClass('device-xl') ) { 741 if( xlCol ) { column = Number(xlCol); } 742 } else if( $body.hasClass('device-lg') ) { 743 if( lgCol ) { column = Number(lgCol); } 744 } else if( $body.hasClass('device-md') ) { 745 if( mdCol ) { column = Number(mdCol); } 746 } else if( $body.hasClass('device-sm') ) { 747 if( smCol ) { column = Number(smCol); } 748 } else if( $body.hasClass('device-xs') ) { 749 if( xsCol ) { column = Number(xsCol); } 750 } 751 752 return column; 753 }, 754 755 setFullColumnWidth: function( element ){ 756 757 if( !$().isotope ) { 758 console.log('setFullColumnWidth: Isotope not Defined.'); 759 return true; 760 } 761 762 element.css({ 'width': '' }); 763 764 if( element.hasClass('portfolio-full') ) { 765 var columns = SEMICOLON.initialize.defineColumns( element ), 766 containerWidth = element.width(), 767 postWidth = Math.floor(containerWidth/columns); 768 if( $body.hasClass('device-xs') ) { var deviceSmallest = 1; } else { var deviceSmallest = 0; } 769 element.find(".portfolio-item").each(function(index){ 770 if( deviceSmallest == 0 && $(this).hasClass('wide') ) { var elementSize = ( postWidth*2 ); } else { var elementSize = postWidth; } 771 $(this).css({"width":elementSize+"px"}); 772 }); 773 } else if( element.hasClass('masonry-thumbs') ) { 774 var columns = SEMICOLON.initialize.defineColumns( element ), 775 containerWidth = element.innerWidth(); 776 777 if( containerWidth == windowWidth ){ 778 containerWidth = windowWidth*1.005; 779 element.css({ 'width': containerWidth+'px' }); 780 } 781 782 var postWidth = (containerWidth/columns); 783 784 postWidth = Math.floor(postWidth); 785 786 if( ( postWidth * columns ) >= containerWidth ) { element.css({ 'margin-right': '-1px' }); } 787 788 element.children('a').css({"width":postWidth+"px"}); 789 790 var firstElementWidth = element.find('a:eq(0)').outerWidth(); 791 792 element.isotope({ 793 masonry: { 794 columnWidth: firstElementWidth 795 } 796 }); 797 798 var bigImageNumbers = element.attr('data-big'); 799 if( bigImageNumbers ) { 800 bigImageNumbers = bigImageNumbers.split(","); 801 var bigImageNumber = '', 802 bigi = ''; 803 for( bigi = 0; bigi < bigImageNumbers.length; bigi++ ){ 804 bigImageNumber = Number(bigImageNumbers[bigi]) - 1; 805 element.find('a:eq('+bigImageNumber+')').css({ width: firstElementWidth*2 + 'px' }); 806 } 807 var t = setTimeout( function(){ 808 element.isotope('layout'); 809 }, 1000 ); 810 } 811 } 812 813 }, 814 815 aspectResizer: function(){ 816 var $aspectResizerEl = $('.aspect-resizer'); 817 if( $aspectResizerEl.length > 0 ) { 818 $aspectResizerEl.each( function(){ 819 var element = $(this), 820 elementW = element.inlineStyle('width'), 821 elementH = element.inlineStyle('height'), 822 elementPW = element.parent().innerWidth(); 823 }); 824 } 825 }, 826 827 dataResponsiveClasses: function(){ 828 var $dataClassXs = $('[data-class-xs]'), 829 $dataClassSm = $('[data-class-sm]'), 830 $dataClassMd = $('[data-class-md]'), 831 $dataClassLg = $('[data-class-lg]'), 832 $dataClassXl = $('[data-class-xl]'); 833 834 if( $dataClassXs.length > 0 ) { 835 $dataClassXs.each( function(){ 836 var element = $(this), 837 elementClass = element.attr('data-class-xs'), 838 elementClassDelete = element.attr('data-class-sm') + ' ' + element.attr('data-class-md') + ' ' + element.attr('data-class-lg') + ' ' + element.attr('data-class-xl'); 839 840 if( $body.hasClass('device-xs') ) { 841 element.removeClass( elementClassDelete ); 842 element.addClass( elementClass ); 843 } 844 }); 845 } 846 847 if( $dataClassSm.length > 0 ) { 848 $dataClassSm.each( function(){ 849 var element = $(this), 850 elementClass = element.attr('data-class-sm'), 851 elementClassDelete = element.attr('data-class-xs') + ' ' + element.attr('data-class-md') + ' ' + element.attr('data-class-lg') + ' ' + element.attr('data-class-xl'); 852 853 if( $body.hasClass('device-sm') ) { 854 element.removeClass( elementClassDelete ); 855 element.addClass( elementClass ); 856 } 857 }); 858 } 859 860 if( $dataClassMd.length > 0 ) { 861 $dataClassMd.each( function(){ 862 var element = $(this), 863 elementClass = element.attr('data-class-md'), 864 elementClassDelete = element.attr('data-class-xs') + ' ' + element.attr('data-class-sm') + ' ' + element.attr('data-class-lg') + ' ' + element.attr('data-class-xl'); 865 866 if( $body.hasClass('device-md') ) { 867 element.removeClass( elementClassDelete ); 868 element.addClass( elementClass ); 869 } 870 }); 871 } 872 873 if( $dataClassLg.length > 0 ) { 874 $dataClassLg.each( function(){ 875 var element = $(this), 876 elementClass = element.attr('data-class-lg'), 877 elementClassDelete = element.attr('data-class-xs') + ' ' + element.attr('data-class-sm') + ' ' + element.attr('data-class-md') + ' ' + element.attr('data-class-xl'); 878 879 if( $body.hasClass('device-lg') ) { 880 element.removeClass( elementClassDelete ); 881 element.addClass( elementClass ); 882 } 883 }); 884 } 885 886 if( $dataClassXl.length > 0 ) { 887 $dataClassXl.each( function(){ 888 var element = $(this), 889 elementClass = element.attr('data-class-xl'), 890 elementClassDelete = element.attr('data-class-xs') + ' ' + element.attr('data-class-sm') + ' ' + element.attr('data-class-md') + ' ' + element.attr('data-class-lg'); 891 892 if( $body.hasClass('device-xl') ) { 893 element.removeClass( elementClassDelete ); 894 element.addClass( elementClass ); 895 } 896 }); 897 } 898 }, 899 900 dataResponsiveHeights: function(){ 901 var $dataHeightXs = $('[data-height-xs]'), 902 $dataHeightSm = $('[data-height-sm]'), 903 $dataHeightMd = $('[data-height-md]'), 904 $dataHeightLg = $('[data-height-lg]'), 905 $dataHeightXl = $('[data-height-xl]'); 906 907 if( $dataHeightXs.length > 0 ) { 908 $dataHeightXs.each( function(){ 909 var element = $(this), 910 elementHeight = element.attr('data-height-xs'); 911 912 if( $body.hasClass('device-xs') ) { 913 if( elementHeight != '' ) { element.css( 'height', elementHeight ); } 914 } 915 }); 916 } 917 918 if( $dataHeightSm.length > 0 ) { 919 $dataHeightSm.each( function(){ 920 var element = $(this), 921 elementHeight = element.attr('data-height-sm'); 922 923 if( $body.hasClass('device-sm') ) { 924 if( elementHeight != '' ) { element.css( 'height', elementHeight ); } 925 } 926 }); 927 } 928 929 if( $dataHeightMd.length > 0 ) { 930 $dataHeightMd.each( function(){ 931 var element = $(this), 932 elementHeight = element.attr('data-height-md'); 933 934 if( $body.hasClass('device-md') ) { 935 if( elementHeight != '' ) { element.css( 'height', elementHeight ); } 936 } 937 }); 938 } 939 940 if( $dataHeightLg.length > 0 ) { 941 $dataHeightLg.each( function(){ 942 var element = $(this), 943 elementHeight = element.attr('data-height-lg'); 944 945 if( $body.hasClass('device-lg') ) { 946 if( elementHeight != '' ) { element.css( 'height', elementHeight ); } 947 } 948 }); 949 } 950 951 if( $dataHeightXl.length > 0 ) { 952 $dataHeightXl.each( function(){ 953 var element = $(this), 954 elementHeight = element.attr('data-height-xl'); 955 956 if( $body.hasClass('device-xl') ) { 957 if( elementHeight != '' ) { element.css( 'height', elementHeight ); } 958 } 959 }); 960 } 961 }, 962 963 stickFooterOnSmall: function(){ 964 $footer.css({ 'margin-top': '' }); 965 var windowH = $window.height(), 966 wrapperH = $wrapper.height(); 967 968 if( !$body.hasClass('sticky-footer') && $footer.length > 0 && $wrapper.has('#footer') ) { 969 if( windowH > wrapperH ) { 970 $footer.css({ 'margin-top': ( windowH - wrapperH ) }); 971 } 972 } 973 }, 974 975 stickyFooter: function(){ 976 if( $body.hasClass('sticky-footer') && $footer.length > 0 && ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) ) { 977 var stickyFooter = $footer.outerHeight(); 978 $content.css({ 'margin-bottom': stickyFooter }); 979 } else { 980 $content.css({ 'margin-bottom': 0 }); 981 } 982 } 983 984 }; 985 986 SEMICOLON.header = { 987 988 init: function(){ 989 990 SEMICOLON.header.superfish(); 991 SEMICOLON.header.menufunctions(); 992 SEMICOLON.header.fullWidthMenu(); 993 SEMICOLON.header.overlayMenu(); 994 SEMICOLON.header.stickyMenu(); 995 SEMICOLON.header.stickyPageMenu(); 996 SEMICOLON.header.sideHeader(); 997 SEMICOLON.header.sidePanel(); 998 SEMICOLON.header.onePageScroll(); 999 SEMICOLON.header.onepageScroller(); 1000 SEMICOLON.header.logo(); 1001 SEMICOLON.header.topsearch(); 1002 SEMICOLON.header.topcart(); 1003 1004 }, 1005 1006 superfish: function(){ 1007 1008 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1009 $('#primary-menu ul ul, #primary-menu ul .mega-menu-content').css('display', 'block'); 1010 SEMICOLON.header.menuInvert(); 1011 $('#primary-menu ul ul, #primary-menu ul .mega-menu-content').css('display', ''); 1012 } 1013 1014 if( !$().superfish ) { 1015 $body.addClass('no-superfish'); 1016 console.log('superfish: Superfish not Defined.'); 1017 return true; 1018 } 1019 1020 $('body:not(.side-header) #primary-menu:not(.on-click) > ul, body:not(.side-header) #primary-menu:not(.on-click) > div > ul:not(.dropdown-menu), .top-links:not(.on-click) > ul').superfish({ 1021 popUpSelector: 'ul,.mega-menu-content,.top-link-section', 1022 delay: 1000, 1023 speed: 350, 1024 animation: {opacity:'show'}, 1025 animationOut: {opacity:'hide'},
1026 cssArrows: false, 1027 onShow: function(){ 1028 var megaMenuContent = $(this); 1029 if( megaMenuContent.find('.owl-carousel.customjs').length > 0 ) { 1030 megaMenuContent.find('.owl-carousel').removeClass('customjs'); 1031 SEMICOLON.widget.carousel(); 1032 } 1033 1034 if( megaMenuContent.hasClass('mega-menu-content') && megaMenuContent.find('.widget').length > 0 ) { 1035 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1036 setTimeout( function(){ SEMICOLON.initialize.commonHeight( megaMenuContent ); }, 200); 1037 } else { 1038 megaMenuContent.children().height(''); 1039 } 1040 } 1041 } 1042 }); 1043 1044 $('body.side-header #primary-menu:not(.on-click) > ul').superfish({ 1045 popUpSelector: 'ul', 1046 delay: 250, 1047 1048 speed: 350, 1049 animation: {opacity:'show',height:'show'}, 1050 animationOut: {opacity:'hide',height:'hide'}, 1051 cssArrows:false 1052 }); 1053 1054 }, 1055 1056 menuInvert: function() { 1057 1058 $('#primary-menu .mega-menu-content, #primary-menu ul ul').each( function( index, element ){ 1059 var $menuChildElement = $(element), 1060 menuChildOffset = $menuChildElement.offset(), 1061 menuChildWidth = $menuChildElement.width(), 1062 menuChildLeft = menuChildOffset.left; 1063 1064 if(windowWidth - (menuChildWidth + menuChildLeft) < 0) { 1065 $menuChildElement.addClass('menu-pos-invert'); 1066 } 1067 }); 1068 1069 }, 1070 1071 menufunctions: function(){ 1072 1073 console.log("Menu function called"); 1074 $( '#primary-menu ul li:has(ul)' ).addClass('sub-menu'); 1075 $( '.top-links ul li:has(ul) > a, #primary-menu.with-arrows > ul > li:has(ul) > a > div, #primary-menu.with-arrows > div > ul > li:has(ul) > a > div, #page-menu nav ul li:has(ul) > a > div' ).append( '<i class="icon-angle-down"></i>' ); 1076 $( '.top-links > ul' ).addClass( 'clearfix' ); 1077 1078 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1079 $('#primary-menu.sub-title > ul > li').hover(function() { 1080 $(this).prev().css({ backgroundImage : 'none' }); 1081 }, function() { 1082 $(this).prev().css({ backgroundImage : 'url("images/icons/menu-divider.png")' }); 1083 }); 1084 1085 $('#primary-menu.sub-title').children('ul').children('.current').prev().css({ backgroundImage : 'none' }); 1086 } 1087 1088 $('#primary-menu.on-click li:has(ul) > a').on( 'click', function(e){ 1089 console.log("sub menu clicked"); 1090 $(this).parents('.sub-menu').siblings().find('ul,.mega-menu-content').removeClass('d-block'); 1091 $(this).parent('li').children('ul,.mega-menu-content').toggleClass('d-block'); 1092 console.log("Event "+e); 1093 e.preventDefault(); 1094 }); 1095 1096 // var responsiveThreshold = $header.attr('data-responsive-under'); 1097 // if( !responsiveThreshold ) { responsiveThreshold = 992; } 1098 1099 // if( windowWidth < Number( responsiveThreshold ) ) { 1100 // $body.addClass('mobile-header-active'); 1101 // } else { 1102 // $body.removeClass('mobile-header-active'); 1103 // } 1104 1105 if( SEMICOLON.isMobile.Android() ) { 1106 $( '#primary-menu ul li.sub-menu' ).children('a').on('touchstart', function(e){ 1107 if( !$(this).parent('li.sub-menu').hasClass('sfHover') ) { 1108 e.preventDefault(); 1109 } 1110 }); 1111 } 1112 1113 if( SEMICOLON.isMobile.Windows() ) { 1114 if( $().superfish ){ 1115 $('#primary-menu > ul, #primary-menu > div > ul,.top-links > ul').superfish('destroy').addClass('windows-mobile-menu'); 1116 } else { 1117 $('#primary-menu > ul, #primary-menu > div > ul,.top-links > ul').addClass('windows-mobile-menu'); 1118 console.log('menufunctions: Superfish not defined.'); 1119 } 1120 1121 $( '#primary-menu ul li:has(ul)' ).append('<a href="#" class="wn-submenu-trigger"><i class="icon-angle-down"></i></a>'); 1122 1123 $( '#primary-menu ul li.sub-menu' ).children('a.wn-submenu-trigger').click( function(e){ 1124 $(this).parent().toggleClass('open'); 1125 $(this).parent().find('> ul, > .mega-menu-content').stop(true,true).toggle(); 1126 return false; 1127 }); 1128 } 1129 1130 }, 1131 1132 fullWidthMenu: function(){ 1133 if( $body.hasClass('stretched') ) { 1134 if( $header.find('.container-fullwidth').length > 0 ) { $('.mega-menu .mega-menu-content').css({ 'width': $wrapper.width() - 120 }); } 1135 if( $header.hasClass('full-header') ) { $('.mega-menu .mega-menu-content').css({ 'width': $wrapper.width() - 60 }); } 1136 } else { 1137 if( $header.find('.container-fullwidth').length > 0 ) { $('.mega-menu .mega-menu-content').css({ 'width': $wrapper.width() - 120 }); } 1138 if( $header.hasClass('full-header') ) { $('.mega-menu .mega-menu-content').css({ 'width': $wrapper.width() - 80 }); } 1139 } 1140 }, 1141 1142 overlayMenu: function(){ 1143 if( $body.hasClass('overlay-menu') ) { 1144 var overlayMenuItem = $('#primary-menu').children('ul').children('li'), 1145 overlayMenuItemHeight = overlayMenuItem.outerHeight(), 1146 overlayMenuItemTHeight = overlayMenuItem.length * overlayMenuItemHeight, 1147 firstItemOffset = ( $window.height() - overlayMenuItemTHeight ) / 2; 1148 1149 $('#primary-menu').children('ul').children('li:first-child').css({ 'margin-top': firstItemOffset+'px' }); 1150 } 1151 }, 1152 1153 stickyMenu: function( headerOffset ){ 1154 if ($window.scrollTop() > headerOffset) { 1155 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1156 $('body:not(.side-header) #header:not(.no-sticky)').addClass('sticky-header'); 1157 $('a.backTop').addClass('show'); 1158 if( !$headerWrap.hasClass('force-not-dark') ) { $headerWrap.removeClass('not-dark'); } 1159 SEMICOLON.header.stickyMenuClass(); 1160 } else if( $body.hasClass('device-sm') || $body.hasClass('device-xs') || $body.hasClass('device-md') ) { 1161 $('a.backTop').addClass('show'); 1162 if( $body.hasClass('sticky-responsive-menu') ) { 1163 $('#header:not(.no-sticky)').addClass('responsive-sticky-header'); 1164 SEMICOLON.header.stickyMenuClass(); 1165 } 1166 } 1167 } else { 1168 SEMICOLON.header.removeStickyness(); 1169 } 1170 }, 1171 1172 1173 stickyPageMenu: function( pageMenuOffset ){ 1174 if ($window.scrollTop() > pageMenuOffset) { 1175 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1176 $('#page-menu:not(.dots-menu,.no-sticky)').addClass('sticky-page-menu'); 1177 } else if( $body.hasClass('device-sm') || $body.hasClass('device-xs') || $body.hasClass('device-md') ) { 1178 if( $body.hasClass('sticky-responsive-pagemenu') ) { 1179 $('#page-menu:not(.dots-menu,.no-sticky)').addClass('sticky-page-menu'); 1180 } 1181 } 1182 } else { 1183 $('#page-menu:not(.dots-menu,.no-sticky)').removeClass('sticky-page-menu'); 1184 } 1185 }, 1186 1187 removeStickyness: function(){ 1188 $('a.backTop').removeClass('show'); 1189 if( $header.hasClass('sticky-header') ){ 1190 $('body:not(.side-header) #header:not(.no-sticky)').removeClass('sticky-header'); 1191 $header.removeClass().addClass(oldHeaderClasses); 1192 $headerWrap.removeClass().addClass(oldHeaderWrapClasses); 1193 if( !$headerWrap.hasClass('force-not-dark') ) { $headerWrap.removeClass('not-dark'); } 1194 SEMICOLON.slider.swiperSliderMenu(); 1195 SEMICOLON.slider.revolutionSliderMenu(); 1196 } 1197 if( $header.hasClass('responsive-sticky-header') ){ 1198 $('body.sticky-responsive-menu #header').removeClass('responsive-sticky-header'); 1199 } 1200 if( ( $body.hasClass('device-sm') || $body.hasClass('device-xs') || $body.hasClass('device-md') ) && ( typeof responsiveMenuClasses === 'undefined' ) ) { 1201 $header.removeClass().addClass(oldHeaderClasses); 1202 $headerWrap.removeClass().addClass(oldHeaderWrapClasses); 1203 if( !$headerWrap.hasClass('force-not-dark') ) { $headerWrap.removeClass('not-dark'); } 1204 } 1205 }, 1206 1207 sideHeader: function(){ 1208 $("#header-trigger").click(function(){ 1209 $('body.open-header').toggleClass("side-header-open"); 1210 return false;
1211 }); 1212 }, 1213 1214 sidePanel: function(){ 1215 $(".side-panel-trigger").click(function(){ 1216 $body.toggleClass("side-panel-open"); 1217 if( $body.hasClass('device-touch') && $body.hasClass('side-push-panel') ) { 1218 $body.toggleClass("ohidden"); 1219 } 1220 return false; 1221 }); 1222 }, 1223 1224 onePageScroll: function(){ 1225 if( $onePageMenuEl.length > 0 ){ 1226 var onePageSpeed = $onePageMenuEl.attr('data-speed'), 1227 onePageOffset = $onePageMenuEl.attr('data-offset'), 1228 onePageEasing = $onePageMenuEl.attr('data-easing'); 1229 1230 if( !onePageSpeed ) { onePageSpeed = 1000; } 1231 if( !onePageEasing ) { onePageEasing = 'easeOutQuad'; } 1232 1233 $onePageMenuEl.find('a[data-href]').click(function(){ 1234 var element = $(this), 1235 divScrollToAnchor = element.attr('data-href'), 1236 divScrollSpeed = element.attr('data-speed'), 1237 divScrollOffset = element.attr('data-offset'), 1238 divScrollEasing = element.attr('data-easing'); 1239 1240 if( $( divScrollToAnchor ).length > 0 ) { 1241 1242 if( !onePageOffset ) { 1243 var onePageOffsetG = SEMICOLON.initialize.topScrollOffset(); 1244 } else { 1245 var onePageOffsetG = onePageOffset; 1246 } 1247 1248 if( !divScrollSpeed ) { divScrollSpeed = onePageSpeed; } 1249 if( !divScrollOffset ) { divScrollOffset = onePageOffsetG; } 1250 if( !divScrollEasing ) { divScrollEasing = onePageEasing; } 1251 1252 if( $onePageMenuEl.hasClass('no-offset') ) { divScrollOffset = 0; } 1253 1254 onePageGlobalOffset = Number(divScrollOffset); 1255 1256 $onePageMenuEl.find('li').removeClass('current'); 1257 $onePageMenuEl.find('a[data-href="' + divScrollToAnchor + '"]').parent('li').addClass('current'); 1258 1259 if( windowWidth < 768 || $body.hasClass('overlay-menu') ) { 1260 if( $('#primary-menu').find('ul.mobile-primary-menu').length > 0 ) { 1261 $('#primary-menu > ul.mobile-primary-menu, #primary-menu > div > ul.mobile-primary-menu').toggleClass('d-block', false); 1262 } else { 1263 $('#primary-menu > ul, #primary-menu > div > ul').toggleClass('d-block', false); 1264 } 1265 $pagemenu.toggleClass('pagemenu-active', false); 1266 $body.toggleClass('primary-menu-open', false); 1267 } 1268 1269 $('html,body').stop(true).animate({ 1270 'scrollTop': $( divScrollToAnchor ).offset().top - Number(divScrollOffset) 1271 }, Number(divScrollSpeed), divScrollEasing); 1272 1273 onePageGlobalOffset = Number(divScrollOffset); 1274 } 1275 1276 return false; 1277 }); 1278 } 1279 }, 1280 1281 onepageScroller: function(){ 1282 $onePageMenuEl.find('li').removeClass('current'); 1283 $onePageMenuEl.find('a[data-href="#' + SEMICOLON.header.onePageCurrentSection() + '"]').parent('li').addClass('current'); 1284 }, 1285 1286 onePageCurrentSection: function(){ 1287 var currentOnePageSection = 'home', 1288 headerHeight = $headerWrap.outerHeight(); 1289 1290 if( $body.hasClass('side-header') ) { headerHeight = 0; } 1291 1292 $pageSectionEl.each(function(index) { 1293 var h = $(this).offset().top; 1294 var y = $window.scrollTop(); 1295 1296 var offsetScroll = headerHeight + onePageGlobalOffset; 1297 1298 if( y + offsetScroll >= h && y < h + $(this).height() && $(this).attr('id') != currentOnePageSection ) { 1299 currentOnePageSection = $(this).attr('id'); 1300 } 1301 }); 1302 1303 return currentOnePageSection; 1304 }, 1305 1306 logo: function(){ 1307 if( ( $header.hasClass('dark') || $body.hasClass('dark') ) && !$headerWrap.hasClass('not-dark') ) { 1308 if( defaultDarkLogo ){ defaultLogo.find('img').attr('src', defaultDarkLogo); } 1309 if( retinaDarkLogo ){ retinaLogo.find('img').attr('src', retinaDarkLogo); } 1310 } else { 1311 if( defaultLogoImg ){ defaultLogo.find('img').attr('src', defaultLogoImg); } 1312 if( retinaLogoImg ){ retinaLogo.find('img').attr('src', retinaLogoImg); } 1313 } 1314 if( $header.hasClass('sticky-header') ) { 1315 if( defaultStickyLogo ){ defaultLogo.find('img').attr('src', defaultStickyLogo); } 1316 if( retinaStickyLogo ){ retinaLogo.find('img').attr('src', retinaStickyLogo); } 1317 } 1318 if( $body.hasClass('device-sm') || $body.hasClass('device-xs') ) { 1319 if( defaultMobileLogo ){ defaultLogo.find('img').attr('src', defaultMobileLogo); } 1320 if( retinaMobileLogo ){ retinaLogo.find('img').attr('src', retinaMobileLogo); } 1321 } 1322 }, 1323 1324 stickyMenuClass: function(){ 1325 if( stickyMenuClasses ) { var newClassesArray = stickyMenuClasses.split(/ +/); } else { var newClassesArray = ''; } 1326 var noOfNewClasses = newClassesArray.length; 1327 1328 if( noOfNewClasses > 0 ) { 1329 var i = 0; 1330 for( i=0; i<noOfNewClasses; i++ ) { 1331 if( newClassesArray[i] == 'not-dark' ) { 1332 $header.removeClass('dark'); 1333 $headerWrap.addClass('not-dark'); 1334 }
1334 else if( newClassesArray[i] == 'dark' ) { 1335 $headerWrap.removeClass('not-dark force-not-dark'); 1336 if( !$header.hasClass( newClassesArray[i] ) ) { 1337 $header.addClass( newClassesArray[i] ); 1338 } 1339 } else if( !$header.hasClass( newClassesArray[i] ) ) { 1340 $header.addClass( newClassesArray[i] ); 1341 } 1342 } 1343 } 1344 }, 1345 1346 responsiveMenuClass: function(){ 1347 if( $body.hasClass('device-sm') || $body.hasClass('device-xs') || $body.hasClass('device-md') ){ 1348 if( responsiveMenuClasses ) { var newClassesArray = responsiveMenuClasses.split(/ +/); } else { var newClassesArray = ''; } 1349 var noOfNewClasses = newClassesArray.length; 1350 1351 if( noOfNewClasses > 0 ) { 1352 var i = 0; 1353 for( i=0; i<noOfNewClasses; i++ ) { 1354 if( newClassesArray[i] == 'not-dark' ) { 1355 $header.removeClass('dark'); 1356 $headerWrap.addClass('not-dark'); 1357 } else if( newClassesArray[i] == 'dark' ) { 1358 $headerWrap.removeClass('not-dark force-not-dark'); 1359 if( !$header.hasClass( newClassesArray[i] ) ) { 1360 $header.addClass( newClassesArray[i] ); 1361 } 1362 } else if( !$header.hasClass( newClassesArray[i] ) ) { 1363 $header.addClass( newClassesArray[i] ); 1364 } 1365 } 1366 } 1367 SEMICOLON.header.logo(); 1368 } 1369 }, 1370 1371 topsocial: function(){ 1372 if( $topSocialEl.length > 0 ){ 1373 if( $body.hasClass('device-lg') || $body.hasClass('device-xl') ) { 1374 $topSocialEl.show(); 1375 $topSocialEl.find('a').css({width: 40}); 1376 1377 $topSocialEl.find('.ts-text').each( function(){ 1378 var $clone = $(this).clone().css({'visibility': 'hidden', 'display': 'inline-block', 'font-size': '13px', 'font-weight':'bold'}).appendTo($body), 1379 cloneWidth = $clone.innerWidth() + 52; 1380 $(this).parent('a').attr('data-hover-width',cloneWidth); 1381 $clone.remove(); 1382 }); 1383 1384 $topSocialEl.find('a').hover(function() { 1385 if( $(this).find('.ts-text').length > 0 ) { 1386 $(this).css({width: $(this).attr('data-hover-width')}); 1387 } 1388 }, function() { 1389 $(this).css({width: 40}); 1390 }); 1391 } else { 1392 $topSocialEl.show(); 1393 $topSocialEl.find('a').css({width: 40}); 1394 1395 $topSocialEl.find('a').each(function() { 1396 var topIconTitle = $(this).find('.ts-text').text(); 1397 $(this).attr('title', topIconTitle); 1398 }); 1399 1400 $topSocialEl.find('a').hover(function() { 1401 $(this).css({width: 40}); 1402 }, function() { 1403 $(this).css({width: 40}); 1404 }); 1405 1406 if( $body.hasClass('device-xs') ) { 1407 $topSocialEl.hide(); 1408 $topSocialEl.slice(0, 8).show(); 1409 } 1410 } 1411 } 1412 }, 1413 1414 topsearch: function(){ 1415 1416 /* ==== Function to click anywhere on the screen and have the search field revert back === 1417 $(document).on('click', function(event) { 1418 if (!$(event.target).closest('#top-search').length) { $body.toggleClass('top-search-open', false); } 1419 if (!$(event.target).closest('#top-cart').length) { $topCart.toggleClass('top-cart-open', false); } 1420 if (!$(event.target).closest('#page-menu').length) { $pagemenu.toggleClass('pagemenu-active', false); } 1421 if (!$(event.target).closest('#side-panel').length) { $body.toggleClass('side-panel-open', false); } 1422 if (!$(event.target).closest('#primary-menu').length) { $('#primary-menu.on-click > ul').find('.d-block').removeClass('d-block'); } 1423 if (!$(event.target).closest('#primary-menu.mobile-menu-off-canvas > ul').length) { $('#primary-menu.mobile-menu-off-canvas > ul').toggleClass('show', false); } 1424 if (!$(event.target).closest('#primary-menu.mobile-menu-off-canvas > div > ul').length) { $('#primary-menu.mobile-menu-off-canvas > div > ul').toggleClass('show', false); } 1425 }); 1426 */ 1427 1428 $("#top-search-trigger").mousedown(function(e) { 1429 e.preventDefault(); // don't grab focus 1430 }).click(function(e){ 1431 e.stopImmediatePropagation(); 1432 $body.toggleClass('top-search-open'); 1433 $topCart.toggleClass('top-cart-open', false); 1434 $( '#primary-menu > ul, #primary-menu > div > ul, #primary-menu .contentArea' ).toggleClass('d-block', false); 1435 $pagemenu.toggleClass('pagemenu-active', false); 1436 if ($body.hasClass('top-search-open')){ 1437 $topSearch.find('input').focus(); 1438 } 1439 1440 e.stopPropagation(); 1441 e.preventDefault(); 1442 }).focusin(function(e){ 1443 $body.addClass('top-search-open'); 1444 $topCart.addClass('top-cart-open', false); 1445 $( '#primary-menu > ul, #primary-menu > div > ul, #primary-menu .contentArea' ).addClass('d-block', false); 1446 $pagemenu.addClass('pagemenu-active', false); 1447 if ($body.hasClass('top-search-open')){ 1448 $topSearch.find('input').focus(); 1449 } 1450 1451 e.stopPropagation(); 1452 e.preventDefault(); 1453 }); 1454 1455 $topSearch.find('input').focusout(function(e){ 1456 $body.removeClass('top-search-open'); 1457 $( '#primary-menu > ul, #primary-menu > div > ul, #primary-menu .contentArea' ).removeClass('d-block', false); 1458 $pagemenu.toggleClass('pagemenu-active', false); 1459 }); 1460 1461 $('#searchTrap').focusin(function(e){ 1462 console.log('Focus Trap'); 1463 $('#primary-menu ul > li:last-child a').focus(); 1464 }); 1465 $('primary-menu ul > li:last-child a').focusin(function(e) { 1466 console.log('Menu Last Item Focused'); 1467 }); 1468 1469 }, 1470 1471 topcart: function(){ 1472 1473 $("#top-cart-trigger").click(function(e){ 1474 $pagemenu.toggleClass('pagemenu-active', false); 1475 $topCart.toggleClass('top-cart-open'); 1476 e.stopPropagation(); 1477 e.preventDefault(); 1478 }); 1479 1480 1481 } 1482 1483 }; 1484 1485 SEMICOLON.slider = { 1486 1487 init: function() { 1488 1489 SEMICOLON.slider.sliderParallaxDimensions(); 1490 SEMICOLON.slider.sliderRun(); 1491 SEMICOLON.slider.sliderParallax(); 1492 SEMICOLON.slider.sliderElementsFade(); 1493 SEMICOLON.slider.captionPosition(); 1494 1495 }, 1496 sliderParallaxDimensions: function(){ 1497 if( $sliderParallaxEl.find('.slider-parallax-inner').length < 1 ) { return true; } 1498 1499 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') || $body.hasClass('device-md') ) { 1500 var parallaxElHeight = $sliderParallaxEl.outerHeight(), 1501 parallaxElWidth = $sliderParallaxEl.outerWidth(); 1502 1503 if( $sliderParallaxEl.hasClass('revslider-wrap') || $sliderParallaxEl.find('.carousel-widget').length > 0 ) { 1504 parallaxElHeight = $sliderParallaxEl.find('.slider-parallax-inner').children().first().outerHeight(); 1505 $sliderParallaxEl.height( parallaxElHeight ); 1506 } 1507 1508 $sliderParallaxEl.find('.slider-parallax-inner').height( parallaxElHeight ); 1509 1510 if( $body.hasClass('side-header') ) { 1511 $sliderParallaxEl.find('.slider-parallax-inner').width( parallaxElWidth ); 1512 } 1513 1514 if( !$body.hasClass('stretched') ) { 1515 parallaxElWidth = $wrapper.outerWidth(); 1516 $sliderParallaxEl.find('.slider-parallax-inner').width( parallaxElWidth ); 1517 } 1518 } else { 1519 $sliderParallaxEl.find('.slider-parallax-inner').css({ 'width': '', height: '' }); 1520 } 1521
1522 if( swiperSlider ) { swiperSlider.update(); } 1523 }, 1524 1525 sliderRun: function(){ 1526 1527 if( typeof Swiper === 'undefined' ) { 1528 console.log('sliderRun: Swiper not Defined.'); 1529 return true; 1530 } 1531 1532 var $sliderEl = $sliderElement.filter(':not(.customjs)'); 1533 1534 $sliderEl.each( function(){ 1535 if( $(this).hasClass('swiper_wrapper') ) { 1536 1537 var element = $(this).filter('.swiper_wrapper'), 1538 elementDirection = element.attr('data-direction'), 1539 elementSpeed = element.attr('data-speed'), 1540 elementAutoPlay = element.attr('data-autoplay'), 1541 elementLoop = element.attr('data-loop'), 1542 elementEffect = element.attr('data-effect'), 1543 elementGrabCursor = element.attr('data-grab'), 1544 slideNumberTotal = element.find('.slide-number-total'), 1545 slideNumberCurrent = element.find('.slide-number-current'), 1546 sliderVideoAutoPlay = element.attr('data-video-autoplay'); 1547 1548 if( !elementSpeed ) { elementSpeed = 300; } 1549 if( !elementDirection ) { elementDirection = 'horizontal'; } 1550 if( elementAutoPlay ) { elementAutoPlay = Number( elementAutoPlay ); } else { elementAutoPlay = 999999999; } 1551 if( elementLoop == 'true' ) { elementLoop = true; } else { elementLoop = false; } 1552 if( !elementEffect ) { elementEffect = 'slide'; } 1553 if( elementGrabCursor == 'false' ) { elementGrabCursor = false; } else { elementGrabCursor = true; } 1554 if( sliderVideoAutoPlay == 'false' ) { sliderVideoAutoPlay = false; } else { sliderVideoAutoPlay = true; } 1555 1556 if( element.find('.swiper-pagination').length > 0 ) { 1557 var elementPagination = element.find('.swiper-pagination'), 1558 elementPaginationClickable = true; 1559 } else { 1560 var elementPagination = '', 1561 elementPaginationClickable = false; 1562 } 1563 1564 var elementNavNext = element.find('.slider-arrow-right'), 1565 elementNavPrev = element.find('.slider-arrow-left'); 1566 1567 swiperSlider = new Swiper( element.find('.swiper-parent') ,{ 1568 direction: elementDirection, 1569 speed: Number( elementSpeed ), 1570 autoplay: { 1571 delay: elementAutoPlay 1572 }, 1573 loop: elementLoop, 1574 effect: elementEffect, 1575 slidesPerView: 1, 1576 grabCursor: elementGrabCursor, 1577 pagination: { 1578 el: elementPagination, 1579 clickable: elementPaginationClickable 1580 }, 1581 navigation: { 1582 prevEl: elementNavPrev, 1583 nextEl: elementNavNext 1584 }, 1585 on: { 1586 init: function(swiper){ 1587 SEMICOLON.slider.sliderParallaxDimensions(); 1588 element.find('.yt-bg-player').removeClass('customjs'); 1589 SEMICOLON.widget.youtubeBgVideo(); 1590 $('.swiper-slide-active [data-caption-animate]').each(function(){ 1591 var $toAnimateElement = $(this), 1592 toAnimateDelay = $toAnimateElement.attr('data-caption-delay'), 1593 toAnimateDelayTime = 0; 1594 if( toAnimateDelay ) { toAnimateDelayTime = Number( toAnimateDelay ) + 750; } else { toAnimateDelayTime = 750; } 1595 if( !$toAnimateElement.hasClass('animated') ) { 1596 $toAnimateElement.addClass('not-animated'); 1597 var elementAnimation = $toAnimateElement.attr('data-caption-animate'); 1598 setTimeout(function() { 1599 $toAnimateElement.removeClass('not-animated').addClass( elementAnimation + ' animated'); 1600 }, toAnimateDelayTime); 1601 } 1602 }); 1603 element.find('[data-caption-animate]').each(function(){ 1604 var $toAnimateElement = $(this), 1605 elementAnimation = $toAnimateElement.attr('data-caption-animate'); 1606 if( $toAnimateElement.parents('.swiper-slide').hasClass('swiper-slide-active') ) { return true; } 1607 $toAnimateElement.removeClass('animated').removeClass(elementAnimation).addClass('not-animated'); 1608 }); 1609 SEMICOLON.slider.swiperSliderMenu(); 1610 }, 1611 slideChangeTransitionStart: function(swiper){ 1612 if( slideNumberCurrent.length > 0 ){ 1613 if( elementLoop == true ) { 1614 slideNumberCurrent.html( Number( element.find('.swiper-slide.swiper-slide-active').attr('data-swiper-slide-index') ) + 1 ); 1615 } else { 1616 slideNumberCurrent.html( swiperSlider.activeIndex + 1 ); 1617 } 1618 } 1619 element.find('[data-caption-animate]').each(function(){ 1620 var $toAnimateElement = $(this), 1621 elementAnimation = $toAnimateElement.attr('data-caption-animate'); 1622 if( $toAnimateElement.parents('.swiper-slide').hasClass('swiper-slide-active') ) { return true; } 1623 $toAnimateElement.removeClass('animated').removeClass(elementAnimation).addClass('not-animated'); 1624 }); 1625 SEMICOLON.slider.swiperSliderMenu(); 1626 }, 1627 slideChangeTransitionEnd: function(swiper){ 1628 element.find('.swiper-slide').each(function(){ 1629 var slideEl = $(this); 1630 if( slideEl.find('video').length > 0 && sliderVideoAutoPlay == true ) { slideEl.find('video').get(0).pause(); } 1631 if( slideEl.find('.yt-bg-player.mb_YTPlayer:not(.customjs)').length > 0 ) { slideEl.find('.yt-bg-player.mb_YTPlayer:not(.customjs)').YTPPause(); } 1632 if( slideEl.find('a').length > 0 ){ 1633 slideEl.find('a').attr('tabindex', '-1'); 1634 }; 1635 }); 1636 element.find('.swiper-slide:not(".swiper-slide-active")').each(function(){ 1637 var slideEl = $(this); 1638 if( slideEl.find('video').length > 0 ) { 1639 if( slideEl.find('video').get(0).currentTime != 0 ) { slideEl.find('video').get(0).currentTime = 0; } 1640 } 1641 if( slideEl.find('.yt-bg-player.mb_YTPlayer:not(.customjs)').length > 0 ) { 1642 slideEl.find('.yt-bg-player.mb_YTPlayer:not(.customjs)').YTPGetPlayer().seekTo( slideEl.find('.yt-bg-player.mb_YTPlayer:not(.customjs)').attr('data-start') ); 1643 } 1644 }); 1645 if( element.find('.swiper-slide.swiper-slide-active').find('video').length > 0 && sliderVideoAutoPlay == true ) { element.find('.swiper-slide.swiper-slide-active').find('video').get(0).play(); } 1646 if( element.find('.swiper-slide.swiper-slide-active').find('.yt-bg-player.mb_YTPlayer:not(.customjs)').length > 0 && sliderVideoAutoPlay == true ) { element.find('.swiper-slide.swiper-slide-active').find('.yt-bg-player.mb_YTPlayer:not(.customjs)').YTPPlay(); } 1647 1648 element.find('.swiper-slide.swiper-slide-active').each(function() { 1649 var slideEl = $(this); 1650 if (slideEl.find('a').length > 0) { 1651 slideEl.find('a').attr('tabindex', '0'); 1652 }; 1653 }); 1654 element.find('.swiper-slide.swiper-slide-active [data-caption-animate]').each(function(){ 1655 var $toAnimateElement = $(this), 1656 toAnimateDelay = $toAnimateElement.attr('data-caption-delay'), 1657 toAnimateDelayTime = 0; 1658 if( toAnimateDelay ) { toAnimateDelayTime = Number( toAnimateDelay ) + 300; } else { toAnimateDelayTime = 300; } 1659 if( !$toAnimateElement.hasClass('animated') ) { 1660 $toAnimateElement.addClass('not-animated'); 1661 var elementAnimation = $toAnimateElement.attr('data-caption-animate'); 1662 setTimeout(function() { 1663 $toAnimateElement.removeClass('not-animated').addClass( elementAnimation + ' animated'); 1664 }, toAnimateDelayTime); 1665 } 1666 }); 1667 } 1668 } 1669 }); 1670 $('.startSlider').on('click', function(){ 1671 swiperSlider.autoplay.start(); 1672 event.preventDefault(); 1673 }).keypress(function (e) { 1674 var key = e.which; 1675 if(key == 13) // the enter key code 1676 { 1677 swiperSlider.autoplay.start(); 1678 event.preventDefault(); 1679 } 1680 }); 1681 $('.stopSlider').on('click', function(){ 1682 swiperSlider.autoplay.stop(); 1683 event.preventDefault(); 1684 }).keypress(function (e) { 1685 var key = e.which; 1686 if(key == 13) // the enter key code 1687 { 1688 swiperSlider.autoplay.stop(); 1689 event.preventDefault(); 1690 } 1691 }); 1692 if( slideNumberCurrent.length > 0 ) { 1693 if( elementLoop == true ) { 1694 slideNumberCurrent.html( swiperSlider.realIndex + 1 ); 1695 } else { 1696 slideNumberCurrent.html( swiperSlider.activeIndex + 1 ); 1697 } 1698 } 1699 if( slideNumberTotal.length > 0 ) { 1700 slideNumberTotal.html( element.find('.swiper-slide:not(.swiper-slide-duplicate)').length ); 1701 } 1702 1703 } 1704 }); 1705 }, 1706 1707 sliderParallaxOffset: function(){ 1708 var sliderParallaxOffsetTop = 0; 1709 var headerHeight = $header.outerHeight(); 1710 if( $body.hasClass('side-header') || $header.hasClass('transparent-header') ) { headerHeight = 0; } 1711 if( $pageTitle.length > 0 ) { 1712 var pageTitleHeight = $pageTitle.outerHeight(); 1713 sliderParallaxOffsetTop = pageTitleHeight + headerHeight; 1714 } else { 1715 sliderParallaxOffsetTop = headerHeight; 1716 } 1717 1718 if( $slider.next('#header').length > 0 ) { sliderParallaxOffsetTop = 0; } 1719 1720 return sliderParallaxOffsetTop; 1721 }, 1722 1723 sliderParallax: function(){ 1724 1725 if( $sliderParallaxEl.length < 1 ) { return true; } 1726 1727 var parallaxOffsetTop = SEMICOLON.slider.sliderParallaxOffset(), 1728 parallaxElHeight = $sliderParallaxEl.outerHeight(); 1729 1730 if( ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) && !SEMICOLON.isMobile.any() ) { 1731 if( ( parallaxElHeight + parallaxOffsetTop + 50 ) > $window.scrollTop() ){ 1732 $sliderParallaxEl.addClass('slider-parallax-visible').removeClass('slider-parallax-invisible'); 1733 if ($window.scrollTop() > parallaxOffsetTop) { 1734 if( $sliderParallaxEl.find('.slider-parallax-inner').length > 0 ) { 1735 var tranformAmount = (($window.scrollTop()-parallaxOffsetTop) *-.4 ).toFixed(0), 1736 tranformAmount2 = (($window.scrollTop()-parallaxOffsetTop) *-.15 ).toFixed(0); 1737 $sliderParallaxEl.find('.slider-parallax-inner').css({'transform':'translateY('+ tranformAmount +'px)'}); 1738 $('.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY('+ tranformAmount2 +'px)'}); 1739 } else { 1740 var tranformAmount = (($window.scrollTop()-parallaxOffsetTop) / 1.5 ).toFixed(0), 1741 tranformAmount2 = (($window.scrollTop()-parallaxOffsetTop) / 7 ).toFixed(0); 1742 $sliderParallaxEl.css({'transform':'translateY('+ tranformAmount +'px)'}); 1743 $('.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY('+ -tranformAmount2 +'px)'}); 1744 } 1745 } else { 1746 if( $sliderParallaxEl.find('.slider-parallax-inner').length > 0 ) { 1747 $('.slider-parallax-inner,.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY(0px)'}); 1748 } else { 1749 $('.slider-parallax,.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY(0px)'}); 1750 } 1751 } 1752 } else { 1753 $sliderParallaxEl.addClass('slider-parallax-invisible').removeClass('slider-parallax-visible'); 1754 } 1755 if(requesting) { 1756 requestAnimationFrame(function(){ 1757 SEMICOLON.slider.sliderParallax(); 1758 SEMICOLON.slider.sliderElementsFade(); 1759 }); 1760 } 1761 } else { 1762 if( $sliderParallaxEl.find('.slider-parallax-inner').length > 0 ) { 1763 $('.slider-parallax-inner,.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY(0px)'}); 1764 } else { 1765 $('.slider-parallax,.slider-parallax .slider-caption,.ei-title').css({'transform':'translateY(0px)'}); 1766 } 1767 } 1768 }, 1769 1770 sliderElementsFade: function(){ 1771 1772 if( $sliderParallaxEl.length > 0 ) { 1773 if( ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) && !SEMICOLON.isMobile.any() ) { 1774 var parallaxOffsetTop = SEMICOLON.slider.sliderParallaxOffset(), 1775 parallaxElHeight = $sliderParallaxEl.outerHeight(); 1776 if( $slider.length > 0 ) { 1777 if( $header.hasClass('transparent-header') || $('body').hasClass('side-header') ) { var tHeaderOffset = 100; } else { var tHeaderOffset = 0; } 1778 $sliderParallaxEl.find('.slider-arrow-left,.slider-arrow-right,.vertical-middle:not(.no-fade),.slider-caption,.ei-title,.camera_prev,.camera_next').css({'opacity': 1 - ( ( ( $window.scrollTop() - tHeaderOffset ) *1.85 ) / parallaxElHeight ) }); 1779 } 1780 } else { 1781 $sliderParallaxEl.find('.slider-arrow-left,.slider-arrow-right,.vertical-middle:not(.no-fade),.slider-caption,.ei-title,.camera_prev,.camera_next').css({'opacity': 1}); 1782 } 1783 } 1784 }, 1785 1786 captionPosition: function(){ 1787 $sliderElement.find('.slider-caption:not(.custom-caption-pos)').each(function(){ 1788 var scapHeight = $(this).outerHeight(); 1789 var scapSliderHeight = $sliderElement.outerHeight(); 1790 if( $(this).parents('#slider').prev('#header').hasClass('transparent-header') && ( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) ) { 1791 if( $(this).parents('#slider').prev('#header').hasClass('floating-header') ) { 1792 $(this).css({ top: ( scapSliderHeight + 160 - scapHeight ) / 2 + 'px' }); 1793 } else { 1794 $(this).css({ top: ( scapSliderHeight + 100 - scapHeight ) / 2 + 'px' }); 1795 } 1796 } else { 1797 $(this).css({ top: ( scapSliderHeight - scapHeight ) / 2 + 'px' }); 1798 } 1799 }); 1800 }, 1801 1802 swiperSliderMenu: function( onWinLoad ){ 1803 onWinLoad = typeof onWinLoad !== 'undefined' ? onWinLoad : false;
1804 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1805 var activeSlide = $slider.find('.swiper-slide.swiper-slide-active'); 1806 SEMICOLON.slider.headerSchemeChanger(activeSlide, onWinLoad); 1807 } 1808 }, 1809 1810 revolutionSliderMenu: function( onWinLoad ){ 1811 onWinLoad = typeof onWinLoad !== 'undefined' ? onWinLoad : false; 1812 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 1813 var activeSlide = $slider.find('.active-revslide'); 1814 SEMICOLON.slider.headerSchemeChanger(activeSlide, onWinLoad); 1815 } 1816 }, 1817 1818 headerSchemeChanger: function( activeSlide, onWinLoad ){ 1819 if( activeSlide.length > 0 ) { 1820 var darkExists = false; 1821 if( activeSlide.hasClass('dark') ){ 1822 if( oldHeaderClasses ) { var oldClassesArray = oldHeaderClasses.split(/ +/); } else { var oldClassesArray = ''; } 1823 var noOfOldClasses = oldClassesArray.length; 1824 1825 if( noOfOldClasses > 0 ) { 1826 var i = 0; 1827 for( i=0; i<noOfOldClasses; i++ ) { 1828 if( oldClassesArray[i] == 'dark' && onWinLoad == true ) { 1829 darkExists = true; 1830 break; 1831 } 1832 } 1833 } 1834 $('#header.transparent-header:not(.sticky-header,.semi-transparent,.floating-header)').addClass('dark'); 1835 if( !darkExists ) { 1836 $('#header.transparent-header.sticky-header,#header.transparent-header.semi-transparent.sticky-header,#header.transparent-header.floating-header.sticky-header').removeClass('dark'); 1837 } 1838 $headerWrap.removeClass('not-dark'); 1839 } else { 1840 if( $body.hasClass('dark') ) { 1841 activeSlide.addClass('not-dark'); 1842 $('#header.transparent-header:not(.semi-transparent,.floating-header)').removeClass('dark'); 1843 $('#header.transparent-header:not(.sticky-header,.semi-transparent,.floating-header)').find('#header-wrap').addClass('not-dark'); 1844 } else { 1845 $('#header.transparent-header:not(.semi-transparent,.floating-header)').removeClass('dark'); 1846 $headerWrap.removeClass('not-dark'); 1847 } 1848 } 1849 if( $header.hasClass('sticky-header') ) { 1850 SEMICOLON.header.stickyMenuClass(); 1851 } 1852 SEMICOLON.header.logo(); 1853 } 1854 }, 1855 1856 owlCaptionInit: function(){ 1857 if( $owlCarouselEl.length > 0 ){ 1858 $owlCarouselEl.each( function(){ 1859 var element = $(this); 1860 if( element.find('.owl-dot').length > 0 ) { 1861 element.addClass('with-carousel-dots'); 1862 } 1863 }); 1864 } 1865 } 1866 1867 }; 1868 1869 SEMICOLON.portfolio = { 1870 1871 init: function(){ 1872 1873 SEMICOLON.portfolio.ajaxload(); 1874 1875 }, 1876 1877 gridInit: function( $container ){ 1878 1879 if( !$().isotope ) { 1880 console.log('gridInit: Isotope not Defined.'); 1881 return true; 1882 } 1883 1884 if( $container.length < 1 ) { return true; } 1885 if( $container.hasClass('customjs') ) { return true; } 1886 1887 $container.each( function(){ 1888 var element = $(this), 1889 elementTransition = element.attr('data-transition'), 1890 elementLayoutMode = element.attr('data-layout'), 1891 elementStagger = element.attr('data-stagger'), 1892 elementOriginLeft = true; 1893 1894 if( !elementTransition ) { elementTransition = '0.65s'; } 1895 if( !elementLayoutMode ) { elementLayoutMode = 'masonry'; } 1896 if( !elementStagger ) { elementStagger = 0; } 1897 if( $body.hasClass('rtl') ) { elementOriginLeft = false; } 1898 1899 setTimeout( function(){ 1900 if( element.hasClass('portfolio') ){ 1901 element.isotope({ 1902 layoutMode: elementLayoutMode, 1903 isOriginLeft: elementOriginLeft, 1904 transitionDuration: elementTransition, 1905 stagger: Number( elementStagger ), 1906 masonry: { 1907 columnWidth: element.find('.portfolio-item:not(.wide)')[0] 1908 } 1909 }); 1910 } else { 1911 element.isotope({ 1912 layoutMode: elementLayoutMode, 1913 isOriginLeft: elementOriginLeft, 1914 transitionDuration: elementTransition 1915 }); 1916 } 1917 }, 300); 1918 }); 1919 }, 1920 1921 filterInit: function(){ 1922 1923 if( !$().isotope ) { 1924 console.log('filterInit: Isotope not Defined.'); 1925 return true; 1926 } 1927 1928 if( $portfolioFilter.length < 1 ) { return true; } 1929 if( $portfolioFilter.hasClass('customjs') ) { return true; } 1930 1931 $portfolioFilter.each( function(){ 1932 var element = $(this), 1933 elementContainer = element.attr('data-container'), 1934 elementActiveClass = element.attr('data-active-class'),
1935 elementDefaultFilter = element.attr('data-default'); 1936 1937 if( !elementActiveClass ) { elementActiveClass = 'activeFilter'; } 1938 1939 element.find('a').click(function(){ 1940 element.find('li').removeClass( elementActiveClass ); 1941 $(this).parent('li').addClass( elementActiveClass ); 1942 var selector = $(this).attr('data-filter'); 1943 $(elementContainer).isotope({ filter: selector }); 1944 return false; 1945 }); 1946 1947 if( elementDefaultFilter ) { 1948 element.find('li').removeClass( elementActiveClass ); 1949 element.find('[data-filter="'+ elementDefaultFilter +'"]').parent('li').addClass( elementActiveClass ); 1950 $(elementContainer).isotope({ filter: elementDefaultFilter }); 1951 } 1952 }); 1953 }, 1954 1955 shuffleInit: function(){ 1956 1957 if( !$().isotope ) { 1958 console.log('shuffleInit: Isotope not Defined.'); 1959 return true; 1960 } 1961 1962 if( $('.portfolio-shuffle').length < 1 ) { return true; } 1963 1964 $('.portfolio-shuffle').click(function(){ 1965 var element = $(this), 1966 elementContainer = element.attr('data-container'); 1967 1968 $(elementContainer).isotope('shuffle'); 1969 }); 1970 }, 1971 1972 portfolioDescMargin: function(){ 1973 var $portfolioOverlayEl = $('.portfolio-overlay'); 1974 if( $portfolioOverlayEl.length > 0 ){ 1975 $portfolioOverlayEl.each(function() { 1976 var element = $(this); 1977 if( element.find('.portfolio-desc').length > 0 ) { 1978 var portfolioOverlayHeight = element.outerHeight(); 1979 var portfolioOverlayDescHeight = element.find('.portfolio-desc').outerHeight(); 1980 if( element.find('a.left-icon').length > 0 || element.find('a.right-icon').length > 0 || element.find('a.center-icon').length > 0 ) { 1981 var portfolioOverlayIconHeight = 40 + 20; 1982 } else { 1983 var portfolioOverlayIconHeight = 0; 1984 } 1985 var portfolioOverlayMiddleAlign = ( portfolioOverlayHeight - portfolioOverlayDescHeight - portfolioOverlayIconHeight ) / 2 1986 element.find('.portfolio-desc').css({ 'margin-top': portfolioOverlayMiddleAlign }); 1987 } 1988 }); 1989 } 1990 }, 1991 1992 arrange: function(){ 1993 if( $portfolio.length > 0 ) { 1994 $portfolio.each( function(){ 1995 var element = $(this); 1996 SEMICOLON.initialize.setFullColumnWidth( element ); 1997 }); 1998 } 1999 }, 2000 2001 ajaxload: function(){ 2002 $('.portfolio-ajax .portfolio-item a.center-icon').click( function(e) { 2003 var portPostId = $(this).parents('.portfolio-item').attr('id'); 2004 if( !$(this).parents('.portfolio-item').hasClass('portfolio-active') ) { 2005 SEMICOLON.portfolio.loadItem(portPostId, prevPostPortId); 2006 } 2007 e.preventDefault(); 2008 }); 2009 }, 2010 2011 newNextPrev: function( portPostId ){ 2012 var portNext = SEMICOLON.portfolio.getNextItem(portPostId); 2013 var portPrev = SEMICOLON.portfolio.getPrevItem(portPostId); 2014 $('#next-portfolio').attr('data-id', portNext); 2015 $('#prev-portfolio').attr('data-id', portPrev); 2016 }, 2017 2018 loadItem: function( portPostId, prevPostPortId, getIt ){ 2019 if(!getIt) { getIt = false; } 2020 var portNext = SEMICOLON.portfolio.getNextItem(portPostId); 2021 var portPrev = SEMICOLON.portfolio.getPrevItem(portPostId); 2022 if(getIt == false) { 2023 SEMICOLON.portfolio.closeItem(); 2024 $portfolioAjaxLoader.fadeIn(); 2025 var portfolioDataLoader = $('#' + portPostId).attr('data-loader'); 2026 $portfolioDetailsContainer.load(portfolioDataLoader, { portid: portPostId, portnext: portNext, portprev: portPrev }, 2027 function(){ 2028 SEMICOLON.portfolio.initializeAjax(portPostId); 2029 SEMICOLON.portfolio.openItem(); 2030 $portfolioItems.removeClass('portfolio-active'); 2031 $('#' + portPostId).addClass('portfolio-active'); 2032 }); 2033 } 2034 }, 2035 2036 closeItem: function(){ 2037 if( $portfolioDetails && $portfolioDetails.height() > 32 ) { 2038 $portfolioAjaxLoader.fadeIn(); 2039 $portfolioDetails.find('#portfolio-ajax-single').fadeOut('600', function(){ 2040 $(this).remove(); 2041 }); 2042 $portfolioDetails.removeClass('portfolio-ajax-opened'); 2043 } 2044 }, 2045 2046 openItem: function(){ 2047 var noOfImages = $portfolioDetails.find('img').length; 2048 var noLoaded = 0; 2049 2050 if( noOfImages > 0 ) { 2051 $portfolioDetails.find('img').on('load', function(){ 2052 noLoaded++; 2053 var topOffsetScroll = SEMICOLON.initialize.topScrollOffset(); 2054 if(noOfImages === noLoaded) { 2055 $portfolioDetailsContainer.css({ 'display': 'block' }); 2056 $portfolioDetails.addClass('portfolio-ajax-opened'); 2057 $portfolioAjaxLoader.fadeOut(); 2058 var t=setTimeout(function(){ 2059 SEMICOLON.widget.loadFlexSlider(); 2060 SEMICOLON.initialize.lightbox(); 2061 SEMICOLON.initialize.resizeVideos(); 2062 SEMICOLON.widget.masonryThumbs(); 2063 $('html,body').stop(true).animate({ 2064 'scrollTop': $portfolioDetails.offset().top - topOffsetScroll 2065 }, 900, 'easeOutQuad'); 2066 },500); 2067 } 2068 }); 2069 } else { 2070 var topOffsetScroll = SEMICOLON.initialize.topScrollOffset(); 2071 $portfolioDetailsContainer.css({ 'display': 'block' }); 2072 $portfolioDetails.addClass('portfolio-ajax-opened'); 2073 $portfolioAjaxLoader.fadeOut(); 2074 var t=setTimeout(function(){ 2075 SEMICOLON.widget.loadFlexSlider(); 2076 SEMICOLON.initialize.lightbox(); 2077 SEMICOLON.initialize.resizeVideos(); 2078 SEMICOLON.widget.masonryThumbs(); 2079 $('html,body').stop(true).animate({ 2080 'scrollTop': $portfolioDetails.offset().top - topOffsetScroll 2081 }, 900, 'easeOutQuad'); 2082 },500); 2083 } 2084 }, 2085 2086 getNextItem: function( portPostId ){ 2087 var portNext = ''; 2088 var hasNext = $('#' + portPostId).next(); 2089 if(hasNext.length != 0) { 2090 portNext = hasNext.attr('id'); 2091 } 2092 return portNext; 2093 }, 2094 2095 getPrevItem: function( portPostId ){ 2096 var portPrev = ''; 2097 var hasPrev = $('#' + portPostId).prev(); 2098 if(hasPrev.length != 0) { 2099 portPrev = hasPrev.attr('id'); 2100 } 2101 return portPrev; 2102 }, 2103 2104 initializeAjax: function( portPostId ){ 2105 prevPostPortId = $('#' + portPostId); 2106 2107 $('#next-portfolio, #prev-portfolio').click( function() { 2108 var portPostId = $(this).attr('data-id'); 2109 $portfolioItems.removeClass('portfolio-active'); 2110 $('#' + portPostId).addClass('portfolio-active'); 2111 SEMICOLON.portfolio.loadItem(portPostId,prevPostPortId); 2112 return false;
2113 }); 2114 2115 $('#close-portfolio').click( function() { 2116 $portfolioDetailsContainer.fadeOut('600', function(){ 2117 $portfolioDetails.find('#portfolio-ajax-single').remove(); 2118 }); 2119 $portfolioDetails.removeClass('portfolio-ajax-opened'); 2120 $portfolioItems.removeClass('portfolio-active'); 2121 return false; 2122 }); 2123 } 2124 2125 }; 2126 2127 SEMICOLON.widget = { 2128 2129 init: function(){ 2130 2131 SEMICOLON.widget.animations(); 2132 SEMICOLON.widget.youtubeBgVideo(); 2133 SEMICOLON.widget.tabs(); 2134 SEMICOLON.widget.tabsJustify(); 2135 SEMICOLON.widget.tabsResponsive(); 2136 SEMICOLON.widget.tabsResponsiveResize(); 2137 SEMICOLON.widget.toggles(); 2138 SEMICOLON.widget.accordions(); 2139 SEMICOLON.widget.counter(); 2140 SEMICOLON.widget.roundedSkill(); 2141 SEMICOLON.widget.progress(); 2142 SEMICOLON.widget.twitterFeed(); 2143 SEMICOLON.widget.flickrFeed(); 2144 SEMICOLON.widget.instagramPhotos( '5834720953.1677ed0.a0a26ba4c90845f9a844d64c316bf77a', '8e000fefe3024b2ead6a50ff005bf036' ); 2145 SEMICOLON.widget.dribbbleShots( '012d3d72d12f93e1d41a19195d7da2fc87e6b5afa48a184256e398eb793cfe56' ); 2146 SEMICOLON.widget.navTree(); 2147 SEMICOLON.widget.textRotater(); 2148 SEMICOLON.widget.carousel(); 2149 SEMICOLON.widget.linkScroll(); 2150 SEMICOLON.widget.contactForm(); 2151 SEMICOLON.widget.subscription(); 2152 SEMICOLON.widget.quickContact(); 2153 SEMICOLON.widget.stickySidebar(); 2154 SEMICOLON.widget.cookieNotify(); 2155 SEMICOLON.widget.extras(); 2156 2157 }, 2158 2159 parallax: function(){ 2160 2161 if( typeof skrollr !== 'undefined' && $.isFunction(skrollr) ) { 2162 console.log('parallax: skrollr not Defined.'); 2163 return true; 2164 } 2165 2166 if( $parallaxEl.length > 0 || $parallaxPageTitleEl.length > 0 || $parallaxPortfolioEl.length > 0 ) { 2167 if( !SEMICOLON.isMobile.any() ){ 2168 skrollr.init({forceHeight: false}); 2169 } else { 2170 $parallaxEl.addClass('mobile-parallax'); 2171 $parallaxPageTitleEl.addClass('mobile-parallax'); 2172 $parallaxPortfolioEl.addClass('mobile-parallax'); 2173 } 2174 } 2175 }, 2176 2177 animations: function(){ 2178 2179 if( !$().appear ) { 2180 console.log('animations: Appear not Defined.'); 2181 return true; 2182 } 2183 2184 var $dataAnimateEl = $('[data-animate]'); 2185 if( $dataAnimateEl.length > 0 ){ 2186 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') || $body.hasClass('device-md') ){ 2187 $dataAnimateEl.each(function(){ 2188 var element = $(this), 2189 animationOut = element.attr('data-animate-out'), 2190 animationDelay = element.attr('data-delay'), 2191 animationDelayOut = element.attr('data-delay-out'), 2192 animationDelayTime = 0, 2193 animationDelayOutTime = 3000; 2194 2195 if( element.parents('.fslider.no-thumbs-animate').length > 0 ) { return true; } 2196 2197 if( animationDelay ) { animationDelayTime = Number( animationDelay ) + 500; } else { animationDelayTime = 500; } 2198 if( animationOut && animationDelayOut ) { animationDelayOutTime = Number( animationDelayOut ) + animationDelayTime; } 2199 2200 if( !element.hasClass('animated') ) { 2201 element.addClass('not-animated'); 2202 var elementAnimation = element.attr('data-animate'); 2203 element.appear(function () { 2204 setTimeout(function() { 2205 element.removeClass('not-animated').addClass( elementAnimation + ' animated'); 2206 }, animationDelayTime); 2207 2208 if( animationOut ) { 2209 setTimeout( function() { 2210 element.removeClass( elementAnimation ).addClass( animationOut ); 2211 }, animationDelayOutTime ); 2212 } 2213 },{accX: 0, accY: -120},'easeInCubic'); 2214 } 2215 }); 2216 } 2217 } 2218 }, 2219 2220 loadFlexSlider: function(){ 2221 2222 if( !$().flexslider ) { 2223 console.log('loadFlexSlider: FlexSlider not Defined.'); 2224 return true; 2225 } 2226 2227 var $flexSliderEl = $('.fslider:not(.customjs)').find('.flexslider'); 2228 if( $flexSliderEl.length > 0 ){ 2229 $flexSliderEl.each(function() { 2230 var $flexsSlider = $(this), 2231 flexsAnimation = $flexsSlider.parent('.fslider').attr('data-animation'), 2232 flexsEasing = $flexsSlider.parent('.fslider').attr('data-easing'), 2233 flexsDirection = $flexsSlider.parent('.fslider').attr('data-direction'), 2234 flexsReverse = $flexsSlider.parent('.fslider').attr('data-reverse'), 2235 flexsSlideshow = $flexsSlider.parent('.fslider').attr('data-sli
2235deshow'), 2236 flexsPause = $flexsSlider.parent('.fslider').attr('data-pause'), 2237 flexsSpeed = $flexsSlider.parent('.fslider').attr('data-speed'), 2238 flexsVideo = $flexsSlider.parent('.fslider').attr('data-video'), 2239 flexsPagi = $flexsSlider.parent('.fslider').attr('data-pagi'), 2240 flexsArrows = $flexsSlider.parent('.fslider').attr('data-arrows'), 2241 flexsThumbs = $flexsSlider.parent('.fslider').attr('data-thumbs'), 2242 flexsHover = $flexsSlider.parent('.fslider').attr('data-hover'), 2243 flexsSheight = $flexsSlider.parent('.fslider').attr('data-smooth-height'), 2244 flexsTouch = $flexsSlider.parent('.fslider').attr('data-touch'), 2245 flexsUseCSS = false; 2246 2247 if( !flexsAnimation ) { flexsAnimation = 'slide'; } 2248 if( !flexsEasing || flexsEasing == 'swing' ) { 2249 flexsEasing = 'swing'; 2250 flexsUseCSS = true; 2251 } 2252 if( !flexsDirection ) { flexsDirection = 'horizontal'; } 2253 if( flexsReverse == 'true' ) { flexsReverse = true; } else { flexsReverse = false; } 2254 if( !flexsSlideshow ) { flexsSlideshow = true; } else { flexsSlideshow = false; } 2255 if( !flexsPause ) { flexsPause = 5000; } 2256 if( !flexsSpeed ) { flexsSpeed = 600; } 2257 if( !flexsVideo ) { flexsVideo = false; } 2258 if( flexsSheight == 'false' ) { flexsSheight = false; } else { flexsSheight = true; } 2259 if( flexsDirection == 'vertical' ) { flexsSheight = false; } 2260 if( flexsPagi == 'false' ) { flexsPagi = false; } else { flexsPagi = true; } 2261 if( flexsThumbs == 'true' ) { flexsPagi = 'thumbnails'; } else { flexsPagi = flexsPagi; } 2262 if( flexsArrows == 'false' ) { flexsArrows = false; } else { flexsArrows = true; } 2263 if( flexsHover == 'false' ) { flexsHover = false; } else { flexsHover = true; } 2264 if( flexsTouch == 'false' ) { flexsTouch = false; } else { flexsTouch = true; } 2265 2266 $flexsSlider.flexslider({ 2267 selector: ".slider-wrap > .slide", 2268 animation: flexsAnimation, 2269 easing: flexsEasing, 2270 direction: flexsDirection, 2271 reverse: flexsReverse, 2272 slideshow: flexsSlideshow, 2273 slideshowSpeed: Number(flexsPause), 2274 animationSpeed: Number(flexsSpeed), 2275 pauseOnHover: flexsHover, 2276 video: flexsVideo, 2277 controlNav: flexsPagi, 2278 directionNav: flexsArrows, 2279 smoothHeight: flexsSheight, 2280 useCSS: flexsUseCSS, 2281 touch: flexsTouch, 2282 start: function(slider){ 2283 SEMICOLON.widget.animations(); 2284 SEMICOLON.initialize.verticalMiddle(); 2285 slider.parent().removeClass('preloader2'); 2286 var t = setTimeout( function(){ $('.grid-container').isotope('layout'); }, 1200 ); 2287 SEMICOLON.initialize.lightbox(); 2288 $('.flex-prev').html('<i class="icon-angle-left"></i>'); 2289 $('.flex-next').html('<i class="icon-angle-right"></i>'); 2290 SEMICOLON.portfolio.portfolioDescMargin(); 2291 }, 2292 after: function(){ 2293 if( $('.grid-container').hasClass('portfolio-full') ) { 2294 $('.grid-container.portfolio-full').isotope('layout'); 2295 SEMICOLON.portfolio.portfolioDescMargin(); 2296 } 2297 if( $('.post-grid').hasClass('post-masonry-full') ) { 2298 $('.post-grid.post-masonry-full').isotope('layout'); 2299 } 2300 } 2301 }); 2302 }); 2303 } 2304 }, 2305 2306 html5Video: function(){ 2307 var videoEl = $('.video-wrap:has(video)'); 2308 if( videoEl.length > 0 ) { 2309 videoEl.each(function(){ 2310 var element = $(this), 2311 elementVideo = element.find('video'), 2312 outerContainerWidth = element.outerWidth(), 2313 outerContainerHeight = element.outerHeight(), 2314 innerVideoWidth = elementVideo.outerWidth(), 2315 innerVideoHeight = elementVideo.outerHeight(); 2316 2317 if( innerVideoHeight < outerContainerHeight ) { 2318 var videoAspectRatio = innerVideoWidth/innerVideoHeight, 2319 newVideoWidth = outerContainerHeight * videoAspectRatio, 2320 innerVideoPosition = (newVideoWidth - outerContainerWidth) / 2; 2321 elementVideo.css({ 'width': newVideoWidth+'px', 'height': outerContainerHeight+'px', 'left': -innerVideoPosition+'px' }); 2322 } else { 2323 var innerVideoPosition = (innerVideoHeight - outerContainerHeight) / 2; 2324 elementVideo.css({ 'width': innerVideoWidth+'px', 'height': innerVideoHeight+'px', 'top': -innerVideoPosition+'px' }); 2325 } 2326 2327 if( SEMICOLON.isMobile.any() && !element.hasClass('no-placeholder') ) { 2328 var placeholderImg = elementVideo.attr('poster'); 2329 2330 if( placeholderImg != '' ) { 2331 element.append('<div class="video-placeholder" style="background-image: url('+ placeholderImg +');"></div>') 2332 } 2333 2334 elementVideo.hide(); 2335 } 2336 }); 2337 } 2338 }, 2339 2340 youtubeBgVideo: function(){ 2341 2342 if( !$().YTPlayer ) { 2343 console.log('youtubeBgVideo: YoutubeBG Plugin not Defined.'); 2344 return true; 2345 } 2346 2347 var $youtubeBgPlayerEl = $('.yt-bg-player'); 2348 if( $youtubeBgPlayerEl.hasClass('customjs') ) { return true; } 2349 2350 if( $youtubeBgPlayerEl.length > 0 ){ 2351 $youtubeBgPlayerEl.each( function(){ 2352 var element = $(this), 2353 ytbgVideo = element.attr('data-video'), 2354 ytbgMute = element.attr('data-mute'), 2355 ytbgRatio = element.attr('data-ratio'), 2356 ytbgQuality = element.attr('data-quality'), 2357 ytbgOpacity = element.attr('data-opacity'), 2358 ytbgContainer = element.attr('data-container'), 2359 ytbgOptimize = element.attr('data-optimize'), 2360 ytbgLoop = element.attr('data-loop'), 2361 ytbgVolume = element.attr('data-volume'), 2362 ytbgStart = element.attr('data-start'), 2363 ytbgStop = element.attr('data-stop'), 2364 ytbgAutoPlay = element.attr('data-autoplay'), 2365 ytbgFullScreen = element.attr('data-fullscreen'); 2366 2367 if( ytbgMute == 'false' ) { ytbgMute = false; } else { ytbgMute = true; } 2368 if( !ytbgRatio ) { ytbgRatio = '16/9'; } 2369 if( !ytbgQuality ) { ytbgQuality = 'hd720'; } 2370 if( !ytbgOpacity ) { ytbgOpacity = 1; } 2371 if( !ytbgContainer ) { ytbgContainer = 'self'; } 2372 if( ytbgOptimize == 'false' ) { ytbgOptimize = false; } else { ytbgOptimize = true; } 2373 if( ytbgLoop == 'false' ) { ytbgLoop = false; } else { ytbgLoop = true; } 2374 if( !ytbgVolume ) { ytbgVolume = 1; } 2375 if( !ytbgStart ) { ytbgStart = 0; } 2376 if( !ytbgStop ) { ytbgStop = 0; } 2377 if( ytbgAutoPlay == 'false' ) { ytbgAutoPlay = false; } else { ytbgAutoPlay = true; } 2378 if( ytbgFullScreen == 'true' ) { ytbgFullScreen = true; } else { ytbgFullScreen = false; } 2379 2380 element.YTPlayer({ 2381 videoURL: ytbgVideo, 2382 mute: ytbgMute, 2383 ratio: ytbgRatio, 2384 quality: ytbgQuality, 2385 opacity: Number(ytbgOpacity), 2386 containment: ytbgContainer, 2387 optimizeDisplay: ytbgOptimize, 2388 loop: ytbgLoop, 2389 vol: Number(ytbgVolume), 2390 startAt: Number(ytbgStart), 2391 stopAt: Number(ytbgStop), 2392 autoPlay: ytbgAutoPlay, 2393 realfullscreen: ytbgFullScreen, 2394 showYTLogo: false, 2395 showControls: false 2396 }); 2397 }); 2398 } 2399 }, 2400 2401 tabs: function(){ 2402 2403 if( !$().tabs ) { 2404 console.log('tabs: Tabs not Defined.'); 2405 return true; 2406 } 2407 2408 var $tabs = $('.tabs:not(.customjs)'); 2409 if( $tabs.length > 0 ) { 2410 $tabs.each( function(){ 2411 var element = $(this), 2412 elementSpeed = element.attr('data-speed'), 2413 tabActive = element.attr('data-active'); 2414 2415 if( !elementSpeed ) { elementSpeed = 400; } 2416 if( !tabActive ) { tabActive = 0; } else { tabActive = tabActive - 1; } 2417 2418 element.tabs({ 2419 active: Number(tabActive), 2420 show: { 2421 effect: "fade", 2422 duration: Number(elementSpeed) 2423 } 2424 }); 2425 }); 2426 } 2427 }, 2428 2429 tabsJustify: function(){ 2430 if( !$('body').hasClass('device-xs') && !$('body').hasClass('device-sm') ){ 2431 var $tabsJustify = $('.tabs.tabs-justify'); 2432 if( $tabsJustify.length > 0 ) { 2433 $tabsJustify.each( function(){ 2434 var element = $(this), 2435 elementTabs = element.find('.tab-nav > li'), 2436 elementTabsNo = elementTabs.length, 2437 elementContainer = 0, 2438 elementWidth = 0; 2439 2440 if( element.hasClass('tabs-bordered') || element.hasClass('tabs-bb') ) { 2441 elementContainer = element.find('.tab-nav').outerWidth(); 2442 } else { 2443 if( element.find('tab-nav').hasClass('tab-nav2') ) { 2444 elementContainer = element.find('.tab-nav').outerWidth() - (elementTabsNo * 10); 2445 } else { 2446 elementContainer = element.find('.tab-nav').outerWidth() - 30; 2447 } 2448 } 2449 2450 elementWidth = Math.floor(elementContainer/elementTabsNo); 2451 elementTabs.css({ 'width': elementWidth + 'px' }); 2452 2453 }); 2454 } 2455 } else { $('.tabs.tabs-justify').find('.tab-nav > li').css({ 'width': '' }); } 2456 }, 2457 2458 tabsResponsive: function(){ 2459 2460 if( !$().tabs ) { 2461 console.log('tabs: Tabs not Defined.'); 2462 return true; 2463 } 2464 2465 var $tabsResponsive = $('.tabs.tabs-responsive'); 2466 if( $tabsResponsive.length < 1 ) { return true; } 2467 2468 $tabsResponsive.each( function(){ 2469 var element = $(this), 2470 elementNav = element.find('.tab-nav'), 2471 elementContent = element.find('.tab-container'); 2472 2473 elementNav.children('li').each( function(){ 2474 var navEl = $(this), 2475 navElAnchor = navEl.children('a'), 2476 navElTarget = navElAnchor.attr('href'), 2477 navElContent = navElAnchor.html(); 2478 2479 elementContent.find(navElTarget).before('<div class="acctitle d-none"><i class="acc-closed icon-ok-circle"></i><i class="acc-open icon-remove-circle"></i>'+navElContent+'</div>'); 2480 }); 2481 }); 2482 }, 2483 2484 tabsResponsiveResize: function(){ 2485 2486 if( !$().tabs ) { 2487 console.log('tabs: Tabs not Defined.'); 2488 return true; 2489 } 2490 2491 var $tabsResponsive = $('.tabs.tabs-responsive'); 2492 if( $tabsResponsive.length < 1 ) { return true; } 2493 2494 $tabsResponsive.each( function(){ 2495 var element = $(this), 2496 tabActive = element.attr('data-active'), 2497 elementAccStyle = element.attr('data-accordion-style'); 2498 2499 if( $('body').hasClass('device-sm') || $('body').hasClass('device-xs') ) { 2500 2501 element.find('.tab-nav').addClass('d-none'); 2502 element.find('.tab-container').addClass('accordion '+ elementAccStyle +' clearfix').attr('data-active', tabActive); 2503 element.find('.tab-content').addClass('acc_content'); 2504 element.find('.acctitle').removeClass('d-none'); 2505 SEMICOLON.widget.accordions(); 2506 2507 } else if( $('body').hasClass('device-md') || $('body').hasClass('device-lg') || $('body').hasClass('device-xl') ) { 2508 2509 element.find('.tab-nav').removeClass('d-none'); 2510 element.find('.tab-container').removeClass('accordion '+ elementAccStyle +' clearfix').attr('data-active', ''); 2511 element.find('.tab-content').removeClass('acc_content'); 2512 element.find('.acctitle').addClass('d-none'); 2513 element.tabs('refresh'); 2514 2515 } 2516 }); 2517 }, 2518 2519 toggles: function(){ 2520 var $toggle = $('.toggle'); 2521 if( $toggle.length > 0 ) { 2522 $toggle.each( function(){ 2523 var element = $(this), 2524 elementState = element.attr('data-state'); 2525 2526 if( elementState != 'open' ){ 2527 element.children('.togglec').hide(); 2528 } else { 2529 element.children('.togglet').addClass("toggleta"); 2530 } 2531 2532 element.children('.togglet').click(function(){ 2533 $(this).toggleClass('toggleta').next('.togglec').slideToggle(300); 2534 return true; 2535 }); 2536 }); 2537 } 2538 }, 2539 2540 accordions: function(){ 2541 var $accordionEl = $('.accordion'); 2542 if( $accordionEl.length > 0 ){ 2543 $accordionEl.each( function(){ 2544 var element = $(this), 2545 elementState = element.attr('data-state'), 2546 accordionActive = element.attr('data-active'); 2547 2548 if( !accordionActive ) { accordionActive = 0; } else { accordionActive = accordionActive - 1; } 2549 2550 element.find('.acc_content').hide(); 2551 2552 if( elementState != 'closed' ) { 2553 element.find('.acctitle:eq('+ Number(accordionActive) +')').addClass('acctitlec').next().show(); 2554 } 2555 2556 element.find('.acctitle').click(function(){ 2557 if( $(this).next().is(':hidden') ) { 2558 element.find('.acctitle').removeClass('acctitlec').next().slideUp("normal"); 2559 var clickTarget = $(this); 2560 $(this).toggleClass('acctitlec').next().stop().slideDown("normal", function(){ 2561 if( ( $body.hasClass('device-sm') || $body.hasClass('device-xs') ) && element.hasClass('scroll-on-open') ) { 2562 $('html,body').stop(true).animate({ 2563 'scrollTop': clickTarget.offset().top - ( SEMICOLON.initialize.topScrollOffset() - 40 ) 2564 }, 800, 'easeOutQuad' ); 2565 } 2566 }); 2567 } 2568 return false;
2569 }); 2570 }); 2571 } 2572 }, 2573 2574 counter: function(){ 2575 2576 if( !$().appear ) { 2577 console.log('counter: Appear not Defined.'); 2578 return true; 2579 } 2580 2581 if( !$().countTo ) { 2582 console.log('counter: countTo not Defined.'); 2583 return true; 2584 } 2585 2586 var $counterEl = $('.counter:not(.counter-instant)'); 2587 if( $counterEl.length > 0 ){ 2588 $counterEl.each(function(){ 2589 var element = $(this); 2590 var counterElementComma = $(this).find('span').attr('data-comma'); 2591 if( !counterElementComma ) { counterElementComma = false; } else { counterElementComma = true; } 2592 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ){ 2593 element.appear( function(){ 2594 SEMICOLON.widget.runCounter( element, counterElementComma ); 2595 if( element.parents('.common-height') ) { 2596 SEMICOLON.initialize.maxHeight(); 2597 } 2598 },{accX: 0, accY: -120},'easeInCubic'); 2599 } else { 2600 SEMICOLON.widget.runCounter( element, counterElementComma ); 2601 } 2602 }); 2603 } 2604 }, 2605 2606 runCounter: function( counterElement,counterElementComma ){ 2607 if( counterElementComma == true ) { 2608 counterElement.find('span').countTo({ 2609 formatter: function (value, options) { 2610 value = value.toFixed(options.decimals); 2611 value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ','); 2612 return value; 2613 } 2614 }); 2615 } else { 2616 counterElement.find('span').countTo(); 2617 } 2618 }, 2619 2620 roundedSkill: function(){ 2621 2622 if( !$().appear ) { 2623 console.log('roundedSkill: Appear not Defined.'); 2624 return true; 2625 } 2626 2627 if( !$().easyPieChart ) { 2628 console.log('roundedSkill: EasyPieChart not Defined.'); 2629 return true; 2630 } 2631 2632 var $roundedSkillEl = $('.rounded-skill'); 2633 if( $roundedSkillEl.length > 0 ){ 2634 $roundedSkillEl.each(function(){ 2635 var element = $(this); 2636 2637 var roundSkillSize = element.attr('data-size'); 2638 var roundSkillSpeed = element.attr('data-speed'); 2639 var roundSkillWidth = element.attr('data-width'); 2640 var roundSkillColor = element.attr('data-color'); 2641 var roundSkillTrackColor = element.attr('data-trackcolor'); 2642 2643 if( !roundSkillSize ) { roundSkillSize = 140; } 2644 if( !roundSkillSpeed ) { roundSkillSpeed = 2000; } 2645 if( !roundSkillWidth ) { roundSkillWidth = 8; } 2646 if( !roundSkillColor ) { roundSkillColor = '#0093BF'; } 2647 if( !roundSkillTrackColor ) { roundSkillTrackColor = 'rgba(0,0,0,0.04)'; } 2648 2649 var properties = {roundSkillSize:roundSkillSize, roundSkillSpeed:roundSkillSpeed, roundSkillWidth:roundSkillWidth, roundSkillColor:roundSkillColor, roundSkillTrackColor:roundSkillTrackColor}; 2650 2651 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ){ 2652 element.css({'width':roundSkillSize+'px','height':roundSkillSize+'px','line-height':roundSkillSize+'px'}).animate({opacity:0}
2652, 10); 2653 element.appear( function(){ 2654 if (!element.hasClass('skills-animated')) { 2655 var t = setTimeout( function(){ element.css({opacity: 1}); }, 100 ); 2656 SEMICOLON.widget.runRoundedSkills( element, properties ); 2657 element.addClass('skills-animated'); 2658 } 2659 },{accX: 0, accY: -120},'easeInCubic'); 2660 } else { 2661 SEMICOLON.widget.runRoundedSkills( element, properties ); 2662 } 2663 }); 2664 } 2665 }, 2666 2667 runRoundedSkills: function( element, properties ){ 2668 element.easyPieChart({ 2669 size: Number(properties.roundSkillSize), 2670 animate: Number(properties.roundSkillSpeed), 2671 scaleColor: false, 2672 trackColor: properties.roundSkillTrackColor, 2673 lineWidth: Number(properties.roundSkillWidth), 2674 lineCap: 'square', 2675 barColor: properties.roundSkillColor 2676 }); 2677 }, 2678 2679 progress: function(){ 2680 2681 if( !$().appear ) { 2682 console.log('progress: Appear not Defined.'); 2683 return true; 2684 } 2685 2686 var $progressEl = $('.progress'); 2687 if( $progressEl.length > 0 ){ 2688 $progressEl.each(function(){ 2689 var element = $(this), 2690 skillsBar = element.parent('li'), 2691 skillValue = skillsBar.attr('data-percent'); 2692 2693 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ){ 2694 element.appear( function(){ 2695 if (!skillsBar.hasClass('skills-animated')) { 2696 element.find('.counter-instant span').countTo(); 2697 skillsBar.find('.progress').css({width: skillValue + "%"}).addClass('skills-animated'); 2698 } 2699 },{accX: 0, accY: -120},'easeInCubic'); 2700 } else { 2701 element.find('.counter-instant span').countTo(); 2702 skillsBar.find('.progress').css({width: skillValue + "%"}); 2703 } 2704 }); 2705 } 2706 }, 2707 2708 twitterFeed: function(){ 2709 2710 if( typeof sm_format_twitter === 'undefined' ) { 2711 console.log('twitterFeed: sm_format_twitter() not Defined.'); 2712 return true; 2713 } 2714 2715 if( typeof sm_format_twitter3 === 'undefined' ) { 2716 console.log('twitterFeed: sm_format_twitter3() not Defined.'); 2717 return true; 2718 } 2719 2720 var $twitterFeedEl = $('.twitter-feed'); 2721 if( $twitterFeedEl.length > 0 ){ 2722 $twitterFeedEl.each(function() { 2723 var element = $(this), 2724 twitterFeedUser = element.attr('data-username'), 2725 twitterFeedCount = element.attr('data-count'), 2726 twitterFeedLoader = element.attr('data-loader'); 2727 2728 if( !twitterFeedUser ) { twitterFeedUser = 'twitter' } 2729 if( !twitterFeedCount ) { twitterFeedCount = 3 } 2730 if( !twitterFeedLoader ) { twitterFeedLoader = 'include/twitter/tweets.php'; } 2731 2732 $.getJSON( twitterFeedLoader + '?username='+ twitterFeedUser +'&count='+ twitterFeedCount, function(tweets){ 2733 if( element.hasClass('fslider') ) { 2734 element.find(".slider-wrap").html(sm_format_twitter3(tweets)).promise().done( function(){ 2735 var timer = setInterval(function(){ 2736 if( element.find('.slide').length > 1 ) { 2737 element.removeClass('customjs'); 2738 var t = setTimeout( function(){ SEMICOLON.widget.loadFlexSlider(); }, 500); 2739 clearInterval(timer); 2740 } 2741 },500); 2742 }); 2743 } else { 2744 element.html(sm_format_twitter(tweets)); 2745 } 2746 }); 2747 }); 2748 } 2749 }, 2750 2751 flickrFeed: function(){ 2752 2753 if( !$().jflickrfeed ) { 2754 console.log('flickrFeed: jflickrfeed not Defined.'); 2755 return true; 2756 } 2757 2758 var $flickrFeedEl = $('.flickr-feed'); 2759 if( $flickrFeedEl.length > 0 ){ 2760 $flickrFeedEl.each(function() { 2761 var element = $(this), 2762 flickrFeedID = element.attr('data-id'), 2763 flickrFeedCount = element.attr('data-count'), 2764 flickrFeedType = element.attr('data-type'), 2765 flickrFeedTypeGet = 'photos_public.gne'; 2766 2767 if( flickrFeedType == 'group' ) { flickrFeedTypeGet = 'groups_pool.gne'; } 2768 if( !flickrFeedCount ) { flickrFeedCount = 9; } 2769 2770 element.jflickrfeed({ 2771 feedapi: flickrFeedTypeGet, 2772 limit: Number(flickrFeedCount), 2773 qstrings: { 2774 id: flickrFeedID 2775 }, 2776 itemTemplate: '<a href="{{image_b}}" title="{{title}}" data-lightbox="gallery-item">' + 2777 '<img src="{{image_s}}" alt="{{title}}" />' + 2778 '</a>' 2779 }, function(data) { 2780 SEMICOLON.initialize.lightbox(); 2781 }); 2782 }); 2783 } 2784 }, 2785 2786 instagramPhotos: function( c_accessToken, c_clientID ){ 2787 2788 if( typeof Instafeed === 'undefined' ) { 2789 console.log('Instafeed not Defined.'); 2790 return true; 2791 } 2792 2793 var $instagramPhotosEl = $('.instagram-photos'); 2794 if( $instagramPhotosEl.length > 0 ){ 2795 2796 $instagramPhotosEl.each(function() { 2797 var element = $(this), 2798 instaGramTarget = element.attr('id'), 2799 instaGramUserId = element.attr('data-user'), 2800 instaGramTag = element.attr('data-tag'), 2801 instaGramLocation = element.attr('data-location'), 2802 instaGramCount = element.attr('data-count'), 2803 instaGramType = element.attr('data-type'), 2804 instaGramSortBy = element.attr('data-sortBy'), 2805 instaGramRes = element.attr('data-resolution'); 2806 2807 if( !instaGramCount ) { instaGramCount = 9; } 2808 if( !instaGramSortBy ) { instaGramSortBy = 'none'; } 2809 if( !instaGramRes ) { instaGramRes = 'thumbnail'; } 2810 2811 if( instaGramType == 'user' ) { 2812 2813 var feed = new Instafeed({ 2814 target: instaGramTarget, 2815 get: instaGramType, 2816 userId: Number(instaGramUserId), 2817 limit: Number(instaGramCount), 2818 sortBy: instaGramSortBy, 2819 resolution: instaGramRes, 2820 accessToken: c_accessToken, 2821 clientId: c_clientID 2822 }); 2823 2824 } else if( instaGramType == 'tagged' ) { 2825 2826 var feed = new Instafeed({ 2827 target: instaGramTarget, 2828 get: instaGramType, 2829 tagName: instaGramTag, 2830 limit: Number(instaGramCount), 2831 sortBy: instaGramSortBy, 2832 resolution: instaGramRes, 2833 clientId: c_clientID 2834 }); 2835 2836 } else if( instaGramType == 'location' ) { 2837 2838 var feed = new Instafeed({ 2839 target: instaGramTarget, 2840 get: instaGramType, 2841 locationId: Number(instaGramUserId), 2842 limit: Number(instaGramCount), 2843 sortBy: instaGramSortBy, 2844 resolution: instaGramRes, 2845 clientId: c_clientID 2846 }); 2847 2848 } else { 2849 2850 var feed = new Instafeed({ 2851 target: instaGramTarget, 2852 get: 'popular', 2853 limit: Number(instaGramCount), 2854 sortBy: instaGramSortBy, 2855 resolution: instaGramRes, 2856 clientId: c_clientID 2857 }); 2858 2859 } 2860 2861 feed.run(); 2862 }); 2863 } 2864 }, 2865 2866 dribbbleShots: function( c_accessToken ){ 2867 2868 if( !$.jribbble ) { 2869 console.log('dribbbleShots: Jribbble not Defined.'); 2870 return true; 2871 } 2872 2873 if( !$().imagesLoaded ) { 2874 console.log('dribbbleShots: imagesLoaded not Defined.'); 2875 return true; 2876 } 2877 2878 var $dribbbleShotsEl = $('.dribbble-shots'); 2879 if( $dribbbleShotsEl.length > 0 ){ 2880 2881 $.jribbble.setToken( c_accessToken ); 2882 2883 $dribbbleShotsEl.each(function() { 2884 var element = $(this), 2885 dribbbleUsername = element.attr('data-user'), 2886 dribbbleCount = element.attr('data-count'), 2887 dribbbleList = element.attr('data-list'), 2888 dribbbleType = element.attr('data-type'); 2889 2890 element.addClass('customjs'); 2891 2892 if( !dribbbleCount ) { dribbbleCount = 9; } 2893 2894 if( dribbbleType == 'user' ) { 2895 2896 $.jribbble.users( dribbbleUsername ).shots({ 2897 'sort': 'recent', 2898 'page': 1, 2899 'per_page': Number(dribbbleCount) 2900 }).then( function(res) { 2901 var html = [];
2902 res.forEach( function(shot) { 2903 html.push('<a href="' + shot.html_url + '" target="_blank">'); 2904 html.push('<img src="' + shot.images.teaser + '" '); 2905 html.push('alt="' + shot.title + '"></a>'); 2906 }); 2907 element.html(html.join('')); 2908 2909 element.imagesLoaded().done( function() { 2910 element.removeClass('customjs'); 2911 SEMICOLON.widget.masonryThumbs(); 2912 }); 2913 }); 2914 2915 } else if( dribbbleType == 'list' ) { 2916 2917 $.jribbble.shots( dribbbleList, { 2918 'sort': 'recent', 2919 'page': 1, 2920 'per_page': Number(dribbbleCount) 2921 }).then( function(res) { 2922 var html = []; 2923 res.forEach( function(shot) { 2924 html.push('<a href="' + shot.html_url + '" target="_blank">'); 2925 html.push('<img src="' + shot.images.teaser + '" '); 2926 html.push('alt="' + shot.title + '"></a>'); 2927 }); 2928 element.html(html.join('')); 2929 2930 element.imagesLoaded().done( function() { 2931 element.removeClass('customjs'); 2932 SEMICOLON.widget.masonryThumbs(); 2933 }); 2934 }); 2935 } 2936 2937 }); 2938 } 2939 }, 2940 2941 navTree: function(){ 2942 var $navTreeEl = $('.nav-tree'); 2943 if( $navTreeEl.length > 0 ){ 2944 $navTreeEl.each( function(){ 2945 var element = $(this), 2946 elementSpeed = element.attr('data-speed'), 2947 elementEasing = element.attr('data-easing'); 2948 2949 if( !elementSpeed ) { elementSpeed = 250; } 2950 if( !elementEasing ) { elementEasing = 'swing'; } 2951 2952 element.find( 'ul li:has(ul)' ).addClass('sub-menu'); 2953 element.find( 'ul li:has(ul) > a' ).append( ' <i class="icon-angle-down"></i>' ); 2954 2955 if( element.hasClass('on-hover') ){ 2956 element.find( 'ul li:has(ul):not(.active)' ).hover( function(e){ 2957 $(this).children('ul').stop(true, true).slideDown( Number(elementSpeed), elementEasing); 2958 }, function(){ 2959 $(this).children('ul').delay(250).slideUp( Number(elementSpeed), elementEasing); 2960 }); 2961 } else { 2962 element.find( 'ul li:has(ul) > a' ).click( function(e){ 2963 var childElement = $(this); 2964 element.find( 'ul li' ).not(childElement.parents()).removeClass('active'); 2965 childElement.parent().children('ul').slideToggle( Number(elementSpeed), elementEasing, function(){ 2966 $(this).find('ul').hide(); 2967 $(this).find('li.active').removeClass('active'); 2968 }); 2969 element.find( 'ul li > ul' ).not(childElement.parent().children('ul')).not(childElement.parents('ul')).slideUp( Number(elementSpeed), elementEasing ); 2970 childElement.parent('li:has(ul)').toggleClass('active'); 2971 e.preventDefault(); 2972 }); 2973 } 2974 }); 2975 } 2976 }, 2977 2978 carousel: function(){ 2979 2980 if( !$().owlCarousel ) { 2981 console.log('carousel: Owl Carousel not Defined.'); 2982 return true; 2983 } 2984 2985 var $carousel = $('.carousel-widget:not(.customjs)'); 2986 if( $carousel.length < 1 ){ return true; } 2987 2988 $carousel.each( function(){ 2989 var element = $(this), 2990 elementItems = element.attr('data-items'), 2991 elementItemsXl = element.attr('data-items-xl'), 2992 elementItemsLg = element.attr('data-items-lg'), 2993 elementItemsMd = element.attr('data-items-md'), 2994 elementItemsSm = element.attr('data-items-sm'), 2995 elementItemsXs = element.attr('data-items-xs'), 2996 elementLoop = element.attr('data-loop'), 2997 elementAutoPlay = element.attr('data-autoplay'), 2998 elementSpeed = element.attr('data-speed'), 2999 elementAnimateIn = element.attr('data-animate-in'), 3000 elementAnimateOut = element.attr('data-animate-out'), 3001 elementNav = element.attr('data-nav'), 3002 elementPagi = element.attr('data-pagi'), 3003 elementMargin = element.attr('data-margin'), 3004 elementStage = element.attr('data-stage-padding'), 3005 elementMerge = element.attr('data-merge'), 3006 elementStart = element.attr('data-start'), 3007 elementRewind = element.attr('data-rewind'), 3008 elementSlideBy = element.attr('data-slideby'), 3009 elementCenter = element.attr('data-center'), 3010 elementLazy = element.attr('data-lazyload'), 3011 elementVideo = element.attr('data-video'), 3012 elementRTL = element.attr('data-rtl'), 3013 elementAutoPlayTime = 5000, 3014 elementAutoPlayHoverPause = true; 3015 3016 if( !elementItems ) { elementItems = 4; } 3017 if( !elementItemsXl ) { elementItemsXl = Number(elementItems); } 3018 if( !elementItemsLg ) { elementItemsLg = Number(elementItemsXl); } 3019 if( !elementItemsMd ) { elementItemsMd = Number(elementItemsLg); } 3020 if( !elementItemsSm ) { elementItemsSm = Number(elementItemsMd); } 3021 if( !elementItemsXs ) { elementItemsXs = Number(elementItemsSm); } 3022 if( !elementSpeed ) { elementSpeed = 250; } 3023 if( !elementMargin ) { elementMargin = 20; } 3024 if( !elementStage ) { elementStage = 0; } 3025 if( !elementStart ) { elementStart = 0; } 3026 3027 if( !elementSlideBy ) { elementSlideBy = 1; } 3028 if( elementSlideBy == 'page' ) { 3029 elementSlideBy = 'page'; 3030 } else { 3031 elementSlideBy = Number(elementSlideBy); 3032 } 3033 3034 if( elementLoop == 'true' ){ elementLoop = true; } else { elementLoop = false; } 3035 if( !elementAutoPlay ){ 3036 elementAutoPlay = false;
3037 elementAutoPlayHoverPause = false; 3038 } else { 3039 elementAutoPlayTime = Number(elementAutoPlay); 3040 elementAutoPlay = true; 3041 } 3042 if( !elementAnimateIn ) { elementAnimateIn = false; } 3043 if( !elementAnimateOut ) { elementAnimateOut = false; } 3044 if( elementNav == 'false' ){ elementNav = false; } else { elementNav = true; } 3045 if( elementPagi == 'false' ){ elementPagi = false; } else { elementPagi = true; } 3046 if( elementRewind == 'true' ){ elementRewind = true; } else { elementRewind = false; } 3047 if( elementMerge == 'true' ){ elementMerge = true; } else { elementMerge = false; } 3048 if( elementCenter == 'true' ){ elementCenter = true; } else { elementCenter = false; } 3049 if( elementLazy == 'true' ){ elementLazy = true; } else { elementLazy = false; } 3050 if( elementVideo == 'true' ){ elementVideo = true; } else { elementVideo = false; } 3051 if( elementRTL == 'true' || $body.hasClass('rtl') ){ elementRTL = true; } else { elementRTL = false; } 3052 3053 element.owlCarousel({ 3054 margin: Number(elementMargin), 3055 loop: elementLoop, 3056 stagePadding: Number(elementStage), 3057 merge: elementMerge, 3058 startPosition: Number(elementStart), 3059 rewind: elementRewind, 3060 slideBy: elementSlideBy, 3061 center: elementCenter, 3062 lazyLoad: elementLazy, 3063 nav: elementNav, 3064 navText: ['<i class="icon-angle-left"></i>','<i class="icon-angle-right"></i>'], 3065 autoplay: elementAutoPlay, 3066 autoplayTimeout: elementAutoPlayTime, 3067 autoplayHoverPause: elementAutoPlayHoverPause, 3068 dots: elementPagi, 3069 smartSpeed: Number(elementSpeed), 3070 fluidSpeed: Number(elementSpeed), 3071 video: elementVideo, 3072 animateIn: elementAnimateIn, 3073 animateOut: elementAnimateOut, 3074 rtl: elementRTL, 3075 responsive:{ 3076 0:{ items:Number(elementItemsXs) }, 3077 576:{ items:Number(elementItemsSm) }, 3078 768:{ items:Number(elementItemsMd) }, 3079 992:{ items:Number(elementItemsLg) }, 3080 1200:{ items:Number(elementItemsXl) } 3081 }, 3082 onInitialized: function(){ 3083 SEMICOLON.slider.owlCaptionInit(); 3084 SEMICOLON.slider.sliderParallaxDimensions(); 3085 SEMICOLON.initialize.lightbox(); 3086 } 3087 }); 3088 }); 3089 }, 3090 3091 masonryThumbs: function(){ 3092 var $masonryThumbsEl = $('.masonry-thumbs:not(.customjs)'); 3093 if( $masonryThumbsEl.length > 0 ){ 3094 $masonryThumbsEl.each( function(){ 3095 var masonryItemContainer = $(this); 3096 SEMICOLON.widget.masonryThumbsArrange( masonryItemContainer ); 3097 }); 3098 } 3099 }, 3100 3101 masonryThumbsArrange: function( element ){ 3102 3103 if( !$().isotope ) { 3104 console.log('masonryThumbsArrange: Isotope not Defined.'); 3105 return true; 3106 } 3107 3108 SEMICOLON.initialize.setFullColumnWidth( element ); 3109 element.isotope('layout'); 3110 }, 3111 3112 notifications: function( element ){ 3113 3114 if( typeof toastr === 'undefined' ) { 3115 console.log('notifications: Toastr not Defined.'); 3116 return true; 3117 } 3118 3119 toastr.remove(); 3120 var notifyElement = $(element), 3121 notifyPosition = notifyElement.attr('data-notify-position'), 3122 notifyType = notifyElement.attr('data-notify-type'), 3123 notifyMsg = notifyElement.attr('data-notify-msg'), 3124 notifyTimeout = notifyElement.attr('data-notify-timeout'), 3125 notifyCloseButton = notifyElement.attr('data-notify-close'); 3126 3127 if( !notifyPosition ) { notifyPosition = 'toast-top-right'; } else { notifyPosition = 'toast-' + notifyElement.attr('data-notify-position'); } 3128 if( !notifyMsg ) { notifyMsg = 'Please set a message!'; } 3129 if( !notifyTimeout ) { notifyTimeout = 5000; } 3130 if( notifyCloseButton == 'true' ) { notifyCloseButton = true; } else { notifyCloseButton = false; } 3131 3132 toastr.options.positionClass = notifyPosition; 3133 toastr.options.timeOut = Number( notifyTimeout ); 3134 toastr.options.closeButton = notifyCloseButton; 3135 toastr.options.closeHtml = '<button><i class="icon-remove"></i></button>'; 3136 3137 if( notifyType == 'warning' ) { 3138 toastr.warning(notifyMsg); 3139 } else if( notifyType == 'error' ) { 3140 toastr.error(notifyMsg); 3141 } else if( notifyType == 'success' ) { 3142 toastr.success(notifyMsg); 3143 } else { 3144 toastr.info(notifyMsg); 3145 } 3146 3147 return false;
3148 }, 3149 3150 textRotater: function(){ 3151 3152 if( !$().Morphext ) { 3153 console.log('textRotater: Morphext not Defined.'); 3154 return true; 3155 } 3156 3157 if( $textRotaterEl.length > 0 ){ 3158 $textRotaterEl.each(function(){ 3159 var element = $(this), 3160 trRotate = $(this).attr('data-rotate'), 3161 trSpeed = $(this).attr('data-speed'), 3162 trSeparator = $(this).attr('data-separator'); 3163 3164 if( !trRotate ) { trRotate = "fade"; } 3165 if( !trSpeed ) { trSpeed = 1200; } 3166 if( !trSeparator ) { trSeparator = ","; } 3167 3168 var tRotater = $(this).find('.t-rotate'); 3169 3170 tRotater.Morphext({ 3171 animation: trRotate, 3172 separator: trSeparator, 3173 speed: Number(trSpeed) 3174 }); 3175 }); 3176 } 3177 }, 3178 3179 linkScroll: function(){ 3180 $("a[data-scrollto]").click(function(){ 3181 var element = $(this), 3182 divScrollToAnchor = element.attr('data-scrollto'), 3183 divScrollSpeed = element.attr('data-speed'), 3184 divScrollOffset = element.attr('data-offset'), 3185 divScrollEasing = element.attr('data-easing'), 3186 divScrollHighlight = element.attr('data-highlight'); 3187 3188 if( element.parents('#primary-menu').hasClass('on-click') ) { return true; } 3189 3190 if( !divScrollSpeed ) { divScrollSpeed = 750; } 3191 if( !divScrollOffset ) { divScrollOffset = SEMICOLON.initialize.topScrollOffset(); } 3192 if( !divScrollEasing ) { divScrollEasing = 'easeOutQuad'; } 3193 3194 $('html,body').stop(true).animate({ 3195 'scrollTop': $( divScrollToAnchor ).offset().top - Number(divScrollOffset) 3196 }, Number(divScrollSpeed), divScrollEasing, function(){ 3197 if( divScrollHighlight ) { 3198 if( $(divScrollToAnchor).find('.highlight-me').length > 0 ) { 3199 $(divScrollToAnchor).find('.highlight-me').animate({'backgroundColor': divScrollHighlight}, 300); 3200 var t = setTimeout( function(){ $(divScrollToAnchor).find('.highlight-me').animate({'backgroundColor': 'transparent'}, 300); }, 500 ); 3201 } else { 3202 $(divScrollToAnchor).animate({'backgroundColor': divScrollHighlight}, 300); 3203 var t = setTimeout( function(){ $(divScrollToAnchor).animate({'backgroundColor': 'transparent'}, 300); }, 500 ); 3204 } 3205 } 3206 }); 3207 3208 return false; 3209 }); 3210 }, 3211 3212 contactForm: function(){ 3213 3214 if( !$().validate ) { 3215 console.log('contactForm: Form Validate not Defined.'); 3216 return true; 3217 } 3218 3219 if( !$().ajaxSubmit ) { 3220 console.log('contactForm: jQuery Form not Defined.'); 3221 return true; 3222 } 3223 3224 var $contactForm = $('.contact-widget:not(.customjs)'); 3225 if( $contactForm.length < 1 ){ return true; } 3226 3227 $contactForm.each( function(){ 3228 var element = $(this), 3229 elementAlert = element.attr('data-alert-type'), 3230 elementLoader = element.attr('data-loader'), 3231 elementResult = element.find('.contact-form-result'), 3232 elementRedirect = element.attr('data-redirect'); 3233 3234 element.find('form').validate({ 3235 submitHandler: function(form) { 3236 3237 elementResult.hide(); 3238 3239 if( elementLoader == 'button' ) { 3240 var defButton = $(form).find('button'), 3241 defButtonText = defButton.html(); 3242 3243 defButton.html('<i class="icon-line-loader icon-spin nomargin"></i>'); 3244 } else { 3245 $(form).find('.form-process').fadeIn(); 3246 } 3247 3248 $(form).ajaxSubmit({ 3249 target: elementResult, 3250 dataType: 'json', 3251 success: function( data ) { 3252 if( elementLoader == 'button' ) { 3253 defButton.html( defButtonText ); 3254 } else { 3255 $(form).find('.form-process').fadeOut(); 3256 } 3257 if( data.alert != 'error' && elementRedirect ){ 3258 window.location.replace( elementRedirect ); 3259 return true; 3260 } 3261 if( elementAlert == 'inline' ) { 3262 if( data.alert == 'error' ) { 3263 var alertType = 'alert-danger'; 3264 } else { 3265 var alertType = 'alert-success'; 3266 } 3267 3268 elementResult.removeClass( 'alert-danger alert-success' ).addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 ); 3269 } else { 3270 elementResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html(''); 3271 SEMICOLON.widget.notifications( elementResult ); 3272 } 3273 if( $(form).find('.g-recaptcha').children('div').length > 0 ) { grecaptcha.reset(); } 3274 if( data.alert != 'error' ) { $(form).clearForm(); } 3275 } 3276 }); 3277 } 3278 }); 3279 3280 }); 3281 }, 3282 3283 subscription: function(){ 3284 3285 if( !$().validate ) { 3286 console.log('subscription: Form Validate not Defined.'); 3287 return true; 3288 } 3289 3290 if( !$().ajaxSubmit ) { 3291 console.log('subscription: jQuery Form not Defined.'); 3292 return true; 3293 } 3294 3295 var $subscribeForm = $('.subscribe-widget:not(.customjs)'); 3296 if( $subscribeForm.length < 1 ){ return true; } 3297 3298 $subscribeForm.each( function(){ 3299 var element = $(this), 3300 elementAlert = element.attr('data-alert-type'), 3301 elementLoader = element.attr('data-loader'), 3302 elementResult = element.find('.widget-subscribe-form-result'), 3303 elementRedirect = element.attr('data-redirect'); 3304 3305 element.find('form').validate({ 3306 submitHandler: function(form) { 3307 3308 elementResult.hide(); 3309 3310 if( elementLoader == 'button' ) { 3311 var defButton = $(form).find('button'), 3312 defButtonText = defButton.html(); 3313 3314 defButton.html('<i class="icon-line-loader icon-spin nomargin"></i>'); 3315 } else { 3316 $(form).find('.input-group-addon').find('.icon-email2').removeClass('icon-email2').addClass('icon-line-loader icon-spin'); 3317 } 3318
3319 $(form).ajaxSubmit({ 3320 target: elementResult, 3321 dataType: 'json', 3322 resetForm: true, 3323 success: function( data ) { 3324 if( elementLoader == 'button' ) { 3325 defButton.html( defButtonText ); 3326 } else { 3327 $(form).find('.input-group-addon').find('.icon-line-loader').removeClass('icon-line-loader icon-spin').addClass('icon-email2'); 3328 } 3329 if( data.alert != 'error' && elementRedirect ){ 3330 window.location.replace( elementRedirect ); 3331 return true; 3332 } 3333 if( elementAlert == 'inline' ) { 3334 if( data.alert == 'error' ) { 3335 var alertType = 'alert-danger'; 3336 } else { 3337 var alertType = 'alert-success'; 3338 } 3339 3340 elementResult.addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 ); 3341 } else { 3342 elementResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html(''); 3343 SEMICOLON.widget.notifications( elementResult ); 3344 } 3345 } 3346 }); 3347 } 3348 }); 3349 3350 }); 3351 }, 3352 3353 quickContact: function(){ 3354 3355 if( !$().validate ) { 3356 console.log('quickContact: Form Validate not Defined.'); 3357 return true; 3358 } 3359 3360 if( !$().ajaxSubmit ) { 3361 console.log('quickContact: jQuery Form not Defined.'); 3362 return true; 3363 } 3364 3365 var $quickContact = $('.quick-contact-widget:not(.customjs)'); 3366 if( $quickContact.length < 1 ){ return true; } 3367 3368 $quickContact.each( function(){ 3369 var element = $(this), 3370 elementAlert = element.attr('data-alert-type'), 3371 elementLoader = element.attr('data-loader'), 3372 elementResult = element.find('.quick-contact-form-result'), 3373 elementRedirect = element.attr('data-redirect'); 3374 3375 element.find('form').validate({ 3376 submitHandler: function(form) { 3377 3378 elementResult.hide(); 3379 $(form).animate({ opacity: 0.4 }); 3380 3381 if( elementLoader == 'button' ) { 3382 var defButton = $(form).find('button'), 3383 defButtonText = defButton.html(); 3384 3385 defButton.html('<i class="icon-line-loader icon-spin nomargin"></i>'); 3386 } else { 3387 $(form).find('.form-process').fadeIn(); 3388 } 3389 3390 $(form).ajaxSubmit({ 3391 target: elementResult, 3392 dataType: 'json', 3393 resetForm: true, 3394 success: function( data ) { 3395 $(form).animate({ opacity: 1 }); 3396 if( elementLoader == 'button' ) { 3397 defButton.html( defButtonText ); 3398 } else { 3399 $(form).find('.form-process').fadeOut(); 3400 } 3401 if( data.alert != 'error' && elementRedirect ){ 3402 window.location.replace( elementRedirect ); 3403 return true; 3404 } 3405 if( elementAlert == 'inline' ) { 3406 if( data.alert == 'error' ) { 3407 var alertType = 'alert-danger'; 3408 } else { 3409 var alertType = 'alert-success'; 3410 } 3411 3412 elementResult.addClass( 'alert ' + alertType ).html( data.message ).slideDown( 400 ); 3413 } else { 3414 elementResult.attr( 'data-notify-type', data.alert ).attr( 'data-notify-msg', data.message ).html(''); 3415 SEMICOLON.widget.notifications( elementResult ); 3416 } 3417 if( $(form).find('.g-recaptcha').children('div').length > 0 ) { grecaptcha.reset(); } 3418 } 3419 }); 3420 } 3421 }); 3422 3423 }); 3424 }, 3425 3426 ticker: function(){ 3427 3428 var $ticker = jQuery('.scw-ticker'); 3429 if( $ticker.length < 1 ){ return true; } 3430 3431 $ticker.each( function(){ 3432 3433 var element = $(this), 3434 elementItem = element.find('.scw-ticker-item'), 3435 tickerItemWidth = 0, 3436 tickerItemCount = elementItem.length, 3437 tickerWidth = 0, 3438 elementSpeed = element.attr('data-speed'), 3439 elementHover = element.attr('data-hover'), 3440 elementItems = element.attr('data-items'), 3441 elementItemsXl = element.attr('data-items-xl'), 3442 elementItemsLg = element.attr('data-items-lg'), 3443 elementItemsMd = element.attr('data-items-md'), 3444 elementItemsSm = element.attr('data-items-sm'), 3445 elementItemsXs = element.attr('data-items-xs'); 3446 3447 if( !elementItems ) { elementItems = 5; } 3448 if( !elementItemsXl ) { elementItemsXl = Number(elementItems); } 3449 if( !elementItemsLg ) { elementItemsLg = Number(elementItemsXl); } 3450 if( !elementItemsMd ) { elementItemsMd = Number(elementItemsLg); } 3451 if( !elementItemsSm ) { elementItemsSm = Number(elementItemsMd); } 3452 if( !elementItemsXs ) { elementItemsXs = Number(elementItemsSm); } 3453 3454 tickerItemWidth = windowWidth / elementItems; 3455 tickerWidth = ( tickerItemWidth * tickerItemCount ); 3456 3457 element.find('.scw-ticker-wrap').after('<div class="scw-ticker-wrap-clone"></div>'); 3458 3459 var elementWrap = element.find('.scw-ticker-wrap,.scw-ticker-wrap-clone'); 3460 3461 elementItem.css({ 'width':tickerItemWidth }); 3462 3463 setTimeout( function(){ 3464 elementWrap.css({ 'width': tickerWidth }); 3465 element.css({ 'width': (tickerWidth*2) }); 3466 elementItem.clone().appendTo( element.find('.scw-ticker-wrap-clone') ); 3467 }, 300); 3468 3469 if( !elementSpeed ) { elementSpeed = 30000; } 3470 if( elementHover == 'false' ) { elementHover = false; } else { elementHover = true; } 3471 3472 var speedFactor = tickerWidth / windowWidth; 3473 3474 elementWrap.css({ 'animation-duration': ( Number(elementSpeed)*speedFactor )+'ms' }); 3475 3476 if( elementHover == true ) { 3477 element.on( 'mouseover', function(){ 3478 elementWrap.addClass('scw-ticker-paused'); 3479 }); 3480 3481 element.on( 'mouseout', function(){ 3482 elementWrap.removeClass('scw-ticker-paused'); 3483 }); 3484 } 3485 }); 3486 3487 }, 3488 3489 stickySidebar: function(){ 3490 3491 if( !$().scwStickySidebar ) { 3492 console.log('stickySidebar: Sticky Sidebar is not Defined.'); 3493 return true; 3494 } 3495 3496 var $stickySidebar = jQuery('.sticky-sidebar-wrap'); 3497 if( $stickySidebar.length < 1 ){ return true; } 3498 3499 $stickySidebar.each( function(){ 3500 var element = $(this), 3501 elementTop = element.attr('data-offset-top'), 3502 elementBottom = element.attr('data-offset-bottom'); 3503 3504 if( !elementTop ) { elementTop = 110; } 3505 if( !elementBottom ) { elementBottom = 50; } 3506 3507 element.scwStickySidebar({ 3508 additionalMarginTop: Number( elementTop ), 3509 additionalMarginBottom: Number( elementBottom ) 3510 }); 3511 }); 3512 }, 3513 3514 cookieNotify: function(){ 3515 3516 if( !$.cookie ) { 3517 console.log('cookieNotify: Cookie Function not defined.'); 3518 return true; 3519 } 3520 3521 if( $cookieNotification.length > 0 ) { 3522 var cookieNotificationHeight = $cookieNotification.outerHeight(); 3523 3524 $cookieNotification.css({ bottom: -cookieNotificationHeight }); 3525 3526 if( $.cookie('websiteUsesCookies') != 'yesConfirmed' ) { 3527 $cookieNotification.css({ bottom: 0 }); 3528 } 3529 3530 $('.cookie-accept').click( function(){ 3531 $cookieNotification.css({ bottom: -cookieNotificationHeight });
3532 $.cookie('websiteUsesCookies', 'yesConfirmed', { expires: 30 }); 3533 return false; 3534 }); 3535 } 3536 }, 3537 3538 extras: function(){ 3539 3540 if( $().tooltip ) { 3541 $('[data-toggle="tooltip"]').tooltip({container: 'body'}); 3542 } else { 3543 console.log('extras: Bootstrap Tooltip not defined.'); 3544 } 3545 3546 if( $().popover ) { 3547 $('[data-toggle=popover]').popover(); 3548 } else { 3549 console.log('extras: Bootstrap Popover not defined.'); 3550 } 3551 3552 $('.style-msg').on( 'click', '.close', function(e){ 3553 $( this ).parents( '.style-msg' ).slideUp(); 3554 e.preventDefault(); 3555 }); 3556 3557 $('#primary-menu-trigger,#overlay-menu-close').click(function() { 3558 console.log("Menu click event called"); 3559 if( $('#primary-menu').find('ul.mobile-primary-menu').length > 0 ) { 3560 $( '#primary-menu > ul.mobile-primary-menu, #primary-menu > div > ul.mobile-primary-menu' ).toggleClass('d-block'); 3561 } else { 3562 $( '#primary-menu > ul, #primary-menu > div > ul' ).toggleClass('d-block'); 3563 } 3564 $body.toggleClass("primary-menu-open"); 3565 return false; 3566 }); 3567 $('#page-submenu-trigger').click(function() { 3568 $body.toggleClass('top-search-open', false); 3569 $pagemenu.toggleClass("pagemenu-active"); 3570 return false; 3571 }); 3572 $pagemenu.find('nav').click(function(e){ 3573 $body.toggleClass('top-search-open', false); 3574 $topCart.toggleClass('top-cart-open', false); 3575 }); 3576 if( SEMICOLON.isMobile.any() ){ 3577 $body.addClass('device-touch'); 3578 } 3579 // var el = { 3580 // darkLogo : $("<img>", {src: defaultDarkLogo}), 3581 // darkRetinaLogo : $("<img>", {src: retinaDarkLogo}) 3582 // }; 3583 // el.darkLogo.prependTo("body"); 3584 // el.darkRetinaLogo.prependTo("body"); 3585 // el.darkLogo.css({'position':'absolute','z-index':'-100'}); 3586 // el.darkRetinaLogo.css({'position':'absolute','z-index':'-100'}); 3587 } 3588 3589 }; 3590 3591 SEMICOLON.isMobile = { 3592 Android: function() { 3593 return navigator.userAgent.match(/Android/i); 3594 }, 3595 BlackBerry: function() { 3596 return navigator.userAgent.match(/BlackBerry/i); 3597 }, 3598 iOS: function() { 3599 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 3600 }, 3601 Opera: function() { 3602 return navigator.userAgent.match(/Opera Mini/i); 3603 }, 3604 Windows: function() { 3605 return navigator.userAgent.match(/IEMobile/i); 3606 }, 3607 any: function() { 3608 return (SEMICOLON.isMobile.Android() || SEMICOLON.isMobile.BlackBerry() || SEMICOLON.isMobile.iOS() || SEMICOLON.isMobile.Opera() || SEMICOLON.isMobile.Windows()); 3609 } 3610 }; 3611 3612 SEMICOLON.documentOnResize = { 3613 3614 init: function(){ 3615 3616 var t = setTimeout( function(){ 3617 SEMICOLON.header.topsocial(); 3618 SEMICOLON.header.fullWidthMenu(); 3619 SEMICOLON.header.overlayMenu(); 3620 SEMICOLON.initialize.fullScreen(); 3621 SEMICOLON.initialize.dataResponsiveHeights(); 3622 SEMICOLON.initialize.maxHeight(); 3623 SEMICOLON.initialize.verticalMiddle(); 3624 SEMICOLON.initialize.testimonialsGrid(); 3625 SEMICOLON.initialize.stickFooterOnSmall(); 3626 SEMICOLON.initialize.stickyFooter(); 3627 SEMICOLON.slider.sliderParallaxDimensions(); 3628 SEMICOLON.slider.captionPosition(); 3629 SEMICOLON.portfolio.arrange(); 3630 SEMICOLON.portfolio.portfolioDescMargin(); 3631 SEMICOLON.widget.tabsResponsiveResize(); 3632 SEMICOLON.widget.tabsJustify(); 3633 SEMICOLON.widget.html5Video(); 3634 SEMICOLON.widget.masonryThumbs(); 3635 SEMICOLON.initialize.dataResponsiveClasses(); 3636 if( $gridContainer.length > 0 ) { 3637 if( !$gridContainer.hasClass('.customjs') ) { 3638 if( $().isotope ) { 3639 $gridContainer.isotope('layout'); 3640 } else { 3641 console.log('documentOnResize > init: Isotope not defined.'); 3642 } 3643 } 3644 } 3645 if( $body.hasClass('device-xl') || $body.hasClass('device-lg') ) { 3646 $('#primary-menu').find('ul.mobile-primary-menu').removeClass('d-block'); 3647 } 3648 }, 500 ); 3649 3650 windowWidth = $window.width(); 3651 3652 } 3653 3654 }; 3655 3656 SEMICOLON.documentOnReady = { 3657 3658 init: function(){ 3659 SEMICOLON.initialize.init(); 3660 SEMICOLON.header.init(); 3661 if( $slider.length > 0 || $sliderElement.length > 0 ) { SEMICOLON.slider.init(); } 3662 if( $portfolio.length > 0 ) { SEMICOLON.portfolio.init(); } 3663 SEMICOLON.widget.init(); 3664 SEMICOLON.documentOnReady.windowscroll(); 3665 }, 3666 3667 windowscroll: function(){ 3668 3669 var headerOffset = 0, 3670 headerWrapOffset = 0, 3671 pageMenuOffset = 0; 3672 3673 3674 if( $header.length > 0 ) { headerOffset = $header.offset().top; } 3675 if( $header.length > 0 ) { headerWrapOffset = $headerWrap.offset().top; } 3676 if( $pagemenu.length > 0 ) { 3677 if( $header.length > 0 && !$header.hasClass('no-sticky') ) { 3678 if( $header.hasClass('sticky-style-2') || $header.hasClass('sticky-style-3') ) { 3679 pageMenuOffset = $pagemenu.offset().top - $headerWrap.outerHeight(); 3680 } else { 3681 pageMenuOffset = $pagemenu.offset().top - $header.outerHeight(); 3682 } 3683 } else { 3684 pageMenuOffset = $pagemenu.offset().top; 3685 } 3686 } 3687 3688 var headerDefinedOffset = $header.attr('data-sticky-offset'); 3689 if( typeof headerDefinedOffset !== 'undefined' ) { 3690 if( headerDefinedOffset == 'full' ) { 3691 headerWrapOffset = $window.height(); 3692 var headerOffsetNegative = $header.attr('data-sticky-offset-negative'); 3693 if( typeof headerOffsetNegative !== 'undefined' ) { headerWrapOffset = headerWrapOffset - headerOffsetNegative - 1; } 3694 } else { 3695 headerWrapOffset = Number(headerDefinedOffset); 3696 } 3697 } 3698 3699 SEMICOLON.header.stickyMenu( headerWrapOffset ); 3700 SEMICOLON.header.stickyPageMenu( pageMenuOffset ); 3701 3702 $window.on( 'scroll', function(){ 3703 3704 SEMICOLON.initialize.goToTopScroll(); 3705 $('body.open-header.close-header-on-scroll').removeClass("side-header-open"); 3706 SEMICOLON.header.stickyMenu( headerWrapOffset ); 3707 SEMICOLON.header.stickyPageMenu( pageMenuOffset ); 3708 SEMICOLON.header.logo(); 3709 3710 }); 3711 3712 window.addEventListener('scroll', onScrollSliderParallax, false); 3713 3714 if( $onePageMenuEl.length > 0 ){ 3715 if( $().scrolled ) { 3716 $window.scrolled(function() { 3717 SEMICOLON.header.onepageScroller(); 3718 }); 3719 } else { 3720 console.log('windowscroll: Scrolled Function not defined.'); 3721 } 3722 } 3723 } 3724 3725 }; 3726 3727 SEMICOLON.documentOnLoad = { 3728 3729 init: function(){ 3730 SEMICOLON.slider.captionPosition(); 3731 SEMICOLON.slider.swiperSliderMenu(true); 3732 SEMICOLON.slider.revolutionSliderMenu(true); 3733 SEMICOLON.initialize.maxHeight(); 3734 SEMICOLON.initialize.testimonialsGrid(); 3735 SEMICOLON.initialize.verticalMiddle(); 3736 SEMICOLON.initialize.stickFooterOnSmall(); 3737 SEMICOLON.initialize.stickyFooter(); 3738 SEMICOLON.portfolio.gridInit( $gridContainer ); 3739 SEMICOLON.portfolio.filterInit(); 3740 SEMICOLON.portfolio.shuffleInit(); 3741 SEMICOLON.portfolio.arrange(); 3742 SEMICOLON.portfolio.portfolioDescMargin(); 3743 SEMICOLON.widget.parallax(); 3744 SEMICOLON.widget.loadFlexSlider(); 3745 SEMICOLON.widget.html5Video(); 3746 SEMICOLON.widget.masonryThumbs(); 3747 SEMICOLON.widget.ticker(); 3748 SEMICOLON.header.topsocial(); 3749 SEMICOLON.header.responsiveMenuClass(); 3750 SEMICOLON.initialize.modal(); 3751 } 3752 3753 }; 3754 3755 var $window = $(window), 3756 $body = $('body'), 3757 $wrapper = $('#wrapper'), 3758 $header = $('#header'), 3759 $headerWrap = $('#header-wrap'), 3760 $content = $('#content'), 3761 $footer = $('#footer'), 3762 windowWidth = $window.width(), 3763 oldHeaderClasses = $header.attr('class'), 3764 oldHeaderWrapClasses = $headerWrap.attr('class'), 3765 stickyMenuClasses = $header.attr('data-sticky-class'),
3766 responsiveMenuClasses = $header.attr('data-responsive-class'), 3767 defaultLogo = $('#logo').find('.standard-logo'), 3768 defaultLogoWidth = defaultLogo.find('img').outerWidth(), 3769 retinaLogo = $('#logo').find('.retina-logo'), 3770 defaultLogoImg = defaultLogo.find('img').attr('src'), 3771 retinaLogoImg = retinaLogo.find('img').attr('src'), 3772 defaultDarkLogo = defaultLogo.attr('data-dark-logo'), 3773 retinaDarkLogo = retinaLogo.attr('data-dark-logo'), 3774 defaultStickyLogo = defaultLogo.attr('data-sticky-logo'), 3775 retinaStickyLogo = retinaLogo.attr('data-sticky-logo'), 3776 defaultMobileLogo = defaultLogo.attr('data-mobile-logo'), 3777 retinaMobileLogo = retinaLogo.attr('data-mobile-logo'), 3778 $pagemenu = $('#page-menu'), 3779 $onePageMenuEl = $('.one-page-menu'), 3780 onePageGlobalOffset = 0, 3781 $portfolio = $('.portfolio'), 3782 $shop = $('.shop'), 3783 $gridContainer = $('.grid-container'), 3784 $slider = $('#slider'), 3785 $sliderParallaxEl = $('.slider-parallax'), 3786 $sliderElement = $('.slider-element'), 3787 swiperSlider = '', 3788 $pageTitle = $('#page-title'), 3789 $portfolioItems = $('.portfolio-ajax').find('.portfolio-item'), 3790 $portfolioDetails = $('#portfolio-ajax-wrap'), 3791 $portfolioDetailsContainer = $('#portfolio-ajax-container'), 3792 $portfolioAjaxLoader = $('#portfolio-ajax-loader'), 3793 $portfolioFilter = $('.portfolio-filter,.custom-filter'), 3794 prevPostPortId = '', 3795 $topSearch = $('#top-search'), 3796 $topCart = $('#top-cart'), 3797 $verticalMiddleEl = $('.vertical-middle'), 3798 $topSocialEl = $('#top-social').find('li'), 3799 $siStickyEl = $('.si-sticky'), 3800 $dotsMenuEl = $('.dots-menu'), 3801 $goToTopEl = $('#gotoTop'), 3802 $fullScreenEl = $('.full-screen'), 3803 $commonHeightEl = $('.common-height'), 3804 $testimonialsGridEl = $('.testimonials-grid'), 3805 $pageSectionEl = $('.page-section'), 3806 $owlCarouselEl = $('.owl-carousel'), 3807 $parallaxEl = $('.parallax'), 3808 $parallaxPageTitleEl = $('.page-title-parallax'), 3809 $parallaxPortfolioEl = $('.portfolio-parallax').find('.portfolio-image'), 3810 $textRotaterEl = $('.text-rotater'), 3811 $cookieNotification = $('#cookie-notification'); 3812 3813 $(document).ready( SEMICOLON.documentOnReady.init ); 3814 $window.on( 'load', SEMICOLON.documentOnLoad.init ); 3815 $window.on( 'resize', SEMICOLON.documentOnResize.init ); 3816 3817})(jQuery); 3818 3819 3820$(document).ready(function(){ 3821 $('#adFooter .fa-times').delay(15000).fadeIn(300); 3822 $('#adFooter .fa-times').on('click', function(){ 3823 $(this).fadeOut(200); 3824 $('.fa-arrow-up').fadeIn(200); 3825 $('#adFooter').animate({ bottom: "-148px" }, 500); 3826 $('footer').animate({paddingBottom: "0"}, 500); 3827 $('.backTop').animate({ bottom: "40px" }, 500); 3828 }); 3829 $('#adFooter .fa-arrow-up').on('click', function(){ 3830 $(this).fadeOut(200); 3831 $('.fa-times').fadeIn(200); 3832 $('#adFooter').animate({ bottom: "0px" }, 500); 3833 $('footer').animate({paddingBottom: "150px"}, 500); 3834 $('.backTop').animate({ bottom: "200px" }, 500); 3835 }); 3836}); 3837 3838/* ======================================================================= 3839 Module Menu 3840==========================================================================*/ 3841$(document).ready(function(){ 3842 /*$('li.parent a i.fa').on('click', function(){ 3843 event.preventDefault(); 3844 $(this).parents('li').toggleClass('open'); 3845 $(this).toggleClass('fa-angle-down').toggleClass('fa-angle-up'); 3846 });*/ 3847}); 3848 3849 3850$(document).ready(function(){ 3851 $('li.parent a i.fa').on('click', function(){ 3852 event.preventDefault(); 3853 var hasclass = $(this).hasClass('fa-angle-down'); 3854 3855 if (hasclass == true){ 3856 $(this).toggleClass('fa-angle-down').toggleClass('fa-angle-up'); 3857 $(this).parent().parent().addClass('open'); 3858 $(this).parent().parent().parent().find('> ul').addClass('open'); 3859 } else { 3860 $(this).toggleClass('fa-angle-down').toggleClass('fa-angle-up'); 3861 $(this).parent().parent().removeClass('up'); 3862 $(this).parent().parent().parent().find('> ul').removeClass('open'); 3863 } 3864 }); 3865}); 3866 3867/* ======================================================================= 3868End Module Menu 3869==========================================================================*/ 3870 3871/* ======================================================================= 3872 Show Sticky side filters 3873==========================================================================*/ 3874$(document).ready(function() { 3875 $('.sticky-sidebar').on('click',function(){ 3876 $(this).toggleClass('openMenu'); 3877 }); 3878 3879 3880}); 3881 3882/* ======================================================================= 3883 Show Sticky side filters end 3884==========================================================================*/ 3885 3886/* =======================================================================
3887 Sticky Accessibility Bar 3888==========================================================================*/ 3889 3890$(function(){ 3891 var headNotSticky = $('#header.no-sticky').length; 3892 var nostickWebsite = $('#content01 #accessibilityBar').length; 3893 3894 console.log(headNotSticky); 3895 console.log('No stick web' + nostickWebsite); 3896 if (headNotSticky > 0 && nostickWebsite < 0){ 3897 $('#accessibilityBar').addClass('sticky'); 3898 var accessSticky = $('#accessibilityBar.sticky').length; 3899 if (accessSticky > 0){ 3900 3901 $(window).scroll(function(){ 3902 var scrollTop = $(window).scrollTop(), 3903 elementOffset = $('#content01').offset().top, 3904 adjustOffset = elementOffset + 40; 3905 distance = (elementOffset - scrollTop); 3906 3907 paddingTop = $('#content01').css('padding-top','+60'); 3908 console.log(paddingTop); 3909 if (distance < 0){ 3910 3911 var winTop = $(window).scrollTop(), 3912 contTop = $('#content01').offset().top; 3913 margin = (winTop - contTop); 3914 marginTop = margin + 'px'; 3915 3916 $("#accessibilityBar.sticky").addClass('stickyNow'); 3917 $("#accessibilityBar.sticky").css('margin-top', marginTop); 3918 $('#content01').css('padding-top','+60');; 3919 3920 } else if (distance > 0) { 3921 3922 $("#accessibilityBar.sticky").removeClass('stickyNow'); 3923 $('#content01').css('padding-top','-60'); 3924 $("#accessibilityBar.sticky").css('margin-top', '0px'); 3925 3926 } 3927 }); 3928 } 3929 } 3930 3931}); 3932 3933/* ======================================================================= 3934End Sticky Accessibility Bar 3935==========================================================================*/ 3936 3937/* ======================================================================= 3938 Template Selector 3939 ========================================================================*/ 3940 3941/* Create Paramater Search in URL */ 3942$.urlParam = function(name){ 3943 var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); 3944 if (results != null){ 3945 return results[1] || 0; 3946 } 3947} 3948 3949$(document).ready(function(){ 3950 3951 $('.templateContainer h4').on('click', function(){ 3952 $('.templateContainer').toggleClass('closed'); 3953 $('.templateContainer i').toggleClass('fa-angle-double-down').toggleClass('fa-angle-double-up'); 3954 }); 3955 3956 var vh = $.urlParam('vh'); 3957 var vf = $.urlParam('vf'); 3958 var vs = $.urlParam('vs'); 3959 3960 if (vh != null){ 3961 $('#headerSelect').val(vh); 3962 } 3963 if (vh != null){ 3964 $('#footerSelect').val(vf); 3965 } 3966 if (vh != null){ 3967 $('#sliderSelect').val(vs); 3968 } 3969 3970 $('#templatePreview').on('click', function(){ 3971 var valHead = $('#headerSelect').val(); 3972 var valFooter = $('#footerSelect').val(); 3973 var valSlider = $('#sliderSelect').val(); 3974 var location = window.location.href.split('?')[0]; 3975 3976 window.location.href = location + '?vh=' + valHead + '&vf=' + valFooter + '&vs=' + valSlider; 3977 3978 3979 }); 3980 3981 $( "#templateSelector" ).draggable({ handle: ".moveIcon" }); 3982}); 3983 3984/* ======================================================================= 3985 Schoolzine Website 3986 ========================================================================*/ 3987// Region Select Editor 3988$(document).ready(function(){ 3989 url = window.location.hostname; 3990 if (url == 'blueprint.schoolzine.local'){ 3991 $('.regionSelect a.topRegion').html('<i class="icon-globe"></i> Australia/Oceania <i class="icon-caret-down"></i>'); 3992 $('#loginBtn a').attr('href', 'https://schoolzineplus.co.uk'); 3993 } else if (url == 'schoolzine.com.au'){ 3994 $('.regionSelect a.topRegion').html('<i class="icon-globe"></i> Australia/Oceania <i class="icon-caret-down"></i>'); 3995 $('#loginBtn a').attr('href', 'https://schoolzineplus.com'); 3996 } else if (url == 'schoolzine.co.uk'){ 3997 $('.regionSelect a.topRegion').html('<i class="icon-globe"></i> Europe <i class="icon-caret-down"></i>'); 3998 $('#loginBtn a').attr('href', 'https://schoolzineplus.co.uk'); 3999 } else if (url == 'schoolzine.com'){ 4000 $('.regionSelect a.topRegion').html('<i class="icon-globe"></i> Region Select <i class="icon-caret-down"></i>'); 4001 $('#loginBtn a').attr('href', 'https://schoolzineplus.com'); 4002 } else { 4003 $('.regionSelect a.topRegion').html('<i class="icon-globe"></i> Region Select <i class="icon-caret-down"></i>'); 4004 $('#loginBtn a').attr('href', 'https://schoolzineplus.com'); 4005 } 4006 4007 4008}); 4009 4010/* ======================================================================= 4011End Schoolzine Website 4012==========================================================================*/ 4013 4014 4015 4016/* ======================================================================= 4017 Knowledgebase Scripts 4018 ========================================================================*/ 4019 4020/* KB Sticky Header */ 4021 4022$(window).scroll(function() { 4023 var heightmarker = $("#header-wrap").height(); 4024 var height = $(window).scrollTop(); 4025 if(height > heightmarker) { 4026 $("#kbstickyHeader").css( "top", '0px' ); 4027 } 4028 if(height < heightmarker) { 4029 $("#kbstickyHeader").css( "top", '-100px' ); 4030 } 4031}); 4032 4033//On DOM ready 4034$(function() { 4035 4036 /* Close sticky header */ 4037 jQuery('#kbstickyHeader .fa-times').click(function() { 4038 jQuery('#kbstickyHeader').slideUp(); 4039 }); 4040 4041 /* Close important message*/ 4042 jQuery('.important-message-close').click(function() { 4043 jQuery('.important-message').fadeOut(); 4044 }); 4045 4046 /* Side Menu*/ 4047 $('.kb-categories .kb-categories-btn i').click(function(e) { 4048 var $parent = $(this).parent().parent(); 4049 4050 if($parent.children('.kb-article').length > 0) { 4051 $('.kb-article').slideUp(300); 4052 $('.trans-up').removeClass('open'); 4053 4054 var $submenu = $parent.children('.kb-article'); 4055 var $arrow = $(this).parent().find('.trans-up'); 4056 4057 if ($submenu.is(':hidden')) { 4058 $submenu.slideDown(300); 4059 $arrow.toggleClass('open'); 4060 } 4061 } 4062 4063 }); 4064 4065 $(window).scroll(function(e) { 4066 if($(this).scrollTop() >= 100) { 4067 $('.top-button').show(); 4068 } else { 4069 $('.top-button').hide(); 4070 } 4071 }); 4072 4073 /* Back to top button*/ 4074 $('.top-button').click(function() { 4075 $('body, html').animate({scrollTop : 0}, 500); 4076 }); 4077 4078 /* Feedback buttons */ 4079 $('input[name="feedback"]').change(function(){ 4080 if($(this).val() === "yes") { 4081 $(".feedback-yes").slideDown();
4082 $(".feedback-no").slideUp(); 4083 } 4084 else { 4085 if($(this).val() === "no") { 4086 $(".feedback-no").slideDown(); 4087 $(".feedback-yes").slideUp(); 4088 } 4089 } 4090 }); 4091 4092 /* Mobile Menu */ 4093 $('.sub-nav-bar .fa-bars').click(function() { 4094 $('.kb-categories-mobile').slideToggle(300); 4095 }); 4096}); 4097 4098$(window).resize(function() { 4099 if ($(this).width() > 1182) { 4100 $('.kb-categories-mobile').hide(); 4101 } 4102}); 4103 4104 4105/* status*/ 4106jQuery(document).ready(function() { 4107 $( ".system-status-notes").hide(); 4108 4109 $('#system-status .system-status-title').click(function() { 4110 $('.system-status-notes').slideUp(300); 4111 $('.trans-up').removeClass('open'); 4112 4113 var submenu = $(this).parent().find('.system-status-notes'); 4114 var arrow = $(this).find('.trans-up'); 4115 if ( $(submenu).is(':hidden') ) { 4116 $(submenu).slideDown(300); 4117 $(arrow).toggleClass('open'); 4118 } 4119 4120 }); 4121 // Remove last Divider from sidebar_2.twig for newsletters 4122 $('.dividerBorderBottom:last').removeClass('dividerBorderBottom'); 4123 4124 $('#accessibilityButton').on('click', function(){ 4125 $('#accessibilityBar').toggleClass('d-block'); 4126 }); 4127 4128 4129 $('.megaSubHover a').hover(function() { 4130 var classType = $(this).attr('class'); 4131 $('.megaSubMenu').fadeOut(0); 4132 $('.megaSubMenu.'+ classType).fadeIn(0); 4133 }); 4134 4135}); 4136 4137 4138 4139 4140 4141 4142/* ======================================================================= 4143 End of Knowledgebase Scripts 4144 ========================================================================*/ 4145 4146 4147 4148/* ======================================================================= 4149 PDF Scripts 4150 ========================================================================*/ 4151 4152/** 4153 * Generate a PDF via Gotenberg (Chromium-based). 4154 * Extracts the print-cb URL from the printUrl format, POSTs it to Gotenberg's 4155 * URL-to-PDF endpoint, and opens the resulting PDF in a new browser tab. 4156 * 4157 * The new tab is opened synchronously (inside the click gesture) to avoid 4158 * popup blockers, then navigated to the blob URL once the PDF arrives. 4159 * 4160 * @param {string} printUrl - The print URL containing a base64-encoded print-cb URL 4161 */ 4162function get_pdf_gotenberg(printUrl) { 4163 // Show loading spinner 4164 $('.get-print-publication i').removeClass('fa-print').addClass('fa-spinner fa-spin'); 4165 4166 // Open the tab now, while we're still in the synchronous click handler. 4167 // Browsers allow window.open() here because the call stack traces back 4168 // to a trusted user gesture. Opening later (in the XHR callback) would 4169 // be blocked by popup blockers. 4170 var pdfTab = window.open('about:blank', '_blank'); 4171 if (pdfTab) { 4172 pdfTab.document.title = 'Generating PDFâ¦'; 4173 pdfTab.document.body.innerHTML = '<p style="font-family:sans-serif;text-align:center;margin-top:40vh;color:#666;">Generating PDF…</p>'; 4174 } 4175 4176 // POST to same-origin proxy to avoid CORS issues. 4177 // The PHP endpoint handles all Gotenberg communication server-side. 4178 var xhr = new XMLHttpRequest(); 4179 xhr.open('POST', '/newsletter/_print_gotenberg', true); 4180 xhr.responseType = 'blob'; 4181 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 4182 4183 xhr.onload = function() { 4184 $('.get-print-publication i').removeClass('fa-spinner fa-spin').addClass('fa-print'); 4185 4186 if (xhr.status === 200) { 4187 var pdfBlob = xhr.response; 4188 var pdfUrl = URL.createObjectURL(pdfBlob); 4189 4190 if (pdfTab && !pdfTab.closed) { 4191 pdfTab.location.href = pdfUrl; 4192 } else { 4193 // Tab was closed or blocked â fall back to download 4194 var a = document.createElement('a'); 4195 a.href = pdfUrl; 4196 a.download = 'newsletter_' + new Date().toISOString().slice(0, 10) + '.pdf'; 4197 a.style.display = 'none'; 4198 document.body.appendChild(a); 4199 a.click(); 4200 document.body.removeChild(a); 4201 } 4202 4203 setTimeout(function() { URL.revokeObjectURL(pdfUrl); }, 60000); 4204 } else { 4205 if (pdfTab && !pdfTab.closed) { 4206 pdfTab.document.body.innerHTML = '<p style="font-family:sans-serif;text-align:center;margin-top:40vh;color:#c00;">PDF generation failed. Please close this tab and try again.</p>'; 4207 } 4208 console.error('Gotenberg PDF generation failed:', xhr.status, xhr.statusText); 4209 alert('PDF generation failed. Please try again later.'); 4210 } 4211 }; 4212 4213 xhr.onerror = function() { 4214 $('.get-print-publication i').removeClass('fa-spinner fa-spin').addClass('fa-print'); 4215 if (pdfTab && !pdfTab.closed) { 4216 pdfTab.document.body.innerHTML = '<p style="font-family:sans-serif;text-align:center;margin-top:40vh;color:#c00;">PDF generation failed. Please close this tab and try again.</p>'; 4217 } 4218 console.error('Gotenberg PDF request failed'); 4219 alert('PDF generation failed. Please try again later.'); 4220 }; 4221 4222 xhr.send('print_url=' + encodeURIComponent(printUrl)); 4223} 4224 4225/** 4226 * Extract the inner print-cb URL from the encoded printUrl format. 4227 * printUrl format: {printServer}/newsletter/_print/{base64(innerUrl)}?session_id=X 4228 * Returns the decoded inner URL (e.g. https://school.schoolzineplus.com/newsletter/publication/1/newsletter/25/print-cb) 4229 */ 4230function extractPrintCbUrl(printUrl) { 4231 try { 4232 // Find the base64 portion between /_print/ and ?session_id (or end of string) 4233 var match = printUrl.match(/\/_print\/([A-Za-z0-9+/=]+)/); 4234 if (match && match[1]) { 4235 return atob(match[1]); 4236 } 4237 } catch (e) { 4238 console.error('Failed to extract print-cb URL:', e); 4239 } 4240 return null; 4241} 4242 4243/** 4244 * Open the print preview page with the customiser ribbon. 4245 * Instead of immediately generating a PDF, opens the print-cb page 4246 * directly so the user can adjust settings before generating. 4247 */ 4248function openPrintPreview(printUrl) { 4249 // If this is already a direct print-cb/print-diy/print-unified URL (no base64 wrapper), just open it 4250 if ((printUrl.indexOf('/print-cb') !== -1 || printUrl.indexOf('/print-diy') !== -1 || printUrl.indexOf('/print-unified') !== -1) 4251 && printUrl.indexOf('/_print/') === -1) { 4252 // Check for any preview param (preview=1 or preview=true) 4253 var hasPreview = printUrl.indexOf('preview=1') !== -1 || printUrl.indexOf('preview=true') !== -1; 4254 if (hasPreview) { 4255 // Replace preview=true with preview=1 so the JS ribbon check works 4256 var previewUrl = printUrl.replace('preview=true', 'preview=1'); 4257 window.open(previewUrl, '_blank', 'noopener'); 4258 } else { 4259 var separator = printUrl.indexOf('?') !== -1 ? '&' : '?'; 4260 window.open(printUrl + separator + 'preview=1', '_blank', 'noopener'); 4261 } 4262 return; 4263 } 4264 4265 var innerUrl = extractPrintCbUrl(printUrl); 4266 if (!innerUrl) { 4267 // Fallback: generate PDF directly 4268 get_pdf_gotenberg(printUrl); 4269 return; 4270 } 4271 4272 // Only use preview mode for Content Builder (print-cb), DIY (print-diy), 4273 // and Unified (print-unified) templates. 4274 // Other print templates don't have the preview ribbon. 4275 if (innerUrl.indexOf('/print-cb') === -1 && innerUrl.indexOf('/print-diy') === -1 && innerUrl.indexOf('/print-unified') === -1) { 4276 get_pdf_gotenberg(printUrl); 4277 return; 4278 } 4279 4280 // Replace preview=true with preview=1 so the JS ribbon check works, 4281 // then add preview=1 only if no preview param exists yet 4282 innerUrl = innerUrl.replace('preview=true', 'preview=1'); 4283 var separator = innerUrl.indexOf('?') !== -1 ? '&' : '?'; 4284 var previewUrl = innerUrl.indexOf('preview=1') !== -1 ? innerUrl : innerUrl + separator + 'preview=1'; 4285 4286 // Open in a new tab â the print-cb page will show with the ribbon 4287 window.open(previewUrl, '_blank', 'noopener'); 4288} 4289 4290function get_pdf(printUrl) { 4291 if (printUrl != null) { 4292 openPrintPreview(printUrl); 4293 } 4294} 4295 4296function get_pdf_non_newsletter(printUrl) { 4297 if (printUrl != null) { 4298 openPrintPreview(printUrl); 4299 } 4300} 4301 4302function printByPublication(pub_url) { 4303 // Publication-level print is not supported via Gotenberg yet 4304 window.console && console.log("PUB PRINT: " + pub_url); 4305} 4306 4307//On DOM ready 4308$(function() { 4309 4310 //-- PRINT NEWSLETTER 4311 $("body").on('click', '.get-print a', function(e){ 4312 var printUrl = $(this).attr('data-print-url'); 4313 get_pdf(printUrl); 4314 }); 4315 4316 $("body").on('click', '.get-print-publication a', function(e){ 4317 var printUrl = $(this).attr('data-print-url'); 4318 get_pdf_non_newsletter(printUrl); 4319 }); 4320 4321 $("body").on('click', '.get-print-publication-all a', function(e){ 4322 if (typeof publicationSearchUrl !== 'undefined') { 4323 window.console && console.log("Print publication "+publicationSearchUrl); 4324 printByPublication(publicationSearchUrl); 4325 }else{ 4326 window.console && console.log("No publicationSearchUrl"); 4327 } 4328 4329 }); 4330 4331}); 4332 4333 4334/* ======================================================================= 4335 End of PDF Scripts 4336 ========================================================================*/ 4337 4338 4339 4340numberOfGalleriesToLoad = jQuery('.sz-gallery').length; 4341jQuery(document).ready(function() { 4342 jQuery('.sz-gallery').each(function() { 4343 var array = jQuery(this).attr('data-parameters').split(','); 4344 var parameters = {}; 4345 4346 jQuery.each(array, function(key, value) { 4347 var split = value.split(':'); 4348 4349 if (!isNaN(Number(split[1]))) {
4350 split[1] = Number(split[1]); 4351 } else if (split[1] === "true" || split[1] === "false") { 4352 split[1] = (split[1] === "true"); 4353 } else { 4354 split[1] = String(split[1]); 4355 } 4356 parameters[split[0]] = split[1]; 4357 }); 4358 $.when( jQuery(this).unitegallery(parameters) ).then(function( data, textStatus, jqXHR ) { 4359 numberOfGalleriesComplete ++; 4360 }); 4361 4362 }); 4363}); 4364/* ======================================================================= 4365 Menu navigation issue 4366 ========================================================================*/ 4367// Space bar press navigation function - start// 4368 function navMenuItem(e){ 4369 4370 if(e.shiftKey && e.which == 32){ 4371 e.preventDefault(); 4372 // Shift tab 4373 $($(e.target.parentElement)[0]).removeClass('active'); 4374 4375 let currentEleTitle = e.target.title; 4376 console.log(e.target.parentElement.nodeName); 4377 let childElements = e.target.parentElement.nodeName == 'LI'? e.target.parentElement.parentElement.childNodes : e.target.parentElement.childNodes; 4378 4379 childElements.forEach(element => { 4380 if((element.nodeName == 'A' && element.title && element.title == currentEleTitle) || (element.nodeName == 'LI' && element.firstElementChild && element.firstElementChild.title == currentEleTitle)){ 4381 if(element.previousElementSibling == null){ 4382 $(element.parentElement.parentElement).addClass('active'); 4383 $(element.parentElement.parentElement)[0].children[0].focus(); 4384 } 4385 else{ 4386 $(element.previousElementSibling).addClass('active'); 4387 $(element.previousElementSibling)[0].children[0].focus(); 4388 } 4389 } 4390 }); 4391 } 4392 //Spacebar 4393 else if(e.which == 32){ 4394 e.preventDefault(); 4395 $($(e.target.parentElement)[0]).removeClass('active'); 4396 4397 let currentEleTitle = e.target.title; 4398 let childElements = e.target.parentElement.children.length > 1? e.target.parentElement.childNodes : e.target.parentElement.parentElement.childNodes; 4399 let focusNextEle = false; 4400 4401 childElements.forEach(element => { 4402 if(focusNextEle){ 4403 if(element.className && element.className.indexOf('nav-submenu') > -1){ 4404 if($($(element.firstElementChild)[0])[0].nodeName == 'A'){ 4405 $(element).addClass('active'); 4406 $(element)[0].children[0].focus(); 4407 focusNextEle = false; 4408 } 4409 else{ 4410 $($(element.firstElementChild)[0]).addClass('active'); 4411 $(element.firstElementChild)[0].children[0].focus(); 4412 focusNextEle = false; 4413 } 4414 } 4415 else if(element.nodeName != '#text'){ 4416 $(element).addClass('active'); 4417 $(element)[0].children[0].focus(); 4418 focusNextEle = false; 4419 } 4420 } 4421 if((element.nodeName == 'A' && element.title && element.title == currentEleTitle) || (element.nodeName == 'LI' && element.firstElementChild && element.firstElementChild.title == currentEleTitle)){ 4422 focusNextEle = true; 4423 } 4424 }); 4425 4426 if(focusNextEle){ 4427 $(e.target.parentElement.parentElement.parentElement.nextElementSibling).addClass('active'); 4428 $(e.target.parentElement.parentElement.parentElement.nextElementSibling)[0].children[0].focus(); 4429 } 4430 } 4431 else if(e.which == 13){ 4432 // Enter 4433 e.target.click(); 4434 4435 } 4436 }// Space bar press navigation function - END// 4437 4438$(document).ready(function(){ 4439 4440 //Menu Navigation -start // 4441 $('#primary-menu ul.sf-js-enabled li > ul ').addClass("nav-submenu"); 4442 $('#primary-menu ul.sf-js-enabled li').keydown(function(e){ 4443 if (e.which == 9){ 4444 console.log("test -tab"); 4445 $('#primary-menu ul.sf-js-enabled li.sub-menu ul').css({"display": "none"}); 4446 4447 } 4448 else { 4449 navMenuItem(e); 4450 4451 } 4452 4453 $('#Search').on('focus', function(){ 4454 $('body').addClass('top-search-open'); 4455 }); 4456 }); 4457//Menu Navigation -END // 4458 4459 // feature text issue resolved by below to functions - Sneha -End 4460 4461 //Danish h1 margin-left fixes start 4462 /*var h1_value = $("#content01 .content-wrap h1").text(); 4463 if ($('#content01 .content-wrap .container').find('.postcontent').length) { 4464 // found! 4465 //console.log('Hello found'); 4466 } 4467 else{ 4468 4469 $('#content01 .content-wrap h1').remove(); 4470 $("#content01 .clearfix.container.content-wrap").prepend('<h1>'+h1_value+'</h1>'); 4471 }*/ 4472 //Danish h1 margin-left fixes end 4473 4474 }); 4475 4476 4477$(document).ready(function() { 4478
4479 $('.increaseZooom').on('click', function(){ 4480 if (zoomLevel < 1.5){ 4481 updateZoom(0.1); 4482 SEMICOLON.slider.sliderParallaxDimensions(); 4483 } 4484 }); 4485 $('.decreaseZoom').on('click', function(){ 4486 if (zoomLevel > 1){ 4487 updateZoom(-0.1); 4488 SEMICOLON.slider.sliderParallaxDimensions(); 4489 } 4490 }); 4491}); 4492 4493var zoomLevel = 1; 4494 4495var updateZoom = function(zoom) { 4496 zoomLevel += zoom; 4497 $('body').css({ zoom: zoomLevel, '-moz-transform': 'scale(' + zoomLevel + ')' }); 4498} 4499 4500// Comprehensive keyboard accessibility for navigation elements 4501$(document).ready(function() { 4502 // 1. Make the font size controls and search icon keyboard accessible 4503 $('.font-increase, .font-decrease').attr({ 4504 'tabindex': '0', 4505 'role': 'button', 4506 'aria-label': function() { 4507 // Published translation attributes must retain their captured source. 4508 if (/(^|,)\s*aria-label:/.test(this.getAttribute('data-et-attr') || '')) { 4509 return this.getAttribute('aria-label'); 4510 } 4511 return $(this).hasClass('font-increase') ? 'Increase font size' : 'Decrease font size'; 4512 } 4513 }); 4514 4515 // Make the search trigger focusable 4516 $('#top-search-trigger').attr({ 4517 'tabindex': '0', 4518 'role': 'button', 4519 'aria-label': 'Search' 4520 }); 4521 4522 // Ensure sidebar links are keyboard focusable 4523 $('.sidebar a, .sidebar .sideNav a, .sidebar .media-item').attr('tabindex', '0'); 4524 4525 // 2. Add keyboard activation via Enter/Space for font controls 4526 // Preserve native Tab order, including the newsletter widget's shadow DOM. 4527 $('.font-increase, .font-decrease').on('keydown', function(e) { 4528 if (e.which !== 13 && e.which !== 32) return; 4529 e.preventDefault(); 4530 var increase = $(this).hasClass('font-increase'); 4531 if ((increase && zoomLevel < 1.5) || (!increase && zoomLevel > 1)) { 4532 updateZoom(increase ? 0.1 : -0.1); 4533 SEMICOLON.slider.sliderParallaxDimensions(); 4534 } 4535 }); 4536 4537 // Add keyboard support for search icon 4538 $('#top-search-trigger').on('keydown', function(e) { 4539 if (e.which === 13 || e.which === 32) { // Enter or Space 4540 e.preventDefault(); 4541 $(this).click(); 4542 setTimeout(function() { 4543 $('#search_phrase').focus(); 4544 }, 50); 4545 return false; 4546 } 4547 }); 4548 4549 // Make sure the print button is properly set up for accessibility 4550 $('.get-print-publication a').attr({ 4551 'role': 'button', 4552 'aria-label': 'Print newsletter', 4553 'tabindex': '0' 4554 }); 4555 4556 // Add keyboard support for print button 4557 $('.get-print-publication a').on('keydown', function(e) { 4558 if (e.which === 13 || e.which === 32) { // Enter or Space to activate 4559 e.preventDefault(); 4560 var printUrl = $(this).attr('data-print-url'); 4561 if (printUrl) { 4562 get_pdf(printUrl); 4563 } else { 4564 get_pdf_non_newsletter(null); 4565 } 4566 return false; 4567 } 4568 }); 4569 4570 // 3. Add visible focus styles for all important elements 4571 $("<style>") 4572 .prop("type", "text/css") 4573 .html(` 4574 .font-increase:focus, 4575 .font-decrease:focus, 4576 #top-search-trigger:focus, 4577 .get-print-publication a:focus, 4578 .goog-te-combo:focus, 4579 #accessibilityBar:focus, 4580 .sidebar a:focus, 4581 .sidebar .sideNav a:focus, 4582 .sidebar .media-item:focus { 4583 outline: 3px solid black !important; 4584 outline-offset: 2px !important; 4585 box-shadow: 0 0 0 2px rgba(0,0,0,0.2) !important; 4586 } 4587 `) 4588 .appendTo("head"); 4589 4590 // 4. Google Translate keyboard navigation 4591 var translateComboState = { 4592 isOpen: false, 4593 currentIndex: 0, 4594 options: [] 4595 }; 4596 4597 // Initialize function for Google Translate 4598 var initGoogleTranslate = function() { 4599 if ($('.goog-te-combo').length > 0) {
4600 console.log("Google Translate found, initializing keyboard navigation"); 4601 4602 // Create a map of the Google Translate options for keyboard navigation 4603 translateComboState.options = $('.goog-te-combo option').map(function() { 4604 return { 4605 value: $(this).val(), 4606 label: $(this).text() 4607 }; 4608 }).get(); 4609 4610 console.log("Found " + translateComboState.options.length + " language options"); 4611 4612 // Set current index to match current selection 4613 var currentValue = $('.goog-te-combo').val(); 4614 translateComboState.currentIndex = translateComboState.options.findIndex(opt => opt.value === currentValue); 4615 4616 // Add keyboard navigation for the combo box 4617 $('.goog-te-combo').off('keydown').on('keydown', function(e) { 4618 console.log("Combo keydown event: " + e.which); 4619 4620 if (e.which === 38) { // Up arrow 4621 e.preventDefault(); 4622 translateComboState.currentIndex = Math.max(0, translateComboState.currentIndex - 1); 4623 changeLanguage(translateComboState.currentIndex); 4624 console.log("Changed to language: " + translateComboState.options[translateComboState.currentIndex].label); 4625 return false; 4626 } else if (e.which === 40) { // Down arrow 4627 e.preventDefault(); 4628 translateComboState.currentIndex = Math.min(translateComboState.options.length - 1, translateComboState.currentIndex + 1); 4629 changeLanguage(translateComboState.currentIndex); 4630 console.log("Changed to language: " + translateComboState.options[translateComboState.currentIndex].label); 4631 return false; 4632 } else if (e.which === 9 && !e.shiftKey) { // Tab forward 4633 e.preventDefault(); 4634 $('.font-increase').focus(); 4635 return false; 4636 } else if (e.which === 9 && e.shiftKey) { // Tab backward 4637 e.preventDefault(); 4638 $('#accessibilityBar').focus(); 4639 return false; 4640 } 4641 }); 4642 4643 // Add tab navigation from search to Google Translate 4644 $('#search_phrase').on('keydown', function(e) { 4645 if (e.which === 9 && !e.shiftKey) { // Tab forward 4646 e.preventDefault(); 4647 $('#accessibilityBar').focus(); 4648 return false; 4649 } 4650 }); 4651 4652 // Make accessibilityBar focusable 4653 $('#accessibilityBar').attr('tabindex', '0'); 4654 4655 // Add tab navigation from accessibilityBar to Google Translate 4656 $('#accessibilityBar').on('keydown', function(e) { 4657 if (e.which === 9 && !e.shiftKey) { // Tab forward 4658 e.preventDefault(); 4659 $('.goog-te-combo').focus(); 4660 return false; 4661 } else if (e.which === 9 && e.shiftKey) { // Tab backward 4662 e.preventDefault(); 4663 $('#search_phrase').focus(); 4664 return false; 4665 } 4666 }); 4667 4668 // Clear the interval once we've set up the handlers 4669 clearInterval(checkInterval); 4670 } 4671 }; 4672 4673 // Function to change the selected language 4674 function changeLanguage(index) { 4675 const selected = translateComboState.options[index]; 4676 if (selected && selected.value) { 4677 $('.goog-te-combo') 4678 .val(selected.value) 4679 .trigger('change'); 4680 4681 // Bubble event up so language changes 4682 var event = new Event('change', { bubbles: true }); 4683 document.querySelector('.goog-te-combo').dispatchEvent(event); 4684 } 4685 } 4686 4687 // Check periodically if Google Translate has loaded 4688 var checkInterval = setInterval(initGoogleTranslate, 500); 4689 4690 // Give up after 10 seconds to prevent endless checking 4691 setTimeout(function() { 4692 clearInterval(checkInterval); 4693 }, 10000); 4694 4695 // Also try to initialize immediately if Google Translate is already loaded 4696 initGoogleTranslate(); 4697 4698 // Debug - log focus events to console 4699 $(document).on('focusin', function(e) { 4700 console.log('Focus on:', e.target.tagName, e.target.className, e.target); 4701 }); 4702});
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.