From 31c3abb7ab2243a8f445af1922d9086319295029 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 26 Apr 2022 14:36:05 +0100 Subject: [PATCH] Add a definition for the value widget just so that it doesn't cause errors Of course, it doesn't actually need to be a JS widget, it could be a wikitext widget... --- core/modules/widgets/value.js | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 core/modules/widgets/value.js diff --git a/core/modules/widgets/value.js b/core/modules/widgets/value.js new file mode 100644 index 000000000..46e5a8a79 --- /dev/null +++ b/core/modules/widgets/value.js @@ -0,0 +1,57 @@ +/*\ +title: $:/core/modules/widgets/value.js +type: application/javascript +module-type: widget + +Sub-widget used by the ubertransclude widget for specifying values for slots within transcluded content. It doesn't do anything by itself because the ubertransclude widget only ever deals with the parse tree nodes, and doesn't instantiate the widget itself + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var Widget = require("$:/core/modules/widgets/widget.js").widget; + +var ValueWidget = function(parseTreeNode,options) { + // Initialise + this.initialise(parseTreeNode,options); +}; + +/* +Inherit from the base widget class +*/ +ValueWidget.prototype = Object.create(Widget.prototype); + +/* +Render this widget into the DOM +*/ +ValueWidget.prototype.render = function(parent,nextSibling) { + // Call the constructor + Widget.call(this); + this.parentDomNode = parent; + this.computeAttributes(); + this.execute(); + this.renderChildren(parent,nextSibling); +}; + +/* +Compute the internal state of the widget +*/ +ValueWidget.prototype.execute = function() { + // Construct the child widgets + this.makeChildWidgets(); +}; + +/* +Refresh the widget by ensuring our attributes are up to date +*/ +ValueWidget.prototype.refresh = function(changedTiddlers) { + return this.refreshChildren(changedTiddlers); +}; + +exports.value = ValueWidget; + +})(); + \ No newline at end of file