1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 23:04:50 +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 Render this widget into the DOM
*/ */
TestCaseWidget.prototype.render = function(parent,nextSibling) { TestCaseWidget.prototype.render = function(parent,nextSibling) {
var self = this;
this.parentDomNode = parent; this.parentDomNode = parent;
this.computeAttributes(); this.computeAttributes();
this.execute(); this.execute();
@ -48,7 +49,14 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
// Create a wiki // Create a wiki
this.testcaseWiki = new $tw.Wiki(); this.testcaseWiki = new $tw.Wiki();
// Always load the core plugin // 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 // Load tiddlers from child data widgets
var tiddlers = []; var tiddlers = [];
this.findChildrenDataWidgets(this.contentRoot.children,"data",function(widget) { this.findChildrenDataWidgets(this.contentRoot.children,"data",function(widget) {

View File

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

View File

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