1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Remove version widget in favour of widget macro

This commit is contained in:
Jeremy Ruston 2013-11-01 13:22:06 +00:00
parent 4118afe9e8
commit 363e90fca8
5 changed files with 3 additions and 79 deletions

View File

@ -1,62 +0,0 @@
/*\
title: $:/core/modules/new_widgets/version.js
type: application/javascript
module-type: new_widget
Version widget
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/new_widgets/widget.js").widget;
var VersionWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
VersionWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
VersionWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.execute();
var textNode = this.document.createTextNode($tw.version);
parent.insertBefore(textNode,nextSibling);
this.domNodes.push(textNode);
};
/*
Compute the internal state of the widget
*/
VersionWidget.prototype.execute = function() {
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
VersionWidget.prototype.refresh = function(changedTiddlers) {
return false;
};
/*
Remove any DOM nodes created by this widget
*/
VersionWidget.prototype.removeChildDomNodes = function() {
$tw.utils.each(this.domNodes,function(domNode) {
domNode.parentNode.removeChild(domNode);
});
this.domNodes = [];
};
exports.version = VersionWidget;
})();

View File

@ -1,3 +1,3 @@
title: $:/core/templates/version
<$version/>
<<version>>

View File

@ -20,4 +20,4 @@ Import: <$browse/>
---
TiddlyWiki5 version <$version/>
TiddlyWiki5 version <<version>>

View File

@ -23,6 +23,6 @@ Edit [[DefaultTiddlers|$:/DefaultTiddlers]] to choose which tiddlers are display
''Additional information about this ~TiddlyWiki''
*~TiddlyWiki5 version <$version/>
*~TiddlyWiki5 version <<version>>
*[[Wiki Info|$:/WikiInfo]]
*[[Internal configuration information|$:/ConfigInfo]]

View File

@ -1,14 +0,0 @@
title: VersionWidget
created: 201310241419
creator: JeremyRuston
modified: 201310300837
modifier: JeremyRuston
tags: widget
! Introduction
The version widget displays the current TiddlyWiki core version number.
! Content and Attributes
The content of the `<$version>` widget is ignored, and it doesn't take any attributes