1jQuery(document).ready(function($) { 2 "use strict"; 3 4 /*** Sticky Leftbar ***/ 5 6 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.stickyLeftBar || 'enable' == hootData.stickyLeftBar ) { 7 if (typeof Waypoint === "function" && $('#leftbar-inner.hoot-sticky-leftbar').length) { 8 var offset = -10; // fixes bug: header gets stuck when no topbar i.e. header is at top 0 at page load 9 if( 'undefined' != typeof hootData && 'undefined' != typeof hootData.stickyHeaderOffset ) 10 offset = hootData.stickyHeaderOffset; 11 if ( typeof Waypoint.Sticky === 'function' ) { 12 var stickyHeader = new Waypoint.Sticky({ 13 element: $('#leftbar-inner.hoot-sticky-leftbar #header')[0], 14 offset: offset 15 }); 16 } else { console.log( 'Waypoint exist. Sticky does not.'); } 17 // var $leftbarinner = $('#leftbar-inner.hoot-sticky-leftbar'); 18 // var waypoints = $leftbarinner.waypoint(function(direction) { 19 // if(direction=='down') 20 // $leftbarinner.addClass('stuck'); 21 // if(direction=='up') 22 // $leftbarinner.removeClass('stuck'); 23 // },{offset: 'bottom-in-view'} // 'bottom-in-view' creates trouble with lightslider.move 24 // ); 25 } 26 } 27 28 /*** Lightbox ***/ 29 30 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightbox || 'enable' == hootData.lightbox ) { 31 if (typeof $.fn.lightGallery != 'undefined') { 32 33 // Add lightbox to Images 34 if ( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightboxImg || 'enable' == hootData.lightboxImg ) { 35 36 $('.woocommerce .entry.product > .images a').addClass('no-lightbox'); // Remove lightbox from woocommerce images, and let woo's lightbox take over 37 $('a[href]').filter(function() { 38 var href = $(this).attr('href'), 39 islb = href.match(/\.(jpg|gif|png|webp)\/?(\?+[^\s]*)*$/); 40 if ( !islb ) islb = /\/\/(?:www\.)?youtu(?:\.be\/|be\.com\/(?:watch\?v=|embed\/)+)/i.test(href); 41 if ( !islb ) islb = /\/\/(?:www\.)?vimeo.com\/(\d+)(?:\/[0-9a-z]+)?/i.test(href); 42 if ( !islb ) islb = /\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i.test(href); 43 if ( !islb ) islb = /\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i.test(href); 44 return islb; 45 }).each(function(i){ 46 var self = $(this), 47 href = self.attr('href'), 48 caption = '', 49 child = self.children('img'), 50 alt = self.attr('data-alt'), 51 title = self.attr('title'); 52 if ( !title ) title = self.attr('data-title'); 53 if ( !title ) title = child.attr('data-title'); 54 if ( !alt ) alt = child.attr('alt'); 55 56 self.attr('data-src', href).attr('data-lightbox','yes'); 57 if(title) caption += '<h4>'+title+'</h4>'; 58 if(alt) caption += '<p>'+alt+'</p>'; 59 if(caption) caption = '<div class="customHtml">'+caption+'</div>'; 60 if(caption) self.attr('data-sub-html', caption); 61 62 // Add lightbox if this is not a WordPress Gallery image, not a Jetpack Tiled Gallery or explicitly told not to use lightbox 63 if( 64 !self.parent('.gallery-icon').length && 65 !self.parent('.tiled-gallery-item').length && 66 !self.is('.no-lightbox') && 67 !(self.closest('.lightGallery').length) && 68 !(self.closest('.wp-block-gallery').length) 69 ) { 70 $(self.parent()).addClass('apply-lightbox'); 71 } 72 }); 73 $('.apply-lightbox').lightGallery({ 74 selector : "a[data-lightbox='yes']" // this 75 }); 76 77 } 78 79 // Add lightbox to WordPress Gallery and Jetpack Tiled Gallery 80 if ( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightboxWpGal || 'enable' == hootData.lightboxWpGal ) { 81 $(".gallery").each(function(i){ 82 var galID = $(this).attr('id'); 83 $(this).lightGallery({ 84 selector : "#"+galID+" .gallery-icon > a[href$='.jpg'], #"+galID+" .gallery-icon > a[href$='.png'], #"+galID+" .gallery-icon > a[href$='.jpeg'], #"+galID+" .gallery-icon > a[href$='.gif'], #"+galID+" .gallery-icon > a[href$='.webp']" 85 }); 86 }); 87 $(".wp-block-gallery").each(function(i){ 88 var galID = 'hoot-block-gallery-' + i; 89 $(this).addClass( galID ); 90 $(this).lightGallery({ 91 selector : "."+galID+" figure > a[href$='.jpg'], ."+galID+" figure > a[href$='.png'], ."+galID+" figure > a[href$='.jpeg'], ."+galID+" figure > a[href$='.gif'], ."+galID+" figure > a[href$='.webp']" 92 }); 93 }); 94 $(".tiled-gallery").each(function(i){ 95 var galID = 'hoot-tiled-gallery-' + i; 96 $(this).addClass( galID ); 97 $(this).lightGallery({ 98 selector : "."+galID+" .tiled-gallery-item > a[href$='.jpg'], ."+galID+" .tiled-gallery-item > a[href$='.png'], ."+galID+" .tiled-gallery-item > a[href$='.jpeg'], ."+galID+" .tiled-gallery-item > a[href$='.gif'], ."+galID+" .tiled-gallery-item > a[href$='.webp']" 99 }); 100 }); 101 } 102 103 } 104 } 105
106 /*** LightGallery (for brevity) ***/ 107 108 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightGallery || 'enable' == hootData.lightGallery ) { 109 if (typeof $.fn.lightGallery != 'undefined') { 110 $(".lightGallery").lightGallery({ 111 selector : 'a' 112 }); 113 } 114 } 115 116 /*** Isotope for Archive Mosaic Type ***/ 117 118 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.isotope || 'enable' == hootData.isotope ) { 119 if (typeof $.fn.isotope != 'undefined') { 120 var $mosaic = $(".archive-mosaic").first().parent(), 121 mosaic_relayout = function() { $mosaic.isotope( 'layout' ); }; 122 $mosaic.isotope({ 123 itemSelector: '.archive-mosaic' 124 }); 125 //$(window).load(function() { $mosaic.isotope( 'layout' ); }); 126 $(window).load(mosaic_relayout); // bug fix for cases when images are without width/height atts 127 } 128 } 129 130 /*** Number Boxes ***/ 131 132 var hootCircliful = function( $el ) { 133 if (typeof $.fn.circliful != 'undefined') { 134 $el.find(".number-block-circle").each(function(i){ 135 var $self = $(this), 136 settings = { 137 animation: 1, 138 foregroundBorderWidth: 10, 139 percent: 100, 140 }, 141 selfData = $self.data(), 142 customs = {}; 143 if ( selfData.foregroundcolor ) customs.foregroundColor = selfData.foregroundcolor; 144 if ( selfData.backgroundcolor ) customs.backgroundColor = selfData.backgroundcolor; 145 if ( selfData.fillcolor ) customs.fillColor = selfData.fillcolor; 146 if ( selfData.foregroundborderwidth ) customs.foregroundBorderWidth = selfData.foregroundborderwidth; 147 if ( selfData.backgroundborderwidth ) customs.backgroundBorderWidth = selfData.backgroundborderwidth; 148 if ( selfData.fontcolor ) customs.fontColor = selfData.fontcolor; 149 if ( selfData.percent ) customs.percent = selfData.percent; 150 if ( selfData.animation ) customs.animation = selfData.animation; 151 if ( selfData.animationstep ) customs.animationStep = selfData.animationstep; 152 if ( selfData.icon ) customs.icon = selfData.icon; 153 if ( selfData.iconsize ) customs.iconSize = selfData.iconsize; 154 if ( selfData.iconcolor ) customs.iconColor = selfData.iconcolor; 155 if ( selfData.iconposition ) customs.iconPosition = selfData.iconposition; 156 if ( selfData.percentagetextsize ) customs.percentageTextSize = selfData.percentagetextsize; 157 if ( selfData.textadditionalcss ) customs.textAdditionalCss = selfData.textadditionalcss; 158 if ( selfData.targetpercent ) customs.targetPercent = selfData.targetpercent; 159 if ( selfData.targettextsize ) customs.targetTextSize = selfData.targettextsize; 160 if ( selfData.targetcolor ) customs.targetColor = selfData.targetcolor; 161 if ( selfData.text ) customs.text = selfData.text; 162 if ( selfData.textstyle ) customs.textStyle = selfData.textstyle; 163 if ( selfData.textcolor ) customs.textColor = selfData.textcolor; 164 // WPHOOT MOD Values 165 if ( selfData.percentsign ) customs.percentSign = selfData.percentsign; 166 if ( selfData.displayprefix ) customs.displayPrefix = selfData.displayprefix; 167 if ( selfData.displaysuffix ) customs.displaySuffix = selfData.displaysuffix; 168 if ( selfData.display ) customs.display = selfData.display; 169 // WPHOOT MOD Values end 170 $.extend(settings,customs); 171 $self.circliful(settings); 172 }); 173 } 174 }; 175 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.circliful || 'enable' == hootData.circliful ) { 176 if (typeof Waypoint === "function") { 177 var nbwaypoints = $('.number-blocks-widget').waypoint(function(direction) { 178 if(direction=='down') { 179 hootCircliful( $(this.element) ); 180 this.destroy(); 181 } 182 },{offset: '75%'}); 183 } else { 184 $('.number-blocks-widget').each( function(){ 185 hootCircliful($(this)); 186 }); 187 } 188 } 189
190 /*** Shortcodes ***/ 191 192 /* Toggles */ 193 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scToggle || 'enable' == hootData.scToggle ) { 194 $('.shortcode-toggle-head').click( function() { 195 $( this ).siblings( '.shortcode-toggle-box' ).slideToggle( 'fast' ); 196 $( this ).toggleClass( 'shortcode-toggle-active' ); 197 $( this ).children( 'i' ).toggleClass( 'fa-plus fa-minus' ); 198 }); 199 } 200 201 /* Tabset */ 202 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scTabset || 'enable' == hootData.scTabset ) { 203 $('.shortcode-tabset').each(function(i){ 204 var self = $(this), 205 nav = self.find('.shortcode-tabset-nav > li'), 206 box = self.children('.shortcode-tabset-box'), 207 tabs = box.children('div'); 208 209 nav.click( function() { 210 var navself = $(this), 211 tabid = navself.data('tab'), 212 tabself = tabs.filter('[data-tab="'+tabid+'"]'); 213 214 tabs.removeClass('current'); 215 tabself.addClass('current'); 216 nav.removeClass('current'); 217 navself.addClass('current'); 218 }); 219 }); 220 } 221 222 /* Scroller (Divider) */ 223 if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scScroller || 'enable' == hootData.scScroller ) { 224 $('.shortcode-divider > a').on('click', function(e) { 225 e.preventDefault(); 226 var target = $(this).attr('href'); 227 var destin = $(target).offset().top; 228 if( target != '#page-wrapper') 229 destin -= 50; 230 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destin}, 500 ); 231 }); 232 } 233 234});
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.