mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-22 19:04:38 +00:00
Compare commits
559 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e7065c391 | ||
|
|
a869316b1f | ||
|
|
c24598885a | ||
|
|
3bf9ad78fa | ||
|
|
5bba45bb0a | ||
|
|
8b2f320f7f | ||
|
|
d240ab5003 | ||
|
|
f1deea3b74 | ||
|
|
def26a40ac | ||
|
|
0b4ce5be28 | ||
|
|
ac345c86a1 | ||
|
|
94107dc64c | ||
|
|
6613cc7b2c | ||
|
|
4a5b531f78 | ||
|
|
10df62b24f | ||
|
|
2d9d09adcc | ||
|
|
3d19b585ae | ||
|
|
e47f06bd5e | ||
|
|
6b68d9b0c4 | ||
|
|
5109e96cec | ||
|
|
334497ce4e | ||
|
|
c1763193df | ||
|
|
e1912b624b | ||
|
|
e71bff0110 | ||
|
|
74e8afdcdd | ||
|
|
01f8b954ae | ||
|
|
a1079270a2 | ||
|
|
64efee40e5 | ||
|
|
0747635fba | ||
|
|
822bd1f3cc | ||
|
|
877aed3ead | ||
|
|
7ee985407b | ||
|
|
5a543276f5 | ||
|
|
677e100ea2 | ||
|
|
e0c84ee85d | ||
|
|
b873df0ba2 | ||
|
|
3fa5ba52f9 | ||
|
|
366cdb608d | ||
|
|
20983c0174 | ||
|
|
d917198abb | ||
|
|
cd36ad582b | ||
|
|
83c54f4bb5 | ||
|
|
fcfddf2b46 | ||
|
|
152c3db9a1 | ||
|
|
0cbe97615a | ||
|
|
93f7d8c028 | ||
|
|
31b4f104e4 | ||
|
|
540354a693 | ||
|
|
2cd812c15f | ||
|
|
b2fd3366e3 | ||
|
|
114f4dbcea | ||
|
|
791f97983e | ||
|
|
1cb8247063 | ||
|
|
0240a8048f | ||
|
|
45092d289e | ||
|
|
5cc1f2b313 | ||
|
|
665d6657bb | ||
|
|
f8723397e9 | ||
|
|
fa3ea480fe | ||
|
|
ac8b706d42 | ||
|
|
658ccadca7 | ||
|
|
f42acfa73e | ||
|
|
f2591761b0 | ||
|
|
56ff0027e0 | ||
|
|
49c6a172ad | ||
|
|
bd9cd10de1 | ||
|
|
040e35eab6 | ||
|
|
e3f381ed8d | ||
|
|
2a26ca53c2 | ||
|
|
747eb9daba | ||
|
|
7fbe29fd04 | ||
|
|
a44edee782 | ||
|
|
471f28e52b | ||
|
|
91b970e422 | ||
|
|
48987e186a | ||
|
|
2f51c3695d | ||
|
|
0d27f3b836 | ||
|
|
8e02390353 | ||
|
|
2fe2c531e8 | ||
|
|
62e6d3a99c | ||
|
|
fe00229ad5 | ||
|
|
456e7abc5d | ||
|
|
3a426dfd2a | ||
|
|
e344dbe077 | ||
|
|
44bf4310d2 | ||
|
|
dcc53b8e96 | ||
|
|
075f5b757f | ||
|
|
3e1128787a | ||
|
|
68c633c9bb | ||
|
|
08fed4840f | ||
|
|
f4f86e3c23 | ||
|
|
b1bc75d4eb | ||
|
|
2da1af2a41 | ||
|
|
07c1af106b | ||
|
|
7ef60ded52 | ||
|
|
b7c2063f63 | ||
|
|
c2dea12f1c | ||
|
|
d7f24a5779 | ||
|
|
61235a12fb | ||
|
|
b905874c06 | ||
|
|
03519c14b0 | ||
|
|
15eab0ce1c | ||
|
|
5be0de798f | ||
|
|
7676f93932 | ||
|
|
3dc001620c | ||
|
|
a94ba99ec2 | ||
|
|
55f053ec89 | ||
|
|
57ceffd67c | ||
|
|
7037b66479 | ||
|
|
aa06f4ea8c | ||
|
|
ccf6edb940 | ||
|
|
fa1814d0f4 | ||
|
|
44dfbec3cf | ||
|
|
3959b1b89e | ||
|
|
ef1cd5f55f | ||
|
|
de99dd5196 | ||
|
|
a34ac01d63 | ||
|
|
07ac75b084 | ||
|
|
ad1793c8f5 | ||
|
|
64b916bb43 | ||
|
|
231d0a3dc8 | ||
|
|
aaf3e6bb9e | ||
|
|
b0dce4f8e4 | ||
|
|
9468e50146 | ||
|
|
6e7f532825 | ||
|
|
ea8a8f1b53 | ||
|
|
c2105de49c | ||
|
|
da36f1c728 | ||
|
|
4a8511c6f2 | ||
|
|
aae1bf9f80 | ||
|
|
4e0a5c862c | ||
|
|
6c89b27328 | ||
|
|
cd6b443533 | ||
|
|
7dbb4240f1 | ||
|
|
d0c33ec3d2 | ||
|
|
8d2bdaa338 | ||
|
|
8501847942 | ||
|
|
9e03252e01 | ||
|
|
05f0bea61f | ||
|
|
1aa4cb5f55 | ||
|
|
d48deefa91 | ||
|
|
4a2fc8cbc0 | ||
|
|
65f891dcdf | ||
|
|
b0c9dcf353 | ||
|
|
e209254bc6 | ||
|
|
8c2ecca7e6 | ||
|
|
98b6a45044 | ||
|
|
6eba06e23e | ||
|
|
b4994f2e77 | ||
|
|
d90828d14e | ||
|
|
848e351685 | ||
|
|
15f52bd7ce | ||
|
|
d94ffbae39 | ||
|
|
d7623b6985 | ||
|
|
8ccee5d015 | ||
|
|
35ce8c8b55 | ||
|
|
f540be4ac4 | ||
|
|
065b274b98 | ||
|
|
46a3b2f261 | ||
|
|
1569090046 | ||
|
|
75380c56cc | ||
|
|
c535dd605c | ||
|
|
3a33282705 | ||
|
|
ef3e44eb48 | ||
|
|
b152a0a894 | ||
|
|
ac00aa8407 | ||
|
|
d3586c7bf1 | ||
|
|
f08c2c8a60 | ||
|
|
5877a26855 | ||
|
|
8980e491c4 | ||
|
|
085ebd4e23 | ||
|
|
7ba2649194 | ||
|
|
85895374ea | ||
|
|
34e0bf13f2 | ||
|
|
12431a9fbc | ||
|
|
91c87ec2ac | ||
|
|
0c78c63fae | ||
|
|
617c13d196 | ||
|
|
008f22b511 | ||
|
|
cb6b8233fa | ||
|
|
cab0900ddd | ||
|
|
72889a0527 | ||
|
|
ec2d819c8c | ||
|
|
88a5c742e7 | ||
|
|
1358cd5185 | ||
|
|
18a0f6b12d | ||
|
|
b1cfc8633f | ||
|
|
abdd1e7fd6 | ||
|
|
b2edbd8d1d | ||
|
|
31b9835a4e | ||
|
|
e9c79faf05 | ||
|
|
d87c328fd9 | ||
|
|
2adb005c28 | ||
|
|
fad106d2d5 | ||
|
|
7370d61602 | ||
|
|
ac9aa78859 | ||
|
|
befb13dde1 | ||
|
|
3b64497c57 | ||
|
|
faee511d20 | ||
|
|
171fd2c853 | ||
|
|
99969024f8 | ||
|
|
0b99ac2b75 | ||
|
|
583ed07af2 | ||
|
|
0769b90bb7 | ||
|
|
bc0cbf9070 | ||
|
|
d0ca776edb | ||
|
|
f217451fc5 | ||
|
|
eb34709cc4 | ||
|
|
d59d9238f7 | ||
|
|
513ed8774c | ||
|
|
7307c32dd2 | ||
|
|
03383ad1ae | ||
|
|
837a96e569 | ||
|
|
4dadbe5ba8 | ||
|
|
eb25fdc472 | ||
|
|
41480968ac | ||
|
|
817882a404 | ||
|
|
d3ab4144d4 | ||
|
|
52e0524fbf | ||
|
|
e55c5b0669 | ||
|
|
106f11343e | ||
|
|
9d7a850e83 | ||
|
|
89bd088a75 | ||
|
|
bcb49b64f6 | ||
|
|
41287d7859 | ||
|
|
72cd6a5802 | ||
|
|
c0de553370 | ||
|
|
f593bae2b2 | ||
|
|
a6fe696269 | ||
|
|
e6963cbccd | ||
|
|
5d61dfb1d7 | ||
|
|
7ecaba9a65 | ||
|
|
0996f06a32 | ||
|
|
7040d483f2 | ||
|
|
7cd81efa37 | ||
|
|
612a2707c6 | ||
|
|
3e1c6c1972 | ||
|
|
36f0a50ec1 | ||
|
|
0d6450cfb5 | ||
|
|
717e9ae913 | ||
|
|
ba15086381 | ||
|
|
52022691f9 | ||
|
|
a089fb94a6 | ||
|
|
3e445b8853 | ||
|
|
7492086f31 | ||
|
|
5232d5a0a7 | ||
|
|
9f954ce55d | ||
|
|
56d467fb47 | ||
|
|
49894abaf4 | ||
|
|
a0468a5e6c | ||
|
|
33bca3d390 | ||
|
|
4347d91c57 | ||
|
|
2fee131aa4 | ||
|
|
d7f1f973a9 | ||
|
|
8e68f904f1 | ||
|
|
95f98d36d9 | ||
|
|
0a220a09da | ||
|
|
26d0029746 | ||
|
|
b1633e0f2d | ||
|
|
0703a257f3 | ||
|
|
7609bcdf0e | ||
|
|
fe1b318987 | ||
|
|
e31abf89ac | ||
|
|
33563d01ba | ||
|
|
093f507319 | ||
|
|
9f6fea7607 | ||
|
|
85553609b1 | ||
|
|
acc44c6f67 | ||
|
|
00f6aafed6 | ||
|
|
9a23c2471c | ||
|
|
5d36e17c18 | ||
|
|
98983c4072 | ||
|
|
69b4f174c3 | ||
|
|
2d9471fe3b | ||
|
|
ed1a306f88 | ||
|
|
e5cef9a5a6 | ||
|
|
51739e3fd2 | ||
|
|
4c95dc9bbb | ||
|
|
5faba15446 | ||
|
|
7e9f7afa94 | ||
|
|
6add992bf2 | ||
|
|
2acea55711 | ||
|
|
26114eb3ff | ||
|
|
b34e4f628d | ||
|
|
71968e0973 | ||
|
|
843f18dc7e | ||
|
|
8b74706e35 | ||
|
|
32c41479cc | ||
|
|
95eb8810b6 | ||
|
|
91b5547cdf | ||
|
|
d0a24bd9f0 | ||
|
|
4788725ccf | ||
|
|
f684a6beb0 | ||
|
|
a88ead9c0f | ||
|
|
c3cbbc3f66 | ||
|
|
f9464dfaf8 | ||
|
|
baca2703f1 | ||
|
|
a42dff1a41 | ||
|
|
3853a76c9a | ||
|
|
8a763e9d83 | ||
|
|
acbf87657b | ||
|
|
79972fe57f | ||
|
|
5163b541cf | ||
|
|
1e06824ed1 | ||
|
|
2803890baf | ||
|
|
0035a00463 | ||
|
|
6b3dd1bb63 | ||
|
|
5fafa0fb07 | ||
|
|
a30f9e1739 | ||
|
|
9db8a9326f | ||
|
|
2e1ad771d6 | ||
|
|
11b09be523 | ||
|
|
1b25962948 | ||
|
|
db2eaf56d4 | ||
|
|
2f8ae31377 | ||
|
|
6ef894f240 | ||
|
|
650a9a76df | ||
|
|
c3356e50e3 | ||
|
|
adb81f7eab | ||
|
|
4e281d51c4 | ||
|
|
a14eb78d76 | ||
|
|
3ab7db1a59 | ||
|
|
d806f1d0f1 | ||
|
|
b23d53e9b0 | ||
|
|
6598455e83 | ||
|
|
8d58e2d651 | ||
|
|
88c1a1e062 | ||
|
|
8f5ad753af | ||
|
|
c0c0b6653c | ||
|
|
99df9f46f7 | ||
|
|
814353d8ce | ||
|
|
7b8928886b | ||
|
|
6ac178323f | ||
|
|
72941f3e9a | ||
|
|
b30126ec22 | ||
|
|
ebb3a62d9a | ||
|
|
b27a41eb86 | ||
|
|
99c5fa46dd | ||
|
|
6107bbfd6e | ||
|
|
8c538af9df | ||
|
|
115c40dc4a | ||
|
|
6b1e6b7545 | ||
|
|
fd997c4581 | ||
|
|
1b2d54b4bf | ||
|
|
6b3fc8d538 | ||
|
|
57c40a8a56 | ||
|
|
a1ce254e95 | ||
|
|
90e0b6f555 | ||
|
|
6ee8c14d89 | ||
|
|
c03dc4c37c | ||
|
|
e6529af04e | ||
|
|
21175012dc | ||
|
|
cf00658ddf | ||
|
|
b641cb402d | ||
|
|
6309d41b42 | ||
|
|
268da52f8c | ||
|
|
dc020276b0 | ||
|
|
e2d63a03b2 | ||
|
|
1fef272388 | ||
|
|
7b8cb928cf | ||
|
|
bbc802e228 | ||
|
|
8e98102281 | ||
|
|
207406eeb3 | ||
|
|
f4d11cb471 | ||
|
|
a19f7454ca | ||
|
|
5dbaf187f1 | ||
|
|
746aab2cf6 | ||
|
|
803d70225a | ||
|
|
f917c4da1a | ||
|
|
d4bd253779 | ||
|
|
5ef0259ab2 | ||
|
|
f7cf62de57 | ||
|
|
6976e57af6 | ||
|
|
3c71c10da9 | ||
|
|
fb69a43325 | ||
|
|
7f93cea6d0 | ||
|
|
e19617a5ce | ||
|
|
e62778a50f | ||
|
|
3592a9560b | ||
|
|
c80db86b67 | ||
|
|
b379ab4f87 | ||
|
|
c20e5b47b6 | ||
|
|
939596bd47 | ||
|
|
eb9fb6635d | ||
|
|
35e84c41ed | ||
|
|
3a700c025d | ||
|
|
06ba6f62cb | ||
|
|
79132a1797 | ||
|
|
51d71f9858 | ||
|
|
470238acbf | ||
|
|
a25955d8c6 | ||
|
|
424b2fea32 | ||
|
|
0861e1bb3a | ||
|
|
8cf02fcb0f | ||
|
|
ecdae4ceff | ||
|
|
f405a89b28 | ||
|
|
026c84197f | ||
|
|
76c12a9ecc | ||
|
|
1d33f5ed48 | ||
|
|
2e0845b806 | ||
|
|
2c9b1ae257 | ||
|
|
1491ba71aa | ||
|
|
f0a655d8b2 | ||
|
|
4ea5dce284 | ||
|
|
34619481ad | ||
|
|
5dcb53abae | ||
|
|
ad6a6f3b75 | ||
|
|
5176f008f0 | ||
|
|
4ccdaf3faf | ||
|
|
c4244e8f04 | ||
|
|
1d30ee955c | ||
|
|
b4aa895cac | ||
|
|
17dc21b809 | ||
|
|
0be82ea7fb | ||
|
|
cc4bef9c0e | ||
|
|
ae80f9176d | ||
|
|
73f3244113 | ||
|
|
709126dd64 | ||
|
|
684fbb1ee8 | ||
|
|
faa32bc424 | ||
|
|
bc448ce1fd | ||
|
|
51d771a074 | ||
|
|
4d4181b048 | ||
|
|
4cac7b6784 | ||
|
|
0d55f2c46b | ||
|
|
3fbe07f1f8 | ||
|
|
68e15c1064 | ||
|
|
a204784c0c | ||
|
|
abd8201aaa | ||
|
|
97979e1fb1 | ||
|
|
46087fd270 | ||
|
|
f443719223 | ||
|
|
74bd6e8232 | ||
|
|
abcb2d3a1c | ||
|
|
2eb645e5e5 | ||
|
|
d3ca636a5b | ||
|
|
c06b3c4ef7 | ||
|
|
3cfad8b044 | ||
|
|
010b01f205 | ||
|
|
66b405ac81 | ||
|
|
4d5c14bca7 | ||
|
|
ac08dc2e35 | ||
|
|
4bcf1e298b | ||
|
|
4152fbbfeb | ||
|
|
16c69bb419 | ||
|
|
27ec05e521 | ||
|
|
0f32af1cce | ||
|
|
bad4a19f8e | ||
|
|
c91c7b7cbb | ||
|
|
ef87dd0687 | ||
|
|
5d43cd7408 | ||
|
|
6a3c4d6c91 | ||
|
|
318a1cf212 | ||
|
|
1022854900 | ||
|
|
be0ab28e89 | ||
|
|
fbe4bc18b9 | ||
|
|
7421616754 | ||
|
|
6c6b723a0d | ||
|
|
4f5cf4597a | ||
|
|
e27e49e00c | ||
|
|
cac6d3b4d9 | ||
|
|
d01d8539a6 | ||
|
|
e5cd8313a0 | ||
|
|
821617058d | ||
|
|
22563792c4 | ||
|
|
b1cf0fdd68 | ||
|
|
cbbe90313b | ||
|
|
fdce67399d | ||
|
|
d7263d8413 | ||
|
|
72ed4b2673 | ||
|
|
be0ebfeeae | ||
|
|
535d8d6fa0 | ||
|
|
dd1f82c1aa | ||
|
|
898e992694 | ||
|
|
2e5c500300 | ||
|
|
8b9e790e69 | ||
|
|
cc1acdaf74 | ||
|
|
b57feaa6a8 | ||
|
|
db20d8f812 | ||
|
|
9168480d18 | ||
|
|
bc0d8c7c65 | ||
|
|
c6c9abeb1b | ||
|
|
d2c14ba203 | ||
|
|
1e25de984b | ||
|
|
0691286092 | ||
|
|
9ec38eef32 | ||
|
|
d938c10144 | ||
|
|
c23e26be5f | ||
|
|
8444961cd2 | ||
|
|
e1cce60df3 | ||
|
|
a4d0210f90 | ||
|
|
cd29eed067 | ||
|
|
3b321b5d26 | ||
|
|
8488a13761 | ||
|
|
8f746f9dde | ||
|
|
7cc85e8162 | ||
|
|
f708b4df65 | ||
|
|
58188cf805 | ||
|
|
d5e690a06d | ||
|
|
9e1741a549 | ||
|
|
73210a7b8c | ||
|
|
273daa9613 | ||
|
|
6de92a0293 | ||
|
|
66bdb71c4a | ||
|
|
90b12676c4 | ||
|
|
e508b7b765 | ||
|
|
c25f7e786f | ||
|
|
92bfbc578c | ||
|
|
756ebae1f6 | ||
|
|
45bf43d8d0 | ||
|
|
ea10d85604 | ||
|
|
7e94fa8e84 | ||
|
|
3fbf29093b | ||
|
|
ecbd97b4b4 | ||
|
|
684d6e4377 | ||
|
|
8bb0a9b7c8 | ||
|
|
56ea55ddc4 | ||
|
|
dfc935b520 | ||
|
|
72cf85f0d4 | ||
|
|
69ae017f49 | ||
|
|
9b6151c6c4 | ||
|
|
f8027a3708 | ||
|
|
18e38bb2bc | ||
|
|
2cb6400773 | ||
|
|
396af28d16 | ||
|
|
e0aacc84d5 | ||
|
|
7ae5eab3a8 | ||
|
|
c2342fce7a | ||
|
|
32f6d7f1b0 | ||
|
|
0e75497d58 | ||
|
|
0c276c327b | ||
|
|
4cfb6813f5 | ||
|
|
d327d6fbed | ||
|
|
fad9fd13b5 | ||
|
|
82fac2599d | ||
|
|
862e358b57 | ||
|
|
7dddc925ae | ||
|
|
8f63e2a959 | ||
|
|
8bfc6f3557 | ||
|
|
5be980c64e | ||
|
|
5924616ee9 | ||
|
|
caeb736c2b | ||
|
|
a75cfefe88 | ||
|
|
203bc4b242 | ||
|
|
48d452c535 | ||
|
|
848a7f4e74 | ||
|
|
c6e48ebc2d | ||
|
|
a86cfe2663 | ||
|
|
31fc9babfe | ||
|
|
c4397792f5 | ||
|
|
4b2cf2eeee | ||
|
|
b0cb17cd83 | ||
|
|
c1005b9d12 | ||
|
|
9d17127144 | ||
|
|
a1e5000984 | ||
|
|
a58dc869bd | ||
|
|
f1ae41da9a | ||
|
|
56403a21bf | ||
|
|
a37ba2afbe |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
.c9/
|
||||
tmp/
|
||||
output/
|
||||
node_modules/
|
||||
|
||||
@@ -5,3 +5,4 @@ plugins/tiddlywiki/highlight/files/
|
||||
plugins/tiddlywiki/jasmine/files/
|
||||
plugins/tiddlywiki/markdown/files/
|
||||
plugins/tiddlywiki/markdown/files/
|
||||
node_modules/
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
.c9/
|
||||
tmp/
|
||||
output/
|
||||
node_modules/
|
||||
|
||||
5
bin/clean.sh
Executable file
5
bin/clean.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove any output files
|
||||
|
||||
find . -regex "^./editions/[a-z0-9\.-]*/output/.*" -delete
|
||||
108
boot/boot.js
108
boot/boot.js
@@ -62,22 +62,22 @@ $tw.utils.isDate = function(value) {
|
||||
Iterate through all the own properties of an object or array. Callback is invoked with (element,title,object)
|
||||
*/
|
||||
$tw.utils.each = function(object,callback) {
|
||||
var next,f;
|
||||
var next,f,length;
|
||||
if(object) {
|
||||
if(Object.prototype.toString.call(object) == "[object Array]") {
|
||||
for (f=0; f<object.length; f++) {
|
||||
for (f=0, length=object.length; f<length; f++) {
|
||||
next = callback(object[f],f,object);
|
||||
if(next === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(f in object) {
|
||||
if(Object.prototype.hasOwnProperty.call(object,f)) {
|
||||
next = callback(object[f],f,object);
|
||||
if(next === false) {
|
||||
break;
|
||||
}
|
||||
var keys = Object.keys(object);
|
||||
for (f=0, length=keys.length; f<length; f++) {
|
||||
var key = keys[f];
|
||||
next = callback(object[key],key,object);
|
||||
if(next === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,8 +126,8 @@ Display an error and exit
|
||||
*/
|
||||
$tw.utils.error = function(err) {
|
||||
// Prepare the error message
|
||||
var errHeading = "Internal JavaScript Error",
|
||||
promptMsg = "Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser";
|
||||
var errHeading = ( $tw.language == undefined ? "Internal JavaScript Error" : $tw.language.getString("InternalJavaScriptError/Title") ),
|
||||
promptMsg = ( $tw.language == undefined ? "Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser" : $tw.language.getString("InternalJavaScriptError/Hint") );
|
||||
// Log the error to the console
|
||||
console.error($tw.node ? "\x1b[1;31m" + err + "\x1b[0m" : err);
|
||||
if($tw.browser && !$tw.node) {
|
||||
@@ -590,7 +590,7 @@ Crypto helper object for encrypted content. It maintains the password text in a
|
||||
the password, and to encrypt/decrypt a block of text
|
||||
*/
|
||||
$tw.utils.Crypto = function() {
|
||||
var sjcl = $tw.node ? require("./sjcl.js") : window.sjcl,
|
||||
var sjcl = $tw.node ? (global.sjcl || require("./sjcl.js")) : window.sjcl,
|
||||
currentPassword = null,
|
||||
callSjcl = function(method,inputText,password) {
|
||||
password = password || currentPassword;
|
||||
@@ -885,10 +885,12 @@ $tw.Wiki = function(options) {
|
||||
this.deleteTiddler = function(title) {
|
||||
// Uncomment the following line for detailed logs of all tiddler deletions
|
||||
// console.log("Deleting",title,tiddler)
|
||||
delete tiddlers[title];
|
||||
this.clearCache(title);
|
||||
this.clearGlobalCache();
|
||||
this.enqueueTiddlerEvent(title,true);
|
||||
if($tw.utils.hop(tiddlers,title)) {
|
||||
delete tiddlers[title];
|
||||
this.clearCache(title);
|
||||
this.clearGlobalCache();
|
||||
this.enqueueTiddlerEvent(title,true);
|
||||
}
|
||||
};
|
||||
|
||||
// Get a tiddler from the store
|
||||
@@ -910,7 +912,10 @@ $tw.Wiki = function(options) {
|
||||
|
||||
// Iterate through all tiddler titles
|
||||
this.each = function(callback) {
|
||||
for(var title in tiddlers) {
|
||||
var titles = Object.keys(tiddlers),
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
callback(tiddlers[title],title);
|
||||
}
|
||||
};
|
||||
@@ -922,7 +927,10 @@ $tw.Wiki = function(options) {
|
||||
|
||||
// Iterate through all shadow tiddler titles
|
||||
this.eachShadow = function(callback) {
|
||||
for(var title in shadowTiddlers) {
|
||||
var titles = Object.keys(shadowTiddlers),
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
var shadowInfo = shadowTiddlers[title];
|
||||
callback(shadowInfo.tiddler,title);
|
||||
}
|
||||
@@ -930,10 +938,15 @@ $tw.Wiki = function(options) {
|
||||
|
||||
// Iterate through all tiddlers and then the shadows
|
||||
this.eachTiddlerPlusShadows = function(callback) {
|
||||
for(var title in tiddlers) {
|
||||
var titles = Object.keys(tiddlers),
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
callback(tiddlers[title],title);
|
||||
}
|
||||
for(var title in shadowTiddlers) {
|
||||
titles = Object.keys(shadowTiddlers);
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(!Object.prototype.hasOwnProperty.call(tiddlers,title)) {
|
||||
var shadowInfo = shadowTiddlers[title];
|
||||
callback(shadowInfo.tiddler,title);
|
||||
@@ -943,7 +956,10 @@ $tw.Wiki = function(options) {
|
||||
|
||||
// Iterate through all the shadows and then the tiddlers
|
||||
this.eachShadowPlusTiddlers = function(callback) {
|
||||
for(var title in shadowTiddlers) {
|
||||
var titles = Object.keys(shadowTiddlers),
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(Object.prototype.hasOwnProperty.call(tiddlers,title)) {
|
||||
callback(tiddlers[title],title);
|
||||
} else {
|
||||
@@ -951,7 +967,9 @@ $tw.Wiki = function(options) {
|
||||
callback(shadowInfo.tiddler,title);
|
||||
}
|
||||
}
|
||||
for(var title in tiddlers) {
|
||||
titles = Object.keys(tiddlers);
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(!Object.prototype.hasOwnProperty.call(shadowTiddlers,title)) {
|
||||
callback(tiddlers[title],title);
|
||||
}
|
||||
@@ -1067,6 +1085,8 @@ $tw.Wiki = function(options) {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.clearCache(null);
|
||||
this.clearGlobalCache();
|
||||
};
|
||||
|
||||
};
|
||||
@@ -1379,10 +1399,6 @@ $tw.loadTiddlersBrowser = function() {
|
||||
for(var t=0; t<containerIds.length; t++) {
|
||||
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById(containerIds[t])));
|
||||
}
|
||||
// Load any preloaded tiddlers
|
||||
if($tw.preloadTiddlers) {
|
||||
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
@@ -1445,22 +1461,41 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
||||
if(files.indexOf("tiddlywiki.files") !== -1) {
|
||||
// If so, process the files it describes
|
||||
var filesInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "tiddlywiki.files","utf8"));
|
||||
// First the tiddlers
|
||||
$tw.utils.each(filesInfo.tiddlers,function(tidInfo) {
|
||||
var type = tidInfo.fields.type || "text/plain",
|
||||
typeInfo = $tw.config.contentTypeInfo[type],
|
||||
pathname = path.resolve(filepath,tidInfo.file),
|
||||
text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8"),
|
||||
fileTiddlers = $tw.wiki.deserializeTiddlers(path.extname(pathname),text) || [];
|
||||
$tw.utils.each(fileTiddlers,function(tiddler) {
|
||||
$tw.utils.extend(tiddler,tidInfo.fields);
|
||||
text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8");
|
||||
if(tidInfo.isTiddlerFile) {
|
||||
var fileTiddlers = $tw.wiki.deserializeTiddlers(path.extname(pathname),text) || [];
|
||||
$tw.utils.each(fileTiddlers,function(tiddler) {
|
||||
$tw.utils.extend(tiddler,tidInfo.fields);
|
||||
if(tidInfo.prefix) {
|
||||
tiddler.text = tidInfo.prefix + tiddler.text;
|
||||
}
|
||||
if(tidInfo.suffix) {
|
||||
tiddler.text = tiddler.text + tidInfo.suffix;
|
||||
}
|
||||
});
|
||||
tiddlers.push({tiddlers: fileTiddlers});
|
||||
} else {
|
||||
if(tidInfo.prefix) {
|
||||
tiddler.text = tidInfo.prefix + tiddler.text;
|
||||
text = tidInfo.prefix + text;
|
||||
}
|
||||
if(tidInfo.suffix) {
|
||||
tiddler.text = tiddler.text + tidInfo.suffix;
|
||||
text = text + tidInfo.suffix;
|
||||
}
|
||||
});
|
||||
tiddlers.push({tiddlers: fileTiddlers});
|
||||
tidInfo.fields.text = text;
|
||||
tiddlers.push({tiddlers: [tidInfo.fields]});
|
||||
}
|
||||
});
|
||||
// Then any recursive directories
|
||||
$tw.utils.each(filesInfo.directories,function(dirPath) {
|
||||
var pathname = path.resolve(filepath,dirPath);
|
||||
if(fs.existsSync(pathname) && fs.statSync(pathname).isDirectory()) {
|
||||
tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(pathname,excludeRegExp));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// If not, read all the files in the directory
|
||||
@@ -1769,7 +1804,7 @@ $tw.boot.startup = function(options) {
|
||||
$tw.boot.wikiPath = process.cwd();
|
||||
}
|
||||
// Read package info
|
||||
$tw.packageInfo = require("../package.json");
|
||||
$tw.packageInfo = $tw.packageInfo || require("../package.json");
|
||||
// Check node version number
|
||||
if(!$tw.utils.checkVersions(process.version.substr(1),$tw.packageInfo.engines.node.substr(2))) {
|
||||
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
||||
@@ -1796,6 +1831,7 @@ $tw.boot.startup = function(options) {
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
|
||||
$tw.utils.registerFileType("application/font-woff","base64",".woff");
|
||||
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
|
||||
$tw.utils.registerFileType("video/mp4","base64",".mp4");
|
||||
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
|
||||
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
||||
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
||||
@@ -1826,6 +1862,10 @@ $tw.boot.startup = function(options) {
|
||||
} else {
|
||||
$tw.loadTiddlersNode();
|
||||
}
|
||||
// Load any preloaded tiddlers
|
||||
if($tw.preloadTiddlers) {
|
||||
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
||||
}
|
||||
// Unpack plugin tiddlers
|
||||
$tw.wiki.readPluginInfo();
|
||||
$tw.wiki.registerPluginTiddlers("plugin",$tw.safeMode ? ["$:/core"] : undefined);
|
||||
|
||||
@@ -99,7 +99,14 @@ $tw.preloadTiddler = function(fields) {
|
||||
$tw.preloadTiddlers.push(fields);
|
||||
};
|
||||
|
||||
return $tw
|
||||
/*
|
||||
Convenience function for pushing an array of tiddlers onto the preloading array
|
||||
*/
|
||||
$tw.preloadTiddlerArray = function(fieldsArray) {
|
||||
$tw.preloadTiddlers.push.apply($tw.preloadTiddlers,fieldsArray);
|
||||
};
|
||||
|
||||
return $tw;
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ type: text/plain
|
||||
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
|
||||
|
||||
Copyright © Jeremy Ruston 2004-2007
|
||||
Copyright © UnaMesa Association 2007-2015
|
||||
Copyright © UnaMesa Association 2007-2016
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
14
core/images/file.tid
Normal file
14
core/images/file.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/core/images/file
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-file tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="nonzero">
|
||||
<path d="M111.96811,30.5 L112,30.5 L112,119.999079 C112,124.417866 108.419113,128 104.000754,128 L23.9992458,128 C19.5813843,128 16,124.417687 16,119.999079 L16,8.00092105 C16,3.58213437 19.5808867,0 23.9992458,0 L81,0 L81,0.0201838424 C83.1589869,-0.071534047 85.3482153,0.707077645 86.9982489,2.35711116 L109.625176,24.9840387 C111.151676,26.510538 111.932942,28.4998414 111.96811,30.5 L111.96811,30.5 Z M81,8 L24,8 L24,120 L104,120 L104,30.5 L89.0003461,30.5 C84.5818769,30.5 81,26.9216269 81,22.4996539 L81,8 Z"></path>
|
||||
<rect x="32" y="36" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="52" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="68" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="84" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="100" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="20" width="40" height="8" rx="8"></rect>
|
||||
</g>
|
||||
</svg>
|
||||
11
core/images/fold-all-button.tid
Normal file
11
core/images/fold-all-button.tid
Normal file
@@ -0,0 +1,11 @@
|
||||
title: $:/core/images/fold-all-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-fold-all tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
|
||||
<rect x="0" y="64" width="128" height="16" rx="8"></rect>
|
||||
<path d="M64.0292774,58.6235628 C61.9791013,58.6242848 59.9275217,57.8435723 58.3632024,56.279253 L35.7458219,33.6618725 C32.6211696,30.5372202 32.6166093,25.4673401 35.7408036,22.3431458 C38.8586409,19.2253085 43.9325646,19.2211982 47.0595304,22.348164 L64.0250749,39.3137085 L80.9906194,22.348164 C84.1152717,19.2235117 89.1851518,19.2189514 92.3093461,22.3431458 C95.4271834,25.460983 95.4312937,30.5349067 92.3043279,33.6618725 L69.6869474,56.279253 C68.1237851,57.8424153 66.0737951,58.6247195 64.0241231,58.6250809 Z" transform="translate(64.024316, 39.313708) scale(1, -1) translate(-64.024316, -39.313708) "></path>
|
||||
<path d="M64.0292774,123.621227 C61.9791013,123.621949 59.9275217,122.841236 58.3632024,121.276917 L35.7458219,98.6595365 C32.6211696,95.5348842 32.6166093,90.4650041 35.7408036,87.3408098 C38.8586409,84.2229725 43.9325646,84.2188622 47.0595304,87.345828 L64.0250749,104.311373 L80.9906194,87.345828 C84.1152717,84.2211757 89.1851518,84.2166154 92.3093461,87.3408098 C95.4271834,90.458647 95.4312937,95.5325707 92.3043279,98.6595365 L69.6869474,121.276917 C68.1237851,122.840079 66.0737951,123.622383 64.0241231,123.622745 Z" transform="translate(64.024316, 104.311372) scale(1, -1) translate(-64.024316, -104.311372) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
10
core/images/fold-button.tid
Normal file
10
core/images/fold-button.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/images/fold-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-fold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
|
||||
<path d="M64.0292774,63.6235628 C61.9791013,63.6242848 59.9275217,62.8435723 58.3632024,61.279253 L35.7458219,38.6618725 C32.6211696,35.5372202 32.6166093,30.4673401 35.7408036,27.3431458 C38.8586409,24.2253085 43.9325646,24.2211982 47.0595304,27.348164 L64.0250749,44.3137085 L80.9906194,27.348164 C84.1152717,24.2235117 89.1851518,24.2189514 92.3093461,27.3431458 C95.4271834,30.460983 95.4312937,35.5349067 92.3043279,38.6618725 L69.6869474,61.279253 C68.1237851,62.8424153 66.0737951,63.6247195 64.0241231,63.6250809 Z" transform="translate(64.024316, 44.313708) scale(1, -1) translate(-64.024316, -44.313708) "></path>
|
||||
<path d="M64.0049614,105.998482 C61.9547853,105.999204 59.9032057,105.218491 58.3388864,103.654172 L35.7215059,81.0367916 C32.5968535,77.9121393 32.5922933,72.8422592 35.7164876,69.7180649 C38.8343248,66.6002276 43.9082485,66.5961173 47.0352144,69.7230831 L64.0007589,86.6886276 L80.9663034,69.7230831 C84.0909557,66.5984308 89.1608358,66.5938705 92.2850301,69.7180649 C95.4028673,72.8359021 95.4069777,77.9098258 92.2800119,81.0367916 L69.6626314,103.654172 C68.099469,105.217334 66.0494791,105.999639 63.999807,106 Z" transform="translate(64.000000, 86.688628) scale(1, -1) translate(-64.000000, -86.688628) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
10
core/images/fold-others-button.tid
Normal file
10
core/images/fold-others-button.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/images/fold-others-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-fold-others tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<rect x="0" y="56.0314331" width="128" height="16" rx="8"></rect>
|
||||
<path d="M101.657101,104.948818 C100.207918,103.498614 98.2051847,102.599976 95.9929031,102.599976 L72,102.599976 L72,78.6070725 C72,76.3964271 71.1036108,74.3936927 69.6545293,72.9441002 L69.6571005,72.9488183 C68.2079177,71.4986143 66.2051847,70.5999756 63.9929031,70.5999756 L32.0070969,70.5999756 C27.5881712,70.5999756 24,74.1816976 24,78.5999756 C24,83.0092633 27.5848994,86.5999756 32.0070969,86.5999756 L56,86.5999756 L56,110.592879 C56,112.803524 56.8963895,114.806259 58.3454713,116.255852 L58.3429,116.251133 C59.7920828,117.701337 61.7948156,118.599976 64.0070969,118.599976 L88,118.599976 L88,142.592879 C88,147.011804 91.581722,150.599976 96,150.599976 C100.409288,150.599976 104,147.015076 104,142.592879 L104,110.607072 C104,108.396427 103.103611,106.393693 101.654529,104.9441 Z" transform="translate(64.000000, 110.599976) rotate(-45.000000) translate(-64.000000, -110.599976) "></path>
|
||||
<path d="M101.725643,11.7488671 C100.27646,10.2986632 98.2737272,9.40002441 96.0614456,9.40002441 L72.0685425,9.40002441 L72.0685425,-14.5928787 C72.0685425,-16.8035241 71.1721533,-18.8062584 69.7230718,-20.255851 L69.725643,-20.2511329 C68.2764602,-21.7013368 66.2737272,-22.5999756 64.0614456,-22.5999756 L32.0756394,-22.5999756 C27.6567137,-22.5999756 24.0685425,-19.0182536 24.0685425,-14.5999756 C24.0685425,-10.1906879 27.6534419,-6.59997559 32.0756394,-6.59997559 L56.0685425,-6.59997559 L56.0685425,17.3929275 C56.0685425,19.6035732 56.964932,21.6063078 58.4140138,23.0559004 L58.4114425,23.0511823 C59.8606253,24.5013859 61.8633581,25.4000244 64.0756394,25.4000244 L88.0685425,25.4000244 L88.0685425,49.3929275 C88.0685425,53.8118532 91.6502645,57.4000244 96.0685425,57.4000244 C100.47783,57.4000244 104.068542,53.815125 104.068542,49.3929275 L104.068542,17.4071213 C104.068542,15.1964759 103.172153,13.1937416 101.723072,11.744149 Z" transform="translate(64.068542, 17.400024) scale(1, -1) rotate(-45.000000) translate(-64.068542, -17.400024) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
9
core/images/folder.tid
Normal file
9
core/images/folder.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/core/images/folder
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-folder tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<path d="M55.6943257,128.000004 L7.99859666,128.000004 C3.5810937,128.000004 0,124.413822 0,119.996384 L0,48.0036243 C0,43.5833471 3.58387508,40.0000044 7.99859666,40.0000044 L16,40.0000044 L16,31.9999914 C16,27.5817181 19.5783731,24 24.0003461,24 L55.9996539,24 C60.4181231,24 64,27.5800761 64,31.9999914 L64,40.0000044 L104.001403,40.0000044 C108.418906,40.0000044 112,43.5861868 112,48.0036243 L112,59.8298353 L104,59.7475921 L104,51.9994189 C104,49.7887607 102.207895,48.0000044 99.9972215,48.0000044 L56,48.0000044 L56,36.0000255 C56,33.7898932 54.2072328,32 51.9957423,32 L28.0042577,32 C25.7890275,32 24,33.7908724 24,36.0000255 L24,48.0000044 L12.0027785,48.0000044 C9.78987688,48.0000044 8,49.7906032 8,51.9994189 L8,116.00059 C8,118.211248 9.79210499,120.000004 12.0027785,120.000004 L58.7630167,120.000004 L55.6943257,128.000004 L55.6943257,128.000004 Z"></path>
|
||||
<path d="M23.8728955,55.5 L119.875702,55.5 C124.293205,55.5 126.87957,59.5532655 125.650111,64.5630007 L112.305967,118.936999 C111.077582,123.942356 106.497904,128 102.083183,128 L6.08037597,128 C1.66287302,128 -0.923492342,123.946735 0.305967145,118.936999 L13.650111,64.5630007 C14.878496,59.5576436 19.4581739,55.5 23.8728955,55.5 L23.8728955,55.5 L23.8728955,55.5 Z M25.6530124,64 L113.647455,64 C115.858129,64 117.151473,66.0930612 116.538306,68.6662267 L105.417772,115.333773 C104.803671,117.910859 102.515967,120 100.303066,120 L12.3086228,120 C10.0979492,120 8.8046054,117.906939 9.41777189,115.333773 L20.5383062,68.6662267 C21.1524069,66.0891409 23.4401107,64 25.6530124,64 L25.6530124,64 L25.6530124,64 Z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
8
core/images/spiral.tid
Normal file
8
core/images/spiral.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: $:/core/images/spiral
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-spiral tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="nonzero">
|
||||
<path d="M64.534 68.348c3.39 0 6.097-2.62 6.476-5.968l-4.755-.538 4.75.583c.377-3.07-1.194-6.054-3.89-7.78-2.757-1.773-6.34-2.01-9.566-.7-3.46 1.403-6.14 4.392-7.35 8.148l-.01.026c-1.3 4.08-.72 8.64 1.58 12.52 2.5 4.2 6.77 7.2 11.76 8.27 5.37 1.15 11.11-.05 15.83-3.31 5.04-3.51 8.46-9.02 9.45-15.3 1.05-6.7-.72-13.63-4.92-19.19l.02.02c-4.42-5.93-11.2-9.82-18.78-10.78-7.96-1.01-16.13 1.31-22.59 6.43-6.81 5.39-11.18 13.41-12.11 22.26-.98 9.27 1.87 18.65 7.93 26.02 6.32 7.69 15.6 12.56 25.74 13.48 10.54.96 21.15-2.42 29.45-9.4l.01-.01c8.58-7.25 13.94-17.78 14.86-29.21.94-11.84-2.96-23.69-10.86-32.9-8.19-9.5-19.95-15.36-32.69-16.27-13.16-.94-26.24 3.49-36.34 12.34l.01-.01c-10.41 9.08-16.78 22.1-17.68 36.15-.93 14.44 4.03 28.77 13.79 39.78 10.03 11.32 24.28 18.2 39.6 19.09 15.73.92 31.31-4.56 43.24-15.234 12.23-10.954 19.61-26.44 20.5-43.074.14-2.64-1.89-4.89-4.52-5.03-2.64-.14-4.89 1.88-5.03 4.52-.75 14.1-7 27.2-17.33 36.45-10.03 8.98-23.11 13.58-36.3 12.81-12.79-.75-24.67-6.48-33-15.89-8.07-9.11-12.17-20.94-11.41-32.827.74-11.52 5.942-22.15 14.43-29.54l.01-.01c8.18-7.17 18.74-10.75 29.35-9.998 10.21.726 19.6 5.41 26.11 12.96 6.24 7.273 9.32 16.61 8.573 25.894-.718 8.9-4.88 17.064-11.504 22.66l.01-.007c-6.36 5.342-14.44 7.92-22.425 7.19-7.604-.68-14.52-4.314-19.21-10.027-4.44-5.4-6.517-12.23-5.806-18.94.67-6.3 3.76-11.977 8.54-15.766 4.46-3.54 10.05-5.128 15.44-4.44 5.03.63 9.46 3.18 12.32 7.01l.02.024c2.65 3.5 3.75 7.814 3.1 11.92-.59 3.71-2.58 6.925-5.45 8.924-2.56 1.767-5.61 2.403-8.38 1.81-2.42-.516-4.42-1.92-5.53-3.79-.93-1.56-1.15-3.3-.69-4.75l-4.56-1.446L59.325 65c.36-1.12 1.068-1.905 1.84-2.22.25-.103.48-.14.668-.13.06.006.11.015.14.025.01 0 .01 0-.01-.01-.02-.015-.054-.045-.094-.088-.06-.064-.12-.145-.17-.244-.15-.29-.23-.678-.18-1.11l-.005.04c.15-1.332 1.38-2.523 3.035-2.523-2.65 0-4.79 2.144-4.79 4.787s2.14 4.785 4.78 4.785z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
11
core/images/unfold-all-button.tid
Normal file
11
core/images/unfold-all-button.tid
Normal file
@@ -0,0 +1,11 @@
|
||||
title: $:/core/images/unfold-all-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-unfold-all tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
|
||||
<rect x="0" y="64" width="128" height="16" rx="8"></rect>
|
||||
<path d="M85.598226,8.34884273 C84.1490432,6.89863875 82.1463102,6 79.9340286,6 L47.9482224,6 C43.5292967,6 39.9411255,9.581722 39.9411255,14 C39.9411255,18.4092877 43.5260249,22 47.9482224,22 L71.9411255,22 L71.9411255,45.9929031 C71.9411255,50.4118288 75.5228475,54 79.9411255,54 C84.3504132,54 87.9411255,50.4151006 87.9411255,45.9929031 L87.9411255,14.0070969 C87.9411255,11.7964515 87.0447363,9.79371715 85.5956548,8.34412458 Z" transform="translate(63.941125, 30.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -30.000000) "></path>
|
||||
<path d="M85.6571005,72.2899682 C84.2079177,70.8397642 82.2051847,69.9411255 79.9929031,69.9411255 L48.0070969,69.9411255 C43.5881712,69.9411255 40,73.5228475 40,77.9411255 C40,82.3504132 43.5848994,85.9411255 48.0070969,85.9411255 L72,85.9411255 L72,109.934029 C72,114.352954 75.581722,117.941125 80,117.941125 C84.4092877,117.941125 88,114.356226 88,109.934029 L88,77.9482224 C88,75.737577 87.1036108,73.7348426 85.6545293,72.2852501 Z" transform="translate(64.000000, 93.941125) scale(1, -1) rotate(-45.000000) translate(-64.000000, -93.941125) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
10
core/images/unfold-button.tid
Normal file
10
core/images/unfold-button.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/images/unfold-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-unfold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
|
||||
<path d="M85.598226,11.3488427 C84.1490432,9.89863875 82.1463102,9 79.9340286,9 L47.9482224,9 C43.5292967,9 39.9411255,12.581722 39.9411255,17 C39.9411255,21.4092877 43.5260249,25 47.9482224,25 L71.9411255,25 L71.9411255,48.9929031 C71.9411255,53.4118288 75.5228475,57 79.9411255,57 C84.3504132,57 87.9411255,53.4151006 87.9411255,48.9929031 L87.9411255,17.0070969 C87.9411255,14.7964515 87.0447363,12.7937171 85.5956548,11.3441246 Z" transform="translate(63.941125, 33.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -33.000000) "></path>
|
||||
<path d="M85.6571005,53.4077172 C84.2079177,51.9575133 82.2051847,51.0588745 79.9929031,51.0588745 L48.0070969,51.0588745 C43.5881712,51.0588745 40,54.6405965 40,59.0588745 C40,63.4681622 43.5848994,67.0588745 48.0070969,67.0588745 L72,67.0588745 L72,91.0517776 C72,95.4707033 75.581722,99.0588745 80,99.0588745 C84.4092877,99.0588745 88,95.4739751 88,91.0517776 L88,59.0659714 C88,56.855326 87.1036108,54.8525917 85.6545293,53.4029991 Z" transform="translate(64.000000, 75.058875) scale(1, -1) rotate(-45.000000) translate(-64.000000, -75.058875) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
@@ -30,12 +30,24 @@ ExportTiddler/Caption: export tiddler
|
||||
ExportTiddler/Hint: Export tiddler
|
||||
ExportTiddlers/Caption: export tiddlers
|
||||
ExportTiddlers/Hint: Export tiddlers
|
||||
Fold/Caption: fold tiddler
|
||||
Fold/Hint: Fold the body of this tiddler
|
||||
Fold/FoldBar/Caption: fold-bar
|
||||
Fold/FoldBar/Hint: Optional bars to fold and unfold tiddlers
|
||||
Unfold/Caption: unfold tiddler
|
||||
Unfold/Hint: Unfold the body of this tiddler
|
||||
FoldOthers/Caption: fold other tiddlers
|
||||
FoldOthers/Hint: Fold the bodies of other opened tiddlers
|
||||
FoldAll/Caption: fold all tiddlers
|
||||
FoldAll/Hint: Fold the bodies of all opened tiddlers
|
||||
UnfoldAll/Caption: unfold all tiddlers
|
||||
UnfoldAll/Hint: Unfold the bodies of all opened tiddlers
|
||||
FullScreen/Caption: full-screen
|
||||
FullScreen/Hint: Enter or leave full-screen mode
|
||||
Help/Caption: help
|
||||
Help/Hint: Show help panel
|
||||
Import/Caption: import
|
||||
Import/Hint: Import files
|
||||
Import/Hint: Import many types of file including text, image, TiddlyWiki or JSON
|
||||
Info/Caption: info
|
||||
Info/Hint: Show information for this tiddler
|
||||
Home/Caption: home
|
||||
|
||||
@@ -38,6 +38,11 @@ Palette/Editor/Reset/Caption: reset
|
||||
Palette/HideEditor/Caption: hide editor
|
||||
Palette/Prompt: Current palette:
|
||||
Palette/ShowEditor/Caption: show editor
|
||||
Parsing/Caption: Parsing
|
||||
Parsing/Hint: Here you can globally disable individual wiki parser rules. Take care as disabling some parser rules can prevent ~TiddlyWiki functioning correctly (you can restore normal operation with [[safe mode|http://tiddlywiki.com/#SafeMode]] )
|
||||
Parsing/Block/Caption: Block Parse Rules
|
||||
Parsing/Inline/Caption: Inline Parse Rules
|
||||
Parsing/Pragma/Caption: Pragma Parse Rules
|
||||
Plugins/Add/Hint: Install plugins from the official library
|
||||
Plugins/Add/Caption: Get more plugins
|
||||
Plugins/Caption: Plugins
|
||||
@@ -47,11 +52,14 @@ Plugins/Disabled/Status: (disabled)
|
||||
Plugins/Empty/Hint: None
|
||||
Plugins/Enable/Caption: enable
|
||||
Plugins/Enable/Hint: Enable this plugin when reloading page
|
||||
Plugins/Install: install
|
||||
Plugins/Installed/Hint: Currently installed plugins:
|
||||
Plugins/Languages/Caption: Languages
|
||||
Plugins/Languages/Hint: Language pack plugins
|
||||
Plugins/OpenPluginLibrary: open plugin library
|
||||
Plugins/Plugins/Caption: Plugins
|
||||
Plugins/Plugins/Hint: Plugins
|
||||
Plugins/Reinstall: reinstall
|
||||
Plugins/Themes/Caption: Themes
|
||||
Plugins/Themes/Hint: Theme plugins
|
||||
Saving/Caption: Saving
|
||||
@@ -71,6 +79,9 @@ Settings/AutoSave/Caption: Autosave
|
||||
Settings/AutoSave/Disabled/Description: Do not save changes automatically
|
||||
Settings/AutoSave/Enabled/Description: Save changes automatically
|
||||
Settings/AutoSave/Hint: Automatically save changes during editing
|
||||
Settings/CamelCase/Caption: Camel Case Wiki Links
|
||||
Settings/CamelCase/Hint: You can globally disable automatic linking of ~CamelCase phrases. Requires reload to take effect
|
||||
Settings/CamelCase/Description: Enable automatic ~CamelCase linking
|
||||
Settings/Caption: Settings
|
||||
Settings/Hint: These settings let you customise the behaviour of TiddlyWiki.
|
||||
Settings/NavigationAddressBar/Caption: Navigation Address Bar
|
||||
@@ -82,6 +93,9 @@ Settings/NavigationHistory/Caption: Navigation History
|
||||
Settings/NavigationHistory/Hint: Update browser history when navigating to a tiddler:
|
||||
Settings/NavigationHistory/No/Description: Do not update history
|
||||
Settings/NavigationHistory/Yes/Description: Update history
|
||||
Settings/PerformanceInstrumentation/Caption: Performance Instrumentation
|
||||
Settings/PerformanceInstrumentation/Hint: Displays performance statistics in the browser developer console. Requires reload to take effect
|
||||
Settings/PerformanceInstrumentation/Description: Enable performance instrumentation
|
||||
Settings/ToolbarButtonStyle/Caption: Toolbar Button Style
|
||||
Settings/ToolbarButtonStyle/Hint: Choose the style for toolbar buttons:
|
||||
Settings/ToolbarButtonStyle/Styles/Borderless: Borderless
|
||||
@@ -115,8 +129,7 @@ Toolbars/EditToolbar/Caption: Edit Toolbar
|
||||
Toolbars/EditToolbar/Hint: Choose which buttons are displayed for tiddlers in edit mode
|
||||
Toolbars/Hint: Select which toolbar buttons are displayed
|
||||
Toolbars/PageControls/Caption: Page Toolbar
|
||||
Toolbars/PageControls/Hint: Choose which buttons are displayed on the main page toolbar
|
||||
Toolbars/PageControls/Hint: Choose which buttons are displayed on the main page toolbar
|
||||
Toolbars/ViewToolbar/Caption: View Toolbar
|
||||
Toolbars/ViewToolbar/Hint: Choose which buttons are displayed for tiddlers in view mode
|
||||
Tools/Download/Full/Caption: Download full wiki
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ Fields/Add/Prompt: Add a new field:
|
||||
Fields/Add/Value/Placeholder: field value
|
||||
Fields/Add/Dropdown/System: System fields
|
||||
Fields/Add/Dropdown/User: User fields
|
||||
Shadow/Warning: This is a shadow tiddler. Any changes will override the default version
|
||||
Shadow/OverriddenWarning: This is a modified shadow tiddler. You can revert to the default version by deleting this tiddler
|
||||
Shadow/Warning: This is a shadow tiddler. Any changes you make will override the default version from the plugin <<pluginLink>>
|
||||
Shadow/OverriddenWarning: This is a modified shadow tiddler. You can revert to the default version in the plugin <<pluginLink>> by deleting this tiddler
|
||||
Tags/Add/Button: add
|
||||
Tags/Add/Placeholder: tag name
|
||||
Tags/Dropdown/Caption: tag list
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/language/Help/load
|
||||
description: Load tiddlers from a file
|
||||
|
||||
Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files
|
||||
Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files
|
||||
|
||||
```
|
||||
--load <filepath>
|
||||
|
||||
@@ -7,3 +7,4 @@ Set a password for subsequent crypto operations
|
||||
--password <password>
|
||||
```
|
||||
|
||||
''Note'': This should not be used for serving TiddlyWiki with password protection. Instead, see the password option under the [[ServerCommand]].
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
title: $:/language/Help/rendertiddler
|
||||
description: Render an individual tiddler as a specified ContentType
|
||||
|
||||
Render an individual tiddler as a specified ContentType, defaults to `text/html` and save it to the specified filename:
|
||||
Render an individual tiddler as a specified ContentType, defaulting to `text/html` and save it to the specified filename. Optionally a template can be specified, in which case the template tiddler is rendered with the "currentTiddler" variable set to the tiddler that is being rendered (the first parameter value).
|
||||
|
||||
```
|
||||
--rendertiddler <title> <filename> [<type>]
|
||||
--rendertiddler <title> <filename> [<type>] [<template>]
|
||||
```
|
||||
|
||||
By default, the filename is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.
|
||||
|
||||
@@ -15,4 +15,4 @@ For example:
|
||||
|
||||
By default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.
|
||||
|
||||
Any files in the target directory are deleted unless the "noclean" parameter is specified. The target directory is recursively created if it is missing.
|
||||
Any files in the target directory are deleted unless the ''noclean'' flag is specified. The target directory is recursively created if it is missing.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/language/Help/savetiddler
|
||||
description: Saves a raw tiddler to a file
|
||||
|
||||
Saves an individual tiddler in its raw text or binary format to the specified filename.
|
||||
Saves an individual tiddler in its raw text or binary format to the specified filename.
|
||||
|
||||
```
|
||||
--savetiddler <title> <filename>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
title: $:/language/Help/savetiddlers
|
||||
description: Saves a group of raw tiddlers to a directory
|
||||
|
||||
Saves a group of tiddlers in their raw text or binary format to the specified directory.
|
||||
Saves a group of tiddlers in their raw text or binary format to the specified directory.
|
||||
|
||||
```
|
||||
--savetiddlers <filter> <pathname>
|
||||
--savetiddlers <filter> <pathname> ["noclean"]
|
||||
```
|
||||
|
||||
By default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.
|
||||
|
||||
The output directory is cleared of existing files before saving the specified files. The deletion can be disabled by specifying the ''noclean'' flag.
|
||||
|
||||
Any missing directories in the pathname are automatically created.
|
||||
|
||||
@@ -12,7 +12,7 @@ At the root, it serves a rendering of a specified tiddler. Away from the root, i
|
||||
The parameters are:
|
||||
|
||||
* ''port'' - port number to serve from (defaults to "8080")
|
||||
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
|
||||
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
|
||||
* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
|
||||
* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html")
|
||||
* ''username'' - the default username for signing edits
|
||||
|
||||
@@ -14,5 +14,4 @@ The parameters are:
|
||||
* ''filter'' - filter identifying the tiddlers to be affected
|
||||
* ''fieldname'' - the field to modify (defaults to "text")
|
||||
* ''templatetitle'' - the tiddler to wikify into the specified field. If blank or missing then the specified field is deleted
|
||||
* ''type'' - the text type to render (defaults to "text/plain"; "text/html" can be used to include HTML tags)
|
||||
|
||||
* ''rendertype'' - the text type to render (defaults to "text/plain"; "text/html" can be used to include HTML tags)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/language/Help/verbose
|
||||
description: Triggers verbose output mode
|
||||
|
||||
Triggers verbose output, useful for debugging
|
||||
Triggers verbose output, useful for debugging
|
||||
|
||||
```
|
||||
--verbose
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
title: $:/language/Import/
|
||||
|
||||
Imported: The following tiddlers were imported:
|
||||
Listing/Cancel/Caption: Cancel
|
||||
Listing/Hint: These tiddlers are ready to import:
|
||||
Listing/Import/Caption: Import
|
||||
Listing/Select/Caption: Select
|
||||
Listing/Status/Caption: Status
|
||||
Listing/Title/Caption: Title
|
||||
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
|
||||
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
|
||||
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
|
||||
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
|
||||
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
|
||||
Upgrader/State/Suppressed: Blocked temporary state tiddler
|
||||
Upgrader/System/Suppressed: Blocked system tiddler
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
title: $:/language/
|
||||
|
||||
AboveStory/ClassicPlugin/Warning: It looks like you are trying to load a plugin designed for ~TiddlyWiki Classic. Please note that [[these plugins do not work with TiddlyWiki version 5.x.x|http://tiddlywiki.com/#TiddlyWikiClassic]]. ~TiddlyWiki Classic plugins detected:
|
||||
BinaryWarning/Prompt: This tiddler contains binary data
|
||||
ClassicWarning/Hint: This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See http://tiddlywiki.com/static/Upgrading.html for more details.
|
||||
ClassicWarning/Hint: This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See http://tiddlywiki.com/static/Upgrading.html for more details.
|
||||
ClassicWarning/Upgrade/Caption: upgrade
|
||||
CloseAll/Button: close all
|
||||
ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"?
|
||||
@@ -18,9 +19,13 @@ Encryption/Password: Password
|
||||
Encryption/RepeatPassword: Repeat password
|
||||
Encryption/PasswordNoMatch: Passwords do not match
|
||||
Encryption/SetPassword: Set password
|
||||
InternalJavaScriptError/Title: Internal JavaScript Error
|
||||
InternalJavaScriptError/Hint: Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
|
||||
InvalidFieldName: Illegal characters in field name "<$text text=<<fieldName>>/>". Fields can only contain lowercase letters, digits and the characters underscore (`_`), hyphen (`-`) and period (`.`)
|
||||
LazyLoadingWarning: <p>Loading external text from ''<$text text={{!!_canonical_uri}}/>''</p><p>If this message doesn't disappear you may be using a browser that doesn't support external text in this configuration. See http://tiddlywiki.com/#ExternalText</p>
|
||||
MissingTiddler/Hint: Missing tiddler "<$text text=<<currentTiddler>>/>" - click {{$:/core/images/edit-button}} to create
|
||||
OfficialPluginLibrary: Official ~TiddlyWiki Plugin Library
|
||||
OfficialPluginLibrary/Hint: The official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to plugins to take effect
|
||||
RecentChanges/DateFormat: DDth MMM YYYY
|
||||
SystemTiddler/Tooltip: This is a system tiddler
|
||||
@@ -29,4 +34,5 @@ TagManager/Count/Heading: Count
|
||||
TagManager/Icon/Heading: Icon
|
||||
TagManager/Info/Heading: Info
|
||||
TagManager/Tag/Heading: Tag
|
||||
Tiddler/DateFormat: DDth MMM YYYY at hh12:0mmam
|
||||
UnsavedChangesWarning: You have unsaved changes in TiddlyWiki
|
||||
|
||||
@@ -5,6 +5,9 @@ Filter/Caption: Filter
|
||||
Filter/Hint: Search via a [[filter expression|http://tiddlywiki.com/static/Filters.html]]
|
||||
Filter/Matches: //<small><<resultCount>> matches</small>//
|
||||
Matches: //<small><<resultCount>> matches</small>//
|
||||
Matches/All: All matches:
|
||||
Matches/Title: Title matches:
|
||||
Search: Search
|
||||
Shadows/Caption: Shadows
|
||||
Shadows/Hint: Search for shadow tiddlers
|
||||
Shadows/Matches: //<small><<resultCount>> matches</small>//
|
||||
|
||||
@@ -32,9 +32,15 @@ Command.prototype.execute = function() {
|
||||
path = require("path"),
|
||||
title = this.params[0],
|
||||
filename = path.resolve(this.commander.outputPath,this.params[1]),
|
||||
type = this.params[2] || "text/html";
|
||||
type = this.params[2] || "text/html",
|
||||
template = this.params[3],
|
||||
variables = {};
|
||||
$tw.utils.createFileDirectories(filename);
|
||||
fs.writeFile(filename,this.commander.wiki.renderTiddler(type,title),"utf8",function(err) {
|
||||
if(template) {
|
||||
variables.currentTiddler = title;
|
||||
title = template;
|
||||
}
|
||||
fs.writeFile(filename,this.commander.wiki.renderTiddler(type,title,{variables: variables}),"utf8",function(err) {
|
||||
self.callback(err);
|
||||
});
|
||||
return null;
|
||||
|
||||
@@ -39,7 +39,7 @@ Command.prototype.execute = function() {
|
||||
pathname = path.resolve(outputPath,this.params[2]),
|
||||
type = this.params[3] || "text/html",
|
||||
extension = this.params[4] || ".html",
|
||||
deleteDirectory = (this.params[5] || "") != "noclean",
|
||||
deleteDirectory = (this.params[5] || "").toLowerCase() !== "noclean",
|
||||
tiddlers = wiki.filterTiddlers(filter);
|
||||
if(deleteDirectory) {
|
||||
$tw.utils.deleteDirectory(pathname);
|
||||
|
||||
@@ -43,7 +43,7 @@ Command.prototype.execute = function() {
|
||||
basepath = this.params[2],
|
||||
skinnyListTitle = this.params[3];
|
||||
// Get the container tiddler as data
|
||||
var containerData = self.commander.wiki.getTiddlerData(containerTitle,undefined);
|
||||
var containerData = self.commander.wiki.getTiddlerDataCached(containerTitle,undefined);
|
||||
if(!containerData) {
|
||||
return "'" + containerTitle + "' is not a tiddler bundle";
|
||||
}
|
||||
|
||||
@@ -35,8 +35,11 @@ Command.prototype.execute = function() {
|
||||
wiki = this.commander.wiki,
|
||||
filter = this.params[0],
|
||||
pathname = path.resolve(this.commander.outputPath,this.params[1]),
|
||||
deleteDirectory = (this.params[2] || "").toLowerCase() !== "noclean",
|
||||
tiddlers = wiki.filterTiddlers(filter);
|
||||
$tw.utils.deleteDirectory(pathname);
|
||||
if(deleteDirectory) {
|
||||
$tw.utils.deleteDirectory(pathname);
|
||||
}
|
||||
$tw.utils.createDirectory(pathname);
|
||||
$tw.utils.each(tiddlers,function(title) {
|
||||
var tiddler = self.commander.wiki.getTiddler(title),
|
||||
|
||||
@@ -12,7 +12,7 @@ Serve tiddlers over http
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
if(!$tw.browser) {
|
||||
if($tw.node) {
|
||||
var util = require("util"),
|
||||
fs = require("fs"),
|
||||
url = require("url"),
|
||||
@@ -170,7 +170,7 @@ var Command = function(params,commander,callback) {
|
||||
if(fields.revision) {
|
||||
delete fields.revision;
|
||||
}
|
||||
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
|
||||
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title},state.wiki.getModificationFields()));
|
||||
var changeCount = state.wiki.getChangeCount(title).toString();
|
||||
response.writeHead(204, "OK",{
|
||||
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\"",
|
||||
@@ -301,7 +301,7 @@ Command.prototype.execute = function() {
|
||||
console.log("Serving on " + host + ":" + port);
|
||||
console.log("(press ctrl-C to exit)");
|
||||
// Warn if required plugins are missing
|
||||
if($tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/tiddlyweb") === -1 || $tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/filesystem") === -1) {
|
||||
if(!$tw.wiki.getTiddler("$:/plugins/tiddlywiki/tiddlyweb") || !$tw.wiki.getTiddler("$:/plugins/tiddlywiki/filesystem")) {
|
||||
$tw.utils.warning("Warning: Plugins required for client-server operation (\"tiddlywiki/filesystem\" and \"tiddlywiki/tiddlyweb\") are missing from tiddlywiki.info file");
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -29,7 +29,7 @@ Command.prototype.execute = function() {
|
||||
}
|
||||
var self = this,
|
||||
title = this.params[0],
|
||||
pluginData = this.commander.wiki.getTiddlerData(title);
|
||||
pluginData = this.commander.wiki.getTiddlerDataCached(title);
|
||||
if(!pluginData) {
|
||||
return "Plugin '" + title + "' not found";
|
||||
}
|
||||
|
||||
49
core/modules/filters/days.js
Normal file
49
core/modules/filters/days.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/days.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that selects tiddlers with a specified date field within a specified date interval.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.days = function(source,operator,options) {
|
||||
var results = [],
|
||||
fieldName = operator.suffix || "modified",
|
||||
dayInterval = (parseInt(operator.operand,10)||0),
|
||||
dayIntervalSign = $tw.utils.sign(dayInterval),
|
||||
targetTimeStamp = (new Date()).setHours(0,0,0,0) + 1000*60*60*24*dayInterval,
|
||||
isWithinDays = function(dateField) {
|
||||
var sign = $tw.utils.sign(targetTimeStamp - (new Date(dateField)).setHours(0,0,0,0));
|
||||
return sign === 0 || sign === dayIntervalSign;
|
||||
};
|
||||
|
||||
if(operator.prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields[fieldName]) {
|
||||
if(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields[fieldName]) {
|
||||
if(isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -3,7 +3,8 @@ title: $:/core/modules/filters/each.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that selects one tiddler for each unique value of the specified field
|
||||
Filter operator that selects one tiddler for each unique value of the specified field.
|
||||
With suffix "list", selects all tiddlers that are values in a specified list field.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@@ -16,22 +17,34 @@ Filter operator that selects one tiddler for each unique value of the specified
|
||||
Export our filter function
|
||||
*/
|
||||
exports.each = function(source,operator,options) {
|
||||
var results = [],
|
||||
values = {};
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
var value;
|
||||
if((operator.operand === "") || (operator.operand === "title")) {
|
||||
value = title;
|
||||
} else {
|
||||
value = tiddler.getFieldString(operator.operand);
|
||||
var results =[] ,
|
||||
value,values = {},
|
||||
field = operator.operand || "title";
|
||||
if(operator.suffix !== "list-item") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
value = (field === "title") ? title : tiddler.getFieldString(field);
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(title);
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
$tw.utils.each(
|
||||
options.wiki.getTiddlerList(title,field),
|
||||
function(value) {
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(value);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Export our filter function
|
||||
exports.indexes = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
var data = options.wiki.getTiddlerData(title);
|
||||
var data = options.wiki.getTiddlerDataCached(title);
|
||||
if(data) {
|
||||
$tw.utils.pushTop(results,Object.keys(data));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ Export our filter function
|
||||
exports.plugintiddlers = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerData(title,{tiddlers:[]});
|
||||
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerDataCached(title,{tiddlers:[]});
|
||||
if(pluginInfo && pluginInfo.tiddlers) {
|
||||
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
|
||||
results.push(title);
|
||||
|
||||
@@ -16,13 +16,16 @@ Filter operator returning all the tags of the selected tiddlers
|
||||
Export our filter function
|
||||
*/
|
||||
exports.tags = function(source,operator,options) {
|
||||
var results = [];
|
||||
var tags = {};
|
||||
source(function(tiddler,title) {
|
||||
var t, length;
|
||||
if(tiddler && tiddler.fields.tags) {
|
||||
$tw.utils.pushTop(results,tiddler.fields.tags);
|
||||
for(t=0, length=tiddler.fields.tags.length; t<length; t++) {
|
||||
tags[tiddler.fields.tags[t]] = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return results;
|
||||
return Object.keys(tags);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
30
core/modules/filters/wikiparserrules.js
Normal file
30
core/modules/filters/wikiparserrules.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/wikiparserrules.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning the names of the wiki parser rules in this wiki
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.wikiparserrules = function(source,operator,options) {
|
||||
var results = [];
|
||||
$tw.utils.each($tw.modules.types.wikirule,function(mod) {
|
||||
var exp = mod.exports;
|
||||
if(exp.types[operator.operand]) {
|
||||
results.push(exp.name);
|
||||
}
|
||||
});
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
189
core/modules/filters/x-listops.js
Normal file
189
core/modules/filters/x-listops.js
Normal file
@@ -0,0 +1,189 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/x-listops.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Extended filter operators to manipulate the current list.
|
||||
|
||||
\*/
|
||||
(function () {
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Fetch titles from the current list
|
||||
*/
|
||||
var prepare_results = function (source) {
|
||||
var results = [];
|
||||
source(function (tiddler, title) {
|
||||
results.push(title);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list before the item named in the operand
|
||||
*/
|
||||
exports.putbefore = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -1) :
|
||||
results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list after the item named in the operand
|
||||
*/
|
||||
exports.putafter = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -1) :
|
||||
results.slice(0, index + 1).concat(results.slice(-count)).concat(results.slice(index + 1, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Replaces the item named in the operand with a number of items from the tail of the current list
|
||||
*/
|
||||
exports.replace = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -count) :
|
||||
results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index + 1, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list to the head of the list
|
||||
*/
|
||||
exports.putfirst = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return results.slice(-count).concat(results.slice(0, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the head of the current list to the tail of the list
|
||||
*/
|
||||
exports.putlast = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return results.slice(count).concat(results.slice(0, count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves the item named in the operand a number of places forward or backward in the list
|
||||
*/
|
||||
exports.move = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1,
|
||||
marker = results.splice(index, 1);
|
||||
return results.slice(0, index + count).concat(marker).concat(results.slice(index + count));
|
||||
};
|
||||
|
||||
/*
|
||||
Returns the items from the current list that are after the item named in the operand
|
||||
*/
|
||||
exports.allafter = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand);
|
||||
return (index === -1 || index > (results.length - 2)) ? [] :
|
||||
(operator.suffix) ? results.slice(index) :
|
||||
results.slice(index + 1);
|
||||
};
|
||||
|
||||
/*
|
||||
Returns the items from the current list that are before the item named in the operand
|
||||
*/
|
||||
exports.allbefore = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand);
|
||||
return (index <= 0) ? [] :
|
||||
(operator.suffix) ? results.slice(0, index + 1) :
|
||||
results.slice(0, index);
|
||||
};
|
||||
|
||||
/*
|
||||
Appends the items listed in the operand array to the tail of the current list
|
||||
*/
|
||||
exports.append = function (source, operator) {
|
||||
var append = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || append.length;
|
||||
return (append.length === 0) ? results :
|
||||
(operator.prefix) ? results.concat(append.slice(-count)) :
|
||||
results.concat(append.slice(0, count));
|
||||
};
|
||||
|
||||
/*
|
||||
Prepends the items listed in the operand array to the head of the current list
|
||||
*/
|
||||
exports.prepend = function (source, operator) {
|
||||
var prepend = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || prepend.length;
|
||||
return (prepend.length === 0) ? results :
|
||||
(operator.prefix) ? prepend.slice(-count).concat(results) :
|
||||
prepend.slice(0, count).concat(results);
|
||||
};
|
||||
|
||||
/*
|
||||
Returns all items from the current list except the items listed in the operand array
|
||||
*/
|
||||
exports.remove = function (source, operator) {
|
||||
var array = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || array.length,
|
||||
p,
|
||||
len,
|
||||
index;
|
||||
len = array.length - 1;
|
||||
for (p = 0; p < count; ++p) {
|
||||
if (operator.prefix) {
|
||||
index = results.indexOf(array[len - p]);
|
||||
} else {
|
||||
index = results.indexOf(array[p]);
|
||||
}
|
||||
if (index !== -1) {
|
||||
results.splice(index, 1);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Returns all items from the current list sorted in the order of the items in the operand array
|
||||
*/
|
||||
exports.sortby = function (source, operator) {
|
||||
var results = prepare_results(source);
|
||||
if (!results || results.length < 2) {
|
||||
return results;
|
||||
}
|
||||
var lookup = $tw.utils.parseStringArray(operator.operand, "true");
|
||||
results.sort(function (a, b) {
|
||||
return lookup.indexOf(a) - lookup.indexOf(b);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Removes all duplicate items from the current list
|
||||
*/
|
||||
exports.unique = function (source, operator) {
|
||||
var results = prepare_results(source);
|
||||
var set = results.reduce(function (a, b) {
|
||||
if (a.indexOf(b) < 0) {
|
||||
a.push(b);
|
||||
}
|
||||
return a;
|
||||
}, []);
|
||||
return set;
|
||||
};
|
||||
})();
|
||||
@@ -22,7 +22,7 @@ function Language(options) {
|
||||
}
|
||||
|
||||
/*
|
||||
Return a single translateable string. The title is automatically prefixed with "$:/language/"
|
||||
Return a wikified translateable string. The title is automatically prefixed with "$:/language/"
|
||||
Options include:
|
||||
variables: optional hashmap of variables to supply to the language wikification
|
||||
*/
|
||||
@@ -32,6 +32,14 @@ Language.prototype.getString = function(title,options) {
|
||||
return this.wiki.renderTiddler("text/plain",title,{variables: options.variables});
|
||||
};
|
||||
|
||||
/*
|
||||
Return a raw, unwikified translateable string. The title is automatically prefixed with "$:/language/"
|
||||
*/
|
||||
Language.prototype.getRawString = function(title) {
|
||||
title = "$:/language/" + title;
|
||||
return this.wiki.getTiddlerText(title);
|
||||
};
|
||||
|
||||
exports.Language = Language;
|
||||
|
||||
})();
|
||||
|
||||
@@ -32,29 +32,39 @@ The exception is `skipWhiteSpace`, which just returns the position after the whi
|
||||
Look for a whitespace token. Returns null if not found, otherwise returns {type: "whitespace", start:, end:,}
|
||||
*/
|
||||
exports.parseWhiteSpace = function(source,pos) {
|
||||
var node = {
|
||||
type: "whitespace",
|
||||
start: pos
|
||||
};
|
||||
var re = /(\s)+/g;
|
||||
re.lastIndex = pos;
|
||||
var match = re.exec(source);
|
||||
if(match && match.index === pos) {
|
||||
node.end = pos + match[0].length;
|
||||
return node;
|
||||
var p = pos,c;
|
||||
while(true) {
|
||||
c = source.charAt(p);
|
||||
if((c === " ") || (c === "\f") || (c === "\n") || (c === "\r") || (c === "\t") || (c === "\v") || (c === "\u00a0")) { // Ignores some obscure unicode spaces
|
||||
p++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(p === pos) {
|
||||
return null;
|
||||
} else {
|
||||
return {
|
||||
type: "whitespace",
|
||||
start: pos,
|
||||
end: p
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/*
|
||||
Convenience wrapper for parseWhiteSpace. Returns the position after the whitespace
|
||||
*/
|
||||
exports.skipWhiteSpace = function(source,pos) {
|
||||
var whitespace = $tw.utils.parseWhiteSpace(source,pos);
|
||||
if(whitespace) {
|
||||
return whitespace.end;
|
||||
var c;
|
||||
while(true) {
|
||||
c = source.charAt(pos);
|
||||
if((c === " ") || (c === "\f") || (c === "\n") || (c === "\r") || (c === "\t") || (c === "\v") || (c === "\u00a0")) { // Ignores some obscure unicode spaces
|
||||
pos++;
|
||||
} else {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
35
core/modules/parsers/videoparser.js
Normal file
35
core/modules/parsers/videoparser.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/videoparser.js
|
||||
type: application/javascript
|
||||
module-type: parser
|
||||
|
||||
The video parser parses a video tiddler into an embeddable HTML element
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var AudioParser = function(type,text,options) {
|
||||
var element = {
|
||||
type: "element",
|
||||
tag: "video",
|
||||
attributes: {
|
||||
controls: {type: "string", value: "controls"}
|
||||
}
|
||||
},
|
||||
src;
|
||||
if(options._canonical_uri) {
|
||||
element.attributes.src = {type: "string", value: options._canonical_uri};
|
||||
} else if(text) {
|
||||
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
|
||||
}
|
||||
this.tree = [element];
|
||||
};
|
||||
|
||||
exports["video/mp4"] = AudioParser;
|
||||
|
||||
})();
|
||||
|
||||
@@ -78,10 +78,13 @@ exports.parse = function() {
|
||||
}
|
||||
// Save the macro definition
|
||||
return [{
|
||||
type: "macrodef",
|
||||
name: this.match[1],
|
||||
params: params,
|
||||
text: text
|
||||
type: "set",
|
||||
attributes: {
|
||||
name: {type: "string", value: this.match[1]},
|
||||
value: {type: "string", value: text}
|
||||
},
|
||||
children: [],
|
||||
params: params
|
||||
}];
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ exports.types = {inline: true};
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /~?\$:\/[a-zA-Z/.-]+/mg;
|
||||
this.matchRegExp = /~?\$:\/[a-zA-Z0-9/.\-_]+/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
|
||||
@@ -26,15 +26,24 @@ Attributes are stored as hashmaps of the following objects:
|
||||
|
||||
var WikiParser = function(type,text,options) {
|
||||
this.wiki = options.wiki;
|
||||
var self = this;
|
||||
// Check for an externally linked tiddler
|
||||
if($tw.browser && (text || "") === "" && options._canonical_uri) {
|
||||
this.loadRemoteTiddler(options._canonical_uri);
|
||||
text = $tw.language.getRawString("LazyLoadingWarning");
|
||||
}
|
||||
// Initialise the classes if we don't have them already
|
||||
if(!this.pragmaRuleClasses) {
|
||||
WikiParser.prototype.pragmaRuleClasses = $tw.modules.createClassesFromModules("wikirule","pragma",$tw.WikiRuleBase);
|
||||
this.setupRules(WikiParser.prototype.pragmaRuleClasses,"$:/config/WikiParserRules/Pragmas/");
|
||||
}
|
||||
if(!this.blockRuleClasses) {
|
||||
WikiParser.prototype.blockRuleClasses = $tw.modules.createClassesFromModules("wikirule","block",$tw.WikiRuleBase);
|
||||
this.setupRules(WikiParser.prototype.blockRuleClasses,"$:/config/WikiParserRules/Block/");
|
||||
}
|
||||
if(!this.inlineRuleClasses) {
|
||||
WikiParser.prototype.inlineRuleClasses = $tw.modules.createClassesFromModules("wikirule","inline",$tw.WikiRuleBase);
|
||||
this.setupRules(WikiParser.prototype.inlineRuleClasses,"$:/config/WikiParserRules/Inline/");
|
||||
}
|
||||
// Save the parse text
|
||||
this.type = type || "text/vnd.tiddlywiki";
|
||||
@@ -48,16 +57,51 @@ var WikiParser = function(type,text,options) {
|
||||
this.blockRules = this.instantiateRules(this.blockRuleClasses,"block",0);
|
||||
this.inlineRules = this.instantiateRules(this.inlineRuleClasses,"inline",0);
|
||||
// Parse any pragmas
|
||||
this.tree = this.parsePragmas();
|
||||
this.tree = [];
|
||||
var topBranch = this.parsePragmas();
|
||||
// Parse the text into inline runs or blocks
|
||||
if(options.parseAsInline) {
|
||||
this.tree.push.apply(this.tree,this.parseInlineRun());
|
||||
topBranch.push.apply(topBranch,this.parseInlineRun());
|
||||
} else {
|
||||
this.tree.push.apply(this.tree,this.parseBlocks());
|
||||
topBranch.push.apply(topBranch,this.parseBlocks());
|
||||
}
|
||||
// Return the parse tree
|
||||
};
|
||||
|
||||
/*
|
||||
*/
|
||||
WikiParser.prototype.loadRemoteTiddler = function(url) {
|
||||
var self = this;
|
||||
$tw.utils.httpRequest({
|
||||
url: url,
|
||||
type: "GET",
|
||||
callback: function(err,data) {
|
||||
if(!err) {
|
||||
var tiddlers = self.wiki.deserializeTiddlers(".tid",data,self.wiki.getCreationFields());
|
||||
$tw.utils.each(tiddlers,function(tiddler) {
|
||||
tiddler["_canonical_uri"] = url;
|
||||
});
|
||||
if(tiddlers) {
|
||||
self.wiki.addTiddlers(tiddlers);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
*/
|
||||
WikiParser.prototype.setupRules = function(proto,configPrefix) {
|
||||
var self = this;
|
||||
if(!$tw.safemode) {
|
||||
$tw.utils.each(proto,function(object,name) {
|
||||
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
|
||||
delete proto[name];
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Instantiate an array of parse rules
|
||||
*/
|
||||
@@ -122,7 +166,7 @@ WikiParser.prototype.findNextMatch = function(rules,startPos) {
|
||||
Parse any pragmas at the beginning of a block of parse text
|
||||
*/
|
||||
WikiParser.prototype.parsePragmas = function() {
|
||||
var tree = [];
|
||||
var currentTreeBranch = this.tree;
|
||||
while(true) {
|
||||
// Skip whitespace
|
||||
this.skipWhitespace();
|
||||
@@ -137,9 +181,15 @@ WikiParser.prototype.parsePragmas = function() {
|
||||
break;
|
||||
}
|
||||
// Process the pragma rule
|
||||
tree.push.apply(tree,nextMatch.rule.parse());
|
||||
var subTree = nextMatch.rule.parse();
|
||||
if(subTree.length > 0) {
|
||||
// Quick hack; we only cope with a single parse tree node being returned, which is true at the moment
|
||||
currentTreeBranch.push.apply(currentTreeBranch,subTree);
|
||||
subTree[0].children = [];
|
||||
currentTreeBranch = subTree[0].children;
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
return currentTreeBranch;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -18,7 +18,7 @@ exports.after = ["load-modules"];
|
||||
exports.synchronous = true;
|
||||
|
||||
// Set to `true` to enable performance instrumentation
|
||||
var PERFORMANCE_INSTRUMENTATION = false;
|
||||
var PERFORMANCE_INSTRUMENTATION_CONFIG_TITLE = "$:/config/Performance/Instrumentation";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
|
||||
@@ -29,7 +29,7 @@ exports.startup = function() {
|
||||
}
|
||||
$tw.version = $tw.utils.extractVersionInfo();
|
||||
// Set up the performance framework
|
||||
$tw.perf = new $tw.Performance(PERFORMANCE_INSTRUMENTATION);
|
||||
$tw.perf = new $tw.Performance($tw.wiki.getTiddlerText(PERFORMANCE_INSTRUMENTATION_CONFIG_TITLE,"no") === "yes");
|
||||
// Kick off the language manager and switcher
|
||||
$tw.language = new $tw.Language();
|
||||
$tw.languageSwitcher = new $tw.PluginSwitcher({
|
||||
|
||||
@@ -118,7 +118,7 @@ function openStartupTiddlers(options) {
|
||||
}
|
||||
// Process the story filter to get the story list
|
||||
var storyList = $tw.wiki.filterTiddlers(storyFilter);
|
||||
//invoke any hooks that might change the default story list
|
||||
// Invoke any hooks that want to change the default story list
|
||||
storyList = $tw.hooks.invokeHook("th-opening-default-tiddlers-list",storyList);
|
||||
// If the target tiddler isn't included then splice it in at the top
|
||||
if(target && storyList.indexOf(target) === -1) {
|
||||
|
||||
@@ -30,7 +30,8 @@ exports.startup = function() {
|
||||
paramObject = event.paramObject || {},
|
||||
template = paramObject.template || "$:/core/templates/single.tiddler.window",
|
||||
width = paramObject.width || "700",
|
||||
height = paramObject.height || "600";
|
||||
height = paramObject.height || "600",
|
||||
variables = $tw.utils.extend({},paramObject,{currentTiddler: title});
|
||||
// Open the window
|
||||
var srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
|
||||
srcDocument = srcWindow.document;
|
||||
@@ -48,7 +49,7 @@ exports.startup = function() {
|
||||
$tw.wiki.removeEventListener("change",refreshHandler);
|
||||
},false);
|
||||
// Set up the styles
|
||||
var styleWidgetNode = $tw.wiki.makeTranscludeWidget("$:/core/ui/PageStylesheet",{document: $tw.fakeDocument}),
|
||||
var styleWidgetNode = $tw.wiki.makeTranscludeWidget("$:/core/ui/PageStylesheet",{document: $tw.fakeDocument, variables: variables}),
|
||||
styleContainer = $tw.fakeDocument.createElement("style");
|
||||
styleWidgetNode.render(styleContainer,null);
|
||||
var styleElement = srcDocument.createElement("style");
|
||||
@@ -56,7 +57,7 @@ exports.startup = function() {
|
||||
srcDocument.head.insertBefore(styleElement,srcDocument.head.firstChild);
|
||||
// Render the text of the tiddler
|
||||
var parser = $tw.wiki.parseTiddler(template),
|
||||
widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: {currentTiddler: title}});
|
||||
widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: variables});
|
||||
widgetNode.render(srcDocument.body,srcDocument.body.firstChild);
|
||||
// Function to handle refreshes
|
||||
refreshHandler = function(changes) {
|
||||
|
||||
138
core/modules/story.js
Normal file
138
core/modules/story.js
Normal file
@@ -0,0 +1,138 @@
|
||||
/*\
|
||||
title: $:/core/modules/story.js
|
||||
type: application/javascript
|
||||
module-type: global
|
||||
|
||||
Lightweight object for managing interactions with the story and history lists.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Construct Story object with options:
|
||||
wiki: reference to wiki object to use to resolve tiddler titles
|
||||
storyTitle: title of story list tiddler
|
||||
historyTitle: title of history list tiddler
|
||||
*/
|
||||
function Story(options) {
|
||||
options = options || {};
|
||||
this.wiki = options.wiki || $tw.wiki;
|
||||
this.storyTitle = options.storyTitle || "$:/StoryList";
|
||||
this.historyTitle = options.historyTitle || "$:/HistoryList";
|
||||
};
|
||||
|
||||
Story.prototype.navigateTiddler = function(navigateTo,navigateFromTitle,navigateFromClientRect) {
|
||||
this.addToStory(navigateTo,navigateFromTitle);
|
||||
this.addToHistory(navigateTo,navigateFromClientRect);
|
||||
};
|
||||
|
||||
Story.prototype.getStoryList = function() {
|
||||
return this.wiki.getTiddlerList(this.storyTitle) || [];
|
||||
};
|
||||
|
||||
Story.prototype.addToStory = function(navigateTo,navigateFromTitle,options) {
|
||||
options = options || {};
|
||||
var storyList = this.getStoryList();
|
||||
// See if the tiddler is already there
|
||||
var slot = storyList.indexOf(navigateTo);
|
||||
// Quit if it already exists in the story river
|
||||
if(slot >= 0) {
|
||||
return;
|
||||
}
|
||||
// First we try to find the position of the story element we navigated from
|
||||
var fromIndex = storyList.indexOf(navigateFromTitle);
|
||||
if(fromIndex >= 0) {
|
||||
// The tiddler is added from inside the river
|
||||
// Determine where to insert the tiddler; Fallback is "below"
|
||||
switch(options.openLinkFromInsideRiver) {
|
||||
case "top":
|
||||
slot = 0;
|
||||
break;
|
||||
case "bottom":
|
||||
slot = storyList.length;
|
||||
break;
|
||||
case "above":
|
||||
slot = fromIndex;
|
||||
break;
|
||||
case "below": // Intentional fall-through
|
||||
default:
|
||||
slot = fromIndex + 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// The tiddler is opened from outside the river. Determine where to insert the tiddler; default is "top"
|
||||
if(options.openLinkFromOutsideRiver === "bottom") {
|
||||
// Insert at bottom
|
||||
slot = storyList.length;
|
||||
} else {
|
||||
// Insert at top
|
||||
slot = 0;
|
||||
}
|
||||
}
|
||||
// Add the tiddler
|
||||
storyList.splice(slot,0,navigateTo);
|
||||
// Save the story
|
||||
this.saveStoryList(storyList);
|
||||
};
|
||||
|
||||
Story.prototype.saveStoryList = function(storyList) {
|
||||
var storyTiddler = this.wiki.getTiddler(this.storyTitle);
|
||||
this.wiki.addTiddler(new $tw.Tiddler(
|
||||
this.wiki.getCreationFields(),
|
||||
{title: this.storyTitle},
|
||||
storyTiddler,
|
||||
{list: storyList},
|
||||
this.wiki.getModificationFields()
|
||||
));
|
||||
};
|
||||
|
||||
Story.prototype.addToHistory = function(navigateTo,navigateFromClientRect) {
|
||||
var titles = $tw.utils.isArray(navigateTo) ? navigateTo : [navigateTo];
|
||||
// Add a new record to the top of the history stack
|
||||
var historyList = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
historyList.push({title: title, fromPageRect: navigateFromClientRect});
|
||||
});
|
||||
this.wiki.setTiddlerData(this.historyTitle,historyList,{"current-tiddler": titles[titles.length-1]});
|
||||
};
|
||||
|
||||
Story.prototype.storyCloseTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyCloseAllTiddlers = function() {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyCloseOtherTiddlers = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyEditTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyDeleteTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storySaveTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyCancelTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
Story.prototype.storyNewTiddler = function(targetTitle) {
|
||||
// TBD
|
||||
};
|
||||
|
||||
exports.Story = Story;
|
||||
|
||||
|
||||
})();
|
||||
@@ -18,7 +18,7 @@ var ZoominListView = function(listWidget) {
|
||||
var self = this;
|
||||
this.listWidget = listWidget;
|
||||
// Get the index of the tiddler that is at the top of the history
|
||||
var history = this.listWidget.wiki.getTiddlerData(this.listWidget.historyTitle,[]),
|
||||
var history = this.listWidget.wiki.getTiddlerDataCached(this.listWidget.historyTitle,[]),
|
||||
targetTiddler;
|
||||
if(history.length > 0) {
|
||||
targetTiddler = history[history.length-1].title;
|
||||
|
||||
@@ -44,7 +44,7 @@ exports.upgrade = function(wiki,titles,tiddlers) {
|
||||
var mapping = MAPPINGS[title];
|
||||
if(mapping) {
|
||||
var tiddler = new $tw.Tiddler(tiddlers[title]),
|
||||
tiddlerData = wiki.getTiddlerData(tiddler,{});
|
||||
tiddlerData = wiki.getTiddlerDataCached(tiddler,{});
|
||||
for(var index in mapping) {
|
||||
var mappedTitle = mapping[index];
|
||||
if(!tiddlers[mappedTitle] || tiddlers[mappedTitle].title !== mappedTitle) {
|
||||
|
||||
@@ -43,7 +43,7 @@ exports.convertStyleNameToPropertyName = function(styleName) {
|
||||
// Convert it by first removing any hyphens
|
||||
var propertyName = $tw.utils.unHyphenateCss(styleName);
|
||||
// Then check if it needs a prefix
|
||||
if(document.body.style[propertyName] === undefined) {
|
||||
if($tw.browser && document.body.style[propertyName] === undefined) {
|
||||
var prefixes = ["O","MS","Moz","webkit"];
|
||||
for(var t=0; t<prefixes.length; t++) {
|
||||
var prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1);
|
||||
|
||||
@@ -58,7 +58,11 @@ exports.httpRequest = function(options) {
|
||||
if(data && !$tw.utils.hop(headers,"Content-type")) {
|
||||
request.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");
|
||||
}
|
||||
request.send(data);
|
||||
try {
|
||||
request.send(data);
|
||||
} catch(e) {
|
||||
options.callback(e);
|
||||
}
|
||||
return request;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,12 +31,7 @@ Trigger a popup open or closed. Parameters are in a hashmap:
|
||||
*/
|
||||
Popup.prototype.triggerPopup = function(options) {
|
||||
// Check if this popup is already active
|
||||
var index = -1;
|
||||
for(var t=0; t<this.popups.length; t++) {
|
||||
if(this.popups[t].title === options.title) {
|
||||
index = t;
|
||||
}
|
||||
}
|
||||
var index = this.findPopup(options.title);
|
||||
// Compute the new state
|
||||
var state = index === -1;
|
||||
if(options.force !== undefined) {
|
||||
@@ -50,6 +45,16 @@ Popup.prototype.triggerPopup = function(options) {
|
||||
}
|
||||
};
|
||||
|
||||
Popup.prototype.findPopup = function(title) {
|
||||
var index = -1;
|
||||
for(var t=0; t<this.popups.length; t++) {
|
||||
if(this.popups[t].title === title) {
|
||||
index = t;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
Popup.prototype.handleEvent = function(event) {
|
||||
if(event.type === "click") {
|
||||
// Find out what was clicked on
|
||||
@@ -107,12 +112,14 @@ Popup.prototype.show = function(options) {
|
||||
var info = this.popupInfo(options.domNode);
|
||||
// Cancel any higher level popups
|
||||
this.cancel(info.popupLevel);
|
||||
// Store the popup details
|
||||
this.popups.push({
|
||||
title: options.title,
|
||||
wiki: options.wiki,
|
||||
domNode: options.domNode
|
||||
});
|
||||
// Store the popup details if not already there
|
||||
if(this.findPopup(options.title) === -1) {
|
||||
this.popups.push({
|
||||
title: options.title,
|
||||
wiki: options.wiki,
|
||||
domNode: options.domNode
|
||||
});
|
||||
}
|
||||
// Set the state tiddler
|
||||
options.wiki.setTextReference(options.title,
|
||||
"(" + options.domNode.offsetLeft + "," + options.domNode.offsetTop + "," +
|
||||
|
||||
@@ -26,6 +26,12 @@ var TW_TextNode = function(text) {
|
||||
this.textContent = text;
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
|
||||
get: function() {
|
||||
return 3;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(TW_TextNode.prototype, "formattedTextContent", {
|
||||
get: function() {
|
||||
return this.textContent.replace(/(\r?\n)/g,"");
|
||||
@@ -43,6 +49,19 @@ var TW_Element = function(tag,namespace) {
|
||||
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "nodeType", {
|
||||
get: function() {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
TW_Element.prototype.getAttribute = function(name) {
|
||||
if(this.isRaw) {
|
||||
throw "Cannot getAttribute on a raw TW_Element";
|
||||
}
|
||||
return this.attributes[name];
|
||||
};
|
||||
|
||||
TW_Element.prototype.setAttribute = function(name,value) {
|
||||
if(this.isRaw) {
|
||||
throw "Cannot setAttribute on a raw TW_Element";
|
||||
@@ -93,6 +112,12 @@ TW_Element.prototype.hasChildNodes = function() {
|
||||
return !!this.children.length;
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "childNodes", {
|
||||
get: function() {
|
||||
return this.children;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "firstChild", {
|
||||
get: function() {
|
||||
return this.children[0];
|
||||
@@ -103,6 +128,12 @@ TW_Element.prototype.addEventListener = function(type,listener,useCapture) {
|
||||
// Do nothing
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "tagName", {
|
||||
get: function() {
|
||||
return this.tag || "";
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(TW_Element.prototype, "className", {
|
||||
get: function() {
|
||||
return this.attributes["class"] || "";
|
||||
|
||||
@@ -56,4 +56,24 @@ exports.findParseTreeNode = function(nodeArray,search) {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
/*
|
||||
Helper to get the text of a parse tree node or array of nodes
|
||||
*/
|
||||
exports.getParseTreeText = function getParseTreeText(tree) {
|
||||
var output = [];
|
||||
if($tw.utils.isArray(tree)) {
|
||||
$tw.utils.each(tree,function(node) {
|
||||
output.push(getParseTreeText(node));
|
||||
});
|
||||
} else {
|
||||
if(tree.type === "text") {
|
||||
output.push(tree.text);
|
||||
}
|
||||
if(tree.children) {
|
||||
return getParseTreeText(tree.children);
|
||||
}
|
||||
}
|
||||
return output.join("");
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -28,9 +28,9 @@ Performance.prototype.report = function(name,fn) {
|
||||
self.measures = {};
|
||||
var startTime = $tw.utils.timer(),
|
||||
result = fn.apply(this,arguments);
|
||||
self.logger.log(name + ": " + $tw.utils.timer(startTime) + "ms");
|
||||
self.logger.log(name + ": " + $tw.utils.timer(startTime).toFixed(2) + "ms");
|
||||
for(var m in self.measures) {
|
||||
self.logger.log("+" + m + ": " + self.measures[m] + "ms");
|
||||
self.logger.log("+" + m + ": " + self.measures[m].toFixed(2) + "ms");
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -35,9 +35,7 @@ exports.trim = function(str) {
|
||||
Return the number of keys in an object
|
||||
*/
|
||||
exports.count = function(object) {
|
||||
var s = 0;
|
||||
$tw.utils.each(object,function() {s++;});
|
||||
return s;
|
||||
return Object.keys(object || {}).length;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -171,6 +169,17 @@ exports.extendDeepCopy = function(object,extendedProperties) {
|
||||
return result;
|
||||
};
|
||||
|
||||
exports.deepFreeze = function deepFreeze(object) {
|
||||
var property, key;
|
||||
Object.freeze(object);
|
||||
for(key in object) {
|
||||
property = object[key];
|
||||
if($tw.utils.hop(object,key) && (typeof property === "object") && !Object.isFrozen(property)) {
|
||||
deepFreeze(property);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.slowInSlowOut = function(t) {
|
||||
return (1 - ((Math.cos(t * Math.PI) + 1) / 2));
|
||||
};
|
||||
@@ -622,4 +631,27 @@ exports.makeDataUri = function(text,type) {
|
||||
return parts.join("");
|
||||
};
|
||||
|
||||
})();
|
||||
/*
|
||||
Useful for finding out the fully escaped CSS selector equivalent to a given tag. For example:
|
||||
|
||||
$tw.utils.tagToCssSelector("$:/tags/Stylesheet") --> tc-tagged-\%24\%3A\%2Ftags\%2FStylesheet
|
||||
*/
|
||||
exports.tagToCssSelector = function(tagName) {
|
||||
return "tc-tagged-" + encodeURIComponent(tagName).replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^`{\|}~,]/mg,function(c) {
|
||||
return "\\" + c;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
IE does not have sign function
|
||||
*/
|
||||
exports.sign = Math.sign || function(x) {
|
||||
x = +x; // convert to a number
|
||||
if (x === 0 || isNaN(x)) {
|
||||
return x;
|
||||
}
|
||||
return x > 0 ? 1 : -1;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -67,7 +67,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
removeFields[name] = undefined;
|
||||
}
|
||||
});
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,removeFields));
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getModificationFields(),tiddler,removeFields,this.wiki.getCreationFields()));
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
||||
92
core/modules/widgets/action-listops.js
Normal file
92
core/modules/widgets/action-listops.js
Normal file
@@ -0,0 +1,92 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/action-listops.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Action widget to apply list operations to any tiddler field (defaults to the 'list' field of the current tiddler)
|
||||
|
||||
\*/
|
||||
(function() {
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
var ActionListopsWidget = function(parseTreeNode, options) {
|
||||
this.initialise(parseTreeNode, options);
|
||||
};
|
||||
/**
|
||||
* Inherit from the base widget class
|
||||
*/
|
||||
ActionListopsWidget.prototype = new Widget();
|
||||
/**
|
||||
* Render this widget into the DOM
|
||||
*/
|
||||
ActionListopsWidget.prototype.render = function(parent, nextSibling) {
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
};
|
||||
/**
|
||||
* Compute the internal state of the widget
|
||||
*/
|
||||
ActionListopsWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.target = this.getAttribute("$tiddler", this.getVariable(
|
||||
"currentTiddler"));
|
||||
this.filter = this.getAttribute("$filter");
|
||||
this.subfilter = this.getAttribute("$subfilter");
|
||||
this.listField = this.getAttribute("$field", "list");
|
||||
this.listIndex = this.getAttribute("$index");
|
||||
this.filtertags = this.getAttribute("$tags");
|
||||
};
|
||||
/**
|
||||
* Refresh the widget by ensuring our attributes are up to date
|
||||
*/
|
||||
ActionListopsWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.$tiddler || changedAttributes.$filter ||
|
||||
changedAttributes.$subfilter || changedAttributes.$field ||
|
||||
changedAttributes.$index || changedAttributes.$tags) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
}
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
};
|
||||
/**
|
||||
* Invoke the action associated with this widget
|
||||
*/
|
||||
ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
||||
event) {
|
||||
//Apply the specified filters to the lists
|
||||
var field = this.listField,
|
||||
index,
|
||||
type = "!!",
|
||||
list = this.listField;
|
||||
if(this.listIndex) {
|
||||
field = undefined;
|
||||
index = this.listIndex;
|
||||
type = "##";
|
||||
list = this.listIndex;
|
||||
}
|
||||
if(this.filter) {
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(
|
||||
this.wiki
|
||||
.filterTiddlers(this.filter, this)));
|
||||
}
|
||||
if(this.subfilter) {
|
||||
var subfilter = "[list[" + this.target + type + list + "]] " + this.subfilter;
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(
|
||||
this.wiki
|
||||
.filterTiddlers(subfilter, this)));
|
||||
}
|
||||
if(this.filtertags) {
|
||||
var tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags;
|
||||
this.wiki.setText(this.target, "tags", undefined, $tw.utils.stringifyList(
|
||||
this.wiki.filterTiddlers(tagfilter, this)));
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
||||
exports["action-listops"] = ActionListopsWidget;
|
||||
|
||||
})();
|
||||
@@ -39,6 +39,7 @@ SetFieldWidget.prototype.execute = function() {
|
||||
this.actionField = this.getAttribute("$field");
|
||||
this.actionIndex = this.getAttribute("$index");
|
||||
this.actionValue = this.getAttribute("$value");
|
||||
this.actionTimestamp = this.getAttribute("$timestamp","yes") === "yes";
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -57,13 +58,15 @@ SetFieldWidget.prototype.refresh = function(changedTiddlers) {
|
||||
Invoke the action associated with this widget
|
||||
*/
|
||||
SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
var self = this;
|
||||
if(typeof this.actionValue === "string") {
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue);
|
||||
var self = this,
|
||||
options = {};
|
||||
options.suppressTimestamp = !this.actionTimestamp;
|
||||
if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) {
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
|
||||
}
|
||||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
self.wiki.setText(self.actionTiddler,name,undefined,attribute);
|
||||
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
|
||||
}
|
||||
});
|
||||
return true; // Action was invoked
|
||||
|
||||
@@ -42,9 +42,14 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.tooltip) {
|
||||
domNode.setAttribute("title",this.tooltip);
|
||||
}
|
||||
// Nw.js supports "nwsaveas" to force a "save as" dialogue that allows a new or existing file to be selected
|
||||
if(this.nwsaveas) {
|
||||
domNode.setAttribute("nwsaveas",this.nwsaveas);
|
||||
}
|
||||
// Nw.js supports "webkitdirectory" to allow a directory to be selected
|
||||
if(this.webkitdirectory) {
|
||||
domNode.setAttribute("webkitdirectory",this.webkitdirectory);
|
||||
}
|
||||
// Add a click event handler
|
||||
domNode.addEventListener("change",function (event) {
|
||||
if(self.message) {
|
||||
@@ -71,6 +76,7 @@ BrowseWidget.prototype.execute = function() {
|
||||
this.param = this.getAttribute("param");
|
||||
this.tooltip = this.getAttribute("tooltip");
|
||||
this.nwsaveas = this.getAttribute("nwsaveas");
|
||||
this.webkitdirectory = this.getAttribute("webkitdirectory");
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -125,7 +125,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
||||
}
|
||||
}
|
||||
if(hasChanged) {
|
||||
this.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ EditBitmapWidget.prototype.saveChanges = function() {
|
||||
type = dataURL.substring(posColon+1,posSemiColon),
|
||||
text = dataURL.substring(posComma+1);
|
||||
var update = {type: type, text: text};
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,update));
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getModificationFields(),tiddler,update,this.wiki.getCreationFields()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.editSize) {
|
||||
domNode.setAttribute("size",this.editSize);
|
||||
}
|
||||
if(this.editRows) {
|
||||
domNode.setAttribute("rows",this.editRows);
|
||||
}
|
||||
// Assign classes
|
||||
if(this.editClass) {
|
||||
domNode.className = this.editClass;
|
||||
@@ -79,7 +82,7 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.editFocus === "true") {
|
||||
if(domNode.focus && domNode.select) {
|
||||
domNode.focus();
|
||||
domNode.select();
|
||||
domNode.select();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -148,6 +151,7 @@ EditTextWidget.prototype.execute = function() {
|
||||
this.editClass = this.getAttribute("class");
|
||||
this.editPlaceholder = this.getAttribute("placeholder");
|
||||
this.editSize = this.getAttribute("size");
|
||||
this.editRows = this.getAttribute("rows");
|
||||
this.editAutoHeight = this.getAttribute("autoHeight","yes") === "yes";
|
||||
this.editMinHeight = this.getAttribute("minHeight",DEFAULT_MIN_TEXT_AREA_HEIGHT);
|
||||
this.editFocusPopup = this.getAttribute("focusPopup");
|
||||
@@ -178,13 +182,15 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
// 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) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else if(changedTiddlers[this.editTitle]) {
|
||||
this.updateEditor(this.getEditInfo().value);
|
||||
return true;
|
||||
}
|
||||
// Fix the height anyway in case there has been a reflow
|
||||
this.fixHeight();
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -211,18 +217,31 @@ EditTextWidget.prototype.updateEditorDomNode = function(text) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get the first parent element that has scrollbars or use the body as fallback.
|
||||
*/
|
||||
EditTextWidget.prototype.getScrollContainer = function(el) {
|
||||
while(el.parentNode) {
|
||||
el = el.parentNode;
|
||||
if(el.scrollTop) {
|
||||
return el;
|
||||
}
|
||||
}
|
||||
return this.document.body;
|
||||
};
|
||||
|
||||
/*
|
||||
Fix the height of textareas to fit their content
|
||||
*/
|
||||
EditTextWidget.prototype.fixHeight = function() {
|
||||
var self = this,
|
||||
domNode = this.domNodes[0];
|
||||
var domNode = this.domNodes[0];
|
||||
if(this.editAutoHeight && domNode && !domNode.isTiddlyWikiFakeDom && this.editTag === "textarea") {
|
||||
// Resize the textarea to fit its content, preserving scroll position
|
||||
var scrollPosition = $tw.utils.getScrollPosition(),
|
||||
scrollTop = scrollPosition.y;
|
||||
// Measure the specified minimum height
|
||||
domNode.style.height = self.editMinHeight;
|
||||
// Get the scroll container and register the current scroll position
|
||||
var container = this.getScrollContainer(domNode),
|
||||
scrollTop = container.scrollTop;
|
||||
// Measure the specified minimum height
|
||||
domNode.style.height = this.editMinHeight;
|
||||
var minHeight = domNode.offsetHeight;
|
||||
// Set its height to auto so that it snaps to the correct height
|
||||
domNode.style.height = "auto";
|
||||
@@ -230,12 +249,11 @@ EditTextWidget.prototype.fixHeight = function() {
|
||||
var newHeight = Math.max(domNode.scrollHeight + domNode.offsetHeight - domNode.clientHeight,minHeight);
|
||||
// Only try to change the height if it has changed
|
||||
if(newHeight !== domNode.offsetHeight) {
|
||||
domNode.style.height = newHeight + "px";
|
||||
domNode.style.height = newHeight + "px";
|
||||
// Make sure that the dimensions of the textarea are recalculated
|
||||
$tw.utils.forceLayout(domNode);
|
||||
// Check that the scroll position is still visible before trying to scroll back to it
|
||||
scrollTop = Math.min(scrollTop,self.document.body.scrollHeight - window.innerHeight);
|
||||
window.scrollTo(scrollPosition.x,scrollTop);
|
||||
// Set the container to the position we registered at the beginning
|
||||
container.scrollTop = scrollTop;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,6 +135,10 @@ FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
|
||||
$tw.utils.pushTop(modification.tags,tag);
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
|
||||
}
|
||||
} else if(typeof event.param === "string" && event.param.trim() !== "" && this.mangleTitle.trim() !== "") {
|
||||
var tag = [];
|
||||
tag.push(event.param.trim());
|
||||
this.wiki.addTiddler({title: this.mangleTitle, tags: tag});
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
|
||||
// Add a keyboard event handler
|
||||
domNode.addEventListener("keydown",function (event) {
|
||||
if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) {
|
||||
self.invokeActions(this,event);
|
||||
self.dispatchMessage(event);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -135,9 +135,9 @@ LinkWidget.prototype.handleClickEvent = function(event) {
|
||||
});
|
||||
if(this.domNodes[0].hasAttribute("href")) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
};
|
||||
|
||||
LinkWidget.prototype.handleDragStartEvent = function(event) {
|
||||
|
||||
@@ -156,7 +156,7 @@ Handle any changes to the history list
|
||||
*/
|
||||
ListWidget.prototype.handleHistoryChanges = function() {
|
||||
// Get the history data
|
||||
var newHistory = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
var newHistory = this.wiki.getTiddlerDataCached(this.historyTitle,[]);
|
||||
// Ignore any entries of the history that match the previous history
|
||||
var entry = 0;
|
||||
while(entry < newHistory.length && entry < this.history.length && newHistory[entry].title === this.history[entry].title) {
|
||||
|
||||
@@ -29,7 +29,12 @@ var NavigatorWidget = function(parseTreeNode,options) {
|
||||
{type: "tm-close-other-tiddlers", handler: "handleCloseOtherTiddlersEvent"},
|
||||
{type: "tm-new-tiddler", handler: "handleNewTiddlerEvent"},
|
||||
{type: "tm-import-tiddlers", handler: "handleImportTiddlersEvent"},
|
||||
{type: "tm-perform-import", handler: "handlePerformImportEvent"}
|
||||
{type: "tm-perform-import", handler: "handlePerformImportEvent"},
|
||||
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
|
||||
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
|
||||
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
|
||||
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
|
||||
{type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -220,14 +225,17 @@ NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
|
||||
return false;
|
||||
}
|
||||
// Replace the specified tiddler with a draft in edit mode
|
||||
var draftTiddler = this.makeDraftTiddler(title),
|
||||
draftTitle = draftTiddler.fields.title,
|
||||
storyList = this.getStoryList();
|
||||
this.removeTitleFromStory(storyList,draftTitle);
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
return false;
|
||||
var draftTiddler = this.makeDraftTiddler(title);
|
||||
// Update the story and history if required
|
||||
if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
|
||||
var draftTitle = draftTiddler.fields.title,
|
||||
storyList = this.getStoryList();
|
||||
this.removeTitleFromStory(storyList,draftTitle);
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Delete a tiddler
|
||||
@@ -333,23 +341,27 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
|
||||
));
|
||||
}
|
||||
if(isConfirmed) {
|
||||
// Save the draft tiddler as the real tiddler
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||
// Create the new tiddler and pass it through the th-saving-tiddler hook
|
||||
var newTiddler = new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||
title: draftTitle,
|
||||
"draft.title": undefined,
|
||||
"draft.of": undefined
|
||||
},this.wiki.getModificationFields()));
|
||||
},this.wiki.getModificationFields());
|
||||
newTiddler = $tw.hooks.invokeHook("th-saving-tiddler",newTiddler);
|
||||
this.wiki.addTiddler(newTiddler);
|
||||
// Remove the draft tiddler
|
||||
this.wiki.deleteTiddler(title);
|
||||
// Remove the original tiddler if we're renaming it
|
||||
if(isRename) {
|
||||
this.wiki.deleteTiddler(draftOf);
|
||||
}
|
||||
// Replace the draft in the story with the original
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
if(draftTitle !== this.storyTitle) {
|
||||
this.saveStoryList(storyList);
|
||||
if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
|
||||
// Replace the draft in the story with the original
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
if(draftTitle !== this.storyTitle) {
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
}
|
||||
// Trigger an autosave
|
||||
$tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
|
||||
@@ -381,13 +393,15 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
|
||||
// Remove the draft tiddler
|
||||
if(isConfirmed) {
|
||||
this.wiki.deleteTiddler(draftTitle);
|
||||
if(originalTiddler) {
|
||||
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
|
||||
this.addToHistory(originalTitle,event.navigateFromClientRect);
|
||||
} else {
|
||||
this.removeTitleFromStory(storyList,draftTitle);
|
||||
if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
|
||||
if(originalTiddler) {
|
||||
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
|
||||
this.addToHistory(originalTitle,event.navigateFromClientRect);
|
||||
} else {
|
||||
this.removeTitleFromStory(storyList,draftTitle);
|
||||
}
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -539,10 +553,10 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
||||
NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
|
||||
var self = this,
|
||||
importTiddler = this.wiki.getTiddler(event.param),
|
||||
importData = this.wiki.getTiddlerData(event.param,{tiddlers: {}}),
|
||||
importData = this.wiki.getTiddlerDataCached(event.param,{tiddlers: {}}),
|
||||
importReport = [];
|
||||
// Add the tiddlers to the store
|
||||
importReport.push("The following tiddlers were imported:\n");
|
||||
importReport.push($tw.language.getString("Import/Imported") + "\n");
|
||||
$tw.utils.each(importData.tiddlers,function(tiddlerFields) {
|
||||
var title = tiddlerFields.title;
|
||||
if(title && importTiddler && importTiddler.fields["selection-" + title] !== "unchecked") {
|
||||
@@ -552,16 +566,60 @@ NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
|
||||
});
|
||||
// Replace the $:/Import tiddler with an import report
|
||||
this.wiki.addTiddler(new $tw.Tiddler({
|
||||
title: IMPORT_TITLE,
|
||||
title: event.param,
|
||||
text: importReport.join("\n"),
|
||||
"status": "complete"
|
||||
}));
|
||||
// Navigate to the $:/Import tiddler
|
||||
this.addToHistory([IMPORT_TITLE]);
|
||||
this.addToHistory([event.param]);
|
||||
// Trigger an autosave
|
||||
$tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleFoldTiddlerEvent = function(event) {
|
||||
var self = this,
|
||||
paramObject = event.paramObject || {};
|
||||
if(paramObject.foldedState) {
|
||||
var foldedState = this.wiki.getTiddlerText(paramObject.foldedState,"show") === "show" ? "hide" : "show";
|
||||
this.wiki.setText(paramObject.foldedState,"text",null,foldedState);
|
||||
}
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleFoldOtherTiddlersEvent = function(event) {
|
||||
var self = this,
|
||||
paramObject = event.paramObject || {},
|
||||
prefix = paramObject.foldedStatePrefix;
|
||||
$tw.utils.each(this.getStoryList(),function(title) {
|
||||
self.wiki.setText(prefix + title,"text",null,event.param === title ? "show" : "hide");
|
||||
});
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleFoldAllTiddlersEvent = function(event) {
|
||||
var self = this,
|
||||
paramObject = event.paramObject || {},
|
||||
prefix = paramObject.foldedStatePrefix;
|
||||
$tw.utils.each(this.getStoryList(),function(title) {
|
||||
self.wiki.setText(prefix + title,"text",null,"hide");
|
||||
});
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
|
||||
var self = this,
|
||||
paramObject = event.paramObject || {},
|
||||
prefix = paramObject.foldedStatePrefix;
|
||||
$tw.utils.each(this.getStoryList(),function(title) {
|
||||
self.wiki.setText(prefix + title,"text",null,"show");
|
||||
});
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
|
||||
var self = this,
|
||||
paramObject = event.paramObject || {},
|
||||
from = paramObject.from || event.tiddlerTitle,
|
||||
to = paramObject.to;
|
||||
$tw.wiki.renameTiddler(from,to);
|
||||
};
|
||||
|
||||
exports.navigator = NavigatorWidget;
|
||||
|
||||
})();
|
||||
|
||||
@@ -79,7 +79,7 @@ RadioWidget.prototype.setValue = function() {
|
||||
var tiddler = this.wiki.getTiddler(this.radioTitle),
|
||||
addition = {};
|
||||
addition[this.radioField] = this.radioValue;
|
||||
this.wiki.addTiddler(new $tw.Tiddler({title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),{title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,12 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
|
||||
Handle a change event
|
||||
*/
|
||||
SelectWidget.prototype.handleChangeEvent = function(event) {
|
||||
var value = this.getSelectDomNode().value;
|
||||
if(this.selectMultiple == false) {
|
||||
var value = this.getSelectDomNode().value;
|
||||
} else {
|
||||
var value = this.getSelectValues()
|
||||
value = $tw.utils.stringifyList(value);
|
||||
}
|
||||
this.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value);
|
||||
};
|
||||
|
||||
@@ -81,9 +86,21 @@ SelectWidget.prototype.setSelectValue = function() {
|
||||
}
|
||||
}
|
||||
// Assign it to the select element if it's different than the current value
|
||||
var domNode = this.getSelectDomNode();
|
||||
if(domNode.value !== value) {
|
||||
domNode.value = value;
|
||||
if (this.selectMultiple) {
|
||||
value = value === undefined ? "" : value;
|
||||
var select = this.getSelectDomNode();
|
||||
var values = Array.isArray(value) ? value : $tw.utils.parseStringArray(value);
|
||||
for(var i=0; i < select.children.length; i++){
|
||||
if(values.indexOf(select.children[i].value) != -1) {
|
||||
select.children[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
var domNode = this.getSelectDomNode();
|
||||
if(domNode.value !== value) {
|
||||
domNode.value = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -94,6 +111,22 @@ SelectWidget.prototype.getSelectDomNode = function() {
|
||||
return this.children[0].domNodes[0];
|
||||
};
|
||||
|
||||
// Return an array of the selected opion values
|
||||
// select is an HTML select element
|
||||
SelectWidget.prototype.getSelectValues = function() {
|
||||
var select, result, options, opt;
|
||||
select = this.getSelectDomNode();
|
||||
result = [];
|
||||
options = select && select.options;
|
||||
for (var i=0; i<options.length; i++) {
|
||||
opt = options[i];
|
||||
if (opt.selected) {
|
||||
result.push(opt.value || opt.text);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
@@ -104,6 +137,8 @@ SelectWidget.prototype.execute = function() {
|
||||
this.selectIndex = this.getAttribute("index");
|
||||
this.selectClass = this.getAttribute("class");
|
||||
this.selectDefault = this.getAttribute("default");
|
||||
this.selectMultiple = this.getAttribute("multiple", false);
|
||||
this.selectSize = this.getAttribute("size");
|
||||
// Make the child widgets
|
||||
var selectNode = {
|
||||
type: "element",
|
||||
@@ -113,6 +148,12 @@ SelectWidget.prototype.execute = function() {
|
||||
if(this.selectClass) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"class",this.selectClass);
|
||||
}
|
||||
if(this.selectMultiple) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"multiple","multiple");
|
||||
}
|
||||
if(this.selectSize) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"size",this.selectSize);
|
||||
}
|
||||
this.makeChildWidgets([selectNode]);
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,15 @@ SetWidget.prototype.execute = function() {
|
||||
this.setValue = this.getAttribute("value");
|
||||
this.setEmptyValue = this.getAttribute("emptyValue");
|
||||
// Set context variable
|
||||
this.setVariable(this.setName,this.getValue(),this.parseTreeNode.params);
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Get the value to be assigned
|
||||
*/
|
||||
SetWidget.prototype.getValue = function() {
|
||||
var value = this.setValue;
|
||||
if(this.setFilter) {
|
||||
var results = this.wiki.filterTiddlers(this.setFilter,this);
|
||||
@@ -52,10 +61,10 @@ SetWidget.prototype.execute = function() {
|
||||
if(results.length === 0 && this.setEmptyValue !== undefined) {
|
||||
value = this.setEmptyValue;
|
||||
}
|
||||
} else if(!value && this.setEmptyValue) {
|
||||
value = this.setEmptyValue;
|
||||
}
|
||||
this.setVariable(this.setName,value,this.parseTreeNode.params);
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
return value;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -63,11 +72,12 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
SetWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.name || changedAttributes.filter || changedAttributes.value || changedAttributes.emptyValue) {
|
||||
if(changedAttributes.name || changedAttributes.filter || changedAttributes.value || changedAttributes.emptyValue ||
|
||||
(this.setFilter && this.getValue() != this.variables[this.setName].value)) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ ViewWidget.prototype.execute = function() {
|
||||
case "htmlwikified":
|
||||
this.text = this.getValueAsHtmlWikified();
|
||||
break;
|
||||
case "htmlencodedplainwikified":
|
||||
this.text = this.getValueAsHtmlEncodedPlainWikified();
|
||||
break;
|
||||
case "htmlencoded":
|
||||
this.text = this.getValueAsHtmlEncoded();
|
||||
break;
|
||||
@@ -132,6 +135,10 @@ ViewWidget.prototype.getValueAsHtmlWikified = function() {
|
||||
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
|
||||
};
|
||||
|
||||
ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function() {
|
||||
return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this}));
|
||||
};
|
||||
|
||||
ViewWidget.prototype.getValueAsHtmlEncoded = function() {
|
||||
return $tw.utils.htmlEncode(this.getValueAsText());
|
||||
};
|
||||
|
||||
@@ -195,16 +195,23 @@ Widget.prototype.hasVariable = function(name,value) {
|
||||
Construct a qualifying string based on a hash of concatenating the values of a given variable in the parent chain
|
||||
*/
|
||||
Widget.prototype.getStateQualifier = function(name) {
|
||||
this.qualifiers = this.qualifiers || Object.create(null);
|
||||
name = name || "transclusion";
|
||||
var output = [],
|
||||
node = this;
|
||||
while(node && node.parentWidget) {
|
||||
if($tw.utils.hop(node.parentWidget.variables,name)) {
|
||||
output.push(node.getVariable(name));
|
||||
if(this.qualifiers[name]) {
|
||||
return this.qualifiers[name];
|
||||
} else {
|
||||
var output = [],
|
||||
node = this;
|
||||
while(node && node.parentWidget) {
|
||||
if($tw.utils.hop(node.parentWidget.variables,name)) {
|
||||
output.push(node.getVariable(name));
|
||||
}
|
||||
node = node.parentWidget;
|
||||
}
|
||||
node = node.parentWidget;
|
||||
var value = $tw.utils.hashString(output.join(""));
|
||||
this.qualifiers[name] = value;
|
||||
return value;
|
||||
}
|
||||
return $tw.utils.hashString(output.join(""));
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
53
core/modules/wiki-bulkops.js
Normal file
53
core/modules/wiki-bulkops.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*\
|
||||
title: $:/core/modules/wiki-bulkops.js
|
||||
type: application/javascript
|
||||
module-type: wikimethod
|
||||
|
||||
Bulk tiddler operations such as rename.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Rename a tiddler, and relink any tags or lists that reference it.
|
||||
*/
|
||||
exports.renameTiddler = function(fromTitle,toTitle) {
|
||||
var self = this;
|
||||
fromTitle = (fromTitle || "").trim();
|
||||
toTitle = (toTitle || "").trim();
|
||||
if(fromTitle && toTitle && fromTitle !== toTitle) {
|
||||
// Rename the tiddler itself
|
||||
var tiddler = this.getTiddler(fromTitle);
|
||||
this.addTiddler(new $tw.Tiddler(tiddler,{title: toTitle},this.getModificationFields()));
|
||||
this.deleteTiddler(fromTitle);
|
||||
// Rename any tags or lists that reference it
|
||||
this.each(function(tiddler,title) {
|
||||
var tags = (tiddler.fields.tags || []).slice(0),
|
||||
list = (tiddler.fields.list || []).slice(0),
|
||||
isModified = false;
|
||||
// Rename tags
|
||||
$tw.utils.each(tags,function (title,index) {
|
||||
if(title === fromTitle) {
|
||||
tags[index] = toTitle;
|
||||
isModified = true;
|
||||
}
|
||||
});
|
||||
// Rename lists
|
||||
$tw.utils.each(list,function (title,index) {
|
||||
if(title === fromTitle) {
|
||||
list[index] = toTitle;
|
||||
isModified = true;
|
||||
}
|
||||
});
|
||||
if(isModified) {
|
||||
self.addTiddler(new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -58,17 +58,24 @@ exports.setTextReference = function(textRef,value,currTiddlerTitle) {
|
||||
this.setText(title,tr.field,tr.index,value);
|
||||
};
|
||||
|
||||
exports.setText = function(title,field,index,value) {
|
||||
exports.setText = function(title,field,index,value,options) {
|
||||
options = options || {};
|
||||
var creationFields = options.suppressTimestamp ? {} : this.getCreationFields(),
|
||||
modificationFields = options.suppressTimestamp ? {} : this.getModificationFields();
|
||||
// Check if it is a reference to a tiddler field
|
||||
if(index) {
|
||||
var data = this.getTiddlerData(title,Object.create(null));
|
||||
data[index] = value;
|
||||
this.setTiddlerData(title,data,this.getModificationFields());
|
||||
if(value !== undefined) {
|
||||
data[index] = value;
|
||||
} else {
|
||||
delete data[index];
|
||||
}
|
||||
this.setTiddlerData(title,data,modificationFields);
|
||||
} else {
|
||||
var tiddler = this.getTiddler(title),
|
||||
fields = {title: title};
|
||||
fields[field || "text"] = value;
|
||||
this.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));
|
||||
this.addTiddler(new $tw.Tiddler(creationFields,tiddler,fields,modificationFields));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -186,11 +193,11 @@ exports.generateNewTitle = function(baseTitle,options) {
|
||||
};
|
||||
|
||||
exports.isSystemTiddler = function(title) {
|
||||
return title.indexOf("$:/") === 0;
|
||||
return title && title.indexOf("$:/") === 0;
|
||||
};
|
||||
|
||||
exports.isTemporaryTiddler = function(title) {
|
||||
return title.indexOf("$:/temp/") === 0;
|
||||
return title && title.indexOf("$:/temp/") === 0;
|
||||
};
|
||||
|
||||
exports.isImageTiddler = function(title) {
|
||||
@@ -577,7 +584,7 @@ exports.sortByList = function(array,listTitle) {
|
||||
};
|
||||
|
||||
exports.getSubTiddler = function(title,subTiddlerTitle) {
|
||||
var bundleInfo = this.getPluginInfo(title) || this.getTiddlerData(title);
|
||||
var bundleInfo = this.getPluginInfo(title) || this.getTiddlerDataCached(title);
|
||||
if(bundleInfo && bundleInfo.tiddlers) {
|
||||
var subTiddler = bundleInfo.tiddlers[subTiddlerTitle];
|
||||
if(subTiddler) {
|
||||
@@ -613,6 +620,29 @@ Other types currently just return null.
|
||||
|
||||
titleOrTiddler: string tiddler title or a tiddler object
|
||||
defaultData: default data to be returned if the tiddler is missing or doesn't contain data
|
||||
|
||||
Note that the same value is returned for repeated calls for the same tiddler data. The value is frozen to prevent modification; otherwise modifications would be visible to all callers
|
||||
*/
|
||||
exports.getTiddlerDataCached = function(titleOrTiddler,defaultData) {
|
||||
var self = this,
|
||||
tiddler = titleOrTiddler;
|
||||
if(!(tiddler instanceof $tw.Tiddler)) {
|
||||
tiddler = this.getTiddler(tiddler);
|
||||
}
|
||||
if(tiddler) {
|
||||
return this.getCacheForTiddler(tiddler.fields.title,"data",function() {
|
||||
// Return the frozen value
|
||||
var value = self.getTiddlerData(tiddler.fields.title,defaultData);
|
||||
$tw.utils.deepFreeze(value);
|
||||
return value;
|
||||
});
|
||||
} else {
|
||||
return defaultData;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Alternative, uncached version of getTiddlerDataCached(). The return value can be mutated freely and reused
|
||||
*/
|
||||
exports.getTiddlerData = function(titleOrTiddler,defaultData) {
|
||||
var tiddler = titleOrTiddler,
|
||||
@@ -705,29 +735,29 @@ exports.clearGlobalCache = function() {
|
||||
|
||||
// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it
|
||||
exports.getCacheForTiddler = function(title,cacheName,initializer) {
|
||||
|
||||
// Temporarily disable caching so that tweakParseTreeNode() works
|
||||
return initializer();
|
||||
|
||||
// this.caches = this.caches || Object.create(null);
|
||||
// var caches = this.caches[title];
|
||||
// if(caches && caches[cacheName]) {
|
||||
// return caches[cacheName];
|
||||
// } else {
|
||||
// if(!caches) {
|
||||
// caches = Object.create(null);
|
||||
// this.caches[title] = caches;
|
||||
// }
|
||||
// caches[cacheName] = initializer();
|
||||
// return caches[cacheName];
|
||||
// }
|
||||
this.caches = this.caches || Object.create(null);
|
||||
var caches = this.caches[title];
|
||||
if(caches && caches[cacheName]) {
|
||||
return caches[cacheName];
|
||||
} else {
|
||||
if(!caches) {
|
||||
caches = Object.create(null);
|
||||
this.caches[title] = caches;
|
||||
}
|
||||
caches[cacheName] = initializer();
|
||||
return caches[cacheName];
|
||||
}
|
||||
};
|
||||
|
||||
// Clear all caches associated with a particular tiddler
|
||||
// Clear all caches associated with a particular tiddler, or, if the title is null, clear all the caches for all the tiddlers
|
||||
exports.clearCache = function(title) {
|
||||
this.caches = this.caches || Object.create(null);
|
||||
if($tw.utils.hop(this.caches,title)) {
|
||||
delete this.caches[title];
|
||||
if(title) {
|
||||
this.caches = this.caches || Object.create(null);
|
||||
if($tw.utils.hop(this.caches,title)) {
|
||||
delete this.caches[title];
|
||||
}
|
||||
} else {
|
||||
this.caches = Object.create(null);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -753,7 +783,7 @@ Options include:
|
||||
parseAsInline: if true, the text of the tiddler will be parsed as an inline run
|
||||
_canonical_uri: optional string of the canonical URI of this content
|
||||
*/
|
||||
exports.old_parseText = function(type,text,options) {
|
||||
exports.parseText = function(type,text,options) {
|
||||
options = options || {};
|
||||
// Select a parser
|
||||
var Parser = $tw.Wiki.parsers[type];
|
||||
@@ -777,53 +807,19 @@ exports.old_parseText = function(type,text,options) {
|
||||
/*
|
||||
Parse a tiddler according to its MIME type
|
||||
*/
|
||||
exports.old_parseTiddler = function(title,options) {
|
||||
exports.parseTiddler = function(title,options) {
|
||||
options = $tw.utils.extend({},options);
|
||||
var cacheType = options.parseAsInline ? "newInlineParseTree" : "newBlockParseTree",
|
||||
var cacheType = options.parseAsInline ? "inlineParseTree" : "blockParseTree",
|
||||
tiddler = this.getTiddler(title),
|
||||
self = this;
|
||||
return tiddler ? this.getCacheForTiddler(title,cacheType,function() {
|
||||
if(tiddler.hasField("_canonical_uri")) {
|
||||
options._canonical_uri = tiddler.fields._canonical_uri;
|
||||
}
|
||||
return self.old_parseText(tiddler.fields.type,tiddler.fields.text,options);
|
||||
return self.parseText(tiddler.fields.type,tiddler.fields.text,options);
|
||||
}) : null;
|
||||
};
|
||||
|
||||
var tweakMacroDefinition = function(nodeList) {
|
||||
if(nodeList && nodeList[0] && nodeList[0].type === "macrodef") {
|
||||
nodeList[0].type = "set";
|
||||
nodeList[0].attributes = {
|
||||
name: {type: "string", value: nodeList[0].name},
|
||||
value: {type: "string", value: nodeList[0].text}
|
||||
};
|
||||
nodeList[0].children = nodeList.slice(1);
|
||||
nodeList.splice(1,nodeList.length-1);
|
||||
tweakMacroDefinition(nodeList[0].children);
|
||||
}
|
||||
};
|
||||
|
||||
var tweakParser = function(parser) {
|
||||
// Move any macro definitions to contain the body tree
|
||||
tweakMacroDefinition(parser.tree);
|
||||
};
|
||||
|
||||
exports.parseText = function(type,text,options) {
|
||||
var parser = this.old_parseText(type,text,options);
|
||||
if(parser) {
|
||||
tweakParser(parser);
|
||||
}
|
||||
return parser;
|
||||
};
|
||||
|
||||
exports.parseTiddler = function(title,options) {
|
||||
var parser = this.old_parseTiddler(title,options);
|
||||
if(parser) {
|
||||
tweakParser(parser);
|
||||
}
|
||||
return parser;
|
||||
};
|
||||
|
||||
exports.parseTextReference = function(title,field,index,options) {
|
||||
var tiddler,text;
|
||||
if(options.subTiddler) {
|
||||
@@ -1190,14 +1186,8 @@ fromPageRect: page coordinates of the origin of the navigation
|
||||
historyTitle: title of history tiddler (defaults to $:/HistoryList)
|
||||
*/
|
||||
exports.addToHistory = function(title,fromPageRect,historyTitle) {
|
||||
historyTitle = historyTitle || "$:/HistoryList";
|
||||
var titles = $tw.utils.isArray(title) ? title : [title];
|
||||
// Add a new record to the top of the history stack
|
||||
var historyList = this.getTiddlerData(historyTitle,[]);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
historyList.push({title: title, fromPageRect: fromPageRect});
|
||||
});
|
||||
this.setTiddlerData(historyTitle,historyList,{"current-tiddler": titles[titles.length-1]});
|
||||
var story = new $tw.Story({wiki: this, historyTitle: historyTitle});
|
||||
story.addToHistory(title,fromPageRect);
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
10
core/templates/canonical-uri-external-text.tid
Normal file
10
core/templates/canonical-uri-external-text.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/core/templates/canonical-uri-external-text
|
||||
|
||||
<!--
|
||||
|
||||
This template is used to assign the ''_canonical_uri'' field to external text files.
|
||||
|
||||
Change the `./text/` part to a different base URI. The URI can be relative or absolute.
|
||||
|
||||
-->
|
||||
./text/<$view field="title" format="doubleurlencoded"/>.tid
|
||||
@@ -1,6 +1,6 @@
|
||||
title: $:/core/save/all
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
\end
|
||||
{{$:/core/templates/tiddlywiki5.html}}
|
||||
|
||||
6
core/templates/save-lazy-all.tid
Normal file
6
core/templates/save-lazy-all.tid
Normal file
@@ -0,0 +1,6 @@
|
||||
title: $:/core/save/lazy-all
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
|
||||
\end
|
||||
{{$:/core/templates/tiddlywiki5.html}}
|
||||
27
core/ui/AboveStory/tw2-plugin-check.tid
Normal file
27
core/ui/AboveStory/tw2-plugin-check.tid
Normal file
@@ -0,0 +1,27 @@
|
||||
title: $:/core/ui/AboveStory/tw2-plugin-check
|
||||
tags: $:/tags/AboveStory
|
||||
|
||||
\define lingo-base() $:/language/AboveStory/ClassicPlugin/
|
||||
<$list filter="[all[system+tiddlers]tag[systemConfig]limit[1]]">
|
||||
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo Warning>>
|
||||
|
||||
<ul>
|
||||
|
||||
<$list filter="[all[system+tiddlers]tag[systemConfig]limit[1]]">
|
||||
|
||||
<li>
|
||||
|
||||
<$link><$view field="title"/></$link>
|
||||
|
||||
</li>
|
||||
|
||||
</$list>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</$list>
|
||||
@@ -2,8 +2,7 @@ title: $:/core/ui/AlertTemplate
|
||||
|
||||
<div class="tc-alert">
|
||||
<div class="tc-alert-toolbar">
|
||||
<$button message="tm-delete-tiddler" class="tc-btn-invisible">
|
||||
{{$:/core/images/delete-button}}</$button>
|
||||
<$button class="tc-btn-invisible"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/delete-button}}</$button>
|
||||
</div>
|
||||
<div class="tc-alert-subtitle">
|
||||
<$view field="component"/> - <$view field="modified" format="date" template="0hh:0mm:0ss DD MM YYYY"/> <$reveal type="nomatch" state="!!count" text=""><span class="tc-alert-highlight">(count: <$view field="count"/>)</span></$reveal>
|
||||
|
||||
@@ -6,8 +6,8 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/
|
||||
\define install-plugin-button()
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion" emptyMessage="""install""">
|
||||
reinstall
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion" emptyMessage="""{{$:/language/ControlPanel/Plugins/Install}}""">
|
||||
{{$:/language/ControlPanel/Plugins/Reinstall}}
|
||||
</$list>
|
||||
</$button>
|
||||
\end
|
||||
@@ -65,12 +65,12 @@ This plugin is already installed at version <$text text=<<installedVersion>>/>
|
||||
\define load-plugin-library-button()
|
||||
<$button class="tc-btn-big-green">
|
||||
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
|
||||
{{$:/core/images/chevron-right}} open plugin library
|
||||
{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define display-server-assets(type)
|
||||
Search: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
|
||||
{{$:/language/Search/Search}}: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
|
||||
<$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text="">
|
||||
<$button class="tc-btn-invisible">
|
||||
<$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/>
|
||||
|
||||
33
core/ui/ControlPanel/Parsing.tid
Normal file
33
core/ui/ControlPanel/Parsing.tid
Normal file
@@ -0,0 +1,33 @@
|
||||
title: $:/core/ui/ControlPanel/Parsing
|
||||
tags: $:/tags/ControlPanel/Advanced
|
||||
caption: {{$:/language/ControlPanel/Parsing/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Parsing/
|
||||
|
||||
\define parsing-inner(typeCap)
|
||||
<li>
|
||||
<$checkbox tiddler="""$:/config/WikiParserRules/$typeCap$/$(currentTiddler)$""" field="text" checked="enable" unchecked="disable" default="enable"> ''<$text text=<<currentTiddler>>/>'': </$checkbox>
|
||||
</li>
|
||||
\end
|
||||
|
||||
\define parsing-outer(typeLower,typeCap)
|
||||
<ul>
|
||||
<$list filter="[wikiparserrules[$typeLower$]]">
|
||||
<<parsing-inner typeCap:"$typeCap$">>
|
||||
</$list>
|
||||
</ul>
|
||||
\end
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
! <<lingo Pragma/Caption>>
|
||||
|
||||
<<parsing-outer typeLower:"pragma" typeCap:"Pragma">>
|
||||
|
||||
! <<lingo Inline/Caption>>
|
||||
|
||||
<<parsing-outer typeLower:"inline" typeCap:"Inline">>
|
||||
|
||||
! <<lingo Block/Caption>>
|
||||
|
||||
<<parsing-outer typeLower:"block" typeCap:"Block">>
|
||||
@@ -96,9 +96,7 @@ No information provided
|
||||
</$set>
|
||||
\end
|
||||
|
||||
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green" style="background:blue;">
|
||||
{{$:/core/images/download-button}} <<lingo Add/Caption>>
|
||||
</$button>
|
||||
{{$:/core/ui/ControlPanel/Plugins/AddPlugins}}
|
||||
|
||||
<<lingo Installed/Hint>>
|
||||
|
||||
|
||||
7
core/ui/ControlPanel/Plugins/AddPlugins.tid
Normal file
7
core/ui/ControlPanel/Plugins/AddPlugins.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/AddPlugins
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Plugins/
|
||||
|
||||
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green" style="background:blue;">
|
||||
{{$:/core/images/download-button}} <<lingo Add/Caption>>
|
||||
</$button>
|
||||
8
core/ui/ControlPanel/Settings/CamelCase.tid
Normal file
8
core/ui/ControlPanel/Settings/CamelCase.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: $:/core/ui/ControlPanel/Settings/CamelCase
|
||||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/CamelCase/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/CamelCase/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink" field="text" checked="enable" unchecked="disable" default="enable"> <$link to="$:/config/WikiParserRules/Inline/wikilink"><<lingo Description>></$link> </$checkbox>
|
||||
@@ -0,0 +1,8 @@
|
||||
title: $:/core/ui/ControlPanel/Settings/PerformanceInstrumentation
|
||||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/PerformanceInstrumentation/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/Performance/Instrumentation" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Performance/Instrumentation"><<lingo Description>></$link> </$checkbox>
|
||||
@@ -3,18 +3,13 @@ tags: $:/tags/SearchResults
|
||||
caption: {{$:/language/Search/DefaultResults/Caption}}
|
||||
|
||||
\define searchResultList()
|
||||
<$set name="resultCount" value="""<$count filter="[!is[system]search{$(searchTiddler)$}]"/>""">
|
||||
|
||||
{{$:/language/Search/Matches}}
|
||||
|
||||
</$set>
|
||||
|
||||
//<small>Title matches:</small>//
|
||||
//<small>{{$:/language/Search/Matches/Title}}</small>//
|
||||
|
||||
<$list filter="[!is[system]search:title{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
|
||||
|
||||
//<small>All matches:</small>//
|
||||
//<small>{{$:/language/Search/Matches/All}}</small>//
|
||||
|
||||
<$list filter="[!is[system]search{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
|
||||
|
||||
\end
|
||||
<<searchResultList>>
|
||||
|
||||
@@ -5,8 +5,8 @@ tc-tiddler-frame tc-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl
|
||||
\end
|
||||
<div class=<<frame-classes>>>
|
||||
<$set name="storyTiddler" value=<<currentTiddler>>>
|
||||
<$keyboard key="escape" message="tm-cancel-tiddler">
|
||||
<$keyboard key="ctrl+enter" message="tm-save-tiddler">
|
||||
<$keyboard key={{$:/config/shortcuts/cancel-edit-tiddler}} message="tm-cancel-tiddler">
|
||||
<$keyboard key={{$:/config/shortcuts/save-tiddler}} message="tm-save-tiddler">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$list>
|
||||
|
||||
@@ -2,18 +2,37 @@ title: $:/core/ui/EditTemplate/shadow
|
||||
tags: $:/tags/EditTemplate
|
||||
|
||||
\define lingo-base() $:/language/EditTemplate/Shadow/
|
||||
\define pluginLinkBody()
|
||||
<$link to="""$(pluginTitle)$""">
|
||||
<$text text="""$(pluginTitle)$"""/>
|
||||
</$link>
|
||||
\end
|
||||
<$list filter="[all[current]get[draft.of]is[shadow]!is[tiddler]]">
|
||||
|
||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||
|
||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo Warning>>
|
||||
|
||||
</div>
|
||||
</$set>
|
||||
</$list>
|
||||
|
||||
</$list>
|
||||
|
||||
<$list filter="[all[current]get[draft.of]is[shadow]is[tiddler]]">
|
||||
|
||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||
|
||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo OverriddenWarning>>
|
||||
|
||||
</div>
|
||||
</$set>
|
||||
</$list>
|
||||
|
||||
</$list>
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/core/ui/Buttons/delete
|
||||
tags: $:/tags/EditToolbar
|
||||
tags: $:/tags/EditToolbar $:/tags/ViewToolbar
|
||||
caption: {{$:/core/images/delete-button}} {{$:/language/Buttons/Delete/Caption}}
|
||||
description: {{$:/language/Buttons/Delete/Hint}}
|
||||
|
||||
|
||||
@@ -3,11 +3,19 @@ tags: $:/tags/EditToolbar
|
||||
caption: {{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}}
|
||||
description: {{$:/language/Buttons/Save/Hint}}
|
||||
|
||||
<$button message="tm-save-tiddler" tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$fieldmangler>
|
||||
<$button tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
|
||||
<$action-sendmessage $message="tm-add-field" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/newfieldname"/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/>
|
||||
<$action-sendmessage $message="tm-save-tiddler"/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||
{{$:/core/images/done-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Save/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
</$button>
|
||||
</$fieldmangler>
|
||||
|
||||
14
core/ui/PageControls/fold-all.tid
Normal file
14
core/ui/PageControls/fold-all.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/core/ui/Buttons/fold-all
|
||||
tags: $:/tags/PageControls
|
||||
caption: {{$:/core/images/fold-all-button}} {{$:/language/Buttons/FoldAll/Caption}}
|
||||
description: {{$:/language/Buttons/FoldAll/Hint}}
|
||||
|
||||
<$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-fold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
|
||||
{{$:/core/images/fold-all-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/FoldAll/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
14
core/ui/PageControls/unfold-all.tid
Normal file
14
core/ui/PageControls/unfold-all.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/core/ui/Buttons/unfold-all
|
||||
tags: $:/tags/PageControls
|
||||
caption: {{$:/core/images/unfold-all-button}} {{$:/language/Buttons/UnfoldAll/Caption}}
|
||||
description: {{$:/language/Buttons/UnfoldAll/Hint}}
|
||||
|
||||
<$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
|
||||
{{$:/core/images/unfold-all-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/UnfoldAll/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
@@ -5,7 +5,7 @@ tags: $:/tags/PageTemplate
|
||||
|
||||
<div class="tc-sidebar-header">
|
||||
|
||||
<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes" retain="yes">
|
||||
<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes" retain="yes" animate="yes">
|
||||
|
||||
<h1 class="tc-site-title">
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user