1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-26 04:43:42 +00:00

Compare commits

..

19 Commits

Author SHA1 Message Date
jeremy@jermolene.com
5f213567dd Add a cascade for dynamically choosing tiddler icons 2021-11-10 14:27:14 +00:00
jeremy@jermolene.com
a1ab220df6 Avoid unwanted whitespace 2021-11-10 10:42:25 +00:00
jeremy@jermolene.com
88d8057b38 Add a cascade for the view template title 2021-11-08 20:55:35 +00:00
jeremy@jermolene.com
a4e0cf31b0 Add a cascade for the editor template body 2021-11-08 17:52:36 +00:00
jeremy@jermolene.com
4bb12379eb Standardise "Story Tiddler Template" nomenclature 2021-11-08 17:50:06 +00:00
jeremy@jermolene.com
4697718e7b Tweak control panel wording 2021-11-08 09:29:05 +00:00
jeremy@jermolene.com
a624ed24e2 Add demo of custom story tiddler template 2021-11-06 14:48:30 +00:00
jeremy@jermolene.com
2059464276 Fix typo in previous commit 2021-11-05 17:59:53 +00:00
jeremy@jermolene.com
2a3a6dd558 Refer to $:/core/ui/{View|Edit}Template via their associated config tiddlers 2021-11-05 17:56:52 +00:00
jeremy@jermolene.com
e0b7dcded1 Refactor import listing and plugin listing as alternate body templates
As suggested by @pmario
2021-11-05 16:42:57 +00:00
jeremy@jermolene.com
478d90acec Add control panel UI for inspecting the template cascades 2021-11-05 14:45:02 +00:00
jeremy@jermolene.com
3aacf0fe72 Simplify cascade filter
Thanks @saqimtiaz
2021-11-05 14:44:26 +00:00
jeremy@jermolene.com
72c77f42da Use the cascade mechanism to choose between the edit and view templates 2021-11-05 09:20:46 +00:00
jeremy@jermolene.com
52907b98f9 Merge branch 'master' into cascade-filter-run-prefix 2021-11-05 08:29:08 +00:00
jeremy@jermolene.com
b1cb211f21 Use the cascade filter run prefix to choose the view template body template 2021-11-04 20:40:59 +00:00
jeremy@jermolene.com
ee32eb909f Add explicit test for empty result when no filter passes 2021-11-04 17:36:02 +00:00
jeremy@jermolene.com
b47a3ab585 Precompile the filters for performance 2021-11-04 16:43:06 +00:00
jeremy@jermolene.com
9e41d410ee Set currentTiddler and ..currentTiddler for filter evaulation 2021-11-04 16:20:37 +00:00
jeremy@jermolene.com
fc3a764199 Initial Commit 2021-11-04 15:51:13 +00:00
308 changed files with 796 additions and 2635 deletions

View File

@@ -1,8 +1,15 @@
# Ignore "third party" code whose style we will not change.
# Known minified files
/boot/sjcl.js
/core/modules/utils/base64-utf8/base64-utf8.module.js
/core/modules/utils/base64-utf8/base64-utf8.module.min.js
/core/modules/utils/diff-match-patch/diff_match_patch.js
/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js
/core/modules/utils/dom/csscolorparser.js
/plugins/tiddlywiki/*/files/
/plugins/tiddlywiki/async/files/async.min.v1.5.0.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/anyword-hint.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/css-hint.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/html-hint.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/javascript-hint.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/show-hint.js
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/xml-hint.js
/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/closebrackets.js
/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/matchbrackets.js
/plugins/tiddlywiki/codemirror-closetag/files/addon/edit/closetag.js
/plugins/tiddlywiki/codemirror-closetag/files/addon/fold/xml-fold.js

View File

@@ -64,23 +64,7 @@ rules:
init-declarations: 'off'
jsx-quotes: error
key-spacing: 'off'
keyword-spacing:
- error
- before: true
after: false
overrides:
'case':
after: true
'do':
'after': true
'else':
after: true
'return':
after: true
'throw':
after: true
'try':
after: true
keyword-spacing: 'off'
line-comment-position: 'off'
linebreak-style: 'off'
lines-around-comment: 'off'

View File

@@ -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.2.2
TW5_BUILD_VERSION=v5.2.0
fi
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"

View File

@@ -2649,4 +2649,3 @@ if(typeof(exports) !== "undefined") {
} else {
_boot(window.$tw);
}
//# sourceURL=$:/boot/boot.js

View File

@@ -117,4 +117,3 @@ if(typeof(exports) === "undefined") {
// Export functionality as a module
exports.bootprefix = _bootprefix;
}
//# sourceURL=$:/boot/bootprefix.js

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@ type: text/plain
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
Copyright (c) 2004-2007, Jeremy Ruston
Copyright (c) 2007-2022, UnaMesa Association
Copyright (c) 2007-2021, UnaMesa Association
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -208,8 +208,6 @@ Theme/Caption: Theme
Theme/Prompt: Current theme:
TiddlerFields/Caption: Tiddler Fields
TiddlerFields/Hint: This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers).
TiddlerColour/Caption: Tiddler Colour
TiddlerColour/Hint: This rules cascade is used to dynamically choose the colour for a tiddler (used for the icon and the associated tag pill).
TiddlerIcon/Caption: Tiddler Icon
TiddlerIcon/Hint: This rules cascade is used to dynamically choose the icon for a tiddler.
Toolbars/Caption: Toolbars

View File

@@ -3,7 +3,6 @@ title: $:/language/Docs/Fields/
_canonical_uri: The full URI of an external image tiddler
bag: The name of the bag from which a tiddler came
caption: The text to be displayed on a tab or button
code-body: The view template will display the tiddler as code if set to ''yes''
color: The CSS color value associated with a tiddler
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
@@ -14,9 +13,9 @@ description: The descriptive text for a plugin, or a modal dialogue
draft.of: For draft tiddlers, contains the title of the tiddler of which this is a draft
draft.title: For draft tiddlers, contains the proposed new title of the tiddler
footer: The footer text for a wizard
hide-body: The view template will hide bodies of tiddlers if set to ''yes''
hide-body: The view template will hide bodies of tiddlers if set to: ''yes''
icon: The title of the tiddler containing the icon associated with a tiddler
library: Indicates that a tiddler should be saved as a JavaScript library if set to ''yes''
library: Indicates that a tiddler should be saved as a JavaScript library if set to: ''yes''
list: An ordered list of tiddler titles associated with a tiddler
list-before: If set, the title of a tiddler before which this tiddler should be added to the ordered list of tiddler titles, or at the start of the list if this field is present but empty
list-after: If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles, or at the end of the list if this field is present but empty
@@ -33,7 +32,7 @@ tags: A list of tags associated with a tiddler
text: The body text of a tiddler
throttle.refresh: If present, throttles refreshes of this tiddler
title: The unique name of a tiddler
toc-link: Suppresses the tiddler's link in a Table of Contents tree if set to ''no''
toc-link: Suppresses the tiddler's link in a Table of Contents tree if set to: ''no''
type: The content type of a tiddler
version: Version information for a plugin
_is_skinny: If present, indicates that the tiddler text field must be loaded from the server

View File

@@ -14,7 +14,7 @@ ConfirmAction: Do you wish to proceed?
Count: count
DefaultNewTiddlerTitle: New Tiddler
Diffs/CountMessage: <<diff-count>> differences
DropMessage: Drop now (or use the 'Escape' key to cancel)
DropMessage: Drop here (or use the 'Escape' key to cancel)
Encryption/Cancel: Cancel
Encryption/ConfirmClearPassword: Do you wish to clear the password? This will remove the encryption applied when saving this wiki
Encryption/PromptSetPassword: Set a new password for this TiddlyWiki

View File

@@ -324,7 +324,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
If there are no Files, let the browser handle it.
*/
EditTextWidget.prototype.handleDropEvent = function(event) {
if($tw.utils.dragEventContainsFiles(event)) {
if(event.dataTransfer.files.length) {
event.preventDefault();
event.stopPropagation();
this.dispatchDOMEvent(this.cloneEvent(event,["dataTransfer"]));

View File

@@ -13,17 +13,15 @@ Text editor operation to wrap the selected lines with a prefix and suffix
"use strict";
exports["wrap-lines"] = function(event,operation) {
var prefix = event.paramObject.prefix || "",
suffix = event.paramObject.suffix || "";
// Cut just past the preceding line break, or the start of the text
operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
// Cut to just past the following line break, or to the end of the text
operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
// Add the prefix and suffix
operation.replacement = prefix + "\n" +
operation.replacement = event.paramObject.prefix + "\n" +
operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
suffix + "\n";
operation.newSelStart = operation.cutStart + prefix.length + 1;
event.paramObject.suffix + "\n";
operation.newSelStart = operation.cutStart + event.paramObject.prefix.length + 1;
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
};

View File

@@ -26,19 +26,17 @@ exports.cascade = function(operationSubFunction,options) {
filterFnList[index] = options.wiki.compileFilter(filter);
}
var output = filterFnList[index](options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name,opts) {
opts = opts || {};
opts.variables = {
"currentTiddler": "" + title,
"..currentTiddler": widget.getVariable("currentTiddler")
};
if(name in opts.variables) {
return opts.variables[name];
} else {
return widget.getVariable(name,opts);
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
default:
return widget.getVariable(name);
}
}
}
});
});
if(output.length !== 0) {
result = output[0];
return false;

View File

@@ -16,30 +16,23 @@ Export our filter function
exports.filter = function(operationSubFunction,options) {
return function(results,source,widget) {
if(results.length > 0) {
var resultsToRemove = [],
index = 0;
var resultsToRemove = [];
results.each(function(title) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name,opts) {
opts = opts || {};
opts.variables = {
"currentTiddler": "" + title,
"..currentTiddler": widget.getVariable("currentTiddler"),
"index": "" + index,
"revIndex": "" + (results.length - 1 - index),
"length": "" + results.length
};
if(name in opts.variables) {
return opts.variables[name];
} else {
return widget.getVariable(name,opts);
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
default:
return widget.getVariable(name);
}
}
});
if(filtered.length === 0) {
resultsToRemove.push(title);
}
++index;
});
results.remove(resultsToRemove);
}

