diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-05-01 19:32:50 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-05-01 19:32:50 -0400 |
| commit | 547f7002acbbe871e7cba5dfd4c1dfb3e057378f (patch) | |
| tree | 1a015ac104ea309d4938a89fec041d2bc811a123 /site/public/assets/javascripts | |
| parent | 54287ebd1ffc4fe00d1481ad8b4d14b3f23b1ffc (diff) | |
facebook lol
Diffstat (limited to 'site/public/assets/javascripts')
| -rw-r--r-- | site/public/assets/javascripts/_env.js | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index 2857069..1563afa 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -608,14 +608,37 @@ var Share = { init: function(){ $(document).on("click", ".fb", Share.facebook) $(document).on("click", ".tw", Share.twitter) + setTimeout(function(){ + window.fbAsyncInit = function() { + FB.init({ + appId : '643786815755427', + xfbml : true, + version : 'v2.3' + }); + }; + + (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')); + }, 1000) }, facebook: function (e) { e.preventDefault() - var link = window.location.href - var msg = $(".postname").html() - var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(link) + "&t=" + encodeURIComponent(msg) - window.open(url, "_blank") + // var link = window.location.href + // var msg = $(".postname").html() + // var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(link) + "&t=" + encodeURIComponent(msg) + // window.open(url, "_blank") + FB.ui({ + method: 'feed', + link: window.location.href, + caption: $(".postname").html(), + picture: $(".gallery img").first().attr("src"), + }, function(response){}); }, twitter: function (e) { |
