Google
Edit File: social-buttons-eed128e10584f50bbd7a-min.en-US.js
webpackJsonp([36],{1028:function(e,t,i){var n=i(1029);e.exports=function(e,t){return function(i,s){return n(i,e,t(s),{})}}},1029:function(e,t,i){var n=i(229);e.exports=function(e,t,i,s){return n(e,function(e,n,o){t(s,i(e),n,o)}),s}},110:function(e,t){e.exports={TEXT:1,IMAGE:2,QUOTE:4,LINK:5,CHAT:6,AUDIO:7,VIDEO:8,VIDEO_DEPRECATED:9,REVIEW:10,STORE_ITEM:11,EVENT:12,THREAD:13,GALLERY:14,BINARY:15,CSSASSET:16,TWEAKASSET:17,DIGITALGOOD:18,ATTACHMENT:19,EXPORT_WORDPRESS:20,EXPORT_INTERNAL:21,TWEET:50,RSS:51,CHECKIN:52,DELICIOUS:53,KBARTICLE:54}},1523:function(e,t){e.exports={TWITTER:1,FACEBOOK:2,GOOGLE:3,LINKEDIN:4,STUMBLE:5,REDDIT:6,PINTEREST:7,TUMBLR:8}},272:function(e,t,i){var n=i(673),s=i(1028),o=i(127),r=Object.prototype.toString,a=s(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=r.call(t)),e[t]=i},n(o));e.exports=a},6330:function(e,t,i){var n=i(1523),s=i(110);YUI.add("squarespace-social-buttons",function(e){e.namespace("Squarespace");var t,i=e.config.win.Static,o=e.Squarespace.SocialButton,r=e.Squarespace.SocialButtons=e.Base.create("socialButtons",e.Base,[],{initializer:function(e){var t=this.get("services");this._buttonConfigs={},this._buttons=[],this._eventHandles=[],t.length>0?(this._scanForButtons(),this._initializeButtons(),this._bindEvents(),this._renderButtons()):this._markButtonsAsEmpty()},_markButtonsAsEmpty:function(){e.all(r.SOCIAL_BUTTON_CONTAINER).addClass("empty")},_scanForButtons:function(){var t=e.all(r.SOCIAL_BUTTON_CONTAINER),n=this.get("services");t.each(function(t){var s=t.getAttribute(r.TITLE),o=i.SQUARESPACE_CONTEXT.website.baseUrl+t.getAttribute(r.FULL_URL),a=parseInt(t.getAttribute(r.RECORD_TYPE),10),u=t.getAttribute(r.ASSET_URL),c=t.getAttribute(r.SYSTEM_DATA_ID),d=e.guid(r.ID_PREFIX);this._buttonConfigs[d]={id:d,title:s,url:o,recordType:a,assetUrl:u,systemDataId:c,services:n,node:t}},this)},_initializeButtons:function(){this._buttons=e.Array.map(e.Object.values(this._buttonConfigs),function(e){return new o(e)})},_bindEvents:function(){this._eventHandles.push(this.after("cleanup",this._defaultDestroy,this))},_renderButtons:function(){this._buttons.filter(this._excludeOnlyPinterest,this).forEach(function(e){var t=e.get("id");e.render(this._buttonConfigs[t].node)},this)},destructor:function(){this.fire("cleanup")},_unbindEvents:function(){this._eventHandles.forEach(function(e){e.detach(),e=null})},_defaultDestroy:function(){this._destroyButtons(),this._unbindEvents(),this.fire("destroyed")},_destroyButtons:function(){this._buttons.forEach(function(e){e.destroy()},this)},_excludeOnlyPinterest:function(e){return e.get("recordType")===s.IMAGE||!this._onlyServiceIsPinterest(e)},_onlyServiceIsPinterest:function(e){var t=e.get("services");return 1===t.length&&t[0]===n.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 e.Array.map(e.Object.keys(i.SQUARESPACE_CONTEXT.website.shareButtonOptions||{}),function(e){return parseInt(e,10)})}}}});e.config.win.Squarespace.onInitialize(e,function(){t=[],e.all(".squarespace-social-buttons").isEmpty()||t.push(new e.Squarespace.SocialButtons)}),e.config.win.Squarespace.onDestroy(e,function(){t.forEach(function(e){e.destroy()}),t=null})},"1.0",{requires:["array-extras","base","node","squarespace-social-button"]})},6331:function(e,t,i){var n=i(5),s=i(194),o=i(1523),r=i(272);YUI.add("squarespace-social-button",function(e){e.namespace("Squarespace");var t=o,i=function(e){return e},a=e.Squarespace.SocialButton=e.Base.create("socialButton",e.Widget,[],{initializer:function(i){this._servicesRendered={},i.services.forEach(function(e){this._servicesRendered[e]=!1},this),this._open=!1,this._anims={},this._serviceRenderers={},this._serviceRenderers[t.REDDIT]=this._renderReddit,this._serviceRenderers[t.FACEBOOK]=this._renderFacebook,this._serviceRenderers[t.TWITTER]=this._renderTwitter,this._serviceRenderers[t.GOOGLE]=this._renderGoogle,this._serviceRenderers[t.LINKEDIN]=this._renderLinkedIn,this._serviceRenderers[t.STUMBLE]=this._renderStumble,this._serviceRenderers[t.PINTEREST]=this._renderPinterest,this._serviceRenderers[t.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=e.Node.create('<div class="ss-social-button-container"></div>')},_defaultServiceRendered:function(e){var t=e.details[0];this._servicesRendered[t]=!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(e){this.fire("buttonClicked",e)},_defaultButtonClicked:function(e){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(){e.Object.values(this._anims).forEach(function(e){e.stop(),e=null})},_closeList:function(){var t=this.get("contentBox");if(t._node&&t.inDoc()){var i,n=t.one(".ss-social-list-wrapper");n&&n._node&&n.inDoc()&&(i=new e.Anim({node:n,duration:.3,easing:e.Easing.easeOutStrong,to:{height:0,opacity:0}}),this._anims.close=i,i.on("end",function(){n.setStyle("overflow",null),this.fire("listClose")},this),i.run())}},_openList:function(){var t=this.get("contentBox");if(t._node&&t.inDoc()){var i,n,s=t.one(".ss-social-button-wrapper"),o=t.one(".ss-social-list-wrapper"),r=t.one(".ss-social-button-list"),a=s.get("offsetWidth"),u=s.get("offsetHeight"),c=o.get("offsetWidth"),d=Math.abs(a-c);o.setStyles({left:(a<=c?-1:1)*d/2,top:u});var l=e.DOM.viewportRegion(),h=r.get("region"),p=h.height+h.top-(l.height+l.top),f=l.left-h.left,T=f>0;p>0&&o.setStyle("top",parseInt(o.getComputedStyle("top"),10)-p-20),T&&o.setStyle("left",parseInt(o.getComputedStyle("left"),10)+f+20),o&&o._node&&o.inDoc()&&(n=new e.Anim({node:o,duration:.3,easing:e.Easing.easeOutStrong,to:{height:r.get("offsetHeight"),opacity:1}}),this._anims.open=n,n.on("end",function(){o.setStyle("overflow","visible");var t=e.config.win.document;e.UA.touchEnabled&&e.one(t.documentElement).setStyle("cursor","pointer"),i=e.one(t).on("click",function(n){n.target.ancestor(".ss-social-list-wrapper",!0)||(this.fire("close"),i.detach(),i=null,e.one(t.documentElement).setStyle("cursor",""))},this),this.fire("listOpen")},this),n.run())}},_allServicesRendered:function(){return e.Object.values(this._servicesRendered).every(i)},bindUI:function(){var e=this.get("contentBox").one(".ss-social-button-wrapper");this.after("loadingChange",this._onLoadingChange,this),e.on("click",this._onClick,this)},_onLoadingChange:function(){this.get("boundingBox").ancestor(".squarespace-social-buttons").toggleClass("loading",this.get("loading"))},renderUI:function(){var e=this.get("contentBox");e.append('<div class="ss-social-button-wrapper"><div class="ss-social-button"><span class="ss-social-button-icon"></span>'+n("Share")+"</div></div>"),e.append('<div class="ss-social-list-wrapper"><div class="ss-social-button-list"></div></div>')},_renderServices:function(){var e=this.get("contentBox").one(".ss-social-button-list");this.get("services").forEach(function(t){this._serviceRenderers[t].call(this,e)},this)},_defaultTimeoutCb:function(e,t){r(o),n("(Social Button) Loading render script for service: {name} too longer than {sub1} seconds. Skipping.",{sub1:a.SCRIPT_TIMEOUT/1e3});return function(){this.fire("serviceRendered",e),t&&t.hide()}},_defaultFailureCb:function(e,t){r(o),n("(Social Button) Service {name} render script failed to load.");return function(){this.fire("serviceRendered",e),t&&t.hide()}},_renderReddit:function(i){var s=this._serviceContainer.cloneNode(!0),o=this.get("url");s.addClass("reddit"),s.append(e.Node.create(a.REDDIT_LINK)),s.on("click",function(e){window.open("http://reddit.com/submit?url="+encodeURIComponent(o),n("Submit to Reddit")),e.stopImmediatePropagation()}),i.append(s),this.fire("serviceRendered",t.REDDIT)},_renderTumblr:function(i){var n=this._serviceContainer.cloneNode(!0),s={url:this.get("url"),name:this.get("title")},o=e.QueryString.stringify(s);n.addClass("tumblr"),n.append(e.substitute(a.TUMBLR_TAG_TEMPLATE,{query:o})),i.append(n),e.Get.script(a.TUMBLR_URL,{onSuccess:function(){e.later(400,this,function(){this.fire("serviceRendered",t.TUMBLR)})},onFailure:this._defaultFailureCb(t.TUMBLR,n),onTimeout:this._defaultTimeoutCb(t.TUMBLR,n),timeout:a.SCRIPT_TIMEOUT,context:this,win:e.config.win})},_renderFacebook:function(i){var n=this._serviceContainer.cloneNode(!0),o=this.get("url");n.addClass("facebook"),n.append(e.Node.create(e.substitute(a.FACEBOOK_TAG_TEMPLATE,{url:o}))),i.append(n);var r=e.config.win,u=Static.SQUARESPACE_CONTEXT.facebookAppId,c=e.substitute(a.FACEBOOK_URL,{locale:s.formatLocaleForFacebook(s.getResolvedWebsiteLocale())});e.Get.script(c,{onSuccess:function(){r.FB&&e.later(400,this,function(){r.FB.init({appId:u,xfbml:!1,version:"v2.7"}),r.FB.XFBML&&r.FB.XFBML.parse&&r.FB.XFBML.parse(),this.fire("serviceRendered",t.FACEBOOK)})},onFailure:this._defaultFailureCb(t.FACEBOOK,n),onTimeout:this._defaultTimeoutCb(t.FACEBOOK,n),timeout:a.SCRIPT_TIMEOUT,context:this})},_renderGoogle:function(i){var n=this._serviceContainer.cloneNode(!0),s=this.get("url");n.addClass("google"),n.append(e.Node.create(e.substitute(a.GOOGLE_TAG_TEMPLATE,{url:s}))),i.append(n),e.Get.script(a.GOOGLE_PLUS_URL,{onSuccess:function(){window.gapi&&(window.gapi.plusone.go(),e.later(400,this,function(){this.fire("serviceRendered",o.GOOGLE),this._googleRendered=!0}))},onFailure:this._defaultFailureCb(t.GOOGLE,n),onTimeout:this._defaultTimeoutCb(t.GOOGLE,n),timeout:a.SCRIPT_TIMEOUT,context:this}),this.fire("serviceRendered",t.GOOGLE)},_renderTwitter:function(i){var s=this._serviceContainer.cloneNode(!0),o=this.get("title"),r=this.get("url");s.append(e.Node.create('<a href="https://twitter.com/share" data-text="'+e.Escape.html(o||"")+'" data-url="'+e.Escape.html(r)+'"class="twitter-share-button">'+n("tweet")+"</a>")),s.addClass("twitter"),i.append(s),e.Get.script(a.TWITTER_URL,{onSuccess:function(){e.later(400,this,function(){this.fire("serviceRendered",t.TWITTER)})},onFailure:this._defaultFailureCb(t.TWITTER,s),onTimeout:this._defaultTimeoutCb(t.TWITTER,s),timeout:a.SCRIPT_TIMEOUT,context:this})},_renderLinkedIn:function(i){var n=this._serviceContainer.cloneNode(!0),s=this.get("url");n.addClass("linkedin"),n.append(e.Node.create(e.substitute(a.LINKEDIN_URL_TEMPLATE,{url:s}))),i.append(n),window.IN=void 0,e.Get.script(a.LINKEDIN_URL,{onSuccess:function(){e.later(400,this,function(){this.fire("serviceRendered",t.LINKEDIN)})},onFailure:this._defaultFailureCb(t.LINKEDIN,n),onTimeout:this._defaultTimeoutCb(t.LINKEDIN,n),timeout:a.SCRIPT_TIMEOUT,context:this})},_renderStumble:function(i){var n=this._serviceContainer.cloneNode(!0),s=this.get("url"),r=this.get("id");n.addClass("stumble"),n.append(e.Node.create(e.substitute(a.STUMBLE_TAG_TEMPLATE,{url:s,id:r}))),i.append(n),e.Get.script(a.STUMBLE_URL,{onSuccess:function(){e.later(400,this,function(){window.STMBLPN&&(window.STMBLPN.wasProcessLoaded&&(window.STMBLPN.wasProcessLoaded=!1),window.STMBLPN.processWidgets()),this.fire("serviceRendered",o.STUMBLE)})},onFailure:this._defaultFailureCb(t.STUMBLE,n),onTimeout:this._defaultTimeoutCb(t.STUMBLE,n),timeout:a.SCRIPT_TIMEOUT,context:this})},_renderPinterest:function(i){var n=this._serviceContainer.cloneNode(!0),s=this.get("assetUrl"),r=this.get("url"),u=Static.SQUARESPACE_CONTEXT.website.authenticUrl+i.ancestor(".squarespace-social-buttons").getAttribute("data-full-url");this.get("systemDataId")?(n.addClass("pinterest"),n.append(e.Node.create(e.substitute(a.PINTEREST_TAG_TEMPLATE,{url:encodeURIComponent(s||r),pageUrl:encodeURIComponent(u)}))),i.append(n),e.Get.script(a.PINTEREST_URL,{onSuccess:function(){e.later(400,this,function(){this.fire("serviceRendered",o.PINTEREST)},this)},onFailure:this._defaultFailureCb(t.PINTEREST,n),onTimeout:this._defaultTimeoutCb(t.PINTEREST,n),timeout:a.SCRIPT_TIMEOUT,context:this})):this.fire("serviceRendered",t.PINTEREST)}},{TWITTER_URL:"https://platform.twitter.com/widgets.js",TUMBLR_URL:"https://platform.tumblr.com/v1/share.js",FACEBOOK_URL:"https://connect.facebook.net/{locale}/sdk.js",LINKEDIN_URL:"https://platform.linkedin.com/in.js",GOOGLE_PLUS_URL:"https://apis.google.com/js/plusone.js",STUMBLE_URL:"http://platform.stumbleupon.com/1/widgets.js",PINTEREST_URL:"https://assets.pinterest.com/js/pinit.js",LINKEDIN_URL_TEMPLATE:'<script type="IN/Share" data-url="{url}" data-counter="right"><\/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="https://pinterest.com/pin/create/button?url={pageUrl}&media={url}" class="pin-it-button" count-layout="horizontal"><img border="0" src="../../images/PinExt.png" title="'+n("Pin It")+'" /></a>',TUMBLR_TAG_TEMPLATE:'<a href="http://tumblr.com/share/link?{query}" title="'+n("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;">'+n("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="'+n("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"]})},823:function(e,t){YUI.add("substitute",function(e,t){var i=e.Lang,n=/(~-(\d+)-~)/g,s=/\{LBRACE\}/g,o=/\{RBRACE\}/g,r=function(t,r,a,u){for(var c,d,l,h,p,f,T,_,E=[],g=t.length;!((c=t.lastIndexOf("{",g))<0)&&(d=t.indexOf("}",c),!(c+1>=d));)f=null,(l=(h=T=t.substring(c+1,d)).indexOf(" "))>-1&&(f=h.substring(l+1),h=h.substring(0,l)),p=r[h],a&&(p=a(h,p,f)),i.isObject(p)?e.dump?i.isArray(p)?p=e.dump(p,parseInt(f,10)):((_=(f=f||"").indexOf("dump"))>-1&&(f=f.substring(4)),p=p.toString===Object.prototype.toString||_>-1?e.dump(p,parseInt(f,10)):p.toString()):p=p.toString():i.isUndefined(p)&&(p="~-"+E.length+"-~",E.push(T)),t=t.substring(0,c)+p+t.substring(d+1),u||(g=c-1);return t.replace(n,function(e,t,i){return"{"+E[parseInt(i,10)]+"}"}).replace(s,"{").replace(o,"}")};e.substitute=r,i.substitute=r},"3.17.2",{requires:["yui-base"],optional:["dump"]})},8913:function(e,t,i){i(6330),i(6331),i(823)}},[8913]);