1/** 2 * Theme functions file 3 */ 4 5(function ($) { 6 "use strict"; 7 8 jQuery(document).ready(function ($) { 9 10 //initialize foundation 11 $(document).foundation(); 12 13 if($('.smartlib-slider-container').length>0){ 14 $('.smartlib-slider-container').flexslider(); 15 } 16 17 /*sticky post initialize*/ 18 modifyStickyBox(); 19 20 $('.maxflat-toggle-topbar').click(function (e) { 21 var container_expand = $(this).attr('href'); 22 var toggle_container = $('.smartlib-toggle-area'); 23 var top_menu = $('#top-navigation'); 24 var search_container = $('#smartlib-top-search-container'); 25 var link = $(this); 26 27 28 link.toggleClass('active-toggle'); 29 30 if(container_expand=='#top-navigation'){ 31 32 if(link.hasClass('active-toggle')){ 33 top_menu.removeClass('show-for-large-up'); 34 }else{ 35 top_menu.addClass('show-for-large-up'); 36 } 37 }else if(container_expand=='#toggle-search'){ 38 39 toggle_container.toggleClass('show-container'); 40 41 if(toggle_container.hasClass('show-container')){ 42 search_container.show(); 43 }else{ 44 search_container.hide(); 45 } 46 } 47 48 49 50 51 52 53 e.preventDefault(); 54 }); 55 56 if ('embed') { 57 58 $("embed").each(function (index) { 59 var height = $(this).attr('height'); 60 var width = $(this).attr('width'); 61 62 $(this).width(width); 63 $(this).height(height); 64 }); 65 66 } 67 /*ADD photoswipe*/ 68 if ($(".gallery-icon a").length != 0) 69 var myPhotoSwipe = $(".gallery-icon a").photoSwipe({ enableMouseWheel:false, enableKeyboard:false, captionAndToolbarAutoHideDelay:0, captionAndToolbarFlipPosition:true }); 70 //fixed menu 71 var nav = $('.fixed-menu'); 72 var max_margin = $('#page').height(); 73 var front_page_header_height = $('.frontpage-header').height(); 74 $(window).scroll(function () { 75 var scrollTop = $(this).scrollTop(); 76 if (scrollTop > 230) { 77 if (scrollTop < max_margin - 230) 78 nav.css("margin-top", scrollTop - 70 - front_page_header_height); 79 } else { 80 nav.css("margin-top", 0); 81 } 82 }); 83 84 }); 85 var isHidden = false;
86 function topNavScroll() { 87 jQuery(window).scroll(function () { 88 89 if (!isHidden) { 90 //Animate off the screen while scrolling 91 jQuery('#top-bar').animate({ 92 top:'-55px' 93 }, 250, function () { 94 //Make hidden to disable re-rendering 95 jQuery('#top-bar')[0].style.visibility = "hidden"; 96 }); 97 isHidden = true; 98 } 99 clearTimeout(jQuery.data(this, 'scrollTimer')); 100 jQuery.data(this, 'scrollTimer', setTimeout(function () { 101 //Animate back on the screen when finished scrolling and make visible 102 jQuery('#top-bar')[0].style.visibility = "visible"; 103 jQuery('#top-bar').animate({ 104 top:'0px' 105 }, 250, function () { 106 }); 107 isHidden = false; 108 }, 500)); 109 }); 110 } 111 112 113 /*Sticky box modyfication depoend on sticky box counter */ 114 115 function modifyStickyBox(){ 116 var sticky_post = $('.smartlib-featured-post-box'); 117 var sticky_count = sticky_post.length; 118 119 if(sticky_count%2!=0 && sticky_count> 2){ 120 121 sticky_post.last().addClass('smartlib-featured-post-box-wide'); 122 123 }else if(sticky_count==1){ 124 125 sticky_post.addClass('smartlib-featured-post-box-wide'); 126 127 } 128 129 } 130})(jQuery); 131 132 133 134 135 136 137 138
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.