1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-07 11:16:55 +00:00

Take advantage of compiled palettes

More robust because previously we couldn't cope with indirect palette entries in these situations
This commit is contained in:
Jeremy Ruston 2025-02-06 12:55:45 +00:00
parent bfea62b43b
commit 1f4f164d5e
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ function FramedEngine(options) {
this.parentNode.insertBefore(this.iframeNode,this.nextSibling);
this.iframeDoc = this.iframeNode.contentWindow.document;
// (Firefox requires us to put some empty content in the iframe)
var paletteTitle = this.widget.wiki.getTiddlerText("$:/palette");
var paletteTitle = this.widget.wiki.getTiddlerText("$:/palette/palette-colours");
var colorScheme = (this.widget.wiki.getTiddler(paletteTitle) || {fields: {}}).fields["color-scheme"] || "light";
this.iframeDoc.open();
this.iframeDoc.write("<meta name='color-scheme' content='" + colorScheme + "'>");

View File

@ -17,7 +17,7 @@ title: $:/PaletteManager
{{$:/snippets/palettetests}}
<$let
paletteSettings={{{ [{$:/palette}get[settings]] :else[{$:/palette}get[palette-import]!match[]get[settings]] }}}
paletteSettings={{{ [[$:/temp/palette-consolidated]get[settings]] }}}
>
<%if [<paletteSettings>!match[]] %>
<div>

View File

@ -166,7 +166,7 @@ The second ESC tries to close the "draft tiddler"
<!-- keep those variables because they may "bleed" into macros using old syntax -->
<!-- "nonSystemTagsFilter", "systemTagsFilter" __need to be the same__ as fields: "first-search-filter", "second-search-filter" -->
<$let
palette={{$:/palette}}
palette="$:/temp/palette-colours"
colourA={{{ [<palette>getindex[foreground]] }}}
colourB={{{ [<palette>getindex[background]] }}}
fallbackTarget={{{ [<palette>getindex[tag-background]] }}}