Created
February 27, 2011 14:11
-
-
Save mcansky/846201 to your computer and use it in GitHub Desktop.
some jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("span.repo_update").click(function() { | |
/*$("#repo_"+$(this).attr('title')+'_gif').fadeToggle();*/ | |
$.getJSON("/update_repo/" + $(this).attr('rel') + "&format=json", | |
function(data) { | |
console.log(data); | |
$('.repo_stuff').fadeOut(); | |
$("#"+data["div_id"]).html(''); | |
for (var issue in data.issues) | |
{ | |
/*= issue.edited_at.strftime("%d/%m/%Y %H:%M") | |
- issue.labels.each do |label| | |
%span.labels= link_to label, "https://github.com/#{repo.owner}/#{repo.name}/issues/labels/#{label}" */ | |
issue_number = "<span class='issue_number'>"+data.issues[issue].number+"</span>"; | |
issue_link = "<a href='"+data.issues[issue].url+"'>"+data.issues[issue].title+"</a>"; | |
issue_date = data.issues[issue].edited_at; | |
labels = "";/* | |
data.issues[issue] */ | |
$("#"+data.div_id).append("<div class='issue'><h3>"+issue_number+" "+issue_link+" "+issue_date+"</h3></div>"); | |
} | |
$("#"+data["div_id"]).fadeIn(); | |
} | |
) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment