Compare commits
86 Commits
fix-global
...
list-widge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f633e5e050 | ||
|
|
7726982d71 | ||
|
|
774058912d | ||
|
|
106e1c68df | ||
|
|
12f42ad62f | ||
|
|
66a8e2dbf2 | ||
|
|
327ecf8f66 | ||
|
|
35e45f3b90 | ||
|
|
93bc9e4309 | ||
|
|
23b75bbc5d | ||
|
|
68da654eb3 | ||
|
|
1eceb5f47f | ||
|
|
def508a220 | ||
|
|
3fb71e2553 | ||
|
|
d17525ec8e | ||
|
|
5bb8155422 | ||
|
|
bb2973fc29 | ||
|
|
bbaa0890b5 | ||
|
|
b4a862c618 | ||
|
|
1be8f0a933 | ||
|
|
773c1f83f2 | ||
|
|
9ee1ef7e23 | ||
|
|
8effb3f218 | ||
|
|
780e5d33a4 | ||
|
|
526e997aa4 | ||
|
|
e4d8849f22 | ||
|
|
bd99cf3385 | ||
|
|
711d1658e2 | ||
|
|
b82f012c0c | ||
|
|
f383863654 | ||
|
|
697dc8db4c | ||
|
|
49c96901f3 | ||
|
|
7d8766d2b9 | ||
|
|
6255856205 | ||
|
|
6f307ae01e | ||
|
|
213a850715 | ||
|
|
217af20fcd | ||
|
|
6d0b4108a4 | ||
|
|
642f8da6ed | ||
|
|
e16635a5ad | ||
|
|
db79bf2380 | ||
|
|
2b16fa7b5c | ||
|
|
64c9d17181 | ||
|
|
ceee20fd59 | ||
|
|
0889f13fef | ||
|
|
fa9bfa07a0 | ||
|
|
dbe233fc87 | ||
|
|
3965e2c027 | ||
|
|
c22cd3f4c6 | ||
|
|
dc282db31b | ||
|
|
70309c67d1 | ||
|
|
ba5bfd1ad0 | ||
|
|
3c66af9fdc | ||
|
|
6877082090 | ||
|
|
9201d2bedc | ||
|
|
229e681550 | ||
|
|
779ac28bd0 | ||
|
|
78ecc20c5e | ||
|
|
8b6bc6664b | ||
|
|
674bd1822c | ||
|
|
6c67dc8235 | ||
|
|
72a4adbd6b | ||
|
|
aaf0bffb39 | ||
|
|
9bbd8a70c2 | ||
|
|
cc57cf2fe9 | ||
|
|
34bc9c72c6 | ||
|
|
aeb502657b | ||
|
|
48705db21f | ||
|
|
587aa28853 | ||
|
|
b926a33b55 | ||
|
|
44ccfe83c9 | ||
|
|
cef0ac680d | ||
|
|
b8a235697f | ||
|
|
ed82536a55 | ||
|
|
d99b1897c3 | ||
|
|
3684cfd178 | ||
|
|
643819f5f5 | ||
|
|
52f7f6382b | ||
|
|
575930b31d | ||
|
|
73f256a411 | ||
|
|
1b5b8905d8 | ||
|
|
825f4eaae1 | ||
|
|
d0da1ef9d9 | ||
|
|
3e213569e2 | ||
|
|
4bdac09872 | ||
|
|
4c9eaeaaf2 |
@@ -5,7 +5,7 @@
|
||||
# Default to the current version number for building the plugin library
|
||||
|
||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||
TW5_BUILD_VERSION=v5.3.1
|
||||
TW5_BUILD_VERSION=v5.3.2
|
||||
fi
|
||||
|
||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||
@@ -104,13 +104,15 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
--build favicon static index \
|
||||
|| exit 1
|
||||
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
# /empty-external-core.html External core empty
|
||||
# /tiddlywikicore-<version>.js Core plugin javascript
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/empty \
|
||||
--verbose \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--build empty \
|
||||
--build empty emptyexternalcore \
|
||||
|| exit 1
|
||||
|
||||
|
||||
|
||||
17
boot/boot.js
@@ -575,9 +575,8 @@ var globalCheck =[
|
||||
" configurable: true",
|
||||
" });",
|
||||
" if(Object.keys(__temp__).length){",
|
||||
" console.log(Object.keys(__temp__));",
|
||||
" console.log(\"Warning: Global assignment detected\",Object.keys(__temp__));",
|
||||
" delete Object.prototype.__temp__;",
|
||||
" throw \"Global assignment is not allowed within modules on node.\";",
|
||||
" }",
|
||||
" delete Object.prototype.__temp__;",
|
||||
].join('\n');
|
||||
@@ -926,7 +925,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
||||
}
|
||||
} else {
|
||||
// line number should be included in e.stack for runtime errors
|
||||
$tw.utils.error("Error executing boot module " + name + ": " + JSON.stringify(e) + "\n\n" + e.stack);
|
||||
$tw.utils.error("Error executing boot module " + name + ": " + String(e) + "\n\n" + e.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2675,6 +2674,18 @@ $tw.hooks.addHook = function(hookName,definition) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Delete hooks from the hashmap
|
||||
*/
|
||||
$tw.hooks.removeHook = function(hookName,definition) {
|
||||
if($tw.utils.hop($tw.hooks.names,hookName)) {
|
||||
var p = $tw.hooks.names[hookName].indexOf(definition);
|
||||
if(p !== -1) {
|
||||
$tw.hooks.names[hookName].splice(p, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Invoke the hook by key
|
||||
*/
|
||||
|
||||
@@ -3,4 +3,4 @@ title: $:/language/Exporters/
|
||||
StaticRiver: Static HTML
|
||||
JsonFile: JSON file
|
||||
CsvFile: CSV file
|
||||
TidFile: ".tid" file
|
||||
TidFile: TID text file
|
||||
|
||||
@@ -19,7 +19,7 @@ The following options are supported:
|
||||
** ''yes'' will "explode" plugins into separate tiddler files and save them to the plugin directory within the wiki folder
|
||||
** ''no'' will suppress exploding plugins into their constituent tiddler files. It will save the plugin as a single JSON tiddler in the tiddlers folder
|
||||
|
||||
Note that both ''explodePlugins'' options will produce wiki folders that build the same exact same original wiki. The difference lies in how plugins are represented in the wiki folder.
|
||||
Note that both ''explodePlugins'' options will produce wiki folders that build the exact same original wiki. The difference lies in how plugins are represented in the wiki folder.
|
||||
|
||||
A common usage is to convert a TiddlyWiki HTML file into a wiki folder:
|
||||
|
||||
@@ -31,4 +31,4 @@ Save the plugin to the tiddlers directory of the target wiki folder:
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder explodePlugins=no
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/language/Help/server
|
||||
description: Provides an HTTP server interface to TiddlyWiki (deprecated in favour of the new listen command)
|
||||
description: (deprecated: see 'listen' command) Provides an HTTP server interface to TiddlyWiki
|
||||
|
||||
Legacy command to serve a wiki over HTTP.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/language/Docs/Types/image/svg+xml
|
||||
description: Structured Vector Graphics image
|
||||
description: SVG image
|
||||
name: image/svg+xml
|
||||
group: Image
|
||||
group-sort: 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/language/Docs/Types/image/x-icon
|
||||
description: ICO format icon file
|
||||
description: ICO icon
|
||||
name: image/x-icon
|
||||
group: Image
|
||||
group-sort: 1
|
||||
|
||||
@@ -60,7 +60,7 @@ function FramedEngine(options) {
|
||||
this.domNode.value = this.value;
|
||||
}
|
||||
// Set the attributes
|
||||
if(this.widget.editType) {
|
||||
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||
this.domNode.setAttribute("type",this.widget.editType);
|
||||
}
|
||||
if(this.widget.editPlaceholder) {
|
||||
|
||||
@@ -34,7 +34,7 @@ function SimpleEngine(options) {
|
||||
this.domNode.value = this.value;
|
||||
}
|
||||
// Set the attributes
|
||||
if(this.widget.editType) {
|
||||
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||
this.domNode.setAttribute("type",this.widget.editType);
|
||||
}
|
||||
if(this.widget.editPlaceholder) {
|
||||
|
||||
@@ -28,12 +28,8 @@ function getAllFilterOperators() {
|
||||
Export our filter function
|
||||
*/
|
||||
exports.all = function(source,operator,options) {
|
||||
// Get our suboperators
|
||||
var allFilterOperators = getAllFilterOperators();
|
||||
// Cycle through the suboperators accumulating their results
|
||||
var results = new $tw.utils.LinkedList(),
|
||||
subops = operator.operand.split("+");
|
||||
// Check for common optimisations
|
||||
var subops = operator.operand.split("+");
|
||||
if(subops.length === 1 && subops[0] === "") {
|
||||
return source;
|
||||
} else if(subops.length === 1 && subops[0] === "tiddlers") {
|
||||
@@ -46,6 +42,10 @@ exports.all = function(source,operator,options) {
|
||||
return options.wiki.eachShadowPlusTiddlers;
|
||||
}
|
||||
// Do it the hard way
|
||||
// Get our suboperators
|
||||
var allFilterOperators = getAllFilterOperators();
|
||||
// Cycle through the suboperators accumulating their results
|
||||
var results = new $tw.utils.LinkedList();
|
||||
for(var t=0; t<subops.length; t++) {
|
||||
var subop = allFilterOperators[subops[t]];
|
||||
if(subop) {
|
||||
|
||||
@@ -81,6 +81,9 @@ exports.parse = function() {
|
||||
}
|
||||
return [tiddlerNode];
|
||||
} else {
|
||||
// No template or text reference is provided, so we'll use a blank target. Otherwise we'll generate
|
||||
// a transclude widget that transcludes the current tiddler, often leading to recursion errors
|
||||
transcludeNode.attributes["$tiddler"] = {name: "$tiddler", type: "string", value: ""};
|
||||
return [transcludeNode];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ exports.parse = function() {
|
||||
}
|
||||
return [tiddlerNode];
|
||||
} else {
|
||||
// No template or text reference is provided, so we'll use a blank target. Otherwise we'll generate
|
||||
// a transclude widget that transcludes the current tiddler, often leading to recursion errors
|
||||
transcludeNode.attributes["$tiddler"] = {name: "$tiddler", type: "string", value: ""};
|
||||
return [transcludeNode];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ CheckboxWidget.prototype.getValue = function() {
|
||||
} else {
|
||||
list = $tw.utils.parseStringArray(this.checkboxDefault || "") || [];
|
||||
}
|
||||
} else if (this.checkboxListIndex) {
|
||||
} else if(this.checkboxListIndex) {
|
||||
list = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(tiddler,this.checkboxListIndex,this.checkboxDefault || "")) || [];
|
||||
} else {
|
||||
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
|
||||
@@ -215,6 +215,8 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
||||
if($tw.utils.isArray(fieldContents)) {
|
||||
// Make a copy so we can modify it without changing original that's refrenced elsewhere
|
||||
listContents = fieldContents.slice(0);
|
||||
} else if(fieldContents === undefined) {
|
||||
listContents = [];
|
||||
} else if(typeof fieldContents === "string") {
|
||||
listContents = $tw.utils.parseStringArray(fieldContents);
|
||||
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
|
||||
|
||||
@@ -60,6 +60,7 @@ ListWidget.prototype.render = function(parent,nextSibling) {
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
ListWidget.prototype.execute = function() {
|
||||
var self = this;
|
||||
// Get our attributes
|
||||
this.template = this.getAttribute("template");
|
||||
this.editTemplate = this.getAttribute("editTemplate");
|
||||
@@ -67,6 +68,8 @@ ListWidget.prototype.execute = function() {
|
||||
this.counterName = this.getAttribute("counter");
|
||||
this.storyViewName = this.getAttribute("storyview");
|
||||
this.historyTitle = this.getAttribute("history");
|
||||
// Look for <$list-template> and <$list-empty> widgets as immediate child widgets
|
||||
this.findExplicitTemplates();
|
||||
// Compose the list elements
|
||||
this.list = this.getTiddlerList();
|
||||
var members = [],
|
||||
@@ -85,18 +88,48 @@ ListWidget.prototype.execute = function() {
|
||||
this.history = [];
|
||||
};
|
||||
|
||||
ListWidget.prototype.findExplicitTemplates = function() {
|
||||
var self = this;
|
||||
this.explicitListTemplate = null;
|
||||
this.explicitEmptyTemplate = null;
|
||||
var searchChildren = function(childNodes) {
|
||||
$tw.utils.each(childNodes,function(node) {
|
||||
if(node.type === "list-template") {
|
||||
self.explicitListTemplate = node.children;
|
||||
} else if(node.type === "list-empty") {
|
||||
self.explicitEmptyTemplate = node.children;
|
||||
} else if(node.type === "element" && node.tag === "p") {
|
||||
searchChildren(node.children);
|
||||
}
|
||||
});
|
||||
};
|
||||
searchChildren(this.parseTreeNode.children);
|
||||
}
|
||||
|
||||
ListWidget.prototype.getTiddlerList = function() {
|
||||
var limit = $tw.utils.getInt(this.getAttribute("limit",""),undefined);
|
||||
var defaultFilter = "[!is[system]sort[title]]";
|
||||
return this.wiki.filterTiddlers(this.getAttribute("filter",defaultFilter),this);
|
||||
var results = this.wiki.filterTiddlers(this.getAttribute("filter",defaultFilter),this);
|
||||
if(limit !== undefined) {
|
||||
if(limit >= 0) {
|
||||
results = results.slice(0,limit);
|
||||
} else {
|
||||
results = results.slice(limit);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
ListWidget.prototype.getEmptyMessage = function() {
|
||||
var parser,
|
||||
emptyMessage = this.getAttribute("emptyMessage","");
|
||||
// this.wiki.parseText() calls
|
||||
// new Parser(..), which should only be done, if needed, because it's heavy!
|
||||
if (emptyMessage === "") {
|
||||
return [];
|
||||
emptyMessage = this.getAttribute("emptyMessage");
|
||||
// If emptyMessage attribute is not present or empty then look for an explicit empty template
|
||||
if(!emptyMessage) {
|
||||
if(this.explicitEmptyTemplate) {
|
||||
return this.explicitEmptyTemplate;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
parser = this.wiki.parseText("text/vnd.tiddlywiki",emptyMessage,{parseAsInline: true});
|
||||
if(parser) {
|
||||
@@ -122,12 +155,19 @@ ListWidget.prototype.makeItemTemplate = function(title,index) {
|
||||
if(template) {
|
||||
templateTree = [{type: "transclude", attributes: {tiddler: {type: "string", value: template}}}];
|
||||
} else {
|
||||
// Check for child nodes of the list widget
|
||||
if(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {
|
||||
templateTree = this.parseTreeNode.children;
|
||||
} else {
|
||||
// Check for a <$list-item> widget
|
||||
if(this.explicitListTemplate) {
|
||||
templateTree = this.explicitListTemplate;
|
||||
} else if (!this.explicitEmptyTemplate) {
|
||||
templateTree = this.parseTreeNode.children;
|
||||
}
|
||||
}
|
||||
if(!templateTree) {
|
||||
// Default template is a link to the title
|
||||
templateTree = [{type: "element", tag: this.parseTreeNode.isBlock ? "div" : "span", children: [{type: "link", attributes: {to: {type: "string", value: title}}, children: [
|
||||
{type: "text", text: title}
|
||||
{type: "text", text: title}
|
||||
]}]}];
|
||||
}
|
||||
}
|
||||
@@ -225,6 +265,8 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
||||
// If we are providing an counter variable then we must refresh the items, otherwise we can rearrange them
|
||||
var hasRefreshed = false,t;
|
||||
if(this.counterName) {
|
||||
var mustRefreshOldLast = false;
|
||||
var oldLength = this.children.length;
|
||||
// Cycle through the list and remove and re-insert the first item that has changed, and all the remaining items
|
||||
for(t=0; t<this.list.length; t++) {
|
||||
if(hasRefreshed || !this.children[t] || this.children[t].parseTreeNode.itemTitle !== this.list[t]) {
|
||||
@@ -232,6 +274,9 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
||||
this.removeListItem(t);
|
||||
}
|
||||
this.insertListItem(t,this.list[t]);
|
||||
if(!hasRefreshed && t === oldLength) {
|
||||
mustRefreshOldLast = true;
|
||||
}
|
||||
hasRefreshed = true;
|
||||
} else {
|
||||
// Refresh the item we're reusing
|
||||
@@ -239,6 +284,12 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
||||
hasRefreshed = hasRefreshed || refreshed;
|
||||
}
|
||||
}
|
||||
// If items were inserted then we must recreate the item that used to be at the last position as it is no longer last
|
||||
if(mustRefreshOldLast && oldLength > 0) {
|
||||
var oldLastIdx = oldLength-1;
|
||||
this.removeListItem(oldLastIdx);
|
||||
this.insertListItem(oldLastIdx,this.list[oldLastIdx]);
|
||||
}
|
||||
// If there are items to remove and we have not refreshed then recreate the item that will now be at the last position
|
||||
if(!hasRefreshed && this.children.length > this.list.length) {
|
||||
this.removeListItem(this.list.length-1);
|
||||
|
||||
@@ -41,30 +41,43 @@ TranscludeWidget.prototype.execute = function() {
|
||||
this.collectAttributes();
|
||||
this.collectStringParameters();
|
||||
this.collectSlotFillParameters();
|
||||
// Get the target text and parse tree nodes that we are transcluding
|
||||
var target = this.getTransclusionTarget(),
|
||||
parseTreeNodes;
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
}
|
||||
// Set 'thisTiddler'
|
||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||
var parseTreeNodes, target;
|
||||
// Process the transclusion according to the output type
|
||||
switch(this.transcludeOutput || "text/html") {
|
||||
case "text/html":
|
||||
// Return the parse tree nodes
|
||||
// Return the parse tree nodes of the target
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
parseTreeNodes = target.parseTreeNodes;
|
||||
break;
|
||||
case "text/raw":
|
||||
// Just return the raw text
|
||||
parseTreeNodes = [{type: "text", text: this.sourceText}];
|
||||
target = this.getTransclusionTarget();
|
||||
parseTreeNodes = [{type: "text", text: target.text}];
|
||||
break;
|
||||
default:
|
||||
// text/plain
|
||||
var plainText = this.wiki.renderText("text/plain",this.parserType,this.sourceText,{parentWidget: this});
|
||||
parseTreeNodes = [{type: "text", text: plainText}];
|
||||
// "text/plain" is the plain text result of wikifying the text
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
var widgetNode = this.wiki.makeWidget(target.parser,{
|
||||
parentWidget: this,
|
||||
document: $tw.fakeDocument
|
||||
});
|
||||
var container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
parseTreeNodes = [{type: "text", text: container.textContent}];
|
||||
break;
|
||||
}
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
// Set the legacy transclusion context variables only if we're not transcluding a variable
|
||||
if(!this.transcludeVariable) {
|
||||
var recursionMarker = this.makeRecursionMarker();
|
||||
@@ -161,17 +174,44 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() {
|
||||
};
|
||||
|
||||
/*
|
||||
Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:}
|
||||
Get transcluded details as an object {text:,type:}
|
||||
*/
|
||||
TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
var self = this;
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
var text;
|
||||
// Return the text and type of the target
|
||||
if(this.hasAttribute("$variable")) {
|
||||
if(this.transcludeVariable) {
|
||||
// Transcluding a variable
|
||||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()});
|
||||
text = variableInfo.text;
|
||||
return {
|
||||
text: variableInfo.text,
|
||||
type: this.transcludeType
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Transcluding a text reference
|
||||
var parserInfo = this.wiki.getTextReferenceParserInfo(
|
||||
this.transcludeTitle,
|
||||
this.transcludeField,
|
||||
this.transcludeIndex,
|
||||
{
|
||||
subTiddler: this.transcludeSubTiddler,
|
||||
defaultType: this.transcludeType
|
||||
});
|
||||
return {
|
||||
text: parserInfo.text,
|
||||
type: parserInfo.type
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:}
|
||||
*/
|
||||
TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
var self = this;
|
||||
var parser;
|
||||
// Get the parse tree
|
||||
if(this.hasAttribute("$variable")) {
|
||||
@@ -237,7 +277,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
}
|
||||
$tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"])
|
||||
});
|
||||
} else if(srcVariable && (srcVariable.isMacroDefinition || !srcVariable.isFunctionDefinition)) {
|
||||
} else if(srcVariable && !srcVariable.isFunctionDefinition) {
|
||||
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"
|
||||
parser = {
|
||||
tree: [
|
||||
@@ -269,22 +309,13 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
});
|
||||
}
|
||||
// Return the parse tree
|
||||
if(parser) {
|
||||
return {
|
||||
parseTreeNodes: parser.tree,
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser.source,
|
||||
type: parser.type
|
||||
};
|
||||
} else {
|
||||
// If there's no parse tree then return the missing slot value
|
||||
return {
|
||||
parseTreeNodes: (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: null,
|
||||
type: null
|
||||
};
|
||||
}
|
||||
return {
|
||||
parser: parser,
|
||||
parseTreeNodes: parser ? parser.tree : (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser && parser.source,
|
||||
type: parser && parser.type
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
title: $:/core/ui/EditTemplate/body/default
|
||||
|
||||
\function edit-preview-state()
|
||||
[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] +[get[text]] :else[[no]]
|
||||
\end
|
||||
|
||||
\define config-visibility-title()
|
||||
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
\end
|
||||
@@ -10,15 +14,16 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
|
||||
\whitespace trim
|
||||
<$let
|
||||
edit-preview-state={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}
|
||||
importTitle=<<qualify $:/ImportImage>>
|
||||
importState=<<qualify $:/state/ImportImage>> >
|
||||
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
|
||||
<$reveal stateTitle=<<edit-preview-state>> type="match" text="yes" tag="div">
|
||||
<div class="tc-tiddler-preview">
|
||||
<div>
|
||||
<div class={{{ [function[edit-preview-state]match[yes]then[tc-tiddler-preview]] +[join[ ]] }}}>
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
<$list filter="[function[edit-preview-state]match[yes]]" variable="ignore">
|
||||
|
||||
<div class="tc-tiddler-preview-preview" data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}>
|
||||
|
||||
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
||||
@@ -29,13 +34,12 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
|
||||
</div>
|
||||
|
||||
</$list>
|
||||
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes" tag="div">
|
||||
</div>
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
</$reveal>
|
||||
</$dropzone>
|
||||
|
||||
</$let>
|
||||
|
||||
@@ -10,7 +10,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
|
||||
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
|
||||
<div class="tc-type-selector-dropdown-wrapper">
|
||||
<div class="tc-type-selector"><$fieldmangler>
|
||||
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
|
||||
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<typeInputTiddler>] [<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
|
||||
</$fieldmangler></div>
|
||||
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
|
||||
@@ -9,11 +9,17 @@ button-classes: tc-text-editor-toolbar-item-start-group
|
||||
shortcuts: ((preview))
|
||||
|
||||
\whitespace trim
|
||||
<$let
|
||||
edit-preview-state={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}
|
||||
>
|
||||
<$reveal state=<<edit-preview-state>> type="match" text="yes" tag="span">
|
||||
{{$:/core/images/preview-open}}
|
||||
<$action-setfield $tiddler=<<edit-preview-state>> $value="no"/>
|
||||
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
|
||||
</$reveal>
|
||||
<$reveal state=<<edit-preview-state>> type="nomatch" text="yes" tag="span">
|
||||
{{$:/core/images/preview-closed}}
|
||||
<$action-setfield $tiddler=<<edit-preview-state>> $value="yes"/>
|
||||
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
|
||||
</$reveal>
|
||||
</$let>
|
||||
|
||||
@@ -20,7 +20,7 @@ code-body: yes
|
||||
|
||||
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
|
||||
|
||||
<$dropzone enable=<<tv-enable-drag-and-drop>>>
|
||||
<$dropzone enable=<<tv-enable-drag-and-drop>> class="tc-dropzone tc-page-container-inner">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]" variable="listItem">
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.3.1/index.html
|
||||
url: https://tiddlywiki.com/library/v5.3.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
||||
@@ -10,7 +10,7 @@ color:$(foregroundColor)$;
|
||||
<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. -->
|
||||
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
|
||||
\whitespace trim
|
||||
<$vars
|
||||
<$let
|
||||
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
|
||||
backgroundColor=<<__colour__>>
|
||||
>
|
||||
@@ -23,6 +23,7 @@ color:$(foregroundColor)$;
|
||||
<$transclude tiddler=<<__icon__>>/>
|
||||
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||
</$element-tag$>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/de-AT-server/tiddlers/system/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/dev/tiddlers/images/favicon.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
@@ -1,9 +1,14 @@
|
||||
created: 20141122200310516
|
||||
modified: 20201213161842776
|
||||
modified: 20230923031318421
|
||||
tags: Mechanisms
|
||||
title: HookMechanism
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The hook mechanism provides a way for plugins to intercept and modify default functionality. Hooks are added as follows:
|
||||
The hook mechanism provides a way for plugins to intercept and modify default functionality.
|
||||
|
||||
!! Add a hook
|
||||
|
||||
Hooks are added as follows:
|
||||
|
||||
```js
|
||||
/*
|
||||
@@ -13,6 +18,8 @@ handler: function to be called when hook is invoked
|
||||
$tw.hooks.addHook(name,handler);
|
||||
```
|
||||
|
||||
!!! Params and return
|
||||
|
||||
The handler function will be called with parameters that depend on the specific hook in question, but they always follow the pattern `handler(value,params...)`
|
||||
|
||||
* ''value'': an optional value that is to be transformed by the hook function
|
||||
@@ -20,11 +27,29 @@ The handler function will be called with parameters that depend on the specific
|
||||
|
||||
If required by the hook in question, the handler function must return the modified ''value''.
|
||||
|
||||
!!! Multiple handlers
|
||||
|
||||
Multiple handlers can be assigned to the same name using repeated calls. When a hook is invoked by name all registered functions will be called sequentially in their order of addition.
|
||||
|
||||
Note that the ''value'' passed to the subsequent hook function will be the return value of the previous hook function.
|
||||
|
||||
Though not essential care should be taken to ensure that hooks are added before they are invoked. For example: [[Hook: th-opening-default-tiddlers-list]] should ideally be added before the story startup module is invoked otherwise any hook specified additions to the default tiddlers will not be seen on the initial loading of the page, though will be visible if the user clicks the home button.
|
||||
Be careful not to `addHook` in widget's `render` method, which will be call several times. You could `addHook` in methods that only called once, e.g. the constructor of widget class. Otherwise you should `removeHook` then add it again.
|
||||
|
||||
!!! Timing of registration
|
||||
|
||||
Though not essential care should be taken to ensure that hooks are added before they are invoked.
|
||||
|
||||
For example: [[Hook: th-opening-default-tiddlers-list]] should ideally be added before the story startup module is invoked. Otherwise any hook specified additions to the default tiddlers will not be seen on the initial loading of the page, though will be visible if the user clicks the home button.
|
||||
|
||||
!! Remove a hook
|
||||
|
||||
You should clean up the callback when your widget is going to unmount.
|
||||
|
||||
```js
|
||||
$tw.hooks.removeHook(handler)
|
||||
```
|
||||
|
||||
The `handler` should be the same function instance you used in `addHook` (check by `===`). You can save it to `this.xxxHookHandler` on your widget, and call `removeHook` in [[destroy method|Widget `destroy` method examples]].
|
||||
|
||||
!! Example
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
"empty": [
|
||||
"--render","$:/core/save/all","empty.html","text/plain",
|
||||
"--render","$:/core/save/all","empty.hta","text/plain"],
|
||||
"emptyexternalcore": [
|
||||
"--render","$:/core/save/offline-external-js","empty-external-core.html","text/plain",
|
||||
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"],
|
||||
"externalimages": [
|
||||
"--savetiddlers","[is[image]]","images",
|
||||
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
||||
@@ -20,7 +23,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/es-ES-server/tiddlers/system/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/es-ES/tiddlers/images/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/es-ES/tiddlers/images/green_favicon.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/green_favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/fr-FR-server/tiddlers/system/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2
editions/fr-FR-server/tiddlers/system/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/fr-FR/tiddlers/images/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2
editions/fr-FR/tiddlers/images/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/fr-FR/tiddlers/images/green_favicon.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/green_favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
@@ -15,7 +15,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/ja-JP/tiddlers/images/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2
editions/ja-JP/tiddlers/images/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/ja-JP/tiddlers/images/green_favicon.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/green_favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
@@ -15,7 +15,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/ko-KR-server/tiddlers/system/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2
editions/ko-KR-server/tiddlers/system/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/ko-KR/tiddlers/images/favicon.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2
editions/ko-KR/tiddlers/images/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
editions/ko-KR/tiddlers/images/green_favicon.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,2 +1,2 @@
|
||||
title: $:/green_favicon.ico
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
@@ -17,8 +17,8 @@
|
||||
],
|
||||
"library": [
|
||||
"--makelibrary","$:/UpgradeLibrary",
|
||||
"--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
|
||||
"--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
|
||||
"--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
|
||||
"--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
|
||||
"--rendertiddler","$:/plugins/tiddlywiki/pluginlibrary/library.template.html","index.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
78
editions/prerelease/tiddlers/Release 5.3.2.tid
Normal file
@@ -0,0 +1,78 @@
|
||||
caption: 5.3.2
|
||||
created: 20230820114855583
|
||||
modified: 20230820114855583
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.3.2
|
||||
type: text/vnd.tiddlywiki
|
||||
description: Under development
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.1...master]]//
|
||||
|
||||
! Translation improvement
|
||||
|
||||
Improvements to the following translations:
|
||||
|
||||
* Chinese
|
||||
* Polish
|
||||
* Spanish
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/1be8f0a9336952d4745d2bd4f2327e353580a272">> comments plugin to use predefined palette colours
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
*
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/7747">> editor preview button to automatically focus the editor
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7764">> file type names in the export menu
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7737">> an automatic build of the external core TiddlyWiki at https://tiddlywiki.com/empty-external-core.html
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7690">> the default page layout to better support CSS grid and flexbox layouts
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7665">> `{{}}` generating a recursion error
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7758">> ordering of Vanilla stylesheets
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/fa9bfa07a095548eb2f8339b0b1b816d2e6794ef">> missing closing tag in tag-pill-inner macro
|
||||
* <<.link-badge-removed "https://github.com/Jermolene/TiddlyWiki5/issues/7732">> invalid "type" attribute from textarea elements generated by the EditTextWidget
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7749">> editor "type" dropdown state tiddlers
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7712">> handling of "counter-last" variable when appending items with the ListWidget
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6088">> upgrade download link in Firefox
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Performance Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7702">> performance of predefined patterns with [[all Operator]]
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/7671">> favicon format to PNG
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7751">> global hook handling to support removing hooks
|
||||
|
||||
! Acknowledgements
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
<<.contributors """
|
||||
AnthonyMuscio
|
||||
BramChen
|
||||
BuckarooBanzay
|
||||
BurningTreeC
|
||||
EvidentlyCube
|
||||
joebordes
|
||||
kookma
|
||||
linonetwo
|
||||
mateuszwilczek
|
||||
pmario
|
||||
rmunn
|
||||
simonbaird
|
||||
T1mL3arn
|
||||
""">>
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/LocalPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.3.1/index.html
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.3.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease Local)
|
||||
|
||||
A locally installed version of the official ~TiddlyWiki plugin library at tiddlywiki.com for testing and debugging. //Requires a local web server to share the library//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.1/index.html
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.2/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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: TiddlyWiki Pre-release
|
||||
modified: 20150428204930183
|
||||
modified: 20230731122156493
|
||||
|
||||
This is a pre-release build of TiddlyWiki provided for testing and review purposes. ''Please don't try to depend on the pre-release for anything important'' -- you should use the latest official release from https://tiddlywiki.com.
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 118 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
BIN
editions/prerelease/tiddlers/system/favicon.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
2
editions/prerelease/tiddlers/system/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
@@ -20,4 +20,4 @@
|
||||
"favicon": [
|
||||
"--savetiddler","$:/favicon.ico","favicon.ico"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
|
||||
"tiddlywikicore": [
|
||||
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,4 @@ $param$ with a ''buffalo''
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a buffalo with a buffaloGoing to dinner with a buffalo
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a ''buffalo''Going to breakfastwith abuffaloGoing to dinner with a buffalo
|
||||
@@ -0,0 +1,29 @@
|
||||
title: ListWidget/WithExplicitTemplates
|
||||
description: List widget with explicit templates
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\procedure test(filter)
|
||||
<$list filter=<<filter>>>
|
||||
<$list-template>
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$list-template>
|
||||
<$list-empty>
|
||||
None!
|
||||
</$list-empty>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<<test "1 2 3">>
|
||||
|
||||
<<test "">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>123</p><p>None!</p>
|
||||
@@ -0,0 +1,32 @@
|
||||
title: ListWidget/WithExplicitTemplatesInBlockMode
|
||||
description: List widget with explicit templates in block mode
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\procedure test(filter)
|
||||
<$list filter=<<filter>>>
|
||||
|
||||
<$list-template>
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$list-template>
|
||||
|
||||
<$list-empty>
|
||||
None!
|
||||
</$list-empty>
|
||||
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<<test "1 2 3">>
|
||||
|
||||
<<test "">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
123None!
|
||||
@@ -0,0 +1,33 @@
|
||||
title: ListWidget/WithExplicitTemplatesOverriddenByAttributes
|
||||
description: List widget with explicit templates
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\procedure test(filter)
|
||||
<$list filter=<<filter>> emptyMessage="Zero" template="Template">
|
||||
<$list-template>
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$list-template>
|
||||
<$list-empty>
|
||||
None!
|
||||
</$list-empty>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<<test "1 2 3">>
|
||||
|
||||
<<test "">>
|
||||
|
||||
+
|
||||
title: Template
|
||||
|
||||
<$text text=<<currentTiddler>>/><$text text=<<currentTiddler>>/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>112233</p><p>Zero</p>
|
||||
25
editions/test/tiddlers/tests/data/list-widget/WithLimit.tid
Normal file
@@ -0,0 +1,25 @@
|
||||
title: ListWidget/WithLimit
|
||||
description: List widget with limit
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
Zero: <$list filter="1 2 3 4" limit="0" template="Template"/>
|
||||
|
||||
One: <$list filter="1 2 3 4" limit="1" template="Template"/>
|
||||
|
||||
Two: <$list filter="1 2 3 4" limit="2" template="Template"/>
|
||||
|
||||
Minus Two: <$list filter="1 2 3 4" limit="-2" template="Template"/>
|
||||
|
||||
+
|
||||
title: Template
|
||||
|
||||
<$text text=<<currentTiddler>>/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Zero: </p><p>One: 1</p><p>Two: 12</p><p>Minus Two: 34
|
||||
</p>
|
||||
@@ -0,0 +1,26 @@
|
||||
title: ListWidget/WithMissingTemplate
|
||||
description: List widget with explicit templates
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\procedure test(filter)
|
||||
<$list filter=<<filter>>>
|
||||
<$list-empty>
|
||||
None!
|
||||
</$list-empty>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<<test "1 2 3">>
|
||||
|
||||
<<test "">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#1">1</a></span><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#2">2</a></span><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#3">3</a></span></p><p>None!</p>
|
||||
@@ -0,0 +1,26 @@
|
||||
title: Procedures/Double/Underscore
|
||||
description: Checking that procedures don't expose parameters as variables wrapped in double underscores
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure mamacro(one:"red",two:"green")
|
||||
It is $one$ and $two$<<__one__>><<__two__>>.
|
||||
\end
|
||||
|
||||
<$macrocall $name="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="orange"/>
|
||||
|
||||
<$transclude $variable="mamacro" 0="pink"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="purple" 1="pink"/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p>
|
||||
@@ -527,6 +527,29 @@ describe("Widget module", function() {
|
||||
expect(wrapper.children[0].children[15].sequenceNumber).toBe(53);
|
||||
});
|
||||
|
||||
var testCounterLast = function(oldList, newList) {
|
||||
return function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add some tiddlers
|
||||
wiki.addTiddler({title: "Numbers", text: "", list: oldList});
|
||||
var text = "<$list filter='[list[Numbers]]' variable='item' counter='c'><<item>><$text text={{{ [<c-last>match[no]then[, ]] }}} /></$list>";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe("<p>" + oldList.split(' ').join(', ') + "</p>");
|
||||
// Append a number
|
||||
wiki.addTiddler({title: "Numbers", text: "", list: newList});
|
||||
refreshWidgetNode(widgetNode,wrapper,["Numbers"]);
|
||||
expect(wrapper.innerHTML).toBe("<p>" + newList.split(' ').join(', ') + "</p>");
|
||||
}
|
||||
}
|
||||
|
||||
it("the list widget with counter-last should update correctly when list is appended", testCounterLast("1 2 3 4", "1 2 3 4 5"));
|
||||
it("the list widget with counter-last should update correctly when last item is removed", testCounterLast("1 2 3 4", "1 2 3"));
|
||||
it("the list widget with counter-last should update correctly when first item is inserted", testCounterLast("1 2 3 4", "0 1 2 3 4"));
|
||||
it("the list widget with counter-last should update correctly when first item is removed", testCounterLast("1 2 3 4", "2 3 4"));
|
||||
|
||||
it("should deal with the list widget followed by other widgets", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add some tiddlers
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -21,7 +21,7 @@
|
||||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
},
|
||||
"config": {
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,2 +0,0 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
|
Before Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 235 B |
@@ -1,3 +1,3 @@
|
||||
title: $:/_tw_shared/favicons/classic.tiddlywiki.com
|
||||
type: image/x-icon
|
||||
type: image/png
|
||||
tags: TiddlyWikiSitesMenu
|
||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 4.3 KiB |