This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/dev/

tiddlerfield-norefresh.js

2nd February 2019 at 3:06am
/*\

Hello, World widget

\*/
(function() {

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var Widget = require("$:/core/modules/widgets/widget.js").widget;

var MyWidget = function(parseTreeNode, options) {
	this.initialise(parseTreeNode, options);
};

/*
Inherit from the base widget class
*/
MyWidget.prototype = new Widget();

/*
Render this widget into the DOM
*/
MyWidget.prototype.render = function(parent, nextSibling) {
	this.parentDomNode = parent;
	var text = this.wiki.getTiddlerText("test", "<empty>")
	var textNode = this.document.createTextNode(text);
	parent.insertBefore(textNode, nextSibling);
	this.domNodes.push(textNode);
};

exports.tiddlerfield = MyWidget;

})();