1/** 2 * Theme functions file 3 */ 4(function ($) { 5 'use strict'; 6 7 var $document = $(document); 8 var $window = $(window); 9 10 11 /** 12 * Document ready (jQuery) 13 */ 14 $(function () { 15 16 /** 17 * Activate superfish menu. 18 */ 19 $('.sf-menu').superfish({ 20 'speed': 'fast', 21 'delay' : 0, 22 'animation': { 23 'height': 'show' 24 } 25 }); 26 27 /** 28 * SlickNav 29 */ 30 31 $('#menu-main-slide').slicknav({ 32 prependTo:'.navbar-header-main', 33 allowParentLinks: true, 34 closedSymbol: "", 35 openedSymbol: "" 36 } 37 ); 38 39 /* Tag Cloud fix */ 40 $('.tag-cloud-link:has(.post_count)').addClass('has_sub'); 41 42 43 /** 44 * FitVids - Responsive Videos in posts 45 */ 46 $(".entry-content, .cover").fitVids(); 47 48 49 /** 50 * Search form in header. 51 */ 52 $(".sb-search").sbSearch(); 53 54 55 // tick toggle 56 57 $(".shortcode-ingredients li").prepend('<span class="tick"></span>') 58 59 60 $(".shortcode-ingredients li").click(function(){ 61 $(this).find("span").toggleClass("ticked"); 62 $(this).toggleClass("ticked"); 63 }); 64 65 /** 66 * Retina-ready images in Slider. 67 */ 68 $.fn.responsiveSliderImages(); 69 70 /** 71 * Recipe Index infinite loading support. 72 */ 73 var $folioitems = $('.foodica-index'); 74 if (typeof wpz_currPage != 'undefined' && wpz_currPage < wpz_maxPages) { 75 $('.navigation').empty().append('<a class="btn btn-primary" id="load-more" href="#">' + zoomOptions.index_infinite_load_txt + '</a>'); 76 77 $('#load-more').on('click', function (e) { 78 e.preventDefault(); 79 if (wpz_currPage < wpz_maxPages) { 80 $(this).text(zoomOptions.index_infinite_loading_txt); 81 wpz_currPage++; 82 83 $.get(wpz_pagingURL + wpz_currPage + '/', function (data) { 84 var $newItems = $('.foodica-index article', data); 85 86 $newItems.addClass('hidden').hide(); 87 $folioitems.append($newItems); 88 $folioitems.find('article.hidden').fadeIn().removeClass('hidden'); 89 90 if ((wpz_currPage + 1) <= wpz_maxPages) { 91 $('#load-more').text(zoomOptions.index_infinite_load_txt); 92 } else { 93 $('#load-more').animate({height: 'hide', opacity: 'hide'}, 'slow', function () { 94 $(this).remove(); 95 }); 96 } 97 }); 98 } 99 }); 100 } 101 102 103 104 105 }); 106 107 $window.on('load', function() { 108 // $window.ready(function() { 109 110 /** 111 * Activate main slider. 112 */ 113 $('#slider').sllider(); 114 115 116 }); 117 118 119 $.fn.sllider = function() { 120 return this.each(function () { 121 var $this = $(this); 122 123 var $slides = $this.find('.slide'); 124 125 if ($slides.length <= 1) { 126 $slides.addClass('is-selected'); 127 128 return; 129 } 130 131 var flky = new Flickity('.slides', { 132 autoPlay: (zoomOptions.slideshow_auto ? parseInt(zoomOptions.slideshow_speed, 10) : false), 133 cellAlign: 'center', 134 contain: true, 135 percentPosition: false, 136 //prevNextButtons: false, 137 pageDots: true, 138 wrapAround: true, 139 accessibility: false 140 }); 141 }); 142 }; 143 144 145 $.fn.sbSearch = function() { 146 return this.each(function() { 147 new UISearch( this ); 148 }); 149 }; 150 151 $.fn.responsiveSliderImages = function () { 152 $(window).on('resize orientationchange', update); 153 154 function update() { 155 var windowWidth = $(window).width(); 156 157 158 if (windowWidth > 900) { 159 retinajs(); 160 } 161 } 162 163 update(); 164 }; 165 166 167})(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.