The Unified and Autonomous Development Platform
Fix the issue that markdown headline links is missing
robin shine7afe022d095b
diff --git a/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.css b/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.cssindex b085cecfed..88a16e20aa 100644--- a/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.css+++ b/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.css@@ -50,44 +50,33 @@.md-preview .task-list-item input {margin-right: 8px;}-.md-preview .permalinked {- position: relative;- margin-left: -20px;- padding-left: 20px;-}.md-preview .permalinked a.permalink {- position: absolute;display: none;}.md-preview .permalinked:hover a.permalink {- display: inherit;+ display: inline;}.md-preview h1.permalinked a.permalink {- font-size: 16px;- left: 3px;- top: 11px;+ margin-left: 12px;+ font-size: 24px;}.md-preview h2.permalinked a.permalink {- font-size: 15px;- left: 3px;- top: 8px;+ margin-left: 10px;+ font-size: 20px;}.md-preview h3.permalinked a.permalink {- font-size: 14px;- top: 6px;- left: 3px;+ margin-left: 8px;+ font-size: 16px;}.md-preview h4.permalinked a.permalink {- font-size: 13px;- top: 3px;- left: 4px;+ margin-left: 6px;+ font-size: 14px;}.md-preview h5.permalinked a.permalink {+ margin-left: 4px;font-size: 12px;- top: 2px;- left: 5px;}.md-preview h6.permalinked a.permalink {- font-size: 11px;- left: 5px;+ margin-left: 2px;+ font-size: 10px;}diff --git a/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.js b/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.jsindex b1c699c843..17a1fb4fec 100644--- a/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.js+++ b/commons.wicket/src/main/java/com/gitplex/commons/wicket/component/markdown/markdown.js@@ -15,11 +15,11 @@ gitplex.commons.initMarkdownPanel = function($preview, taskCallback) {if ($anchor.length != 0) {$this.addClass("permalinked").append($anchor.html());$anchor.empty();- $this.prepend("<a href='#" + $anchor.attr("name") + "' class='permalink'><i class='fa fa-link'></i></a>");+ $this.append("<a href='#" + $anchor.attr("name") + "' class='permalink'><i class='fa fa-link'></i></a>");} else {var anchorName = encodeURIComponent($this.text());$this.addClass("permalinked").prepend("<a name='" + anchorName + "'></a>");- $this.prepend("<a href='#" + anchorName + "' class='permalink'><i class='fa fa-link'></i></a>");+ $this.append("<a href='#" + anchorName + "' class='permalink'><i class='fa fa-link'></i></a>");}});};\ No newline at end of filediff --git a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/blobview/blob-view.js b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/blobview/blob-view.jsindex 2683ebf6c0..ef7dfccd8d 100644--- a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/blobview/blob-view.js+++ b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/blobview/blob-view.js@@ -23,5 +23,10 @@ gitplex.server.blobView = function(containerId) {$body.scrollLeft(viewState.scroll.left);$body.scrollTop(viewState.scroll.top);}+ if (location.hash) { // scroll markdown headlines into view+ var element = document.getElementsByName(decodeURIComponent(location.hash.slice(1)))[0];+ if (element)+ element.scrollIntoView();+ }});};\ No newline at end of filediff --git a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.css b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.cssindex 67dcb0d9b4..ee257a8e7d 100644--- a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.css+++ b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.css@@ -47,5 +47,5 @@margin-left: 4px;}.file-list>.readme>.body {- padding: 20px;+ padding: 10px 20px;}\ No newline at end of filediff --git a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.js b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.jsindex 3f187d45bd..b97f4873a8 100644--- a/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.js+++ b/server.web/src/main/java/com/gitplex/server/web/component/depotfile/filelist/file-list.js@@ -13,6 +13,11 @@ gitplex.server.filelist = {$fileList.scrollLeft(viewState.scroll.left);$fileList.scrollTop(viewState.scroll.top);}+ if (location.hash) { // scroll markdown headlines into view+ var element = document.getElementsByName(decodeURIComponent(location.hash.slice(1)))[0];+ if (element)+ element.scrollIntoView();+ }});$fileList.on("storeViewState", function(e) {diff --git a/server.web/src/main/java/com/gitplex/server/web/component/sourceformat/SourceFormatPanel.java b/server.web/src/main/java/com/gitplex/server/web/component/sourceformat/SourceFormatPanel.javaindex 2081ead420..9d45a98f48 100644--- a/server.web/src/main/java/com/gitplex/server/web/component/sourceformat/SourceFormatPanel.java+++ b/server.web/src/main/java/com/gitplex/server/web/component/sourceformat/SourceFormatPanel.java@@ -65,7 +65,7 @@ public class SourceFormatPanel extends Panel {if (cookie != null)lineWrapMode = cookie.getValue();else- lineWrapMode = "No wrap";+ lineWrapMode = "Soft wrap";}@Override