mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-24 03:44:41 +00:00
Compare commits
253 Commits
nested-mac
...
diff-match
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3605543078 | ||
|
|
b548b29b2b | ||
|
|
0eb6569674 | ||
|
|
0c7e06a10c | ||
|
|
d5f0d834bc | ||
|
|
8c378e0d24 | ||
|
|
925ce2b505 | ||
|
|
eb8f4d66b9 | ||
|
|
ef03a4a5df | ||
|
|
51a4d39c19 | ||
|
|
95dc56d850 | ||
|
|
77b418004a | ||
|
|
028dfe39b7 | ||
|
|
81f5141166 | ||
|
|
3da3318396 | ||
|
|
89fd8871b6 | ||
|
|
f249b79e81 | ||
|
|
524cee1489 | ||
|
|
93abe5e3a6 | ||
|
|
c0bca18cab | ||
|
|
d70b6a7d6c | ||
|
|
6404d5652e | ||
|
|
fe2c677ac4 | ||
|
|
3faadd69c0 | ||
|
|
4e5c957e97 | ||
|
|
3d0ec5b1bd | ||
|
|
fb8e5d1417 | ||
|
|
2426cc668d | ||
|
|
75a399a389 | ||
|
|
4c4399c32d | ||
|
|
194df33de3 | ||
|
|
6718f82b4c | ||
|
|
8ef6d78bef | ||
|
|
e6189078ff | ||
|
|
c20c35c0a6 | ||
|
|
51cbf83c23 | ||
|
|
1441138d5c | ||
|
|
a5894946de | ||
|
|
a3a1eceb4a | ||
|
|
aa8f7f77d6 | ||
|
|
5d650e87dd | ||
|
|
67a8f7aeba | ||
|
|
485bf19c3c | ||
|
|
586d44f6ce | ||
|
|
18c790152f | ||
|
|
9541f3c283 | ||
|
|
5aa5fc72b1 | ||
|
|
005dfdadf0 | ||
|
|
af1cc56c0c | ||
|
|
5bf60cd26f | ||
|
|
4546828541 | ||
|
|
1a69fb7e5c | ||
|
|
db88eed88f | ||
|
|
c51816e826 | ||
|
|
e41511c652 | ||
|
|
8f7441f296 | ||
|
|
c8d99c8aad | ||
|
|
166f68cc15 | ||
|
|
fecb7edca4 | ||
|
|
7632a3317a | ||
|
|
0039c2134b | ||
|
|
34643a4279 | ||
|
|
4d040d2499 | ||
|
|
c0615e20ec | ||
|
|
c39ef398bf | ||
|
|
02d28c100b | ||
|
|
dc225da1ff | ||
|
|
aeec6aee23 | ||
|
|
f9efbd93b1 | ||
|
|
b7c420393c | ||
|
|
9574506a89 | ||
|
|
13c0f3c5e2 | ||
|
|
301a0ecec7 | ||
|
|
917975b464 | ||
|
|
c9691bdb27 | ||
|
|
5ea9743cd5 | ||
|
|
0c328a1696 | ||
|
|
b5134951e5 | ||
|
|
6e10918a28 | ||
|
|
0ee53bbc01 | ||
|
|
a52da67563 | ||
|
|
494ee984f8 | ||
|
|
9c70ee34d4 | ||
|
|
c7612ff4ce | ||
|
|
51acc24b0a | ||
|
|
c5ce1d78a2 | ||
|
|
dd6e00687b | ||
|
|
7b7063a7b2 | ||
|
|
f3ebb258f7 | ||
|
|
67beafe359 | ||
|
|
8ca0bf10e4 | ||
|
|
6f9cf20e77 | ||
|
|
fb8df29948 | ||
|
|
b33b41e1fc | ||
|
|
04810667e6 | ||
|
|
50971db392 | ||
|
|
d57abcbb23 | ||
|
|
8a2fad2499 | ||
|
|
666e2a795f | ||
|
|
42a408146d | ||
|
|
bf8e1ca5b0 | ||
|
|
3bdc18ab84 | ||
|
|
43214c1cc6 | ||
|
|
0b39e47ce8 | ||
|
|
87c3e53299 | ||
|
|
3a7a3d64c2 | ||
|
|
c819b2d365 | ||
|
|
119813529d | ||
|
|
9f69161709 | ||
|
|
18d3ea9d14 | ||
|
|
ae18c2e19b | ||
|
|
95e6168839 | ||
|
|
73507ca8b5 | ||
|
|
4a6e3d4281 | ||
|
|
d217826375 | ||
|
|
a5afed9384 | ||
|
|
b37a356b5e | ||
|
|
55d9a5e16d | ||
|
|
3bab996acd | ||
|
|
7e8380a8df | ||
|
|
44de7918ab | ||
|
|
5ee6af0632 | ||
|
|
ccf444c834 | ||
|
|
ecaa288fc5 | ||
|
|
ceb6999dd6 | ||
|
|
e51dd406b1 | ||
|
|
6ea61ac94f | ||
|
|
caf01f10d6 | ||
|
|
1bd7924e1b | ||
|
|
25b8f26073 | ||
|
|
9160d81cc6 | ||
|
|
0b1a4f3a4d | ||
|
|
8d48964aca | ||
|
|
6cd2fc029d | ||
|
|
6235f29749 | ||
|
|
6385534638 | ||
|
|
ba3cba6170 | ||
|
|
34c9e83bec | ||
|
|
ed9cc84fb2 | ||
|
|
22bc826247 | ||
|
|
6e6efcafc9 | ||
|
|
3c81558d74 | ||
|
|
cc47bb0330 | ||
|
|
0ce5788747 | ||
|
|
1118de319e | ||
|
|
c2d82ccb32 | ||
|
|
a899aac92c | ||
|
|
bef11fe6a2 | ||
|
|
17a1ae23eb | ||
|
|
9f867ad51e | ||
|
|
28c1e6bfc3 | ||
|
|
2db886793e | ||
|
|
8d050e0e69 | ||
|
|
e77006de63 | ||
|
|
80442b7f7f | ||
|
|
10bb3ba09d | ||
|
|
58013ba435 | ||
|
|
ee7bde58a2 | ||
|
|
229159fea7 | ||
|
|
a311e5ebac | ||
|
|
9ff479ce87 | ||
|
|
77053cfe13 | ||
|
|
1bd58db944 | ||
|
|
4be0c17dd0 | ||
|
|
595da5f9f6 | ||
|
|
ff674b9117 | ||
|
|
38dce175d6 | ||
|
|
1ab9f457b4 | ||
|
|
1eddb52de5 | ||
|
|
52fd6ce9c2 | ||
|
|
62308792c8 | ||
|
|
272ba6a4b7 | ||
|
|
90449c9458 | ||
|
|
5b8f36a594 | ||
|
|
acc7224758 | ||
|
|
0db987da60 | ||
|
|
a93a499684 | ||
|
|
2c33502a4a | ||
|
|
451a3454b5 | ||
|
|
45a7eb1c03 | ||
|
|
d03da6085b | ||
|
|
fa4dc2a4e9 | ||
|
|
3918e59cc1 | ||
|
|
f7ccba4c25 | ||
|
|
319d7fbe9c | ||
|
|
67c8f29160 | ||
|
|
856aca2f92 | ||
|
|
34a20463c7 | ||
|
|
56f13133d8 | ||
|
|
684673cbff | ||
|
|
bea1a6b14f | ||
|
|
32a033bb50 | ||
|
|
97f7db169a | ||
|
|
850a4dd351 | ||
|
|
d707e6f825 | ||
|
|
5c378855ab | ||
|
|
ebc1f7e4ce | ||
|
|
2fcbf3b521 | ||
|
|
00927d2e13 | ||
|
|
882e040e62 | ||
|
|
026739e2e0 | ||
|
|
fba9efcf4a | ||
|
|
acfea3a212 | ||
|
|
0dc30086e9 | ||
|
|
cb0d0cfa6d | ||
|
|
d32d559f93 | ||
|
|
8ead7e0624 | ||
|
|
4f7b10e055 | ||
|
|
b8a30091ee | ||
|
|
6955f14c3c | ||
|
|
994c5a2970 | ||
|
|
ea150029f5 | ||
|
|
c663d2ba00 | ||
|
|
39e8c8b125 | ||
|
|
3713ee4fa9 | ||
|
|
a99f934371 | ||
|
|
63803fd99d | ||
|
|
79ec96cb59 | ||
|
|
419b3b3534 | ||
|
|
368963def0 | ||
|
|
830ffe64de | ||
|
|
1483195cd5 | ||
|
|
9b9ff1e843 | ||
|
|
ea3503e30c | ||
|
|
5e116d2a57 | ||
|
|
aa5183a08e | ||
|
|
10cb585dae | ||
|
|
029203dbc0 | ||
|
|
832868ecae | ||
|
|
7f48b6c6ce | ||
|
|
b263ee3c80 | ||
|
|
b097d2ec48 | ||
|
|
ef779c11e8 | ||
|
|
06520c8994 | ||
|
|
710e51fe04 | ||
|
|
af6c017086 | ||
|
|
34353f4065 | ||
|
|
fedc23d73c | ||
|
|
344110e289 | ||
|
|
72f06581b6 | ||
|
|
ae12e8fb69 | ||
|
|
e8148ff978 | ||
|
|
965bd090a9 | ||
|
|
3be9b13814 | ||
|
|
62f26d6630 | ||
|
|
8fe2f6086d | ||
|
|
30af537b91 | ||
|
|
f54ecc23f3 | ||
|
|
67dd3f06bf | ||
|
|
6af3eb539b | ||
|
|
3f55f827a6 | ||
|
|
b9d27e9fd5 | ||
|
|
5b85786f73 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@
|
|||||||
tmp/
|
tmp/
|
||||||
output/
|
output/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# Default to the current version number for building the plugin library
|
# Default to the current version number for building the plugin library
|
||||||
|
|
||||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||||
TW5_BUILD_VERSION=v5.2.3
|
TW5_BUILD_VERSION=v5.2.6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||||
@@ -233,6 +233,15 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|||||||
--build index \
|
--build index \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
|
# /editions/twitter-archivist/index.html Twitter Archivist edition
|
||||||
|
node $TW5_BUILD_TIDDLYWIKI \
|
||||||
|
./editions/twitter-archivist \
|
||||||
|
--verbose \
|
||||||
|
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||||
|
--output $TW5_BUILD_OUTPUT/editions/twitter-archivist/ \
|
||||||
|
--build index \
|
||||||
|
|| exit 1
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
#
|
#
|
||||||
# Plugin demos
|
# Plugin demos
|
||||||
@@ -350,14 +359,14 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|||||||
|
|
||||||
# Delete any existing static content
|
# Delete any existing static content
|
||||||
|
|
||||||
rm $TW5_BUILD_OUTPUT/languages/de-AT/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/de-AT/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/de-DE/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/de-DE/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/es-ES/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/es-ES/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/fr-FR/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/fr-FR/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/ja-JP/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/ja-JP/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/ko-KR/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/ko-KR/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/zh-Hans/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/zh-Hans/static/*
|
||||||
rm $TW5_BUILD_OUTPUT/languages/zh-Hant/static/*
|
rm -rf $TW5_BUILD_OUTPUT/languages/zh-Hant/static/*
|
||||||
|
|
||||||
# /languages/de-AT/index.html Demo wiki with de-AT language
|
# /languages/de-AT/index.html Demo wiki with de-AT language
|
||||||
# /languages/de-AT/empty.html Empty wiki with de-AT language
|
# /languages/de-AT/empty.html Empty wiki with de-AT language
|
||||||
@@ -450,7 +459,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|||||||
--verbose \
|
--verbose \
|
||||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||||
--output $TW5_BUILD_OUTPUT/library/$TW5_BUILD_VERSION \
|
--output $TW5_BUILD_OUTPUT/library/$TW5_BUILD_VERSION \
|
||||||
--build \
|
--build library\
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
# Delete the temporary build tiddler
|
# Delete the temporary build tiddler
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ node ./tiddlywiki.js \
|
|||||||
--verbose \
|
--verbose \
|
||||||
--version \
|
--version \
|
||||||
--rendertiddler $:/core/save/all test.html text/plain \
|
--rendertiddler $:/core/save/all test.html text/plain \
|
||||||
|
--test \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
echo To run the tests in a browser, open "editions/test/output/test.html"
|
echo To run the tests in a browser, open "editions/test/output/test.html"
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ $tw.utils.getLocationHash = function() {
|
|||||||
var idx = href.indexOf('#');
|
var idx = href.indexOf('#');
|
||||||
if(idx === -1) {
|
if(idx === -1) {
|
||||||
return "#";
|
return "#";
|
||||||
} else if(idx < href.length-1 && href[idx+1] === '#') {
|
} else if(href.substr(idx + 1,1) === "#" || href.substr(idx + 1,3) === "%23") {
|
||||||
// Special case: ignore location hash if it itself starts with a #
|
// Special case: ignore location hash if it itself starts with a #
|
||||||
return "#";
|
return "#";
|
||||||
} else {
|
} else {
|
||||||
@@ -375,7 +375,7 @@ $tw.utils.stringifyList = function(value) {
|
|||||||
var result = new Array(value.length);
|
var result = new Array(value.length);
|
||||||
for(var t=0, l=value.length; t<l; t++) {
|
for(var t=0, l=value.length; t<l; t++) {
|
||||||
var entry = value[t] || "";
|
var entry = value[t] || "";
|
||||||
if(entry.indexOf(" ") !== -1) {
|
if(entry.match(/[^\S\xA0]/mg)) {
|
||||||
result[t] = "[[" + entry + "]]";
|
result[t] = "[[" + entry + "]]";
|
||||||
} else {
|
} else {
|
||||||
result[t] = entry;
|
result[t] = entry;
|
||||||
@@ -1881,7 +1881,7 @@ A default set of files for TiddlyWiki to ignore during load.
|
|||||||
This matches what NPM ignores, and adds "*.meta" to ignore tiddler
|
This matches what NPM ignores, and adds "*.meta" to ignore tiddler
|
||||||
metadata files.
|
metadata files.
|
||||||
*/
|
*/
|
||||||
$tw.boot.excludeRegExp = /^\.DS_Store$|^.*\.meta$|^\..*\.swp$|^\._.*$|^\.git$|^\.hg$|^\.lock-wscript$|^\.svn$|^\.wafpickle-.*$|^CVS$|^npm-debug\.log$/;
|
$tw.boot.excludeRegExp = /^\.DS_Store$|^.*\.meta$|^\..*\.swp$|^\._.*$|^\.git$|^\.github$|^\.vscode$|^\.hg$|^\.lock-wscript$|^\.svn$|^\.wafpickle-.*$|^CVS$|^npm-debug\.log$/;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}. Note that no file information is returned for externally loaded tiddlers, just the `tiddlers` property.
|
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}. Note that no file information is returned for externally loaded tiddlers, just the `tiddlers` property.
|
||||||
@@ -2403,11 +2403,12 @@ $tw.boot.initStartup = function(options) {
|
|||||||
$tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
|
$tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
|
||||||
$tw.utils.registerFileType("application/font-woff2","base64",".woff2");
|
$tw.utils.registerFileType("application/font-woff2","base64",".woff2");
|
||||||
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
|
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
|
||||||
|
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
||||||
$tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]);
|
$tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]);
|
||||||
$tw.utils.registerFileType("video/webm","base64",".webm");
|
$tw.utils.registerFileType("video/webm","base64",".webm");
|
||||||
$tw.utils.registerFileType("video/mp4","base64",".mp4");
|
$tw.utils.registerFileType("video/mp4","base64",".mp4");
|
||||||
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
|
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
|
||||||
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
$tw.utils.registerFileType("audio/mpeg","base64");
|
||||||
$tw.utils.registerFileType("text/markdown","utf8",[".md",".markdown"],{deserializerType:"text/x-markdown"});
|
$tw.utils.registerFileType("text/markdown","utf8",[".md",".markdown"],{deserializerType:"text/x-markdown"});
|
||||||
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
||||||
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
|
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ type: text/plain
|
|||||||
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
|
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
|
||||||
|
|
||||||
Copyright (c) 2004-2007, Jeremy Ruston
|
Copyright (c) 2004-2007, Jeremy Ruston
|
||||||
Copyright (c) 2007-2022, UnaMesa Association
|
Copyright (c) 2007-2023, UnaMesa Association
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
4
core/images/layout-button.tid
Executable file
4
core/images/layout-button.tid
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
title: $:/core/images/layout-button
|
||||||
|
tags: $:/tags/Image
|
||||||
|
|
||||||
|
<svg width="22pt" height="22pt" class="tc-image-layout-button tc-image-button" viewBox="0 0 24 24" stroke-width="1" stroke="none"><path d="M0 0h24v24H0z" fill="none"/><rect x="2" y="2" width="7" height="7" rx="2"/><rect x="2" y="13" width="7" height="9" rx="2"/><rect x="12" y="2" width="10" height="20" rx="2"/></svg>
|
||||||
6
core/images/mastodon.tid
Normal file
6
core/images/mastodon.tid
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
title: $:/core/images/mastodon
|
||||||
|
tags: $:/tags/Image
|
||||||
|
|
||||||
|
<svg width="22pt" height="22pt" class="tc-image-mastodon tc-image-button" viewBox="0 0 128 128">
|
||||||
|
<path d="M112.716,76.735C111.231,85.764 99.411,95.646 85.836,97.561C78.757,98.559 71.787,99.476 64.355,99.073C52.201,98.415 42.61,95.646 42.61,95.646C42.61,97.044 42.683,98.374 42.829,99.619C44.409,113.79 54.723,114.639 64.493,115.035C74.354,115.434 83.134,112.163 83.134,112.163L83.539,122.695C83.539,122.695 76.642,127.071 64.355,127.875C57.58,128.315 49.167,127.674 39.369,124.61C18.118,117.965 14.463,91.202 13.904,64.048C13.733,55.985 13.839,48.383 13.839,42.024C13.839,14.257 29.238,6.118 29.238,6.118C37.002,1.905 50.326,0.134 64.177,-0L64.517,-0C78.369,0.134 91.701,1.905 99.465,6.118C99.465,6.118 114.864,14.257 114.864,42.024C114.864,42.024 115.057,62.511 112.716,76.735ZM96.7,44.179C96.7,37.307 95.219,31.847 92.245,27.807C89.177,23.767 85.16,21.696 80.174,21.696C74.403,21.696 70.034,24.316 67.146,29.556L64.337,35.118L61.529,29.556C58.64,24.316 54.271,21.696 48.501,21.696C43.514,21.696 39.497,23.767 36.43,27.807C33.455,31.847 31.974,37.307 31.974,44.179L31.974,77.8L43.249,77.8L43.249,45.167C43.249,38.288 45.699,34.796 50.599,34.796C56.017,34.796 58.733,38.938 58.733,47.128L58.733,64.99L69.941,64.99L69.941,47.128C69.941,38.938 72.657,34.796 78.075,34.796C82.975,34.796 85.425,38.288 85.425,45.167L85.425,77.8L96.7,77.8L96.7,44.179Z"/>
|
||||||
|
</svg>
|
||||||
12
core/images/save-button-dynamic.tid
Normal file
12
core/images/save-button-dynamic.tid
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
title: $:/core/images/save-button-dynamic
|
||||||
|
tags: $:/tags/Image
|
||||||
|
|
||||||
|
<svg width="22pt" height="22pt" class="tc-image-save-button-dynamic tc-image-button" viewBox="0 0 128 128">
|
||||||
|
<g class="tc-image-save-button-dynamic-clean">
|
||||||
|
<path fill-rule="evenodd" d="M120.783 34.33c4.641 8.862 7.266 18.948 7.266 29.646 0 35.347-28.653 64-64 64-35.346 0-64-28.653-64-64 0-35.346 28.654-64 64-64 18.808 0 35.72 8.113 47.43 21.03l2.68-2.68c3.13-3.13 8.197-3.132 11.321-.008 3.118 3.118 3.121 8.193-.007 11.32l-4.69 4.691zm-12.058 12.058a47.876 47.876 0 013.324 17.588c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48c14.39 0 27.3 6.332 36.098 16.362L58.941 73.544 41.976 56.578c-3.127-3.127-8.201-3.123-11.32-.005-3.123 3.124-3.119 8.194.006 11.319l22.617 22.617a7.992 7.992 0 005.659 2.347c2.05 0 4.101-.783 5.667-2.349l44.12-44.12z"/>
|
||||||
|
</g>
|
||||||
|
<g class="tc-image-save-button-dynamic-dirty">
|
||||||
|
<path d="M64.856912,0 C100.203136,0 128.856912,28.653776 128.856912,64 C128.856912,99.346224 100.203136,128 64.856912,128 C29.510688,128 0.856911958,99.346224 0.856911958,64 C0.856911958,28.653776 29.510688,0 64.856912,0 Z M64.856912,16 C38.347244,16 16.856912,37.490332 16.856912,64 C16.856912,90.509668 38.347244,112 64.856912,112 C91.3665799,112 112.856912,90.509668 112.856912,64 C112.856912,37.490332 91.3665799,16 64.856912,16 Z"></path>
|
||||||
|
<circle cx="65" cy="64" r="32"></circle>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
@@ -59,6 +59,8 @@ Home/Caption: home
|
|||||||
Home/Hint: Open the default tiddlers
|
Home/Hint: Open the default tiddlers
|
||||||
Language/Caption: language
|
Language/Caption: language
|
||||||
Language/Hint: Choose the user interface language
|
Language/Hint: Choose the user interface language
|
||||||
|
LayoutSwitcher/Hint: Open layout switcher
|
||||||
|
LayoutSwitcher/Caption: layout
|
||||||
Manager/Caption: tiddler manager
|
Manager/Caption: tiddler manager
|
||||||
Manager/Hint: Open tiddler manager
|
Manager/Hint: Open tiddler manager
|
||||||
More/Caption: more
|
More/Caption: more
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Appearance/Hint: Ways to customise the appearance of your TiddlyWiki.
|
|||||||
Basics/AnimDuration/Prompt: Animation duration
|
Basics/AnimDuration/Prompt: Animation duration
|
||||||
Basics/AutoFocus/Prompt: Default focus field for new tiddlers
|
Basics/AutoFocus/Prompt: Default focus field for new tiddlers
|
||||||
Basics/Caption: Basics
|
Basics/Caption: Basics
|
||||||
Basics/DefaultTiddlers/BottomHint: Use [[double square brackets]] for titles with spaces. Or you can choose to <$button set="$:/DefaultTiddlers" setTo="[list[$:/StoryList]]">retain story ordering</$button>
|
Basics/DefaultTiddlers/BottomHint: Use [[double square brackets]] for titles with spaces. Or you can choose to {{retain story ordering||$:/snippets/retain-story-ordering-button}}
|
||||||
Basics/DefaultTiddlers/Prompt: Default tiddlers
|
Basics/DefaultTiddlers/Prompt: Default tiddlers
|
||||||
Basics/DefaultTiddlers/TopHint: Choose which tiddlers are displayed at startup
|
Basics/DefaultTiddlers/TopHint: Choose which tiddlers are displayed at startup
|
||||||
Basics/Language/Prompt: Hello! Current language:
|
Basics/Language/Prompt: Hello! Current language:
|
||||||
@@ -90,8 +90,8 @@ Plugins/Languages/Caption: Languages
|
|||||||
Plugins/Languages/Hint: Language pack plugins
|
Plugins/Languages/Hint: Language pack plugins
|
||||||
Plugins/NoInfoFound/Hint: No ''"<$text text=<<currentTab>>/>"'' found
|
Plugins/NoInfoFound/Hint: No ''"<$text text=<<currentTab>>/>"'' found
|
||||||
Plugins/NotInstalled/Hint: This plugin is not currently installed
|
Plugins/NotInstalled/Hint: This plugin is not currently installed
|
||||||
Plugins/OpenPluginLibrary: open plugin library
|
Plugins/OpenPluginLibrary: Open plugin library
|
||||||
Plugins/ClosePluginLibrary: close plugin library
|
Plugins/ClosePluginLibrary: Close plugin library
|
||||||
Plugins/PluginWillRequireReload: (requires reload)
|
Plugins/PluginWillRequireReload: (requires reload)
|
||||||
Plugins/Plugins/Caption: Plugins
|
Plugins/Plugins/Caption: Plugins
|
||||||
Plugins/Plugins/Hint: Plugins
|
Plugins/Plugins/Hint: Plugins
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
title: $:/language/Docs/Fields/
|
title: $:/language/Docs/Fields/
|
||||||
|
|
||||||
_canonical_uri: The full URI of an external image tiddler
|
_canonical_uri: The full URI of an external image tiddler
|
||||||
|
author: Name of the author of a plugin
|
||||||
bag: The name of the bag from which a tiddler came
|
bag: The name of the bag from which a tiddler came
|
||||||
caption: The text to be displayed on a tab or button
|
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''
|
code-body: The view template will display the tiddler as code if set to ''yes''
|
||||||
color: The CSS color value associated with a tiddler
|
color: The CSS color value associated with a tiddler
|
||||||
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
||||||
|
core-version: For a plugin, indicates what version of TiddlyWiki with which it is compatible
|
||||||
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
|
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
|
||||||
created: The date a tiddler was created
|
created: The date a tiddler was created
|
||||||
creator: The name of the person who created a tiddler
|
creator: The name of the person who created a tiddler
|
||||||
@@ -22,7 +24,9 @@ list-before: If set, the title of a tiddler before which this tiddler should be
|
|||||||
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
|
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
|
||||||
modified: The date and time at which a tiddler was last modified
|
modified: The date and time at which a tiddler was last modified
|
||||||
modifier: The tiddler title associated with the person who last modified a tiddler
|
modifier: The tiddler title associated with the person who last modified a tiddler
|
||||||
|
module-type: For javascript tiddlers, specifies what kind of module it is
|
||||||
name: The human readable name associated with a plugin tiddler
|
name: The human readable name associated with a plugin tiddler
|
||||||
|
parent-plugin: For a plugin, specifies which plugin of which it is a sub-plugin
|
||||||
plugin-priority: A numerical value indicating the priority of a plugin tiddler
|
plugin-priority: A numerical value indicating the priority of a plugin tiddler
|
||||||
plugin-type: The type of plugin in a plugin tiddler
|
plugin-type: The type of plugin in a plugin tiddler
|
||||||
revision: The revision of the tiddler held at the server
|
revision: The revision of the tiddler held at the server
|
||||||
|
|||||||
18
core/language/en-GB/Help/commands.tid
Normal file
18
core/language/en-GB/Help/commands.tid
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
title: $:/language/Help/commands
|
||||||
|
description: Run commands returned from a filter
|
||||||
|
|
||||||
|
Sequentially run the command tokens returned from a filter
|
||||||
|
|
||||||
|
```
|
||||||
|
--commands <filter>
|
||||||
|
```
|
||||||
|
|
||||||
|
Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
--commands "[enlist{$:/build-commands-as-text}]"
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
--commands "[{$:/build-commands-as-json}jsonindexes[]] :map[{$:/build-commands-as-json}jsonget<currentTiddler>]"
|
||||||
|
```
|
||||||
42
core/modules/commands/commands.js
Normal file
42
core/modules/commands/commands.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/commands/commands.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: command
|
||||||
|
|
||||||
|
Runs the commands returned from a filter
|
||||||
|
|
||||||
|
\*/
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.info = {
|
||||||
|
name: "commands",
|
||||||
|
synchronous: true
|
||||||
|
};
|
||||||
|
|
||||||
|
var Command = function(params, commander) {
|
||||||
|
this.params = params;
|
||||||
|
this.commander = commander;
|
||||||
|
};
|
||||||
|
|
||||||
|
Command.prototype.execute = function() {
|
||||||
|
// Parse the filter
|
||||||
|
var filter = this.params[0];
|
||||||
|
if(!filter) {
|
||||||
|
return "No filter specified";
|
||||||
|
}
|
||||||
|
var commands = this.commander.wiki.filterTiddlers(filter)
|
||||||
|
if(commands.length === 0) {
|
||||||
|
return "No tiddlers found for filter '" + filter + "'";
|
||||||
|
}
|
||||||
|
this.commander.addCommandTokens(commands);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Command = Command;
|
||||||
|
|
||||||
|
})();
|
||||||
@@ -57,7 +57,7 @@ Command.prototype.execute = function() {
|
|||||||
exportPath = path.resolve(outputPath,macroPath + extension);
|
exportPath = path.resolve(outputPath,macroPath + extension);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var finalPath = exportPath || path.resolve(pathname,encodeURIComponent(title) + extension);
|
var finalPath = exportPath || path.resolve(pathname,$tw.utils.encodeURIComponentExtended(title) + extension);
|
||||||
$tw.utils.createFileDirectories(finalPath);
|
$tw.utils.createFileDirectories(finalPath);
|
||||||
fs.writeFileSync(finalPath,text,"utf8");
|
fs.writeFileSync(finalPath,text,"utf8");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ Command.prototype.execute = function() {
|
|||||||
$tw.utils.each(filteredPluginList,function(title) {
|
$tw.utils.each(filteredPluginList,function(title) {
|
||||||
var tiddler = containerData.tiddlers[title];
|
var tiddler = containerData.tiddlers[title];
|
||||||
// Save each JSON file and collect the skinny data
|
// Save each JSON file and collect the skinny data
|
||||||
var pathname = path.resolve(self.commander.outputPath,basepath + encodeURIComponent(title) + ".json");
|
var pathname = path.resolve(self.commander.outputPath,basepath + $tw.utils.encodeURIComponentExtended(title) + ".json");
|
||||||
$tw.utils.createFileDirectories(pathname);
|
$tw.utils.createFileDirectories(pathname);
|
||||||
fs.writeFileSync(pathname,JSON.stringify(tiddler),"utf8");
|
fs.writeFileSync(pathname,JSON.stringify(tiddler),"utf8");
|
||||||
// Collect the skinny list data
|
// Collect the skinny list data
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Command.prototype.execute = function() {
|
|||||||
var tiddler = self.commander.wiki.getTiddler(title),
|
var tiddler = self.commander.wiki.getTiddler(title),
|
||||||
type = tiddler.fields.type || "text/vnd.tiddlywiki",
|
type = tiddler.fields.type || "text/vnd.tiddlywiki",
|
||||||
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"},
|
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"},
|
||||||
filename = path.resolve(pathname,encodeURIComponent(title));
|
filename = path.resolve(pathname,$tw.utils.encodeURIComponentExtended(title));
|
||||||
fs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);
|
fs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
|||||||
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
// Completely rerender if any of our attributes have changed
|
// Completely rerender if any of our attributes have changed
|
||||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || changedTiddlers[HEIGHT_MODE_TITLE] || changedTiddlers[ENABLE_TOOLBAR_TITLE] || changedAttributes.disabled || changedAttributes.fileDrop) {
|
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || changedTiddlers[HEIGHT_MODE_TITLE] || changedTiddlers[ENABLE_TOOLBAR_TITLE] || changedTiddlers["$:/palette"] || changedAttributes.disabled || changedAttributes.fileDrop) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else if (changedTiddlers[this.editRefreshTitle]) {
|
} else if (changedTiddlers[this.editRefreshTitle]) {
|
||||||
@@ -298,7 +298,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
|||||||
Propogate keydown events to our container for the keyboard widgets benefit
|
Propogate keydown events to our container for the keyboard widgets benefit
|
||||||
*/
|
*/
|
||||||
EditTextWidget.prototype.propogateKeydownEvent = function(event) {
|
EditTextWidget.prototype.propogateKeydownEvent = function(event) {
|
||||||
var newEvent = this.cloneEvent(event,["keyCode","which","metaKey","ctrlKey","altKey","shiftKey"]);
|
var newEvent = this.cloneEvent(event,["keyCode","code","which","key","metaKey","ctrlKey","altKey","shiftKey"]);
|
||||||
return !this.parentDomNode.dispatchEvent(newEvent);
|
return !this.parentDomNode.dispatchEvent(newEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,22 @@ Filter operator for applying decodeURIComponent() to each item.
|
|||||||
Export our filter functions
|
Export our filter functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
exports.decodebase64 = function(source,operator,options) {
|
||||||
|
var results = [];
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
results.push($tw.utils.base64Decode(title));
|
||||||
|
});
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.encodebase64 = function(source,operator,options) {
|
||||||
|
var results = [];
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
results.push($tw.utils.base64Encode(title));
|
||||||
|
});
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
exports.decodeuricomponent = function(source,operator,options) {
|
exports.decodeuricomponent = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
@@ -27,7 +43,7 @@ exports.decodeuricomponent = function(source,operator,options) {
|
|||||||
exports.encodeuricomponent = function(source,operator,options) {
|
exports.encodeuricomponent = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
results.push(encodeURIComponent(title));
|
results.push($tw.utils.encodeURIComponentExtended(title));
|
||||||
});
|
});
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,14 +21,15 @@ exports.filter = function(source,operator,options) {
|
|||||||
target = operator.prefix !== "!";
|
target = operator.prefix !== "!";
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
var list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),{
|
var list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),{
|
||||||
getVariable: function(name) {
|
getVariable: function(name,opts) {
|
||||||
|
opts = opts || {};
|
||||||
switch(name) {
|
switch(name) {
|
||||||
case "currentTiddler":
|
case "currentTiddler":
|
||||||
return "" + title;
|
return "" + title;
|
||||||
case "..currentTiddler":
|
case "..currentTiddler":
|
||||||
return options.widget.getVariable("currentTiddler");
|
return options.widget.getVariable("currentTiddler");
|
||||||
default:
|
default:
|
||||||
return options.widget.getVariable(name);
|
return options.widget.getVariable(name,opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,9 +17,23 @@ exports["jsonget"] = function(source,operator,options) {
|
|||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
var data = $tw.utils.parseJSONSafe(title,title);
|
var data = $tw.utils.parseJSONSafe(title,title);
|
||||||
if(data) {
|
if(data) {
|
||||||
var item = getDataItemValueAsString(data,operator.operands);
|
var items = getDataItemValueAsStrings(data,operator.operands);
|
||||||
|
if(items !== undefined) {
|
||||||
|
results.push.apply(results,items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports["jsonextract"] = function(source,operator,options) {
|
||||||
|
var results = [];
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
var data = $tw.utils.parseJSONSafe(title,title);
|
||||||
|
if(data) {
|
||||||
|
var item = getDataItem(data,operator.operands);
|
||||||
if(item !== undefined) {
|
if(item !== undefined) {
|
||||||
results.push(item);
|
results.push(JSON.stringify(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -31,9 +45,9 @@ exports["jsonindexes"] = function(source,operator,options) {
|
|||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
var data = $tw.utils.parseJSONSafe(title,title);
|
var data = $tw.utils.parseJSONSafe(title,title);
|
||||||
if(data) {
|
if(data) {
|
||||||
var item = getDataItemKeysAsStrings(data,operator.operands);
|
var items = getDataItemKeysAsStrings(data,operator.operands);
|
||||||
if(item !== undefined) {
|
if(items !== undefined) {
|
||||||
results.push.apply(results,item);
|
results.push.apply(results,items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -57,11 +71,11 @@ exports["jsontype"] = function(source,operator,options) {
|
|||||||
/*
|
/*
|
||||||
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
|
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
|
||||||
*/
|
*/
|
||||||
function getDataItemValueAsString(data,indexes) {
|
function getDataItemValueAsStrings(data,indexes) {
|
||||||
// Get the item
|
// Get the item
|
||||||
var item = getDataItem(data,indexes);
|
var item = getDataItem(data,indexes);
|
||||||
// Return the item as a string
|
// Return the item as a string list
|
||||||
return convertDataItemValueToString(item);
|
return convertDataItemValueToStrings(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -77,15 +91,34 @@ function getDataItemKeysAsStrings(data,indexes) {
|
|||||||
/*
|
/*
|
||||||
Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined
|
Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined
|
||||||
*/
|
*/
|
||||||
function convertDataItemValueToString(item) {
|
function convertDataItemValueToStrings(item) {
|
||||||
// Return the item as a string
|
// Return the item as a string
|
||||||
if(item === undefined) {
|
if(item === undefined) {
|
||||||
return item;
|
return undefined;
|
||||||
|
} else if(item === null) {
|
||||||
|
return ["null"]
|
||||||
|
} else if(typeof item === "object") {
|
||||||
|
var results = [],i,t;
|
||||||
|
if($tw.utils.isArray(item)) {
|
||||||
|
// Return all the items in arrays recursively
|
||||||
|
for(i=0; i<item.length; i++) {
|
||||||
|
t = convertDataItemValueToStrings(item[i])
|
||||||
|
if(t !== undefined) {
|
||||||
|
results.push.apply(results,t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Return all the values in objects recursively
|
||||||
|
$tw.utils.each(Object.keys(item).sort(),function(key) {
|
||||||
|
t = convertDataItemValueToStrings(item[key]);
|
||||||
|
if(t !== undefined) {
|
||||||
|
results.push.apply(results,t);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
if(typeof item === "object") {
|
return [item.toString()];
|
||||||
return JSON.stringify(item);
|
|
||||||
}
|
|
||||||
return item.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -143,7 +176,11 @@ function getDataItem(data,indexes) {
|
|||||||
var item = data;
|
var item = data;
|
||||||
for(var i=0; i<indexes.length; i++) {
|
for(var i=0; i<indexes.length; i++) {
|
||||||
if(item !== undefined) {
|
if(item !== undefined) {
|
||||||
item = item[indexes[i]];
|
if(item !== null && ["number","string","boolean"].indexOf(typeof item) === -1) {
|
||||||
|
item = item[indexes[i]];
|
||||||
|
} else {
|
||||||
|
item = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ exports.reduce = function(source,operator,options) {
|
|||||||
for(var index=0; index<results.length; index++) {
|
for(var index=0; index<results.length; index++) {
|
||||||
var title = results[index],
|
var title = results[index],
|
||||||
list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),{
|
list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),{
|
||||||
getVariable: function(name) {
|
getVariable: function(name,opts) {
|
||||||
|
opts = opts || {};
|
||||||
switch(name) {
|
switch(name) {
|
||||||
case "currentTiddler":
|
case "currentTiddler":
|
||||||
return "" + title;
|
return "" + title;
|
||||||
@@ -42,7 +43,7 @@ exports.reduce = function(source,operator,options) {
|
|||||||
case "length":
|
case "length":
|
||||||
return "" + results.length;
|
return "" + results.length;
|
||||||
default:
|
default:
|
||||||
return options.widget.getVariable(name);
|
return options.widget.getVariable(name,opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,14 +26,15 @@ exports.sortsub = function(source,operator,options) {
|
|||||||
var r = filterFn.call(options.wiki,function(iterator) {
|
var r = filterFn.call(options.wiki,function(iterator) {
|
||||||
iterator(options.wiki.getTiddler(title),title);
|
iterator(options.wiki.getTiddler(title),title);
|
||||||
},{
|
},{
|
||||||
getVariable: function(name) {
|
getVariable: function(name,opts) {
|
||||||
|
opts = opts || {};
|
||||||
switch(name) {
|
switch(name) {
|
||||||
case "currentTiddler":
|
case "currentTiddler":
|
||||||
return "" + title;
|
return "" + title;
|
||||||
case "..currentTiddler":
|
case "..currentTiddler":
|
||||||
return options.widget.getVariable("currentTiddler");
|
return options.widget.getVariable("currentTiddler");
|
||||||
default:
|
default:
|
||||||
return options.widget.getVariable(name);
|
return options.widget.getVariable(name,opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -74,6 +74,113 @@ exports.join = makeStringReducingOperator(
|
|||||||
},null
|
},null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var dmp = require("$:/core/modules/utils/diff-match-patch/diff_match_patch.js");
|
||||||
|
|
||||||
|
exports.levenshtein = makeStringBinaryOperator(
|
||||||
|
function(a,b) {
|
||||||
|
var dmpObject = new dmp.diff_match_patch(),
|
||||||
|
diffs = dmpObject.diff_main(a,b);
|
||||||
|
return [dmpObject.diff_levenshtein(diffs) + ""];
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// these two functions are adapted from https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs
|
||||||
|
function diffLineWordMode(text1,text2,mode) {
|
||||||
|
var dmpObject = new dmp.diff_match_patch();
|
||||||
|
var a = diffPartsToChars(text1,text2,mode);
|
||||||
|
var lineText1 = a.chars1;
|
||||||
|
var lineText2 = a.chars2;
|
||||||
|
var lineArray = a.lineArray;
|
||||||
|
var diffs = dmpObject.diff_main(lineText1,lineText2,false);
|
||||||
|
dmpObject.diff_charsToLines_(diffs,lineArray);
|
||||||
|
return diffs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function diffPartsToChars(text1,text2,mode) {
|
||||||
|
var lineArray = [];
|
||||||
|
var lineHash = {};
|
||||||
|
lineArray[0] = '';
|
||||||
|
|
||||||
|
function diff_linesToPartsMunge_(text,mode) {
|
||||||
|
var chars = '';
|
||||||
|
var lineStart = 0;
|
||||||
|
var lineEnd = -1;
|
||||||
|
var lineArrayLength = lineArray.length,
|
||||||
|
regexpResult;
|
||||||
|
const searchRegexp = /\W+/g;
|
||||||
|
while(lineEnd < text.length - 1) {
|
||||||
|
if(mode === "words") {
|
||||||
|
regexpResult = searchRegexp.exec(text);
|
||||||
|
lineEnd = searchRegexp.lastIndex;
|
||||||
|
if(regexpResult === null) {
|
||||||
|
lineEnd = text.length;
|
||||||
|
}
|
||||||
|
lineEnd = --lineEnd;
|
||||||
|
} else {
|
||||||
|
lineEnd = text.indexOf('\n', lineStart);
|
||||||
|
if(lineEnd == -1) {
|
||||||
|
lineEnd = text.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var line = text.substring(lineStart, lineEnd + 1);
|
||||||
|
|
||||||
|
if(lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : (lineHash[line] !== undefined)) {
|
||||||
|
chars += String.fromCharCode(lineHash[line]);
|
||||||
|
} else {
|
||||||
|
if (lineArrayLength == maxLines) {
|
||||||
|
line = text.substring(lineStart);
|
||||||
|
lineEnd = text.length;
|
||||||
|
}
|
||||||
|
chars += String.fromCharCode(lineArrayLength);
|
||||||
|
lineHash[line] = lineArrayLength;
|
||||||
|
lineArray[lineArrayLength++] = line;
|
||||||
|
}
|
||||||
|
lineStart = lineEnd + 1;
|
||||||
|
}
|
||||||
|
return chars;
|
||||||
|
}
|
||||||
|
var maxLines = 40000;
|
||||||
|
var chars1 = diff_linesToPartsMunge_(text1,mode);
|
||||||
|
maxLines = 65535;
|
||||||
|
var chars2 = diff_linesToPartsMunge_(text2,mode);
|
||||||
|
return {chars1: chars1, chars2: chars2, lineArray: lineArray};
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.makepatches = function(source,operator,options) {
|
||||||
|
var dmpObject = new dmp.diff_match_patch(),
|
||||||
|
suffix = operator.suffix || "",
|
||||||
|
result = [];
|
||||||
|
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
var diffs, patches;
|
||||||
|
if(suffix === "lines" || suffix === "words") {
|
||||||
|
diffs = diffLineWordMode(title,operator.operand,suffix);
|
||||||
|
patches = dmpObject.patch_make(title,diffs);
|
||||||
|
} else {
|
||||||
|
patches = dmpObject.patch_make(title,operator.operand);
|
||||||
|
}
|
||||||
|
Array.prototype.push.apply(result,[dmpObject.patch_toText(patches)]);
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.applypatches = makeStringBinaryOperator(
|
||||||
|
function(a,b) {
|
||||||
|
var dmpObject = new dmp.diff_match_patch(),
|
||||||
|
patches;
|
||||||
|
try {
|
||||||
|
patches = dmpObject.patch_fromText(b);
|
||||||
|
} catch(e) {
|
||||||
|
}
|
||||||
|
if(patches) {
|
||||||
|
return [dmpObject.patch_apply(patches,a)[0]];
|
||||||
|
} else {
|
||||||
|
return [a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function makeStringBinaryOperator(fnCalc) {
|
function makeStringBinaryOperator(fnCalc) {
|
||||||
return function(source,operator,options) {
|
return function(source,operator,options) {
|
||||||
var result = [];
|
var result = [];
|
||||||
@@ -184,4 +291,4 @@ exports.charcode = function(source,operator,options) {
|
|||||||
return [chars.join("")];
|
return [chars.join("")];
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
@@ -13,6 +13,11 @@ The CSV text parser processes CSV files into a table wrapped in a scrollable wid
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var CsvParser = function(type,text,options) {
|
var CsvParser = function(type,text,options) {
|
||||||
|
// Special handler for tab-delimited files
|
||||||
|
if (type === 'text/tab-delimited-values' && !options.separator) {
|
||||||
|
options.separator = "\t";
|
||||||
|
}
|
||||||
|
|
||||||
// Table framework
|
// Table framework
|
||||||
this.tree = [{
|
this.tree = [{
|
||||||
"type": "scrollable", "children": [{
|
"type": "scrollable", "children": [{
|
||||||
@@ -24,30 +29,33 @@ var CsvParser = function(type,text,options) {
|
|||||||
}]
|
}]
|
||||||
}];
|
}];
|
||||||
// Split the text into lines
|
// Split the text into lines
|
||||||
var lines = text.split(/\r?\n/mg),
|
var lines = $tw.utils.parseCsvString(text, options),
|
||||||
tag = "th";
|
tag = "th";
|
||||||
|
var maxColumns = 0;
|
||||||
|
$tw.utils.each(lines, function(columns) {
|
||||||
|
maxColumns = Math.max(columns.length, maxColumns);
|
||||||
|
});
|
||||||
|
|
||||||
for(var line=0; line<lines.length; line++) {
|
for(var line=0; line<lines.length; line++) {
|
||||||
var lineText = lines[line];
|
var columns = lines[line];
|
||||||
if(lineText) {
|
var row = {
|
||||||
var row = {
|
"type": "element", "tag": "tr", "children": []
|
||||||
"type": "element", "tag": "tr", "children": []
|
};
|
||||||
};
|
for(var column=0; column<maxColumns; column++) {
|
||||||
var columns = lineText.split(",");
|
row.children.push({
|
||||||
for(var column=0; column<columns.length; column++) {
|
"type": "element", "tag": tag, "children": [{
|
||||||
row.children.push({
|
"type": "text",
|
||||||
"type": "element", "tag": tag, "children": [{
|
"text": columns[column] || ''
|
||||||
"type": "text",
|
}]
|
||||||
"text": columns[column]
|
});
|
||||||
}]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
tag = "td";
|
|
||||||
this.tree[0].children[0].children[0].children.push(row);
|
|
||||||
}
|
}
|
||||||
|
tag = "td";
|
||||||
|
this.tree[0].children[0].children[0].children.push(row);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports["text/csv"] = CsvParser;
|
exports["text/csv"] = CsvParser;
|
||||||
|
exports["text/tab-delimited-values"] = CsvParser;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ The PDF parser embeds a PDF viewer
|
|||||||
var ImageParser = function(type,text,options) {
|
var ImageParser = function(type,text,options) {
|
||||||
var element = {
|
var element = {
|
||||||
type: "element",
|
type: "element",
|
||||||
tag: "embed",
|
tag: "iframe",
|
||||||
attributes: {}
|
attributes: {}
|
||||||
},
|
},
|
||||||
src;
|
src;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /^\\import[^\S\n]/mg;
|
this.matchRegExp = /\\import[^\S\n]/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /^\\define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
|
this.matchRegExp = /\\define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -58,7 +58,7 @@ exports.parse = function() {
|
|||||||
var reEnd;
|
var reEnd;
|
||||||
if(this.match[3]) {
|
if(this.match[3]) {
|
||||||
// If so, the end of the body is marked with \end
|
// If so, the end of the body is marked with \end
|
||||||
reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg");
|
reEnd = new RegExp("(\\r?\\n\\s*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg");
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, the end of the definition is marked by the end of the line
|
// Otherwise, the end of the definition is marked by the end of the line
|
||||||
reEnd = /($|\r?\n)/mg;
|
reEnd = /($|\r?\n)/mg;
|
||||||
|
|||||||
68
core/modules/parsers/wikiparser/rules/parsermode.js
Normal file
68
core/modules/parsers/wikiparser/rules/parsermode.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/parsers/wikiparser/rules/parsermode.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: wikirule
|
||||||
|
|
||||||
|
Wiki pragma rule for parser mode specifications
|
||||||
|
|
||||||
|
```
|
||||||
|
\parsermode block
|
||||||
|
\parsermode inline
|
||||||
|
```
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.name = "parsermode";
|
||||||
|
exports.types = {pragma: true};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Instantiate parse rule
|
||||||
|
*/
|
||||||
|
exports.init = function(parser) {
|
||||||
|
this.parser = parser;
|
||||||
|
// Regexp to match
|
||||||
|
this.matchRegExp = /\\parsermode[^\S\n]/mg;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Parse the most recent match
|
||||||
|
*/
|
||||||
|
exports.parse = function() {
|
||||||
|
// Move past the pragma invocation
|
||||||
|
this.parser.pos = this.matchRegExp.lastIndex;
|
||||||
|
// Parse whitespace delimited tokens terminated by a line break
|
||||||
|
var reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,
|
||||||
|
parserMode = undefined;
|
||||||
|
reMatch.lastIndex = this.parser.pos;
|
||||||
|
var match = reMatch.exec(this.parser.source);
|
||||||
|
while(match && match.index === this.parser.pos) {
|
||||||
|
this.parser.pos = reMatch.lastIndex;
|
||||||
|
// Exit if we've got the line break
|
||||||
|
if(match[2]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Process the token
|
||||||
|
if(match[1]) {
|
||||||
|
parserMode = match[1];
|
||||||
|
}
|
||||||
|
// Match the next token
|
||||||
|
match = reMatch.exec(this.parser.source);
|
||||||
|
}
|
||||||
|
// Process the tokens
|
||||||
|
if(parserMode !== undefined) {
|
||||||
|
if(parserMode === "block") {
|
||||||
|
this.parser.parseAsInline = false;
|
||||||
|
} else if(parserMode === "inline") {
|
||||||
|
this.parser.parseAsInline = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// No parse tree nodes to return
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
||||||
@@ -26,7 +26,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /^\\rules[^\S\n]/mg;
|
this.matchRegExp = /\\rules[^\S\n]/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /^\\whitespace[^\S\n]/mg;
|
this.matchRegExp = /\\whitespace[^\S\n]/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ var WikiParser = function(type,text,options) {
|
|||||||
this.sourceLength = this.source.length;
|
this.sourceLength = this.source.length;
|
||||||
// Flag for ignoring whitespace
|
// Flag for ignoring whitespace
|
||||||
this.configTrimWhiteSpace = false;
|
this.configTrimWhiteSpace = false;
|
||||||
|
// Parser mode
|
||||||
|
this.parseAsInline = options.parseAsInline;
|
||||||
// Set current parse position
|
// Set current parse position
|
||||||
this.pos = 0;
|
this.pos = 0;
|
||||||
// Start with empty output
|
// Start with empty output
|
||||||
@@ -83,7 +85,7 @@ var WikiParser = function(type,text,options) {
|
|||||||
// Parse any pragmas
|
// Parse any pragmas
|
||||||
var topBranch = this.parsePragmas();
|
var topBranch = this.parsePragmas();
|
||||||
// Parse the text into inline runs or blocks
|
// Parse the text into inline runs or blocks
|
||||||
if(options.parseAsInline) {
|
if(this.parseAsInline) {
|
||||||
topBranch.push.apply(topBranch,this.parseInlineRun());
|
topBranch.push.apply(topBranch,this.parseInlineRun());
|
||||||
} else {
|
} else {
|
||||||
topBranch.push.apply(topBranch,this.parseBlocks());
|
topBranch.push.apply(topBranch,this.parseBlocks());
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
/*\
|
|
||||||
title: $:/core/modules/savers/beaker.js
|
|
||||||
type: application/javascript
|
|
||||||
module-type: saver
|
|
||||||
|
|
||||||
Saves files using the Beaker browser's (https://beakerbrowser.com) Dat protocol (https://datproject.org/)
|
|
||||||
Compatible with beaker >= V0.7.2
|
|
||||||
|
|
||||||
\*/
|
|
||||||
(function(){
|
|
||||||
|
|
||||||
/*jslint node: true, browser: true */
|
|
||||||
/*global $tw: false */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
Set up the saver
|
|
||||||
*/
|
|
||||||
var BeakerSaver = function(wiki) {
|
|
||||||
this.wiki = wiki;
|
|
||||||
};
|
|
||||||
|
|
||||||
BeakerSaver.prototype.save = function(text,method,callback) {
|
|
||||||
var dat = new DatArchive("" + window.location),
|
|
||||||
pathname = ("" + window.location.pathname).split("#")[0];
|
|
||||||
dat.stat(pathname).then(function(value) {
|
|
||||||
if(value.isDirectory()) {
|
|
||||||
pathname = pathname + "/index.html";
|
|
||||||
}
|
|
||||||
dat.writeFile(pathname,text,"utf8").then(function(value) {
|
|
||||||
callback(null);
|
|
||||||
},function(reason) {
|
|
||||||
callback("Beaker Saver Write Error: " + reason);
|
|
||||||
});
|
|
||||||
},function(reason) {
|
|
||||||
callback("Beaker Saver Stat Error: " + reason);
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Information about this saver
|
|
||||||
*/
|
|
||||||
BeakerSaver.prototype.info = {
|
|
||||||
name: "beaker",
|
|
||||||
priority: 3000,
|
|
||||||
capabilities: ["save", "autosave"]
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Static method that returns true if this saver is capable of working
|
|
||||||
*/
|
|
||||||
exports.canSave = function(wiki) {
|
|
||||||
return !!window.DatArchive && location.protocol==="dat:";
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Create an instance of this saver
|
|
||||||
*/
|
|
||||||
exports.create = function(wiki) {
|
|
||||||
return new BeakerSaver(wiki);
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/*\
|
|
||||||
title: $:/core/modules/savers/hyperdrive.js
|
|
||||||
type: application/javascript
|
|
||||||
module-type: saver
|
|
||||||
|
|
||||||
Saves files using the Hyperdrive Protocol (https://hypercore-protocol.org/#hyperdrive) Beaker browser beta-1.0 and later (https://beakerbrowser.com)
|
|
||||||
Compatible with beaker >= V1.0.0
|
|
||||||
|
|
||||||
\*/
|
|
||||||
(function(){
|
|
||||||
|
|
||||||
/*jslint node: true, browser: true */
|
|
||||||
/*global $tw: false */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
Set up the saver
|
|
||||||
*/
|
|
||||||
var HyperdriveSaver = function(wiki) {
|
|
||||||
this.wiki = wiki;
|
|
||||||
};
|
|
||||||
|
|
||||||
HyperdriveSaver.prototype.save = function(text,method,callback) {
|
|
||||||
var dat = beaker.hyperdrive.drive("" + window.location),
|
|
||||||
pathname = ("" + window.location.pathname).split("#")[0];
|
|
||||||
dat.stat(pathname).then(function(value) {
|
|
||||||
if(value.isDirectory()) {
|
|
||||||
pathname = pathname + "/index.html";
|
|
||||||
}
|
|
||||||
dat.writeFile(pathname,text,"utf8").then(function(value) {
|
|
||||||
callback(null);
|
|
||||||
},function(reason) {
|
|
||||||
callback("Hyperdrive Saver Write Error: " + reason);
|
|
||||||
});
|
|
||||||
},function(reason) {
|
|
||||||
callback("Hyperdrive Saver Stat Error: " + reason);
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Information about this saver
|
|
||||||
*/
|
|
||||||
HyperdriveSaver.prototype.info = {
|
|
||||||
name: "beaker-1.x",
|
|
||||||
priority: 3000,
|
|
||||||
capabilities: ["save", "autosave"]
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Static method that returns true if this saver is capable of working
|
|
||||||
*/
|
|
||||||
exports.canSave = function(wiki) {
|
|
||||||
return !!window.beaker && !!beaker.hyperdrive && location.protocol==="hyper:";
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Create an instance of this saver
|
|
||||||
*/
|
|
||||||
exports.create = function(wiki) {
|
|
||||||
return new HyperdriveSaver(wiki);
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -21,6 +21,7 @@ exports.handler = function(request,response,state) {
|
|||||||
username: state.authenticatedUsername || state.server.get("anon-username") || "",
|
username: state.authenticatedUsername || state.server.get("anon-username") || "",
|
||||||
anonymous: !state.authenticatedUsername,
|
anonymous: !state.authenticatedUsername,
|
||||||
read_only: !state.server.isAuthorized("writers",state.authenticatedUsername),
|
read_only: !state.server.isAuthorized("writers",state.authenticatedUsername),
|
||||||
|
logout_is_available: false,
|
||||||
space: {
|
space: {
|
||||||
recipe: "default"
|
recipe: "default"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,6 +30,16 @@ exports.handler = function(request,response,state) {
|
|||||||
if(fields.revision) {
|
if(fields.revision) {
|
||||||
delete fields.revision;
|
delete fields.revision;
|
||||||
}
|
}
|
||||||
|
// If this is a skinny tiddler, it means the client never got the full
|
||||||
|
// version of the tiddler to edit. So we must preserve whatever text
|
||||||
|
// already exists on the server, or else we'll inadvertently delete it.
|
||||||
|
if(fields._is_skinny !== undefined) {
|
||||||
|
var tiddler = state.wiki.getTiddler(title);
|
||||||
|
if(tiddler) {
|
||||||
|
fields.text = tiddler.fields.text;
|
||||||
|
}
|
||||||
|
delete fields._is_skinny;
|
||||||
|
}
|
||||||
state.wiki.addTiddler(new $tw.Tiddler(fields,{title: title}));
|
state.wiki.addTiddler(new $tw.Tiddler(fields,{title: title}));
|
||||||
var changeCount = state.wiki.getChangeCount(title).toString();
|
var changeCount = state.wiki.getChangeCount(title).toString();
|
||||||
response.writeHead(204, "OK",{
|
response.writeHead(204, "OK",{
|
||||||
|
|||||||
@@ -121,7 +121,11 @@ exports.startup = function() {
|
|||||||
});
|
});
|
||||||
// Set up the syncer object if we've got a syncadaptor
|
// Set up the syncer object if we've got a syncadaptor
|
||||||
if($tw.syncadaptor) {
|
if($tw.syncadaptor) {
|
||||||
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});
|
$tw.syncer = new $tw.Syncer({
|
||||||
|
wiki: $tw.wiki,
|
||||||
|
syncadaptor: $tw.syncadaptor,
|
||||||
|
logging: $tw.wiki.getTiddlerText('$:/config/SyncLogging', "yes") === "yes"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Setup the saver handler
|
// Setup the saver handler
|
||||||
$tw.saverHandler = new $tw.SaverHandler({
|
$tw.saverHandler = new $tw.SaverHandler({
|
||||||
|
|||||||
@@ -402,6 +402,7 @@ Syncer.prototype.handleLazyLoadEvent = function(title) {
|
|||||||
// Mark the tiddler as needing loading, and having already been lazily loaded
|
// Mark the tiddler as needing loading, and having already been lazily loaded
|
||||||
this.titlesToBeLoaded[title] = true;
|
this.titlesToBeLoaded[title] = true;
|
||||||
this.titlesHaveBeenLazyLoaded[title] = true;
|
this.titlesHaveBeenLazyLoaded[title] = true;
|
||||||
|
this.processTaskQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,35 +12,113 @@ A barebones CSV parser
|
|||||||
/*global $tw: false */
|
/*global $tw: false */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var QUOTE = '"';
|
||||||
|
|
||||||
|
var getCellInfo = function(text, start, length, SEPARATOR) {
|
||||||
|
var isCellQuoted = text.charAt(start) === QUOTE;
|
||||||
|
var cellStart = isCellQuoted ? start + 1 : start;
|
||||||
|
|
||||||
|
if (text.charAt(i) === SEPARATOR) {
|
||||||
|
return [cellStart, cellStart, false];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = cellStart; i < length; i++) {
|
||||||
|
var cellCharacter = text.charAt(i);
|
||||||
|
var isEOL = cellCharacter === "\n" || cellCharacter === "\r";
|
||||||
|
|
||||||
|
if (isEOL && !isCellQuoted) {
|
||||||
|
return [cellStart, i, false];
|
||||||
|
|
||||||
|
} else if (cellCharacter === SEPARATOR && !isCellQuoted) {
|
||||||
|
return [cellStart, i, false];
|
||||||
|
|
||||||
|
} else if (cellCharacter === QUOTE && isCellQuoted) {
|
||||||
|
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
||||||
|
if (nextCharacter !== QUOTE) {
|
||||||
|
return [cellStart, i, true];
|
||||||
|
} else {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [cellStart, i, isCellQuoted];
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.parseCsvString = function(text, options) {
|
||||||
|
if (!text) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
var SEPARATOR = options.separator || ",",
|
||||||
|
length = text.length,
|
||||||
|
rows = [],
|
||||||
|
nextRow = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < length; i++) {
|
||||||
|
var cellInfo = getCellInfo(text, i, length, SEPARATOR);
|
||||||
|
var cellText = text.substring(cellInfo[0], cellInfo[1]);
|
||||||
|
if (cellInfo[2]) {
|
||||||
|
cellText = cellText.replace(/""/g, '"');
|
||||||
|
cellInfo[1]++;
|
||||||
|
}
|
||||||
|
nextRow.push(cellText);
|
||||||
|
|
||||||
|
i = cellInfo[1];
|
||||||
|
|
||||||
|
var character = text.charAt(i);
|
||||||
|
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
||||||
|
|
||||||
|
if (character === "\r" || character === "\n") {
|
||||||
|
// Edge case for empty rows
|
||||||
|
if (nextRow.length === 1 && nextRow[0] === '') {
|
||||||
|
nextRow.length = 0;
|
||||||
|
}
|
||||||
|
rows.push(nextRow);
|
||||||
|
nextRow = [];
|
||||||
|
|
||||||
|
if (character === "\r") {
|
||||||
|
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
||||||
|
|
||||||
|
if (nextCharacter === "\n") {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special case if last cell in last row is an empty cell
|
||||||
|
if (text.charAt(length - 1) === SEPARATOR) {
|
||||||
|
nextRow.push("");
|
||||||
|
}
|
||||||
|
|
||||||
|
rows.push(nextRow);
|
||||||
|
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Parse a CSV string with a header row and return an array of hashmaps.
|
Parse a CSV string with a header row and return an array of hashmaps.
|
||||||
*/
|
*/
|
||||||
exports.parseCsvStringWithHeader = function(text,options) {
|
exports.parseCsvStringWithHeader = function(text,options) {
|
||||||
options = options || {};
|
var csv = $tw.utils.parseCsvString(text, options);
|
||||||
var separator = options.separator || ",",
|
var headers = csv[0];
|
||||||
rows = text.split(/\r?\n/mg).map(function(row) {
|
|
||||||
return $tw.utils.trim(row);
|
csv = csv.slice(1);
|
||||||
}).filter(function(row) {
|
for (var i = 0; i < csv.length; i++) {
|
||||||
return row !== "";
|
var row = csv[i];
|
||||||
});
|
var rowObject = Object.create(null);
|
||||||
if(rows.length < 1) {
|
|
||||||
return "Missing header row";
|
for(var columnIndex=0; columnIndex<headers.length; columnIndex++) {
|
||||||
}
|
var columnName = headers[columnIndex];
|
||||||
var headings = rows[0].split(separator),
|
if (columnName) {
|
||||||
results = [];
|
rowObject[columnName] = $tw.utils.trim(row[columnIndex] || "");
|
||||||
for(var row=1; row<rows.length; row++) {
|
}
|
||||||
var columns = rows[row].split(separator),
|
|
||||||
columnResult = Object.create(null);
|
|
||||||
if(columns.length !== headings.length) {
|
|
||||||
return "Malformed CSV row '" + rows[row] + "'";
|
|
||||||
}
|
}
|
||||||
for(var column=0; column<columns.length; column++) {
|
csv[i] = rowObject;
|
||||||
var columnName = headings[column];
|
|
||||||
columnResult[columnName] = $tw.utils.trim(columns[column] || "");
|
|
||||||
}
|
|
||||||
results.push(columnResult);
|
|
||||||
}
|
}
|
||||||
return results;
|
return csv;
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ Various static DOM-related utility functions.
|
|||||||
/*global $tw: false */
|
/*global $tw: false */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var Popup = require("$:/core/modules/utils/dom/popup.js");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Determines whether element 'a' contains element 'b'
|
Determines whether element 'a' contains element 'b'
|
||||||
Code thanks to John Resig, http://ejohn.org/blog/comparing-document-position/
|
Code thanks to John Resig, http://ejohn.org/blog/comparing-document-position/
|
||||||
@@ -294,8 +296,21 @@ exports.collectDOMVariables = function(selectedNode,domNode,event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(selectedNode.offsetLeft) {
|
if(selectedNode.offsetLeft) {
|
||||||
// Add a variable with a popup coordinate string for the selected node
|
// Add variables with a (relative and absolute) popup coordinate string for the selected node
|
||||||
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
|
var nodeRect = {
|
||||||
|
left: selectedNode.offsetLeft,
|
||||||
|
top: selectedNode.offsetTop,
|
||||||
|
width: selectedNode.offsetWidth,
|
||||||
|
height: selectedNode.offsetHeight
|
||||||
|
};
|
||||||
|
variables["tv-popup-coords"] = Popup.buildCoordinates(Popup.coordinatePrefix.csOffsetParent,nodeRect);
|
||||||
|
|
||||||
|
var absRect = $tw.utils.extend({}, nodeRect);
|
||||||
|
for (var currentNode = selectedNode.offsetParent; currentNode; currentNode = currentNode.offsetParent) {
|
||||||
|
absRect.left += currentNode.offsetLeft;
|
||||||
|
absRect.top += currentNode.offsetTop;
|
||||||
|
}
|
||||||
|
variables["tv-popup-abs-coords"] = Popup.buildCoordinates(Popup.coordinatePrefix.csAbsolute,absRect);
|
||||||
|
|
||||||
// Add variables for offset of selected node
|
// Add variables for offset of selected node
|
||||||
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
|
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ Display a modal dialogue
|
|||||||
options: see below
|
options: see below
|
||||||
Options include:
|
Options include:
|
||||||
downloadLink: Text of a big download link to include
|
downloadLink: Text of a big download link to include
|
||||||
|
event: widget event
|
||||||
|
variables: from event.paramObject
|
||||||
*/
|
*/
|
||||||
Modal.prototype.display = function(title,options) {
|
Modal.prototype.display = function(title,options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@@ -209,6 +211,10 @@ Modal.prototype.display = function(title,options) {
|
|||||||
headerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
headerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
||||||
bodyWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
bodyWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
||||||
footerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
footerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
||||||
|
// Whether to close the modal dialog when the mask (area outside the modal) is clicked
|
||||||
|
if(tiddler.fields && (tiddler.fields["mask-closable"] === "yes" || tiddler.fields["mask-closable"] === "true")) {
|
||||||
|
modalBackdrop.addEventListener("click",closeHandler,false);
|
||||||
|
}
|
||||||
// Set the initial styles for the message
|
// Set the initial styles for the message
|
||||||
$tw.utils.setStyle(modalBackdrop,[
|
$tw.utils.setStyle(modalBackdrop,[
|
||||||
{opacity: "0"}
|
{opacity: "0"}
|
||||||
|
|||||||
@@ -22,6 +22,19 @@ var Popup = function(options) {
|
|||||||
this.popups = []; // Array of {title:,wiki:,domNode:} objects
|
this.popups = []; // Array of {title:,wiki:,domNode:} objects
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Global regular expression for parsing the location of a popup.
|
||||||
|
This is also used by the Reveal widget.
|
||||||
|
*/
|
||||||
|
exports.popupLocationRegExp = /^(@?)\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Objekt containing the available prefixes for coordinates build with the `buildCoordinates` function:
|
||||||
|
- csOffsetParent: Uses a coordinate system based on the offset parent (no prefix).
|
||||||
|
- csAbsolute: Use an absolute coordinate system (prefix "@").
|
||||||
|
*/
|
||||||
|
exports.coordinatePrefix = { csOffsetParent: "", csAbsolute: "@" }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Trigger a popup open or closed. Parameters are in a hashmap:
|
Trigger a popup open or closed. Parameters are in a hashmap:
|
||||||
title: title of the tiddler where the popup details are stored
|
title: title of the tiddler where the popup details are stored
|
||||||
@@ -136,8 +149,17 @@ Popup.prototype.show = function(options) {
|
|||||||
height: options.domNode.offsetHeight
|
height: options.domNode.offsetHeight
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
var popupRect = "(" + rect.left + "," + rect.top + "," +
|
if(options.absolute && options.domNode) {
|
||||||
rect.width + "," + rect.height + ")";
|
// Walk the offsetParent chain and add the position of the offsetParents to make
|
||||||
|
// the position absolute to the root node of the page.
|
||||||
|
var currentNode = options.domNode.offsetParent;
|
||||||
|
while(currentNode) {
|
||||||
|
rect.left += currentNode.offsetLeft;
|
||||||
|
rect.top += currentNode.offsetTop;
|
||||||
|
currentNode = currentNode.offsetParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var popupRect = exports.buildCoordinates(options.absolute?exports.coordinatePrefix.csAbsolute:exports.coordinatePrefix.csOffsetParent,rect);
|
||||||
if(options.noStateReference) {
|
if(options.noStateReference) {
|
||||||
options.wiki.setText(options.title,"text",undefined,popupRect);
|
options.wiki.setText(options.title,"text",undefined,popupRect);
|
||||||
} else {
|
} else {
|
||||||
@@ -172,13 +194,54 @@ Popup.prototype.cancel = function(level) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Returns true if the specified title and text identifies an active popup
|
Returns true if the specified title and text identifies an active popup.
|
||||||
|
This function is safe to call, even if the popup class was not initialized.
|
||||||
*/
|
*/
|
||||||
Popup.prototype.readPopupState = function(text) {
|
exports.readPopupState = function(text) {
|
||||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/;
|
return exports.popupLocationRegExp.test(text);
|
||||||
return popupLocationRegExp.test(text);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Parses a coordinate string in the format `(x,y,w,h)` or `@(x,y,z,h)` and returns
|
||||||
|
an object containing the position, width and height. The absolute-Mark is boolean
|
||||||
|
value that indicates the coordinate system of the coordinates. If they start with
|
||||||
|
an `@`, `absolute` is set to true and the coordinates are relative to the root
|
||||||
|
element. If the initial `@` is missing, they are relative to the offset parent
|
||||||
|
element and `absoute` is false.
|
||||||
|
This function is safe to call, even if the popup class was not initialized.
|
||||||
|
*/
|
||||||
|
exports.parseCoordinates = function(coordinates) {
|
||||||
|
var match = exports.popupLocationRegExp.exec(coordinates);
|
||||||
|
if(match) {
|
||||||
|
return {
|
||||||
|
absolute: (match[1] === "@"),
|
||||||
|
left: parseFloat(match[2]),
|
||||||
|
top: parseFloat(match[3]),
|
||||||
|
width: parseFloat(match[4]),
|
||||||
|
height: parseFloat(match[5])
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Builds a coordinate string from a coordinate system identifier and an object
|
||||||
|
containing the left, top, width and height values.
|
||||||
|
Use constants defined in coordinatePrefix to specify a coordinate system.
|
||||||
|
If one of the parameters is invalid for building a coordinate string `(0,0,0,0)`
|
||||||
|
will be returned.
|
||||||
|
This function is safe to call, even if the popup class was not initialized.
|
||||||
|
*/
|
||||||
|
exports.buildCoordinates = function(prefix,position) {
|
||||||
|
var coord = prefix + "(" + position.left + "," + position.top + "," + position.width + "," + position.height + ")";
|
||||||
|
if (exports.popupLocationRegExp.test(coord)) {
|
||||||
|
return coord;
|
||||||
|
} else {
|
||||||
|
return "(0,0,0,0)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exports.Popup = Popup;
|
exports.Popup = Popup;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ exports.generateTiddlerFileInfo = function(tiddler,options) {
|
|||||||
hasUnsafeFields = hasUnsafeFields || /[\x00-\x1F]/mg.test(value);
|
hasUnsafeFields = hasUnsafeFields || /[\x00-\x1F]/mg.test(value);
|
||||||
hasUnsafeFields = hasUnsafeFields || ($tw.utils.trim(value) !== value);
|
hasUnsafeFields = hasUnsafeFields || ($tw.utils.trim(value) !== value);
|
||||||
}
|
}
|
||||||
hasUnsafeFields = hasUnsafeFields || /:/mg.test(fieldName);
|
hasUnsafeFields = hasUnsafeFields || /:|#/mg.test(fieldName);
|
||||||
});
|
});
|
||||||
// Check for field values
|
// Check for field values
|
||||||
if(hasUnsafeFields) {
|
if(hasUnsafeFields) {
|
||||||
@@ -238,7 +238,7 @@ exports.generateTiddlerFileInfo = function(tiddler,options) {
|
|||||||
} else {
|
} else {
|
||||||
// Save as a .tid or a text/binary file plus a .meta file
|
// Save as a .tid or a text/binary file plus a .meta file
|
||||||
var tiddlerType = tiddler.fields.type || "text/vnd.tiddlywiki";
|
var tiddlerType = tiddler.fields.type || "text/vnd.tiddlywiki";
|
||||||
if(tiddlerType === "text/vnd.tiddlywiki") {
|
if(tiddlerType === "text/vnd.tiddlywiki" || tiddler.hasField("_canonical_uri")) {
|
||||||
// Save as a .tid file
|
// Save as a .tid file
|
||||||
fileInfo.type = "application/x-tiddler";
|
fileInfo.type = "application/x-tiddler";
|
||||||
fileInfo.hasMetaFile = false;
|
fileInfo.hasMetaFile = false;
|
||||||
@@ -393,7 +393,7 @@ exports.generateTiddlerFilepath = function(title,options) {
|
|||||||
} while(fs.existsSync(fullPath));
|
} while(fs.existsSync(fullPath));
|
||||||
// If the last write failed with an error, or if path does not start with:
|
// If the last write failed with an error, or if path does not start with:
|
||||||
// the resolved options.directory, the resolved wikiPath directory, the wikiTiddlersPath directory,
|
// the resolved options.directory, the resolved wikiPath directory, the wikiTiddlersPath directory,
|
||||||
// or the 'originalpath' directory, then encodeURIComponent() and resolve to tiddler directory.
|
// or the 'originalpath' directory, then $tw.utils.encodeURIComponentExtended() and resolve to tiddler directory.
|
||||||
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath,fullPath),
|
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath,fullPath),
|
||||||
encode = (options.fileInfo || {writeError: false}).writeError == true;
|
encode = (options.fileInfo || {writeError: false}).writeError == true;
|
||||||
if(!encode) {
|
if(!encode) {
|
||||||
@@ -403,7 +403,7 @@ exports.generateTiddlerFilepath = function(title,options) {
|
|||||||
writePath.indexOf(path.resolve($tw.boot.wikiTiddlersPath,originalpath)) == 0 );
|
writePath.indexOf(path.resolve($tw.boot.wikiTiddlersPath,originalpath)) == 0 );
|
||||||
}
|
}
|
||||||
if(encode) {
|
if(encode) {
|
||||||
writePath = path.resolve(directory,encodeURIComponent(fullPath));
|
writePath = path.resolve(directory,$tw.utils.encodeURIComponentExtended(fullPath));
|
||||||
}
|
}
|
||||||
// Return the full path to the file
|
// Return the full path to the file
|
||||||
return writePath;
|
return writePath;
|
||||||
|
|||||||
@@ -15,10 +15,11 @@ function LinkedList() {
|
|||||||
|
|
||||||
LinkedList.prototype.clear = function() {
|
LinkedList.prototype.clear = function() {
|
||||||
// LinkedList performs the duty of both the head and tail node
|
// LinkedList performs the duty of both the head and tail node
|
||||||
this.next = Object.create(null);
|
this.next = new LLMap();
|
||||||
this.prev = Object.create(null);
|
this.prev = new LLMap();
|
||||||
this.first = undefined;
|
// Linked list head initially points to itself
|
||||||
this.last = undefined;
|
this.next.set(null, null);
|
||||||
|
this.prev.set(null, null);
|
||||||
this.length = 0;
|
this.length = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,28 +42,29 @@ Push behaves like array.push and accepts multiple string arguments. But it also
|
|||||||
accepts a single array argument too, to be consistent with its other methods.
|
accepts a single array argument too, to be consistent with its other methods.
|
||||||
*/
|
*/
|
||||||
LinkedList.prototype.push = function(/* values */) {
|
LinkedList.prototype.push = function(/* values */) {
|
||||||
var values = arguments;
|
var i, values = arguments;
|
||||||
if($tw.utils.isArray(values[0])) {
|
if($tw.utils.isArray(values[0])) {
|
||||||
values = values[0];
|
values = values[0];
|
||||||
}
|
}
|
||||||
for(var i = 0; i < values.length; i++) {
|
for(i = 0; i < values.length; i++) {
|
||||||
_assertString(values[i]);
|
_assertString(values[i]);
|
||||||
}
|
}
|
||||||
for(var i = 0; i < values.length; i++) {
|
for(i = 0; i < values.length; i++) {
|
||||||
_linkToEnd(this,values[i]);
|
_linkToEnd(this,values[i]);
|
||||||
}
|
}
|
||||||
return this.length;
|
return this.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
LinkedList.prototype.pushTop = function(value) {
|
LinkedList.prototype.pushTop = function(value) {
|
||||||
|
var t;
|
||||||
if($tw.utils.isArray(value)) {
|
if($tw.utils.isArray(value)) {
|
||||||
for (var t=0; t<value.length; t++) {
|
for (t=0; t<value.length; t++) {
|
||||||
_assertString(value[t]);
|
_assertString(value[t]);
|
||||||
}
|
}
|
||||||
for(var t=0; t<value.length; t++) {
|
for(t=0; t<value.length; t++) {
|
||||||
_removeOne(this,value[t]);
|
_removeOne(this,value[t]);
|
||||||
}
|
}
|
||||||
for(var t=0; t<value.length; t++) {
|
for(t=0; t<value.length; t++) {
|
||||||
_linkToEnd(this,value[t]);
|
_linkToEnd(this,value[t]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -74,11 +76,11 @@ LinkedList.prototype.pushTop = function(value) {
|
|||||||
|
|
||||||
LinkedList.prototype.each = function(callback) {
|
LinkedList.prototype.each = function(callback) {
|
||||||
var visits = Object.create(null),
|
var visits = Object.create(null),
|
||||||
value = this.first;
|
value = this.next.get(null);
|
||||||
while(value !== undefined) {
|
while(value !== null) {
|
||||||
callback(value);
|
callback(value);
|
||||||
var next = this.next[value];
|
var next = this.next.get(value);
|
||||||
if(typeof next === "object") {
|
if(Array.isArray(next)) {
|
||||||
var i = visits[value] || 0;
|
var i = visits[value] || 0;
|
||||||
visits[value] = i+1;
|
visits[value] = i+1;
|
||||||
value = next[i];
|
value = next[i];
|
||||||
@@ -105,91 +107,79 @@ LinkedList.prototype.makeTiddlerIterator = function(wiki) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function _removeOne(list,value) {
|
function _removeOne(list,value) {
|
||||||
var prevEntry = list.prev[value],
|
var nextEntry = list.next.get(value);
|
||||||
nextEntry = list.next[value],
|
if(nextEntry === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var prevEntry = list.prev.get(value),
|
||||||
prev = prevEntry,
|
prev = prevEntry,
|
||||||
next = nextEntry;
|
next = nextEntry,
|
||||||
if(typeof nextEntry === "object") {
|
ref;
|
||||||
|
if(Array.isArray(nextEntry)) {
|
||||||
next = nextEntry[0];
|
next = nextEntry[0];
|
||||||
prev = prevEntry[0];
|
prev = prevEntry[0];
|
||||||
}
|
}
|
||||||
// Relink preceding element.
|
// Relink preceding element.
|
||||||
if(list.first === value) {
|
ref = list.next.get(prev);
|
||||||
list.first = next
|
if(Array.isArray(ref)) {
|
||||||
} else if(prev !== undefined) {
|
var i = ref.indexOf(value);
|
||||||
if(typeof list.next[prev] === "object") {
|
ref[i] = next;
|
||||||
if(next === undefined) {
|
|
||||||
// Must have been last, and 'i' would be last element.
|
|
||||||
list.next[prev].pop();
|
|
||||||
} else {
|
|
||||||
var i = list.next[prev].indexOf(value);
|
|
||||||
list.next[prev][i] = next;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
list.next[prev] = next;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
list.next.set(prev,next);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now relink following element
|
// Now relink following element
|
||||||
// Check "next !== undefined" rather than "list.last === value" because
|
ref = list.prev.get(next);
|
||||||
// we need to know if the FIRST value is the last in the list, not the last.
|
if(Array.isArray(ref)) {
|
||||||
if(next !== undefined) {
|
var i = ref.indexOf(value);
|
||||||
if(typeof list.prev[next] === "object") {
|
ref[i] = prev;
|
||||||
if(prev === undefined) {
|
|
||||||
// Must have been first, and 'i' would be 0.
|
|
||||||
list.prev[next].shift();
|
|
||||||
} else {
|
|
||||||
var i = list.prev[next].indexOf(value);
|
|
||||||
list.prev[next][i] = prev;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
list.prev[next] = prev;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
list.last = prev;
|
list.prev.set(next,prev);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delink actual value. If it uses arrays, just remove first entries.
|
// Delink actual value. If it uses arrays, just remove first entries.
|
||||||
if(typeof nextEntry === "object") {
|
if(Array.isArray(nextEntry) && nextEntry.length > 1) {
|
||||||
nextEntry.shift();
|
nextEntry.shift();
|
||||||
prevEntry.shift();
|
prevEntry.shift();
|
||||||
} else {
|
} else {
|
||||||
list.next[value] = undefined;
|
list.next.set(value,undefined);
|
||||||
list.prev[value] = undefined;
|
list.prev.set(value,undefined);
|
||||||
}
|
}
|
||||||
list.length -= 1;
|
list.length -= 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sticks the given node onto the end of the list.
|
// Sticks the given node onto the end of the list.
|
||||||
function _linkToEnd(list,value) {
|
function _linkToEnd(list,value) {
|
||||||
if(list.first === undefined) {
|
var old = list.next.get(value);
|
||||||
list.first = value;
|
var last = list.prev.get(null);
|
||||||
|
// Does it already exists?
|
||||||
|
if(old !== undefined) {
|
||||||
|
if(!Array.isArray(old)) {
|
||||||
|
old = [old];
|
||||||
|
list.next.set(value,old);
|
||||||
|
list.prev.set(value,[list.prev.get(value)]);
|
||||||
|
}
|
||||||
|
old.push(null);
|
||||||
|
list.prev.get(value).push(last);
|
||||||
} else {
|
} else {
|
||||||
// Does it already exists?
|
list.next.set(value,null);
|
||||||
if(list.first === value || list.prev[value] !== undefined) {
|
list.prev.set(value,last);
|
||||||
if(typeof list.next[value] === "string") {
|
}
|
||||||
list.next[value] = [list.next[value]];
|
// Make the old last point to this new one.
|
||||||
list.prev[value] = [list.prev[value]];
|
if(value !== last) {
|
||||||
} else if(typeof list.next[value] === "undefined") {
|
var array = list.next.get(last);
|
||||||
// list.next[value] must be undefined.
|
if(Array.isArray(array)) {
|
||||||
// Special case. List already has 1 value. It's at the end.
|
array[array.length-1] = value;
|
||||||
list.next[value] = [];
|
} else {
|
||||||
list.prev[value] = [list.prev[value]];
|
list.next.set(last,value);
|
||||||
}
|
}
|
||||||
list.prev[value].push(list.last);
|
list.prev.set(null,value);
|
||||||
// We do NOT append a new value onto "next" list. Iteration will
|
} else {
|
||||||
// figure out it must point to End-of-List on its own.
|
// Edge case, the pushed value was already the last value.
|
||||||
} else {
|
// The second-to-last nextPtr for that value must point to itself now.
|
||||||
list.prev[value] = list.last;
|
var array = list.next.get(last);
|
||||||
}
|
array[array.length-2] = value;
|
||||||
// Make the old last point to this new one.
|
|
||||||
if(typeof list.next[list.last] === "object") {
|
|
||||||
list.next[list.last].push(value);
|
|
||||||
} else {
|
|
||||||
list.next[list.last] = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
list.last = value;
|
|
||||||
list.length += 1;
|
list.length += 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -199,6 +189,20 @@ function _assertString(value) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var LLMap = function() {
|
||||||
|
this.map = Object.create(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Just a wrapper so our object map can also accept null.
|
||||||
|
LLMap.prototype = {
|
||||||
|
set: function(key,val) {
|
||||||
|
(key === null) ? (this.null = val) : (this.map[key] = val);
|
||||||
|
},
|
||||||
|
get: function(key) {
|
||||||
|
return (key === null) ? this.null : this.map[key];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
exports.LinkedList = LinkedList;
|
exports.LinkedList = LinkedList;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -354,6 +354,9 @@ exports.formatDateString = function(date,template) {
|
|||||||
var result = "",
|
var result = "",
|
||||||
t = template,
|
t = template,
|
||||||
matches = [
|
matches = [
|
||||||
|
[/^TIMESTAMP/, function() {
|
||||||
|
return date.getTime();
|
||||||
|
}],
|
||||||
[/^0hh12/, function() {
|
[/^0hh12/, function() {
|
||||||
return $tw.utils.pad($tw.utils.getHours12(date));
|
return $tw.utils.pad($tw.utils.getHours12(date));
|
||||||
}],
|
}],
|
||||||
@@ -682,9 +685,19 @@ exports.escapeRegExp = function(s) {
|
|||||||
return s.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, '\\$&');
|
return s.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, '\\$&');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Extended version of encodeURIComponent that encodes additional characters including
|
||||||
|
those that are illegal within filepaths on various platforms including Windows
|
||||||
|
*/
|
||||||
|
exports.encodeURIComponentExtended = function(s) {
|
||||||
|
return encodeURIComponent(s).replace(/[!'()*]/g,function(c) {
|
||||||
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Checks whether a link target is external, i.e. not a tiddler title
|
// Checks whether a link target is external, i.e. not a tiddler title
|
||||||
exports.isLinkExternal = function(to) {
|
exports.isLinkExternal = function(to) {
|
||||||
var externalRegExp = /^(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|"\\^]+(?:\/|\b)/i;
|
var externalRegExp = /^(?:file|http|https|mailto|ftp|irc|news|obsidian|data|skype):[^\s<>{}\[\]`|"\\^]+(?:\/|\b)/i;
|
||||||
return externalRegExp.test(to);
|
return externalRegExp.test(to);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ Action widget to trigger a popup.
|
|||||||
|
|
||||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||||
|
|
||||||
|
var Popup = require("$:/core/modules/utils/dom/popup.js");
|
||||||
|
|
||||||
var ActionPopupWidget = function(parseTreeNode,options) {
|
var ActionPopupWidget = function(parseTreeNode,options) {
|
||||||
this.initialise(parseTreeNode,options);
|
this.initialise(parseTreeNode,options);
|
||||||
};
|
};
|
||||||
@@ -57,20 +59,20 @@ Invoke the action associated with this widget
|
|||||||
*/
|
*/
|
||||||
ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||||
// Trigger the popup
|
// Trigger the popup
|
||||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
|
var coordinates = Popup.parseCoordinates(this.actionCoords || "");
|
||||||
match = popupLocationRegExp.exec(this.actionCoords || "");
|
if(coordinates) {
|
||||||
if(match) {
|
|
||||||
$tw.popup.triggerPopup({
|
$tw.popup.triggerPopup({
|
||||||
domNode: null,
|
domNode: null,
|
||||||
domNodeRect: {
|
domNodeRect: {
|
||||||
left: parseFloat(match[1]),
|
left: coordinates.left,
|
||||||
top: parseFloat(match[2]),
|
top: coordinates.top,
|
||||||
width: parseFloat(match[3]),
|
width: coordinates.width,
|
||||||
height: parseFloat(match[4])
|
height: coordinates.height
|
||||||
},
|
},
|
||||||
title: this.actionState,
|
title: this.actionState,
|
||||||
wiki: this.wiki,
|
wiki: this.wiki,
|
||||||
floating: this.floating
|
floating: this.floating,
|
||||||
|
absolute: coordinates.absolute
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.popup.cancel(0);
|
$tw.popup.cancel(0);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ Button widget
|
|||||||
|
|
||||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||||
|
|
||||||
|
var Popup = require("$:/core/modules/utils/dom/popup.js");
|
||||||
|
|
||||||
var ButtonWidget = function(parseTreeNode,options) {
|
var ButtonWidget = function(parseTreeNode,options) {
|
||||||
this.initialise(parseTreeNode,options);
|
this.initialise(parseTreeNode,options);
|
||||||
};
|
};
|
||||||
@@ -147,7 +149,7 @@ ButtonWidget.prototype.isSelected = function() {
|
|||||||
|
|
||||||
ButtonWidget.prototype.isPoppedUp = function() {
|
ButtonWidget.prototype.isPoppedUp = function() {
|
||||||
var tiddler = this.popupTitle ? this.wiki.getTiddler(this.popupTitle) : this.wiki.getTiddler(this.popup);
|
var tiddler = this.popupTitle ? this.wiki.getTiddler(this.popupTitle) : this.wiki.getTiddler(this.popup);
|
||||||
var result = tiddler && tiddler.fields.text ? $tw.popup.readPopupState(tiddler.fields.text) : false;
|
var result = tiddler && tiddler.fields.text ? Popup.readPopupState(tiddler.fields.text) : false;
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -173,6 +175,7 @@ ButtonWidget.prototype.triggerPopup = function(event) {
|
|||||||
if(this.popupTitle) {
|
if(this.popupTitle) {
|
||||||
$tw.popup.triggerPopup({
|
$tw.popup.triggerPopup({
|
||||||
domNode: this.domNodes[0],
|
domNode: this.domNodes[0],
|
||||||
|
absolute: (this.popupAbsCoords === "yes"),
|
||||||
title: this.popupTitle,
|
title: this.popupTitle,
|
||||||
wiki: this.wiki,
|
wiki: this.wiki,
|
||||||
noStateReference: true
|
noStateReference: true
|
||||||
@@ -180,6 +183,7 @@ ButtonWidget.prototype.triggerPopup = function(event) {
|
|||||||
} else {
|
} else {
|
||||||
$tw.popup.triggerPopup({
|
$tw.popup.triggerPopup({
|
||||||
domNode: this.domNodes[0],
|
domNode: this.domNodes[0],
|
||||||
|
absolute: (this.popupAbsCoords === "yes"),
|
||||||
title: this.popup,
|
title: this.popup,
|
||||||
wiki: this.wiki
|
wiki: this.wiki
|
||||||
});
|
});
|
||||||
@@ -223,6 +227,7 @@ ButtonWidget.prototype.execute = function() {
|
|||||||
this.setField = this.getAttribute("setField");
|
this.setField = this.getAttribute("setField");
|
||||||
this.setIndex = this.getAttribute("setIndex");
|
this.setIndex = this.getAttribute("setIndex");
|
||||||
this.popupTitle = this.getAttribute("popupTitle");
|
this.popupTitle = this.getAttribute("popupTitle");
|
||||||
|
this.popupAbsCoords = this.getAttribute("popupAbsCoords", "no");
|
||||||
this.tabIndex = this.getAttribute("tabindex");
|
this.tabIndex = this.getAttribute("tabindex");
|
||||||
this.isDisabled = this.getAttribute("disabled","no");
|
this.isDisabled = this.getAttribute("disabled","no");
|
||||||
// Make child widgets
|
// Make child widgets
|
||||||
@@ -252,7 +257,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
*/
|
*/
|
||||||
ButtonWidget.prototype.refresh = function(changedTiddlers) {
|
ButtonWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
|
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else if(changedAttributes["class"]) {
|
} else if(changedAttributes["class"]) {
|
||||||
|
|||||||
@@ -232,10 +232,32 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DropZoneWidget.prototype.handlePasteEvent = function(event) {
|
DropZoneWidget.prototype.handlePasteEvent = function(event) {
|
||||||
var self = this,
|
var self = this;
|
||||||
readFileCallback = function(tiddlerFieldsArray) {
|
var readFileCallback = function(tiddlerFieldsArray) {
|
||||||
self.readFileCallback(tiddlerFieldsArray);
|
self.readFileCallback(tiddlerFieldsArray);
|
||||||
};
|
};
|
||||||
|
var getItem = function(type) {
|
||||||
|
type = type || "text/plain";
|
||||||
|
return function(str) {
|
||||||
|
// Use the deserializer specified if any
|
||||||
|
if(self.dropzoneDeserializer) {
|
||||||
|
tiddlerFields = self.wiki.deserializeTiddlers(null,str,{title: self.wiki.generateNewTitle("Untitled " + type)},{deserializer:self.dropzoneDeserializer});
|
||||||
|
if(tiddlerFields && tiddlerFields.length) {
|
||||||
|
readFileCallback(tiddlerFields);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tiddlerFields = {
|
||||||
|
title: self.wiki.generateNewTitle("Untitled " + type),
|
||||||
|
text: str,
|
||||||
|
type: type
|
||||||
|
};
|
||||||
|
if($tw.log.IMPORT) {
|
||||||
|
console.log("Importing string '" + str + "', type: '" + type + "'");
|
||||||
|
}
|
||||||
|
readFileCallback([tiddlerFields]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
// Let the browser handle it if we're in a textarea or input box
|
// Let the browser handle it if we're in a textarea or input box
|
||||||
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable) {
|
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable) {
|
||||||
var self = this,
|
var self = this,
|
||||||
@@ -251,27 +273,10 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
|
|||||||
});
|
});
|
||||||
} else if(item.kind === "string") {
|
} else if(item.kind === "string") {
|
||||||
// Create tiddlers from string items
|
// Create tiddlers from string items
|
||||||
var tiddlerFields,
|
var tiddlerFields;
|
||||||
type = item.type;
|
// It's important to give getAsString a closure with the right type
|
||||||
item.getAsString(function(str) {
|
// So it can be added to the import queue
|
||||||
// Use the deserializer specified if any
|
item.getAsString(getItem(item.type));
|
||||||
if(self.dropzoneDeserializer) {
|
|
||||||
tiddlerFields = self.wiki.deserializeTiddlers(null,str,{title: self.wiki.generateNewTitle("Untitled")},{deserializer:self.dropzoneDeserializer});
|
|
||||||
if(tiddlerFields && tiddlerFields.length) {
|
|
||||||
readFileCallback(tiddlerFields);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tiddlerFields = {
|
|
||||||
title: self.wiki.generateNewTitle("Untitled"),
|
|
||||||
text: str,
|
|
||||||
type: type
|
|
||||||
};
|
|
||||||
if($tw.log.IMPORT) {
|
|
||||||
console.log("Importing string '" + str + "', type: '" + type + "'");
|
|
||||||
}
|
|
||||||
readFileCallback([tiddlerFields]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Tell the browser that we've handled the paste
|
// Tell the browser that we've handled the paste
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
if($tw.config.htmlUnsafeElements.indexOf(this.tag) !== -1) {
|
if($tw.config.htmlUnsafeElements.indexOf(this.tag) !== -1) {
|
||||||
this.tag = "safe-" + this.tag;
|
this.tag = "safe-" + this.tag;
|
||||||
}
|
}
|
||||||
|
// Restrict tag name to digits, letts and dashes
|
||||||
|
this.tag = this.tag.replace(/[^0-9a-zA-Z\-]/mg,"");
|
||||||
|
// Default to a span
|
||||||
|
this.tag = this.tag || "span";
|
||||||
// Adjust headings by the current base level
|
// Adjust headings by the current base level
|
||||||
var headingLevel = ["h1","h2","h3","h4","h5","h6"].indexOf(this.tag);
|
var headingLevel = ["h1","h2","h3","h4","h5","h6"].indexOf(this.tag);
|
||||||
if(headingLevel !== -1) {
|
if(headingLevel !== -1) {
|
||||||
|
|||||||
@@ -42,10 +42,16 @@ Compute the internal state of the widget
|
|||||||
GenesisWidget.prototype.execute = function() {
|
GenesisWidget.prototype.execute = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
// Collect attributes
|
// Collect attributes
|
||||||
this.genesisType = this.getAttribute("$type","element");
|
this.genesisType = this.getAttribute("$type");
|
||||||
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
|
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
|
||||||
this.genesisNames = this.getAttribute("$names","");
|
this.genesisNames = this.getAttribute("$names","");
|
||||||
this.genesisValues = this.getAttribute("$values","");
|
this.genesisValues = this.getAttribute("$values","");
|
||||||
|
this.genesisIsBlock = this.getAttribute("$mode",this.parseTreeNode.isBlock && "block") === "block";
|
||||||
|
// Do not create a child widget if the $type attribute is missing or blank
|
||||||
|
if(!this.genesisType) {
|
||||||
|
this.makeChildWidgets(this.parseTreeNode.children);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Construct parse tree
|
// Construct parse tree
|
||||||
var isElementWidget = this.genesisType.charAt(0) !== "$",
|
var isElementWidget = this.genesisType.charAt(0) !== "$",
|
||||||
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
|
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
|
||||||
@@ -55,6 +61,7 @@ GenesisWidget.prototype.execute = function() {
|
|||||||
tag: nodeTag,
|
tag: nodeTag,
|
||||||
attributes: {},
|
attributes: {},
|
||||||
orderedAttributes: [],
|
orderedAttributes: [],
|
||||||
|
isBlock: this.genesisIsBlock,
|
||||||
children: this.parseTreeNode.children || [],
|
children: this.parseTreeNode.children || [],
|
||||||
isNotRemappable: !this.genesisRemappable
|
isNotRemappable: !this.genesisRemappable
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ LetWidget.prototype.getVariableInfo = function(name,options) {
|
|||||||
text: this.currentValueFor[name]
|
text: this.currentValueFor[name]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return Widget.prototype.getVariableInfo.call(this,name,options);
|
return Widget.prototype.getVariableInfo.call(this,name,$tw.utils.extend(Object.create(null),options,{
|
||||||
|
defaultValue: ""
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
|||||||
// Expand the tv-wikilink-template variable to construct the href
|
// Expand the tv-wikilink-template variable to construct the href
|
||||||
var wikiLinkTemplateMacro = this.getVariable("tv-wikilink-template"),
|
var wikiLinkTemplateMacro = this.getVariable("tv-wikilink-template"),
|
||||||
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$";
|
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$";
|
||||||
wikiLinkText = $tw.utils.replaceString(wikiLinkTemplate,"$uri_encoded$",encodeURIComponent(this.to));
|
wikiLinkText = $tw.utils.replaceString(wikiLinkTemplate,"$uri_encoded$",$tw.utils.encodeURIComponentExtended(this.to));
|
||||||
wikiLinkText = $tw.utils.replaceString(wikiLinkText,"$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
|
wikiLinkText = $tw.utils.replaceString(wikiLinkText,"$uri_doubleencoded$",$tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(this.to)));
|
||||||
}
|
}
|
||||||
// Override with the value of tv-get-export-link if defined
|
// Override with the value of tv-get-export-link if defined
|
||||||
wikiLinkText = this.getVariable("tv-get-export-link",{params: [{name: "to",value: this.to}],defaultValue: wikiLinkText});
|
wikiLinkText = this.getVariable("tv-get-export-link",{params: [{name: "to",value: this.to}],defaultValue: wikiLinkText});
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ MessageCatcherWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Render children
|
// Render children
|
||||||
this.renderChildren(parent,null);
|
this.renderChildren(parent,nextSibling);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -227,10 +227,7 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
|
|||||||
originalTitle = tiddler ? tiddler.fields["draft.of"] : "",
|
originalTitle = tiddler ? tiddler.fields["draft.of"] : "",
|
||||||
originalTiddler = originalTitle ? this.wiki.getTiddler(originalTitle) : undefined,
|
originalTiddler = originalTitle ? this.wiki.getTiddler(originalTitle) : undefined,
|
||||||
confirmationTitle,
|
confirmationTitle,
|
||||||
win = event.event && event.event.view ? event.event.view : window;
|
win = event.event && event.event.view ? event.event.view : window;
|
||||||
if(!tiddler) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Check if the tiddler we're deleting is in draft mode
|
// Check if the tiddler we're deleting is in draft mode
|
||||||
if(originalTitle) {
|
if(originalTitle) {
|
||||||
// If so, we'll prompt for confirmation referencing the original tiddler
|
// If so, we'll prompt for confirmation referencing the original tiddler
|
||||||
@@ -240,7 +237,7 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
|
|||||||
confirmationTitle = title;
|
confirmationTitle = title;
|
||||||
}
|
}
|
||||||
// Seek confirmation
|
// Seek confirmation
|
||||||
if((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !win.confirm($tw.language.getString(
|
if(((originalTitle && this.wiki.getTiddler(originalTitle)) || (tiddler && ((tiddler.fields.text || "") !== ""))) && !win.confirm($tw.language.getString(
|
||||||
"ConfirmDeleteTiddler",
|
"ConfirmDeleteTiddler",
|
||||||
{variables:
|
{variables:
|
||||||
{title: confirmationTitle}
|
{title: confirmationTitle}
|
||||||
@@ -257,8 +254,10 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
|
|||||||
this.removeTitleFromStory(storyList,originalTitle);
|
this.removeTitleFromStory(storyList,originalTitle);
|
||||||
}
|
}
|
||||||
// Invoke the hook function and delete this tiddler
|
// Invoke the hook function and delete this tiddler
|
||||||
$tw.hooks.invokeHook("th-deleting-tiddler",tiddler);
|
if(tiddler) {
|
||||||
this.wiki.deleteTiddler(title);
|
$tw.hooks.invokeHook("th-deleting-tiddler",tiddler);
|
||||||
|
this.wiki.deleteTiddler(title);
|
||||||
|
}
|
||||||
// Remove the closed tiddler from the story
|
// Remove the closed tiddler from the story
|
||||||
this.removeTitleFromStory(storyList,title);
|
this.removeTitleFromStory(storyList,title);
|
||||||
this.saveStoryList(storyList);
|
this.saveStoryList(storyList);
|
||||||
@@ -500,7 +499,8 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
// Get the tiddlers
|
// Get the tiddlers
|
||||||
var tiddlers = $tw.utils.parseJSONSafe(event.param,[]);
|
var tiddlers = $tw.utils.parseJSONSafe(event.param,[]);
|
||||||
// Get the current $:/Import tiddler
|
// Get the current $:/Import tiddler
|
||||||
var importTitle = event.importTitle ? event.importTitle : IMPORT_TITLE,
|
var paramObject = event.paramObject || {},
|
||||||
|
importTitle = event.importTitle || paramObject.importTitle || IMPORT_TITLE,
|
||||||
importTiddler = this.wiki.getTiddler(importTitle),
|
importTiddler = this.wiki.getTiddler(importTitle),
|
||||||
importData = this.wiki.getTiddlerData(importTitle,{}),
|
importData = this.wiki.getTiddlerData(importTitle,{}),
|
||||||
newFields = new Object({
|
newFields = new Object({
|
||||||
@@ -541,7 +541,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
|
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
|
||||||
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
|
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
|
||||||
// Update the story and history details
|
// Update the story and history details
|
||||||
var autoOpenOnImport = event.autoOpenOnImport ? event.autoOpenOnImport : this.getVariable("tv-auto-open-on-import");
|
var autoOpenOnImport = event.autoOpenOnImport || paramObject.autoOpenOnImport || this.getVariable("tv-auto-open-on-import");
|
||||||
if(autoOpenOnImport !== "no") {
|
if(autoOpenOnImport !== "no") {
|
||||||
var storyList = this.getStoryList(),
|
var storyList = this.getStoryList(),
|
||||||
history = [];
|
history = [];
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ Reveal widget
|
|||||||
|
|
||||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||||
|
|
||||||
|
var Popup = require("$:/core/modules/utils/dom/popup.js");
|
||||||
|
|
||||||
var RevealWidget = function(parseTreeNode,options) {
|
var RevealWidget = function(parseTreeNode,options) {
|
||||||
this.initialise(parseTreeNode,options);
|
this.initialise(parseTreeNode,options);
|
||||||
};
|
};
|
||||||
@@ -94,6 +96,13 @@ RevealWidget.prototype.positionPopup = function(domNode) {
|
|||||||
left = Math.max(0,left);
|
left = Math.max(0,left);
|
||||||
top = Math.max(0,top);
|
top = Math.max(0,top);
|
||||||
}
|
}
|
||||||
|
if (this.popup.absolute) {
|
||||||
|
// Traverse the offsetParent chain and correct the offset to make it relative to the parent node.
|
||||||
|
for (var offsetParentDomNode = domNode.offsetParent; offsetParentDomNode; offsetParentDomNode = offsetParentDomNode.offsetParent) {
|
||||||
|
left -= offsetParentDomNode.offsetLeft;
|
||||||
|
top -= offsetParentDomNode.offsetTop;
|
||||||
|
}
|
||||||
|
}
|
||||||
domNode.style.left = left + "px";
|
domNode.style.left = left + "px";
|
||||||
domNode.style.top = top + "px";
|
domNode.style.top = top + "px";
|
||||||
};
|
};
|
||||||
@@ -183,19 +192,11 @@ RevealWidget.prototype.compareStateText = function(state) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
RevealWidget.prototype.readPopupState = function(state) {
|
RevealWidget.prototype.readPopupState = function(state) {
|
||||||
var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
|
this.popup = Popup.parseCoordinates(state);
|
||||||
match = popupLocationRegExp.exec(state);
|
|
||||||
// Check if the state matches the location regexp
|
// Check if the state matches the location regexp
|
||||||
if(match) {
|
if(this.popup) {
|
||||||
// If so, we're open
|
// If so, we're open
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
// Get the location
|
|
||||||
this.popup = {
|
|
||||||
left: parseFloat(match[1]),
|
|
||||||
top: parseFloat(match[2]),
|
|
||||||
width: parseFloat(match[3]),
|
|
||||||
height: parseFloat(match[4])
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
// If not, we're closed
|
// If not, we're closed
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.execute();
|
this.execute();
|
||||||
this.renderChildren(parent,nextSibling);
|
this.renderChildren(parent,nextSibling);
|
||||||
this.setSelectValue();
|
this.setSelectValue();
|
||||||
|
if(this.selectFocus == "yes") {
|
||||||
|
this.getSelectDomNode().focus();
|
||||||
|
}
|
||||||
$tw.utils.addEventListeners(this.getSelectDomNode(),[
|
$tw.utils.addEventListeners(this.getSelectDomNode(),[
|
||||||
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
|
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
|
||||||
]);
|
]);
|
||||||
@@ -143,6 +146,7 @@ SelectWidget.prototype.execute = function() {
|
|||||||
this.selectMultiple = this.getAttribute("multiple", false);
|
this.selectMultiple = this.getAttribute("multiple", false);
|
||||||
this.selectSize = this.getAttribute("size");
|
this.selectSize = this.getAttribute("size");
|
||||||
this.selectTooltip = this.getAttribute("tooltip");
|
this.selectTooltip = this.getAttribute("tooltip");
|
||||||
|
this.selectFocus = this.getAttribute("focus");
|
||||||
// Make the child widgets
|
// Make the child widgets
|
||||||
var selectNode = {
|
var selectNode = {
|
||||||
type: "element",
|
type: "element",
|
||||||
|
|||||||
@@ -168,11 +168,11 @@ ViewWidget.prototype.getValueAsHtmlTextEncoded = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ViewWidget.prototype.getValueAsUrlEncoded = function() {
|
ViewWidget.prototype.getValueAsUrlEncoded = function() {
|
||||||
return encodeURIComponent(this.getValueAsText());
|
return $tw.utils.encodeURIComponentExtended(this.getValueAsText());
|
||||||
};
|
};
|
||||||
|
|
||||||
ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {
|
ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {
|
||||||
return encodeURIComponent(encodeURIComponent(this.getValueAsText()));
|
return $tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(this.getValueAsText()));
|
||||||
};
|
};
|
||||||
|
|
||||||
ViewWidget.prototype.getValueAsDate = function(format) {
|
ViewWidget.prototype.getValueAsDate = function(format) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ extension: .html
|
|||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
<meta name="generator" content="TiddlyWiki" />
|
<meta name="generator" content="TiddlyWiki" />
|
||||||
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
|
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="format-detection" content="telephone=no">
|
<meta name="format-detection" content="telephone=no">
|
||||||
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
|
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
|
||||||
<title>{{$:/core/wiki/title}}</title>
|
<title>{{$:/core/wiki/title}}</title>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
title: $:/core/save/all-external-js
|
title: $:/core/save/all-external-js
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||||
\define saveTiddlerFilter()
|
\define saveTiddlerFilter()
|
||||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||||
\end
|
\end
|
||||||
\define coreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js
|
\define defaultCoreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js
|
||||||
{{$:/core/templates/tiddlywiki5-external-js.html}}
|
<$let coreURL={{{ [[coreURL]is[variable]then<coreURL>else<defaultCoreURL>] }}}>
|
||||||
|
{{$:/core/templates/tiddlywiki5-external-js.html}}
|
||||||
|
</$let>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
title: $:/core/save/offline-external-js
|
title: $:/core/save/offline-external-js
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||||
\define saveTiddlerFilter()
|
\define saveTiddlerFilter()
|
||||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||||
\end
|
\end
|
||||||
\define coreURL() tiddlywikicore-$(version)$.js
|
\define defaultCoreURL() tiddlywikicore-$(version)$.js
|
||||||
{{$:/core/templates/tiddlywiki5-external-js.html}}
|
<$let coreURL={{{ [[coreURL]is[variable]then<coreURL>else<defaultCoreURL>] }}}>
|
||||||
|
{{$:/core/templates/tiddlywiki5-external-js.html}}
|
||||||
|
</$let>
|
||||||
|
|||||||
3
core/templates/external-js/tiddlywiki.js.load.tid
Normal file
3
core/templates/external-js/tiddlywiki.js.load.tid
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
title: $:/core/templates/tiddlywiki.js/load-tiddler
|
||||||
|
|
||||||
|
_load(window,<$macrocall $name="jsontiddler" $output="text/raw"/>);
|
||||||
@@ -1,15 +1,48 @@
|
|||||||
|
|
||||||
title: $:/core/templates/tiddlywiki5.js
|
title: $:/core/templates/tiddlywiki5.js
|
||||||
|
|
||||||
\rules only filteredtranscludeinline transcludeinline codeinline
|
\rules only filteredtranscludeinline transcludeinline codeinline
|
||||||
|
|
||||||
/*
|
`/*
|
||||||
{{ $:/core/copyright.txt ||$:/core/templates/plain-text-tiddler}}
|
`{{ $:/core/copyright.txt ||$:/core/templates/plain-text-tiddler}}`
|
||||||
`*/
|
*/
|
||||||
`<!--~~ Library modules ~~-->
|
|
||||||
{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/plain-text-tiddler}}}
|
$tw = (typeof $tw === 'undefined') ? Object.create(null) : $tw;
|
||||||
<!--~~ Boot prefix ~~-->
|
|
||||||
{{ $:/boot/bootprefix.js ||$:/core/templates/plain-text-tiddler}}
|
$tw.preloadTiddlers = $tw.preloadTiddlers || [];
|
||||||
<!--~~ Core plugin ~~-->
|
|
||||||
{{$:/core/templates/tiddlywiki5.js/tiddlers}}
|
_load = function(window,tiddler) {
|
||||||
<!--~~ Boot kernel ~~-->
|
"use strict";
|
||||||
{{ $:/boot/boot.js ||$:/core/templates/plain-text-tiddler}}
|
var f;
|
||||||
|
$tw.preloadTiddlers.push(tiddler);
|
||||||
|
if(tiddler.library === "yes") {
|
||||||
|
var module = { exports:{} };
|
||||||
|
var moduleName = function moduleName(path) {
|
||||||
|
var word = path.split("/").pop();
|
||||||
|
word = word.substring(0,word.indexOf(".")) || word;
|
||||||
|
return word;
|
||||||
|
}
|
||||||
|
f = new Function("module",tiddler.text);
|
||||||
|
f(module);
|
||||||
|
window[moduleName(tiddler.title)] = module.exports;
|
||||||
|
} else {
|
||||||
|
f = new Function("window",tiddler.text);
|
||||||
|
f(window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ~~ Library modules ~~ */
|
||||||
|
|
||||||
|
`{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/tiddlywiki.js/load-tiddler}}}`
|
||||||
|
|
||||||
|
/* ~~ Boot kernel prologue ~~ */
|
||||||
|
|
||||||
|
`{{ $:/boot/bootprefix.js ||$:/core/templates/tiddlywiki.js/load-tiddler}}`
|
||||||
|
|
||||||
|
/* ~~ Core tiddlers ~~ */
|
||||||
|
|
||||||
|
`{{$:/core/templates/tiddlywiki5.js/tiddlers}}`
|
||||||
|
|
||||||
|
/* ~~ Boot kernel ~~ */
|
||||||
|
|
||||||
|
`{{ $:/boot/boot.js ||$:/core/templates/tiddlywiki.js/load-tiddler}}`
|
||||||
|
|||||||
@@ -1,48 +1,50 @@
|
|||||||
title: $:/core/templates/tiddlywiki5-external-js.html
|
title: $:/core/templates/tiddlywiki5-external-js.html
|
||||||
|
|
||||||
\rules only filteredtranscludeinline transcludeinline
|
<$set name="saveTiddlerAndShadowsFilter" filter="[subfilter<saveTiddlerFilter>] [subfilter<saveTiddlerFilter>plugintiddlers[]]">
|
||||||
<!doctype html>
|
`<!doctype html>
|
||||||
{{$:/core/templates/MOTW.html}}<html lang="{{{ [{$:/language}get[name]] }}}">
|
`{{$:/core/templates/MOTW.html}}`<html lang="`<$text text={{{ [{$:/language}get[name]] }}}/>`">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
<!--~~ Raw markup for the top of the head section ~~-->
|
<!--~~ Raw markup for the top of the head section ~~-->
|
||||||
{{{ [all[shadows+tiddlers]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 http-equiv="X-UA-Compatible" content="IE=Edge"/>
|
||||||
<meta name="application-name" content="TiddlyWiki" />
|
<meta name="application-name" content="TiddlyWiki" />
|
||||||
<meta name="generator" content="TiddlyWiki" />
|
<meta name="generator" content="TiddlyWiki" />
|
||||||
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
|
<meta name="tiddlywiki-version" content="`{{$:/core/templates/version}}`" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
<meta name="mobile-web-app-capable" content="yes"/>
|
<meta name="mobile-web-app-capable" content="yes"/>
|
||||||
<meta name="format-detection" content="telephone=no" />
|
<meta name="format-detection" content="telephone=no" />
|
||||||
<meta name="copyright" content="{{$:/core/copyright.txt}}" />
|
<meta name="copyright" content="`{{$:/core/copyright.txt}}`" />
|
||||||
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
|
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
|
||||||
<title>{{$:/core/wiki/title}}</title>
|
<title>`{{$:/core/wiki/title}}`</title>
|
||||||
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->
|
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->
|
||||||
|
|
||||||
<!--~~ Raw markup ~~-->
|
<!--~~ Raw markup ~~-->
|
||||||
{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}
|
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}`
|
||||||
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}
|
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}`
|
||||||
|
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}`
|
||||||
</head>
|
</head>
|
||||||
<body class="tc-body">
|
<body class="tc-body">
|
||||||
<!--~~ Raw markup for the top of the body section ~~-->
|
<!--~~ Raw markup for the top of the body section ~~-->
|
||||||
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/TopBody]] ||$:/core/templates/raw-static-tiddler}}}
|
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopBody]] ||$:/core/templates/raw-static-tiddler}}}`
|
||||||
<!--~~ Static styles ~~-->
|
<!--~~ Static styles ~~-->
|
||||||
<div id="styleArea">
|
<div id="styleArea">
|
||||||
{{$:/boot/boot.css||$:/core/templates/css-tiddler}}
|
`{{$:/boot/boot.css||$:/core/templates/css-tiddler}}`
|
||||||
</div>
|
</div>
|
||||||
<!--~~ Static content for Google and browsers without JavaScript ~~-->
|
<!--~~ Static content for Google and browsers without JavaScript ~~-->
|
||||||
<noscript>
|
<noscript>
|
||||||
<div id="splashArea">
|
<div id="splashArea">
|
||||||
{{$:/core/templates/static.area}}
|
`{{$:/core/templates/static.area}}`
|
||||||
</div>
|
</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
<!--~~ Ordinary tiddlers ~~-->
|
<!--~~ Ordinary tiddlers ~~-->
|
||||||
{{$:/core/templates/store.area.template.html}}
|
`{{$:/core/templates/store.area.template.html}}`
|
||||||
<!--~~ Raw markup for the bottom of the body section ~~-->
|
<!--~~ Raw markup for the bottom of the body section ~~-->
|
||||||
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}
|
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}`
|
||||||
|
<!--~~ Load external JavaScripts ~~-->
|
||||||
|
<script src="`{{{ [<coreURL>] }}}`" onerror="alert('Error: Cannot load `{{{ [<coreURL>] }}}`');"></script>
|
||||||
</body>
|
</body>
|
||||||
<!--~~ Load external JS ~~-->
|
</html>`
|
||||||
<script src="{{{ [<coreURL>] }}}" onerror="alert('Error: Cannot load {{{ [<coreURL>] }}}');"></script>
|
</$set>
|
||||||
</html>
|
|
||||||
@@ -14,8 +14,8 @@ tags: $:/tags/AdvancedSearch/FilterButton
|
|||||||
<$linkcatcher actions="<$action-setfield $tiddler='$:/temp/advancedsearch' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/input' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/refresh' text='yes'/><$action-sendmessage $message='tm-focus-selector' $param='.tc-advanced-search input' />">
|
<$linkcatcher actions="<$action-setfield $tiddler='$:/temp/advancedsearch' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/input' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/refresh' text='yes'/><$action-sendmessage $message='tm-focus-selector' $param='.tc-advanced-search input' />">
|
||||||
<div class="tc-block-dropdown-wrapper">
|
<div class="tc-block-dropdown-wrapper">
|
||||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]!is[draft]]">
|
||||||
<$link to={{!!filter}}><$transclude field="description"/></$link>
|
<$link to={{!!filter}}><$let tv-wikilinks="no"><$transclude field="description"/></$let></$link>
|
||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,15 +20,16 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
|
|||||||
\end
|
\end
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
|
|tc-max-width tc-edit-max-width|k
|
||||||
|<<lingo Version/Prompt>> |''<<version>>'' |
|
|<<lingo Version/Prompt>> |''<<version>>'' |
|
||||||
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/status/UserName"><<lingo Username/Prompt>></$link> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|
|<$link to="$:/status/UserName"><<lingo Username/Prompt>></$link> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/AnimationDuration"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|
|<$link to="$:/config/AnimationDuration"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|
||||||
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers" class="tc-edit-texteditor"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit class="tc-edit-texteditor" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|
||||||
|<$link to="$:/language/DefaultNewTiddlerTitle"><<lingo NewTiddler/Title/Prompt>></$link> |<$edit-text tiddler="$:/language/DefaultNewTiddlerTitle" default="" tag="input"/> |
|
|<$link to="$:/language/DefaultNewTiddlerTitle"><<lingo NewTiddler/Title/Prompt>></$link> |<$edit-text tiddler="$:/language/DefaultNewTiddlerTitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/NewJournal/Title"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> |
|
|<$link to="$:/config/NewJournal/Title"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/NewJournal/Text"><<lingo NewJournal/Text/Prompt>></$link> |<$edit tiddler="$:/config/NewJournal/Text" tag="textarea" class="tc-edit-texteditor" default=""/> |
|
|<$link to="$:/config/NewJournal/Text"><<lingo NewJournal/Text/Prompt>></$link> |<$edit tiddler="$:/config/NewJournal/Text" class="tc-edit-texteditor" default=""/> |
|
||||||
|<$link to="$:/config/NewTiddler/Tags"><<lingo NewTiddler/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewTiddler/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
|<$link to="$:/config/NewTiddler/Tags"><<lingo NewTiddler/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewTiddler/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
||||||
|<$link to="$:/config/NewJournal/Tags"><<lingo NewJournal/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewJournal/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
|<$link to="$:/config/NewJournal/Tags"><<lingo NewJournal/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewJournal/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
||||||
|<$link to="$:/config/AutoFocus"><<lingo AutoFocus/Prompt>></$link> |{{$:/snippets/minifocusswitcher}} |
|
|<$link to="$:/config/AutoFocus"><<lingo AutoFocus/Prompt>></$link> |{{$:/snippets/minifocusswitcher}} |
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
title: $:/snippets/retain-story-ordering-button
|
||||||
|
|
||||||
|
<$button set="$:/DefaultTiddlers" setTo={{$:/config/ControlPanel/Basics/DefaultTiddlers/RetainStory}} ><<currentTiddler>></$button>
|
||||||
@@ -12,7 +12,7 @@ field="text"
|
|||||||
checked="enable"
|
checked="enable"
|
||||||
unchecked="disable"
|
unchecked="disable"
|
||||||
default="enable">
|
default="enable">
|
||||||
<<rule>>
|
<span class="tc-small-gap-left"><<rule>></span>
|
||||||
</$checkbox>
|
</$checkbox>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
|
|||||||
18
core/ui/DownloadFullWiki.tid
Normal file
18
core/ui/DownloadFullWiki.tid
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
title: $:/core/ui/DownloadFullWiki
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
\rules except wikilink
|
||||||
|
|
||||||
|
To download the standard single-file version of your wiki:
|
||||||
|
|
||||||
|
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
|
||||||
|
<$let publishFilter="""-[[$:/config/SaveWikiButton/Template]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]]""">
|
||||||
|
<$button tooltip="Download fully standalone wiki" aria-label="download full wiki" class="tc-btn-big-green">
|
||||||
|
<$action-sendmessage $message="tm-download-file" $param="$:/core/save/all" publishFilter=<<publishFilter>> filename=<<site-title>>/>
|
||||||
|
{{$:/core/images/download-button}}
|
||||||
|
<span class="tc-tiny-gap-left">
|
||||||
|
Download full wiki
|
||||||
|
</span>
|
||||||
|
</$button>
|
||||||
|
</$let>
|
||||||
|
</$wikify>
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
title: $:/core/ui/EditTemplate
|
title: $:/core/ui/EditTemplate
|
||||||
|
|
||||||
\define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix<newFieldValueTiddlerPrefix>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/>
|
\define delete-edittemplate-state-tiddlers()
|
||||||
|
<$set name="safeNewFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
||||||
|
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix[$:/temp/NewFieldValue]prefix<safeNewFieldValueTiddlerPrefix>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/>
|
||||||
|
</$set>
|
||||||
|
\end
|
||||||
|
|
||||||
|
<!-- Beware this is duplicated from fields.tid. For details see bug #7054 -->
|
||||||
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
|
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
|
||||||
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
|
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
|
||||||
|
|
||||||
@@ -23,7 +28,7 @@ title: $:/core/ui/EditTemplate
|
|||||||
<div
|
<div
|
||||||
data-tiddler-title=<<currentTiddler>>
|
data-tiddler-title=<<currentTiddler>>
|
||||||
data-tags={{!!tags}}
|
data-tags={{!!tags}}
|
||||||
class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
|
class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
|
||||||
role="region"
|
role="region"
|
||||||
aria-label={{$:/language/EditTemplate/Caption}}>
|
aria-label={{$:/language/EditTemplate/Caption}}>
|
||||||
<$fieldmangler>
|
<$fieldmangler>
|
||||||
@@ -41,9 +46,7 @@ title: $:/core/ui/EditTemplate
|
|||||||
<$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">> tag="div">
|
<$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">> tag="div">
|
||||||
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>> tag="div">
|
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>> tag="div">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
|
||||||
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
</$set>
|
|
||||||
</$list>
|
</$list>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|||||||
|
|
||||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||||
|
|
||||||
<div class="tc-tiddler-preview-preview">
|
<div class="tc-tiddler-preview-preview" data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}>
|
||||||
|
|
||||||
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ $:/config/EditToolbarButtons/Visibility/$(listItem)$
|
|||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-tiddler-title tc-tiddler-edit-title">
|
<div class="tc-tiddler-title tc-tiddler-edit-title">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list></span>
|
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
|
|||||||
[[hide]] -[title{$(config-title)$}]
|
[[hide]] -[title{$(config-title)$}]
|
||||||
\end
|
\end
|
||||||
|
|
||||||
|
<!-- Beware this is duplicated from EditTemplate.tid. For details see bug #7054 -->
|
||||||
|
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
|
||||||
|
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
|
||||||
|
|
||||||
\define current-tiddler-new-field-selector()
|
\define current-tiddler-new-field-selector()
|
||||||
[data-tiddler-title="$(currentTiddlerCSSescaped)$"] .tc-edit-field-add-name-wrapper input
|
[data-tiddler-title="$(currentTiddlerCSSescaped)$"] .tc-edit-field-add-name-wrapper input
|
||||||
\end
|
\end
|
||||||
@@ -17,7 +21,9 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
|
|||||||
\define new-field-actions()
|
\define new-field-actions()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
||||||
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix<newFieldValueTiddlerPrefix>] [<storeTitle>] [<searchListState>]"/>
|
<$set name="safeNewFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
||||||
|
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix[$:/temp/NewFieldValue]prefix<safeNewFieldValueTiddlerPrefix>] [<storeTitle>] [<searchListState>]"/>
|
||||||
|
</$set>
|
||||||
<$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/>
|
<$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
@@ -52,7 +58,9 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
|
|||||||
<$action-sendmessage $message="tm-add-field"
|
<$action-sendmessage $message="tm-add-field"
|
||||||
$name=<<name>>
|
$name=<<name>>
|
||||||
$value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
$value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
||||||
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix<newFieldValueTiddlerPrefix>] [<storeTitle>] [<searchListState>]"/>
|
<$set name="safeNewFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
||||||
|
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix[$:/temp/NewFieldValue]prefix<safeNewFieldValueTiddlerPrefix>] [<storeTitle>] [<searchListState>]"/>
|
||||||
|
</$set>
|
||||||
<<lingo Fields/Add/Button>>
|
<<lingo Fields/Add/Button>>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
@@ -65,6 +73,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
|||||||
\end
|
\end
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
|
<$set name="newFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
||||||
<div class="tc-edit-fields">
|
<div class="tc-edit-fields">
|
||||||
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
|
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -148,3 +157,4 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
|||||||
</$vars>
|
</$vars>
|
||||||
</div>
|
</div>
|
||||||
</$fieldmangler>
|
</$fieldmangler>
|
||||||
|
</$set>
|
||||||
@@ -3,16 +3,23 @@ tags: $:/tags/EditToolbar
|
|||||||
caption: {{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}}
|
caption: {{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}}
|
||||||
description: {{$:/language/Buttons/Save/Hint}}
|
description: {{$:/language/Buttons/Save/Hint}}
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
\define save-tiddler-button()
|
\define save-tiddler-button()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$fieldmangler><$button tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>
|
<$fieldmangler>
|
||||||
<<save-tiddler-actions>>
|
<$button
|
||||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
tooltip={{$:/language/Buttons/Save/Hint}}
|
||||||
{{$:/core/images/done-button}}
|
aria-label={{$:/language/Buttons/Save/Caption}}
|
||||||
</$list>
|
class=<<tv-config-toolbar-class>>
|
||||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
>
|
||||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Save/Caption}}/></span>
|
<<save-tiddler-actions>>
|
||||||
</$list>
|
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||||
</$button></$fieldmangler>
|
{{$:/core/images/done-button}}
|
||||||
|
</$list>
|
||||||
|
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||||
|
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Save/Caption}}/></span>
|
||||||
|
</$list>
|
||||||
|
</$button>
|
||||||
|
</$fieldmangler>
|
||||||
\end
|
\end
|
||||||
<<save-tiddler-button>>
|
<<save-tiddler-button>>
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
title: $:/core/ui/ExportTiddlyWikiCore
|
title: $:/core/ui/ExportTiddlyWikiCore
|
||||||
|
|
||||||
\define jsFileName() tiddlywikicore-$(version)$.js
|
\define jsFileName() tiddlywikicore-$(version)$.js
|
||||||
\define noExportMsg()
|
|
||||||
It appears that you have a wiki with an external ~TiddlyWiki core. The export action cannot be performed.
|
|
||||||
<p>You will need to view the page source in your browser. Then go to the very bottom the the source, find the last `<script>`
|
|
||||||
element, and right-click its `src` URI. Save the link as ''$(jsFileName)$''</p>
|
|
||||||
\end
|
|
||||||
\rules except wikilink
|
\rules except wikilink
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
@@ -17,16 +12,11 @@ Export the TiddlyWiki core JavaScript code for running with external JavaScript:
|
|||||||
tooltip="Export the TiddlyWiki core code for running with external JavaScript"
|
tooltip="Export the TiddlyWiki core code for running with external JavaScript"
|
||||||
aria-label="export TiddlyWiki core"
|
aria-label="export TiddlyWiki core"
|
||||||
class="tc-btn-big-green">
|
class="tc-btn-big-green">
|
||||||
<$list
|
<$action-sendmessage $message='tm-download-file' $param='$:/core/templates/tiddlywiki5.js' filename=<<jsFileName>>/>
|
||||||
filter="[[$:/boot/boot.js]is[missing]]"
|
|
||||||
variable="ignore"
|
|
||||||
emptyMessage="<$action-sendmessage $message='tm-download-file' $param='$:/core/templates/tiddlywiki5.js' filename=<<jsFileName>>/>" >
|
|
||||||
<$action-setfield $tiddler=<<qualify "$:/temp/alert">> text=<<noExportMsg>> subtitle="Export ~TiddllyWiki Core"/>
|
|
||||||
<$action-sendmessage $message="tm-modal" $param=<<qualify "$:/temp/alert">>/>
|
|
||||||
</$list>
|
|
||||||
{{$:/core/images/download-button}}
|
{{$:/core/images/download-button}}
|
||||||
 
|
<span class="tc-tiny-gap-left">
|
||||||
Download TiddlyWiki core
|
Download TiddlyWiki core
|
||||||
|
</span>
|
||||||
</$button>
|
</$button>
|
||||||
|
|
||||||
[[Further information|https://tiddlywiki.com/#Using%20the%20external%20JavaScript%20template]]
|
[[Further information|https://tiddlywiki.com/#Using%20the%20external%20JavaScript%20template]]
|
||||||
|
|||||||
@@ -117,15 +117,15 @@ title: $:/core/ui/ImportListing
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<tr>
|
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="tr">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
|
|
||||||
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
|
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
|
||||||
<$transclude tiddler={{$:/state/importpreviewtype}}/>
|
<div>
|
||||||
|
<$transclude tiddler={{$:/state/importpreviewtype}}/>
|
||||||
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
</$reveal>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ key: ((advanced-search))
|
|||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
||||||
<$action-navigate $to="$:/AdvancedSearch"/>
|
<$action-navigate $to="$:/AdvancedSearch" $scroll="yes"/>
|
||||||
<$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
|
<$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
|
||||||
</$navigator>
|
</$navigator>
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ caption: {{$:/language/ControlPanel/LayoutSwitcher/Caption}}
|
|||||||
<$set name="cls" filter="[all[current]field:title{$:/layout}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
<$set name="cls" filter="[all[current]field:title{$:/layout}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
||||||
<div class=<<cls>>>
|
<div class=<<cls>>>
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
''<$transclude field="name"/>'' - <$transclude field="description"/>
|
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>'' - <$transclude field="description"/>
|
||||||
</$link></div></$set>
|
</$link></div></$set>
|
||||||
""">
|
""">
|
||||||
<$set name="cls" filter="[all[current]field:title[$:/core/ui/PageTemplate]]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
<$set name="cls" filter="[all[current]field:title[$:/core/ui/PageTemplate]]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
||||||
<div class=<<cls>>>
|
<div class=<<cls>>>
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
''<$transclude field="name"/>'' - <$transclude field="description"/>
|
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>'' - <$transclude field="description"/>
|
||||||
</$link>
|
</$link>
|
||||||
</div>
|
</div>
|
||||||
</$set>
|
</$set>
|
||||||
|
|||||||
@@ -2,26 +2,17 @@ title: $:/core/ui/MoreSideBar/Tags
|
|||||||
tags: $:/tags/MoreSideBar
|
tags: $:/tags/MoreSideBar
|
||||||
caption: {{$:/language/SideBar/Tags/Caption}}
|
caption: {{$:/language/SideBar/Tags/Caption}}
|
||||||
|
|
||||||
<$set name="tv-config-toolbar-icons" value="yes">
|
\whitespace trim
|
||||||
|
|
||||||
<$set name="tv-config-toolbar-text" value="yes">
|
|
||||||
|
|
||||||
<$set name="tv-config-toolbar-class" value="">
|
|
||||||
|
|
||||||
{{$:/core/ui/Buttons/tag-manager}}
|
|
||||||
|
|
||||||
</$set>
|
|
||||||
|
|
||||||
</$set>
|
|
||||||
|
|
||||||
</$set>
|
|
||||||
|
|
||||||
|
<$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="">
|
||||||
|
<div class="tc-tiny-v-gap-bottom">
|
||||||
|
{{$:/core/ui/Buttons/tag-manager}}
|
||||||
|
</div>
|
||||||
|
</$let>
|
||||||
<$list filter={{$:/core/Filters/AllTags!!filter}}>
|
<$list filter={{$:/core/Filters/AllTags!!filter}}>
|
||||||
|
<div class="tc-tiny-v-gap-bottom">
|
||||||
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
||||||
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
<hr class="tc-untagged-separator">
|
<hr class="tc-untagged-separator">
|
||||||
|
|
||||||
{{$:/core/ui/UntaggedTemplate}}
|
{{$:/core/ui/UntaggedTemplate}}
|
||||||
|
|||||||
15
core/ui/PageControls/layout.tid
Normal file
15
core/ui/PageControls/layout.tid
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
title: $:/core/ui/Buttons/layout
|
||||||
|
tags: $:/tags/PageControls
|
||||||
|
caption: {{$:/core/images/layout-button}} {{$:/language/Buttons/LayoutSwitcher/Caption}}
|
||||||
|
description: {{$:/language/LayoutSwitcher/Description}}
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
<$button tooltip={{$:/language/Buttons/LayoutSwitcher/Hint}} aria-label={{$:/language/Buttons/LayoutSwitcher/Caption}} class=<<tv-config-toolbar-class>>>
|
||||||
|
<$action-sendmessage $message="tm-show-switcher" switch="layout"/>
|
||||||
|
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||||
|
{{$:/core/images/layout-button}}
|
||||||
|
</$list>
|
||||||
|
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||||
|
<span class="tc-btn-text"><$text text={{$:/language/Buttons/LayoutSwitcher/Caption}}/></span>
|
||||||
|
</$list>
|
||||||
|
</$button>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
title: $:/core/ui/Buttons/save-wiki
|
title: $:/core/ui/Buttons/save-wiki
|
||||||
tags: $:/tags/PageControls
|
tags: $:/tags/PageControls
|
||||||
caption: {{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}
|
caption: {{$:/core/images/save-button-dynamic}} {{$:/language/Buttons/SaveWiki/Caption}}
|
||||||
description: {{$:/language/Buttons/SaveWiki/Hint}}
|
description: {{$:/language/Buttons/SaveWiki/Hint}}
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
@@ -10,7 +10,7 @@ description: {{$:/language/Buttons/SaveWiki/Hint}}
|
|||||||
</$wikify>
|
</$wikify>
|
||||||
<span class="tc-dirty-indicator">
|
<span class="tc-dirty-indicator">
|
||||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||||
{{$:/core/images/save-button}}
|
{{$:/core/images/save-button-dynamic}}
|
||||||
</$list>
|
</$list>
|
||||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||||
<span class="tc-btn-text">
|
<span class="tc-btn-text">
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
title: $:/core/ui/PageTemplate
|
title: $:/core/ui/PageTemplate
|
||||||
name: {{$:/language/PageTemplate/Name}}
|
name: {{$:/language/PageTemplate/Name}}
|
||||||
description: {{$:/language/PageTemplate/Description}}
|
description: {{$:/language/PageTemplate/Description}}
|
||||||
|
icon: $:/core/images/layout-button
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
\define containerClasses()
|
|
||||||
tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
|
|
||||||
\end
|
|
||||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||||
|
|
||||||
<$vars
|
<$vars
|
||||||
@@ -17,7 +15,7 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
|
|||||||
storyviewTitle={{$:/view}}
|
storyviewTitle={{$:/view}}
|
||||||
languageTitle={{{ [{$:/language}get[name]] }}}>
|
languageTitle={{{ [{$:/language}get[name]] }}}>
|
||||||
|
|
||||||
<div class=<<containerClasses>>>
|
<div class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/PageTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-page-container [[tc-page-view-]addsuffix<storyviewTitle>] [[tc-language-]addsuffix<languageTitle>] :and[unique[]join[ ]] }}} >
|
||||||
|
|
||||||
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
|
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ tags: $:/tags/SideBar
|
|||||||
caption: {{$:/language/SideBar/More/Caption}}
|
caption: {{$:/language/SideBar/More/Caption}}
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-more-sidebar">
|
<div class={{{ [{$:/config/ui/SideBar/More/horizontal}match[yes]then[tc-sidebar-tabs]else[tc-more-sidebar]] }}}>
|
||||||
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]" default={{$:/config/DefaultMoreSidebarTab}} state="$:/state/tab/moresidebar" class="tc-vertical tc-sidebar-tabs-more" explicitState="$:/state/tab/moresidebar-1850697562"/>
|
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]" default={{$:/config/DefaultMoreSidebarTab}} state="$:/state/tab/moresidebar" class={{{ [{$:/config/ui/SideBar/More/horizontal}match[yes]then[tc-sidebar-tabs-more]else[tc-vertical tc-sidebar-tabs-more]] }}} explicitState="$:/state/tab/moresidebar-1850697562"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
title: $:/core/ui/SwitcherModal
|
title: $:/core/ui/SwitcherModal
|
||||||
subtitle: <$text text={{{[<switch>lookup[$:/language/Switcher/Subtitle/]]}}}/>
|
subtitle: <$text text={{{[<switch>lookup[$:/language/Switcher/Subtitle/]]}}}/>
|
||||||
class: tc-modal-centered
|
class: tc-modal-centered
|
||||||
|
mask-closable: yes
|
||||||
|
|
||||||
<$tiddler tiddler={{{[<switch>lookup[$:/config/SwitcherTargets/]]}}}>
|
<$tiddler tiddler={{{[<switch>lookup[$:/config/SwitcherTargets/]]}}}>
|
||||||
|
|
||||||
|
|||||||
@@ -3,89 +3,101 @@ icon: $:/core/images/tag-button
|
|||||||
color: #bbb
|
color: #bbb
|
||||||
|
|
||||||
\define lingo-base() $:/language/TagManager/
|
\define lingo-base() $:/language/TagManager/
|
||||||
|
|
||||||
\define iconEditorTab(type)
|
\define iconEditorTab(type)
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$link to=""><<lingo Icons/None>></$link>
|
<$link to=""><<lingo Icons/None>></$link>
|
||||||
<$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[sort[title]] +[$type$is[system]]">
|
<$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[sort[title]] +[$type$is[system]]">
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$transclude/> <$view field="title"/>
|
<$transclude/> <$view field="title"/>
|
||||||
</$link>
|
</$link>
|
||||||
</$list>
|
</$list>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define iconEditor(title)
|
\define iconEditor(title)
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-drop-down-wrapper">
|
<div class="tc-drop-down-wrapper">
|
||||||
<$button popupTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}</$button>
|
<$button popupTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} class="tc-btn-invisible tc-btn-dropdown">
|
||||||
<$reveal stateTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} type="popup" position="belowleft" text="" default="">
|
{{$:/core/images/down-arrow}}
|
||||||
<div class="tc-drop-down">
|
</$button>
|
||||||
<$linkcatcher actions="""<$action-setfield $tiddler=<<__title__>> icon=<<navigateTo>>/>""">
|
<$reveal stateTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} type="popup" position="belowleft" text="" default="">
|
||||||
<<iconEditorTab type:"!">>
|
<div class="tc-drop-down">
|
||||||
<hr/>
|
<$linkcatcher actions="""<$action-setfield $tiddler=<<__title__>> icon=<<navigateTo>>/>""">
|
||||||
<<iconEditorTab type:"">>
|
<<iconEditorTab type:"!">>
|
||||||
</$linkcatcher>
|
<hr/>
|
||||||
</div>
|
<<iconEditorTab type:"">>
|
||||||
</$reveal>
|
</$linkcatcher>
|
||||||
|
</div>
|
||||||
|
</$reveal>
|
||||||
</div>
|
</div>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define toggleButton(state)
|
\define toggleButton(state)
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$reveal stateTitle=<<__state__>> type="match" text="closed" default="closed">
|
<$reveal stateTitle=<<__state__>> type="match" text="closed" default="closed">
|
||||||
<$button setTitle=<<__state__>> setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
|
<$button setTitle=<<__state__>> setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
|
||||||
{{$:/core/images/info-button}}
|
{{$:/core/images/info-button}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal stateTitle=<<__state__>> type="match" text="open" default="closed">
|
<$reveal stateTitle=<<__state__>> type="match" text="open" default="closed">
|
||||||
<$button setTitle=<<__state__>> setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
|
<$button setTitle=<<__state__>> setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
|
||||||
{{$:/core/images/info-button}}
|
{{$:/core/images/info-button}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<table class="tc-tag-manager-table">
|
<table class="tc-tag-manager-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th><<lingo Colour/Heading>></th>
|
<th><<lingo Colour/Heading>></th>
|
||||||
<th class="tc-tag-manager-tag"><<lingo Tag/Heading>></th>
|
<th class="tc-tag-manager-tag"><<lingo Tag/Heading>></th>
|
||||||
<th><<lingo Count/Heading>></th>
|
<th><<lingo Count/Heading>></th>
|
||||||
<th><<lingo Icon/Heading>></th>
|
<th><<lingo Icon/Heading>></th>
|
||||||
<th><<lingo Info/Heading>></th>
|
<th><<lingo Info/Heading>></th>
|
||||||
</tr>
|
</tr>
|
||||||
<$list filter="[tags[]!is[system]sort[title]]">
|
<$list filter="[tags[]!is[system]sort[title]]">
|
||||||
<tr>
|
<tr>
|
||||||
<td><$edit-text field="color" tag="input" type="color"/></td>
|
<td><$edit-text field="color" tag="input" type="color"/></td>
|
||||||
<td>{{||$:/core/ui/TagTemplate}}</td>
|
<td>{{||$:/core/ui/TagTemplate}}</td>
|
||||||
<td><$count filter="[all[current]tagging[]]"/></td>
|
<td><$count filter="[all[current]tagging[]]"/></td>
|
||||||
<td>
|
<td>
|
||||||
<$macrocall $name="iconEditor" title={{!!title}}/>
|
<$macrocall $name="iconEditor" title={{!!title}}/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<$macrocall $name="toggleButton" state={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} />
|
<$macrocall $name="toggleButton" state={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
<$reveal stateTitle={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} type="match" text="open" default="">
|
<$reveal stateTitle={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} type="match" text="open" default="">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td><<lingo Colour/Heading>></td><td><$edit-text field="color" tag="input" type="text" size="9"/></td></tr>
|
<tr>
|
||||||
<tr><td><<lingo Icon/Heading>></td><td><$edit-text field="icon" tag="input" size="45"/></td></tr>
|
<td><<lingo Colour/Heading>></td>
|
||||||
</tbody>
|
<td><$edit-text field="color" tag="input" type="text" size="9"/></td>
|
||||||
</table>
|
</tr>
|
||||||
</$reveal>
|
<tr>
|
||||||
</td>
|
<td><<lingo Icon/Heading>></td>
|
||||||
</tr>
|
<td><$edit-text field="icon" tag="input" size="45"/></td>
|
||||||
</$list>
|
</tr>
|
||||||
<tr>
|
</tbody>
|
||||||
<td></td>
|
</table>
|
||||||
<td style="position:relative;">
|
</$reveal>
|
||||||
{{$:/core/ui/UntaggedTemplate}}
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>
|
</$list>
|
||||||
<small class="tc-menu-list-count"><$count filter="[untagged[]!is[system]] -[tags[]]"/></small>
|
<tr>
|
||||||
</td>
|
<td></td>
|
||||||
<td></td>
|
<td style="position:relative;">
|
||||||
<td></td>
|
{{$:/core/ui/UntaggedTemplate}}
|
||||||
</tr>
|
</td>
|
||||||
|
<td>
|
||||||
|
<small class="tc-menu-list-count"><$count filter="[untagged[]!is[system]] -[tags[]]"/></small>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ title: $:/core/ui/UntaggedTemplate
|
|||||||
\define lingo-base() $:/language/SideBar/
|
\define lingo-base() $:/language/SideBar/
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
|
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
|
||||||
<<lingo Tags/Untagged/Caption>>
|
<<lingo Tags/Untagged/Caption>>
|
||||||
</$button>
|
</$button>
|
||||||
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
|
<$reveal class="tc-drop-down" tag="div" state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
|
||||||
<div class="tc-drop-down">
|
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
|
||||||
</div>
|
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ $:/state/folded/$(currentTiddler)$
|
|||||||
\define cancel-delete-tiddler-actions(message) <$action-sendmessage $message="tm-$message$-tiddler"/>
|
\define cancel-delete-tiddler-actions(message) <$action-sendmessage $message="tm-$message$-tiddler"/>
|
||||||
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]]
|
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]]
|
||||||
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>
|
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>
|
||||||
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}} role="article">
|
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}} role="article">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
</$list>
|
</$list>
|
||||||
|
|||||||
@@ -2,17 +2,21 @@ title: $:/core/ui/ViewTemplate/unfold
|
|||||||
tags: $:/tags/ViewTemplate
|
tags: $:/tags/ViewTemplate
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$reveal tag="div" type="nomatch" state="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar" text="hide">
|
<div class="tc-reveal">
|
||||||
|
<$list filter="[{$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar}match[show]]" variable="ignore">
|
||||||
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
|
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
|
||||||
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class="tc-fold-banner">
|
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class="tc-fold-banner">
|
||||||
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
||||||
{{$:/core/images/chevron-up}}
|
{{$:/core/images/chevron-up}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
</$list>
|
||||||
|
<$list filter="[{$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar}match[show]] :else[<folded-state>get[text]match[hide]]" variable="ignore">
|
||||||
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
|
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
|
||||||
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class="tc-unfold-banner">
|
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class="tc-unfold-banner">
|
||||||
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
||||||
{{$:/core/images/chevron-down}}
|
{{$:/core/images/chevron-down}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$reveal>
|
</$list>
|
||||||
|
</div>
|
||||||
3
core/wiki/config/DefaultTiddlersRetainStory.tid
Normal file
3
core/wiki/config/DefaultTiddlersRetainStory.tid
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
title: $:/config/ControlPanel/Basics/DefaultTiddlers/RetainStory
|
||||||
|
|
||||||
|
[list[$:/StoryList]]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
title: $:/config/OfficialPluginLibrary
|
title: $:/config/OfficialPluginLibrary
|
||||||
tags: $:/tags/PluginLibrary
|
tags: $:/tags/PluginLibrary
|
||||||
url: https://tiddlywiki.com/library/v5.2.4/index.html
|
url: https://tiddlywiki.com/library/v5.2.6/index.html
|
||||||
caption: {{$:/language/OfficialPluginLibrary}}
|
caption: {{$:/language/OfficialPluginLibrary}}
|
||||||
|
|
||||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ core/ui/Buttons/print: hide
|
|||||||
core/ui/Buttons/storyview: hide
|
core/ui/Buttons/storyview: hide
|
||||||
core/ui/Buttons/timestamp: hide
|
core/ui/Buttons/timestamp: hide
|
||||||
core/ui/Buttons/theme: hide
|
core/ui/Buttons/theme: hide
|
||||||
|
core/ui/Buttons/layout: hide
|
||||||
core/ui/Buttons/unfold-all: hide
|
core/ui/Buttons/unfold-all: hide
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ title: $:/snippets/download-wiki-button
|
|||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$button class="tc-btn-big-green">
|
<$button class="tc-btn-big-green">
|
||||||
<$action-sendmessage $message="tm-download-file" $param="$:/core/save/all" filename="index.html"/>
|
<$action-sendmessage $message="tm-download-file" $param="$:/core/save/all" filename="index.html"/>
|
||||||
<<lingo Full/Caption>> {{$:/core/images/save-button}}
|
<<lingo Full/Caption>> {{$:/core/images/save-button-dynamic}}
|
||||||
</$button>
|
</$button>
|
||||||
@@ -4,76 +4,85 @@ tags: $:/tags/Macro
|
|||||||
\define change-input-tab(stateTitle,tag,beforeafter,defaultState,actions)
|
\define change-input-tab(stateTitle,tag,beforeafter,defaultState,actions)
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$set name="tabsList" filter="[all[shadows+tiddlers]tag<__tag__>!has[draft.of]]">
|
<$set name="tabsList" filter="[all[shadows+tiddlers]tag<__tag__>!has[draft.of]]">
|
||||||
<$let
|
<$let
|
||||||
currentState={{{ [<__stateTitle__>!is[missing]get[text]] ~[<__defaultState__>] }}}
|
currentState={{{ [<__stateTitle__>!is[missing]get[text]] ~[<__defaultState__>] }}}
|
||||||
firstTab={{{ [enlist<tabsList>nth[1]] }}}
|
firstTab={{{ [enlist<tabsList>nth[1]] }}}
|
||||||
lastTab={{{ [enlist<tabsList>last[]] }}}
|
lastTab={{{ [enlist<tabsList>last[]] }}}
|
||||||
nextTab={{{ [all[shadows+tiddlers]tag<__tag__>!has[draft.of]$beforeafter$<currentState>] ~[[$beforeafter$]removeprefix[after]suffix[]addprefix<firstTab>] ~[[$beforeafter$]removeprefix[before]suffix[]addprefix<lastTab>] }}}>
|
nextTab={{{ [all[shadows+tiddlers]tag<__tag__>!has[draft.of]$beforeafter$<currentState>] ~[[$beforeafter$]removeprefix[after]suffix[]addprefix<firstTab>] ~[[$beforeafter$]removeprefix[before]suffix[]addprefix<lastTab>] }}}
|
||||||
<$action-setfield $tiddler=<<__stateTitle__>> text=<<nextTab>>/>
|
>
|
||||||
$actions$
|
<$action-setfield $tiddler=<<__stateTitle__>> text=<<nextTab>>/>
|
||||||
</$let>
|
$actions$
|
||||||
|
</$let>
|
||||||
</$set>
|
</$set>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define keyboard-input-actions()
|
\define keyboard-input-actions()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$list filter="[<__index__>match[]]">
|
<$list filter="[<__index__>match[]]">
|
||||||
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>get<__field__>] }}}/>
|
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>get<__field__>] }}}/>
|
||||||
</$list>
|
</$list>
|
||||||
<$list filter="[<__index__>!match[]]">
|
<$list filter="[<__index__>!match[]]">
|
||||||
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>getindex<__index__>] }}}/>
|
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>getindex<__index__>] }}}/>
|
||||||
</$list>
|
</$list>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define input-next-actions-inner()
|
\define input-next-actions-inner()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$list filter="[<nextItem>minlength[1]]" variable="ignore">
|
<$list filter="[<nextItem>minlength[1]]" variable="ignore">
|
||||||
<$action-setfield $tiddler=<<__selectionStateTitle__>> text=<<nextItem>>/>
|
<$action-setfield $tiddler=<<__selectionStateTitle__>> text=<<nextItem>>/>
|
||||||
<$list filter="[<__index__>match[]]">
|
<$list filter="[<__index__>match[]]">
|
||||||
<$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
|
<$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
|
||||||
</$list>
|
</$list>
|
||||||
<$list filter="[<__index__>!match[]]">
|
<$list filter="[<__index__>!match[]]">
|
||||||
<$action-setfield $tiddler=<<__tiddler__>> $index=<<__index__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
|
<$action-setfield $tiddler=<<__tiddler__>> $index=<<__index__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
|
||||||
</$list>
|
</$list>
|
||||||
<$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
|
<$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
|
||||||
</$list>
|
</$list>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define input-next-actions(afterOrBefore:"after",reverse:"")
|
\define input-next-actions(afterOrBefore:"after",reverse:"")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$list filter="[<__storeTitle__>get[text]minlength<__filterMinLength__>] [<__filterMinLength__>match[0]] +[limit[1]]" variable="ignore">
|
<$list
|
||||||
<$let
|
filter="[<__storeTitle__>get[text]minlength<__filterMinLength__>] [<__filterMinLength__>match[0]] +[limit[1]]"
|
||||||
userInput={{{ [<__storeTitle__>get[text]] }}}
|
variable="ignore"
|
||||||
selectedItem={{{ [<__selectionStateTitle__>get[text]] }}}
|
>
|
||||||
configTiddler={{{ [subfilter<__configTiddlerFilter__>] }}}
|
<$let
|
||||||
primaryListFilter={{{ [<configTiddler>get<__firstSearchFilterField__>] }}}
|
userInput={{{ [<__storeTitle__>get[text]] }}}
|
||||||
secondaryListFilter={{{ [<configTiddler>get<__secondSearchFilterField__>] }}}>
|
selectedItem={{{ [<__selectionStateTitle__>get[text]] }}}
|
||||||
<$set name="filteredList" filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] =[subfilter<secondaryListFilter>addsuffix[-secondaryList]]">
|
configTiddler={{{ [subfilter<__configTiddlerFilter__>] }}}
|
||||||
<$let
|
primaryListFilter={{{ [<configTiddler>get<__firstSearchFilterField__>] }}}
|
||||||
nextItem={{{ [enlist<filteredList>$afterOrBefore$<selectedItem>] ~[enlist<filteredList>$reverse$nth[1]] }}}
|
secondaryListFilter={{{ [<configTiddler>get<__secondSearchFilterField__>] }}}
|
||||||
firstItem={{{ [enlist<filteredList>nth[1]] }}}
|
>
|
||||||
lastItem={{{ [enlist<filteredList>last[]] }}}>
|
<$set
|
||||||
<$list filter="[<selectedItem>match<firstItem>!match<lastItem>]" variable="ignore">
|
name="filteredList"
|
||||||
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[before]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
|
filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] =[subfilter<secondaryListFilter>addsuffix[-secondaryList]]"
|
||||||
<<input-next-actions-inner>>
|
>
|
||||||
</$set>
|
<$let
|
||||||
</$list>
|
nextItem={{{ [enlist<filteredList>$afterOrBefore$<selectedItem>] ~[enlist<filteredList>$reverse$nth[1]] }}}
|
||||||
<$list filter="[<selectedItem>match<lastItem>!match<firstItem>]" variable="ignore">
|
firstItem={{{ [enlist<filteredList>nth[1]] }}}
|
||||||
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[after]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
|
lastItem={{{ [enlist<filteredList>last[]] }}}
|
||||||
<<input-next-actions-inner>>
|
>
|
||||||
</$set>
|
<$list filter="[<selectedItem>match<firstItem>!match<lastItem>]" variable="ignore">
|
||||||
</$list>
|
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[before]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
|
||||||
<$list filter="[<selectedItem>match<firstItem>match<lastItem>]" variable="ignore">
|
<<input-next-actions-inner>>
|
||||||
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
|
</$set>
|
||||||
<<input-next-actions-inner>>
|
</$list>
|
||||||
</$set>
|
<$list filter="[<selectedItem>match<lastItem>!match<firstItem>]" variable="ignore">
|
||||||
</$list>
|
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[after]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
|
||||||
<$list filter="[<selectedItem>!match<firstItem>!match<lastItem>]" variable="ignore">
|
<<input-next-actions-inner>>
|
||||||
<<input-next-actions-inner>>
|
</$set>
|
||||||
</$list>
|
</$list>
|
||||||
</$let>
|
<$list filter="[<selectedItem>match<firstItem>match<lastItem>]" variable="ignore">
|
||||||
</$set>
|
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
|
||||||
</$let>
|
<<input-next-actions-inner>>
|
||||||
|
</$set>
|
||||||
|
</$list>
|
||||||
|
<$list filter="[<selectedItem>!match<firstItem>!match<lastItem>]" variable="ignore">
|
||||||
|
<<input-next-actions-inner>>
|
||||||
|
</$list>
|
||||||
|
</$let>
|
||||||
|
</$set>
|
||||||
|
</$let>
|
||||||
</$list>
|
</$list>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
@@ -84,12 +93,14 @@ $actions$
|
|||||||
<$keyboard key="((input-up))" actions=<<input-next-actions "before" "reverse[]">>>
|
<$keyboard key="((input-up))" actions=<<input-next-actions "before" "reverse[]">>>
|
||||||
<$keyboard key="((input-down))" actions=<<input-next-actions>>>
|
<$keyboard key="((input-down))" actions=<<input-next-actions>>>
|
||||||
<$keyboard key="((input-cancel))" actions=<<__inputCancelActions__>>>
|
<$keyboard key="((input-cancel))" actions=<<__inputCancelActions__>>>
|
||||||
<$edit-text tiddler=<<__tiddler__>> field=<<__field__>> index=<<__index__>>
|
<$edit-text
|
||||||
inputActions=<<keyboard-input-actions>> tag=<<__tag__>> class=<<__class__>>
|
tiddler=<<__tiddler__>> field=<<__field__>> index=<<__index__>>
|
||||||
placeholder=<<__placeholder__>> default=<<__default__>> focusPopup=<<__focusPopup__>>
|
inputActions=<<keyboard-input-actions>> tag=<<__tag__>> class=<<__class__>>
|
||||||
focus=<<__focus__>> type=<<__type__>> rows=<<__rows__>> minHeight=<<__minHeight__>>
|
placeholder=<<__placeholder__>> default=<<__default__>> focusPopup=<<__focusPopup__>>
|
||||||
tabindex=<<__tabindex__>> size=<<__size__>> autoHeight=<<__autoHeight__>>
|
focus=<<__focus__>> type=<<__type__>> rows=<<__rows__>> minHeight=<<__minHeight__>>
|
||||||
refreshTitle=<<__refreshTitle__>> cancelPopups=<<__cancelPopups__>>/>
|
tabindex=<<__tabindex__>> size=<<__size__>> autoHeight=<<__autoHeight__>>
|
||||||
|
refreshTitle=<<__refreshTitle__>> cancelPopups=<<__cancelPopups__>>
|
||||||
|
/>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
title: $:/core/macros/list
|
title: $:/core/macros/list
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage)
|
\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage,field:"caption")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$type$ class="$class$">
|
<$genesis $type=<<__type__>> class=<<__class__>>>
|
||||||
<$list filter="$filter$" emptyMessage=<<__emptyMessage__>>>
|
<$list filter=<<__filter__>> emptyMessage=<<__emptyMessage__>>>
|
||||||
<$subtype$>
|
<$genesis $type=<<__subtype__>>>
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$let tv-wikilinks="no">
|
<$let tv-wikilinks="no">
|
||||||
<$transclude field="caption">
|
<$transclude field=<<__field__>>>
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$transclude>
|
</$transclude>
|
||||||
</$let>
|
</$let>
|
||||||
</$link>
|
</$link>
|
||||||
</$subtype$>
|
</$genesis>
|
||||||
</$list>
|
</$list>
|
||||||
</$type$>
|
</$genesis>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define list-links-draggable-drop-actions()
|
\define list-links-draggable-drop-actions()
|
||||||
@@ -26,7 +26,7 @@ tags: $:/tags/Macro
|
|||||||
\whitespace trim
|
\whitespace trim
|
||||||
<span class="tc-links-draggable-list">
|
<span class="tc-links-draggable-list">
|
||||||
<$vars targetTiddler="""$tiddler$""" targetField="""$field$""">
|
<$vars targetTiddler="""$tiddler$""" targetField="""$field$""">
|
||||||
<$type$ class="$class$">
|
<$genesis $type=<<__type__>> class="$class$">
|
||||||
<$list filter="[list[$tiddler$!!$field$]]" emptyMessage=<<__emptyMessage__>>>
|
<$list filter="[list[$tiddler$!!$field$]]" emptyMessage=<<__emptyMessage__>>>
|
||||||
<$droppable actions=<<list-links-draggable-drop-actions>> tag="""$subtype$""" enable=<<tv-enable-drag-and-drop>>>
|
<$droppable actions=<<list-links-draggable-drop-actions>> tag="""$subtype$""" enable=<<tv-enable-drag-and-drop>>>
|
||||||
<div class="tc-droppable-placeholder"/>
|
<div class="tc-droppable-placeholder"/>
|
||||||
@@ -51,7 +51,7 @@ tags: $:/tags/Macro
|
|||||||
<div style="height:0.5em;"/>
|
<div style="height:0.5em;"/>
|
||||||
</$droppable>
|
</$droppable>
|
||||||
</$tiddler>
|
</$tiddler>
|
||||||
</$type$>
|
</$genesis>
|
||||||
</$vars>
|
</$vars>
|
||||||
</span>
|
</span>
|
||||||
\end
|
\end
|
||||||
@@ -84,24 +84,24 @@ tags: $:/tags/Macro
|
|||||||
<span class="tc-tagged-draggable-list">
|
<span class="tc-tagged-draggable-list">
|
||||||
<$set name="tag" value=<<__tag__>>>
|
<$set name="tag" value=<<__tag__>>>
|
||||||
<$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>> storyview=<<__storyview__>>>
|
<$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>> storyview=<<__storyview__>>>
|
||||||
<$elementTag$ class="tc-menu-list-item">
|
<$genesis $type=<<__elementTag__>> class="tc-menu-list-item">
|
||||||
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
|
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
|
||||||
<$elementTag$ class="tc-droppable-placeholder"/>
|
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/>
|
||||||
<$elementTag$>
|
<$genesis $type=<<__elementTag__>>>
|
||||||
<$transclude tiddler="""$itemTemplate$""">
|
<$transclude tiddler="""$itemTemplate$""">
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$link>
|
</$link>
|
||||||
</$transclude>
|
</$transclude>
|
||||||
</$elementTag$>
|
</$genesis>
|
||||||
</$droppable>
|
</$droppable>
|
||||||
</$elementTag$>
|
</$genesis>
|
||||||
</$list>
|
</$list>
|
||||||
<$tiddler tiddler="">
|
<$tiddler tiddler="">
|
||||||
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
|
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
|
||||||
<$elementTag$ class="tc-droppable-placeholder"/>
|
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/>
|
||||||
<$elementTag$ style="height:0.5em;">
|
<$genesis $type=<<__elementTag__>> style="height:0.5em;">
|
||||||
</$elementTag$>
|
</$genesis>
|
||||||
</$droppable>
|
</$droppable>
|
||||||
</$tiddler>
|
</$tiddler>
|
||||||
</$set>
|
</$set>
|
||||||
|
|||||||
@@ -10,10 +10,14 @@ second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
|
|||||||
\define add-tag-actions(actions,tagField:"tags")
|
\define add-tag-actions(actions,tagField:"tags")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$set name="tag" value={{{ [<__tiddler__>get[text]] }}}>
|
<$set name="tag" value={{{ [<__tiddler__>get[text]] }}}>
|
||||||
<$list filter="[<saveTiddler>!contains:$tagField$<tag>!match[]]" variable="ignore" emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>">
|
<$list
|
||||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
filter="[<saveTiddler>!contains:$tagField$<tag>!match[]]"
|
||||||
$actions$
|
variable="ignore"
|
||||||
</$list>
|
emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>"
|
||||||
|
>
|
||||||
|
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||||
|
$actions$
|
||||||
|
</$list>
|
||||||
</$set>
|
</$set>
|
||||||
<<delete-tag-state-tiddlers>>
|
<<delete-tag-state-tiddlers>>
|
||||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||||
@@ -21,80 +25,153 @@ $actions$
|
|||||||
|
|
||||||
\define clear-tags-actions-inner()
|
\define clear-tags-actions-inner()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$list filter="[<storeTitle>has[text]] [<newTagNameTiddler>has[text]]" variable="ignore" emptyMessage="<<cancel-delete-tiddler-actions 'cancel'>>">
|
<$list
|
||||||
<<delete-tag-state-tiddlers>>
|
filter="[<storeTitle>has[text]] [<newTagNameTiddler>has[text]]"
|
||||||
|
variable="ignore"
|
||||||
|
emptyMessage="<<cancel-delete-tiddler-actions 'cancel'>>"
|
||||||
|
>
|
||||||
|
<<delete-tag-state-tiddlers>>
|
||||||
</$list>
|
</$list>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define clear-tags-actions()
|
\define clear-tags-actions()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
||||||
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" emptyMessage="<<clear-tags-actions-inner>>">
|
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" emptyMessage="<<clear-tags-actions-inner>>">
|
||||||
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||||
</$list>
|
</$list>
|
||||||
</$set>
|
</$set>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define tag-picker-inner(actions,tagField:"tags")
|
\define tag-picker-inner(actions,tagField:"tags")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$vars newTagNameInputTiddlerQualified=<<qualify "$:/temp/NewTagName/input">> newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">> fallbackTarget={{$(palette)$##tag-background}} colourA={{$(palette)$##foreground}} colourB={{$(palette)$##background}}>
|
<$vars
|
||||||
<$vars storeTitle={{{ [<newTagNameInputTiddler>!match[]] ~[<newTagNameInputTiddlerQualified>] }}} tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}>
|
newTagNameInputTiddlerQualified=<<qualify "$:/temp/NewTagName/input">>
|
||||||
<$vars refreshTitle=<<qualify "$:/temp/NewTagName/refresh">> nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]" systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]">
|
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
|
||||||
<div class="tc-edit-add-tag">
|
fallbackTarget={{$(palette)$##tag-background}}
|
||||||
<div>
|
colourA={{$(palette)$##foreground}}
|
||||||
<span class="tc-add-tag-name tc-small-gap-right">
|
colourB={{$(palette)$##background}}
|
||||||
<$macrocall $name="keyboard-driven-input" tiddler=<<newTagNameTiddler>> storeTitle=<<storeTitle>> refreshTitle=<<refreshTitle>>
|
>
|
||||||
selectionStateTitle=<<tagSelectionState>> inputAcceptActions="<$macrocall $name='add-tag-actions' actions=<<__actions__>> tagField=<<__tagField__>>/>"
|
<$vars
|
||||||
inputCancelActions=<<clear-tags-actions>> tag="input" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
|
storeTitle={{{ [<newTagNameInputTiddler>!match[]] ~[<newTagNameInputTiddlerQualified>] }}}
|
||||||
focusPopup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-edit-texteditor tc-popup-handle" tabindex=<<tabIndex>>
|
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}
|
||||||
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}} filterMinLength={{$:/config/Tags/MinLength}}
|
>
|
||||||
cancelPopups=<<cancelPopups>> configTiddlerFilter="[[$:/core/macros/tag-picker]]"/>
|
<$vars
|
||||||
</span><$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$reveal state=<<storeTitle>> type="nomatch" text=""><$button class="tc-btn-invisible tc-small-gap tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}} aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}>{{$:/core/images/close-button}}<<delete-tag-state-tiddlers>></$button></$reveal><span class="tc-add-tag-button tc-small-gap-left">
|
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
|
||||||
<$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}>
|
nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]"
|
||||||
<$button set=<<newTagNameTiddler>> setTo="" class="">
|
systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]"
|
||||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
>
|
||||||
$actions$
|
<div class="tc-edit-add-tag">
|
||||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
<div>
|
||||||
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
|
<span class="tc-add-tag-name tc-small-gap-right">
|
||||||
</$set>
|
<$macrocall
|
||||||
{{$:/language/EditTemplate/Tags/Add/Button}}
|
$name="keyboard-driven-input"
|
||||||
</$button>
|
tiddler=<<newTagNameTiddler>>
|
||||||
</$set>
|
storeTitle=<<storeTitle>>
|
||||||
</span>
|
refreshTitle=<<refreshTitle>>
|
||||||
</div>
|
selectionStateTitle=<<tagSelectionState>>
|
||||||
<div class="tc-block-dropdown-wrapper">
|
inputAcceptActions="<$macrocall $name='add-tag-actions' actions=<<__actions__>> tagField=<<__tagField__>>/>"
|
||||||
<$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
|
inputCancelActions=<<clear-tags-actions>>
|
||||||
<div class="tc-block-dropdown tc-block-tags-dropdown">
|
tag="input"
|
||||||
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
|
||||||
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
focusPopup=<<qualify "$:/state/popup/tags-auto-complete">>
|
||||||
<$list filter=<<nonSystemTagsFilter>> variable="tag">
|
class="tc-edit-texteditor tc-popup-handle"
|
||||||
<$list filter="[<tag>addsuffix[-primaryList]] -[<tagSelectionState>get[text]]" emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>">
|
tabindex=<<tabIndex>>
|
||||||
<$vars button-classes="tc-btn-invisible" actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>
|
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
|
||||||
</$list>
|
filterMinLength={{$:/config/Tags/MinLength}}
|
||||||
</$list></$list>
|
cancelPopups=<<cancelPopups>>
|
||||||
<hr>
|
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
|
||||||
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
/>
|
||||||
<$list filter=<<systemTagsFilter>> variable="tag">
|
</span>
|
||||||
<$list filter="[<tag>addsuffix[-secondaryList]] -[<tagSelectionState>get[text]]" emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>">
|
<$button popup=<<qualify "$:/state/popup/tags-auto-complete">>
|
||||||
<$vars button-classes="tc-btn-invisible" actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>
|
class="tc-btn-invisible tc-btn-dropdown"
|
||||||
</$list>
|
tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}}
|
||||||
</$list></$list>
|
aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}
|
||||||
</$set>
|
>
|
||||||
</div>
|
{{$:/core/images/down-arrow}}
|
||||||
</$reveal>
|
</$button>
|
||||||
</div>
|
<$reveal state=<<storeTitle>> type="nomatch" text="">
|
||||||
</div>
|
<$button class="tc-btn-invisible tc-small-gap tc-btn-dropdown"
|
||||||
</$vars>
|
tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}}
|
||||||
</$vars>
|
aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}
|
||||||
|
>
|
||||||
|
{{$:/core/images/close-button}}<<delete-tag-state-tiddlers>>
|
||||||
|
</$button>
|
||||||
|
</$reveal>
|
||||||
|
<span class="tc-add-tag-button tc-small-gap-left">
|
||||||
|
<$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}>
|
||||||
|
<$button set=<<newTagNameTiddler>> setTo="" class="">
|
||||||
|
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||||
|
$actions$
|
||||||
|
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||||
|
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
|
||||||
|
</$set>
|
||||||
|
{{$:/language/EditTemplate/Tags/Add/Button}}
|
||||||
|
</$button>
|
||||||
|
</$set>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="tc-block-dropdown-wrapper">
|
||||||
|
<$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
|
||||||
|
<div class="tc-block-dropdown tc-block-tags-dropdown">
|
||||||
|
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
||||||
|
<$list
|
||||||
|
filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]"
|
||||||
|
emptyMessage="<div class='tc-search-results'
|
||||||
|
>
|
||||||
|
{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
||||||
|
<$list filter=<<nonSystemTagsFilter>> variable="tag">
|
||||||
|
<$list
|
||||||
|
filter="[<tag>addsuffix[-primaryList]] -[<tagSelectionState>get[text]]"
|
||||||
|
emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>"
|
||||||
|
>
|
||||||
|
<$vars button-classes="tc-btn-invisible"
|
||||||
|
actions=<<__actions__>>
|
||||||
|
tagField=<<__tagField__>>
|
||||||
|
currentTiddler=<<tag>>
|
||||||
|
>
|
||||||
|
{{||$:/core/ui/TagPickerTagTemplate}}
|
||||||
|
</$vars>
|
||||||
|
</$list>
|
||||||
|
</$list>
|
||||||
|
</$list>
|
||||||
|
<hr>
|
||||||
|
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>
|
||||||
|
{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
||||||
|
<$list filter=<<systemTagsFilter>> variable="tag">
|
||||||
|
<$list filter="[<tag>addsuffix[-secondaryList]] -[<tagSelectionState>get[text]]"
|
||||||
|
emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>"
|
||||||
|
>
|
||||||
|
<$vars button-classes="tc-btn-invisible"
|
||||||
|
actions=<<__actions__>>
|
||||||
|
tagField=<<__tagField__>>
|
||||||
|
currentTiddler=<<tag>>
|
||||||
|
>
|
||||||
|
{{||$:/core/ui/TagPickerTagTemplate}}
|
||||||
|
</$vars>
|
||||||
|
</$list>
|
||||||
|
</$list>
|
||||||
|
</$list>
|
||||||
|
</$set>
|
||||||
|
</div>
|
||||||
|
</$reveal>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</$vars>
|
||||||
|
</$vars>
|
||||||
</$vars>
|
</$vars>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define tag-picker(actions,tagField:"tags")
|
\define tag-picker(actions,tagField:"tags")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$vars saveTiddler=<<currentTiddler>> palette={{$:/palette}}>
|
<$vars saveTiddler=<<currentTiddler>> palette={{$:/palette}}>
|
||||||
<$list filter="[<newTagNameTiddler>match[]]" emptyMessage="<$macrocall $name='tag-picker-inner' actions=<<__actions__>> tagField=<<__tagField__>>/>">
|
<$list
|
||||||
<$set name="newTagNameTiddler" value=<<qualify "$:/temp/NewTagName">>>
|
filter="[<newTagNameTiddler>match[]]"
|
||||||
<$macrocall $name="tag-picker-inner" actions=<<__actions__>> tagField=<<__tagField__>>/>
|
emptyMessage="<$macrocall $name='tag-picker-inner' actions=<<__actions__>> tagField=<<__tagField__>>/>"
|
||||||
</$set>
|
>
|
||||||
</$list>
|
<$set name="newTagNameTiddler" value=<<qualify "$:/temp/NewTagName">>>
|
||||||
|
<$macrocall $name="tag-picker-inner" actions=<<__actions__>> tagField=<<__tagField__>>/>
|
||||||
|
</$set>
|
||||||
|
</$list>
|
||||||
</$vars>
|
</$vars>
|
||||||
\end
|
\end
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ modified: 20141212110330815
|
|||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
title: $:/core/macros/timeline
|
title: $:/core/macros/timeline
|
||||||
|
|
||||||
\define timeline-title()
|
<!-- Override one or both of the following two macros with a global or local macro of the same name
|
||||||
\whitespace trim
|
if you need to change how titles are displayed on a timeline -->
|
||||||
<!-- Override this macro with a global macro
|
|
||||||
of the same name if you need to change
|
\define timeline-title() <$view field="title"/>
|
||||||
how titles are displayed on the timeline
|
\define timeline-link() <$link to={{!!title}}><<timeline-title>></$link>
|
||||||
-->
|
|
||||||
<$view field="title"/>
|
|
||||||
\end
|
|
||||||
\define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified")
|
\define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-timeline">
|
<div class="tc-timeline">
|
||||||
@@ -19,7 +16,7 @@ title: $:/core/macros/timeline
|
|||||||
<$view field="$dateField$" format="date" template="$format$"/>
|
<$view field="$dateField$" format="date" template="$format$"/>
|
||||||
<$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]">
|
<$list filter="[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]">
|
||||||
<div class="tc-menu-list-subitem">
|
<div class="tc-menu-list-subitem">
|
||||||
<$link to={{!!title}}><<timeline-title>></$link>
|
<<timeline-link>>
|
||||||
</div>
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
title: $:/core/macros/toc
|
title: $:/core/macros/toc
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
|
|
||||||
|
\define toc-open-icon() $:/core/images/down-arrow
|
||||||
|
\define toc-closed-icon() $:/core/images/right-arrow
|
||||||
|
|
||||||
\define toc-caption()
|
\define toc-caption()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<span class="tc-toc-caption tc-tiny-gap-left">
|
<span class="tc-toc-caption">
|
||||||
<$set name="tv-wikilinks" value="no">
|
<$set name="tv-wikilinks" value="no">
|
||||||
<$transclude field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
@@ -20,7 +24,7 @@ tags: $:/tags/Macro
|
|||||||
<$set name="excluded" filter="""[enlist<__exclude__>] [<__tag__>]""">
|
<$set name="excluded" filter="""[enlist<__exclude__>] [<__tag__>]""">
|
||||||
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
||||||
<li class=<<toc-item-class>>>
|
<li class=<<toc-item-class>>>
|
||||||
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}><$view field='caption'><$view field='title'/></$view></$link>">
|
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}><<toc-caption>></$link>">
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$list>
|
</$list>
|
||||||
<$macrocall $name="toc-body" tag=<<item>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
|
<$macrocall $name="toc-body" tag=<<item>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
|
||||||
@@ -45,12 +49,12 @@ tags: $:/tags/Macro
|
|||||||
<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}>
|
<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}>
|
||||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/right-arrow}}
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/down-arrow}}
|
<$transclude tiddler=<<toc-open-icon>> />
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
@@ -71,13 +75,13 @@ tags: $:/tags/Macro
|
|||||||
<li class=<<toc-item-class>>>
|
<li class=<<toc-item-class>>>
|
||||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/right-arrow}}
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/down-arrow}}
|
<$transclude tiddler=<<toc-open-icon>> />
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
@@ -117,12 +121,12 @@ tags: $:/tags/Macro
|
|||||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
|
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
|
||||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/right-arrow}}
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/down-arrow}}
|
<$transclude tiddler=<<toc-open-icon>> />
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
@@ -144,13 +148,13 @@ tags: $:/tags/Macro
|
|||||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
|
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
|
||||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/right-arrow}}
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
||||||
{{$:/core/images/down-arrow}}
|
<$transclude tiddler=<<toc-open-icon>> />
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
title: $:/tags/PageControls
|
title: $:/tags/PageControls
|
||||||
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]
|
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/layout]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
title: HelloThere
|
title: HelloThere
|
||||||
|
|
||||||
This is a demo of TiddlyWiki5 incorporating a plugin for the [[D3.js]] visualization library.
|
This is a demo of TiddlyWiki5 incorporating a plugin for the [[D3.js]] visualisation library.
|
||||||
|
|
||||||
! Word Cloud
|
! Word Cloud
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
"tiddlywiki/snowwhite"
|
"tiddlywiki/snowwhite"
|
||||||
],
|
],
|
||||||
"languages": [
|
"languages": [
|
||||||
"en-GB",
|
|
||||||
"de-AT",
|
"de-AT",
|
||||||
"de-DE"
|
"de-DE"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
"tiddlywiki/internals"
|
"tiddlywiki/internals"
|
||||||
],
|
],
|
||||||
"languages": [
|
"languages": [
|
||||||
"en-GB",
|
|
||||||
"de-AT",
|
"de-AT",
|
||||||
"de-DE"
|
"de-DE"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"description": "Deutsche Basis Edition",
|
"description": "Deutsche Basis Edition",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"tiddlywiki/browser-sniff"],
|
"tiddlywiki/browser-sniff",
|
||||||
|
"tiddlywiki/internals"
|
||||||
|
],
|
||||||
"themes": [
|
"themes": [
|
||||||
"tiddlywiki/vanilla",
|
"tiddlywiki/vanilla",
|
||||||
"tiddlywiki/snowwhite",
|
"tiddlywiki/snowwhite",
|
||||||
@@ -9,11 +11,9 @@
|
|||||||
"tiddlywiki/seamless",
|
"tiddlywiki/seamless",
|
||||||
"tiddlywiki/centralised",
|
"tiddlywiki/centralised",
|
||||||
"tiddlywiki/tight",
|
"tiddlywiki/tight",
|
||||||
"tiddlywiki/readonly",
|
"tiddlywiki/readonly"
|
||||||
"tiddlywiki/internals"
|
|
||||||
],
|
],
|
||||||
"languages": [
|
"languages": [
|
||||||
"en-GB",
|
|
||||||
"de-AT",
|
"de-AT",
|
||||||
"de-DE"
|
"de-DE"
|
||||||
],
|
],
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user