2014-04-23 23:38:53 -04:00
|
|
|
/*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */
|
|
|
|
|
2014-02-15 03:44:53 +00:00
|
|
|
$(function() {
|
|
|
|
if($('#updatecheck').length !== 0){
|
|
|
|
$.getJSON('https://api.github.com/repos/shish/shimmie2/commits', function(data){
|
|
|
|
var c = data[0];
|
2014-04-19 02:58:36 -04:00
|
|
|
$('#updatecheck').html('<a href="'+ c.html_url+'">'+ c.sha+'</a>' + " ("+ c.commit.message+")");
|
2014-02-15 03:44:53 +00:00
|
|
|
|
2014-04-19 02:58:36 -04:00
|
|
|
var params = $.param({sha: c.sha, date: c.commit.committer.date});
|
2014-02-15 03:44:53 +00:00
|
|
|
$('#updatelink').attr('href', function(i, val){ return val + "?" + params; });
|
|
|
|
$('#updatelink').text("Update");
|
|
|
|
}).fail(function(){
|
|
|
|
$('#updatecheck').text("Loading failed. (Github down?)");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|