mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-03 15:28:05 +00:00
First take of the ConfigInfo panel
It displays internal configuration information for debugging and learning about TiddlyWiki. Also introduces a way of interleaving documentation tiddlers (complete for tiddler fields, more module type docs to come)
This commit is contained in:
@@ -27,10 +27,27 @@ InfoWidget.types.changecount = function(options) {
|
||||
};
|
||||
|
||||
InfoWidget.types.currentfield = function(options) {
|
||||
var text = options.widget.renderer.renderTree.getContextVariable(options.widget.renderer,"field","text");
|
||||
return [{type: "text", text: text}];
|
||||
var fieldName = options.widget.renderer.renderTree.getContextVariable(options.widget.renderer,"field","text");
|
||||
return [{type: "text", text: fieldName}];
|
||||
};
|
||||
|
||||
var FIELD_DESCRIPTION_PREFIX = "$:/docs/fields/";
|
||||
|
||||
InfoWidget.types.currentfielddescription = function(options) {
|
||||
var fieldName = options.widget.renderer.renderTree.getContextVariable(options.widget.renderer,"field","text"),
|
||||
descriptionTitle = FIELD_DESCRIPTION_PREFIX + fieldName;
|
||||
return [{
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
isBlock: false,
|
||||
attributes: {
|
||||
target: {type: "string", value: descriptionTitle}
|
||||
}
|
||||
}];
|
||||
};
|
||||
|
||||
var MODULE_TYPE_DESCRIPTION_PREFIX = "$:/docs/moduletypes/";
|
||||
|
||||
/*
|
||||
Return a list of all the currently loaded modules grouped by type
|
||||
*/
|
||||
@@ -45,9 +62,18 @@ InfoWidget.types.modules = function(options) {
|
||||
// Output the module types
|
||||
$tw.utils.each(types,function(moduleType) {
|
||||
// Heading
|
||||
output.push({type: "element", tag: "h3", children: [
|
||||
output.push({type: "element", tag: "h2", children: [
|
||||
{type: "text", text: moduleType}
|
||||
]})
|
||||
// Description
|
||||
output.push({
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
isBlock: false,
|
||||
attributes: {
|
||||
target: {type: "string", value: MODULE_TYPE_DESCRIPTION_PREFIX + moduleType}
|
||||
}
|
||||
});
|
||||
// List each module
|
||||
var list = {type: "element", tag: "ul", children: []},
|
||||
modules = [];
|
||||
|
||||
Reference in New Issue
Block a user