1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-21 11:49:44 +00:00
TiddlyWiki5/core/ui/TestCases/DefaultTemplateSourceTabs.tid
Mario Pietsch b75fa58746
Testcase widget improve containment (#8529)
* testcase improve containment using navigator-widget

* testcase implement minimal edit new-tiddler interface
2024-08-20 16:29:16 +01:00

49 lines
1.6 KiB
Plaintext

title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
\whitespace trim
\procedure testcaseNewTitle() $:/temp/testcase/draft-title
\procedure saveActions()
<$action-setfield $tiddler=<<currentTab>> $field="draft.title" $value=<<newTitle>>/>
<$action-sendmessage $message="tm-save-tiddler" $param=<<title>> />
<$action-setfield $tiddler=<<testcase-source-state>> text=<<newTitle>>/>
<$action-deletetiddler $tiddler=<<testcaseNewTitle>>/>
\end
\procedure saveButton(title, newTitle)
<$button class="tc-btn-invisible tc-test-case-save-button tc-small-gap-left" actions=<<saveActions>> disabled={{{ [<testcaseNewTitle>!has[text]then[yes]] }}}>
{{$:/core/images/done-button}}
</$button>
\end
\procedure body()
<$list filter="[<currentTab>fields[]] -text +[limit[1]]" variable="ignore">
<table class="tc-field-table">
<tbody>
<$list filter="[<currentTab>fields[]sort[]] -text -title title +[putfirst[]]" variable="fieldName">
<tr>
<td>
<$text text=<<fieldName>>/>
</td>
<td>
<%if [<fieldName>match[draft.title]] %>
<$edit-text class="tc-edit-texteditor tc-max-width-80" tiddler=<<testcaseNewTitle>> focus="yes" tag="input"/>
<$macrocall $name="saveButton" newTitle={{{ [<testcaseNewTitle>get[text]] }}} title=<<currentTab>>/>
<%else%>
<$view tiddler=<<currentTab>> field=<<fieldName>>/>
<%endif%>
</td>
</tr>
</$list>
</tbody>
</table>
</$list>
<$edit class="tc-edit-texteditor" tiddler=<<currentTab>>/>
<div class="tc-test-case-footer-toolbar">
<$macrocall $name="copy-to-clipboard" src={{{ [<currentTab>get[text]] }}}/>
</div>
\end
<$transclude $variable="body" $mode="inline"/>