mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
track follows and likes from homepage, add fb plugin and twitter plugin
This commit is contained in:
parent
6655e673da
commit
92d29a224b
4 changed files with 68 additions and 2 deletions
|
@ -43,6 +43,7 @@
|
|||
<body>
|
||||
<?php echo $content ?>
|
||||
<div class="hide">
|
||||
<div id="fb-root"></div>
|
||||
<div id="js">
|
||||
<script src="/js/jquery-2.1.3.min.js"></script>
|
||||
<script src="/js/global.js"></script>
|
||||
|
@ -55,6 +56,30 @@
|
|||
ga('create', 'UA-60403362-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
(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#xfbml=1&version=v2.5&appId=1477813539180850";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
|
||||
window.twttr = (function(d,s,id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0],
|
||||
t = window.twttr || {};
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s);
|
||||
js.id = id;
|
||||
js.src = "//platform.twitter.com/widgets.js";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
|
||||
t._e = [];
|
||||
t.ready = function(f) {
|
||||
t._e.push(f);
|
||||
};
|
||||
|
||||
return t;
|
||||
}(document, "script", "twitter-wjs"));
|
||||
</script>
|
||||
<script>
|
||||
<?php echo implode("\n", Response::getJsCalls()) ?>
|
||||
|
|
|
@ -10,16 +10,27 @@
|
|||
<h3 class="cover-subtitle">Join a fully distributed network that makes information open to everyone.</h3>
|
||||
<div class="control-group spacer1">
|
||||
<div class="control-item">
|
||||
<a href="/get" class="btn-primary">Get LBRY</a>
|
||||
<a href="/get" class="btn-primary">Test LBRY</a>
|
||||
</div>
|
||||
<div class="control-item">
|
||||
<a href="/what" class="btn-alt">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="video">
|
||||
<div class="video" style="margin-bottom: 80px">
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/qMUbq3sbG-o?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
<div class="row-fluid content-constrained">
|
||||
<div class="span6 text-center">
|
||||
<div class="fb-page" data-href="https://www.facebook.com/lbryio" data-height="300" data-small-header="false" data-width="400"
|
||||
data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true">
|
||||
<div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/lbryio"><a href="https://www.facebook.com/lbryio">LBRY</a></blockquote></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6 text-center">
|
||||
<a width="400" class="twitter-timeline" href="https://twitter.com/LBRYio" data-widget-id="671104143034073088">Tweets by @LBRYio</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -21,6 +21,19 @@ $(document).ready(function() {
|
|||
var body = $('body');
|
||||
|
||||
body.on('click', 'a', onAnchorClick);
|
||||
|
||||
if (window.twttr)
|
||||
{
|
||||
twttr.ready(function (twttr) {
|
||||
twttr.events.bind('follow', onTwitterFollow);
|
||||
});
|
||||
}
|
||||
|
||||
window.fbAsyncInit = function()
|
||||
{
|
||||
window.FB.Event.subscribe('edge.create', onFacebookLike);
|
||||
};
|
||||
|
||||
//$(window).scroll(onBodyScroll);
|
||||
|
||||
function onAnchorClick()
|
||||
|
@ -81,6 +94,17 @@ $(document).ready(function() {
|
|||
.height(width * ratio);
|
||||
}
|
||||
}
|
||||
|
||||
function onTwitterFollow (intentEvent)
|
||||
{
|
||||
if (!intentEvent) return;
|
||||
ga('send', 'social', 'Twitter', 'follow', window.location.href);
|
||||
}
|
||||
|
||||
function onFacebookLike(url)
|
||||
{
|
||||
ga('send', 'social', 'Facebook', 'like', window.location.href);
|
||||
}
|
||||
|
||||
$('.video > iframe').each(function() {
|
||||
var iframe = $(this);
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
@import "global";
|
||||
.content-constrained
|
||||
{
|
||||
max-width: $max-content-width; /*we have more padding than desirable so numbers from ol can exceed container*/
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.content
|
||||
{
|
||||
margin-left: auto;
|
||||
|
|
Loading…
Add table
Reference in a new issue