-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckpoint.min.js
1 lines (1 loc) · 1.78 KB
/
checkpoint.min.js
1
(function(a){var b={popmeup:function(a,b,c){var d=screen.width/2-a/2,e=screen.height/2-b/2;window.open(c,"_blank","toolbar=0,width="+a+", height="+b+", location=0, directories=0, status=1, scrollbars=1, menubar=0, resizable=0, copyhistory=0, top="+e+", left="+d)},facebook:function(a,c,d,e){if(void 0==e)var f="http://www.facebook.com/sharer.php?s=100&p[title]="+encodeURIComponent(a)+"&p[summary]="+encodeURIComponent(c)+"&p[url]="+encodeURIComponent(d);else var f="http://www.facebook.com/sharer.php?s=100&p[title]="+encodeURIComponent(a)+"&p[summary]="+encodeURIComponent(c)+"&p[url]="+encodeURIComponent(d)+"&p[images][0]="+encodeURIComponent(e);b.popmeup(500,500,f)},linkedin:function(a,c,d){if(void 0==c)var e="http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(d)+"&title="+encodeURIComponent(a);else var e="http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(d)+"&title="+encodeURIComponent(a)+"&summary="+encodeURIComponent(c);b.popmeup(500,500,e)},twitter:function(a,c){if(void 0==c)var d="http://twitter.com/home?status="+encodeURIComponent(a);else var d="http://twitter.com/home?status="+encodeURIComponent(a)+"+"+encodeURIComponent(c);b.popmeup(500,500,d)},google:function(a){var c="https://plus.google.com/share?url="+encodeURIComponent(a);b.popmeup(500,500,c)}};a.fn.checkpoint=function(c){return c=a.extend({},a.fn.checkpoint.defaults,c),this.length?(this.each(function(){var e=a(this),f=e.attr(c.title),g=e.attr(c.text),h=e.attr(c.url),i=e.attr(c.img);"f"==c[0]?e.click(function(){b.facebook(f,g,h,i)}):"t"==c[0]?e.click(function(){b.twitter(g,h)}):"g"==c[0]?e.click(function(){b.google(h)}):"l"==c[0]&&e.click(function(){b.linkedin(f,g,h)})}),void 0):this},a.fn.checkpoint.defaults={title:"data-title",text:"data-text",url:"data-url",img:"data-img"}})(jQuery);