share 🎁

This commit is contained in:
Liang Ding 2014-12-18 16:46:34 +08:00
parent a7369bcea4
commit 78a827ebcd
1 changed files with 12 additions and 9 deletions

View File

@ -36,20 +36,23 @@ var menu = {
$(".share-panel .font-ico").click(function () { $(".share-panel .font-ico").click(function () {
var key = $(this).attr('class').split('-')[2]; var key = $(this).attr('class').split('-')[2];
var title = encodeURIComponent($('title').text() + '. \n' + $('meta[name=description]').attr('content')), var url = "https://wide.b3log.org", pic = 'https://wide.b3log.org/static/images/wide-logo.png';
url = "https://wide.b3log.org",
pic = 'https://wide.b3log.org/static/images/wide-logo.png';
var urls = {}; var urls = {};
urls.email = "mailto:?subject=" + $('title').text() urls.email = "mailto:?subject=" + $('title').text()
+ "&body=" + $('meta[name=description]').attr('content') + ' ' + url; + "&body=" + $('meta[name=description]').attr('content') + ' ' + url;
urls.twitter = "https://twitter.com/intent/tweet?status="
+ $('meta[name=description]').attr('content') + " " + url + " #golang"; var twitterShare = encodeURIComponent($('meta[name=description]').attr('content') + " " + url + " #golang");
urls.twitter = "https://twitter.com/intent/tweet?status=" + twitterShare;
urls.facebook = "https://www.facebook.com/sharer/sharer.php?u=" + url; urls.facebook = "https://www.facebook.com/sharer/sharer.php?u=" + url;
urls.googleplus = "https://plus.google.com/share?url=" + url + " +golang"; urls.googleplus = "https://plus.google.com/share?url=" + url;
urls.weibo = "http://v.t.sina.com.cn/share/share.php?title=" +
title + "&url=" + url + "&pic=" + pic; var title = encodeURIComponent($('title').text() + '. \n' + $('meta[name=description]').attr('content')
+ " #golang#");
urls.weibo = "http://v.t.sina.com.cn/share/share.php?title=" + title + "&url=" + url + "&pic=" + pic;
urls.tencent = "http://share.v.t.qq.com/index.php?c=share&a=index&title=" + title + urls.tencent = "http://share.v.t.qq.com/index.php?c=share&a=index&title=" + title +
"&url=" + url + "&pic=" + pic; "&url=" + url + "&pic=" + pic;
window.open(urls[key], "_blank", "top=100,left=200,width=648,height=618"); window.open(urls[key], "_blank", "top=100,left=200,width=648,height=618");
}); });
}, },