diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 3ee898b4f..15273d18e 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -104,6 +104,8 @@ ShowSideBar/Caption: show sidebar ShowSideBar/Hint: Show sidebar TagManager/Caption: tag manager TagManager/Hint: Open tag manager +TestCaseImport/Caption: import tiddlers +TestCaseImport/Hint: Import tiddlers Timestamp/Caption: timestamps Timestamp/Hint: Choose whether modifications update timestamps Timestamp/On/Caption: timestamps are on diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 119c3e67a..23056bcc2 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -95,6 +95,7 @@ function SaverHandler(options) { if($tw.browser) { $tw.rootWidget.addEventListener("tm-save-wiki",function(event) { self.saveWiki({ + wiki: event.widget.wiki, template: event.param, downloadType: "text/plain", variables: event.paramObject @@ -102,6 +103,7 @@ function SaverHandler(options) { }); $tw.rootWidget.addEventListener("tm-download-file",function(event) { self.saveWiki({ + wiki: event.widget.wiki, method: "download", template: event.param, downloadType: "text/plain", @@ -147,20 +149,22 @@ Save the wiki contents. Options are: method: "save", "autosave" or "download" template: the tiddler containing the template to save downloadType: the content type for the saved file + wiki: optional wiki, overriding the default wiki specified in the constructor */ SaverHandler.prototype.saveWiki = function(options) { options = options || {}; var self = this, + wiki = options.wiki || this.wiki, method = options.method || "save"; // Ignore autosave if disabled - if(method === "autosave" && ($tw.config.disableAutoSave || this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes")) { + if(method === "autosave" && ($tw.config.disableAutoSave || wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes")) { return false; } var variables = options.variables || {}, template = (options.template || - this.wiki.getTiddlerText("$:/config/SaveWikiButton/Template","$:/core/save/all")).trim(), + wiki.getTiddlerText("$:/config/SaveWikiButton/Template","$:/core/save/all")).trim(), downloadType = options.downloadType || "text/plain", - text = this.wiki.renderTiddler(downloadType,template,options), + text = wiki.renderTiddler(downloadType,template,options), callback = function(err) { if(err) { alert($tw.language.getString("Error/WhileSaving") + ":\n\n" + err); diff --git a/core/palettes/Vanilla.tid b/core/palettes/Vanilla.tid index d2b765b02..067f32519 100644 --- a/core/palettes/Vanilla.tid +++ b/core/palettes/Vanilla.tid @@ -99,7 +99,7 @@ table-footer-background: #a8a8a8 table-header-background: #f0f0f0 tag-background: #ec6 tag-foreground: #ffffff -testcase-accent-level-1: #84C5E6 +testcase-accent-level-1: #c1eaff testcase-accent-level-2: #E3B740 testcase-accent-level-3: #5FD564 tiddler-background: <> diff --git a/core/ui/TestCases/DefaultTemplate.tid b/core/ui/TestCases/DefaultTemplate.tid index 3a68253e8..02d20ad80 100644 --- a/core/ui/TestCases/DefaultTemplate.tid +++ b/core/ui/TestCases/DefaultTemplate.tid @@ -27,6 +27,31 @@ title: $:/core/ui/testcases/DefaultTemplate <%endif%> <$view tiddler="Description" mode="inline"/> + + <$button popup=`$(state)$-more` + tooltip={{$:/language/Buttons/More/Hint}} + aria-label={{$:/language/Buttons/More/Caption}} + class="tc-btn-invisible" + selectedClass="tc-selected" + > + {{$:/core/images/down-arrow}} + + <$let + tv-config-toolbar-icons="yes" + tv-config-toolbar-text="yes" + tv-config-toolbar-class="tc-btn-invisible" + > + <$reveal state=`$(state)$-more` type="popup" position="belowleft" animate="yes"> +
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/TestCase/Actions]!has[draft.of]]" + variable="listItem" + > + <$transclude tiddler=<> mode="inline"/> + +
+ + +
<%if [[Narrative]is[tiddler]] %> @@ -46,7 +71,7 @@ title: $:/core/ui/testcases/DefaultTemplate <%endif%>
- <$macrocall $name="tabs" tabsList="[all[tiddlers]sort[]] -[prefix] -Description -Narrative -ExpectedResult -Output Output +[putfirst[]] -[has[plugin-type]]" state=<> default="Output" template="$:/core/ui/testcases/DefaultTemplate/SourceTabs"/> + <$macrocall $name="tabs" tabsList="[all[tiddlers]sort[]] -[prefix] -Description -Narrative -Output Output +[putfirst[]] -[has[plugin-type]]" state=<> default="Output" template="$:/core/ui/testcases/DefaultTemplate/SourceTabs"/>
diff --git a/core/ui/TestCases/DefaultTemplateSourceTabs.tid b/core/ui/TestCases/DefaultTemplateSourceTabs.tid index 68c62c1f6..862a7f57a 100644 --- a/core/ui/TestCases/DefaultTemplateSourceTabs.tid +++ b/core/ui/TestCases/DefaultTemplateSourceTabs.tid @@ -19,6 +19,9 @@ title: $:/core/ui/testcases/DefaultTemplate/SourceTabs <$edit class="tc-edit-texteditor" tiddler=<>/> + \end <$transclude $variable="body" $mode="inline"/> diff --git a/core/ui/TestCases/actions/Export.tid b/core/ui/TestCases/actions/Export.tid new file mode 100644 index 000000000..0d5f976e5 --- /dev/null +++ b/core/ui/TestCases/actions/Export.tid @@ -0,0 +1,4 @@ +title: $:/core/ui/testcases/actions/Export +tags: $:/tags/TestCase/Actions + +<$macrocall $name="exportButton" exportFilter="[all[tiddlers]sort[]] -[prefix[$:/state/]] -Description -Narrative -ExpectedResult -Output Output +[putfirst[]] -[has[plugin-type]]" lingoBase="$:/language/Buttons/ExportTiddlers/"/> \ No newline at end of file diff --git a/core/ui/TestCases/actions/Import.tid b/core/ui/TestCases/actions/Import.tid new file mode 100644 index 000000000..2a90dc227 --- /dev/null +++ b/core/ui/TestCases/actions/Import.tid @@ -0,0 +1,11 @@ +title: $:/core/ui/testcases/actions/Import +tags: $:/tags/TestCase/Actions + +\whitespace trim +<$button tooltip={{$:/language/Buttons/TestCaseImport/Hint}} aria-label={{$:/language/Buttons/TestCaseImport/Caption}} class=<>> +<$action-sendmessage $message="tm-import-tiddlers" $param=<>/> +{{$:/core/images/permalink-button}} + +<$text text={{$:/language/Buttons/TestCaseImport/Caption}}/> + + diff --git a/core/wiki/tags/TestCaseActions.tid b/core/wiki/tags/TestCaseActions.tid new file mode 100644 index 000000000..79b2780dd --- /dev/null +++ b/core/wiki/tags/TestCaseActions.tid @@ -0,0 +1,2 @@ +title: $:/tags/TestCase/Actions +list: diff --git a/editions/tw5.com/tiddlers/testcases/TestCaseWidget/FailingTest.tid b/editions/tw5.com/tiddlers/testcases/TestCaseWidget/FailingTest.tid index 5524a9852..bad3e1395 100644 --- a/editions/tw5.com/tiddlers/testcases/TestCaseWidget/FailingTest.tid +++ b/editions/tw5.com/tiddlers/testcases/TestCaseWidget/FailingTest.tid @@ -5,7 +5,7 @@ description: An example of a failing test title: Narrative -This test case intentionally fails (in order to show how failures are displayed) +This test case intentionally fails (in order to show how failures are displayed). The expected result is set to <$text text={{ExpectedResult}}/>, but the result computes to <$wikify name="html" text={{Output}} mode="block" output="html"><$text text=<>/> + title: Output diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index b1000539c..641d44779 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -3297,7 +3297,7 @@ span.tc-translink > a:first-child { display: inline-block; line-height: 0; border-radius: 1em; - vertical-align: bottom; + vertical-align: text-bottom; margin-right: 0.25em; } @@ -3314,6 +3314,12 @@ span.tc-translink > a:first-child { height: 0.5em; } +.tc-test-case-header > h2 { + background: <>; + border-radius: 4px; + padding: 0.25em; +} + .tc-test-case-header > h2, .tc-test-case-source > pre { margin: 0; @@ -3323,6 +3329,18 @@ span.tc-translink > a:first-child { font-style: normal; } +.tc-test-case-toolbar { + float: right; +} + +.tc-test-case-toolbar svg { + fill: <>; +} + +.tc-test-case-toolbar .tc-drop-down { + font-size: 0.8em; +} + .tc-test-case-result-fail { border: 1px solid <>; background-color: <>; @@ -3366,10 +3384,14 @@ span.tc-translink > a:first-child { } .tc-test-case-source .tc-tab-content { - background: <>; + background: inherit; margin: 0; } +.tc-test-case-source .tc-tab-content .tc-field-table { + background: <>; +} + .tc-test-case-source .tc-field-table { width: 100%; } @@ -3390,11 +3412,16 @@ span.tc-translink > a:first-child { padding-top: 0; } +.tc-test-case-footer-toolbar { + display: flex; + justify-content: flex-end; +} + .tc-test-case-output { box-shadow: inset 2px 2px 10px 0px <>; background: <>; border-radius: 4px; - border: 1px solid <>; + border: 1px solid <>; flex: 1 0 49%; min-width: 250px; padding: 0.25em 1em;