diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-06 09:42:49 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-10-06 09:42:49 +0200 |
commit | ce1e0e187339976fc3cae7ef70bcfdd0eaf68981 (patch) | |
tree | c71ab2b8badd7a54759790bde083cab721796d92 /theme/javascript/utils/sharing.js | |
parent | bcb224d1cb0add4285538f03956f6f6a1574e49a (diff) | |
parent | c2775b3b63e92a7047f019a9d56851ce4fdd6c02 (diff) | |
download | gitbook-ce1e0e187339976fc3cae7ef70bcfdd0eaf68981.zip gitbook-ce1e0e187339976fc3cae7ef70bcfdd0eaf68981.tar.gz gitbook-ce1e0e187339976fc3cae7ef70bcfdd0eaf68981.tar.bz2 |
Merge pull request #964 from GitbookIO/features/plugin_api
Better APIs for Plugins
Diffstat (limited to 'theme/javascript/utils/sharing.js')
-rwxr-xr-x | theme/javascript/utils/sharing.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/theme/javascript/utils/sharing.js b/theme/javascript/utils/sharing.js deleted file mode 100755 index a0cfb59..0000000 --- a/theme/javascript/utils/sharing.js +++ /dev/null @@ -1,39 +0,0 @@ -define([ - "jQuery" -], function($) { - var types = { - "twitter": function($el) { - window.open("http://twitter.com/home?status="+encodeURIComponent($("title").text()+" "+location.href)) - }, - "facebook": function($el) { - window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(location.href)) - }, - "google-plus": function($el) { - window.open("https://plus.google.com/share?url="+encodeURIComponent(location.href)) - }, - "weibo": function($el) { - window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent($("title").text())) - }, - "instapaper": function($el) { - window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href)); - }, - "vk": function($el) { - window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href)); - } - }; - - - // Bind all sharing button - var init = function() { - $(document).on("click", "a[data-sharing],button[data-sharing]", function(e) { - if (e) e.preventDefault(); - var type = $(this).data("sharing"); - - types[type]($(this)); - }) - }; - - return { - init: init - }; -}); |