1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-02-13 21:49:50 +00:00

Compare commits

...

45 Commits

Author SHA1 Message Date
jeremy@jermolene.com
995ab34ee0 First commit 2022-10-01 10:04:42 +01:00
jeremy@jermolene.com
8d1e6b5d23 Test plugin should run tests in shadow tiddlers
Missed off #6961, preventing the tests introduced there from running
2022-10-01 10:03:50 +01:00
jeremy@jermolene.com
1df4c29d73 Relax the restriction on the let widget being unable to create variables starting with a dollar 2022-10-01 09:47:26 +01:00
jeremy@jermolene.com
81e4745c56 Update release note contributors list 2022-09-24 14:23:36 +01:00
jeremy@jermolene.com
87597ea273 Update release note 2022-09-24 14:20:30 +01:00
Jeremy Ruston
4e9267ea58 Introduce genesis widget (#6961)
* Initial Commit

* Fix version number

* Fix docs date
2022-09-24 14:07:42 +01:00
jeremy@jermolene.com
dd66fcc759 Merge branch 'tiddlywiki-com' 2022-09-24 11:06:39 +01:00
jeremy@jermolene.com
8ebb9ef442 Typo from a981f8ccfe
Fixes #6955
2022-09-24 10:55:22 +01:00
jeremy@jermolene.com
81ac987484 Optimise variable prototype chain handling
With this improvement and 53d229592d I'm measuring a 10-15% performance improvement between v5.2.3 and master using https://github.com/Jermolene/tiddlywiki-performance-test-rig
2022-09-24 08:28:16 +01:00
jeremy@jermolene.com
0a00da6db9 Optimise fake dom
Object.setPrototypeOf() appears to be significantly faster
2022-09-23 18:09:45 +01:00
jeremy@jermolene.com
53d229592d Optimise wiki.getTiddler() 2022-09-23 18:09:16 +01:00
jeremy@jermolene.com
166a156584 Fix typo: Safe mode should prevent globally disabling parser rules 2022-09-23 18:08:28 +01:00
jeremy@jermolene.com
c5d3d4c26e Disable wiki indexers in safe mode 2022-09-23 18:07:46 +01:00
Robin Munn
51bdf60ee8 Fix bug when using built-in list field as listField parameter to checkbox widget (#6897)
* Fix bug with checkbox widget and `list` field

The `list` field is stored as a list and frozen against modifications,
and getFieldList() returns it directly without creating a copy. So
before we modify it, we need to make a copy so we're not modifying a
frozen list. This bug doesn't manifest with custom fields, which are
stored as strings, only with the built-in `list` field.

* Fix checkboxes referencing non-existent tiddlers

This fixes the "tiddler is undefined" error when a checkbox's listField
property references a tiddler that doesn't (yet) exist.

* Better logic for checkbox listField handling

If the field contains an array, then it's almost certainly referenced
elsewhere and needs a defensive copy made. If it contained a string,
then it's safe to modify without making a defensive copy.
2022-09-22 18:52:55 +01:00
jeremy@jermolene.com
50f54ba6ca Merge branch 'tiddlywiki-com' 2022-09-22 10:34:41 +01:00
jeremy@jermolene.com
1a0ab68dec Complete fix for a981f8ccfe 2022-09-22 10:34:27 +01:00
jeremy@jermolene.com
bb67f96562 Merge branch 'tiddlywiki-com' 2022-09-21 09:32:33 +01:00
jeremy@jermolene.com
a981f8ccfe Partial fix for wikitext example macros
They don't work when the src text contains variable substitution syntax.
2022-09-21 09:32:18 +01:00
白宦成
859d15a446 Signing the CLA (#6951) 2022-09-17 16:52:05 +01:00
Cameron Fischer
debfd42d51 Log message not to have spaces and <empty string> (#6947) 2022-09-15 12:10:33 +01:00
twMat
fe365354d0 [doc] Update WidgetMessage: tm-new-tiddler (#6945)
...
2022-09-13 17:20:28 +01:00
jeremy@jermolene.com
d825f1c875 Use view template body cascade for the default preview 2022-09-10 11:01:29 +01:00
jeremy@jermolene.com
fe74a776e9 Docs: Add note for retrieving system tiddlers via HTTP under Node.js
See #6866
2022-09-09 10:02:26 +01:00
Roma Hicks
93e1a632b8 Updated URL to new public site. (#6496) 2022-09-05 18:04:47 +01:00
jeremy@jermolene.com
9b7edfc1a7 Revert changes to parse tree preview
This implementation requires #6666
2022-09-03 10:55:15 +01:00
jeremy@jermolene.com
3b2c64a85b Update release note 2022-09-02 21:28:32 +01:00
Jeremy Ruston
35b9faaa89 JSON Filter Operators (Revised Attempt) (#6936)
* First commit

Cherry-picked from #6666

* Adjust release version number

Just in case we decide to make a release before we merge #6666
2022-09-02 18:15:45 +01:00
tw-FRed
11b258a14b Fix tag pills style (#6934) 2022-09-01 08:38:26 +01:00
Bram Chen
7652aa5fed Update chinese translations (#6935)
* Add Hint and Caption of the delete button in the AdvancedSearch filter results
* Add confirm messages for the above deleting action
2022-09-01 08:03:37 +01:00
jeremy@jermolene.com
d62a16ee46 iPhone/iPad: Prevent long presses on tiddlylinks from triggering a preview 2022-08-31 17:44:31 +01:00
Xavier Cazin
0b1fc8e574 Make dialogs over deleting AdvancedSearch filter results translatable (#6933)
* Add fr-FR strings over deleting AvancedSearch filter results

* Add default strings over deleting AvancedSearch filter results

* Make dialogs over deleting results from AdvancedSearch filters translatable
2022-08-31 17:32:55 +01:00
jeremy@jermolene.com
127f660c91 Edit widget: remove default text "Type the text for the tiddler 'foo'"
Fixes #6152
2022-08-28 15:12:51 +01:00
Jeremy Ruston
668f443fc2 Fix prerelease version string 2022-08-19 13:14:11 +00:00
Jeremy Ruston
c8ad385947 Docs: Update code of conduct 2022-08-19 11:15:57 +00:00
Marxsal
c1f6e02d14 Fix missing links in Getting Started. (#6900)
* Fix empty links in Getting Started.

* Remove standalone TH reference and combine lines.
2022-08-19 08:14:04 +01:00
jeremy@jermolene.com
f0423c20b9 Merge branch 'tiddlywiki-com' 2022-08-17 18:11:12 +01:00
Mario Pietsch
953b89fd6b CSS: Make input and button elements consistent for all browsers (#6910) 2022-08-17 14:54:15 +01:00
Bram Chen
f87ab06414 Update chinese language files (#6895)
* Change core GettingStarted tiddler table layout
* Revise wording
2022-08-10 10:06:57 +02:00
Mario Pietsch
2ff5bd5a0f Fix removing a field with empty name (#6888)
* allow us to remove a field with empty key

* fix typo in if clause
2022-08-09 18:44:45 +02:00
Mario Pietsch
d7b9e6fb02 Getting started new table layout (#6894)
* change core GettingStarted tiddler table layout

* rename tc-table-no-grid to tc-table-no-border
2022-08-09 18:42:01 +02:00
BALLOON | FU-SEN
8420f8430f Minor adjustments to Japanese language files (#6884)
Since there was a mixture of "Desumasu-style"(ですます調) and "Dearu-style"(である調), the unification (that is unique to Japanese)
2022-08-06 11:07:47 +02:00
Mario Pietsch
a572979cc4 Add global option to show default text below the edit textarea (#6882) 2022-08-05 17:16:39 +02:00
Guang Li
90d6a0f1a6 Update readme.tid (#6883) 2022-08-05 16:59:53 +02:00
twMat
406dbd0883 Update Releases.tid (#6880) 2022-08-04 19:18:06 +01:00
jeremy@jermolene.com
3fd2cfc339 Preparing for v5.2.4
Note that we currently only plan to release v5.2.4 if there's an issue with v5.2.3, and that the next release version will be v5.3.0
2022-08-02 17:31:20 +01:00
72 changed files with 1412 additions and 168 deletions

View File

@@ -1230,13 +1230,16 @@ $tw.Wiki = function(options) {
this.getTiddler = function(title) {
if(title) {
var t = tiddlers[title];
if(t instanceof $tw.Tiddler) {
if(t !== undefined) {
return t;
} else if(title !== undefined && shadowTiddlers[title]) {
return shadowTiddlers[title].tiddler;
} else {
var s = shadowTiddlers[title];
if(s !== undefined) {
return s.tiddler;
}
}
return undefined;
}
return undefined;
};
// Get an array of all tiddler titles
@@ -2416,7 +2419,7 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("application/epub+zip","base64",".epub");
$tw.utils.registerFileType("application/octet-stream","base64",".octet-stream");
// Create the wiki store for the app
$tw.wiki = new $tw.Wiki();
$tw.wiki = new $tw.Wiki($tw.safeMode && {enableIndexers: []});
// Install built in tiddler fields modules
$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");
// Install the tiddler deserializer modules

View File

@@ -18,6 +18,8 @@ CopyToClipboard/Caption: copy to clipboard
CopyToClipboard/Hint: Copy this text to the clipboard
Delete/Caption: delete
Delete/Hint: Delete this tiddler
DeleteTiddlers/Caption: delete tiddlers
DeleteTiddlers/Hint: Delete tiddlers
Edit/Caption: edit
Edit/Hint: Edit this tiddler
Encryption/Caption: encryption

View File

@@ -9,9 +9,10 @@ Before you start storing important information in ~TiddlyWiki it is vital to mak
<div class="tc-control-panel">
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div>
See the [[control panel|$:/ControlPanel]] for more options.

View File

@@ -8,6 +8,7 @@ CloseAll/Button: close all
ColourPicker/Recent: Recent:
ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddlers: Are you sure you wish to delete <<resultCount>> tiddler(s)?
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"?
ConfirmAction: Do you wish to proceed?

View File

@@ -115,7 +115,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
// Otherwise, we need to construct a default value for the editor
switch(this.editField) {
case "text":
value = "Type the text for the tiddler '" + this.editTitle + "'";
value = "";
type = "text/vnd.tiddlywiki";
break;
case "title":

View File

@@ -12,6 +12,9 @@ Adds tiddler filtering methods to the $tw.Wiki object.
/*global $tw: false */
"use strict";
/* Maximum permitted filter recursion depth */
var MAX_FILTER_DEPTH = 300;
/*
Parses an operation (i.e. a run) within a filter string
operators: Array of array of operator nodes into which results should be inserted
@@ -328,7 +331,7 @@ exports.compileFilter = function(filterString) {
})());
});
// Return a function that applies the operations to a source iterator of tiddler titles
var compiled = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
var fnMeasured = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
if(!source) {
source = self.each;
} else if(typeof source === "object") { // Array or hashmap
@@ -338,9 +341,15 @@ exports.compileFilter = function(filterString) {
widget = $tw.rootWidget;
}
var results = new $tw.utils.LinkedList();
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,widget);
});
self.filterRecursionCount = (self.filterRecursionCount || 0) + 1;
if(self.filterRecursionCount < MAX_FILTER_DEPTH) {
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,widget);
});
} else {
results.push("/**-- Excessive filter recursion --**/");
}
self.filterRecursionCount = self.filterRecursionCount - 1;
return results.toArray();
});
if(this.filterCacheCount >= 2000) {
@@ -350,9 +359,9 @@ exports.compileFilter = function(filterString) {
this.filterCache = Object.create(null);
this.filterCacheCount = 0;
}
this.filterCache[filterString] = compiled;
this.filterCache[filterString] = fnMeasured;
this.filterCacheCount++;
return compiled;
return fnMeasured;
};
})();

View File

@@ -0,0 +1,35 @@
/*\
title: $:/core/modules/filters/format/json.js
type: application/javascript
module-type: formatfilteroperator
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.json = function(source,operand,options) {
var results = [],
spaces = null;
if(operand) {
spaces = /^\d+$/.test(operand) ? parseInt(operand,10) : operand;
}
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title);
try {
data = JSON.parse(title);
} catch(e) {
data = undefined;
}
if(data !== undefined) {
results.push(JSON.stringify(data,null,spaces));
}
});
return results;
};
})();

View File

@@ -0,0 +1,153 @@
/*\
title: $:/core/modules/filters/json-ops.js
type: application/javascript
module-type: filteroperator
Filter operators for JSON operations
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports["jsonget"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemValueAsString(data,operator.operands);
if(item !== undefined) {
results.push(item);
}
}
});
return results;
};
exports["jsonindexes"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemKeysAsStrings(data,operator.operands);
if(item !== undefined) {
results.push.apply(results,item);
}
}
});
return results;
};
exports["jsontype"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemType(data,operator.operands);
if(item !== undefined) {
results.push(item);
}
}
});
return results;
};
/*
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItemValueAsString(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item as a string
return convertDataItemValueToString(item);
}
/*
Given a JSON data structure and an array of index strings, return an array of the string representation of the keys of the item at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItemKeysAsStrings(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item keys as a string
return convertDataItemKeysToStrings(item);
}
/*
Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined
*/
function convertDataItemValueToString(item) {
// Return the item as a string
if(item === undefined) {
return item;
}
if(typeof item === "object") {
return JSON.stringify(item);
}
return item.toString();
}
/*
Return an array of the string representation of the keys of a data item, or "undefined" if the item is undefined
*/
function convertDataItemKeysToStrings(item) {
// Return the item as a string
if(item === undefined) {
return item;
} else if(typeof item === "object") {
if(item === null) {
return [];
}
var results = [];
if($tw.utils.isArray(item)) {
for(var i=0; i<item.length; i++) {
results.push(i.toString());
}
return results;
} else {
$tw.utils.each(Object.keys(item).sort(),function(key) {
results.push(key);
});
return results;
}
}
return [];
}
function getDataItemType(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item type
if(item === undefined) {
return item;
} else if(item === null) {
return "null";
} else if($tw.utils.isArray(item)) {
return "array";
} else if(typeof item === "object") {
return "object";
} else {
return typeof item;
}
}
/*
Given a JSON data structure and an array of index strings, return the value at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItem(data,indexes) {
if(indexes.length === 0 || (indexes.length === 1 && indexes[0] === "")) {
return data;
}
// Get the item
var item = data;
for(var i=0; i<indexes.length; i++) {
if(item !== undefined) {
item = item[indexes[i]];
}
}
return item;
}
})();

View File

@@ -116,7 +116,7 @@ WikiParser.prototype.loadRemoteTiddler = function(url) {
*/
WikiParser.prototype.setupRules = function(proto,configPrefix) {
var self = this;
if(!$tw.safemode) {
if(!$tw.safeMode) {
$tw.utils.each(proto,function(object,name) {
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
delete proto[name];

View File

@@ -42,7 +42,7 @@ var TW_TextNode = function(text) {
this.textContent = text + "";
};
TW_TextNode.prototype = Object.create(TW_Node.prototype);
Object.setPrototypeOf(TW_TextNode,TW_Node.prototype);
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
get: function() {
@@ -67,7 +67,7 @@ var TW_Element = function(tag,namespace) {
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
};
TW_Element.prototype = Object.create(TW_Node.prototype);
Object.setPrototypeOf(TW_Element,TW_Node.prototype);
Object.defineProperty(TW_Element.prototype, "style", {
get: function() {

View File

@@ -48,7 +48,9 @@ Logger.prototype.log = function(/* args */) {
this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
}
if(console !== undefined && console.log !== undefined) {
return Function.apply.call(console.log, console, [$tw.utils.terminalColour(this.colour),this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0)).concat($tw.utils.terminalColour()));
var logMessage = [$tw.utils.terminalColour(this.colour) + this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0));
logMessage[logMessage.length-1] += $tw.utils.terminalColour();
return Function.apply.call(console.log, console, logMessage);
}
}
};

View File

@@ -12,12 +12,26 @@ Parse tree utility functions.
/*global $tw: false */
"use strict";
/*
Add attribute to parse tree node
Can be invoked as (node,name,value) or (node,attr)
*/
exports.addAttributeToParseTreeNode = function(node,name,value) {
var attribute = {name: name, type: "string", value: value};
var attribute = typeof name === "object" ? name : {name: name, type: "string", value: value};
name = attribute.name;
node.attributes = node.attributes || {};
node.orderedAttributes = node.orderedAttributes || [];
node.attributes[name] = attribute;
if(node.orderedAttributes) {
var foundIndex = -1;
$tw.utils.each(node.orderedAttributes,function(attr,index) {
if(attr.name === name) {
foundIndex = index;
}
});
if(foundIndex === -1) {
node.orderedAttributes.push(attribute);
} else {
node.orderedAttributes[foundIndex] = attribute;
}
};

View File

@@ -36,7 +36,7 @@ Compute the internal state of the widget
*/
DeleteFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field");
this.actionField = this.getAttribute("$field",null);
};
/*
@@ -59,7 +59,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
tiddler = this.wiki.getTiddler(self.actionTiddler),
removeFields = {},
hasChanged = false;
if(this.actionField && tiddler) {
if((this.actionField !== null) && tiddler) {
removeFields[this.actionField] = undefined;
if(this.actionField in tiddler.fields) {
hasChanged = true;

View File

@@ -66,14 +66,14 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
CheckboxWidget.prototype.getValue = function() {
var tiddler = this.wiki.getTiddler(this.checkboxTitle);
if(tiddler || this.checkboxFilter) {
if(this.checkboxTag) {
if(tiddler && this.checkboxTag) {
if(this.checkboxInvertTag === "yes") {
return !tiddler.hasTag(this.checkboxTag);
} else {
return tiddler.hasTag(this.checkboxTag);
}
}
if(this.checkboxField || this.checkboxIndex) {
if(tiddler && (this.checkboxField || this.checkboxIndex)) {
// Same logic applies to fields and indexes
var value;
if(this.checkboxField) {
@@ -206,11 +206,18 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
}
// Set the list field (or index) if specified
if(this.checkboxListField || this.checkboxListIndex) {
var listContents, oldPos, newPos;
var fieldContents, listContents, oldPos, newPos;
if(this.checkboxListField) {
listContents = tiddler.getFieldList(this.checkboxListField);
fieldContents = tiddler ? tiddler.fields[this.checkboxListField] : undefined;
} else {
listContents = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex) || "") || [];
fieldContents = this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex);
}
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 {
listContents = $tw.utils.parseStringArray(fieldContents) || [];
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
}
oldPos = notValue ? listContents.indexOf(notValue) : -1;
newPos = value ? listContents.indexOf(value) : -1;

View File

@@ -0,0 +1,63 @@
/*\
title: $:/core/modules/widgets/error.js
type: application/javascript
module-type: widget
Error widget
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var ErrorWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
ErrorWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
ErrorWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
var message = this.getAttribute("$message","Unknown error"),
domNode = this.document.createElement("span");
domNode.appendChild(this.document.createTextNode(message));
domNode.className = "tc-error";
parent.insertBefore(domNode,nextSibling);
this.domNodes.push(domNode);
};
/*
Compute the internal state of the widget
*/
ErrorWidget.prototype.execute = function() {
// Nothing to do for a text node
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
ErrorWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$message"]) {
this.refreshSelf();
return true;
} else {
return false;
}
};
exports.error = ErrorWidget;
})();

View File

@@ -0,0 +1,108 @@
/*\
title: $:/core/modules/widgets/genesis.js
type: application/javascript
module-type: widget
Genesis widget for dynamically creating widgets
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var GenesisWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes({filterFn: function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}});
this.execute();
this.renderChildren(parent,nextSibling);
};
/*
Compute the internal state of the widget
*/
GenesisWidget.prototype.execute = function() {
var self = this;
// Collect attributes
this.genesisType = this.getAttribute("$type","element");
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
this.genesisNames = this.getAttribute("$names","");
this.genesisValues = this.getAttribute("$values","");
// Construct parse tree
var isElementWidget = this.genesisType.charAt(0) !== "$",
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
nodeTag = isElementWidget ? this.genesisType : undefined;
var parseTreeNodes = [{
type: nodeType,
tag: nodeTag,
attributes: {},
orderedAttributes: [],
children: this.parseTreeNode.children || [],
isNotRemappable: !this.genesisRemappable
}];
// Apply explicit attributes
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var name = attribute.name;
if(name.charAt(0) === "$") {
if(name.charAt(1) === "$") {
// Double $$ is changed to a single $
name = name.substr(1);
} else {
// Single dollar is ignored
return;
}
}
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name}));
});
// Apply attributes in $names/$values
this.attributeNames = [];
this.attributeValues = [];
if(this.genesisNames && this.genesisValues) {
this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
$tw.utils.each(this.attributeNames,function(varname,index) {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
});
}
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes);
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
GenesisWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(),
filterNames = this.getAttribute("$names",""),
filterValues = this.getAttribute("$values",""),
attributeNames = this.wiki.filterTiddlers(filterNames,this),
attributeValues = this.wiki.filterTiddlers(filterValues,this);
if($tw.utils.count(changedAttributes) > 0 || !$tw.utils.isArrayEqual(this.attributeNames,attributeNames) || !$tw.utils.isArrayEqual(this.attributeValues,attributeValues)) {
this.refreshSelf();
return true;
} else {
return this.refreshChildren(changedTiddlers);
}
};
exports.genesis = GenesisWidget;
})();

View File

@@ -39,7 +39,10 @@ Compute the internal state of the widget
ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var widgetPointer = this;
// Got to flush all the accumulated variables
this.variables = new this.variablesConstructor();
this.variables = Object.create(null);
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
// Get our parameters
this.filter = this.getAttribute("filter");
// Compute the filter

View File

@@ -51,11 +51,9 @@ LetWidget.prototype.computeAttributes = function() {
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var value = self.computeAttribute(attribute),
name = attribute.name;
if(name.charAt(0) !== "$") {
// Now that it's prepped, we're allowed to look this variable up
// when defining later variables
self.currentValueFor[name] = value;
}
// Now that it's prepped, we're allowed to look this variable up
// when defining later variables
self.currentValueFor[name] = value;
});
// Run through again, setting variables and looking for differences
$tw.utils.each(this.currentValueFor,function(value,name) {

View File

@@ -12,6 +12,9 @@ Widget base class
/*global $tw: false */
"use strict";
/* Maximum permitted depth of the widget tree for recursion detection */
var MAX_WIDGET_TREE_DEPTH = 1000;
/*
Create a widget object for a parse tree node
parseTreeNode: reference to the parse tree node to be rendered
@@ -38,9 +41,10 @@ Widget.prototype.initialise = function(parseTreeNode,options) {
this.parseTreeNode = parseTreeNode;
this.wiki = options.wiki;
this.parentWidget = options.parentWidget;
this.variablesConstructor = function() {};
this.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};
this.variables = new this.variablesConstructor();
this.variables = Object.create(null);
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
this.document = options.document;
this.attributes = {};
this.children = [];
@@ -357,6 +361,20 @@ Widget.prototype.assignAttributes = function(domNode,options) {
}
};
/*
Get the number of ancestor widgets for this widget
*/
Widget.prototype.getAncestorCount = function() {
if(this.ancestorCount === undefined) {
if(this.parentWidget) {
this.ancestorCount = this.parentWidget.getAncestorCount() + 1;
} else {
this.ancestorCount = 0;
}
}
return this.ancestorCount;
};
/*
Make child widgets correspondng to specified parseTreeNodes
*/
@@ -364,21 +382,29 @@ Widget.prototype.makeChildWidgets = function(parseTreeNodes,options) {
options = options || {};
this.children = [];
var self = this;
// Create set variable widgets for each variable
$tw.utils.each(options.variables,function(value,name) {
var setVariableWidget = {
type: "set",
attributes: {
name: {type: "string", value: name},
value: {type: "string", value: value}
},
children: parseTreeNodes
};
parseTreeNodes = [setVariableWidget];
});
$tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {
self.children.push(self.makeChildWidget(childNode));
});
// Check for too much recursion
if(this.getAncestorCount() > MAX_WIDGET_TREE_DEPTH) {
this.children.push(this.makeChildWidget({type: "error", attributes: {
"$message": {type: "string", value: $tw.language.getString("Error/RecursiveTransclusion")}
}}));
} else {
// Create set variable widgets for each variable
$tw.utils.each(options.variables,function(value,name) {
var setVariableWidget = {
type: "set",
attributes: {
name: {type: "string", value: name},
value: {type: "string", value: value}
},
children: parseTreeNodes
};
parseTreeNodes = [setVariableWidget];
});
// Create the child widgets
$tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {
self.children.push(self.makeChildWidget(childNode));
});
}
};
/*

View File

@@ -3,7 +3,7 @@ tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
<$button tooltip={{$:/language/Buttons/DeleteTiddlers/Hint}} popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
{{$:/core/images/delete-button}}
</$button>
</$reveal>
@@ -13,13 +13,13 @@ tags: $:/tags/AdvancedSearch/FilterButton
<div class="tc-block-dropdown tc-edit-type-dropdown">
<div class="tc-dropdown-item-plain">
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
Are you sure you wish to delete <<resultCount>> tiddler(s)?
{{$:/language/ConfirmDeleteTiddlers}}
</$set>
</div>
<div class="tc-dropdown-item-plain">
<$button class="tc-btn">
<$action-deletetiddler $filter={{$:/temp/advancedsearch}}/>
Delete these tiddlers
{{$:/language/Buttons/DeleteTiddlers/Hint}}
</$button>
</div>
</div>

View File

@@ -5,6 +5,6 @@ caption: {{$:/language/EditTemplate/Body/Preview/Type/Output}}
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]] [all[shadows+tiddlers]tag[$:/tags/Macro/View/Body]!has[draft.of]]
<$set name="tv-tiddler-preview" value="yes">
<$transclude />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
</$set>

View File

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

View File

@@ -1,33 +0,0 @@
created: 20160504080001125
modified: 20160504080318928
title: $:/core/ui/TagTemplate
type: text/vnd.tiddlywiki
\define tag-styles()
background-color:$(backgroundColor)$;
fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end
\define tag-body-inner(colour,fallbackTarget,colourA,colourB)
<$set name="foregroundColor" value=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>>
<$set name="backgroundColor" value="""$colour$""">
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-tag-label" style=<<tag-styles>>>
<$transclude tiddler={{!!icon}}/> <$view field="fr-title"><$view field="title" format="text" /></$view>
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes"><div class="tc-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
</$set>
</$set>
\end
\define tag-body(colour,palette)
<span class="tc-tag-list-item">
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/>
</span>
\end
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>

View File

@@ -0,0 +1,113 @@
created: 20220830224607117
modified: 20220830224638865
tags: $:/tags/Macro
title: $:/core/macros/list
\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage)
\whitespace trim
<$type$ class="$class$">
<$list filter="$filter$" emptyMessage=<<__emptyMessage__>>>
<$subtype$>
<$link to={{!!title}}>
<$let tv-wikilinks="no">
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$let>
</$link>
</$subtype$>
</$list>
</$type$>
\end
\define list-links-draggable-drop-actions()
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore<actionTiddler>,<currentTiddler>]"/>
\end
\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate)
\whitespace trim
<span class="tc-links-draggable-list">
<$vars targetTiddler="""$tiddler$""" targetField="""$field$""">
<$type$ class="$class$">
<$list filter="[list[$tiddler$!!$field$]]" emptyMessage=<<__emptyMessage__>>>
<$droppable actions=<<list-links-draggable-drop-actions>> tag="""$subtype$""" enable=<<tv-enable-drag-and-drop>>>
<div class="tc-droppable-placeholder"/>
<div>
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$let tv-wikilinks="no">
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$let>
</$link>
</$transclude>
</div>
</$droppable>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<list-links-draggable-drop-actions>> tag="div" enable=<<tv-enable-drag-and-drop>>>
<div class="tc-droppable-placeholder">
{{$:/core/images/blank}}
</div>
<div style="height:0.5em;"/>
</$droppable>
</$tiddler>
</$type$>
</$vars>
</span>
\end
\define list-tagged-draggable-drop-actions(tag)
\whitespace trim
<!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<__tag__>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<__tag__>tagging[]]">
<$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/>
</$list>
<!-- Save the new order to the Tag Tiddler -->
<$action-listops $tiddler=<<__tag__>> $field="list" $filter="+[enlist<order>] +[insertbefore<actionTiddler>,<currentTiddler>]"/>
<!-- Make sure the newly added item has the right tag -->
<!-- Removing this line makes dragging tags within the dropdown work as intended -->
<!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<__tag__>>/>-->
<!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag -->
<$list filter="[<actionTiddler>!contains:tags<__tag__>]">
<$fieldmangler tiddler=<<actionTiddler>>>
<$action-sendmessage $message="tm-add-tag" $param=<<__tag__>>/>
</$fieldmangler>
</$list>
</$set>
\end
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"")
\whitespace trim
<span class="tc-tagged-draggable-list">
<$set name="tag" value=<<__tag__>>>
<$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>> storyview=<<__storyview__>>>
<$elementTag$ class="tc-menu-list-item">
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
<$elementTag$ class="tc-droppable-placeholder"/>
<$elementTag$>
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$view field="fr-title">
<$view field="title"/>
</$view>
</$link>
</$transclude>
</$elementTag$>
</$droppable>
</$elementTag$>
</$list>
<$tiddler tiddler="">
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
<$elementTag$ class="tc-droppable-placeholder"/>
<$elementTag$ style="height:0.5em;">
</$elementTag$>
</$droppable>
</$tiddler>
</$set>
</span>
\end

View File

@@ -0,0 +1,39 @@
created: 20220830190922373
modified: 20220830191056761
tags: $:/tags/Macro
title: $:/core/macros/tag
\define tag-pill-styles()
background-color:$(backgroundColor)$;
fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end
<!-- 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)
<$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="fr-title" format="text"><$view tiddler=<<__tag__>> field="title" format="text" /></$view></$element-tag$>
\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$"""/>
\end
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
\whitespace trim
<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>
</span>
\end
\define tag(tag)
{{$tag$||$:/core/ui/TagTemplate}}
\end

View File

@@ -0,0 +1,25 @@
created: 20220830194301860
modified: 20220830194658750
title: $:/core/ui/TagPickerTagTemplate
\whitespace trim
<$button class=<<button-classes>> tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}>
<$list filter="[<saveTiddler>minlength[1]]">
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>]"/>
</$list>
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>> preventScroll="true"/>
</$set>
<<delete-tag-state-tiddlers>>
<$list filter="[<refreshTitle>minlength[1]]">
<$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>>/>""">
<span class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
{{||$:/core/ui/TiddlerIcon}}<$view field="fr-title" format="text"><$view field="title" format="text"/></$view>
</span>
</$wikify>
</$set>
</$button>

View File

@@ -1,6 +1,6 @@
caption: 5.2.4
created: 20220802100223020
modified: 20220802100223020
created: 20220924141149286
modified: 20220924141149286
tags: ReleaseNotes
title: Release 5.2.4
type: text/vnd.tiddlywiki
@@ -11,9 +11,17 @@ type: text/vnd.tiddlywiki
*
! Translation improvements
! Translation improvement
*
Improvements to the following translations:
* Chinese
* Japanese
Improvements to the translation features of TiddlyWiki:
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6882">> the [[Translators Edition|Translate TiddlyWiki into your language]] to add an option to display the original English text underneath the text area
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6933">> "delete" button text in $:/AdvancedSearch so that it is translatable
! Accessibility Improvements
@@ -21,11 +29,14 @@ type: text/vnd.tiddlywiki
! Usability Improvements
*
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/d62a16ee464fb9984b766b48504829a1a3eb143b">> problem with long presses on tiddler links triggering a preview on iOS/iPadOS
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6910">> consistency of button and input elements across browsers
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/d825f1c875f5e46158c9c41c8c66471138c162d1">> edit preview to use the [[View Template Body Cascade]]
! Widget Improvements
*
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6961">> new GenesisWidget that allows the dynamic construction of another widget, where the name and attributes of the new widget can be dynamically determined, without needing to be known in advance
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/127f660c91020dcbb43897d954066b31af729e74">> EditTextWidget to remove the default text "Type the text for the tiddler 'foo'"
! Filter improvements
@@ -33,7 +44,11 @@ type: text/vnd.tiddlywiki
! Hackability Improvements
*
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6936">> new operators for reading and formatting JSON data: [[jsonget Operator]], [[jsonindexes Operator]], [[jsontype Operator]] and [[format Operator]]
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/c5d3d4c26e8fe27f272dda004aec27d6b66c4f60">> safe mode to disable wiki store indexers
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/166a1565843878083fb1eba47c73b8e67b78400d">> safe mode to prevent globally disabling parser rules
! Bug Fixes
@@ -45,15 +60,29 @@ type: text/vnd.tiddlywiki
! Node.js Improvements
*
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6947">> console logging to avoid spaces and `<empty string>` message
! Performance Improvements
*
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/53d229592df76c6dd607e40be5bea4d5e063c48e">> performance of `wiki.getTiddler()`
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/81ac9874846b3ead275f67010fcfdb49f3d2f43c">> performance of variable prototype chain handling
! 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 """
bestony
BramChen
flibbles
fu-sen
Marxsal
oflg
pmario
rmunn
roma0104
tw-FRed
twMat
xcazin
""">>

View File

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

@@ -0,0 +1,15 @@
title: Filters/Recursion
description: Filter recursion detection
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
\define myfilter() [subfilter<myfilter>]
<$text text={{{ [subfilter<myfilter>] }}}/>
+
title: ExpectedResult
<p>/**-- Excessive filter recursion --**/</p>

View File

@@ -0,0 +1,14 @@
title: Genesis/DollarSigns
description: Usage of genesis widget with attributes starting with dollar signs
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<$genesis $type="$let" myvar="Kitten">(<$text text=<<myvar>>/>)</$genesis>
<$genesis $type="$let" $$myvar="Kitten">(<$text text=<<$myvar>>/>)</$genesis>
+
title: ExpectedResult
<p>(Kitten)(Kitten)</p>

View File

@@ -0,0 +1,14 @@
title: Genesis/MultipleAttributes
description: Usage of genesis widget with multiple attributes
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<$genesis $type="$let" $names="myvar other" $values="Kitten Donkey" myvar={{{ Shark }}}>(<$text text=<<myvar>>/>|<$text text=<<other>>/>)</$genesis>
<$genesis $type="$let" $names="$myvar $other" $values="Kitten Donkey" $$myvar="Shark">(<$text text=<<$myvar>>/>|<$text text=<<$other>>/>)</$genesis>
+
title: ExpectedResult
<p>(Kitten|Donkey)(Kitten|Donkey)</p>

View File

@@ -0,0 +1,14 @@
title: Genesis/Simple
description: Simple usage of genesis widget
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<$genesis $type="div">Mouse</$genesis>
<$genesis $type="div" class="tc-thing" label="Squeak">Mouse</$genesis>
+
title: ExpectedResult
<p><div>Mouse</div><div class="tc-thing" label="Squeak">Mouse</div></p>

View File

@@ -0,0 +1,13 @@
title: Transclude/Recursion
description: Transclusion recursion detection
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<$transclude $tiddler="Output"/>
+
title: ExpectedResult
<p><span class="tc-error">Recursive transclusion error in transclude widget</span></p>

View File

@@ -234,6 +234,38 @@ Tests the checkbox widget thoroughly.
},
];
// https://github.com/Jermolene/TiddlyWiki5/issues/6871
const listModeTestsWithListField = (
listModeTests
.filter(data => data.widgetText.includes("listField='colors'"))
.map(data => {
const newData = {
...data,
tiddlers: data.tiddlers.map(tiddler => ({...tiddler, list: tiddler.colors, colors: undefined})),
widgetText: data.widgetText.replace("listField='colors'", "listField='list'"),
expectedChange: {
"Colors": { list: data.expectedChange.Colors.colors.split(' ') }
},
}
return newData;
})
);
const listModeTestsWithTagsField = (
listModeTests
.filter(data => data.widgetText.includes("listField='colors'"))
.map(data => {
const newData = {
...data,
tiddlers: data.tiddlers.map(tiddler => ({...tiddler, tags: tiddler.colors, colors: undefined})),
widgetText: data.widgetText.replace("listField='colors'", "listField='tags'"),
expectedChange: {
"Colors": { tags: data.expectedChange.Colors.colors.split(' ') }
},
}
return newData;
})
);
const indexListModeTests = listModeTests.map(data => {
const newData = {...data};
const newName = data.testName.replace('list mode', 'index list mode');
@@ -453,6 +485,8 @@ Tests the checkbox widget thoroughly.
const checkboxTestData = fieldModeTests.concat(
indexModeTests,
listModeTests,
listModeTestsWithListField,
listModeTestsWithTagsField,
indexListModeTests,
filterModeTests,
);
@@ -495,7 +529,7 @@ Tests the checkbox widget thoroughly.
for (const fieldName of Object.keys(change)) {
const expectedValue = change[fieldName];
const fieldValue = tiddler.fields[fieldName];
expect(fieldValue).toBe(expectedValue);
expect(fieldValue).toEqual(expectedValue);
}
}
})

View File

@@ -0,0 +1,95 @@
/*\
title: test-json-filters.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests the JSON filters and the format:json operator
\*/
(function(){
/* jslint node: true, browser: true */
/* eslint-env node, browser, jasmine */
/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
/* global $tw, require */
"use strict";
describe("json filter tests", function() {
var wiki = new $tw.Wiki();
var tiddlers = [{
title: "First",
text: '{"a":"one","b":"","c":1.618,"d": {"e": "four","f": ["five","six",true,false,null]}}',
type: "application/json"
},{
title: "Second",
text: '["une","deux","trois"]',
type: "application/json"
},{
title: "Third",
text: "This is not JSON",
type: "text/vnd.tiddlywiki"
}];
wiki.addTiddlers(tiddlers);
it("should support the getindex operator", function() {
expect(wiki.filterTiddlers("[{First}getindex[b]]")).toEqual([]);
});
it("should support the jsonget operator", function() {
expect(wiki.filterTiddlers("[{Third}jsonget[]]")).toEqual(["This is not JSON"]);
expect(wiki.filterTiddlers("[{First}jsonget[]]")).toEqual(['{"a":"one","b":"","c":1.618,"d":{"e":"four","f":["five","six",true,false,null]}}']);
expect(wiki.filterTiddlers("[{First}jsonget[a]]")).toEqual(["one"]);
expect(wiki.filterTiddlers("[{First}jsonget[b]]")).toEqual([""]);
expect(wiki.filterTiddlers("[{First}jsonget[missing-property]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonget[d]]")).toEqual(['{"e":"four","f":["five","six",true,false,null]}']);
expect(wiki.filterTiddlers("[{First}jsonget[d]jsonget[f]]")).toEqual(['["five","six",true,false,null]']);
expect(wiki.filterTiddlers("[{First}jsonget[d],[e]]")).toEqual(["four"]);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f]]")).toEqual(['["five","six",true,false,null]']);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[0]]")).toEqual(["five"]);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[1]]")).toEqual(["six"]);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[2]]")).toEqual(["true"]);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[3]]")).toEqual(["false"]);
expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[4]]")).toEqual(["null"]);
});
it("should support the jsonindexes operator", function() {
expect(wiki.filterTiddlers("[{Second}jsonindexes[]]")).toEqual(["0","1","2"]);
expect(wiki.filterTiddlers("[{First}jsonindexes[]]")).toEqual(["a","b","c","d"]);
expect(wiki.filterTiddlers("[{First}jsonindexes[a]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[b]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d]]")).toEqual(["e","f"]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[e]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f]]")).toEqual(["0","1","2","3","4"]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f],[0]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f],[1]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f],[2]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f],[3]]")).toEqual([]);
expect(wiki.filterTiddlers("[{First}jsonindexes[d],[f],[4]]")).toEqual([]);
});
it("should support the jsontype operator", function() {
expect(wiki.filterTiddlers("[{Third}jsontype[]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[]]")).toEqual(["object"]);
expect(wiki.filterTiddlers("[{First}jsontype[a]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[b]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[c]]")).toEqual(["number"]);
expect(wiki.filterTiddlers("[{First}jsontype[d]]")).toEqual(["object"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[e]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f]]")).toEqual(["array"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f],[0]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f],[1]]")).toEqual(["string"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f],[2]]")).toEqual(["boolean"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f],[3]]")).toEqual(["boolean"]);
expect(wiki.filterTiddlers("[{First}jsontype[d],[f],[4]]")).toEqual(["null"]);
});
it("should support the format:json operator", function() {
expect(wiki.filterTiddlers("[{First}format:json[]]")).toEqual(["{\"a\":\"one\",\"b\":\"\",\"c\":1.618,\"d\":{\"e\":\"four\",\"f\":[\"five\",\"six\",true,false,null]}}"]);
expect(wiki.filterTiddlers("[{First}format:json[4]]")).toEqual(["{\n \"a\": \"one\",\n \"b\": \"\",\n \"c\": 1.618,\n \"d\": {\n \"e\": \"four\",\n \"f\": [\n \"five\",\n \"six\",\n true,\n false,\n null\n ]\n }\n}"]);
expect(wiki.filterTiddlers("[{First}format:json[ ]]")).toEqual(["{\n \"a\": \"one\",\n \"b\": \"\",\n \"c\": 1.618,\n \"d\": {\n \"e\": \"four\",\n \"f\": [\n \"five\",\n \"six\",\n true,\n false,\n null\n ]\n }\n}"]);
});
});
})();

