~hokiegeek/tw5-location-crafts

4d9bf66e7eab20524f1d3bfbc5005c098427a151 — HokieGeek 5 months ago 30bafff 0.2.1
Improved how elements are added
3 files changed, 29 insertions(+), 15 deletions(-)

M macros.tid
M plugin.info
M styles.tid
M macros.tid => macros.tid +27 -13
@@ 18,7 18,8 @@ and how to mark them off?

\define category-list(type)
<div class="category-list">
    <$let categoryState={{{ [{!!title}encodeuricomponent[]addprefix[$:/state/location-crafts/]] }}}>
    <$let special-elements="expected random special none complete"
          categoryState={{{ [{!!title}encodeuricomponent[]addprefix[$:/state/location-crafts/]] }}}>
    <div class="header-button">
        <h1 style="text-transform: capitalize;">$type$</h1>
        <$button setTitle=<<categoryState>> setField=$type$ setTo="visible" tooltip="Add $type$" aria-label="Add $type$" class="tc-btn-invisible tc-btn-mini">


@@ 29,7 30,14 @@ and how to mark them off?
        <$let me={{!!title}}>
        <$list filter="[is[current]get[crafted-$type$]enlist-input:raw[]]" counter="counter" emptyMessage="no $type$ setup">
        <li>
            <<currentTiddler>>
            <$let element=<<currentTiddler>>>
            <$list filter="[<special-elements>enlist-input:raw[]match<currentTiddler>]">
            <<element>>
            </$list>
            <$list filter="[<special-elements>enlist-input:raw[]match<currentTiddler>then[found]else[]remove[found]]">
            <$link to=<<element>>><<element>></$link>
            </$list>
            </$let>
            <!--
            <$let prev={{{ [<counter>subtract[1]] }}}
                  last={{{ [<me>get[crafted-$type$]enlist-input:raw[]rest<counter>join[ ]] }}}


@@ 50,27 58,33 @@ and how to mark them off?
            <$edit-text tiddler=<<categoryState>> field="custom-$type$" focus="true" />
            </div>
            <div style="grid-row-start: 1; grid-column-start: 2; padding-right: .2rem;">
            <$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="cancel" aria-label="cancel" class="tc-btn-invisible tc-btn-mini">
                <$action-setfield $tiddler=<<categoryState>> $field="custom-$type$" $value="" />
                {{$:/core/images/close-button}}
            </$button>
            </div>
            <div style="grid-row-start: 1; grid-column-start: 3;">
            <$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="submit" aria-label="submit" class="tc-btn-invisible tc-btn-mini">
                <$let custom-element={{{ [<categoryState>get[custom-$type$]] }}}
                      updated-list={{{ [is[current]get[crafted-$type$]enlist-input:raw[]append<custom-element>join[ ]] }}}>
                <$action-setfield $tiddler=<<currentTiddler>> $field="crafted-$type$" $value=<<updated-list>> />
                      updated-list={{{ [all[current]get[crafted-$type$]enlist-input:raw[]] [<categoryState>get[custom-$type$]] }}}>
                <$action-listops $field="crafted-$type$" $filter="[all[current]get[crafted-$type$]enlist-input:raw[]] [<categoryState>get[custom-$type$]]" />
                <!--
                <$action-setfield $field="crafted-$type$" $value=<<updated-list>> />
                -->
                </$let>
                <$action-setfield $tiddler=<<categoryState>> $field="custom-$type$" $value="" />
                {{$:/core/images/done-button}}
            </$button>
            </div>
            <!--
            <div style="grid-row-start: 1; grid-column-start: 3;">
            <$button setTitle=<<categoryState>> setField=$type$ setTo="hidden" tooltip="cancel" aria-label="cancel" class="tc-btn-invisible tc-btn-mini">
                <$action-setfield $tiddler=<<categoryState>> $field="custom-$type$" $value="" />
                {{$:/core/images/close-button}}
            </$button>
            </div>
            <div style="grid-row-start: 2">
                <$list filter="[[expected random special complete none]enlist-input[]]">
                <<currentTiddler>><br />
                <$list filter="[<special-elements>enlist-input[]]">
                <$button setTitle=<<categoryState>> setField="custom-$type$" setTo=<<currentTiddler>> class="tc-btn-invisible tc-tiddlylink">
                <<currentTiddler>>
                </$button>
                <br />
                </$list>
            </div>
            <!--
            -->
        </div>
        </li>

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/location-crafts",
    "description": "Some templates and stuff for recording information created with the RPG tool The Location Crafter",
    "author": "hokiegeek",
    "version": "0.2.0",
    "version": "0.2.1",
    "core-version": ">=5.2.1",
    "source": "https://git.sr.ht/~hokiegeek/tw5-location-crafts",
    "plugin-type": "plugin",

M styles.tid => styles.tid +1 -1
@@ 27,7 27,7 @@ type: text/vnd.tiddlywiki

.category-list .header-button svg
{
    opacity: .7;
    opacity: .5;
}

.category-list input {