1// global jQuery:false 2 3var THEMEREX_ADMIN_MODE = false; 4var THEMEREX_error_msg_box = null; 5var THEMEREX_VIEWMORE_BUSY = false; 6var THEMEREX_REMEMBERSCROLL = 0; 7var THEMEREX_isotopeInitCounter = 0; 8var THEMEREX_isotopeMemoryID = ''; 9var THEMEREX_isotopeFilter = '*'; 10 11 12jQuery(document).ready(function () { 13 "use strict"; 14 timelineResponsive(); 15 ready(); 16 itemPageFull(); 17 scrollAction(); 18 fullSlider(); 19}); 20jQuery(window).resize(function () { 21 "use strict"; 22 itemPageFull(); 23 timelineResponsive(); 24 fullSlider(); 25 scrollAction(); 26}); 27jQuery(window).smartresize(function() { 28 mobileMenuShow(); 29}); 30jQuery(window).scroll(function () { 31 "use strict"; 32 scrollAction(); 33}); 34 35 36 37function ready() { 38 "use strict"; 39 40 // Show system message 41 if (THEMEREX_systemMessage.message) { 42 if (THEMEREX_systemMessage.status == 'success') 43 themerex_message_success(THEMEREX_systemMessage.message, THEMEREX_systemMessage.header); 44 else if (THEMEREX_systemMessage.status == 'info') 45 themerex_message_info(THEMEREX_systemMessage.message, THEMEREX_systemMessage.header); 46 else if (THEMEREX_systemMessage.status == 'error' || THEMEREX_systemMessage.status == 'warning') 47 themerex_message_warning(THEMEREX_systemMessage.message, THEMEREX_systemMessage.header); 48 } 49 50 //textarea Autosize 51 if (jQuery('textarea.textAreaSize').length > 0) { 52 jQuery('textarea.textAreaSize').autosize({ 53 append: "\n" 54 }); 55 } 56 57 // Share button 58 if (jQuery('ul.shareDrop').length > 0) { 59 jQuery(document).click(function (e) { 60 "use strict"; 61 jQuery('ul.shareDrop').slideUp().siblings('a.shareDrop').removeClass('selected'); 62 }); 63 jQuery('li.share a').click(function (e) { 64 "use strict"; 65 if (jQuery(this).hasClass('selected')) { 66 jQuery(this).removeClass('selected').siblings('ul.shareDrop').slideUp(); 67 } else { 68 jQuery(this).addClass('selected').siblings('ul.shareDrop').slideDown(); 69 } 70 e.preventDefault(); 71 return false; 72 }); 73 jQuery('li.share li a').click(function (e) { 74 jQuery(this).parents('ul.shareDrop').slideUp().siblings('a.shareDrop').removeClass('selected'); 75 e.preventDefault(); 76 return false; 77 }); 78 } 79 80 // Like button 81 jQuery('.postSharing,.masonryMore').on('click', '.likeButton a', function(e) { 82 var button = jQuery(this).parent(); 83 var inc = button.hasClass('like') ? 1 : -1; 84 var post_id = button.data('postid'); 85 var likes = Number(button.data('likes'))+inc; 86 var grecko_likes = jQuery.cookie('grecko_likes'); 87 if (grecko_likes === undefined) grecko_likes = ''; 88 jQuery.post(THEMEREX_ajax_url, { 89 action: 'post_counter', 90 nonce: THEMEREX_ajax_nonce, 91 post_id: post_id, 92 likes: likes 93 }).done(function(response) { 94 var rez = JSON.parse(response); 95 if (rez.error === '') { 96 if (inc == 1) { 97 var title = button.data('title-dislike'); 98 button.removeClass('like').addClass('likeActive'); 99 grecko_likes += (grecko_likes.substr(-1)!=',' ? ',' : '') + post_id + ','; 100 } else { 101 var title = button.data('title-like'); 102 button.removeClass('likeActive').addClass('like'); 103 grecko_likes = grecko_likes.replace(','+post_id+',', ','); 104 } 105 button.data('likes', likes).find('a').attr('title', title).find('.likePost').html(likes); 106 jQuery.cookie('grecko_likes', grecko_likes, {expires: 365, path: '/'}); 107 } else { 108 themerex_message_warning(THEMEREX_MESSAGE_ERROR_LIKE); 109 } 110 }); 111 e.preventDefault(); 112 return false; 113 });
114 115 //hoverZoom img effect 116 jQuery('.hoverIncrease').each(function () { 117 "use strict"; 118 var img = jQuery(this).data('image'); 119 var title = jQuery(this).data('title'); 120 if (img) { 121 jQuery(this).append('<span class="hoverShadow"></span><a href="'+img+'" title="'+title+'"><span class="hoverIcon"></span></a>'); 122 } 123 }); 124 125 // ====== isotope ===================================================================== 126 if (jQuery('.isotopeWrap').length > 0) { 127 128 jQuery('.isotopeWrap').each(function(){ 129 isotopeFilterClass( '*' ); 130 131 var isotopeWrap = jQuery(this); 132 var isotopeItem = isotopeWrap.find('.isotopeItem'); 133 var isotopeWrapWidth = isotopeWrap.width(); 134 var isotopeWrapFoliosize = isotopeWrap.data('foliosize'); 135 var isotopeItemIncw = jQuery(this).data('incw'); 136 var isotopeItemInch = jQuery(this).data('inch'); 137 138 isotopeItem.each(function() { 139 var isotopeItemIncw = jQuery(this).data('incw'); 140 var isotopeItemInch = jQuery(this).data('inch'); 141 var isotopeSize = isotopeResizeMath(isotopeWrapWidth, isotopeWrapFoliosize, isotopeItemIncw, isotopeItemInch); 142 143 jQuery(this).filter(':not(fullItemWrap)').css({ 144 'width':isotopeSize[0], 145 'height':isotopeSize[1] 146 }); 147 148 jQuery(this).find('.isotopeItemWrap').css({ 149 'height':isotopeSize[1] 150 }); 151 152 }); 153 154 155 //isotope 156 var isotopeSize = isotopeResizeMath(isotopeWrapWidth, isotopeWrapFoliosize, isotopeItemIncw, isotopeItemInch); 157 isotopeWrap.isotope({ 158 layoutMode: 'masonry', 159 resizable: false, 160 filter: THEMEREX_isotopeFilter, 161 masonry: { 162 columnWidth: isotopeSize[0] 163 }, 164 itemSelector: '.isotopeItem', 165 animationOptions: { 166 duration: 750, 167 easing: 'linear', 168 queue: false 169 } 170 }); 171 172 isotopeRow(isotopeWrap,isotopeItem); 173 174 setTimeout(function(){ 175 isotoreEffect() 176 }, 200); 177 178 179 isotopeResize(isotopeWrap,isotopeItem); 180 181 //isotope Full post 182 isotopeWrap.on( 'click', 'article.isotopeItem', function() { 183 if( jQuery(this).hasClass('post_format_link') ){ 184 location.href = jQuery(this).find('.isotopeLinks').attr('href'); 185 } else { 186 var scrollPos = jQuery(window).scrollTop(); 187 isotopeRow(isotopeWrap,isotopeItem); 188 isotopeAjaxLoad( isotopeWrap, jQuery(this)); 189 jQuery('html,body').animate({ scrollTop: scrollPos}, 0 ); 190 } 191 }); 192 193 //isotope navigation 194 isotopeWrap.on('click', '.isotopeNav', function() { 195 var scrollPos = jQuery(window).scrollTop(); 196 var nav_id = jQuery(this).data('nav-id'); 197 jQuery('html,body').animate({ scrollTop: scrollPos}, 0 ); 198 isotopeAjaxLoad( isotopeWrap, jQuery('.isotopeItem[data-postid="'+nav_id+'"]') ); 199 }); 200 201 202 //isotope Fullpost closed 203 isotopeWrap.on('click', '.fullItemClosed', function(){ 204 isotopeRemove( isotopeWrap, jQuery(this).parent('.fullItemWrap')); 205 }); 206 207 208 209 //isotope filtre 210 jQuery('.isotopeFiltr li a').click(function () { 211 "use strict"; 212 213 isotopeRemove( isotopeWrap, isotopeWrap.find('.fullItemWrap') ); 214 215 jQuery('.isotopeFiltr li').removeClass('active'); 216 jQuery(this).parent().addClass('active'); 217 218 var selectorFilter = jQuery(this).attr('data-filter'); 219 220 isotopeFilterClass( selectorFilter ); 221 222 isotopeWrap.isotope({ 223 layoutMode: 'masonry', 224 itemSelector: '.isotopeItem', 225 filter: selectorFilter, 226 animationOptions: { 227 duration: 750, 228 easing: 'linear', 229 queue: false 230 } 231 }).isotope( 'on', 'layoutComplete', function() { 232 isotopeRow(isotopeWrap, isotopeItem); 233 }); 234 235 236 THEMEREX_isotopeFilter = selectorFilter; 237 return false; 238 }); 239 240 jQuery("#custom_options .co_switch_box a" ).click(function(e) { 241 var wrap = jQuery(this).parent('.co_switch_box'); 242 var options = wrap.data('options'); 243 244 //check settings 245 if ( options == 'body_style'){ 246 jQuery(window).resize(); 247 } 248 }); 249 }); 250 251 } 252 253 // main Slider 254 if (jQuery('.sliderBullets, .sliderHeader').length > 0) { 255 if (jQuery.rsCSS3Easing!=undefined && jQuery.rsCSS3Easing!=null) { 256 jQuery.rsCSS3Easing.easeOutBack = 'cubic-bezier(0.175, 0.885, 0.320, 1.275)'; 257 } 258 jQuery('.sliderHeader').addClass('hsInit'); 259 initShortcodes(jQuery(this)); 260 } 261 262 263 // ==================================================================================== 264 // Page Navigation 265 jQuery(document).click(function () { 266 "use strict"; 267 if (jQuery('.pageFocusBlock').length > 0) {
268 jQuery('.pageFocusBlock').slideUp(); 269 } 270 271 }); 272 273 jQuery('.pageFocusBlock').click(function (e) { 274 "use strict"; 275 e.preventDefault(); 276 return false; 277 }); 278 279 jQuery('.navInput').click(function (e) { 280 "use strict"; 281 if (jQuery('.pageFocusBlock').length > 0) { 282 jQuery('.pageFocusBlock').slideDown(); 283 } 284 285 e.preventDefault(); 286 return false; 287 }); 288 289 //related links 290 jQuery('.postBoxItem').click(function () { 291 "use strict"; 292 var link = jQuery(this).find('h5 a').attr('href'); 293 if( link != '' ){ 294 window.location.href = link; 295 } 296 }); 297 298 299 // topMenu DROP superfish 300 if (jQuery('.topMenu ul, .usermenuArea ul').length > 0) { 301 jQuery('.topMenu ul, .usermenuArea ul').superfish({ 302 delay: 500, 303 animation: { 304 opacity: 'show', 305 height: 'show' 306 }, 307 animationOut:{ 308 opacity: 'hide', 309 height: 'hide' 310 }, 311 speed: 'fast',
312 autoArrows: false, 313 dropShadows: false 314 }); 315 } 316 317 318 319 320 // top menu animation 321 jQuery(document).click(function () { 322 "use strict"; 323 jQuery('.hideMenuDisplay #header').removeClass('topMenuShow'); 324 }); 325 jQuery('.hideMenuDisplay .wrapTopMenu').click(function (e) { 326 "use strict"; 327 e.stopPropagation(); 328 }); 329 jQuery('.hideMenuDisplay .openTopMenu').click(function (e) { 330 "use strict"; 331 e.stopPropagation(); 332 jQuery(this).parent().toggleClass('topMenuShow'); 333 return false; 334 }); 335 336 337 338 339 340 // Sidemenu DROP 341 jQuery('.sidemenu_area > ul > li.dropMenu ').click(function (e) { 342 "use strict"; 343 e.preventDefault(); 344 return false; 345 }); 346 jQuery('.sidemenu_area > ul > li.dropMenu, .sidemenu_area > ul > li.dropMenu li').click(function (e) { 347 "use strict"; 348 initScroll('sidemenu_scroll'); 349 jQuery(this).toggleClass('dropOpen'); 350 jQuery(this).find('ul').first().slideToggle(); 351 e.preventDefault(); 352 return false; 353 }); 354 355 jQuery('#sidemenu_scroll a').click(function (e) { 356 "use strict"; 357 initScroll('sidemenu_scroll'); 358 jQuery('#sidemenu_scroll').mCustomScrollbar("update"); 359 e.preventDefault(); 360 return false; 361 }); 362 363 jQuery(document).click(function (e) { 364 "use strict"; 365 jQuery('body').removeClass('openMenuFixRight openMenuFix'); 366 jQuery('.sidemenu_overflow').fadeOut(400); 367 jQuery('body').attr('style', '');; 368 369 }); 370 jQuery('.sidemenu_wrap.swpLeftPos, .swpRightPos, .openRightMenu').click(function (e) { 371 "use strict"; 372 e.preventDefault(); 373 return false; 374 }); 375 376 jQuery('.sidemenu_wrap .sidemenu_button').click(function (e) { 377 "use strict"; 378 jQuery('body').addClass('openMenuFix'); 379 if (jQuery('.sidemenu_overflow').length == 0) { 380 jQuery('body').append('<div class="sidemenu_overflow"></div>') 381 } 382 jQuery('.sidemenu_overflow').fadeIn(400); 383 jQuery('body').css('overflow','hidden'); 384 e.preventDefault(); 385 return false; 386 }); 387 388 jQuery('.openRightMenu').click(function (e) { 389 "use strict"; 390 jQuery('body').addClass('openMenuFixRight'); 391 if (jQuery('.sidemenu_overflow').length == 0) { 392 jQuery('body').append('<div class="sidemenu_overflow"></div>') 393 } 394 jQuery('.sidemenu_overflow').fadeIn(400); 395 jQuery('body').css('overflow','hidden'); 396 e.preventDefault(); 397 return false; 398 }); 399 400 401 //Hover DIR 402 jQuery(' .portfolio > .isotopeItem > .hoverDirShow').each(function () { 403 "use strict"; 404 jQuery(this).hoverdir(); 405 }); 406 407 408 //Portfolio item Description 409 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 410 jQuery('.toggleButton').show(); 411 jQuery('.itemDescriptionWrap,.toggleButton').click(function (e) { 412 "use strict"; 413 jQuery(this).toggleClass('descriptionShow'); 414 jQuery(this).find('.toggleDescription').slideToggle(); 415 e.preventDefault(); 416 return false; 417 }); 418 } else { 419 jQuery('.itemDescriptionWrap').hover(function () { 420 "use strict"; 421 jQuery(this).toggleClass('descriptionShow'); 422 jQuery(this).find('.toggleDescription').slideToggle(); 423 }) 424 } 425 426 427 428 429 430 jQuery('input[type="text"], input[type="password"], input[type="search"], textarea').focus(function () { 431 "use strict"; 432 jQuery(this).attr('data-placeholder', jQuery(this).attr('placeholder')).attr('placeholder', ''); 433 jQuery(this).parent('li').addClass('iconFocus'); 434 }) 435 .blur(function () { 436 "use strict"; 437 jQuery(this).attr('placeholder', jQuery(this).attr('data-placeholder')); 438 jQuery(this).parent('li').removeClass('iconFocus'); 439 }); 440 441 //responsive Show menu 442 jQuery('.openMobileMenu').click(function(e){
443 "use strict"; 444 var ul = jQuery('.wrapTopMenu .topMenu > ul'); 445 ul.slideToggle(); 446 jQuery(this).parents('.menuFixedWrap').toggleClass('menuMobileShow'); 447 e.preventDefault(); 448 return false; 449 }); 450 451 452 // IFRAME width and height constrain proportions 453 if (jQuery('iframe').length > 0) { 454 jQuery(window).resize(function() { 455 "use strict"; 456 videoDimensions(); 457 }); 458 videoDimensions(); 459 } 460 461 // Hide empty pagination 462 if (jQuery('#nav_pages > ul > li').length < 3) { 463 jQuery('#nav_pages').remove(); 464 } else { 465 jQuery('.theme_paginaton a').addClass('theme_button'); 466 } 467 468 // View More button 469 jQuery('#viewmore_link').click(function(e) { 470 "use strict"; 471 if (!THEMEREX_VIEWMORE_BUSY) { 472 jQuery(this).addClass('loading'); 473 THEMEREX_VIEWMORE_BUSY = true; 474 jQuery.post(THEMEREX_ajax_url, { 475 action: 'view_more_posts', 476 nonce: THEMEREX_ajax_nonce, 477 page: THEMEREX_VIEWMORE_PAGE+1, 478 data: THEMEREX_VIEWMORE_DATA, 479 vars: THEMEREX_VIEWMORE_VARS 480 }).done(function(response) { 481 "use strict"; 482 var rez = JSON.parse(response); 483 jQuery('#viewmore_link').removeClass('loading'); 484 THEMEREX_VIEWMORE_BUSY = false; 485 if (rez.error === '') { 486 487 var posts_container = jQuery('.content').eq(0); 488 489 if (posts_container.find('section.isotopeWrap').length > 0) posts_container = posts_container.find('section.isotopeWrap').eq(0); 490 491 if (posts_container.hasClass('isotopeWrap')) { 492 posts_container.append(rez.data); 493 THEMEREX_isotopeInitCounter = 0; 494 initAppendedIsotope(posts_container, rez.filters); 495 } else { 496 jQuery('.ajaxContainer').append(rez.data); 497 } 498 499 initPostFormats(); 500 THEMEREX_VIEWMORE_PAGE++; 501 if (rez.no_more_data==1) { 502 jQuery('#viewmore_link').hide(); 503 } 504 if (jQuery('#nav_pages ul li').length >= THEMEREX_VIEWMORE_PAGE) { 505 jQuery('#nav_pages ul li').eq(THEMEREX_VIEWMORE_PAGE).toggleClass('pager_current', true); 506 } 507 } 508 }); 509 } 510 e.preventDefault(); 511 return false; 512 }); 513 514 // Infinite pagination 515 if (jQuery('#viewmore_link.pagination_infinite').length > 0) { 516 jQuery(window).scroll(infiniteScroll); 517 } 518 519 //custom panel scroll 520 if (jQuery('#custom_options').length > 0) { 521 jQuery('#custom_options .sc_scroll').css('height',jQuery('#custom_options').height()-46); 522 } 523 524 // Scroll to top 525 jQuery('.buttonScrollUp').click(function(e) { 526 "use strict"; 527 jQuery('html,body').animate({ 528 scrollTop: 0 529 }, 'slow'); 530 e.preventDefault(); 531 return false; 532 }); 533 534 jQuery('.woocommerce ul.products li.product h3').each(function(){ 535 var title = jQuery(this).html(); 536 if(jQuery(this).html().length > 20) 537 title = title.substr(0, 20) + '..'; 538 jQuery(this).html(title); 539 }); 540 541 // Added to cart 542 jQuery('body').bind('added_to_cart removed_from_cart', function() { 543 "use strict"; 544 // Update amount on the cart button 545 var total = jQuery('.widget_shopping_cart').eq(0).find('.total .amount').text(); 546 if (total != undefined) { 547 jQuery('.usermenuCart .cart_total').text(total); 548 } 549 }); 550 551 initPostFormats(); 552} //end ready 553 554 555 556 557// Fit video frame to document width 558function videoDimensions() { 559 jQuery('iframe').each(function() { 560 "use strict"; 561 var iframe = jQuery(this).eq(0); 562 var w_attr = iframe.attr('width'); 563 var h_attr = iframe.attr('height'); 564 if (!w_attr || !h_attr) { 565 return; 566 } 567 var w_real = iframe.width(); 568 if (w_real!=w_attr) { 569 var h_real = Math.round(w_real/w_attr*h_attr); 570 iframe.height(h_real); 571 } 572 });
573} 574 575function initPostFormats() { 576 "use strict"; 577 578 // MediaElement init 579 if (THEMEREX_useMediaElement) { 580 581 if (jQuery('audio').length > 0) { 582 jQuery('audio').each(function () { 583 if (jQuery(this).hasClass('inited')) return; 584 jQuery(this).addClass('inited').mediaelementplayer({ 585 audioWidth: '100%', // width of audio player 586 audioHeight: 30, // height of audio player 587 success: function (mediaElement, domObject) { 588 jQuery(domObject).parents('.sc_audio').addClass('sc_audio_show'); 589 }, 590 }); 591 }); 592 } 593 594 jQuery('video').each(function () { 595 if (jQuery(this).hasClass('inited')) return; 596 jQuery(this).addClass('inited').mediaelementplayer({ 597 videoWidth: -1, // if set, overrides <video width> 598 videoHeight: -1, // if set, overrides <video height> 599 audioWidth: '100%', // width of audio player 600 audioHeight: 30 // height of audio player 601 }); 602 }); 603 } else { 604 jQuery('.sc_audio').addClass('sc_audio_show'); 605 } 606 607 // Popup init image 608 jQuery("a[href$='jpg']:not(.prettyphoto),a[href$='jpeg']:not(.prettyphoto),a[href$='png']:not(.prettyphoto),a[href$='gif']:not(.prettyphoto)").attr('rel', 'magnific'); 609 jQuery("a[rel*='magnific']:not(.inited)").addClass('inited').attr('data-effect',THEMEREX_MAGNIFIC_EFFECT_OPEN).magnificPopup({ 610 type: 'image', 611 closeOnContentClick: true, 612 closeBtnInside: true, 613 fixedContentPos: true, 614 removalDelay: 500, 615 midClick: true, 616 preloader: true, 617 gallery:{ 618 enabled:true 619 }, 620 tLoading: '<span></span>', 621 image: { 622 tError: THEMEREX_MAGNIFIC_ERROR, 623 verticalFit: true, 624 }, 625 callbacks: { 626 beforeOpen: function() { 627 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 628 this.st.mainClass = this.st.el.attr('data-effect'); 629 } 630 } 631 }); 632 // Popup init video 633 jQuery("a[href*='youtube'],a[href*='vimeo']").attr('rel', 'magnific-video'); 634 jQuery("a[rel*='magnific-video']:not(.inited)").addClass('inited').attr('data-effect',THEMEREX_MAGNIFIC_EFFECT_OPEN).magnificPopup({ 635 type: 'iframe', 636 closeOnContentClick: true, 637 closeBtnInside: true, 638 fixedContentPos: true, 639 removalDelay: 500, 640 midClick: true, 641 preloader: true, 642 callbacks:{ 643 open: function() { 644 //open function 645 }, 646 close: function() { 647 //close function 648 } 649 } 650 }); 651 652 653 654 // Popup windows with any html content 655 jQuery('.user-popup-link:not(.inited)').addClass('inited').magnificPopup({ 656 type: 'inline', 657 removalDelay: 500, 658 callbacks: { 659 beforeOpen: function () { 660 this.st.mainClass = 'mfp-zoom-in'; 661 initShortcodes(jQuery('.sc_popup')); 662 }, 663 open: function () { 664 jQuery('html').css({ 665 overflow: 'visible', 666 margin: 0 667 }); 668 }, 669 close: function () { 670 } 671 }, 672 midClick: true 673 }); 674 675 676 // Add video on thumb click 677 jQuery('.sc_video_frame').each(function () { 678 "use strict"; 679 if (jQuery(this).hasClass('sc_inited')) return; 680 if (jQuery(this).hasClass('sc_video_frame_auto_play')){ 681 scVideoAutoplay(jQuery(this)); 682 } 683 jQuery(this).addClass('sc_inited').click(function (e) { 684 "use strict"; 685 scVideoAutoplay(jQuery(this)); 686 e.preventDefault(); 687 }); 688 }); 689 jQuery('.sc_video_frame').hover(function() { 690 jQuery(this).find('.sc_video_frame_player_title').slideDown(400); 691 }, function() { 692 "use strict"; 693 jQuery(this).find('.sc_video_frame_player_title').slideUp(400); 694 });
695 function scVideoAutoplay($videoObject) { 696 "use strict"; 697 var video = $videoObject.data('videoframe'); 698 if (video!=='' && !$videoObject.hasClass('sc_video_active')) { 699 $videoObject.addClass('sc_video_active'); 700 $videoObject.empty().html(video); 701 videoDimensions(); 702 } 703 return false; 704 } 705 706 //hover Underline effect 707 jQuery('.hoverUnderline').each(function() { 708 jQuery(this).find('a').each(function() { 709 jQuery(this).append('<span class="hoverLine"></span>'); 710 }); 711 }); 712 713} 714 715//mobile menu init, resize 716function mobileMenuShow() { 717 "use strict"; 718 if( THEMEREX_RESPONSIVE_MENU < jQuery(window).width()){ 719 jQuery('.wrapTopMenu .topMenu > ul').removeAttr('style'); 720 } 721} 722 723// Infinite Scroll 724function infiniteScroll() { 725 "use strict"; 726 var v = jQuery('#viewmore_link.pagination_infinite').offset(); 727 if (jQuery(this).scrollTop() + jQuery(this).height() + 100 >= v.top && !THEMEREX_VIEWMORE_BUSY) { 728 jQuery('#viewmore_link').eq(0).trigger('click'); 729 } 730} 731 732//itemPageFull 733function itemPageFull() { 734 "use strict"; 735 var bodyHeight = jQuery(window).height(); 736 jQuery('.itemPageFull').css('height', bodyHeight - jQuery('.topWrap').height()); 737 jQuery('#sidemenu_scroll').css('height', bodyHeight); 738} 739 740 741//init scroll 742function initScroll(idScroll) { 743 "use strict"; 744 745 if (!jQuery('#' + idScroll).hasClass("scrollInit")) { 746 jQuery('#' + idScroll).addClass('scrollInit').mCustomScrollbar({ 747 scrollButtons: { 748 enable: false 749 }, 750 }); 751 752 jQuery('.scrollPositionAction > .roundButton').click(function (e) { 753 "use strict"; 754 var scrollAction = jQuery(this).data('scroll'); 755 jQuery('#' + idScroll).mCustomScrollbar("scrollTo", scrollAction); 756 e.preventDefault(); 757 return false; 758 }); 759 760 } 761} 762 763 764 765//scroll Action 766function scrollAction() { 767 "use strict"; 768 var head = jQuery('header'); 769 var buttonScrollTop = jQuery('.upToScroll'); 770 var scrollPos = jQuery(window).scrollTop(); 771 var headHeight = jQuery(window).height(); 772 var topMemuHeight = head.height(); 773 // var menuMinWidth = jQuery(window).width() > 990; 774 var menuMinWidth = head.find('.menuFixedWrap').height(); 775 776 //fixed menu 777 if (scrollPos <= topMemuHeight / 3 && menuMinWidth) { 778 head.removeClass('fixedTopMenuShow'); 779 } else if (scrollPos >= topMemuHeight /1.5 && menuMinWidth) { 780 head.addClass('fixedTopMenuShow'); 781 //smartScroll 782 if (THEMEREX_REMEMBERSCROLL < scrollPos){ 783 //scroll up 784 head.removeClass('smartScrollDown'); 785 jQuery('.menuFixedWrap').height(menuMinWidth); 786 } else if (THEMEREX_REMEMBERSCROLL > scrollPos){ 787 //scroll down 788 head.addClass('smartScrollDown'); 789 jQuery('.menuFixedWrap').height('auto'); 790 } 791 792 } 793 794 THEMEREX_REMEMBERSCROLL = scrollPos; 795 796 //button UP 797 if (scrollPos > topMemuHeight) { 798 buttonScrollTop.addClass('buttonShow'); 799 } else { 800 buttonScrollTop.removeClass('buttonShow'); 801 } 802} 803 804function fullSlider() { 805 "use strict"; 806 if (jQuery('.fullScreenSlider').length > 0) { 807 jQuery('.sliderHeader, .sliderHeader .rsContent').css('height', jQuery(window).height()) 808 } 809} 810 811 812//Time Line 813function timelineResponsive() { 814 "use strict"; 815 var bodyHeight = jQuery(window).height(); 816 var headHeight = jQuery(window).height() - jQuery('.contentTimeLine h2').height() - 150; 817 var leftPosition = (jQuery('.main_content').width() - jQuery('.main').width()) / 2 + jQuery('.sidemenu_wrap').width(); 818 jQuery('.TimeLineScroll .tlContentScroll').css('height', headHeight); 819 820} 821 822//============= isotope function ============ 823 824//isotope effect 825function isotoreEffect(){ 826 "use strict"; 827 var isotopeWrap = jQuery('.isotopeWrap '); 828 isotopeWrap.find('.isotopeItem:not(.isotopeItemShow)').addClass('isotopeItemShow'); 829} 830 831// isotope rows 832function isotopeRow(itemWrap,item){ 833 "use strict"; 834 835 var isotopeWrap = itemWrap; 836 var isotopeItem = itemWrap.find('.isotopeItem:not(:hidden)'); 837 var i = 0; 838 var positionCounter = 1; 839 var items_sum = 0; 840 var row_num = 1; 841 var positionCounterArr = []; 842 var isotope_width = isotopeWrap.width() 843 844 item.removeClass('itemFirst itemLast').removeAttr('data-row-num'); 845 isotopeItem.filter(':visible:last').addClass('itemLast'); 846 847 itemWrap.find('.isotopeItem:not(:hidden)').each(function() { 848 849 var item_l = jQuery(this).position().left; 850 851 if( item_l == 0 ){ 852 jQuery(this).addClass('itemFirst'); 853 } 854 855 });
856 857} 858 859//scrolling 860function isotopeScrolling(item){ 861 "use strict"; 862 setTimeout(function(){ 863 jQuery('html,body').animate({ scrollTop: item.offset().top + item.height()-100}, 'slow' ); 864 }, 2000); 865} 866 867//isotope Ajax Load 868function isotopeAjaxLoad(itemWrap,item){ 869 "use strict"; 870 871 if ( item.hasClass('isotopeActive') ) { 872 return; 873 } 874 875 var itemRow = item.data('row-num'); 876 var istPostID = item.data('postid'); 877 var navFirstID = item.parent('.isotopeWrap').find('article.isotopeItem:visible:first').data('postid'); 878 var navLastID = item.parent('.isotopeWrap').find('article.isotopeItem:visible:last').data('postid'); 879 var navPrevID = item.prevAll('article.isotopeItem:visible').data('postid'); 880 var navNextID = item.nextAll('article.isotopeItem:visible').data('postid'); 881 var isoFilter = THEMEREX_isotopeFilter.replace('.','').replace('*',''); 882 883 jQuery('.isotopeItem[data-postid="'+THEMEREX_isotopeMemoryID+'"]').removeClass('isotopeActive') 884 jQuery('.isotopeItem[data-postid="'+istPostID+'"]').addClass('isotopeActive'); 885 886 var itemContent = jQuery('<div class="fullItemWrap isotopeItem sc_loader_show '+isoFilter+'" data-postid="'+istPostID+'"><span class="fullItemClosed icon-cancel-line" title="Closed"></span><div class="fullContent"></div></div>'); 887 888 889 isotopeRemove( itemWrap, itemWrap.find('.fullItemWrap')); 890 891 var next_before = item.nextAll('.itemFirst').eq(0); 892 if( !item.hasClass('itemLast') && next_before.length > 0 ){ 893 item.nextAll('.itemFirst:visible').eq(0).before( itemContent ); 894 } else { 895 itemWrap.find('article.itemLast').after( itemContent ); 896 } 897 898 //jQuery('.isotopeItem.itemLast[data-row-num="'+itemRow+'"]').after( itemContent ); 899 900 itemWrap.isotope('destroy').isotope({ 901 //getSortData: { 902 // ids: '[data-postid]', 903 //}, 904 //sortBy: ['ids'], 905 layoutMode: 'masonry', 906 itemSelector: '.isotopeItem', 907 filter: THEMEREX_isotopeFilter, 908 animationOptions: { 909 duration: 750, 910 easing: 'linear', 911 queue: false 912 } 913 914 }).isotope( 'on', 'layoutComplete', function() { 915 //function complete 916 }); 917 918 919 //add effect 920 setTimeout(function(){ 921 "use strict"; 922 isotoreEffect(); 923 }, 500); 924 925 isotopeScrolling( item ); 926 927 //load content 928 jQuery.post(THEMEREX_ajax_url, { 929 action: 'isotope_content', 930 nonce: THEMEREX_ajax_nonce, 931 postID: istPostID 932 }).done(function(response) { 933 "use strict"; 934 var rez = JSON.parse(response); 935 jQuery('.fullItemWrap .fullContent').html( (rez != '' ? rez.data : THEMEREX_SEND_ERROR )).parent('.fullItemWrap').addClass('ajaxShow'); 936 initShortcodes(jQuery('.fullItemWrap')); 937 initPostFormats(); 938 939 //nav prev 940 jQuery('.isotopeNav.isoPrev').data('nav-id', (navPrevID != undefined ? navPrevID : navLastID)); 941 jQuery('.isotopeNav.isoNext').data('nav-id', (navNextID != undefined ? navNextID : navFirstID)); 942 943 THEMEREX_isotopeInitCounter = 0; 944 initRelayoutIsotope(jQuery('.fullItemWrap .fullContent')); 945 }); 946 947 948 THEMEREX_isotopeMemoryID = istPostID; 949 950 return false; 951} 952 953 954function isotopeFilterClass(selector){ 955 "use strict"; 956 957 jQuery('.isotopeWrap .isotopeItem').removeClass('isotopeVisible').each(function() { 958 if( selector === '*' ){ 959 jQuery(this).addClass('isotopeVisible'); 960 } else { 961 jQuery(selector).addClass('isotopeVisible'); 962 } 963 }); 964} 965 966 967//isotope remove 968function isotopeRemove(itemWrap,item) { 969 "use strict"; 970 971 var isotopeWrap = itemWrap; 972 isotopeWrap.find('.isotopeItem[data-postid="'+THEMEREX_isotopeMemoryID+'"]').removeClass('isotopeActive'); 973 isotopeWrap.isotope('remove', item).isotope('layout'); 974} 975 976//isotope Images Complete 977function initRelayoutIsotope(content){ 978 "use strict"; 979 if (!imagesCompleteLoad(content) && THEMEREX_isotopeInitCounter++ < 30) { 980 setTimeout(function() { initRelayoutIsotope(content); }, 300); 981 return; 982 } 983 jQuery('.isotopeWrap').isotope('layout'); 984} 985 986//init Appended Isotope 987function initAppendedIsotope(isotopeWrap, filters) { 988 "use strict"; 989 if (!imagesCompleteLoad(isotopeWrap) && THEMEREX_isotopeInitCounter++ < 30) { 990 setTimeout(function() { initAppendedIsotope(isotopeWrap, filters); }, 300); 991 return; 992 } 993 994 var flt = isotopeWrap.siblings('.isotopeFiltr'); 995 var item = isotopeWrap.find('.isotopeItem:not(.isotopeItemShow)').addClass('isotopeItemShow'); 996 var isotopeWrapWidth = isotopeWrap.width(); 997 var isotopeItemWidth = isotopeWrap.data('foliosize'); 998 999 item.css('width',Math.floor(isotopeWrap.width() / Math.floor(isotopeWrap.width() / isotopeItemWidth))); 1000 1001 isotopeRow(isotopeWrap,isotopeWrap.find('isotopeItem')); 1002 1003 isotopeWrap.isotope('appended', item); 1004 for (var i in filters) { 1005 if (flt.find('a[data-filter=".flt_'+i+'"]').length === 0) { 1006 flt.find('ul').append('<li><a href="#" data-filter=".flt_'+i+'">'+filters[i]+'</a></li>'); 1007 } 1008 } 1009} 1010 1011 1012//isotope resize 1013function isotopeResize(itemWrap,item){ 1014 "use strict"; 1015 1016 var isotopeWrap = itemWrap; //.isotopeWrap 1017 var isotopeItem = item; 1018 var isotopeWrapFoliosize = isotopeWrap.data('foliosize'); //600 1019 var columns = 3; 1020 if(jQuery(itemWrap).hasClass('portfolio_medium')) columns = 4; 1021 if(jQuery(itemWrap).hasClass('portfolio_mini')) columns = 6; 1022 1023 1024 jQuery(document).ready(function () { 1025 "use strict"; 1026 beforeIsotopeItemResize(itemWrap, isotopeWrap, isotopeItem, columns); 1027 });
1028 1029 if(jQuery(window).width() > 420) { 1030 jQuery(window).smartresize(function () { 1031 "use strict"; 1032 beforeIsotopeItemResize(itemWrap, isotopeWrap, isotopeItem, columns); 1033 }); 1034 } 1035} 1036 1037function beforeIsotopeItemResize(itemWrap, isotopeWrap, isotopeItem, columns) 1038{ 1039 if( itemWrap.find('.fullItemWrap').length > 0 ){ 1040 isotopeRemove( itemWrap, itemWrap.find('.fullItemWrap')); 1041 } 1042 1043 isotopeItem.each(function() { 1044 "use strict"; 1045 1046 var isotopeItemIncw = jQuery(this).data('incw'); 1047 var isotopeItemInch = jQuery(this).data('inch'); 1048 1049 var isotopeSize = isotopeResizeMath(isotopeWrap.width(), columns, isotopeItemIncw, isotopeItemInch); 1050 1051 jQuery(this).filter(':not(fullItemWrap)').css({ 1052 'width':isotopeSize[0], 1053 'height':isotopeSize[1] 1054 }); 1055 1056 jQuery(itemWrap).find('.isotopeItem').css({ 1057 'width':isotopeSize[0], 1058 'height':isotopeSize[1] 1059 }); 1060 1061 jQuery(this).find('.isotopeItemWrap').css({ 1062 'height':isotopeSize[1] 1063 }); 1064 }); 1065 1066 var numb = jQuery(itemWrap).find('.isotopeItem').length; 1067 if(numb % 2 != 0 && jQuery(window).width() <= 600) 1068 { 1069 var elem = jQuery(itemWrap).find('.isotopeItem:nth-child('+ numb + ')'); 1070 1071 jQuery(elem).css({ 1072 'width': isotopeWrap.width(), 1073 'height':isotopeWrap.width() 1074 }); 1075 1076 jQuery(elem).find('.isotopeItemWrap').css({ 1077 'height':isotopeWrap.width() 1078 }); 1079 } 1080 1081 initRelayoutIsotope(itemWrap); 1082} 1083 1084function isotopeResizeMath(wrap,/*style*/columns,incw,inch){ 1085 "use strict"; 1086 1087 var windowWidth = jQuery(window).width(); 1088// var columns = Math.floor(wrap / style); //3 1089 if(windowWidth <= 1200 && columns > 4) columns = 4; 1090 if(windowWidth <= 900 && columns > 3) columns = 3; 1091 if(windowWidth <= 600 && columns > 2) columns = 2; 1092 1093 var bw = Math.floor(wrap / columns); 1094 1095 var w_px = (bw * incw);//-incw ; //w_px 1096 var h_px = (bw * inch);//-inch ; //h_px 1097 var w_pr = (100 / columns) * incw; //w_% 1098 1099 return [w_px,h_px,w_pr]; 1100} 1101 1102 1103//isotope Images Complete 1104function imagesCompleteLoad(content) { 1105 "use strict"; 1106 1107 var complete = true; 1108 content.find('img').each(function() { 1109 if (!complete) return; 1110 if (!jQuery(this).get(0).complete) complete = false; 1111 }); 1112 return complete; 1113}
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.