54 lines
2.1 KiB
HTML
54 lines
2.1 KiB
HTML
---
|
|
layout: default
|
|
footer: hidden
|
|
ogdescription: "Check out more puns at 2punny.uni.me! "
|
|
ogisarticle: true
|
|
---
|
|
<main class="pun">
|
|
<div class="puncontent" style="background: {{ page.background }}; color: {{ page.color }};">
|
|
{{ content }}
|
|
</div>
|
|
<div class="share">
|
|
<a class="btn previous{% if page.previous %} opaque{% else %} disabled noclick{% endif %}" href="{{ page.previous.url }}"><i class="icon-arrow-left"></i><span>Prev</span></a>
|
|
<a class="btn facebook" href="#facebook"><i class="icon-facebook"></i><span class="hidewhensmall">Facebook</span></a>
|
|
<a class="btn twitter" href="#twitter"><i class="icon-twitter"></i><span class="hidewhensmall">Twitter</span></a>
|
|
<a class="btn next{% if page.next %} opaque{% else %} disabled noclick{% endif %}" href="{{ page.next.url }}"><span>Next</span><i class="icon-arrow-right"></i></a>
|
|
</div>
|
|
</main>
|
|
<script>
|
|
var rawurl = "http://2punny.uni.me" + window.location.pathname;
|
|
var url = encodeURI(rawurl);
|
|
var text = encodeURI(document.querySelector(".puncontent").innerText.replace("\n", "") + " | " + "Funny? Get more puns on 2punny");
|
|
|
|
document.querySelector(".twitter").addEventListener("click", function (e) {
|
|
e.preventDefault();
|
|
window.open("https://twitter.com/share?url=" + url + "&text=" + text + "", "_blank", "height=320,width=480");
|
|
});
|
|
|
|
document.querySelector(".facebook").addEventListener("click", function (e) {
|
|
e.preventDefault();
|
|
// window.open("https://www.facebook.com/dialog/share?app_id=556080077853061&display=popup&href=" + url + "&redirect_uri=" + url + "", "_blank", "height=320,width=480");
|
|
FB.ui(
|
|
{
|
|
method: 'share',
|
|
href: rawurl
|
|
}, function(response){});
|
|
});
|
|
|
|
window.fbAsyncInit = function() {
|
|
FB.init({
|
|
appId : '556080077853061',
|
|
xfbml : false,
|
|
version : 'v2.0'
|
|
});
|
|
};
|
|
|
|
(function(d, s, id){
|
|
var js, fjs = d.getElementsByTagName(s)[0];
|
|
if (d.getElementById(id)) {return;}
|
|
js = d.createElement(s); js.id = id;
|
|
js.src = "//connect.facebook.net/en_US/sdk.js";
|
|
fjs.parentNode.insertBefore(js, fjs);
|
|
}(document, 'script', 'facebook-jssdk'));
|
|
|
|
</script> |