Skip to content

Commit 0441de1

Browse files
committed
add social share plugin
1 parent 4bc2384 commit 0441de1

76 files changed

Lines changed: 1043 additions & 72 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.jekyll-metadata

-53.5 KB
Binary file not shown.

_includes/share-page.html

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
1-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
21
<div class="share-box">
3-
<h2>Share:</h2>
4-
5-
<a class="t" href="https://twitter.com/intent/tweet?text={{ page.title | url_encode}}&via={{ site.twitter_username }}&url={{ page.url | absolute_url | url_encode }}"
6-
onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"
7-
title="Share on Twitter">
8-
<i class="fa fa-twitter fa"></i><span> twitter</span>
9-
</a>
10-
11-
<a class="f" href="https://www.facebook.com/sharer/sharer.php?u={{ page.url | absolute_url | url_encode }}" onclick="window.open(this.href, 'debezium',
12-
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Facebook"><i class="fa fa-facebook-official fa"></i><span> facebook</span></a>
13-
14-
<a class="l" href="https://www.linkedin.com/shareArticle?mini=true&url={{site.url}}{{page.url}}" onclick="window.open(this.href, 'debezium',
15-
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Linkedin"><i class="fa fa-linkedin fa"></i><span> linkedin</span></a>
16-
17-
<a class="r" href="http://www.reddit.com/submit?url={{site.url}}{{page.url}}}&title={{page.title}}" onclick="window.open(this.href, 'debezium',
18-
'left=20,top=20,width=900,height=500,toolbar=1,resizable=0'); return false;" title="Share on Reddit"><i class="fa fa-reddit fa"></i><span> reddit</span></a>
19-
20-
<a class="e" href="mailto:?subject={{ page.title}}&body=Check out this site {{site.url}}{{page.url}}" title="Share via Email"><i class="fa fa-envelope fa"></i><span> email</span></a>
21-
2+
<h3>Share:</h3>
3+
<div
4+
data-social-share-privacy='true'
5+
data-options='{
6+
"order" : ["fbshare", "twitter", "linkedin"]
7+
}'
8+
></div>
229
</div>
23-

_layouts/base.html

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,44 @@
6767
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
6868
<script type="text/javascript" src="/assets/javascript/vanilla-back-to-top.min.js"></script>
6969
<script type="text/javascript" src="/assets/javascript/highlight.min.js"></script>
70-
<script>
70+
<script type="text/javascript" src="/assets/javascript/jquery.cookies.js"></script>
71+
<script type="text/javascript" src="/assets/socialshare/javascript/jquery.socialshareprivacy.min.autoload.js"></script>
72+
<script type="application/x-social-share-privacy-settings">
73+
{
74+
"path_prefix":"{{site.baseurl}}/assets/socialshare/",
75+
"layout":"line",
76+
"services": {
77+
"buffer": {
78+
"status": false
79+
},
80+
"delicious": {
81+
"status": false
82+
},
83+
"disqus": {
84+
"status": false
85+
},
86+
"facebook": {
87+
"status": false
88+
},
89+
"flattr": {
90+
"status": false
91+
},
92+
"gplus": {
93+
"status": false
94+
},
95+
"hackernews": {
96+
"status": false
97+
},
98+
"pinterest": {
99+
"status": false
100+
},
101+
"xing": {
102+
"status": false
103+
}
104+
}
105+
}
106+
</script>
107+
<script>
71108
addBackToTop({ scrollDuration: 400 })
72109
hljs.initHighlightingOnLoad();
73110
</script>