View File

@@ -20,19 +20,20 @@ exports.map = function(operationSubFunction,options) {
results.clear();
$tw.utils.each(inputTitles,function(title) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name,opts) {
opts = opts || {};
opts.variables = {
"currentTiddler": "" + title,
"..currentTiddler": widget.getVariable("currentTiddler"),
"index": "" + index,
"revIndex": "" + (inputTitles.length - 1 - index),
"length": "" + inputTitles.length
};
if(name in opts.variables) {
return opts.variables[name];
} else {
return widget.getVariable(name,opts);
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
case "index":
return "" + index;
case "revIndex":
return "" + (inputTitles.length - 1 - index);
case "length":
return "" + inputTitles.length;
default:
return widget.getVariable(name);
}
}
});

View File

@@ -15,24 +15,26 @@ Export our filter prefix function
exports.reduce = function(operationSubFunction,options) {
return function(results,source,widget) {
if(results.length > 0) {
var accumulator = "",
index = 0;
var accumulator = "";
var index = 0;
results.each(function(title) {
var list = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name,opts) {
opts = opts || {};
opts.variables = {
"currentTiddler": "" + title,
"..currentTiddler": widget.getVariable("currentTiddler"),
"index": "" + index,
"revIndex": "" + (results.length - 1 - index),
"length": "" + results.length,
"accumulator": "" + accumulator
};
if(name in opts.variables) {
return opts.variables[name];
} else {
return widget.getVariable(name,opts);
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
case "accumulator":
return "" + accumulator;
case "index":
return "" + index;
case "revIndex":
return "" + (results.length - 1 - index);
case "length":
return "" + results.length;
default:
return widget.getVariable(name);
}
}
});

View File

@@ -26,16 +26,14 @@ exports.sort = function(operationSubFunction,options) {
compareFn;
results.each(function(title) {
var key = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name,opts) {
opts = opts || {};
opts.variables = {
"currentTiddler": "" + title,
"..currentTiddler": widget.getVariable("currentTiddler")
};
if(name in opts.variables) {
return opts.variables[name];
} else {
return widget.getVariable(name,opts);
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
default:
return widget.getVariable(name);
}
}
});

View File

@@ -95,12 +95,10 @@ function parseFilterOperation(operators,filterString,p) {
if(nextBracketPos === -1) {
throw "Missing closing bracket in filter expression";
}
if(operator.regexp) {
operand.text = "";
} else {
if(!operator.regexp) {
operand.text = filterString.substring(p,nextBracketPos);
operator.operands.push(operand);
}
operator.operands.push(operand);
p = nextBracketPos + 1;
}

View File

@@ -1,27 +0,0 @@
/*\
title: $:/core/modules/filters/crypto.js
type: application/javascript
module-type: filteroperator
Filter operators for cryptography, using the Stanford JavaScript library
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.sha256 = function(source,operator,options) {
var results = [],
length = parseInt(operator.operand,10) || 20,
sha256 = function(text) {
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length);
};
source(function(tiddler,title) {
results.push(sha256(title));
});
return results;
};
})();

View File

@@ -51,20 +51,6 @@ exports.startup = function() {
element.focus(event.paramObject);
}
});
// Install the tm-rename-tiddler and tm-relink-tiddler messages
var makeRenameHandler = function(method) {
return function(event) {
var options = {},
paramObject = event.paramObject || {},
from = paramObject.from || event.tiddlerTitle,
to = paramObject.to;
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
$tw.wiki[method](from,to,options);
};
};
$tw.rootWidget.addEventListener("tm-rename-tiddler",makeRenameHandler("renameTiddler"));
$tw.rootWidget.addEventListener("tm-relink-tiddler",makeRenameHandler("relinkTiddler"));
// Install the scroller
$tw.pageScroller = new $tw.utils.PageScroller();
$tw.rootWidget.addEventListener("tm-scroll",function(event) {

View File

@@ -24,13 +24,13 @@ exports.isDraft = function() {
return this.hasField("draft.of");
};
exports.getFieldString = function(field,defaultValue) {
exports.getFieldString = function(field) {
var value = this.fields[field];
// Check for a missing field
if(value === undefined || value === null) {
return defaultValue || "";
return "";
}
// Stringify the field with the associated tiddler field module (if any)
// Parse the field with the associated module (if any)
var fieldModule = $tw.Tiddler.fieldModules[field];
if(fieldModule && fieldModule.stringify) {
return fieldModule.stringify.call(this,value);

View File

@@ -21,7 +21,7 @@ exports.extractEncryptedStoreArea = function(text) {
if(encryptedStoreAreaStart !== -1) {
var encryptedStoreAreaEnd = text.indexOf("</pre>",encryptedStoreAreaStart);
if(encryptedStoreAreaEnd !== -1) {
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd));
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd-1));
}
}
return null;

View File

@@ -208,10 +208,10 @@ function parseJSONTiddlers(json,fallbackTitle) {
return data;
};
function dragEventContainsType(event,targetType) {
exports.dragEventContainsFiles = function(event) {
if(event.dataTransfer.types) {
for(var i=0; i<event.dataTransfer.types.length; i++) {
if(event.dataTransfer.types[i] === targetType) {
if(event.dataTransfer.types[i] === "Files") {
return true;
break;
}
@@ -220,10 +220,4 @@ function dragEventContainsType(event,targetType) {
return false;
};
exports.dragEventContainsFiles = function(event) {
return (dragEventContainsType(event,"Files") && !dragEventContainsType(event,"text/plain"));
};
exports.dragEventContainsType = dragEventContainsType;
})();

View File

@@ -49,14 +49,10 @@ Handle an event
*/
PageScroller.prototype.handleEvent = function(event) {
if(event.type === "tm-scroll") {
var options = {};
if($tw.utils.hop(event.paramObject,"animationDuration")) {
options.animationDuration = event.paramObject.animationDuration;
}
if(event.paramObject && event.paramObject.selector) {
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
this.scrollSelectorIntoView(null,event.paramObject.selector);
} else {
this.scrollIntoView(event.target,null,options);
this.scrollIntoView(event.target);
}
return false; // Event was handled
}
@@ -66,10 +62,10 @@ PageScroller.prototype.handleEvent = function(event) {
/*
Handle a scroll event hitting the page document
*/
PageScroller.prototype.scrollIntoView = function(element,callback,options) {
PageScroller.prototype.scrollIntoView = function(element,callback) {
var self = this,
duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
srcWindow = element ? element.ownerDocument.defaultView : window;
duration = $tw.utils.getAnimationDuration(),
srcWindow = element ? element.ownerDocument.defaultView : window;
// Now get ready to scroll the body
this.cancelScroll(srcWindow);
this.startTime = Date.now();
@@ -126,11 +122,11 @@ PageScroller.prototype.scrollIntoView = function(element,callback,options) {
drawFrame();
};
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
baseElement = baseElement || document.body;
var element = baseElement.querySelector(selector);
if(element) {
this.scrollIntoView(element,callback,options);
this.scrollIntoView(element,callback);
}
};

View File

@@ -198,8 +198,7 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
this.resetState();
// Import any files in the drop
var numFiles = 0;
// If we have type text/vnd.tiddlywiki then skip trying to import files
if(dataTransfer.files && !$tw.utils.dragEventContainsType(event,"text/vnd.tiddler")) {
if(dataTransfer.files) {
numFiles = this.wiki.readFiles(dataTransfer.files,{
callback: readFileCallback,
deserializer: this.dropzoneDeserializer

View File

@@ -111,16 +111,6 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt);
}
// Add classes when the image loads or fails
$tw.utils.addClass(domNode,"tc-image-loading");
domNode.addEventListener("load",function() {
$tw.utils.removeClass(domNode,"tc-image-loading");
$tw.utils.addClass(domNode,"tc-image-loaded");
},false);
domNode.addEventListener("error",function() {
$tw.utils.removeClass(domNode,"tc-image-loading");
$tw.utils.addClass(domNode,"tc-image-error");
},false);
// Insert element
parent.insertBefore(domNode,nextSibling);
this.domNodes.push(domNode);

View File

@@ -46,7 +46,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
// Accumulate the <$set> widgets from each tiddler
$tw.utils.each(this.tiddlerList,function(title) {
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true});
var parser = widgetPointer.wiki.parseTiddler(title);
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && parseTreeNode.type === "set") {

View File

@@ -51,9 +51,6 @@ ListWidget.prototype.render = function(parent,nextSibling) {
} else {
this.storyview = null;
}
if(this.storyview && this.storyview.renderEnd) {
this.storyview.renderEnd();
}
};
/*

View File

@@ -44,7 +44,8 @@ NavigatorWidget.prototype.render = function(parent,nextSibling) {
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
{type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
]);
this.parentDomNode = parent;
this.computeAttributes();
@@ -635,6 +636,16 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
});
};
NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
var options = {},
paramObject = event.paramObject || {},
from = paramObject.from || event.tiddlerTitle,
to = paramObject.to;
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
this.wiki.renameTiddler(from,to,options);
};
exports.navigator = NavigatorWidget;
})();

View File

@@ -64,9 +64,9 @@ RadioWidget.prototype.getValue = function() {
tiddler = this.wiki.getTiddler(this.radioTitle);
if(tiddler) {
if(this.radioIndex) {
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex,this.radioDefault);
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex);
} else {
value = tiddler.getFieldString(this.radioField,this.radioDefault);
value = tiddler.getFieldString(this.radioField);
}
} else {
value = this.radioDefault;

View File

@@ -38,14 +38,10 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
if(this.outerDomNode.scrollWidth <= this.outerDomNode.offsetWidth && this.outerDomNode.scrollHeight <= this.outerDomNode.offsetHeight && this.fallthrough === "yes") {
return true;
}
var options = {};
if($tw.utils.hop(event.paramObject,"animationDuration")) {
options.animationDuration = event.paramObject.animationDuration;
}
if(event.paramObject && event.paramObject.selector) {
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
this.scrollSelectorIntoView(null,event.paramObject.selector);
} else {
this.scrollIntoView(event.target,null,options);
this.scrollIntoView(event.target);
}
return false; // Handled event
};
@@ -53,9 +49,9 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
/*
Scroll an element into view
*/
ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) {
var duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
srcWindow = element ? element.ownerDocument.defaultView : window;
ScrollableWidget.prototype.scrollIntoView = function(element) {
var duration = $tw.utils.getAnimationDuration(),
srcWindow = element ? element.ownerDocument.defaultView : window;
this.cancelScroll();
this.startTime = Date.now();
var scrollPosition = {
@@ -118,11 +114,11 @@ ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) {
}
};
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
baseElement = baseElement || document.body;
var element = baseElement.querySelector(selector);
if(element) {
this.scrollIntoView(element,callback,options);
this.scrollIntoView(element,callback);
}
};
@@ -159,6 +155,8 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) {
// Create elements
this.outerDomNode = this.document.createElement("div");
$tw.utils.setStyle(this.outerDomNode,[
{overflowY: "auto"},
{overflowX: "auto"},
{webkitOverflowScrolling: "touch"}
]);
this.innerDomNode = this.document.createElement("div");

View File

@@ -122,7 +122,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
});
// Only substitute variable references if this variable was defined with the \define pragma
if(variable.isMacroDefinition) {
value = this.substituteVariableReferences(value,options);
value = this.substituteVariableReferences(value);
}
return {
text: value,
@@ -175,10 +175,10 @@ Widget.prototype.resolveVariableParameters = function(formalParams,actualParams)
return results;
};
Widget.prototype.substituteVariableReferences = function(text,options) {
Widget.prototype.substituteVariableReferences = function(text) {
var self = this;
return (text || "").replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
return options.variables && options.variables[p1] || (self.getVariable(p1,{defaultValue: ""}));
return self.getVariable(p1,{defaultValue: ""});
});
};
@@ -314,40 +314,24 @@ excludeEventAttributes: ignores attributes whose name begins with "on"
Widget.prototype.assignAttributes = function(domNode,options) {
options = options || {};
var self = this;
var assignAttribute = function(name,value) {
// Check for excluded attribute names
if(options.excludeEventAttributes && name.substr(0,2) === "on") {
value = undefined;
$tw.utils.each(this.attributes,function(v,a) {
// Check exclusions
if(options.excludeEventAttributes && a.substr(0,2) === "on") {
v = undefined;
}
if(value !== undefined) {
// Handle the xlink: namespace
var namespace = null;
if(name.substr(0,6) === "xlink:" && name.length > 6) {
namespace = "http://www.w3.org/1999/xlink";
name = name.substr(6);
}
// Handle styles
if(name.substr(0,6) === "style." && name.length > 6) {
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;
} else {
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
try {
domNode.setAttributeNS(namespace,name,value);
} catch(e) {
if(v !== undefined) {
var b = a.split(":");
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
try {
if (b.length == 2 && b[0] == "xlink"){
domNode.setAttributeNS("http://www.w3.org/1999/xlink",b[1],v);
} else {
domNode.setAttributeNS(null,a,v);
}
} catch(e) {
}
}
}
// Not all parse tree nodes have the orderedAttributes property
if(this.parseTreeNode.orderedAttributes) {
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
assignAttribute(attribute.name,self.attributes[attribute.name]);
});
} else {
$tw.utils.each(Object.keys(self.attributes).sort(),function(name) {
assignAttribute(name,self.attributes[name]);
});
}
});
};
/*

View File

@@ -46,31 +46,26 @@ function relinkTiddler(fromTitle,toTitle,options) {
if(!tiddler.fields["plugin-type"] && type !== "application/javascript") {
var tags = tiddler.fields.tags ? tiddler.fields.tags.slice(0) : undefined,
list = tiddler.fields.list ? tiddler.fields.list.slice(0) : undefined,
isModified = false,
processList = function(listField) {
if(listField && listField.indexOf(fromTitle) !== -1) {
// Remove any existing instances of the toTitle
var p = listField.indexOf(toTitle);
while(p !== -1) {
listField.splice(p,1);
p = listField.indexOf(toTitle);
}
// Replace the fromTitle with toTitle
$tw.utils.each(listField,function (title,index) {
if(title === fromTitle) {
listField[index] = toTitle;
isModified = true;
}
});
}
};
isModified = false;
if(!options.dontRenameInTags) {
// Rename tags
processList(tags);
$tw.utils.each(tags,function (title,index) {
if(title === fromTitle) {
console.log("Renaming tag '" + tags[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
tags[index] = toTitle;
isModified = true;
}
});
}
if(!options.dontRenameInLists) {
// Rename lists
processList(list);
$tw.utils.each(list,function (title,index) {
if(title === fromTitle) {
console.log("Renaming list item '" + list[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
list[index] = toTitle;
isModified = true;
}
});
}
if(isModified) {
var newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields())

View File

@@ -6,7 +6,7 @@ title: $:/core/templates/tiddlywiki5.html
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--~~ Raw markup for the top of the head section ~~-->
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
`{{{ [<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />

View File

@@ -1,7 +1,7 @@
title: $:/core/ui/Components/tag-link
<$link>
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<$set name="backgroundColor" value={{!!color}}>
<span style=<<tag-styles>> class="tc-tag-label">
<$view field="title" format="text"/>
</span>

View File

@@ -1,5 +1,5 @@
title: $:/core/ui/ControlPanel/EditTemplateBody
tags: $:/tags/ControlPanel/Cascades
tags: $:/tags/ControlPanel/Cascade
caption: {{$:/language/ControlPanel/EditTemplateBody/Caption}}
\define lingo-base() $:/language/ControlPanel/EditTemplateBody/

View File

@@ -1,9 +0,0 @@
title: $:/core/ui/ControlPanel/TiddlerColour
tags: $:/tags/ControlPanel/Cascades
caption: {{$:/language/ControlPanel/TiddlerColour/Caption}}
\define lingo-base() $:/language/ControlPanel/TiddlerColour/
<<lingo Hint>>
{{$:/tags/TiddlerColourFilter||$:/snippets/ListTaggedCascade}}

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/EditTemplate/body
tags: $:/tags/EditTemplate
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/EditTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/EditTemplate/body/default]] }}} />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/EditTemplateBodyFilter]get[text]] :and[!is[blank]else[$:/core/ui/EditTemplate/body/default]] }}} />

View File

@@ -29,7 +29,7 @@ color:$(foregroundColor)$;
\whitespace trim
<div class="tc-edit-tags">
<$list filter="[list[!!$tagField$]sort[title]]" storyview="pop">
<$macrocall $name="tag-body" colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} tagField=<<__tagField__>>/>
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}} icon={{!!icon}} tagField=<<__tagField__>>/>
</$list>
<$vars tabIndex={{$:/config/EditTabIndex}} cancelPopups="yes">
<$macrocall $name="tag-picker" tagField=<<__tagField__>>/>

View File

@@ -23,7 +23,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
<$text text={{!!group}}/>
</div>
<$set name="userInput" value={{{ [<typeInputTiddler>get[text]] }}}>
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/><$text text=" "/>(<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/> (<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
</$list>
</$set>
</$list>

View File

@@ -1,15 +1,5 @@
title: $:/core/ui/PluginListItemTemplate
\whitespace trim
<$link to={{!!title}} class="tc-plugin-info">
<div class="tc-plugin-info-chunk tc-plugin-info-icon">
<$transclude tiddler=<<currentTiddler>> subtiddler={{{ [<currentTiddler>addsuffix[/icon]] }}}>
<$transclude tiddler={{{ [<currentTiddler>get[plugin-type]addprefix[$:/core/images/plugin-generic-]] }}}/>
</$transclude>
</div>
<div class="tc-plugin-info-chunk tc-plugin-info-description">
<h1>
''<$text text={{{ [<currentTiddler>get[name]] ~[<currentTiddler>split[/]last[1]] }}}/>'':&nbsp;<$view field="description"><$view field="title"/></$view>
</h1>
</div>
</$link>
<div class="tc-menu-list-item">
<$link to={{!!title}}><$view field="description"><$view field="title"/></$view></$link>
</div>

View File

@@ -1,3 +1,3 @@
title: $:/core/ui/StoryTiddlerTemplate
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[!is[blank]else{$:/config/ui/ViewTemplate}] }}} />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]get[text]] :and[!is[blank]else{$:/config/ui/ViewTemplate}] }}} />

View File

@@ -13,8 +13,8 @@ title: $:/core/ui/TagPickerTagTemplate
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$list>
<<actions>>
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
<$set name="backgroundColor" value={{!!color}}>
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target={{!!color}} fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
<span class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
</span>

View File

@@ -3,7 +3,7 @@ title: $:/core/ui/TagTemplate
\whitespace trim
<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
<$set name="tv-show-missing-links" value="yes">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>

View File

@@ -1,8 +1,15 @@
title: $:/core/ui/TiddlerIcon
\whitespace trim
<$let tiddlerIcon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}>
\define title-styles()
fill:$(foregroundColor)$;
\end
<$let tiddlerIcon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]get[text]] }}}>
<$list filter="[<tiddlerIcon>!is[blank]]" variable="ignore">
<$let foregroundColor={{!!color}}>
<span class=<<iconSpanClass>> style=<<title-styles>>>
<$transclude tiddler=<<tiddlerIcon>>/>
</span>
</$let>
</$list>
</$let>

View File

@@ -3,6 +3,6 @@ tags: $:/tags/ViewTemplate
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
</$reveal>

View File

@@ -2,9 +2,6 @@ title: $:/core/ui/ViewTemplate/title
tags: $:/tags/ViewTemplate
\whitespace trim
\define title-styles()
fill:$(foregroundColor)$;
\end
<div class="tc-tiddler-title">
<div class="tc-titlebar">
<span class="tc-tiddler-controls">
@@ -12,12 +9,10 @@ fill:$(foregroundColor)$;
</span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
<$link>
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
<$let iconSpanClass="tc-tiddler-title-icon">
{{||$:/core/ui/TiddlerIcon}}
</span>
</$let>
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
</$link>
</$set>
</div>

View File

@@ -1,7 +1,7 @@
title: $:/snippets/allfields
\define renderfield(title)
<tr class="tc-view-field"><td class="tc-view-field-name">''<$text text=<<__title__>>/>'':</td><td class="tc-view-field-value">//{{$:/language/Docs/Fields/$title$}}//</td></tr>
<tr class="tc-view-field"><td class="tc-view-field-name">''$title$'':</td><td class="tc-view-field-value">//{{$:/language/Docs/Fields/$title$}}//</td></tr>
\end
<table class="tc-view-field-table"><tbody><$list filter="[fields[]sort[title]]" variable="listItem"><$macrocall $name="renderfield" title=<<listItem>>/></$list>
</tbody></table>

View File

@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/library/v5.2.2/index.html
url: https://tiddlywiki.com/library/v5.2.0/index.html
caption: {{$:/language/OfficialPluginLibrary}}
{{$:/language/OfficialPluginLibrary/Hint}}

View File

@@ -1,5 +0,0 @@
title: $:/config/TiddlerColourFilters/
tags: $:/tags/TiddlerColourFilter
color-field: [has[color]then{!!color}]
default: [[$:/config/DefaultTiddlerColour]has[text]get[text]trim[]]

View File

@@ -1,8 +1,7 @@
title: $:/config/ViewTemplateBodyFilters/
tags: $:/tags/ViewTemplateBodyFilter
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/core/ui/]split[/]count[]compare:number:eq[4]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[limit[1]then[$:/core/ui/ViewTemplate/body/code]]
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/]!field:title[$:/core/readme]!field:title[$:/core/icon]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[limit[1]then[$:/core/ui/ViewTemplate/body/code]]
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
hide-body: [field:hide-body[yes]then[$:/core/ui/ViewTemplate/body/blank]]

View File

@@ -1,9 +0,0 @@
title: $:/snippets/DebugStylesheets
<style>[test]{list-style:'❌'}</style>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]has[modified]]" counter="n">
<style>{{!!text}}[test="<<n>>"]{list-style:disc;}</style>
<li test=<<n>>><$link/></li>
</$list>
</ul>

View File

@@ -10,20 +10,18 @@ color:$(foregroundColor)$;
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="title" format="text" />
$actions${{||$:/core/ui/TiddlerIcon}}<$view tiddler=<<__tag__>> field="title" format="text" />
</$element-tag$>
</$vars>
\end
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
\end
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
<$let currentTiddler=<<__tag__>>>
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
</$let>
<$macrocall $name="tag-pill-body" tag=<<__tag__>> colour={{{ [<__tag__>get[color]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
</span>
\end

View File

@@ -1,7 +1,6 @@
title: $:/snippets/peek-stylesheets
\define expandable-stylesheets-list()
\whitespace trim
<ol>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]">
<$vars state=<<qualify "$:/state/peek-stylesheets/open/">>>
@@ -39,7 +38,6 @@ title: $:/snippets/peek-stylesheets
\end
\define stylesheets-list()
\whitespace trim
<ol>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]">
<li>
@@ -59,7 +57,6 @@ title: $:/snippets/peek-stylesheets
</$list>
</ol>
\end
\whitespace trim
<$vars modeState=<<qualify "$:/state/peek-stylesheets/mode/">>>

View File

@@ -1,3 +0,0 @@
title: $:/tags/TiddlerColourFilter
list: $:/config/TiddlerColourFilters/color-field $:/config/TiddlerColourFilters/default

View File

@@ -1,3 +1,3 @@
title: $:/tags/ViewTemplateBodyFilter
list: $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/default
list: $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/default

View File

@@ -2,7 +2,7 @@ caption: Quoi de neuf dans <<version>>
color: #fff
created: 20160603124050989
fr-title: BonjourLaVignette - Dernière Version
image: New Release Banner
image: New Release Banner.png
link: Releases
modified: 20160603124131122
tags: HelloThumbnail

View File

@@ -0,0 +1,82 @@
caption: 5.2.1
created: 20211003152250369
modified: 20211003152250369
tags: ReleaseNotes
title: Release 5.2.1
type: text/vnd.tiddlywiki
\define contributor(username)
<a href="https://github.com/$username$" style="text-decoration:none;font-size:24px;" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><img src="https://github.com/$username$.png?size=32" width="32" height="32"/> @<$text text=<<__username__>>/></a>
\end
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.0...master]]//
! Highlights
! Performance Improvements
*
! Usability Improvements
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6015">> image picker in theme tweaks to not dismiss when an image is selected
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/5998">> a [[new hidden setting|Hidden Setting: Show Edit Preview per Tiddler]] for controlling the visibility of the editor preview pane on a per-tiddler basis
! Widget Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6148">> new LetWidget, a more flexible alternative to the SetWidget and the VarsWidget
! Filter improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6150">> new [[zth Operator]] that works like [[nth Operator]] but counts from zero instead of one
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6149">> [[Map Filter Run Prefix]] to provide additional variables to the filter
! Hackability Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6012/files">> new `focus-editor` operation to [[WidgetMessage: tm-edit-text-operation]]
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6130">> new ActionSetMultipleFieldsWidget, new SetMultipleVariablesWidget and extended ActionSendMessageWidget for working with multiple variables/fields/indexes/parameters in one operation
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6127">> new trigonometric operators: [[acos|acos Operator]], [[asin|asin Operator]], [[atan|atan Operator]], [[cos|cos Operator]], [[sin|sin Operator]] and [[tan|tan Operator]]
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6145">> EditTextWidget to provide a new ''actionValue'' variable to action strings that contains the value of the input
! Developer Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6132">> support for widgets to access the order in which attributes are defined
! Client-server Improvements
*
! Node.js Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/5275">> support for recursively loading subdirectories with [[tiddlywiki.files Files]]
! Plugin Improvements
! Developer Experience Improvements
*
! Translation improvements
* Polish
! Other Bug Fixes
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6013">> refreshing of LinkWidget attributes
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6107">> crash when using "source=basename-uri-decoded" in tiddlywiki.files
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/8ae4428332e03a1fdaee26f777a0c3a372fff401">> ''$timestamp'' attribute ignored when using ActionSetFieldWidget to set the value of an index
! 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:
* <<contributor btheado>>
* <<contributor BurningTreeC>>
* <<contributor EvidentlyCube>>
* <<contributor flibbles>>
* <<contributor joshuafontany>>
* <<contributor Marxsal>>
* <<contributor pmario>>
* <<contributor saqimtiaz>>
* <<contributor Telumire>>

View File

@@ -1,72 +0,0 @@
caption: 5.2.2
created: 20220208152620527
modified: 20220208152620527
tags: ReleaseNotes
title: Release 5.2.2
type: text/vnd.tiddlywiki
\define contributor(username)
<a href="https://github.com/$username$" style="text-decoration:none;font-size:24px;" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><img src="https://github.com/$username$.png?size=32" width="32" height="32"/> @<$text text=<<__username__>>/></a>
\end
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.1...master]]//
! Highlights
*
! Bug Fixes
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/60187dc59e6546d9ca8e6a35418f782a9627cda0">> importing/upgrading encrypted single file wikis
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6389">> RadioWidget not using default value if the field or index is missing
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6376">> [[WidgetMessage: tm-edit-text-operation]] crash with ''wrap-lines'' operation if prefix or suffix is missing
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6395">> processing of $:/tags/RawMarkupWikified/TopHead tiddlers
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6398">> issue whereby renaming tags could result in duplicate tags
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6426">> issue with ImportVariablesWidget when importing block mode widgets
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6428">> issue with ~LaTeX content within Markdown tiddlers
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6440">> search results obscured on narrow screens
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6438">> crash when using deprecated regexp operands for filter operators
! Usability Improvements
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6435">> wording of drag and drop banner (from "drop here" to "drop now")
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/853a899c77766e47eade1dfa5822640ef9915637">> wrapping and wikification of field names in field viewer
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/0186c6490fbd1d8fd4de7c3fa99ccf4d129fbd80">> missing whitespace between description and MIME type in edit template dropdown for the ''type'' field
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/c7e8c87f85b54f60302ff8e396a7569d996e3f67">> incorrect usage of code view for certain system tiddlers
! Widget Improvements
*
! Filter improvements
*
! Hackability Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/54cfda76ee353190f1cf0210b9071894fb1a5690">> support for ''code-body'' field set to ''yes'' to trigger display of a tiddler in the code view
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/66ae1d6930796a9eb062fdb64a755adab8f39294">> classes to the ImageWidget to indicate whether it is loading, loaded or has encountered an error
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6381">> sourceURL tags to $:/boot/boot.js and $:/boot/bootprefix.js, enabling them to be accessed in the browser debugger more easily
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6410">> support to [[WidgetMessage: tm-scroll]] for scrolling without animating
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/1a0c831216c397c6fef8e5685e47857193411a1b">> [[sha256 Operator]]
! Developer Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6409">> support for ''renderEnd()'' method for storyviews
! Node.js Improvements
*
! Translation improvements
* Polish
! 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:
* <<contributor Jermolene>>

View File

@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/prerelease/library/v5.2.2/index.html
url: https://tiddlywiki.com/prerelease/library/v5.2.1/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.

View File

@@ -1,5 +1,4 @@
title: $:/editions/tw5.com/download-empty
code-body: yes
\define saveTiddlerFilter()
[[$:/core]] [[$:/isEncrypted]] [[$:/themes/tiddlywiki/snowwhite]] [[$:/themes/tiddlywiki/vanilla]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [[$:/config/OfficialPluginLibrary]] +[sort[title]]

View File

@@ -256,16 +256,6 @@ Tests the filtering mechanism.
expect(wiki.filterTiddlers("[modifier/Jo/]").join(",")).toBe("TiddlerOne,$:/TiddlerTwo,Tiddler Three,a fourth tiddler,one");
expect(console.log).toHaveBeenCalledWith("WARNING: Filter", "modifier", "has a deprecated regexp operand", /Jo/);
});
it("should handle regular expression operands without crashing", function() {
spyOn(console, 'log');
// We don't really care about the results. Just don't get RSoD.
expect(() => wiki.filterTiddlers("[all/current/]")).not.toThrow();
expect(() => wiki.filterTiddlers("[prefix/anything/]")).not.toThrow();
expect(() => wiki.filterTiddlers("[title/anything/]")).not.toThrow();
expect(() => wiki.filterTiddlers("[/anything/]")).not.toThrow();
expect(() => wiki.filterTiddlers("[//]")).not.toThrow();
});
it("should handle the prefix operator", function() {
expect(wiki.filterTiddlers("[prefix[Tiddler]]").join(",")).toBe("TiddlerOne,Tiddler Three");

View File

@@ -419,22 +419,6 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
// Prepend the position in the list using the index and length variables
expect(wiki.filterTiddlers("[tag[shopping]] :map[get[title]addprefix[-]addprefix<length>addprefix[of]addprefix<index>]").join(",")).toBe("0of4-Brownies,1of4-Chick Peas,2of4-Milk,3of4-Rice Pudding");
});
it("should handle macro parameters for filter run prefixes",function() {
var widget = require("$:/core/modules/widgets/widget.js");
var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] },
{ wiki:wiki, document:$tw.document});
rootWidget.makeChildWidgets();
var anchorWidget = rootWidget.children[0];
rootWidget.setVariable("greet","Hello $name$",[{name:"name"}],true);
rootWidget.setVariable("echo","$text$",[{name:"text"}],true);
// :map prefix
expect(wiki.filterTiddlers("1 :map[subfilter<greet Tom>join[ ]]",anchorWidget).join(",")).toBe("Hello Tom");
expect(wiki.filterTiddlers('[tag[shopping]] :map[<echo "$(index)$ $(currentTiddler)$">]',anchorWidget).join(",")).toBe("0 Brownies,1 Chick Peas,2 Milk,3 Rice Pudding");
// :reduce prefix
expect(wiki.filterTiddlers("1 :reduce[subfilter<greet Tom>join[ ]]",anchorWidget).join(",")).toBe("Hello Tom");
expect(wiki.filterTiddlers('[tag[shopping]] :reduce[<echo "$(accumulator)$ $(index)$ $(currentTiddler)$,">]',anchorWidget).join(",")).toBe(" 0 Brownies, 1 Chick Peas, 2 Milk, 3 Rice Pudding,");
});
});
})();

View File

@@ -1,5 +1,5 @@
created: 20211126104006194
list: [[Page and tiddler layout customisation]] [[Creating new buttons for the ViewToolbar and page controls]] [[Structuring TiddlyWiki]] Tagging [[Introduction to Lists]] [[Icon Gallery]] [[How to widen tiddlers (aka storyriver)]] [[How to turn off camel case linking]] [[How to put the last modification date in a banner]] [[How to hide the author's and other fields with CSS]] [[How to export tiddlers]] [[How to Customize TiddlyDesktop]] [[Editing Tiddlers with Vim]] [[Concatenating text and variables using macro substitution]] [[Demonstration: keyboard-driven-input Macro]] HelloThere GettingStarted Community
modified: 20211126111221917
created: 20210322152203906
list: [[Documentation Macros]] HelloThere GettingStarted Community
modified: 20210322152237613
title: $:/StoryList
type: text/vnd.tiddlywiki

View File

@@ -1,6 +1,5 @@
created: 20211031174746965
modified: 20211113163856255
tags: Widgets
modified: 20211031181800684
title: MessageHandlerWidgets
type: text/vnd.tiddlywiki

View File

@@ -1,6 +1,5 @@
created: 20211031172716741
modified: 20211113163836901
tags: Widgets
modified: 20211031174029381
title: TriggeringWidgets
type: text/vnd.tiddlywiki

View File

@@ -1,6 +1,6 @@
created: 20180626122427188
modified: 20211117234223960
tags: [[TiddlyWiki on Node.js]]
modified: 20180626134639673
tags: [[Using TiddlyWiki on Node.js]]
title: NamedCommandParameters
type: text/vnd.tiddlywiki

View File

@@ -1,5 +1,5 @@
created: 20131101111400000
modified: 20211115092001000
modified: 20210402095728684
tags: Community
title: Contributing
type: text/vnd.tiddlywiki
@@ -45,7 +45,7 @@ PR titles may also include a short prefix to indicate the subsystem to which the
! Commenting on Pull Requests
One of the principles of open source is that many pairs of eyes on the code can improve quality. So, we welcome comments and critiques of pending PRs. [[Conventional Comments|https://conventionalcomments.org]] has some techniques to help make comments as constructive and actionable as possible. Notably, they recommend prefixing a comment with a label to clarify the intention:
One of the principles of open source is that many pairs of eyes on the code can improve quality. So, we welcome comments and critiques of pending PRs. [[Conventional Comments|https://conventionalcomments.org]] has some techcniques to help make comments as constructive and actionable as possible. Notably, they recommend prefixing a comment with a label to clarify the intention:
|praise |Praises highlight something positive. Try to leave at least one of these comments per review. Do not leave false praise (which can actually be damaging). Do look for something to sincerely praise |
|nitpick |Nitpicks are small, trivial, but necessary changes. Distinguishing nitpick comments significantly helps direct the reader's attention to comments requiring more involvement |

View File

@@ -1,31 +1,28 @@
created: 20140721121924384
modified: 20220131165124489
modified: 20201222114755959
tags: Community
title: Forums
type: text/vnd.tiddlywiki
! Official Forums
! Users
The new official forum for talking about ~TiddlyWiki: requests for help, announcements of new releases and plugins, debating new features, or just sharing experiences. You can participate via the associated website, or subscribe via email.
The ~TiddlyWiki discussion groups are mailing lists for talking about ~TiddlyWiki: requests for help, announcements of new releases and plugins, debating new features, or just sharing experiences. You can participate via the associated website, or subscribe via email.
https://talk.tiddlywiki.org/
* The main ~TiddlyWiki group: https://groups.google.com/group/TiddlyWiki
*> Note that you do not need a Google Account to join the discussion groups. Subscribe by sending an email to mailto:tiddlywiki+subscribe@googlegroups.com.
** An enhanced group search facility is available on [[mail-archive.com|https://www.mail-archive.com/tiddlywiki@googlegroups.com/]]
* Watch recordings of our regular [[TiddlyWiki Hangouts]]
* Follow [[@TiddlyWiki on Twitter|http://twitter.com/TiddlyWiki]] for the latest news
* New: Join us on our live chat at https://gitter.im/TiddlyWiki/public !
* There is also a discord available at https://discord.gg/HFFZVQ8
Note that talk.tiddlywiki.org is a community run service that we host and maintain ourselves. The modest running costs are covered by community contributions.
For the convenience of existing users, we also continue to operate the original ~TiddlyWiki group (hosted on Google Groups since 2005):
https://groups.google.com/group/TiddlyWiki
! Developer Forums
! Developers
{{Developers}}
! Other Forums
New releases of TiddlyWiki, TiddlyDesktop and TiddlyFox are announced via the discussion groups and [[Twitter|https://twitter.com/TiddlyWiki]] (you can also subscribe to an Atom/RSS feed of [[TiddlyWiki releases from GitHub|https://github.com/jermolene/tiddlywiki5/releases.atom]])
* [[TiddlyWiki Subreddit|https://www.reddit.com/r/TiddlyWiki5/]]
* Chat with Gitter at https://gitter.im/TiddlyWiki/public !
* Chat on Discord at https://discord.gg/HFFZVQ8
!! Documentation
! Documentation
There is also a discussion group specifically for discussing TiddlyWiki documentation improvement initiatives: https://groups.google.com/group/tiddlywikidocs

View File

@@ -1,6 +1,6 @@
created: 20210204010508263
modified: 20211113225941563
tags: Images SVG Icons [[Other Resources]]
modified: 20210204010941713
tags: Images SVG Icons
title: "TW Icons" by morosanuae
type: text/vnd.tiddlywiki
url: https://morosanuae.github.io/tw-icons

View File

@@ -1,10 +1,10 @@
created: 20130823091700000
modified: 20211124214214045
modified: 20140912150339263
tags: Community Videos
title: TiddlyWiki Hangouts
type: text/vnd.tiddlywiki
The TiddlyWiki community has held many Google Hangouts over the years. They are announced in the [[TiddlyWiki Google group|https://groups.google.com/d/forum/tiddlywiki]] and on the [[TiddlyWiki Twitter account|https://twitter.com/TiddlyWiki]].
The TiddlyWiki community holds regular Google Hangouts, usually every Tuesday from 4pm to 6pm (UK time). They are announced in the [[TiddlyWiki Google group|https://groups.google.com/d/forum/tiddlywiki]] and on the [[TiddlyWiki Twitter account|https://twitter.com/TiddlyWiki]].
Past Hangouts are archived in this ~YouTube playlist:

View File

@@ -5,8 +5,8 @@ created: 20141122093837330
delivery: Web Service
description: Free online service that you can also host yourself
method: sync
modified: 20211113010826610
tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera PHP Safari Saving Windows iOS Edge [[Community Editions]] [[Other Resources]]
modified: 20210106151027179
tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera PHP [[Other resources]] Safari Saving Windows iOS Edge [[Community Editions]]
title: "Noteself" by Danielo Rodríguez
type: text/vnd.tiddlywiki
url: https://noteself.github.io/

View File

@@ -1,6 +1,6 @@
created: 20200907161522189
modified: 20211113230558637
tags: Resources [[Other Resources]]
modified: 20200907162234327
tags: Resources
title: "Reveal.js" by Devin Weaver
type: text/vnd.tiddlywiki
url: https://sukima.github.io/tiddlywiki-reveal-js/

View File

@@ -1,6 +1,6 @@
created: 20150602084548184
modified: 20211113010652022
tags: [[Community Plugins]]
modified: 20210106151027028
tags: [[Community Plugns]]
title: "Encrypt single tiddler plugin" by Danielo Rodriguez
type: text/vnd.tiddlywiki
url: http://danielorodriguez.com/TW5-EncryptTiddlerPlugin/

View File

@@ -1,6 +1,6 @@
created: 20141122093837330
modified: 20211114205057710
tags: [[Community Plugins]] [[Other Resources]]
modified: 20210106151027589
tags: [[Community Resources]]
title: TiddlyMap Plugin by Felix Küppers
type: text/vnd.tiddlywiki
url: http://tiddlymap.org

View File

@@ -1,6 +1,6 @@
created: 20140315085406905
modified: 20211114205310834
tags: [[Other Resources]] Tutorials [[Community Plugins]]
modified: 20210106151027357
tags: [[Other Resources]] Tutorials [[Community plugins]]
title: "TW5 Magick" by Stephan Hradek
type: text/vnd.tiddlywiki
url: http://tw5magick.tiddlyspot.com/

View File

@@ -1,6 +1,6 @@
created: 20180309160958926
modified: 20211113010607278
tags: [[Other Resources]]
modified: 20210106151027021
tags: [[Other Resourches]]
title: "Dynamic Tables" by Jed Carty
type: text/vnd.tiddlywiki
url: http://ooktech.com/jed/ExampleWikis/DynamicTables/

View File

@@ -1,7 +1,7 @@
created: 20161226165024380
creator: Matt Lauber
modified: 20211113230709926
tags: [[Other Resources]]
modified: 20211008161027226
tags: [[Other resources]]
title: "TiddlyServer" by Matt Lauber
type: text/vnd.tiddlywiki
url: https://github.com/mklauber/TiddlyServer/releases/

View File

@@ -1,6 +1,6 @@
created: 20171219165418434
modified: 20211113230637633
tags: [[Other Resources]]
modified: 20210106151027169
tags: [[Other resources]]
title: "muritest" by Simon Huber
type: text/vnd.tiddlywiki
url: http://muritest.tiddlyspot.com

View File

@@ -1,47 +0,0 @@
created: 20211201100326006
modified: 20211206164704335
tags: Concepts
title: Cascades
type: text/vnd.tiddlywiki
!! Introduction
Cascades are a key mechanism used to construct and customise TiddlyWiki's user interface.
<<.tip "See [[Customising TiddlyWiki's user interface]] for an overview of all the customisation mechanisms">>
!! How cascades work
Cascades provide a means to select one of multiple values based on flexible, extensible criteria. They can be thought of as a list of conditions that are evaluated in turn until one of them matches.
Each cascade is defined by a special tag which identifies the tiddlers containing the conditions to be matched. The [[Order of Tagged Tiddlers]] determines the order in which the conditions are processed, and provides the means for arranging new rules at specific points in the cascade.
The conditions are defined by a [[Filter Expression]] in the text field. The filters are evaluated with the list of input titles set to the title of the tiddler to be considered. The `currentTiddler` variable is also set to the title of the tiddler to be considered.
If the filter returns no result then that result will be ignored and the cascade proceeds to test the next condition. If the filter expression does return at least one result then it serves as the result of the entire cascade.
The [[Cascade Filter Run Prefix]] provides the implementation of the underlying logic.
!! Example
The [[Story Tiddler Template Cascade]] contains the logic for determining a tiddler should be displayed as an editable draft or in view mode. By default, it consists of two tiddlers containing the following list of rules:
# `[is[draft]then{$:/config/ui/EditTemplate}]` if it is a draft tiddler, use the template title given in the tiddler $:/config/ui/EditTemplate
# `[{$:/config/ui/ViewTemplate}] `  otherwise, use the template title given in the tiddler $:/config/ui/ViewTemplate
!! Usage in the core
The TiddlyWiki core uses cascades to choose the following elements:
|[[Story Tiddler Template Cascade]] |The template used to display a particular tiddler in the story river. By default, the edit template is chosen for draft tiddlers, and the view template for others |
|[[Tiddler Icon Cascade]] |The optional icon associated with a particular tiddler (displayed alongside the title) |
|[[Tiddler Colour Cascade]] |The optional colour associated with a particular tiddler (used to colour the tiddler icon and if the tiddler is used as a tag also provides the colour for the tag pill) |
|[[View Template Title Cascade]] |The template used to display the title of a particular tiddler (used by the default view template to display the tiddler title) |
|[[View Template Body Cascade]] |The template used to display the view mode body of a particular tiddler (used by the default view template to display the tiddler body) |
|[[Edit Template Body Cascade]] |The template used to display the edit mode body of a particular tiddler (used by the default edit template to display the tiddler body editor) |
You can see the current settings for each cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' tab.
!! See Also
<<list-links "[tag[Cascades]]">>

View File

@@ -1,10 +1,8 @@
color: #FF8383
created: 20130825144700000
list: Cascades ColourPalettes Commands [[Current Tiddler]] DataTiddlers [[Date Fields]] DefaultTiddlers DictionaryTiddlers ExternalImages Filters [[Hard and Soft Links]] JSONTiddlers [[Keyboard Shortcut Tiddler]] Macros Messages Modules PermaLinks Plugins Pragma [[Railroad Diagrams]] ShadowTiddlers [[Story River]] SystemTags SystemTiddlers Tagging TemplateTiddlers TextReference TiddlerFields TiddlerLinks Tiddlers TiddlyWiki TiddlyWiki5 [[Title List]] [[Title Selection]] Transclusion Variables Widgets Wiki WikiText
modified: 20211201100624625
tags: Reference
created: 201308251447
modified: 201308251447
title: Concepts
type: text/vnd.tiddlywiki
tags: Reference
These are the concepts underlying TiddlyWiki. Understanding how these ideas fit together is the key to getting the most from TiddlyWiki.

View File

@@ -1,16 +0,0 @@
created: 20211206161652630
modified: 20211206161959460
tags: Cascades
title: Edit Template Body Cascade
type: text/vnd.tiddlywiki
The edit template body cascade is a [[cascade|Cascades]] used by the default edit template to choose the template for displaying the tiddler body.
The default edit template body cascade consists of:
# If the tiddler has the field ''_canonical_uri'' then use the template $:/core/ui/EditTemplate/body/canonical-uri to display the remote URL
# Otherwise, use the template $:/core/ui/EditTemplate/body/default which provides the default editing interface
You can see the current settings for the view template body cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' -> ''Edit Template Body'' tab.
<<list-links "[tag[Edit Template Body Cascade]]">>

View File

@@ -1,5 +1,5 @@
created: 20140211171341271
modified: 20220128112317724
modified: 20200103092706002
tags: Concepts Reference
title: Macros
type: text/vnd.tiddlywiki
@@ -14,6 +14,8 @@ They are created using the `\define` [[pragma|Pragma]]. (Behind the scenes, this
The snippet and its incoming parameter values are treated as simple strings of characters with no WikiText meaning, at least until the placeholders have been filled in and the macro call has returned. This means that a macro can assemble and return the complete syntax of a ~WikiText component, such as a [[link|Linking in WikiText]]. (See [[Transclusion and Substitution]] for further discussion of this.)
The string returned by a macro call is parsed separately from any surrounding ~WikiText components. So a safe way to insert a special character sequence (such as `[[` or `<`) without triggering its normal ~WikiText meaning is to wrap it in a macro.
Within a snippet itself, the only markup detected is `$name$` (a placeholder for a macro parameter) and `$(name)$` (a placeholder for a [[variable|Variables]]).
The <<.mlink dumpvariables>> macro lists all variables (including macros) that are available at that position in the widget tree.

View File

@@ -1,10 +1,10 @@
created: 20140226083311937
modified: 20211117042057208
modified: 20140226090209479
tags: Concepts Reference
title: Messages
type: text/vnd.tiddlywiki
Widget ''messages'' are generated by [[Widgets]] in response to user actions. Messages have a <<.param name>>, an optional primary <<.param parameter>>, and one or more optional named parameters. These messages travel up the widget tree where they are handled by ancestor widgets or the core itself.
Widget messages are generated by widgets in response to user actions. They flow up the widget tree until they are handled by an ancestor widget.
The following widget messages are implemented by the core:

View File

@@ -1,6 +1,6 @@
created: 20131129162847412
modified: 20211121031330912
tags: Modules Definitions
modified: 20150917193804197
tags: Modules
title: ModuleType
type: text/vnd.tiddlywiki

View File

@@ -1,5 +1,5 @@
created: 20150124125646000
modified: 20211127140005352
modified: 20170328161702062
tags: Tagging
title: Order of Tagged Tiddlers
type: text/vnd.tiddlywiki

View File

@@ -1,6 +1,6 @@
created: 20150219175930000
modified: 20220122182842041
tags: Concepts [[WikiText Parser Modes]]
modified: 20180928145730028
tags: Concepts
title: Pragma
type: text/vnd.tiddlywiki

View File

@@ -1,6 +1,5 @@
created: 20150105133800000
modified: 20211117212441252
tags: Concepts
modified: 20150124181306000
title: Railroad Diagrams
<<.def "Railroad diagrams">>, sometimes called <<.def "syntax diagrams">>, are a visual way of explaining the syntax rules of a computer language. Reading one is like reading a public transport map.

View File

@@ -1,16 +0,0 @@
created: 20211206132047986
modified: 20211206155818924
tags: Cascades
title: Story Tiddler Template Cascade
type: text/vnd.tiddlywiki
The story tiddler template cascade is a [[cascade|Cascades]] used to choose which [[Story Tiddler Template]] should be used for a particular tiddler.
The default story tiddler template cascade consists of:
# If the tiddler is a draft tiddler, use the template title given in the tiddler $:/config/ui/EditTemplate
# Otherwise, use the template title given in the tiddler $:/config/ui/ViewTemplate
You can see the current settings for the story tiddler template cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' -> ''Story Tiddler'' tab.
<<list-links "[tag[Story Tiddler Template Cascade]]">>

View File

@@ -1,13 +0,0 @@
created: 20211204122044198
modified: 20211206133756716
tags: Concepts
title: Story Tiddler Template
type: text/vnd.tiddlywiki
"Story tiddler template" refers to the template used to display a tiddler within the story river.
The [[Story Tiddler Template Cascade]] is used to choose the template to be used for a particular tiddler. By default, the edit template is used for tiddlers in draft mode, and the view template used otherwise.
See also:
<<list-links "[tag[Story Tiddler Template]]">>

View File

@@ -1,5 +1,5 @@
created: 20141228094500000
modified: 20211127135914596
modified: 20150917193731240
tags: Tagging
title: TagTiddlers
type: text/vnd.tiddlywiki

View File

@@ -1,16 +0,0 @@
created: 20211206160300525
modified: 20211206165301231
tags: Cascades
title: Tiddler Colour Cascade
type: text/vnd.tiddlywiki
The tiddler colour cascade is a [[cascade|Cascades]] used to choose which colour should be used for a particular tiddler.
The default tiddler colour cascade consists of:
# If the tiddler has a ''color'' field, use the value as the colour
# If the tiddler $:/config/DefaultTiddlerColour exists, use the value as the colour
You can see the current settings for the tiddler colour cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' -> ''Tiddler Colour'' tab.
<<list-links "[tag[Tiddler Colour Cascade]]">>

View File

@@ -1,16 +0,0 @@
created: 20211206154017669
modified: 20211206160003647
tags: Cascades
title: Tiddler Icon Cascade
type: text/vnd.tiddlywiki
The tiddler icon cascade is a [[cascade|Cascades]] used to choose which icon should be used for a particular tiddler.
The default tiddler icon cascade consists of:
# If the tiddler has an ''icon'' field, use the value as the title of the icon tiddler
# If the tiddler $:/config/DefaultTiddlerIcon exists, use the value as the title of the icon tiddler
You can see the current settings for the tiddler icon cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' -> ''Tiddler Icon'' tab.
<<list-links "[tag[Tiddler Icon Cascade]]">>

View File

@@ -1,5 +1,5 @@
created: 20130825213300000
modified: 20220109101407050
modified: 20191206152031468
tags: Concepts
title: TiddlerFields
type: text/vnd.tiddlywiki
@@ -25,7 +25,6 @@ Other fields used by the core are:
|!Field Name |!Description |
|`class` |<<lingo class>> |
|`code-body` |<<.from-version "5.2.1">> <<lingo code-body>> |
|`color` |<<lingo color>> |
|`description` |<<lingo description>> |
|`draft.of` |<<lingo draft.of>> |

View File

@@ -1,19 +0,0 @@
created: 20211206161124327
modified: 20211206161613268
tags: Cascades
title: View Template Body Cascade
type: text/vnd.tiddlywiki
The view template body cascade is a [[cascade|Cascades]] used by the default view template to choose the template for displaying the tiddler body.
The default view template body cascade consists of:
# If the tiddler title starts with any of a list of known system tiddler prefixes, use the template $:/core/ui/ViewTemplate/body/code to display the body as preformatted code
# If the tiddler has the field ''plugin-type'' set to ''import'' then use the template $:/core/ui/ViewTemplate/body/import which displays the custom import user interface
# If the tiddler has the field ''plugin-type'' then use the template $:/core/ui/ViewTemplate/body/plugin to display the plugin information badge
# If the tiddler has the field ''hide-body'' set to ''yes'' then use the template $:/core/ui/ViewTemplate/body/blank to hide the body
# Otherwise, use the default template $:/core/ui/ViewTemplate/body/default
You can see the current settings for the view template body cascade in $:/ControlPanel under the ''Info'' -> ''Advanced'' -> ''Cascades'' -> ''View Template Body'' tab.
<<list-links "[tag[View Template Body Cascade]]">>

Some files were not shown because too many files have changed in this diff Show More