mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-22 18:09:50 +00:00
Compare commits
8 Commits
testcase-w
...
plugin-sta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08cc320d34 | ||
|
|
5837570196 | ||
|
|
f2f6b72056 | ||
|
|
ece8b0ee01 | ||
|
|
21b02e8ba5 | ||
|
|
404015c455 | ||
|
|
25b1900849 | ||
|
|
29373c3359 |
@@ -206,6 +206,12 @@ Stylesheets/Caption: Stylesheets
|
||||
Stylesheets/Expand/Caption: Expand All
|
||||
Stylesheets/Hint: This is the rendered CSS of the current stylesheet tiddlers tagged with <<tag "$:/tags/Stylesheet">>
|
||||
Stylesheets/Restore/Caption: Restore
|
||||
TestCases/Caption: Test Cases
|
||||
TestCases/Hint: Test cases are self contained examples for testing and learning
|
||||
TestCases/All/Caption: All Test Cases
|
||||
TestCases/All/Hint: All Test Cases
|
||||
TestCases/Failed/Caption: Failed Test Cases
|
||||
TestCases/Failed/Hint: Only Failed Test Cases
|
||||
Theme/Caption: Theme
|
||||
Theme/Prompt: Current theme:
|
||||
TiddlerFields/Caption: Tiddler Fields
|
||||
|
||||
@@ -65,6 +65,9 @@ sidebar-tab-foreground-selected: Sidebar tab foreground for selected tabs
|
||||
sidebar-tab-foreground: Sidebar tab foreground
|
||||
sidebar-tiddler-link-foreground-hover: Sidebar tiddler link foreground hover
|
||||
sidebar-tiddler-link-foreground: Sidebar tiddler link foreground
|
||||
testcase-accent-level-1: Test case accent colour with no nesting
|
||||
testcase-accent-level-2: Test case accent colour with 2nd level nesting
|
||||
testcase-accent-level-3: Test case accent colour with 3rd level nesting or higher
|
||||
site-title-foreground: Site title foreground
|
||||
static-alert-foreground: Static alert foreground
|
||||
tab-background-selected: Tab background for selected tabs
|
||||
|
||||
@@ -30,6 +30,7 @@ name: The human readable name associated with a plugin tiddler
|
||||
parent-plugin: For a plugin, specifies which plugin of which it is a sub-plugin
|
||||
plugin-priority: A numerical value indicating the priority of a plugin tiddler
|
||||
plugin-type: The type of plugin in a plugin tiddler
|
||||
stability: The development status of a plugin: deprecated, experimental, stable, or legacy
|
||||
revision: The revision of the tiddler held at the server
|
||||
released: Date of a TiddlyWiki release
|
||||
source: The source URL associated with a tiddler
|
||||
|
||||
@@ -27,33 +27,8 @@ var Command = function(params,commander,callback) {
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
var wiki = this.commander.wiki,
|
||||
fs = require("fs"),
|
||||
path = require("path"),
|
||||
upgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,
|
||||
tiddlers = {};
|
||||
// Collect up the library plugins
|
||||
var collectPlugins = function(folder) {
|
||||
var pluginFolders = $tw.utils.getSubdirectories(folder) || [];
|
||||
for(var p=0; p<pluginFolders.length; p++) {
|
||||
if(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {
|
||||
pluginFields = $tw.loadPluginFolder(path.resolve(folder,"./" + pluginFolders[p]));
|
||||
if(pluginFields && pluginFields.title) {
|
||||
tiddlers[pluginFields.title] = pluginFields;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
collectPublisherPlugins = function(folder) {
|
||||
var publisherFolders = $tw.utils.getSubdirectories(folder) || [];
|
||||
for(var t=0; t<publisherFolders.length; t++) {
|
||||
if(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {
|
||||
collectPlugins(path.resolve(folder,"./" + publisherFolders[t]));
|
||||
}
|
||||
}
|
||||
};
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,$tw.config.pluginsEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,$tw.config.themesEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,$tw.config.languagesEnvVar),collectPlugins);
|
||||
tiddlers = $tw.utils.getAllPlugins();
|
||||
// Save the upgrade library tiddler
|
||||
var pluginFields = {
|
||||
title: upgradeLibraryTitle,
|
||||
|
||||
48
core/modules/utils/repository.js
Normal file
48
core/modules/utils/repository.js
Normal file
@@ -0,0 +1,48 @@
|
||||
/*\
|
||||
title: $:/core/modules/utils/repository.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
Utilities for working with the TiddlyWiki repository file structure
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Get an object containing all the plugins as a hashmap by title of the JSON representation of the plugin
|
||||
*/
|
||||
exports.getAllPlugins = function() {
|
||||
var fs = require("fs"),
|
||||
path = require("path"),
|
||||
tiddlers = {};
|
||||
// Collect up the library plugins
|
||||
var collectPlugins = function(folder) {
|
||||
var pluginFolders = $tw.utils.getSubdirectories(folder) || [];
|
||||
for(var p=0; p<pluginFolders.length; p++) {
|
||||
if(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {
|
||||
var pluginFields = $tw.loadPluginFolder(path.resolve(folder,"./" + pluginFolders[p]));
|
||||
if(pluginFields && pluginFields.title) {
|
||||
tiddlers[pluginFields.title] = pluginFields;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
collectPublisherPlugins = function(folder) {
|
||||
var publisherFolders = $tw.utils.getSubdirectories(folder) || [];
|
||||
for(var t=0; t<publisherFolders.length; t++) {
|
||||
if(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {
|
||||
collectPlugins(path.resolve(folder,"./" + publisherFolders[t]));
|
||||
}
|
||||
}
|
||||
};
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,$tw.config.pluginsEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,$tw.config.themesEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,$tw.config.languagesEnvVar),collectPlugins);
|
||||
return tiddlers;
|
||||
};
|
||||
|
||||
})();
|
||||
145
core/modules/widgets/data.js
Normal file
145
core/modules/widgets/data.js
Normal file
@@ -0,0 +1,145 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/data.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Widget to dynamically represent one or more tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
|
||||
var DataWidget = function(parseTreeNode,options) {
|
||||
this.dataWidgetTag = parseTreeNode.type;
|
||||
this.initialise(parseTreeNode,options);
|
||||
};
|
||||
|
||||
/*
|
||||
Inherit from the base widget class
|
||||
*/
|
||||
DataWidget.prototype = new Widget();
|
||||
|
||||
/*
|
||||
Render this widget into the DOM
|
||||
*/
|
||||
DataWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var jsonPayload = JSON.stringify(this.readDataTiddlerValues(),null,4);
|
||||
var textNode = this.document.createTextNode(jsonPayload);
|
||||
parent.insertBefore(textNode,nextSibling);
|
||||
this.domNodes.push(textNode);
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
DataWidget.prototype.execute = function() {
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Read the tiddler value(s) from a data widget – must be called after the .render() method
|
||||
*/
|
||||
DataWidget.prototype.readDataTiddlerValues = function() {
|
||||
var self = this;
|
||||
// Start with a blank object
|
||||
var item = Object.create(null);
|
||||
// Read any attributes not prefixed with $
|
||||
$tw.utils.each(this.attributes,function(value,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
item[name] = value;
|
||||
}
|
||||
});
|
||||
item = new $tw.Tiddler(item);
|
||||
// Deal with $tiddler, $filter or $compound-tiddler attributes
|
||||
var tiddlers = [],title;
|
||||
if(this.hasAttribute("$tiddler")) {
|
||||
title = this.getAttribute("$tiddler");
|
||||
if(title) {
|
||||
var tiddler = this.wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
tiddlers.push(tiddler);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.hasAttribute("$filter")) {
|
||||
var filter = this.getAttribute("$filter");
|
||||
if(filter) {
|
||||
var titles = this.wiki.filterTiddlers(filter);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
var tiddler = self.wiki.getTiddler(title);
|
||||
tiddlers.push(tiddler);
|
||||
});
|
||||
}
|
||||
}
|
||||
if(this.hasAttribute("$compound-tiddler")) {
|
||||
title = this.getAttribute("$compound-tiddler");
|
||||
if(title) {
|
||||
tiddlers.push.apply(tiddlers,this.extractCompoundTiddler(title));
|
||||
}
|
||||
}
|
||||
// Convert the literal item to field strings
|
||||
item = item.getFieldStrings();
|
||||
if(tiddlers.length === 0) {
|
||||
if(Object.keys(item).length > 0 && !!item.title) {
|
||||
return [item];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
} else {
|
||||
var results = [];
|
||||
$tw.utils.each(tiddlers,function(tiddler,index) {
|
||||
var fields = tiddler.getFieldStrings();
|
||||
results.push($tw.utils.extend({},fields,item));
|
||||
});
|
||||
return results;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Helper to extract tiddlers from text/vnd.tiddlywiki-multiple tiddlers
|
||||
*/
|
||||
DataWidget.prototype.extractCompoundTiddler = function(title) {
|
||||
var tiddler = this.wiki.getTiddler(title);
|
||||
if(tiddler && tiddler.fields.type === "text/vnd.tiddlywiki-multiple") {
|
||||
var text = tiddler.fields.text || "",
|
||||
rawTiddlers = text.split(/\r?\n\+\r?\n/),
|
||||
tiddlers = [];
|
||||
$tw.utils.each(rawTiddlers,function(rawTiddler) {
|
||||
var fields = Object.create(null),
|
||||
split = rawTiddler.split(/\r?\n\r?\n/mg);
|
||||
if(split.length >= 1) {
|
||||
fields = $tw.utils.parseFields(split[0],fields);
|
||||
}
|
||||
if(split.length >= 2) {
|
||||
fields.text = split.slice(1).join("\n\n");
|
||||
}
|
||||
tiddlers.push(new $tw.Tiddler(fields));
|
||||
});
|
||||
return tiddlers;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
DataWidget.prototype.refresh = function(changedTiddlers) {
|
||||
// It would be expensive to calculate whether the changedTiddlers impact the filter
|
||||
// identified by the $filter attribute so we just refresh ourselves unconditionally
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.data = DataWidget;
|
||||
|
||||
})();
|
||||
160
core/modules/widgets/testcase.js
Normal file
160
core/modules/widgets/testcase.js
Normal file
@@ -0,0 +1,160 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/testcase.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Widget to display a test case
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
|
||||
var TestCaseWidget = function(parseTreeNode,options) {
|
||||
this.initialise(parseTreeNode,options);
|
||||
};
|
||||
|
||||
/*
|
||||
Inherit from the base widget class
|
||||
*/
|
||||
TestCaseWidget.prototype = new Widget();
|
||||
|
||||
/*
|
||||
Render this widget into the DOM
|
||||
*/
|
||||
TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
var self = this;
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
// Create container DOM node
|
||||
var domNode = this.document.createElement("div");
|
||||
this.domNodes.push(domNode);
|
||||
parent.insertBefore(domNode,nextSibling);
|
||||
// Render the children into a hidden DOM node
|
||||
var parser = {
|
||||
tree: [{
|
||||
type: "widget",
|
||||
attributes: {},
|
||||
orderedAttributes: [],
|
||||
children: this.parseTreeNode.children || []
|
||||
}]
|
||||
};
|
||||
this.contentRoot = this.wiki.makeWidget(parser,{
|
||||
document: $tw.fakeDocument,
|
||||
parentWidget: this
|
||||
});
|
||||
this.contentContainer = $tw.fakeDocument.createElement("div");
|
||||
this.contentRoot.render(this.contentContainer,null);
|
||||
// Create a wiki
|
||||
this.testcaseWiki = new $tw.Wiki();
|
||||
// Always load the core plugin
|
||||
var loadTiddler = function(title) {
|
||||
var tiddler = self.wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
self.testcaseWiki.addTiddler(tiddler);
|
||||
}
|
||||
}
|
||||
loadTiddler("$:/core");
|
||||
loadTiddler("$:/plugins/tiddlywiki/codemirror");
|
||||
// Load tiddlers from child data widgets
|
||||
var tiddlers = [];
|
||||
this.findChildrenDataWidgets(this.contentRoot.children,"data",function(widget) {
|
||||
Array.prototype.push.apply(tiddlers,widget.readDataTiddlerValues());
|
||||
});
|
||||
var jsonPayload = JSON.stringify(tiddlers);
|
||||
this.testcaseWiki.addTiddlers(tiddlers);
|
||||
// Unpack plugin tiddlers
|
||||
this.testcaseWiki.readPluginInfo();
|
||||
this.testcaseWiki.registerPluginTiddlers("plugin");
|
||||
this.testcaseWiki.unpackPluginTiddlers();
|
||||
this.testcaseWiki.addIndexersToWiki();
|
||||
// Generate a `transclusion` variable that depends on the values of the payload tiddlers so that the template can easily make unique state tiddlers
|
||||
this.setVariable("transclusion",$tw.utils.hashString(jsonPayload));
|
||||
// Generate a `payloadTiddlers` variable that contains the payload in JSON format
|
||||
this.setVariable("payloadTiddlers",jsonPayload);
|
||||
// Render the test rendering if required
|
||||
if(this.testcaseTestOutput && this.testcaseTestExpectedResult) {
|
||||
var testcaseOutputContainer = $tw.fakeDocument.createElement("div");
|
||||
var testcaseOutputWidget = this.testcaseWiki.makeTranscludeWidget(this.testcaseTestOutput,{
|
||||
document: $tw.fakeDocument,
|
||||
parseAsInline: false,
|
||||
parentWidget: this,
|
||||
variables: {
|
||||
currentTiddler: this.testcaseTestOutput
|
||||
}
|
||||
});
|
||||
testcaseOutputWidget.render(testcaseOutputContainer);
|
||||
}
|
||||
// Clear changes queue
|
||||
this.testcaseWiki.clearTiddlerEventQueue();
|
||||
// Run the actions if provided
|
||||
if(this.testcaseWiki.tiddlerExists(this.testcaseTestActions)) {
|
||||
testcaseOutputWidget.invokeActionString(this.testcaseWiki.getTiddlerText(this.testcaseTestActions));
|
||||
testcaseOutputWidget.refresh(this.testcaseWiki.changedTiddlers,testcaseOutputContainer);
|
||||
}
|
||||
// Set up the test result variables
|
||||
var testResult = "",
|
||||
outputHTML = "",
|
||||
expectedHTML = "";
|
||||
if(this.testcaseTestOutput && this.testcaseTestExpectedResult) {
|
||||
outputHTML = testcaseOutputContainer.children[0].innerHTML;
|
||||
expectedHTML = this.testcaseWiki.getTiddlerText(this.testcaseTestExpectedResult);
|
||||
if(outputHTML === expectedHTML) {
|
||||
testResult = "pass";
|
||||
} else {
|
||||
testResult = "fail";
|
||||
}
|
||||
this.setVariable("outputHTML",outputHTML);
|
||||
this.setVariable("expectedHTML",expectedHTML);
|
||||
this.setVariable("testResult",testResult);
|
||||
this.setVariable("currentTiddler",this.testcaseTestOutput);
|
||||
}
|
||||
// Don't display anything if testHideIfPass is "yes" and the tests have passed
|
||||
if(this.testcaseHideIfPass === "yes" && testResult === "pass") {
|
||||
return;
|
||||
}
|
||||
// Render the page root template of the subwiki
|
||||
var rootWidget = this.testcaseWiki.makeTranscludeWidget(this.testcaseTemplate,{
|
||||
document: this.document,
|
||||
parseAsInline: false,
|
||||
parentWidget: this
|
||||
});
|
||||
rootWidget.render(domNode);
|
||||
// Trap changes in the wiki and refresh the rendering
|
||||
this.testcaseWiki.addEventListener("change",function(changes) {
|
||||
rootWidget.refresh(changes,domNode);
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
TestCaseWidget.prototype.execute = function() {
|
||||
this.testcaseTemplate = this.getAttribute("template","$:/core/ui/testcases/DefaultTemplate");
|
||||
this.testcaseTestOutput = this.getAttribute("testOutput");
|
||||
this.testcaseTestActions = this.getAttribute("testActions");
|
||||
this.testcaseTestExpectedResult = this.getAttribute("testExpectedResult");
|
||||
this.testcaseHideIfPass = this.getAttribute("testHideIfPass");
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
TestCaseWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if($tw.utils.count(changedAttributes) > 0) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
return this.contentRoot.refresh(changedTiddlers);
|
||||
}
|
||||
};
|
||||
|
||||
exports["testcase"] = TestCaseWidget;
|
||||
|
||||
})();
|
||||
@@ -813,6 +813,21 @@ Widget.prototype.allowActionPropagation = function() {
|
||||
return true;
|
||||
};
|
||||
|
||||
/*
|
||||
Find child <$data> widgets recursively. The tag name allows aliased versions of the widget to be found too
|
||||
*/
|
||||
Widget.prototype.findChildrenDataWidgets = function(children,tag,callback) {
|
||||
var self = this;
|
||||
$tw.utils.each(children,function(child) {
|
||||
if(child.dataWidgetTag === tag) {
|
||||
callback(child);
|
||||
}
|
||||
if(child.children) {
|
||||
self.findChildrenDataWidgets(child.children,tag,callback);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Evaluate a variable with parameters. This is a static convenience method that attempts to evaluate a variable as a function, returning an array of strings
|
||||
*/
|
||||
|
||||
@@ -95,6 +95,9 @@ table-footer-background: #a8a8a8
|
||||
table-header-background: #f0f0f0
|
||||
tag-background: #ec6
|
||||
tag-foreground: #ffffff
|
||||
testcase-accent-level-1: #84C5E6
|
||||
testcase-accent-level-2: #E3B740
|
||||
testcase-accent-level-3: #5FD564
|
||||
tiddler-background: <<colour background>>
|
||||
tiddler-border: <<colour background>>
|
||||
tiddler-controls-foreground-hover: #888888
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
"author": "JeremyRuston",
|
||||
"core-version": ">=5.0.0",
|
||||
"plugin-priority": "0",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -45,7 +45,17 @@ $:/config/Plugins/Disabled/$(currentTiddler)$
|
||||
<$view field="title"/>
|
||||
</h2>
|
||||
<h2>
|
||||
<div><em><$view field="version"/></em></div>
|
||||
<div>
|
||||
<%if [<currentTiddler>get[stability]match[STABILITY_0_DEPRECATED]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated">DEPRECATED</span>
|
||||
<%elseif [<currentTiddler>get[stability]match[STABILITY_1_EXPERIMENTAL]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-experimental">EXPERIMENTAL</span>
|
||||
<%elseif [<currentTiddler>get[stability]match[STABILITY_2_STABLE]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-stable">STABLE</span>
|
||||
<%elseif [<currentTiddler>get[stability]match[STABILITY_3_LEGACY]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-legacy">LEGACY</span>
|
||||
<%endif%>
|
||||
<em><$view field="version"/></em></div>
|
||||
</h2>
|
||||
</div>
|
||||
\end
|
||||
|
||||
@@ -70,9 +70,20 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
|
||||
<div class="tc-plugin-info-chunk tc-plugin-info-description">
|
||||
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>:
|
||||
 
|
||||
<$view tiddler=<<assetInfo>> field="description"/></h1>
|
||||
<$view tiddler=<<assetInfo>> field="description"/>
|
||||
</h1>
|
||||
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
|
||||
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
|
||||
<div>
|
||||
<%if [<assetInfo>get[stability]match[STABILITY_0_DEPRECATED]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated">DEPRECATED</span>
|
||||
<%elseif [<assetInfo>get[stability]match[STABILITY_1_EXPERIMENTAL]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-experimental">EXPERIMENTAL</span>
|
||||
<%elseif [<assetInfo>get[stability]match[STABILITY_2_STABLE]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-stable">STABLE</span>
|
||||
<%elseif [<assetInfo>get[stability]match[STABILITY_3_LEGACY]] %>
|
||||
<span class="tc-plugin-info-stability tc-plugin-info-stability-legacy">LEGACY</span>
|
||||
<%endif%>
|
||||
<em><$view tiddler=<<assetInfo>> field="version"/></em></div>
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk tc-plugin-info-buttons">
|
||||
|
||||
10
core/ui/ControlPanel/TestCases.tid
Normal file
10
core/ui/ControlPanel/TestCases.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/ui/ControlPanel/TestCases
|
||||
tags: $:/tags/ControlPanel/Advanced
|
||||
caption: {{$:/language/ControlPanel/TestCases/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
{{$:/language/ControlPanel/TestCases/Hint}}
|
||||
|
||||
<div class="tc-control-panel">
|
||||
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/TestCases]!has[draft.of]]" default="$:/core/ui/ControlPanel/TestCases/All"/>
|
||||
</div>
|
||||
24
core/ui/ControlPanel/TestCasesAll.tid
Normal file
24
core/ui/ControlPanel/TestCasesAll.tid
Normal file
@@ -0,0 +1,24 @@
|
||||
title: $:/core/ui/ControlPanel/TestCases/All
|
||||
tags: $:/tags/ControlPanel/TestCases
|
||||
caption: {{$:/language/ControlPanel/TestCases/All/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/
|
||||
<<lingo TestCases/All/Hint>>
|
||||
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]] [all[tiddlers+shadows]tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]]">
|
||||
|
||||
<h2>
|
||||
|
||||
<$link>
|
||||
|
||||
<$text text=<<currentTiddler>>/>
|
||||
|
||||
</$link>
|
||||
|
||||
</h2>
|
||||
|
||||
<$transclude
|
||||
$tiddler="$:/core/ui/TestCaseTemplate"
|
||||
/>
|
||||
|
||||
</$list>
|
||||
15
core/ui/ControlPanel/TestCasesFailed.tid
Normal file
15
core/ui/ControlPanel/TestCasesFailed.tid
Normal file
@@ -0,0 +1,15 @@
|
||||
title: $:/core/ui/ControlPanel/TestCases/Failed
|
||||
tags: $:/tags/ControlPanel/TestCases
|
||||
caption: {{$:/language/ControlPanel/TestCases/Failed/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/
|
||||
<<lingo TestCases/Failed/Hint>>
|
||||
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]] [all[tiddlers+shadows]tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]]">
|
||||
|
||||
<$transclude
|
||||
$tiddler="$:/core/ui/TestCaseTemplate"
|
||||
hideIfPass="yes"
|
||||
/>
|
||||
|
||||
</$list>
|
||||
18
core/ui/TestCaseTemplate.tid
Normal file
18
core/ui/TestCaseTemplate.tid
Normal file
@@ -0,0 +1,18 @@
|
||||
title: $:/core/ui/TestCaseTemplate
|
||||
|
||||
\parameters (hideIfPass:"no")
|
||||
\whitespace trim
|
||||
<$let
|
||||
linkTarget="yes"
|
||||
displayFormat={{!!display-format}}
|
||||
>
|
||||
<$testcase
|
||||
testOutput="Output"
|
||||
testExpectedResult="ExpectedResult"
|
||||
testActions="Actions"
|
||||
testHideIfPass=<<hideIfPass>>
|
||||
>
|
||||
<$data $compound-tiddler=<<currentTiddler>>/>
|
||||
<$data title="Description" text={{!!description}}/>
|
||||
</$testcase>
|
||||
</$let>
|
||||
64
core/ui/TestCases/DefaultTemplate.tid
Normal file
64
core/ui/TestCases/DefaultTemplate.tid
Normal file
@@ -0,0 +1,64 @@
|
||||
title: $:/core/ui/testcases/DefaultTemplate
|
||||
|
||||
\whitespace trim
|
||||
\procedure linkcatcherActions()
|
||||
<%if [<navigateTo>has[title]] %>
|
||||
<$qualify title=<<state>> name="qualifiedState">
|
||||
<$action-setfield $tiddler=<<qualifiedState>> text=<<navigateTo>>/>
|
||||
</$qualify>
|
||||
<%endif%>
|
||||
\end
|
||||
|
||||
<$let
|
||||
state={{{ [<qualify "$:/state/testcase">] }}}
|
||||
>
|
||||
<div class="tc-test-case-wrapper">
|
||||
<div class="tc-test-case-header">
|
||||
<h2>
|
||||
<$genesis $type={{{ [<linkTarget>!match[]then[$link]else[div]] }}}>
|
||||
<%if [<testResult>!match[]] %>
|
||||
<span class={{{ tc-test-case-result-icon [<testResult>!match[fail]then[tc-test-case-result-icon-pass]] [<testResult>match[fail]then[tc-test-case-result-icon-fail]] +[join[ ]] }}}>
|
||||
<%if [<testResult>!match[fail]] %>
|
||||
{{$:/core/images/done-button}}
|
||||
<%else%>
|
||||
{{$:/core/images/close-button}}
|
||||
<%endif%>
|
||||
</span>
|
||||
<%endif%>
|
||||
<$view tiddler="Description" mode="inline"/>
|
||||
</$genesis>
|
||||
</h2>
|
||||
</div>
|
||||
<%if [[Narrative]is[tiddler]] %>
|
||||
<div class="tc-test-case-narrative">
|
||||
<$transclude $tiddler="Narrative" mode="block"/>
|
||||
</div>
|
||||
<%endif%>
|
||||
<%if [<testResult>match[fail]] %>
|
||||
<div class="tc-test-case-result-fail">
|
||||
<div class="tc-test-case-result-fail-header">
|
||||
TEST FAILED
|
||||
</div>
|
||||
<div class="tc-test-case-result-fail-body">
|
||||
<$diff-text source=<<expectedHTML>> dest=<<outputHTML>>/>
|
||||
</div>
|
||||
</div>
|
||||
<%endif%>
|
||||
<div class="tc-test-case-panes">
|
||||
<div class="tc-test-case-source">
|
||||
<$macrocall $name="tabs" tabsList="[all[tiddlers]sort[]] -[prefix<state>] -Description -Narrative -ExpectedResult -Output Output +[putfirst[]] -[has[plugin-type]]" state=<<state>> default="Output" template="$:/core/ui/testcases/DefaultTemplate/SourceTabs"/>
|
||||
</div>
|
||||
<div class="tc-test-case-divider">
|
||||
</div>
|
||||
<div class="tc-test-case-output">
|
||||
<%if [<displayFormat>!match[]else[wikitext]match[plaintext]] %>
|
||||
<pre><$view tiddler="Output" format="plainwikified" mode="block"/></pre>
|
||||
<%else%>
|
||||
<$linkcatcher actions=<<linkcatcherActions>>>
|
||||
<$transclude $tiddler="Output" $mode="block"/>
|
||||
</$linkcatcher>
|
||||
<%endif%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</$let>
|
||||
24
core/ui/TestCases/DefaultTemplateSourceTabs.tid
Normal file
24
core/ui/TestCases/DefaultTemplateSourceTabs.tid
Normal file
@@ -0,0 +1,24 @@
|
||||
title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
|
||||
|
||||
\whitespace trim
|
||||
\procedure body()
|
||||
<$list filter="[<currentTab>fields[]] -text +[limit[1]]" variable="ignore">
|
||||
<table class="tc-field-table">
|
||||
<tbody>
|
||||
<$list filter="[<currentTab>fields[]sort[]] -text -title title +[putfirst[]]" variable="fieldName">
|
||||
<tr>
|
||||
<td>
|
||||
<$text text=<<fieldName>>/>
|
||||
</td>
|
||||
<td>
|
||||
<$view tiddler=<<currentTab>> field=<<fieldName>>/>
|
||||
</td>
|
||||
</tr>
|
||||
</$list>
|
||||
</tbody>
|
||||
</table>
|
||||
</$list>
|
||||
<$edit class="tc-edit-texteditor" tiddler=<<currentTab>>/>
|
||||
\end
|
||||
|
||||
<$transclude $variable="body" $mode="inline"/>
|
||||
4
core/ui/TestCases/RawJSONTemplate.tid
Normal file
4
core/ui/TestCases/RawJSONTemplate.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/testcases/RawJSONTemplate
|
||||
|
||||
\whitespace trim
|
||||
<$text text=<<payloadTiddlers>>/>
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.3.3/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
tags: $:/tags/PluginLibrary
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
url: https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app/library/v5.3.3/index.html
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
Plugin library for https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app
|
||||
@@ -1,6 +1,7 @@
|
||||
title: $:/config/ViewTemplateBodyFilters/
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
|
||||
testcase: [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]]
|
||||
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
|
||||
core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]][tag[$:/tags/EditorToolbar]] [tag[$:/tags/Actions]] :then[[$:/core/ui/ViewTemplate/body/code]]
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
|
||||
10
core/wiki/macros/testcase.tid
Normal file
10
core/wiki/macros/testcase.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/macros/testcase
|
||||
tags: $:/tags/Macro $:/tags/Global
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\procedure testcase(tiddler)
|
||||
<$tiddler tiddler=<<tiddler>>>
|
||||
<$transclude $tiddler="$:/core/ui/TestCaseTemplate">
|
||||
</$tiddler>
|
||||
\end
|
||||
@@ -1,2 +1,2 @@
|
||||
title: $:/tags/ViewTemplateBodyFilter
|
||||
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
list: $:/config/ViewTemplateBodyFilters/testcase $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.3/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
url: https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app/library/v5.3.3/index.html
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
Plugin library for https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app
|
||||
@@ -3,3 +3,7 @@ title: HelloThere
|
||||
This is TiddlyWiki's browser-based test runner for version <<version>>. See the bottom of this page for the test results.
|
||||
|
||||
https://tiddlywiki.com/
|
||||
|
||||
! Test Cases
|
||||
|
||||
{{$:/core/ui/ControlPanel/TestCases}}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"directories": [
|
||||
"../../../../tw5.com/tiddlers/testcases"
|
||||
]
|
||||
}
|
||||
44
editions/test/tiddlers/tests/test-plugins.js
Normal file
44
editions/test/tiddlers/tests/test-plugins.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*\
|
||||
title: test-plugins.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests for integrity of the core plugins, languages, themes and editions
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe("Plugin tests", function() {
|
||||
|
||||
// Get all the plugins as a hashmap by title of a JSON string with the plugin content
|
||||
var tiddlers = $tw.utils.getAllPlugins();
|
||||
// console.log(JSON.stringify(Object.keys(tiddlers),null,4));
|
||||
describe("every plugin should have the required standard fields", function() {
|
||||
var titles = Object.keys(tiddlers);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
it("plugin " + title + " should have the required standard fields",function() {
|
||||
var fields = tiddlers[title];
|
||||
expect(fields["plugin-type"]).toMatch(/^(?:plugin|language|theme)$/);
|
||||
switch(fields["plugin-type"]) {
|
||||
case "plugin":
|
||||
expect(!!(fields.name && fields.description && fields.list)).toEqual(true);
|
||||
expect(fields.stability).toMatch(/^(?:STABILITY_0_DEPRECATED|STABILITY_1_EXPERIMENTAL|STABILITY_2_STABLE|STABILITY_3_LEGACY)$/);
|
||||
break;
|
||||
case "language":
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
break;
|
||||
case "theme":
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
31
editions/tw5.com/tiddlers/concepts/CompoundTiddlers.tid
Normal file
31
editions/tw5.com/tiddlers/concepts/CompoundTiddlers.tid
Normal file
@@ -0,0 +1,31 @@
|
||||
title: CompoundTiddlers
|
||||
modified: 20240507221902644
|
||||
created: 20240507221902644
|
||||
tags: Concepts
|
||||
|
||||
Compound tiddlers are a special type of tiddler that can store one or more payload tiddlers. The tiddlers within a compound tiddler are only accessible via special operations, typically with the TestCaseWidget.
|
||||
|
||||
The compound tiddler format is extremely simple, and includes the notable flaw that it does not permit tiddlers that contain a plus sign (`+`) on a line by itself. It is not intended as a general purpose way of storing tiddler data.
|
||||
|
||||
Compound tiddlers are identified by having their type field set to `text/vnd.tiddlywiki-multiple`.
|
||||
|
||||
The content of a compound tiddler consists of a sequence of tiddlers separated by a plus sign (`+`) on a line by itself. Each tiddler uses the same format as [[.tid files|TiddlerFiles]].
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
title: First
|
||||
tags: one two
|
||||
|
||||
This is the first tiddler
|
||||
+
|
||||
title: Second
|
||||
tags: three four
|
||||
|
||||
This is the second tiddler
|
||||
+
|
||||
title: third
|
||||
tags: five six
|
||||
|
||||
This is the third tiddler
|
||||
```
|
||||
27
editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid
Normal file
27
editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid
Normal file
@@ -0,0 +1,27 @@
|
||||
title: TestCaseTiddlers
|
||||
modified: 20240507221902644
|
||||
created: 20240507221902644
|
||||
tags: Concepts
|
||||
|
||||
Test case tiddlers encapsulate one or more tiddlers that can be displayed as a [[test case|TestCaseWidget]]: an independent embedded wiki that can be used for testing or learning purposes.
|
||||
|
||||
Test case tiddlers are formatted as CompoundTiddlers, allowing them to contain multiple tiddlers packed into one.
|
||||
|
||||
Test case tiddlers have the following fields:
|
||||
|
||||
|!Field |!Description |
|
||||
|<<.field type>> | Should be set to `text/vnd.tiddlywiki-multiple` |
|
||||
|<<.field tags>> | Test cases are tagged [[$:/tags/wiki-test-spec]]. Test cases that intentionally fail are tagged [[$:/tags/wiki-test-spec-failing]] |
|
||||
|<<.field description>> |Descriptive heading for the test, intended to make it easy to identify the test |
|
||||
|<<.field display-format>> |Optional, defaults to `wikitext`. Set to `plaintext` to cause the output to be rended as plain text |
|
||||
|
||||
Test case tiddlers with the appropriate tag are shown in $:/ControlPanel
|
||||
|
||||
Some payload tiddlers are set aside for special purposes:
|
||||
|
||||
|!Tiddler |!Description |
|
||||
|''Narrative'' |Narrative description of the test, intended to explain the purpose and operation of the test |
|
||||
|''Output'' |The tiddler that produces the test output |
|
||||
|''~ExpectedResult'' |HTML of expected result of rendering the ''Output'' tiddler |
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20130825213300000
|
||||
modified: 20240416103247799
|
||||
modified: 20240520162904479
|
||||
tags: Concepts
|
||||
title: TiddlerFields
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -39,6 +39,7 @@ Other fields used by the core are:
|
||||
|`name` |<<lingo name>> |
|
||||
|`plugin-priority` |<<lingo plugin-priority>> |
|
||||
|`plugin-type` |<<lingo plugin-type>> |
|
||||
|`stability` |<<lingo stability>> |
|
||||
|`source` |<<lingo source>> |
|
||||
|`subtitle` |<<lingo subtitle>> |
|
||||
|`throttle.refresh` |<<lingo throttle.refresh>> |
|
||||
|
||||
@@ -5,7 +5,7 @@ tags: TableOfContents
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
!!.tc-hero-heading ''Welcome to TiddlyWiki, a unique [[non-linear|Philosophy of Tiddlers]] notebook for [[capturing|Creating and editing tiddlers]], [[organising|Structuring TiddlyWiki]] and [[sharing|Sharing your tiddlers with others]] complex information''
|
||||
!!.tc-hero-heading ''Welcome to TiddlyWiki, a unique [[non-linear|Philosophy of Tiddlers]] notebook for [[capturing|Creating and editing tiddlers]], [[organising|Structuring TiddlyWiki]] and [[sharing|Sharing your tiddlers with others]] complex information''
|
||||
|
||||
Use it to keep your [[to-do list|TaskManagementExample]], to plan an [[essay or novel|"TiddlyWiki for Scholars" by Alberto Molina]], or to organise your wedding. Record every thought that crosses your brain, or build a flexible and responsive website.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20130826122000000
|
||||
modified: 20220613124446953
|
||||
modified: 20240520162828577
|
||||
tags: Mechanisms
|
||||
title: PluginMechanism
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -16,6 +16,10 @@ By convention, plugin titles have the form `$:/plugins/<publisher>/<name>`. Plug
|
||||
|
||||
When [[running TiddlyWiki under Node.js|TiddlyWiki on Node.js]], plugins can also be stored as individual tiddler files in [[PluginFolders]].
|
||||
|
||||
! Plugin Stability
|
||||
|
||||
{{Plugin Stability}}
|
||||
|
||||
! Plugin Types
|
||||
|
||||
{{Plugin Types}}
|
||||
|
||||
@@ -4,7 +4,7 @@ tags: [[Releases]]
|
||||
title: TiddlyWiki5 Versioning
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Each release of TiddlyWiki5 is identified by a version number that complies with the [[Semantic Versioning 2.0.0|http://semver.org/]] standard.
|
||||
Each release of TiddlyWiki5 is identified by a version number that complies with a variant of [[Semantic Versioning 2.0.0|http://semver.org/]] standard.
|
||||
|
||||
! TiddlyWiki Core Version
|
||||
|
||||
|
||||
14
editions/tw5.com/tiddlers/plugins/Plugin Stability.tid
Normal file
14
editions/tw5.com/tiddlers/plugins/Plugin Stability.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
created: 20240520155341641
|
||||
modified: 20240520162820882
|
||||
tags: PluginMechanism
|
||||
title: Plugin Stability
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Plugins are recommended to have a `stability` field that communicates the state of development of the plugin. It can contain the following values:
|
||||
|
||||
* ''STABILITY_0_DEPRECATED'' - Deprecated. This plugin is not recommended for new projects
|
||||
* ''STABILITY_1_EXPERIMENTAL'' - Experimental. Non-backward compatible changes or removal may occur in any future release. Use of the plugin is not recommended in production environments
|
||||
* ''STABILITY_2_STABLE'' - Stable.
|
||||
* ''STABILITY_3_LEGACY'' - Legacy. Although this plugin is unlikely to be removed, it is no longer actively maintained, and other alternatives are available
|
||||
|
||||
These stability levels are taken from the Node.js project - https://nodejs.org/api/documentation.html#stability-index.
|
||||
@@ -0,0 +1,33 @@
|
||||
title: TestCases/DataWidget/ImportCompound
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Importing a compound payload tiddler and adding custom fields
|
||||
display-format: plaintext
|
||||
|
||||
title: Narrative
|
||||
|
||||
Using the data widget to import a tiddler stored in a compound tiddler
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$data $compound-tiddler="Compound" custom="Alpha"/>
|
||||
+
|
||||
title: Compound
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Payload Tiddler
|
||||
tags: Alpha Beta Gamma
|
||||
|
||||
This is a payload tiddler from a compound tiddler
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>[
|
||||
{
|
||||
"title": "Payload Tiddler",
|
||||
"tags": "Alpha Beta Gamma",
|
||||
"text": "This is a payload tiddler from a compound tiddler",
|
||||
"custom": "Alpha"
|
||||
}
|
||||
]</p>
|
||||
@@ -0,0 +1,49 @@
|
||||
title: TestCases/DataWidget/ImportedFilter
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Imported filter definition
|
||||
display-format: plaintext
|
||||
|
||||
title: Narrative
|
||||
|
||||
Using the data widget to create copies of all the tiddlers with the title prefix "Day: T", adding the field "custom" set to "Beta"
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$data $filter="[prefix[Day: T]]" custom="Beta"/>
|
||||
+
|
||||
title: Day: Monday
|
||||
text: Today is Monday
|
||||
+
|
||||
title: Day: Tuesday
|
||||
text: Today is Tuesday
|
||||
+
|
||||
title: Day: Wednesday
|
||||
text: Today is Wednesday
|
||||
+
|
||||
title: Day: Thursday
|
||||
text: Today is Thursday
|
||||
+
|
||||
title: Day: Friday
|
||||
text: Today is Friday
|
||||
+
|
||||
title: Day: Saturday
|
||||
text: Today is Saturday
|
||||
+
|
||||
title: Day: Sunday
|
||||
text: Today is Sunday
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>[
|
||||
{
|
||||
"title": "Day: Thursday",
|
||||
"text": "Today is Thursday",
|
||||
"custom": "Beta"
|
||||
},
|
||||
{
|
||||
"title": "Day: Tuesday",
|
||||
"text": "Today is Tuesday",
|
||||
"custom": "Beta"
|
||||
}
|
||||
]</p>
|
||||
@@ -0,0 +1,29 @@
|
||||
title: TestCases/DataWidget/ImportedTiddler
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Imported tiddler definition
|
||||
display-format: plaintext
|
||||
|
||||
title: Narrative
|
||||
|
||||
Using the data widget to create a tiddler that is a copy of the tiddler "Hello" with the addition of the field "custom" set to "Alpha"
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$data $tiddler="Hello" custom="Alpha"/>
|
||||
+
|
||||
title: Hello
|
||||
modifier: JoeBloggs
|
||||
|
||||
This is the Hello tiddler
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>[
|
||||
{
|
||||
"title": "Hello",
|
||||
"modifier": "JoeBloggs",
|
||||
"text": "This is the Hello tiddler",
|
||||
"custom": "Alpha"
|
||||
}
|
||||
]</p>
|
||||
@@ -0,0 +1,30 @@
|
||||
title: TestCases/DataWidget/Refreshing
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Refreshing the data widget
|
||||
display-format: plaintext
|
||||
|
||||
title: Narrative
|
||||
|
||||
Verifying that the JSON output of the data widget is correctly refreshed when the data changes
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$data title="Epsilon" text={{Subject}}/>
|
||||
+
|
||||
title: Subject
|
||||
|
||||
Nothing
|
||||
+
|
||||
title: Actions
|
||||
|
||||
<$action-setfield $tiddler="Subject" text="Theta"/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>[
|
||||
{
|
||||
"title": "Epsilon",
|
||||
"text": "Theta"
|
||||
}
|
||||
]</p>
|
||||
@@ -0,0 +1,22 @@
|
||||
title: TestCases/DataWidget/SimpleTiddler
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Simple tiddler definition
|
||||
display-format: plaintext
|
||||
|
||||
title: Narrative
|
||||
|
||||
Using the data widget to create a tiddler with the title "Epsilon" and the text "Theta"
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$data title="Epsilon" text="Theta"/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>[
|
||||
{
|
||||
"title": "Epsilon",
|
||||
"text": "Theta"
|
||||
}
|
||||
]</p>
|
||||
@@ -0,0 +1,15 @@
|
||||
title: TestCases/TestCaseWidget/FailingTest
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec-failing]]
|
||||
description: An example of a failing test
|
||||
|
||||
title: Narrative
|
||||
|
||||
This test case intentionally fails to show how failures are displayed.
|
||||
+
|
||||
title: Output
|
||||
|
||||
The sum is <$text text={{{ [[2]add[2]] }}}/>.
|
||||
+
|
||||
title: ExpectedResult
|
||||
text: <p>The sum is not 8.</p>
|
||||
@@ -0,0 +1,16 @@
|
||||
description: currentTiddler should be properly set
|
||||
tags: $:/tags/wiki-test-spec
|
||||
title: TestCases/TestCaseTiddler/currentTiddler
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
|
||||
title: Narrative
|
||||
|
||||
currentTiddler variable in Output tiddler should be "Output"
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$text text=<<currentTiddler>>>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Output</p>
|
||||
@@ -0,0 +1,23 @@
|
||||
title: TestCases/TranscludeWidget/SimpleTransclusion
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Simple transclusion
|
||||
|
||||
title: Narrative
|
||||
|
||||
This test case demonstrates transclusion of and links to other tiddlers.
|
||||
+
|
||||
title: Output
|
||||
|
||||
Good morning, my [[name|Name]] is {{Name}} and I [[live in|Address]] {{Address}}
|
||||
+
|
||||
title: Name
|
||||
|
||||
Robert Rabbit
|
||||
+
|
||||
title: Address
|
||||
|
||||
14 Carrot Street, Vegetabletown
|
||||
+
|
||||
title: ExpectedResult
|
||||
text: <p>Good morning, my <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Name">name</a> is Robert Rabbit and I <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Address">live in</a> 14 Carrot Street, Vegetabletown</p>
|
||||
42
editions/tw5.com/tiddlers/widgets/DataWidget.tid
Normal file
42
editions/tw5.com/tiddlers/widgets/DataWidget.tid
Normal file
@@ -0,0 +1,42 @@
|
||||
caption: data
|
||||
created: 20240507221902644
|
||||
modified: 20240507221902644
|
||||
tags: Widgets
|
||||
title: DataWidget
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Introduction
|
||||
|
||||
The data widget is used with the <<.wlink TestCaseWidget>> widget and the [[Innerwiki Plugin]] to specify payload tiddlers that are to be included in the test case or innerwiki.
|
||||
|
||||
! Content and Attributes
|
||||
|
||||
The content of the data widget is ignored. It supports the following attributes:
|
||||
|
||||
|!Attribute |!Description |
|
||||
|<<.attr $tiddler>> |Optional title of a tiddler to be used as a payload tiddler (optional) |
|
||||
|<<.attr $filter>> |Optional filter string identifying tiddlers to be used as payload tiddlers (optional) |
|
||||
|<<.attr $compound-tiddler>> |Optional title of a tiddler containing payload tiddlers in `text/vnd.tiddlywiki-multiple` format (see below) |
|
||||
|//any attribute<br>not starting<br>with $// |Field values to be assigned to the payload tiddler(s) |
|
||||
|
||||
The data widget is not rendered when used within the <<.wlink TestCaseWidget>> widget or the [[Innerwiki Plugin]] but for ease of testing, when used elsewhere it renders a JSON representation of the payload tiddlers.
|
||||
|
||||
Without any of the attributes <<.attr $tiddler>>, <<.attr $filter>> or <<.attr $compound-tiddler>>, any attributes whose name does not start with $ are used as the field values for creating a single new tiddler.
|
||||
|
||||
<<testcase "TestCases/DataWidget/SimpleTiddler">>
|
||||
|
||||
If any of the attributes <<.attr $tiddler>>, <<.attr $filter>> or <<.attr $compound-tiddler>> are specified then they are used to generate base tiddlers that are then modified with the addition of fields derived from any attributes whose name does not start with $.
|
||||
|
||||
The attribute <<.attr $tiddler>> is used to ingest a single tiddler from the wiki containing the data widget:
|
||||
|
||||
<<testcase "TestCases/DataWidget/ImportedTiddler">>
|
||||
|
||||
The attribute <<.attr $filter>> is used to ingest multiple tiddlers from the wiki containing the data widget:
|
||||
|
||||
<<testcase "TestCases/DataWidget/ImportedFilter">>
|
||||
|
||||
! Compound Tiddlers
|
||||
|
||||
[[Compound tiddlers|CompoundTiddlers]] provide a way to easily create multiple tiddlers from within a single tiddler. They are contained in tiddlers of type `text/vnd.tiddlywiki-multiple`. The text field consists of a series of tiddlers in the same format as `.tid` files, each separated by a line containing a single `+` character.
|
||||
|
||||
<<testcase "TestCases/DataWidget/ImportCompound">>
|
||||
101
editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid
Normal file
101
editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid
Normal file
@@ -0,0 +1,101 @@
|
||||
caption: testcase
|
||||
created: 20240507221902644
|
||||
modified: 20240507221902644
|
||||
tags: Widgets
|
||||
title: TestCaseWidget
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Introduction
|
||||
|
||||
The <<.wid testcase>> widget is designed to present interactive example test cases that are useful for learning and testing. It functions by creating an independent subwiki loaded with the specified payload tiddlers and then rendering a specified template from within the subwiki. The <<.wid testcase>> widget can optionally also be used to run and verify test results within the subwiki.
|
||||
|
||||
This makes it possible to run independent tests that also serve as documentation examples.
|
||||
|
||||
The <<.wid testcase>> widget can be used directly as documented below, but it is generally easier to create [[TestCaseTiddlers]]. These are special CompoundTiddlers that can contain multiple payload tiddlers making up a test case.
|
||||
|
||||
!! Features
|
||||
|
||||
Here is an example of a test case showing the default split view with the source tiddlers on the left and the tiddler titled `Output` rendered on the right.
|
||||
|
||||
<<testcase "TestCases/TranscludeWidget/SimpleTransclusion">>
|
||||
|
||||
Notice also that clicking on links within the output pane will switch to the tab containing that tiddler.
|
||||
|
||||
The text of the payload tiddlers listed on the left are editable, with the results being immediately reflected in the preview pane on the right. However, if the <<.wid testcase>> widget is refreshed then the modifications are lost.
|
||||
|
||||
The green tick at the top left of a test case indicates that a test has been set up and that it passes.
|
||||
|
||||
If the test fails, a red cross is shown, and there is a display of the differences between the actual results and the expected results:
|
||||
|
||||
<<testcase "TestCases/TestCaseWidget/FailingTest">>
|
||||
|
||||
! Limitations
|
||||
|
||||
The <<.wid testcase>> widget creates a lightweight TiddlyWiki environment that is a parasite of the main wiki. Because it is not a full, independent TiddlyWiki environment, there are some important limitations:
|
||||
|
||||
* Output is rendered into a DIV, and so cannot be styled independently of the host wiki
|
||||
* Any changes to the wiki made interactively by the user are volatile, and are lost when the <<.wid testcase>> widget is refreshed
|
||||
* Startup actions are not supported
|
||||
* Only plugins available in the host wiki can be included in the test case
|
||||
|
||||
If these limitations are a problem, the [[Innerwiki Plugin]] offers the ability to embed a fully independent subwiki via an `<iframe>` element, but without the testing related features of the <<.wid testcase>> widget.
|
||||
|
||||
! Content and Attributes
|
||||
|
||||
The content of the `<$testcase>` widget is not displayed but instead is scanned for <<.wlink DataWidget>> widgets that define the payload tiddlers to be included in the test case.
|
||||
|
||||
|!Attribute |!Description |
|
||||
|<<.attr template>> |Optional title of the template used to display the test case (defaults to $:/core/ui/testcases/DefaultTemplate). Note that custom templates will need to be explicitly added to the payload |
|
||||
|<<.attr testOutput>> |Optional title of the tiddler whose output should be subject to testing (note that both <<.attr testOutput>> and <<.attr testExpectedResult>> must be provided in order for testing to occur) |
|
||||
|<<.attr testExpectedResult>> |Optional title of the tiddler whose content is the expected result of rendering the output tiddler (note that both <<.attr testOutput>> and <<.attr testExpectedResult>> must be provided in order for testing to occur) |
|
||||
|<<.attr testActions>> |Optional title of the tiddler containing actions that should be executed before the test occurs |
|
||||
|<<.attr testHideIfPass>> |If set to "yes", hides the <<.wid testcase>> widget if the test passes |
|
||||
|
||||
! Payload Tiddlers
|
||||
|
||||
The payload tiddlers are the tiddler values that are loaded into the subwiki that is created to run the tests. They are created via <<.wlink DataWidget>> widgets within the body of the `<$testcase>` widget. The `$:/core` plugin is automatically included in the payload.
|
||||
|
||||
! Testcase Templates
|
||||
|
||||
The <<.attr template>> attribute defaults to $:/core/ui/testcases/DefaultTemplate
|
||||
|
||||
The default test case template assigns special meanings to a number of payload tiddlers:
|
||||
|
||||
|!Tiddler |!Description |
|
||||
|''Description'' |Descriptive heading for the test, intended to make it easy to identify the test |
|
||||
|''Narrative'' |Narrative description of the test, intended to explain the purpose and operation of the test |
|
||||
|''Output'' |The tiddler that produces the test output |
|
||||
|''~ExpectedResult'' |HTML of expected result of rendering the ''Output'' tiddler |
|
||||
|
||||
The test case wiki will inherit variables that are visible to the <<.wid testcase>> widget itself. The default template uses several variables that can be set by the user:
|
||||
|
||||
|!Variable |!Description |
|
||||
|<<.var linkTarget>> |Causes the test case description to be rendered as a link to the current tiddler |
|
||||
|<<.var displayFormat>> |Defaults to "wikitext", can also be "plaintext" to force plain text display |
|
||||
|
||||
A custom template can be specified for special purposes. For example, the provided template $:/core/ui/testcases/RawJSONTemplate just displays the payload tiddlers in JSON, which can be used for debugging purposes.
|
||||
|
||||
! Test Czase Template Variables
|
||||
|
||||
The <<.wid testcase>> widget makes the following variables available within the rendered template:
|
||||
|
||||
|!Variable |!Description |
|
||||
|<<.var transclusion>> |A hash that reflects the names and values of all the payload tiddlers. This makes it easier for test case templates to create unique state tiddler titles using the [[qualify Macro]] or QualifyWidget |
|
||||
|<<.var payloadTiddlers>> |JSON array of payload tiddler fields |
|
||||
|<<.var outputHTML>> |The actual output HTML if running tests |
|
||||
|<<.var expectedHTML>> |The expected output HTML if running tests |
|
||||
|<<.var testResult>> |The tests result if running tests (may be "pass" or "fail") |
|
||||
|
||||
! Example
|
||||
|
||||
Here is an example of setting up a test case that includes expected test results:
|
||||
|
||||
<$testcase>
|
||||
<$data title="Description" text="Example of a test case with expected results"/>
|
||||
<$data title="Output" text="""<$testcase testOutput="Output" testExpectedResult="ExpectedResult">
|
||||
<$data title="Description" text="How to calculate 2 plus 2"/>
|
||||
<$data title="Output" text="<$text text={{{ [[2]add[2]] }}}/>"/>
|
||||
<$data title="ExpectedResult" text="<p>8</p>"/>
|
||||
</$testcase>
|
||||
"""/>
|
||||
</$testcase>
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "Async",
|
||||
"description": "async.js library",
|
||||
"author": "Caolan McMahon",
|
||||
"list": "readme license"
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "AWS",
|
||||
"description": "Amazon Web Services extensions and tools",
|
||||
"list": "readme setup commands lambda",
|
||||
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"]
|
||||
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"],
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "BibTeX",
|
||||
"description": "BibTeX importer",
|
||||
"author": "Henrik Muehe and Mikola Lysenko",
|
||||
"list": "readme license"
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/blog",
|
||||
"name": "Blog",
|
||||
"description": "Blog publishing tools",
|
||||
"list": "readme docs"
|
||||
"list": "readme docs",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/browser-sniff",
|
||||
"name": "Browser Sniff",
|
||||
"description": "Browser feature detection",
|
||||
"list": "readme usage"
|
||||
"list": "readme usage",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/browser-storage",
|
||||
"name": "Browser Storage",
|
||||
"description": "Local storage in the browser",
|
||||
"list": "readme settings"
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/cecily",
|
||||
"name": "Cecily",
|
||||
"description": "Zoomable storyview (Cecily)",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/classictools",
|
||||
"name": "Classic Tools",
|
||||
"description": "TiddlyWiki Classic tools",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "Autocompletion for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-css"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Close Brackets",
|
||||
"description": "Close brackets for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Close Tag",
|
||||
"description": "Close tags automatically for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Fullscreen",
|
||||
"description": "Fullscreen editing for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Keymap Emacs",
|
||||
"description": "Keymap compatible with Emacs for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "Keymap compatible with Sublime Text for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-search-replace","$:/plugins/tiddlywiki/codemirror-closebrackets"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "Keymap compatible with Vim for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-search-replace","$:/plugins/tiddlywiki/codemirror-closebrackets"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Mode CSS",
|
||||
"description": "CSS highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "Embedded HTML highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-htmlmixed","$:/plugins/tiddlywiki/codemirror-mode-javascript","$:/plugins/tiddlywiki/codemirror-mode-css","$:/plugins/tiddlywiki/codemirror-mode-xml"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "HTML mixed highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-xml","$:/plugins/tiddlywiki/codemirror-mode-javascript","$:/plugins/tiddlywiki/codemirror-mode-css"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Mode JavaScript",
|
||||
"description": "JavaScript highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
"description": "Markdown highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-xml"],
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Mode TiddlyWiki Classic",
|
||||
"description": "Tiddlywiki Classic highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Mode XML",
|
||||
"description": "XML highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Search and Replace",
|
||||
"description": "Search and replace for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "CodeMirror Show Trailing Space",
|
||||
"description": "Show trailing space in CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/codemirror",
|
||||
"name": "CodeMirror",
|
||||
"description": "CodeMirror editor",
|
||||
"list": "readme usage keyboard license"
|
||||
"list": "readme usage keyboard license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/comments",
|
||||
"name": "Comments",
|
||||
"description": "Threaded tiddler comments",
|
||||
"list": "readme config"
|
||||
"list": "readme config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/confetti",
|
||||
"name": "Confetti",
|
||||
"description": "Animated confetti effect",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/consent-banner",
|
||||
"name": "Consent Banner",
|
||||
"description": "Consent banner for GDPR etc",
|
||||
"list": "readme docs youtube config"
|
||||
"list": "readme docs youtube config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/d3",
|
||||
"name": "D3",
|
||||
"description": "D3 data visualisation demo",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
"author": "JeremyRuston",
|
||||
"core-version": ">=5.0.0",
|
||||
"list": "readme examples",
|
||||
"dependents": ["$:/plugins/tiddlywiki/dynaview"]
|
||||
"dependents": ["$:/plugins/tiddlywiki/dynaview"],
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/dynaview",
|
||||
"name": "Dynaview",
|
||||
"description": "Dynamic scrolling and zooming effects",
|
||||
"list": "readme docs examples config"
|
||||
"list": "readme docs examples config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/evernote",
|
||||
"name": "Evernote",
|
||||
"description": "Evernote migration tools",
|
||||
"list": "readme docs"
|
||||
"list": "readme docs",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/external-attachments",
|
||||
"name": "External Attachments",
|
||||
"description": "External attachments for TiddlyDesktop",
|
||||
"list": "readme settings"
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/filesystem",
|
||||
"name": "Filesystem",
|
||||
"description": "Synchronize changes from the node.js server to the local filesystem",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/freelinks",
|
||||
"name": "Freelinks",
|
||||
"description": "Freelinking of tiddler titles",
|
||||
"list": "readme settings"
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "GitHub Fork Ribbon",
|
||||
"description": "GitHub-inspired corner ribbon",
|
||||
"author": "Simon Whitaker",
|
||||
"list": "readme usage"
|
||||
"list": "readme usage",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "Google Analytics",
|
||||
"description": "Website visitor statistics from Google",
|
||||
"contributor": "Sylvain Comte",
|
||||
"list": "readme settings usage"
|
||||
"list": "readme settings usage",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "HammerJS",
|
||||
"description": "HammerJS touch gesture library",
|
||||
"author": "Jorik Tangelder (Eight Media)",
|
||||
"list": "readme license"
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/help",
|
||||
"name": "Help",
|
||||
"description": "Floating help panel",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "Highlight (Legacy)",
|
||||
"description": "Highlight.js syntax highlighting for legacy browsers",
|
||||
"author": "Joao Bolila",
|
||||
"list": "readme usage license"
|
||||
"list": "readme usage license",
|
||||
"stability": "STABILITY_3_LEGACY"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "Highlight",
|
||||
"description": "Highlight.js syntax highlighting",
|
||||
"author": "Joao Bolila",
|
||||
"list": "readme usage license"
|
||||
"list": "readme usage license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
17
plugins/tiddlywiki/innerwiki/anchor.js
Normal file
17
plugins/tiddlywiki/innerwiki/anchor.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/*\
|
||||
title: $:/plugins/tiddlywiki/innerwiki/anchor.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Anchor widget to represent an innerwiki graphical anchor. Clone of the data widget
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.anchor = require("$:/core/modules/widgets/data.js").data;
|
||||
|
||||
})();
|
||||
@@ -1,58 +0,0 @@
|
||||
/*\
|
||||
title: $:/plugins/tiddlywiki/innerwiki/data.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Widget to represent a single item of data
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
|
||||
var DataWidget = function(parseTreeNode,options) {
|
||||
this.dataWidgetTag = parseTreeNode.type;
|
||||
this.initialise(parseTreeNode,options);
|
||||
};
|
||||
|
||||
/*
|
||||
Inherit from the base widget class
|
||||
*/
|
||||
DataWidget.prototype = new Widget();
|
||||
|
||||
/*
|
||||
Render this widget into the DOM
|
||||
*/
|
||||
DataWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
this.renderChildren(parent,nextSibling);
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
DataWidget.prototype.execute = function() {
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
DataWidget.prototype.refresh = function(changedTiddlers) {
|
||||
// Refresh our attributes
|
||||
var changedAttributes = this.computeAttributes();
|
||||
// Refresh our children
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
};
|
||||
|
||||
exports.data = DataWidget;
|
||||
exports.anchor = DataWidget;
|
||||
|
||||
})();
|
||||
@@ -15,7 +15,7 @@ Widget to display an innerwiki in an iframe
|
||||
var DEFAULT_INNERWIKI_TEMPLATE = "$:/plugins/tiddlywiki/innerwiki/template";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget,
|
||||
DataWidget = require("$:/plugins/tiddlywiki/innerwiki/data.js").data,
|
||||
DataWidget = require("$:/core/modules/widgets/data.js").data,
|
||||
dm = $tw.utils.domMaker;
|
||||
|
||||
var InnerWikiWidget = function(parseTreeNode,options) {
|
||||
@@ -143,7 +143,7 @@ Create the anchors
|
||||
*/
|
||||
InnerWikiWidget.prototype.createAnchors = function() {
|
||||
var self = this;
|
||||
this.findDataWidgets(this.children,"anchor",function(widget) {
|
||||
this.findChildrenDataWidgets(this.children,"anchor",function(widget) {
|
||||
var anchorWidth = 40,
|
||||
anchorHeight = 40,
|
||||
getAnchorCoordinate = function(name) {
|
||||
@@ -233,76 +233,16 @@ InnerWikiWidget.prototype.createInnerHTML = function() {
|
||||
IMPLANT_PREFIX = "<" + "script>\n$tw.preloadTiddlerArray(",
|
||||
IMPLANT_SUFFIX = ");\n</" + "script>\n",
|
||||
parts = html.split(SPLIT_MARKER),
|
||||
tiddlers = this.readTiddlerDataWidgets(this.children);
|
||||
tiddlers = [];
|
||||
this.findChildrenDataWidgets(this.children,"data",function(widget) {
|
||||
Array.prototype.push.apply(tiddlers,widget.readDataTiddlerValues());
|
||||
});
|
||||
if(parts.length === 2) {
|
||||
html = parts[0] + IMPLANT_PREFIX + JSON.stringify(tiddlers) + IMPLANT_SUFFIX + SPLIT_MARKER + parts[1];
|
||||
}
|
||||
return html;
|
||||
};
|
||||
|
||||
/*
|
||||
Find child data widgets
|
||||
*/
|
||||
InnerWikiWidget.prototype.findDataWidgets = function(children,tag,callback) {
|
||||
var self = this;
|
||||
$tw.utils.each(children,function(child) {
|
||||
if(child.dataWidgetTag === tag) {
|
||||
callback(child);
|
||||
}
|
||||
if(child.children) {
|
||||
self.findDataWidgets(child.children,tag,callback);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Find the child data widgets
|
||||
*/
|
||||
InnerWikiWidget.prototype.readTiddlerDataWidgets = function(children) {
|
||||
var self = this,
|
||||
results = [];
|
||||
this.findDataWidgets(children,"data",function(widget) {
|
||||
Array.prototype.push.apply(results,self.readTiddlerDataWidget(widget));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Read the value(s) from a data widget
|
||||
*/
|
||||
InnerWikiWidget.prototype.readTiddlerDataWidget = function(dataWidget) {
|
||||
// Start with a blank object
|
||||
var item = Object.create(null);
|
||||
// Read any attributes not prefixed with $
|
||||
$tw.utils.each(dataWidget.attributes,function(value,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
item[name] = value;
|
||||
}
|
||||
});
|
||||
// Deal with $tiddler or $filter attributes
|
||||
var titles;
|
||||
if(dataWidget.hasAttribute("$tiddler")) {
|
||||
titles = [dataWidget.getAttribute("$tiddler")];
|
||||
} else if(dataWidget.hasAttribute("$filter")) {
|
||||
titles = this.wiki.filterTiddlers(dataWidget.getAttribute("$filter"));
|
||||
}
|
||||
if(titles) {
|
||||
var self = this;
|
||||
var results = [];
|
||||
$tw.utils.each(titles,function(title,index) {
|
||||
var tiddler = self.wiki.getTiddler(title),
|
||||
fields;
|
||||
if(tiddler) {
|
||||
fields = tiddler.getFieldStrings();
|
||||
}
|
||||
results.push($tw.utils.extend({},fields,item));
|
||||
})
|
||||
return results;
|
||||
} else {
|
||||
return [item];
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/innerwiki",
|
||||
"name": "Innerwiki",
|
||||
"description": "Innerwikis for screenshots and hacking",
|
||||
"list": "readme docs examples"
|
||||
"list": "readme docs examples",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/internals",
|
||||
"name": "Internals",
|
||||
"description": "Tools for exploring the internals of TiddlyWiki",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/jasmine",
|
||||
"name": "Jasmine",
|
||||
"description": "Jasmine testing framework",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ Tests the wiki based tests
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var TEST_WIKI_TIDDLER_FILTER = "[type[text/vnd.tiddlywiki-multiple]tag[$:/tags/wiki-test-spec]]";
|
||||
var TEST_WIKI_TIDDLER_FILTER = "[all[tiddlers+shadows]type[text/vnd.tiddlywiki-multiple]tag[$:/tags/wiki-test-spec]]";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
|
||||
@@ -24,7 +24,11 @@ describe("Wiki-based tests", function() {
|
||||
var tiddler = $tw.wiki.getTiddler(title);
|
||||
it(tiddler.fields.title + ": " + tiddler.fields.description, function() {
|
||||
// Add our tiddlers
|
||||
var wiki = new $tw.Wiki();
|
||||
var wiki = new $tw.Wiki(),
|
||||
coreTiddler = $tw.wiki.getTiddler("$:/core");
|
||||
if(coreTiddler) {
|
||||
wiki.addTiddler(coreTiddler);
|
||||
}
|
||||
wiki.addTiddlers(readMultipleTiddlersTiddler(title));
|
||||
// Complain if we don't have the ouput and expected results
|
||||
if(!wiki.tiddlerExists("Output")) {
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "JSZip",
|
||||
"description": "JSZip library",
|
||||
"author": "Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso",
|
||||
"list": "readme docs examples license"
|
||||
"list": "readme docs examples license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "KaTeX",
|
||||
"description": "KaTeX library for mathematical typography",
|
||||
"list": "readme usage config",
|
||||
"library-version": "v0.15.3"
|
||||
"library-version": "v0.15.3",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/markdown-legacy",
|
||||
"name": "Markdown (Legacy)",
|
||||
"description": "Markdown parser based on remarkable by Jon Schlinkert and remarkable-katex by Brad Howes",
|
||||
"list": "readme usage remarkable-license remarkable-katex-license"
|
||||
"list": "readme usage remarkable-license remarkable-katex-license",
|
||||
"stability": "STABILITY_3_LEGACY"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/markdown",
|
||||
"name": "Markdown",
|
||||
"description": "Markdown parser based on markdown-it",
|
||||
"list": "readme config syntax license"
|
||||
"list": "readme config syntax license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/menubar",
|
||||
"name": "Menu Bar",
|
||||
"description": "Menu Bar",
|
||||
"list": "readme config"
|
||||
"list": "readme config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"name": "Mobile Drag Drop",
|
||||
"description": "Mobile drag and drop shim",
|
||||
"author": "Tim Ruffles",
|
||||
"list": "readme license"
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/nodewebkitsaver",
|
||||
"name": "nw.js Saver",
|
||||
"description": "Saver for nw.js",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"title": "$:/plugins/tiddlywiki/pluginlibrary",
|
||||
"name": "Plugin Library",
|
||||
"description": "Plugin library builder",
|
||||
"list": "readme"
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user