diff --git a/core/modules/widgets/version.js b/core/modules/widgets/version.js new file mode 100644 index 000000000..965db3d38 --- /dev/null +++ b/core/modules/widgets/version.js @@ -0,0 +1,34 @@ +/*\ +title: $:/core/modules/widget/version.js +type: application/javascript +module-type: widget + +Implements the version widget. + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var VersionWidget = function(renderer) { + // Save state + this.renderer = renderer; + // Generate child nodes + this.generate(); +}; + +VersionWidget.prototype.generate = function() { + // Set the element + this.tag = "span"; + this.attributes = {}; + this.children = this.renderer.renderTree.createRenderers(this.renderer.renderContext,[{ + type: "text", + text: $tw.version + }]); +}; + +exports.version = VersionWidget; + +})(); diff --git a/core/templates/tiddlywiki5.template.html.tid b/core/templates/tiddlywiki5.template.html.tid index 47b62f96e..72a380420 100644 --- a/core/templates/tiddlywiki5.template.html.tid +++ b/core/templates/tiddlywiki5.template.html.tid @@ -6,7 +6,7 @@ title: $:/core/templates/tiddlywiki5.template.html - + diff --git a/core/templates/version.tid b/core/templates/version.tid new file mode 100644 index 000000000..1533b7af0 --- /dev/null +++ b/core/templates/version.tid @@ -0,0 +1,3 @@ +title: $:/core/templates/version + +<$version/> \ No newline at end of file