mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
generate css classes for each mime type, #328
This commit is contained in:
parent
f88cdac000
commit
6a3e7a5a8e
@ -168,9 +168,24 @@ async function getExtraClasses(note) {
|
|||||||
|
|
||||||
extraClasses.push(note.type);
|
extraClasses.push(note.type);
|
||||||
|
|
||||||
|
if (note.mime) { // some notes should not have mime type (e.g. render)
|
||||||
|
extraClasses.push(getMimeTypeClass(note.mime));
|
||||||
|
}
|
||||||
|
|
||||||
return extraClasses.join(" ");
|
return extraClasses.join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMimeTypeClass(mime) {
|
||||||
|
const semicolonIdx = mime.indexOf(';');
|
||||||
|
|
||||||
|
if (semicolonIdx !== -1) {
|
||||||
|
// stripping everything following the semicolon
|
||||||
|
mime = mime.substr(0, semicolonIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'mime-' + mime.toLowerCase().replace(/[\W_]+/g,"-");
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
prepareTree,
|
prepareTree,
|
||||||
prepareBranch,
|
prepareBranch,
|
||||||
|
@ -801,4 +801,9 @@ div[data-notify="container"] {
|
|||||||
100% {
|
100% {
|
||||||
transform: rotate(360deg);
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ck-content .image > figcaption {
|
||||||
|
color: var(--main-text-color);
|
||||||
|
background-color: var(--accented-background-color);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user