diff --git a/static/e_blog/b_share_btn.css b/static/e_blog/b_share_btn.css index de5d084..b18d167 100644 --- a/static/e_blog/b_share_btn.css +++ b/static/e_blog/b_share_btn.css @@ -59,4 +59,5 @@ .fb { background: #1877f2; } .tw { background: #000000; } .in { background: #0077b5; } -.copy { background: #444; } \ No newline at end of file +.copy { background: #444; } +.wa { background-color: #25D366; } \ No newline at end of file diff --git a/static/e_blog/copy_url.js b/static/e_blog/copy_url.js index cca67fb..9229779 100644 --- a/static/e_blog/copy_url.js +++ b/static/e_blog/copy_url.js @@ -55,3 +55,17 @@ if (btn_x) { openShareWindow(xShareUrl); }); } + +// compartir por whatsapp +// WhatsApp +const btn_wa = document.querySelector("button.wa"); +if (btn_wa) { + btn_wa.addEventListener("click", () => { + const whatsappText = encodeURIComponent("Mira este post interesante:"); + const whatsappUrl = `https://api.whatsapp.com/send?text=${whatsappText}%20${encode_url('wa')}`; + openShareWindow(whatsappUrl); + }); +} + + + diff --git a/templates/e_blog/b_post.html b/templates/e_blog/b_post.html index 66b9749..7a284f3 100644 --- a/templates/e_blog/b_post.html +++ b/templates/e_blog/b_post.html @@ -11,7 +11,6 @@ {% block body %} -{{data}}

{{data[5]}}

@@ -33,6 +32,7 @@ +