Comparing version 2.0.0-beta.0 to 2.0.0-beta.1
@@ -0,1 +1,5 @@ | ||
## 2.0.0-beta.1 | ||
Return the newly created window from share methods. | ||
## 2.0.0-beta.0 | ||
@@ -2,0 +6,0 @@ |
@@ -14,6 +14,6 @@ /** | ||
window.open(url, name, 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',location,resizable,scrollbars,toolbar=no'); | ||
} else { | ||
window.open(url, name); | ||
return window.open(url, name, 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',location,resizable,scrollbars,toolbar=no'); | ||
} | ||
return window.open(url, name); | ||
}; |
@@ -8,3 +8,3 @@ var popup = require('./popup'); | ||
var url = href.apply(this, arguments); | ||
popup(url, null, width, height); | ||
return popup(url, null, width, height); | ||
} | ||
@@ -20,3 +20,3 @@ | ||
var url = href.apply(this, arguments); | ||
popup(url, name); | ||
return popup(url, name); | ||
}; | ||
@@ -23,0 +23,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
var sharon=function(){"use strict";var t=0,e=function(e,n){var r=e.url||e,o=e.object||window,i=e.key||"j"+t++,c=void 0===e.parameter?"callback":e.parameter,u=document.createElement("script");u.src=c?r+(~r.indexOf("?")?"&":"?")+c+"="+i:r,u.onerror=function(){delete o[i],n(Error())},o[i]=function(t){delete o[i],n(null,t)},document.head.removeChild(document.head.appendChild(u))},n=e,r=function(t,e,r){return function(o,i){arguments.length<2&&(i=o,o=location),n({url:t+"="+encodeURIComponent(o),parameter:r},function(t,n){if(t)return i(t);i(null,e(n))})}},o=function(t,e){return e&&Object.keys(e).forEach(function(n){t[n]=e[n]}),t},i=o,c=function(t,e){return e=e||{},function(n,r){"string"==typeof n?r=i({url:n},r):(r=i({url:location},n),e.title&&(r.title=r.title||document.title));var o=Object.keys(r).map(function(t){var n=e[t]||t;return Array.isArray(r[t])?n+"="+r[t].map(encodeURIComponent):n+"="+encodeURIComponent(r[t])});return t+(~t.indexOf("?")?"&":"?")+o.join("&")}},u=function(t,e,n,r){if(n){var o=Math.max(0,Math.round(screen.height/3-r/2)),i=Math.round((screen.width-n)/2);window.open(t,e,"width="+n+",height="+r+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}else window.open(t,e)},a=u,s=0,l=function(t,e,n){function r(){var r=t.apply(this,arguments);a(r,null,e,n)}return r.defer=function(r){r=r||"about:blank";var o="sharon"+s++;return a(r,o,e,n),function(){var e=t.apply(this,arguments);a(e,o)}},r.href=t,r},h=r,p=c,d=l,m=p("https://buffer.com/add",{title:"text"}),f=d(m,850,600),w=h("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});f.count=w;var v=r,b=c,k=l,g=b("https://www.facebook.com/sharer.php",{url:"u"}),x=k(g,670,340),y=v("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});x.count=y;var j=c,C=l,U=j("https://mail.google.com/mail/?view=cm",{title:"su",url:"body"}),O=C(U,800,632),I=r,R=c,A=l,E=R("https://www.linkedin.com/shareArticle",{title:"title"}),M=A(E,600,400),K=I("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});M.count=K;var L=e,S=function(t,e,n){return function(r,o){arguments.length<2&&(o=r,r=location);var i=n.length+"";L({url:t+encodeURIComponent(r)+e+i,parameter:!1,object:n,key:i},o)}},_=S,z=c,D=l,N=z("https://connect.ok.ru/dk?st.cmd=WidgetSharePreview",{url:"st.shareUrl"}),P=D(N,580,350),V=[];window.ODKL={updateCount:function(t,e){V[t](+e)}};var W=_("https://connect.ok.ru/dk?st.cmd=extLike&ref=","&uid=",V);P.count=W;var q=r,B=c,F=l,G=B("https://www.pinterest.com/pin/create/button/",{title:"description"}),H=F(G,750,320),J=q("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});H.count=J;var Q=r,T=c,X=l,Y=T("https://plus.google.com/share"),Z=X(Y,600,600),$=Q("https://share.yandex.ru/gpp.xml?url",Number);Z.count=$;var tt=r,et=c,nt=l,rt=et("https://www.reddit.com/submit",{title:"title"}),ot=nt(rt),it=tt("https://www.reddit.com/api/info.json?url",function(t){return t.data.children.reduce(function(t,e){return t+e.data.score},0)},"jsonp");ot.count=it;var ct=c,ut=l,at=ct("https://t.me/share",{title:"text"}),st=ut(at,600,500),lt=r,ht=c,pt=l,dt=ht("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),mt=pt(dt,557,600),ft=lt("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});mt.count=ft;var wt=c,vt=l,bt=wt("https://twitter.com/intent/tweet",{title:"text"}),kt=vt(bt,550,420),gt=S,xt=c,yt=l,jt=xt("https://vk.com/share.php"),Ct=yt(jt,650,610),Ut=[];window.VK={Share:{count:function(t,e){Ut[t](e)}}};var Ot=gt("https://vk.com/share.php?act=count&url=","&index=",Ut);return Ct.count=Ot,{buffer:f,facebook:x,gmail:O,linkedin:M,ok:P,pinterest:H,plus:Z,reddit:ot,telegram:st,tumblr:mt,twitter:kt,vk:Ct,weibo:l(c("http://service.weibo.com/share/share.php",{title:"title"}),615,505),xing:l(c("https://www.xing.com/spi/shares/new"),570,530)}}(); | ||
var sharon=function(){"use strict";var c=0,u=function(t,e){var n=t.url||t,r=t.object||window,o=t.key||"j"+c++,i=void 0===t.parameter?"callback":t.parameter,u=document.createElement("script");u.src=i?n+(~n.indexOf("?")?"&":"?")+i+"="+o:n,u.onerror=function(){delete r[o],e(Error())},r[o]=function(t){delete r[o],e(null,t)},document.head.removeChild(document.head.appendChild(u))},t=function(e,r,o){return function(t,n){arguments.length<2&&(n=t,t=location),u({url:e+"="+encodeURIComponent(t),parameter:o},function(t,e){if(t)return n(t);n(null,r(e))})}},i=function(e,n){return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},e=function(r,o){return o=o||{},function(t,n){"string"==typeof t?n=i({url:t},n):(n=i({url:location},t),o.title&&(n.title=n.title||document.title));var e=Object.keys(n).map(function(t){var e=o[t]||t;return Array.isArray(n[t])?e+"="+n[t].map(encodeURIComponent):e+"="+encodeURIComponent(n[t])});return r+(~r.indexOf("?")?"&":"?")+e.join("&")}},a=function(t,e,n,r){if(n){var o=Math.max(0,Math.round(screen.height/3-r/2)),i=Math.round((screen.width-n)/2);return window.open(t,e,"width="+n+",height="+r+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}return window.open(t,e)},s=0,n=function(n,r,o){function t(){var t=n.apply(this,arguments);return a(t,null,r,o)}return t.defer=function(t){var e="sharon"+s++;return a(t=t||"about:blank",e,r,o),function(){var t=n.apply(this,arguments);return a(t,e)}},t.href=n,t},r=n(e("https://buffer.com/add",{title:"text"}),850,600),o=t("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});r.count=o;var l=n(e("https://www.facebook.com/sharer.php",{url:"u"}),670,340),h=t("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});l.count=h;var p=n(e("https://mail.google.com/mail/?view=cm",{title:"su",url:"body"}),800,632),d=n(e("https://www.linkedin.com/shareArticle",{title:"title"}),600,400),m=t("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});d.count=m;var f=function(r,o,i){return function(t,e){arguments.length<2&&(e=t,t=location);var n=i.length+"";u({url:r+encodeURIComponent(t)+o+n,parameter:!1,object:i,key:n},e)}},w=n(e("https://connect.ok.ru/dk?st.cmd=WidgetSharePreview",{url:"st.shareUrl"}),580,350),v=[];window.ODKL={updateCount:function(t,e){v[t](+e)}};var b=f("https://connect.ok.ru/dk?st.cmd=extLike&ref=","&uid=",v);w.count=b;var k=n(e("https://www.pinterest.com/pin/create/button/",{title:"description"}),750,320),g=t("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});k.count=g;var x=n(e("https://plus.google.com/share"),600,600),y=t("https://share.yandex.ru/gpp.xml?url",Number);x.count=y;var j=n(e("https://www.reddit.com/submit",{title:"title"})),C=t("https://www.reddit.com/api/info.json?url",function(t){return t.data.children.reduce(function(t,e){return t+e.data.score},0)},"jsonp");j.count=C;var U=n(e("https://t.me/share",{title:"text"}),600,500),O=n(e("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),557,600),I=t("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});O.count=I;var R=n(e("https://twitter.com/intent/tweet",{title:"text"}),550,420),A=n(e("https://vk.com/share.php"),650,610),E=[];window.VK={Share:{count:function(t,e){E[t](e)}}};var M=f("https://vk.com/share.php?act=count&url=","&index=",E);return A.count=M,{buffer:r,facebook:l,gmail:p,linkedin:d,ok:w,pinterest:k,plus:x,reddit:j,telegram:U,tumblr:O,twitter:R,vk:A,weibo:n(e("http://service.weibo.com/share/share.php",{title:"title"}),615,505),xing:n(e("https://www.xing.com/spi/shares/new"),570,530)}}(); | ||
//# sourceMappingURL=sharon.min.js.map |
@@ -1,2 +0,2 @@ | ||
module.exports = { | ||
var sharon = { | ||
buffer: require('./buffer'), | ||
@@ -17,1 +17,3 @@ facebook: require('./facebook'), | ||
}; | ||
module.exports = sharon; |
{ | ||
"name": "sharon", | ||
"version": "2.0.0-beta.0", | ||
"version": "2.0.0-beta.1", | ||
"description": "A lightweight and modular social sharing library", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"build": "rollup -co dist/sharon.min.js", | ||
"lint": "xo --env=browser --env=mocha --space", | ||
"lint": "xo --env=browser --env=mocha --no-esnext --space", | ||
"test": "zuul -- test/*", | ||
@@ -40,14 +40,14 @@ "test-local": "zuul --local -- test/*" | ||
"mocha": "*", | ||
"proxyquire": "^1.7.11", | ||
"proxyquire": "^2.0.1", | ||
"proxyquire-universal": "^1.0.8", | ||
"proxyquireify": "^3.2.1", | ||
"rollup": "^0.41.4", | ||
"rollup-plugin-commonjs": "^7.0.0", | ||
"rollup-plugin-filesize": "^1.0.1", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-uglify": "^1.0.1", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-commonjs": "^9.1.5", | ||
"rollup-plugin-filesize": "^4.0.1", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-uglify": "^4.0.0", | ||
"sinon": "*", | ||
"xo": "^0.17.1", | ||
"xo": "^0.22.0", | ||
"zuul": "^3.11.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
41050
298