|
Share = { |
|
vkontakte: function(purl, ptitle, text) { |
|
url = 'http://vkontakte.ru/share.php?'; |
|
url += 'url=' + encodeURIComponent(purl); |
|
url += '&title=' + encodeURIComponent(ptitle); |
|
url += '&description=' + encodeURIComponent(text); |
|
Share.popup(url); |
|
}, |
|
odnoklassniki: function(purl, text) { |
|
url = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1'; |
|
url += '&st.comments=' + encodeURIComponent(text); |
|
url += '&st._surl=' + encodeURIComponent(purl); |
|
Share.popup(url); |
|
}, |
|
facebook: function(purl, ptitle, pimg, text) { |
|
url = 'http://www.facebook.com/sharer.php?s=100'; |
|
url += '&p[title]=' + encodeURIComponent(ptitle); |
|
url += '&p[summary]=' + encodeURIComponent(text); |
|
url += '&p[url]=' + encodeURIComponent(purl); |
|
url += '&p[images][0]=' + encodeURIComponent(pimg); |
|
Share.popup(url); |
|
}, |
|
twitter: function(purl, ptitle) { |
|
url = 'http://twitter.com/share?'; |
|
url += 'text=' + encodeURIComponent(ptitle); |
|
url += '&url=' + encodeURIComponent(purl); |
|
url += '&counturl=' + encodeURIComponent(purl); |
|
Share.popup(url); |
|
}, |
|
mailru: function(purl, ptitle, pimg, text) { |
|
url = 'http://connect.mail.ru/share?'; |
|
url += 'url=' + encodeURIComponent(purl); |
|
url += '&title=' + encodeURIComponent(ptitle); |
|
url += '&description=' + encodeURIComponent(text); |
|
url += '&imageurl=' + encodeURIComponent(pimg); |
|
Share.popup(url) |
|
}, |
|
googleplus: function(purl) { |
|
url = 'https://plus.google.com/share?'; |
|
url += 'url=' + encodeURIComponent(purl); |
|
Share.popup(url) |
|
}, |
|
|
|
popup: function(url) { |
|
window.open(url,'','toolbar=0,status=0,width=626,height=436'); |
|
} |
|
}; |
Share.facebook('https://gist.github.com/ambivalentno/449321207b1c7891fa41','funny gist','https://wannameet.s3.amazonaws.com/purchase_images/%D0%A4%D0%B8%D1%82%D0%BE2.jpg', '')