mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-23 03:14:40 +00:00
Compare commits
125 Commits
json-ops
...
revised-js
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
418aab50a5 | ||
|
|
f82d15e55f | ||
|
|
7652aa5fed | ||
|
|
d62a16ee46 | ||
|
|
0b1fc8e574 | ||
|
|
127f660c91 | ||
|
|
668f443fc2 | ||
|
|
f0423c20b9 | ||
|
|
953b89fd6b | ||
|
|
f87ab06414 | ||
|
|
2ff5bd5a0f | ||
|
|
d7b9e6fb02 | ||
|
|
8420f8430f | ||
|
|
a572979cc4 | ||
|
|
90d6a0f1a6 | ||
|
|
406dbd0883 | ||
|
|
3fd2cfc339 | ||
|
|
f690458792 | ||
|
|
6bc18570f2 | ||
|
|
1f4b12cd0e | ||
|
|
608aa3378a | ||
|
|
bff7dc88e8 | ||
|
|
667da96c97 | ||
|
|
fb037de091 | ||
|
|
75865385a6 | ||
|
|
091a6a9dc1 | ||
|
|
38f0337207 | ||
|
|
a3b294470f | ||
|
|
53c5cc535e | ||
|
|
9e6713d3e0 | ||
|
|
1acad41574 | ||
|
|
9a5f6558fe | ||
|
|
5d9b71771a | ||
|
|
f891eacddc | ||
|
|
178e652a5d | ||
|
|
daf4eec702 | ||
|
|
34b1b8128f | ||
|
|
a453121e96 | ||
|
|
e849aaab4d | ||
|
|
453d91caeb | ||
|
|
0ad0001e29 | ||
|
|
2441819c70 | ||
|
|
ca762ab7a6 | ||
|
|
28070f847c | ||
|
|
8f85fbca33 | ||
|
|
655cf4729a | ||
|
|
55f3ee5eab | ||
|
|
63bba13758 | ||
|
|
c22d52c046 | ||
|
|
8c57cfdf26 | ||
|
|
4f38903c7b | ||
|
|
ab1e85e01e | ||
|
|
065911259b | ||
|
|
6497633859 | ||
|
|
9cc4c3ead7 | ||
|
|
613b3df367 | ||
|
|
39996c7a2f | ||
|
|
0237d9ed94 | ||
|
|
7e9c2a1a10 | ||
|
|
d4fc8f585e | ||
|
|
caa6b888e9 | ||
|
|
a1b240de2f | ||
|
|
7a98ab1677 | ||
|
|
c49d5a3b08 | ||
|
|
93717560dc | ||
|
|
abc3af16c3 | ||
|
|
97eaec88d1 | ||
|
|
2275255c2b | ||
|
|
fe1147c6fd | ||
|
|
eceacc23c8 | ||
|
|
1ca6305acb | ||
|
|
19331cc6f9 | ||
|
|
f6e021d70f | ||
|
|
2da117484c | ||
|
|
1c1dd2a4cf | ||
|
|
f957874d18 | ||
|
|
aa4a284b88 | ||
|
|
338dc11436 | ||
|
|
22d8fdd259 | ||
|
|
c270e3cd6b | ||
|
|
18d8173dcc | ||
|
|
4cd3c065e7 | ||
|
|
45895bd560 | ||
|
|
af86080943 | ||
|
|
94b02ba3a0 | ||
|
|
bbae2ab6da | ||
|
|
3b778c156b | ||
|
|
2f817e4293 | ||
|
|
0112d04033 | ||
|
|
56d8f47710 | ||
|
|
f818fd96cd | ||
|
|
c5821326d0 | ||
|
|
add14ef65a | ||
|
|
f93fe50044 | ||
|
|
ceec7b5737 | ||
|
|
76bc2f7524 | ||
|
|
a59ec3ebf7 | ||
|
|
20df381cf3 | ||
|
|
4185d9a26c | ||
|
|
bf6d5fa767 | ||
|
|
92c4c82005 | ||
|
|
1110fd50cf | ||
|
|
2c607ee8e6 | ||
|
|
dfebd69d8f | ||
|
|
926b7808b3 | ||
|
|
7ac7d26f86 | ||
|
|
f02bd2392f | ||
|
|
2b45bbc4c4 | ||
|
|
bce3ec6e6f | ||
|
|
5e35c8dda6 | ||
|
|
8af7054efa | ||
|
|
10bc84ba6c | ||
|
|
0391e1855c | ||
|
|
a29889a741 | ||
|
|
27609d2619 | ||
|
|
d5030eb87b | ||
|
|
35b0833e0c | ||
|
|
45f5ba7d38 | ||
|
|
8e64e21039 | ||
|
|
bb47cc97f5 | ||
|
|
7e4722f07a | ||
|
|
df7416d16b | ||
|
|
a226975b3e | ||
|
|
2a62da1498 | ||
|
|
696c5c9c7a |
File diff suppressed because one or more lines are too long
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
title: $:/language/EditTemplate/
|
||||
|
||||
Caption: Editor
|
||||
Body/External/Hint: This tiddler shows content stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself
|
||||
Body/Placeholder: Type the text for this tiddler
|
||||
Body/Preview/Type/Output: output
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -31,5 +31,5 @@ Notes:
|
||||
|
||||
Examples:
|
||||
|
||||
* `--render "[!is[system]]" "[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]"` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML
|
||||
|
||||
* `--render '[!is[system]]' '[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]'` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML
|
||||
* `--render '.' 'tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[HelloThere]]'` -- renders the tiddlers tagged "HelloThere" to a JSON file named "tiddlers.json"
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
title: $:/language/SideBar/
|
||||
|
||||
Caption: Sidebar
|
||||
All/Caption: All
|
||||
Contents/Caption: Contents
|
||||
Drafts/Caption: Drafts
|
||||
|
||||
@@ -50,7 +50,7 @@ Render individual tiddlers and save the results to the specified files
|
||||
console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
|
||||
}
|
||||
var parser = wiki.parseTiddler(template || title),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title})}),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}),
|
||||
container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
var text = type === "text/html" ? container.innerHTML : container.textContent;
|
||||
|
||||
@@ -40,6 +40,7 @@ Command.prototype.execute = function() {
|
||||
$tw.utils.createFileDirectories(filename);
|
||||
if(template) {
|
||||
variables.currentTiddler = title;
|
||||
variables.storyTiddler = title;
|
||||
title = template;
|
||||
}
|
||||
if(name && value) {
|
||||
|
||||
@@ -46,7 +46,7 @@ Command.prototype.execute = function() {
|
||||
}
|
||||
$tw.utils.each(tiddlers,function(title) {
|
||||
var parser = wiki.parseTiddler(template),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title, storyTiddler: title}}),
|
||||
container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
var text = type === "text/html" ? container.innerHTML : container.textContent,
|
||||
|
||||
@@ -35,7 +35,7 @@ function FramedEngine(options) {
|
||||
this.iframeDoc = this.iframeNode.contentWindow.document;
|
||||
// (Firefox requires us to put some empty content in the iframe)
|
||||
var paletteTitle = this.widget.wiki.getTiddlerText("$:/palette");
|
||||
var colorScheme = this.widget.wiki.getTiddler(paletteTitle).fields["color-scheme"] || "light";
|
||||
var colorScheme = (this.widget.wiki.getTiddler(paletteTitle) || {fields: {}}).fields["color-scheme"] || "light";
|
||||
this.iframeDoc.open();
|
||||
this.iframeDoc.write("<meta name='color-scheme' content='" + colorScheme + "'>");
|
||||
this.iframeDoc.close();
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -16,7 +16,9 @@ exports.map = function(operationSubFunction,options) {
|
||||
return function(results,source,widget) {
|
||||
if(results.length > 0) {
|
||||
var inputTitles = results.toArray(),
|
||||
index = 0;
|
||||
index = 0,
|
||||
suffixes = options.suffixes,
|
||||
flatten = (suffixes[0] && suffixes[0][0] === "flat") ? true : false;
|
||||
results.clear();
|
||||
$tw.utils.each(inputTitles,function(title) {
|
||||
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
|
||||
@@ -36,7 +38,13 @@ exports.map = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
});
|
||||
results.push(filtered[0] || "");
|
||||
if(filtered.length && flatten) {
|
||||
$tw.utils.each(filtered,function(value) {
|
||||
results.push(value);
|
||||
})
|
||||
} else {
|
||||
results.push(filtered[0]||"");
|
||||
}
|
||||
++index;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -220,10 +220,18 @@ source: an iterator function for the source tiddlers, called source(iterator), w
|
||||
widget: an optional widget node for retrieving the current tiddler etc.
|
||||
*/
|
||||
exports.compileFilter = function(filterString) {
|
||||
if(!this.filterCache) {
|
||||
this.filterCache = Object.create(null);
|
||||
this.filterCacheCount = 0;
|
||||
}
|
||||
if(this.filterCache[filterString] !== undefined) {
|
||||
return this.filterCache[filterString];
|
||||
}
|
||||
var filterParseTree;
|
||||
try {
|
||||
filterParseTree = this.parseFilter(filterString);
|
||||
} catch(e) {
|
||||
// We do not cache this result, so it adjusts along with localization changes
|
||||
return function(source,widget) {
|
||||
return [$tw.language.getString("Error/Filter") + ": " + e];
|
||||
};
|
||||
@@ -320,7 +328,7 @@ exports.compileFilter = function(filterString) {
|
||||
})());
|
||||
});
|
||||
// Return a function that applies the operations to a source iterator of tiddler titles
|
||||
return $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
|
||||
var compiled = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
|
||||
if(!source) {
|
||||
source = self.each;
|
||||
} else if(typeof source === "object") { // Array or hashmap
|
||||
@@ -335,6 +343,16 @@ exports.compileFilter = function(filterString) {
|
||||
});
|
||||
return results.toArray();
|
||||
});
|
||||
if(this.filterCacheCount >= 2000) {
|
||||
// To prevent memory leak, we maintain an upper limit for cache size.
|
||||
// Reset if exceeded. This should give us 95% of the benefit
|
||||
// that no cache limit would give us.
|
||||
this.filterCache = Object.create(null);
|
||||
this.filterCacheCount = 0;
|
||||
}
|
||||
this.filterCache[filterString] = compiled;
|
||||
this.filterCacheCount++;
|
||||
return compiled;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
35
core/modules/filters/format/json.js
Normal file
35
core/modules/filters/format/json.js
Normal 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;
|
||||
};
|
||||
|
||||
})();
|
||||
46
core/modules/filters/insertafter.js
Normal file
46
core/modules/filters/insertafter.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/insertafter.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Insert an item after another item in a list
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Order a list
|
||||
*/
|
||||
exports.insertafter = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
results.push(title);
|
||||
});
|
||||
var target = operator.operands[1] || (options.widget && options.widget.getVariable(operator.suffix || "currentTiddler"));
|
||||
if(target !== operator.operand) {
|
||||
// Remove the entry from the list if it is present
|
||||
var pos = results.indexOf(operator.operand);
|
||||
if(pos !== -1) {
|
||||
results.splice(pos,1);
|
||||
}
|
||||
// Insert the entry after the target marker
|
||||
pos = results.indexOf(target);
|
||||
if(pos !== -1) {
|
||||
results.splice(pos+1,0,operator.operand);
|
||||
} else {
|
||||
var suffix = operator.operands.length > 1 ? operator.suffix : "";
|
||||
if(suffix === "start") {
|
||||
results.splice(0,0,operator.operand);
|
||||
} else {
|
||||
results.push(operator.operand);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -32,7 +32,12 @@ exports.insertbefore = function(source,operator,options) {
|
||||
if(pos !== -1) {
|
||||
results.splice(pos,0,operator.operand);
|
||||
} else {
|
||||
results.push(operator.operand);
|
||||
var suffix = operator.operands.length > 1 ? operator.suffix : "";
|
||||
if(suffix == "start") {
|
||||
results.splice(0,0,operator.operand);
|
||||
} else {
|
||||
results.push(operator.operand);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
153
core/modules/filters/json-ops.js
Normal file
153
core/modules/filters/json-ops.js
Normal 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;
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -359,8 +359,9 @@ Server.prototype.listen = function(port,host,prefix) {
|
||||
}
|
||||
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
|
||||
server.on("listening",function() {
|
||||
var address = server.address();
|
||||
$tw.utils.log("Serving on " + self.protocol + "://" + address.address + ":" + address.port + prefix,"brown/orange");
|
||||
var address = server.address(),
|
||||
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix;
|
||||
$tw.utils.log("Serving on " + url,"brown/orange");
|
||||
$tw.utils.log("(press ctrl-C to exit)","red");
|
||||
});
|
||||
// Listen
|
||||
|
||||
@@ -62,12 +62,14 @@ function loadIFrame(url,callback) {
|
||||
Unload library iframe for given url
|
||||
*/
|
||||
function unloadIFrame(url){
|
||||
$tw.utils.each(document.getElementsByTagName('iframe'), function(iframe) {
|
||||
var iframes = document.getElementsByTagName('iframe');
|
||||
for(var t=iframes.length-1; t--; t>=0) {
|
||||
var iframe = iframes[t];
|
||||
if(iframe.getAttribute("library") === "true" &&
|
||||
iframe.getAttribute("src") === url) {
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function saveIFrameInfoTiddler(iframeInfo) {
|
||||
|
||||
@@ -54,7 +54,9 @@ exports.startup = function() {
|
||||
var hash = $tw.utils.getLocationHash();
|
||||
if(hash !== $tw.locationHash) {
|
||||
$tw.locationHash = hash;
|
||||
openStartupTiddlers({defaultToCurrentStory: true});
|
||||
if(hash !== "#") {
|
||||
openStartupTiddlers({defaultToCurrentStory: true});
|
||||
}
|
||||
}
|
||||
},false);
|
||||
// Listen for the tm-browser-refresh message
|
||||
|
||||
@@ -25,14 +25,13 @@ widget: widget to use as the context for the filter
|
||||
exports.makeDraggable = function(options) {
|
||||
var dragImageType = options.dragImageType || "dom",
|
||||
dragImage,
|
||||
domNode = options.domNode,
|
||||
dragHandle = options.selector && domNode.querySelector(options.selector) || domNode;
|
||||
domNode = options.domNode;
|
||||
// Make the dom node draggable (not necessary for anchor tags)
|
||||
if((domNode.tagName || "").toLowerCase() !== "a") {
|
||||
dragHandle.setAttribute("draggable","true");
|
||||
if(!options.selector && ((domNode.tagName || "").toLowerCase() !== "a")) {
|
||||
domNode.setAttribute("draggable","true");
|
||||
}
|
||||
// Add event handlers
|
||||
$tw.utils.addEventListeners(dragHandle,[
|
||||
$tw.utils.addEventListeners(domNode,[
|
||||
{name: "dragstart", handlerFunction: function(event) {
|
||||
if(event.dataTransfer === undefined) {
|
||||
return false;
|
||||
@@ -41,19 +40,19 @@ exports.makeDraggable = function(options) {
|
||||
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
|
||||
dragFilter = options.dragFilterFn && options.dragFilterFn(),
|
||||
titles = dragTiddler ? [dragTiddler] : [],
|
||||
startActions = options.startActions,
|
||||
variables,
|
||||
domNodeRect;
|
||||
startActions = options.startActions,
|
||||
variables,
|
||||
domNodeRect;
|
||||
if(dragFilter) {
|
||||
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
|
||||
}
|
||||
var titleString = $tw.utils.stringifyList(titles);
|
||||
// Check that we've something to drag
|
||||
if(titles.length > 0 && event.target === dragHandle) {
|
||||
if(titles.length > 0 && (options.selector && $tw.utils.domMatchesSelector(event.target,options.selector) || event.target === domNode)) {
|
||||
// Mark the drag in progress
|
||||
$tw.dragInProgress = domNode;
|
||||
// Set the dragging class on the element being dragged
|
||||
$tw.utils.addClass(event.target,"tc-dragging");
|
||||
$tw.utils.addClass(domNode,"tc-dragging");
|
||||
// Invoke drag-start actions if given
|
||||
if(startActions !== undefined) {
|
||||
// Collect our variables
|
||||
@@ -107,21 +106,22 @@ exports.makeDraggable = function(options) {
|
||||
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
||||
dataTransfer.setData("text/plain",titleString);
|
||||
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
} else {
|
||||
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
}
|
||||
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
dataTransfer.setData("Text",titleString);
|
||||
event.stopPropagation();
|
||||
}
|
||||
return false;
|
||||
}},
|
||||
{name: "dragend", handlerFunction: function(event) {
|
||||
if(event.target === domNode) {
|
||||
if((options.selector && $tw.utils.domMatchesSelector(event.target,options.selector)) || event.target === domNode) {
|
||||
// Collect the tiddlers being dragged
|
||||
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
|
||||
dragFilter = options.dragFilterFn && options.dragFilterFn(),
|
||||
titles = dragTiddler ? [dragTiddler] : [],
|
||||
endActions = options.endActions,
|
||||
variables;
|
||||
endActions = options.endActions,
|
||||
variables;
|
||||
if(dragFilter) {
|
||||
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
|
||||
}
|
||||
@@ -135,7 +135,7 @@ exports.makeDraggable = function(options) {
|
||||
options.widget.invokeActionString(endActions,options.widget,event,variables);
|
||||
}
|
||||
// Remove the dragging class on the element being dragged
|
||||
$tw.utils.removeClass(event.target,"tc-dragging");
|
||||
$tw.utils.removeClass(domNode,"tc-dragging");
|
||||
// Delete the drag image element
|
||||
if(dragImage) {
|
||||
dragImage.parentNode.removeChild(dragImage);
|
||||
|
||||
@@ -36,8 +36,9 @@ Notifier.prototype.display = function(title,options) {
|
||||
if(!tiddler) {
|
||||
return;
|
||||
}
|
||||
// Add classes
|
||||
// Add classes and roles
|
||||
$tw.utils.addClass(notification,"tc-notification");
|
||||
notification.setAttribute("role","alert");
|
||||
// Create the variables
|
||||
var variables = $tw.utils.extend({currentTiddler: title},options.variables);
|
||||
// Render the body of the notification
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -46,7 +46,8 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
||||
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
|
||||
if(this.selectedClass) {
|
||||
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
|
||||
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
|
||||
$tw.utils.pushTop(classes, this.selectedClass.split(" "));
|
||||
domNode.setAttribute("aria-checked", "true");
|
||||
}
|
||||
if(isPoppedUp) {
|
||||
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
|
||||
@@ -66,6 +67,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this["aria-label"]) {
|
||||
domNode.setAttribute("aria-label",this["aria-label"]);
|
||||
}
|
||||
if (this.role) {
|
||||
domNode.setAttribute("role", this.role);
|
||||
}
|
||||
if(this.popup || this.popupTitle) {
|
||||
domNode.setAttribute("aria-expanded",isPoppedUp ? "true" : "false");
|
||||
}
|
||||
@@ -206,6 +210,7 @@ ButtonWidget.prototype.execute = function() {
|
||||
this.popup = this.getAttribute("popup");
|
||||
this.hover = this.getAttribute("hover");
|
||||
this["aria-label"] = this.getAttribute("aria-label");
|
||||
this.role = this.getAttribute("role");
|
||||
this.tooltip = this.getAttribute("tooltip");
|
||||
this.style = this.getAttribute("style");
|
||||
this["class"] = this.getAttribute("class","");
|
||||
|
||||
@@ -87,12 +87,32 @@ DraggableWidget.prototype.execute = function() {
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
|
||||
DraggableWidget.prototype.updateDomNodeClasses = function() {
|
||||
var domNodeClasses = this.domNodes[0].className.split(" "),
|
||||
oldClasses = this.draggableClasses.split(" ");
|
||||
this.draggableClasses = this.getAttribute("class");
|
||||
//Remove classes assigned from the old value of class attribute
|
||||
$tw.utils.each(oldClasses,function(oldClass){
|
||||
var i = domNodeClasses.indexOf(oldClass);
|
||||
if(i !== -1) {
|
||||
domNodeClasses.splice(i,1);
|
||||
}
|
||||
});
|
||||
//Add new classes from updated class attribute.
|
||||
$tw.utils.pushTop(domNodeClasses,this.draggableClasses);
|
||||
this.domNodes[0].setAttribute("class",domNodeClasses.join(" "))
|
||||
}
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if($tw.utils.count(changedAttributes) > 0) {
|
||||
var changedAttributes = this.computeAttributes(),
|
||||
changedAttributesCount = $tw.utils.count(changedAttributes);
|
||||
if(changedAttributesCount === 1 && changedAttributes["class"]) {
|
||||
this.updateDomNodeClasses();
|
||||
} else if(changedAttributesCount > 0) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
}
|
||||
@@ -101,4 +121,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
||||
|
||||
exports.draggable = DraggableWidget;
|
||||
|
||||
})();
|
||||
})();
|
||||
@@ -42,16 +42,22 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.tag = "h" + headingLevel;
|
||||
}
|
||||
// Select the namespace for the tag
|
||||
var tagNamespaces = {
|
||||
var XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml",
|
||||
tagNamespaces = {
|
||||
svg: "http://www.w3.org/2000/svg",
|
||||
math: "http://www.w3.org/1998/Math/MathML",
|
||||
body: "http://www.w3.org/1999/xhtml"
|
||||
body: XHTML_NAMESPACE
|
||||
};
|
||||
this.namespace = tagNamespaces[this.tag];
|
||||
if(this.namespace) {
|
||||
this.setVariable("namespace",this.namespace);
|
||||
} else {
|
||||
this.namespace = this.getVariable("namespace",{defaultValue: "http://www.w3.org/1999/xhtml"});
|
||||
if(this.hasAttribute("xmlns")) {
|
||||
this.namespace = this.getAttribute("xmlns");
|
||||
this.setVariable("namespace",this.namespace);
|
||||
} else {
|
||||
this.namespace = this.getVariable("namespace",{defaultValue: XHTML_NAMESPACE});
|
||||
}
|
||||
}
|
||||
// Invoke the th-rendering-element hook
|
||||
var parseTreeNodes = $tw.hooks.invokeHook("th-rendering-element",null,this);
|
||||
|
||||
@@ -111,6 +111,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.imageAlt) {
|
||||
domNode.setAttribute("alt",this.imageAlt);
|
||||
}
|
||||
if(this.lazyLoading && tag === "img") {
|
||||
domNode.setAttribute("loading",this.lazyLoading);
|
||||
}
|
||||
// Add classes when the image loads or fails
|
||||
$tw.utils.addClass(domNode,"tc-image-loading");
|
||||
domNode.addEventListener("load",function() {
|
||||
@@ -137,6 +140,7 @@ ImageWidget.prototype.execute = function() {
|
||||
this.imageClass = this.getAttribute("class");
|
||||
this.imageTooltip = this.getAttribute("tooltip");
|
||||
this.imageAlt = this.getAttribute("alt");
|
||||
this.lazyLoading = this.getAttribute("loading");
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -50,7 +50,7 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
|
||||
if(tr.field) {
|
||||
var tiddler = this.getTiddler(title);
|
||||
if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler
|
||||
return title;
|
||||
return title || defaultText;
|
||||
} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
||||
return tiddler.getFieldString(tr.field);
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/core/templates/server/static.sidebar.wikitext
|
||||
|
||||
\whitespace trim
|
||||
<div class="tc-sidebar-scrollable" style="overflow: auto;">
|
||||
<div class="tc-sidebar-scrollable" style="overflow: auto;" role="region" aria-label={{$:/language/SideBar/Caption}}>
|
||||
<div class="tc-sidebar-header">
|
||||
<h1 class="tc-site-title">
|
||||
<$transclude tiddler="$:/SiteTitle"/>
|
||||
|
||||
@@ -19,8 +19,8 @@ title: $:/core/templates/server/static.tiddler.html
|
||||
</head>
|
||||
<body class="tc-body">
|
||||
<$transclude tiddler="$:/core/templates/server/static.sidebar.wikitext" mode="inline"/>
|
||||
<section class="tc-story-river">
|
||||
<div class="tc-tiddler-frame">
|
||||
<section class="tc-story-river" role="main">
|
||||
<div class="tc-tiddler-frame" role="article">
|
||||
<$transclude tiddler="$:/core/templates/server/static.tiddler.wikitext" mode="inline"/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -23,7 +23,9 @@ title: $:/core/ui/EditTemplate
|
||||
<div
|
||||
data-tiddler-title=<<currentTiddler>>
|
||||
data-tags={{!!tags}}
|
||||
class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>
|
||||
class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
|
||||
role="region"
|
||||
aria-label={{$:/language/EditTemplate/Caption}}>
|
||||
<$fieldmangler>
|
||||
<$vars
|
||||
storyTiddler=<<currentTiddler>>
|
||||
|
||||
@@ -2,7 +2,7 @@ title: $:/core/ui/PageTemplate/story
|
||||
tags: $:/tags/PageTemplate
|
||||
|
||||
\whitespace trim
|
||||
<section class="tc-story-river">
|
||||
<section class="tc-story-river" role="main">
|
||||
|
||||
<section class="story-backdrop">
|
||||
|
||||
|
||||
@@ -51,12 +51,14 @@ tags: $:/tags/SideBarSegment
|
||||
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
||||
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
|
||||
<$keyboard key="((advanced-search-sidebar))" actions=<<advanced-search-actions>>>
|
||||
<form class="tc-form-inline">
|
||||
<$macrocall $name="keyboard-driven-input" tiddler=<<editTiddler>> storeTitle=<<searchTiddler>>
|
||||
selectionStateTitle=<<searchListState>> refreshTitle="$:/temp/search/refresh" type="search"
|
||||
tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">>
|
||||
class="tc-popup-handle" filterMinLength={{$:/config/Search/MinLength}} inputCancelActions=<<cancel-search-actions>>
|
||||
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> cancelPopups="yes"
|
||||
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"/>
|
||||
</form>
|
||||
</$keyboard>
|
||||
</$keyboard>
|
||||
</$keyboard>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/core/ui/SideBarSegments/tabs
|
||||
tags: $:/tags/SideBarSegment
|
||||
|
||||
<div class="tc-sidebar-lists tc-sidebar-tabs">
|
||||
<div class="tc-sidebar-lists tc-sidebar-tabs" role="region" aria-label={{$:/language/SideBar/Caption}}>
|
||||
|
||||
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" default={{$:/config/DefaultSidebarTab}} state="$:/state/tab/sidebar" class="tc-sidebar-tabs-main" explicitState="$:/state/tab/sidebar--595412856"/>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ $:/state/folded/$(currentTiddler)$
|
||||
\define cancel-delete-tiddler-actions(message) <$action-sendmessage $message="tm-$message$-tiddler"/>
|
||||
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]]
|
||||
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>
|
||||
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>
|
||||
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}} role="article">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$list>
|
||||
|
||||
7
core/ui/ViewTemplate/body/rendered-plain-text.tid
Normal file
7
core/ui/ViewTemplate/body/rendered-plain-text.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/ViewTemplate/body/rendered-plain-text
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
<$wikify name="text" text={{!!text}} type={{!!type}}>
|
||||
<$codeblock code=<<text>> language="css"/>
|
||||
</$wikify>
|
||||
@@ -4,7 +4,11 @@ tags: $:/tags/ViewTemplate
|
||||
\whitespace trim
|
||||
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
|
||||
<div class="tc-subtitle">
|
||||
<$link to={{!!modifier}} />
|
||||
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler" counter="indexSubtitleTiddler">
|
||||
<$list filter="[<indexSubtitleTiddler-first>match[no]]" variable="ignore">
|
||||
|
||||
</$list>
|
||||
<$transclude tiddler=<<subtitleTiddler>> mode="inline"/>
|
||||
</$list>
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
4
core/ui/ViewTemplate/subtitle/modified.tid
Normal file
4
core/ui/ViewTemplate/subtitle/modified.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/subtitle/modified
|
||||
tags: $:/tags/ViewTemplate/Subtitle
|
||||
|
||||
<$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
|
||||
4
core/ui/ViewTemplate/subtitle/modifier.tid
Normal file
4
core/ui/ViewTemplate/subtitle/modifier.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/subtitle/modifier
|
||||
tags: $:/tags/ViewTemplate/Subtitle
|
||||
|
||||
<$link to={{!!modifier}}/>
|
||||
@@ -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}}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
title: $:/config/ViewTemplateBodyFilters/
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
|
||||
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
|
||||
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/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
||||
|
||||
@@ -22,12 +22,12 @@ tags: $:/tags/Macro
|
||||
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore<actionTiddler>,<currentTiddler>]"/>
|
||||
\end
|
||||
|
||||
\define list-links-draggable(tiddler,field:"list",type:"ul",subtype:"li",class:"",itemTemplate)
|
||||
\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$]]">
|
||||
<$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>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
title: $:/core/macros/tabs
|
||||
tags: $:/tags/Macro
|
||||
code_body: yes
|
||||
code-body: yes
|
||||
|
||||
\define tabs-button()
|
||||
\whitespace trim
|
||||
<$button set=<<tabsState>> setTo=<<currentTab>> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
|
||||
<$button set=<<tabsState>> setTo=<<currentTab>> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}} role="switch">
|
||||
<$tiddler tiddler=<<save-currentTiddler>>>
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude tiddler=<<__buttonTemplate__>> mode="inline">
|
||||
@@ -48,7 +48,7 @@ code_body: yes
|
||||
\define tabs(tabsList,default,state:"$:/state/tab",class,template,buttonTemplate,retain,actions,explicitState)
|
||||
\whitespace trim
|
||||
<$qualify title=<<__state__>> name="qualifiedState">
|
||||
<$set name="tabsState" filter={{{ [<__explicitState__>minlength[1]] ~[<qualifiedState>] }}}>
|
||||
<$let tabsState={{{ [<__explicitState__>minlength[1]] ~[<qualifiedState>] }}}>
|
||||
<div class={{{ [[tc-tab-set]addsuffix[ ]addsuffix<__class__>] }}}>
|
||||
<div class={{{ [[tc-tab-buttons]addsuffix[ ]addsuffix<__class__>] }}}>
|
||||
<<tabs-tab-list>>
|
||||
@@ -58,6 +58,6 @@ code_body: yes
|
||||
<<tabs-tab-body>>
|
||||
</div>
|
||||
</div>
|
||||
</$set>
|
||||
</$let>
|
||||
</$qualify>
|
||||
\end
|
||||
|
||||
@@ -11,7 +11,7 @@ second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
|
||||
\whitespace trim
|
||||
<$set name="tag" value={{{ [<__tiddler__>get[text]] }}}>
|
||||
<$list filter="[<saveTiddler>!contains:$tagField$<tag>!match[]]" variable="ignore" emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>">
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>]"/>
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||
$actions$
|
||||
</$list>
|
||||
</$set>
|
||||
@@ -52,7 +52,7 @@ $actions$
|
||||
</span><$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$reveal state=<<storeTitle>> type="nomatch" text=""><$button class="tc-btn-invisible tc-small-gap tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}} aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}>{{$:/core/images/close-button}}<<delete-tag-state-tiddlers>></$button></$reveal><span class="tc-add-tag-button tc-small-gap-left">
|
||||
<$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}>
|
||||
<$button set=<<newTagNameTiddler>> setTo="" class="">
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>]"/>
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||
$actions$
|
||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
|
||||
|
||||
@@ -16,7 +16,7 @@ color:$(foregroundColor)$;
|
||||
$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$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="title" format="text" /></$element-tag$>
|
||||
\end
|
||||
|
||||
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
||||
|
||||
@@ -3,11 +3,13 @@ tags: $:/tags/Macro
|
||||
|
||||
\define toc-caption()
|
||||
\whitespace trim
|
||||
<span class="tc-toc-caption tc-tiny-gap-left">
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$transclude>
|
||||
</$set>
|
||||
</span>
|
||||
\end
|
||||
|
||||
\define toc-body(tag,sort:"",itemClassFilter,exclude,path)
|
||||
@@ -51,7 +53,6 @@ tags: $:/tags/Macro
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$link>
|
||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||
@@ -71,14 +72,12 @@ tags: $:/tags/Macro
|
||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||
{{$:/core/images/right-arrow}}
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||
{{$:/core/images/down-arrow}}
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
@@ -127,7 +126,6 @@ tags: $:/tags/Macro
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$list>
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$link>
|
||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||
@@ -147,14 +145,12 @@ tags: $:/tags/Macro
|
||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||
{{$:/core/images/right-arrow}}
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||
{{$:/core/images/down-arrow}}
|
||||
 
|
||||
<<toc-caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
|
||||
@@ -23,11 +23,7 @@ title: $:/snippets/peek-stylesheets
|
||||
<$reveal type="match" state=<<state>> text="yes" tag="div">
|
||||
<$set name="source" tiddler=<<currentTiddler>>>
|
||||
<$wikify name="styles" text=<<source>>>
|
||||
<pre>
|
||||
<code>
|
||||
<$text text=<<styles>>/>
|
||||
</code>
|
||||
</pre>
|
||||
<$codeblock code=<<styles>> language="css"/>
|
||||
</$wikify>
|
||||
</$set>
|
||||
</$reveal>
|
||||
|
||||
@@ -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/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
|
||||
|
||||
2
core/wiki/tags/ViewTemplateSubtitle.tid
Normal file
2
core/wiki/tags/ViewTemplateSubtitle.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/ViewTemplate/Subtitle
|
||||
list: $:/core/ui/ViewTemplate/subtitle/modifier $:/core/ui/ViewTemplate/subtitle/modified
|
||||
8
editions/katexdemo/tiddlers/$__DefaultTiddlers.tid
Normal file
8
editions/katexdemo/tiddlers/$__DefaultTiddlers.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
created: 20220504131459155
|
||||
modified: 20220504131522349
|
||||
title: $:/DefaultTiddlers
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
HelloThere
|
||||
KaTeX
|
||||
$:/plugins/tiddlywiki/katex/developer
|
||||
@@ -1,5 +0,0 @@
|
||||
title: $:/DefaultTiddlers
|
||||
|
||||
HelloThere
|
||||
KaTeX
|
||||
ImplementationNotes
|
||||
@@ -1,4 +1,7 @@
|
||||
created: 20220504124110967
|
||||
modified: 20220504124250020
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This is a TiddlyWiki plugin for mathematical and chemical typesetting based on KaTeX from Khan Academy.
|
||||
|
||||
@@ -6,7 +9,7 @@ It is completely self-contained, and doesn't need an Internet connection in orde
|
||||
|
||||
! Installation
|
||||
|
||||
To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
|
||||
To add the plugin to your own wiki, just //drag the following link to your ~TiddlyWiki browser window//.
|
||||
|
||||
[[$:/plugins/tiddlywiki/katex]]
|
||||
|
||||
|
||||
8
editions/katexdemo/tiddlers/LaTeX.tid
Normal file
8
editions/katexdemo/tiddlers/LaTeX.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
created: 20220504123802219
|
||||
modified: 20220504123918414
|
||||
title: LaTeX
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<<https://en.wikipedia.org/wiki/LaTeX
|
||||
LaTeX is widely used in academia for the communication and publication of scientific documents in many fields, including mathematics, computer science, engineering, physics, chemistry, economics, linguistics, quantitative psychology, philosophy, and political science.
|
||||
<<<
|
||||
8
editions/katexdemo/tiddlers/TiddlyWiki.tid
Normal file
8
editions/katexdemo/tiddlers/TiddlyWiki.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
created: 20220504123347104
|
||||
modified: 20220504123400803
|
||||
title: TiddlyWiki
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWiki is a rich, interactive tool for manipulating complex data with structure that doesn't easily fit into conventional tools like spreadsheets or wordprocessors.
|
||||
|
||||
Learn more at: https://tiddlywiki.com
|
||||
6
editions/katexdemo/tiddlers/TiddlyWiki5.tid
Normal file
6
editions/katexdemo/tiddlers/TiddlyWiki5.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
created: 20220504123412027
|
||||
modified: 20220504123416593
|
||||
title: TiddlyWiki5
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
{{TiddlyWiki}}
|
||||
@@ -1,83 +0,0 @@
|
||||
caption: 5.2.3
|
||||
created: 20220325131459084
|
||||
modified: 20220325131459084
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.2.3
|
||||
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.2...master]]//
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6625">> [[BrowserStorage Plugin]] to be able to delete existing tiddlers as well as modify or add tiddlers
|
||||
|
||||
|
||||
! Translation improvements
|
||||
|
||||
* Polish
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/5916">> ActionSetFieldWidget to avoid inadvertent changes to the current tiddler
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6589">> "put" and "upload" savers (as used by TiddlyHost) to display error responses from the server
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6561">> CheckboxWidget to support for the ''listField'' and ''filter'' attributes
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6581">> DraggableWidget to support an ''enabled'' attribute
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6582">> DraggableWidget to pass additional context variables to the ''dragstartactions'' action string
|
||||
|
||||
! Filter improvements
|
||||
|
||||
*
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6624">> [[colour Macro]] to allow for palette-specific fallback colours to be specified
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6578">> whitespace and indentation of [[tabs Macro]] to improve readability
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* A number of core tiddlers have been refactored to use `\whitespace trim` for improved readability. The work was split into a number of PRs: [[#6257|https://github.com/Jermolene/TiddlyWiki5/pull/6257]], [[#6265|https://github.com/Jermolene/TiddlyWiki5/pull/6265]], [[#6269|https://github.com/Jermolene/TiddlyWiki5/pull/6269]], [[#6270|https://github.com/Jermolene/TiddlyWiki5/pull/6270]], [[#6272|https://github.com/Jermolene/TiddlyWiki5/pull/6272]], [[#6275|https://github.com/Jermolene/TiddlyWiki5/pull/6275]], [[#6276|https://github.com/Jermolene/TiddlyWiki5/pull/6276]], [[#6587|https://github.com/Jermolene/TiddlyWiki5/pull/6587]], [[#6600|https://github.com/Jermolene/TiddlyWiki5/pull/6600]], [[#6604|https://github.com/Jermolene/TiddlyWiki5/pull/6604]], [[#6611|https://github.com/Jermolene/TiddlyWiki5/pull/6611]]
|
||||
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Performance Improvements
|
||||
|
||||
*
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6614">> bug with formatting UTC date strings
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6603">> SaveCommand crash when attempting to save missing tiddlers
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6599">> fix broken [[style block behaviour|Styles and Classes in WikiText]]
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6594">> incorrect display of image system tiddlers as text
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/1c16f12d6f5b81d86f79c3e687eec05b3a8d45bf">> erroneous link rendering within captions in [[list-links Macro]]
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/758d590837c30ddde9cc7b8171273756680f1545">> erroneous link rendering within captions in [[list-links-draggable Macro]]
|
||||
|
||||
! 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 Arlen22>>
|
||||
* <<contributor btheado>>
|
||||
* <<contributor BurningTreeC>>
|
||||
* <<contributor damscal>>
|
||||
* <<contributor es-kha>>
|
||||
* <<contributor EvidentlyCube>>
|
||||
* <<contributor FlashSystems>>
|
||||
* <<contributor flibbles>>
|
||||
* <<contributor linonetwo>>
|
||||
* <<contributor Marxsal>>
|
||||
* <<contributor pmario>>
|
||||
* <<contributor rmunn>>
|
||||
* <<contributor saqimtiaz>>
|
||||
* <<contributor simonbaird>>
|
||||
* <<contributor tobibeer>>
|
||||
59
editions/prerelease/tiddlers/Release 5.2.4.tid
Normal file
59
editions/prerelease/tiddlers/Release 5.2.4.tid
Normal file
@@ -0,0 +1,59 @@
|
||||
caption: 5.2.4
|
||||
created: 20220802100223020
|
||||
modified: 20220802100223020
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.2.4
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.3...master]]//
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
*
|
||||
|
||||
! Translation improvements
|
||||
|
||||
*
|
||||
|
||||
! Accessibility Improvements
|
||||
|
||||
*
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
*
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
*
|
||||
|
||||
! Filter improvements
|
||||
|
||||
*
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
*
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
*
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
*
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Performance Improvements
|
||||
|
||||
*
|
||||
|
||||
! 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 """
|
||||
""">>
|
||||
@@ -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.
|
||||
|
||||
@@ -4,6 +4,9 @@ modified: 20150428204930183
|
||||
This is a pre-release build of TiddlyWiki, [[also available in empty form|https://tiddlywiki.com/prerelease/empty.html]]. It is provided for testing purposes. ''Please don't try to use it for anything important'' -- you should use the latest official release from https://tiddlywiki.com.
|
||||
|
||||
<$list filter="[tag[ReleaseNotes]!has[released]!sort[created]]">
|
||||
<h1><$text text=<<currentTiddler>>/></h1>
|
||||
<div class="tc-titlebar">
|
||||
<h2 class="tc-title"><$text text=<<currentTiddler>>/></h2>
|
||||
</div>
|
||||
<div class="tc-subtitle">Updated: <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/></div>
|
||||
<$transclude mode="block"/>
|
||||
</$list>
|
||||
|
||||
@@ -2,4 +2,4 @@ title: expected-html-tabs-horizontal-all
|
||||
type: text/html
|
||||
description: Horizontal tabs with all parameters active. This is the expected HTML output from a test in test-wikitext-tabs-macro.js
|
||||
|
||||
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="">t 1</button><button class=" tc-tab-selected">t 2</button><button class="">desc</button><button class="">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><h2 class=""><a class="tc-tiddlylink tc-tiddlylink-resolves" href="#TabTwo">TabTwo</a></h2><p><p>Text tab 2</p></p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">desc</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><h2 class=""><a class="tc-tiddlylink tc-tiddlylink-resolves" href="#TabTwo">TabTwo</a></h2><p><p>Text tab 2</p></p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
@@ -2,4 +2,4 @@ title: expected-html-tabs-horizontal
|
||||
type: text/html
|
||||
description: Horizontal tabs test - This is the expected HTML output from a test in test-wikitext-tabs-macro.js
|
||||
|
||||
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="">t 1</button><button class=" tc-tab-selected">t 2</button><button class="">t 3</button><button class="">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">t 3</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
@@ -2,4 +2,4 @@ title: expected-html-tabs-vertical
|
||||
type: text/html
|
||||
description: Vertical tabs test -- This is the expected HTML output from the test in test-wikitext-tabs-macro.js
|
||||
|
||||
<p><div class="tc-tab-set tc-vertical"><div class="tc-tab-buttons tc-vertical"><button class="">t 1</button><button class=" tc-tab-selected">t 2</button><button class="">t 3</button><button class="">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical"><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
<p><div class="tc-tab-set tc-vertical"><div class="tc-tab-buttons tc-vertical"><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">t 3</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical"><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p>
|
||||
@@ -621,6 +621,8 @@ Tests the filtering mechanism.
|
||||
});
|
||||
|
||||
it("should handle indirect operands", function() {
|
||||
expect(wiki.filterTiddlers("[{!!missing}]").join(",")).toBe("");
|
||||
expect(wiki.filterTiddlers("[{!!title}]").join(",")).toBe("");
|
||||
expect(wiki.filterTiddlers("[prefix{Tiddler8}] +[sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[modifier{Tiddler8!!test-field}] +[sort[title]]").join(",")).toBe("TiddlerOne");
|
||||
var fakeWidget = {wiki: wiki, getVariable: function() {return "Tiddler Three";}};
|
||||
@@ -745,7 +747,46 @@ Tests the filtering mechanism.
|
||||
|
||||
expect(wiki.filterTiddlers("a [[b c]] +[append{TiddlerSix!!filter}]").join(",")).toBe("a,b c,one,a a,[subfilter{hasList!!list}]");
|
||||
});
|
||||
|
||||
|
||||
it("should handle the insertafter operator", 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("myVar","c");
|
||||
rootWidget.setVariable("tidTitle","e");
|
||||
rootWidget.setVariable("tidList","one tid with spaces");
|
||||
|
||||
// Position title specified as suffix.
|
||||
expect(wiki.filterTiddlers("a b c d e f +[insertafter:myVar[f]]",anchorWidget).join(",")).toBe("a,b,c,f,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e f +[insertafter:myVar<tidTitle>]",anchorWidget).join(",")).toBe("a,b,c,e,d,f");
|
||||
expect(wiki.filterTiddlers("a b c d e f +[insertafter:myVar[gg gg]]",anchorWidget).join(",")).toBe("a,b,c,gg gg,d,e,f");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:myVar<tidList>]",anchorWidget).join(",")).toBe("a,b,c,one tid with spaces,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e f +[insertafter:tidTitle{TiddlerOne!!tags}]",anchorWidget).join(",")).toBe("a,b,c,d,e,one,f");
|
||||
|
||||
// Position title specified as parameter.
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter[f],[a]]",anchorWidget).join(",")).toBe("a,f,b,c,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter[f],<myVar>]",anchorWidget).join(",")).toBe("a,b,c,f,d,e");
|
||||
|
||||
// Parameter takes precedence over suffix.
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:myVar[f],[a]]",anchorWidget).join(",")).toBe("a,f,b,c,d,e");
|
||||
|
||||
// No position title.
|
||||
expect(wiki.filterTiddlers("a b c [[with space]] +[insertafter[b]]").join(",")).toBe("a,c,with space,b");
|
||||
|
||||
// Position title does not exist, and no suffix given.
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:foo[b]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter[b],[foo]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter[b],<foo>]").join(",")).toBe("a,c,d,e,b");
|
||||
|
||||
// Position title does not exist, but "start" or "end" given as suffix
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:start[b],[foo]]").join(",")).toBe("b,a,c,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:start[b],<foo>]").join(",")).toBe("b,a,c,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:end[b],[foo]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertafter:end[b],<foo>]").join(",")).toBe("a,c,d,e,b");
|
||||
});
|
||||
|
||||
it("should handle the insertbefore operator", function() {
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] },
|
||||
@@ -773,10 +814,16 @@ Tests the filtering mechanism.
|
||||
// No position title.
|
||||
expect(wiki.filterTiddlers("a b c [[with space]] +[insertbefore[b]]").join(",")).toBe("a,c,with space,b");
|
||||
|
||||
// Position title does not exist.
|
||||
// Position title does not exist, and no suffix given.
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore:foo[b]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore[b],[foo]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore[b],<foo>]").join(",")).toBe("a,c,d,e,b");
|
||||
|
||||
// Position title does not exist, but "start" or "end" given as suffix
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore:start[b],[foo]]").join(",")).toBe("b,a,c,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore:start[b],<foo>]").join(",")).toBe("b,a,c,d,e");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore:end[b],[foo]]").join(",")).toBe("a,c,d,e,b");
|
||||
expect(wiki.filterTiddlers("a b c d e +[insertbefore:end[b],<foo>]").join(",")).toBe("a,c,d,e,b");
|
||||
});
|
||||
|
||||
it("should handle the move operator", function() {
|
||||
|
||||
95
editions/test/tiddlers/tests/test-json-filters.js
Normal file
95
editions/test/tiddlers/tests/test-json-filters.js
Normal 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}"]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -416,6 +416,8 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :map[get[description]else{!!title}]").join(",")).toBe("A square of rich chocolate cake,a round yellow seed,Milk,Rice Pudding");
|
||||
// Return the first title from :map if the filter returns more than one result
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :map[tags[]]").join(",")).toBe("shopping,shopping,shopping,shopping");
|
||||
// Return all titles from :map if the flat suffix is used
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :map:flat[tags[]]").join(",")).toBe("shopping,food,shopping,food,shopping,dairy,drinks,shopping,dairy");
|
||||
// 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");
|
||||
});
|
||||
|
||||
@@ -78,7 +78,12 @@ describe("Utility tests", function() {
|
||||
expect(fds(d,"ddd hh mm ssss")).toBe("Sun 17 41 2828");
|
||||
expect(fds(d,"MM0DD")).toBe("1109");
|
||||
expect(fds(d,"MM0\\D\\D")).toBe("110DD");
|
||||
expect(fds(d,"[UTC]YYYY0MM0DD0hh0mm0ssXXX")).toBe("20141109174128542");
|
||||
const day = d.getUTCDate();
|
||||
const dayStr = ("" + day).padStart(2, '0');
|
||||
const hours = d.getUTCHours();
|
||||
const hoursStr = ("" + hours).padStart(2, '0');
|
||||
const expectedUtcStr = `201411${dayStr}${hoursStr}4128542`;
|
||||
expect(fds(d,"[UTC]YYYY0MM0DD0hh0mm0ssXXX")).toBe(expectedUtcStr);
|
||||
|
||||
// test some edge cases found at: https://en.wikipedia.org/wiki/ISO_week_date
|
||||
// 2016-11-13 is Week 45 and it's a Sunday (month nr: 10)
|
||||
|
||||
6
editions/tw.org/tiddlers/$__config_DefaultSidebarTab.tid
Normal file
6
editions/tw.org/tiddlers/$__config_DefaultSidebarTab.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
created: 20220721202136733
|
||||
modified: 20220721202136733
|
||||
title: $:/config/DefaultSidebarTab
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Table of Contents
|
||||
30
editions/tw.org/tiddlers/Code of Conduct.tid
Normal file
30
editions/tw.org/tiddlers/Code of Conduct.tid
Normal file
@@ -0,0 +1,30 @@
|
||||
created: 20220721200137586
|
||||
modified: 20220721200137586
|
||||
tags: [[Table of Contents]]
|
||||
title: Code of Conduct
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This community exists because TiddlyWiki is more useful when people share and work together.
|
||||
|
||||
This community is a beautiful but fragile thing: a collection of diverse people from all over the planet, united in their interest in the project, and their commitment to helping one another achieve and learn more.
|
||||
|
||||
We try to make the community as broad and welcoming as possible by remembering some basic principles of culture and behaviour.
|
||||
|
||||
These principles guide technical and non-technical decisions, and help contributors and leaders support our project and community.
|
||||
|
||||
* We are optimistic and hopeful
|
||||
* We aim to foster a learning environment that is collaborative and safe for everyone
|
||||
* 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 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
|
||||
* When we disagree with others we do so graciously, and treat others with dignity and respoect
|
||||
* We do not tolerate intolerance towards others
|
||||
* We seek first to understand others, and then to be understood
|
||||
* We have fun
|
||||
|
||||
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.
|
||||
|
||||
As an inclusive community, we are committed to making sure that TiddlyWiki is an accessible tool that understands the needs of people with disabilities.
|
||||
@@ -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: 20220728145919904
|
||||
list: Brackets Base64 HelloThere GettingStarted Community
|
||||
modified: 20220728145919904
|
||||
title: $:/StoryList
|
||||
type: text/vnd.tiddlywiki
|
||||
14
editions/tw5.com/tiddlers/Brackets.tid
Normal file
14
editions/tw5.com/tiddlers/Brackets.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
created: 20220728145925343
|
||||
modified: 20220728150440771
|
||||
tags: Definitions
|
||||
title: Brackets
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
WikiText syntax uses a number of different types of brackets. Their names are shown in the table below:
|
||||
|
||||
|!Appearance |!Name |!Short name |!Usage |
|
||||
|`()` |Round brackets |Parenthesis |Not used in WikiText |
|
||||
|`[]` |Square brackets |Brackets |[[Links|Linking in WikiText]], [[Filters|Filters]] |
|
||||
|`{}` |Curly brackets |Braces |[[Text references|TextReference]], [[Filtered attributes|HTML in WikiText]] |
|
||||
|`<>` |Angle brackets |Chevrons |[[HTML elements and widgets|HTML in WikiText]], [[Macros|Macros in WikiText]] |
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
title: $:/_tw_shared/styles
|
||||
tags: $:/tags/Stylesheet TiddlyWikiSitesMenu
|
||||
code-body: yes
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock
|
||||
|
||||
|
||||
@@ -10,3 +10,10 @@ A ''Keyboard Shortcut Tiddler'' is made of three parts:
|
||||
If the [[Keyboard Shortcut Descriptor]] has the form `((my-shortcut))` it's a ''reference'' to a ''configuration Tiddler'' that stores the corresponding [[Keyboard Shortcut|KeyboardShortcuts]]
|
||||
|
||||
In order to make a ''shortcut'' editable through the <<.controlpanel-tab KeyboardShortcuts>> Tab in the $:/ControlPanel it's sufficient to create a tiddler `$:/config/ShortcutInfo/my-shortcut`, where the ''suffix'' is the ''reference'' used for the [[Keyboard Shortcut|KeyboardShortcuts]]
|
||||
|
||||
!! Notes on wiki navigation
|
||||
|
||||
If you want to create keyboard shortcuts for navigation, there are two things to keep in mind:
|
||||
|
||||
* If your shortcut uses ''Ctrl'', you need to include `$scroll="yes"` in the [[ActionNavigateWidget's|ActionNavigateWidget]] attributes otherwise the action will be ignored.
|
||||
* The actions need to be wrapped in [[NavigatorWidget]] like in this [[New Tiddler keyboard shortcut|$:/core/ui/KeyboardShortcuts/new-tiddler]].
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20150124125646000
|
||||
modified: 20211127140005352
|
||||
modified: 20220729141540007
|
||||
tags: Tagging
|
||||
title: Order of Tagged Tiddlers
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -13,6 +13,8 @@ When ~TiddlyWiki generates a list of the tiddlers that have a particular tag (e.
|
||||
|
||||
# In each remaining tiddler <<.place T>>, look for a <<.field list-after>> field. If this has a tiddler title as its value, place tiddler <<.place T>> just <<.em after>> that one.
|
||||
|
||||
#* As a special case, if the field exists but its value is empty, place <<.place T>> at the very end of the list.
|
||||
|
||||
# If any tiddlers still remain, place them at the end of the list in ascending alphabetical order of title. The difference between capital and lowercase letters is ignored.
|
||||
|
||||
The ordering of tiddlers with a particular tag can be directly modified using drag and drop within a tag pill dropdown. The underlying [[list-tagged-draggable Macro]] can also be used elsewhere.
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
created: 201308252136
|
||||
modified: 201308252136
|
||||
created: 20130825213600000
|
||||
modified: 20220613145033713
|
||||
tags: Concepts
|
||||
title: TiddlyWiki5
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
~TiddlyWiki5 is a reboot of TiddlyWiki for the next 25 years. It is a complete interactive wiki in JavaScript that can be run in the browser or on the server under [[Node.js]].
|
||||
|
||||
The ~TiddlyWiki repository can be found at GitHub.
|
||||
@@ -1,13 +1,15 @@
|
||||
created: 20131129094739786
|
||||
modified: 20140211195455541
|
||||
modified: 20220612091858504
|
||||
tags: Definitions
|
||||
title: Node.js
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
''Node.js'' is a downloadable application for your PC, Mac or Linux computer that lets it run JavaScript applications. Unlike ~JavaScript applications running in a web browser, Node.js code has full access to the file system and other resources of the computer, enabling it to perform the roles that have traditionally been the preserve of languages like Java, PHP and Python. See http://nodejs.org for more details.
|
||||
''Node.js'' is a downloadable application for your PC, Mac or Linux computer that lets it run JavaScript applications. Unlike ~JavaScript applications running in a web browser, Node.js code has full access to the file system and other resources of the computer, enabling it to perform the roles that have traditionally been the preserve of languages like Java, PHP and Python.
|
||||
|
||||
For ~TiddlyWiki, Node.js means that we can have a single code base that can run in the browser or on the server, giving great flexibility in how it is used.
|
||||
|
||||
For end users, Node.js is no more complicated to install than a web browser, but unlocks powerful capabilities such as the ability to run ~TiddlyWiki as a web server that you can connect to from other devices.
|
||||
|
||||
See [[TiddlyWiki on Node.js]] for more details.
|
||||
''Node.js'' is a ''trademark'' of the ~OpenJS Foundation. See: https://nodejs.org fore more details.
|
||||
|
||||
[[TiddlyWiki on Node.js]] will give an overview about the possibilities using a client-server configuration.
|
||||
|
||||
@@ -15,5 +15,6 @@ Other implementations of the API include:
|
||||
|
||||
* [[TiddlyWiki App Engine Server|https://github.com/rsc/tiddly]], a 300-line Go implementation from Russ Cox
|
||||
* [[TiddlyWiki 5 server module|https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/commands/server.js]], the bare-bones subset of the API implemented in TiddlyWiki version 5 for Node.js
|
||||
* [[tiddly-wiki-server|https://github.com/nathanielknight/tiddly-wiki-server]], an implementation based on Rust and SQLite
|
||||
|
||||
As of early 2017, none is currently as complete as TiddlyWeb itself.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
title: $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Styles
|
||||
tags: $:/tags/Stylesheet
|
||||
code-body: yes
|
||||
|
||||
.tc-custom-tiddler-template {
|
||||
border: 3px solid <<colour muted-foreground>>;
|
||||
|
||||
@@ -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]]:
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
created: 20220223004441865
|
||||
modified: 20220223004441865
|
||||
tags: [[Operator Examples]] [[insertafter Operator]]
|
||||
title: insertafter Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define after-title() Friday
|
||||
\define missing-title() Yesterday
|
||||
\define display-variable(name)
|
||||
''<$text text=<<__name__>>/>'': <code><$text text={{{ [<__name__>getvariable[]] }}}/></code>
|
||||
\end
|
||||
|
||||
These examples use the following predefined variables:
|
||||
|
||||
* <<display-variable after-title>>
|
||||
* <<display-variable missing-title>>
|
||||
|
||||
<<.operator-example 1 """[list[Days of the Week]insertafter[Today]]""">>
|
||||
|
||||
<<.operator-example 2 """[list[Days of the Week]insertafter[Today],[Tuesday]]""">>
|
||||
|
||||
<<.operator-example 3 """[list[Days of the Week]insertafter[Today],<after-title>]""">>
|
||||
|
||||
<<.operator-example 4 """[list[Days of the Week]insertafter:after-title[Today]]""">>
|
||||
|
||||
<<.operator-example 5 """[list[Days of the Week]insertafter[Today],<missing-title>]""">>
|
||||
|
||||
<<.operator-example 6 """[list[Days of the Week]insertafter:missing-title[Today]]""">>
|
||||
@@ -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.""">>
|
||||
|
||||
|
||||
35
editions/tw5.com/tiddlers/filters/insertafter Operator.tid
Normal file
35
editions/tw5.com/tiddlers/filters/insertafter Operator.tid
Normal file
@@ -0,0 +1,35 @@
|
||||
caption: insertafter
|
||||
created: 20170406090122441
|
||||
modified: 20220223004441865
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input tiddler list with the new entry inserted
|
||||
op-parameter: the <<.op insertafter>> operator accepts 1 or 2 parameters, see below for details
|
||||
op-purpose: insert an item <<.place T>> into a list immediately after an item <<.place A>>
|
||||
op-suffix: (optional) the name of a variable containing the title of the tiddler after which this one should be inserted
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: insertafter Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.2.3">>
|
||||
|
||||
The <<.op insertafter>> operator requires at least one parameter which specifies the title to insert into the input list. A second parameter can be used to specify the title after which the new title should be inserted.
|
||||
|
||||
A suffix can also be used to specify <<.place A>>, the title after which the new title should be inserted, but this form is deprecated. Instead, the two-parameter form is recommended. If the two-parameter form is used, the suffixes ''start'' and ''end'' can be used to specify where the item should be inserted if <<.place A>> is not found.
|
||||
|
||||
```
|
||||
insertafter:<after-title-variable>[<title>]
|
||||
insertafter:<missing-location>[<title>],[<after-title>]
|
||||
```
|
||||
|
||||
* ''title'' : a title <<.place T>> to insert in the input list.
|
||||
* ''after-title'' : (optional). Insert <<.place T>> after this title <<.place A>> in the input list.
|
||||
* ''after-title-variable'' : (optional). The name of a variable specifying <<.place A>> instead of the `after-title` parameter.
|
||||
* ''missing-location'' : (optional). Either `start` or `end`: where to insert <<.place T>> if <<.place A>> is not found in the list.
|
||||
|
||||
If the item <<.place A>> isn't present in the input list then the new item is inserted at the end of the list. <<.from-version "5.2.3">> The suffixes ''start'' and ''end'' can be spedified to control where the new item is inserted when <<.place A>> is not found. The suffix ''end'' is the default, inserting the new item at the end of the list. The suffix ''start'' will cause the new item to be inserted at the start of the list when <<.place A>> is not found.
|
||||
|
||||
<<.tip "Either [[parameter|Filter Parameter]] can be a string, a text reference or a variable">>
|
||||
|
||||
<<.tip "If <<.place A>> is specified as both a suffix and a parameter, the parameter takes precedence">>
|
||||
|
||||
<<.operator-examples "insertafter">>
|
||||
@@ -5,7 +5,7 @@ op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input tiddler list with the new entry inserted
|
||||
op-parameter: <<.from-version "5.2.2">> the <<.op insertbefore>> operator accepts 1 or 2 parameters, see below for details
|
||||
op-purpose: insert an item <<.place T>> into a list immediately before an item <<.place B>>
|
||||
op-suffix: (optional) the name of a variable containing the title of the tiddler before which this one should be inserted
|
||||
op-suffix: <<.from-version "5.2.3">> (optional) the name of a variable containing the title of the tiddler before which this one should be inserted
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: insertbefore Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -14,15 +14,21 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
The <<.op insertbefore>> operator requires at least one parameter which specifies the title to insert into the input list. A second parameter can be used to specify the title before which the new title should be inserted.
|
||||
|
||||
<<.from-version "5.2.3">>
|
||||
|
||||
Using the suffix to specify <<.place B>>, the title before which the new title should be inserted, is deprecated. Instead, the two-parameter form is recommended. If the two-parameter form is used, the suffixes ''start'' and ''end'' can be used to specify where the item should be inserted if <<.place B>> is not found.
|
||||
|
||||
```
|
||||
insertbefore:<before-title-variable>[<title>],[<before-title>]
|
||||
insertbefore:<before-title-variable>[<title>]
|
||||
insertbefore:<missing-location>[<title>],[<before-title>]
|
||||
```
|
||||
|
||||
* ''title'' : a title <<.place T>> to insert in the input list.
|
||||
* ''before-title'' : (optional). Insert <<.place T>> before this title <<.place B>> in the input list.
|
||||
* ''before-title-variable'' : (optional). The name of a variable specifying <<.place B>> instead of the `before-title` parameter.
|
||||
* ''missing-location'' : (optional). Either `start` or `end`: where to insert <<.place T>> if <<.place B>> is not found in the list.
|
||||
|
||||
If the item <<.place B>> isn't present in the input list then the new item is inserted at the end of the list.
|
||||
If the item <<.place B>> isn't present in the input list then the new item is inserted at the end of the list. <<.from-version "5.2.3">> The suffixes ''start'' and ''end'' can be spedified to control where the new item is inserted when <<.place B>> is not found. The suffix ''end'' is the default, inserting the new item at the end of the list. The suffix ''start'' will cause the new item to be inserted at the start of the list when <<.place B>> is not found.
|
||||
|
||||
<<.tip "Either [[parameter|Filter Parameter]] can be a string, a text reference or a variable">>
|
||||
|
||||
|
||||
86
editions/tw5.com/tiddlers/filters/jsonget.tid
Normal file
86
editions/tw5.com/tiddlers/filters/jsonget.tid
Normal 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"
|
||||
```
|
||||
64
editions/tw5.com/tiddlers/filters/jsonindexes.tid
Normal file
64
editions/tw5.com/tiddlers/filters/jsonindexes.tid
Normal 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"
|
||||
```
|
||||
73
editions/tw5.com/tiddlers/filters/jsontype.tid
Normal file
73
editions/tw5.com/tiddlers/filters/jsontype.tid
Normal 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"
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20210618134753828
|
||||
modified: 20211125152755859
|
||||
modified: 20220724162340642
|
||||
tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Map Filter Run Prefix]]
|
||||
title: Map Filter Run Prefix (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -15,12 +15,30 @@ For each title in a shopping list, calculate the total cost of purchasing each i
|
||||
|
||||
<<.operator-example 2 "[tag[shopping]] :map[get[quantity]else[0]multiply{!!price}]">>
|
||||
|
||||
Get the tags of all tiddlers tagged `Widget:`
|
||||
|
||||
<<.operator-example 3 "[tag[Widgets]] :map:flat[tagging[]] :and[!is[blank]unique[]]">>
|
||||
<<.tip "Without the `flat` suffix the `:map` filter run only returns the first result for each input title">>
|
||||
|
||||
!! Comparison between `:map` with and without the `flat` suffix
|
||||
|
||||
The `:map` filter run will return at least as many outputs as given in the input. By default one input item will result in exactly one output item. When the filter run transforms an input item into an empty result, the output for that item will be an empty string. When the filter run transforms an input item into multiple items, only the first item will appear in the output. This behavior can be overridden by providing the `flat` suffix. The `flat` suffix will cause all the items to appear in the output.
|
||||
|
||||
| `:map` | `:map:flat` |
|
||||
|^<<.operator-example m0.1 "[range[4]] :map[match[this matches nothing]]">>|^<<.operator-example m0.2 "[range[4]] :map:flat[match[this matches nothing]]">>|
|
||||
|^<<.operator-example m1.1 "[range[4]] :map[range<currentTiddler>]">>|^<<.operator-example m1.2 "[range[4]] :map:flat[range<currentTiddler>]">>|
|
||||
|^<<.operator-example m2.1 "[range[4]] :map[range<currentTiddler>]">>|^<<.operator-example m2.2 "[range[4]] :map:flat[range<currentTiddler>first[]]">>|
|
||||
|^<<.operator-example m3.1 "[range[4]] :map[range<currentTiddler>sum[]]">>|^<<.operator-example m3.2 "[range[4]] :map:flat[range<currentTiddler>sum[]]">>|
|
||||
|^<<.operator-example m4.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example m4.2 "[[1,2,3]] [[4,5]] :map:flat[split[,]]">>|
|
||||
|^<<.operator-example m5.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example m5.2 "[[1,2,3]] [[4,5]] :map:flat[split[,]first[]]">>|
|
||||
|
||||
|
||||
!! Comparison between `:map` and `:and`/`+` filter run prefixes
|
||||
|
||||
The functionality of the `:map` filter run prefix has some overlap with the `:and` prefix (alias `+`). They will sometimes return the same results as each other. In at least these cases, the results will be different:
|
||||
|
||||
# The `:and` filter run can modify the number of items (either increase or decrease). The `:map` run will never alter the number of items.
|
||||
# The number of items in the `:and` filter run will also decrease due to de-duplication. The `:map` run will not de-duplicate.
|
||||
# The number of items in the `:and` filter run will also decrease due to [[de-duplication|Dominant Append]]. The `:map` run will not [[de-duplicate|Dominant Append]].
|
||||
# Explicit references to the "currentTiddler" variable will behave differently
|
||||
# Implicit references to the "currentTiddler" using TextReference will behave differently.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20210618133745003
|
||||
modified: 20211029025541750
|
||||
modified: 20220720190146771
|
||||
tags: [[Filter Syntax]] [[Filter Run Prefix]]
|
||||
title: Map Filter Run Prefix
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -8,6 +8,7 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
|''purpose'' |modify input titles by the result of evaluating this filter run for each item |
|
||||
|''input'' |all titles from previous filter runs |
|
||||
|''suffix''|<<.from-version "5.2.3">> `flat` to return all results from the filter run, If omitted (default), only the first result is returned.|
|
||||
|''output''|the input titles as modified by the result of this filter run |
|
||||
|
||||
Each input title from previous runs is passed to this run in turn. The filter run transforms the input titles and the output of this run replaces the input title. For example, the filter run `[get[caption]else{!!title}]` replaces each input title with its caption field, unless the field does not exist in which case the title is preserved.
|
||||
@@ -22,6 +23,6 @@ The following variables are available within the filter run:
|
||||
* ''revIndex'' - <<.from-version "5.2.1">> the reverse numeric index of the current list item (with zero being the last item in the list).
|
||||
* ''length'' - <<.from-version "5.2.1">> the total length of the input list.
|
||||
|
||||
Filter runs used with the `:map` prefix should return the same number of items that they are passed. Any missing entries will be treated as an empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`.
|
||||
Filter runs used with the `:map` prefix should return at least the same number of items that they are passed. Any missing entries will be treated as an empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`.
|
||||
|
||||
[[Examples|Map Filter Run Prefix (Examples)]]
|
||||
@@ -4,6 +4,12 @@ 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:
|
||||
|
||||
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}}
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20130822170200000
|
||||
list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]] [[HelloThumbnail - TWEUM2017]]
|
||||
modified: 20220325130817150
|
||||
modified: 20220802122551819
|
||||
tags: TableOfContents
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
caption: {{!!title}} - ^^deprecated^^
|
||||
created: 20141001132300000
|
||||
modified: 201804111739
|
||||
modified: 20220704174221300
|
||||
tags: [[How to apply custom styles]] $:/deprecated
|
||||
title: How to apply custom styles by tag
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.deprecated-since "5.1.16 <- click" "Custom styles by data-tags">>. Also see: [[How to apply custom styles]]
|
||||
<<.deprecated-since "5.1.16" "Custom styles by data-tags">>. Also see: [[How to apply custom styles]]
|
||||
|
||||
----
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
Before experimenting with TiddlyDesktop internals you should find the location of the “user configuration folder” - click the “Settings” button on the main TiddlyDesktop window, and then click the button “Open user config folder”. Then move up to locate the parent folder, which should be called “TiddlyDesktop”. If things go wrong, you can reset TiddlyDesktop to its factory state by deleting this entire folder.
|
||||
|
||||
Click the `Backstage` button on the main TiddlyDesktop window to open the backstage wiki. This is is a Node.js-like instance of TiddlyWiki that runs the UI and logic of TiddlyDesktop.
|
||||
Click the `Backstage` button on the main TiddlyDesktop window to open the backstage wiki. This is a Node.js-like instance of TiddlyWiki that runs the UI and logic of TiddlyDesktop.
|
||||
|
||||
!! How do I get rid of the "Add a ~TiddlyWiki Folder" button.
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 106 KiB |
@@ -5,7 +5,7 @@ tags: Macros [[Core Macros]]
|
||||
title: tag Macro
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag.
|
||||
The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag. Clicking the tag pill opens a dropdown. This can be compared to the [[tag-pill Macro]] which also features other parameters.
|
||||
|
||||
!! Parameters
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ The <<.def list-links-draggable>> [[macro|Macros]] renders the ListField of a ti
|
||||
: The title of the tiddler containing the list
|
||||
;field
|
||||
: The name of the field containing the list (defaults to `list`)
|
||||
;emptyMessage
|
||||
: Optional wikitext to display if there is no output (tiddler is not existed, field is not existed or empty)
|
||||
;type
|
||||
: The element tag to use for the list wrapper (defaults to `ul`)
|
||||
;subtype
|
||||
|
||||
@@ -15,6 +15,7 @@ System tiddlers in the namespace `$:/info/` are used to expose information about
|
||||
|!Title |!Description |
|
||||
|[[$:/info/startup-timestamp]] |<<.from-version "5.1.23">> Startup timestamp in TiddlyWiki date format |
|
||||
|[[$:/info/browser]] |Running in the browser? ("yes" or "no") |
|
||||
|[[$:/info/mobile]] |<<.from-version "5.2.3">> Is running on a mobile device? ("yes" or "no" - eg, ''<<example full>>'') |
|
||||
|[[$:/info/browser/language]] |<<.from-version "5.1.20">> Language as reported by browser (note that some browsers report two character codes such as `en` while others report full codes such as `en-GB`) |
|
||||
|[[$:/info/browser/screen/width]] |Screen width in pixels |
|
||||
|[[$:/info/browser/screen/height]] |Screen height in pixels |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20130826122000000
|
||||
modified: 20190928082000464
|
||||
modified: 20220613124446953
|
||||
tags: Mechanisms
|
||||
title: PluginMechanism
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140617211749290
|
||||
modified: 20211104172343220
|
||||
modified: 20220613114121229
|
||||
tags: [[TiddlyWiki on Node.js]]
|
||||
title: Environment Variables on Node.js
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -11,15 +11,15 @@ type: text/vnd.tiddlywiki
|
||||
* `TIDDLYWIKI_LANGUAGE_PATH` - Search path for languages
|
||||
* `TIDDLYWIKI_EDITION_PATH` - Search path for editions (used by the InitCommand)
|
||||
|
||||
''Note 1'': The delimiter may vary between operating systems. While on Windows a semicolon `;` is used, Linux implements a colon `:`.
|
||||
|
||||
''Note 2'': On Linux systems, it may be necessary to //''export''// the variable as well as to define it.
|
||||
<$macrocall $name=".note" _="""''1.'' The delimiter may vary between operating systems. While on Windows a semicolon `;` is used, Linux implements a colon `:`.<br><br>''2.'' On Linux systems, it may be necessary to //''export''// the variable as well as to define it.
|
||||
"""/>
|
||||
|
||||
The additional paths should each point to folders structured like the equivalent directories in the TiddlyWiki5 GitHub repository: the plugin, theme and language directories contain `publisher/pluginname/<files>` while the edition directories contain `editionname/<files>`
|
||||
The additional paths should each point to folders structured like the equivalent directories in the ~TiddlyWiki5 GitHub repository: the plugin, theme and language directories contain `publisher/pluginname/<files>` while the edition directories contain `editionname/<files>`
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
TIDDLYWIKI_PLUGIN_PATH=~/MyPluginStore
|
||||
export TIDDLYWIKI_PLUGIN_PATH=~/MyPluginStore
|
||||
tiddlywiki mywiki --build index
|
||||
```
|
||||
|
||||
@@ -23,9 +23,9 @@ type: text/vnd.tiddlywiki
|
||||
#> `npm install -g tiddlywiki`
|
||||
#> If it fails with an error you may need to re-run the command as an administrator:
|
||||
#> `sudo npm install -g tiddlywiki` (Mac/Linux)
|
||||
# Check TiddlyWiki is installed by typing:
|
||||
# Ensure ~TiddlyWiki is installed by typing:
|
||||
#> `tiddlywiki --version`
|
||||
# In response, you should see TiddlyWiki report its current version (eg "<<version>>"; you may also see other debugging information reported)
|
||||
#* In response, you should see TiddlyWiki report its current version (eg "<<version>>". You may also see other debugging information reported.)
|
||||
# Try it out:
|
||||
## `tiddlywiki mynewwiki --init server` to create a folder for a new wiki that includes server-related components
|
||||
## `tiddlywiki mynewwiki --listen` to start TiddlyWiki
|
||||
@@ -37,11 +37,6 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
The `-g` flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.
|
||||
|
||||
If you are using Debian or Debian-based Linux and you are receiving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. Consult your distro's manual and `whereis` to correctly create a link. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]]
|
||||
|
||||
Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node`
|
||||
|
||||
You can also install prior versions like this:
|
||||
|
||||
> npm install -g tiddlywiki@5.1.13
|
||||
|
||||
<<.warning "If you are using Debian or Debian-based Linux and you are receiving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. Consult your distro's manual and `whereis` to correctly create a link. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]]. <br><br>Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node`">>
|
||||
<br>
|
||||
<<.tip "You can also install prior versions like this: <br><code> npm install -g tiddlywiki@5.1.13</code>">>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user