jquery.socialshareprivacy.min.js 41 KB

12
  1. !function($,undefined){"use strict";function absurl(url,base){if(base||(base=document.baseURI||$("html > head > base").last().attr("href")||document.location.href),!url)return base;if(/^[a-z][-+\.a-z0-9]*:/i.test(url))return url;if("//"===url.slice(0,2))return/^[^:]+:/.exec(base)[0]+url;var ch=url.charAt(0);if("/"===ch)return/^file:/i.test(base)?"file://"+url:/^[^:]+:\/*[^\/]+/i.exec(base)[0]+url;if("#"===ch)return base.replace(/#.*$/,"")+url;if("?"===ch)return base.replace(/[\?#].*$/,"")+url;var path;if(/^file:/i.test(base))path=base.replace(/^file:\/{0,2}/i,""),base="file://";else{var match=/^([^:]+:\/*[^\/]+)(\/.*?)?(\?.*?)?(#.*)?$/.exec(base);base=match[1],path=match[2]||"/"}return path=path.split("/"),path.pop(),0===path.length&&path.push(""),path.push(url),base+path.join("/")}function formatNumber(number){number=Number(number);var prefix="",suffix="";if(0>number&&(prefix="-",number=-number),1/0===number)return prefix+"Infinity";if(number>9999&&(number/=1e3,suffix="K"),number=Math.round(number),0===number)return"0";for(var buf=[];number>0;){var part=String(number%1e3);if(number=Math.floor(number/1e3))for(;part.length<3;)part="0"+part;buf.unshift(part)}return prefix+buf.join(",")+suffix}function getTitle(options,uri,settings){var title=settings&&settings.title;if("function"==typeof title&&(title=title.call(this,options,uri,settings)),title)return title;var title=$('meta[name="DC.title"]').attr("content"),creator=$('meta[name="DC.creator"]').attr("content");return title&&creator?title+" - "+creator:title||$('meta[property="og:title"]').attr("content")||$("title").text()}function getDescription(options,uri,settings){var description=settings&&settings.description;return"function"==typeof description&&(description=description.call(this,options,uri,settings)),description?description:abbreviateText($('meta[name="twitter:description"]').attr("content")||$('meta[itemprop="description"]').attr("content")||$('meta[name="description"]').attr("content")||$.trim($("article, p").first().text())||$.trim($("body").text()),3500)}function getImage(options,uri,settings){var imgs,img=settings&&settings.image;return"function"==typeof img&&(img=img.call(this,options,uri,settings)),img||(imgs=$('meta[property="image"], meta[property="og:image"], meta[property="og:image:url"], meta[name="twitter:image"], link[rel="image_src"], itemscope *[itemprop="image"]').first(),imgs.length>0&&(img=imgs.attr(IMAGE_ATTR_MAP[imgs[0].nodeName]))),img?absurl(img):(imgs=$("img").filter(":visible").filter(function(){return 0===$(this).parents(".social_share_privacy_area").length}),0===imgs.length?(img=$('link[rel~="shortcut"][rel~="icon"]').attr("href"),img?absurl(img):"http://www.google.com/s2/favicons?"+$.param({domain:location.hostname})):(imgs.sort(function(lhs,rhs){return rhs.offsetWidth*rhs.offsetHeight-lhs.offsetWidth*lhs.offsetHeight}),imgs[0].src))}function abbreviateText(text,length){if(unescape(encodeURIComponent(text)).length<=length)return text;var abbrev=text.slice(0,length-3);if(!/\W/.test(text.charAt(length-3))){var match=/^(.*)\s\S*$/.exec(abbrev);match&&(abbrev=match[1])}return abbrev+"…"}function escapeHtml(s){return s.replace(/[<>&"']/g,function(ch){return HTML_CHAR_MAP[ch]})}function getEmbed(options,uri,settings){var embed=settings&&settings.embed;if("function"==typeof embed&&(embed=embed.call(this,options,uri,settings)),embed)return embed;embed=['<iframe scrolling="no" frameborder="0" style="border:none;" allowtransparency="true"'];var embed_url=$('meta[name="twitter:player"]').attr("content");if(embed_url){var width=$('meta[name="twitter:player:width"]').attr("content"),height=$('meta[name="twitter:player:height"]').attr("content");width&&embed.push(' width="',escapeHtml(width),'"'),height&&embed.push(' height="',escapeHtml(height),'"')}else embed_url=uri+options.referrer_track;return embed.push(' src="',escapeHtml(embed_url),'"></iframe>'),embed.join("")}function getURI(options){var uri=document.location.href,canonical=$('head meta[property="og:url"]').attr("content")||$("link[rel=canonical]").attr("href");return canonical?uri=absurl(canonical):options&&options.ignore_fragment&&(uri=uri.replace(/#.*$/,"")),uri}function buttonClickHandler(service_name){function onclick(event){var $container=$(this).parents("li.help_info").first(),$share=$container.parents(".social_share_privacy_area").first().parent(),options=$share.data("social-share-privacy-options"),service=options.services[service_name],button_class=service.button_class||service_name,uri=options.uri;"function"==typeof uri&&(uri=uri.call($share[0],options));var $switch=$container.find("span.switch");$switch.hasClass("off")?($container.addClass("info_off"),$switch.addClass("on").removeClass("off").html(service.txt_on||" "),$container.find("img.privacy_dummy").replaceWith("function"==typeof service.button?service.button.call($container.parent().parent()[0],service,uri,options):service.button),$share.trigger({type:"socialshareprivacy:enable",serviceName:service_name,isClick:!event.isTrigger})):($container.removeClass("info_off"),$switch.addClass("off").removeClass("on").html(service.txt_off||" "),$container.find(".dummy_btn").empty().append($("<img/>").addClass(button_class+"_privacy_dummy privacy_dummy").attr({alt:service.dummy_alt,src:service.path_prefix+("line"===options.layout?service.dummy_line_img:service.dummy_box_img)}).click(onclick)),$share.trigger({type:"socialshareprivacy:disable",serviceName:service_name,isClick:!event.isTrigger}))}return onclick}function enterHelpInfo(){var $info_wrapper=$(this);if(!$info_wrapper.hasClass("info_off")){var timeout_id=window.setTimeout(function(){$info_wrapper.addClass("display"),$info_wrapper.removeData("timeout_id")},500);$info_wrapper.data("timeout_id",timeout_id)}}function leaveHelpInfo(){var $info_wrapper=$(this),timeout_id=$info_wrapper.data("timeout_id");timeout_id!==undefined&&window.clearTimeout(timeout_id),$info_wrapper.removeClass("display")}function permCheckChangeHandler(){var $input=$(this),$share=$input.parents(".social_share_privacy_area").first().parent(),options=$share.data("social-share-privacy-options");$input.is(":checked")?(options.set_perma_option($input.attr("data-service"),options),$input.parent().addClass("checked")):(options.del_perma_option($input.attr("data-service"),options),$input.parent().removeClass("checked"))}function enterSettingsInfo(){var $settings=$(this),timeout_id=window.setTimeout(function(){$settings.find(".settings_info_menu").removeClass("off").addClass("on"),$settings.removeData("timeout_id")},500);$settings.data("timeout_id",timeout_id)}function leaveSettingsInfo(){var $settings=$(this),timeout_id=$settings.data("timeout_id");timeout_id!==undefined&&window.clearTimeout(timeout_id),$settings.find(".settings_info_menu").removeClass("on").addClass("off")}function setPermaOption(service_name,options){$.cookie("socialSharePrivacy_"+service_name,"perma_on",options.cookie_expires,options.cookie_path,options.cookie_domain)}function delPermaOption(service_name,options){$.cookie("socialSharePrivacy_"+service_name,null,-1,options.cookie_path,options.cookie_domain)}function getPermaOption(service_name,options){return!!options.get_perma_options(options)[service_name]}function getPermaOptions(){var cookies=$.cookie(),permas={};for(var name in cookies){var match=/^socialSharePrivacy_(.+)$/.exec(name);match&&(permas[match[1]]="perma_on"===cookies[name])}return permas}function socialSharePrivacy(options){if("string"==typeof options){var command=options;if(1===arguments.length)switch(command){case"enable":this.find(".switch.off").click();break;case"disable":this.find(".switch.on").click();break;case"toggle":this.find(".switch").click();break;case"options":return this.data("social-share-privacy-options");case"destroy":this.trigger({type:"socialshareprivacy:destroy"}),this.children(".social_share_privacy_area").remove(),this.removeData("social-share-privacy-options");break;case"enabled":var enabled={};return this.each(function(){var $self=$(this),options=$self.data("social-share-privacy-options");for(var name in options.services)enabled[name]=$self.find("."+(options.services[name].class_name||name)+" .switch").hasClass("on")}),enabled;case"disabled":var disabled={};return this.each(function(){var $self=$(this),options=$self.data("social-share-privacy-options");for(var name in options.services)disabled[name]=$self.find("."+(options.services[name].class_name||name)+" .switch").hasClass("off")}),disabled;default:throw new Error("socialSharePrivacy: unknown command: "+command)}else{var arg=arguments[1];switch(command){case"enable":this.each(function(){var $self=$(this),options=$self.data("social-share-privacy-options");$self.find("."+(options.services[arg].class_name||arg)+" .switch.off").click()});break;case"disable":this.each(function(){var $self=$(this),options=$self.data("social-share-privacy-options");$self.find("."+(options.services[arg].class_name||arg)+" .switch.on").click()});break;case"toggle":this.each(function(){var $self=$(this),options=$self.data("social-share-privacy-options");$self.find("."+(options.services[arg].class_name||arg)+" .switch").click()});break;case"option":if(!(arguments.length>2))return this.data("social-share-privacy-options")[arg];var value={};value[arg]=arguments[2],this.each(function(){$.extend(!0,$(this).data("social-share-privacy-options"),value)});break;case"options":$.extend(!0,options,arg);break;case"enabled":var options=this.data("social-share-privacy-options");return this.find("."+(options.services[arg].class_name||arg)+" .switch").hasClass("on");case"disabled":var options=this.data("social-share-privacy-options");return this.find("."+(options.services[arg].class_name||arg)+" .switch").hasClass("off");default:throw new Error("socialSharePrivacy: unknown command: "+command)}}return this}return this.each(function(){var data={};this.lang&&(data.language=this.lang);for(var i=0,attrs=this.attributes;i<attrs.length;++i){var attr=attrs[i];if(/^data-./.test(attr.name)){for(var path=attr.name.slice(5).replace(/-/g,"_").split("."),ctx=data,j=0;j<path.length-1;++j){var name=path[j];name in ctx?(ctx=ctx[name],"string"==typeof ctx&&(ctx=new Function("$","return ("+ctx+");").call(this,$))):ctx=ctx[name]={}}var name=path[j];ctx[name]="object"==typeof ctx[name]?$.extend(!0,new Function("$","return ("+attr.value+");").call(this,$),ctx[name]):attr.value}}if("cookie_expires"in data&&(data.cookie_expires=Number(data.cookie_expires)),"perma_option"in data&&(data.perma_option="true"===$.trim(data.perma_option).toLowerCase()),"ignore_fragment"in data&&(data.ignore_fragment="true"===$.trim(data.ignore_fragment).toLowerCase()),"set_perma_option"in data&&(data.set_perma_option=new Function("service_name","options",data.set_perma_option)),"del_perma_option"in data&&(data.del_perma_option=new Function("service_name","options",data.del_perma_option)),"get_perma_option"in data&&(data.get_perma_option=new Function("service_name","options",data.get_perma_option)),"get_perma_options"in data&&(data.get_perma_options=new Function("options",data.get_perma_options)),"order"in data&&(data.order=$.trim(data.order),data.order?data.order=data.order.split(/\s+/g):delete data.order),"string"==typeof data.services&&(data.services=new Function("$","return ("+data.services+");").call(this,$)),"options"in data&&(data=$.extend(data,new Function("$","return ("+data.options+");").call(this,$)),delete data.options),"services"in data)for(var service_name in data.services){var service=data.services[service_name];"string"==typeof service&&(data.services[service_name]=new Function("$","return ("+service+");").call(this,$)),"string"==typeof service.status&&(service.status="true"===$.trim(service.status).toLowerCase()),"string"==typeof service.perma_option&&(service.perma_option="true"===$.trim(service.perma_option).toLowerCase())}var this_options=$.extend(!0,{},socialSharePrivacy.settings,options,data),order=this_options.order||[],dummy_img="line"===this_options.layout?"dummy_line_img":"dummy_box_img",any_on=!1,any_perm=!1,any_unsafe=!1,unordered=[];for(var service_name in this_options.services){var service=this_options.services[service_name];service.status&&(any_on=!0,-1===$.inArray(service_name,order)&&unordered.push(service_name),"safe"!==service.privacy&&(any_unsafe=!0,service.perma_option&&(any_perm=!0))),"language"in service||(service.language=this_options.language),"path_prefix"in service||(service.path_prefix=this_options.path_prefix),"referrer_track"in service||(service.referrer_track="")}if(unordered.sort(),order=order.concat(unordered),any_on){if(this_options.css_path){var css_path=(this_options.path_prefix||"")+this_options.css_path;document.createStyleSheet?document.createStyleSheet(css_path):0===$('link[href="'+css_path+'"]').length&&$("<link/>",{rel:"stylesheet",type:"text/css",href:css_path}).appendTo(document.head)}var permas;if(this_options.perma_option&&any_perm)if(this_options.get_perma_options)permas=this_options.get_perma_options(this_options);else{permas={};for(var service_name in this_options.services)permas[service_name]=this_options.get_perma_option(service_name,this_options)}var uri=this_options.uri;"function"==typeof uri&&(uri=uri.call(this,this_options));var $context=$('<ul class="social_share_privacy_area"></ul>').addClass(this_options.layout),$share=$(this);$share.prepend($context).data("social-share-privacy-options",this_options);for(var i=0;i<order.length;++i){var service_name=order[i],service=this_options.services[service_name];if(service&&service.status){var $help_info,class_name=service.class_name||service_name,button_class=service.button_class||service_name;"safe"===service.privacy?($help_info=$('<li class="help_info"><div class="info">'+service.txt_info+'</div><div class="dummy_btn"></div></li>').addClass(class_name),$help_info.find(".dummy_btn").addClass(button_class).append(service.button.call(this,service,uri,this_options))):($help_info=$('<li class="help_info"><div class="info">'+service.txt_info+'</div><span class="switch off">'+(service.txt_off||" ")+'</span><div class="dummy_btn"></div></li>').addClass(class_name),$help_info.find(".dummy_btn").addClass(button_class).append($("<img/>").addClass(button_class+"_privacy_dummy privacy_dummy").attr({alt:service.dummy_alt,src:service.path_prefix+service[dummy_img]})),$help_info.find(".dummy_btn img.privacy_dummy, span.switch").click(buttonClickHandler(service_name))),$context.append($help_info)}}if(any_unsafe){var $settings_info=$('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a><span class="help_info icon"><span class="info">'+this_options.txt_help+"</span></span></a></div></li>"),$info_link=$settings_info.find("> .settings_info_menu > a").attr("href",this_options.info_link);if(this_options.info_link_target&&$info_link.attr("target",this_options.info_link_target),$context.append($settings_info),$context.find(".help_info").on("mouseenter",enterHelpInfo).on("mouseleave",leaveHelpInfo),this_options.perma_option&&any_perm){var $container_settings_info=$context.find("li.settings_info"),$settings_info_menu=$container_settings_info.find(".settings_info_menu");$settings_info_menu.removeClass("perma_option_off"),$settings_info_menu.append('<span class="settings">'+this_options.txt_settings+"</span><form><fieldset><legend>"+this_options.settings_perma+"</legend></fieldset></form>");for(var $fieldset=$settings_info_menu.find("form fieldset"),i=0;i<order.length;++i){var service_name=order[i],service=this_options.services[service_name];if(service&&service.status&&service.perma_option&&"safe"!==service.privacy){var class_name=service.class_name||service_name,perma=permas[service_name],$field=$('<label><input type="checkbox"'+(perma?' checked="checked"/>':"/>")+service.display_name+"</label>");$field.find("input").attr("data-service",service_name),$fieldset.append($field),perma&&($context.find("li."+class_name+" span.switch").click(),this_options.set_perma_option(service_name,this_options))}}$container_settings_info.find("span.settings").css("cursor","pointer"),$container_settings_info.on("mouseenter",enterSettingsInfo).on("mouseleave",leaveSettingsInfo),$container_settings_info.find("fieldset input").on("change",permCheckChangeHandler)}}$share.trigger({type:"socialshareprivacy:create",options:this_options})}})}var IMAGE_ATTR_MAP={META:"content",IMG:"src",A:"href",IFRAME:"src",LINK:"href"},HTML_CHAR_MAP={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"};socialSharePrivacy.absurl=absurl,socialSharePrivacy.escapeHtml=escapeHtml,socialSharePrivacy.getTitle=getTitle,socialSharePrivacy.getImage=getImage,socialSharePrivacy.getEmbed=getEmbed,socialSharePrivacy.getDescription=getDescription,socialSharePrivacy.abbreviateText=abbreviateText,socialSharePrivacy.formatNumber=formatNumber,socialSharePrivacy.settings={services:{},info_link:"http://panzi.github.io/SocialSharePrivacy/",info_link_target:"",txt_settings:"Settings",txt_help:"If you activate these fields via click, data will be sent to a third party (Facebook, Twitter, Google, ...) and stored there. For more details click <em>i</em>.",settings_perma:"Permanently enable share buttons:",layout:"line",set_perma_option:setPermaOption,del_perma_option:delPermaOption,get_perma_options:getPermaOptions,get_perma_option:getPermaOption,perma_option:!!$.cookie,cookie_path:"/",cookie_domain:document.location.hostname,cookie_expires:365,path_prefix:"",css_path:"stylesheets/jquery.socialshareprivacy.min.css",uri:getURI,language:"en",ignore_fragment:!0},$.fn.socialSharePrivacy=socialSharePrivacy}(jQuery),function($){"use strict";function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value?value.call(self,options,uri,settings):String(value)}$.fn.socialSharePrivacy.settings.services.buffer={status:!0,dummy_line_img:"images/dummy_buffer.png",dummy_box_img:"images/dummy_box_buffer.png",dummy_alt:'"Buffer"-Dummy',txt_info:"Two clicks for more privacy: The Buffer button will be enabled once you click here. Activating the button already sends data to Buffer &ndash; see <em>i</em>.",txt_off:"not connected to Buffer",txt_on:"connected to Buffer",perma_option:!0,display_name:"Buffer",referrer_track:"",via:"",text:$.fn.socialSharePrivacy.getTitle,picture:$.fn.socialSharePrivacy.getImage,button:function(options,uri,settings){return $('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr("src","https://widgets.bufferapp.com/button/?"+$.param({count:"line"===settings.layout?"horizontal":"vertical",via:get(this,options,uri,settings,"via"),text:$.fn.socialSharePrivacy.abbreviateText(get(this,options,uri,settings,"text"),120),picture:get(this,options,uri,settings,"picture"),url:uri+options.referrer_track,source:"button"}))}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.delicious={status:!0,dummy_line_img:"images/dummy_delicious.png",dummy_box_img:"images/dummy_box_delicious.png",dummy_alt:'"Delicious"-Dummy',txt_info:"Two clicks for more privacy: The Delicious button will be enabled once you click here. Activating the button already sends data to Delicious &ndash; see <em>i</em>.",txt_off:"not connected to Delicious",txt_on:"connected to Delicious",perma_option:!0,display_name:"Delicious",txt_button:"Save",referrer_track:"",title:$.fn.socialSharePrivacy.getTitle,button:function(options,uri,settings){var $button=$('<div class="delicious-widget"/>'),url=uri+options.referrer_track;return $.ajax({url:"http://feeds.delicious.com/v2/json/urlinfo/data",data:{url:url},dataType:"jsonp",success:function(counts){for(var hash,total_posts,title,txt_button,i=0;i<counts.length;++i){var count=counts[i];if(count.url===url){total_posts=parseInt(count.total_posts,10),hash=count.hash,title=count.title;break}}txt_button=total_posts?$.fn.socialSharePrivacy.formatNumber(total_posts):options.txt_button;var save_url="http://delicious.com/save?"+$.param({v:"5",url:url,title:("function"==typeof options.title?options.title.call(this,options,uri,settings):String(options.title))||title});$button.html('<a target="delicious" class="icon"><div class="delicious1"></div><div class="delicious2"></div><div class="delicious3"></div></a><a class="count" target="delicious"><i></i><b></b></a>'),$button.find("i").text(options.txt_button),$button.find("b").text(txt_button),$button.find("a.icon").attr("href",hash?"http://delicious.com/url/"+hash:save_url);var $count=$button.find("a.count").attr("href",save_url).click(function(event){window.open(save_url+"&noui&jump=close","delicious","toolbar=no,width=555,height=555"),event.preventDefault()});total_posts&&$count.hover(function(){var $self=$(this);$self.find("b").stop(1,1).css("display","none"),$self.find("i").fadeIn()},function(){var $self=$(this);$self.find("i").stop(1,1).css("display","none"),$self.find("b").fadeIn()})}}),$button}}}(jQuery),function($){"use strict";var DISQUSWIDGETS={displayCount:function(data){$(".social_share_privacy_area .disqus .disqus-widget:not(.init)").each(function(){var $widget=$(this),uri=data.counts[0].id;if($widget.attr("data-uri")===uri){var key=$widget.attr("data-count"),count=data.counts[0][key],text=data.text[key],scount=$.fn.socialSharePrivacy.formatNumber(count);$widget.attr("title",0===count?text.zero:1===count?text.one:text.multiple.replace("{num}",scount)),$widget.find(".count a").text(scount),$widget.addClass("init")}})}};$.fn.socialSharePrivacy.settings.services.disqus={status:!0,dummy_line_img:"images/dummy_disqus.png",dummy_box_img:"images/dummy_box_disqus.png",dummy_alt:'"Disqus"-Dummy',txt_info:"Two clicks for more privacy: The Disqus button will be enabled once you click here. Activating the button already sends data to Disqus &ndash; see <em>i</em>.",txt_off:"not connected to Disqus",txt_on:"connected to Disqus",perma_option:!0,display_name:"Disqus",referrer_track:"",shortname:"",count:"comments",onclick:null,button:function(options,uri,settings){var $code,shortname=options.shortname||window.disqus_shortname||"";return $code=$("line"===settings.layout?'<div class="disqus-widget"><a href="#disqus_thread" class="name">Disq<span class="us">us</span></a><span class="count"><i></i><u></u><a href="#disqus_thread">&nbsp;</a></span></div>':'<div class="disqus-widget"><div class="count"><i></i><u></u><a href="#disqus_thread">&nbsp;</a></div><a href="#disqus_thread" class="name">Disq<span class="us">us</span></a></div>'),$code.attr({"data-count":options.count,"data-shortname":shortname,"data-uri":uri+options.referrer_track}),options.onclick&&$code.find("a").click("function"==typeof options.onclick?options.onclick:new Function("event",options.onclick)),window.DISQUSWIDGETS=DISQUSWIDGETS,$.getScript("https://"+shortname+".disqus.com/count-data.js?2="+encodeURIComponent(uri+options.referrer_track)),$code}}}(jQuery),function($){"use strict";var locales={af:["ZA"],ar:["AR"],az:["AZ"],be:["BY"],bg:["BG"],bn:["IN"],bs:["BA"],ca:["ES"],cs:["CZ"],cy:["GB"],da:["DK"],de:["DE"],el:["GR"],en:["GB","PI","UD","US"],eo:["EO"],es:["ES","LA"],et:["EE"],eu:["ES"],fa:["IR"],fb:["LT"],fi:["FI"],fo:["FO"],fr:["CA","FR"],fy:["NL"],ga:["IE"],gl:["ES"],he:["IL"],hi:["IN"],hr:["HR"],hu:["HU"],hy:["AM"],id:["ID"],is:["IS"],it:["IT"],ja:["JP"],ka:["GE"],km:["KH"],ko:["KR"],ku:["TR"],la:["VA"],lt:["LT"],lv:["LV"],mk:["MK"],ml:["IN"],ms:["MY"],nb:["NO"],ne:["NP"],nl:["NL"],nn:["NO"],pa:["IN"],pl:["PL"],ps:["AF"],pt:["BR","PT"],ro:["RO"],ru:["RU"],sk:["SK"],sl:["SI"],sq:["AL"],sr:["RS"],sv:["SE"],sw:["KE"],ta:["IN"],te:["IN"],th:["TH"],tl:["PH"],tr:["TR"],uk:["UA"],vi:["VN"],zh:["CN","HK","TW"]};$.fn.socialSharePrivacy.settings.services.facebook={status:!0,button_class:"fb_like",dummy_line_img:"images/dummy_facebook.png",dummy_box_img:"images/dummy_box_facebook.png",dummy_alt:'Facebook "Like"-Dummy',txt_info:"Two clicks for more privacy: The Facebook Like button will be enabled once you click here. Activating the button already sends data to Facebook &ndash; see <em>i</em>.",txt_off:"not connected to Facebook",txt_on:"connected to Facebook",perma_option:!0,display_name:"Facebook Like/Recommend",referrer_track:"",action:"like",colorscheme:"light",font:"",button:function(options,uri,settings){var match=/^([a-z]{2})_([A-Z]{2})$/.exec(options.language),locale="en_US";if(match){if(match[1]in locales){var subs=locales[match[1]];locale=-1!==$.inArray(match[2],subs)?options.language:match[1]+"_"+subs[0]}}else options.language in locales&&(locale=options.language+"_"+locales[options.language][0]);var params={locale:locale,href:uri+options.referrer_track,send:"false",show_faces:"false",action:options.action,colorscheme:options.colorscheme};return options.font&&(params.font=options.font),"line"===settings.layout?(params.width="120",params.height="20",params.layout="button_count"):(params.width="62",params.height="61",params.layout="box_count"),$('<iframe scrolling="no" frameborder="0" allowtransparency="true"></iframe>').attr("src","https://www.facebook.com/plugins/like.php?"+$.param(params))}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.fbshare={status:!0,privacy:"safe",button_class:"fbshare",line_img:"images/fbshare.png",box_img:"images/box_fbshare.png",txt_info:"Share via facebook.",txt_button:"Facebook Share",display_name:"Facebook Share",referrer_track:"",button:function(options,uri,settings){return $("<a/>",{target:"_blank",href:"https://www.facebook.com/sharer/sharer.php?"+$.param({u:uri+options.referrer_track})}).append($("<img>",{alt:options.txt_button,src:options.path_prefix+("line"===settings.layout?options.line_img:options.box_img)}))}}}(jQuery),function($){"use strict";function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value?value.call(self,options,uri,settings):String(value)}var langs={en:!0,sq:!0,ar:!0,be:!0,bg:!0,ca:!0,zh:!0,hr:!0,cs:!0,da:!0,nl:!0,eo:!0,et:!0,fi:!0,fr:!0,es:!0,de:!0,el:!0,iw:!0,hi:!0,hu:!0,is:!0,"in":!0,ga:!0,it:!0,ja:!0,ko:!0,lv:!0,lt:!0,mk:!0,ms:!0,mt:!0,no:!0,nn:!0,fa:!0,pl:!0,pt:!0,ro:!0,ru:!0,sr:!0,sk:!0,sl:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0};$.fn.socialSharePrivacy.settings.services.flattr={status:!0,button_class:"flattr",dummy_line_img:"images/dummy_flattr.png",dummy_box_img:"images/dummy_box_flattr.png",dummy_alt:'"Flattr"-Dummy',txt_info:"Two clicks for more privacy: The Flattr button will be enabled once you click here. Activating the button already sends data to Flattr &ndash; see <em>i</em>.",txt_off:"not connected to Flattr",txt_on:"connected to Flattr",perma_option:!0,display_name:"Flattr",referrer_track:"",title:$.fn.socialSharePrivacy.getTitle,description:$.fn.socialSharePrivacy.getDescription,uid:"",category:"",tags:"",popout:"",hidden:"",button:function(options,uri,settings){var attrs={href:uri+options.referrer_track,title:get(this,options,uri,settings,"title")};if(options.uid&&(attrs["data-flattr-uid"]=options.uid),options.hidden&&(attrs["data-flattr-hidden"]=options.hidden),options.popout&&(attrs["data-flattr-popout"]=options.popout),options.category&&(attrs["data-flattr-category"]=options.category),options.tags&&(attrs["data-flattr-tags"]=options.tags),options.language){var lang=String(options.language).replace("-","_"),baselang=lang.split("_")[0];langs[baselang]===!0&&(attrs["data-flattr-language"]=attrs.lang=lang)}"line"===settings.layout&&(attrs["data-flattr-button"]="compact");var $code=$('<a class="FlattrButton">'+get(this,options,uri,settings,"description")+'</a><script text="text/javscript" src="https://api.flattr.com/js/0.6/load.js?mode=auto"></script>');return $code.filter("a").attr(attrs),$code}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.gplus={status:!0,button_class:"gplusone",dummy_line_img:"images/dummy_gplus.png",dummy_box_img:"images/dummy_box_gplus.png",dummy_alt:'"Google+1"-Dummy',txt_info:"Two clicks for more privacy: The Google+ button will be enabled once you click here. Activating the button already sends data to Google &ndash; see <em>i</em>.",txt_off:"not connected to Google+",txt_on:"connected to Google+",perma_option:!0,display_name:"Google+",referrer_track:"",button:function(options,uri,settings){var $code=$('<div class="g-plusone"></div><script type="text/javascript">window.___gcfg = {lang: "'+options.language.replace("_","-")+'"}; (function() { var po = document.createElement("script"); po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/plusone.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>');return $code.filter(".g-plusone").attr({"data-href":uri+options.referrer_track,"data-size":"line"===settings.layout?"medium":"tall"}),$code}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.hackernews={status:!0,dummy_line_img:"images/dummy_hackernews.png",dummy_box_img:"images/dummy_box_hackernews.png",dummy_alt:'"Hacker News"-Dummy',txt_info:"Two clicks for more privacy: The Hacker News button will be enabled once you click here. Activating the button already sends data to Hacker News &ndash; see <em>i</em>.",txt_off:"not connected to Hacker News",txt_on:"connected to Hacker News",perma_option:!0,display_name:"Hacker News",txt_n_points:"{points} points",txt_one_point:"1 point",referrer_track:"",title:$.fn.socialSharePrivacy.getTitle,button:function(options,uri,settings){var $code,url=uri+options.referrer_track,title="function"==typeof options.title?options.title.call(this,options,uri,settings):String(options.title);return $code=$("line"===settings.layout?'<div class="hackernews-widget"><a class="name" target="_blank">Y</a><span class="points"><i></i><u></u><a target="_blank">submit</a></span></div>':'<div class="hackernews-widget"><div class="points"><i></i><u></u><a target="_blank">submit</a></div><a class="name" target="_blank">Y</a></div>'),$code.find("a").attr("href","https://news.ycombinator.com/submitlink?"+$.param({u:url,t:title})),$.ajax("https://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][url][]="+encodeURIComponent(url),{dataType:"jsonp",success:function(data){var item=data.results[0];if(item){item=item.item;var points=$.fn.socialSharePrivacy.formatNumber(item.points);$code.find("a").attr("href","https://news.ycombinator.com/item?id="+item.id),$code.find(".points a").text(points).attr("title",1===item.points?options.txt_one_point:options.txt_n_points.replace(/{points}/g,points))}}}),$code}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.linkedin={status:!0,dummy_line_img:"images/dummy_linkedin.png",dummy_box_img:"images/dummy_box_linkedin.png",dummy_alt:'"LinkedIn"-Dummy',txt_info:"Two clicks for more privacy: The Linked in button will be enabled once you click here. Activating the button already sends data to Linked in &ndash; see <em>i</em>.",txt_off:"not connected to LinkedIn",txt_on:"connected to LinkedIn",perma_option:!0,display_name:"LinkedIn",referrer_track:"",onsuccess:null,onerror:null,showzero:!1,button:function(options,uri,settings){var attrs={"data-counter":"line"===settings.layout?"right":"top","data-url":uri+options.referrer_track,"data-showzero":String(options.showzero)};options.onsuccess&&(attrs["data-onsuccess"]=options.onsuccess),options.onerror&&(attrs["data-onerror"]=options.onerror);var $code=$('<script type="IN/Share"></script>').attr(attrs);return window.IN&&window.IN.parse?$code=$code.add('<script type="text/javascript">IN.parse(document.body);</script>'):0===$('script[src^="https://platform.linkedin.com/"]').length&&($code=$code.add('<script type="text/javascript" src="https://platform.linkedin.com/in.js"></script>')),$code}}}(jQuery),function($){"use strict";function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value&&(value=value.call(self,options,uri,settings)),String(value)}function getBody(options,uri,settings){return getDescription.call(this,options,uri,settings)+"\n\n"+uri+options.referrer_track}var getDescription=$.fn.socialSharePrivacy.getDescription;
  2. $.fn.socialSharePrivacy.settings.services.mail={status:!0,privacy:"safe",button_class:"mail",line_img:"images/mail.png",box_img:"images/box_mail.png",txt_info:"Send this via email to a friend.",txt_button:"Send Email",display_name:"Mail",referrer_track:"",subject:$.fn.socialSharePrivacy.getTitle,body:getBody,button:function(options,uri,settings){return $("<a/>").attr("href","mailto:?"+$.param({subject:get(this,options,uri,settings,"subject"),body:get(this,options,uri,settings,"body")}).replace(/\+/g,"%20")).append($("<img>",{alt:options.txt_button,src:options.path_prefix+("line"===settings.layout?options.line_img:options.box_img)}))}}}(jQuery),function($){"use strict";function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value?value.call(self,options,uri,settings):String(value)}function loadScript(){$(".social_share_privacy_area .pinterest .pinit a[data-pin-log]").attr("data-pin-do","ignore"),$.ajax({url:"https://assets.pinterest.com/js/pinit.js",dataType:"script",cache:!0}),loadingScript=!1}var loadingScript=!1;$.fn.socialSharePrivacy.settings.services.pinterest={status:!0,button_class:"pinit",dummy_line_img:"images/dummy_pinterest.png",dummy_box_img:"images/dummy_box_pinterest.png",dummy_alt:'"Pin it"-Dummy',txt_info:"Two clicks for more privacy: The Pin it button will be enabled once you click here. Activating the button already sends data to Pinterest &ndash; see <em>i</em>.",txt_off:"not connected to Pinterest",txt_on:"connected to Pinterest",perma_option:!0,display_name:"Pinterest",referrer_track:"",title:$.fn.socialSharePrivacy.getTitle,description:$.fn.socialSharePrivacy.getDescription,media:$.fn.socialSharePrivacy.getImage,button:function(options,uri,settings){var params={url:uri+options.referrer_track,media:get(this,options,uri,settings,"media")},title=get(this,options,uri,settings,"title"),description=get(this,options,uri,settings,"description");title&&(params.title=title),description&&(params.description=description);var $code=$('<a data-pin-do="buttonPin"><img /></a>');return $code.filter("a").attr({"data-pin-config":"line"===settings.layout?"beside":"above",href:"https://pinterest.com/pin/create/button/?"+$.param(params)}).find("img").attr("src","https://assets.pinterest.com/images/pidgets/pin_it_button.png"),loadingScript||(loadingScript=!0,setTimeout(loadScript,10)),$code}}}(jQuery),function($){"use strict";function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value?value.call(self,options,uri,settings):String(value)}$.fn.socialSharePrivacy.settings.services.reddit={status:!0,button_class:"reddit",dummy_line_img:"images/dummy_reddit.png",dummy_box_img:"images/dummy_box_reddit.png",dummy_alt:'"Reddit this!"-Dummy',txt_info:"Two clicks for more privacy: The reddit this! button will be enabled once you click here. Activating the button already sends data to reddit &ndash; see <em>i</em>.",txt_off:"not connected to reddit",txt_on:"connected to reddit",perma_option:!0,display_name:"Reddit",referrer_track:"",title:$.fn.socialSharePrivacy.getTitle,target:"",newwindow:"1",bgcolor:"transparent",bordercolor:"",button:function(options,uri,settings){var base_url,w,layout;"line"===settings.layout?(w=120,layout="/button/button1.html?"):(w=58,layout="/button/button2.html?"),base_url="https://redditstatic.s3.amazonaws.com";var params={url:uri+options.referrer_track,width:String(w)},title=get(this,options,uri,settings,"title"),target=get(this,options,uri,settings,"target");return title&&(params.title=title),target&&(params.target=target),options.bgcolor&&(params.bgcolor=options.bgcolor),options.bordercolor&&(params.bordercolor=options.bordercolor),options.newwindow&&(params.newwindow=options.newwindow),$('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr("src",base_url+layout+$.param(params))}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.stumbleupon={status:!0,button_class:"stumbleupon",dummy_line_img:"images/dummy_stumbleupon.png",dummy_box_img:"images/dummy_box_stumbleupon.png",dummy_alt:'"Stumble!"-Dummy',txt_info:"Two clicks for more privacy: The Stumble! button will be enabled once you click here. Activating the button already sends data to StumbleUpon &ndash; see <em>i</em>.",txt_off:"not connected to StumbleUpon",txt_on:"connected to StumbleUpon",perma_option:!0,display_name:"Stumble Upon",referrer_track:"",button:function(options,uri,settings){var w,h,base_url="https:"===document.location.protocol?"https://":"http://";return"line"===settings.layout?(w="74",h="18",base_url+="badge.stumbleupon.com/badge/embed/1/?"):(w="50",h="60",base_url+="badge.stumbleupon.com/badge/embed/5/?"),$('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr({src:base_url+$.param({url:uri+options.referrer_track}),width:w,height:h})}}}(jQuery),function($){"use strict";function getQuote(){var text=$.trim($("article, p").text());if(text.length<=600)return text;var abbrev=text.slice(0,597);if(/^\w+$/.test(text.slice(596,598))){var match=/^(.*)\s\S*$/.exec(abbrev);match&&(abbrev=match[1])}return $.trim(abbrev)+"…"}function getClickthru(options,uri){return uri+options.referrer_track}function get(self,options,uri,settings,name){var value=options[name];return"function"==typeof value?value.call(self,options,uri,settings):String(value)}function openTumblr(event){var winx=window.screenX||window.screenLeft,winy=window.screenY||window.screenTop,winw=window.outerWidth||window.innerWidth,winh=window.outerHeight||window.innerHeight,width=450,height=430,x=Math.round(winx+.5*(winw-width)),y=Math.round(winy+.5*(winh-height));window.open(this.href,"t","left="+x+",top="+y+",toolbar=0,resizable=0,status=0,menubar=0,width="+width+",height="+height),event.preventDefault()}$.fn.socialSharePrivacy.settings.services.tumblr={status:!0,privacy:"safe",button_class:"tumblr",line_img:"images/tumblr.png",box_img:"images/box_tumblr.png",txt_info:"Post this on Tumblr.",txt_button:"Share on Tubmlr",display_name:"Tumblr",referrer_track:"",type:"link",name:$.fn.socialSharePrivacy.getTitle,description:$.fn.socialSharePrivacy.getDescription,quote:getQuote,photo:$.fn.socialSharePrivacy.getImage,clickthrou:getClickthru,embed:$.fn.socialSharePrivacy.getEmbed,caption:$.fn.socialSharePrivacy.getDescription,button:function(options,uri,settings){var $code=$('<a target="_blank"/>').click(openTumblr);switch($("<img>",{alt:options.txt_button,src:options.path_prefix+("line"===settings.layout?options.line_img:options.box_img)}).appendTo($code),options.type){case"link":return $code.attr("href","https://www.tumblr.com/share/link?"+$.param({url:uri+options.referrer_track,name:get(this,options,uri,settings,"name"),description:get(this,options,uri,settings,"description")}));case"quote":return $code.attr("href","https://www.tumblr.com/share/quote?"+$.param({source:uri+options.referrer_track,quote:get(this,options,uri,settings,"quote")}));case"photo":return $code.attr("href","https://www.tumblr.com/share/photo?"+$.param({source:get(this,options,uri,settings,"photo"),caption:get(this,options,uri,settings,"caption"),clickthrou:get(this,options,uri,settings,"clickthrou")}));case"video":return $code.attr("href","https://www.tumblr.com/share/video?"+$.param({embed:get(this,options,uri,settings,"embed"),caption:get(this,options,uri,settings,"caption")}))}}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.twitter={status:!0,button_class:"tweet",dummy_line_img:"images/dummy_twitter.png",dummy_box_img:"images/dummy_box_twitter.png",dummy_alt:'"Tweet this"-Dummy',txt_info:"Two clicks for more privacy: The Tweet this button will be enabled once you click here. Activating the button already sends data to Twitter &ndash; see <em>i</em>.",txt_off:"not connected to Twitter",txt_on:"connected to Twitter",perma_option:!0,display_name:"Twitter",referrer_track:"",via:"",related:"",hashtags:"",dnt:!0,text:$.fn.socialSharePrivacy.getTitle,button:function(options,uri,settings){var text="function"==typeof options.text?options.text.call(this,options,uri,settings):String(options.text);text=$.fn.socialSharePrivacy.abbreviateText(text,120);var params={url:uri+options.referrer_track,counturl:uri,text:text,count:"line"===settings.layout?"horizontal":"vertical",lang:options.language};return options.via&&(params.via=options.via),options.related&&(params.related=options.related),options.hashtags&&(params.hashtags=options.hashtags),options.dnt&&(params.dnt=options.dnt),$('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr("src","https://platform.twitter.com/widgets/tweet_button.html?"+$.param(params).replace(/\+/g,"%20"))}}}(jQuery),function($){"use strict";$.fn.socialSharePrivacy.settings.services.xing={status:!0,dummy_line_img:"images/dummy_xing.png",dummy_box_img:"images/dummy_box_xing.png",dummy_alt:'"XING"-Dummy',txt_info:"Two clicks for more privacy: The XING button will be enabled once you click here. Activating the button already sends data to XING &ndash; see <em>i</em>.",txt_off:"not connected to XING",txt_on:"connected to XING",perma_option:!0,display_name:"XING",referrer_track:"",button:function(options,uri,settings){var $code=$('<script type="XING/Share"></script>').attr({"data-counter":"line"===settings.layout?"right":"top","data-url":uri+options.referrer_track,"data-lang":options.language});return $code.add("<script type='text/javascript'>(function(d, s) { var x = d.createElement(s); s = d.getElementsByTagName(s)[0]; x.src = 'https://www.xing-share.com/js/external/share.js'; s.parentNode.insertBefore(x, s); })(document, 'script');</script>")}}}(jQuery),jQuery(document).ready(function($){"use strict";$('script[type="application/x-social-share-privacy-settings"]').each(function(){var settings=new Function("return ("+(this.textContent||this.innerText||this.text)+");").call(this);"object"==typeof settings&&$.extend(!0,$.fn.socialSharePrivacy.settings,settings)})});