diff --git a/core/ui/ControlPanel/Palette.tid b/core/ui/ControlPanel/Palette.tid index 3cac62122..8f3aa8ca7 100644 --- a/core/ui/ControlPanel/Palette.tid +++ b/core/ui/ControlPanel/Palette.tid @@ -2,33 +2,4 @@ title: $:/core/ui/ControlPanel/Palette tags: $:/tags/ControlPanel/Appearance caption: {{$:/language/ControlPanel/Palette/Caption}} -\define lingo-base() $:/language/ControlPanel/Palette/ - -<$transclude $tiddler="$:/snippets/paletteswitcher" thumbnails="yes"/> - -{{$:/snippets/palettetests}} - -<$let - paletteEditor={{{ [{$:/palette}get[editor]] :else[{$:/palette}get[palette-import]!match[]get[editor]] }}} -> - <%if [!match[]] %> -
- <> - <$transclude $tiddler=<> $mode="block"/> -
- <%endif%> - - -<$reveal type="nomatch" state="$:/state/ShowPaletteEditor" text="yes"> - -<$button set="$:/state/ShowPaletteEditor" setTo="yes"><> - - - -<$reveal type="match" state="$:/state/ShowPaletteEditor" text="yes"> - -<$button set="$:/state/ShowPaletteEditor" setTo="no"><> -{{$:/PaletteManager}} - - - +{{$:/PaletteManager}} \ No newline at end of file diff --git a/core/ui/PaletteEditor.tid b/core/ui/PaletteEditor.tid new file mode 100644 index 000000000..e0b1482f3 --- /dev/null +++ b/core/ui/PaletteEditor.tid @@ -0,0 +1,94 @@ +title: $:/PaletteEditor + +\define lingo-base() $:/language/ControlPanel/Palette/Editor/ +\define describePaletteColour(colour) +<$transclude tiddler="$:/language/Docs/PaletteColours/$colour$"><$text text="$colour$"/> +\end +\define edit-colour-placeholder() + edit $(colourName)$ +\end +\define colour-tooltip(showhide) $showhide$ editor for $(newColourName)$ + +\define resolve-colour(macrocall) +\import $:/core/macros/utils +\whitespace trim +<$wikify name="name" text="""$macrocall$"""> +<> + +\end + +\define delete-colour-index-actions() <$action-setfield $index=<>/> +\define palette-manager-colour-row-segment() +\whitespace trim +<$edit-text index=<> tag="input" placeholder=<> default=""/> +
+<$edit-text index=<> type="color" tag="input" class="tc-palette-manager-colour-input"/> +<$list filter="[getindexremoveprefix[<<]removesuffix[>>]] [getindexremoveprefix[<$]removesuffix[/>]]" variable="ignore"> +<$set name="state" value={{{ [[$:/state/palettemanager/]addsuffixaddsuffix[/]addsuffix] }}}> +<$wikify name="newColourName" text="""<$macrocall $name="resolve-colour" macrocall={{{ [getindex] }}}/>"""> +<$reveal state=<> type="nomatch" text="show"> +<$button tooltip=<> aria-label=<> class="tc-btn-invisible" set=<> setTo="show">{{$:/core/images/down-arrow}}<$text text=<> class="tc-small-gap-left"/>
+ +<$reveal state=<> type="match" text="show"> +<$button tooltip=<> aria-label=<> class="tc-btn-invisible" actions="""<$action-deletetiddler $tiddler=<>/>""">{{$:/core/images/up-arrow}}<$text text=<> class="tc-small-gap-left"/>
+ +<$reveal state=<> type="match" text="show"> +<$set name="colourName" value=<>> +
+<> +

