clean up whitespace from project
This commit is contained in:
parent
415eddaf39
commit
368deb5992
50 changed files with 356 additions and 413 deletions
|
@ -39,7 +39,7 @@ function branchGraph(holder) {
|
|||
var cuday = 0, cumonth = "";
|
||||
r.rect(0, 0, days.length * 20 + 20, 20).attr({fill: "#474D57"});
|
||||
r.rect(0, 20, days.length * 20 + 20, 20).attr({fill: "#f7f7f7"});
|
||||
|
||||
|
||||
for (mm = 0; mm < days.length; mm++) {
|
||||
if(days[mm] != null){
|
||||
if(cuday != days[mm][0]){
|
||||
|
@ -50,7 +50,7 @@ function branchGraph(holder) {
|
|||
r.text(10 + mm * 20, 10, days[mm][1]).attr({font: "12px Fontin-Sans, Arial", fill: "#444"});
|
||||
cumonth = days[mm][1]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
for (i = 0; i < ii; i++) {
|
||||
|
@ -65,7 +65,7 @@ function branchGraph(holder) {
|
|||
}
|
||||
var t = r.text(x+5, y+5, shortrefs).attr({font: "12px Fontin-Sans, Arial", fill: "#666",
|
||||
title: longrefs, cursor: "pointer", rotation: "90"});
|
||||
|
||||
|
||||
var textbox = t.getBBox();
|
||||
t.translate(textbox.height/-4,textbox.width/2);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ function branchGraph(holder) {
|
|||
if (c.space == commits[i].space) {
|
||||
r.path("M" + (x - 5) + "," + (y + .0001) + "L" + (15 + 20 * c.time) + "," + (y + .0001))
|
||||
.attr({stroke: colors[c.space], "stroke-width": 2});
|
||||
|
||||
|
||||
} else if (c.space < commits[i].space) {
|
||||
r.path(["M", x - 5, y + .0001, "l-5-2,0,4,5,-2C",x-5,y,x -17, y+2, x -20, y-10,"L", cx,y-10,cx , cy])
|
||||
.attr({stroke: colors[commits[i].space], "stroke-width": 2});
|
||||
|
|
|
@ -12,20 +12,20 @@ class GraphCommit
|
|||
@_commit.send(m, *args, &block)
|
||||
end
|
||||
|
||||
# Method is adding time and space on the
|
||||
# list of commits. As well as returns date list
|
||||
# Method is adding time and space on the
|
||||
# list of commits. As well as returns date list
|
||||
# corelated with time set on commits.
|
||||
#
|
||||
# @param [Array<GraphCommit>] comits to index
|
||||
#
|
||||
# @return [Array<TimeDate>] list of commit dates corelated with time on commits
|
||||
# @return [Array<TimeDate>] list of commit dates corelated with time on commits
|
||||
def self.index_commits(commits)
|
||||
days, heads = [], []
|
||||
map = {}
|
||||
|
||||
commits.reverse.each_with_index do |c,i|
|
||||
c.time = i
|
||||
days[i] = c.committed_date
|
||||
days[i] = c.committed_date
|
||||
map[c.id] = c
|
||||
heads += c.refs unless c.refs.nil?
|
||||
end
|
||||
|
@ -35,7 +35,7 @@ class GraphCommit
|
|||
heads.sort! do |a,b|
|
||||
if a.name == "master"
|
||||
-1
|
||||
elsif b.name == "master"
|
||||
elsif b.name == "master"
|
||||
1
|
||||
else
|
||||
b.commit.committed_date <=> a.commit.committed_date
|
||||
|
@ -45,7 +45,7 @@ class GraphCommit
|
|||
j = 0
|
||||
heads.each do |h|
|
||||
if map.include? h.commit.id then
|
||||
j = mark_chain(j+=1, map[h.commit.id], map)
|
||||
j = mark_chain(j+=1, map[h.commit.id], map)
|
||||
end
|
||||
end
|
||||
days
|
||||
|
@ -55,15 +55,15 @@ class GraphCommit
|
|||
#
|
||||
# @param [Fixnum] space (row on the graph) to be set
|
||||
# @param [GraphCommit] the commit object.
|
||||
# @param [Hash<String,GraphCommit>] map of commits
|
||||
# @param [Hash<String,GraphCommit>] map of commits
|
||||
#
|
||||
# @return [Fixnum] max space used.
|
||||
# @return [Fixnum] max space used.
|
||||
def self.mark_chain(mark, commit, map)
|
||||
commit.space = mark if commit.space == 0
|
||||
m1 = mark - 1
|
||||
marks = commit.parents.collect do |p|
|
||||
if map.include? p.id and map[p.id].space == 0 then
|
||||
mark_chain(m1 += 1, map[p.id],map)
|
||||
mark_chain(m1 += 1, map[p.id],map)
|
||||
else
|
||||
m1 + 1
|
||||
end
|
||||
|
@ -71,5 +71,5 @@ class GraphCommit
|
|||
marks << mark
|
||||
marks.compact.max
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue