Google
Edit File: social-buttons-5af7f8e0ee07b45d03a3-min.js
webpackJsonp([27],{0:function(k,l,h){h(2220);h(2219)},369:function(k,l){k.exports={TWITTER:1,FACEBOOK:2,GOOGLE:3,LINKEDIN:4,STUMBLE:5,REDDIT:6,PINTEREST:7,TUMBLR:8}},2219:function(k,l,h){var d=h(369);YUI.add("squarespace-social-button",function(c){c.namespace("Squarespace");var g=function(b){return b},f=c.Squarespace.SocialButton=c.Base.create("socialButton",c.Widget,[],{initializer:function(b){this._servicesRendered={};b.services.forEach(function(a){this._servicesRendered[a]=!1},this);this._open= !1;this._anims={};this._serviceRenderers={};this._serviceRenderers[d.REDDIT]=this._renderReddit;this._serviceRenderers[d.FACEBOOK]=this._renderFacebook;this._serviceRenderers[d.TWITTER]=this._renderTwitter;this._serviceRenderers[d.GOOGLE]=this._renderGoogle;this._serviceRenderers[d.LINKEDIN]=this._renderLinkedIn;this._serviceRenderers[d.STUMBLE]=this._renderStumble;this._serviceRenderers[d.PINTEREST]=this._renderPinterest;this._serviceRenderers[d.TUMBLR]=this._renderTumblr;this.publish("serviceRendered", {defaultFn:this._defaultServiceRendered,context:this});this.publish("buttonClicked",{defaultFn:this._defaultButtonClicked,preventable:!0,context:this});this.publish("close",{defaultFn:this.close,preventable:!0,context:this});this.publish("servicesRendered");this._serviceContainer=c.Node.create('<div class="ss-social-button-container"></div>')},_defaultServiceRendered:function(b){this._servicesRendered[b.details[0]]=!0;this._allServicesRendered()&&(this.set("loaded",!0),this.fire("servicesRendered", this))},open:function(){this._open=!0;this._openList()},close:function(){this._open=!1;this._closeList()},_onClick:function(b){this.fire("buttonClicked",b)},_defaultButtonClicked:function(b){this.get("loaded")?this.isOpen()?this.close():this.open():this.get("loading")||(this.once("servicesRendered",function(){this.set("loading",!1)},this),this.set("loading",!0),this._renderServices(),this.open())},isOpen:function(){return this._open},destructor:function(){this._stopAnimations()},_stopAnimations:function(){c.Object.values(this._anims).forEach(function(b){b.stop()})}, _closeList:function(){var b=this.get("contentBox");if(b._node&&b.inDoc()){var a=b.one(".ss-social-button-wrapper"),e=b.one(".ss-social-list-wrapper"),b=a.get("offsetWidth");a.get("offsetHeight");a=e.get("offsetWidth");Math.abs(b-a);e&&(e._node&&e.inDoc())&&(a=new c.Anim({node:e,duration:0.3,easing:c.Easing.easeOutStrong,to:{height:0,opacity:0}}),this._anims.close=a,a.on("end",function(){e.setStyle("overflow",null);this.fire("listClose")},this),a.run())}},_openList:function(){var b=this.get("contentBox"); if(b._node&&b.inDoc()){var a=b.one(".ss-social-button-wrapper"),e=b.one(".ss-social-list-wrapper"),b=b.one(".ss-social-button-list"),d=a.get("offsetWidth"),a=a.get("offsetHeight"),f=e.get("offsetWidth"),g=Math.abs(d-f),h;this.get("id");e.setStyles({left:(d<=f?-1:1)*g/2,top:a});a=c.DOM.viewportRegion();f=b.get("region");d=f.height+f.top-(a.height+a.top);a=a.left-f.left;f=0<a;0<d&&e.setStyle("top",parseInt(e.getComputedStyle("top"),10)-d-20);f&&e.setStyle("left",parseInt(e.getComputedStyle("left"), 10)+a+20);e&&(e._node&&e.inDoc())&&(b=new c.Anim({node:e,duration:0.3,easing:c.Easing.easeOutStrong,to:{height:b.get("offsetHeight"),opacity:1}}),this._anims.open=b,b.on("end",function(){e.setStyle("overflow","visible");h=c.one(document).on("click",function(a){a.target.ancestor(".ss-social-list-wrapper",!0)||(this.fire("close"),h.detach(),h=null)},this);this.fire("listOpen")},this),b.run())}},_allServicesRendered:function(){return c.Object.values(this._servicesRendered).every(g)},bindUI:function(){var b= this.get("contentBox").one(".ss-social-button-wrapper");this.after("loadingChange",this._onLoadingChange,this);b.on("click",this._onClick,this)},_onLoadingChange:function(){this.get("boundingBox").ancestor(".squarespace-social-buttons").toggleClass("loading",this.get("loading"))},renderUI:function(){var b=this.get("contentBox");b.append('<div class="ss-social-button-wrapper"><div class="ss-social-button"><span class="ss-social-button-icon"></span>Share</div></div>');b.append('<div class="ss-social-list-wrapper"><div class="ss-social-button-list"></div></div>'); b.one(".ss-social-button-list")},_renderServices:function(){var b=this.get("contentBox").one(".ss-social-button-list");this.get("services").forEach(function(a){this._serviceRenderers[a].call(this,b)},this)},_defaultTimeoutCb:function(b){var a=c.Squarespace.Utils.reverseMap(d),e="(Social Button) Loading render script for service: {name} too longer than "+f.SCRIPT_TIMEOUT/1E3+" seconds. Skipping.";return function(){console.warn(c.substitute(e,{name:a[b]}));this.fire("serviceRendered",b)}},_defaultFailureCb:function(b){var a= c.Squarespace.Utils.reverseMap(d);return function(){console.warn(c.substitute("(Social Button) Service {name} render script failed to load.",{name:a[b]}));this.fire("serviceRendered",b)}},_renderReddit:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("url");this.get("contentBox");a.addClass("reddit");a.append(c.Node.create(f.REDDIT_LINK));a.on("click",function(a){window.open("http://reddit.com/submit?url="+encodeURIComponent(e),"Submit to Reddit");a.stopImmediatePropagation()});b.append(a); this.fire("serviceRendered",d.REDDIT)},_renderTumblr:function(b){var a=this._serviceContainer.cloneNode(!0),e={url:this.get("url"),name:this.get("title")},e=c.QueryString.stringify(e);a.addClass("tumblr");a.append(c.substitute(f.TUMBLR_TAG_TEMPLATE,{query:e}));b.append(a);c.Get.script(f.TUMBLR_URL,{onSuccess:function(){c.later(400,this,function(){this.fire("serviceRendered",d.TUMBLR)})},onFailure:this._defaultFailureCb(d.TUMBLR),onTimeout:this._defaultTimeoutCb(d.TUMBLR),timeout:f.SCRIPT_TIMEOUT, context:this,win:c.config.win})},_renderFacebook:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("url");this.get("contentBox");a.addClass("facebook");a.append(c.Node.create(c.substitute(f.FACEBOOK_TAG_TEMPLATE,{url:e})));b.append(a);c.Get.script(f.FACEBOOK_URL+"&appId="+Static.SQUARESPACE_CONTEXT.facebookAppId,{onSuccess:function(){window.FB&&c.later(400,this,function(){FB.XFMBL&&FB.XFBML.parse&&FB.XFBML.parse();this.fire("serviceRendered",d.FACEBOOK)})},onFailure:this._defaultFailureCb(d.FACEBOOK), onTimeout:this._defaultTimeoutCb(d.FACEBOOK),timeout:f.SCRIPT_TIMEOUT,context:this})},_renderGoogle:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("url");a.addClass("google");a.append(c.Node.create(c.substitute(f.GOOGLE_TAG_TEMPLATE,{url:e})));b.append(a);c.Get.script(f.GOOGLE_PLUS_URL,{onSuccess:function(){window.gapi&&(gapi.plusone.go(),c.later(400,this,function(){this.fire("serviceRendered",d.GOOGLE);this._googleRendered=!0}))},onFailure:this._defaultFailureCb(d.GOOGLE),onTimeout:this._defaultTimeoutCb(d.GOOGLE), timeout:f.SCRIPT_TIMEOUT,context:this});this.fire("serviceRendered",d.GOOGLE)},_renderTwitter:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("title"),g=this.get("url");a.append(c.Node.create('<a href="https://twitter.com/share" data-text="'+c.Escape.html(e||"")+'" data-url="'+c.Escape.html(g)+'"class="twitter-share-button">tweet</a>'));a.addClass("twitter");b.append(a);c.Get.script(f.TWITTER_URL,{onSuccess:function(){c.later(400,this,function(){this.fire("serviceRendered",d.TWITTER)})}, onFailure:this._defaultFailureCb(d.TWITTER),onTimeout:this._defaultTimeoutCb(d.TWITTER),timeout:f.SCRIPT_TIMEOUT,context:this})},_renderLinkedIn:function(b){var a=this._serviceContainer.cloneNode(!0);this.get("title");var e=this.get("url");a.addClass("linkedin");a.append(c.Node.create(c.substitute(f.LINKEDIN_URL_TEMPLATE,{url:e})));b.append(a);window.IN=void 0;c.Get.script(f.LINKEDIN_URL,{onSuccess:function(){c.later(400,this,function(){this.fire("serviceRendered",d.LINKEDIN)})},onFailure:this._defaultFailureCb(d.LINKEDIN), onTimeout:this._defaultTimeoutCb(d.LINKEDIN),timeout:f.SCRIPT_TIMEOUT,context:this})},_renderStumble:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("url"),g=this.get("id");a.addClass("stumble");a.append(c.Node.create(c.substitute(f.STUMBLE_TAG_TEMPLATE,{url:e,id:g})));b.append(a);c.Get.script(f.STUMBLE_URL,{onSuccess:function(){c.later(400,this,function(){STMBLPN&&(STMBLPN.wasProcessLoaded&&(STMBLPN.wasProcessLoaded=!1),STMBLPN.processWidgets());this.fire("serviceRendered",d.STUMBLE)})}, onFailure:this._defaultFailureCb(d.STUMBLE),onTimeout:this._defaultTimeoutCb(d.STUMBLE),timeout:f.SCRIPT_TIMEOUT,context:this})},_renderPinterest:function(b){var a=this._serviceContainer.cloneNode(!0),e=this.get("assetUrl"),g=this.get("url"),h=Static.SQUARESPACE_CONTEXT.website.authenticUrl+b.ancestor(".squarespace-social-buttons").getAttribute("data-full-url");this.get("id");this.get("recordType");this.get("systemDataId")?(a.addClass("pinterest"),a.append(c.Node.create(c.substitute(f.PINTEREST_TAG_TEMPLATE, {url:encodeURIComponent(e||g),pageUrl:encodeURIComponent(h)}))),b.append(a),c.Get.script(f.PINTEREST_URL,{onSuccess:function(){c.later(400,this,function(){this.fire("serviceRendered",d.PINTEREST)},this)},onFailure:this._defaultFailureCb(d.PINTEREST),onTimeout:this._defaultTimeoutCb(d.PINTEREST),timeout:f.SCRIPT_TIMEOUT,context:this})):this.fire("serviceRendered",d.PINTEREST)}},{TWITTER_URL:"http://platform.twitter.com/widgets.js",TUMBLR_URL:"http://platform.tumblr.com/v1/share.js",FACEBOOK_URL:"http://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3", LINKEDIN_URL:"http://platform.linkedin.com/in.js",GOOGLE_PLUS_URL:"http://apis.google.com/js/plusone.js",STUMBLE_URL:"http://platform.stumbleupon.com/1/widgets.js",PINTEREST_URL:"http://assets.pinterest.com/js/pinit.js",LINKEDIN_URL_TEMPLATE:'<script type="IN/Share" data-url="{url}" data-counter="right">\x3c/script>',GOOGLE_TAG_TEMPLATE:'<g:plusone size="medium" annotation="bubble" href="{url}"></g:plusone>',FACEBOOK_TAG_TEMPLATE:'<div id="fb-root"></div><fb:like href="{url}" send="false" layout="button_count" show_faces="true"></fb:like>', PINTEREST_TAG_TEMPLATE:'<a href="http://pinterest.com/pin/create/button?url={pageUrl}&media={url}" class="pin-it-button" count-layout="horizontal"><img border="0" src="../../images/PinExt.png" title="Pin It" /></a>',TUMBLR_TAG_TEMPLATE:'<a href="http://tumblr.com/share/link?{query}" title="Share on Tumblr" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:81px; height:20px; background:url(\'http://platform.tumblr.com/v1/share_1T.png\') top left no-repeat transparent;">Share on Tumblr</a>', SCRIPT_TIMEOUT:5E3,STUMBLE_TAG_TEMPLATE:'<su:badge layout="1" location="{url}"></su:badge>',REDDIT_LINK:'<a href="#"><img src="../../static/spreddit7.gif" alt="submit to reddit" border="0" /></a>',ATTRS:{url:{value:window.location.href},title:{value:document.title||window.location.href},services:{},recordType:{},assetUrl:{value:""},systemDataId:{value:""},loaded:{value:!1},loading:{value:!1}}})},"1.0",{requires:"anim base escape node querystring-stringify squarespace-util substitute widget".split(" ")})}, 2220:function(k,l,h){var d=h(369),c=h(125);YUI.add("squarespace-social-buttons",function(g){g.namespace("Squarespace");var f=g.config.win.Static,b=g.Squarespace.SocialButton,a=g.Squarespace.SocialButtons=g.Base.create("socialButtons",g.Base,[],{initializer:function(a){a=this.get("services");this._buttonConfigs={};this._buttons=[];this._eventHandles=[];0<a.length?(this._scanForButtons(),this._initializeButtons(),this._bindEvents(),this._renderButtons()):this._markButtonsAsEmpty()},_markButtonsAsEmpty:function(){g.all(a.SOCIAL_BUTTON_CONTAINER).addClass("empty")}, _scanForButtons:function(){var b=g.all(a.SOCIAL_BUTTON_CONTAINER),c=this.get("services");b.each(function(b){var e=b.getAttribute(a.TITLE),d=f.SQUARESPACE_CONTEXT.website.baseUrl+b.getAttribute(a.FULL_URL),h=parseInt(b.getAttribute(a.RECORD_TYPE),10),k=b.getAttribute(a.ASSET_URL),l=b.getAttribute(a.SYSTEM_DATA_ID),m=g.guid(a.ID_PREFIX);this._buttonConfigs[m]={id:m,title:e,url:d,recordType:h,assetUrl:k,systemDataId:l,services:c,node:b}},this)},_initializeButtons:function(){this._buttons=g.Array.map(g.Object.values(this._buttonConfigs), function(a){return new b(a)})},_bindEvents:function(){this._eventHandles.push(this.after("cleanup",this._defaultDestroy,this))},_renderButtons:function(){this._buttons.filter(this._excludeOnlyPinterest,this).forEach(function(a){var b=a.get("id");a.render(this._buttonConfigs[b].node)},this)},destructor:function(){this.fire("cleanup")},_unbindEvents:function(){this._eventHandles.forEach(function(a){a.detach()})},_defaultDestroy:function(){this._destroyButtons();this._unbindEvents();this.fire("destroyed")}, _destroyButtons:function(){this._buttons.forEach(function(a){a.destroy()},this)},_excludeOnlyPinterest:function(a){return a.get("recordType")!==c.IMAGE&&this._onlyServiceIsPinterest(a)?!1:!0},_onlyServiceIsPinterest:function(a){a=a.get("services");return 1===a.length&&a[0]===d.PINTEREST}},{FULL_URL:"data-full-url",ASSET_URL:"data-asset-url",SYSTEM_DATA_ID:"data-system-data-id",RECORD_TYPE:"data-record-type",ID_PREFIX:"social-",TITLE:"data-title",SOCIAL_BUTTON_CONTAINER:".squarespace-social-buttons", ATTRS:{services:{valueFn:function(){return g.Array.map(g.Object.keys(f.SQUARESPACE_CONTEXT.website.shareButtonOptions||{}),function(a){return parseInt(a,10)})}}}});g.config.win.Squarespace.onInitialize(g,function(){g.all(".squarespace-social-buttons").isEmpty()||new g.Squarespace.SocialButtons})},"1.0",{requires:["array-extras","base","base-build","node","squarespace-social-button"]})}});