import com.gitblit.Keys;\r
import com.gitblit.models.FederationModel;\r
import com.gitblit.models.Metric;\r
+import com.gitblit.utils.DiffUtils.DiffComparator;\r
import com.gitblit.utils.HttpUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.utils.TimeUtils;\r
public static void addCssClass(Component container, String value) {\r
container.add(new AttributeAppender("class", new Model<String>(value), " "));\r
}\r
- \r
+\r
public static void setCssStyle(Component container, String value) {\r
container.add(new SimpleAttributeModifier("style", value));\r
}\r
return params.getString("st", null);\r
}\r
\r
+ public static DiffComparator getDiffComparator(PageParameters params) {\r
+ int ordinal = params.getInt("w", 0);\r
+ return DiffComparator.values()[ordinal];\r
+ }\r
+\r
public static int getPage(PageParameters params) {\r
// index from 1\r
return params.getInt("pg", 1);\r
\r
final String blobPath = WicketUtils.getPath(params);\r
final String baseObjectId = WicketUtils.getBaseObjectId(params);\r
- final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL;\r
+ final DiffComparator diffComparator = WicketUtils.getDiffComparator(params);\r
\r
Repository r = getRepository();\r
RevCommit commit = getCommit();\r
RevCommit baseCommit = JGitUtils.getCommit(r, baseObjectId);\r
ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName,\r
baseCommit.getName(), commit.getName(), imageExtensions);\r
- diff = DiffUtils.getDiff(r, baseCommit, commit, blobPath, DiffComparator.WS_IGNORE_ALL, DiffOutputType.HTML, handler).content;\r
+ diff = DiffUtils.getDiff(r, baseCommit, commit, blobPath, diffComparator, DiffOutputType.HTML, handler).content;\r
if (handler.getImgDiffCount() > 0) {\r
addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs\r
}\r
final ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName,
parents.isEmpty() ? null : parents.get(0), commit.getName(), imageExtensions);
- final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL;
+ final DiffComparator diffComparator = WicketUtils.getDiffComparator(params);
final DiffOutput diff = DiffUtils.getCommitDiff(r, commit, diffComparator, DiffOutputType.HTML, handler);
if (handler.getImgDiffCount() > 0) {
addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs
final ImageDiffHandler handler = new ImageDiffHandler(this, repositoryName,
fromCommit.getName(), toCommit.getName(), imageExtensions);
- final DiffComparator diffComparator = DiffComparator.WS_IGNORE_ALL;
+ final DiffComparator diffComparator = WicketUtils.getDiffComparator(params);
final DiffOutput diff = DiffUtils.getDiff(r, fromCommit, toCommit, diffComparator, DiffOutputType.HTML, handler);
if (handler.getImgDiffCount() > 0) {
addBottomScript("scripts/imgdiff.js"); // Tiny support script for image diffs