+ + + + + +\end + +\define palette-manager-colour-row() +\whitespace trim + + + +<$button tooltip={{$:/language/ControlPanel/Palette/Editor/Delete/Hint}} aria-label={{$:/language/ControlPanel/Palette/Editor/Delete/Hint}} class="tc-btn-invisible" actions=<>> +{{$:/core/images/delete-button}} + +''<$macrocall $name="describePaletteColour" colour=<>/>''
+<$macrocall $name="colourName" $output="text/plain"/> + + +<> + + +\end + +\define palette-manager-table() +\whitespace trim + + +<$set name="colorList" filter="[{$:/state/palettemanager/showexternal}match[yes]]" + value="[all[shadows+tiddlers]tag[$:/tags/Palette]indexes[]]" emptyValue="[indexes[]]"> +<$list filter=<> variable="colourName"> <> + + +
+\end +\whitespace trim +<$set name="currentTiddler" value={{$:/palette}}> + +<> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/> + +<$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem"> +<> + +<$button message="tm-delete-tiddler" param={{$:/palette}}><> + + +<$list filter="[all[current]is[shadow]!is[tiddler]]" variable="listItem"> +<> + + +<$button message="tm-new-tiddler" param={{$:/palette}}><> + +<$checkbox tiddler="$:/state/palettemanager/showexternal" field="text" checked="yes" unchecked="no"><> + +<> diff --git a/core/ui/PaletteManager.tid b/core/ui/PaletteManager.tid index ae91d9ccc..39d3be051 100644 --- a/core/ui/PaletteManager.tid +++ b/core/ui/PaletteManager.tid @@ -1,94 +1,32 @@ title: $:/PaletteManager -\define lingo-base() $:/language/ControlPanel/Palette/Editor/ -\define describePaletteColour(colour) -<$transclude tiddler="$:/language/Docs/PaletteColours/$colour$"><$text text="$colour$"/> -\end -\define edit-colour-placeholder() - edit $(colourName)$ -\end -\define colour-tooltip(showhide) $showhide$ editor for $(newColourName)$ +\define lingo-base() $:/language/ControlPanel/Palette/ -\define resolve-colour(macrocall) -\import $:/core/macros/utils -\whitespace trim -<$wikify name="name" text="""$macrocall$"""> -<> - -\end +<$transclude $tiddler="$:/snippets/paletteswitcher" thumbnails="yes"/> + +{{$:/snippets/palettetests}} + +<$let + paletteEditor={{{ [{$:/palette}get[editor]] :else[{$:/palette}get[palette-import]!match[]get[editor]] }}} +> + <%if [!match[]] %> +
+ <> + <$transclude $tiddler=<> $mode="block"/> +
+ <%endif%> + + +<$reveal type="nomatch" state="$:/state/ShowPaletteEditor" text="yes"> + +<$button set="$:/state/ShowPaletteEditor" setTo="yes"><> -\define delete-colour-index-actions() <$action-setfield $index=<>/> -\define palette-manager-colour-row-segment() -\whitespace trim -<$edit-text index=<> tag="input" placeholder=<> default=""/> -
-<$edit-text index=<> type="color" tag="input" class="tc-palette-manager-colour-input"/> -<$list filter="[getindexremoveprefix[<<]removesuffix[>>]] [getindexremoveprefix[<$]removesuffix[/>]]" variable="ignore"> -<$set name="state" value={{{ [[$:/state/palettemanager/]addsuffixaddsuffix[/]addsuffix] }}}> -<$wikify name="newColourName" text="""<$macrocall $name="resolve-colour" macrocall={{{ [getindex] }}}/>"""> -<$reveal state=<> type="nomatch" text="show"> -<$button tooltip=<> aria-label=<> class="tc-btn-invisible" set=<> setTo="show">{{$:/core/images/down-arrow}}<$text text=<> class="tc-small-gap-left"/>
-<$reveal state=<> type="match" text="show"> -<$button tooltip=<> aria-label=<> class="tc-btn-invisible" actions="""<$action-deletetiddler $tiddler=<>/>""">{{$:/core/images/up-arrow}}<$text text=<> class="tc-small-gap-left"/>
+ +<$reveal type="match" state="$:/state/ShowPaletteEditor" text="yes"> + +<$button set="$:/state/ShowPaletteEditor" setTo="no"><> +{{$:/PaletteEditor}} + -<$reveal state=<> type="match" text="show"> -<$set name="colourName" value=<>> -
-<> -

- - - - - -\end -\define palette-manager-colour-row() -\whitespace trim - - - -<$button tooltip={{$:/language/ControlPanel/Palette/Editor/Delete/Hint}} aria-label={{$:/language/ControlPanel/Palette/Editor/Delete/Hint}} class="tc-btn-invisible" actions=<>> -{{$:/core/images/delete-button}} - -''<$macrocall $name="describePaletteColour" colour=<>/>''
-<$macrocall $name="colourName" $output="text/plain"/> - - -<> - - -\end - -\define palette-manager-table() -\whitespace trim - - -<$set name="colorList" filter="[{$:/state/palettemanager/showexternal}match[yes]]" - value="[all[shadows+tiddlers]tag[$:/tags/Palette]indexes[]]" emptyValue="[indexes[]]"> -<$list filter=<> variable="colourName"> <> - - -
-\end -\whitespace trim -<$set name="currentTiddler" value={{$:/palette}}> - -<> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/> - -<$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem"> -<> - -<$button message="tm-delete-tiddler" param={{$:/palette}}><> - - -<$list filter="[all[current]is[shadow]!is[tiddler]]" variable="listItem"> -<> - - -<$button message="tm-new-tiddler" param={{$:/palette}}><> - -<$checkbox tiddler="$:/state/palettemanager/showexternal" field="text" checked="yes" unchecked="no"><> - -<>