mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Added version widget
This commit is contained in:
parent
b7b1b0a693
commit
698f8dd602
34
core/modules/widgets/version.js
Normal file
34
core/modules/widgets/version.js
Normal file
@ -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;
|
||||
|
||||
})();
|
@ -6,7 +6,7 @@ title: $:/core/templates/tiddlywiki5.template.html
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="application-name" content="TiddlyWiki" />
|
||||
<meta name="generator" content="TiddlyWiki" />
|
||||
<meta name="tiddlywiki-version" content="{{version}}" />
|
||||
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
|
3
core/templates/version.tid
Normal file
3
core/templates/version.tid
Normal file
@ -0,0 +1,3 @@
|
||||
title: $:/core/templates/version
|
||||
|
||||
<$version/>
|
Loading…
Reference in New Issue
Block a user