From 75a907eeabb2983bda2bd1081eacb8a7d94db63b Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 24 Nov 2014 09:34:46 -0500 Subject: [PATCH] Add .bat and .cmd to the pretty print extensions --- src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java b/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java index 517e80b..ae737a5 100644 --- a/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java +++ b/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java @@ -52,17 +52,23 @@ if (StringUtils.isEmpty(baseObjectId)) { // use first parent RevCommit parent = commit.getParentCount() == 0 ? null : commit.getParent(0); - ImageDiffHandler handler = new ImageDiffHandler(getContextUrl(), repositoryName, + ImageDiffHandler handler = new ImageDiffHandler(this, 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 { // base commit specified RevCommit baseCommit = JGitUtils.getCommit(r, baseObjectId); - ImageDiffHandler handler = new ImageDiffHandler(getContextUrl(), repositoryName, + ImageDiffHandler handler = new ImageDiffHandler(this, 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))); -- Gitblit v1.9.1