goodshare.js
Advanced tools
Comparing version 6.2.1 to 6.3.0
@@ -5,2 +5,6 @@ # Change log | ||
- `6.3.0`: Add `copy to clipboard` provider and update deps | ||
- `6.2.1`: Update non-secure packages (thanks to GitHub Security bot) | ||
- `6.2.0`: Update dependencies | ||
- `6.1.5`: Fix WhatsApp API #79 + Update deps | ||
- `6.1.4`: pushed to master only if limit `80 ms` is passed, switch docs to [js.org](https://js.org). | ||
@@ -7,0 +11,0 @@ - `6.1.3`: pushed to master only if limit `140 ms` is passed. |
@@ -19,2 +19,5 @@ # Basic usage | ||
<i class="icon-tumblr" data-social="tumblr"></i> | ||
<!-- Create button with copy share url to clipboard --> | ||
<button data-social="copy-to-clipboard">Copy to clipboard</button> | ||
``` | ||
@@ -31,2 +34,2 @@ | ||
</head> | ||
``` | ||
``` |
@@ -1,73 +0,78 @@ | ||
'use strict';(function(){function h(c,b){if(!(c instanceof b))throw new TypeError("Cannot call a class as a function");}function v(c,b){for(var e=0;e<b.length;e++){var a=b[e];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(c,a.key,a)}}function f(c,b,e){b&&v(c.prototype,b);e&&v(c,e);return c}function l(c,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(b&&b.prototype, | ||
{constructor:{value:c,writable:!0,configurable:!0}});b&&r(c,b)}function q(c){q=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)};return q(c)}function r(c,b){r=Object.setPrototypeOf||function(b,a){b.__proto__=a;return b};return r(c,b)}function w(){if("undefined"===typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})), | ||
!0}catch(c){return!1}}function k(c){if(void 0===c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function m(c){var b=w();return function(){var e=q(c);if(b){var a=q(this).constructor;e=Reflect.construct(e,arguments,a)}else e=e.apply(this,arguments);e=!e||"object"!==typeof e&&"function"!==typeof e?k(this):e;return e}}function p(c){var b=Array.isArray(c)?t(c):void 0;b||(b="undefined"!==typeof Symbol&&null!=c[Symbol.iterator]||null!=c["@@iterator"]?Array.from(c): | ||
void 0);if(!b)a:{if(c){if("string"===typeof c){b=t(c,void 0);break a}b=Object.prototype.toString.call(c).slice(8,-1);"Object"===b&&c.constructor&&(b=c.constructor.name);if("Map"===b||"Set"===b){b=Array.from(c);break a}if("Arguments"===b||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)){b=t(c,void 0);break a}}b=void 0}if(!(c=b))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return c}function t(c, | ||
b){if(null==b||b>c.length)b=c.length;for(var e=0,a=Array(b);e<b;e++)a[e]=c[e];return a}var x=function(){function c(){h(this,c);this.handlers={}}f(c,[{key:"addEventListener",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"click";this.handlers[c]={func:2<arguments.length?arguments[2]:void 0,target:b};var a=c.split(".")[0];b.addEventListener(a,this.handlers[c].func)}},{key:"removeEventListener",value:function(){var b= | ||
0<arguments.length&&void 0!==arguments[0]?arguments[0]:"click",c=b.split(".")[0],a=this.handlers[b];a.target.removeEventListener(c,a.func);delete this.handlers[b]}},{key:"removeAll",value:function(){for(var b in this.handlers)this.removeEventListener(b)}}]);return c}(),y=function(){return"".concat(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"id","-").concat(Math.random().toString(36).substr(2,8))},g=function(){function c(){h(this,c);this.events=new x;this.callback=function(){};this.updateInstanceId()} | ||
f(c,[{key:"eventHandler",value:function(b,c){var a=this,n=c.share_url,d=c.windowTitle,e=c.windowWidth,h=c.windowHeight;b.preventDefault();c=Math.round((window.outerHeight||window.document.documentElement.offsetHeight)/2-h/2);var f=Math.round((window.outerWidth||window.document.documentElement.offsetWidth)/2-e/2);e="width=".concat(e,",height=").concat(h);c="left=".concat(f,",top=").concat(c);var g="".concat(e,",").concat(c,",location=no,toolbar=no,menubar=no"),k=window.open(n,d,g),l=setInterval(function(){k.closed&& | ||
(a.callback(b,{share_url:n,windowTitle:d,windowOptions:g},k),clearInterval(l))},10);return k}},{key:"setShareCallback",value:function(b){this.callback=b}},{key:"createEvents",value:function(b){var c=this;p(b).forEach(function(a){var b=c.getPreparedData(a);c.events.addEventListener(a,"click.".concat(c.instanceId),function(a){return c.eventHandler.call(c,a,b)})})}},{key:"getInstance",value:function(){"function"===typeof this.shareWindow&&this.shareWindow();"function"===typeof this.getCounter&&this.getCounter(); | ||
return this}},{key:"updateInstanceId",value:function(){this.instanceId=y()}},{key:"reNewInstance",value:function(){this.events.removeAll();this.updateInstanceId();return this.getInstance()}}]);return c}(),u=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('link[rel="apple-touch-icon"]');h(this, | ||
b);var c=e.call(this);c.url=encodeURIComponent(a);c.title=encodeURIComponent(n);c.image=d?encodeURIComponent(d.href):"";c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;b="https://vk.com/share.php?url=".concat(b,"&title=").concat(d,"&image=").concat(a); | ||
return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="vkontakte"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),b=document.querySelectorAll('[data-counter="vkontakte"]'),d="https://vk.com/share.php?act=count&index=1&url=".concat(this.url);window.VK=Object.assign({},{Share:{}},window.VK);0<b.length&&(window.VK.Share.count= | ||
function(n,d){p(b).forEach(function(a){a.innerHTML=d});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=d,document.body.appendChild(a))}}]);return b}(g),z=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(n);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b, | ||
[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://facebook.com/sharer/sharer.php?u=".concat(b,"&t=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="facebook"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a= | ||
document.createElement("script"),b=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="facebook"]'),c="https://graph.facebook.com/?id=".concat(this.url,"&callback=").concat(b);0<d.length&&(window[b]=function(b){p(d).forEach(function(a){a.innerHTML=b.share?b.share.share_count:0});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=c,document.body.appendChild(a))}}]);return b}(g),A=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]: | ||
document.location.href,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(n);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://connect.ok.ru/offer?url=".concat(b,"&title=").concat(a);return{callback:this.callback, | ||
share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="odnoklassniki"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),b=document.querySelectorAll('[data-counter="odnoklassniki"]'),d="https://connect.ok.ru/dk?st.cmd=extLike&uid=1&ref=".concat(this.url);window.ODKL={};0<b.length&&(window.ODKL.updateCount=function(n,d){p(b).forEach(function(a){a.innerHTML= | ||
d});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=d,document.body.appendChild(a))}}]);return b}(g),B=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]'),c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:document.querySelector('link[rel="apple-touch-icon"]'); | ||
h(this,b);var f=e.call(this);f.url=encodeURIComponent(a);f.title=encodeURIComponent(n);f.description=d?encodeURIComponent(d.content):"";f.image=c?encodeURIComponent(c.href):"";f.createEvents=f.createEvents.bind(k(f));return f}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title,c=a.dataset.description?encodeURIComponent(a.dataset.description):this.description; | ||
a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;b="https://connect.mail.ru/share?url=".concat(b,"&title=").concat(d,"&description=").concat(c,"&imageurl=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="moimir"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),b=encodeURIComponent(this.url.replace(/^.*?:\/\//, | ||
"")),d=("goodshare_"+Math.random()).replace(".",""),c=document.querySelectorAll('[data-counter="moimir"]');0<c.length&&(window[d]=function(b){p(c).forEach(function(a){a.innerHTML=b.share_mm});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src="https://appsmail.ru/share/count/"+b+"?callback="+d,document.body.appendChild(a))}}]);return b}(g),C=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,n=1<arguments.length&&void 0!==arguments[1]? | ||
arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.title=encodeURIComponent(n);c.description=d?encodeURIComponent(d.content):"";c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;b="https://www.tumblr.com/widgets/share/tool?canonicalUrl=".concat(b,"&title=").concat(d,"&caption=").concat(a,"&posttype=link");return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="tumblr"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"), | ||
b=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="tumblr"]'),c="https://api.tumblr.com/v2/share/stats?url=".concat(this.url,"&callback=").concat(b);0<d.length&&(window[b]=function(b){p(d).forEach(function(a){a.innerHTML=b.response.note_count});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=c,document.body.appendChild(a))}}]);return b}(g),D=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href, | ||
n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.querySelector('meta[name="description"]'),d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('link[rel="apple-touch-icon"]');h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.description=n?encodeURIComponent(n.content):"";c.image=d?encodeURIComponent(d.href):"";c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url): | ||
this.url,c=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;b="https://www.pinterest.com/pin/create/button/?url=".concat(b,"&description=").concat(c,"&media=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="pinterest"]');return this.createEvents(a)}},{key:"getCounter", | ||
value:function(){var a=document.createElement("script"),b=("goodshare_"+Math.random()).replace(".",""),c=document.querySelectorAll('[data-counter="pinterest"]'),e="https://api.pinterest.com/v1/urls/count.json?url=".concat(this.url,"&callback=").concat(b);0<c.length&&(window[b]=function(b){p(c).forEach(function(a){a.innerHTML=0<b.length?b.count:0});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=e,document.body.appendChild(a))}}]);return b}(g),E=function(c){function b(){var a=0<arguments.length&& | ||
void 0!==arguments[0]?arguments[0]:document.location.href,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.title=encodeURIComponent(n);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://reddit.com/submit?url=".concat(b, | ||
"&title=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="reddit"]');return this.createEvents(a)}}]);return b}(g),F=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a); | ||
d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://buffer.com/add?url=".concat(b,"&text=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="buffer"]'); | ||
return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),b=("goodshare_"+Math.random()).replace(".",""),c=document.querySelectorAll('[data-counter="buffer"]'),e="https://api.bufferapp.com/1/links/shares.json?url=".concat(this.url,"&callback=").concat(b);0<c.length&&(window[b]=function(b){p(c).forEach(function(a){a.innerHTML=b?b.shares:0});a.parentNode.removeChild(a)},a.src=e,document.body.appendChild(a))}}]);return b}(g),G=function(c){function b(){var a= | ||
0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://twitter.com/share?url=".concat(b, | ||
"&text=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="twitter"]');return this.createEvents(a)}}]);return b}(g),H=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a); | ||
d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://livejournal.com/update.bml?event=".concat(b,"&subject=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="livejournal"]'); | ||
return this.createEvents(a)}}]);return b}(g),I=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');h(this,b);var f=e.call(this);f.url=encodeURIComponent(a);f.title=encodeURIComponent(c);f.description=d?encodeURIComponent(d.content):"";f.createEvents=f.createEvents.bind(k(f)); | ||
return f}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,c=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;b="https://www.linkedin.com/shareArticle?url=".concat(b,"&text=").concat(c,"&summary=").concat(a,"&mini=true");return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow", | ||
value:function(){var a=document.querySelectorAll('[data-social="linkedin"]');return this.createEvents(a)}}]);return b}(g),J=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');h(this,b);var f=e.call(this);f.url=encodeURIComponent(a);f.title=encodeURIComponent(c);f.description= | ||
d?encodeURIComponent(d.content):"";f.createEvents=f.createEvents.bind(k(f));return f}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,c=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;b="https://www.evernote.com/clip.action?url=".concat(b,"&title=").concat(c,"&body=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this", | ||
windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="evernote"]');return this.createEvents(a)}}]);return b}(g),K=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b, | ||
c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://del.icio.us/save?url=".concat(b,"&title=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="delicious"]');return this.createEvents(a)}}]);return b}(g),L=function(c){function b(){var a= | ||
0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://share.flipboard.com/bookmarklet/popout?ext=sharethis&title=".concat(a, | ||
"&url=").concat(b,"&v=2");return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="flipboard"]');return this.createEvents(a)}}]);return b}(g),M=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e= | ||
m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://mix.com/mixit?su=submit&url=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="mix"]');return this.createEvents(a)}}]);return b}(g),N=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href; | ||
h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://www.meneame.net/submit?url=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="meneame"]');return this.createEvents(a)}}]); | ||
return b}(g),O=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;b="https://www.blogger.com/blog-this.g?u=".concat(b,"&n=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="blogger"]');return this.createEvents(a)}}]);return b}(g),P=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title; | ||
h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://getpocket.com/save?url=".concat(b,"&title=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow", | ||
value:function(){var a=document.querySelectorAll('[data-social="pocket"]');return this.createEvents(a)}}]);return b}(g),Q=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b= | ||
a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://www.instapaper.com/edit?url=".concat(b,"&title=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="instapaper"]');return this.createEvents(a)}}]);return b}(g),R=function(c){function b(){var a=0<arguments.length&&void 0!== | ||
arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://digg.com/submit?url=".concat(b,"&title=").concat(a); | ||
return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="digg"]');return this.createEvents(a)}}]);return b}(g),S=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c); | ||
d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="http://www.liveinternet.ru/journal_post.php?action=n_add&cnurl=".concat(b,"&cntitle=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="liveinternet"]'); | ||
return this.createEvents(a)}}]);return b}(g),T=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');h(this,b);var f=e.call(this);f.url=encodeURIComponent(a);f.title=encodeURIComponent(c);f.description=d?encodeURIComponent(d.content):"";f.createEvents=f.createEvents.bind(k(f)); | ||
return f}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,c=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;b="https://surfingbird.ru/share?url=".concat(b,"&title=").concat(c,"&description=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a= | ||
document.querySelectorAll('[data-social="surfingbird"]');return this.createEvents(a)}}]);return b}(g),U=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://www.xing.com/spi/shares/new?url=".concat(a);return{callback:this.callback, | ||
share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="xing"]');return this.createEvents(a)}}]);return b}(g),V=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]'), | ||
f=3<arguments.length&&void 0!==arguments[3]?arguments[3]:document.querySelector('link[rel="apple-touch-icon"]');h(this,b);var g=e.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.image=f?encodeURIComponent(f.href):"";g.createEvents=g.createEvents.bind(k(g));return g}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,c=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title,e=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;b="https://wordpress.com/wp-admin/press-this.php?u=".concat(b,"&t=").concat(c,"&s=").concat(e,"&i=").concat(a,"&v=2");return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="wordpress"]');return this.createEvents(a)}}]); | ||
return b}(g),W=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');h(this,b);var f=e.call(this);f.url=encodeURIComponent(a);f.title=encodeURIComponent(c);f.description=d?encodeURIComponent(d.content):"";f.createEvents=f.createEvents.bind(k(f));return f}l(b,c);var e= | ||
m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,c=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;b="https://cang.baidu.com/do/add?iu=".concat(b,"&it=").concat(c,"&dc=").concat(a,"&fr=ien");return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="baidu"]'); | ||
return this.createEvents(a)}}]);return b}(g),X=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title? | ||
encodeURIComponent(a.dataset.title):this.title;b="http://share.renren.com/share/buttonshare.do?url=".concat(b,"&title=").concat(a);return{callback:this.callback,share_url:b,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="renren"]');return this.createEvents(a)}}]);return b}(g),Y=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&& | ||
void 0!==arguments[1]?arguments[1]:document.title;h(this,b);var d=e.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(k(d));return d}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;b="https://service.weibo.com/share/share.php?url=".concat(b,"&title=").concat(a);return{callback:this.callback,share_url:b, | ||
windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="weibo"]');return this.createEvents(a)}}]);return b}(g),Z=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url): | ||
this.url;a="sms:?&body=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="sms"]');return this.createEvents(a)}}]);return b}(g),aa=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e= | ||
m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://web.skype.com/share?".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="skype"]');return this.createEvents(a)}}]);return b}(g),ba=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href; | ||
h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){var b=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.rhash?a.dataset.rhash:null;var c="https://t.me/share/url?url=".concat(b);null!==a&&(c="https://t.me/iv?url=".concat(b,"&rhash=").concat(a));return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow", | ||
value:function(){var a=document.querySelectorAll('[data-social="telegram"]');return this.createEvents(a)}}]);return b}(g),ca=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="viber://forward?text=".concat(a);return{callback:this.callback, | ||
share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="viber"]');return this.createEvents(a)}}]);return b}(g),da=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url? | ||
encodeURIComponent(a.dataset.url):this.url;a="https://api.whatsapp.com/send?text=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="whatsapp"]');return this.createEvents(a)}}]);return b}(g),ea=function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a); | ||
c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://chart.apis.google.com/chart?cht=qr&chs=196x196&chld=Q%7C0&chl=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="wechat"]');return this.createEvents(a)}}]);return b}(g);g= | ||
function(c){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;h(this,b);var c=e.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(k(c));return c}l(b,c);var e=m(b);f(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="line://msg/text/".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a= | ||
document.querySelectorAll('[data-social="line"]');return this.createEvents(a)}}]);return b}(g);var fa=[u,z,A,B,I,C,D,E,F,G,H,J,K,L,P,M,N,O,Q,R,S,T,U,V,W,X,Y,Z,aa,ba,ca,da,ea,g];u=function(){function c(){h(this,c);this.providers=fa;this.getProviders()}f(c,[{key:"setShareCallback",value:function(b){this.providers=this.providers.map(function(c){return c.setShareCallback(b)})}},{key:"getProviders",value:function(){return this.providers=this.providers.map(function(b){return(new b).getInstance()})}},{key:"reNewAllInstance", | ||
value:function(){this.providers=this.providers.map(function(b){return b.reNewInstance()})}}]);return c}();window._goodshare=new u})() | ||
'use strict';(function(){function k(e,b){if(!(e instanceof b))throw new TypeError("Cannot call a class as a function");}function z(e,b){for(var f=0;f<b.length;f++){var a=b[f];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);var c=Object,d=c.defineProperty;a:{var g=a.key;if("object"===typeof g&&null!==g){var h=g[Symbol.toPrimitive];if(void 0!==h){g=h.call(g,"string");if("object"!==typeof g)break a;throw new TypeError("@@toPrimitive must return a primitive value.");}g=String(g)}}d.call(c, | ||
e,"symbol"===typeof g?g:String(g),a)}}function l(e,b,f){b&&z(e.prototype,b);f&&z(e,f);Object.defineProperty(e,"prototype",{writable:!1});return e}function p(e,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(b&&b.prototype,{constructor:{value:e,writable:!0,configurable:!0}});Object.defineProperty(e,"prototype",{writable:!1});b&&v(e,b)}function u(e){u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__|| | ||
Object.getPrototypeOf(b)};return u(e)}function v(e,b){v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,a){f.__proto__=a;return f};return v(e,b)}function B(){if("undefined"===typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
return e}function q(e){var b=B();return function(){var f=u(e);if(b){var a=u(this).constructor;f=Reflect.construct(f,arguments,a)}else f=f.apply(this,arguments);if(!f||"object"!==typeof f&&"function"!==typeof f){if(void 0!==f)throw new TypeError("Derived constructors may only return object or undefined");f=n(this)}return f}}function t(e){var b=Array.isArray(e)?w(e):void 0;b||(b="undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"]?Array.from(e):void 0);if(!b)a:{if(e){if("string"=== | ||
typeof e){b=w(e,void 0);break a}b=Object.prototype.toString.call(e).slice(8,-1);"Object"===b&&e.constructor&&(b=e.constructor.name);if("Map"===b||"Set"===b){b=Array.from(e);break a}if("Arguments"===b||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)){b=w(e,void 0);break a}}b=void 0}if(!(e=b))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return e}function w(e,b){if(null==b||b>e.length)b= | ||
e.length;for(var f=0,a=Array(b);f<b;f++)a[f]=e[f];return a}var C=function(){function e(){k(this,e);this.handlers={}}l(e,[{key:"addEventListener",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"click";this.handlers[f]={func:2<arguments.length?arguments[2]:void 0,target:b};var a=f.split(".")[0];b.addEventListener(a,this.handlers[f].func)}},{key:"removeEventListener",value:function(){var b=0<arguments.length&& | ||
void 0!==arguments[0]?arguments[0]:"click",f=b.split(".")[0],a=this.handlers[b];a.target.removeEventListener(f,a.func);delete this.handlers[b]}},{key:"removeAll",value:function(){for(var b in this.handlers)this.removeEventListener(b)}}]);return e}(),D=function(){return"".concat(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"id","-").concat(Math.random().toString(36).substr(2,8))},m=function(){function e(){k(this,e);this.events=new C;this.callback=function(){};this.updateInstanceId()}l(e, | ||
[{key:"eventHandler",value:function(b,f){var a=this,c=f.share_url,d=f.windowTitle,g=f.windowWidth,h=f.windowHeight;b.preventDefault();f=Math.round((window.outerHeight||window.document.documentElement.offsetHeight)/2-h/2);var r=Math.round((window.outerWidth||window.document.documentElement.offsetWidth)/2-g/2);g="width=".concat(g,",height=").concat(h);f="left=".concat(r,",top=").concat(f);var A="".concat(g,",").concat(f,",location=no,toolbar=no,menubar=no"),x=window.open(c,d,A),E=setInterval(function(){x.closed&& | ||
(a.callback(b,{share_url:c,windowTitle:d,windowOptions:A},x),clearInterval(E))},10);return x}},{key:"setShareCallback",value:function(b){this.callback=b}},{key:"createEvents",value:function(b){var f=this;t(b).forEach(function(a){var c=f.getPreparedData(a);f.events.addEventListener(a,"click.".concat(f.instanceId),function(d){return f.eventHandler.call(f,d,c)})})}},{key:"getInstance",value:function(){"function"===typeof this.shareWindow&&this.shareWindow();"function"===typeof this.getCounter&&this.getCounter(); | ||
return this}},{key:"updateInstanceId",value:function(){this.instanceId=D()}},{key:"reNewInstance",value:function(){this.events.removeAll();this.updateInstanceId();return this.getInstance()}}]);return e}(),y=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('link[rel="apple-touch-icon"]');k(this, | ||
b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.image=d?encodeURIComponent(d.href):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;c="https://vk.com/share.php?url=".concat(c,"&title=").concat(d,"&image=").concat(a); | ||
return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="vkontakte"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),c=document.querySelectorAll('[data-counter="vkontakte"]'),d="https://vk.com/share.php?act=count&index=1&url=".concat(this.url);window.VK=Object.assign({},{Share:{}},window.VK);0<c.length&&(window.VK.Share.count= | ||
function(g,h){t(c).forEach(function(r){r.innerHTML=h});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=d,document.body.appendChild(a))}}]);return b}(m),F=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b, | ||
[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://facebook.com/sharer/sharer.php?u=".concat(c,"&t=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="facebook"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a= | ||
document.createElement("script"),c=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="facebook"]'),g="https://graph.facebook.com/?id=".concat(this.url,"&callback=").concat(c);0<d.length&&(window[c]=function(h){t(d).forEach(function(r){r.innerHTML=h.share?h.share.share_count:0});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=g,document.body.appendChild(a))}}]);return b}(m),G=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]: | ||
document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://connect.ok.ru/offer?url=".concat(c,"&title=").concat(a);return{callback:this.callback, | ||
share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="odnoklassniki"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),c=document.querySelectorAll('[data-counter="odnoklassniki"]'),d="https://connect.ok.ru/dk?st.cmd=extLike&uid=1&ref=".concat(this.url);window.ODKL={};0<c.length&&(window.ODKL.updateCount=function(g,h){t(c).forEach(function(r){r.innerHTML= | ||
h});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=d,document.body.appendChild(a))}}]);return b}(m),H=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]'),g=3<arguments.length&&void 0!==arguments[3]?arguments[3]:document.querySelector('link[rel="apple-touch-icon"]'); | ||
k(this,b);var h=f.call(this);h.url=encodeURIComponent(a);h.title=encodeURIComponent(c);h.description=d?encodeURIComponent(d.content):"";h.image=g?encodeURIComponent(g.href):"";h.createEvents=h.createEvents.bind(n(h));return h}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title,g=a.dataset.description?encodeURIComponent(a.dataset.description):this.description; | ||
a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;c="https://connect.mail.ru/share?url=".concat(c,"&title=").concat(d,"&description=").concat(g,"&imageurl=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="moimir"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),c=encodeURIComponent(this.url.replace(/^.*?:\/\//, | ||
"")),d=("goodshare_"+Math.random()).replace(".",""),g=document.querySelectorAll('[data-counter="moimir"]');0<g.length&&(window[d]=function(h){t(g).forEach(function(r){r.innerHTML=h.share_mm});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src="https://appsmail.ru/share/count/"+c+"?callback="+d,document.body.appendChild(a))}}]);return b}(m),I=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]? | ||
arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;c="https://www.tumblr.com/widgets/share/tool?canonicalUrl=".concat(c,"&title=").concat(d,"&caption=").concat(a,"&posttype=link");return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="tumblr"]');return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"), | ||
c=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="tumblr"]'),g="https://api.tumblr.com/v2/share/stats?url=".concat(this.url,"&callback=").concat(c);0<d.length&&(window[c]=function(h){t(d).forEach(function(r){r.innerHTML=h.response.note_count});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=g,document.body.appendChild(a))}}]);return b}(m),J=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href, | ||
c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.querySelector('meta[name="description"]'),d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('link[rel="apple-touch-icon"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.description=c?encodeURIComponent(c.content):"";g.image=d?encodeURIComponent(d.href):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url): | ||
this.url,d=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image;c="https://www.pinterest.com/pin/create/button/?url=".concat(c,"&description=").concat(d,"&media=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="pinterest"]');return this.createEvents(a)}},{key:"getCounter", | ||
value:function(){var a=document.createElement("script"),c=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="pinterest"]'),g="https://api.pinterest.com/v1/urls/count.json?url=".concat(this.url,"&callback=").concat(c);0<d.length&&(window[c]=function(h){t(d).forEach(function(r){r.innerHTML=0<h.length?h.count:0});null!==a.parentNode&&a.parentNode.removeChild(a)},a.src=g,document.body.appendChild(a))}}]);return b}(m),K=function(e){function b(){var a=0<arguments.length&& | ||
void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://reddit.com/submit?url=".concat(c, | ||
"&title=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="reddit"]');return this.createEvents(a)}}]);return b}(m),L=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a); | ||
d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://buffer.com/add?url=".concat(c,"&text=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="buffer"]'); | ||
return this.createEvents(a)}},{key:"getCounter",value:function(){var a=document.createElement("script"),c=("goodshare_"+Math.random()).replace(".",""),d=document.querySelectorAll('[data-counter="buffer"]'),g="https://api.bufferapp.com/1/links/shares.json?url=".concat(this.url,"&callback=").concat(c);0<d.length&&(window[c]=function(h){t(d).forEach(function(r){r.innerHTML=h?h.shares:0});a.parentNode.removeChild(a)},a.src=g,document.body.appendChild(a))}}]);return b}(m),M=function(e){function b(){var a= | ||
0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.hashtags=encodeURIComponent(d);g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url, | ||
d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.hashtags?encodeURIComponent(a.dataset.hashtags):this.hashtags;c="https://twitter.com/share?url=".concat(c,"&text=").concat(d,"&hashtags=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="twitter"]');return this.createEvents(a)}}]);return b}(m),N=function(e){function b(){var a= | ||
0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://livejournal.com/update.bml?event=".concat(c, | ||
"&subject=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="livejournal"]');return this.createEvents(a)}}]);return b}(m),O=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]: | ||
document.querySelector('meta[name="description"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description; | ||
c="https://www.linkedin.com/shareArticle?url=".concat(c,"&text=").concat(d,"&summary=").concat(a,"&mini=true");return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="linkedin"]');return this.createEvents(a)}}]);return b}(m),P=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]? | ||
arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;c="https://www.evernote.com/clip.action?url=".concat(c,"&title=").concat(d,"&body=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="evernote"]');return this.createEvents(a)}}]);return b}(m),Q=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]? | ||
arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://del.icio.us/save?url=".concat(c,"&title=").concat(a); | ||
return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="delicious"]');return this.createEvents(a)}}]);return b}(m),R=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c); | ||
d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://share.flipboard.com/bookmarklet/popout?ext=sharethis&title=".concat(a,"&url=").concat(c,"&v=2");return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="flipboard"]'); | ||
return this.createEvents(a)}}]);return b}(m),S=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://mix.com/mixit?su=submit&url=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this", | ||
windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="mix"]');return this.createEvents(a)}}]);return b}(m),T=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url): | ||
this.url;a="https://www.meneame.net/submit?url=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="meneame"]');return this.createEvents(a)}}]);return b}(m),U=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d= | ||
f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://www.blogger.com/blog-this.g?u=".concat(c,"&n=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow", | ||
value:function(){var a=document.querySelectorAll('[data-social="blogger"]');return this.createEvents(a)}}]);return b}(m),V=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c= | ||
a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://getpocket.com/save?url=".concat(c,"&title=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="pocket"]');return this.createEvents(a)}}]);return b}(m),W=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]? | ||
arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://www.instapaper.com/edit?url=".concat(c,"&title=").concat(a); | ||
return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="instapaper"]');return this.createEvents(a)}}]);return b}(m),X=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c); | ||
d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://digg.com/submit?url=".concat(c,"&title=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="digg"]');return this.createEvents(a)}}]); | ||
return b}(m),Y=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;c="http://www.liveinternet.ru/journal_post.php?action=n_add&cnurl=".concat(c,"&cntitle=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="liveinternet"]');return this.createEvents(a)}}]);return b}(m),Z=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!== | ||
arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;c="https://surfingbird.ru/share?url=".concat(c,"&title=").concat(d,"&description=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="surfingbird"]');return this.createEvents(a)}}]);return b}(m),aa=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]? | ||
arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://www.xing.com/spi/shares/new?url=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="xing"]'); | ||
return this.createEvents(a)}}]);return b}(m),ba=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]'),g=3<arguments.length&&void 0!==arguments[3]?arguments[3]:document.querySelector('link[rel="apple-touch-icon"]');k(this,b);var h=f.call(this);h.url=encodeURIComponent(a); | ||
h.title=encodeURIComponent(c);h.description=d?encodeURIComponent(d.content):"";h.image=g?encodeURIComponent(g.href):"";h.createEvents=h.createEvents.bind(n(h));return h}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title):this.title,g=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;a=a.dataset.image?encodeURIComponent(a.dataset.image):this.image; | ||
c="https://wordpress.com/wp-admin/press-this.php?u=".concat(c,"&t=").concat(d,"&s=").concat(g,"&i=").concat(a,"&v=2");return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="wordpress"]');return this.createEvents(a)}}]);return b}(m),ca=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!== | ||
arguments[1]?arguments[1]:document.title,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.querySelector('meta[name="description"]');k(this,b);var g=f.call(this);g.url=encodeURIComponent(a);g.title=encodeURIComponent(c);g.description=d?encodeURIComponent(d.content):"";g.createEvents=g.createEvents.bind(n(g));return g}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url,d=a.dataset.title?encodeURIComponent(a.dataset.title): | ||
this.title;a=a.dataset.description?encodeURIComponent(a.dataset.description):this.description;c="https://cang.baidu.com/do/add?iu=".concat(c,"&it=").concat(d,"&dc=").concat(a,"&fr=ien");return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="baidu"]');return this.createEvents(a)}}]);return b}(m),da=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]? | ||
arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="http://share.renren.com/share/buttonshare.do?url=".concat(c,"&title=").concat(a); | ||
return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="renren"]');return this.createEvents(a)}}]);return b}(m),ea=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c); | ||
d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://service.weibo.com/share/share.php?url=".concat(c,"&title=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="weibo"]'); | ||
return this.createEvents(a)}}]);return b}(m),fa=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="sms:?&body=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}}, | ||
{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="sms"]');return this.createEvents(a)}}]);return b}(m),ha=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.title;k(this,b);var d=f.call(this);d.url=encodeURIComponent(a);d.title=encodeURIComponent(c);d.createEvents=d.createEvents.bind(n(d));return d}p(b,e);var f=q(b);l(b,[{key:"getPreparedData", | ||
value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.title?encodeURIComponent(a.dataset.title):this.title;c="https://web.skype.com/share?url=".concat(c,"&text=").concat(a);return{callback:this.callback,share_url:c,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="skype"]');return this.createEvents(a)}}]);return b}(m),ia=function(e){function b(){var a=0<arguments.length&& | ||
void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){var c=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a=a.dataset.rhash?a.dataset.rhash:null;var d="https://t.me/share/url?url=".concat(c);null!==a&&(d="https://t.me/iv?url=".concat(c,"&rhash=").concat(a));return{callback:this.callback,share_url:d,windowTitle:"Share this", | ||
windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="telegram"]');return this.createEvents(a)}}]);return b}(m),ja=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url): | ||
this.url;a="viber://forward?text=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="viber"]');return this.createEvents(a)}}]);return b}(m),ka=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c} | ||
p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://api.whatsapp.com/send?text=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="whatsapp"]');return this.createEvents(a)}}]);return b}(m),la=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]: | ||
document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="https://chart.apis.google.com/chart?cht=qr&chs=196x196&chld=Q%7C0&chl=".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640,windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="wechat"]'); | ||
return this.createEvents(a)}}]);return b}(m),ma=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=encodeURIComponent(a);c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){a=a.dataset.url?encodeURIComponent(a.dataset.url):this.url;a="line://msg/text/".concat(a);return{callback:this.callback,share_url:a,windowTitle:"Share this",windowWidth:640, | ||
windowHeight:480}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="line"]');return this.createEvents(a)}}]);return b}(m);m=function(e){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.location.href;k(this,b);var c=f.call(this);c.url=a;c.createEvents=c.createEvents.bind(n(c));return c}p(b,e);var f=q(b);l(b,[{key:"getPreparedData",value:function(a){return{callback:this.callback,share_url:a.dataset.url?a.dataset.url:this.url}}},{key:"createFakeTextarea", | ||
value:function(a){var c="rtl"===document.documentElement.getAttribute("dir"),d=document.createElement("textarea");d.style.fontSize="12pt";d.style.border="0";d.style.padding="0";d.style.margin="0";d.style.position="absolute";d.style[c?"right":"left"]="-9999px";d.style.top="".concat(window.pageYOffset||document.documentElement.scrollTop,"px");d.setAttribute("readonly","");d.value=a;return d}},{key:"legacyCopyToClipboard",value:function(a){var c=this;return new Promise(function(){var d=c.createFakeTextarea(a); | ||
document.body.appendChild(d);d.select();d.setSelectionRange(0,d.value.length);document.execCommand("copy");document.body.removeChild(d)})}},{key:"eventHandler",value:function(a,c){var d=this,g=c.share_url;a.preventDefault();try{navigator.permissions.query({name:"clipboard-write"}).then(function(h){"granted"===h.state||"prompt"===h.state?navigator.clipboard.writeText(g).then(function(){d.callback(a,{share_url:g})}):d.legacyCopyToClipboard(g).then(function(){d.callback(a,{share_url:g})})})}catch(h){this.legacyCopyToClipboard(g).then(function(){d.callback(a, | ||
{share_url:g})})}}},{key:"shareWindow",value:function(){var a=document.querySelectorAll('[data-social="copy-to-clipboard"]');return this.createEvents(a)}}]);return b}(m);var na=[y,F,G,H,O,I,J,K,L,M,N,P,Q,R,V,S,T,U,W,X,Y,Z,aa,ba,ca,da,ea,fa,ha,ia,ja,ka,la,ma,m];y=function(){function e(){k(this,e);this.providers=na;this.getProviders()}l(e,[{key:"setShareCallback",value:function(b){this.providers=this.providers.map(function(f){return f.setShareCallback(b)})}},{key:"getProviders",value:function(){return this.providers= | ||
this.providers.map(function(b){return(new b).getInstance()})}},{key:"reNewAllInstance",value:function(){this.providers=this.providers.map(function(b){return b.reNewInstance()})}}]);return e}();window._goodshare=new y})() |
{ | ||
"name": "goodshare.js", | ||
"version": "6.2.1", | ||
"version": "6.3.0", | ||
"description": "Useful modern JavaScript solution for share a link from your website to social networks or mobile messengers.", | ||
@@ -8,15 +8,15 @@ "main": "goodshare.min.js", | ||
"update": "npm outdated && npx npm-check-updates -u && npm install", | ||
"build": "rollup --config rollup.config.js --compact", | ||
"watch": "rollup --config rollup.config.js --watch --compact", | ||
"build": "rollup --config rollup.config.js --compact --bundleConfigAsCjs", | ||
"watch": "rollup --config rollup.config.js --watch --compact --bundleConfigAsCjs", | ||
"size": "npm run build && size-limit" | ||
}, | ||
"devDependencies": { | ||
"@ampproject/rollup-plugin-closure-compiler": "^0.26.0", | ||
"@babel/core": "^7.15.0", | ||
"@babel/preset-env": "^7.15.0", | ||
"@size-limit/preset-app": "^5.0.2", | ||
"babel-loader": "^8.2.2", | ||
"core-js": "^3.16.0", | ||
"rollup": "^2.56.0", | ||
"rollup-plugin-babel": "^4.4.0" | ||
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0", | ||
"@babel/core": "^7.22.9", | ||
"@babel/preset-env": "^7.22.9", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@size-limit/preset-app": "^8.2.6", | ||
"babel-loader": "^9.1.3", | ||
"core-js": "^3.31.1", | ||
"rollup": "^3.26.3" | ||
}, | ||
@@ -29,3 +29,3 @@ "repository": { | ||
"url": "https://github.com/koddr/goodshare.js/issues", | ||
"email": "vic@shostak.dev" | ||
"email": "koddr.me@gmail.com" | ||
}, | ||
@@ -39,4 +39,4 @@ "homepage": "https://goodshare.js.org", | ||
], | ||
"author": "Vic Shóstak <vic@shostak.dev> (https://shostak.dev)", | ||
"author": "Vic Shóstak <koddr.me@gmail.com> (https://github.com/koddr)", | ||
"license": "MIT" | ||
} |
@@ -80,3 +80,2 @@ <h1 align="center">🚀 goodshare.js</h1> | ||
- Vue.js — https://github.com/koddr/vue-goodshare | ||
- React.js — https://github.com/koddr/react-goodshare-components | ||
@@ -109,4 +108,3 @@ ## Size limit report | ||
2. Twit about project [on your Twitter](https://twitter.com/intent/tweet?text=Wow%20%F0%9F%91%8D%20Useful%20%23js%20solution%20for%20%23share%20a%20link%20from%20your%20%23website%20to%20%23social%20networks%20and%20mobile%20%23messengers%3A&url=https%3A%2F%2Fgithub.com%2Fkoddr%2Fgoodshare.js). | ||
3. Donate some money to project author via PayPal: [@paypal.me/koddr](https://paypal.me/koddr?locale.x=en_EN). | ||
4. Join DigitalOcean at our [referral link](https://m.do.co/c/b41859fa9b6e) (your profit is **$100** and we get $25). | ||
3. Join DigitalOcean at our [referral link](https://m.do.co/c/b41859fa9b6e) (your profit is **$100** and we get $25). | ||
@@ -113,0 +111,0 @@ Thanks for your support! 😘 Together, we make this project better every day. |
@@ -5,3 +5,3 @@ /** | ||
import babel from "rollup-plugin-babel"; | ||
import { babel } from "@rollup/plugin-babel"; | ||
import compiler from "@ampproject/rollup-plugin-closure-compiler"; | ||
@@ -19,3 +19,4 @@ | ||
babel({ | ||
exclude: "node_modules/**" | ||
exclude: "node_modules/**", | ||
babelHelpers: "bundled" | ||
}), | ||
@@ -22,0 +23,0 @@ compiler({ |
@@ -63,2 +63,8 @@ /** | ||
/** | ||
* Imports others providers | ||
*/ | ||
import { CopyToClipboard } from "./providers/CopyToClipboard" | ||
/** | ||
* Create providers list. | ||
@@ -104,3 +110,5 @@ */ | ||
WeChat, | ||
Line | ||
Line, | ||
// Imports other provides | ||
CopyToClipboard | ||
]; | ||
@@ -107,0 +115,0 @@ |
@@ -14,5 +14,6 @@ /** | ||
export class Skype extends ProviderMixin { | ||
constructor(url = document.location.href) { | ||
constructor(url = document.location.href, title = document.title) { | ||
super(); | ||
this.url = encodeURIComponent(url); | ||
this.title = encodeURIComponent(title); | ||
this.createEvents = this.createEvents.bind(this); | ||
@@ -25,3 +26,6 @@ } | ||
: this.url; | ||
const share_url = `https://web.skype.com/share?${url}`; | ||
const title = item.dataset.title | ||
? encodeURIComponent(item.dataset.title) | ||
: this.title; | ||
const share_url = `https://web.skype.com/share?url=${url}&text=${title}`; | ||
@@ -28,0 +32,0 @@ return { |
@@ -14,6 +14,8 @@ /** | ||
export class Twitter extends ProviderMixin { | ||
constructor(url = document.location.href, title = document.title) { | ||
constructor(url = document.location.href, title = document.title, hashtags = "") { | ||
super(); | ||
this.url = encodeURIComponent(url); | ||
this.title = encodeURIComponent(title); | ||
// Allow easy discovery of Tweets by topic by including a comma-separated list of hashtag values without the preceding # character. | ||
this.hashtags = encodeURIComponent(hashtags); | ||
this.createEvents = this.createEvents.bind(this); | ||
@@ -29,3 +31,8 @@ } | ||
: this.title; | ||
const share_url = `https://twitter.com/share?url=${url}&text=${title}`; | ||
// Allow easy discovery of Tweets by topic by including a comma-separated list of hashtag values without the preceding # character. | ||
// example: nature,sunset | ||
const hashtags = item.dataset.hashtags | ||
? encodeURIComponent(item.dataset.hashtags) | ||
: this.hashtags; | ||
const share_url = `https://twitter.com/share?url=${url}&text=${title}&hashtags=${hashtags}`; | ||
@@ -32,0 +39,0 @@ return { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
131696
72
2137
126