summaryrefslogtreecommitdiffstats
path: root/public/less
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-06-26 23:35:07 +0200
committerzeripath <art27@cantab.net>2019-06-26 22:35:07 +0100
commitda230412574daa9697b4cef24c7be6209b8884dc (patch)
tree24c1a7ba637c04fe9512643079572afe63d89d39 /public/less
parentedc94c70413048107ea728ff330f32ca3de6df88 (diff)
downloadgitea-da230412574daa9697b4cef24c7be6209b8884dc.tar.gz
gitea-da230412574daa9697b4cef24c7be6209b8884dc.zip
fix extra newlines when copying from diff in Firefox (#7288)
* fix extra newlines when copying from diff See https://bugzilla.mozilla.org/show_bug.cgi?id=1273836 Basically, the <pre><code> seems to add a forced newline that is not possible to get rid of via CSS, so I replaced it with just a <code>. Secondly, .lines-type-marker also forced a newline in the copied text, but that was possible to get rid of via user-select. Safari still has a extraneous newline in the copied text of unknown origin, but this should not block stop this PR. * simplify .line-type-marker * fix selector * remove erronous ^^^ * Fix empty split diff * Fix arc-theme-green * fix add comment * ensure line-num is copied too * Update templates/repo/diff/box.tmpl Co-Authored-By: zeripath <art27@cantab.net> * attempt to fix safari via removing <code> * remove useless whitespace at the end of 'class' * remove inter-tag whitespace for code <td>s * more inter-tag removal * final inter-tag removal * attempt to fix empty line copy * move and comment getLineContent * fix golint * make background grey for missing added code
Diffstat (limited to 'public/less')
-rw-r--r--public/less/_base.less3
-rw-r--r--public/less/_repository.less11
-rw-r--r--public/less/themes/arc-green.less8
3 files changed, 12 insertions, 10 deletions
diff --git a/public/less/_base.less b/public/less/_base.less
index 13ae1ad665..213ae2d2e6 100644
--- a/public/less/_base.less
+++ b/public/less/_base.less
@@ -160,7 +160,8 @@ a {
}
pre,
-code {
+code,
+.mono {
font: 12px @monospaced-fonts, monospace;
&.raw {
diff --git a/public/less/_repository.less b/public/less/_repository.less
index 8d38faf50c..681296b74d 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -1362,10 +1362,6 @@
border-top: 0;
}
- pre {
- margin: 0;
- }
-
.lines-num {
border-color: #d4d4d5;
border-right-width: 1px;
@@ -1405,7 +1401,7 @@
background-color: #99ff99;
}
- .lines-num[data-line-num]::before {
+ [data-line-num]::before {
content: attr(data-line-num);
text-align: right;
}
@@ -1413,9 +1409,10 @@
.lines-type-marker {
width: 10px;
min-width: 10px;
+ user-select: none;
}
- .line-type-marker[data-type-marker]::before {
+ [data-type-marker]::before {
content: attr(data-type-marker);
text-align: right;
display: inline-block;
@@ -1448,7 +1445,7 @@
// light gray for empty lines before / after commit
&.add-code td:nth-child(1),
&.add-code td:nth-child(2),
- &.del-code td:nth-child(3),
+ &.add-code td:nth-child(3),
&.del-code td:nth-child(4),
&.del-code td:nth-child(5),
&.del-code td:nth-child(6) {
diff --git a/public/less/themes/arc-green.less b/public/less/themes/arc-green.less
index d2fe2982d7..463a979434 100644
--- a/public/less/themes/arc-green.less
+++ b/public/less/themes/arc-green.less
@@ -1115,12 +1115,15 @@ a.ui.labels .label:hover {
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(1),
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(2),
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(3),
-.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(4) {
+.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(4),
+.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(5),
+.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(6) {
background-color: #2a2e3a;
}
-.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(3),
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(4),
+.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(5),
+.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(6),
.repository .diff-file-box .code-diff-split tbody tr td.add-code {
background-color: #283e2d !important;
border-color: #314a37 !important;
@@ -1128,6 +1131,7 @@ a.ui.labels .label:hover {
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(1),
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(2),
+.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(3),
.repository .diff-file-box .code-diff-split tbody tr td.del-code {
background-color: #3c2626 !important;
border-color: #634343 !important;