1/*** Kale - JS ***/ 2 3jQuery(document).ready(function($){ 4 5 kale_responsive_videos(); 6 kale_jump_to_recipe(); 7 8 $("#toggle-main_search").on("click", function (event) { 9 var x = setTimeout('jQuery(".main_search .form-control").focus()', 700); 10 }); 11 12 kale_fluidBox(); 13 $(window).load(function(){kale_fluidBox();}) 14 $(window).resize(function(){kale_fluidBox();}); 15 $('body').addClass('js'); 16 17 18 /* $(".owl-carousel").owlCarousel({ 19 lazyContent:true, 20 loop:true, 21 nav:true, 22 dots:false, 23 autoplay:true, 24 items:1, 25 animateOut: 'fadeOut', 26 animateIn: 'fadeIn', 27 }); */ 28 29 30 if($('.sidebar-column .instagram-pics').length>0){ 31 $(".sidebar-column .instagram-pics").owlCarousel({ 32 lazyContent:true, 33 loop:true, 34 nav:false, 35 dots:false, 36 autoplay:true, 37 items:1, 38 dots:false, 39 }); 40 } 41 42 43 $("select.form-control").selectpicker(); 44 $(".header-row-1-toggle").click(function(){ 45 $(this).toggleClass('open'); 46 $('.header-row-1').toggleClass('open'); 47 return false; 48 }); 49 50 $('body').on('click', '.checkbox label,.checkbox-inline label,.radio label,.radio-inline label', function () { 51 kale_setupLabel(); 52 }); 53 54 if ( $( ".sidebar-sticky" ).length ) { 55 var offset = $('.sidebar-sticky').offset(); 56 $(window).scroll(function(e) { 57 if(window.scrollY >= offset.top) { 58 $('.sidebar-sticky').addClass('sidebar-sticky-fixed'); 59 } else { 60 $('.sidebar-sticky').removeClass('sidebar-sticky-fixed'); 61 } 62 }); 63 } 64 65 $('.search-trigger').on( 'click', function() { 66 $(this).siblings('form').find('.search-field').toggleClass('visible').focus(); 67 }); 68 69 if ( $('.header-row-1 .widget_nav_menu li').hasClass( 'menu-item-has-children' ) ) { 70 $('.header-row-1 .menu-item-has-children').addClass('dropdown') 71 .find('> a').addClass('dropdown-toggle has-submenu') 72 .append('<span class="caret 0"></span>'); 73 } 74 75}); 76 77 78jQuery(document).ready(function($){ 79 80 if($( "#main_menu" ).hasClass( "stick-to-top" )) { 81 var admin_bar = $('body').hasClass('admin-bar') ? 32 : 0; 82 var $header_3 = $('.header .header-row-3'); 83 var $nav_bar = $header_3.find('.navbar'); 84 var nav_off_top = $nav_bar.offset().top - admin_bar; 85 var nav_height = $nav_bar.height(); 86 $(window).resize(function(){ 87 nav_off_top = $nav_bar.offset().top; 88 nav_height = $nav_bar.height(); 89 }); 90 $(window).scroll(function(){ 91 var w_scroll = $(window).scrollTop(); 92 if(w_scroll>=nav_off_top && !$nav_bar.hasClass('navbar-fixed-top')){ 93 $header_3.find('.stick-to-top').addClass('navbar-fixed-top container'); 94 $header_3.css('height',nav_height); 95 }else if(w_scroll<nav_off_top && $nav_bar.hasClass('navbar-fixed-top')){ 96 $header_3.find('.stick-to-top').removeClass('navbar-fixed-top container'); 97 $header_3.css('height','auto'); 98 } 99 }); 100 } 101}); 102 103 104function kale_setupLabel() { 105 if (jQuery('.checkbox,.checkbox-inline').length) { 106 jQuery('.checkbox label,.checkbox-inline label').each(function(){ 107 jQuery(this).removeClass('on'); 108 }); 109 jQuery('.checkbox input:checked,.checkbox-inline input:checked').each(function(){ 110 jQuery(this).parent('label').addClass('on'); 111 }); 112 }; 113 if (jQuery('.radio,.radio-inline').length) { 114 jQuery('.radio label,.radio-inline label').each(function(){ 115 jQuery(this).removeClass('on'); 116 }); 117 jQuery('.radio input:checked,.radio-inline input:checked').each(function(){ 118 jQuery(this).parent('label').addClass('on'); 119 }); 120 }; 121};
122 123function kale_fluidBox(){ 124 if(jQuery('[data-fluid]').length>0){ 125 jQuery('[data-fluid]').each(function(){ 126 var data = jQuery(this).attr('data-fluid'); 127 var dataFloat = jQuery(this).attr('data-float'); 128 var _container = jQuery(this); 129 var dataSplit = data.split(','); 130 if(_container.hasClass('carousel')){ 131 _container.find('.item').addClass('show'); 132 } 133 for(i=0;i<dataSplit.length;i++){ 134 if(dataSplit[i]!=''){ 135 if(jQuery(dataSplit[i],_container).length>0){ 136 jQuery(dataSplit[i],_container).css('min-height','inherit'); 137 if( dataFloat=='true' && jQuery(dataSplit[i],_container).parent().css('float')!='none' ){ 138 var newH = 0; 139 if(jQuery(dataSplit[i],_container).length>0){ 140 jQuery(dataSplit[i],_container).each(function(){ 141 var thisH = jQuery(this).innerHeight(); 142 if( newH<thisH ) newH = thisH; 143 }); 144 jQuery(dataSplit[i],_container).css('min-height',newH); 145 } 146 }else if(dataFloat!='true'){ 147 var newH = 0; 148 if(jQuery(dataSplit[i],_container).length>0){ 149 jQuery(dataSplit[i],_container).each(function(){ 150 var thisH = jQuery(this).innerHeight(); 151 if( newH<thisH ) newH = thisH; 152 }); 153 jQuery(dataSplit[i],_container).css('min-height',newH); 154 } 155 } 156 } 157 } 158 } 159 if(_container.hasClass('carousel')){ 160 _container.find('.item').removeClass('show'); 161 } 162 }); 163 } 164} 165 166//http://www.skipser.com/p/2/p/auto-resize-youtube-videos-in-responsive-layout.html 167function kale_responsive_videos(){ 168 YOUTUBE_VIDEO_MARGIN = 5; 169 jQuery('.single-content iframe, .page-content iframe').each(function(index,item) { 170 if(jQuery(this)[0].hasAttribute("src") && jQuery(item).attr('src').match(/(https?:)?\/\/www\.youtube\.com/)) { 171 var w=jQuery(item).attr('width'); 172 var h=jQuery(item).attr('height'); 173 var ar = h/w*100; 174 ar=ar.toFixed(2); 175 //Style iframe 176 jQuery(item).css('position','absolute'); 177 jQuery(item).css('top','0'); 178 jQuery(item).css('left','0'); 179 jQuery(item).css('width','100%'); 180 jQuery(item).css('height','100%'); 181 jQuery(item).css('max-width',w+'px'); 182 jQuery(item).css('max-height', h+'px'); 183 jQuery(item).wrap('<div style="max-width:'+w+'px;margin:0 auto; padding:'+YOUTUBE_VIDEO_MARGIN+'px;" />'); 184 jQuery(item).wrap('<div style="position: relative;padding-bottom: '+ar+'%; height: 0; overflow: hidden;" />'); 185 } 186 }); 187} 188 189function kale_jump_to_recipe(){ 190 191 jQuery('.jump-to-recipe a').on('click',function (e) { 192 e.preventDefault(); 193 194 var target = this.hash; 195 var $target = jQuery(target); 196 197 jQuery('html, body').stop().animate({ 198 'scrollTop': $target.offset().top 199 }, 900, 'swing', function () { 200 window.location.hash = target; 201 }); 202 }); 203 204}
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.