1/** 2 * Theme functions file 3 * 4 * Contains handlers for navigation, accessibility, header sizing 5 * footer widgets and Featured Content slider 6 * 7 */ 8( function( $ ) { 9 10 function is_display_type(display_type){ 11 return ( ($('.display-type').css('content') == display_type) || ($('.display-type').css('content') == '"'+display_type+'"')); 12 } 13 function not_display_type(display_type){ 14 return ( ($('.display-type').css('content') != display_type) && ($('.display-type').css('content') != '"'+display_type+'"')); 15 } 16 17 // Initialize isotope layout only if there is a index-isotope container element on a page and the device in use is not a phone or a tablet 18 function initiate_isotope() { 19 var is_origin_left = true; 20 if($('body').hasClass('rtl')){ 21 is_origin_left = false; 22 } 23 if($('.index-isotope').length && (not_display_type("tablet") || (is_display_type("tablet") && $('body').hasClass('menu-position-top') && $('body').hasClass('no-sidebar'))) && not_display_type("phone")){ 24 var layout_mode = $('.index-isotope').data('layout-mode'); 25 var $isotope_container = $('.index-isotope').isotope({ 26 'itemSelector': '.item-isotope', 27 'layoutMode': layout_mode, 28 'isOriginLeft': is_origin_left 29 }); 30 $('.index-isotope').addClass('isotope-active'); 31 // init isotope 32 $isotope_container.isotope('layout'); 33 // reposition when everything loads isotope 34 $(window).on('load',function() { 35 $isotope_container.isotope('layout'); 36 }); 37 // reposition when images load 38 $('.index-isotope').imagesLoaded(function(){ 39 $isotope_container.isotope('layout'); 40 // $('.index-isotope .pluto-post-box .post-media-body, .index-isotope .product-media-body').find('.figure-link-w, iframe').slideDown(100, function(){ 41 // $isotope_container.isotope('layout'); 42 // setTimeout(function(){ 43 // $('.index-isotope .pluto-post-box .post-media-body, .index-isotope .product-media-body').find('.figure-link-w, iframe').addClass('os-faded-in'); 44 // }, 50); 45 // }); 46 }); 47 }else{ 48 if($('.index-isotope').length && $('.index-isotope').hasClass('isotope-active')){ 49 $('.index-isotope').isotope('destroy').removeClass('isotope-active'); 50 } 51 } 52 } 53 54 55 // Smarter window resize which allows to disregard continious resizing in favor of action on resize complete 56 $(window).resize(function() { 57 if(this.resizeTO) clearTimeout(this.resizeTO); 58 this.resizeTO = setTimeout(function() { 59 $(this).trigger('resizeEnd'); 60 }, 500); 61 }); 62 63 64 // Re-init isotope on window resize 65 $(window).bind('resizeEnd', function() { 66 initiate_isotope(); 67 }); 68 69 70 71 // Document Ready functions 72 $( function() { 73 74 75 // If there is a qr-code generator button - init it 76 if($('.single-post-top-qr').length){ 77 $('.single-post-top-qr').on("click", function(){ 78 $('#qrcode').html(""); 79 var qrcode = new QRCode("qrcode"); 80 qrcode.makeCode(window.location); 81 $('#qrcode-modal').modal(); 82 }); 83 } 84 85 // Initiate isotope layout on document ready 86 initiate_isotope(); 87 88 // Menu block sub items 89 $('.menu-trigger-click .menu-item-has-children > a').on("click", function(){ 90 $submenu = $(this).next('.sub-menu'); 91 if($submenu.hasClass('sub-menu-active')){ 92 $submenu.slideUp(100).removeClass('sub-menu-active'); 93 }else{ 94 $('.sub-menu').slideUp(100).removeClass('sub-menu-active'); 95 $submenu.slideDown(100).addClass('sub-menu-active'); 96 } 97 return false; 98 }); 99 100 $('.menu-trigger-hover .menu-item-has-children').hover(function(){ 101 $submenu = $(this).find('.sub-menu'); 102 $('.sub-menu').slideUp(100).removeClass('sub-menu-active'); 103 $submenu.show().addClass('sub-menu-active'); 104 }, function(){ 105 $submenu = $(this).find('.sub-menu'); 106 $submenu.hide().removeClass('sub-menu-active'); 107 }); 108 109 // Initiate perfect scrollbar for the fixed side menu 110 $('.menu-position-left .menu-block, .menu-position-right .menu-block').perfectScrollbar({ 111 suppressScrollX: true, 112 wheelPropagation: true, 113 includePadding: true 114 }); 115 116 $('.menu-toggler').on("click", function(){ 117 $("body").toggleClass('side-menu-active'); 118 return false;
119 }); 120 121 $('.sidebar-toggler, .sidebar-main-toggler').on("click", function(){ 122 $("body").toggleClass('sidebar-active'); 123 return false; 124 }); 125 126 // Click on top share button on single posts 127 $('body').on("click", ".post-top-share .share-activator, .single-post-top-share .share-activator", function(){ 128 $(this).closest('.post-top-share, .single-post-top-share').toggleClass('active'); 129 $(this).closest('.post-top-share, .single-post-top-share').find('i.share-activator').toggleClass('os-icon-minus'); 130 return false; 131 }); 132 133 134 // Flexslider init 135 $('.flexslider').flexslider({ 136 animation : "fade", 137 //animation : "slide", 138 slideshowSpeed:4500 139 }); 140 141 if($('.featured-carousel').length){ 142 $('.featured-carousel').owlCarousel({ 143 loop: true, 144 autoplay: true, 145 responsive : { 146 0 : { items : 1 }, 147 480 : { items : 2 }, 148 768 : { items : 2 }, 149 992 : { items : 3 }, 150 1200 : { items : 4 }, 151 1700 : { items : 5 } 152 } 153 }); 154 } 155 156 // Toggle reading mode on link click 157 $('.single-post-top-reading-mode').on("click", function(){ 158 if($('body').hasClass('reading-mode')){ 159 $('body').removeClass("reading-mode"); 160 $('.single-post-top-reading-mode i').removeClass('os-icon-eye-slash').addClass('os-icon-eye'); 161 $('.single-post-top-reading-mode span').text($(this).data('message-on')); 162 }else{ 163 $('body').addClass("reading-mode"); 164 $('.single-post-top-reading-mode i').removeClass('os-icon-eye').addClass('os-icon-eye-slash'); 165 $('.single-post-top-reading-mode span').text($(this).data('message-off')); 166 } 167 return false; 168 }); 169 170 // Disable reading mode when ESC key is pressed 171 $(document).keyup(function(e) { 172 if (e.keyCode == 27) { $('body').removeClass('reading-mode'); } // esc 173 }); 174 175 // featured posts slider 176 $('.featured-post-control-up').on("click", function(){ 177 var step_px = 95; 178 var total_height = $('.featured-posts-slider-contents').height(); 179 var current_margin = Math.abs($('.featured-posts-slider-contents').css('margin-top').replace('px', '')); 180 if((current_margin - step_px - 40) >= 0){ 181 var new_margin = (current_margin - step_px) * -1; 182 $('.featured-posts-slider-contents').animate({ 'marginTop': new_margin + "px"}, 200); 183 }else{ 184 $('.featured-posts-slider-contents').animate({ 'marginTop': '0px'}, 200); 185 } 186 }); 187 // featured posts slider 188 $('.featured-post-control-down').on("click", function(){ 189 var step_px = 95; 190 var total_height = $('.featured-posts-slider-contents').height(); 191 var current_margin = Math.abs($('.featured-posts-slider-contents').css('margin-top').replace('px', '')); 192 if((current_margin + step_px + 40) <= total_height){ 193 var new_margin = (current_margin + step_px) * -1; 194 $('.featured-posts-slider-contents').animate({ 'marginTop': new_margin + "px"}, 200); 195 }else{ 196 $('.featured-posts-slider-contents').animate({ 'marginTop': '0px'}, 200); 197 } 198 }); 199 200 201 } ); 202} )( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.