View File

@@ -1,5 +1,5 @@
created: 20220721200137586
modified: 20220721200137586
modified: 20220819200137586
tags: [[Table of Contents]]
title: Code of Conduct
type: text/vnd.tiddlywiki
@@ -17,6 +17,7 @@ These principles guide technical and non-technical decisions, and help contribut
* We recognise that the motivation for sharing and helping is usually for appreciation, and not financial gain, and so we take care to acknowledge and ''thank the people who enrich the community by sharing what they have created''
* While we are united in our interest in TiddlyWiki, we differ in every other conceivable way. We choose to focus on what unites us, and ''avoid unnecessarily mixing contentious topics like religion and politics''
* We treat each other with respect, and start with the assumption that ''others are acting in good faith''
* We avoid discriminatory language
* We try to use our strength as a community to help others
* We avoid responding when angry or upset because we try to de-escalate conflict
* We make sure we critique ideas, not people
@@ -27,4 +28,6 @@ These principles guide technical and non-technical decisions, and help contribut
Our discussions are in English. It is not the first language of many people in the community, nor do we all share the same cultural background and reference points. So we take care to use language that is clear and unambigous, and avoid cultural references or jokes that will not be widely understood.
It is not acceptable to make jokes or other comments that discriminate by race, gender, sexuality, or other protected characteristic.
As an inclusive community, we are committed to making sure that TiddlyWiki is an accessible tool that understands the needs of people with disabilities.

