summaryrefslogtreecommitdiffstats
path: root/assets/javascript/utils/sharing.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-04 14:10:56 -0700
committerSamy Pessé <samypesse@gmail.com>2014-04-04 14:10:56 -0700
commit446d486a0fb725f3df76d9b6e8d2bca02042805b (patch)
treecfd5405f607fcca196ef5bad6b0b88662c30ccb9 /assets/javascript/utils/sharing.js
parent07101deaefb8848d40231eea12a3bf0710e6a78e (diff)
downloadgitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.zip
gitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.tar.gz
gitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.tar.bz2
Add base for theming
Diffstat (limited to 'assets/javascript/utils/sharing.js')
-rw-r--r--assets/javascript/utils/sharing.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/assets/javascript/utils/sharing.js b/assets/javascript/utils/sharing.js
deleted file mode 100644
index f4354f1..0000000
--- a/assets/javascript/utils/sharing.js
+++ /dev/null
@@ -1,33 +0,0 @@
-define([
- "jQuery"
-], function($) {
- var url = location.href;
- var title = $("title").text();
-
- var types = {
- "twitter": function($el) {
- window.open("http://twitter.com/home?status="+encodeURIComponent(title+" "+url))
- },
- "facebook": function($el) {
- window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(url))
- },
- "google-plus": function($el) {
- window.open("https://plus.google.com/share?url="+encodeURIComponent(url))
- }
- };
-
-
- // Bind all sharing button
- var init = function() {
- $("a[data-sharing]").click(function(e) {
- if (e) e.preventDefault();
- var type = $(this).data("sharing");
-
- types[type]($(this));
- })
- };
-
- return {
- init: init
- };
-}); \ No newline at end of file