Tom
2014-11-11 7dd99fe7474604f314c01bcd4123eb7cbacfb583
refs
author Tom <tw201207@gmail.com>
Tuesday, November 11, 2014 01:52 -0500
committer Tom <tw201207@gmail.com>
Tuesday, November 11, 2014 02:00 -0500
commit7dd99fe7474604f314c01bcd4123eb7cbacfb583
tree 84f3b0da388cdc79c2b31e6fab5619fc1617e455 tree | zip | gz
parent 8cd4feca58b55f311a543c744777e930c4f4b34a view | diff
Image diffs

Ticket 88: https://dev.gitblit.com/tickets/gitblit.git/88

Based on Lea Verou's pure CSS slider:
http://lea.verou.me/2014/07/image-comparison-slider-with-pure-css/

* Add a callback interface, pass it through DiffUtils to the
GitBlitDiffFormatter. Is needed because the rendering needs access
to the repositoryName and other things that are known only at higher
levels.

* New class ImageDiffHandler responsible for rendering an image diff.
Called for all binary diffs, doesn't do anything if it's not an
image. HTML is generated via JSoup: no worries about forgetting to
close a tag, not about HTML escaping, nor about XSS.

* The 3 diff pages set up such an ImageDIffHandler and pass it along.

* CSS changes: from Lea Verou, with some minor improvements.

I think in the long run there'll be no way around rewriting the
HTML diff formatter from scratch, not using the standard JGit
DiffFormatter at all.
2 files added
6 files modified
502 ■■■■■ changed files
src/main/java/com/gitblit/utils/DiffUtils.java 97 ●●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java 82 ●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/utils/HtmlBuilder.java 96 ●●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/BlobDiffPage.java 14 ●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/CommitDiffPage.java 8 ●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/ComparePage.java 7 ●●●● diff | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/ImageDiffHandler.java 138 ●●●●● diff | view | raw | blame | history
src/main/resources/gitblit.css 60 ●●●●● diff | view | raw | blame | history