summaryrefslogtreecommitdiff
path: root/static/js/soho.js
diff options
context:
space:
mode:
authorAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2020-10-17 14:40:58 +0200
committerAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2020-10-17 14:40:58 +0200
commitb607c6857a95b49df2e71042b82b41ca15d26eb3 (patch)
treec6dda838ab985454d1ca1bd06a32c231d5ecf1d9 /static/js/soho.js
parentcd5751ef1425db3ed7e46fcaa7fafe53e494c286 (diff)
Layout improvements
- Tagline - Share buttons - JSON LD - Tags - Style Fixes
Diffstat (limited to 'static/js/soho.js')
-rw-r--r--static/js/soho.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/static/js/soho.js b/static/js/soho.js
new file mode 100644
index 0000000..8b9a658
--- /dev/null
+++ b/static/js/soho.js
@@ -0,0 +1,48 @@
+$(document).ready(function(){
+
+ $(".twitter-share-button").click(function (e) {
+ e.preventDefault();
+ var self = $(this);
+ var url = encodeURIComponent(self.data("url"));
+ var text = encodeURIComponent(self.data("text"));
+
+ window.open(`https://twitter.com/intent/tweet?text=${text}&url=${url}`, "_blank").focus();
+ });
+
+ $(".linkedin-share-button").click(function (e) {
+ e.preventDefault();
+ var self = $(this);
+ var url = encodeURIComponent(self.data("url"));
+ // var text = encodeURIComponent(self.data("text"));
+
+ window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${url}`, "_blank").focus();
+ });
+
+ $(".facebook-share-button").click(function (e) {
+ e.preventDefault();
+ var self = $(this);
+ var url = encodeURIComponent(self.data("url"));
+ // var text = encodeURIComponent(self.data("text"));
+
+ window.open(`https://www.facebook.com/sharer/sharer.php?u=${url}`, "_blank").focus();
+ });
+
+ $(".telegram-share-button").click(function (e) {
+ e.preventDefault();
+ var self = $(this);
+ var url = encodeURIComponent(self.data("url"));
+ var text = encodeURIComponent(self.data("text"));
+
+ window.open(`https://t.me/share/url?url=${url}&text=${text}`, "_blank").focus();
+ });
+
+ $(".pinterest-share-button").click(function (e) {
+ e.preventDefault();
+ var self = $(this);
+ var url = encodeURIComponent(self.data("url"));
+ var text = encodeURIComponent(self.data("text"));
+
+ window.open(`https://pinterest.com/pin/create/button/?url=${url}&media=&description=${text}`, "_blank").focus();
+ });
+
+});