DiffHilighter: Specific the div in which to hilight

Previously, the diff hilighter was a bit odd in that it would
just search for elements with a diff and highlight those. While
useful in theory, this wasn't used at all. We change it to
receive the diff to hilight, which makes the code somewhat simpler.
This commit is contained in:
Pieter de Bie
2008-11-25 16:14:58 +01:00
parent f05d0188fc
commit 7e2707d979
5 changed files with 71 additions and 82 deletions
+2 -4
View File
@@ -26,7 +26,6 @@ var showFileChanges = function(file, cached) {
if (!file)
return;
$("diff").style.display = 'none';
hideNotification();
hideState();
@@ -49,7 +48,6 @@ var showFileChanges = function(file, cached) {
}
displayDiff(changes, cached);
$("diff").style.display = '';
}
var diffHeader;
@@ -60,8 +58,8 @@ var displayDiff = function(diff, cached)
diffHeader = diff.split("\n").slice(0,4).join("\n");
originalDiff = diff;
$("diff").innerHTML = diff.escapeHTML();
highlightDiffs();
$("diff").style.display = "";
highlightDiff(diff, $("diff"));
hunkHeaders = $("diff").getElementsByClassName("hunkheader");
for (i = 0; i < hunkHeaders.length; ++i) {