mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-22 10:54:46 +00:00
Compare commits
179 Commits
cascade-fi
...
fix-3692
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2bd54c9d9 | ||
|
|
4a3223b562 | ||
|
|
ab3109d84b | ||
|
|
a4ab42da8a | ||
|
|
af87727ffc | ||
|
|
6b4e5c74ad | ||
|
|
8af99878cc | ||
|
|
d6d2bc455c | ||
|
|
d5ff723d4c | ||
|
|
1d0af90ba2 | ||
|
|
59572cd75d | ||
|
|
1d16206188 | ||
|
|
37a6ff8521 | ||
|
|
d3ea98fcef | ||
|
|
5022516c61 | ||
|
|
965d8ee014 | ||
|
|
8e50ad1243 | ||
|
|
33f40c47c6 | ||
|
|
1b3c2557b8 | ||
|
|
1a4766c5a1 | ||
|
|
e49dda3b48 | ||
|
|
bd447f0716 | ||
|
|
13faeaa0bd | ||
|
|
7f0fb2b610 | ||
|
|
7d2994388b | ||
|
|
edb5dc3fdc | ||
|
|
df1b1316c8 | ||
|
|
1a0c831216 | ||
|
|
f4365e4bb4 | ||
|
|
75d10a2dc3 | ||
|
|
da7cf7a4f3 | ||
|
|
2469d0f0bf | ||
|
|
6452eb56a9 | ||
|
|
9fce8153df | ||
|
|
4cdfa4e3f9 | ||
|
|
d6384df6fc | ||
|
|
f0bd06b38d | ||
|
|
d823856082 | ||
|
|
b02a82ba0f | ||
|
|
c43b013539 | ||
|
|
5548186c93 | ||
|
|
def9b553a8 | ||
|
|
35f7a8ea06 | ||
|
|
54bfb28063 | ||
|
|
80c63b96cf | ||
|
|
2ef9ecbc44 | ||
|
|
88812092fd | ||
|
|
4e01fc1838 | ||
|
|
5cab75f4a7 | ||
|
|
1345384d39 | ||
|
|
927013a57a | ||
|
|
0d11fccba2 | ||
|
|
d78ad756db | ||
|
|
5613bcc884 | ||
|
|
0729d730f8 | ||
|
|
f2422efeb8 | ||
|
|
cbb002ec4b | ||
|
|
c7e8c87f85 | ||
|
|
66ae1d6930 | ||
|
|
8e3885277f | ||
|
|
9293dfa477 | ||
|
|
8a80d89582 | ||
|
|
10ebd93df3 | ||
|
|
d414eef773 | ||
|
|
7d1f0ea8f4 | ||
|
|
f477e90192 | ||
|
|
b4dec78a72 | ||
|
|
60187dc59e | ||
|
|
4453aefad8 | ||
|
|
54cfda76ee | ||
|
|
1e8c2821d6 | ||
|
|
cbc030fbe2 | ||
|
|
b454116163 | ||
|
|
0186c6490f | ||
|
|
853a899c77 | ||
|
|
95a3d7fde2 | ||
|
|
d33e0a05e2 | ||
|
|
cb833b3f65 | ||
|
|
b73c50adeb | ||
|
|
fdfa45329a | ||
|
|
7b1880404c | ||
|
|
2739b1bafe | ||
|
|
cc782ff518 | ||
|
|
492bfbebe9 | ||
|
|
c9fbff265a | ||
|
|
b0f72d0690 | ||
|
|
6070a2c921 | ||
|
|
cb43b91ab6 | ||
|
|
804bc9e9c0 | ||
|
|
4514a67a1f | ||
|
|
edcba4ee16 | ||
|
|
9e28356047 | ||
|
|
44ad8c770f | ||
|
|
2dd4fa41a5 | ||
|
|
f5389b3859 | ||
|
|
65c8d74218 | ||
|
|
f88e3939e1 | ||
|
|
769778b05b | ||
|
|
f84ff0d778 | ||
|
|
ca1aabe21f | ||
|
|
dd801d1571 | ||
|
|
485730483b | ||
|
|
8b6733d792 | ||
|
|
75aabcce64 | ||
|
|
5dfa6b2bb4 | ||
|
|
3798a3c7d0 | ||
|
|
1c4b2243a6 | ||
|
|
c11493ec37 | ||
|
|
b6c8cdae64 | ||
|
|
b80d079d71 | ||
|
|
6512b038c5 | ||
|
|
6d1d497a63 | ||
|
|
6ea7140e8f | ||
|
|
7b311b0e4a | ||
|
|
be3018fe3b | ||
|
|
68095eb392 | ||
|
|
4bb34e4801 | ||
|
|
1348607c8f | ||
|
|
2f86779a27 | ||
|
|
2af632a46d | ||
|
|
05606f72ad | ||
|
|
6d0701e0fa | ||
|
|
76cdc17f3b | ||
|
|
7b076eadfa | ||
|
|
c5ce2a0a94 | ||
|
|
7fcc84156e | ||
|
|
75bf12db7a | ||
|
|
07de96459e | ||
|
|
be036aa9c8 | ||
|
|
0664895670 | ||
|
|
dde1e4bc0f | ||
|
|
122de63b71 | ||
|
|
e3ba880e18 | ||
|
|
e3be15531f | ||
|
|
5a3ff4e3dc | ||
|
|
f7f32f00a3 | ||
|
|
d7d694b14f | ||
|
|
a6feb6dd66 | ||
|
|
ecf10e41c3 | ||
|
|
481edc1cfe | ||
|
|
ff5817ab50 | ||
|
|
80235bf049 | ||
|
|
ecddd5a7be | ||
|
|
f22fc788e5 | ||
|
|
f828a582c3 | ||
|
|
a94f94f352 | ||
|
|
9f34a01577 | ||
|
|
9cd49ed485 | ||
|
|
4ea1a05af6 | ||
|
|
b6eb6d477b | ||
|
|
cce18d8e2e | ||
|
|
45d469ca5c | ||
|
|
fbee714ffe | ||
|
|
2429dcc2e2 | ||
|
|
4d84422f22 | ||
|
|
d98bfbde58 | ||
|
|
983787a8f2 | ||
|
|
7b83c22e78 | ||
|
|
c8c43b2811 | ||
|
|
7e32e2efcf | ||
|
|
6f8e842105 | ||
|
|
ce99c0aa0f | ||
|
|
3ff165402c | ||
|
|
a350a76a00 | ||
|
|
05b9dd1822 | ||
|
|
5207b1c127 | ||
|
|
267c351735 | ||
|
|
f545418e55 | ||
|
|
97dd832d2e | ||
|
|
d7e7d87581 | ||
|
|
bd2efeaaa3 | ||
|
|
a206bf56b9 | ||
|
|
a33e94c4ee | ||
|
|
e9313b1c9d | ||
|
|
8096935d87 | ||
|
|
dcb083abb0 | ||
|
|
6cc76fe6ab | ||
|
|
4f8de1881c | ||
|
|
746a8ca17f |
@@ -1,15 +1,8 @@
|
||||
# Known minified files
|
||||
# Ignore "third party" code whose style we will not change.
|
||||
/boot/sjcl.js
|
||||
/core/modules/utils/base64-utf8/base64-utf8.module.js
|
||||
/core/modules/utils/base64-utf8/base64-utf8.module.min.js
|
||||
/core/modules/utils/diff-match-patch/diff_match_patch.js
|
||||
/plugins/tiddlywiki/async/files/async.min.v1.5.0.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/anyword-hint.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/css-hint.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/html-hint.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/javascript-hint.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/show-hint.js
|
||||
/plugins/tiddlywiki/codemirror-autocomplete/files/addon/hint/xml-hint.js
|
||||
/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/closebrackets.js
|
||||
/plugins/tiddlywiki/codemirror-closebrackets/files/addon/edit/matchbrackets.js
|
||||
/plugins/tiddlywiki/codemirror-closetag/files/addon/edit/closetag.js
|
||||
/plugins/tiddlywiki/codemirror-closetag/files/addon/fold/xml-fold.js
|
||||
/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js
|
||||
/core/modules/utils/dom/csscolorparser.js
|
||||
/plugins/tiddlywiki/*/files/
|
||||
|
||||
@@ -64,7 +64,23 @@ rules:
|
||||
init-declarations: 'off'
|
||||
jsx-quotes: error
|
||||
key-spacing: 'off'
|
||||
keyword-spacing: 'off'
|
||||
keyword-spacing:
|
||||
- error
|
||||
- before: true
|
||||
after: false
|
||||
overrides:
|
||||
'case':
|
||||
after: true
|
||||
'do':
|
||||
'after': true
|
||||
'else':
|
||||
after: true
|
||||
'return':
|
||||
after: true
|
||||
'throw':
|
||||
after: true
|
||||
'try':
|
||||
after: true
|
||||
line-comment-position: 'off'
|
||||
linebreak-style: 'off'
|
||||
lines-around-comment: 'off'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Default to the current version number for building the plugin library
|
||||
|
||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||
TW5_BUILD_VERSION=v5.2.0
|
||||
TW5_BUILD_VERSION=v5.2.2
|
||||
fi
|
||||
|
||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||
|
||||
@@ -2649,3 +2649,4 @@ if(typeof(exports) !== "undefined") {
|
||||
} else {
|
||||
_boot(window.$tw);
|
||||
}
|
||||
//# sourceURL=$:/boot/boot.js
|
||||
|
||||
@@ -117,3 +117,4 @@ if(typeof(exports) === "undefined") {
|
||||
// Export functionality as a module
|
||||
exports.bootprefix = _bootprefix;
|
||||
}
|
||||
//# sourceURL=$:/boot/bootprefix.js
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@ type: text/plain
|
||||
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
|
||||
|
||||
Copyright (c) 2004-2007, Jeremy Ruston
|
||||
Copyright (c) 2007-2021, UnaMesa Association
|
||||
Copyright (c) 2007-2022, UnaMesa Association
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -27,10 +27,15 @@ Basics/Tiddlers/Prompt: Number of tiddlers
|
||||
Basics/Title/Prompt: Title of this ~TiddlyWiki
|
||||
Basics/Username/Prompt: Username for signing edits
|
||||
Basics/Version/Prompt: ~TiddlyWiki version
|
||||
Cascades/Caption: Cascades
|
||||
Cascades/Hint: These global rules are used to dynamically choose certain templates. The result of the cascade is the result of the first filter in the sequence that returns a result
|
||||
Cascades/TagPrompt: Filters tagged <$macrocall $name="tag" tag=<<currentTiddler>>/>
|
||||
EditorTypes/Caption: Editor Types
|
||||
EditorTypes/Editor/Caption: Editor
|
||||
EditorTypes/Hint: These tiddlers determine which editor is used to edit specific tiddler types.
|
||||
EditorTypes/Type/Caption: Type
|
||||
EditTemplateBody/Caption: Edit Template Body
|
||||
EditTemplateBody/Hint: This rule cascade is used by the default edit template to dynamically choose the template for editing the body of a tiddler.
|
||||
Info/Caption: Info
|
||||
Info/Hint: Information about this TiddlyWiki
|
||||
KeyboardShortcuts/Add/Prompt: Type shortcut here
|
||||
@@ -191,6 +196,8 @@ Settings/TitleLinks/Yes/Description: Display tiddler titles as links
|
||||
Settings/MissingLinks/Caption: Wiki Links
|
||||
Settings/MissingLinks/Hint: Choose whether to link to tiddlers that do not exist yet
|
||||
Settings/MissingLinks/Description: Enable links to missing tiddlers
|
||||
StoryTiddler/Caption: Story Tiddler
|
||||
StoryTiddler/Hint: This rule cascade is used to dynamically choose the template for displaying a tiddler in the story river.
|
||||
StoryView/Caption: Story View
|
||||
StoryView/Prompt: Current view:
|
||||
Stylesheets/Caption: Stylesheets
|
||||
@@ -201,6 +208,10 @@ Theme/Caption: Theme
|
||||
Theme/Prompt: Current theme:
|
||||
TiddlerFields/Caption: Tiddler Fields
|
||||
TiddlerFields/Hint: This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers).
|
||||
TiddlerColour/Caption: Tiddler Colour
|
||||
TiddlerColour/Hint: This rules cascade is used to dynamically choose the colour for a tiddler (used for the icon and the associated tag pill).
|
||||
TiddlerIcon/Caption: Tiddler Icon
|
||||
TiddlerIcon/Hint: This rules cascade is used to dynamically choose the icon for a tiddler.
|
||||
Toolbars/Caption: Toolbars
|
||||
Toolbars/EditToolbar/Caption: Edit Toolbar
|
||||
Toolbars/EditToolbar/Hint: Choose which buttons are displayed for tiddlers in edit mode. Drag and drop to change the ordering
|
||||
@@ -212,3 +223,7 @@ Toolbars/EditorToolbar/Hint: Choose which buttons are displayed in the editor to
|
||||
Toolbars/ViewToolbar/Caption: View Toolbar
|
||||
Toolbars/ViewToolbar/Hint: Choose which buttons are displayed for tiddlers in view mode. Drag and drop to change the ordering
|
||||
Tools/Download/Full/Caption: Download full wiki
|
||||
ViewTemplateBody/Caption: View Template Body
|
||||
ViewTemplateBody/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the body of a tiddler.
|
||||
ViewTemplateTitle/Caption: View Template Title
|
||||
ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler.
|
||||
@@ -3,6 +3,7 @@ title: $:/language/Docs/Fields/
|
||||
_canonical_uri: The full URI of an external image tiddler
|
||||
bag: The name of the bag from which a tiddler came
|
||||
caption: The text to be displayed on a tab or button
|
||||
code-body: The view template will display the tiddler as code if set to ''yes''
|
||||
color: The CSS color value associated with a tiddler
|
||||
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
||||
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
|
||||
@@ -13,9 +14,9 @@ description: The descriptive text for a plugin, or a modal dialogue
|
||||
draft.of: For draft tiddlers, contains the title of the tiddler of which this is a draft
|
||||
draft.title: For draft tiddlers, contains the proposed new title of the tiddler
|
||||
footer: The footer text for a wizard
|
||||
hide-body: The view template will hide bodies of tiddlers if set to: ''yes''
|
||||
hide-body: The view template will hide bodies of tiddlers if set to ''yes''
|
||||
icon: The title of the tiddler containing the icon associated with a tiddler
|
||||
library: Indicates that a tiddler should be saved as a JavaScript library if set to: ''yes''
|
||||
library: Indicates that a tiddler should be saved as a JavaScript library if set to ''yes''
|
||||
list: An ordered list of tiddler titles associated with a tiddler
|
||||
list-before: If set, the title of a tiddler before which this tiddler should be added to the ordered list of tiddler titles, or at the start of the list if this field is present but empty
|
||||
list-after: If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles, or at the end of the list if this field is present but empty
|
||||
@@ -32,7 +33,7 @@ tags: A list of tags associated with a tiddler
|
||||
text: The body text of a tiddler
|
||||
throttle.refresh: If present, throttles refreshes of this tiddler
|
||||
title: The unique name of a tiddler
|
||||
toc-link: Suppresses the tiddler's link in a Table of Contents tree if set to: ''no''
|
||||
toc-link: Suppresses the tiddler's link in a Table of Contents tree if set to ''no''
|
||||
type: The content type of a tiddler
|
||||
version: Version information for a plugin
|
||||
_is_skinny: If present, indicates that the tiddler text field must be loaded from the server
|
||||
|
||||
@@ -14,7 +14,7 @@ ConfirmAction: Do you wish to proceed?
|
||||
Count: count
|
||||
DefaultNewTiddlerTitle: New Tiddler
|
||||
Diffs/CountMessage: <<diff-count>> differences
|
||||
DropMessage: Drop here (or use the 'Escape' key to cancel)
|
||||
DropMessage: Drop now (or use the 'Escape' key to cancel)
|
||||
Encryption/Cancel: Cancel
|
||||
Encryption/ConfirmClearPassword: Do you wish to clear the password? This will remove the encryption applied when saving this wiki
|
||||
Encryption/PromptSetPassword: Set a new password for this TiddlyWiki
|
||||
|
||||
@@ -324,7 +324,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
||||
If there are no Files, let the browser handle it.
|
||||
*/
|
||||
EditTextWidget.prototype.handleDropEvent = function(event) {
|
||||
if(event.dataTransfer.files.length) {
|
||||
if($tw.utils.dragEventContainsFiles(event)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.dispatchDOMEvent(this.cloneEvent(event,["dataTransfer"]));
|
||||
|
||||
@@ -13,15 +13,17 @@ Text editor operation to wrap the selected lines with a prefix and suffix
|
||||
"use strict";
|
||||
|
||||
exports["wrap-lines"] = function(event,operation) {
|
||||
var prefix = event.paramObject.prefix || "",
|
||||
suffix = event.paramObject.suffix || "";
|
||||
// Cut just past the preceding line break, or the start of the text
|
||||
operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
|
||||
// Cut to just past the following line break, or to the end of the text
|
||||
operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
|
||||
// Add the prefix and suffix
|
||||
operation.replacement = event.paramObject.prefix + "\n" +
|
||||
operation.replacement = prefix + "\n" +
|
||||
operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
|
||||
event.paramObject.suffix + "\n";
|
||||
operation.newSelStart = operation.cutStart + event.paramObject.prefix.length + 1;
|
||||
suffix + "\n";
|
||||
operation.newSelStart = operation.cutStart + prefix.length + 1;
|
||||
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
|
||||
};
|
||||
|
||||
|
||||
53
core/modules/filterrunprefixes/cascade.js
Normal file
53
core/modules/filterrunprefixes/cascade.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*\
|
||||
title: $:/core/modules/filterrunprefixes/cascade.js
|
||||
type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter prefix function
|
||||
*/
|
||||
exports.cascade = function(operationSubFunction,options) {
|
||||
return function(results,source,widget) {
|
||||
if(results.length !== 0) {
|
||||
var filterList = operationSubFunction(source,widget),
|
||||
filterFnList = [];
|
||||
var inputResults = results.toArray();
|
||||
results.clear();
|
||||
$tw.utils.each(inputResults,function(title) {
|
||||
var result = ""; // If no filter matches, we return an empty string
|
||||
$tw.utils.each(filterList,function(filter,index) {
|
||||
if(!filterFnList[index]) {
|
||||
filterFnList[index] = options.wiki.compileFilter(filter);
|
||||
}
|
||||
var output = filterFnList[index](options.wiki.makeTiddlerIterator([title]),{
|
||||
getVariable: function(name,opts) {
|
||||
opts = opts || {};
|
||||
opts.variables = {
|
||||
"currentTiddler": "" + title,
|
||||
"..currentTiddler": widget.getVariable("currentTiddler")
|
||||
};
|
||||
if(name in opts.variables) {
|
||||
return opts.variables[name];
|
||||
} else {
|
||||
return widget.getVariable(name,opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
if(output.length !== 0) {
|
||||
result = output[0];
|
||||
return false;
|
||||
}
|
||||
});
|
||||
results.push(result);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -16,23 +16,30 @@ Export our filter function
|
||||
exports.filter = function(operationSubFunction,options) {
|
||||
return function(results,source,widget) {
|
||||
if(results.length > 0) {
|
||||
var resultsToRemove = [];
|
||||
var resultsToRemove = [],
|
||||
index = 0;
|
||||
results.each(function(title) {
|
||||
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
|
||||
getVariable: function(name) {
|
||||
switch(name) {
|
||||
case "currentTiddler":
|
||||
return "" + title;
|
||||
case "..currentTiddler":
|
||||
return widget.getVariable("currentTiddler");
|
||||
default:
|
||||
return widget.getVariable(name);
|
||||
getVariable: function(name,opts) {
|
||||
opts = opts || {};
|
||||
opts.variables = {
|
||||
"currentTiddler": "" + title,
|
||||
"..currentTiddler": widget.getVariable("currentTiddler"),
|
||||
"index": "" + index,
|
||||
"revIndex": "" + (results.length - 1 - index),
|
||||
"length": "" + results.length
|
||||
};
|
||||
if(name in opts.variables) {
|
||||
return opts.variables[name];
|
||||
} else {
|
||||
return widget.getVariable(name,opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
if(filtered.length === 0) {
|
||||
resultsToRemove.push(title);
|
||||
}
|
||||
++index;
|
||||
});
|
||||
results.remove(resultsToRemove);
|
||||
}
|
||||
|
||||
@@ -20,20 +20,19 @@ exports.map = function(operationSubFunction,options) {
|
||||
results.clear();
|
||||
$tw.utils.each(inputTitles,function(title) {
|
||||
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
|
||||
getVariable: function(name) {
|
||||
switch(name) {
|
||||
case "currentTiddler":
|
||||
return "" + title;
|
||||
case "..currentTiddler":
|
||||
return widget.getVariable("currentTiddler");
|
||||
case "index":
|
||||
return "" + index;
|
||||
case "revIndex":
|
||||
return "" + (inputTitles.length - 1 - index);
|
||||
case "length":
|
||||
return "" + inputTitles.length;
|
||||
default:
|
||||
return widget.getVariable(name);
|
||||
getVariable: function(name,opts) {
|
||||
opts = opts || {};
|
||||
opts.variables = {
|
||||
"currentTiddler": "" + title,
|
||||
"..currentTiddler": widget.getVariable("currentTiddler"),
|
||||
"index": "" + index,
|
||||
"revIndex": "" + (inputTitles.length - 1 - index),
|
||||
"length": "" + inputTitles.length
|
||||
};
|
||||
if(name in opts.variables) {
|
||||
return opts.variables[name];
|
||||
} else {
|
||||
return widget.getVariable(name,opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,26 +15,24 @@ Export our filter prefix function
|
||||
exports.reduce = function(operationSubFunction,options) {
|
||||
return function(results,source,widget) {
|
||||
if(results.length > 0) {
|
||||
var accumulator = "";
|
||||
var index = 0;
|
||||
var accumulator = "",
|
||||
index = 0;
|
||||
results.each(function(title) {
|
||||
var list = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
|
||||
getVariable: function(name) {
|
||||
switch(name) {
|
||||
case "currentTiddler":
|
||||
return "" + title;
|
||||
case "..currentTiddler":
|
||||
return widget.getVariable("currentTiddler");
|
||||
case "accumulator":
|
||||
return "" + accumulator;
|
||||
case "index":
|
||||
return "" + index;
|
||||
case "revIndex":
|
||||
return "" + (results.length - 1 - index);
|
||||
case "length":
|
||||
return "" + results.length;
|
||||
default:
|
||||
return widget.getVariable(name);
|
||||
getVariable: function(name,opts) {
|
||||
opts = opts || {};
|
||||
opts.variables = {
|
||||
"currentTiddler": "" + title,
|
||||
"..currentTiddler": widget.getVariable("currentTiddler"),
|
||||
"index": "" + index,
|
||||
"revIndex": "" + (results.length - 1 - index),
|
||||
"length": "" + results.length,
|
||||
"accumulator": "" + accumulator
|
||||
};
|
||||
if(name in opts.variables) {
|
||||
return opts.variables[name];
|
||||
} else {
|
||||
return widget.getVariable(name,opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -26,14 +26,16 @@ exports.sort = function(operationSubFunction,options) {
|
||||
compareFn;
|
||||
results.each(function(title) {
|
||||
var key = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
|
||||
getVariable: function(name) {
|
||||
switch(name) {
|
||||
case "currentTiddler":
|
||||
return "" + title;
|
||||
case "..currentTiddler":
|
||||
return widget.getVariable("currentTiddler");
|
||||
default:
|
||||
return widget.getVariable(name);
|
||||
getVariable: function(name,opts) {
|
||||
opts = opts || {};
|
||||
opts.variables = {
|
||||
"currentTiddler": "" + title,
|
||||
"..currentTiddler": widget.getVariable("currentTiddler")
|
||||
};
|
||||
if(name in opts.variables) {
|
||||
return opts.variables[name];
|
||||
} else {
|
||||
return widget.getVariable(name,opts);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -95,10 +95,12 @@ function parseFilterOperation(operators,filterString,p) {
|
||||
if(nextBracketPos === -1) {
|
||||
throw "Missing closing bracket in filter expression";
|
||||
}
|
||||
if(!operator.regexp) {
|
||||
if(operator.regexp) {
|
||||
operand.text = "";
|
||||
} else {
|
||||
operand.text = filterString.substring(p,nextBracketPos);
|
||||
operator.operands.push(operand);
|
||||
}
|
||||
operator.operands.push(operand);
|
||||
p = nextBracketPos + 1;
|
||||
}
|
||||
|
||||
|
||||
27
core/modules/filters/crypto.js
Normal file
27
core/modules/filters/crypto.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/crypto.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operators for cryptography, using the Stanford JavaScript library
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.sha256 = function(source,operator,options) {
|
||||
var results = [],
|
||||
length = parseInt(operator.operand,10) || 20,
|
||||
sha256 = function(text) {
|
||||
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length);
|
||||
};
|
||||
source(function(tiddler,title) {
|
||||
results.push(sha256(title));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -5,9 +5,11 @@ module-type: filteroperator
|
||||
|
||||
Filter operator that looks up values via a title prefix
|
||||
|
||||
[lookup:<field>[<prefix>]]
|
||||
[lookup:<defaultvalue>:<field OR index>[<prefix>],[<field-name OR index-name>]]
|
||||
|
||||
Prepends the prefix to the selected items and returns the specified field value
|
||||
Prepends the prefix to the selected items and returns the specified
|
||||
field or index value. If the 2nd suffix does not exist, it defaults to field.
|
||||
If the second operand is missing it defaults to "text" for fields, and "0" for indexes
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@@ -20,10 +22,31 @@ Prepends the prefix to the selected items and returns the specified field value
|
||||
Export our filter function
|
||||
*/
|
||||
exports.lookup = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
results.push(options.wiki.getTiddlerText(operator.operand + title) || operator.suffix || '');
|
||||
});
|
||||
var results = [],
|
||||
suffixes = operator.suffixes || [],
|
||||
defaultSuffix = suffixes[0] ? (suffixes[0][0] || "") : "",
|
||||
indexSuffix = (suffixes[1] && suffixes[1][0] === "index") ? true : false,
|
||||
target;
|
||||
if(operator.operands.length == 2) {
|
||||
target = operator.operands[1]
|
||||
} else {
|
||||
target = indexSuffix ? "0": "text";
|
||||
}
|
||||
if(indexSuffix) {
|
||||
source(function(tiddler,title) {
|
||||
var data = options.wiki.extractTiddlerDataItem(operator.operands[0]+title,target,defaultSuffix);
|
||||
results.push(data);
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
var value = defaultSuffix;
|
||||
var targetTiddler = options.wiki.getTiddler(operator.operands[0]+title);
|
||||
if(targetTiddler && targetTiddler.getFieldString(target)) {
|
||||
value = targetTiddler.getFieldString(target);
|
||||
}
|
||||
results.push(value);
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ exports.search = function(source,operator,options) {
|
||||
invert: invert,
|
||||
field: fields,
|
||||
excludeField: excludeFields,
|
||||
some: hasFlag("some"),
|
||||
caseSensitive: hasFlag("casesensitive"),
|
||||
literal: hasFlag("literal"),
|
||||
whitespace: hasFlag("whitespace"),
|
||||
|
||||
@@ -239,7 +239,7 @@ exports.parseFilterVariable = function(source) {
|
||||
};
|
||||
|
||||
/*
|
||||
Look for an HTML attribute definition. Returns null if not found, otherwise returns {type: "attribute", name:, valueType: "string|indirect|macro", value:, start:, end:,}
|
||||
Look for an HTML attribute definition. Returns null if not found, otherwise returns {type: "attribute", name:, type: "filtered|string|indirect|macro", value|filter|textReference:, start:, end:,}
|
||||
*/
|
||||
exports.parseAttribute = function(source,pos) {
|
||||
var node = {
|
||||
@@ -248,7 +248,7 @@ exports.parseAttribute = function(source,pos) {
|
||||
// Define our regexps
|
||||
var reAttributeName = /([^\/\s>"'=]+)/g,
|
||||
reUnquotedAttribute = /([^\/\s<>"'=]+)/g,
|
||||
reFilteredValue = /\{\{\{(.+?)\}\}\}/g,
|
||||
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
||||
reIndirectValue = /\{\{([^\}]+)\}\}/g;
|
||||
// Skip whitespace
|
||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||
|
||||
@@ -34,7 +34,6 @@ function Server(options) {
|
||||
this.authenticators = options.authenticators || [];
|
||||
this.wiki = options.wiki;
|
||||
this.boot = options.boot || $tw.boot;
|
||||
this.servername = $tw.utils.transliterateToSafeASCII(this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
||||
// Initialise the variables
|
||||
this.variables = $tw.utils.extend({},this.defaultVariables);
|
||||
if(options.variables) {
|
||||
@@ -44,7 +43,8 @@ function Server(options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$tw.utils.extend({},this.defaultVariables,options.variables);
|
||||
// Setup the default required plugins
|
||||
this.requiredPlugins = this.get("required-plugins").split(',');
|
||||
// Initialise CSRF
|
||||
this.csrfDisable = this.get("csrf-disable") === "yes";
|
||||
// Initialize Gzip compression
|
||||
@@ -52,14 +52,24 @@ function Server(options) {
|
||||
// Initialize browser-caching
|
||||
this.enableBrowserCache = this.get("use-browser-cache") === "yes";
|
||||
// Initialise authorization
|
||||
var authorizedUserName = (this.get("username") && this.get("password")) ? this.get("username") : "(anon)";
|
||||
var authorizedUserName;
|
||||
if(this.get("username") && this.get("password")) {
|
||||
authorizedUserName = this.get("username");
|
||||
} else if(this.get("credentials")) {
|
||||
authorizedUserName = "(authenticated)";
|
||||
} else {
|
||||
authorizedUserName = "(anon)";
|
||||
}
|
||||
this.authorizationPrincipals = {
|
||||
readers: (this.get("readers") || authorizedUserName).split(",").map($tw.utils.trim),
|
||||
writers: (this.get("writers") || authorizedUserName).split(",").map($tw.utils.trim)
|
||||
}
|
||||
if(this.get("admin") || authorizedUserName !== "(anon)") {
|
||||
this.authorizationPrincipals["admin"] = (this.get("admin") || authorizedUserName).split(',').map($tw.utils.trim)
|
||||
}
|
||||
// Load and initialise authenticators
|
||||
$tw.modules.forEachModuleOfType("authenticator", function(title,authenticatorDefinition) {
|
||||
// console.log("Loading server route " + title);
|
||||
// console.log("Loading authenticator " + title);
|
||||
self.addAuthenticator(authenticatorDefinition.AuthenticatorClass);
|
||||
});
|
||||
// Load route handlers
|
||||
@@ -71,15 +81,21 @@ function Server(options) {
|
||||
this.listenOptions = null;
|
||||
this.protocol = "http";
|
||||
var tlsKeyFilepath = this.get("tls-key"),
|
||||
tlsCertFilepath = this.get("tls-cert");
|
||||
tlsCertFilepath = this.get("tls-cert"),
|
||||
tlsPassphrase = this.get("tls-passphrase");
|
||||
if(tlsCertFilepath && tlsKeyFilepath) {
|
||||
this.listenOptions = {
|
||||
key: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsKeyFilepath),"utf8"),
|
||||
cert: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsCertFilepath),"utf8")
|
||||
cert: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsCertFilepath),"utf8"),
|
||||
passphrase: tlsPassphrase || ''
|
||||
};
|
||||
this.protocol = "https";
|
||||
}
|
||||
this.transport = require(this.protocol);
|
||||
// Name the server and init the boot state
|
||||
this.servername = $tw.utils.transliterateToSafeASCII(this.get("server-name") || this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
||||
this.boot.origin = this.get("origin")? this.get("origin"): this.protocol+"://"+this.get("host")+":"+this.get("port");
|
||||
this.boot.pathPrefix = this.get("path-prefix") || "";
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -150,6 +166,7 @@ function sendResponse(request,response,statusCode,headers,data,encoding) {
|
||||
Server.prototype.defaultVariables = {
|
||||
port: "8080",
|
||||
host: "127.0.0.1",
|
||||
"required-plugins": "$:/plugins/tiddlywiki/filesystem,$:/plugins/tiddlywiki/tiddlyweb",
|
||||
"root-tiddler": "$:/core/save/all",
|
||||
"root-render-type": "text/plain",
|
||||
"root-serve-type": "text/html",
|
||||
@@ -239,15 +256,15 @@ Server.prototype.requestHandler = function(request,response,options) {
|
||||
state.pathPrefix = options.pathPrefix || this.get("path-prefix") || "";
|
||||
state.sendResponse = sendResponse.bind(self,request,response);
|
||||
// Get the principals authorized to access this resource
|
||||
var authorizationType = this.methodMappings[request.method] || "readers";
|
||||
state.authorizationType = options.authorizationType || this.methodMappings[request.method] || "readers";
|
||||
// Check for the CSRF header if this is a write
|
||||
if(!this.csrfDisable && authorizationType === "writers" && request.headers["x-requested-with"] !== "TiddlyWiki") {
|
||||
if(!this.csrfDisable && state.authorizationType === "writers" && request.headers["x-requested-with"] !== "TiddlyWiki") {
|
||||
response.writeHead(403,"'X-Requested-With' header required to login to '" + this.servername + "'");
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
// Check whether anonymous access is granted
|
||||
state.allowAnon = this.isAuthorized(authorizationType,null);
|
||||
state.allowAnon = this.isAuthorized(state.authorizationType,null);
|
||||
// Authenticate with the first active authenticator
|
||||
if(this.authenticators.length > 0) {
|
||||
if(!this.authenticators[0].authenticateRequest(request,response,state)) {
|
||||
@@ -256,7 +273,7 @@ Server.prototype.requestHandler = function(request,response,options) {
|
||||
}
|
||||
}
|
||||
// Authorize with the authenticated username
|
||||
if(!this.isAuthorized(authorizationType,state.authenticatedUsername)) {
|
||||
if(!this.isAuthorized(state.authorizationType,state.authenticatedUsername)) {
|
||||
response.writeHead(401,"'" + state.authenticatedUsername + "' is not authorized to access '" + this.servername + "'");
|
||||
response.end();
|
||||
return;
|
||||
@@ -322,8 +339,16 @@ Server.prototype.listen = function(port,host,prefix) {
|
||||
port = process.env[port] || 8080;
|
||||
}
|
||||
// Warn if required plugins are missing
|
||||
if(!this.wiki.getTiddler("$:/plugins/tiddlywiki/tiddlyweb") || !this.wiki.getTiddler("$:/plugins/tiddlywiki/filesystem")) {
|
||||
$tw.utils.warning("Warning: Plugins required for client-server operation (\"tiddlywiki/filesystem\" and \"tiddlywiki/tiddlyweb\") are missing from tiddlywiki.info file");
|
||||
var missing = [];
|
||||
for (var index=0; index<this.requiredPlugins.length; index++) {
|
||||
if (!this.wiki.getTiddler(this.requiredPlugins[index])) {
|
||||
missing.push(this.requiredPlugins[index]);
|
||||
}
|
||||
}
|
||||
if(missing.length > 0) {
|
||||
var error = "Warning: Plugin(s) required for client-server operation are missing.\n"+
|
||||
"\""+ missing.join("\", \"")+"\"";
|
||||
$tw.utils.warning(error);
|
||||
}
|
||||
// Create the server
|
||||
var server;
|
||||
|
||||
@@ -51,6 +51,20 @@ exports.startup = function() {
|
||||
element.focus(event.paramObject);
|
||||
}
|
||||
});
|
||||
// Install the tm-rename-tiddler and tm-relink-tiddler messages
|
||||
var makeRenameHandler = function(method) {
|
||||
return function(event) {
|
||||
var options = {},
|
||||
paramObject = event.paramObject || {},
|
||||
from = paramObject.from || event.tiddlerTitle,
|
||||
to = paramObject.to;
|
||||
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
|
||||
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
|
||||
$tw.wiki[method](from,to,options);
|
||||
};
|
||||
};
|
||||
$tw.rootWidget.addEventListener("tm-rename-tiddler",makeRenameHandler("renameTiddler"));
|
||||
$tw.rootWidget.addEventListener("tm-relink-tiddler",makeRenameHandler("relinkTiddler"));
|
||||
// Install the scroller
|
||||
$tw.pageScroller = new $tw.utils.PageScroller();
|
||||
$tw.rootWidget.addEventListener("tm-scroll",function(event) {
|
||||
|
||||
@@ -32,13 +32,15 @@ exports.startup = function() {
|
||||
template = paramObject.template || "$:/core/templates/single.tiddler.window",
|
||||
width = paramObject.width || "700",
|
||||
height = paramObject.height || "600",
|
||||
top = paramObject.top,
|
||||
left = paramObject.left,
|
||||
variables = $tw.utils.extend({},paramObject,{currentTiddler: title});
|
||||
// Open the window
|
||||
var srcWindow,
|
||||
srcDocument;
|
||||
// In case that popup blockers deny opening a new window
|
||||
try {
|
||||
srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
|
||||
srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height + (top ? ",top=" + top : "" ) + (left ? ",left=" + left : "" )),
|
||||
srcDocument = srcWindow.document;
|
||||
}
|
||||
catch(e) {
|
||||
|
||||
@@ -24,13 +24,13 @@ exports.isDraft = function() {
|
||||
return this.hasField("draft.of");
|
||||
};
|
||||
|
||||
exports.getFieldString = function(field) {
|
||||
exports.getFieldString = function(field,defaultValue) {
|
||||
var value = this.fields[field];
|
||||
// Check for a missing field
|
||||
if(value === undefined || value === null) {
|
||||
return "";
|
||||
return defaultValue || "";
|
||||
}
|
||||
// Parse the field with the associated module (if any)
|
||||
// Stringify the field with the associated tiddler field module (if any)
|
||||
var fieldModule = $tw.Tiddler.fieldModules[field];
|
||||
if(fieldModule && fieldModule.stringify) {
|
||||
return fieldModule.stringify.call(this,value);
|
||||
|
||||
@@ -21,7 +21,7 @@ exports.extractEncryptedStoreArea = function(text) {
|
||||
if(encryptedStoreAreaStart !== -1) {
|
||||
var encryptedStoreAreaEnd = text.indexOf("</pre>",encryptedStoreAreaStart);
|
||||
if(encryptedStoreAreaEnd !== -1) {
|
||||
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd-1));
|
||||
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -208,10 +208,10 @@ function parseJSONTiddlers(json,fallbackTitle) {
|
||||
return data;
|
||||
};
|
||||
|
||||
exports.dragEventContainsFiles = function(event) {
|
||||
function dragEventContainsType(event,targetType) {
|
||||
if(event.dataTransfer.types) {
|
||||
for(var i=0; i<event.dataTransfer.types.length; i++) {
|
||||
if(event.dataTransfer.types[i] === "Files") {
|
||||
if(event.dataTransfer.types[i] === targetType) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
@@ -220,4 +220,10 @@ exports.dragEventContainsFiles = function(event) {
|
||||
return false;
|
||||
};
|
||||
|
||||
exports.dragEventContainsFiles = function(event) {
|
||||
return (dragEventContainsType(event,"Files") && !dragEventContainsType(event,"text/plain"));
|
||||
};
|
||||
|
||||
exports.dragEventContainsType = dragEventContainsType;
|
||||
|
||||
})();
|
||||
|
||||
@@ -49,10 +49,14 @@ Handle an event
|
||||
*/
|
||||
PageScroller.prototype.handleEvent = function(event) {
|
||||
if(event.type === "tm-scroll") {
|
||||
var options = {};
|
||||
if($tw.utils.hop(event.paramObject,"animationDuration")) {
|
||||
options.animationDuration = event.paramObject.animationDuration;
|
||||
}
|
||||
if(event.paramObject && event.paramObject.selector) {
|
||||
this.scrollSelectorIntoView(null,event.paramObject.selector);
|
||||
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
|
||||
} else {
|
||||
this.scrollIntoView(event.target);
|
||||
this.scrollIntoView(event.target,null,options);
|
||||
}
|
||||
return false; // Event was handled
|
||||
}
|
||||
@@ -62,10 +66,10 @@ PageScroller.prototype.handleEvent = function(event) {
|
||||
/*
|
||||
Handle a scroll event hitting the page document
|
||||
*/
|
||||
PageScroller.prototype.scrollIntoView = function(element,callback) {
|
||||
PageScroller.prototype.scrollIntoView = function(element,callback,options) {
|
||||
var self = this,
|
||||
duration = $tw.utils.getAnimationDuration(),
|
||||
srcWindow = element ? element.ownerDocument.defaultView : window;
|
||||
duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
|
||||
srcWindow = element ? element.ownerDocument.defaultView : window;
|
||||
// Now get ready to scroll the body
|
||||
this.cancelScroll(srcWindow);
|
||||
this.startTime = Date.now();
|
||||
@@ -122,11 +126,11 @@ PageScroller.prototype.scrollIntoView = function(element,callback) {
|
||||
drawFrame();
|
||||
};
|
||||
|
||||
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
|
||||
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
|
||||
baseElement = baseElement || document.body;
|
||||
var element = baseElement.querySelector(selector);
|
||||
if(element) {
|
||||
this.scrollIntoView(element,callback);
|
||||
this.scrollIntoView(element,callback,options);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -198,7 +198,8 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
|
||||
this.resetState();
|
||||
// Import any files in the drop
|
||||
var numFiles = 0;
|
||||
if(dataTransfer.files) {
|
||||
// If we have type text/vnd.tiddlywiki then skip trying to import files
|
||||
if(dataTransfer.files && !$tw.utils.dragEventContainsType(event,"text/vnd.tiddler")) {
|
||||
numFiles = this.wiki.readFiles(dataTransfer.files,{
|
||||
callback: readFileCallback,
|
||||
deserializer: this.dropzoneDeserializer
|
||||
|
||||
@@ -111,6 +111,16 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.imageAlt) {
|
||||
domNode.setAttribute("alt",this.imageAlt);
|
||||
}
|
||||
// Add classes when the image loads or fails
|
||||
$tw.utils.addClass(domNode,"tc-image-loading");
|
||||
domNode.addEventListener("load",function() {
|
||||
$tw.utils.removeClass(domNode,"tc-image-loading");
|
||||
$tw.utils.addClass(domNode,"tc-image-loaded");
|
||||
},false);
|
||||
domNode.addEventListener("error",function() {
|
||||
$tw.utils.removeClass(domNode,"tc-image-loading");
|
||||
$tw.utils.addClass(domNode,"tc-image-error");
|
||||
},false);
|
||||
// Insert element
|
||||
parent.insertBefore(domNode,nextSibling);
|
||||
this.domNodes.push(domNode);
|
||||
|
||||
@@ -46,7 +46,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
||||
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
||||
// Accumulate the <$set> widgets from each tiddler
|
||||
$tw.utils.each(this.tiddlerList,function(title) {
|
||||
var parser = widgetPointer.wiki.parseTiddler(title);
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true});
|
||||
if(parser) {
|
||||
var parseTreeNode = parser.tree[0];
|
||||
while(parseTreeNode && parseTreeNode.type === "set") {
|
||||
|
||||
@@ -51,6 +51,9 @@ ListWidget.prototype.render = function(parent,nextSibling) {
|
||||
} else {
|
||||
this.storyview = null;
|
||||
}
|
||||
if(this.storyview && this.storyview.renderEnd) {
|
||||
this.storyview.renderEnd();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,8 +44,7 @@ NavigatorWidget.prototype.render = function(parent,nextSibling) {
|
||||
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
|
||||
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
|
||||
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
|
||||
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
|
||||
{type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
|
||||
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
|
||||
]);
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
@@ -636,16 +635,6 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
|
||||
});
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
|
||||
var options = {},
|
||||
paramObject = event.paramObject || {},
|
||||
from = paramObject.from || event.tiddlerTitle,
|
||||
to = paramObject.to;
|
||||
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
|
||||
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
|
||||
this.wiki.renameTiddler(from,to,options);
|
||||
};
|
||||
|
||||
exports.navigator = NavigatorWidget;
|
||||
|
||||
})();
|
||||
|
||||
@@ -64,9 +64,9 @@ RadioWidget.prototype.getValue = function() {
|
||||
tiddler = this.wiki.getTiddler(this.radioTitle);
|
||||
if(tiddler) {
|
||||
if(this.radioIndex) {
|
||||
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex);
|
||||
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex,this.radioDefault);
|
||||
} else {
|
||||
value = tiddler.getFieldString(this.radioField);
|
||||
value = tiddler.getFieldString(this.radioField,this.radioDefault);
|
||||
}
|
||||
} else {
|
||||
value = this.radioDefault;
|
||||
|
||||
@@ -38,10 +38,14 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
|
||||
if(this.outerDomNode.scrollWidth <= this.outerDomNode.offsetWidth && this.outerDomNode.scrollHeight <= this.outerDomNode.offsetHeight && this.fallthrough === "yes") {
|
||||
return true;
|
||||
}
|
||||
var options = {};
|
||||
if($tw.utils.hop(event.paramObject,"animationDuration")) {
|
||||
options.animationDuration = event.paramObject.animationDuration;
|
||||
}
|
||||
if(event.paramObject && event.paramObject.selector) {
|
||||
this.scrollSelectorIntoView(null,event.paramObject.selector);
|
||||
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
|
||||
} else {
|
||||
this.scrollIntoView(event.target);
|
||||
this.scrollIntoView(event.target,null,options);
|
||||
}
|
||||
return false; // Handled event
|
||||
};
|
||||
@@ -49,9 +53,9 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
|
||||
/*
|
||||
Scroll an element into view
|
||||
*/
|
||||
ScrollableWidget.prototype.scrollIntoView = function(element) {
|
||||
var duration = $tw.utils.getAnimationDuration(),
|
||||
srcWindow = element ? element.ownerDocument.defaultView : window;
|
||||
ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) {
|
||||
var duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
|
||||
srcWindow = element ? element.ownerDocument.defaultView : window;
|
||||
this.cancelScroll();
|
||||
this.startTime = Date.now();
|
||||
var scrollPosition = {
|
||||
@@ -114,11 +118,11 @@ ScrollableWidget.prototype.scrollIntoView = function(element) {
|
||||
}
|
||||
};
|
||||
|
||||
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
|
||||
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
|
||||
baseElement = baseElement || document.body;
|
||||
var element = baseElement.querySelector(selector);
|
||||
if(element) {
|
||||
this.scrollIntoView(element,callback);
|
||||
this.scrollIntoView(element,callback,options);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -155,8 +159,6 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) {
|
||||
// Create elements
|
||||
this.outerDomNode = this.document.createElement("div");
|
||||
$tw.utils.setStyle(this.outerDomNode,[
|
||||
{overflowY: "auto"},
|
||||
{overflowX: "auto"},
|
||||
{webkitOverflowScrolling: "touch"}
|
||||
]);
|
||||
this.innerDomNode = this.document.createElement("div");
|
||||
|
||||
@@ -122,7 +122,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
});
|
||||
// Only substitute variable references if this variable was defined with the \define pragma
|
||||
if(variable.isMacroDefinition) {
|
||||
value = this.substituteVariableReferences(value);
|
||||
value = this.substituteVariableReferences(value,options);
|
||||
}
|
||||
return {
|
||||
text: value,
|
||||
@@ -175,10 +175,10 @@ Widget.prototype.resolveVariableParameters = function(formalParams,actualParams)
|
||||
return results;
|
||||
};
|
||||
|
||||
Widget.prototype.substituteVariableReferences = function(text) {
|
||||
Widget.prototype.substituteVariableReferences = function(text,options) {
|
||||
var self = this;
|
||||
return (text || "").replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
|
||||
return self.getVariable(p1,{defaultValue: ""});
|
||||
return options.variables && options.variables[p1] || (self.getVariable(p1,{defaultValue: ""}));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -314,24 +314,40 @@ excludeEventAttributes: ignores attributes whose name begins with "on"
|
||||
Widget.prototype.assignAttributes = function(domNode,options) {
|
||||
options = options || {};
|
||||
var self = this;
|
||||
$tw.utils.each(this.attributes,function(v,a) {
|
||||
// Check exclusions
|
||||
if(options.excludeEventAttributes && a.substr(0,2) === "on") {
|
||||
v = undefined;
|
||||
var assignAttribute = function(name,value) {
|
||||
// Check for excluded attribute names
|
||||
if(options.excludeEventAttributes && name.substr(0,2) === "on") {
|
||||
value = undefined;
|
||||
}
|
||||
if(v !== undefined) {
|
||||
var b = a.split(":");
|
||||
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
|
||||
try {
|
||||
if (b.length == 2 && b[0] == "xlink"){
|
||||
domNode.setAttributeNS("http://www.w3.org/1999/xlink",b[1],v);
|
||||
} else {
|
||||
domNode.setAttributeNS(null,a,v);
|
||||
if(value !== undefined) {
|
||||
// Handle the xlink: namespace
|
||||
var namespace = null;
|
||||
if(name.substr(0,6) === "xlink:" && name.length > 6) {
|
||||
namespace = "http://www.w3.org/1999/xlink";
|
||||
name = name.substr(6);
|
||||
}
|
||||
// Handle styles
|
||||
if(name.substr(0,6) === "style." && name.length > 6) {
|
||||
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;
|
||||
} else {
|
||||
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
|
||||
try {
|
||||
domNode.setAttributeNS(namespace,name,value);
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// Not all parse tree nodes have the orderedAttributes property
|
||||
if(this.parseTreeNode.orderedAttributes) {
|
||||
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
|
||||
assignAttribute(attribute.name,self.attributes[attribute.name]);
|
||||
});
|
||||
} else {
|
||||
$tw.utils.each(Object.keys(self.attributes).sort(),function(name) {
|
||||
assignAttribute(name,self.attributes[name]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -46,26 +46,31 @@ function relinkTiddler(fromTitle,toTitle,options) {
|
||||
if(!tiddler.fields["plugin-type"] && type !== "application/javascript") {
|
||||
var tags = tiddler.fields.tags ? tiddler.fields.tags.slice(0) : undefined,
|
||||
list = tiddler.fields.list ? tiddler.fields.list.slice(0) : undefined,
|
||||
isModified = false;
|
||||
isModified = false,
|
||||
processList = function(listField) {
|
||||
if(listField && listField.indexOf(fromTitle) !== -1) {
|
||||
// Remove any existing instances of the toTitle
|
||||
var p = listField.indexOf(toTitle);
|
||||
while(p !== -1) {
|
||||
listField.splice(p,1);
|
||||
p = listField.indexOf(toTitle);
|
||||
}
|
||||
// Replace the fromTitle with toTitle
|
||||
$tw.utils.each(listField,function (title,index) {
|
||||
if(title === fromTitle) {
|
||||
listField[index] = toTitle;
|
||||
isModified = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
if(!options.dontRenameInTags) {
|
||||
// Rename tags
|
||||
$tw.utils.each(tags,function (title,index) {
|
||||
if(title === fromTitle) {
|
||||
console.log("Renaming tag '" + tags[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
|
||||
tags[index] = toTitle;
|
||||
isModified = true;
|
||||
}
|
||||
});
|
||||
processList(tags);
|
||||
}
|
||||
if(!options.dontRenameInLists) {
|
||||
// Rename lists
|
||||
$tw.utils.each(list,function (title,index) {
|
||||
if(title === fromTitle) {
|
||||
console.log("Renaming list item '" + list[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
|
||||
list[index] = toTitle;
|
||||
isModified = true;
|
||||
}
|
||||
});
|
||||
processList(list);
|
||||
}
|
||||
if(isModified) {
|
||||
var newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields())
|
||||
|
||||
@@ -639,14 +639,25 @@ Lookup a given tiddler and return a list of all the tiddlers that include it in
|
||||
*/
|
||||
exports.findListingsOfTiddler = function(targetTitle,fieldName) {
|
||||
fieldName = fieldName || "list";
|
||||
var titles = [];
|
||||
this.each(function(tiddler,title) {
|
||||
var list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);
|
||||
if(list && list.indexOf(targetTitle) !== -1) {
|
||||
titles.push(title);
|
||||
}
|
||||
var wiki = this;
|
||||
var listings = this.getGlobalCache("listings-" + fieldName,function() {
|
||||
var listings = Object.create(null);
|
||||
wiki.each(function(tiddler,title) {
|
||||
var list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);
|
||||
if(list) {
|
||||
for(var i = 0; i < list.length; i++) {
|
||||
var listItem = list[i],
|
||||
listing = listings[listItem] || [];
|
||||
if (listing.indexOf(title) === -1) {
|
||||
listing.push(title);
|
||||
}
|
||||
listings[listItem] = listing;
|
||||
}
|
||||
}
|
||||
});
|
||||
return listings;
|
||||
});
|
||||
return titles;
|
||||
return listings[targetTitle] || [];
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1201,23 +1212,28 @@ Return an array of tiddler titles that match a search string
|
||||
text: The text string to search for
|
||||
options: see below
|
||||
Options available:
|
||||
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
|
||||
source: an iterator function for the source tiddlers, called source(iterator),
|
||||
where iterator is called as iterator(tiddler,title)
|
||||
exclude: An array of tiddler titles to exclude from the search
|
||||
invert: If true returns tiddlers that do not contain the specified string
|
||||
caseSensitive: If true forces a case sensitive search
|
||||
field: If specified, restricts the search to the specified field, or an array of field names
|
||||
anchored: If true, forces all but regexp searches to be anchored to the start of text
|
||||
excludeField: If true, the field options are inverted to specify the fields that are not to be searched
|
||||
|
||||
The search mode is determined by the first of these boolean flags to be true
|
||||
literal: searches for literal string
|
||||
whitespace: same as literal except runs of whitespace are treated as a single space
|
||||
regexp: treats the search term as a regular expression
|
||||
words: (default) treats search string as a list of tokens, and matches if all tokens are found, regardless of adjacency or ordering
|
||||
words: (default) treats search string as a list of tokens, and matches if all tokens are found,
|
||||
regardless of adjacency or ordering
|
||||
some: treats search string as a list of tokens, and matches if at least ONE token is found
|
||||
*/
|
||||
exports.search = function(text,options) {
|
||||
options = options || {};
|
||||
var self = this,
|
||||
t,
|
||||
regExpStr="",
|
||||
invert = !!options.invert;
|
||||
// Convert the search string into a regexp for each term
|
||||
var terms, searchTermsRegExps,
|
||||
@@ -1244,7 +1260,18 @@ exports.search = function(text,options) {
|
||||
searchTermsRegExps = null;
|
||||
console.log("Regexp error parsing /(" + text + ")/" + flags + ": ",e);
|
||||
}
|
||||
} else {
|
||||
} else if(options.some) {
|
||||
terms = text.trim().split(/ +/);
|
||||
if(terms.length === 1 && terms[0] === "") {
|
||||
searchTermsRegExps = null;
|
||||
} else {
|
||||
searchTermsRegExps = [];
|
||||
for(t=0; t<terms.length; t++) {
|
||||
regExpStr += (t===0) ? anchor + $tw.utils.escapeRegExp(terms[t]) : "|" + anchor + $tw.utils.escapeRegExp(terms[t]);
|
||||
}
|
||||
searchTermsRegExps.push(new RegExp("(" + regExpStr + ")",flags));
|
||||
}
|
||||
} else { // default: words
|
||||
terms = text.split(/ +/);
|
||||
if(terms.length === 1 && terms[0] === "") {
|
||||
searchTermsRegExps = null;
|
||||
@@ -1255,7 +1282,7 @@ exports.search = function(text,options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Accumulate the array of fields to be searched or excluded from the search
|
||||
// Accumulate the array of fields to be searched or excluded from the search
|
||||
var fields = [];
|
||||
if(options.field) {
|
||||
if($tw.utils.isArray(options.field)) {
|
||||
|
||||
@@ -6,7 +6,7 @@ title: $:/core/templates/tiddlywiki5.html
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<!--~~ Raw markup for the top of the head section ~~-->
|
||||
`{{{ [<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
|
||||
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
|
||||
<meta name="application-name" content="TiddlyWiki" />
|
||||
<meta name="generator" content="TiddlyWiki" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/core/ui/Components/tag-link
|
||||
|
||||
<$link>
|
||||
<$set name="backgroundColor" value={{!!color}}>
|
||||
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<span style=<<tag-styles>> class="tc-tag-label">
|
||||
<$view field="title" format="text"/>
|
||||
</span>
|
||||
|
||||
9
core/ui/ControlPanel/Cascades.tid
Normal file
9
core/ui/ControlPanel/Cascades.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/Cascades
|
||||
tags: $:/tags/ControlPanel/Advanced
|
||||
caption: {{$:/language/ControlPanel/Cascades/Caption}}
|
||||
|
||||
{{$:/language/ControlPanel/Cascades/Hint}}
|
||||
|
||||
<div class="tc-control-panel">
|
||||
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Cascades]!has[draft.of]]" default="$:/core/ui/ControlPanel/StoryTiddler"/>
|
||||
</div>
|
||||
9
core/ui/ControlPanel/Cascades/EditTemplateBody.tid
Normal file
9
core/ui/ControlPanel/Cascades/EditTemplateBody.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/EditTemplateBody
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/EditTemplateBody/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/EditTemplateBody/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/EditTemplateBodyFilter||$:/snippets/ListTaggedCascade}}
|
||||
9
core/ui/ControlPanel/Cascades/StoryTiddler.tid
Normal file
9
core/ui/ControlPanel/Cascades/StoryTiddler.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/StoryTiddler
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/StoryTiddler/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/StoryTiddler/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/StoryTiddlerTemplateFilter||$:/snippets/ListTaggedCascade}}
|
||||
9
core/ui/ControlPanel/Cascades/TiddlerColour.tid
Normal file
9
core/ui/ControlPanel/Cascades/TiddlerColour.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/TiddlerColour
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/TiddlerColour/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/TiddlerColour/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/TiddlerColourFilter||$:/snippets/ListTaggedCascade}}
|
||||
9
core/ui/ControlPanel/Cascades/TiddlerIcon.tid
Normal file
9
core/ui/ControlPanel/Cascades/TiddlerIcon.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/TiddlerIcon
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/TiddlerIcon/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/TiddlerIcon/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/TiddlerIconFilter||$:/snippets/ListTaggedCascade}}
|
||||
9
core/ui/ControlPanel/Cascades/ViewTemplateBody.tid
Normal file
9
core/ui/ControlPanel/Cascades/ViewTemplateBody.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/ViewTemplateBody
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/ViewTemplateBody/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/ViewTemplateBody/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/ViewTemplateBodyFilter||$:/snippets/ListTaggedCascade}}
|
||||
9
core/ui/ControlPanel/Cascades/ViewTemplateTitle.tid
Normal file
9
core/ui/ControlPanel/Cascades/ViewTemplateTitle.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/ControlPanel/ViewTemplateTitle
|
||||
tags: $:/tags/ControlPanel/Cascades
|
||||
caption: {{$:/language/ControlPanel/ViewTemplateTitle/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/ViewTemplateTitle/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
{{$:/tags/ViewTemplateTitleFilter||$:/snippets/ListTaggedCascade}}
|
||||
@@ -1,56 +1,4 @@
|
||||
title: $:/core/ui/EditTemplate/body
|
||||
tags: $:/tags/EditTemplate
|
||||
|
||||
\define lingo-base() $:/language/EditTemplate/Body/
|
||||
\define config-visibility-title()
|
||||
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
\end
|
||||
|
||||
\define importFileActions()
|
||||
<$action-popup $state=<<importState>> $coords="(0,0,0,0)" $floating="yes"/>
|
||||
\end
|
||||
|
||||
<$list filter="[all[current]has[_canonical_uri]]">
|
||||
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo External/Hint>>
|
||||
|
||||
<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>
|
||||
|
||||
<$edit-text field="_canonical_uri" class="tc-edit-fields" tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"></$edit-text>
|
||||
|
||||
</div>
|
||||
|
||||
</$list>
|
||||
|
||||
<$set name="edit-preview-state" value={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}>
|
||||
<$list filter="[all[current]!has[_canonical_uri]]">
|
||||
<$vars importTitle=<<qualify $:/ImportImage>> importState=<<qualify $:/state/ImportImage>> >
|
||||
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> ><$reveal stateTitle=<<edit-preview-state>> type="match" text="yes">
|
||||
<div class="tc-tiddler-preview">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
<div class="tc-tiddler-preview-preview">
|
||||
|
||||
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
|
||||
|
||||
</$transclude>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
</$reveal>
|
||||
</$dropzone>
|
||||
</$vars>
|
||||
</$list>
|
||||
</$set>
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/EditTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/EditTemplate/body/default]] }}} />
|
||||
|
||||
13
core/ui/EditTemplate/body/canonical-uri.tid
Normal file
13
core/ui/EditTemplate/body/canonical-uri.tid
Normal file
@@ -0,0 +1,13 @@
|
||||
title: $:/core/ui/EditTemplate/body/canonical-uri
|
||||
|
||||
\define lingo-base() $:/language/EditTemplate/Body/
|
||||
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo External/Hint>>
|
||||
|
||||
<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>
|
||||
|
||||
<$edit-text field="_canonical_uri" class="tc-edit-fields" tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"></$edit-text>
|
||||
|
||||
</div>
|
||||
38
core/ui/EditTemplate/body/default.tid
Normal file
38
core/ui/EditTemplate/body/default.tid
Normal file
@@ -0,0 +1,38 @@
|
||||
title: $:/core/ui/EditTemplate/body/default
|
||||
|
||||
\define config-visibility-title()
|
||||
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
\end
|
||||
|
||||
\define importFileActions()
|
||||
<$action-popup $state=<<importState>> $coords="(0,0,0,0)" $floating="yes"/>
|
||||
\end
|
||||
|
||||
<$set name="edit-preview-state" value={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}>
|
||||
<$vars importTitle=<<qualify $:/ImportImage>> importState=<<qualify $:/state/ImportImage>> >
|
||||
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> ><$reveal stateTitle=<<edit-preview-state>> type="match" text="yes">
|
||||
<div class="tc-tiddler-preview">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
<div class="tc-tiddler-preview-preview">
|
||||
|
||||
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
|
||||
|
||||
</$transclude>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
</$reveal>
|
||||
</$dropzone>
|
||||
</$vars>
|
||||
</$set>
|
||||
@@ -29,7 +29,7 @@ color:$(foregroundColor)$;
|
||||
\whitespace trim
|
||||
<div class="tc-edit-tags">
|
||||
<$list filter="[list[!!$tagField$]sort[title]]" storyview="pop">
|
||||
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}} icon={{!!icon}} tagField=<<__tagField__>>/>
|
||||
<$macrocall $name="tag-body" colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} tagField=<<__tagField__>>/>
|
||||
</$list>
|
||||
<$vars tabIndex={{$:/config/EditTabIndex}} cancelPopups="yes">
|
||||
<$macrocall $name="tag-picker" tagField=<<__tagField__>>/>
|
||||
|
||||
@@ -23,7 +23,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
|
||||
<$text text={{!!group}}/>
|
||||
</div>
|
||||
<$set name="userInput" value={{{ [<typeInputTiddler>get[text]] }}}>
|
||||
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/> (<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
|
||||
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/><$text text=" "/>(<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
|
||||
</$list>
|
||||
</$set>
|
||||
</$list>
|
||||
|
||||
14
core/ui/ListTaggedCascade.tid
Normal file
14
core/ui/ListTaggedCascade.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/snippets/ListTaggedCascade
|
||||
|
||||
{{||$:/language/ControlPanel/Cascades/TagPrompt}}
|
||||
|
||||
<ol>
|
||||
<$list filter="[all[shadows+tiddlers]tag<currentTiddler>]">
|
||||
<li>
|
||||
<div>
|
||||
<$link><$text text=<<currentTiddler>>/></$link>
|
||||
</div>
|
||||
<$codeblock code={{!!text}}/>
|
||||
</li>
|
||||
</$list>
|
||||
</ol>
|
||||
@@ -14,7 +14,7 @@ tags: $:/tags/PageTemplate
|
||||
|
||||
</section>
|
||||
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template={{$:/config/ui/ViewTemplate}} editTemplate={{$:/config/ui/EditTemplate}} storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
|
||||
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template="$:/core/ui/StoryTiddlerTemplate" storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
|
||||
|
||||
<section class="story-frontdrop">
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
title: $:/core/ui/PluginListItemTemplate
|
||||
|
||||
<div class="tc-menu-list-item">
|
||||
<$link to={{!!title}}><$view field="description"><$view field="title"/></$view></$link>
|
||||
</div>
|
||||
\whitespace trim
|
||||
<$link to={{!!title}} class="tc-plugin-info">
|
||||
<div class="tc-plugin-info-chunk tc-plugin-info-icon">
|
||||
<$transclude tiddler=<<currentTiddler>> subtiddler={{{ [<currentTiddler>addsuffix[/icon]] }}}>
|
||||
<$transclude tiddler={{{ [<currentTiddler>get[plugin-type]addprefix[$:/core/images/plugin-generic-]] }}}/>
|
||||
</$transclude>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk tc-plugin-info-description">
|
||||
<h1>
|
||||
''<$text text={{{ [<currentTiddler>get[name]] ~[<currentTiddler>split[/]last[1]] }}}/>'': <$view field="description"><$view field="title"/></$view>
|
||||
</h1>
|
||||
</div>
|
||||
</$link>
|
||||
|
||||
3
core/ui/StoryTiddlerTemplate.tid
Normal file
3
core/ui/StoryTiddlerTemplate.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/core/ui/StoryTiddlerTemplate
|
||||
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[!is[blank]else{$:/config/ui/ViewTemplate}] }}} />
|
||||
@@ -13,10 +13,10 @@ title: $:/core/ui/TagPickerTagTemplate
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
</$list>
|
||||
<<actions>>
|
||||
<$set name="backgroundColor" value={{!!color}}>
|
||||
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target={{!!color}} fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
|
||||
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
|
||||
<span class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
|
||||
<$transclude tiddler={{!!icon}}/><$view field="title" format="text"/>
|
||||
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
|
||||
</span>
|
||||
</$wikify>
|
||||
</$set>
|
||||
|
||||
@@ -3,7 +3,7 @@ title: $:/core/ui/TagTemplate
|
||||
\whitespace trim
|
||||
<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
|
||||
<$set name="transclusion" value=<<currentTiddler>>>
|
||||
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
|
||||
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
|
||||
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
|
||||
<$set name="tv-show-missing-links" value="yes">
|
||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||
|
||||
8
core/ui/TiddlerIcon.tid
Normal file
8
core/ui/TiddlerIcon.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: $:/core/ui/TiddlerIcon
|
||||
|
||||
\whitespace trim
|
||||
<$let tiddlerIcon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}>
|
||||
<$list filter="[<tiddlerIcon>!is[blank]]" variable="ignore">
|
||||
<$transclude tiddler=<<tiddlerIcon>>/>
|
||||
</$list>
|
||||
</$let>
|
||||
@@ -3,14 +3,6 @@ tags: $:/tags/ViewTemplate
|
||||
|
||||
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
|
||||
|
||||
<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">
|
||||
|
||||
<$transclude>
|
||||
|
||||
<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
|
||||
|
||||
</$transclude>
|
||||
|
||||
</$list>
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
|
||||
|
||||
</$reveal>
|
||||
|
||||
3
core/ui/ViewTemplate/body/blank.tid
Normal file
3
core/ui/ViewTemplate/body/blank.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/core/ui/ViewTemplate/body/blank
|
||||
|
||||
<!-- Intentionally blank -->
|
||||
3
core/ui/ViewTemplate/body/code.tid
Normal file
3
core/ui/ViewTemplate/body/code.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/core/ui/ViewTemplate/body/code
|
||||
|
||||
<$codeblock code={{{ [<currentTiddler>get[text]] }}} language={{{ [<currentTiddler>get[type]else[text/vnd.tiddlywiki]] }}}/>
|
||||
7
core/ui/ViewTemplate/body/default.tid
Normal file
7
core/ui/ViewTemplate/body/default.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/ViewTemplate/body/default
|
||||
|
||||
<$transclude>
|
||||
|
||||
<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
|
||||
|
||||
</$transclude>
|
||||
@@ -1,5 +1,4 @@
|
||||
title: $:/core/ui/ViewTemplate/import
|
||||
tags: $:/tags/ViewTemplate
|
||||
title: $:/core/ui/ViewTemplate/body/import
|
||||
|
||||
\define lingo-base() $:/language/Import/
|
||||
|
||||
10
core/ui/ViewTemplate/body/plugin.tid
Normal file
10
core/ui/ViewTemplate/body/plugin.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/ui/ViewTemplate/body/plugin
|
||||
|
||||
<div class="tc-tiddler-plugin-info">
|
||||
<$let plugin-type={{!!plugin-type}}
|
||||
default-popup-state="yes"
|
||||
qualified-state=<<qualify "$:/state/plugin-info">>
|
||||
>
|
||||
{{||$:/core/ui/Components/plugin-info}}
|
||||
</$let>
|
||||
</div>
|
||||
@@ -1,15 +0,0 @@
|
||||
title: $:/core/ui/ViewTemplate/plugin
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<$reveal tag="div" class="tc-tiddler-plugin-info" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
|
||||
|
||||
<$list filter="[all[current]has[plugin-type]] -[all[current]field:plugin-type[import]]">
|
||||
<$set name="plugin-type" value={{!!plugin-type}}>
|
||||
<$set name="default-popup-state" value="yes">
|
||||
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
|
||||
{{||$:/core/ui/Components/plugin-info}}
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
</$list>
|
||||
</$reveal>
|
||||
@@ -12,25 +12,12 @@ fill:$(foregroundColor)$;
|
||||
</span>
|
||||
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
|
||||
<$link>
|
||||
<$set name="foregroundColor" value={{!!color}}>
|
||||
<$list filter="[all[current]has[icon]]~[[$:/config/DefaultTiddlerIcon]has[text]]">
|
||||
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
|
||||
<$transclude tiddler={{!!icon}}>
|
||||
<$transclude tiddler={{$:/config/DefaultTiddlerIcon}}/>
|
||||
</$transclude>
|
||||
{{||$:/core/ui/TiddlerIcon}}
|
||||
</span>
|
||||
</$list>
|
||||
</$set>
|
||||
<$list filter="[all[current]removeprefix[$:/]]">
|
||||
<h2 class="tc-title" title={{$:/language/SystemTiddler/Tooltip}}>
|
||||
<span class="tc-system-title-prefix">$:/</span><$text text=<<currentTiddler>>/>
|
||||
</h2>
|
||||
</$list>
|
||||
<$list filter="[all[current]!prefix[$:/]]">
|
||||
<h2 class="tc-title">
|
||||
<$view field="title"/>
|
||||
</h2>
|
||||
</$list>
|
||||
</$let>
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
|
||||
</$link>
|
||||
</$set>
|
||||
</div>
|
||||
|
||||
6
core/ui/ViewTemplate/title/default.tid
Normal file
6
core/ui/ViewTemplate/title/default.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
title: $:/core/ui/ViewTemplate/title/default
|
||||
|
||||
\whitespace trim
|
||||
<h2 class="tc-title">
|
||||
<$view field="title"/>
|
||||
</h2>
|
||||
6
core/ui/ViewTemplate/title/system.tid
Normal file
6
core/ui/ViewTemplate/title/system.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
title: $:/core/ui/ViewTemplate/title/system
|
||||
|
||||
\whitespace trim
|
||||
<h2 class="tc-title" title={{$:/language/SystemTiddler/Tooltip}}>
|
||||
<span class="tc-system-title-prefix">$:/</span><$text text={{{ [<currentTiddler>removeprefix[$:/]] }}}/>
|
||||
</h2>
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/snippets/allfields
|
||||
|
||||
\define renderfield(title)
|
||||
<tr class="tc-view-field"><td class="tc-view-field-name">''$title$'':</td><td class="tc-view-field-value">//{{$:/language/Docs/Fields/$title$}}//</td></tr>
|
||||
<tr class="tc-view-field"><td class="tc-view-field-name">''<$text text=<<__title__>>/>'':</td><td class="tc-view-field-value">//{{$:/language/Docs/Fields/$title$}}//</td></tr>
|
||||
\end
|
||||
<table class="tc-view-field-table"><tbody><$list filter="[fields[]sort[title]]" variable="listItem"><$macrocall $name="renderfield" title=<<listItem>>/></$list>
|
||||
</tbody></table>
|
||||
|
||||
5
core/wiki/config/EditTemplateBodyFilters.multids
Normal file
5
core/wiki/config/EditTemplateBodyFilters.multids
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/config/EditTemplateBodyFilters/
|
||||
tags: $:/tags/EditTemplateBodyFilter
|
||||
|
||||
canonical-uri: [has[_canonical_uri]then[$:/core/ui/EditTemplate/body/canonical-uri]]
|
||||
default: [[$:/core/ui/EditTemplate/body/default]]
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.2.0/index.html
|
||||
url: https://tiddlywiki.com/library/v5.2.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
||||
5
core/wiki/config/StoryTiddlerTemplateFilters.multids
Normal file
5
core/wiki/config/StoryTiddlerTemplateFilters.multids
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/config/StoryTiddlerTemplateFilters/
|
||||
tags: $:/tags/StoryTiddlerTemplateFilter
|
||||
|
||||
draft: [is[draft]then{$:/config/ui/EditTemplate}]
|
||||
default: [{$:/config/ui/ViewTemplate}]
|
||||
5
core/wiki/config/TiddlerColourFilters.multids
Normal file
5
core/wiki/config/TiddlerColourFilters.multids
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/config/TiddlerColourFilters/
|
||||
tags: $:/tags/TiddlerColourFilter
|
||||
|
||||
color-field: [has[color]then{!!color}]
|
||||
default: [[$:/config/DefaultTiddlerColour]has[text]get[text]trim[]]
|
||||
5
core/wiki/config/TiddlerIconFilters.multids
Normal file
5
core/wiki/config/TiddlerIconFilters.multids
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/config/TiddlerIconFilters/
|
||||
tags: $:/tags/TiddlerIconFilter
|
||||
|
||||
icon-field: [has[icon]then{!!icon}]
|
||||
default: [{$:/config/DefaultTiddlerIcon}has[text]]
|
||||
9
core/wiki/config/ViewTemplateBodyFilters.multids
Normal file
9
core/wiki/config/ViewTemplateBodyFilters.multids
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/config/ViewTemplateBodyFilters/
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/core/ui/]split[/]count[]compare:number:eq[4]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
||||
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
|
||||
hide-body: [field:hide-body[yes]then[$:/core/ui/ViewTemplate/body/blank]]
|
||||
default: [[$:/core/ui/ViewTemplate/body/default]]
|
||||
5
core/wiki/config/ViewTemplateTitleFilters.multids
Normal file
5
core/wiki/config/ViewTemplateTitleFilters.multids
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/config/ViewTemplateTitleFilters/
|
||||
tags: $:/tags/ViewTemplateTitleFilter
|
||||
|
||||
system: [prefix[$:/]then[$:/core/ui/ViewTemplate/title/system]]
|
||||
default: [[$:/core/ui/ViewTemplate/title/default]]
|
||||
9
core/wiki/debugstylesheets.tid
Normal file
9
core/wiki/debugstylesheets.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/snippets/DebugStylesheets
|
||||
|
||||
<style>[test]{list-style:'❌'}</style>
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]has[modified]]" counter="n">
|
||||
<style>{{!!text}}[test="<<n>>"]{list-style:disc;}</style>
|
||||
<li test=<<n>>><$link/></li>
|
||||
</$list>
|
||||
</ul>
|
||||
@@ -21,7 +21,9 @@ $actions$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="ti
|
||||
|
||||
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
|
||||
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
|
||||
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<__tag__>get[icon]] }}} colour={{{ [<__tag__>get[color]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
||||
<$let currentTiddler=<<__tag__>>>
|
||||
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
||||
</$let>
|
||||
</span>
|
||||
\end
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
title: $:/snippets/peek-stylesheets
|
||||
|
||||
\define expandable-stylesheets-list()
|
||||
\whitespace trim
|
||||
<ol>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]">
|
||||
<$vars state=<<qualify "$:/state/peek-stylesheets/open/">>>
|
||||
@@ -38,6 +39,7 @@ title: $:/snippets/peek-stylesheets
|
||||
\end
|
||||
|
||||
\define stylesheets-list()
|
||||
\whitespace trim
|
||||
<ol>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]">
|
||||
<li>
|
||||
@@ -57,6 +59,7 @@ title: $:/snippets/peek-stylesheets
|
||||
</$list>
|
||||
</ol>
|
||||
\end
|
||||
\whitespace trim
|
||||
|
||||
<$vars modeState=<<qualify "$:/state/peek-stylesheets/mode/">>>
|
||||
|
||||
|
||||
2
core/wiki/tags/EditTemplateBodyFilter.tid
Normal file
2
core/wiki/tags/EditTemplateBodyFilter.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/EditTemplateBodyFilter
|
||||
list: $:/config/EditTemplateBodyFilters/canonical-uri $:/config/EditTemplateBodyFilters/default
|
||||
2
core/wiki/tags/StoryTiddlerTemplateFilter.tid
Normal file
2
core/wiki/tags/StoryTiddlerTemplateFilter.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/StoryTiddlerTemplateFilter
|
||||
list: $:/config/StoryTiddlerTemplateFilters/draft $:/config/StoryTiddlerTemplateFilters/default
|
||||
3
core/wiki/tags/TiddlerColourFilter.tid
Normal file
3
core/wiki/tags/TiddlerColourFilter.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/tags/TiddlerColourFilter
|
||||
list: $:/config/TiddlerColourFilters/color-field $:/config/TiddlerColourFilters/default
|
||||
|
||||
3
core/wiki/tags/TiddlerIconFilter.tid
Normal file
3
core/wiki/tags/TiddlerIconFilter.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/tags/TiddlerIconFilter
|
||||
list: $:/config/TiddlerIconFilters/icon-field $:/config/TiddlerIconFilters/default
|
||||
|
||||
3
core/wiki/tags/ViewTemplateBodyFilter.tid
Normal file
3
core/wiki/tags/ViewTemplateBodyFilter.tid
Normal file
@@ -0,0 +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
|
||||
|
||||
3
core/wiki/tags/ViewTemplateTitleFilter.tid
Normal file
3
core/wiki/tags/ViewTemplateTitleFilter.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/tags/ViewTemplateTitleFilter
|
||||
list: $:/config/ViewTemplateTitleFilters/system $:/config/ViewTemplateTitleFilters/default
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
chapter.of: Extended Persistence
|
||||
created: 20140708084850294
|
||||
modified: 20140717181245449
|
||||
modified: 20210720193245000
|
||||
sub.num: 3
|
||||
tags: doc
|
||||
title: Syncadaptor
|
||||
|
||||
A module with ``module-type: syncadaptor`` provides functionality to get a list of tiddlers (this list is provided as ~SkinnyTiddlers, which are normal tiddlers without the text field) and to load, save and delete single tiddlers. A syncadaptor can also provide functions to login and logout so that syncadaptor modules can be used to synchronize tiddlers with a remote server.
|
||||
|
||||
The syncer module only uses one syncadaptor and honours a special [[system tiddler|System Tiddlers]] [[$:/config/SyncFilter]] containing a [[filter string|Tags and Filter Mechanism]]. Tiddlers matching this filter string are not saved to the server with a syncadapter. It uses the [[WebServer API|https://tiddlywiki.com/#WebServer%20API%3A%20Get%20All%20Tiddlers]] to load modified tiddlers from the server, which returns only non-system tiddlers.
|
||||
The syncer module only uses one syncadaptor and honours a special [[system tiddler|System Tiddlers]] [[$:/config/SyncFilter]] containing a [[filter string|Tags and Filter Mechanism]]. Tiddlers matching this filter string are saved to the server with a syncadapter. It uses the [[WebServer API|https://tiddlywiki.com/#WebServer%20API%3A%20Get%20All%20Tiddlers]] to load modified tiddlers from the server, which returns only non-system tiddlers.
|
||||
|
||||
@@ -2,7 +2,7 @@ caption: Quoi de neuf dans <<version>>
|
||||
color: #fff
|
||||
created: 20160603124050989
|
||||
fr-title: BonjourLaVignette - Dernière Version
|
||||
image: New Release Banner.png
|
||||
image: New Release Banner
|
||||
link: Releases
|
||||
modified: 20160603124131122
|
||||
tags: HelloThumbnail
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
caption: 5.2.1
|
||||
created: 20211003152250369
|
||||
modified: 20211003152250369
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.2.1
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define contributor(username)
|
||||
<a href="https://github.com/$username$" style="text-decoration:none;font-size:24px;" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><img src="https://github.com/$username$.png?size=32" width="32" height="32"/> @<$text text=<<__username__>>/></a>
|
||||
\end
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.0...master]]//
|
||||
|
||||
! Highlights
|
||||
|
||||
! Performance Improvements
|
||||
|
||||
*
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6015">> image picker in theme tweaks to not dismiss when an image is selected
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/5998">> a [[new hidden setting|Hidden Setting: Show Edit Preview per Tiddler]] for controlling the visibility of the editor preview pane on a per-tiddler basis
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6148">> new LetWidget, a more flexible alternative to the SetWidget and the VarsWidget
|
||||
|
||||
! Filter improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6150">> new [[zth Operator]] that works like [[nth Operator]] but counts from zero instead of one
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6149">> [[Map Filter Run Prefix]] to provide additional variables to the filter
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6012/files">> new `focus-editor` operation to [[WidgetMessage: tm-edit-text-operation]]
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6130">> new ActionSetMultipleFieldsWidget, new SetMultipleVariablesWidget and extended ActionSendMessageWidget for working with multiple variables/fields/indexes/parameters in one operation
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6127">> new trigonometric operators: [[acos|acos Operator]], [[asin|asin Operator]], [[atan|atan Operator]], [[cos|cos Operator]], [[sin|sin Operator]] and [[tan|tan Operator]]
|
||||
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/6145">> EditTextWidget to provide a new ''actionValue'' variable to action strings that contains the value of the input
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6132">> support for widgets to access the order in which attributes are defined
|
||||
|
||||
! Client-server Improvements
|
||||
|
||||
*
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/5275">> support for recursively loading subdirectories with [[tiddlywiki.files Files]]
|
||||
|
||||
! Plugin Improvements
|
||||
|
||||
! Developer Experience Improvements
|
||||
|
||||
*
|
||||
|
||||
! Translation improvements
|
||||
|
||||
* Polish
|
||||
|
||||
! Other Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6013">> refreshing of LinkWidget attributes
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6107">> crash when using "source=basename-uri-decoded" in tiddlywiki.files
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/8ae4428332e03a1fdaee26f777a0c3a372fff401">> ''$timestamp'' attribute ignored when using ActionSetFieldWidget to set the value of an index
|
||||
|
||||
! Acknowledgements
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
* <<contributor btheado>>
|
||||
* <<contributor BurningTreeC>>
|
||||
* <<contributor EvidentlyCube>>
|
||||
* <<contributor flibbles>>
|
||||
* <<contributor joshuafontany>>
|
||||
* <<contributor Marxsal>>
|
||||
* <<contributor pmario>>
|
||||
* <<contributor saqimtiaz>>
|
||||
* <<contributor Telumire>>
|
||||
|
||||
72
editions/prerelease/tiddlers/Release 5.2.2.tid
Normal file
72
editions/prerelease/tiddlers/Release 5.2.2.tid
Normal file
@@ -0,0 +1,72 @@
|
||||
caption: 5.2.2
|
||||
created: 20220208152620527
|
||||
modified: 20220208152620527
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.2.2
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define contributor(username)
|
||||
<a href="https://github.com/$username$" style="text-decoration:none;font-size:24px;" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><img src="https://github.com/$username$.png?size=32" width="32" height="32"/> @<$text text=<<__username__>>/></a>
|
||||
\end
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.1...master]]//
|
||||
|
||||
! Highlights
|
||||
|
||||
*
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/60187dc59e6546d9ca8e6a35418f782a9627cda0">> importing/upgrading encrypted single file wikis
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6389">> RadioWidget not using default value if the field or index is missing
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6376">> [[WidgetMessage: tm-edit-text-operation]] crash with ''wrap-lines'' operation if prefix or suffix is missing
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6395">> processing of $:/tags/RawMarkupWikified/TopHead tiddlers
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6398">> issue whereby renaming tags could result in duplicate tags
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6426">> issue with ImportVariablesWidget when importing block mode widgets
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6428">> issue with ~LaTeX content within Markdown tiddlers
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/6440">> search results obscured on narrow screens
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6438">> crash when using deprecated regexp operands for filter operators
|
||||
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6435">> wording of drag and drop banner (from "drop here" to "drop now")
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/853a899c77766e47eade1dfa5822640ef9915637">> wrapping and wikification of field names in field viewer
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/0186c6490fbd1d8fd4de7c3fa99ccf4d129fbd80">> missing whitespace between description and MIME type in edit template dropdown for the ''type'' field
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/c7e8c87f85b54f60302ff8e396a7569d996e3f67">> incorrect usage of code view for certain system tiddlers
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
*
|
||||
|
||||
! Filter improvements
|
||||
|
||||
*
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/54cfda76ee353190f1cf0210b9071894fb1a5690">> support for ''code-body'' field set to ''yes'' to trigger display of a tiddler in the code view
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/66ae1d6930796a9eb062fdb64a755adab8f39294">> classes to the ImageWidget to indicate whether it is loading, loaded or has encountered an error
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6381">> sourceURL tags to $:/boot/boot.js and $:/boot/bootprefix.js, enabling them to be accessed in the browser debugger more easily
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6410">> support to [[WidgetMessage: tm-scroll]] for scrolling without animating
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/1a0c831216c397c6fef8e5685e47857193411a1b">> [[sha256 Operator]]
|
||||
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6409">> support for ''renderEnd()'' method for storyviews
|
||||
|
||||
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Translation improvements
|
||||
|
||||
* Polish
|
||||
|
||||
! Acknowledgements
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
* <<contributor Jermolene>>
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.2.1/index.html
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.2.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
title: $:/editions/tw5.com/download-empty
|
||||
code-body: yes
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[[$:/core]] [[$:/isEncrypted]] [[$:/themes/tiddlywiki/snowwhite]] [[$:/themes/tiddlywiki/vanilla]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [[$:/config/OfficialPluginLibrary]] +[sort[title]]
|
||||
|
||||
@@ -211,6 +211,8 @@ Tests the filtering mechanism.
|
||||
it("should handle the lookup operator", function() {
|
||||
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,,Tidd");
|
||||
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup:8[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,8,Tidd");
|
||||
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup:8[Tiddler],[text]]").join(",")).toBe("Missing inaction from TiddlerOne,8,Tidd");
|
||||
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup[Tiddler],[tags]]").join(",")).toBe(",one,one");
|
||||
});
|
||||
|
||||
it("should retrieve shadow tiddlers", function() {
|
||||
@@ -256,6 +258,16 @@ Tests the filtering mechanism.
|
||||
expect(wiki.filterTiddlers("[modifier/Jo/]").join(",")).toBe("TiddlerOne,$:/TiddlerTwo,Tiddler Three,a fourth tiddler,one");
|
||||
expect(console.log).toHaveBeenCalledWith("WARNING: Filter", "modifier", "has a deprecated regexp operand", /Jo/);
|
||||
});
|
||||
|
||||
it("should handle regular expression operands without crashing", function() {
|
||||
spyOn(console, 'log');
|
||||
// We don't really care about the results. Just don't get RSoD.
|
||||
expect(() => wiki.filterTiddlers("[all/current/]")).not.toThrow();
|
||||
expect(() => wiki.filterTiddlers("[prefix/anything/]")).not.toThrow();
|
||||
expect(() => wiki.filterTiddlers("[title/anything/]")).not.toThrow();
|
||||
expect(() => wiki.filterTiddlers("[/anything/]")).not.toThrow();
|
||||
expect(() => wiki.filterTiddlers("[//]")).not.toThrow();
|
||||
});
|
||||
|
||||
it("should handle the prefix operator", function() {
|
||||
expect(wiki.filterTiddlers("[prefix[Tiddler]]").join(",")).toBe("TiddlerOne,Tiddler Three");
|
||||
@@ -383,6 +395,11 @@ Tests the filtering mechanism.
|
||||
expect(wiki.filterTiddlers("[list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[tag[one]list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should handle the listed operator", function() {
|
||||
expect(wiki.filterTiddlers("TiddlerOne MissingTiddler +[listed[]]").join(",")).toBe('one,hasList');
|
||||
expect(wiki.filterTiddlers("one two +[listed[tags]]").join(",")).toBe('TiddlerOne,$:/TiddlerTwo,Tiddler Three');
|
||||
});
|
||||
|
||||
it("should handle the next operator", function() {
|
||||
expect(wiki.filterTiddlers("[[Tiddler Three]next[TiddlerSeventh]]").join(",")).toBe("a fourth tiddler");
|
||||
@@ -406,11 +423,44 @@ Tests the filtering mechanism.
|
||||
expect(wiki.filterTiddlers("[search:*:[g]sort[title]]").join(",")).toBe("$:/ShadowPlugin,filter regexp test,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:text:anchored[the]]").join(",")).toBe("TiddlerOne,$:/TiddlerTwo,Tiddler Three,a fourth tiddler");
|
||||
});
|
||||
|
||||
|
||||
it("should yield search results where 'default' search finds at least 1 token", function() {
|
||||
expect(wiki.filterTiddlers("[search::some[one two]sort[title]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,one,Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should yield search results where 'title' finds at least one token", function() {
|
||||
expect(wiki.filterTiddlers("[search:title:some[tiddler]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:title:some[tiddler one]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should yield search results where 'tags' finds at least one token", function() {
|
||||
expect(wiki.filterTiddlers("[search:tags:some[one]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:tags:some[two]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||
expect(wiki.filterTiddlers("[search:tags:some[two one]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should yield search results where 'tags' finds at least one token / casesensitive", function() {
|
||||
expect(wiki.filterTiddlers("[search:tags:some[ONE]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:tags:some,casesensitive[two ONE]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||
});
|
||||
|
||||
it("should yield search results where 'tags' finds at least one token / anchored", function() {
|
||||
expect(wiki.filterTiddlers("[search:tags:some,anchored[one]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:tags:some,anchored[two]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||
// search:title
|
||||
expect(wiki.filterTiddlers("[search:title:some,anchored[tiddler]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:title:some,anchored[tiddler one]sort[title]]").join(",")).toBe("one,Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should yield search results where 'tags' finds at least one token / anchored & casesensitive", function() {
|
||||
expect(wiki.filterTiddlers("[search:title:some,anchored,casesensitive[Tiddler one]sort[title]]").join(",")).toBe("one,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[search:title:some,anchored,casesensitive[Tiddler ONE]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
});
|
||||
|
||||
it("should yield search results that have search tokens spread across different fields", function() {
|
||||
expect(wiki.filterTiddlers("[search[fox one]sort[title]]").join(",")).toBe("TiddlerOne");
|
||||
});
|
||||
|
||||
|
||||
it("should handle the each operator", function() {
|
||||
expect(wiki.filterTiddlers("[each[modifier]sort[title]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,hasList,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[each:list-item[tags]sort[title]]").join(",")).toBe("one,two");
|
||||
|
||||
@@ -128,6 +128,21 @@ describe("HTML tag new parser tests", function() {
|
||||
expect($tw.utils.parseAttribute("p=\"blah\" ",0)).toEqual(
|
||||
{ type : 'string', start : 0, name : 'p', value : 'blah', end : 8 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p=\"bl\nah\" ",0)).toEqual(
|
||||
{ type : 'string', start : 0, name : 'p', value : 'bl\nah', end : 9 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p={{{blah}}} ",0)).toEqual(
|
||||
{ type : 'filtered', start : 0, name : 'p', filter : 'blah', end : 12 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p={{{bl\nah}}} ",0)).toEqual(
|
||||
{ type : 'filtered', start : 0, name : 'p', filter : 'bl\nah', end : 13 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p={{{ [{$:/layout}] }}} ",0)).toEqual(
|
||||
{ type : 'filtered', start : 0, name : 'p', filter : ' [{$:/layout}] ', end : 23 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p={{blah}} ",0)).toEqual(
|
||||
{ type : 'indirect', start : 0, name : 'p', textReference : 'blah', end : 10 }
|
||||
);
|
||||
expect($tw.utils.parseAttribute("p=blah ",0)).toEqual(
|
||||
{ type : 'string', start : 0, name : 'p', value : 'blah', end : 6 }
|
||||
);
|
||||
|
||||
@@ -288,6 +288,38 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
|
||||
tags: ["cakes","with tea"],
|
||||
text: "Does anyone eat pound cake?"
|
||||
});
|
||||
wiki.addTiddler({
|
||||
title: "$:/filter1",
|
||||
text: "[tag[cakes]then[It is customary]]",
|
||||
tags: "$:/tags/Filter $:/tags/SecondFilter"
|
||||
});
|
||||
wiki.addTiddler({
|
||||
title: "$:/filter2",
|
||||
text: "[<currentTiddler>tag[shopping]then[It is not customary]]",
|
||||
tags: "$:/tags/Filter $:/tags/SecondFilter"
|
||||
});
|
||||
wiki.addTiddler({
|
||||
title: "$:/filter3",
|
||||
text: "[[Just a default]]",
|
||||
tags: "$:/tags/Filter"
|
||||
});
|
||||
wiki.addTiddler({
|
||||
title: "$:/tags/Filter",
|
||||
list: "$:/filter1 $:/filter2 $:/filter3"
|
||||
});
|
||||
wiki.addTiddler({
|
||||
title: "$:/tags/SecondFilter",
|
||||
list: "$:/filter1 $:/filter2"
|
||||
});
|
||||
|
||||
it("should handle the :cascade filter prefix", function() {
|
||||
expect(wiki.filterTiddlers("[[Rice Pudding]] :cascade[all[shadows+tiddlers]tag[$:/tags/Filter]get[text]]").join(",")).toBe("It is not customary");
|
||||
expect(wiki.filterTiddlers("[[chocolate cake]] :cascade[all[shadows+tiddlers]tag[$:/tags/Filter]get[text]]").join(",")).toBe("It is customary");
|
||||
expect(wiki.filterTiddlers("[[Sparkling water]] :cascade[all[shadows+tiddlers]tag[$:/tags/Filter]get[text]]").join(",")).toBe("Just a default");
|
||||
expect(wiki.filterTiddlers("[[Rice Pudding]] :cascade[all[shadows+tiddlers]tag[$:/tags/SecondFilter]get[text]]").join(",")).toBe("It is not customary");
|
||||
expect(wiki.filterTiddlers("[[chocolate cake]] :cascade[all[shadows+tiddlers]tag[$:/tags/SecondFilter]get[text]]").join(",")).toBe("It is customary");
|
||||
expect(wiki.filterTiddlers("[[Sparkling water]] :cascade[all[shadows+tiddlers]tag[$:/tags/SecondFilter]get[text]]").join(",")).toBe("");
|
||||
});
|
||||
|
||||
it("should handle the :reduce filter prefix", function() {
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :reduce[get[quantity]add<accumulator>]").join(",")).toBe("22");
|
||||
@@ -387,6 +419,22 @@ describe("'reduce' and 'intersection' filter prefix tests", function() {
|
||||
// Prepend the position in the list using the index and length variables
|
||||
expect(wiki.filterTiddlers("[tag[shopping]] :map[get[title]addprefix[-]addprefix<length>addprefix[of]addprefix<index>]").join(",")).toBe("0of4-Brownies,1of4-Chick Peas,2of4-Milk,3of4-Rice Pudding");
|
||||
});
|
||||
|
||||
it("should handle macro parameters for filter run prefixes",function() {
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] },
|
||||
{ wiki:wiki, document:$tw.document});
|
||||
rootWidget.makeChildWidgets();
|
||||
var anchorWidget = rootWidget.children[0];
|
||||
rootWidget.setVariable("greet","Hello $name$",[{name:"name"}],true);
|
||||
rootWidget.setVariable("echo","$text$",[{name:"text"}],true);
|
||||
// :map prefix
|
||||
expect(wiki.filterTiddlers("1 :map[subfilter<greet Tom>join[ ]]",anchorWidget).join(",")).toBe("Hello Tom");
|
||||
expect(wiki.filterTiddlers('[tag[shopping]] :map[<echo "$(index)$ $(currentTiddler)$">]',anchorWidget).join(",")).toBe("0 Brownies,1 Chick Peas,2 Milk,3 Rice Pudding");
|
||||
// :reduce prefix
|
||||
expect(wiki.filterTiddlers("1 :reduce[subfilter<greet Tom>join[ ]]",anchorWidget).join(",")).toBe("Hello Tom");
|
||||
expect(wiki.filterTiddlers('[tag[shopping]] :reduce[<echo "$(accumulator)$ $(index)$ $(currentTiddler)$,">]',anchorWidget).join(",")).toBe(" 0 Brownies, 1 Chick Peas, 2 Milk, 3 Rice Pudding,");
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
@@ -119,7 +119,7 @@ describe("WikiText parser tests", function() {
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse comment in pragma area. Comment will be INVISIBLE", function() {
|
||||
it("should parse comment in pragma area. Comment will be invisible", function() {
|
||||
expect(parse("<!-- comment in pragma area -->\n\\define aMacro()\nnothing\n\\end\n")).toEqual(
|
||||
|
||||
[ { type : 'set', attributes : { name : { type : 'string', value : 'aMacro' }, value : { type : 'string', value : 'nothing' } }, children : [ ], params : [ ], isMacroDefinition : true } ]
|
||||
@@ -127,6 +127,19 @@ describe("WikiText parser tests", function() {
|
||||
);
|
||||
});
|
||||
|
||||
it("should block mode filtered transclusions", function() {
|
||||
expect(parse("{{{ filter }}}")).toEqual(
|
||||
|
||||
[ { type: 'list', attributes: { filter: { type: 'string', value: ' filter ' } }, isBlock: true } ]
|
||||
|
||||
);
|
||||
expect(parse("{{{ fil\nter }}}")).toEqual(
|
||||
|
||||
[ { type: 'list', attributes: { filter: { type: 'string', value: ' fil\nter ' } }, isBlock: true } ]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse inline macro calls", function() {
|
||||
expect(parse("<<john>><<paul>><<george>><<ringo>>")).toEqual(
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20210322152203906
|
||||
list: [[Documentation Macros]] HelloThere GettingStarted Community
|
||||
modified: 20210322152237613
|
||||
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
|
||||
title: $:/StoryList
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20180626122427188
|
||||
modified: 20180626134639673
|
||||
tags: [[Using TiddlyWiki on Node.js]]
|
||||
modified: 20211117234223960
|
||||
tags: [[TiddlyWiki on Node.js]]
|
||||
title: NamedCommandParameters
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user