summaryrefslogtreecommitdiffstats
path: root/theme/javascript
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-10-05 13:53:19 +0200
committerSamy Pessé <samypesse@gmail.com>2015-10-05 13:53:19 +0200
commit376c68957f7c58f87de977047ac63936926e328e (patch)
tree2ced57f94e0b78a56f7aaffcee705abd2d367b5c /theme/javascript
parent222ec8d4b9c9ee126ef477de7cf52412799a821d (diff)
downloadgitbook-376c68957f7c58f87de977047ac63936926e328e.zip
gitbook-376c68957f7c58f87de977047ac63936926e328e.tar.gz
gitbook-376c68957f7c58f87de977047ac63936926e328e.tar.bz2
Remove sharing
Diffstat (limited to 'theme/javascript')
-rw-r--r--theme/javascript/apis/toolbar.js4
-rwxr-xr-xtheme/javascript/gitbook.js6
-rwxr-xr-xtheme/javascript/utils/sharing.js39
3 files changed, 5 insertions, 44 deletions
diff --git a/theme/javascript/apis/toolbar.js b/theme/javascript/apis/toolbar.js
index dab3a79..187e9ac 100644
--- a/theme/javascript/apis/toolbar.js
+++ b/theme/javascript/apis/toolbar.js
@@ -128,6 +128,10 @@ define([
// Create inner menu
var $menu = createDropdownMenu(opts.dropdown);
+
+ // Menu position
+ $menu.addClass('dropdown-'+(opts.position == 'right'? 'left' : 'right'));
+
$container.append($menu);
$container.insertBefore($title);
diff --git a/theme/javascript/gitbook.js b/theme/javascript/gitbook.js
index b9f7d01..00dcafe 100755
--- a/theme/javascript/gitbook.js
+++ b/theme/javascript/gitbook.js
@@ -1,7 +1,6 @@
define([
'jQuery',
'utils/storage',
- 'utils/sharing',
'utils/dropdown',
'core/events',
@@ -13,7 +12,7 @@ define([
'core/search',
'apis/toolbar'
-], function($, storage, sharing, dropdown, events, state,
+], function($, storage, dropdown, events, state,
keyboard, navigation, progress, sidebar, search, toolbar){
var start = function(config) {
// Init sidebar
@@ -25,9 +24,6 @@ keyboard, navigation, progress, sidebar, search, toolbar){
// Init keyboard
keyboard.init();
- // Bind sharing button
- sharing.init();
-
// Bind dropdown
dropdown.init();
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
- };
-});