Merge pull request 'Render inline file permalinks' (#2669) from Mai-Lapyst/forgejo:markup-add-filepreview into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2669 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
2e744dc991
25 changed files with 577 additions and 4 deletions
|
@ -40,6 +40,7 @@
|
|||
@import "./markup/content.css";
|
||||
@import "./markup/codecopy.css";
|
||||
@import "./markup/asciicast.css";
|
||||
@import "./markup/filepreview.css";
|
||||
|
||||
@import "./chroma/base.css";
|
||||
@import "./codemirror/base.css";
|
||||
|
|
|
@ -451,7 +451,8 @@
|
|||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.markup pre > code {
|
||||
.markup pre > code,
|
||||
.markup .file-preview code {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 100%;
|
||||
|
|
41
web_src/css/markup/filepreview.css
Normal file
41
web_src/css/markup/filepreview.css
Normal file
|
@ -0,0 +1,41 @@
|
|||
.markup table.file-preview {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.markup table.file-preview td {
|
||||
padding: 0 10px !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.markup table.file-preview tr {
|
||||
border-top: none;
|
||||
background-color: inherit !important;
|
||||
}
|
||||
|
||||
.markup .file-preview-box {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.markup .file-preview-box .header {
|
||||
padding: .5rem;
|
||||
padding-left: 1rem;
|
||||
border: 1px solid var(--color-secondary);
|
||||
border-bottom: none;
|
||||
border-radius: 0.28571429rem 0.28571429rem 0 0;
|
||||
background: var(--color-box-header);
|
||||
}
|
||||
|
||||
.markup .file-preview-box .warning {
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
padding: .5rem .5rem .5rem 1rem;
|
||||
}
|
||||
|
||||
.markup .file-preview-box .header > a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.markup .file-preview-box .table {
|
||||
margin-top: 0;
|
||||
border-radius: 0 0 0.28571429rem 0.28571429rem;
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
.code-view .lines-num:hover {
|
||||
.code-view .lines-num:hover,
|
||||
.file-preview .lines-num:hover {
|
||||
color: var(--color-text-dark) !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ export function initUnicodeEscapeButton() {
|
|||
|
||||
e.preventDefault();
|
||||
|
||||
const fileContent = btn.closest('.file-content, .non-diff-file-content');
|
||||
const fileView = fileContent?.querySelectorAll('.file-code, .file-view');
|
||||
const fileContent = btn.closest('.file-content, .non-diff-file-content, .file-preview-box');
|
||||
const fileView = fileContent?.querySelectorAll('.file-code, .file-view, .file-preview');
|
||||
if (btn.matches('.escape-button')) {
|
||||
for (const el of fileView) el.classList.add('unicode-escaped');
|
||||
hideElem(btn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue