diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2014-07-31 01:41:56 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@gmail.com> | 2014-07-31 01:41:56 -0700 |
commit | 5692bdd229020f5b01ca9b24658d6a7b253b6515 (patch) | |
tree | 6ee771461196e05720591e6dfbc95fa948056257 | |
parent | 30a8414b06287f805c40600f1f2e40bbe9cdd9ec (diff) | |
parent | 3402746719e4557c513fa2c33e9c176623aa291e (diff) | |
download | gitbook-5692bdd229020f5b01ca9b24658d6a7b253b6515.zip gitbook-5692bdd229020f5b01ca9b24658d6a7b253b6515.tar.gz gitbook-5692bdd229020f5b01ca9b24658d6a7b253b6515.tar.bz2 |
Merge pull request #386 from codepiano/china-social-network-sharing
add sharing to weibo.com.
-rwxr-xr-x | theme/javascript/utils/sharing.js | 5 | ||||
-rw-r--r-- | theme/templates/includes/book/header.html | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/theme/javascript/utils/sharing.js b/theme/javascript/utils/sharing.js index caf97fb..4889b40 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 5be0de3..9b36af8 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 %} <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a> {% endif %} + {% if options.links.sharing.weibo === true %} + <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="weibo" aria-label="Share on Weibo"><i class="fa fa-weibo"></i></a> + {% endif %} <!-- Title --> <h1> |