View File

@@ -1,9 +1,9 @@
created: 20141230182901899
modified: 20210106151027090
modified: 20220226205227090
tags: [[Community Editions]] [[Community Plugins]]
title: "GSD5" by Roma Hicks
type: text/vnd.tiddlywiki
url: http://gsd5.tiddlyspot.com/
url: http://gsd5.tiddlyhost.com/
An adaptation of the [[TiddlyWiki powered GTD® system formerly known as MonkeyGTD|http://mgsd.tiddlyspot.com/]] for TiddlyWiki version 5.

View File

@@ -1,5 +1,5 @@
created: 20201020102735123
modified: 20210524044020645
modified: 20220611104737314
tags: [[Operator Examples]] [[format Operator]]
title: format Operator (Examples)
type: text/vnd.tiddlywiki
@@ -18,9 +18,12 @@ Modified date shown as a relative date:
A tiddler title with spaces formatted as a title list:
<<.operator-example 4 """[[Hello There]format:titlelist[]]""">>
All tiddler titles tagged with <<tag TableOfContents>> formatted as a title list :
All tiddler titles tagged with <<tag TableOfContents>> formatted as a title list:
<<.operator-example 5 """[tag[TableOfContents]format:titlelist[]]""">>
A JSON string formatted as JSON note how the JSON string is normalised to remove the duplicated properties:
<<.operator-example 6 """[[{"one":"first","one":"another","two":"second"}]format:json[]]""">>
<<.tip "To create a string to save a [[title list|Title List]] into a list field, use `format:titlelist[]` with the [[join operator|join Operator]]">>
<<.operator-example 6 """[tag[TableOfContents]format:titlelist[]join[ ]]""">>
For example, to save titles tagged `TableOfContents` to the titles field of the tiddler [[format titlelist test]]:

View File

@@ -1,6 +1,6 @@
caption: format
created: 20201020100834443
modified: 20220523075550449
modified: 20220611104737314
op-input: a [[selection of titles|Title Selection]]
op-output: input strings formatted according to the specified suffix <<.place B>>
op-parameter: optional format string for the formats
@@ -17,9 +17,10 @@ type: text/vnd.tiddlywiki
The suffix <<.place B>> is one of the following supported string formats:
|!Format |!Description |
|^`date` |The input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional operator parameter. (Defaults to "YYYY MM DD 0hh:0mm") |
|^`relativedate` |The input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters are ignored. |
|^`titlelist` |<<.from-version "5.2.0">>The input string wrapped in double square brackets if it contains a space. Appropriate for use in a [[title list|Title List]]. |
|^`date` |The input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional operator operand. (Defaults to "YYYY MM DD 0hh:0mm") |
|^`json` |<<.from-version "5.2.4">> The input string is interpreted as JSON and displayed with standard formatting. The optional operator operand specifies the number of spaces to use for indenting, or a string to use for indenting. Nothing is returned if the input string is not valid JSON |
|^`relativedate` |The input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters are ignored |
|^`titlelist` |<<.from-version "5.2.0">> The input string wrapped in double square brackets if it contains a space. Appropriate for use in a [[title list|Title List]]. |
<<.warning """The [[Title List]] format cannot reliably represent items that contain certain specific character sequences such as `]] `. Thus it should not be used where there is a possibility of such sequences occurring.""">>

View File

@@ -0,0 +1,86 @@
created: 20220611104737314
modified: 20220611104737314
tags: [[Filter Operators]] [[JSON Operators]]
title: jsonget Operator
caption: jsonget
op-purpose: retrieve the value of a property from JSON strings
op-input: a selection of JSON strings
op-parameter: one or more indexes of the property to retrieve
op-output: the values of each of the retrieved properties
<<.from-version "5.2.4">> See [[JSON in TiddlyWiki]] for background.
The <<.op jsonget>> operator is used to retrieve values from JSON data. See also the following related operators:
* <<.olink jsontype>> to retrieve the type of a JSON value
* <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array
Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`.
```
{
"a": "one",
"b": "",
"c": "three",
"d": {
"e": "four",
"f": [
"five",
"six",
true,
false,
null
],
"g": {
"x": "max",
"y": "may",
"z": "maize"
}
}
}
```
The following examples assume that this JSON data is contained in a variable called `jsondata`.
The <<.op jsonget>> operator uses multiple operands to specify the indexes of the property to retrieve:
```
[<jsondata>jsonget[a]] --> "one"
[<jsondata>jsonget[d],[e]] --> "four"
[<jsondata>jsonget[d],[f],[0]] --> "five"
```
Indexes can be dynamically composed from variables and transclusions:
```
[<jsondata>jsonget<variable>,{!!field},[0]]
```
Boolean values and null are returned as normal strings. The <<.olink jsontype>> operator can be used to retrieve a string identifying the original type. Thus:
```
[<jsondata>jsontype[a]] --> "string"
[<jsondata>jsontype[d]] --> "object"
[<jsondata>jsontype[d],[f]] --> "array"
[<jsondata>jsontype[d],[f],[2]] --> "boolean"
```
Using the <<.op jsonget>> operator to retrieve an object or an array returns a JSON string of the values. For example:
```
[<jsondata>jsonget[d],[f]] --> `["five","six",true,false,null]`
[<jsondata>jsonget[d],[g]] --> `{"x": "max","y": "may","z": "maize"}`
```
The <<.olink jsonindexes>> operator retrieves the corresponding indexes:
```
[<jsondata>jsonindexes[d],[f]] --> "0", "1", "2", "3", "4"
[<jsondata>jsonindexes[d],[g]] --> "x", "y", "z"
```
A subtlety is that the special case of a single blank operand is used to identify the root object. Thus:
```
[<jsondata>jsonindexes[]] --> "a", "b", "c", "d"
```

View File

@@ -0,0 +1,64 @@
created: 20220611104737314
modified: 20220611104737314
tags: [[Filter Operators]] [[JSON Operators]]
title: jsonindexes Operator
caption: jsonindexes
op-purpose: retrieve the value of a property from JSON strings
op-input: a selection of JSON strings
op-parameter: one or more indexes of the property to retrieve
op-output: the values of each of the retrieved properties
<<.from-version "5.2.4">> See [[JSON in TiddlyWiki]] for background.
The <<.op jsonindexes>> operator is used to retrieve the property names of JSON objects or the index names of JSON arrays. See also the following related operators:
* <<.olink jsonget>> to retrieve the values of a property in JSON data
* <<.olink jsontype>> to retrieve the type of a JSON value
Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`.
```
{
"a": "one",
"b": "",
"c": "three",
"d": {
"e": "four",
"f": [
"five",
"six",
true,
false,
null
],
"g": {
"x": "max",
"y": "may",
"z": "maize"
}
}
}
```
The following examples assume that this JSON data is contained in a variable called `jsondata`.
The <<.op jsonindexes>> operator uses multiple operands to specify the indexes of the property to retrieve:
```
[<jsondata>jsonindexes[d],[f]] --> "0", "1", "2", "3", "4"
[<jsondata>jsonindexes[d],[g]] --> "x", "y", "z"
```
Indexes can be dynamically composed from variables and transclusions:
```
[<jsondata>jsonindexes<variable>,{!!field}]
```
Retrieving the indexes of JSON properties that are not objects or arrays will return nothing.
A subtlety is that the special case of a single blank operand is used to identify the root object. Thus:
```
[<jsondata>jsonindexes[]] --> "a", "b", "c", "d"
```

View File

@@ -0,0 +1,73 @@
created: 20220611104737314
modified: 20220611104737314
tags: [[Filter Operators]] [[JSON Operators]]
title: jsontype Operator
caption: jsontype
op-purpose: retrieve the type of a property from JSON strings
op-input: a selection of JSON strings
op-parameter: one or more indexes of the property whose type is to be retrieved
op-output: the types of each of the retrieved properties
<<.from-version "5.2.4">> See [[JSON in TiddlyWiki]] for background.
The <<.op jsontype>> operator is used to retrieve the type of a property in JSON data. See also the following related operators:
* <<.olink jsonget>> to retrieve the values of a property in JSON data
* <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array
JSON supports the following data types:
* ''string'' - a Unicode string
* ''number'' - a floating point number
* ''boolean'' - Boolean value (true or false)
* ''array'' - an array of values
* ''object'' - an object of name/value pairs
* ''null'' - a special type representing a missing value
Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`.
```
{
"a": "one",
"b": "",
"c": "three",
"d": {
"e": "four",
"f": [
"five",
"six",
true,
false,
null
],
"g": {
"x": "max",
"y": "may",
"z": "maize"
}
}
}
```
The following examples assume that this JSON data is contained in a variable called `jsondata`.
The <<.op jsontype>> operator uses multiple operands to specify the indexes of the property whose type is to be retrieved:
```
[<jsondata>jsontype[a]] --> "string"
[<jsondata>jsontype[d]] --> "object"
[<jsondata>jsontype[d],[f]] --> "array"
[<jsondata>jsontype[d],[f],[2]] --> "boolean"
```
Indexes can be dynamically composed from variables and transclusions:
```
[<jsondata>jsontype<variable>,{!!field},[0]]
```
A subtlety is that the special case of a single blank operand is used to identify the root object. Thus:
```
[<jsondata>jsontype[]] --> "object"
```

View File

@@ -1,16 +1,12 @@
created: 20131129090249275
modified: 20200507203622933
modified: 20220819041016415
tags: [[Working with TiddlyWiki]]
title: GettingStarted
type: text/vnd.tiddlywiki
The easiest way to use TiddlyWiki is to sign up for a free account with [[Tiddlyhost]], an independently run community service:
The easiest way to use ~TiddlyWiki is to sign up for a free account with [[Tiddlyhost|https://tiddlyhost.com/]], an independently run community service. If you find Tiddlyhost useful, please consider [[donation or sponsorship|https://tiddlyhost.com/donate]].
https://tiddlyhost.com/
If you find Tiddlyhost useful, please consider [[donation or sponsorship|https://tiddlyhost.com/donate]].
Click here to download an empty copy of TiddlyWiki: {{$:/editions/tw5.com/snippets/download-empty-button}}
Click here to download an empty copy of ~TiddlyWiki: {{$:/editions/tw5.com/snippets/download-empty-button}}
The next step is to choose a method for saving changes. There's a wide variety of methods available, with different features and limitations. Click on the badge for a method to see more information about it. You can also click on one of the platform filters to restrict the listing to methods that work with that platform.

View File

@@ -0,0 +1,13 @@
created: 20220909094340097
modified: 20220909094340097
title: Hidden Setting: Sync System Tiddlers From Server
tags: [[Hidden Settings]]
<<.from-version "5.1.23">> Determines whether system tiddlers are synced from the server under Node.js. (Note that this is a one-way setting; system tiddlers are always synced //to// the server).
* `no` -- system tiddlers are not synced from the server (default)
* `yes` -- system tiddlers are synced from the server
Engaging sync of system tiddlers means that tiddlers such as $:/StoryList and $:/HistoryList get synced, which can lead to unexpected outcomes when multiple users are connected to the same server at the same time (it means that the story sequence is synced between all the users).
$:/config/SyncSystemTiddlersFromServer

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -22,7 +22,7 @@ The new tiddler message is usually generated with the ButtonWidget or ActionSend
! Examples
To make a button that creates new tiddlers tagged "task", create a tiddler called "TaskTemplate" with that tag, and then make your button like this:
To make a button that creates new tiddlers tagged "task", create a tiddler called "~TaskTemplate" with that tag, and then make your button like this:
```
<$button message="tm-new-tiddler" param="TaskTemplate">New Task</$button>

View File

@@ -4,6 +4,6 @@ tags: About
title: Releases
type: text/vnd.tiddlywiki
New releases of TiddlyWiki, TiddlyDesktop and TiddlyFox are announced via the [[official discussion groups|Forums]] 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]])
New releases of TiddlyWiki and TiddlyDesktop are announced via the [[official discussion groups|Forums]] 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]])
<<tabs "[[TiddlyWiki Releases]] [[TiddlyDesktop Releases]]" "TiddlyWiki Releases" "$:/state/tab">>

