From 0cf4c578d48fd1adb0b7847636e1a0d0b7b9757a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 9 Aug 2013 21:57:05 +0100 Subject: [PATCH] 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) --- core/docs/fields/color.tid | 3 +++ core/docs/fields/description.tid | 3 +++ core/docs/fields/footer.tid | 3 +++ core/docs/fields/icon.tid | 3 +++ core/docs/fields/library.tid | 3 +++ core/docs/fields/list.tid | 3 +++ core/docs/fields/modified.tid | 3 +++ core/docs/fields/modifier.tid | 3 +++ core/docs/fields/name.tid | 3 +++ core/docs/fields/plugin.tid | 3 +++ core/docs/fields/pluginpriority.tid | 3 +++ core/docs/fields/plugintype.tid | 3 +++ core/docs/fields/source.tid | 3 +++ core/docs/fields/subtitle.tid | 3 +++ core/docs/fields/tags.tid | 3 +++ core/docs/fields/text.tid | 3 +++ core/docs/fields/title.tid | 3 +++ core/docs/fields/type.tid | 3 +++ core/docs/moduletypes/animation.tid | 3 +++ core/modules/widgets/info.js | 32 ++++++++++++++++++++++++++--- core/wiki/ConfigInfo.tid | 4 +--- core/wiki/allfields.tid | 5 +++++ 22 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 core/docs/fields/color.tid create mode 100644 core/docs/fields/description.tid create mode 100644 core/docs/fields/footer.tid create mode 100644 core/docs/fields/icon.tid create mode 100644 core/docs/fields/library.tid create mode 100644 core/docs/fields/list.tid create mode 100644 core/docs/fields/modified.tid create mode 100644 core/docs/fields/modifier.tid create mode 100644 core/docs/fields/name.tid create mode 100644 core/docs/fields/plugin.tid create mode 100644 core/docs/fields/pluginpriority.tid create mode 100644 core/docs/fields/plugintype.tid create mode 100644 core/docs/fields/source.tid create mode 100644 core/docs/fields/subtitle.tid create mode 100644 core/docs/fields/tags.tid create mode 100644 core/docs/fields/text.tid create mode 100644 core/docs/fields/title.tid create mode 100644 core/docs/fields/type.tid create mode 100644 core/docs/moduletypes/animation.tid create mode 100644 core/wiki/allfields.tid diff --git a/core/docs/fields/color.tid b/core/docs/fields/color.tid new file mode 100644 index 000000000..33380c818 --- /dev/null +++ b/core/docs/fields/color.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/color + +The CSS color value associated with a tiddler \ No newline at end of file diff --git a/core/docs/fields/description.tid b/core/docs/fields/description.tid new file mode 100644 index 000000000..0aafdf9a8 --- /dev/null +++ b/core/docs/fields/description.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/description + +The descriptive text for a wizard \ No newline at end of file diff --git a/core/docs/fields/footer.tid b/core/docs/fields/footer.tid new file mode 100644 index 000000000..c9f4c1a27 --- /dev/null +++ b/core/docs/fields/footer.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/footer + +The footer text for a wizard \ No newline at end of file diff --git a/core/docs/fields/icon.tid b/core/docs/fields/icon.tid new file mode 100644 index 000000000..0a6c65fca --- /dev/null +++ b/core/docs/fields/icon.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/icon + +The title of the tiddler containing the icon associated with a tiddler \ No newline at end of file diff --git a/core/docs/fields/library.tid b/core/docs/fields/library.tid new file mode 100644 index 000000000..040e9689d --- /dev/null +++ b/core/docs/fields/library.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/library + +If set to "yes" indicates that a tiddler should be saved as a JavaScript library \ No newline at end of file diff --git a/core/docs/fields/list.tid b/core/docs/fields/list.tid new file mode 100644 index 000000000..124e64ff0 --- /dev/null +++ b/core/docs/fields/list.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/list + +An ordered list of tiddler titles associated with a tiddler \ No newline at end of file diff --git a/core/docs/fields/modified.tid b/core/docs/fields/modified.tid new file mode 100644 index 000000000..6e6116dfb --- /dev/null +++ b/core/docs/fields/modified.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/modified + +The date and time at which a tiddler was last modified \ No newline at end of file diff --git a/core/docs/fields/modifier.tid b/core/docs/fields/modifier.tid new file mode 100644 index 000000000..795a55b70 --- /dev/null +++ b/core/docs/fields/modifier.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/modifier + +The tiddler title associated with the person who last modified a tiddler \ No newline at end of file diff --git a/core/docs/fields/name.tid b/core/docs/fields/name.tid new file mode 100644 index 000000000..0d4ff129b --- /dev/null +++ b/core/docs/fields/name.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/name + +The human readable name associated with a plugin tiddler \ No newline at end of file diff --git a/core/docs/fields/plugin.tid b/core/docs/fields/plugin.tid new file mode 100644 index 000000000..0a3b037d2 --- /dev/null +++ b/core/docs/fields/plugin.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/plugin + +Set to "yes" to indicate that a tiddler is a plugin \ No newline at end of file diff --git a/core/docs/fields/pluginpriority.tid b/core/docs/fields/pluginpriority.tid new file mode 100644 index 000000000..433af2776 --- /dev/null +++ b/core/docs/fields/pluginpriority.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/plugin-priority + +A numerical value indicating the priority of a plugin tiddler \ No newline at end of file diff --git a/core/docs/fields/plugintype.tid b/core/docs/fields/plugintype.tid new file mode 100644 index 000000000..840de0ebe --- /dev/null +++ b/core/docs/fields/plugintype.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/plugin-type + +The type of plugin in a plugin tiddler \ No newline at end of file diff --git a/core/docs/fields/source.tid b/core/docs/fields/source.tid new file mode 100644 index 000000000..d18b804a4 --- /dev/null +++ b/core/docs/fields/source.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/source + +The source URL associated with a tiddler \ No newline at end of file diff --git a/core/docs/fields/subtitle.tid b/core/docs/fields/subtitle.tid new file mode 100644 index 000000000..3767519bf --- /dev/null +++ b/core/docs/fields/subtitle.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/subtitle + +The subtitle text for a wizard \ No newline at end of file diff --git a/core/docs/fields/tags.tid b/core/docs/fields/tags.tid new file mode 100644 index 000000000..22b4e56fc --- /dev/null +++ b/core/docs/fields/tags.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/tags + +A list of tags associated with a tiddler \ No newline at end of file diff --git a/core/docs/fields/text.tid b/core/docs/fields/text.tid new file mode 100644 index 000000000..20ab3af67 --- /dev/null +++ b/core/docs/fields/text.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/text + +The body text of a tiddler \ No newline at end of file diff --git a/core/docs/fields/title.tid b/core/docs/fields/title.tid new file mode 100644 index 000000000..ec9ab908d --- /dev/null +++ b/core/docs/fields/title.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/title + +The unique name of a tiddler \ No newline at end of file diff --git a/core/docs/fields/type.tid b/core/docs/fields/type.tid new file mode 100644 index 000000000..cea270f59 --- /dev/null +++ b/core/docs/fields/type.tid @@ -0,0 +1,3 @@ +title: $:/docs/fields/type + +The content type of a tiddler \ No newline at end of file diff --git a/core/docs/moduletypes/animation.tid b/core/docs/moduletypes/animation.tid new file mode 100644 index 000000000..f5c45561b --- /dev/null +++ b/core/docs/moduletypes/animation.tid @@ -0,0 +1,3 @@ +title: $:/docs/moduletypes/animation + +Animation modules contain animations that may be used with the RevealWidget. \ No newline at end of file diff --git a/core/modules/widgets/info.js b/core/modules/widgets/info.js index 62950d4ae..613326370 100644 --- a/core/modules/widgets/info.js +++ b/core/modules/widgets/info.js @@ -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 = []; diff --git a/core/wiki/ConfigInfo.tid b/core/wiki/ConfigInfo.tid index a962ef10d..249339ed4 100644 --- a/core/wiki/ConfigInfo.tid +++ b/core/wiki/ConfigInfo.tid @@ -6,9 +6,7 @@ This tiddler displays the internal configuration of this wiki, which can be usef This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers). -<$fieldlist all> -<$info type="currentField"/> - +{{$:/snippets/allfields}} ! Loaded Modules diff --git a/core/wiki/allfields.tid b/core/wiki/allfields.tid new file mode 100644 index 000000000..4a0cad328 --- /dev/null +++ b/core/wiki/allfields.tid @@ -0,0 +1,5 @@ +title: $:/snippets/allfields + +<$fieldlist all> +''<$info type="currentField"/>'': //<$info type="currentFieldDescription"/>// +