Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBZ-2619 Adding few social share buttons #620

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .jekyll-metadata
Binary file not shown.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ GEM
asciidoctor (1.5.8)
coderay (1.1.3)
colorator (1.1.0)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.9)
cssminify2 (2.0.1)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
execjs (2.7.0)
ffi (1.14.2)
execjs (2.8.1)
ffi (1.15.3)
forwardable-extended (2.6.0)
htmlcompressor (0.4.0)
http_parser.rb (0.6.0)
i18n (1.8.7)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.4)
Expand Down Expand Up @@ -63,7 +63,7 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.4.1)
listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
Expand All @@ -74,8 +74,8 @@ GEM
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rake (13.0.3)
rb-fsevent (0.10.4)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
Expand Down
24 changes: 8 additions & 16 deletions _includes/share-page.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<div class="share-page">
<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url={{ site.url }}{{ post.url }}&title={{ post.title }}" rel="nofollow" target="_blank" title="Share on LinkedIn">
<img src="{{site.baseurl}}/assets/images/share-page/icons_social-linkedin.png"/>
</a>
<a class="share-twitter" href="https://twitter.com/intent/tweet?text={{ post.title }}&url={{ site.url }}{{ post.url }}&via={{ site.twitter_username }}&related={{ site.twitter_username }}" rel="nofollow" target="_blank" title="Share on Twitter">
<img src="{{site.baseurl}}/assets/images/share-page/icons_social-twitter.png"/>
</a>
<a class="share-facebook" href="https://facebook.com/sharer.php?u={{ site.url }}{{ post.url }}" rel="nofollow" target="_blank" title="Share on Facebook">
<img src="{{site.baseurl}}/assets/images/share-page/icons_social-facebook.png"/>
</a>
<a class="share-reddit" href="http://www.reddit.com/submit?url={{ site.url }}{{ post.url }}" onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=900,height=500,toolbar=1,resizable=0'); return false;" title="Share on Reddit" >
<img src="{{site.baseurl}}/assets/images/share-page/icons_social-reddit.png"/>
</a>
<a class="share-email" href="mailto:?subject={{ post.title }}&amp;body={{post.title}} {{ site.url }}{{ post.url }}" title="Share via Email" >
<img src="{{site.baseurl}}/assets/images/share-page/icons_social-email.png"/>
</a>
<div class="share-box">
<h3>Share:</h3>
<div
data-social-share-privacy='true'
data-options='{
"order" : ["fbshare", "twitter", "linkedin"]
}'
></div>
</div>
47 changes: 46 additions & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,52 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript" src="/assets/javascript/vanilla-back-to-top.min.js"></script>
<script type="text/javascript" src="/assets/javascript/highlight.min.js"></script>
<script>
<script type="text/javascript" src="/assets/socialshare/javascript/jquery.socialshareprivacy.min.autoload.js"></script>
<script type="application/x-social-share-privacy-settings">
{
"path_prefix":"{{site.baseurl}}/assets/socialshare/",
"layout":"line",
"services": {
"buffer": {
"status": false
},
"delicious": {
"status": false
},
"disqus": {
"status": false
},
"facebook": {
"status": false
},
"flattr": {
"status": false
},
"gplus": {
"status": false
},
"hackernews": {
"status": false
},
"pinterest": {
"status": false
},
"xing": {
"status": false
},
"tumblr": {
"status": false
},
"stumble": {
"status": false
},
"stumbleupon": {
"status":false
}
}
}
</script>
<script>
addBackToTop({ scrollDuration: 400 })
hljs.initHighlightingOnLoad();
</script>
Expand Down
7 changes: 5 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@
</div>
<div class="grid__item width-12-12">{{ content }}</div>
</div>
<div class="row">
<div class="col-md-12">
{% include share-page.html %}
</div>
</div>
{% if postAuthors %}

{% for postAuthor in postAuthors %}
{% assign authorName = site.data.authors[postAuthor].name %}
<div class="well">
Expand Down Expand Up @@ -165,7 +169,6 @@ <h2>Get involved</h2>
</p>
</div>
</div>

{% if site.disqus.shortname and jekyll.environment == 'production' %}
{% include disqus_comments.html %}
{% endif %}
Expand Down
8 changes: 8 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -10813,4 +10813,12 @@ span.test-with-subcategory {
}
.pager-blog {
margin-bottom: 0px !important;
}
.dummy_btn.mail a{
margin-right: 10px!important;
}
.dummy_btn.mail img{
height: 20px;
width: 35px;
margin-right: 10px;
}
154 changes: 154 additions & 0 deletions assets/javascript/jquery.cookies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
"use strict";

