From 3402746719e4557c513fa2c33e9c176623aa291e Mon Sep 17 00:00:00 2001 From: codepiano Date: Thu, 31 Jul 2014 16:10:33 +0800 Subject: [PATCH] =?UTF-8?q?add=20sharing=20to=20weibo.com.=20google?= =?UTF-8?q?=E3=80=81facebook=20and=20twitter=20are=20block=20by=20GFW=20in?= =?UTF-8?q?=20China=EF=BC=8CChinese=20can=20not=20visit=20these=20websites?= =?UTF-8?q?.=20add=20'weibo'=20config=20in=20option=20links.sharing,the=20?= =?UTF-8?q?share=20link=20will=20not=20be=20used=20by=20default,users=20sh?= =?UTF-8?q?ould=20set=20the=20value=20of=20'weibo'=20to=20true=20to=20turn?= =?UTF-8?q?=20on=20sharing=20to=20weibo.com.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme/javascript/utils/sharing.js | 5 ++++- theme/templates/includes/book/header.html | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/theme/javascript/utils/sharing.js b/theme/javascript/utils/sharing.js index caf97fbc4..4889b407a 100755 --- a/theme/javascript/utils/sharing.js +++ b/theme/javascript/utils/sharing.js @@ -13,6 +13,9 @@ define([ }, "google-plus": function($el) { window.open("https://plus.google.com/share?url="+encodeURIComponent(url)) + }, + "weibo": function($el) { + window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(url)+"&title="+encodeURIComponent(title)) } }; @@ -30,4 +33,4 @@ define([ return { init: init }; -}); \ No newline at end of file +}); diff --git a/theme/templates/includes/book/header.html b/theme/templates/includes/book/header.html index 5be0de381..9b36af8b2 100644 --- a/theme/templates/includes/book/header.html +++ b/theme/templates/includes/book/header.html @@ -21,6 +21,9 @@ {% if options.links.sharing.twitter !== false %} {% endif %} + {% if options.links.sharing.weibo === true %} + + {% endif %}