diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids
index 3ee898b4f2..15273d18ea 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 119c3e67a3..23056bcc2c 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/ui/TestCases/DefaultTemplate.tid b/core/ui/TestCases/DefaultTemplate.tid
index 784c3861a3..02d20ad807 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"/>
$genesis>
+
+ <$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}}
+ $button>
+ <$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"/>
+ $list>
+
+ $reveal>
+ $let>
+
<%if [[Narrative]is[tiddler]] %>
diff --git a/core/ui/TestCases/DefaultTemplateSourceTabs.tid b/core/ui/TestCases/DefaultTemplateSourceTabs.tid
index 68c62c1f60..d16c3e600a 100644
--- a/core/ui/TestCases/DefaultTemplateSourceTabs.tid
+++ b/core/ui/TestCases/DefaultTemplateSourceTabs.tid
@@ -19,6 +19,7 @@ title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
$list>
<$edit class="tc-edit-texteditor" tiddler=<>/>
+<$macrocall $name="copy-to-clipboard" src={{{ [get[text]] }}}/>
\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 0000000000..0d5f976e52
--- /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 0000000000..2a90dc2277
--- /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}}/>
+
+$button>
diff --git a/core/wiki/tags/TestCaseActions.tid b/core/wiki/tags/TestCaseActions.tid
new file mode 100644
index 0000000000..79b2780dd1
--- /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 5524a98525..bad3e1395d 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=<>/>$wikify>
+
title: Output
diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid
index b1000539c4..9089e2caf4 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,14 @@ span.tc-translink > a:first-child {
font-style: normal;
}
+.tc-test-case-toolbar {
+ float: right;
+}
+
+.tc-test-case-toolbar svg {
+ fill: <>;
+}
+
.tc-test-case-result-fail {
border: 1px solid <>;
background-color: <>;
@@ -3394,7 +3408,7 @@ span.tc-translink > a:first-child {
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;