1/** 2 * Motive Theme Utilities 3 */ 4var Bunyad_Theme = (function($) { 5 "use strict"; 6 7 var has_touch = false, 8 responsive_menu = false; 9 10 // module 11 return { 12 13 init: function() 14 { 15 // posts grid 16 var grid = $('.posts-grid').data('grid-count'); 17 if (parseInt(grid) > 0) { 18 $('.posts-grid .column:nth-child(' + grid + 'n)').addClass('last'); 19 } 20 21 // fit videos to container 22 $('.featured-vid, .post-content').fitVids(); 23 24 // fix limitation of inline read more text 25 $('.read-more').each(function() { 26 if ($(this).position().left === 0) { 27 $(this).addClass('new-line'); 28 } 29 }); 30 31 /** 32 * Social Share 33 */ 34 $('.share-links .more').click(function() { 35 36 $(this).parent().find('.share-more').addClass('active'); 37 $(this).remove(); 38 39 return false; 40 }); 41 42 // social icons widget 43 $('.lower-footer .social-icons a, .share-links a').data('toggle', 'tooltip').tooltip({placement: 'top'}); 44 $('.social-icons a').tooltip({placement: 'bottom'}); 45 46 $('.search-box .top-icon').click(function() { 47 $(this).parent().toggleClass('active'); 48 return false; 49 }); 50 51 // news focus block 52 $('.news-focus .subcats a').click(function() { 53 54 var active = $(this).parents('.subcats').find('a.active'), 55 parent = $(this).parents('.news-focus'); 56 57 // show the news and hide the other block 58 parent.find('.news-' + active.data('id')).hide(); 59 parent.find('.news-' + $(this).data('id')).fadeIn('slow'); 60 61 $(this).addClass('active'); 62 active.removeClass('active'); 63 64 return false; 65 }); 66 67 // setup all sliders 68 this.sliders(); 69 70 // handle shortcodes 71 this.shortcodes(); 72 73 // setup mobile navigation 74 this.responsive_nav(); 75 76 // start the news ticker 77 this.news_ticker(); 78 79 // setup the lightbox 80 this.lightbox(); 81 82 // use sticky navigation if enabled 83 this.sticky_nav(); 84 85 this.user_ratings(); 86 87 this.content_slideshow(); 88 89 /** 90 * IE fixes 91 */ 92 if ($.browser.msie && 8 == parseInt($.browser.version)) { 93 94 // fontawesome4 fails to draw sometimes on IE8 95 $(function() { 96 var $ss = $('#motive-font-awesome-css'); 97 $ss[0].href = $ss[0].href; 98 }); 99 100 // background image fix for IE8 101 var bg = $('body').css('background-attachment'), 102 bg_url = $('body').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2'); 103 104 if (bg == 'fixed' && bg_url) { 105 106 $('body').append('<style type="text/css">.bg-overlay { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + bg_url + '\', sizingMethod=\'scale\'); \ 107 -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + bg_url + '\', sizingMethod=\'scale\')"; }</style>'); 108 109 $('<div class="bg-overlay"></div>').appendTo('body'); 110 } 111 } 112 113 // add support for placeholder in IE8/IE9 114 $('input, textarea').placeholder(); 115 }, 116 117 news_ticker: function() 118 { 119 $('.trending-ticker ul').each(function() { 120 if (!$(this).find('li.active').length) { 121 $(this).find('li:first').addClass('active'); 122 } 123 124 var ticker = $(this); 125 126 window.setInterval(function() { 127 128 129 var active = ticker.find('li.active'); 130 active.fadeOut(function() { 131 132 var next = active.next(); 133 if (!next.length) { 134 next = ticker.find('li:first'); 135 } 136 137 next.addClass('active').fadeIn(); 138 active.removeClass('active'); 139 }); 140 141 142 143 }, 8000); 144 }); 145 }, 146 147 responsive_nav: function() 148 { 149 // detect touch capability dynamically 150 $(window).on('touchstart', function() { 151 has_touch = true; 152 $('body').addClass('touch'); 153 }); 154 155 this.init_responsive_nav(); 156 this.touch_nav(); 157 var that = this; 158 159 $(window).on('resize orientationchange', function() { 160 that.init_responsive_nav(); 161 }); 162 }, 163 164 /** 165 * Setup the responsive nav events and markup 166 */ 167 init_responsive_nav: function() { 168 169 if ($(window).width() > 939 || responsive_menu) { 170 return; 171 } 172 173 // set responsive initialized 174 responsive_menu = true; 175 176 // clone navigation for mobile 177 var clone = $('.navigation > div[class$="-container"]').clone().addClass('mobile-menu-container'), 178 mobile_search = false, 179 off_canvas = true; 180 181 // off-canvas setup? 182 if (off_canvas) { 183 clone.addClass('off-canvas');
184 clone.find('.menu').prepend($('<li class="close"><a href="#"><span>' + $('.navigation .selected .text').text() + '</span> <i class="fa fa-times-circle"></i></a></li>')); 185 $('body').addClass('nav-off-canvas'); 186 } 187 188 clone.find('.menu').addClass('mobile-menu') 189 .find('.mega-menu.links').removeClass('mega-menu links ts-row'); 190 191 clone.find('div.mega-menu').each(function() { 192 $(this).replaceWith('<ul>' + $(this).find('.sub-nav').html() + '</ul>'); 193 }); 194 195 clone.appendTo('.navigation'); 196 197 // register click handlers for mobile menu 198 $('.navigation .mobile .selected').click(function(e) { 199 200 // search active? 201 if ($(e.target).hasClass('hamburger') || !mobile_search || !$(this).find('.search .query').is(':visible')) { 202 203 if (off_canvas) { 204 $('.navigation .mobile-menu').addClass('active'); 205 $('body').toggleClass('off-canvas-active'); 206 } 207 else { 208 $('.navigation .mobile-menu').toggleClass('active'); 209 } 210 211 return false; 212 } 213 }); 214 215 // off-canvas close 216 $('.off-canvas .close').click(function() { 217 $('body').toggleClass('off-canvas-active'); 218 }); 219 220 // setup mobile menu click handlers 221 $('.navigation .mobile-menu li > a').each(function() { 222 223 if ($(this).parent().children('ul').length) { 224 $('<a href="#" class="chevron"><i class="fa fa-caret-down"></i></a>').appendTo($(this)); 225 } 226 }); 227 228 $('.navigation .mobile-menu li .chevron').click(function() { 229 $(this).closest('li').find('ul').first().slideToggle().parent().toggleClass('active item-active'); 230 return false; 231 }); 232 233 // add active item 234 if (!$('body').hasClass('home')) { 235 var last = $('.mobile-menu .current-menu-item').last().find('> a'); 236 if (last.length) { 237 238 var selected = $('.navigation .mobile .selected'), 239 current = selected.find('.current'), 240 cur_text = selected.find('.text').text(); 241 242 if (cur_text.slice(-1) !== ':') { 243 selected.find('.text').text(cur_text + ':'); 244 } 245 246 current.text(last.text()); 247 } 248 } 249 }, 250 251 touch_nav: function() { 252 253 var targets = $('.menu:not(.mobile-menu) a'), 254 open_class = 'item-active', 255 child_tag = 'ul, .mega-menu'; 256 257 targets.each(function() { 258 259 var $this = $(this), 260 $parent = $this.parent('li'), 261 $siblings = $parent.siblings().find('a'); 262 263 $this.click(function(e) { 264 265 if (!has_touch) { 266 return; 267 } 268 269 var $this = $(this); 270 e.stopPropagation(); 271 272 $siblings.parent('li').removeClass(open_class); 273 274 // has a child? open the menu on tap 275 if (!$this.parent().hasClass(open_class) && $this.next(child_tag).length > 0 && !$this.parents('.mega-menu.links').length) { 276 e.preventDefault(); 277 $this.parent().addClass(open_class); 278 } 279 }); 280 }); 281 282 // close all menus 283 $(document).click(function(e) { 284 if (!$(e.target).is('.menu') && !$(e.target).parents('.menu').length) { 285 targets.parent('li').removeClass(open_class); 286 } 287 }); 288 }, 289 290 sticky_nav: function() 291 { 292 var nav = $('.navigation'), 293 nav_top = nav.offset().top; 294 295 // not enabled? 296 if (!nav.data('sticky-nav')) { 297 return; 298 } 299 300 if (nav.find('.sticky-logo').length) { 301 nav.addClass('has-logo'); 302 } 303 304 var sticky = function() { 305 306 if (!nav.data('sticky-nav') || $(window).width() < 800) { 307 return; 308 } 309 310 // make it sticky when viewport is scrolled beyond the navigation 311 if ($(window).scrollTop() > nav_top) { 312 313 if (!nav.hasClass('sticky')) { 314 nav.addClass('sticky no-transition'); 315 316 setTimeout(function() { 317 nav.removeClass('no-transition'); 318 }, 100); 319 } 320 321 } else { 322 nav.removeClass('sticky'); 323 } 324 }; 325 326 sticky(); 327 328 $(window).scroll(function() { 329 sticky(); 330 }); 331 332 }, 333 334 /** 335 * Setup all the sliders available 336 */ 337 sliders: function() 338 { 339 340 var is_rtl = $('html').attr('dir') == 'rtl' ? true : false; 341 342 // Setup carousels for blocks 343 $('.owl-carousel').each(function() { 344 345 var per_slide = $(this).data('items') || 3; 346 347 $(this).owlCarousel({ 348 nav: false, 349 responsive: { 350 0: {items: 1}, 351 600: {items: (per_slide > 2 ? 2 : per_slide)}, 352 768: {items: (per_slide > 3 ? 3 : per_slide)}, 353 940: {items: per_slide} 354 }, 355 margin: $(this).data('margin') || 22, 356 stagePadding: $(this).data('stage-pad') || 0, 357 slideBy: 'page', 358 rtl: is_rtl 359 }); 360 }); 361 362 // attach event handlers to carousel nav bars 363 var owl_nav_handler = function(container, selector) { 364 $(container).find(selector).click(function() { 365 366 var owl = $(this).closest(container).parent().find('.owl-carousel'); 367 owl.owlCarousel(); 368 369 var action = ($(this).hasClass('next') ? 'next' : 'prev'); 370 owl.trigger(action + '.owl.carousel'); 371 372 return false; 373 }); 374 }; 375 376 owl_nav_handler('.carousel-nav-bar', 'a'); 377 378 379 // Fire up main slider 380 $('.main-slider').each(function() { 381 382 $(this).addClass('owl-carousel').owlCarousel({ 383 items: 1, 384 animateOut: ($(this).data('animation') == 'fade' ? 'fadeOut' : null), 385 loop: true, 386 autoplay: $(this).data('autoplay') || 0, 387 autoplayTimeout: $(this).data('autoplay-interval') || 0, 388 nav: true, 389 rtl: is_rtl, 390 navText: ['', ''], 391 autoplayHoverPause: true 392 }); 393 });
394 // CSS hover event won't trigger while animating - set JS events 395 $('.main-slider.as-primary a').hover( 396 function() { 397 $(this).closest('.owl-carousel').find('.active').addClass('hover'); 398 }, 399 400 function() { 401 $(this).closest('.owl-carousel').find('.hover').removeClass('hover'); 402 } 403 ); 404 405 /** 406 * Grid Slider 407 */ 408 var grid_owl = $('.featured-grid .grid'), 409 grid_carousel = function() { 410 411 grid_owl.addClass('owl-carousel').owlCarousel({ 412 items: 1, 413 animateOut: 'fadeOut', 414 loop: false, 415 nav: false, 416 autoplayHoverPause: true, 417 rtl: is_rtl 418 }); 419 }; 420 421 // convert featured grid to slider on mobile devices 422 var resize_grid_carousel = function() { 423 424 var has_carousel = grid_owl.hasClass('owl-carousel'); 425 426 if ($(window).width() > 939) { 427 if (!has_carousel) { 428 return; 429 } 430 431 grid_owl.trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded'); 432 grid_owl.find('.owl-stage-outer').children().unwrap(); 433 } 434 else { 435 if (!has_carousel) { 436 grid_carousel(); 437 } 438 } 439 }; 440 441 // on init and resize 442 resize_grid_carousel(); 443 $(window).on('resize', resize_grid_carousel); 444 445 446 // Twitter widget carousel 447 $('.latest-tweets .tweets').addClass('owl-carousel').owlCarousel({ 448 items: 1, 449 mouseDrag: false, 450 rtl: is_rtl 451 }); 452 453 owl_nav_handler('.twitter-widget', '.tweet-nav a'); 454 }, 455 456 /** 457 * Multi-page Post content slideshow 458 */ 459 content_slideshow: function() 460 { 461 462 var slideshow_cache = {}, 463 slideshow_wrap = '.post-slideshow .post-pagination-next', 464 that = this; 465 466 if ($(slideshow_wrap).length && $(slideshow_wrap).data('type') == 'ajax') { 467 468 var processing; 469 470 $('.main-content').on('click', '.post-slideshow .post-pagination-next a', function() { 471 472 // showing on home-page? 473 if ($('body').hasClass('page')) { 474 return; 475 } 476 477 // abort existing request 478 if (processing && processing.hasOwnProperty('abort')) { 479 processing.abort(); 480 } 481 482 var parent = $(this).closest('.post-slideshow'), 483 url = $(this).attr('href'); 484 485 parent.css('height', parent.height() + 'px'); 486 parent.find('.content-page').removeClass('active').addClass('hidden previous'); 487 488 var show_slide = function(data) { 489 490 // change browser url 491 if (history.pushState) { 492 history.pushState({}, '', url); 493 } 494 495 var page = $(data).find('.post-slideshow'); 496 497 if (page.length) { 498 parent.find('.post-pagination-next').html(page.find('.post-pagination-next').html()); 499 parent.prepend(page.find('.content-page').addClass('hidden loading')); 500 501 parent.find('.content-page.previous').remove(); 502 503 // rebind lightbox 504 that.lightbox(); 505 506 setTimeout(function() { 507 parent.css('height', 'auto'); 508 parent.find('.content-page.loading').removeClass('previous hidden loading'); 509 }, 1); 510 } 511 512 processing = null; 513 514 }; 515 516 // in cache? 517 if (slideshow_cache[url]) { 518 show_slide(slideshow_cache[url]); 519 } 520 else { 521 522 // get via ajax 523 processing = $.get(url, function(data) { 524 slideshow_cache[url] = data; 525 show_slide(data); 526 }); 527 } 528 529 return false; 530 }); 531 532 // keyboard nav 533 $(document).on('keyup', function(e) { 534 if (e.which == 37) { 535 $(slideshow_wrap).find('.prev').parent().click(); 536 } 537 else if (e.which == 39) { 538 $(slideshow_wrap).find('.next').parent().click(); 539 } 540 }); 541 542 } // end slideshow wrap 543 }, 544 545 /** 546 * Register shortcode related events 547 */ 548 shortcodes: function() 549 { 550 // normal tabs 551 $('.tabs-list a').click(function() { 552 var tab = $(this).data('tab'); 553 554 $('.tabbed .tabs-list .active').removeClass('active'); 555 $(this).parent().addClass('active'); 556 $('.tabbed .tab-posts.active').hide(); 557 558 // show pane 559 $('#recent-tab-' + tab).fadeIn('slow').addClass('active'); 560 561 // fix for li counters in IE <=9 562 if ($.browser.msie && parseInt($.browser.version) <= 9) { 563 setTimeout(function() { 564 $('#recent-tab-' + tab).hide().delay(1).show(); 565 }, 2); 566 } 567 568 return false; 569 570 }); 571 572 /** 573 * Shortcode: Tabs 574 */ 575 $('.sc-tabs a').click(function() { 576 577 // tabs first 578 var tabs = $(this).parents('ul'); 579 tabs.find('.active').removeClass('active'); 580 $(this).parent().addClass('active'); 581 582 // panes second 583 var panes = tabs.siblings('.sc-tabs-panes'); 584 585 panes.find('.active').hide().removeClass('active'); 586 panes.find('#sc-pane-' + $(this).data('id')).addClass('active').fadeIn(); 587 588 return false; 589 }); 590 591 /** 592 * Shortcode: Accordions & Toggles 593 */ 594 $('.sc-accordion-title > a').click(function() { 595 596 var container = $(this).parents('.sc-accordions'); 597 container.find('.sc-accordion-title').removeClass('active'); 598 container.find('.sc-accordion-pane').slideUp().removeClass('active'); 599 600 var pane = $(this).parent().next(); 601 if (!pane.is(':visible')) { 602 $(this).parent().addClass('active'); 603 pane.slideDown().addClass('active'); 604 } 605 606 return false; 607 }); 608 609 $('.sc-toggle-title > a').click(function() { 610 $(this).parent().toggleClass('active'); 611 $(this).parent().next().slideToggle().toggleClass('active'); 612 613 return false; 614 }); 615 616 }, 617 618 /** 619 * User Ratings handling 620 */ 621 user_ratings: function() 622 { 623 624 $('.user-ratings') 625 .filter(function() { 626 return !$(this).hasClass('voted'); 627 }) 628 .on('click', '.criterion', function() { 629 $(this).parent().find('.user-rate').toggle(500); 630 }); 631 632 $('.user-ratings .rate-button').on('click', function() { 633 634 var user_ratings = $(this).closest('.user-ratings'), 635 bar = user_ratings.find('.label'); 636 637 // get current votes 638 var votes = user_ratings.find('.vote-number'), 639 cur_votes = parseInt(votes.text()) || 0; 640 641 // setup ajax post data 642 var post_data = { 643 'action': 'bunyad_rate', 644 'id': user_ratings.data('post-id'), 645 'rating': user_ratings.find('select').val() * 10 646 }; 647 648 user_ratings.css('opacity', '0.3'); 649 650 // add to votes and disable further voting 651 votes.text((cur_votes + 1).toString()); 652 user_ratings.addClass('voted'); 653 654 $.post(Bunyad.ajaxurl, post_data, function(data) { 655 656 // update data 657 if (data === Object(data)) { 658 659 // change rating 660 var cur_rating = user_ratings.find('.number').text(); 661 user_ratings.find('.number').text( cur_rating.search('%') !== -1 ? data.percent + ' %' : data.decimal ); 662 663 bar.css('width', data.percent + '%'); 664 665 $('.review-box .user-rate').fadeOut('slow'); 666 } 667 668 user_ratings.hide().css('opacity', 1).fadeIn('slow'); 669 670 }, 'json'); 671 672 }); 673 }, 674 675 676 /** 677 * Setup Lightbox 678 */ 679 lightbox: function() { 680 681 // disabled on mobile screens 682 if (!$.fn.magnificPopup) { 683 return; 684 } 685 686 // filter to handle valid images only 687 var filter_images = function() { 688 689 if (!$(this).attr('href')) { 690 return false; 691 } 692 693 if ($(this).closest('.owl-item.cloned').length) { 694 return false; 695 } 696 697 return $(this).attr('href').match(/\.(jpe?g|png|bmp|gif)$/); 698 }; 699 700 /** 701 * Handle Galleries in post 702 */ 703 704 var gal_selectors = '.gallery-slider, .post-content .gallery, .post-content .tiled-gallery'; 705 706 // filter to only tie valid images 707 $(gal_selectors).find('a').has('img').filter(filter_images).addClass('lightbox-gallery-img'); 708 709 // attach the lightbox as gallery 710 $(gal_selectors).magnificPopup({ 711 delegate: '.lightbox-gallery-img', 712 type: 'image', 713 gallery: {enabled: true}, 714 removalDelay: 300, 715 image: { 716 titleSrc: function(item) { 717 var image = item.el.find('img'), caption = item.el.find('.caption').html(); 718 return (caption || image.attr('title') || ' '); 719 } 720 }, 721 mainClass: 'mfp-fade' 722 }); 723 724 // lightbox for non-gallery images in posts 725 var selector = $('.post-content, .main .featured').find('a:not(.lightbox-gallery-img)').has('img'); 726 727 selector.add('.post-content, .main .featured, .lightbox-img').filter(filter_images).magnificPopup({ 728 type: 'image', 729 removalDelay: 300, 730 mainClass: 'mfp-fade' 731 }); 732 } 733 734 }; // end return 735 736})(jQuery); 737 738// load when ready 739jQuery(function($) {
740 Bunyad_Theme.init(); 741 var stickLogo = jQuery('li.sticky-logo').html(); 742 jQuery('div.mobile > a > span.text').html(stickLogo); 743}); 744 745 746/** 747 * Plugins and 3rd Party Libraries 748 */ 749 750/** 751 * Author Christopher Blum 752 * Based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/ 753 * 754 * License: WTFPL 755 */ 756(function(b){function t(){var e,a={height:k.innerHeight,width:k.innerWidth};a.height||!(e=l.compatMode)&&b.support.boxModel||(e="CSS1Compat"===e?f:l.body,a={height:e.clientHeight,width:e.clientWidth});return a}function u(){var e=b(),g,q=0;b.each(m,function(a,b){var c=b.data.selector,d=b.$element;e=e.add(c?d.find(c):d)});if(g=e.length)for(d=d||t(),a=a||{top:k.pageYOffset||f.scrollTop||l.body.scrollTop,left:k.pageXOffset||f.scrollLeft||l.body.scrollLeft};q<g;q++)if(b.contains(f,e[q])){var h=b(e[q]),n=h.height(),p=h.width(),c=h.offset(),r=h.data("inview");if(!a||!d)break;c.top+n>a.top&&c.top<a.top+d.height&&c.left+p>a.left&&c.left<a.left+d.width?(p=a.left>c.left?"right":a.left+d.width<c.left+p?"left":"both",n=a.top>c.top?"bottom":a.top+d.height<c.top+n?"top":"both",c=p+"-"+n,r&&r===c||h.data("inview",c).trigger("inview",[!0,p,n])):r&&h.data("inview",!1).trigger("inview",[!1])}}var m={},d,a,l=document,k=window,f=l.documentElement,s=b.expando,g;b.event.special.inview={add:function(a){m[a.guid+"-"+this[s]]={data:a,$element:b(this)};g||b.isEmptyObject(m)||(g=setInterval(u,250))},remove:function(a){try{delete m[a.guid+"-"+this[s]]}catch(d){}b.isEmptyObject(m)&&(clearInterval(g),g=null)}};b(k).bind("scroll resize",function(){d=a=null});!f.addEventListener&&f.attachEvent&&f.attachEvent("onfocusin",function(){a=null})})(jQuery); 757 758/** 759 * Bootstrap: tooltip.js v3.2.0 760 * http://getbootstrap.com/javascript/#tooltip 761 * Licensed under MIT 762 */ 763+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;(n||"destroy"!=e)&&(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};i.VERSION="3.2.0",i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport);for(var n=this.options.trigger.split(" "),s=n.length;s--;){var r=n[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",p="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(p+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);
vendor: 4,253 bytes, line 763
763return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var i=t.contains(document.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!i)return;var o=this,n=this.tip(),s=this.getUID(this.type);this.setContent(),n.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&n.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,p=a.test(r);p&&(r=r.replace(a,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var l=this.getPosition(),h=n[0].offsetWidth,f=n[0].offsetHeight;if(p){var u=r,d=this.$element.parent(),c=this.getPosition(d);r="bottom"==r&&l.top+l.height+f-c.scroll>c.height?"top":"top"==r&&l.top-c.scroll-f<0?"bottom":"right"==r&&l.right+h>c.width?"left":"left"==r&&l.left-h<c.left?"right":r,n.removeClass(u).addClass(r)}var g=this.getCalculatedOffset(r,l,h,f);this.applyPlacement(g,r);var y=function(){o.$element.trigger("shown.bs."+o.type),o.hoverState=null};t.support.transition&&this.$tip.hasClass("fade")?n.one("bsTransitionEnd",y).emulateTransitionEnd(150):y()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,r=parseInt(o.css("margin-top"),10),a=parseInt(o.css("margin-left"),10);isNaN(r)&&(r=0),isNaN(a)&&(a=0),e.top=e.top+r,e.left=e.left+a,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var p=o[0].offsetWidth,l=o[0].offsetHeight;"top"==i&&l!=s&&(e.top=e.top+s-l);var h=this.getViewportAdjustedDelta(i,e,p,l);h.left?e.left+=h.left:e.top+=h.top;var f=h.left?2*h.left-n+p:2*h.top-s+l,u=h.left?"left":"top",d=h.left?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(f,o[0][d],u)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(){function e(){"in"!=i.hoverState&&o.detach(),i.$element.trigger("hidden.bs."+i.type)}var i=this,o=this.tip(),n=t.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(n),n.isDefaultPrevented()?void 0:(o.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",e).emulateTransitionEnd(150):e(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName;return t.extend({},"function"==typeof i.getBoundingClientRect?i.getBoundingClientRect():null,{scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop(),width:o?t(window).width():e.outerWidth(),height:o?t(window).height():e.outerHeight()},o?{top:0,left:0}:e.offset())},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,r=this.getPosition(this.$viewport);if(/right|left/.test(t)){var a=e.top-s-r.scroll,p=e.top+s-r.scroll+o;a<r.top?n.top=r.top-a:p>r.top+r.height&&(n.top=r.top+r.height-p)}else{var l=e.left-s,h=e.left+s+i;l<r.left?n.left=r.left-l:h>
763r.width&&(n.left=r.left+r.width-h)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery); 764 765/** 766 * FitVids 1.1 - https://github.com/davatron5000/FitVids.js 767 */ 768(function($){$.fn.fitVids=function(options){var settings={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var head=document.head||document.getElementsByTagName("head")[0];var css=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}";var div=document.createElement("div");div.innerHTML='<p>x</p><style id="fit-vids-style">'+css+"</style>";head.appendChild(div.childNodes[1])}if(options)$.extend(settings,options);return this.each(function(){var selectors=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];if(settings.customSelector)selectors.push(settings.customSelector);var ignoreList=".fitvidsignore";if(settings.ignore)ignoreList=ignoreList+", "+settings.ignore;var $allVideos=$(this).find(selectors.join(","));$allVideos=$allVideos.not("object object");$allVideos=$allVideos.not(ignoreList);$allVideos.each(function(){var $this=$(this);if($this.parents(ignoreList).length>0)return;if(this.tagName.toLowerCase()==="embed"&&$this.parent("object").length||$this.parent(".fluid-width-video-wrapper").length)return;if(!$this.css("height")&&!$this.css("width")&&(isNaN($this.attr("height"))||isNaN($this.attr("width")))){$this.attr("height",9);$this.attr("width",16)}var height=this.tagName.toLowerCase()==="object"||$this.attr("height")&&!isNaN(parseInt($this.attr("height"),10))?parseInt($this.attr("height"),10):$this.height(),width=!isNaN(parseInt($this.attr("width"),10))?parseInt($this.attr("width"),10):$this.width(),aspectRatio=height/width;if(!$this.attr("id")){var videoID="fitvid"+Math.floor(Math.random()*999999);$this.attr("id",videoID)}$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",aspectRatio*100+"%");$this.removeAttr("height").removeAttr("width")})})}})(window.jQuery||window.Zepto); 769 770 771/*! http://mths.be/placeholder v2.0.7 by @mathias */ 772(function(q,f,d){function r(b){var a={},c=/^jQuery\d+$/;d.each(b.attributes,function(b,d){d.specified&&!c.test(d.name)&&(a[d.name]=d.value)});return a}function g(b,a){var c=d(this);if(this.value==c.attr("placeholder")&&c.hasClass("placeholder"))if(c.data("placeholder-password")){c=c.hide().next().show().attr("id",c.removeAttr("id").data("placeholder-id"));if(!0===b)return c[0].value=a;c.focus()}else this.value="",c.removeClass("placeholder"),this==m()&&this.select()}function k(){var b,a=d(this),c=this.id;if(""==this.value){if("password"==this.type){if(!a.data("placeholder-textinput")){try{b=a.clone().attr({type:"text"})}catch(e){b=d("<input>").attr(d.extend(r(this),{type:"text"}))}b.removeAttr("name").data({"placeholder-password":a,"placeholder-id":c}).bind("focus.placeholder",g);a.data({"placeholder-textinput":b,"placeholder-id":c}).before(b)}a=a.removeAttr("id").hide().prev().attr("id",c).show()}a.addClass("placeholder");a[0].value=a.attr("placeholder")}else a.removeClass("placeholder")}function m(){try{return f.activeElement}catch(b){}}var h="placeholder"in f.createElement("input"),l="placeholder"in f.createElement("textarea"),e=d.fn,n=d.valHooks,p=d.propHooks;h&&l?(e=e.placeholder=function(){return this},e.input=e.textarea=!0):(e=e.placeholder=function(){this.filter((h?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":g,"blur.placeholder":k}).data("placeholder-enabled",!0).trigger("blur.placeholder");return this},e.input=h,e.textarea=l,e={get:function(b){var a=d(b),c=a.data("placeholder-password");return c?c[0].value:a.data("placeholder-enabled")&&a.hasClass("placeholder")?"":b.value},set:function(b,a){var c=d(b),e=c.data("placeholder-password");if(e)return e[0].value=a;if(!c.data("placeholder-enabled"))return b.value=a;""==a?(b.value=a,b!=m()&&k.call(b)):c.hasClass("placeholder")?g.call(b,!0,a)||(b.value=a):b.value=a;return c}},h||(n.input=e,p.value=e),l||(n.textarea=e,p.value=e),d(function(){d(f).delegate("form","submit.placeholder",function(){var b=d(".placeholder",this).each(g);setTimeout(function(){b.each(k)},10)})}),d(q).bind("beforeunload.placeholder",function(){d(".placeholder").each(function(){this.value=""})}))})(this,document,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.