Skip to content

Commit

Permalink
refactor(config template): remove all config template tiddlers
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Oct 6, 2024
1 parent 8600678 commit 70cea96
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 118 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"registry": "https://registry.npmjs.org"
},
"license": "MIT",
"version": "2.7.0",
"version": "2.8.0",
"packageManager": "pnpm@9.0.6",
"scripts": {
"update:config": " pnpm ts-node scripts/generateConfig.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/tiddlywiki-codemirror-6/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "$:/plugins/oeyoews/tiddlywiki-codemirror-6",
"name": "CodeMirror6",
"description": "CodeMirror 6 editor",
"version": "2.7.0",
"version": "2.8.0",
"core-version": ">=5.3.4",
"list": "readme usage"
}
66 changes: 63 additions & 3 deletions src/tiddlywiki-codemirror-6/tiddlers/ui/ControlPanel/settings.tid
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ subtitle: {{||$:/esc}}
[get[settings-group]!is[blank]else[!general]] [get[id]!is[blank]else[99]] +[join[]]
\end

\define useSound()
<$action-sendmessage $message="neotw-play-sound" audioTiddler="$:/plugins/oeyoews/neotw-play-sound/sounds/bite.mp3" />
\end

<!-- TODO: toggle i18n -->
Your codemirror6 config tiddlers: <$count filter="[prefix[$:/config/codemirror-6]] "/>/<$count filter="[all[tiddlers+shadows]prefix[$:/config/codemirror-6]]"/> (<small><$text text= {{{ [[$:/plugins/oeyoews/tiddlywiki-codemirror-6]get[version]] }}} /></small>) Language: <$select tiddler="$:/config/codemirror6/language" tooltip='change codemirror6 config language'>
<option value=en>En</option>
Expand All @@ -28,11 +32,67 @@ Your codemirror6 config tiddlers: <$count filter="[prefix[$:/config/codemirror-6
<$list filter="[all[shadows+tiddlers]prefix[$:/config/codemirror-6/]has[settings-template]] +[search:title,caption,description{$:/state/codemirror-6/settings/search}] +[sortsub<sortBySettingsGroupFilter>]">
<$list filter={{{[{!!condition}!is[blank]] :else[{!!title}]}}} variable="list-condition">
<div class="btc-list-group-item">
<div class="group-category" hidden>
<$text text= {{{ [<currentTiddler>get[settings-group]else[general]] }}} />
<!-- <div class="group-category" hidden>
<$text text= {{{ [<currentTiddler>get[settings-group]else[general]] }}} /> -->
<!-- {{!!settings-group}} -->
<!-- </div> -->
<!-- <$transclude tiddler={{!!settings-template}}/> -->

<label class="btcui-form-label">

<$reveal type="match" state="$:/config/codemirror6/language" text="en">
<$link tooltip={{!!description}}>{{!!caption}}</$link>
<div>
<small> {{!!description}}
<% if [<currentTiddler>is[tiddler]] %>
<$button> Reset
<$action-deletetiddler $tiddler=<<currentTiddler>>/>
</$button>
<% endif %>
</small>
</div>
</$reveal>

<$reveal type="match" state="$:/config/codemirror6/language" text="zh">
<$link tooltip={{!!description-zh}}>{{!!caption-zh}}</$link>
<div>
<small> {{!!description-zh}}
<% if [<currentTiddler>is[tiddler]] %>
<$button> 恢复默认设置
<$action-deletetiddler $tiddler=<<currentTiddler>>/>
</$button>
<% endif %>
</small>
</div>
<$transclude tiddler={{!!settings-template}}/>
</$reveal>

</label>

<!-- input -->
<% if [<currentTiddler>get[settings-template]match[$:/plugins/oeyoews/tiddlywiki-codemirror-6/ui/templates/settings/input]] %>
<$edit-text tag="input" class="btcui-form-input"/>
<% endif %>

<!-- input-switch -->
<% if [<currentTiddler>get[settings-template]match[$:/plugins/oeyoews/tiddlywiki-codemirror-6/ui/templates/settings/input-switch]] %>
<% if [[$:/config/codemirror-6/useSound]get[text]match[yes]] %>
<$checkbox field="text" checked="yes" unchecked="no" class="btcui-form-switch" actions=<<useSound>>/>
<% else %>
<$checkbox field="text" checked="yes" unchecked="no" class="btcui-form-switch"/>
<% endif %>
<% endif %>

<!-- select -->
<% if [<currentTiddler>get[settings-template]match[$:/plugins/oeyoews/tiddlywiki-codemirror-6/ui/templates/settings/select]] %>
<$vars cnt={{{[enlist{!!option-names}count[]]}}}}>
<$select class="btcui-form-select">
<$list filter="[range<cnt>]" variable="index">
<option value={{{[enlist{!!option-values}nth<index>]}}}><$text text={{{[enlist{!!option-names}nth<index>]}}}/></option>
</$list>
</$select>
</$vars>
<% endif %>

</div>
</$list>
</$list>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 70cea96

Please sign in to comment.