-
Notifications
You must be signed in to change notification settings - Fork 0
/
commit.erb
29 lines (26 loc) · 1.1 KB
/
commit.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$('commit_index').innerHTML = "<%= j @commit_index + 1 %>";
$('commit_message').innerHTML = "<%= j(h(@commit.message)) %>";
$('committer_author_details').innerHTML = "<%= j(h(@commit.committer.name_email)) %><%= j(h(@commit.committer != @commit.author ? " for #{ @commit.author.name_email}": "")) %>";
$('committer_date_time').innerHTML = "<%= j @commit.date.strftime("%A %d/%m/%Y %I:%M %p") %>";
$('diff_message').innerHTML = "<%= j(h(@diff_data[:message])) %>";
queue = [];
<% if @diff_data[:type] == 'rename' %>
queue.push(function()
{
scrollToObject($$("body")[0], runNextInQueue); //TODO Double-check, needs delay
});
<% end %>
<% @textual_add_remove_changes.each do |change| %>
<% if change[:mode] == :add %>
addHunk(<%= change[:start] %>, "<%= j change[:lines] %>");
<% elsif change[:mode] == :remove %>
removeHunk(<%= change[:start] %>, <%= change[:times] %>);
<% end %>
<% end %>
<% if (@commit_index < @commits.length - 1) %>
queue.push(function()
{
new Ajax.Request("/commit/<%= @commit_index.to_i + 1 %>", { method: 'get' });
});
<% end %>
if(queue.length > 0) (queue.shift())();