mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-29 11:30:28 +00:00
8564602256
Get rid of the separate renderContext stack and instead have a parent pointer on renderer nodes. This lets us walk back up the render tree to resolve context references
35 lines
623 B
JavaScript
35 lines
623 B
JavaScript
/*\
|
|
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,[{
|
|
type: "text",
|
|
text: $tw.version
|
|
}]);
|
|
};
|
|
|
|
exports.version = VersionWidget;
|
|
|
|
})();
|