Skip to content

The Unified and Autonomous Development Platform

midwork

robin shine6f34d5ffd73b
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/CommonResourceReference.java b/commons.wicket/src/main/java/com/pmease/commons/wicket/CommonResourceReference.java
index f5d5114fe9..2231c49edb 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/CommonResourceReference.java
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/CommonResourceReference.java
@@ -12,6 +12,7 @@ import org.apache.wicket.request.resource.JavaScriptResourceReference;
import com.google.common.collect.Lists;
import com.pmease.commons.wicket.assets.Assets;
+import com.pmease.commons.wicket.assets.align.AlignResourceReference;
import com.pmease.commons.wicket.assets.autosize.AutoSizeResourceReference;
import de.agilecoders.wicket.core.Bootstrap;
@@ -83,10 +84,9 @@ public class CommonResourceReference extends JavaScriptResourceReference {
dependencies.add(CssHeaderItem.forReference(
new WebjarsCssResourceReference("font-awesome/current/css/font-awesome.min.css")));
+ dependencies.add(JavaScriptHeaderItem.forReference(AlignResourceReference.INSTANCE));
dependencies.add(JavaScriptHeaderItem.forReference(AutoSizeResourceReference.INSTANCE));
-
dependencies.add(JavaScriptHeaderItem.forReference(Assets.STICKY_JS));
-
dependencies.add(JavaScriptHeaderItem.forReference(Assets.ARE_YOU_SURE_JS));
dependencies.add(CssHeaderItem.forReference(Assets.COMMON_CSS));
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/codemirror/codemirror.css b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/codemirror/codemirror.css
index 7234ce8dc2..dd7fd0cb8e 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/codemirror/codemirror.css
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/codemirror/codemirror.css
@@ -2,7 +2,7 @@
background: #CCC;
}
.CodeMirror-mark {
- background: #E2C7F3;
+ background: #DADBFE;
}
.CodeMirror {
font-size: 13px;
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.css b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.css
index 724c86bcaa..42e0136576 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.css
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.css
@@ -452,7 +452,7 @@ span.move.icon {
display: block;
white-space: nowrap;
}
-#selection-popup>.content>a.link {
+#selection-popup>.content>a.permanent {
margin-bottom: 8px;
}
#selection-popup>.triangle {
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
index 51c276de03..5e921f9b42 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
@@ -7,7 +7,7 @@ var pmease = {};
String.prototype.escape = function() {
return (this + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
};
-pmease.commons = {
+pmease.commons = {
setupCollapse: function(triggerId, targetId) {
var trigger = $("#" + triggerId);
var target = $("#" + targetId);
@@ -553,14 +553,14 @@ pmease.commons = {
$("body").append("" +
"<div id='selection-popup'>" +
"<div class='content'>" +
- "<a class='link'><i class='fa fa-link'></i> Permanent link of this selection</a>" +
+ "<a class='permanent'><i class='fa fa-link'></i> Permanent link of this selection</a>" +
"<a class='comment'><i class='fa fa-comment'></i> Add comment for this selection</a>" +
"</div>" +
"<div class='triangle'></div>" +
"</div>");
var $selectionPopup = $("#selection-popup");
- $selectionPopup.data("show", function(position, selectionUrl, commentCallback, containerEl) {
+ $selectionPopup.data("show", function(position, permanentCallback, commentCallback, containerEl) {
var alignment = {
target: {left: position.left, top: position.top, width: 0, height: 0},
placement: {x: 50, y: 100, targetX: 0, targetY: 0}};
@@ -569,8 +569,8 @@ pmease.commons = {
if (Math.abs($selectionPopup.offset().top+$selectionPopup.outerHeight() - position.top)>10) {
$selectionPopup.find(".triangle").hide();
}
- $selectionPopup.find(".link").attr("href", selectionUrl);
- $selectionPopup.find(".comment").click(commentCallback);
+ permanentCallback($selectionPopup.find(".permanent"));
+ commentCallback($selectionPopup.find(".comment"));
$selectionPopup.data("container", containerEl);
});
Wicket.Event.subscribe('/ajax/call/complete', function() {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
index cfba6df6a8..ed38877820 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
@@ -185,6 +185,7 @@ public class TextDiffPanel extends Panel {
getMarkupId(), symbolTooltip.getMarkupId(),
change.getOldBlobIdent().revision, change.getNewBlobIdent().revision);
add(new Label("script", script).setEscapeModelStrings(false));
+ add(AttributeAppender.append("data-markfile", change.getPath()));
setOutputMarkupId(true);
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.css
index 3f5ec567af..086e1b13bc 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.css
@@ -136,6 +136,10 @@
.text-diff>.body>tbody>tr.expanded>td {
background: #F9F9F9;
}
+.text-diff>.body>tbody>tr>td.content>span.mark {
+ background: #DADBFE;
+ padding: 0;
+}
.diff-tokentooltip {
background-color: infobackground;
border: 1px solid black;
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js
index a8dc48ca1f..a5e2173d58 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js
@@ -34,12 +34,14 @@ gitplex.textdiff = {
$container.on("mouseup keyup", function() {
setTimeout(function() { // use a timeout to make sure selection remains stable after an action
var selection = window.getSelection();
- var hasValidSelection = false;
+ var displaySelectionPopup = false;
if (selection.rangeCount) {
var firstRange = selection.getRangeAt(0).cloneRange();
var lastRange = selection.getRangeAt(selection.rangeCount-1).cloneRange();
var $anchor = $(firstRange.startContainer);
var $focus = $(lastRange.endContainer);
+ var anchorOffset = firstRange.startOffset;
+ var focusOffset = lastRange.endOffset;
if ($anchor[0] != $focus[0] || selection.anchorOffset != selection.focusOffset) { // something must be selected
var $anchorDiff = $anchor;
if (!$anchorDiff.hasClass("text-diff"))
@@ -93,26 +95,62 @@ gitplex.textdiff = {
if ($anchorTd.hasClass("left") && $focusTd.hasClass("left")
|| $anchorTd.hasClass("right") && $focusTd.hasClass("right")
|| !$anchorTd.hasClass("left") && !$anchorTd.hasClass("right")) { // selection must not span the split view
+ displaySelectionPopup = true;
+
+ firstRange.collapse(true);
+ var startRect = firstRange.getClientRects()[0];
+ lastRange.collapse(false);
+ var endRect = lastRange.getClientRects()[0];
+ if (!startRect || !endRect) {
+ startRect = selection.getRangeAt(0).getClientRects()[0];
+ endRect = startRect;
+ }
+ var position = {
+ left: (startRect.left + endRect.right)/2,
+ top: startRect.top
+ };
+ position.left += $(window).scrollLeft();
+ position.top += $(window).scrollTop();
+
+ var markPos;
var $anchorTr = $anchorTd.closest("tr");
var $focusTr = $focusTd.closest("tr");
+
+ if ($anchor.is("td.content") && anchorOffset == 0 && $anchorTr.next().is("tr.expander")) {
+ if ($anchor.hasClass("left")) {
+ $anchor = $anchorTr.next().next().find("td.content.left");
+ $anchorTd = $anchor;
+ anchorOffset = $anchor.text().length;
+ } else if ($anchor.hasClass("right")) {
+ $anchor = $anchorTr.next().next().find("td.content.right");
+ $anchorTd = $anchor;
+ anchorOffset = $anchor.text().length;
+ } else {
+ $anchor = $anchorTr.next().next().find("td.content");
+ $anchorTd = $anchor;
+ anchorOffset = $anchor.text().length;
+ }
+ $anchorTr = $anchorTd.parent();
+ }
+ if ($focus.is("td.content") && focusOffset == 0 && $focusTr.prev().is("tr.expander")) {
+ if ($focus.hasClass("left")) {
+ $focus = $focusTr.prev().prev().find("td.content.left");
+ $focusTd = $focus;
+ focusOffset = $focus.text().length;
+ } else if ($focus.hasClass("right")) {
+ $focus = $focusTr.prev().prev().find("td.content.right");
+ $focusTd = $focus;
+ focusOffset = $focus.text().length;
+ } else {
+ $focus = $focusTr.prev().prev().find("td.content");
+ $focusTd = $focus;
+ focusOffset = $focus.text().length;
+ }
+ $focusTr = $focusTd.parent();
+ }
+
if ($anchorTr.nextAll("tr.expander").filter($focusTr.prevAll("tr.expander")).length == 0
&& $anchorTr.prevAll("tr.expander").filter($focusTr.nextAll("tr.expander")).length == 0) { // all lines between selection has been expanded
- hasValidSelection = true;
- firstRange.collapse(true);
- var startRect = firstRange.getClientRects()[0];
- lastRange.collapse(false);
- var endRect = lastRange.getClientRects()[0];
- if (!startRect || !endRect) {
- startRect = selection.getRangeAt(0).getClientRects()[0];
- endRect = startRect;
- }
- var position = {
- left: (startRect.left + endRect.right)/2,
- top: startRect.top
- };
- position.left += $(window).scrollLeft();
- position.top += $(window).scrollTop();
-
function getCursor($td, $node, nodeOffset) {
var oldLine, newLine;
var oldCh, newCh;
@@ -169,47 +207,180 @@ gitplex.textdiff = {
newCh: newCh
};
}
-
- var anchorCursor = getCursor($anchorTd, $anchor, firstRange.startOffset);
- var focusCursor = getCursor($focusTd, $focus, lastRange.endOffset);
-
- var mark;
- var commentCallback = function() {};
- var unableToCommentUrl = "http://wiki.pmease.com/display/gp/Add+Diff+Comment";
- if (anchorCursor.newLine) {
- if (focusCursor.newLine) {
- mark = "new." + anchorCursor.newLine+"."+anchorCursor.newCh
- + "-new." + focusCursor.newLine + "." + focusCursor.newCh;
+
+ var anchorCursor = getCursor($anchorTd, $anchor, anchorOffset);
+ var focusCursor = getCursor($focusTd, $focus, focusOffset);
+
+ if (anchorCursor.newLine && focusCursor.newLine) {
+ if (anchorCursor.newLine == focusCursor.newLine && anchorCursor.newCh < focusCursor.newCh
+ || anchorCursor.newLine < focusCursor.newLine) {
+ markPos = "new-" + anchorCursor.newLine + "." + anchorCursor.newCh
+ + "-" + focusCursor.newLine + "." + focusCursor.newCh;
} else {
- mark = "new." + anchorCursor.newLine+"."+anchorCursor.newCh
- + "-old." + focusCursor.oldLine + "." + focusCursor.oldCh;
- commentCallback = unableToCommentUrl;
+ displaySelectionPopup = false;
}
- } else {
- if (focusCursor.oldLine) {
- mark = "old." + anchorCursor.oldLine+"."+anchorCursor.oldCh
- + "-old." + focusCursor.oldLine + "." + focusCursor.oldCh;
+ } else if (anchorCursor.oldLine && focusCursor.oldLine) {
+ if (anchorCursor.oldLine == focusCursor.oldLine && anchorCursor.oldCh < focusCursor.oldCh
+ || anchorCursor.oldLine < focusCursor.oldLine) {
+ markPos = "old-" + anchorCursor.oldLine + "." + anchorCursor.oldCh
+ + "-" + focusCursor.oldLine + "." + focusCursor.oldCh;
} else {
- mark = "old." + anchorCursor.oldLine+"."+anchorCursor.oldCh
- + "-new." + focusCursor.newLine + "." + focusCursor.newCh;
- commentCallback = unableToCommentUrl;
+ displaySelectionPopup = false;
}
}
- var uri = URI(window.location.href);
- uri.removeSearch("path").addSearch("path", $container.data("path"));
- uri.removeSearch("mark").addSearch("mark", mark);
- $("#selection-popup").data("show")(position, uri.toString(),
- commentCallback, $container[0]);
}
+ var invalidSelectionUrl = "http://wiki.pmease.com/display/gp/Diff+Selection";
+ var permanentCallback = function($permanentLink) {
+ $permanentLink.off("click");
+ if (markPos) {
+ var uri = URI(window.location.href);
+ var markFile = $container.data("markfile");
+ uri.fragment({
+ markfile: markFile,
+ markpos: markPos
+ });
+ $permanentLink.attr("href", uri.toString());
+ $permanentLink.html("<i class='fa fa-link'></i> Permanent link of this selection");
+ $permanentLink.click(function() {
+ history.pushState(undefined, '', uri.toString());
+ gitplex.textdiff.mark(markFile, markPos);
+ return false;
+ });
+ } else {
+ $permanentLink.attr("href", invalidSelectionUrl);
+ $permanentLink.html("<i class='fa fa-link'></i> No permanent link to this selection, see why");
+ }
+ }
+ var commentCallback = function($commentLink) {
+ if (markPos) {
+ $commentLink.removeAttr("href");
+ $commentLink.html("<i class='fa fa-comment'></i> Add comment for this selection");
+ } else {
+ $commentLink.attr("href", invalidSelectionUrl);
+ $commentLink.html("<i class='fa fa-comment'></i> Unable to comment this selection, see why");
+ }
+ };
+ $("#selection-popup").data("show")(position, permanentCallback,
+ commentCallback, $container[0]);
}
}
}
}
}
- if (!hasValidSelection) {
+ if (!displaySelectionPopup) {
$("#selection-popup").hide();
}
}, 100);
});
+ },
+ mark: function(markFile, markPos) {
+ var $container = $('*[data-markfile="' + markFile.escape() + '"]');
+ var splitted = markPos.split("-");
+ var oldOrNew = splitted[0];
+ var anchorCursor = splitted[1].split(".");
+ var focusCursor = splitted[2].split(".");
+
+ var $anchorTd = $container.find("td.content[data-" + oldOrNew + "='" + (anchorCursor[0]-1) + "']");
+ var $focusTd = $container.find("td.content[data-" + oldOrNew + "='" + (focusCursor[0]-1) + "']");
+ if ($anchorTd.length == 2) {
+ if (oldOrNew == "old") {
+ $anchorTd = $anchorTd.first();
+ } else {
+ $anchorTd = $anchorTd.last();
+ }
+ }
+ if ($focusTd.length == 2) {
+ if (oldOrNew == "old") {
+ $focusTd = $focusTd.first();
+ } else {
+ $focusTd = $focusTd.last();
+ }
+ }
+
+ var $td = $anchorTd;
+ while (true) {
+ var ch = 0;
+ $td.contents().each(function() {
+ var $this = $(this);
+ var text = $this.text();
+ var nextCh = ch + text.length;
+
+ function markText(from, to) {
+ var text = $this.text();
+ var left = text.substring(0, from);
+ var middle = text.substring(from, to);
+ var right = text.substring(to);
+
+ var classes = "mark-affected ";
+ if ($this.is("span"))
+ classes += $this.attr("classes");
+
+ var $current = $this;
+ if (left.length != 0) {
+ $current.after("<span></span>");
+ $current = $current.next();
+ $current.attr("class", classes).text(left);
+ }
+
+ $current.after("<span></span>");
+ $current = $current.next();
+ $current.attr("class", classes + " mark").text(middle);
+
+ if (right.length != 0) {
+ $current.after("<span></span>");
+ $current = $current.next();
+ $current.attr("class", classes).text(right);
+ }
+ $this.remove();
+ }
+
+ if (!$td.is($anchorTd) && !$td.is($focusTd)) {
+ markText(0, text.length);
+ } else if ($td.is($anchorTd) && $td.is($focusTd)) {
+ if (focusCursor[1]>ch && anchorCursor[1]<nextCh) {
+ if (ch>=anchorCursor[1] && nextCh<=focusCursor[1]) {
+ markText(0, text.length);
+ } else if (ch<anchorCursor[1] && nextCh>focusCursor[1]) {
+ markText(anchorCursor[1]-ch, nextCh-focusCursor[1]);
+ } else if (ch<anchorCursor[1]) {
+ markText(anchorCursor[1]-ch, text.length);
+ } else {
+ markText(0, nextCh-focusCursor[1]);
+ }
+ }
+ } else if ($td.is($anchorTd)) {
+ if (ch>=anchorCursor[1]) {
+ markText(0, text.length);
+ } else if (nextCh>anchorCursor[1]) {
+ markText(text.length-nextCh+anchorCursor[1], text.length);
+ }
+ } else {
+ if (nextCh<=focusCursor[1]) {
+ markText(0, text.length);
+ } else if (ch<focusCursor[1]) {
+ markText(0, focusCursor[1]-ch);
+ }
+ }
+ });
+ if ($td.is($focusTd)) {
+ break;
+ } else {
+ if ($anchorTd.hasClass("left")) {
+ $td = $td.parent().next().children("td.left");
+ } else if ($anchorTd.hasClass("right")) {
+ $td = $td.parent().next().children("td.right");
+ } else {
+ $td = $td.parent().next().children("td.content");
+ }
+ }
+ }
}
}
+
+$(function() {
+ var uri = URI(window.location.href);
+ var fragment = uri.fragment(true);
+ if (fragment.markfile && fragment.markpos) {
+ gitplex.textdiff.mark(fragment.markfile, fragment.markpos);
+ }
+});
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html
index 5cfa6156e9..6cf1bba000 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html
@@ -1,7 +1,7 @@
<wicket:panel>
<div class="revision-diff">
<div class="title">
- Total <a class="total-changed"><span wicket:id="totalChanged"></span> changed files </a>
+ Total <a wicket:id="totalChanged" class="total-changed"></a>
<span wicket:id="filterPath"></span> <a wicket:id="clearPath" title="Clear filter path"><i class="fa fa-times"></i></a>
</div>
<div wicket:id="tooManyChanges" class="alert alert-warning">Sorry we are unable to display the full diff as there are too many changes</div>
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
index 0c8e961acb..d60710fa31 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java
@@ -16,6 +16,7 @@ import javax.servlet.http.Cookie;
import org.apache.commons.codec.Charsets;
import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.ajax.markup.html.AjaxLink;
@@ -224,11 +225,12 @@ public abstract class RevisionDiffPanel extends Panel {
protected void onInitialize() {
super.onInitialize();
- add(new Label("totalChanged", new AbstractReadOnlyModel<Integer>() {
+ Component totalChangedLink;
+ add(totalChangedLink = new Label("totalChanged", new AbstractReadOnlyModel<String>() {
@Override
- public Integer getObject() {
- return getChangesCount();
+ public String getObject() {
+ return getChangesCount() + " changed files ";
}
}));
@@ -269,6 +271,8 @@ public abstract class RevisionDiffPanel extends Panel {
Cookie cookie = request.getCookie("revisionDiff.showDiffStats");
if (cookie == null || !"yes".equals(cookie.getValue())) {
diffStats.add(AttributeAppender.append("style", "display:none;"));
+ } else {
+ totalChangedLink.add(AttributeAppender.append("class", "expanded"));
}
add(diffStats);
diffStats.add(new ListView<BlobChange>("diffStats", new AbstractReadOnlyModel<List<BlobChange>>() {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css
index b4744dd22c..85e67d53da 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css
@@ -10,7 +10,7 @@
font-weight: bold;
content: "\f107";
}
-.revision-diff .total-changed.diff-stats:after {
+.revision-diff .total-changed.expanded:after {
content: "\f106";
}
.revision-diff>ul>li.diff-stat {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.js
index 9d29e1a318..c12adfaadf 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.js
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.js
@@ -2,16 +2,16 @@ gitplex.revisionDiff = {
init: function() {
var cookieName = "revisionDiff.showDiffStats";
var $container = $(".revision-diff");
- var $diffStats = $container.find(".diff-stats");
+ var $diffStats = $container.find("ul.diff-stats");
var $diffStatsToggle = $container.find("a.total-changed");
$diffStatsToggle.click(function() {
if ($diffStats.is(":visible")) {
$diffStats.hide();
- $diffStatsToggle.removeClass("diff-stats");
+ $diffStatsToggle.removeClass("expanded");
Cookies.set(cookieName, "no", {expires: Infinity});
} else {
$diffStats.show();
- $diffStatsToggle.addClass("diff-stats");
+ $diffStatsToggle.addClass("expanded");
Cookies.set(cookieName, "yes", {expires: Infinity});
}
$(document.body).trigger('sticky_kit:recalc');
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/repofile/blobview/source/source-view.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/repofile/blobview/source/source-view.js
index bd7d60dba0..91ae17f692 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/repofile/blobview/source/source-view.js
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/repofile/blobview/source/source-view.js
@@ -75,7 +75,13 @@ gitplex.sourceview = {
var uri = URI(window.location.href);
uri.removeSearch("mark").addSearch("mark",
(from.line+1) + "," + (from.ch+1) + "-" + (to.line+1) + "," + (to.ch+1));
- $("#selection-popup").data("show")(position, uri.toString(), function(){}, $code[0]);
+ var permanentCallback = function($permanentLink) {
+ $permanentLink.attr("href", uri.toString());
+ };
+ var commentCallback = function($commentLink) {
+
+ };
+ $("#selection-popup").data("show")(position, permanentCallback, commentCallback, $code[0]);
} else {
$("#selection-popup").hide();
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/BasePage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/BasePage.java
index f9004aff3f..9b974c20fb 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/BasePage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/BasePage.java
@@ -17,7 +17,6 @@ import org.apache.wicket.request.resource.JavaScriptResourceReference;
import org.apache.wicket.request.resource.PackageResourceReference;
import com.pmease.commons.wicket.CommonPage;
-import com.pmease.commons.wicket.assets.align.AlignResourceReference;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.entity.Account;
import com.pmease.gitplex.core.manager.AccountManager;
@@ -102,8 +101,6 @@ public abstract class BasePage extends CommonPage {
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
- response.render(new PriorityHeaderItem(
- JavaScriptHeaderItem.forReference(AlignResourceReference.INSTANCE)));
response.render(new PriorityHeaderItem(
JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(BasePage.class, "base.js"))));
response.render(new PriorityHeaderItem(