mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-05 21:33:52 +00:00
Give the AutoToggle palette a custom editor
This commit is contained in:
parent
998d5c8d8f
commit
6e4d7aa7f1
@ -57,7 +57,7 @@ LayoutSwitcher/Caption: Layout
|
|||||||
LoadedModules/Caption: Loaded Modules
|
LoadedModules/Caption: Loaded Modules
|
||||||
LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.
|
LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.
|
||||||
Palette/Caption: Palette
|
Palette/Caption: Palette
|
||||||
Palette/CustomEditor/Prompt: Custom editor for current palette:
|
Palette/CustomEditor/Prompt: Custom editor for current palette: <<palette-link>>
|
||||||
Palette/Editor/Clone/Caption: clone
|
Palette/Editor/Clone/Caption: clone
|
||||||
Palette/Editor/Clone/Prompt: It is recommended that you clone this shadow palette before editing it
|
Palette/Editor/Clone/Prompt: It is recommended that you clone this shadow palette before editing it
|
||||||
Palette/Editor/Delete/Hint: delete this entry from the current palette
|
Palette/Editor/Delete/Hint: delete this entry from the current palette
|
||||||
|
@ -5,9 +5,6 @@ tags: $:/tags/Palette
|
|||||||
type: application/x-tiddler-dictionary
|
type: application/x-tiddler-dictionary
|
||||||
color-scheme: [{$:/info/browser/darkmode}match[no]then[light]else[dark]]
|
color-scheme: [{$:/info/browser/darkmode}match[no]then[light]else[dark]]
|
||||||
palette-type: classic
|
palette-type: classic
|
||||||
editor: $:/palette-editors/TwentyTwenties
|
editor: $:/palette-editors/AutoToggle
|
||||||
palette-import@light: $:/palettes/FlexokiLight
|
palette-import@light: $:/palettes/FlexokiLight
|
||||||
palette-import@dark: $:/palettes/FlexokiDark
|
palette-import@dark: $:/palettes/FlexokiDark
|
||||||
|
|
||||||
page-background@light: green
|
|
||||||
page-background@dark: red
|
|
||||||
|
28
core/palettes/AutoToggleEditor.tid
Normal file
28
core/palettes/AutoToggleEditor.tid
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
title: $:/palette-editors/AutoToggle
|
||||||
|
|
||||||
|
\procedure set-imported-palette(field)
|
||||||
|
<$select field=<<field>>>
|
||||||
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]] :filter[{!!palette-type}!match[]else[classic]match<palette-type>] -[<currentTiddler>]">
|
||||||
|
<option value=<<currentTiddler>>><$view field="name"><$view field="title"/></$view></option>
|
||||||
|
</$list>
|
||||||
|
</$select>
|
||||||
|
\end set-imported-palette
|
||||||
|
|
||||||
|
This palette can be used to automatically switch between two palettes based on the browser's dark mode setting.
|
||||||
|
|
||||||
|
<$tiddler tiddler={{$:/palette}}>
|
||||||
|
|
||||||
|
Palette type: <$select field="palette-type" default="classic">
|
||||||
|
<option value="classic">Classic</option>
|
||||||
|
<option value="modern">Modern</option>
|
||||||
|
</$select>
|
||||||
|
|
||||||
|
<$let palette-type={{!!palette-type}}>
|
||||||
|
|
||||||
|
Light palette: <<set-imported-palette field:"palette-import@light">>
|
||||||
|
|
||||||
|
Dark palette: <<set-imported-palette field:"palette-import@dark">>
|
||||||
|
|
||||||
|
</$let>
|
||||||
|
|
||||||
|
</$tiddler>
|
@ -2,6 +2,16 @@ title: $:/PaletteManager
|
|||||||
|
|
||||||
\define lingo-base() $:/language/ControlPanel/Palette/
|
\define lingo-base() $:/language/ControlPanel/Palette/
|
||||||
|
|
||||||
|
\procedure palette-link()
|
||||||
|
<$tiddler tiddler={{$:/palette}}>
|
||||||
|
<$link to={{!!title}}>
|
||||||
|
<$view field="name" format="text">
|
||||||
|
<$view field="title" format="text"/>
|
||||||
|
</$view>
|
||||||
|
</$link>
|
||||||
|
</$tiddler>
|
||||||
|
\end palette-link
|
||||||
|
|
||||||
<$transclude $tiddler="$:/snippets/paletteswitcher" thumbnails="yes"/>
|
<$transclude $tiddler="$:/snippets/paletteswitcher" thumbnails="yes"/>
|
||||||
|
|
||||||
{{$:/snippets/palettetests}}
|
{{$:/snippets/palettetests}}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
title: $:/palette
|
title: $:/palette
|
||||||
|
|
||||||
$:/palettes/Vanilla
|
$:/palettes/AutoToggle
|
Loading…
x
Reference in New Issue
Block a user