mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-03-07 14:30:38 -08:00
* fix: apply automatic eslint fixes * lint: allow hashbang comment for tiddlywiki.js * lint: first back of manual lint fixes for unused vars * lint: added more fixes for unused vars * lint: missed files * lint: updated eslint config with selected rules from #9669
30 lines
635 B
JavaScript
30 lines
635 B
JavaScript
/*\
|
|
|
|
Hello, World widget
|
|
|
|
\*/
|
|
"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;
|