From e1282d507f1a0321c4f25815470b0fa05265e6dd Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Fri, 7 Dec 2012 19:06:46 +0100 Subject: BranchGraph now loads async Centralized keyboard and drag events for BranchGraph --- lib/gitlab/graph/commit.rb | 2 +- lib/gitlab/graph/json_builder.rb | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/graph/commit.rb b/lib/gitlab/graph/commit.rb index af8d7828ce9..3d82c34432f 100644 --- a/lib/gitlab/graph/commit.rb +++ b/lib/gitlab/graph/commit.rb @@ -28,7 +28,7 @@ module Gitlab h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil? h[:id] = sha h[:date] = date - h[:message] = escape_once(message) + h[:message] = message h[:login] = author.email h end diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb index c2c3fa662a6..e6017644966 100644 --- a/lib/gitlab/graph/json_builder.rb +++ b/lib/gitlab/graph/json_builder.rb @@ -17,16 +17,15 @@ module Gitlab @commits = collect_commits @days = index_commits end - - def days_json - @days_json = @days.compact.map { |d| [d.day, d.strftime("%b")] }.to_json - end - - def commits_json - @commits_json = @commits.map(&:to_graph_hash).to_json + + def to_json + { + days: @days.compact.map { |d| [d.day, d.strftime("%b")] }, + commits: @commits.map(&:to_graph_hash) + }.to_json end - - protected + + protected # Get commits from repository # -- cgit v1.2.1 From 4b2ecbc420ca10ad78e0e6f921d6740c84f2574a Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Fri, 7 Dec 2012 22:05:17 +0100 Subject: Updated branch-graph, abstracted some code in seperate functions Removed unused Raphael.fn.popup --- lib/gitlab/graph/json_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb index e6017644966..a5914363393 100644 --- a/lib/gitlab/graph/json_builder.rb +++ b/lib/gitlab/graph/json_builder.rb @@ -18,11 +18,11 @@ module Gitlab @days = index_commits end - def to_json + def to_json(*args) { days: @days.compact.map { |d| [d.day, d.strftime("%b")] }, commits: @commits.map(&:to_graph_hash) - }.to_json + }.to_json(*args) end protected -- cgit v1.2.1