View File

@@ -1,5 +1,5 @@
created: 20140912140651119
modified: 20220401151525812
modified: 20220812144516626
saving-browser: Firefox Chrome Edge [[Internet Explorer]] Safari Opera [[Standalone App]]
saving-os: Windows Mac Linux Android iOS
tags: [[Working with TiddlyWiki]]
@@ -34,7 +34,7 @@ type: text/vnd.tiddlywiki
\end
<$vars stateTiddler=<<qualify "$:/state/gettingstarted">> >
Available methods for saving changes with TiddlyWiki:
Available methods for saving changes with ~TiddlyWiki:
<div class="tc-wrapper-flex">
<div class="tc-saving-sidebar">

View File

@@ -46,21 +46,17 @@ open the ''example edition'' in a new window
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
```
$src$
```
<$codeblock code=<<__src__>>/>
That renders as:
$$$text/vnd.tiddlywiki
$src$
$$$
<$macrocall $name="__src__"/>
... and the underlying HTML is:
$$$text/vnd.tiddlywiki>text/html
$src$
$$$
<$wikify name="html" text=<<__src__>> output="html">
<$codeblock code=<<html>>/>
</$wikify>
</div>
\end
@@ -69,15 +65,12 @@ $$$
<$macrocall $name="copy-to-clipboard-above-right" src=<<__src__>>/>
```
$src$
```
<$codeblock code=<<__src__>>/>
That renders as:
$$$text/vnd.tiddlywiki
$src$
$$$
<$macrocall $name="__src__"/>
</div>
\end

