Attempt 2 to fix FB
parent
d29e69a027
commit
39f22c6c93
|
@ -7,14 +7,15 @@ footer: hidden
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
<div class="share">
|
<div class="share">
|
||||||
{% if page.previous %}<a class="btn previous" href="{{ page.previous.url }}"><i class="icon-arrow-left"></i><span>Prev</span></a>{% endif %}
|
<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 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 twitter" href="#twitter"><i class="icon-twitter"></i><span class="hidewhensmall">Twitter</span></a>
|
||||||
{% if page.next %}<a class="btn next" href="{{ page.next.url }}"><span>Next</span><i class="icon-arrow-right"></i></a>{% endif %}
|
<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>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<script>
|
<script>
|
||||||
var url = encodeURI("http://2punny.uni.me" + window.location.pathname);
|
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");
|
var text = encodeURI(document.querySelector(".puncontent").innerText.replace("\n", "") + " | " + "Funny? Get more puns on 2punny");
|
||||||
|
|
||||||
document.querySelector(".twitter").addEventListener("click", function (e) {
|
document.querySelector(".twitter").addEventListener("click", function (e) {
|
||||||
|
@ -24,28 +25,28 @@ document.querySelector(".twitter").addEventListener("click", function (e) {
|
||||||
|
|
||||||
document.querySelector(".facebook").addEventListener("click", function (e) {
|
document.querySelector(".facebook").addEventListener("click", function (e) {
|
||||||
e.preventDefault();
|
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");
|
// 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(
|
FB.ui(
|
||||||
// {
|
{
|
||||||
// method: 'share',
|
method: 'share',
|
||||||
// href: url
|
href: rawurl
|
||||||
// }, function(response){});
|
}, function(response){});
|
||||||
});
|
});
|
||||||
|
|
||||||
// window.fbAsyncInit = function() {
|
window.fbAsyncInit = function() {
|
||||||
// FB.init({
|
FB.init({
|
||||||
// appId : '556080077853061',
|
appId : '556080077853061',
|
||||||
// xfbml : true,
|
xfbml : true,
|
||||||
// version : 'v2.0'
|
version : 'v2.0'
|
||||||
// });
|
});
|
||||||
// };
|
};
|
||||||
|
|
||||||
// (function(d, s, id){
|
(function(d, s, id){
|
||||||
// var js, fjs = d.getElementsByTagName(s)[0];
|
var js, fjs = d.getElementsByTagName(s)[0];
|
||||||
// if (d.getElementById(id)) {return;}
|
if (d.getElementById(id)) {return;}
|
||||||
// js = d.createElement(s); js.id = id;
|
js = d.createElement(s); js.id = id;
|
||||||
// js.src = "//connect.facebook.net/en_US/sdk.js";
|
js.src = "//connect.facebook.net/en_US/sdk.js";
|
||||||
// fjs.parentNode.insertBefore(js, fjs);
|
fjs.parentNode.insertBefore(js, fjs);
|
||||||
// }(document, 'script', 'facebook-jssdk'));
|
}(document, 'script', 'facebook-jssdk'));
|
||||||
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue