diff --git a/html/commit.js b/html/commit.js
index 616fae0..22099f9 100644
--- a/html/commit.js
+++ b/html/commit.js
@@ -1,3 +1,4 @@
+var commit;
var Commit = Class.create({
initialize: function(obj) {
this.raw = obj.details;
@@ -31,8 +32,16 @@ var selectCommit = function(a) {
Controller.selectCommit_(a);
}
+var showDiffs = function() {
+ $("details").hide();
+ $("details").innerHTML = commit.diff;
+ highlightDiffs();
+ $("details").show();
+}
+
var doeHet = function() {
- var commit = new Commit(CommitObject);
+ commit = new Commit(CommitObject);
+
$("commitID").innerHTML = commit.sha;
$("authorID").innerHTML = commit.author_name + " <" + commit.author_email + ">";
$("date").innerHTML = commit.author_date;
@@ -48,12 +57,9 @@ var doeHet = function() {
});
$("message").innerHTML = commit.message.replace(/\n/g,"
");
- if (commit.diff.length < 1000000) {
- $("details").hide();
- $("details").innerHTML = commit.diff;
- highlightDiffs();
- $("details").show();
+ if (commit.diff.length < 10000) {
+ showDiffs();
} else {
- $("details").innerHTML = "This diff is currently too large to watch in detailed mode";
+ $("details").innerHTML = "This is a large commit. Click here to show the diff.";
}
}
diff --git a/html/commits.css b/html/commits.css
index 406ae17..244d59f 100644
--- a/html/commits.css
+++ b/html/commits.css
@@ -27,4 +27,13 @@ hr {
background-color: #999;
}
+a {
+ color: rgb(20, 79, 174);
+}
+
+a.showdiff {
+ text-decoration: none;
+ font-size: 1.3em;
+}
+