View File

@@ -1,5 +1,5 @@
created: 20181002131215403
modified: 2020031109590546
modified: 20220909094340097
tags: [[WebServer API]]
title: WebServer API: Get All Tiddlers
type: text/vnd.tiddlywiki
@@ -17,6 +17,8 @@ Parameters:
In order to avoid denial of service attacks with malformed filters in the default configuration the only filter that is accepted is the default filter "[all[tiddlers]!is[system]sort[title]]"; attempts to use any other filter will result in an HTTP 403 error.
<<.note "System tiddlers will not be returned by this API unless the [[Hidden Setting: Sync System Tiddlers From Server]] is explicitly switched on by setting $:/config/SyncSystemTiddlersFromServer to `yes`">>
To enable a particular filter, create a tiddler with the title "$:/config/Server/ExternalFilters/" concatenated with the filter text, and the text field set to "yes". For example, the TiddlyWeb plugin includes the following shadow tiddler to enable the filter that it requires:
```

View File

@@ -0,0 +1,17 @@
caption: error
created: 20220909111836951
modified: 20220909111836951
tags: Widgets
title: ErrorWidget
type: text/vnd.tiddlywiki
<<.from-version "5.3.0">> The <<.wlink ErrorWidget>> widget is used by the core to display error messages such as the recursion errors reported by the <<.wlink TranscludeWidget>> widget.
The <<.wlink ErrorWidget>> does not provide any useful functionality to end users. It is only required by the core for technical reasons.
! Content and Attributes
The content of the <<.wlink ErrorWidget>> widget is ignored.
|!Attribute |!Description |
|$message |The error message |

View File

@@ -0,0 +1,29 @@
caption: genesis
created: 20220924140702430
modified: 20220924140702430
tags: Widgets
title: GenesisWidget
type: text/vnd.tiddlywiki
! Introduction
<<.from-version "5.2.4">> The <<.wlink GenesisWidget>> widget allows the dynamic construction of another widget, where the name and attributes of the new widget can be dynamically determined, without needing to be known in advance.
! Content and Attributes
The content of the <<.wlink GenesisWidget>> widget is used as the content of the dynamically created widget.
|!Attribute |!Description |
|$type |The type of widget or element to create (an initial `$` indicates a widget, otherwise an HTML element will be created) |
|$names |An optional filter evaluating to the names of a list of attributes to be applied to the widget |
|$values |An optional filter evaluating to the values corresponding to the list of names specified in `$names` |
|//{other attributes starting with $}// |Other attributes starting with a single dollar sign are reserved for future use |
|//{attributes starting with $$}// |Attributes starting with two dollar signs are appplied as attributes to the output widget, but with the attribute name changed to use a single dollar sign |
|//{attributes not starting with $}// |Any other attributes that do not start with a dollar are applied as attributes to the output widget |
Note that attributes explicitly specified take precedence over attributes with the same name specified in the `$names` filter.
! Examples
<$macrocall $name='wikitext-example-without-html'
src='<$genesis $type="div" class="tc-thing" label="Squeak">Mouse</$genesis>'/>

View File

@@ -1,5 +1,6 @@
title: LetWidget
created: 20211028115900000
modified: 20221001094658854
tags: Widgets
caption: let
@@ -12,10 +13,12 @@ caption: let
The content of the <<.wid let>> widget is the scope for the value assigned to the variable.
|!Attribute |!Description |
|//{attributes not starting with $}// |Each attribute name specifies a variable name. The attribute value is assigned to the variable |
|//{attributes}// |Each attribute name specifies a variable name. The attribute value is assigned to the variable |
Attributes are evaluated in the order they are written. Attributes with the same name are allowed. Each time a duplicate attribute is encountered, it will replace the existing value set by the earlier duplicate.
<<.note """<<.from-version "5.2.4">> There is no longer any restriction on using variable names that start with the $ character.""">>
! Examples
Consider a case where you need to set multiple variables, where some depend on the evaluation of others.

View File

@@ -18,6 +18,8 @@ CopyToClipboard/Caption: copier dans le presse-papier
CopyToClipboard/Hint: Copie ce texte dans le presse-papier
Delete/Caption: supprimer
Delete/Hint: Supprime ce tiddler
DeleteTiddlers/Caption: supprimer les tiddlers
DeleteTiddlers/Hint: Supprime ces tiddlers
Edit/Caption: éditer
Edit/Hint: Édite ce tiddler
Encryption/Caption: chiffrement

View File

@@ -7,8 +7,9 @@ ClassicWarning/Upgrade/Caption: mettre à jour
CloseAll/Button: tout fermer
ColourPicker/Recent: Récent :
ConfirmCancelTiddler: Souhaitez-vous annuler les modifications apportées au tiddler « <$text text=<<title>>/> » ?
ConfirmDeleteTiddler: Souhaitez-vous supprimer le tiddler « <$text text=<<title>>/> » ?
ConfirmOverwriteTiddler: Souhaitez-vous supplanter le tiddler « <$text text=<<title>>/> » ?
ConfirmDeleteTiddler: Souhaitez-vous supprimer le tiddler « <$text text=<<title>>/> » ?
ConfirmDeleteTiddlers: Êtes-vous sûr•e de vouloir supprimer <<resultCount>> tiddler(s) ?
ConfirmOverwriteTiddler: Souhaitez-vous supplanter le tiddler « <$text text=<<title>>/> » ?
ConfirmEditShadowTiddler: Vous êtes sur le point d'éditer un ShadowTiddler. Toute modification supplantera la version par défaut du système, rendant les prochaines mises à jour non-triviales. Êtes-vous sûr(e) de vouloir éditer "<$text text=<<title>>/>"?
ConfirmAction: Souhaitez-vous poursuivre ?
Count: total

View File

@@ -107,7 +107,7 @@ Plugins/Updates/Caption: 更新
Plugins/Updates/Hint: インストールされているプラグインの更新が可能です
Plugins/Updates/UpdateAll/Caption: <<update-count>> プラグインの更新
Saving/Caption: 保存
Saving/DownloadSaver/AutoSave/Description: ダウンロードセーバーの自動保存を許可します
Saving/DownloadSaver/AutoSave/Description: ダウンロードセーバーの自動保存を許可
Saving/DownloadSaver/AutoSave/Hint: ダウンロードセーバーの自動保存を有効にします
Saving/DownloadSaver/Caption: ダウンロードセーバー
Saving/DownloadSaver/Hint: この設定は HTML5 対応ダウンロードセーバーに適用されます
@@ -148,7 +148,7 @@ Settings/AutoSave/Disabled/Description: 自動的に保存しない
Settings/AutoSave/Enabled/Description: 自動的に保存する
Settings/AutoSave/Hint: 自動的に保存するかどうかを設定します
Settings/CamelCase/Caption: Camel Case Wiki リンク
Settings/CamelCase/Description: 自動で ~CamelCase リンクを有効にしま
Settings/CamelCase/Description: 自動で ~CamelCase リンクを有効にす
Settings/CamelCase/Hint: ~CamelCase フレーズの自動リンクをグローバルに無効にすることができます。有効にするには再読み込みが必要です
Settings/Caption: 設定
Settings/DefaultMoreSidebarTab/Caption: デフォルトのサイドバー 詳しく タブ
@@ -156,13 +156,13 @@ Settings/DefaultMoreSidebarTab/Hint: デフォルトで表示されるサイド
Settings/DefaultSidebarTab/Caption: 標準サイドバータブ
Settings/DefaultSidebarTab/Hint: 標準で表示されるサイドバータブを指定します
Settings/EditorToolbar/Caption: エディターツールバー
Settings/EditorToolbar/Description: エディターツールバーを表示します
Settings/EditorToolbar/Description: エディターツールバーを表示
Settings/EditorToolbar/Hint: エディターツールバーの有効・無効を切り替えます:
Settings/Hint: TiddlyWiki の動作を設定します
Settings/InfoPanelMode/Caption: Tiddler 情報パネルモード
Settings/InfoPanelMode/Hint: Tiddler 情報パネルが閉じる時間:
Settings/InfoPanelMode/Popup/Description: Tiddler 情報パネルが自動的に閉じるタイミングを制御しま
Settings/InfoPanelMode/Sticky/Description: Tiddler 情報パネルは、明示的に閉じるまで開いたままになりま
Settings/InfoPanelMode/Popup/Description: Tiddler 情報パネルが自動的に閉じるタイミングを制御す
Settings/InfoPanelMode/Sticky/Description: Tiddler 情報パネル明示的に閉じるまで開いたままにす
Settings/LinkToBehaviour/Caption: Tiddler を開く動作
Settings/LinkToBehaviour/InsideRiver/Hint: Tiddler 表示部 //内// の動作
Settings/LinkToBehaviour/OpenAbove: 現在の Tiddler 上に開く
@@ -171,13 +171,13 @@ Settings/LinkToBehaviour/OpenAtTop: Tiddler 表示部の上に開く
Settings/LinkToBehaviour/OpenBelow: 現在の Tiddler 下に開く
Settings/LinkToBehaviour/OutsideRiver/Hint: Tiddler 表示部 //外// の動作
Settings/MissingLinks/Caption: Wiki リンク
Settings/MissingLinks/Description: 欠落している Tiddler へのリンクを有効にしま
Settings/MissingLinks/Description: 欠落 Tiddler へのリンクを有効にす
Settings/MissingLinks/Hint: まだ存在しない Tiddler にリンクするかどうかを選択します
Settings/NavigationAddressBar/Caption: ナビゲーションアドレスバー
Settings/NavigationAddressBar/Hint: ナビゲーションアドレスバーの動作:
Settings/NavigationAddressBar/No/Description: アドレスバーを変更しない
Settings/NavigationAddressBar/Permalink/Description: Tiddler をアドレスに含める
Settings/NavigationAddressBar/Permaview/Description: 開く Tiddler と現在開いている Tiddler をアドレスに含めます
Settings/NavigationAddressBar/Permaview/Description: 開く Tiddler と現在開いている Tiddler をアドレスに含め
Settings/NavigationHistory/Caption: 操作履歴
Settings/NavigationHistory/Hint: Tiddler を操作したときのブラウザの履歴の設定:
Settings/NavigationHistory/No/Description: 履歴を残さない
@@ -215,7 +215,7 @@ Theme/Prompt: 現在のテーマ:
TiddlerColour/Caption: Tiddler の色
TiddlerColour/Hint: このルールカスケードは、Tiddler の色(アイコンと関連するタグピルに使用される)を動的に選択するために使用されます。
TiddlerFields/Caption: Tiddler 項目
TiddlerFields/Hint: 以下はこの TiddlyWiki で使用されているすべての Tiddler 項目の一覧です(システム Tiddler も含みますが、隠し Tiddler は含んでいません)
TiddlerFields/Hint: 以下はこの TiddlyWiki で使用されているすべての Tiddler 項目の一覧です(システム Tiddler も含みますが、隠し Tiddler は含んでいません)
TiddlerIcon/Caption: Tiddler アイコン
TiddlerIcon/Hint: このルールカスケードは Tiddler のアイコンを動的に選択するために使用されます。
Toolbars/Caption: ツールバー

View File

@@ -18,6 +18,8 @@ CopyToClipboard/Caption: 复制到剪贴板
CopyToClipboard/Hint: 将此文本复制到剪贴板
Delete/Caption: 删除
Delete/Hint: 删除此条目
DeleteTiddlers/Caption: 删除条目
DeleteTiddlers/Hint: 删除条目
Edit/Caption: 编辑
Edit/Hint: 编辑此条目
Encryption/Caption: 加密

View File

@@ -24,7 +24,7 @@ Basics/Subtitle/Prompt: 副标题
Basics/SystemTiddlers/Prompt: 系统条目数量
Basics/Tags/Prompt: 标签数量
Basics/Tiddlers/Prompt: 一般条目数量
Basics/Title/Prompt: 标题
Basics/Title/Prompt: 此 ~TiddlyWiki 的标题
Basics/Username/Prompt: 编辑者署名
Basics/Version/Prompt: ~TiddlyWiki 版本
Cascades/Caption: 级联

View File

@@ -9,9 +9,10 @@ title: GettingStarted
<div class="tc-control-panel">
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div>
请参阅[[控制台|$:/ControlPanel]]查看更多选项。

View File

@@ -8,6 +8,7 @@ CloseAll/Button: 全部关闭
ColourPicker/Recent: 最近︰
ConfirmCancelTiddler: 您确定要放弃对条目 "<$text text=<<title>>/>" 的更改?
ConfirmDeleteTiddler: 您确定要删除条目 "<$text text=<<title>>/>"
ConfirmDeleteTiddlers: 您确定要删除 <<resultCount>> 个条目?
ConfirmOverwriteTiddler: 您确定要复写条目 "<$text text=<<title>>/>"
ConfirmEditShadowTiddler: 您即将要编辑默认条目,任何更改将会复盖默认的系统,使未来的升级不寻常。您确定要编辑 "<$text text=<<title>>/>"?
ConfirmAction: 是否要继续?

View File

@@ -18,6 +18,8 @@ CopyToClipboard/Caption: 複製到剪貼簿
CopyToClipboard/Hint: 將此文字複製到剪貼簿
Delete/Caption: 刪除
Delete/Hint: 刪除此條目
DeleteTiddlers/Caption: 刪除條目
DeleteTiddlers/Hint: 刪除條目
Edit/Caption: 編輯
Edit/Hint: 編輯此條目
Encryption/Caption: 加密

View File

@@ -24,7 +24,7 @@ Basics/Subtitle/Prompt: 副標題
Basics/SystemTiddlers/Prompt: 系統條目數量
Basics/Tags/Prompt: 標籤數量
Basics/Tiddlers/Prompt: 一般條目數量
Basics/Title/Prompt: 標題
Basics/Title/Prompt: 此 ~TiddlyWiki 的標題
Basics/Username/Prompt: 編輯者署名
Basics/Version/Prompt: ~TiddlyWiki 版本
Cascades/Caption: 級聯

View File

@@ -9,9 +9,10 @@ title: GettingStarted
<div class="tc-control-panel">
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div>
請參閱[[控制台|$:/ControlPanel]]查看更多選項。

View File

@@ -8,6 +8,7 @@ CloseAll/Button: 全部關閉
ColourPicker/Recent: 最近︰
ConfirmCancelTiddler: 您確定要放棄對條目 "<$text text=<<title>>/>" 的更改?
ConfirmDeleteTiddler: 您確定要刪除條目 "<$text text=<<title>>/>"
ConfirmDeleteTiddlers: 您確定要刪除 <<resultCount>> 個條目?
ConfirmOverwriteTiddler: 您確定要覆寫條目 "<$text text=<<title>>/>"
ConfirmEditShadowTiddler: 您即將要編輯預設條目,任何更改將會覆蓋預設的系統,使未來的升級不尋常。您確定要編輯 "<$text text=<<title>>/>"?
ConfirmAction: 是否要繼續?

View File

@@ -497,3 +497,5 @@ Nolan Darilek, @NDarilek, 2022/06/21
Keiichi Shiga (🎈 BALLOON | FU-SEN), @fu-sen. 2022/07/07
Nathaniel Knight, @nathanielknight, 2022/07/26
HuanCheng Bai, @bestony, 2022/09/17

View File

@@ -1,7 +1,7 @@
{
"name": "tiddlywiki",
"preferGlobal": "true",
"version": "5.2.3",
"version": "5.2.4-prerelease",
"author": "Jeremy Ruston <jeremy@jermolene.com>",
"description": "a non-linear personal web notebook",
"contributors": [

View File

@@ -108,11 +108,11 @@ The selection tracker triggers an action string whenever the browser text select
The selection tracker works within DOM subtrees that have the following structure:
* The outer wrapper element has the attribute `data-selection-action-title` containing the title of the tiddler containing the action string to be invoked when the selection changes
* The outer wrapper element has the attribute `data-selection-actions-title` containing the title of the tiddler containing the action string to be invoked when the selection changes
* Each child element of the outer element must have a unique `id` attribute to identify it
```
<div data-selection-action-title="{tiddler title}">
<div data-selection-actions-title="{tiddler title}">
<div id="{title}">
Content text
</div>

