fixing GA, updating github api for counts

This commit is contained in:
Dave Gandy 2012-06-14 16:59:29 -04:00
parent ce7598b538
commit 2f56226f56
2 changed files with 33 additions and 7 deletions

View File

@ -17,12 +17,17 @@ $(function() {
} }
}); });
$.ajax({ $.ajax({
url: 'http://github.com/api/v2/json/repos/show/FortAwesome/Font-Awesome', url: 'https://api.github.com/repos/fortawesome/Font-Awesome',
dataType: 'jsonp', dataType: 'jsonp',
success: function(data) { success: function(data) {
$('#watchers').html(data.repository.watchers); $('#watchers').html(data.data.watchers);
$('#forks').html(data.repository.forks); $('#forks').html(data.data.forks);
},
error:function(xhr, ajaxOptions, thrownError) {
console.log(xhr);
console.log(thrownError);
} }
}); });
@ -45,6 +50,7 @@ $(function() {
var $item = $(event.currentTarget); var $item = $(event.currentTarget);
var $iconName = $item.find("i").attr("class"); var $iconName = $item.find("i").attr("class");
_gaq.push(['_trackEvent', 'iconClick', $iconName]);
mainRouter.navigate("icon/" + $iconName, {trigger: true}); mainRouter.navigate("icon/" + $iconName, {trigger: true});
firstInHistory = false; firstInHistory = false;

View File

@ -24,6 +24,18 @@
<![endif]--> <![endif]-->
<!-- Le fav and touch icons --> <!-- Le fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico"> <link rel="shortcut icon" href="assets/ico/favicon.ico">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30136587-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head> </head>
<body> <body>
@ -77,15 +89,23 @@
<div class="item"><div><i class="icon-flag"></i></div></div> <div class="item"><div><i class="icon-flag"></i></div></div>
</div> </div>
<!-- Carousel nav --> <!-- Carousel nav -->
<a class="carousel-control left" href="#iconCarousel" data-slide="prev"><i class="icon-arrow-left"></i></a> <a class="carousel-control left" href="#iconCarousel" data-slide="prev"
<a class="carousel-control right" href="#iconCarousel" data-slide="next"><i class="icon-arrow-right"></i></a> onClick="_gaq.push(['_trackEvent', 'iconCarousel', 'Prev']);">
<i class="icon-arrow-left"></i></a>
<a class="carousel-control right" href="#iconCarousel" data-slide="next"
onClick="_gaq.push(['_trackEvent', 'iconCarousel', 'Next']);">
<i class="icon-arrow-right"></i></a>
</div> </div>
<div class="hero-content"> <div class="hero-content">
<h1>Font Awesome</h1> <h1>Font Awesome</h1>
<p>The iconic font designed for use with Twitter Bootstrap</p> <p>The iconic font designed for use with Twitter Bootstrap</p>
<div class="actions"> <div class="actions">
<a class="btn btn-primary btn-large" href="https://github.com/FortAwesome/Font-Awesome/zipball/master"><i class="icon-download"></i>Download Font<br>Awesome v2.0</a> <a class="btn btn-primary btn-large" href="https://github.com/FortAwesome/Font-Awesome/zipball/master"
<a class="btn btn-large btn-github" href="https://github.com/FortAwesome/Font-Awesome" target="_blank"><i class="icon-github"></i>View Project<br>on GitHub</a> onClick="_gaq.push(['_trackEvent', 'Outbound Link', 'Download on GitHub']);">
<i class="icon-download"></i>Download Font<br>Awesome v2.0</a>
<a class="btn btn-large btn-github" href="https://github.com/FortAwesome/Font-Awesome" target="_blank"
onClick="_gaq.push(['_trackEvent', 'Outbound Link', 'View Project on GitHub']);">
<i class="icon-github"></i>View Project<br>on GitHub</a>
</div> </div>
</div> </div>
</div> </div>