mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	fix CSS class of user theme
This commit is contained in:
		
							parent
							
								
									f89537037e
								
							
						
					
					
						commit
						c08524c977
					
				| @ -597,7 +597,7 @@ button.icon-button { | |||||||
|     max-width: 100%; |     max-width: 100%; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| pre { | pre:not(.CodeMirror-line) { | ||||||
|     color: var(--main-text-color) !important; |     color: var(--main-text-color) !important; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -43,16 +43,29 @@ async function update(name, value) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function getUserThemes() { | async function getUserThemes() { | ||||||
|     return (await attributes.getNotesWithLabel('appTheme')) |     const notes = await attributes.getNotesWithLabel('appTheme'); | ||||||
|         .map(note => { | 
 | ||||||
|             return { |     const ret = []; | ||||||
|                 val: note.title, | 
 | ||||||
|  |     for (const note of notes) { | ||||||
|  |         let value; | ||||||
|  | 
 | ||||||
|  |         if (await note.hasLabel('appThemeClass')) { | ||||||
|  |             value = await note.getLabelValue('appThemeClass'); | ||||||
|  |         } else { | ||||||
|  |             value = note.title.toLowerCase().replace(/[^a-z0-9]/gi, '-'); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         ret.push({ | ||||||
|  |             val: value, | ||||||
|             title: note.title, |             title: note.title, | ||||||
|             noteId: note.noteId |             noteId: note.noteId | ||||||
|             }; |  | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     return ret; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| module.exports = { | module.exports = { | ||||||
|     getOptions, |     getOptions, | ||||||
|     updateOption, |     updateOption, | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ const BUILTIN_ATTRIBUTES = [ | |||||||
|     { type: 'label', name: 'disableInclusion' }, |     { type: 'label', name: 'disableInclusion' }, | ||||||
|     { type: 'label', name: 'appCss' }, |     { type: 'label', name: 'appCss' }, | ||||||
|     { type: 'label', name: 'appTheme' }, |     { type: 'label', name: 'appTheme' }, | ||||||
|  |     { type: 'label', name: 'appThemeClass' }, | ||||||
|     { type: 'label', name: 'hideChildrenOverview' }, |     { type: 'label', name: 'hideChildrenOverview' }, | ||||||
|     { type: 'label', name: 'hidePromotedAttributes' }, |     { type: 'label', name: 'hidePromotedAttributes' }, | ||||||
|     { type: 'label', name: 'readOnly' }, |     { type: 'label', name: 'readOnly' }, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam