1
window.socialWarfare=window.socialWarfare||{}
2
;(function(window,$){"use strict";if(typeof $!="function"){if(typeof jQuery=="function"){var $=jQuery}
3
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}
4
}
5
function isString(maybeString){return typeof maybeString=="string"&&maybeString.length>0}
6
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}
7
);socialWarfare.establishPanels();socialWarfare.establishBreakpoint();if(!socialWarfare.panels.staticHorizontal&&!socialWarfare.panels.floatingSide&&!socialWarfare.panels.floatingHorizontal){return}
8
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()}
9
setTimeout(function(){socialWarfare.checkListeners(0,5)}
10
,2e3);var time=Date.now();var scrollDelay=50;$(window).on("scroll",function(){if(time+scrollDelay-Date.now()<0){socialWarfare.updateFloatingButtons();time=Date.now()}
11
}
12
)}
13
;var resizeWait;socialWarfare.onWindowResize=function(){clearTimeout(resizeWait);resizeWait=setTimeout(socialWarfare.initPlugin,100)}
14
;socialWarfare.establishPanels=function(){socialWarfare.panels={staticHorizontal:null,floatingSide:null,floatingHorizontal:null}
15
;socialWarfare.panels.staticHorizontal=$(".swp_social_panel").not(".swp_social_panelSide");socialWarfare.panels.floatingSide=$(".swp_social_panelSide");return socialWarfare.panels}
16
;socialWarfare.emphasizeButtons=function(){if(typeof socialWarfare.variables.emphasizeIcons=="undefined"){return}
17
if(socialWarfare.isMobile()){return}
18
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){var shareWidth=jQuery(button).find(".swp_share").width();var iconWidth=jQuery(button).find("i.sw").outerWidth();var iconTextWidth=shareWidth+iconWidth+35;var containerWidth=jQuery(button).width();var change=1+(shareWidth+35)/containerWidth;if(change<2){jQuery(button).addClass("swp_nohover").css({flex:"2 1 0%"}
19
).find(".iconFiller").width(iconTextWidth)}
20
else{jQuery(button).addClass("swp_nohover").css({flex:change+" 1 0%"}
21
).find(".iconFiller").width(iconTextWidth)}
22
}
23
}
24
)}
25
)}
26
;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}
27
socialWarfare.resetStaticPanel();var termWidth=$(this).find(".swp_share").outerWidth();var iconWidth=$(this).find("i.sw").outerWidth();var containerWidth=$(this).width();var change=1+(termWidth+35)/containerWidth;$(this).find(".iconFiller").width(termWidth+iconWidth+25+"px");$(this).css("flex",change+" 1 0%")}
28
);$(".swp_social_panel:not(.swp_social_panelSide)").on("mouseleave",socialWarfare.resetStaticPanel)}
29
;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")}
30
;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}
31
if(true===$(this).hasClass("pinterest_multi_image_select")){event.preventDefault();socialWarfare.openMultiPinterestOverlay($(this));return}
32
if($(this).parent(".swp_more").length>0){event.preventDefault();socialWarfare.openMoreOptions($(this));return}
33
if($(this).hasClass("noPop")){return event}
34
if("undefined"==typeof $(this).data("link")&&false===$(this).is(".swp-hover-pin-button")){return event}
35
event.preventDefault();var href=$(this).data("link").replace("’","'");var 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}
36
if($(this).hasClass("nc_tweet")){network=$(this).parents(".nc_tweetContainer").data("network")}
37
else if($(this).hasClass("swp_CTT")){network="ctt"}
38
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)}
39
)}
40
;socialWarfare.openMultiPinterestOverlay=function(element){if($(".pinterest-overlay").length>0){$(".pinterest-overlay").fadeIn();$(".swp-lightbox-inner").scrollTop(0);return}
...
</html>