1/** 2 * Functionality specific to theme. 3 * 4 * Provides helper functions to enhance the theme experience. 5 */ 6 7(function($){ 8 9 // Superfish 10 jQuery('ul.nav-menu').superfish({ 11 delay: 100, // delay on mouseout 12 animation: {opacity:'show', height:'show'}, // fade-in and slide-down animation 13 speed: 'fast', // speed of the opening animation. Equivalent to second parameter of jQuery's .animate() method 14 speedOut: 'fast', // speed of the closing animation. Equivalent to second parameter of jQuery's .animate() method 15 cssArrows: false // disable generation of arrow mark-up 16 }); 17 18 // Add active class for toggles and accordions 19 jQuery('.toggle-panel').on('show.bs.collapse', function (e) { 20 jQuery(e.target).prev('.toggle-heading').find('.toggle-toggle').addClass('active'); 21 }); 22 23 // Remove active class for toggles and accordions 24 jQuery('.toggle-panel').on('hide.bs.collapse', function (e) { 25 jQuery(this).find('.toggle-toggle').not($(e.target)).removeClass('active'); 26 }); 27 28 // Button to display search form 29 jQuery(".search-button").click(function(){ 30 jQuery(".topnav-search").slideToggle("fast"); 31 jQuery(this).toggleClass("active"); 32 return false; 33 }); 34 35 // Tooltips 36 jQuery("[data-toggle='tooltip']").tooltip(); 37 38 // Open external links in new window 39 jQuery('a[rel*=external]').click(function() { 40 window.open(this.href); 41 return false; 42 }); 43 44 // Scroll to top link 45 jQuery(document).ready(function() { 46 var offset = 220; 47 var duration = 500; 48 jQuery(window).scroll(function() { 49 if (jQuery(this).scrollTop() > offset) { 50 jQuery('#backtotop').fadeIn(duration); 51 } else { 52 jQuery('#backtotop').fadeOut(duration); 53 } 54 }); 55 jQuery('#backtotop').click(function(event) { 56 event.preventDefault(); 57 jQuery('html, body').animate({scrollTop: 0}, duration); 58 return false; 59 }) 60 }); 61 62 // Isotope Filter / Infinite Scroll for Standard Blog 63 jQuery(document).ready(function() { 64 var $blogcontainer = jQuery('.blog-container'); 65 $blogcontainer.imagesLoaded(function(){ 66 $blogcontainer.isotope({ 67 layoutMode: 'fitRows', 68 itemSelector : 'article', 69 }); 70 }); 71 jQuery('.blog-option-set a').click(function(){ 72 var selector = jQuery(this).attr('data-filter'); 73 $blogcontainer.isotope({ filter: selector }); 74 return false; 75 }); 76 var $optionSets = jQuery('.blog-option-set'), 77 $optionLinks = $optionSets.find('a'); 78 $optionLinks.click(function(){ 79 var $this = jQuery(this); 80 if ( $this.hasClass('selected') ) { 81 return false; 82 } 83 var $optionSet = $this.parents('.blog-option-set'); 84 $optionSet.find('.selected').removeClass('selected'); 85 $this.addClass('selected'); 86 }); 87 $blogcontainer.infinitescroll({ 88 nextSelector: "#next-posts a", 89 navSelector: "#next-posts a", 90 itemSelector: ".post", 91 contentSelector: ".blog-container", 92 behavior: "twitter", 93 loading: { 94 msgText: "Loading More Entries", 95 finishedMsg: "All Entries Loaded" 96 }, 97 }, 98 function( newElements ) { 99 var $newElems = jQuery(newElements).css({ opacity: 0 }); 100 $newElems.imagesLoaded(function(){
101 // show elems now they're ready 102 $newElems.animate({ opacity: 1 }); 103 $blogcontainer.isotope( 'appended', jQuery( $newElems ) ); 104 }); 105 }); 106 }); 107 108 // Isotope Filter / Infinite Scroll for Portfolio 109 jQuery(document).ready(function() { 110 var $portfoliocontainer = jQuery('.portfolio-container'); 111 $portfoliocontainer.imagesLoaded(function(){ 112 $portfoliocontainer.isotope({ 113 layoutMode: 'sloppyMasonry', 114 itemSelector : 'article', 115 }); 116 }); 117 jQuery('.portfolio-option-set a').click(function(){ 118 var selector = jQuery(this).attr('data-filter'); 119 $portfoliocontainer.isotope({ filter: selector }); 120 return false; 121 }); 122 var $optionSets = jQuery('.portfolio-option-set'), 123 $optionLinks = $optionSets.find('a'); 124 $optionLinks.click(function(){ 125 var $this = jQuery(this); 126 if ( $this.hasClass('selected') ) { 127 return false; 128 } 129 var $optionSet = $this.parents('.portfolio-option-set'); 130 $optionSet.find('.selected').removeClass('selected'); 131 $this.addClass('selected'); 132 }); 133 $portfoliocontainer.infinitescroll({ 134 nextSelector: "#next-posts a", 135 navSelector: "#next-posts a", 136 itemSelector: ".post", 137 contentSelector: ".portfolio-container", 138 behavior: "twitter", 139 loading: { 140 msgText: "Loading More Entries", 141 finishedMsg: "All Entries Loaded" 142 }, 143 }, 144 function( newElements ) { 145 var $newElems = jQuery(newElements).css({ opacity: 0 }); 146 $newElems.imagesLoaded(function(){
147 // show elems now they're ready 148 $newElems.animate({ opacity: 1 }); 149 $portfoliocontainer.isotope( 'appended', jQuery( $newElems ) ); 150 }); 151 }); 152 }); 153 154 // Isotope Filter / Infinite Scroll for Masonry Blog 155 jQuery(document).ready(function() { 156 var $masonrycontainer = jQuery('.masonry-container'); 157 $masonrycontainer.imagesLoaded(function(){ 158 $masonrycontainer.isotope({ 159 layoutMode: 'sloppyMasonry', 160 itemSelector : 'article', 161 }); 162 }); 163 jQuery('.masonry-option-set a').click(function(){ 164 var selector = jQuery(this).attr('data-filter'); 165 $masonrycontainer.isotope({ filter: selector }); 166 return false; 167 }); 168 var $optionSets = jQuery('.masonry-option-set'), 169 $optionLinks = $optionSets.find('a'); 170 $optionLinks.click(function(){ 171 var $this = jQuery(this); 172 if ( $this.hasClass('selected') ) { 173 return false; 174 } 175 var $optionSet = $this.parents('.masonry-option-set'); 176 $optionSet.find('.selected').removeClass('selected'); 177 $this.addClass('selected'); 178 }); 179 $masonrycontainer.infinitescroll({ 180 nextSelector: "#next-posts a", 181 navSelector: "#next-posts a", 182 itemSelector: ".post", 183 contentSelector: ".masonry-container", 184 behavior: "twitter", 185 loading: { 186 msgText: "Loading More Entries", 187 finishedMsg: "All Entries Loaded" 188 }, 189 }, 190 function( newElements ) { 191 var $newElems = jQuery(newElements).css({ opacity: 0 }); 192 $newElems.imagesLoaded(function(){
193 // show elems now they're ready 194 $newElems.animate({ opacity: 1 }); 195 $masonrycontainer.isotope( 'appended', jQuery( $newElems ) ); 196 }); 197 }); 198 }); 199 200 // Gallery Slider 201 jQuery(document).ready(function() { 202 jQuery('.galleryslider .flexslider').flexslider({ 203 animationLoop:true, 204 animationSpeed:500, 205 animation:'slide', 206 slideshow: true, 207 controlNav: 'thumbnails', 208 smoothHeight:true, 209 useCSS:false, 210 pauseOnAction: true, 211 pauseOnHover: true, 212 }); 213 }); 214 215 // PostSlide Shortcode 216 jQuery(document).ready(function() { 217 jQuery('.postslider .flexslider').flexslider({ 218 animationLoop:true, 219 animationSpeed:300, 220 animation:'slide', 221 slideshow: false, 222 controlNav: true, 223 smoothHeight:true, 224 useCSS:false, 225 pauseOnAction: true, 226 pauseOnHover: true, 227 }); 228 }); 229 230 231 // Fixed Navigation 232 jQuery(document).ready(function() { 233 jQuery(window).scroll(function() { 234 var yPos = ( jQuery(window).scrollTop() ); 235 if(yPos > 200) { // show fixed nav bar after screen has scrolled down 200px from the top 236 jQuery(".nav-fixed").fadeIn('fast'); 237 } else { 238 jQuery(".nav-fixed").fadeOut('fast'); 239 } 240 }); 241 }); 242 243 244 // Menu toggle for mobile devices - top navbar. 245 (function(){ 246 var nav = $('.nav-primary'), button, menu; 247 if ( ! nav ) 248 return; 249 250 button = nav.find( '.menu-toggle' ); 251 if ( ! button ) 252 return; 253 254 // Hide button if menu is missing or empty. 255 menu = nav.find( '#topnav' ); 256 if ( ! menu || ! menu.children().length ) { 257 button.hide(); 258 return; 259 } 260 261 jQuery( '.nav-primary .menu-toggle' ).on( 'click.themebeagle', function() { 262 nav.toggleClass( 'toggled-on', 300 ); 263 } ); 264 265 })(); 266 267 jQuery('.menu-item-has-children').click(function () { 268 jQuery(this).parent().toggleClass( 'shownav', 300 ); 269 }); 270 271 272 // Menu toggle for mobile devices - header nav bar. 273 (function() { 274 var nav = $( '.nav-secondary' ), button, menu; 275 if ( ! nav ) 276 return; 277 278 button = nav.find( '.menu-toggle' ); 279 if ( ! button ) 280 return; 281 282 // Hide button if menu is missing or empty. 283 menu = nav.find( '#secnav' ); 284 if ( ! menu || ! menu.children().length ) { 285 button.hide(); 286 return; 287 } 288 289 jQuery( '.nav-secondary .menu-toggle' ).on( 'click.themebeagle', function() { 290 nav.toggleClass( 'toggled-on', 300 ); 291 }); 292 293 })(); 294 295 296 // Menu toggle for mobile devices - fixed nav bar. 297 (function() { 298 var nav = $( '.nav-fixed' ), button, menu; 299 if ( ! nav ) 300 return; 301 302 button = nav.find( '.menu-toggle' ); 303 if ( ! button ) 304 return; 305 306 // Hide button if menu is missing or empty. 307 menu = nav.find( '#fixednav' ); 308 if ( ! menu || ! menu.children().length ) { 309 button.hide(); 310 return; 311 } 312 313 jQuery( '.nav-fixed .menu-toggle' ).on( 'click.themebeagle', function() { 314 nav.toggleClass( 'toggled-on', 300 ); 315 }); 316 317 })(); 318 319 320 jQuery(document).ready(function() { 321 322 // adding Active class to first selected tab and show 323 jQuery("ul.nav-tabs-widget li:first").addClass("active").show(); 324 325 // adding Active class to first selected tab and show 326 jQuery(".tab-content-widget .tab-pane:first").addClass("in active").show(); 327 328 // adding Active class to first selected tab and show 329 jQuery(".tabs-top ul.nav-tabs li:first").addClass("active").show(); 330 331 // adding Active class to first selected tab and show 332 jQuery(".tabs-top div.tab-pane:first").addClass("in active").show(); 333 334 // adding Active class to first selected tab and show 335 jQuery(".tabs-left ul.nav-tabs li:first").addClass("active").show(); 336 337 // adding Active class to first selected tab and show 338 jQuery(".tabs-left div.tab-pane:first").addClass("in active").show(); 339 }); 340 341 // These are functions only for the theme demo 342 jQuery(".nav-menu .darkheader").click(function(){ 343 jQuery('body').addClass('darkheader'); 344 return false; 345 }); 346 jQuery(".nav-menu .lightheader").click(function(){ 347 jQuery('body').removeClass('darkheader'); 348 return false; 349 }); 350 jQuery(".nav-menu .unboxed").click(function(){ 351 jQuery('body').addClass('unboxed'); 352 return false; 353 }); 354 jQuery(".nav-menu .boxed").click(function(){ 355 jQuery('body').removeClass('unboxed'); 356 return false; 357 }); 358 jQuery(".nav-menu .thumb-left").click(function(){ 359 jQuery('.standard-blog article.post').addClass('thumbs-left'); 360 jQuery('.standard-blog article.post').removeClass('thumbs-right'); 361 return false; 362 });
363 jQuery(".nav-menu .thumb-right").click(function(){ 364 jQuery('.standard-blog article.post').addClass('thumbs-right'); 365 jQuery('.standard-blog article.post').removeClass('thumbs-left'); 366 return false; 367 }); 368 jQuery(".nav-menu .thumb-top").click(function(){ 369 jQuery('.standard-blog article.post').removeClass('thumbs-right'); 370 jQuery('.standard-blog article.post').removeClass('thumbs-left'); 371 return false; 372 }); 373 // End theme demo functions 374 375 jQuery(document).ready(function($) { 376 jQuery(".woocommerce ul.products li.product a img, .woocommerce-page ul.products li.product a img").wrap("<div class='product-image-box'></div>"); 377 jQuery(".widget img.large-thumbnail, .widget img.medium-thumbnail").wrap("<div class='product-image-box'></div>"); 378 jQuery(".woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale").each(function() { 379 var item = jQuery(this); 380 item.prependTo(item.parent().find(".product-image-box")); 381 }); 382 }); 383 384 // Recipe Print Funtion 385 jQuery(document).ready(function(e) { 386 jQuery('#recipeprint').on('click', function(e) { 387 jQuery('.recipe-info').printThis({ 388 exclude: ['hr', '.recipeprint', '.recipe-image', '.recipe-credit' ], 389 include: ['.recipeprintlink' ] 390 }); 391 return false; 392 }); 393 }); 394 395})(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.