window.socialWarfare=window.socialWarfare||{};
(function(window, $){
'use strict';
if(typeof $!=='function'){
if(typeof jQuery==='function'){
var $=jQuery;
}else{
console.log('Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.'
);
return;
}}
function isString(maybeString){
return typeof maybeString==='string'&&maybeString.length > 0;
}
socialWarfare.paddingTop=parseInt($('body').css('padding-top'));
socialWarfare.paddingBottom=parseInt(
$('body').css('padding-bottom')
);
socialWarfare.initPlugin=function (){
$('body').css({
paddingTop: socialWarfare.paddingTop,
paddingBottom: socialWarfare.paddingBottom,
});
socialWarfare.establishPanels();
socialWarfare.establishBreakpoint();
if(! socialWarfare.panels.staticHorizontal &&
! socialWarfare.panels.floatingSide &&
! socialWarfare.panels.floatingHorizontal
){
return;
}
socialWarfare.emphasizeButtons();
socialWarfare.createFloatHorizontalPanel();
socialWarfare.positionFloatSidePanel();
socialWarfare.activateHoverStates();
socialWarfare.handleButtonClicks();
socialWarfare.updateFloatingButtons();
socialWarfare.closeLightboxOverlay();
socialWarfare.preloadPinterestImages();
if(typeof swpPinIt==='object'&&swpPinIt.enabled==true){
socialWarfare.createHoverSaveButton();
socialWarfare.triggerImageListeners();
}
setTimeout(function (){
socialWarfare.checkListeners(0, 5);
}, 2e3);
let time=Date.now();
const scrollDelay=50;
$(window).on('scroll', function (){
if(time + scrollDelay - Date.now() < 0){
socialWarfare.updateFloatingButtons();
time=Date.now();
}});
};
let resizeWait;
socialWarfare.onWindowResize=function (){
clearTimeout(resizeWait);
resizeWait=setTimeout(socialWarfare.initPlugin, 100);
};
socialWarfare.establishPanels=function (){
socialWarfare.panels={
staticHorizontal: null,
floatingSide: null,
floatingHorizontal: null,
};
socialWarfare.panels.staticHorizontal=$('.swp_social_panel').not('.swp_social_panelSide'
);
socialWarfare.panels.floatingSide=$('.swp_social_panelSide');
return socialWarfare.panels;
};
socialWarfare.emphasizeButtons=function (){
if(typeof socialWarfare.variables.emphasizeIcons==='undefined'){
return;
}
if(socialWarfare.isMobile()){
return;
}
jQuery('.swp_social_panel:not(.swp_social_panelSide)').each(function(i, panel){
jQuery(panel)
.find('.nc_tweetContainer:not(.total_shares)')
.each(function(index, button){
if(index < socialWarfare.variables.emphasizeIcons){
const shareWidth=jQuery(button)
.find('.swp_share')
.width();
const iconWidth=jQuery(button)
.find('i.sw')
.outerWidth();
const iconTextWidth=shareWidth + iconWidth + 35;
const containerWidth=jQuery(button).width();
const change =
1 +(shareWidth + 35) / containerWidth;
if(change < 2){
jQuery(button)
.addClass('swp_nohover')
.css({ flex: '2 1 0%' })
.find('.iconFiller')
.width(iconTextWidth);
}else{
jQuery(button)
.addClass('swp_nohover')
.css({ flex: change + ' 1 0%' })
.find('.iconFiller')
.width(iconTextWidth);
}}
});
}
);
};
socialWarfare.activateHoverStates=function (){
socialWarfare.trigger('pre_activate_buttons');
$(
'.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer'
).on('mouseenter', function (){
if($(this).hasClass('swp_nohover')){
return;
}
socialWarfare.resetStaticPanel();
const termWidth=$(this).find('.swp_share').outerWidth();
const iconWidth=$(this).find('i.sw').outerWidth();
const containerWidth=$(this).width();
const change=1 +(termWidth + 35) / containerWidth;
$(this)
.find('.iconFiller')
.width(termWidth + iconWidth + 25 + 'px');
$(this).css('flex', change + ' 1 0%');
});
$('.swp_social_panel:not(.swp_social_panelSide)').on('mouseleave',
socialWarfare.resetStaticPanel
);
};
socialWarfare.resetStaticPanel=function (){
$(
'.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover) .iconFiller'
).removeAttr('style');
$(
'.swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover)'
).removeAttr('style');
};
socialWarfare.handleButtonClicks=function (){
$('.nc_tweet, a.swp_CTT').off('click');
$('.nc_tweet, a.swp_CTT').on('click', function(event){
if($(this).parent('.swp_print').length > 0){
event.preventDefault();
window.print();
return;
}
if(true===$(this).hasClass('pinterest_multi_image_select')
){
event.preventDefault();
socialWarfare.openMultiPinterestOverlay($(this));
return;
}
if($(this).parent('.swp_more').length > 0){
event.preventDefault();
socialWarfare.openMoreOptions($(this));
return;
}
if($(this).hasClass('noPop')){
return event;
}
if('undefined'===typeof $(this).data('link') &&
false===$(this).is('.swp-hover-pin-button')
){
return event;
}
event.preventDefault();
const href=$(this).data('link').replace('’', "'");
let height, width, top, left, instance, windowAttributes, network;
height=270;
width=500;
if($(this).is('.swp_pinterest a, .buffer_link a, .flipboard a, .swp-hover-pin-button'
)
){
height=550;
width=775;
}
if($(this).hasClass('nc_tweet')){
network=$(this)
.parents('.nc_tweetContainer')
.data('network');
}else if($(this).hasClass('swp_CTT')){
network='ctt';
}
top=window.screenY +(window.innerHeight - height) / 2;
left=window.screenX +(window.innerWidth - width) / 2;
windowAttributes =
'height=' +
height +
',width=' +
width +
',top=' +
top +
',left=' +
left;
instance=window.open(href, network, windowAttributes);
socialWarfare.trackClick(network);
});
};
socialWarfare.openMultiPinterestOverlay=function(element){
if($('.pinterest-overlay').length > 0){
$('.pinterest-overlay').fadeIn();
$('.swp-lightbox-inner').scrollTop(0);
return;
}
let html='';
const pin_data=element.data('pins');
let pin_images='';
pin_data.images.forEach(function(image){
const share_url =
'https://pinterest.com/pin/create/button/?url=' +
pin_data.url +
'&media=' +
image +
'&description=' +
encodeURIComponent(pin_data.description);
let pin_html='';
pin_html +='<div class="pin_image_select_wrapper">';
pin_html +='<img class="pin_image" src="' + image + '" />';
pin_html +=
'<a class="swp-hover-pin-button" href="' +
share_url +
'" data-link="' +
share_url +
'">Save</a>';
pin_html +='</div>';
pin_images +=pin_html;
});
html +=
'<div class="swp-lightbox-wrapper pinterest-overlay"><div class="swp-lightbox-inner">';
html +='<i class="sw swp_pinterest_icon top_icon"></i>';
html +='<div class="swp-lightbox-close"></div>';
html +='<h5>Which image would you like to pin?</h5>';
html +='<div class="pin_images_wrapper">';
html +=pin_images;
html +='</div>';
html +=socialWarfare.buildPoweredByLink();
html +='</div></div>';
$('body').append(html);
$('.pinterest-overlay').hide().fadeIn();
socialWarfare.handleButtonClicks();
let max_height=999999;
let iteration=0,
images=$('.pinterest-overlay .pin_images_wrapper img');
images.load(function (){
if(++iteration===images.length){
images
.each(function (){
if($(this).height() < max_height){
max_height=$(this).height();
}})
.promise()
.done(function (){
images.height(max_height + 'px');
const number_of_rows=Math.ceil(images.length / 4);
for(i=0; i < number_of_rows; i++){
const current_row_images=images.slice(i * 4,
i * 4 + 4
);
var max_allowable_width =
current_row_images.length / 4;
var total_width=$(
'.pin_images_wrapper'
).width();
var total_images_width=0;
current_row_images.each(function (){
total_images_width =
total_images_width + $(this).width();
});
var ratio=total_width / total_images_width;
current_row_images.each(function (){
const new_width =
(( $(this).width() * ratio) /
total_width) *
100 *
max_allowable_width -
1;
$(this)
.parent()
.width(new_width + '%');
$(this).height('auto');
});
var height=current_row_images.first().height();
current_row_images.each(function (){
$(this)
.width($(this).width())
.height(height);
});
}});
}});
};
socialWarfare.buildPoweredByLink=function (){
let html='';
if(true===socialWarfare.variables.powered_by_toggle){
let anchor_tag_open='';
let anchor_tag_close='';
if(false!==socialWarfare.variables.affiliate_link){
anchor_tag_open =
'<a href="' +
socialWarfare.variables.affiliate_link +
'" target="_blank">';
anchor_tag_close='</a>';
}
html =
'<div class="swp_powered_by">' +
anchor_tag_open +
'<span>Powered by</span> <img src="/wp-content/plugins/social-warfare/assets/images/admin-options-page/social-warfare-pro-light.png">' +
anchor_tag_close +
'</div>';
}
return html;
};
socialWarfare.preloadPinterestImages=function (){
if($('.pinterest_multi_image_select').length < 1){
return;
}
const pin_data=$('.pinterest_multi_image_select').data('pins');
pin_data.images.forEach(function(image_url){
const image_object=new Image();
image_object.src=image_url;
});
};
socialWarfare.openMoreOptions=function(element){
if($('.swp-more-wrapper').length > 0){
$('.swp-more-wrapper').fadeIn();
return;
}
const post_id=element
.parents('.swp_social_panel')
.data('post-id');
const data={
action: 'swp_buttons_panel',
post_id,
_ajax_nonce: swp_nonce,
};
jQuery.post(swp_ajax_url, data, function(response){
$('body').append(response);
$('.swp-lightbox-wrapper').hide().fadeIn();
socialWarfare.activateHoverStates();
socialWarfare.handleButtonClicks();
});
};
socialWarfare.closeLightboxOverlay=function (){
$('body').on('click', '.swp-lightbox-close', function (){
$('.swp-lightbox-wrapper').fadeOut();
});
$(document).on('keyup', function(e){
if(e.key==='Escape'){
$('.swp-lightbox-wrapper').fadeOut();
}});
};
socialWarfare.createFloatHorizontalPanel=function (){
if(! socialWarfare.panels.staticHorizontal.length){
return;
}
const floatLocation =
socialWarfare.panels.staticHorizontal.data('float');
const mobileFloatLocation =
socialWarfare.panels.staticHorizontal.data('float-mobile');
const backgroundColor =
socialWarfare.panels.staticHorizontal.data('float-color');
const wrapper=$(
'<div class="nc_wrapper swp_floating_horizontal_wrapper" style="background-color:' +
backgroundColor +
'"></div>'
);
let barLocation='';
if($('.nc_wrapper').length){
$('.nc_wrapper').remove();
}
if($('.swp_floating_horizontal_wrapper').length){
$('.swp_floating_horizontal_wrapper').remove();
}
if(floatLocation!='top' &&
floatLocation!='bottom' &&
mobileFloatLocation!='top' &&
mobileFloatLocation!='bottom'
){
return;
}
if(socialWarfare.isMobile()){
barLocation=mobileFloatLocation;
}else{
barLocation=floatLocation;
}
wrapper.addClass(barLocation).hide().appendTo('body');
socialWarfare.panels.floatingHorizontal =
socialWarfare.panels.staticHorizontal.first().clone();
socialWarfare.panels.floatingHorizontal
.addClass('nc_floater')
.appendTo(wrapper);
socialWarfare.updateFloatingHorizontalDimensions();
$('.swp_social_panel .swp_count').css({
transition: 'padding .1s linear',
});
};
socialWarfare.updateFloatingHorizontalDimensions=function (){
if(! socialWarfare.panels.staticHorizontal.length){
return;
}
if(! socialWarfare.panels.floatingHorizontal){
return;
}
let width='100%';
let left=0;
const panel=socialWarfare.panels.staticHorizontal;
let parent=panel.parent();
if(parent.hasClass('swp-hidden-panel-wrap')){
parent=parent.parent();
}
if('undefined'!==typeof panel.offset().left){
left=panel.offset().left;
}
if('undefined'!==typeof panel.width()){
width=panel.width();
}
if(left==0){
left=parent.offset().left;
}
if(width==100||width==0){
width=parent.width();
}
socialWarfare.panels.floatingHorizontal.css({
width,
left,
});
};
socialWarfare.staticPanelIsVisible=function (){
let visible=false;
const scrollPos=$(window).scrollTop();
$('.swp_social_panel')
.not('.swp_social_panelSide, .nc_floater')
.each(function(index){
const offset=$(this).offset();
if(typeof socialWarfare.floatBeforeContent!=='undefined' &&
'1'!=socialWarfare.floatBeforeContent
){
const theContent=$('.swp-content-locator').parent();
if(index===0 &&
theContent.length &&
theContent.offset().top >
scrollPos + $(window).height()
){
visible=true;
}}
if($(this).is(':visible') &&
offset.top + $(this).height() > scrollPos &&
offset.top < scrollPos + $(window).height()
){
visible=true;
}});
return visible;
};
socialWarfare.updateFloatingButtons=function (){
if(socialWarfare.panels.staticHorizontal.length){
var panel=socialWarfare.panels.staticHorizontal;
}else if(socialWarfare.panels.floatingSide.length){
var panel=socialWarfare.panels.floatingSide;
}else{
return;
}
var location=panel.data('float');
if(true==socialWarfare.isMobile()){
var location=panel.data('float-mobile');
}
if(location=='none'){
return $(
'.nc_wrapper, .swp_floating_horizontal_wrapper, .swp_social_panelSide'
).hide();
}
if(socialWarfare.isMobile()){
socialWarfare.toggleMobileButtons();
socialWarfare.toggleFloatingHorizontalPanel();
return;
}
if(location=='right'||location=='left'){
socialWarfare.toggleFloatingVerticalPanel();
}
if(location=='bottom'||location=='top'){
socialWarfare.toggleFloatingHorizontalPanel();
}};
socialWarfare.toggleMobileButtons=function (){
socialWarfare.panels.floatingSide.hide();
const visibility=socialWarfare.staticPanelIsVisible()
? 'collapse'
: 'visible';
$('.nc_wrapper, .swp_floating_horizontal_wrapper').css('visibility',
visibility
);
};
socialWarfare.toggleFloatingVerticalPanel=function (){
let direction='';
const location=socialWarfare.panels.floatingSide.data('float');
let visible=socialWarfare.staticPanelIsVisible();
let offset='';
if(socialWarfare.isMobile()){
return socialWarfare.panels.floatingSide.hide();
}
if(! socialWarfare.panels.floatingSide ||
! socialWarfare.panels.floatingSide.length
){
visible=true;
}
if(socialWarfare.panels.floatingSide.data('transition')=='slide'
){
direction=location;
offset=visible ? '-150px':'5px';
socialWarfare.panels.floatingSide.css(direction, offset).show();
}else if(visible){
socialWarfare.panels.floatingSide
.css('opacity', 1)
.fadeOut(300)
.css('opacity', 0);
}else{
socialWarfare.panels.floatingSide
.css('opacity', 0)
.fadeIn(300)
.css('display', 'flex')
.css('opacity', 1);
}};
socialWarfare.hasReferencePanel=function (){
return (
typeof socialWarfare.panels.staticHorizontal!=='undefined' &&
socialWarfare.panels.staticHorizontal.length > 0
);
};
socialWarfare.toggleFloatingHorizontalPanel=function (){
if(! socialWarfare.hasReferencePanel()){
return;
}
if(! socialWarfare.panels.floatingHorizontal){
return;
}
const panel=socialWarfare.panels.floatingHorizontal.first();
const location=socialWarfare.isMobile()
? $(panel).data('float-mobile')
: $(panel).data('float');
let newPadding =
location=='bottom'
? socialWarfare.paddingBottom
: socialWarfare.paddingTop;
const paddingProp='padding-' + location;
if(location=='off'){
return;
}
if(socialWarfare.staticPanelIsVisible()){
$('.nc_wrapper, .swp_floating_horizontal_wrapper').hide();
if(socialWarfare.isMobile()&&$('#wpadminbar').length){
$('#wpadminbar').css('top', 0);
}}else{
newPadding +=50;
$('.nc_wrapper, .swp_floating_horizontal_wrapper').show();
if(socialWarfare.isMobile() &&
location=='top' &&
$('#wpadminbar').length
){
$('#wpadminbar').css('top', panel.parent().height());
}}
$('body').css(paddingProp, newPadding);
};
socialWarfare.positionFloatSidePanel=function (){
let panelHeight, windowHeight, offset;
const sidePanel=socialWarfare.panels.floatingSide;
if(! sidePanel||! sidePanel.length){
return;
}
if(sidePanel.hasClass('swp_side_top') ||
sidePanel.hasClass('swp_side_bottom')
){
return;
}
panelHeight=sidePanel.outerHeight();
windowHeight=window.innerHeight;
if(panelHeight > windowHeight){
return sidePanel.css('top', 0);
}
offset=(windowHeight - panelHeight) / 2;
sidePanel.css('top', offset);
};
socialWarfare.createHoverSaveButton=function (){
if($('.tve_editor_page').length){
$('.sw-pinit-button').remove();
$('.sw-pinit').each(function (){
const inner_content=$('.sw-pinit').contents();
$(this).replaceWith(inner_content);
});
return;
}
const button=$(document.createElement('a'));
button.css('display: none');
button.addClass('swp-hover-pin-button');
button.text('Save');
socialWarfare.hoverSaveButton=$(button);
return button;
};
socialWarfare.triggerImageListeners=function (){
$('.swp-content-locator')
.parent()
.find('img')
.off('mouseenter', socialWarfare.renderPinterestSaveButton);
$('.swp-content-locator')
.parent()
.find('img')
.on('mouseenter', socialWarfare.renderPinterestSaveButton);
setTimeout(socialWarfare.triggerImageListeners, 2e3);
};
socialWarfare.getPinMedia=function(image){
if(isString(swpPinIt.image_source)){
return swpPinIt.image_source;
}
if(isString(image.attr('src'))){
return image.attr('src');
}
const dataSources=[ 'src', 'lazy-src', 'media' ];
let media='';
dataSources.some(function(maybeSource){
if(isString(image.data(maybeSource))){
media=image.data(maybeSource);
return true;
}});
if(media==''){
return;
}
const i=$('<img>');
i.attr('src', media);
return i.prop('src');
};
socialWarfare.getPinDescription=function(image){
if(isString(image.data('pin-description'))){
return image.data('pin-description');
}
if(isString(swpPinIt.image_description)){
return swpPinIt.image_description;
}
if(isString(image.attr('title'))){
return image.attr('title');
}
if(isString(image.attr('alt'))){
return image.attr('alt');
}
if(isString(swpPinIt.post_title)){
return swpPinIt.post_title;
}};
socialWarfare.enablePinterestSaveButtons=function (){
jQuery('img').on('mouseenter', function (){
const pinterestBrowserButtons =
socialWarfare.findPinterestBrowserSaveButtons();
if(typeof pinterestBrowserButtons!=='undefined' &&
pinterestBrowserButtons
){
socialWarfare.removePinterestBrowserSaveButtons(pinterestBrowserButtons
);
}});
};
socialWarfare.toggleHoverSaveDisplay=function(image){
let top=image.offset().top;
let left=image.offset().left;
const vMargin=15;
const hMargin=15;
const button_size=swpPinIt.button_size||1;
const buttonHeight=24;
const buttonWidth=120;
switch(swpPinIt.vLocation){
case 'top':
top +=vMargin;
break;
case 'middle':
var offset =
image.height() / 2 - vMargin / 2 - buttonHeight / 2;
top +=offset;
break;
case 'bottom':
top +=image.height() - vMargin - buttonHeight;
break;
}
switch(swpPinIt.hLocation){
case 'left':
left +=hMargin;
break;
case 'center':
var offset=image.width() / 2 - hMargin / 2 - buttonWidth / 2;
left +=offset;
break;
case 'right':
left +=image.width() - hMargin - buttonWidth;
break;
}
socialWarfare.hoverSaveButton.css({
top,
left,
transform: 'scale(' + button_size + ')',
'transform-origin': swpPinIt.vLocation + ' ' + swpPinIt.hLocation,
});
image.on('mouseleave', function(event){
if(event.relatedTarget!=null &&
event.relatedTarget.className=='swp-hover-pin-button'
){
return;
}
$('.swp-hover-pin-button').remove();
});
$(document.body).append(socialWarfare.hoverSaveButton);
};
socialWarfare.renderPinterestSaveButton=function(event){
if(event.relatedTarget &&
event.relatedTarget.className=='swp-hover-pin-button'
){
return;
}
if($('.swp-hover-pin-button').length > 0){
return;
}
const image=$(event.target);
if(typeof swpPinIt.disableOnAnchors!==undefined &&
swpPinIt.disableOnAnchors
){
if(image.parents().filter('a').length){
return;
}}
if(image.outerHeight() < swpPinIt.minHeight ||
image.outerWidth() < swpPinIt.minWidth
){
return;
}
if(image.hasClass('no_pin')||image.hasClass('no-pin')){
return;
}
socialWarfare.toggleHoverSaveDisplay(image);
const description=socialWarfare.getPinDescription(image);
const media=socialWarfare.getPinMedia(image);
const shareLink =
'http://pinterest.com/pin/create/bookmarklet/?media=' +
encodeURI(media) +
'&url=' +
encodeURI(document.URL) +
'&is_video=false' +
'&description=' +
encodeURIComponent(description);
function openPinterestDialogue(event){
const offsetLeft=($(window).width() - 775) / 2;
const offsetTop=($(window).height() - 550) / 2;
const position=',top=' + offsetTop + ',left=' + offsetLeft;
window.open(shareLink,
'Pinterest',
'width=775,height=550,status=0,toolbar=0,menubar=0,location=1,scrollbars=1' +
position
);
socialWarfare.trackClick('pin_image');
$('.swp-hover-pin-button').remove();
}
$('.swp-hover-pin-button').on('click', openPinterestDialogue);
};
socialWarfare.findPinterestBrowserSaveButtons=function (){
let pinterestRed,
pinterestRed2019,
pinterestZIndex,
pinterestBackgroundSize,
button,
style;
pinterestRed='rgb(189, 8, 28)';
pinterestRed2019='rgb(230, 0, 35)';
pinterestZIndex='8675309';
pinterestBackgroundSize='14px 14px';
button=null;
document
.querySelectorAll('span')
.forEach(function(element, index){
style=window.getComputedStyle(element);
if(style.backgroundColor==pinterestRed ||
style.backgroundColor==pinterestRed2019
){
if(style.backgroundSize==pinterestBackgroundSize &&
style.zIndex==pinterestZIndex
){
button=element;
}}
});
return button;
};
socialWarfare.removePinterestBrowserSaveButtons=function(button){
let pinterestSquare, style, size;
pinterestSquare=button.nextSibling;
if(pinterestSquare!=undefined &&
pinterestSquare.nodeName=='SPAN'
){
style=window.getComputedStyle(pinterestSquare);
size='24px';
if(style.width.indexOf(size)===0 &&
style.height.indexOf(size)===0
){
pinterestSquare.remove();
}}
button.remove();
};
socialWarfare.fetchFacebookShares=function (){
const url1 =
'https://graph.facebook.com/v18.0/?fields=og_object{engagement}&id=' +
swp_post_url;
const url2=swp_post_recovery_url
? 'https://graph.facebook.com/v18.0/?fields=og_object{engagement}&id=' +
swp_post_recovery_url
: '';
console.log('Facebook Share API: ' + url1);
console.log('Facebook Share API (recovery): ' + url2);
$.when($.get(url1), $.get(url2)).then(function(response1, response2){
var shares, shares1, shares2, data;
shares1=socialWarfare.parseFacebookShares(response1[ 0 ]);
shares2=0;
if(swp_post_recovery_url){
shares2=socialWarfare.parseFacebookShares(response2[ 0 ]
);
}
shares=shares1;
if(shares1!==shares2){
shares=shares1 + shares2;
}
var data={
action: 'swp_facebook_shares_update',
post_id: swp_post_id,
share_counts: shares,
};
$.post(swp_admin_ajax, data, function(response){
console.log(response);
});
}
);
};
socialWarfare.parseFacebookShares=function(response){
if('undefined'===typeof response.og_object){
console.log('Facebook Shares: 0');
return 0;
}
console.log('Facebook Shares: ' + response.og_object.engagement.count
);
return parseInt(response.og_object.engagement.count);
};
socialWarfare.trigger=function(event){
$(window).trigger($.Event(event));
};
socialWarfare.trackClick=function(event){
if(true===swpClickTracking){
if('function'===typeof ga){
ga(
'send',
'event',
'social_media',
'swp_' + event + '_share'
);
}
if('object'===typeof dataLayer){
dataLayer.push({ event: 'swp_' + event + '_share' });
}}
};
socialWarfare.checkListeners=function(count, limit){
if(count > limit){
return;
}
const panel=$('.swp_social_panel');
if(panel.length > 0&&panel.find('.swp_pinterest')){
socialWarfare.handleButtonClicks();
return;
}
setTimeout(function (){
socialWarfare.checkListeners(++count, limit);
}, 2e3);
};
socialWarfare.establishBreakpoint=function (){
const panel=$('.swp_social_panel');
socialWarfare.breakpoint=1100;
if((panel.length&&panel.data('min-width')) ||
panel.data('min-width')==0
){
socialWarfare.breakpoint=parseInt(panel.data('min-width'));
}};
socialWarfare.isMobile=function (){
return $(window).width() < socialWarfare.breakpoint;
};
$(document).ready(function (){
socialWarfare.initPlugin();
socialWarfare.panels.floatingSide.hide();
$(window).on('resize', socialWarfare.onWindowResize);
if('undefined'!==typeof swpPinIt&&swpPinIt.enabled){
socialWarfare.enablePinterestSaveButtons();
}});
$(window).on('load', function (){
if('undefined'!==typeof swpPinIt&&swpPinIt.enabled){
socialWarfare.enablePinterestSaveButtons();
}
window.clearCheckID=0;
});
})(this, jQuery);
if(typeof jQuery==='undefined'){
throw new Error('Bootstrap\'s JavaScript requires jQuery')
}
+function ($){
'use strict';
var version=$.fn.jquery.split(' ')[0].split('.')
if((version[0] < 2&&version[1] < 9)||(version[0]==1&&version[1]==9&&version[2] < 1)){
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
}}(jQuery);
+function ($){
'use strict';
function transitionEnd(){
var el=document.createElement('bootstrap')
var transEndEventNames={
WebkitTransition:'webkitTransitionEnd',
MozTransition:'transitionend',
OTransition:'oTransitionEnd otransitionend',
transition:'transitionend'
}
for (var name in transEndEventNames){
if(el.style[name]!==undefined){
return { end: transEndEventNames[name] }}
}
return false
}
$.fn.emulateTransitionEnd=function (duration){
var called=false
var $el=this
$(this).one('bsTransitionEnd', function (){ called=true })
var callback=function (){ if(!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function (){
$.support.transition=transitionEnd()
if(!$.support.transition) return
$.event.special.bsTransitionEnd={
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e){
if($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}}
})
}(jQuery);
+function ($){
'use strict';
var dismiss='[data-dismiss="alert"]'
var Alert=function (el){
$(el).on('click', dismiss, this.close)
}
Alert.VERSION='3.3.5'
Alert.TRANSITION_DURATION=150
Alert.prototype.close=function (e){
var $this=$(this)
var selector=$this.attr('data-target')
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
var $parent=$(selector)
if(e) e.preventDefault()
if(!$parent.length){
$parent=$this.closest('.alert')
}
$parent.trigger(e=$.Event('close.bs.alert'))
if(e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement(){
$parent.detach().trigger('closed.bs.alert').remove()
}
$.support.transition&&$parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.alert')
if(!data) $this.data('bs.alert', (data=new Alert(this)))
if(typeof option=='string') data[option].call($this)
})
}
var old=$.fn.alert
$.fn.alert=Plugin
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function (){
$.fn.alert=old
return this
}
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
+function ($){
'use strict';
var Button=function (element, options){
this.$element=$(element)
this.options=$.extend({}, Button.DEFAULTS, options)
this.isLoading=false
}
Button.VERSION='3.3.5'
Button.DEFAULTS={
loadingText: 'loading...'
}
Button.prototype.setState=function (state){
var d='disabled'
var $el=this.$element
var val=$el.is('input') ? 'val':'html'
var data=$el.data()
state +='Text'
if(data.resetText==null) $el.data('resetText', $el[val]())
setTimeout($.proxy(function (){
$el[val](data[state]==null ? this.options[state]:data[state])
if(state=='loadingText'){
this.isLoading=true
$el.addClass(d).attr(d, d)
}else if(this.isLoading){
this.isLoading=false
$el.removeClass(d).removeAttr(d)
}}, this), 0)
}
Button.prototype.toggle=function (){
var changed=true
var $parent=this.$element.closest('[data-toggle="buttons"]')
if($parent.length){
var $input=this.$element.find('input')
if($input.prop('type')=='radio'){
if($input.prop('checked')) changed=false
$parent.find('.active').removeClass('active')
this.$element.addClass('active')
}else if($input.prop('type')=='checkbox'){
if(($input.prop('checked'))!==this.$element.hasClass('active')) changed=false
this.$element.toggleClass('active')
}
$input.prop('checked', this.$element.hasClass('active'))
if(changed) $input.trigger('change')
}else{
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
this.$element.toggleClass('active')
}}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.button')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.button', (data=new Button(this, options)))
if(option=='toggle') data.toggle()
else if(option) data.setState(option)
})
}
var old=$.fn.button
$.fn.button=Plugin
$.fn.button.Constructor=Button
$.fn.button.noConflict=function (){
$.fn.button=old
return this
}
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e){
var $btn=$(e.target)
if(!$btn.hasClass('btn')) $btn=$btn.closest('.btn')
Plugin.call($btn, 'toggle')
if(!($(e.target).is('input[type="radio"]')||$(e.target).is('input[type="checkbox"]'))) e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e){
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
}(jQuery);
+function ($){
'use strict';
var Carousel=function (element, options){
this.$element=$(element)
this.$indicators=this.$element.find('.carousel-indicators')
this.options=options
this.paused=null
this.sliding=null
this.interval=null
this.$active=null
this.$items=null
this.options.keyboard&&this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause=='hover'&&!('ontouchstart' in document.documentElement)&&this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
Carousel.VERSION='3.3.5'
Carousel.TRANSITION_DURATION=600
Carousel.DEFAULTS={
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
Carousel.prototype.keydown=function (e){
if(/input|textarea/i.test(e.target.tagName)) return
switch (e.which){
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
e.preventDefault()
}
Carousel.prototype.cycle=function (e){
e||(this.paused=false)
this.interval&&clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval=setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getItemIndex=function (item){
this.$items=item.parent().children('.item')
return this.$items.index(item||this.$active)
}
Carousel.prototype.getItemForDirection=function (direction, active){
var activeIndex=this.getItemIndex(active)
var willWrap=(direction=='prev'&&activeIndex===0)
|| (direction=='next'&&activeIndex==(this.$items.length - 1))
if(willWrap&&!this.options.wrap) return active
var delta=direction=='prev' ? -1:1
var itemIndex=(activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
Carousel.prototype.to=function (pos){
var that=this
var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
if(pos > (this.$items.length - 1)||pos < 0) return
if(this.sliding)       return this.$element.one('slid.bs.carousel', function (){ that.to(pos) })
if(activeIndex==pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next':'prev', this.$items.eq(pos))
}
Carousel.prototype.pause=function (e){
e||(this.paused=true)
if(this.$element.find('.next, .prev').length&&$.support.transition){
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval=clearInterval(this.interval)
return this
}
Carousel.prototype.next=function (){
if(this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev=function (){
if(this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide=function (type, next){
var $active=this.$element.find('.item.active')
var $next=next||this.getItemForDirection(type, $active)
var isCycling=this.interval
var direction=type=='next' ? 'left':'right'
var that=this
if($next.hasClass('active')) return (this.sliding=false)
var relatedTarget=$next[0]
var slideEvent=$.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent)
if(slideEvent.isDefaultPrevented()) return
this.sliding=true
isCycling&&this.pause()
if(this.$indicators.length){
this.$indicators.find('.active').removeClass('active')
var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator&&$nextIndicator.addClass('active')
}
var slidEvent=$.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction })
if($.support.transition&&this.$element.hasClass('slide')){
$next.addClass(type)
$next[0].offsetWidth
$active.addClass(direction)
$next.addClass(direction)
$active
.one('bsTransitionEnd', function (){
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding=false
setTimeout(function (){
that.$element.trigger(slidEvent)
}, 0)
})
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
}else{
$active.removeClass('active')
$next.addClass('active')
this.sliding=false
this.$element.trigger(slidEvent)
}
isCycling&&this.cycle()
return this
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.carousel')
var options=$.extend({}, Carousel.DEFAULTS, $this.data(), typeof option=='object'&&option)
var action=typeof option=='string' ? option:options.slide
if(!data) $this.data('bs.carousel', (data=new Carousel(this, options)))
if(typeof option=='number') data.to(option)
else if(action) data[action]()
else if(options.interval) data.pause().cycle()
})
}
var old=$.fn.carousel
$.fn.carousel=Plugin
$.fn.carousel.Constructor=Carousel
$.fn.carousel.noConflict=function (){
$.fn.carousel=old
return this
}
var clickHandler=function (e){
var href
var $this=$(this)
var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, ''))
if(!$target.hasClass('carousel')) return
var options=$.extend({}, $target.data(), $this.data())
var slideIndex=$this.attr('data-slide-to')
if(slideIndex) options.interval=false
Plugin.call($target, options)
if(slideIndex){
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
$(window).on('load', function (){
$('[data-ride="carousel"]').each(function (){
var $carousel=$(this)
Plugin.call($carousel, $carousel.data())
})
})
}(jQuery);
+function ($){
'use strict';
var Collapse=function (element, options){
this.$element=$(element)
this.options=$.extend({}, Collapse.DEFAULTS, options)
this.$trigger=$('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning=null
if(this.options.parent){
this.$parent=this.getParent()
}else{
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
if(this.options.toggle) this.toggle()
}
Collapse.VERSION='3.3.5'
Collapse.TRANSITION_DURATION=350
Collapse.DEFAULTS={
toggle: true
}
Collapse.prototype.dimension=function (){
var hasWidth=this.$element.hasClass('width')
return hasWidth ? 'width':'height'
}
Collapse.prototype.show=function (){
if(this.transitioning||this.$element.hasClass('in')) return
var activesData
var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
if(actives&&actives.length){
activesData=actives.data('bs.collapse')
if(activesData&&activesData.transitioning) return
}
var startEvent=$.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented()) return
if(actives&&actives.length){
Plugin.call(actives, 'hide')
activesData||actives.data('bs.collapse', null)
}
var dimension=this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
this.transitioning=1
var complete=function (){
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning=0
this.$element
.trigger('shown.bs.collapse')
}
if(!$.support.transition) return complete.call(this)
var scrollSize=$.camelCase(['scroll', dimension].join('-'))
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide=function (){
if(this.transitioning||!this.$element.hasClass('in')) return
var startEvent=$.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented()) return
var dimension=this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this.transitioning=1
var complete=function (){
this.transitioning=0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
if(!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
Collapse.prototype.toggle=function (){
this[this.$element.hasClass('in') ? 'hide':'show']()
}
Collapse.prototype.getParent=function (){
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element){
var $element=$(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
Collapse.prototype.addAriaAndCollapsedClass=function ($element, $trigger){
var isOpen=$element.hasClass('in')
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
function getTargetFromTrigger($trigger){
var href
var target=$trigger.attr('data-target')
|| (href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/, '')
return $(target)
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.collapse')
var options=$.extend({}, Collapse.DEFAULTS, $this.data(), typeof option=='object'&&option)
if(!data&&options.toggle&&/show|hide/.test(option)) options.toggle=false
if(!data) $this.data('bs.collapse', (data=new Collapse(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.collapse
$.fn.collapse=Plugin
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function (){
$.fn.collapse=old
return this
}
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e){
var $this=$(this)
if(!$this.attr('data-target')) e.preventDefault()
var $target=getTargetFromTrigger($this)
var data=$target.data('bs.collapse')
var option=data ? 'toggle':$this.data()
Plugin.call($target, option)
})
}(jQuery);
+function ($){
'use strict';
var backdrop='.dropdown-backdrop'
var toggle='[data-toggle="dropdown"]'
var Dropdown=function (element){
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.VERSION='3.3.5'
function getParent($this){
var selector=$this.attr('data-target')
if(!selector){
selector=$this.attr('href')
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
var $parent=selector&&$(selector)
return $parent&&$parent.length ? $parent:$this.parent()
}
function clearMenus(e){
if(e&&e.which===3) return
$(backdrop).remove()
$(toggle).each(function (){
var $this=$(this)
var $parent=getParent($this)
var relatedTarget={ relatedTarget: this }
if(!$parent.hasClass('open')) return
if(e&&e.type=='click'&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0], e.target)) return
$parent.trigger(e=$.Event('hide.bs.dropdown', relatedTarget))
if(e.isDefaultPrevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
Dropdown.prototype.toggle=function (e){
var $this=$(this)
if($this.is('.disabled, :disabled')) return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){
if('ontouchstart' in document.documentElement&&!$parent.closest('.navbar-nav').length){
$(document.createElement('div'))
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)
}
var relatedTarget={ relatedTarget: this }
$parent.trigger(e=$.Event('show.bs.dropdown', relatedTarget))
if(e.isDefaultPrevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
return false
}
Dropdown.prototype.keydown=function (e){
if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName)) return
var $this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled')) return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
if(!isActive&&e.which!=27||isActive&&e.which==27){
if(e.which==27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc=' li:not(.disabled):visible a'
var $items=$parent.find('.dropdown-menu' + desc)
if(!$items.length) return
var index=$items.index(e.target)
if(e.which==38&&index > 0)                 index--
if(e.which==40&&index < $items.length - 1) index++
if(!~index)                                    index=0
$items.eq(index).trigger('focus')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.dropdown')
if(!data) $this.data('bs.dropdown', (data=new Dropdown(this)))
if(typeof option=='string') data[option].call($this)
})
}
var old=$.fn.dropdown
$.fn.dropdown=Plugin
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function (){
$.fn.dropdown=old
return this
}
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e){ e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
}(jQuery);
+function ($){
'use strict';
var Modal=function (element, options){
this.options=options
this.$body=$(document.body)
this.$element=$(element)
this.$dialog=this.$element.find('.modal-dialog')
this.$backdrop=null
this.isShown=null
this.originalBodyPad=null
this.scrollbarWidth=0
this.ignoreBackdropClick=false
if(this.options.remote){
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function (){
this.$element.trigger('loaded.bs.modal')
}, this))
}}
Modal.VERSION='3.3.5'
Modal.TRANSITION_DURATION=300
Modal.BACKDROP_TRANSITION_DURATION=150
Modal.DEFAULTS={
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle=function (_relatedTarget){
return this.isShown ? this.hide():this.show(_relatedTarget)
}
Modal.prototype.show=function (_relatedTarget){
var that=this
var e=$.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented()) return
this.isShown=true
this.checkScrollbar()
this.setScrollbar()
this.$body.addClass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$dialog.on('mousedown.dismiss.bs.modal', function (){
that.$element.one('mouseup.dismiss.bs.modal', function (e){
if($(e.target).is(that.$element)) that.ignoreBackdropClick=true
})
})
this.backdrop(function (){
var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){
that.$element.appendTo(that.$body)
}
that.$element
.show()
.scrollTop(0)
that.adjustDialog()
if(transition){
that.$element[0].offsetWidth
}
that.$element.addClass('in')
that.enforceFocus()
var e=$.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$dialog
.one('bsTransitionEnd', function (){
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
})
}
Modal.prototype.hide=function (e){
if(e) e.preventDefault()
e=$.Event('hide.bs.modal')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented()) return
this.isShown=false
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition&&this.$element.hasClass('fade') ?
this.$element
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus=function (){
$(document)
.off('focusin.bs.modal')
.on('focusin.bs.modal', $.proxy(function (e){
if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){
this.$element.trigger('focus')
}}, this))
}
Modal.prototype.escape=function (){
if(this.isShown&&this.options.keyboard){
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e){
e.which==27&&this.hide()
}, this))
}else if(!this.isShown){
this.$element.off('keydown.dismiss.bs.modal')
}}
Modal.prototype.resize=function (){
if(this.isShown){
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
}else{
$(window).off('resize.bs.modal')
}}
Modal.prototype.hideModal=function (){
var that=this
this.$element.hide()
this.backdrop(function (){
that.$body.removeClass('modal-open')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop=function (){
this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null
}
Modal.prototype.backdrop=function (callback){
var that=this
var animate=this.$element.hasClass('fade') ? 'fade':''
if(this.isShown&&this.options.backdrop){
var doAnimate=$.support.transition&&animate
this.$backdrop=$(document.createElement('div'))
.addClass('modal-backdrop ' + animate)
.appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e){
if(this.ignoreBackdropClick){
this.ignoreBackdropClick=false
return
}
if(e.target!==e.currentTarget) return
this.options.backdrop=='static'
? this.$element[0].focus()
: this.hide()
}, this))
if(doAnimate) this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback) return
doAnimate ?
this.$backdrop
.one('bsTransitionEnd', callback)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
}else if(!this.isShown&&this.$backdrop){
this.$backdrop.removeClass('in')
var callbackRemove=function (){
that.removeBackdrop()
callback&&callback()
}
$.support.transition&&this.$element.hasClass('fade') ?
this.$backdrop
.one('bsTransitionEnd', callbackRemove)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()
}else if(callback){
callback()
}}
Modal.prototype.handleUpdate=function (){
this.adjustDialog()
}
Modal.prototype.adjustDialog=function (){
var modalIsOverflowing=this.$element[0].scrollHeight > document.documentElement.clientHeight
this.$element.css({
paddingLeft:  !this.bodyIsOverflowing&&modalIsOverflowing ? this.scrollbarWidth:'',
paddingRight: this.bodyIsOverflowing&&!modalIsOverflowing ? this.scrollbarWidth:''
})
}
Modal.prototype.resetAdjustments=function (){
this.$element.css({
paddingLeft: '',
paddingRight: ''
})
}
Modal.prototype.checkScrollbar=function (){
var fullWindowWidth=window.innerWidth
if(!fullWindowWidth){
var documentElementRect=document.documentElement.getBoundingClientRect()
fullWindowWidth=documentElementRect.right - Math.abs(documentElementRect.left)
}
this.bodyIsOverflowing=document.body.clientWidth < fullWindowWidth
this.scrollbarWidth=this.measureScrollbar()
}
Modal.prototype.setScrollbar=function (){
var bodyPad=parseInt((this.$body.css('padding-right')||0), 10)
this.originalBodyPad=document.body.style.paddingRight||''
if(this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar=function (){
this.$body.css('padding-right', this.originalBodyPad)
}
Modal.prototype.measureScrollbar=function (){
var scrollDiv=document.createElement('div')
scrollDiv.className='modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth=scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}
function Plugin(option, _relatedTarget){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.modal')
var options=$.extend({}, Modal.DEFAULTS, $this.data(), typeof option=='object'&&option)
if(!data) $this.data('bs.modal', (data=new Modal(this, options)))
if(typeof option=='string') data[option](_relatedTarget)
else if(options.show) data.show(_relatedTarget)
})
}
var old=$.fn.modal
$.fn.modal=Plugin
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function (){
$.fn.modal=old
return this
}
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e){
var $this=$(this)
var href=$this.attr('href')
var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/, '')))
var option=$target.data('bs.modal') ? 'toggle':$.extend({ remote: !/#/.test(href)&&href }, $target.data(), $this.data())
if($this.is('a')) e.preventDefault()
$target.one('show.bs.modal', function (showEvent){
if(showEvent.isDefaultPrevented()) return
$target.one('hidden.bs.modal', function (){
$this.is(':visible')&&$this.trigger('focus')
})
})
Plugin.call($target, option, this)
})
}(jQuery);
+function ($){
'use strict';
var Tooltip=function (element, options){
this.type=null
this.options=null
this.enabled=null
this.timeout=null
this.hoverState=null
this.$element=null
this.inState=null
this.init('tooltip', element, options)
}
Tooltip.VERSION='3.3.5'
Tooltip.TRANSITION_DURATION=150
Tooltip.DEFAULTS={
animation: true,
placement: 'top',
selector: false,
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false,
viewport: {
selector: 'body',
padding: 0
}}
Tooltip.prototype.init=function (type, element, options){
this.enabled=true
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.$viewport=this.options.viewport&&$($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element):(this.options.viewport.selector||this.options.viewport))
this.inState={ click: false, hover: false, focus: false }
if(this.$element[0] instanceof document.constructor&&!this.options.selector){
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
}
var triggers=this.options.trigger.split(' ')
for (var i=triggers.length; i--;){
var trigger=triggers[i]
if(trigger=='click'){
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
}else if(trigger!='manual'){
var eventIn=trigger=='hover' ? 'mouseenter':'focusin'
var eventOut=trigger=='hover' ? 'mouseleave':'focusout'
this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}}
this.options.selector ?
(this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults=function (){
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions=function (options){
options=$.extend({}, this.getDefaults(), this.$element.data(), options)
if(options.delay&&typeof options.delay=='number'){
options.delay={
show: options.delay,
hide: options.delay
}}
return options
}
Tooltip.prototype.getDelegateOptions=function (){
var options={}
var defaults=this.getDefaults()
this._options&&$.each(this._options, function (key, value){
if(defaults[key]!=value) options[key]=value
})
return options
}
Tooltip.prototype.enter=function (obj){
var self=obj instanceof this.constructor ?
obj:$(obj.currentTarget).data('bs.' + this.type)
if(!self){
self=new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
if(obj instanceof $.Event){
self.inState[obj.type=='focusin' ? 'focus':'hover']=true
}
if(self.tip().hasClass('in')||self.hoverState=='in'){
self.hoverState='in'
return
}
clearTimeout(self.timeout)
self.hoverState='in'
if(!self.options.delay||!self.options.delay.show) return self.show()
self.timeout=setTimeout(function (){
if(self.hoverState=='in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.isInStateTrue=function (){
for (var key in this.inState){
if(this.inState[key]) return true
}
return false
}
Tooltip.prototype.leave=function (obj){
var self=obj instanceof this.constructor ?
obj:$(obj.currentTarget).data('bs.' + this.type)
if(!self){
self=new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
if(obj instanceof $.Event){
self.inState[obj.type=='focusout' ? 'focus':'hover']=false
}
if(self.isInStateTrue()) return
clearTimeout(self.timeout)
self.hoverState='out'
if(!self.options.delay||!self.options.delay.hide) return self.hide()
self.timeout=setTimeout(function (){
if(self.hoverState=='out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show=function (){
var e=$.Event('show.bs.' + this.type)
if(this.hasContent()&&this.enabled){
this.$element.trigger(e)
var inDom=$.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
if(e.isDefaultPrevented()||!inDom) return
var that=this
var $tip=this.tip()
var tipId=this.getUID(this.type)
this.setContent()
$tip.attr('id', tipId)
this.$element.attr('aria-describedby', tipId)
if(this.options.animation) $tip.addClass('fade')
var placement=typeof this.options.placement=='function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken=/\s?auto?\s?/i
var autoPlace=autoToken.test(placement)
if(autoPlace) placement=placement.replace(autoToken, '')||'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
.data('bs.' + this.type, this)
this.options.container ? $tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
this.$element.trigger('inserted.bs.' + this.type)
var pos=this.getPosition()
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(autoPlace){
var orgPlacement=placement
var viewportDim=this.getPosition(this.$viewport)
placement=placement=='bottom'&&pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
placement=='top'&&pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
placement=='right'&&pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
placement=='left'&&pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset=this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
var complete=function (){
var prevHoverState=that.hoverState
that.$element.trigger('shown.bs.' + that.type)
that.hoverState=null
if(prevHoverState=='out') that.leave(that)
}
$.support.transition&&this.$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
}}
Tooltip.prototype.applyPlacement=function (offset, placement){
var $tip=this.tip()
var width=$tip[0].offsetWidth
var height=$tip[0].offsetHeight
var marginTop=parseInt($tip.css('margin-top'), 10)
var marginLeft=parseInt($tip.css('margin-left'), 10)
if(isNaN(marginTop))  marginTop=0
if(isNaN(marginLeft)) marginLeft=0
offset.top  +=marginTop
offset.left +=marginLeft
$.offset.setOffset($tip[0], $.extend({
using: function (props){
$tip.css({
top: Math.round(props.top),
left: Math.round(props.left)
})
}}, offset), 0)
$tip.addClass('in')
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){
offset.top=offset.top + height - actualHeight
}
var delta=this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
if(delta.left) offset.left +=delta.left
else offset.top +=delta.top
var isVertical=/top|bottom/.test(placement)
var arrowDelta=isVertical ? delta.left * 2 - width + actualWidth:delta.top * 2 - height + actualHeight
var arrowOffsetPosition=isVertical ? 'offsetWidth':'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
}
Tooltip.prototype.replaceArrow=function (delta, dimension, isVertical){
this.arrow()
.css(isVertical ? 'left':'top', 50 * (1 - delta / dimension) + '%')
.css(isVertical ? 'top':'left', '')
}
Tooltip.prototype.setContent=function (){
var $tip=this.tip()
var title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html':'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide=function (callback){
var that=this
var $tip=$(this.$tip)
var e=$.Event('hide.bs.' + this.type)
function complete(){
if(that.hoverState!='in') $tip.detach()
that.$element
.removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback&&callback()
}
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition&&$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
this.hoverState=null
return this
}
Tooltip.prototype.fixTitle=function (){
var $e=this.$element
if($e.attr('title')||typeof $e.attr('data-original-title')!='string'){
$e.attr('data-original-title', $e.attr('title')||'').attr('title', '')
}}
Tooltip.prototype.hasContent=function (){
return this.getTitle()
}
Tooltip.prototype.getPosition=function ($element){
$element=$element||this.$element
var el=$element[0]
var isBody=el.tagName=='BODY'
var elRect=el.getBoundingClientRect()
if(elRect.width==null){
elRect=$.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
}
var elOffset=isBody ? { top: 0, left: 0 }:$element.offset()
var scroll={ scroll: isBody ? document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop() }
var outerDims=isBody ? { width: $(window).width(), height: $(window).height() }:null
return $.extend({}, elRect, scroll, outerDims, elOffset)
}
Tooltip.prototype.getCalculatedOffset=function (placement, pos, actualWidth, actualHeight){
return placement=='bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement=='top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement=='left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
{ top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }}
Tooltip.prototype.getViewportAdjustedDelta=function (placement, pos, actualWidth, actualHeight){
var delta={ top: 0, left: 0 }
if(!this.$viewport) return delta
var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
var viewportDimensions=this.getPosition(this.$viewport)
if(/right|left/.test(placement)){
var topEdgeOffset=pos.top - viewportPadding - viewportDimensions.scroll
var bottomEdgeOffset=pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
if(topEdgeOffset < viewportDimensions.top){
delta.top=viewportDimensions.top - topEdgeOffset
}else if(bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height){
delta.top=viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
}}else{
var leftEdgeOffset=pos.left - viewportPadding
var rightEdgeOffset=pos.left + viewportPadding + actualWidth
if(leftEdgeOffset < viewportDimensions.left){
delta.left=viewportDimensions.left - leftEdgeOffset
}else if(rightEdgeOffset > viewportDimensions.right){
delta.left=viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
}}
return delta
}
Tooltip.prototype.getTitle=function (){
var title
var $e=this.$element
var o=this.options
title=$e.attr('data-original-title')
|| (typeof o.title=='function' ? o.title.call($e[0]):o.title)
return title
}
Tooltip.prototype.getUID=function (prefix){
do prefix +=~~(Math.random() * 1000000)
while (document.getElementById(prefix))
return prefix
}
Tooltip.prototype.tip=function (){
if(!this.$tip){
this.$tip=$(this.options.template)
if(this.$tip.length!=1){
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
}}
return this.$tip
}
Tooltip.prototype.arrow=function (){
return (this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))
}
Tooltip.prototype.enable=function (){
this.enabled=true
}
Tooltip.prototype.disable=function (){
this.enabled=false
}
Tooltip.prototype.toggleEnabled=function (){
this.enabled = !this.enabled
}
Tooltip.prototype.toggle=function (e){
var self=this
if(e){
self=$(e.currentTarget).data('bs.' + this.type)
if(!self){
self=new this.constructor(e.currentTarget, this.getDelegateOptions())
$(e.currentTarget).data('bs.' + this.type, self)
}}
if(e){
self.inState.click = !self.inState.click
if(self.isInStateTrue()) self.enter(self)
else self.leave(self)
}else{
self.tip().hasClass('in') ? self.leave(self):self.enter(self)
}}
Tooltip.prototype.destroy=function (){
var that=this
clearTimeout(this.timeout)
this.hide(function (){
that.$element.off('.' + that.type).removeData('bs.' + that.type)
if(that.$tip){
that.$tip.detach()
}
that.$tip=null
that.$arrow=null
that.$viewport=null
})
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.tooltip')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option)) return
if(!data) $this.data('bs.tooltip', (data=new Tooltip(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.tooltip
$.fn.tooltip=Plugin
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.noConflict=function (){
$.fn.tooltip=old
return this
}}(jQuery);
+function ($){
'use strict';
var Popover=function (element, options){
this.init('popover', element, options)
}
if(!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.VERSION='3.3.5'
Popover.DEFAULTS=$.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right',
trigger: 'click',
content: '',
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})
Popover.prototype=$.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor=Popover
Popover.prototype.getDefaults=function (){
return Popover.DEFAULTS
}
Popover.prototype.setContent=function (){
var $tip=this.tip()
var title=this.getTitle()
var content=this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html':'text'](title)
$tip.find('.popover-content').children().detach().end()[
this.options.html ? (typeof content=='string' ? 'html':'append'):'text'
](content)
$tip.removeClass('fade top bottom left right in')
if(!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent=function (){
return this.getTitle()||this.getContent()
}
Popover.prototype.getContent=function (){
var $e=this.$element
var o=this.options
return $e.attr('data-content')
|| (typeof o.content=='function' ?
o.content.call($e[0]) :
o.content)
}
Popover.prototype.arrow=function (){
return (this.$arrow=this.$arrow||this.tip().find('.arrow'))
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.popover')
var options=typeof option=='object'&&option
if(!data&&/destroy|hide/.test(option)) return
if(!data) $this.data('bs.popover', (data=new Popover(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.popover
$.fn.popover=Plugin
$.fn.popover.Constructor=Popover
$.fn.popover.noConflict=function (){
$.fn.popover=old
return this
}}(jQuery);
+function ($){
'use strict';
function ScrollSpy(element, options){
this.$body=$(document.body)
this.$scrollElement=$(element).is(document.body) ? $(window):$(element)
this.options=$.extend({}, ScrollSpy.DEFAULTS, options)
this.selector=(this.options.target||'') + ' .nav li > a'
this.offsets=[]
this.targets=[]
this.activeTarget=null
this.scrollHeight=0
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
}
ScrollSpy.VERSION='3.3.5'
ScrollSpy.DEFAULTS={
offset: 10
}
ScrollSpy.prototype.getScrollHeight=function (){
return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}
ScrollSpy.prototype.refresh=function (){
var that=this
var offsetMethod='offset'
var offsetBase=0
this.offsets=[]
this.targets=[]
this.scrollHeight=this.getScrollHeight()
if(!$.isWindow(this.$scrollElement[0])){
offsetMethod='position'
offsetBase=this.$scrollElement.scrollTop()
}
this.$body
.find(this.selector)
.map(function (){
var $el=$(this)
var href=$el.data('target')||$el.attr('href')
var $href=/^#./.test(href)&&$(href)
return ($href
&& $href.length
&& $href.is(':visible')
&& [[$href[offsetMethod]().top + offsetBase, href]])||null
})
.sort(function (a, b){ return a[0] - b[0] })
.each(function (){
that.offsets.push(this[0])
that.targets.push(this[1])
})
}
ScrollSpy.prototype.process=function (){
var scrollTop=this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight=this.getScrollHeight()
var maxScroll=this.options.offset + scrollHeight - this.$scrollElement.height()
var offsets=this.offsets
var targets=this.targets
var activeTarget=this.activeTarget
var i
if(this.scrollHeight!=scrollHeight){
this.refresh()
}
if(scrollTop >=maxScroll){
return activeTarget!=(i=targets[targets.length - 1])&&this.activate(i)
}
if(activeTarget&&scrollTop < offsets[0]){
this.activeTarget=null
return this.clear()
}
for (i=offsets.length; i--;){
activeTarget!=targets[i]
&& scrollTop >=offsets[i]
&& (offsets[i + 1]===undefined||scrollTop < offsets[i + 1])
&& this.activate(targets[i])
}}
ScrollSpy.prototype.activate=function (target){
this.activeTarget=target
this.clear()
var selector=this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var active=$(selector)
.parents('li')
.addClass('active')
if(active.parent('.dropdown-menu').length){
active=active
.closest('li.dropdown')
.addClass('active')
}
active.trigger('activate.bs.scrollspy')
}
ScrollSpy.prototype.clear=function (){
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.scrollspy')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.scrollspy', (data=new ScrollSpy(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.scrollspy
$.fn.scrollspy=Plugin
$.fn.scrollspy.Constructor=ScrollSpy
$.fn.scrollspy.noConflict=function (){
$.fn.scrollspy=old
return this
}
$(window).on('load.bs.scrollspy.data-api', function (){
$('[data-spy="scroll"]').each(function (){
var $spy=$(this)
Plugin.call($spy, $spy.data())
})
})
}(jQuery);
+function ($){
'use strict';
var Tab=function (element){
this.element=$(element)
}
Tab.VERSION='3.3.5'
Tab.TRANSITION_DURATION=150
Tab.prototype.show=function (){
var $this=this.element
var $ul=$this.closest('ul:not(.dropdown-menu)')
var selector=$this.data('target')
if(!selector){
selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/, '')
}
if($this.parent('li').hasClass('active')) return
var $previous=$ul.find('.active:last a')
var hideEvent=$.Event('hide.bs.tab', {
relatedTarget: $this[0]
})
var showEvent=$.Event('show.bs.tab', {
relatedTarget: $previous[0]
})
$previous.trigger(hideEvent)
$this.trigger(showEvent)
if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented()) return
var $target=$(selector)
this.activate($this.closest('li'), $ul)
this.activate($target, $target.parent(), function (){
$previous.trigger({
type: 'hidden.bs.tab',
relatedTarget: $this[0]
})
$this.trigger({
type: 'shown.bs.tab',
relatedTarget: $previous[0]
})
})
}
Tab.prototype.activate=function (element, container, callback){
var $active=container.find('> .active')
var transition=callback
&& $.support.transition
&& ($active.length&&$active.hasClass('fade')||!!container.find('> .fade').length)
function next(){
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', false)
element
.addClass('active')
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
if(transition){
element[0].offsetWidth
element.addClass('in')
}else{
element.removeClass('fade')
}
if(element.parent('.dropdown-menu').length){
element
.closest('li.dropdown')
.addClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
}
callback&&callback()
}
$active.length&&transition ?
$active
.one('bsTransitionEnd', next)
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
next()
$active.removeClass('in')
}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.tab')
if(!data) $this.data('bs.tab', (data=new Tab(this)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.tab
$.fn.tab=Plugin
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function (){
$.fn.tab=old
return this
}
var clickHandler=function (e){
e.preventDefault()
Plugin.call($(this), 'show')
}
$(document)
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
}(jQuery);
+function ($){
'use strict';
var Affix=function (element, options){
this.options=$.extend({}, Affix.DEFAULTS, options)
this.$target=$(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
this.$element=$(element)
this.affixed=null
this.unpin=null
this.pinnedOffset=null
this.checkPosition()
}
Affix.VERSION='3.3.5'
Affix.RESET='affix affix-top affix-bottom'
Affix.DEFAULTS={
offset: 0,
target: window
}
Affix.prototype.getState=function (scrollHeight, height, offsetTop, offsetBottom){
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
var targetHeight=this.$target.height()
if(offsetTop!=null&&this.affixed=='top') return scrollTop < offsetTop ? 'top':false
if(this.affixed=='bottom'){
if(offsetTop!=null) return (scrollTop + this.unpin <=position.top) ? false:'bottom'
return (scrollTop + targetHeight <=scrollHeight - offsetBottom) ? false:'bottom'
}
var initializing=this.affixed==null
var colliderTop=initializing ? scrollTop:position.top
var colliderHeight=initializing ? targetHeight:height
if(offsetTop!=null&&scrollTop <=offsetTop) return 'top'
if(offsetBottom!=null&&(colliderTop + colliderHeight >=scrollHeight - offsetBottom)) return 'bottom'
return false
}
Affix.prototype.getPinnedOffset=function (){
if(this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
return (this.pinnedOffset=position.top - scrollTop)
}
Affix.prototype.checkPositionWithEventLoop=function (){
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition=function (){
if(!this.$element.is(':visible')) return
var height=this.$element.height()
var offset=this.options.offset
var offsetTop=offset.top
var offsetBottom=offset.bottom
var scrollHeight=Math.max($(document).height(), $(document.body).height())
if(typeof offset!='object')         offsetBottom=offsetTop=offset
if(typeof offsetTop=='function')    offsetTop=offset.top(this.$element)
if(typeof offsetBottom=='function') offsetBottom=offset.bottom(this.$element)
var affix=this.getState(scrollHeight, height, offsetTop, offsetBottom)
if(this.affixed!=affix){
if(this.unpin!=null) this.$element.css('top', '')
var affixType='affix' + (affix ? '-' + affix:'')
var e=$.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if(e.isDefaultPrevented()) return
this.affixed=affix
this.unpin=affix=='bottom' ? this.getPinnedOffset():null
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}
if(affix=='bottom'){
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
}}
function Plugin(option){
return this.each(function (){
var $this=$(this)
var data=$this.data('bs.affix')
var options=typeof option=='object'&&option
if(!data) $this.data('bs.affix', (data=new Affix(this, options)))
if(typeof option=='string') data[option]()
})
}
var old=$.fn.affix
$.fn.affix=Plugin
$.fn.affix.Constructor=Affix
$.fn.affix.noConflict=function (){
$.fn.affix=old
return this
}
$(window).on('load', function (){
$('[data-spy="affix"]').each(function (){
var $spy=$(this)
var data=$spy.data()
data.offset=data.offset||{}
if(data.offsetBottom!=null) data.offset.bottom=data.offsetBottom
if(data.offsetTop!=null) data.offset.top=data.offsetTop
Plugin.call($spy, data)
})
})
}(jQuery);
(function(){
var container, button, menu, links, subMenus, i, len;
container=document.getElementById('site-navigation');
if(! container){
return;
}
button=container.getElementsByTagName('button')[0];
if('undefined'===typeof button){
return;
}
menu=container.getElementsByTagName('ul')[0];
if('undefined'===typeof menu){
button.style.display='none';
return;
}
menu.setAttribute('aria-expanded', 'false');
if(-1===menu.className.indexOf('nav-menu')){
menu.className +=' nav-menu';
}
button.onclick=function(){
if(-1!==container.className.indexOf('toggled')){
container.className=container.className.replace(' toggled', '');
button.setAttribute('aria-expanded', 'false');
menu.setAttribute('aria-expanded', 'false');
}else{
container.className +=' toggled';
button.setAttribute('aria-expanded', 'true');
menu.setAttribute('aria-expanded', 'true');
}};
links=menu.getElementsByTagName('a');
subMenus=menu.getElementsByTagName('ul');
for(i=0, len=subMenus.length; i < len; i++){
subMenus[i].parentNode.setAttribute('aria-haspopup', 'true');
}
for(i=0, len=links.length; i < len; i++){
links[i].addEventListener('focus', toggleFocus, true);
links[i].addEventListener('blur', toggleFocus, true);
}
function toggleFocus(){
var self=this;
while(-1===self.className.indexOf('nav-menu')){
if('li'===self.tagName.toLowerCase()){
if(-1!==self.className.indexOf('focus')){
self.className=self.className.replace(' focus', '');
}else{
self.className +=' focus';
}}
self=self.parentElement;
}}
(function(container){
var touchStartFn, i,
parentLink=container.querySelectorAll('.menu-item-has-children > a, .page_item_has_children > a');
if('ontouchstart' in window){
touchStartFn=function(e){
var menuItem=this.parentNode, i;
if(! menuItem.classList.contains('focus')){
e.preventDefault();
for(i=0; i < menuItem.parentNode.children.length; ++i){
if(menuItem===menuItem.parentNode.children[i]){
continue;
}
menuItem.parentNode.children[i].classList.remove('focus');
}
menuItem.classList.add('focus');
}else{
menuItem.classList.remove('focus');
}};
for(i=0; i < parentLink.length; ++i){
parentLink[i].addEventListener('touchstart', touchStartFn, false);
}}
}(container));
})();
(function(){
var is_webkit=navigator.userAgent.toLowerCase().indexOf('webkit') > -1,
is_opera=navigator.userAgent.toLowerCase().indexOf('opera')  > -1,
is_ie=navigator.userAgent.toLowerCase().indexOf('msie')   > -1;
if(( is_webkit||is_opera||is_ie)&&document.getElementById&&window.addEventListener){
window.addEventListener('hashchange', function(){
var id=location.hash.substring(1),
element;
if(!(/^[A-z0-9_-]+$/.test(id))){
return;
}
element=document.getElementById(id);
if(element){
if(!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))){
element.tabIndex=-1;
}
element.focus();
}}, false);
}})();
(function($){
function initMainNavigation(container){
var dropdownToggle=$('<button />', {
'class': 'dropdown-toggle',
'aria-expanded': false
}).append($('<span />', {
'class': 'screen-reader-text',
text: screenReaderText.expand
}));
container.find('.menu-item-has-children > a').after(dropdownToggle);
container.find('.current-menu-ancestor > button').addClass('toggled-on');
container.find('.current-menu-ancestor > .sub-menu').addClass('toggled-on');
container.find('.menu-item-has-children').attr('aria-haspopup', 'true');
container.find('.dropdown-toggle').click(function(e){
var _this=$(this),
screenReaderSpan=_this.find('.screen-reader-text');
e.preventDefault();
_this.toggleClass('toggled-on');
_this.next('.children, .sub-menu').toggleClass('toggled-on');
_this.attr('aria-expanded', _this.attr('aria-expanded')==='false' ? 'true':'false');
screenReaderSpan.text(screenReaderSpan.text()===screenReaderText.expand ? screenReaderText.collapse:screenReaderText.expand);
});
}
initMainNavigation($('.main-navigation'));
var setHeight=function (h){
height=h;
$("#cc_spacer").css("height", height + "px");
}
$(window).resize(function(){
setHeight($("#navigation_menu").height());
});
$(window).ready(function(){
setHeight($("#navigation_menu").height());
});
})(jQuery);
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
jQuery(document).ready(function ($){
$('.zoom-social_icons-list__link').on({
'mouseenter': function (e){
e.preventDefault();
var $this=$(this).find('.zoom-social_icons-list-span');
var $rule=$this.data('hover-rule');
var $color=$this.data('hover-color');
if($color!==undefined){
$this.attr('data-old-color', $this.css($rule));
$this.css($rule, $color);
}},
'mouseleave': function (e){
e.preventDefault();
var $this=$(this).find('.zoom-social_icons-list-span');
var $rule=$this.data('hover-rule');
var $oldColor=$this.data('old-color');
if($oldColor!==undefined){
$this.css($rule, $oldColor);
}}
});
});