social-share-kit
Advanced tools
Comparing version 1.0.11 to 1.0.12
{ | ||
"name": "social-share-kit", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"homepage": "http://socialsharekit.com/", | ||
@@ -5,0 +5,0 @@ "authors": [ |
/*! | ||
* Social Share Kit v1.0.11 (http://socialsharekit.com) | ||
* Social Share Kit v1.0.12 (http://socialsharekit.com) | ||
* Copyright 2015 Social Share Kit / Kaspars Sprogis. | ||
@@ -36,3 +36,7 @@ * @Licensed under Creative Commons Attribution-NonCommercial 3.0 license: | ||
} | ||
removeEventListener(el, 'click', onClick); | ||
if(el.getAttribute('data-ssk-ready')) | ||
return; | ||
el.setAttribute('data-ssk-ready', true); | ||
addEventListener(el, 'click', onClick); | ||
@@ -151,9 +155,2 @@ | ||
function removeEventListener(el, eventName, handler) { | ||
if (el.removeEventListener) | ||
el.removeEventListener(eventName, handler); | ||
else | ||
el.detachEvent('on' + eventName, handler); | ||
} | ||
function elSupportsShare(el) { | ||
@@ -160,0 +157,0 @@ return el.className.match(supportsShare); |
/*! | ||
* Social Share Kit v1.0.11 (http://socialsharekit.com) | ||
* Social Share Kit v1.0.12 (http://socialsharekit.com) | ||
* Copyright 2015 Social Share Kit / Kaspars Sprogis. | ||
@@ -8,2 +8,2 @@ * @Licensed under Creative Commons Attribution-NonCommercial 3.0 license: | ||
*/ | ||
var SocialShareKit=function(){function e(e){return k(e).share()}function t(e){"loading"!=document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",function(){"loading"!=document.readyState&&e()})}function n(e){return document.querySelectorAll(e)}function o(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function r(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,function(){n.call(e)})}function i(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function a(e){return e.className.match(y)}function c(e){var t=e||window.event;return t.preventDefault?t.preventDefault():(t.returnValue=!1,t.cancelBubble=!0),t.currentTarget||t.srcElement}function u(e){var t=575,n=400,o=document.documentElement.clientWidth/2-t/2,r=(document.documentElement.clientHeight-n)/2,i="status=1,resizable=yes,width="+t+",height="+n+",top="+r+",left="+o,a=window.open(e,"",i);return a.focus(),a}function s(e,t,n){var o,r=f(e,t,n),i=d(e,t,n,r),a="undefined"!=typeof r.title?r.title:l(t),c="undefined"!=typeof r.text?r.text:p(t),u=r.image?r.image:h("og:image"),s="undefined"!=typeof r.via?r.via:h("twitter:site"),m={shareUrl:i,title:a,text:c,image:u,via:s,options:e,shareUrlEncoded:function(){return encodeURIComponent(this.shareUrl)}};switch(t){case"facebook":o="https://www.facebook.com/share.php?u="+m.shareUrlEncoded();break;case"twitter":o="https://twitter.com/intent/tweet?url="+m.shareUrlEncoded()+"&text="+encodeURIComponent(a+(c&&a?" - ":"")+c),s&&(o+="&via="+s.replace("@",""));break;case"google-plus":o="https://plus.google.com/share?url="+m.shareUrlEncoded();break;case"pinterest":o="https://pinterest.com/pin/create/button/?url="+m.shareUrlEncoded()+"&description="+encodeURIComponent(c),u&&(o+="&media="+encodeURIComponent(u));break;case"tumblr":o="https://www.tumblr.com/share/link?url="+m.shareUrlEncoded()+"&name="+encodeURIComponent(a)+"&description="+encodeURIComponent(c);break;case"linkedin":o="https://www.linkedin.com/shareArticle?mini=true&url="+m.shareUrlEncoded()+"&title="+encodeURIComponent(a)+"&summary="+encodeURIComponent(c);break;case"vk":o="https://vkontakte.ru/share.php?url="+m.shareUrlEncoded();break;case"email":o="mailto:?subject="+encodeURIComponent(a)+"&body="+encodeURIComponent(a+"\n"+i+"\n\n"+c+"\n")}return m.networkUrl=o,e.onBeforeOpen&&e.onBeforeOpen(n,t,m),m.networkUrl}function d(e,t,n,o){return o=o||f(e,t,n),o.url||window.location.href}function l(e){var t;return"twitter"==e&&(t=h("twitter:title")),t||document.title}function p(e){var t;return"twitter"==e&&(t=h("twitter:description")),t||h("description")}function h(e,t){var o,r=n("meta["+(t?t:0===e.indexOf("og:")?"property":"name")+'="'+e+'"]');return r.length&&(o=r[0].getAttribute("content")||""),o||""}function f(e,t,n){var o,r,i,a,c=["url","title","text","image"],u={},s=n.parentNode;"twitter"==t&&c.push("via");for(a in c)r=c[a],i="data-"+r,o=n.getAttribute(i)||s.getAttribute(i)||(e[t]&&"undefined"!=typeof e[t][r]?e[t][r]:e[r]),"undefined"!=typeof o&&(u[r]=o);return u}function m(e,t){var n=document.createElement("div");n.innerHTML=t,n.className="ssk-num",e.appendChild(n)}function w(e,t,n,o){var r,i,a,c=encodeURIComponent(t);switch(e){case"facebook":r="https://graph.facebook.com/?id="+c,i=function(e){return o(e.share?e.share.share_count:0)};break;case"twitter":n&&n.twitter&&n.twitter.countCallback&&n.twitter.countCallback(t,o);break;case"google-plus":return r="https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ",a='[{"method":"pos.plusones.get","id":"p","params":{"id":"'+t+'","userId":"@viewer","groupId":"@self","nolog":true},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]',i=function(e){if(e=JSON.parse(e),e.length)return o(e[0].result.metadata.globalCounts.count)},void v(r,i,a);case"linkedin":r="https://www.linkedin.com/countserv/count/share?url="+c,i=function(e){return o(e.count)};break;case"pinterest":r="https://api.pinterest.com/v1/urls/count.json?url="+c,i=function(e){return o(e.count)};break;case"vk":r="https://vk.com/share.php?act=count&url="+c,i=function(e){return o(e)}}r&&i&&g(e,r,i,a)}function v(e,t,n){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===this.readyState&&this.status>=200&&this.status<400&&t(this.responseText)},o.open("POST",e,!0),o.setRequestHeader("Content-Type","application/json"),o.send(n)}function g(e,t,n){var o="cb_"+e+"_"+Math.round(1e5*Math.random()),r=document.createElement("script");return window[o]=function(e){try{delete window[o]}catch(e){}document.body.removeChild(r),n(e)},"vk"==e?window.VK={Share:{count:function(e,t){window[o](t)}}}:"google-plus"==e&&(window.services={gplus:{cb:window[o]}}),r.src=t+(t.indexOf("?")>=0?"&":"?")+"callback="+o,document.body.appendChild(r),!0}var k,b,y=/(twitter|facebook|google-plus|pinterest|tumblr|vk|linkedin|email)/,C="*|*";return b=function(e){var t=e||{},o=t.selector||".ssk";this.nodes=n(o),this.options=t},b.prototype={share:function(){function e(e){var t,n=c(e),o=a(n),r=o[0];if(o&&(t=s(p,r,n))){if(window.twttr&&n.getAttribute("href").indexOf("twitter.com/intent/")!==-1)return void n.setAttribute("href",t);if("email"!=r){var i=u(t);if(p.onOpen&&p.onOpen(n,r,t,i),p.onClose)var d=window.setInterval(function(){i.closed!==!1&&(window.clearInterval(d),p.onClose(n,r,t,i))},250)}else document.location=t}}function n(){var e,t;for(e in h)t=e.split(C),function(e){w(t[0],t[1],p,function(t){for(var n in e)m(e[n],t)})}(h[e])}var l=this.nodes,p=this.options,h={};return t(function(){l.length&&(o(l,function(t){var n,o=a(t);o&&(i(t,"click",e),r(t,"click",e),t.parentNode.className.indexOf("ssk-count")!==-1&&(o=o[0],n=o+C+d(p,o,t),n in h||(h[n]=[]),h[n].push(t)))}),n())}),this.nodes}},k=function(e){return new b(e)},{init:e}}();window.SocialShareKit=SocialShareKit; | ||
var SocialShareKit=function(){function e(e){return g(e).share()}function t(e){"loading"!=document.readyState?e():document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",function(){"loading"!=document.readyState&&e()})}function n(e){return document.querySelectorAll(e)}function o(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function r(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,function(){n.call(e)})}function i(e){return e.className.match(b)}function a(e){var t=e||window.event;return t.preventDefault?t.preventDefault():(t.returnValue=!1,t.cancelBubble=!0),t.currentTarget||t.srcElement}function c(e){var t=575,n=400,o=document.documentElement.clientWidth/2-t/2,r=(document.documentElement.clientHeight-n)/2,i="status=1,resizable=yes,width="+t+",height="+n+",top="+r+",left="+o,a=window.open(e,"",i);return a.focus(),a}function s(e,t,n){var o,r=h(e,t,n),i=u(e,t,n,r),a="undefined"!=typeof r.title?r.title:d(t),c="undefined"!=typeof r.text?r.text:l(t),s=r.image?r.image:p("og:image"),f="undefined"!=typeof r.via?r.via:p("twitter:site"),m={shareUrl:i,title:a,text:c,image:s,via:f,options:e,shareUrlEncoded:function(){return encodeURIComponent(this.shareUrl)}};switch(t){case"facebook":o="https://www.facebook.com/share.php?u="+m.shareUrlEncoded();break;case"twitter":o="https://twitter.com/intent/tweet?url="+m.shareUrlEncoded()+"&text="+encodeURIComponent(a+(c&&a?" - ":"")+c),f&&(o+="&via="+f.replace("@",""));break;case"google-plus":o="https://plus.google.com/share?url="+m.shareUrlEncoded();break;case"pinterest":o="https://pinterest.com/pin/create/button/?url="+m.shareUrlEncoded()+"&description="+encodeURIComponent(c),s&&(o+="&media="+encodeURIComponent(s));break;case"tumblr":o="https://www.tumblr.com/share/link?url="+m.shareUrlEncoded()+"&name="+encodeURIComponent(a)+"&description="+encodeURIComponent(c);break;case"linkedin":o="https://www.linkedin.com/shareArticle?mini=true&url="+m.shareUrlEncoded()+"&title="+encodeURIComponent(a)+"&summary="+encodeURIComponent(c);break;case"vk":o="https://vkontakte.ru/share.php?url="+m.shareUrlEncoded();break;case"email":o="mailto:?subject="+encodeURIComponent(a)+"&body="+encodeURIComponent(a+"\n"+i+"\n\n"+c+"\n")}return m.networkUrl=o,e.onBeforeOpen&&e.onBeforeOpen(n,t,m),m.networkUrl}function u(e,t,n,o){return o=o||h(e,t,n),o.url||window.location.href}function d(e){var t;return"twitter"==e&&(t=p("twitter:title")),t||document.title}function l(e){var t;return"twitter"==e&&(t=p("twitter:description")),t||p("description")}function p(e,t){var o,r=n("meta["+(t?t:0===e.indexOf("og:")?"property":"name")+'="'+e+'"]');return r.length&&(o=r[0].getAttribute("content")||""),o||""}function h(e,t,n){var o,r,i,a,c=["url","title","text","image"],s={},u=n.parentNode;"twitter"==t&&c.push("via");for(a in c)r=c[a],i="data-"+r,o=n.getAttribute(i)||u.getAttribute(i)||(e[t]&&"undefined"!=typeof e[t][r]?e[t][r]:e[r]),"undefined"!=typeof o&&(s[r]=o);return s}function f(e,t){var n=document.createElement("div");n.innerHTML=t,n.className="ssk-num",e.appendChild(n)}function m(e,t,n,o){var r,i,a,c=encodeURIComponent(t);switch(e){case"facebook":r="https://graph.facebook.com/?id="+c,i=function(e){return o(e.share?e.share.share_count:0)};break;case"twitter":n&&n.twitter&&n.twitter.countCallback&&n.twitter.countCallback(t,o);break;case"google-plus":return r="https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ",a='[{"method":"pos.plusones.get","id":"p","params":{"id":"'+t+'","userId":"@viewer","groupId":"@self","nolog":true},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]',i=function(e){if(e=JSON.parse(e),e.length)return o(e[0].result.metadata.globalCounts.count)},void w(r,i,a);case"linkedin":r="https://www.linkedin.com/countserv/count/share?url="+c,i=function(e){return o(e.count)};break;case"pinterest":r="https://api.pinterest.com/v1/urls/count.json?url="+c,i=function(e){return o(e.count)};break;case"vk":r="https://vk.com/share.php?act=count&url="+c,i=function(e){return o(e)}}r&&i&&v(e,r,i,a)}function w(e,t,n){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===this.readyState&&this.status>=200&&this.status<400&&t(this.responseText)},o.open("POST",e,!0),o.setRequestHeader("Content-Type","application/json"),o.send(n)}function v(e,t,n){var o="cb_"+e+"_"+Math.round(1e5*Math.random()),r=document.createElement("script");return window[o]=function(e){try{delete window[o]}catch(e){}document.body.removeChild(r),n(e)},"vk"==e?window.VK={Share:{count:function(e,t){window[o](t)}}}:"google-plus"==e&&(window.services={gplus:{cb:window[o]}}),r.src=t+(t.indexOf("?")>=0?"&":"?")+"callback="+o,document.body.appendChild(r),!0}var g,k,b=/(twitter|facebook|google-plus|pinterest|tumblr|vk|linkedin|email)/,y="*|*";return k=function(e){var t=e||{},o=t.selector||".ssk";this.nodes=n(o),this.options=t},k.prototype={share:function(){function e(e){var t,n=a(e),o=i(n),r=o[0];if(o&&(t=s(l,r,n))){if(window.twttr&&n.getAttribute("href").indexOf("twitter.com/intent/")!==-1)return void n.setAttribute("href",t);if("email"!=r){var u=c(t);if(l.onOpen&&l.onOpen(n,r,t,u),l.onClose)var d=window.setInterval(function(){u.closed!==!1&&(window.clearInterval(d),l.onClose(n,r,t,u))},250)}else document.location=t}}function n(){var e,t;for(e in p)t=e.split(y),function(e){m(t[0],t[1],l,function(t){for(var n in e)f(e[n],t)})}(p[e])}var d=this.nodes,l=this.options,p={};return t(function(){d.length&&(o(d,function(t){var n,o=i(t);o&&(t.getAttribute("data-ssk-ready")||(t.setAttribute("data-ssk-ready",!0),r(t,"click",e),t.parentNode.className.indexOf("ssk-count")!==-1&&(o=o[0],n=o+y+u(l,o,t),n in p||(p[n]=[]),p[n].push(t))))}),n())}),this.nodes}},g=function(e){return new k(e)},{init:e}}();window.SocialShareKit=SocialShareKit; |
{ | ||
"name": "social-share-kit", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Library of decent and good looking CSS/JavaScript social sharing icons, buttons and popups", | ||
@@ -5,0 +5,0 @@ "main": "dist/js/social-share-kit.min.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170262
422