aboutsummaryrefslogtreecommitdiff
path: root/docs/_book/gitbook/gitbook-plugin-sharing/buttons.js
diff options
context:
space:
mode:
authorJakob Stendahl <14180120+JakobST1n@users.noreply.github.com>2021-10-11 20:02:04 +0200
committerGitHub <noreply@github.com>2021-10-11 20:02:04 +0200
commitc67531161e56488166a33232f87566309ba8676e (patch)
tree846e59a020e80bea48557d5a06af5728e44961ff /docs/_book/gitbook/gitbook-plugin-sharing/buttons.js
parente6880cd8ccf82d993f222cb14b4860581654acb8 (diff)
parentc1b6eec770b885a9829e1f62bad5cc99389ca429 (diff)
downloadLuxcena-Neo-c67531161e56488166a33232f87566309ba8676e.tar.gz
Luxcena-Neo-c67531161e56488166a33232f87566309ba8676e.zip
Merge pull request #24 from JakobST1n/rebuild
v1.0.0
Diffstat (limited to 'docs/_book/gitbook/gitbook-plugin-sharing/buttons.js')
-rw-r--r--docs/_book/gitbook/gitbook-plugin-sharing/buttons.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/docs/_book/gitbook/gitbook-plugin-sharing/buttons.js b/docs/_book/gitbook/gitbook-plugin-sharing/buttons.js
deleted file mode 100644
index 709a4e4..0000000
--- a/docs/_book/gitbook/gitbook-plugin-sharing/buttons.js
+++ /dev/null
@@ -1,90 +0,0 @@
-require(['gitbook', 'jquery'], function(gitbook, $) {
- var SITES = {
- 'facebook': {
- 'label': 'Facebook',
- 'icon': 'fa fa-facebook',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[url]='+encodeURIComponent(location.href));
- }
- },
- 'twitter': {
- 'label': 'Twitter',
- 'icon': 'fa fa-twitter',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('http://twitter.com/home?status='+encodeURIComponent(document.title+' '+location.href));
- }
- },
- 'google': {
- 'label': 'Google+',
- 'icon': 'fa fa-google-plus',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href));
- }
- },
- 'weibo': {
- 'label': 'Weibo',
- 'icon': 'fa fa-weibo',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('http://service.weibo.com/share/share.php?content=utf-8&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title));
- }
- },
- 'instapaper': {
- 'label': 'Instapaper',
- 'icon': 'fa fa-instapaper',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('http://www.instapaper.com/text?u='+encodeURIComponent(location.href));
- }
- },
- 'vk': {
- 'label': 'VK',
- 'icon': 'fa fa-vk',
- 'onClick': function(e) {
- e.preventDefault();
- window.open('http://vkontakte.ru/share.php?url='+encodeURIComponent(location.href));
- }
- }
- };
-
-
-
- gitbook.events.bind('start', function(e, config) {
- var opts = config.sharing;
-
- // Create dropdown menu
- var menu = $.map(opts.all, function(id) {
- var site = SITES[id];
-
- return {
- text: site.label,
- onClick: site.onClick
- };
- });
-
- // Create main button with dropdown
- if (menu.length > 0) {
- gitbook.toolbar.createButton({
- icon: 'fa fa-share-alt',
- label: 'Share',
- position: 'right',
- dropdown: [menu]
- });
- }
-
- // Direct actions to share
- $.each(SITES, function(sideId, site) {
- if (!opts[sideId]) return;
-
- gitbook.toolbar.createButton({
- icon: site.icon,
- label: site.text,
- position: 'right',
- onClick: site.onClick
- });
- });
- });
-});