1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-28 23:10:46 +00:00

Make test cases editable

This commit is contained in:
jeremy@jermolene.com 2023-04-28 10:48:08 +01:00
parent b47c75785a
commit 4a0ffcfb97
3 changed files with 12 additions and 3 deletions

View File

@ -27,6 +27,7 @@ TestCaseWidget.prototype = new Widget();
Render this widget into the DOM
*/
TestCaseWidget.prototype.render = function(parent,nextSibling) {
var self = this;
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
@ -48,7 +49,14 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
// Create a wiki
this.testcaseWiki = new $tw.Wiki();
// Always load the core plugin
this.testcaseWiki.addTiddler(this.wiki.getTiddler("$:/core"));
var loadTiddler = function(title) {
var tiddler = self.wiki.getTiddler(title);
if(tiddler) {
self.testcaseWiki.addTiddler(tiddler);
}
}
loadTiddler("$:/core");
loadTiddler("$:/plugins/tiddlywiki/codemirror");
// Load tiddlers from child data widgets
var tiddlers = [];
this.findChildrenDataWidgets(this.contentRoot.children,"data",function(widget) {

View File

@ -16,4 +16,4 @@ title: $:/core/ui/testcases/DefaultTemplate/Source
</tbody>
</table>
</$list>
<pre><$view tiddler=<<currentTab>>/></pre>
<$edit class="tc-edit-texteditor" tiddler=<<currentTab>>/>

View File

@ -3,7 +3,8 @@
"plugins": [
"tiddlywiki/geospatial",
"tiddlywiki/jszip",
"tiddlywiki/xlsx-utils"
"tiddlywiki/xlsx-utils",
"tiddlywiki/codemirror"
],
"themes": [
"tiddlywiki/vanilla",