diff options
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java b/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java index 517e80b8..71516ec8 100644 --- a/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java +++ b/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java @@ -55,6 +55,9 @@ public class BlobDiffPage extends RepositoryPage { ImageDiffHandler handler = new ImageDiffHandler(getContextUrl(), repositoryName,
parent.getName(), commit.getName(), imageExtensions);
diff = DiffUtils.getDiff(r, commit, blobPath, DiffOutputType.HTML, handler).content;
+ if (handler.getImgDiffCount() > 0) {
+ addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs
+ }
add(new BookmarkablePageLink<Void>("patchLink", PatchPage.class,
WicketUtils.newPathParameter(repositoryName, objectId, blobPath)));
} else {
@@ -63,6 +66,9 @@ public class BlobDiffPage extends RepositoryPage { ImageDiffHandler handler = new ImageDiffHandler(getContextUrl(), repositoryName,
baseCommit.getName(), commit.getName(), imageExtensions);
diff = DiffUtils.getDiff(r, baseCommit, commit, blobPath, DiffOutputType.HTML, handler).content;
+ if (handler.getImgDiffCount() > 0) {
+ addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs
+ }
add(new BookmarkablePageLink<Void>("patchLink", PatchPage.class,
WicketUtils.newBlobDiffParameter(repositoryName, baseObjectId, objectId,
blobPath)));
|