diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 1b49fa4..522aaa1 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -15,6 +15,7 @@ - (void) awakeFromNib { startFile = @"history"; + repository = historyController.repository; [super awakeFromNib]; [historyController addObserver:self forKeyPath:@"webCommit" options:0 context:@"ChangedCommit"]; } diff --git a/html/views/history/history.js b/html/views/history/history.js index 140fa9a..fb836df 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -172,7 +172,20 @@ var showDiff = function() { $("files").innerHTML += "" + name + "
"; } - highlightDiff(commit.diff, $("diff"), { "newfile" : newfile }); + var binaryDiff = function(filename) { + if (filename.match(/\.(png|jpg|pdf|icns|psd)$/i)) + return 'Display image'; + else + return "Binary file differs"; + } + + highlightDiff(commit.diff, $("diff"), { "newfile" : newfile, "binaryFile" : binaryDiff }); +} + +var showImage = function(element, filename) +{ + element.outerHTML = ''; + return false; } var loadExtendedCommit = function(commit)