Attempt 2 to fix FB
parent
d29e69a027
commit
39f22c6c93
|
@ -7,14 +7,15 @@ footer: hidden
|
|||
{{ content }}
|
||||
</div>
|
||||
<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 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>
|
||||
</main>
|
||||
<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");
|
||||
|
||||
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) {
|
||||
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: url
|
||||
// }, function(response){});
|
||||
// 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 : true,
|
||||
// version : 'v2.0'
|
||||
// });
|
||||
// };
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : '556080077853061',
|
||||
xfbml : true,
|
||||
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'));
|
||||
(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>
|
Loading…
Reference in New Issue