assets/css/custom.css

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10814,53 +10814,3 @@ span.test-with-subcategory {
1081410814
.pager-blog {
1081510815
margin-bottom: 0px !important;
1081610816
}
10817-
10818-
.share-box a {
10819-
display: inline-block;
10820-
-webkit-box-shadow: 0 0 1px #777;
10821-
box-shadow: 0 0 1px #777;
10822-
padding: 5px 12px;
10823-
margin-right: 5px;
10824-
margin-bottom: 5px;
10825-
text-decoration: none; }
10826-
.share-box a:hover {
10827-
text-decoration: none;
10828-
-webkit-transition: background-color 200ms linear;
10829-
-ms-transition: background-color 200ms linear;
10830-
transition: background-color 200ms linear; }
10831-
10832-
.f {
10833-
color: #3b5998; }
10834-
.f:hover {
10835-
color: #fff;
10836-
background-color: #3b5998; }
10837-
10838-
.t {
10839-
color: #4099FF; }
10840-
.t:hover {
10841-
color: #fff;
10842-
background-color: #4099FF; }
10843-
10844-
.g {
10845-
color: #d34836; }
10846-
.g:hover {
10847-
color: #fff;
10848-
background-color: #d34836; }
10849-
10850-
.r {
10851-
color: #ff5700; }
10852-
.r:hover {
10853-
color: #fff;
10854-
background-color: #ff5700; }
10855-
10856-
.l {
10857-
color: #0077b5; }
10858-
.l:hover {
10859-
color: #fff;
10860-
background-color: #0077b5; }
10861-
10862-
.e {
10863-
color: #444444; }
10864-
.e:hover {
10865-
color: #fff;
10866-
background-color: #444444; }
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
"use strict";
2+
3+
(function ($,undefined) {
4+
function decode (s) {
5+
try {
6+
return decodeURIComponent(s);
7+
}
8+
catch (e) {
9+
try {
10+
return unescape(s);
11+
}
12+
catch (e2) {
13+
return s;
14+
}
15+
}
16+
}
17+
18+
function get () {
19+
var cookies = {};
20+
if (document.cookie) {
21+
var values = document.cookie.split(/; */g);
22+
for (var i = 0; i < values.length; ++ i) {
23+
var value = values[i];
24+
var pos = value.search("=");
25+
var key, value;
26+
27+
if (pos < 0) {
28+
key = decode(value);
29+
value = undefined;
30+
}
31+
else {
32+
key = decode(value.slice(0,pos));
33+
value = decode(value.slice(pos+1));
34+
}
35+
36+
cookies[key] = value;
37+
}
38+
}
39+
40+
return cookies;
41+
}
42+
43+
function set (name, value, expires, path, domain, secure) {
44+
switch (arguments.length) {
45+
case 1:
46+
for (var key in name) {
47+
set(key, name[key]);
48+
}
49+
return;
50+
51+
case 2:
52+
if (typeof(value) === "object") {
53+
expires = value.expires;
54+
path = value.path;
55+
domain = value.domain;
56+
secure = value.secure;
57+
value = value.value;
58+
}
59+
60+
case 3:
61+
if (typeof(expires) === "object" && !(expires instanceof Date)) {
62+
path = expires.path;
63+
domain = expires.domain;
64+
secure = expires.secure;
65+
expires = expires.expires;
66+
}
67+
}
68+
69+
if (value === null || value === undefined) {
70+
expires = -1;
71+
}
72+
73+
var buf = [encodeURIComponent(name)+'='+encodeURIComponent(value)];
74+
switch (typeof(expires)) {
75+
case "string":
76+
expires = new Date(expires);
77+
78+
case "object":
79+
buf.push("expires="+expires.toUTCString());
80+
break;
81+
82+
case "boolean":
83+
if (expires) {
84+
break;
85+
}
86+
expires = 365*2000;
87+
88+
case "number":
89+
var date = new Date();
90+
date.setDate(date.getDate()+expires);
91+
buf.push("expires="+date.toUTCString());
92+
break;
93+
}
94+
95+
if (path === true) {
96+
buf.push("path="+document.location.pathname);
97+
}
98+
else if (path) {
99+
buf.push("path="+path.replace(/[;\s]/g,encodeURIComponent));
100+
}
101+
102+
if (domain === true) {
103+
buf.push("domain="+document.location.host);
104+
}
105+
else if (domain) {
106+
buf.push("domain="+domain.replace(/[;\s]/g,encodeURIComponent));
107+
}
108+
109+
if (secure) {
110+
buf.push("secure");
111+
}
112+
113+
document.cookie = buf.join("; ");
114+
}
115+
116+
$.cookie = function (name) {
117+
switch (arguments.length) {
118+
case 0:
119+
return get();
120+
case 1:
121+
if (typeof(name) !== "object") {
122+
var cookies = get();
123+
if (name === undefined) {
124+
return cookies;
125+
}
126+
else if (Object.prototype.hasOwnProperty.call(cookies,name)) {
127+
return cookies[name];
128+
}
129+
return null;
130+
}
131+
case 2:
132+
case 3:
133+
case 4:
134+
case 5:
135+
case 6:
136+
set.apply(this,arguments);
137+
return this;
138+
139+
default:
140+
throw new Error("Illegal number of arguments");
141+
}
142+
};
143+
144+
$.removeCookie = function (name) {
145+
var cookies = get();
146+
if (Object.prototype.hasOwnProperty.call(cookies,name)) {
147+
var args = Array.prototype.slice.call(arguments,1);
148+
args.unshift(name,null,-1);
149+
set.apply(this,args);
150+
return true;
151+
}
152+
return false;
153+
};
154+
})(jQuery);
4.57 KB
2.26 KB
2.42 KB
1.01 KB
884 Bytes

0 commit comments

Comments
 (0)