summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java
diff options
context:
space:
mode:
authorTom <tw201207@gmail.com>2014-11-12 20:31:12 +0100
committerTom <tw201207@gmail.com>2014-11-12 20:31:12 +0100
commit3e1336cc6d32511daf2acab9c45a517cd3b10058 (patch)
tree525cf009501d0ba340e17f12154dbd54bf7af602 /src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java
parent4dee2c5ee06677d12d5719bc18199a0affd13cc0 (diff)
downloadgitblit-3e1336cc6d32511daf2acab9c45a517cd3b10058.tar.gz
gitblit-3e1336cc6d32511daf2acab9c45a517cd3b10058.zip
Opacity adjustments for image diffs
* ImageDiffHandler adds the slider; styled in gitblit.css * imgdiff.js is a little bottom-loaded Javascript that adjusts the opacity on sliders' scroll events. * The three diff pages add this bottom script to the page if needed * GitBlitDiffFormatter: center image diffs.
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java6
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)));