mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
Testcase widget improve containment (#8529)
* testcase improve containment using navigator-widget * testcase implement minimal edit new-tiddler interface
This commit is contained in:
parent
f10d4eb58d
commit
b75fa58746
@ -3,7 +3,7 @@ code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\function tf.state() [<qualify "$:/state/testcase">]
|
||||
\function tf.state() "$:/state/testcase"
|
||||
|
||||
\procedure linkcatcherActions()
|
||||
<%if [<navigateTo>has[title]] %>
|
||||
@ -102,9 +102,12 @@ code-body: yes
|
||||
[all[tiddlers]sort[]] Output +[putfirst[]]
|
||||
-Description
|
||||
-Narrative
|
||||
-[[$:/temp/testcase/draft-title]]
|
||||
-[has[plugin-type]]
|
||||
-[prefix<tf.state>]
|
||||
-[prefix[$:/state/popup/export]]
|
||||
-[prefix[$:/HistoryList]]
|
||||
-[prefix[$:/StoryList]]
|
||||
\end
|
||||
|
||||
\procedure testcase-source()
|
||||
@ -129,6 +132,8 @@ code-body: yes
|
||||
\procedure testcase-body()
|
||||
<div class="tc-test-case-wrapper">
|
||||
<<testcase-header>>
|
||||
<$let testcase-source-state = <<tf.state>>>
|
||||
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
||||
<%if [[Narrative]is[tiddler]] %>
|
||||
<<testcase-narrative>>
|
||||
<%endif%>
|
||||
@ -136,6 +141,8 @@ code-body: yes
|
||||
<<testcase-fail>>
|
||||
<%endif%>
|
||||
<<testcase-panes>>
|
||||
</$navigator>
|
||||
</$let>
|
||||
</div>
|
||||
\end
|
||||
|
||||
|
@ -1,6 +1,22 @@
|
||||
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">
|
||||
@ -11,7 +27,12 @@ title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
|
||||
<$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>
|
||||
|
Loading…
Reference in New Issue
Block a user