Skip to content

Instantly share code, notes, and snippets.

@mcansky
Created February 27, 2011 14:11
Show Gist options
  • Save mcansky/846201 to your computer and use it in GitHub Desktop.
Save mcansky/846201 to your computer and use it in GitHub Desktop.
some jquery
$("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