View File

@@ -12,7 +12,7 @@ The main module of the Jasmine test plugin for TiddlyWiki5
/*global $tw: true */
"use strict";
var TEST_TIDDLER_FILTER = "[type[application/javascript]tag[$:/tags/test-spec]]";
var TEST_TIDDLER_FILTER = "[all[tiddlers+shadows]type[application/javascript]tag[$:/tags/test-spec]]";
exports.name = "jasmine";
// Ensure this startup module is executed in the right order.

View File

@@ -0,0 +1,93 @@
/*\
title: $:/plugins/tiddlywiki/jasmine/run-wiki-based-tests.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests the wiki based tests
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var TEST_WIKI_TIDDLER_FILTER = "[type[text/vnd.tiddlywiki-multiple]tag[$:/tags/wiki-test-spec]]";
var widget = require("$:/core/modules/widgets/widget.js");
describe("Wiki-based tests", function() {
// Step through the test tiddlers
var tests = $tw.wiki.filterTiddlers(TEST_WIKI_TIDDLER_FILTER);
$tw.utils.each(tests,function(title) {
var tiddler = $tw.wiki.getTiddler(title);
it(tiddler.fields.title + ": " + tiddler.fields.description, function() {
// Add our tiddlers
var wiki = new $tw.Wiki();
wiki.addTiddlers(readMultipleTiddlersTiddler(title));
// Complain if we don't have the ouput and expected results
if(!wiki.tiddlerExists("Output")) {
throw "Missing 'Output' tiddler";
}
if(!wiki.tiddlerExists("ExpectedResult")) {
throw "Missing 'ExpectedResult' tiddler";
}
// Construct the widget node
var text = "{{Output}}\n\n";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
var wrapper = renderWidgetNode(widgetNode);
// Clear changes queue
wiki.clearTiddlerEventQueue();
// Run the actions if provided
if(wiki.tiddlerExists("Actions")) {
widgetNode.invokeActionString(wiki.getTiddlerText("Actions"));
refreshWidgetNode(widgetNode,wrapper);
}
// Test the rendering
expect(wrapper.innerHTML).toBe(wiki.getTiddlerText("ExpectedResult"));
});
});
function readMultipleTiddlersTiddler(title) {
var rawTiddlers = $tw.wiki.getTiddlerText(title).split("\n+\n");
var tiddlers = [];
$tw.utils.each(rawTiddlers,function(rawTiddler) {
var fields = Object.create(null),
split = rawTiddler.split(/\r?\n\r?\n/mg);
if(split.length >= 1) {
fields = $tw.utils.parseFields(split[0],fields);
}
if(split.length >= 2) {
fields.text = split.slice(1).join("\n\n");
}
tiddlers.push(fields);
});
return tiddlers;
}
function createWidgetNode(parser,wiki) {
return wiki.makeWidget(parser);
}
function parseText(text,wiki,options) {
return wiki.parseText("text/vnd.tiddlywiki",text,options);
}
function renderWidgetNode(widgetNode) {
$tw.fakeDocument.setSequenceNumber(0);
var wrapper = $tw.fakeDocument.createElement("div");
widgetNode.render(wrapper,null);
// console.log(require("util").inspect(wrapper,{depth: 8}));
return wrapper;
}
function refreshWidgetNode(widgetNode,wrapper) {
widgetNode.refresh(widgetNode.wiki.changedTiddlers,wrapper);
// console.log(require("util").inspect(wrapper,{depth: 8}));
}
});
})();

View File

@@ -10,6 +10,10 @@ tags: $:/tags/Macro
<$list filter="""$(editFieldsFilter)$""" variable="editorField">
<$edit-text tag="$(editorTagName)$" field=<<editorField>> type="text" class="tc-edit-texteditor" minHeight="10px"/>
</$list>
<$reveal state="$:/state/showEnglishText" type=match text="show" tag="p">
Default text:
<pre><code><$view tiddler="$:/core" subtiddler=<<currentTiddler>> field=<<editorField>>/></code></pre>
</$reveal>
</td>
<td width="20px">
<div class="tc-drop-down-wrapper">
@@ -60,6 +64,8 @@ Delete translation
//<$count filter=<<translatableTiddlerTitles>>/> translatable tiddlers in this group//
<$checkbox tiddler="$:/state/showEnglishText" field="text" checked="show" unchecked="hide" default="hide"> Show the default text below editor field</$checkbox>
<$radio tiddler="$:/plugins/tiddlywiki/translators/editorTag" value="textarea"> Multi-line editors</$radio><br>
<$radio tiddler="$:/plugins/tiddlywiki/translators/editorTag" value="input"> Single-line editors</$radio>

View File

@@ -12,4 +12,9 @@ tags: $:/tags/Stylesheet
.tc-translators-string-table .tc-drop-down {
min-width: 500px;
}
.tc-tiddler-frame textarea.tc-edit-texteditor,
.tc-tiddler-frame input.tc-edit-texteditor {
background-color: #feffef;
}

View File

@@ -76,16 +76,17 @@ $else$
-webkit-box-sizing: border-box;
}
input[type="search"] {
outline-offset: initial;
}
/*
** Button default styles. Makes them look consistent for all browsers
*/
html button {
line-height: 1.2;
color: <<colour button-foreground>>;
fill: <<colour button-foreground>>;
background: <<colour button-background>>;
border-color: <<colour button-border>>;
border: 1px solid <<colour button-border>>;
border-radius: 3px;
padding: 2px 5px;
}
button:disabled svg {
@@ -221,8 +222,19 @@ dl dt {
margin-top: 6px;
}
button, textarea, input, select {
outline-color: <<colour primary>>;
/*
** Definition for text input elements so they look consistent for all browsers
*/
textarea, input, select {
border: 2px solid <<colour tiddler-editor-border>>;
background-color: <<colour tiddler-editor-background>>;
}
/* Input elements accessibility -- overwrite the reset */
:focus-visible {
outline: 2px solid <<colour primary>>;
outline-offset: -2px; /* same as in reset.css [type='search'] but for more elements */
}
textarea,
@@ -231,7 +243,6 @@ input[type=search],
input[type=""],
input:not([type]) {
color: <<colour foreground>>;
background: <<colour background>>;
}
input[type="checkbox"] {
@@ -293,6 +304,10 @@ pre > code {
color: inherit;
}
/*
Table defaults
*/
table {
border: 1px solid <<colour table-border>>;
width: auto;
@@ -320,10 +335,40 @@ table tfoot tr td {
background-color: <<colour table-footer-background>>;
}
/*
Table utility classes
*/
/* Remove borders from table as used in eg: GettingStarted*/
.tc-table-no-border,
.tc-table-no-border th,
.tc-table-no-border td {
border: initial;
}
/* First column in table width will fit to text.*/
/* This rule makes most sense with tc-first-link-nowrap*/
.tc-first-col-min-width td:nth-child(1) {
width: 1%;
}
/* First link A element will not wrap */
.tc-first-link-nowrap:first-of-type a {
white-space: nowrap;
}
/*
CSV parser plugin
*/
.tc-csv-table {
white-space: nowrap;
}
/*
Tiddler frame in story river
*/
.tc-tiddler-frame img,
.tc-tiddler-frame svg,
.tc-tiddler-frame canvas,
@@ -352,6 +397,7 @@ a.tc-tiddlylink {
font-weight: 500;
color: <<colour tiddler-link-foreground>>;
-webkit-user-select: inherit; /* Otherwise the draggable attribute makes links impossible to select */
-webkit-touch-callout: none; /* Prevents long presses from bringing up a link preview */
}
.tc-sidebar-lists a.tc-tiddlylink {
@@ -1140,6 +1186,7 @@ button.tc-btn-invisible.tc-remove-tag-button {
.tc-tiddler-frame .tc-tiddler-controls {
float: right;
padding: 3px; /* make space for outline */
}
.tc-tiddler-controls .tc-drop-down {