mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	generate css classes for each mime type, #328
This commit is contained in:
		| @@ -168,9 +168,24 @@ async function getExtraClasses(note) { | ||||
|  | ||||
|     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(" "); | ||||
| } | ||||
|  | ||||
| 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 { | ||||
|     prepareTree, | ||||
|     prepareBranch, | ||||
|   | ||||
| @@ -801,4 +801,9 @@ div[data-notify="container"] { | ||||
|     100% { | ||||
|         transform: rotate(360deg); | ||||
|     } | ||||
| } | ||||
|  | ||||
| .ck-content .image > figcaption { | ||||
|     color: var(--main-text-color); | ||||
|     background-color: var(--accented-background-color); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user