(function ($,undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this cookie logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cookie logic is to enable share buttons permanently.

function decode (s) {
try {
return decodeURIComponent(s);
}
catch (e) {
try {
return unescape(s);
}
catch (e2) {
return s;
}
}
}

function get () {
var cookies = {};
if (document.cookie) {
var values = document.cookie.split(/; */g);
for (var i = 0; i < values.length; ++ i) {
var value = values[i];
var pos = value.search("=");
var key, value;

if (pos < 0) {
key = decode(value);
value = undefined;
}
else {
key = decode(value.slice(0,pos));
value = decode(value.slice(pos+1));
}

cookies[key] = value;
}
}

return cookies;
}

function set (name, value, expires, path, domain, secure) {
switch (arguments.length) {
case 1:
for (var key in name) {
set(key, name[key]);
}
return;

case 2:
if (typeof(value) === "object") {
expires = value.expires;
path = value.path;
domain = value.domain;
secure = value.secure;
value = value.value;
}

case 3:
if (typeof(expires) === "object" && !(expires instanceof Date)) {
path = expires.path;
domain = expires.domain;
secure = expires.secure;
expires = expires.expires;
}
}

if (value === null || value === undefined) {
expires = -1;
}

var buf = [encodeURIComponent(name)+'='+encodeURIComponent(value)];
switch (typeof(expires)) {
case "string":
expires = new Date(expires);

case "object":
buf.push("expires="+expires.toUTCString());
break;

case "boolean":
if (expires) {
break;
}
expires = 365*2000;

case "number":
var date = new Date();
date.setDate(date.getDate()+expires);
buf.push("expires="+date.toUTCString());
break;
}

if (path === true) {
buf.push("path="+document.location.pathname);
}
else if (path) {
buf.push("path="+path.replace(/[;\s]/g,encodeURIComponent));
}

if (domain === true) {
buf.push("domain="+document.location.host);
}
else if (domain) {
buf.push("domain="+domain.replace(/[;\s]/g,encodeURIComponent));
}

if (secure) {
buf.push("secure");
}

document.cookie = buf.join("; ");
}

$.cookie = function (name) {
switch (arguments.length) {
case 0:
return get();
case 1:
if (typeof(name) !== "object") {
var cookies = get();
if (name === undefined) {
return cookies;
}
else if (Object.prototype.hasOwnProperty.call(cookies,name)) {
return cookies[name];
}
return null;
}
case 2:
case 3:
case 4:
case 5:
case 6:
set.apply(this,arguments);
return this;

default:
throw new Error("Illegal number of arguments");
}
};

$.removeCookie = function (name) {
var cookies = get();
if (Object.prototype.hasOwnProperty.call(cookies,name)) {
var args = Array.prototype.slice.call(arguments,1);
args.unshift(name,null,-1);
set.apply(this,args);
return true;
}
return false;
};
})(jQuery);
Binary file added assets/socialshare/images/box_fbshare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/box_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/box_tumblr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/de/dummy_facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_buffer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_delicious.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_disqus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_flattr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_gplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_hackernews.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_reddit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_twitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_box_xing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_buffer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_delicious.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_disqus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_flattr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_gplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_gplus_alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/socialshare/images/dummy_hackernews.png
Binary file added assets/socialshare/images/dummy_linkedin.png
Binary file added assets/socialshare/images/dummy_pinterest.png
Binary file added assets/socialshare/images/dummy_reddit.png
Binary file added assets/socialshare/images/dummy_stumbleupon.png
Binary file added assets/socialshare/images/dummy_twitter.png
Binary file added assets/socialshare/images/dummy_xing.png
Binary file added assets/socialshare/images/es/dummy_box_facebook.png
Binary file added assets/socialshare/images/es/dummy_facebook.png
Binary file added assets/socialshare/images/fbshare.png
Binary file added assets/socialshare/images/fr/dummy_box_facebook.png
Binary file added assets/socialshare/images/fr/dummy_facebook.png
Binary file added assets/socialshare/images/fr/dummy_twitter.png
Binary file added assets/socialshare/images/mail.png
Binary file added assets/socialshare/images/nl/dummy_box_facebook.png
Binary file added assets/socialshare/images/nl/dummy_facebook.png
Binary file added assets/socialshare/images/nl/dummy_twitter.png
Binary file added assets/socialshare/images/pt/dummy_box_facebook.png
Binary file added assets/socialshare/images/pt/dummy_box_twitter.png
Binary file added assets/socialshare/images/pt/dummy_facebook.png
Binary file added assets/socialshare/images/pt/dummy_twitter.png
Binary file added assets/socialshare/images/ru/dummy_box_facebook.png
Binary file added assets/socialshare/images/ru/dummy_facebook.png
Binary file added assets/socialshare/images/settings.png
Binary file added assets/socialshare/images/tumblr.png

Large diffs are not rendered by default.

Large diffs are not rendered by default.