mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-14 22:19:50 +00:00
Compare commits
43 Commits
custom-cop
...
testcase-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
769969f69f | ||
|
|
7ca70c94d4 | ||
|
|
eb4e9d86ac | ||
|
|
4234aa968e | ||
|
|
5a7f958c64 | ||
|
|
3751a883f5 | ||
|
|
5c34d273bd | ||
|
|
4f19f0a66b | ||
|
|
70f68c7cc2 | ||
|
|
400514f52f | ||
|
|
6b7cf37f36 | ||
|
|
edc6661948 | ||
|
|
8207b80f9f | ||
|
|
53908b792e | ||
|
|
a856d0b322 | ||
|
|
648855e8a5 | ||
|
|
83ebfc67fb | ||
|
|
d5b7bc7d41 | ||
|
|
00ac5503d9 | ||
|
|
43fe5e9523 | ||
|
|
0db4c44939 | ||
|
|
ff03a1bfc4 | ||
|
|
1d89c7925a | ||
|
|
e378c6c4c9 | ||
|
|
e8a3ffdffc | ||
|
|
6b4bd4728a | ||
|
|
08913314c5 | ||
|
|
39d463337b | ||
|
|
d361a1e3cf | ||
|
|
4758b6afb9 | ||
|
|
fa9e643e54 | ||
|
|
1be73ad664 | ||
|
|
57e74a0ad5 | ||
|
|
22ad43954e | ||
|
|
17e939fa2c | ||
|
|
f0d6779dd3 | ||
|
|
44010812bd | ||
|
|
2c07310cd3 | ||
|
|
a32d5143ae | ||
|
|
5eae32d762 | ||
|
|
81f1994bbf | ||
|
|
86507baa60 | ||
|
|
497c56d3fa |
@@ -1,3 +1,6 @@
|
||||
title: $:/boot/boot.css
|
||||
type: text/css
|
||||
|
||||
/*
|
||||
Basic styles used before we boot up the parsing engine
|
||||
*/
|
||||
47
boot/boot.js
47
boot/boot.js
@@ -142,15 +142,15 @@ $tw.utils.each = function(object,callback) {
|
||||
var next,f,length;
|
||||
if(object) {
|
||||
if(Object.prototype.toString.call(object) == "[object Array]") {
|
||||
for(f=0, length=object.length; f<length; f++) {
|
||||
for (f=0, length=object.length; f<length; f++) {
|
||||
next = callback(object[f],f,object);
|
||||
if(next === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var keys = Object.keys(object);
|
||||
for(f=0, length=keys.length; f<length; f++) {
|
||||
for (f=0, length=keys.length; f<length; f++) {
|
||||
var key = keys[f];
|
||||
next = callback(object[key],key,object);
|
||||
if(next === false) {
|
||||
@@ -275,7 +275,7 @@ Extend an object with the properties from a list of source objects
|
||||
$tw.utils.extend = function(object /*, sourceObjectList */) {
|
||||
$tw.utils.each(Array.prototype.slice.call(arguments,1),function(source) {
|
||||
if(source) {
|
||||
for(var p in source) {
|
||||
for (var p in source) {
|
||||
object[p] = source[p];
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ Fill in any null or undefined properties of an object with the properties from a
|
||||
$tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
|
||||
$tw.utils.each(Array.prototype.slice.call(arguments,1),function(source) {
|
||||
if(source) {
|
||||
for(var p in source) {
|
||||
for (var p in source) {
|
||||
if(object[p] === null || object[p] === undefined) {
|
||||
object[p] = source[p];
|
||||
}
|
||||
@@ -893,8 +893,8 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
||||
} else {
|
||||
/*
|
||||
CommonJS optional require.main property:
|
||||
In a browser we offer a fake main module which points back to the boot function
|
||||
(Theoretically, this may allow TW to eventually load itself as a module in the browser)
|
||||
In a browser we offer a fake main module which points back to the boot function
|
||||
(Theoretically, this may allow TW to eventually load itself as a module in the browser)
|
||||
*/
|
||||
Object.defineProperty(sandbox.require, "main", {
|
||||
value: (typeof(require) !== "undefined") ? require.main : {TiddlyWiki: _boot},
|
||||
@@ -936,9 +936,9 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
||||
moduleInfo.exports = moduleInfo.definition;
|
||||
}
|
||||
} catch(e) {
|
||||
if(e instanceof SyntaxError) {
|
||||
if (e instanceof SyntaxError) {
|
||||
var line = e.lineNumber || e.line; // Firefox || Safari
|
||||
if(typeof(line) != "undefined" && line !== null) {
|
||||
if (typeof(line) != "undefined" && line !== null) {
|
||||
$tw.utils.error("Syntax error in boot module " + name + ":" + line + ":\n" + e.stack);
|
||||
} else if(!$tw.browser) {
|
||||
// this is the only way to get node.js to display the line at which the syntax error appeared,
|
||||
@@ -1533,7 +1533,7 @@ Define all modules stored in ordinary tiddlers
|
||||
$tw.Wiki.prototype.defineTiddlerModules = function() {
|
||||
this.each(function(tiddler,title) {
|
||||
if(tiddler.hasField("module-type")) {
|
||||
switch(tiddler.fields.type) {
|
||||
switch (tiddler.fields.type) {
|
||||
case "application/javascript":
|
||||
// We only define modules that haven't already been defined, because in the browser modules in system tiddlers are defined in inline script
|
||||
if(!$tw.utils.hop($tw.modules.titles,tiddler.fields.title)) {
|
||||
@@ -2043,7 +2043,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
arrayOfFiles = arrayOfFiles || [];
|
||||
var files = fs.readdirSync(dirPath);
|
||||
files.forEach(function(file) {
|
||||
if(recurse && fs.statSync(dirPath + path.sep + file).isDirectory()) {
|
||||
if (recurse && fs.statSync(dirPath + path.sep + file).isDirectory()) {
|
||||
arrayOfFiles = getAllFiles(dirPath + path.sep + file, recurse, arrayOfFiles);
|
||||
} else if(fs.statSync(dirPath + path.sep + file).isFile()){
|
||||
arrayOfFiles.push(path.join(dirPath, path.sep, file));
|
||||
@@ -2188,16 +2188,13 @@ Returns an array of search paths
|
||||
*/
|
||||
$tw.getLibraryItemSearchPaths = function(libraryPath,envVar) {
|
||||
var pluginPaths = [path.resolve($tw.boot.corePath,libraryPath)],
|
||||
env;
|
||||
if(envVar) {
|
||||
env = process.env[envVar];
|
||||
if(env) {
|
||||
env.split(path.delimiter).map(function(item) {
|
||||
if(item) {
|
||||
pluginPaths.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(env) {
|
||||
env.split(path.delimiter).map(function(item) {
|
||||
if(item) {
|
||||
pluginPaths.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
return pluginPaths;
|
||||
};
|
||||
@@ -2283,7 +2280,7 @@ $tw.loadWikiTiddlers = function(wikiPath,options) {
|
||||
}
|
||||
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
||||
});
|
||||
if($tw.boot.wikiPath == wikiPath) {
|
||||
if ($tw.boot.wikiPath == wikiPath) {
|
||||
// Save the original tiddler file locations if requested
|
||||
var output = {}, relativePath, fileInfo;
|
||||
for(var title in $tw.boot.files) {
|
||||
@@ -2637,14 +2634,14 @@ $tw.boot.doesTaskMatchPlatform = function(taskModule) {
|
||||
var platforms = taskModule.platforms;
|
||||
if(platforms) {
|
||||
for(var t=0; t<platforms.length; t++) {
|
||||
switch(platforms[t]) {
|
||||
switch (platforms[t]) {
|
||||
case "browser":
|
||||
if($tw.browser) {
|
||||
if ($tw.browser) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case "node":
|
||||
if($tw.node) {
|
||||
if ($tw.node) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -2727,7 +2724,7 @@ Invoke the hook by key
|
||||
$tw.hooks.invokeHook = function(hookName /*, value,... */) {
|
||||
var args = Array.prototype.slice.call(arguments,1);
|
||||
if($tw.utils.hop($tw.hooks.names,hookName)) {
|
||||
for(var i = 0; i < $tw.hooks.names[hookName].length; i++) {
|
||||
for (var i = 0; i < $tw.hooks.names[hookName].length; i++) {
|
||||
args[0] = $tw.hooks.names[hookName][i].apply(null,args);
|
||||
}
|
||||
}
|
||||
|
||||
3
boot/sjcl.js.meta
Normal file
3
boot/sjcl.js.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/library/sjcl.js
|
||||
type: application/javascript
|
||||
library: yes
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"tiddlers": [
|
||||
{
|
||||
"file": "sjcl.js",
|
||||
"fields": {
|
||||
"title": "$:/library/sjcl.js",
|
||||
"type": "application/javascript",
|
||||
"library": "yes"
|
||||
},
|
||||
"prefix": "(function(define) {\n",
|
||||
"suffix": "\n})(function (_,defined){window.sjcl = defined()})\n"
|
||||
},
|
||||
{
|
||||
"file": "boot.js",
|
||||
"fields": {
|
||||
"title": "$:/boot/boot.js",
|
||||
"type": "application/javascript"
|
||||
}
|
||||
},
|
||||
{
|
||||
"file": "bootprefix.js",
|
||||
"fields": {
|
||||
"title": "$:/boot/bootprefix.js",
|
||||
"type": "application/javascript"
|
||||
}
|
||||
},
|
||||
{
|
||||
"file": "boot.css",
|
||||
"fields": {
|
||||
"title": "$:/boot/boot.css",
|
||||
"type": "text/css"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -30,7 +30,6 @@ 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,8 +27,33 @@ 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 = $tw.utils.getAllPlugins();
|
||||
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);
|
||||
// Save the upgrade library tiddler
|
||||
var pluginFields = {
|
||||
title: upgradeLibraryTitle,
|
||||
|
||||
@@ -70,9 +70,6 @@ BackSubIndexer.prototype.rebuild = function() {
|
||||
* Get things that is being referenced in the text, e.g. tiddler names in the link syntax.
|
||||
*/
|
||||
BackSubIndexer.prototype._getTarget = function(tiddler) {
|
||||
if(this.wiki.isBinaryTiddler(tiddler.fields.text)) {
|
||||
return [];
|
||||
}
|
||||
var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
|
||||
if(parser) {
|
||||
return this.wiki[this.extractor](parser.tree);
|
||||
|
||||
@@ -68,10 +68,7 @@ exports.startup = function() {
|
||||
});
|
||||
// Install the copy-to-clipboard mechanism
|
||||
$tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) {
|
||||
$tw.utils.copyToClipboard(event.param,{
|
||||
successNotification: event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject.failureNotification
|
||||
});
|
||||
$tw.utils.copyToClipboard(event.param);
|
||||
});
|
||||
// Install the tm-focus-selector message
|
||||
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
|
||||
|
||||
@@ -93,9 +93,7 @@ exports.startup = function() {
|
||||
updateAddressBar: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_UPDATE_ADDRESS_BAR,"yes").trim() === "yes" ? "permalink" : "none",
|
||||
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
|
||||
targetTiddler: event.param || event.tiddlerTitle,
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permalink" : "none",
|
||||
successNotification: event.paramObject && event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject && event.paramObject.failureNotification
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permalink" : "none"
|
||||
});
|
||||
});
|
||||
// Listen for the tm-permaview message
|
||||
@@ -104,9 +102,7 @@ exports.startup = function() {
|
||||
updateAddressBar: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_UPDATE_ADDRESS_BAR,"yes").trim() === "yes" ? "permaview" : "none",
|
||||
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
|
||||
targetTiddler: event.param || event.tiddlerTitle,
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permaview" : "none",
|
||||
successNotification: event.paramObject && event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject && event.paramObject.failureNotification
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permaview" : "none"
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -181,8 +177,6 @@ options.updateAddressBar: "permalink", "permaview" or "no" (defaults to "permavi
|
||||
options.updateHistory: "yes" or "no" (defaults to "no")
|
||||
options.copyToClipboard: "permalink", "permaview" or "no" (defaults to "no")
|
||||
options.targetTiddler: optional title of target tiddler for permalink
|
||||
options.successNotification: optional title of tiddler to use as the notification in case of success
|
||||
options.failureNotification: optional title of tiddler to use as the notification in case of failure
|
||||
*/
|
||||
function updateLocationHash(options) {
|
||||
// Get the story and the history stack
|
||||
@@ -211,18 +205,14 @@ function updateLocationHash(options) {
|
||||
break;
|
||||
}
|
||||
// Copy URL to the clipboard
|
||||
var url = "";
|
||||
switch(options.copyToClipboard) {
|
||||
case "permalink":
|
||||
url = $tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler);
|
||||
$tw.utils.copyToClipboard($tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler));
|
||||
break;
|
||||
case "permaview":
|
||||
url = $tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList));
|
||||
$tw.utils.copyToClipboard($tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList)));
|
||||
break;
|
||||
}
|
||||
if(url) {
|
||||
$tw.utils.copyToClipboard(url,{successNotification: options.successNotification, failureNotification: options.failureNotification});
|
||||
}
|
||||
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events
|
||||
if($tw.utils.getLocationHash() !== $tw.locationHash) {
|
||||
if(options.updateHistory === "yes") {
|
||||
|
||||
@@ -292,9 +292,7 @@ exports.copyToClipboard = function(text,options) {
|
||||
} catch (err) {
|
||||
}
|
||||
if(!options.doNotNotify) {
|
||||
var successNotification = options.successNotification || "$:/language/Notifications/CopiedToClipboard/Succeeded",
|
||||
failureNotification = options.failureNotification || "$:/language/Notifications/CopiedToClipboard/Failed"
|
||||
$tw.notifier.display(succeeded ? successNotification : failureNotification);
|
||||
$tw.notifier.display(succeeded ? "$:/language/Notifications/CopiedToClipboard/Succeeded" : "$:/language/Notifications/CopiedToClipboard/Failed");
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
};
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/utils/errors.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
Custom errors for TiddlyWiki.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
function TranscludeRecursionError() {
|
||||
Error.apply(this,arguments);
|
||||
this.signatures = Object.create(null);
|
||||
};
|
||||
|
||||
/* Maximum permitted depth of the widget tree for recursion detection */
|
||||
TranscludeRecursionError.MAX_WIDGET_TREE_DEPTH = 1000;
|
||||
|
||||
TranscludeRecursionError.prototype = Object.create(Error);
|
||||
|
||||
exports.TranscludeRecursionError = TranscludeRecursionError;
|
||||
|
||||
})();
|
||||
@@ -42,7 +42,7 @@ var TW_TextNode = function(text) {
|
||||
this.textContent = text + "";
|
||||
};
|
||||
|
||||
Object.setPrototypeOf(TW_TextNode.prototype,TW_Node.prototype);
|
||||
Object.setPrototypeOf(TW_TextNode,TW_Node.prototype);
|
||||
|
||||
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
|
||||
get: function() {
|
||||
@@ -67,7 +67,7 @@ var TW_Element = function(tag,namespace) {
|
||||
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
|
||||
};
|
||||
|
||||
Object.setPrototypeOf(TW_Element.prototype,TW_Node.prototype);
|
||||
Object.setPrototypeOf(TW_Element,TW_Node.prototype);
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "style", {
|
||||
get: function() {
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*\
|
||||
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
|
||||
Options:
|
||||
|
||||
ignoreEnvironmentVariables: defaults to false
|
||||
*/
|
||||
exports.getAllPlugins = function(options) {
|
||||
options = options || {};
|
||||
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,options.ignoreEnvironmentVariables ? undefined : $tw.config.pluginsEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.themesEnvVar),collectPublisherPlugins);
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.languagesEnvVar),collectPlugins);
|
||||
return tiddlers;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -825,7 +825,7 @@ options.length .. number of characters returned defaults to 64
|
||||
*/
|
||||
exports.sha256 = function(str, options) {
|
||||
options = options || {}
|
||||
return $tw.sjcl.codec.hex.fromBits($tw.sjcl.hash.sha256.hash(str)).substr(0,options.length || 64);
|
||||
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(str)).substr(0,options.length || 64);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -77,13 +77,8 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.setVariable("transclusion",$tw.utils.hashString(jsonPayload));
|
||||
// Generate a `payloadTiddlers` variable that contains the payload in JSON format
|
||||
this.setVariable("payloadTiddlers",jsonPayload);
|
||||
// Only run the tests if the testcase output and expected results were specified, and those tiddlers actually exist in the wiki
|
||||
var shouldRunTests = false;
|
||||
if(this.testcaseTestOutput && this.testcaseWiki.tiddlerExists(this.testcaseTestOutput) && this.testcaseTestExpectedResult && this.testcaseWiki.tiddlerExists(this.testcaseTestExpectedResult)) {
|
||||
shouldRunTests = true;
|
||||
}
|
||||
// Render the test rendering if required
|
||||
if(shouldRunTests) {
|
||||
if(this.testcaseTestOutput && this.testcaseTestExpectedResult) {
|
||||
var testcaseOutputContainer = $tw.fakeDocument.createElement("div");
|
||||
var testcaseOutputWidget = this.testcaseWiki.makeTranscludeWidget(this.testcaseTestOutput,{
|
||||
document: $tw.fakeDocument,
|
||||
@@ -106,7 +101,7 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
var testResult = "",
|
||||
outputHTML = "",
|
||||
expectedHTML = "";
|
||||
if(shouldRunTests) {
|
||||
if(this.testcaseTestOutput && this.testcaseTestExpectedResult) {
|
||||
outputHTML = testcaseOutputContainer.children[0].innerHTML;
|
||||
expectedHTML = this.testcaseWiki.getTiddlerText(this.testcaseTestExpectedResult);
|
||||
if(outputHTML === expectedHTML) {
|
||||
@@ -120,7 +115,7 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.setVariable("currentTiddler",this.testcaseTestOutput);
|
||||
}
|
||||
// Don't display anything if testHideIfPass is "yes" and the tests have passed
|
||||
if(this.testcaseHideIfPass === "yes" && testResult !== "fail") {
|
||||
if(this.testcaseHideIfPass === "yes" && testResult === "pass") {
|
||||
return;
|
||||
}
|
||||
// Render the page root template of the subwiki
|
||||
|
||||
@@ -30,30 +30,7 @@ TranscludeWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
try {
|
||||
this.renderChildren(parent,nextSibling);
|
||||
} catch(error) {
|
||||
if(error instanceof $tw.utils.TranscludeRecursionError) {
|
||||
// We were infinite looping.
|
||||
// We need to try and abort as much of the loop as we can, so we will keep "throwing" upward until we find a transclusion that has a different signature.
|
||||
// Hopefully that will land us just outside where the loop began. That's where we want to issue an error.
|
||||
// Rendering widgets beneath this point may result in a freezing browser if they explode exponentially.
|
||||
var transcludeSignature = this.getVariable("transclusion");
|
||||
if(this.getAncestorCount() > $tw.utils.TranscludeRecursionError.MAX_WIDGET_TREE_DEPTH - 50) {
|
||||
// For the first fifty transcludes we climb up, we simply collect signatures.
|
||||
// We're assuming that those first 50 will likely include all transcludes involved in the loop.
|
||||
error.signatures[transcludeSignature] = true;
|
||||
} else if(!error.signatures[transcludeSignature]) {
|
||||
// Now that we're past the first 50, let's look for the first signature that wasn't in the loop. That'll be where we print the error and resume rendering.
|
||||
this.children = [this.makeChildWidget({type: "error", attributes: {
|
||||
"$message": {type: "string", value: $tw.language.getString("Error/RecursiveTransclusion")}
|
||||
}})];
|
||||
this.renderChildren(parent,nextSibling);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
this.renderChildren(parent,nextSibling);
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -12,6 +12,9 @@ Widget base class
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/* Maximum permitted depth of the widget tree for recursion detection */
|
||||
var MAX_WIDGET_TREE_DEPTH = 1000;
|
||||
|
||||
/*
|
||||
Create a widget object for a parse tree node
|
||||
parseTreeNode: reference to the parse tree node to be rendered
|
||||
@@ -163,8 +166,6 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
});
|
||||
resultList = this.wiki.filterTiddlers(value,this.makeFakeWidgetWithVariables(variables),options.source);
|
||||
value = resultList[0] || "";
|
||||
} else {
|
||||
params = variable.params;
|
||||
}
|
||||
return {
|
||||
text: value,
|
||||
@@ -493,8 +494,10 @@ Widget.prototype.makeChildWidgets = function(parseTreeNodes,options) {
|
||||
this.children = [];
|
||||
var self = this;
|
||||
// Check for too much recursion
|
||||
if(this.getAncestorCount() > $tw.utils.TranscludeRecursionError.MAX_WIDGET_TREE_DEPTH) {
|
||||
throw new $tw.utils.TranscludeRecursionError();
|
||||
if(this.getAncestorCount() > MAX_WIDGET_TREE_DEPTH) {
|
||||
this.children.push(this.makeChildWidget({type: "error", attributes: {
|
||||
"$message": {type: "string", value: $tw.language.getString("Error/RecursiveTransclusion")}
|
||||
}}));
|
||||
} else {
|
||||
// Create set variable widgets for each variable
|
||||
$tw.utils.each(options.variables,function(value,name) {
|
||||
|
||||
@@ -5,6 +5,5 @@
|
||||
"author": "JeremyRuston",
|
||||
"core-version": ">=5.0.0",
|
||||
"plugin-priority": "0",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -45,17 +45,7 @@ $:/config/Plugins/Disabled/$(currentTiddler)$
|
||||
<$view field="title"/>
|
||||
</h2>
|
||||
<h2>
|
||||
<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>
|
||||
<div><em><$view field="version"/></em></div>
|
||||
</h2>
|
||||
</div>
|
||||
\end
|
||||
|
||||
@@ -70,20 +70,9 @@ $:/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>
|
||||
<%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>
|
||||
<div><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">
|
||||
|
||||
@@ -5,7 +5,6 @@ title: $:/core/ui/TestCaseTemplate
|
||||
<$let
|
||||
linkTarget="yes"
|
||||
displayFormat={{!!display-format}}
|
||||
testcaseTiddler=<<currentTiddler>>
|
||||
>
|
||||
<$testcase
|
||||
testOutput="Output"
|
||||
|
||||
@@ -15,7 +15,7 @@ title: $:/core/ui/testcases/DefaultTemplate
|
||||
<div class="tc-test-case-wrapper">
|
||||
<div class="tc-test-case-header">
|
||||
<h2>
|
||||
<$genesis $type={{{ [<linkTarget>!match[]then[$link]else[div]] }}} to=<<testcaseTiddler>>>
|
||||
<$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]] %>
|
||||
@@ -55,9 +55,7 @@ title: $:/core/ui/testcases/DefaultTemplate
|
||||
<pre><$view tiddler="Output" format="plainwikified" mode="block"/></pre>
|
||||
<%else%>
|
||||
<$linkcatcher actions=<<linkcatcherActions>>>
|
||||
<$tiddler tiddler="Output">
|
||||
<$transclude $tiddler="Output" $mode="block"/>
|
||||
</$tiddler>
|
||||
<$transclude $tiddler="Output" $mode="block"/>
|
||||
</$linkcatcher>
|
||||
<%endif%>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.3.4/index.html
|
||||
url: https://tiddlywiki.com/library/v5.3.3/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: 5.3.4
|
||||
created: 20240529100240232
|
||||
modified: 20240529100240232
|
||||
created: 20231223102229103
|
||||
modified: 20231223102229103
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.3.4
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -10,8 +10,6 @@ description: Under development
|
||||
|
||||
! Major Improvements
|
||||
|
||||
!! Tour Plugin
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7734">> several new features that together allow interactive learning tours to be created and presented in TiddlyWiki.
|
||||
|
||||
The demo TiddlyWiki interactive tour can be seen at https://tiddlywiki.com/prerelease/tour
|
||||
@@ -22,20 +20,6 @@ The new features include:
|
||||
* The new Confetti Plugin that allows animated bursts of confetti to be displayed
|
||||
* Improvements to the Dynannotate Plugin to add the ability to highlight screen elements using an animated spotlight effect
|
||||
|
||||
!! <<.wlink TestCaseWidget>> Widget
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7817">> new <<.wlink TestCaseWidget>> widget that is intended to solve a problem with the examples that we feature in the documentation. The existing macros are workable for simple, self-contained examples, but can be hard to follow in cases where the examples use additional tiddlers. The <<.wlink TestCaseWidget>> widget displays complete, self-contained interactive examples showing the output together with a tabbed display of the constituent tiddlers that produce it:
|
||||
|
||||
<<testcase "TestCases/TestCaseWidget/TwoPlusTwo">>
|
||||
|
||||
The payload tiddlers for a test case are specified with the <<.wlink DataWidget>> widget. Test cases are run as an independent, self-contained nested wiki in a similar way to the [[Innerwiki Plugin]], but are much more lightweight. The disadvantage is that test cases are rendered as part of the main page, and so any styling changes will leak out to the rest of the page.
|
||||
|
||||
Test cases can also specify the raw HTML of the expected result which causes them to be executed as tests, with success or failure indicated by an icon:
|
||||
|
||||
<<testcase "TestCases/TestCaseWidget/FailingTest">>
|
||||
|
||||
The easiest way to use the <<.wlink TestCaseWidget>> is by creating TestCaseTiddlers using the new CompoundTiddlers format. There are also many test cases to view in the TiddlyWiki test edition at https://tiddlywiki.com/prerelease/test.html
|
||||
|
||||
! Translation improvements
|
||||
|
||||
Improvements to the following translations:
|
||||
@@ -46,7 +30,7 @@ Improvements to the following translations:
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/8198">> badges to the core plugins to indicate their [[stability level|Plugin Stability]] from "deprecated", "experimental", "stable" and "legacy". These badges are shown in the plugin library and in the control panel
|
||||
*
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
@@ -62,13 +46,11 @@ Improvements to the following translations:
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7882">> infinite recursion handling using a custom exception
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7966">> button to the JavaScript error popup allowing tiddlers to be saved to a local JSON file
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/8120">> to latest version of modern-normalize 2.0.0
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8186">> nested [[Block Quotes in WikiText]]
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7933">> TiddlyWikiClassic build process
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7935">> LinkWidget not refreshing when the `to` attribute changes
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/3460">> parsing bug with empty procedures/macros
|
||||
@@ -97,8 +79,7 @@ Improvements to the following translations:
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8195">> issue with fakedom TW_Node inheritence
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8099">> SJCL library creating variables in global scope
|
||||
*
|
||||
|
||||
! Infrastructure Improvements
|
||||
|
||||
@@ -133,6 +114,5 @@ rmunn
|
||||
saqimtiaz
|
||||
sarna
|
||||
Telumire
|
||||
twMat
|
||||
yaisog
|
||||
""">>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.4/index.html
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.3/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
|
||||
@@ -7,8 +7,7 @@ title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$transclude $tiddler="Output"/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<span class="tc-error">Recursive transclusion error in transclude widget</span>
|
||||
<p><span class="tc-error">Recursive transclusion error in transclude widget</span></p>
|
||||
@@ -12,24 +12,6 @@ Tests the backlinks mechanism.
|
||||
"use strict";
|
||||
|
||||
describe('Backlinks tests', function() {
|
||||
function setupWiki(wikiOptions) {
|
||||
wikiOptions = wikiOptions || {};
|
||||
// Create a wiki
|
||||
var wiki = new $tw.Wiki(wikiOptions);
|
||||
wiki.addIndexersToWiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: '',
|
||||
});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]',
|
||||
});
|
||||
return wiki;
|
||||
}
|
||||
|
||||
describe('a tiddler with no links to it', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
@@ -43,7 +25,15 @@ describe('Backlinks tests', function() {
|
||||
});
|
||||
|
||||
describe('A tiddler added to the wiki with a link to it', function() {
|
||||
var wiki = setupWiki();
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]'});
|
||||
|
||||
it('should have a backlink', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backlinks[]]').join(',')).toBe('TestOutgoing');
|
||||
@@ -52,7 +42,15 @@ describe('Backlinks tests', function() {
|
||||
|
||||
describe('A tiddler that has a link added to it later', function() {
|
||||
it('should have an additional backlink', function() {
|
||||
var wiki = setupWiki();
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]'});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing2',
|
||||
@@ -69,7 +67,15 @@ describe('Backlinks tests', function() {
|
||||
});
|
||||
|
||||
describe('A tiddler that has a link remove from it later', function() {
|
||||
var wiki = setupWiki();
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]'});
|
||||
|
||||
it('should have one fewer backlink', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backlinks[]]').join(',')).toBe('TestOutgoing');
|
||||
@@ -83,7 +89,15 @@ describe('Backlinks tests', function() {
|
||||
});
|
||||
|
||||
describe('A tiddler linking to another that gets renamed', function() {
|
||||
var wiki = setupWiki();
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]'});
|
||||
|
||||
it('should have its name changed in the backlinks', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backlinks[]]').join(',')).toBe('TestOutgoing');
|
||||
@@ -95,7 +109,15 @@ describe('Backlinks tests', function() {
|
||||
});
|
||||
|
||||
describe('A tiddler linking to another that gets deleted', function() {
|
||||
var wiki = setupWiki();
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A link to [[TestIncoming]]'});
|
||||
|
||||
it('should be removed from backlinks', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backlinks[]]').join(',')).toBe('TestOutgoing');
|
||||
@@ -105,41 +127,6 @@ describe('Backlinks tests', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backlinks[]]').join(',')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Binary tiddlers should not be parsed', function() {
|
||||
var wiki = setupWiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestDoc.doc',
|
||||
text: 'A link to [[TestOutgoing]]',
|
||||
type: 'application/msword'
|
||||
});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestExcel.xls',
|
||||
text: 'A link to [[TestOutgoing]]',
|
||||
type: 'application/excel'
|
||||
});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'Some links to [[TestDoc.doc]] and [[TestExcel.xls]].'
|
||||
});
|
||||
|
||||
it('should ignore office files', function() {
|
||||
expect(wiki.getIndexer("BackIndexer").subIndexers.link._getTarget(wiki.getTiddler('TestExcel.xls'))).toEqual([]);
|
||||
|
||||
expect(wiki.filterTiddlers('[all[]] +[backlinks[]]').join(',')).toBe('TestOutgoing');
|
||||
|
||||
// make it tw5 tiddler
|
||||
wiki.addTiddler({
|
||||
title: 'TestExcel.xls',
|
||||
text: 'A link to [[TestOutgoing]]'
|
||||
});
|
||||
|
||||
expect(wiki.filterTiddlers('[all[]] +[backlinks[]]').join(',')).toBe('TestOutgoing,TestExcel.xls');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*\
|
||||
title: test-fakedom.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests the fakedom that Tiddlywiki occasionally uses.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe("fakedom tests", function() {
|
||||
|
||||
it("properly assigns nodeType based on DOM standards", function() {
|
||||
// According to MDN, ELEMENT_NODE == 1 && TEXT_NODE == 3
|
||||
// There are others, but currently they're not implemented in fakedom
|
||||
expect($tw.fakeDocument.createElement("div").nodeType).toBe(1);
|
||||
expect($tw.fakeDocument.createElement("div").ELEMENT_NODE).toBe(1);
|
||||
expect($tw.fakeDocument.createTextNode("text").nodeType).toBe(3);
|
||||
expect($tw.fakeDocument.createTextNode("text").TEXT_NODE).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -1,55 +0,0 @@
|
||||
/*\
|
||||
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";
|
||||
|
||||
if($tw.node) {
|
||||
|
||||
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({ignoreEnvironmentVariables: true});
|
||||
// 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) {
|
||||
var fields = tiddlers[title];
|
||||
it("plugin should have a recognised plugin-type field",function() {
|
||||
expect(["plugin","language","theme"].indexOf(fields["plugin-type"]) !== -1).toEqual(true);
|
||||
});
|
||||
switch(fields["plugin-type"]) {
|
||||
case "plugin":
|
||||
it("plugin " + title + " should have name, description and list fields",function() {
|
||||
expect(!!(fields.name && fields.description && fields.list)).toBe(true);
|
||||
});
|
||||
it("plugin " + title + " should have a valid stability field",function() {
|
||||
expect(["STABILITY_0_DEPRECATED","STABILITY_1_EXPERIMENTAL","STABILITY_2_STABLE","STABILITY_3_LEGACY"].indexOf(fields.stability) !== -1).toBe(true);
|
||||
});
|
||||
break;
|
||||
case "language":
|
||||
it("language " + title + " should have name and description fields",function() {
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
});
|
||||
break;
|
||||
case "theme":
|
||||
it("theme " + title + " should have name and description fields",function() {
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})();
|
||||
@@ -1,95 +0,0 @@
|
||||
/*\
|
||||
title: test-widget-getVariableInfo.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests the wikitext rendering pipeline end-to-end. We also need tests that individually test parsers, rendertreenodes etc., but this gets us started.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe("Widget module", function() {
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
|
||||
function createWidgetNode(parseTreeNode,wiki) {
|
||||
return new widget.widget(parseTreeNode,{
|
||||
wiki: wiki,
|
||||
document: $tw.fakeDocument
|
||||
});
|
||||
}
|
||||
|
||||
function parseText(text,wiki,options) {
|
||||
var parser = wiki.parseText("text/vnd.tiddlywiki",text,options);
|
||||
return parser ? {type: "widget", children: parser.tree} : undefined;
|
||||
}
|
||||
|
||||
function renderWidgetNode(widgetNode) {
|
||||
$tw.fakeDocument.setSequenceNumber(0);
|
||||
var wrapper = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(wrapper,null);
|
||||
// console.log(require("util").inspect(wrapper,{depth: 8}));
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
function refreshWidgetNode(widgetNode,wrapper,changes) {
|
||||
var changedTiddlers = {};
|
||||
if(changes) {
|
||||
$tw.utils.each(changes,function(title) {
|
||||
changedTiddlers[title] = true;
|
||||
});
|
||||
}
|
||||
widgetNode.refresh(changedTiddlers,wrapper,null);
|
||||
// console.log(require("util").inspect(wrapper,{depth: 8}));
|
||||
}
|
||||
|
||||
it("should make sure that getVariableInfo returns all expected parameters", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
wiki.addTiddlers([
|
||||
{title: "A", text: "\\define macro(a:aa) aaa"},
|
||||
{title: "B", text: "\\function fn(f:ff) fff\n\\function x() [<fn>]"},
|
||||
{title: "C", text: "\\procedure proc(p:pp) ppp"},
|
||||
{title: "D", text: "\\widget $my.widget(w:ww) www"}
|
||||
]);
|
||||
var text = "\\import A B C D\n\n<$let abc=def>";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
renderWidgetNode(widgetNode);
|
||||
var childNode = widgetNode;
|
||||
while(childNode.children.length > 0) {
|
||||
childNode = childNode.children[0];
|
||||
}
|
||||
|
||||
expect(childNode.getVariableInfo("macro",{allowSelfAssigned:true}).params).toEqual([{name:"a",value:"aa"}]);
|
||||
|
||||
// function params
|
||||
expect(childNode.getVariableInfo("fn", {allowSelfAssigned:true}).params).toEqual([{name:"f",value:"ff"}]);
|
||||
// functions have a text and a value
|
||||
expect(childNode.getVariableInfo("x", {allowSelfAssigned:true}).text).toBe("fff");
|
||||
expect(childNode.getVariableInfo("x", {allowSelfAssigned:true}).srcVariable.value).toBe("[<fn>]");
|
||||
|
||||
// procedures and widgets failed prior to v5.3.4
|
||||
expect(childNode.getVariableInfo("proc", {allowSelfAssigned:true}).params).toEqual([{name:"p",default:"pp"}]);
|
||||
expect(childNode.getVariableInfo("$my.widget", {allowSelfAssigned:true}).params).toEqual([{name:"w",default:"ww"}]);
|
||||
|
||||
// no params expected
|
||||
expect(childNode.getVariableInfo("abc", {allowSelfAssigned:true})).toEqual({text:"def"});
|
||||
|
||||
// debugger; Find code in browser
|
||||
|
||||
// Find values to be compated to
|
||||
// console.log("macro", childNode.getVariableInfo("macro",{allowSelfAssigned:true}));
|
||||
// console.log("function", childNode.getVariableInfo("fn",{allowSelfAssigned:true}));
|
||||
// console.log("function x", childNode.getVariableInfo("x",{allowSelfAssigned:true}));
|
||||
// console.log("procedure", childNode.getVariableInfo("proc",{allowSelfAssigned:true}));
|
||||
// console.log("widget", childNode.getVariableInfo("$my.widget",{allowSelfAssigned:true}));
|
||||
// console.log("let", childNode.getVariableInfo("abc",{allowSelfAssigned:true}));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -160,47 +160,6 @@ describe("Widget module", function() {
|
||||
expect(wrapper.innerHTML).toBe("<span class=\"tc-error\">Recursive transclusion error in transclude widget</span>");
|
||||
});
|
||||
|
||||
it("should handle single-tiddler recursion with branching nodes", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add a tiddler
|
||||
wiki.addTiddlers([
|
||||
{title: "TiddlerOne", text: "<$tiddler tiddler='TiddlerOne'><$transclude /> <$transclude /></$tiddler>"},
|
||||
]);
|
||||
// Test parse tree
|
||||
var parseTreeNode = {type: "widget", children: [
|
||||
{type: "transclude", attributes: {
|
||||
"tiddler": {type: "string", value: "TiddlerOne"}
|
||||
}}
|
||||
]};
|
||||
// Construct the widget node
|
||||
var widgetNode = createWidgetNode(parseTreeNode,wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe("<span class=\"tc-error\">Recursive transclusion error in transclude widget</span> <span class=\"tc-error\">Recursive transclusion error in transclude widget</span>");
|
||||
});
|
||||
|
||||
it("should handle many-tiddler recursion with branching nodes", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add a tiddler
|
||||
wiki.addTiddlers([
|
||||
{title: "TiddlerOne", text: "<$transclude tiddler='TiddlerTwo'/> <$transclude tiddler='TiddlerTwo'/>"},
|
||||
{title: "TiddlerTwo", text: "<$transclude tiddler='TiddlerOne'/>"}
|
||||
]);
|
||||
// Test parse tree
|
||||
var parseTreeNode = {type: "widget", children: [
|
||||
{type: "transclude", attributes: {
|
||||
"tiddler": {type: "string", value: "TiddlerOne"}
|
||||
}}
|
||||
]};
|
||||
// Construct the widget node
|
||||
var widgetNode = createWidgetNode(parseTreeNode,wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe("<span class=\"tc-error\">Recursive transclusion error in transclude widget</span>");
|
||||
});
|
||||
|
||||
it("should deal with SVG elements", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Construct the widget node
|
||||
|
||||
@@ -23,4 +23,5 @@ Some payload tiddlers are set aside for special purposes:
|
||||
|''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 |
|
||||
|''Description'' |Set to the text of the <<.field description>> field |
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20130825213300000
|
||||
modified: 20240520162904479
|
||||
modified: 20240416103247799
|
||||
tags: Concepts
|
||||
title: TiddlerFields
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -39,7 +39,6 @@ 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>> |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20130826122000000
|
||||
modified: 20240520162828577
|
||||
modified: 20220613124446953
|
||||
tags: Mechanisms
|
||||
title: PluginMechanism
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -16,10 +16,6 @@ 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}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: tm-copy-to-clipboard
|
||||
created: 20171215150056004
|
||||
modified: 20240523174013095
|
||||
modified: 20171215150600888
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-copy-to-clipboard
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -11,8 +11,6 @@ It requires the following properties on the `event` object:
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Text to be copied to the clipboard |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
This message is usually generated with the ButtonWidget. It is handled by the TiddlyWiki core.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140723103751357
|
||||
modified: 20240523174013095
|
||||
modified: 20140723103751357
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-permalink
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -12,7 +12,5 @@ The permalink message supports the following properties on the `event` object:
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be permalinked |
|
||||
|tiddlerTitle |The current tiddler (used by default if the tiddler title isn't specified in the `param`) |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
The permalink message can be generated by the ButtonWidget, and is handled by the story mechanism.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140723103751357
|
||||
modified: 20240523174013095
|
||||
modified: 20140723103751357
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-permaview
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -12,7 +12,5 @@ The permaview message supports the following properties on the `event` object:
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be navigated within the permaview |
|
||||
|tiddlerTitle |The current tiddler (used by default if the tiddler title isn't specified in the `param`) |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
The permaview message can be generated by the ButtonWidget, and is handled by the story mechanism.
|
||||
|
||||
@@ -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 a variant of [[Semantic Versioning 2.0.0|http://semver.org/]] standard.
|
||||
Each release of TiddlyWiki5 is identified by a version number that complies with the [[Semantic Versioning 2.0.0|http://semver.org/]] standard.
|
||||
|
||||
! TiddlyWiki Core Version
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
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.
|
||||
@@ -5,7 +5,7 @@ description: An example of a failing test
|
||||
|
||||
title: Narrative
|
||||
|
||||
This test case intentionally fails (in order to show how failures are displayed)
|
||||
This test case intentionally fails to show how failures are displayed.
|
||||
+
|
||||
title: Output
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
title: TestCases/TestCaseWidget/NoExpectedResults
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: A testcase that does not specify expected results
|
||||
|
||||
title: Narrative
|
||||
|
||||
This testcase will display without the pass/fail icons because it does not include an `ExpectedResults` tiddler, and so will only be rendered, and not be executed as a test
|
||||
+
|
||||
title: Output
|
||||
|
||||
This is the output
|
||||
@@ -1,18 +0,0 @@
|
||||
title: TestCases/TestCaseWidget/TwoPlusTwo
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec-failing]]
|
||||
description: A testcase to calculate 2+2
|
||||
|
||||
title: Narrative
|
||||
|
||||
This test case shows an elaborate way to calculate 2+2 involving multiple tiddlers
|
||||
+
|
||||
title: Output
|
||||
|
||||
The sum is <$text text={{{ [{FirstNumber}add{SecondNumber}] }}}/>
|
||||
+
|
||||
title: FirstNumber
|
||||
text: 2
|
||||
+
|
||||
title: SecondNumber
|
||||
text: 2
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: action-listops
|
||||
created: 20141025120850184
|
||||
modified: 20240509135041526
|
||||
modified: 20230805103548113
|
||||
myfield:
|
||||
tags: ActionWidgets Widgets
|
||||
title: ActionListopsWidget
|
||||
@@ -35,12 +35,10 @@ The above widget will toggle the presence of the element <<.value "List Item">>
|
||||
Similarly, if an element is to always be removed when it is present, the `-` / `:except` [[filter run prefix|Filter Expression]] can be used. Both of the following yield the same result:
|
||||
|
||||
```
|
||||
<$action-listops $subfilter="-[[ListItem]]"/>
|
||||
<$action-listops $subfilter="+[remove[ListItem]]"/>
|
||||
<$action-listops $subfilter="-[[List Item]]"/>
|
||||
<$action-listops $subfilter="+[remove[List Item]]"/>
|
||||
```
|
||||
|
||||
<<.infoBox """Note that the parameter of the [[remove Operator]] is a [[Title List]]. To remove one or more titles containing spaces the individual titles must be wrapped in double square brackets, usually via a soft [[Filter Parameter]]. See //Filtered List Variable Assignment// in the [[SetWidget]] documentation to learn more.""">>
|
||||
|
||||
Without any prefixes, the filter run output is simply [[dominantly appended|Dominant Append]] to the list.
|
||||
|
||||
See also the [[Examples|ActionListopsWidget (Examples)]].
|
||||
|
||||
@@ -75,7 +75,7 @@ The test case wiki will inherit variables that are visible to the <<.wid testcas
|
||||
|
||||
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 Case Template Variables
|
||||
! Test Czase Template Variables
|
||||
|
||||
The <<.wid testcase>> widget makes the following variables available within the rendered template:
|
||||
|
||||
|
||||
@@ -207,12 +207,6 @@ Stylesheets/Caption: 样式表
|
||||
Stylesheets/Expand/Caption: 全部展开
|
||||
Stylesheets/Hint: 这是当前标签为 <<tag "$:/tags/Stylesheet">> 的样式表条目呈现的 CSS
|
||||
Stylesheets/Restore/Caption: 复原
|
||||
TestCases/Caption: 测试案例
|
||||
TestCases/Hint: 测试案例是用于测试和学习的自给自足的范例
|
||||
TestCases/All/Caption: 所有测试案例
|
||||
TestCases/All/Hint: 所有测试案例
|
||||
TestCases/Failed/Caption: 失败的测试案例
|
||||
TestCases/Failed/Hint: 仅失败的测试案例
|
||||
Theme/Caption: 布局主题
|
||||
Theme/Prompt: 当前的布局主题:
|
||||
TiddlerColour/Caption: 条目颜色
|
||||
|
||||
@@ -65,9 +65,6 @@ sidebar-tab-foreground-selected: 侧边栏选定页签前景
|
||||
sidebar-tab-foreground: 侧边栏页签前景
|
||||
sidebar-tiddler-link-foreground-hover: 侧边栏悬停条目链结前景
|
||||
sidebar-tiddler-link-foreground: 侧边栏条目链结前景
|
||||
testcase-accent-level-1: 无嵌套的测试案例强调色
|
||||
testcase-accent-level-2: 第二级嵌套的测试案例强调色
|
||||
testcase-accent-level-3: 第三级或更高级别嵌套的测试案例强调色
|
||||
site-title-foreground: 网站标题前景
|
||||
static-alert-foreground: 静态提醒前景
|
||||
tab-background-selected: 选定的页签背景
|
||||
|
||||
@@ -30,7 +30,6 @@ name: 具可读性的插件条目的名称
|
||||
parent-plugin: 对于一个插件,指定其为哪个插件的子插件
|
||||
plugin-priority: 插件条目的优先级数值
|
||||
plugin-type: 插件条目的类型
|
||||
stability: 插件的开发状态:已弃用、实验性、稳定或旧版
|
||||
released: TiddlyWiki 的发布日期
|
||||
revision: 条目存放于服务器中的修订版本
|
||||
source: 条目的网址
|
||||
|
||||
@@ -207,12 +207,6 @@ Stylesheets/Caption: 樣式表
|
||||
Stylesheets/Expand/Caption: 全部展開
|
||||
Stylesheets/Hint: 這是當前標籤為 <<tag "$:/tags/Stylesheet">> 的樣式表條目呈現的 CSS
|
||||
Stylesheets/Restore/Caption: 復原
|
||||
TestCases/Caption: 測試案例
|
||||
TestCases/Hint: 測試案例是用於測試和學習的自給自足的範例
|
||||
TestCases/All/Caption: 所有測試案例
|
||||
TestCases/All/Hint: 所有測試案例
|
||||
TestCases/Failed/Caption: 失敗的測試案例
|
||||
TestCases/Failed/Hint: 僅失敗的測試案例
|
||||
Theme/Caption: 佈景主題
|
||||
Theme/Prompt: 當前的佈景主題:
|
||||
TiddlerColour/Caption: 條目顏色
|
||||
|
||||
@@ -65,9 +65,6 @@ sidebar-tab-foreground-selected: 側邊欄選定頁籤前景
|
||||
sidebar-tab-foreground: 側邊欄頁籤前景
|
||||
sidebar-tiddler-link-foreground-hover: 側邊欄懸停條目鏈結前景
|
||||
sidebar-tiddler-link-foreground: 側邊欄條目鏈結前景
|
||||
testcase-accent-level-1: 無嵌套的測試案例強調色
|
||||
testcase-accent-level-2: 第二級嵌套的測試案例強調色
|
||||
testcase-accent-level-3: 第三級或更高級別嵌套的測試案例強調色
|
||||
site-title-foreground: 網站標題前景
|
||||
static-alert-foreground: 靜態警示前景
|
||||
tab-background-selected: 選定的頁籤背景
|
||||
|
||||
@@ -30,7 +30,6 @@ name: 具可讀性的套件條目的名稱
|
||||
parent-plugin: 對於一個插件,指定其為哪個插件的子插件
|
||||
plugin-priority: 套件條目的優先級數值
|
||||
plugin-type: 套件條目的類型
|
||||
stability: 插件的開發狀態:已棄用、實驗性、穩定或舊版
|
||||
released: TiddlyWiki 的釋出日期
|
||||
revision: 條目存放於伺服器中的修訂版本
|
||||
source: 條目的網址
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "Async",
|
||||
"description": "async.js library",
|
||||
"author": "Caolan McMahon",
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme license"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "AWS",
|
||||
"description": "Amazon Web Services extensions and tools",
|
||||
"list": "readme setup commands lambda",
|
||||
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"],
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"]
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "BibTeX",
|
||||
"description": "BibTeX importer",
|
||||
"author": "Henrik Muehe and Mikola Lysenko",
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/blog",
|
||||
"name": "Blog",
|
||||
"description": "Blog publishing tools",
|
||||
"list": "readme docs",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
"list": "readme docs"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/browser-sniff",
|
||||
"name": "Browser Sniff",
|
||||
"description": "Browser feature detection",
|
||||
"list": "readme usage",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme usage"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/browser-storage",
|
||||
"name": "Browser Storage",
|
||||
"description": "Local storage in the browser",
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme settings"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/cecily",
|
||||
"name": "Cecily",
|
||||
"description": "Zoomable storyview (Cecily)",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/classictools",
|
||||
"name": "Classic Tools",
|
||||
"description": "TiddlyWiki Classic tools",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"description": "Autocompletion for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-css"],
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Close Brackets",
|
||||
"description": "Close brackets for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Close Tag",
|
||||
"description": "Close tags automatically for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Fullscreen",
|
||||
"description": "Fullscreen editing for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Keymap Emacs",
|
||||
"description": "Keymap compatible with Emacs for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"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",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"description": "Keymap compatible with Vim for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-search-replace","$:/plugins/tiddlywiki/codemirror-closebrackets"],
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Mode CSS",
|
||||
"description": "CSS highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"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",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"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",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Mode JavaScript",
|
||||
"description": "JavaScript highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
"description": "Markdown highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-xml"],
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Mode TiddlyWiki Classic",
|
||||
"description": "Tiddlywiki Classic highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Mode XML",
|
||||
"description": "XML highlighting mode for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Search and Replace",
|
||||
"description": "Search and replace for CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "CodeMirror Show Trailing Space",
|
||||
"description": "Show trailing space in CodeMirror",
|
||||
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/codemirror",
|
||||
"name": "CodeMirror",
|
||||
"description": "CodeMirror editor",
|
||||
"list": "readme usage keyboard license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme usage keyboard license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/comments",
|
||||
"name": "Comments",
|
||||
"description": "Threaded tiddler comments",
|
||||
"list": "readme config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme config"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/confetti",
|
||||
"name": "Confetti",
|
||||
"description": "Animated confetti effect",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/consent-banner",
|
||||
"name": "Consent Banner",
|
||||
"description": "Consent banner for GDPR etc",
|
||||
"list": "readme docs youtube config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme docs youtube config"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/d3",
|
||||
"name": "D3",
|
||||
"description": "D3 data visualisation demo",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -5,6 +5,5 @@
|
||||
"author": "JeremyRuston",
|
||||
"core-version": ">=5.0.0",
|
||||
"list": "readme examples",
|
||||
"dependents": ["$:/plugins/tiddlywiki/dynaview"],
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"dependents": ["$:/plugins/tiddlywiki/dynaview"]
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/dynaview",
|
||||
"name": "Dynaview",
|
||||
"description": "Dynamic scrolling and zooming effects",
|
||||
"list": "readme docs examples config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme docs examples config"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/evernote",
|
||||
"name": "Evernote",
|
||||
"description": "Evernote migration tools",
|
||||
"list": "readme docs",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme docs"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/external-attachments",
|
||||
"name": "External Attachments",
|
||||
"description": "External attachments for TiddlyDesktop",
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme settings"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/filesystem",
|
||||
"name": "Filesystem",
|
||||
"description": "Synchronize changes from the node.js server to the local filesystem",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/freelinks",
|
||||
"name": "Freelinks",
|
||||
"description": "Freelinking of tiddler titles",
|
||||
"list": "readme settings",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme settings"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "GitHub Fork Ribbon",
|
||||
"description": "GitHub-inspired corner ribbon",
|
||||
"author": "Simon Whitaker",
|
||||
"list": "readme usage",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
"list": "readme usage"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "Google Analytics",
|
||||
"description": "Website visitor statistics from Google",
|
||||
"contributor": "Sylvain Comte",
|
||||
"list": "readme settings usage",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme settings usage"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "HammerJS",
|
||||
"description": "HammerJS touch gesture library",
|
||||
"author": "Jorik Tangelder (Eight Media)",
|
||||
"list": "readme license",
|
||||
"stability": "STABILITY_0_DEPRECATED"
|
||||
"list": "readme license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/help",
|
||||
"name": "Help",
|
||||
"description": "Floating help panel",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "Highlight (Legacy)",
|
||||
"description": "Highlight.js syntax highlighting for legacy browsers",
|
||||
"author": "Joao Bolila",
|
||||
"list": "readme usage license",
|
||||
"stability": "STABILITY_3_LEGACY"
|
||||
"list": "readme usage license"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "Highlight",
|
||||
"description": "Highlight.js syntax highlighting",
|
||||
"author": "Joao Bolila",
|
||||
"list": "readme usage license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme usage license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/innerwiki",
|
||||
"name": "Innerwiki",
|
||||
"description": "Innerwikis for screenshots and hacking",
|
||||
"list": "readme docs examples",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme docs examples"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/internals",
|
||||
"name": "Internals",
|
||||
"description": "Tools for exploring the internals of TiddlyWiki",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/jasmine",
|
||||
"name": "Jasmine",
|
||||
"description": "Jasmine testing framework",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme"
|
||||
}
|
||||
|
||||
@@ -34,22 +34,23 @@ describe("Wiki-based tests", function() {
|
||||
if(!wiki.tiddlerExists("Output")) {
|
||||
throw "Missing 'Output' tiddler";
|
||||
}
|
||||
if(wiki.tiddlerExists("ExpectedResult")) {
|
||||
// Construct the widget node
|
||||
var text = "{{Output}}\n\n";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Clear changes queue
|
||||
wiki.clearTiddlerEventQueue();
|
||||
// Run the actions if provided
|
||||
if(wiki.tiddlerExists("Actions")) {
|
||||
widgetNode.invokeActionString(wiki.getTiddlerText("Actions"));
|
||||
refreshWidgetNode(widgetNode,wrapper);
|
||||
}
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe(wiki.getTiddlerText("ExpectedResult"));
|
||||
if(!wiki.tiddlerExists("ExpectedResult")) {
|
||||
throw "Missing 'ExpectedResult' tiddler";
|
||||
}
|
||||
// Construct the widget node
|
||||
var text = "{{Output}}\n\n";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Clear changes queue
|
||||
wiki.clearTiddlerEventQueue();
|
||||
// Run the actions if provided
|
||||
if(wiki.tiddlerExists("Actions")) {
|
||||
widgetNode.invokeActionString(wiki.getTiddlerText("Actions"));
|
||||
refreshWidgetNode(widgetNode,wrapper);
|
||||
}
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe(wiki.getTiddlerText("ExpectedResult"));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "JSZip",
|
||||
"description": "JSZip library",
|
||||
"author": "Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso",
|
||||
"list": "readme docs examples license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme docs examples license"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"name": "KaTeX",
|
||||
"description": "KaTeX library for mathematical typography",
|
||||
"list": "readme usage config",
|
||||
"library-version": "v0.15.3",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"library-version": "v0.15.3"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"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",
|
||||
"stability": "STABILITY_3_LEGACY"
|
||||
"list": "readme usage remarkable-license remarkable-katex-license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/markdown",
|
||||
"name": "Markdown",
|
||||
"description": "Markdown parser based on markdown-it",
|
||||
"list": "readme config syntax license",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme config syntax license"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
"title": "$:/plugins/tiddlywiki/menubar",
|
||||
"name": "Menu Bar",
|
||||
"description": "Menu Bar",
|
||||
"list": "readme config",
|
||||
"stability": "STABILITY_2_STABLE"
|
||||
"list": "readme config"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user