mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-22 10:54:46 +00:00
Compare commits
398 Commits
v5.0.6-bet
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9e3550747 | ||
|
|
3d1a8ee703 | ||
|
|
17902d1a1e | ||
|
|
622d4a2d50 | ||
|
|
0cff397111 | ||
|
|
fbf4486d92 | ||
|
|
2714e0939f | ||
|
|
bde6f8d2b8 | ||
|
|
4194f9f20f | ||
|
|
2c6e7ef489 | ||
|
|
cc5be5eb15 | ||
|
|
be8efe1bc7 | ||
|
|
db3c06ecd0 | ||
|
|
947b48bcf9 | ||
|
|
bed6cc7d67 | ||
|
|
63cb0eb3db | ||
|
|
89c7310a53 | ||
|
|
f244293cac | ||
|
|
3994f0dbc6 | ||
|
|
66bb7ad6ba | ||
|
|
84928ac99c | ||
|
|
6b4ec343a7 | ||
|
|
3ff85e9507 | ||
|
|
cd09cf3874 | ||
|
|
9ce79b0795 | ||
|
|
e2f964ae73 | ||
|
|
2aca526d4e | ||
|
|
0aa9f26d51 | ||
|
|
9e820a602b | ||
|
|
d38c513512 | ||
|
|
83b2a5d305 | ||
|
|
bcc282016e | ||
|
|
cdc99ac29c | ||
|
|
cf4eed0129 | ||
|
|
70306de1b1 | ||
|
|
a1a5ada68f | ||
|
|
9233069065 | ||
|
|
e5103c32f3 | ||
|
|
cadeb9654c | ||
|
|
2ed8df0d1f | ||
|
|
3636744d4f | ||
|
|
8ce7c3920c | ||
|
|
470c056b8d | ||
|
|
fd3ce5f668 | ||
|
|
f42246f171 | ||
|
|
599f5978c9 | ||
|
|
042698b508 | ||
|
|
a1ad735822 | ||
|
|
3f6bf2452a | ||
|
|
886d648568 | ||
|
|
dd299bf769 | ||
|
|
f3930ad69c | ||
|
|
b0394f1560 | ||
|
|
327403b3c9 | ||
|
|
6cd13efd48 | ||
|
|
6947f8ebc2 | ||
|
|
0623dd5b7f | ||
|
|
99ccdf4584 | ||
|
|
a332b82df5 | ||
|
|
7f5f4df562 | ||
|
|
2b4dfba2ff | ||
|
|
260080164f | ||
|
|
3f7ff22280 | ||
|
|
51c1a863f8 | ||
|
|
823b4fa61b | ||
|
|
c3f9cf41d5 | ||
|
|
ecb845f1cd | ||
|
|
0737e62161 | ||
|
|
39ee69910e | ||
|
|
2ab0facf3a | ||
|
|
6bff3e3163 | ||
|
|
ec606c89d2 | ||
|
|
9e0f1240c5 | ||
|
|
199fdb090d | ||
|
|
d6a44b67a3 | ||
|
|
2e7efe2dc0 | ||
|
|
639fd4be20 | ||
|
|
75ff9fb6c0 | ||
|
|
57c956716e | ||
|
|
cfa6f0a8a6 | ||
|
|
0961b0426b | ||
|
|
cf5fa875aa | ||
|
|
a812c6e386 | ||
|
|
dfbb6e1fba | ||
|
|
31975e0042 | ||
|
|
38ef4fa609 | ||
|
|
7f66df78ff | ||
|
|
96dc489ba8 | ||
|
|
34a7fc6084 | ||
|
|
41575b8012 | ||
|
|
cb5b95add2 | ||
|
|
372553d9da | ||
|
|
747ec243ff | ||
|
|
1bc2700137 | ||
|
|
4ee277f41b | ||
|
|
894588db54 | ||
|
|
68bcbff753 | ||
|
|
d4baf515ed | ||
|
|
d5c31ed07f | ||
|
|
9b6c59e9a6 | ||
|
|
ec0769d7ca | ||
|
|
93f5e736e7 | ||
|
|
c4058c4662 | ||
|
|
f59b84e63b | ||
|
|
c17844b815 | ||
|
|
c761bbe2ed | ||
|
|
279f32080d | ||
|
|
06a0d21734 | ||
|
|
d8513b23c2 | ||
|
|
49b4e86091 | ||
|
|
f522a96064 | ||
|
|
8f9d88f25b | ||
|
|
e88f8ad4e9 | ||
|
|
0480bf023d | ||
|
|
e3c1906eaf | ||
|
|
45f29f6425 | ||
|
|
f4c7a269bd | ||
|
|
46b2c9e24c | ||
|
|
f46864fff5 | ||
|
|
5bc408fa75 | ||
|
|
921ff6ae39 | ||
|
|
b9e72fb676 | ||
|
|
1258c16e2b | ||
|
|
35eb3aee35 | ||
|
|
12016bd0f8 | ||
|
|
3817ba642d | ||
|
|
d6ef67e817 | ||
|
|
a51a5e969f | ||
|
|
ae9d0f8288 | ||
|
|
b26b620548 | ||
|
|
d21fb85d94 | ||
|
|
bcd86d5861 | ||
|
|
5417b8c4d7 | ||
|
|
2744671211 | ||
|
|
88ffb2ad12 | ||
|
|
aa27305134 | ||
|
|
a186b6f978 | ||
|
|
e55e7ab31b | ||
|
|
e1dfb621f5 | ||
|
|
bd552aedde | ||
|
|
3f89d2d0fa | ||
|
|
c999d82a23 | ||
|
|
118b841aa2 | ||
|
|
ca1daf5a4e | ||
|
|
5e9dae8fb4 | ||
|
|
d00a82e9e9 | ||
|
|
3307604130 | ||
|
|
1ff8d225d9 | ||
|
|
489509c810 | ||
|
|
aa6e02ce8e | ||
|
|
df8ff9eb26 | ||
|
|
e051eb7d90 | ||
|
|
75b9de222e | ||
|
|
5a45fffa9e | ||
|
|
5252328dd9 | ||
|
|
a763610db1 | ||
|
|
c43cd325ca | ||
|
|
e9ba7f3d70 | ||
|
|
68809f9333 | ||
|
|
42b8b86e52 | ||
|
|
69c0b5e031 | ||
|
|
30997f3f24 | ||
|
|
bea8730a47 | ||
|
|
c3254bc981 | ||
|
|
e43a190dab | ||
|
|
4836cf83e2 | ||
|
|
44678b2ea2 | ||
|
|
70a120d4a6 | ||
|
|
28212f08b2 | ||
|
|
9bb600299f | ||
|
|
9db887748b | ||
|
|
800bc639f9 | ||
|
|
dc8e84fcb7 | ||
|
|
ad4e7ccb17 | ||
|
|
4654f6b971 | ||
|
|
6f23aeabb4 | ||
|
|
21eae0135d | ||
|
|
470beabf17 | ||
|
|
523eae83ff | ||
|
|
ca0c352278 | ||
|
|
0dc8de9dd2 | ||
|
|
b5225f5ca8 | ||
|
|
1a8d6811b7 | ||
|
|
d56eec40c9 | ||
|
|
b72d7f1447 | ||
|
|
ecad2bf7a8 | ||
|
|
f67e216b3a | ||
|
|
8b3bfa6805 | ||
|
|
01fa82fac1 | ||
|
|
d5b526914b | ||
|
|
5c66bc6dbc | ||
|
|
1eab3ecbb2 | ||
|
|
280bbde329 | ||
|
|
dd451800c7 | ||
|
|
190ced7cdd | ||
|
|
7a62a86baf | ||
|
|
1086c51019 | ||
|
|
daa79a8612 | ||
|
|
441d9078fa | ||
|
|
f0ab607ea1 | ||
|
|
afaf5b23c9 | ||
|
|
f68d48fcd3 | ||
|
|
10891081ca | ||
|
|
ecba4f71ea | ||
|
|
e003889171 | ||
|
|
1f41daf433 | ||
|
|
a2cbc2deb5 | ||
|
|
dea08ed4f8 | ||
|
|
d1bc053a9c | ||
|
|
73c30716dc | ||
|
|
8ad34e2db9 | ||
|
|
b26a32b93a | ||
|
|
f54122b90e | ||
|
|
828fc9dcd0 | ||
|
|
f0d512edf0 | ||
|
|
2758e586bd | ||
|
|
68bcfe1c8c | ||
|
|
dbd63e6fe7 | ||
|
|
a01bbd4b9c | ||
|
|
8e8e31fb9f | ||
|
|
6d3d3322e5 | ||
|
|
d02ce5dbf3 | ||
|
|
32f290dc13 | ||
|
|
1d685df928 | ||
|
|
4882f70557 | ||
|
|
7eafd51a7d | ||
|
|
e6fa9b8a85 | ||
|
|
1a54d590e1 | ||
|
|
d72d245523 | ||
|
|
7b054440ca | ||
|
|
6ed8a7624d | ||
|
|
e3a05625b2 | ||
|
|
9acb10f781 | ||
|
|
8487221654 | ||
|
|
6780a16ce9 | ||
|
|
92aa682bc5 | ||
|
|
405b4a9007 | ||
|
|
0c20092644 | ||
|
|
758d461823 | ||
|
|
29c4ed20ce | ||
|
|
fa59382215 | ||
|
|
02ba92c6b5 | ||
|
|
e58d9c7008 | ||
|
|
ac163a59e8 | ||
|
|
175e86078c | ||
|
|
3b255561b7 | ||
|
|
59379b14fa | ||
|
|
5af30086c0 | ||
|
|
b342f6db67 | ||
|
|
5d3dda1a17 | ||
|
|
70ed6e6ad3 | ||
|
|
8d031afa94 | ||
|
|
a42ba1a310 | ||
|
|
b4b524deae | ||
|
|
8f6ee1d2a8 | ||
|
|
183e9544b4 | ||
|
|
dfc57ffa49 | ||
|
|
3f9561dd95 | ||
|
|
37ca86ff3d | ||
|
|
cf26986061 | ||
|
|
54822e25d4 | ||
|
|
4a9108154d | ||
|
|
8a88253b4e | ||
|
|
7891824883 | ||
|
|
fca5681a1a | ||
|
|
5c9a5f5cba | ||
|
|
69d342d46a | ||
|
|
66254b436c | ||
|
|
d42981f201 | ||
|
|
04dbf99e54 | ||
|
|
762940adbc | ||
|
|
f58d4fb531 | ||
|
|
45c45e098f | ||
|
|
b5629ccc82 | ||
|
|
bd067c6b1e | ||
|
|
1d10ccb368 | ||
|
|
9297b27b89 | ||
|
|
0b3efe179e | ||
|
|
e6843aabff | ||
|
|
02d3861d7d | ||
|
|
592ef257a2 | ||
|
|
6ba9bf9a95 | ||
|
|
18fe0c0f75 | ||
|
|
c49681ecf3 | ||
|
|
6255b97b14 | ||
|
|
6cb44ac0cc | ||
|
|
b1b9c7d6cd | ||
|
|
951147d502 | ||
|
|
9539664e46 | ||
|
|
f9b5d75446 | ||
|
|
70a7321edd | ||
|
|
9522050aa7 | ||
|
|
8d37219545 | ||
|
|
a76da88380 | ||
|
|
42262a637c | ||
|
|
e6a7a0db1e | ||
|
|
edc71cb920 | ||
|
|
bd48ecfcb1 | ||
|
|
f4b27b33de | ||
|
|
644d88a6c5 | ||
|
|
43eb81173d | ||
|
|
a8eff78b62 | ||
|
|
f90db97625 | ||
|
|
e339b6dffe | ||
|
|
64304f9b7f | ||
|
|
867dfabff8 | ||
|
|
b627bba277 | ||
|
|
b9b1b001da | ||
|
|
e9ae8d2015 | ||
|
|
2fc6451bf7 | ||
|
|
f31369035b | ||
|
|
1e54b1bcc9 | ||
|
|
d3c421985c | ||
|
|
1c283c5586 | ||
|
|
4f5a923ca0 | ||
|
|
95cb99adb9 | ||
|
|
d5df78d979 | ||
|
|
ed5cf8b044 | ||
|
|
98edbec46d | ||
|
|
299e9d15fb | ||
|
|
2f4932fefc | ||
|
|
5f1d49f2e0 | ||
|
|
6ea9dc997f | ||
|
|
c9d06ad18a | ||
|
|
3414f1ca8e | ||
|
|
60926198b1 | ||
|
|
2c790d982f | ||
|
|
839361d54f | ||
|
|
14ca91a949 | ||
|
|
81de74342d | ||
|
|
0338c36610 | ||
|
|
c7fb0bd349 | ||
|
|
d7d5165847 | ||
|
|
aefc7b7ce2 | ||
|
|
1657111cb7 | ||
|
|
08a8689117 | ||
|
|
b1b38dc143 | ||
|
|
22f48198bd | ||
|
|
4072c4461d | ||
|
|
43fb16f232 | ||
|
|
809c441ab3 | ||
|
|
9985efa406 | ||
|
|
84e149e36c | ||
|
|
25423d2d07 | ||
|
|
12770ca3e6 | ||
|
|
a5d75db8d2 | ||
|
|
9444ef095f | ||
|
|
b04141fefd | ||
|
|
c74bf6a655 | ||
|
|
19080f9958 | ||
|
|
b5d2b79a37 | ||
|
|
17b542980f | ||
|
|
8f4e1587a2 | ||
|
|
4b000fac72 | ||
|
|
426f2978cf | ||
|
|
bad2e36e45 | ||
|
|
a4f895dc4d | ||
|
|
e254529763 | ||
|
|
5dff212e5a | ||
|
|
b7a1db1e9f | ||
|
|
6964120fce | ||
|
|
a704498155 | ||
|
|
83811bc2a9 | ||
|
|
bd40977c85 | ||
|
|
e87097c22e | ||
|
|
e74cb05540 | ||
|
|
b326315b0e | ||
|
|
a3384d101e | ||
|
|
8ef520ef37 | ||
|
|
b64b7982af | ||
|
|
c5035fc0b0 | ||
|
|
2740f8c1f0 | ||
|
|
209bc78268 | ||
|
|
ffcc215e8f | ||
|
|
0fb13e649b | ||
|
|
b42eefe1e8 | ||
|
|
82a48cf85c | ||
|
|
9fee9b1043 | ||
|
|
d57010d2fb | ||
|
|
f2409d4245 | ||
|
|
4181de5b74 | ||
|
|
954901d788 | ||
|
|
4688190c96 | ||
|
|
a1d2e70307 | ||
|
|
e0f428b9b2 | ||
|
|
504f353844 | ||
|
|
7857464ab5 | ||
|
|
103f4f6637 | ||
|
|
b06e09a4d3 | ||
|
|
9d72570092 | ||
|
|
b652238650 | ||
|
|
917865c393 | ||
|
|
ec14a0a16d | ||
|
|
ce8cc7607f | ||
|
|
eb7b82696b | ||
|
|
14868d8228 | ||
|
|
3cc8138133 | ||
|
|
8e080eac0a |
52
bld-languages.sh
Normal file
52
bld-languages.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Abbreviated version of bld.sh for quicker builds
|
||||
|
||||
# Set up the build output directory
|
||||
|
||||
if [ -z "$TW5_BUILD_OUTPUT" ]; then
|
||||
TW5_BUILD_OUTPUT=../jermolene.github.com
|
||||
fi
|
||||
|
||||
if [ ! -d "$TW5_BUILD_OUTPUT" ]; then
|
||||
echo 'A valid TW5_BUILD_OUTPUT environment variable must be set'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
|
||||
|
||||
# Make the CNAME file that GitHub Pages requires
|
||||
|
||||
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
|
||||
|
||||
# The tw5.com wiki
|
||||
# index.html: the main file, including content
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/de-AT-DE \
|
||||
--verbose \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/de-AT-DE.html text/plain \
|
||||
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|
||||
|| exit 1
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/zh-Hant \
|
||||
--verbose \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/zh-Hant.html text/plain \
|
||||
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|
||||
|| exit 1
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/zh-Hans \
|
||||
--verbose \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/zh-Hans.html text/plain \
|
||||
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|
||||
|| exit 1
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/fr-FR \
|
||||
--verbose \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/fr-FR.html text/plain \
|
||||
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|
||||
|| exit 1
|
||||
|
||||
9
bld.cmd
9
bld.cmd
@@ -38,6 +38,7 @@ node .\tiddlywiki.js ^
|
||||
--savetiddler $:/favicon.ico %TW5_BUILD_OUTPUT%\favicon.ico ^
|
||||
--rendertiddler ReadMe .\readme.md text/html ^
|
||||
--rendertiddler ContributingTemplate .\contributing.md text/html ^
|
||||
--rendertiddler $:/core/copyright.txt .\licenses\copyright.md text/plain ^
|
||||
--rendertiddler $:/editions/tw5.com/download-empty %TW5_BUILD_OUTPUT%\empty.html text/plain ^
|
||||
--rendertiddler $:/editions/tw5.com/download-empty %TW5_BUILD_OUTPUT%\empty.hta text/plain ^
|
||||
--savetiddler $:/green_favicon.ico %TW5_BUILD_OUTPUT%/static/favicon.ico ^
|
||||
@@ -89,6 +90,14 @@ node .\tiddlywiki.js ^
|
||||
|| exit 1
|
||||
|
||||
|
||||
rem highlightdemo.html: wiki to demo highlight plugin
|
||||
|
||||
node .\tiddlywiki.js ^
|
||||
.\editions\highlightdemo ^
|
||||
--verbose ^
|
||||
--rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\highlightdemo.html text/plain ^
|
||||
|| exit 1
|
||||
|
||||
rem Make the CNAME file that GitHub Pages requires
|
||||
|
||||
echo tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME
|
||||
|
||||
9
bld.sh
9
bld.sh
@@ -39,6 +39,7 @@ node ./tiddlywiki.js \
|
||||
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|
||||
--rendertiddler ReadMe ./readme.md text/html \
|
||||
--rendertiddler ContributingTemplate ./contributing.md text/html \
|
||||
--rendertiddler $:/core/copyright.txt ./licenses/copyright.md text/plain \
|
||||
--rendertiddler $:/editions/tw5.com/download-empty $TW5_BUILD_OUTPUT/empty.html text/plain \
|
||||
--rendertiddler $:/editions/tw5.com/download-empty $TW5_BUILD_OUTPUT/empty.hta text/plain \
|
||||
--savetiddler $:/green_favicon.ico $TW5_BUILD_OUTPUT/static/favicon.ico \
|
||||
@@ -89,6 +90,14 @@ node ./tiddlywiki.js \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/markdowndemo.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# highlightdemo.html: wiki to demo highlight plugin
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/highlightdemo \
|
||||
--verbose \
|
||||
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/highlightdemo.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# Run the test edition to run the Node.js tests and to generate test.html for tests in the browser
|
||||
|
||||
./test.sh
|
||||
|
||||
@@ -14,10 +14,10 @@ Error message and password prompt
|
||||
z-index: 20000;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
width: 480px;
|
||||
width: 200px;
|
||||
top: 4em;
|
||||
left: 50%;
|
||||
margin-left: -264px; /* - width/2 - paddingHorz/2 - border */
|
||||
margin-left: -144px; /* - width/2 - paddingHorz/2 - border */
|
||||
padding: 16px 16px 16px 16px;
|
||||
-webkit-border-radius: 8px;
|
||||
-moz-border-radius: 8px;
|
||||
@@ -29,6 +29,8 @@ Error message and password prompt
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
|
||||
background-color: rgb(255, 75, 75);
|
||||
border: 8px solid rgb(255, 0, 0);
|
||||
width: 480px;
|
||||
margin-left: -244px; /* - width/2 - paddingHorz/2 - border */
|
||||
}
|
||||
|
||||
.tw-error-form div {
|
||||
@@ -54,4 +56,9 @@ Error message and password prompt
|
||||
.tw-password-wrapper h1 {
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.tw-password-wrapper input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
242
boot/boot.js
242
boot/boot.js
@@ -38,7 +38,7 @@ $tw.boot = $tw.boot || {};
|
||||
/////////////////////////// Standard node.js libraries
|
||||
|
||||
var fs, path, vm;
|
||||
if(!$tw.browser) {
|
||||
if($tw.node) {
|
||||
fs = require("fs");
|
||||
path = require("path");
|
||||
vm = require("vm");
|
||||
@@ -46,15 +46,6 @@ if(!$tw.browser) {
|
||||
|
||||
/////////////////////////// Utility functions
|
||||
|
||||
/*
|
||||
Log a message
|
||||
*/
|
||||
$tw.utils.log = function(/* args */) {
|
||||
if(console !== undefined && console.log !== undefined) {
|
||||
return Function.apply.call(console.log, console, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Check if an object has a property
|
||||
*/
|
||||
@@ -207,10 +198,10 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
|
||||
};
|
||||
|
||||
/*
|
||||
Convert "&" to &, "<" to <, ">" to > and """ to "
|
||||
Convert "&" to &, " " to nbsp, "<" to <, ">" to > and """ to "
|
||||
*/
|
||||
$tw.utils.htmlDecode = function(s) {
|
||||
return s.toString().replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\"").replace(/&/mg,"&");
|
||||
return s.toString().replace(/</mg,"<").replace(/ /mg,"\xA0").replace(/>/mg,">").replace(/"/mg,"\"").replace(/&/mg,"&");
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -380,10 +371,11 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) {
|
||||
|
||||
/*
|
||||
Register file type information
|
||||
flags: "image" for image types
|
||||
*/
|
||||
$tw.utils.registerFileType = function(type,encoding,extension) {
|
||||
$tw.utils.registerFileType = function(type,encoding,extension,flags) {
|
||||
$tw.config.fileExtensionInfo[extension] = {type: type};
|
||||
$tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension};
|
||||
$tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension, flags: flags || []};
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -448,11 +440,13 @@ Adds a new password prompt. Options are:
|
||||
submitText: text to use for submit button (defaults to "Login")
|
||||
serviceName: text of the human readable service name
|
||||
noUserName: set true to disable username prompt
|
||||
canCancel: set true to enable a cancel button (callback called with null)
|
||||
callback: function to be called on submission with parameter of object {username:,password:}. Callback must return `true` to remove the password prompt
|
||||
*/
|
||||
$tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
||||
// Create and add the prompt to the DOM
|
||||
var submitText = options.submitText || "Login",
|
||||
var self = this,
|
||||
submitText = options.submitText || "Login",
|
||||
dm = $tw.utils.domMaker,
|
||||
children = [dm("h1",{text: options.serviceName})];
|
||||
if(!options.noUserName) {
|
||||
@@ -465,6 +459,19 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
||||
attributes: {type: "password", name: "password", placeholder: "Password"},
|
||||
"class": "input-small"
|
||||
}));
|
||||
if(options.canCancel) {
|
||||
children.push(dm("button",{
|
||||
text: "Cancel",
|
||||
"class": "btn",
|
||||
eventListeners: [{
|
||||
name: "click",
|
||||
handlerFunction: function(event) {
|
||||
self.removePrompt(promptInfo);
|
||||
options.callback(null);
|
||||
}
|
||||
}]
|
||||
}));
|
||||
}
|
||||
children.push(dm("button",{
|
||||
attributes: {type: "submit"},
|
||||
text: submitText,
|
||||
@@ -492,12 +499,7 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
||||
// Call the callback
|
||||
if(options.callback(data)) {
|
||||
// Remove the prompt if the callback returned true
|
||||
var i = self.passwordPrompts.indexOf(promptInfo);
|
||||
if(i !== -1) {
|
||||
self.passwordPrompts.splice(i,1);
|
||||
promptInfo.form.parentNode.removeChild(promptInfo.form);
|
||||
self.setWrapperDisplay();
|
||||
}
|
||||
self.removePrompt(promptInfo);
|
||||
} else {
|
||||
// Clear the password if the callback returned false
|
||||
$tw.utils.each(form.elements,function(element) {
|
||||
@@ -520,17 +522,29 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
||||
this.setWrapperDisplay();
|
||||
};
|
||||
|
||||
$tw.utils.PasswordPrompt.prototype.removePrompt = function(promptInfo) {
|
||||
var i = this.passwordPrompts.indexOf(promptInfo);
|
||||
if(i !== -1) {
|
||||
this.passwordPrompts.splice(i,1);
|
||||
promptInfo.form.parentNode.removeChild(promptInfo.form);
|
||||
this.setWrapperDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Crypto helper object for encrypted content. It maintains the password text in a closure, and provides methods to change
|
||||
the password, and to encrypt/decrypt a block of text
|
||||
*/
|
||||
$tw.utils.Crypto = function() {
|
||||
var sjcl = $tw.browser ? window.sjcl : require("./sjcl.js"),
|
||||
password = null,
|
||||
callSjcl = function(method,inputText) {
|
||||
currentPassword = null,
|
||||
callSjcl = function(method,inputText,password) {
|
||||
password = password || currentPassword;
|
||||
var outputText;
|
||||
try {
|
||||
outputText = sjcl[method](password,inputText);
|
||||
if(password) {
|
||||
outputText = sjcl[method](password,inputText);
|
||||
}
|
||||
} catch(ex) {
|
||||
console.log("Crypto error:" + ex);
|
||||
outputText = null;
|
||||
@@ -538,22 +552,26 @@ $tw.utils.Crypto = function() {
|
||||
return outputText;
|
||||
};
|
||||
this.setPassword = function(newPassword) {
|
||||
password = newPassword;
|
||||
currentPassword = newPassword;
|
||||
this.updateCryptoStateTiddler();
|
||||
};
|
||||
this.updateCryptoStateTiddler = function() {
|
||||
if($tw.wiki && $tw.wiki.addTiddler) {
|
||||
$tw.wiki.addTiddler(new $tw.Tiddler({title: "$:/isEncrypted", text: password ? "yes" : "no"}));
|
||||
if($tw.wiki) {
|
||||
var state = currentPassword ? "yes" : "no",
|
||||
tiddler = $tw.wiki.getTiddler("$:/isEncrypted");
|
||||
if(!tiddler || tiddler.fields.text !== state) {
|
||||
$tw.wiki.addTiddler(new $tw.Tiddler({title: "$:/isEncrypted", text: state}));
|
||||
}
|
||||
}
|
||||
};
|
||||
this.hasPassword = function() {
|
||||
return !!password;
|
||||
return !!currentPassword;
|
||||
}
|
||||
this.encrypt = function(text) {
|
||||
return callSjcl("encrypt",text);
|
||||
this.encrypt = function(text,password) {
|
||||
return callSjcl("encrypt",text,password);
|
||||
};
|
||||
this.decrypt = function(text) {
|
||||
return callSjcl("decrypt",text);
|
||||
this.decrypt = function(text,password) {
|
||||
return callSjcl("decrypt",text,password);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -779,7 +797,9 @@ $tw.Wiki.prototype.addTiddler = function(tiddler) {
|
||||
if(!(tiddler instanceof $tw.Tiddler)) {
|
||||
tiddler = new $tw.Tiddler(tiddler);
|
||||
}
|
||||
this.tiddlers[tiddler.fields.title] = tiddler;
|
||||
if(tiddler.fields.title) {
|
||||
this.tiddlers[tiddler.fields.title] = tiddler;
|
||||
}
|
||||
};
|
||||
|
||||
$tw.Wiki.prototype.addTiddlers = function(tiddlers) {
|
||||
@@ -859,10 +879,12 @@ $tw.Wiki.prototype.unpackPluginTiddlers = function() {
|
||||
// Extract the constituent tiddlers
|
||||
$tw.utils.each(pluginInfo.tiddlers,function(constituentTiddler,constituentTitle) {
|
||||
// Save the tiddler object
|
||||
self.shadowTiddlers[constituentTitle] = {
|
||||
source: tiddler.fields.title,
|
||||
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
|
||||
};
|
||||
if(constituentTitle) {
|
||||
self.shadowTiddlers[constituentTitle] = {
|
||||
source: tiddler.fields.title,
|
||||
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -911,7 +933,7 @@ $tw.Wiki.prototype.getTiddler = function(title) {
|
||||
var t = this.tiddlers[title];
|
||||
if(t instanceof $tw.Tiddler) {
|
||||
return t;
|
||||
} else if($tw.utils.hop(this.shadowTiddlers,title)) {
|
||||
} else if(title !== undefined && $tw.utils.hop(this.shadowTiddlers,title)) {
|
||||
return this.shadowTiddlers[title].tiddler;
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -974,6 +996,34 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/tid","tiddlerdeserializer",{
|
||||
return [fields];
|
||||
}
|
||||
});
|
||||
$tw.modules.define("$:/boot/tiddlerdeserializer/tids","tiddlerdeserializer",{
|
||||
"application/x-tiddlers": function(text,fields) {
|
||||
var titles = [],
|
||||
tiddlers = [],
|
||||
match = /\r?\n\r?\n/mg.exec(text);
|
||||
if(match) {
|
||||
fields = $tw.utils.parseFields(text.substr(0,match.index),fields);
|
||||
var lines = text.substr(match.index + match[0].length).split(/\r?\n/mg);
|
||||
for(var t=0; t<lines.length; t++) {
|
||||
var line = lines[t];
|
||||
if(line.charAt(0) !== "#") {
|
||||
var colonPos= line.indexOf(": ");
|
||||
if(colonPos !== -1) {
|
||||
var tiddler = $tw.utils.extend({},fields);
|
||||
tiddler.title = (tiddler.title || "") + line.substr(0,colonPos);
|
||||
if(titles.indexOf(tiddler.title) !== -1) {
|
||||
console.log("Warning: .multids file contains multiple definitions for " + tiddler.title);
|
||||
}
|
||||
titles.push(tiddler.title);
|
||||
tiddler.text = line.substr(colonPos + 2);
|
||||
tiddlers.push(tiddler);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return tiddlers;
|
||||
}
|
||||
});
|
||||
$tw.modules.define("$:/boot/tiddlerdeserializer/txt","tiddlerdeserializer",{
|
||||
"text/plain": function(text,fields,type) {
|
||||
fields.text = text;
|
||||
@@ -1096,7 +1146,7 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/dom","tiddlerdeserializer",{
|
||||
}
|
||||
});
|
||||
|
||||
$tw.loadTiddlers = function() {
|
||||
$tw.loadTiddlersBrowser = function() {
|
||||
// In the browser, we load tiddlers from certain elements
|
||||
var containerIds = [
|
||||
"libraryModules",
|
||||
@@ -1131,6 +1181,12 @@ $tw.boot.decryptEncryptedTiddlers = function(callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////// Node definitions
|
||||
|
||||
if($tw.node) {
|
||||
|
||||
/*
|
||||
Load the tiddlers contained in a particular file (and optionally extract fields from the accompanying .meta file) returned as {filepath:,type:,tiddlers:[],hasMetaFile:}
|
||||
*/
|
||||
@@ -1226,12 +1282,14 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
||||
// Save the plugin tiddlers into the plugin info
|
||||
pluginInfo.tiddlers = pluginInfo.tiddlers || {};
|
||||
for(t=0; t<pluginTiddlers.length; t++) {
|
||||
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
|
||||
if(pluginTiddlers[t].title) {
|
||||
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Give the plugin the same version number as the core if it doesn't have one
|
||||
if(!("version" in pluginInfo)) {
|
||||
if(pluginInfo && !("version" in pluginInfo)) {
|
||||
pluginInfo.version = $tw.packageInfo.version;
|
||||
}
|
||||
// Save the plugin tiddler
|
||||
@@ -1254,20 +1312,6 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Fallback tiddlywiki.info content
|
||||
*/
|
||||
$tw.boot.defaultWikiInfo = {
|
||||
"plugins": [
|
||||
"tiddlywiki/tiddlyweb",
|
||||
"tiddlywiki/filesystem"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
};
|
||||
|
||||
/*
|
||||
path: path of wiki directory
|
||||
parentPaths: array of parent paths that we mustn't recurse into
|
||||
@@ -1281,7 +1325,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
||||
if(fs.existsSync(wikiInfoPath)) {
|
||||
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
|
||||
} else {
|
||||
wikiInfo = $tw.boot.defaultWikiInfo;
|
||||
return null;
|
||||
}
|
||||
// Load any parent wikis
|
||||
if(wikiInfo.includeWikis) {
|
||||
@@ -1316,10 +1360,19 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Load any languages listed in the wiki info file
|
||||
if(wikiInfo.languages) {
|
||||
var languagesBasePath = path.resolve($tw.boot.corePath,$tw.config.languagesPath);
|
||||
for(var t=0; t<wikiInfo.languages.length; t++) {
|
||||
pluginFields = $tw.loadPluginFolder(path.resolve(languagesBasePath,"./" + wikiInfo.languages[t]));
|
||||
if(pluginFields) {
|
||||
$tw.wiki.addTiddler(pluginFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Load the wiki files, registering them as writable
|
||||
var resolvedWikiPath = path.resolve(wikiPath,$tw.config.wikiTiddlersSubDir);
|
||||
$tw.utils.each($tw.loadTiddlersFromPath(resolvedWikiPath),function(tiddlerFile) {
|
||||
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
||||
if(tiddlerFile.filepath) {
|
||||
$tw.utils.each(tiddlerFile.tiddlers,function(tiddler) {
|
||||
$tw.boot.files[tiddler.title] = {
|
||||
@@ -1329,7 +1382,16 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
||||
};
|
||||
});
|
||||
}
|
||||
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
||||
});
|
||||
// Save the original tiddler file locations if requested
|
||||
if(wikiInfo.config && wikiInfo.config["retain-original-tiddler-path"]) {
|
||||
var output = [];
|
||||
for(var title in $tw.boot.files) {
|
||||
output.push(title + ": " + path.relative(resolvedWikiPath,$tw.boot.files[title].filepath) + "\n");
|
||||
}
|
||||
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/x-tiddler-dictionary", text: output.join("")});
|
||||
}
|
||||
// Save the path to the tiddlers folder for the filesystemadaptor
|
||||
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
|
||||
// Load any plugins within the wiki folder
|
||||
@@ -1354,10 +1416,21 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Load any languages within the wiki folder
|
||||
var wikiLanguagesPath = path.resolve(wikiPath,$tw.config.wikiLanguagesSubDir);
|
||||
if(fs.existsSync(wikiLanguagesPath)) {
|
||||
var languageFolders = fs.readdirSync(wikiLanguagesPath);
|
||||
for(t=0; t<languageFolders.length; t++) {
|
||||
pluginFields = $tw.loadPluginFolder(path.resolve(wikiLanguagesPath,"./" + languageFolders[t]));
|
||||
if(pluginFields) {
|
||||
$tw.wiki.addTiddler(pluginFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
return wikiInfo;
|
||||
};
|
||||
|
||||
$tw.loadTiddlers = function() {
|
||||
$tw.loadTiddlersNode = function() {
|
||||
// Load the boot tiddlers
|
||||
$tw.utils.each($tw.loadTiddlersFromPath($tw.boot.bootPath),function(tiddlerFile) {
|
||||
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
||||
@@ -1370,12 +1443,17 @@ $tw.loadTiddlers = function() {
|
||||
}
|
||||
};
|
||||
|
||||
// End of if(!$tw.browser)
|
||||
// End of if($tw.node)
|
||||
}
|
||||
|
||||
/////////////////////////// Main startup function called once tiddlers have been decrypted
|
||||
|
||||
$tw.boot.startup = function() {
|
||||
/*
|
||||
Startup TiddlyWiki. Options are:
|
||||
readBrowserTiddlers: whether to read tiddlers from the HTML file we're executing within; if not, tiddlers are read from the file system with Node.js APIs
|
||||
*/
|
||||
$tw.boot.startup = function(options) {
|
||||
options = options || {};
|
||||
// Initialise some more $tw properties
|
||||
$tw.utils.deepDefaults($tw,{
|
||||
modules: { // Information about each module
|
||||
@@ -1385,16 +1463,19 @@ $tw.boot.startup = function() {
|
||||
config: { // Configuration overridables
|
||||
pluginsPath: "../plugins/",
|
||||
themesPath: "../themes/",
|
||||
languagesPath: "../languages/",
|
||||
editionsPath: "../editions/",
|
||||
wikiInfo: "./tiddlywiki.info",
|
||||
wikiPluginsSubDir: "./plugins",
|
||||
wikiThemesSubDir: "./themes",
|
||||
wikiLanguagesSubDir: "./languages",
|
||||
wikiTiddlersSubDir: "./tiddlers",
|
||||
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
|
||||
fileExtensionInfo: {}, // Map file extension to {type:}
|
||||
contentTypeInfo: {} // Map type to {encoding:,extension:}
|
||||
}
|
||||
});
|
||||
if(!$tw.browser) {
|
||||
if(!options.readBrowserTiddlers) {
|
||||
// For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:}
|
||||
$tw.boot.files = {};
|
||||
// System paths and filenames
|
||||
@@ -1403,17 +1484,14 @@ $tw.boot.startup = function() {
|
||||
// If the first command line argument doesn't start with `--` then we
|
||||
// interpret it as the path to the wiki folder, which will otherwise default
|
||||
// to the current folder
|
||||
if($tw.boot.argv[0] === "*") {
|
||||
$tw.boot.wikiPath = undefined;
|
||||
$tw.boot.argv = $tw.boot.argv.slice(1);
|
||||
} else if($tw.boot.argv[0] && $tw.boot.argv[0].indexOf("--") !== 0) {
|
||||
if($tw.boot.argv[0] && $tw.boot.argv[0].indexOf("--") !== 0) {
|
||||
$tw.boot.wikiPath = $tw.boot.argv[0];
|
||||
$tw.boot.argv = $tw.boot.argv.slice(1);
|
||||
} else {
|
||||
$tw.boot.wikiPath = process.cwd();
|
||||
}
|
||||
// Read package info
|
||||
$tw.packageInfo = require("../package");
|
||||
$tw.packageInfo = require("../package.json");
|
||||
// Check node version number
|
||||
if($tw.utils.checkVersions($tw.packageInfo.engines.node.substr(2),process.version.substr(1))) {
|
||||
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
||||
@@ -1422,6 +1500,7 @@ $tw.boot.startup = function() {
|
||||
// Add file extension information
|
||||
$tw.utils.registerFileType("text/vnd.tiddlywiki","utf8",".tid");
|
||||
$tw.utils.registerFileType("application/x-tiddler","utf8",".tid");
|
||||
$tw.utils.registerFileType("application/x-tiddlers","utf8",".multids");
|
||||
$tw.utils.registerFileType("application/x-tiddler-html-div","utf8",".tiddler");
|
||||
$tw.utils.registerFileType("text/vnd.tiddlywiki2-recipe","utf8",".recipe");
|
||||
$tw.utils.registerFileType("text/plain","utf8",".txt");
|
||||
@@ -1429,12 +1508,12 @@ $tw.boot.startup = function() {
|
||||
$tw.utils.registerFileType("text/html","utf8",".html");
|
||||
$tw.utils.registerFileType("application/javascript","utf8",".js");
|
||||
$tw.utils.registerFileType("application/json","utf8",".json");
|
||||
$tw.utils.registerFileType("application/pdf","base64",".pdf");
|
||||
$tw.utils.registerFileType("image/jpeg","base64",".jpg");
|
||||
$tw.utils.registerFileType("image/png","base64",".png");
|
||||
$tw.utils.registerFileType("image/gif","base64",".gif");
|
||||
$tw.utils.registerFileType("image/svg+xml","utf8",".svg");
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico");
|
||||
$tw.utils.registerFileType("application/pdf","base64",".pdf",["image"]);
|
||||
$tw.utils.registerFileType("image/jpeg","base64",".jpg",["image"]);
|
||||
$tw.utils.registerFileType("image/png","base64",".png",["image"]);
|
||||
$tw.utils.registerFileType("image/gif","base64",".gif",["image"]);
|
||||
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",["image"]);
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico",["image"]);
|
||||
$tw.utils.registerFileType("application/font-woff","base64",".woff");
|
||||
// Create the wiki store for the app
|
||||
$tw.wiki = new $tw.Wiki();
|
||||
@@ -1444,7 +1523,11 @@ $tw.boot.startup = function() {
|
||||
$tw.Wiki.tiddlerDeserializerModules = {};
|
||||
$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);
|
||||
// Load tiddlers
|
||||
$tw.loadTiddlers();
|
||||
if(options.readBrowserTiddlers) {
|
||||
$tw.loadTiddlersBrowser();
|
||||
} else {
|
||||
$tw.loadTiddlersNode();
|
||||
}
|
||||
// Unpack plugin tiddlers
|
||||
$tw.wiki.registerPluginTiddlers("plugin");
|
||||
$tw.wiki.unpackPluginTiddlers();
|
||||
@@ -1453,7 +1536,9 @@ $tw.boot.startup = function() {
|
||||
// And any modules within plugins
|
||||
$tw.wiki.defineShadowModules();
|
||||
// Make sure the crypto state tiddler is up to date
|
||||
$tw.crypto.updateCryptoStateTiddler();
|
||||
if($tw.crypto) {
|
||||
$tw.crypto.updateCryptoStateTiddler();
|
||||
}
|
||||
// Run any startup modules
|
||||
$tw.modules.forEachModuleOfType("startup",function(title,module) {
|
||||
if(module.startup) {
|
||||
@@ -1474,13 +1559,15 @@ $tw.boot.boot = function() {
|
||||
// Preload any encrypted tiddlers
|
||||
$tw.boot.decryptEncryptedTiddlers(function() {
|
||||
// Startup
|
||||
$tw.boot.startup();
|
||||
$tw.boot.startup({
|
||||
readBrowserTiddlers: !!$tw.browser
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/////////////////////////// Autoboot in the browser
|
||||
|
||||
if($tw.browser) {
|
||||
if($tw.browser && !$tw.boot.suppressBoot) {
|
||||
$tw.boot.boot();
|
||||
}
|
||||
|
||||
@@ -1493,6 +1580,3 @@ if(typeof(exports) !== "undefined") {
|
||||
} else {
|
||||
_boot(window.$tw);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,12 @@ var _bootprefix = (function($tw) {
|
||||
|
||||
"use strict";
|
||||
|
||||
$tw = $tw || {browser: typeof(window) !== "undefined" ? {} : null};
|
||||
$tw = $tw || {};
|
||||
|
||||
// Detect platforms
|
||||
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
||||
$tw.node = typeof(process) === "object" ? {} : null;
|
||||
$tw.nodeWebKit = $tw.node && global.window && global.window.nwDispatcher ? {} : null;
|
||||
|
||||
/*
|
||||
Information about each module is kept in an object with these members:
|
||||
@@ -92,6 +97,3 @@ if(typeof(exports) === "undefined") {
|
||||
// Export functionality as a module
|
||||
exports.bootprefix = _bootprefix;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
3
core/config/editor-type-mappings/image-gif.tid
Normal file
3
core/config/editor-type-mappings/image-gif.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/image/gif
|
||||
|
||||
bitmap
|
||||
3
core/config/editor-type-mappings/image-jpeg.tid
Normal file
3
core/config/editor-type-mappings/image-jpeg.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/image/jpeg
|
||||
|
||||
bitmap
|
||||
3
core/config/editor-type-mappings/image-jpg.tid
Normal file
3
core/config/editor-type-mappings/image-jpg.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/image/jpg
|
||||
|
||||
bitmap
|
||||
3
core/config/editor-type-mappings/image-png.tid
Normal file
3
core/config/editor-type-mappings/image-png.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/image/png
|
||||
|
||||
bitmap
|
||||
3
core/config/editor-type-mappings/image-x-icon.tid
Normal file
3
core/config/editor-type-mappings/image-x-icon.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/image/x-icon
|
||||
|
||||
bitmap
|
||||
3
core/config/editor-type-mappings/text-vnd-tiddlywiki.tid
Normal file
3
core/config/editor-type-mappings/text-vnd-tiddlywiki.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/config/EditorTypeMappings/text/vnd.tiddlywiki
|
||||
|
||||
text
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/bag
|
||||
|
||||
The name of the bag from which a tiddler came
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/color
|
||||
|
||||
The CSS color value associated with a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/created
|
||||
|
||||
The date a tiddler was created
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/creator
|
||||
|
||||
The name of the person who created a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/description
|
||||
|
||||
The descriptive text for a wizard
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/draft.of
|
||||
|
||||
For draft tiddlers, contains the title of the tiddler of which this is a draft
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/draft.title
|
||||
|
||||
For draft tiddlers, contains the proposed new title of the tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/footer
|
||||
|
||||
The footer text for a wizard
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/icon
|
||||
|
||||
The title of the tiddler containing the icon associated with a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/library
|
||||
|
||||
If set to "yes" indicates that a tiddler should be saved as a JavaScript library
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/list
|
||||
|
||||
An ordered list of tiddler titles associated with a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/modified
|
||||
|
||||
The date and time at which a tiddler was last modified
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/modifier
|
||||
|
||||
The tiddler title associated with the person who last modified a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/name
|
||||
|
||||
The human readable name associated with a plugin tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/plugin-priority
|
||||
|
||||
A numerical value indicating the priority of a plugin tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/plugin-type
|
||||
|
||||
The type of plugin in a plugin tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/revision
|
||||
|
||||
The revision of the tiddler held at the server
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/source
|
||||
|
||||
The source URL associated with a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/subtitle
|
||||
|
||||
The subtitle text for a wizard
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/tags
|
||||
|
||||
A list of tags associated with a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/text
|
||||
|
||||
The body text of a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/title
|
||||
|
||||
The unique name of a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/fields/type
|
||||
|
||||
The content type of a tiddler
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/moduletypes/animation
|
||||
|
||||
Animation modules contain animations that may be used with the RevealWidget.
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/types/application/json
|
||||
description: JSON data
|
||||
name: application/json
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/types/image/gif
|
||||
description: GIF image
|
||||
name: image/gif
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/docs/types/image/png
|
||||
description: PNG image
|
||||
name: image/png
|
||||
7
core/language/en-GB.tid
Normal file
7
core/language/en-GB.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
title: $:/languages/en-GB
|
||||
name: en-GB
|
||||
description: English (British)
|
||||
author: JeremyRuston
|
||||
core-version: >=5.0.0"
|
||||
|
||||
Stub pseudo-plugin for the default language
|
||||
72
core/language/en-GB/ControlPanel.multids
Normal file
72
core/language/en-GB/ControlPanel.multids
Normal file
@@ -0,0 +1,72 @@
|
||||
title: $:/language/ControlPanel/
|
||||
|
||||
Advanced/Caption: Advanced
|
||||
Advanced/Hint: Internal information about this TiddlyWiki
|
||||
Advanced/LoadedModules/Caption: Loaded Modules
|
||||
Advanced/LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.
|
||||
Advanced/TiddlerFields/Caption: Tiddler Fields
|
||||
Advanced/TiddlerFields/Hint: This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers).
|
||||
Appearance/Caption: Appearance
|
||||
Appearance/Hint: Ways to customise the appearance of your TiddlyWiki.
|
||||
Appearance/Palette/Caption: Palette
|
||||
Appearance/Palette/Editor/Clone/Caption: clone
|
||||
Appearance/Palette/Editor/Clone/Prompt: It is recommended that you clone this shadow palette before editing it
|
||||
Appearance/Palette/Editor/Prompt/Modified: This shadow palette has been modified
|
||||
Appearance/Palette/Editor/Prompt: Editing
|
||||
Appearance/Palette/Editor/Reset/Caption: reset
|
||||
Appearance/Palette/ShowEditor/Caption: show editor
|
||||
Appearance/Palette/HideEditor/Caption: hide editor
|
||||
Appearance/Palette/Prompt: Current palette:
|
||||
Appearance/StoryView/Caption: Story View
|
||||
Appearance/StoryView/Prompt: Current view:
|
||||
Appearance/Theme/Caption: Theme
|
||||
Appearance/Theme/Prompt: Current theme:
|
||||
Basics/AnimDuration/Prompt: Animation duration:
|
||||
Basics/Caption: Basics
|
||||
Basics/DefaultTiddlers/BottomHint: Use [[double square brackets]] for titles with spaces. Or you can choose to <$button set="$:/DefaultTiddlers" setTo="[list[$:/StoryList]]">retain story ordering</$button>
|
||||
Basics/DefaultTiddlers/Prompt: Default tiddlers:
|
||||
Basics/DefaultTiddlers/TopHint: Choose which tiddlers are displayed at startup:
|
||||
Basics/Language/Prompt: Hello! Current language:
|
||||
Basics/OverriddenShadowTiddlers/Prompt: Number of overridden shadow tiddlers:
|
||||
Basics/ShadowTiddlers/Prompt: Number of shadow tiddlers:
|
||||
Basics/Subtitle/Prompt: Subtitle:
|
||||
Basics/SystemTiddlers/Prompt: Number of system tiddlers:
|
||||
Basics/Tags/Prompt: Number of tags:
|
||||
Basics/Tiddlers/Prompt: Number of tiddlers:
|
||||
Basics/Title/Prompt: Title of this ~TiddlyWiki:
|
||||
Basics/Username/Prompt: Username for signing edits:
|
||||
Basics/Version/Prompt: ~TiddlyWiki version:
|
||||
Plugins/Caption: Plugins
|
||||
Plugins/Fields/Description: Description
|
||||
Plugins/Fields/Title: Title
|
||||
Plugins/Fields/Version: Version
|
||||
Saving/AutoSave/Disabled/Button: enable
|
||||
Saving/AutoSave/Disabled/Prompt: Autosave is currently disabled
|
||||
Saving/AutoSave/Enabled/Button: disable
|
||||
Saving/AutoSave/Enabled/Prompt: Autosave is currently enabled
|
||||
Saving/AutoSave: Autosave
|
||||
Saving/Caption: Saving
|
||||
Saving/Heading: Saving
|
||||
Saving/TiddlySpot/Advanced/Heading: Advanced Settings
|
||||
Saving/TiddlySpot/BackupDir: Backup Directory
|
||||
Saving/TiddlySpot/Backups: Backups
|
||||
Saving/TiddlySpot/Filename: Upload Filename
|
||||
Saving/TiddlySpot/Heading: ~TiddlySpot
|
||||
Saving/TiddlySpot/Hint: //The server URL defaults to `http://<wikiname>.tiddlyspot.com/store.cgi` and can be changed to use a custom server address//
|
||||
Saving/TiddlySpot/Password: Password
|
||||
Saving/TiddlySpot/ServerURL: Server URL
|
||||
Saving/TiddlySpot/UploadDir: Upload Directory
|
||||
Saving/TiddlySpot/UserName: Wiki Name
|
||||
Tools/Caption: Tools
|
||||
Tools/Download/Full/Caption: Download full wiki
|
||||
Tools/Encryption/ChangePassword/Button: change password
|
||||
Tools/Encryption/ClearPassword/Button: clear password
|
||||
Tools/Encryption/Disabled/Prompt: This wiki is not encrypted
|
||||
Tools/Encryption/Enabled/Prompt: This wiki is encrypted
|
||||
Tools/Encryption/Heading: Encryption
|
||||
Tools/Encryption/SetPassword/Button: set password
|
||||
Tools/Export/AllAsStaticHTML/Caption: Download all tiddlers as static HTML
|
||||
Tools/Export/Heading: Export
|
||||
Tools/Import/Heading: Import
|
||||
Tools/Import/Hint: Browse for files on your computer to import their contents (the individual tiddlers within TiddlyWiki HTML files are imported separately). You can also drag and drop files directly to the browser window.
|
||||
Tools/Import/Prompt: Import:
|
||||
22
core/language/en-GB/Docs/ModuleTypes.multids
Normal file
22
core/language/en-GB/Docs/ModuleTypes.multids
Normal file
@@ -0,0 +1,22 @@
|
||||
title: $:/language/Docs/ModuleTypes/
|
||||
|
||||
animation: Animations that may be used with the RevealWidget.
|
||||
browser-startup: Startup functions that are only executed in the browser.
|
||||
command: Commands that can be executed under Node.js.
|
||||
config: Data to be inserted into `$tw.config`.
|
||||
filteroperator: Individual filter operator methods.
|
||||
global: Global data to be inserted into `$tw`.
|
||||
isfilteroperator: Operands for the ''is'' filter operator.
|
||||
macro: JavaScript macro definitions.
|
||||
parser: Parsers for different content types.
|
||||
saver: Savers handle different methods for saving files from the browser.
|
||||
startup: Startup functions.
|
||||
storyview: Story views customise the animation and behaviour of list widgets.
|
||||
tiddlerdeserializer: Converts different content types into tiddlers.
|
||||
tiddlerfield: Defines the behaviour of an individual tiddler field.
|
||||
tiddlermethod: Adds methods to the `$tw.Tiddler` prototype.
|
||||
utils: Adds methods to `$tw.utils`.
|
||||
utils-node: Adds Node.js-specific methods to `$tw.utils`.
|
||||
widget: Widgets encapsulate DOM rendering and refreshing.
|
||||
wikimethod: Adds methods to `$tw.Wiki`.
|
||||
wikirule: Individual parser rules for the main WikiText parser.
|
||||
14
core/language/en-GB/EditTemplate.multids
Normal file
14
core/language/en-GB/EditTemplate.multids
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/language/EditTemplate/
|
||||
|
||||
Body/Hint: Use WikiText to add formatting, images, and dynamic features
|
||||
Body/Placeholder: Type the text for this tiddler
|
||||
Body/Preview/Button/Hide: hide preview
|
||||
Body/Preview/Button/Show: show preview
|
||||
Fields/Add/Button: add
|
||||
Fields/Add/Name/Placeholder: field name
|
||||
Fields/Add/Prompt: Add a new field:
|
||||
Fields/Add/Value/Placeholder: field value
|
||||
Tags/Add/Button: add
|
||||
Tags/Add/Placeholder: tag name
|
||||
Type/Placeholder: content type
|
||||
Type/Prompt: Type:
|
||||
32
core/language/en-GB/Fields.multids
Normal file
32
core/language/en-GB/Fields.multids
Normal file
@@ -0,0 +1,32 @@
|
||||
title: $:/language/Docs/Fields/
|
||||
|
||||
bag: The name of the bag from which a tiddler came
|
||||
caption: The text to be displayed on a tab or button
|
||||
color: The CSS color value associated with a tiddler
|
||||
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
||||
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
|
||||
created: The date a tiddler was created
|
||||
creator: The name of the person who created a tiddler
|
||||
dependents: For a plugin, lists the dependent plugin titles
|
||||
description: The descriptive text for a plugin, or a modal dialogue
|
||||
draft.of: For draft tiddlers, contains the title of the tiddler of which this is a draft
|
||||
draft.title: For draft tiddlers, contains the proposed new title of the tiddler
|
||||
footer: The footer text for a wizard
|
||||
hack-to-give-us-something-to-compare-against: A temporary storage field used in [[$:/core/templates/static.content]]
|
||||
icon: The title of the tiddler containing the icon associated with a tiddler
|
||||
library: If set to "yes" indicates that a tiddler should be saved as a JavaScript library
|
||||
list: An ordered list of tiddler titles associated with a tiddler
|
||||
modified: The date and time at which a tiddler was last modified
|
||||
modifier: The tiddler title associated with the person who last modified a tiddler
|
||||
name: The human readable name associated with a plugin tiddler
|
||||
plugin-priority: A numerical value indicating the priority of a plugin tiddler
|
||||
plugin-type: The type of plugin in a plugin tiddler
|
||||
revision: The revision of the tiddler held at the server
|
||||
released: Date of a TiddlyWiki release
|
||||
source: The source URL associated with a tiddler
|
||||
subtitle: The subtitle text for a wizard
|
||||
tags: A list of tags associated with a tiddler
|
||||
text: The body text of a tiddler
|
||||
title: The unique name of a tiddler
|
||||
type: The content type of a tiddler
|
||||
version: Version information for a plugin
|
||||
@@ -7,7 +7,7 @@ To get started, first verify that you can save changes successfully - see http:/
|
||||
Then you can:
|
||||
|
||||
* Create new tiddlers using the 'plus' button in the sidebar
|
||||
* Visit the [[control panel|$:/ControlPanel]] using the 'cog' button in the sidebar to customise your wiki
|
||||
** Stop this message appearing by changing the default tiddlers under the ''Basics'' tab
|
||||
* Save changes using the 'download' button in the sidebar
|
||||
* Edit [[DefaultTiddlers|$:/DefaultTiddlers]] to determine which tiddlers appear when you open this wiki
|
||||
* Edit the SiteTitle and SiteSubtitle
|
||||
* Learn more about [[WikiText|http://tiddlywiki.com/static/WikiText.html]]
|
||||
22
core/language/en-GB/Help/default.tid
Normal file
22
core/language/en-GB/Help/default.tid
Normal file
@@ -0,0 +1,22 @@
|
||||
title: $:/language/Help/default
|
||||
|
||||
\define commandTitle()
|
||||
$:/language/Help/$(command)$
|
||||
\end
|
||||
```
|
||||
usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]
|
||||
```
|
||||
|
||||
Available commands:
|
||||
|
||||
<ul>
|
||||
<$list filter="[commands[]sort[title]]" variable="command">
|
||||
<li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>: <$transclude tiddler=<<commandTitle>> field="description"/></li>
|
||||
</$list>
|
||||
</ul>
|
||||
|
||||
To get detailed help on a command:
|
||||
|
||||
```
|
||||
tiddlywiki --help <command>
|
||||
```
|
||||
10
core/language/en-GB/Help/help.tid
Normal file
10
core/language/en-GB/Help/help.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/language/Help/help
|
||||
description: Display help for TiddlyWiki commands
|
||||
|
||||
Displays help text for a command:
|
||||
|
||||
```
|
||||
--help [<command>]
|
||||
```
|
||||
|
||||
If the command name is omitted then a list of available commands is displayed.
|
||||
23
core/language/en-GB/Help/init.tid
Normal file
23
core/language/en-GB/Help/init.tid
Normal file
@@ -0,0 +1,23 @@
|
||||
title: $:/language/Help/init
|
||||
description: Initialise a new wiki folder
|
||||
|
||||
Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition.
|
||||
|
||||
```
|
||||
--init <edition> [<edition> ...]
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
tiddlywiki ./MyWikiFolder --init empty
|
||||
```
|
||||
|
||||
Note:
|
||||
|
||||
* The wiki folder directory will be created if necessary
|
||||
* The "edition" defaults to ''empty''
|
||||
* The init command will fail if the wiki folder is not empty
|
||||
* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file
|
||||
* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition)
|
||||
* `--help editions` returns a list of available editions
|
||||
14
core/language/en-GB/Help/load.tid
Normal file
14
core/language/en-GB/Help/load.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
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 <filepath>
|
||||
```
|
||||
|
||||
To load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example:
|
||||
|
||||
```
|
||||
tiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html
|
||||
```
|
||||
3
core/language/en-GB/Help/notfound.tid
Normal file
3
core/language/en-GB/Help/notfound.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/language/Help/notfound
|
||||
|
||||
No such help item
|
||||
9
core/language/en-GB/Help/password.tid
Normal file
9
core/language/en-GB/Help/password.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/language/Help/password
|
||||
description: Set a password for subsequent crypto operations
|
||||
|
||||
Set a password for subsequent crypto operations
|
||||
|
||||
```
|
||||
--password <password>
|
||||
```
|
||||
|
||||
8
core/language/en-GB/Help/rendertiddler.tid
Normal file
8
core/language/en-GB/Help/rendertiddler.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
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:
|
||||
|
||||
```
|
||||
--rendertiddler <title> <filename> [<type>]
|
||||
```
|
||||
14
core/language/en-GB/Help/rendertiddlers.tid
Normal file
14
core/language/en-GB/Help/rendertiddlers.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/language/Help/rendertiddlers
|
||||
description: Render tiddlers matching a filter to a specified ContentType
|
||||
|
||||
Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`).
|
||||
|
||||
```
|
||||
--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>]
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain
|
||||
```
|
||||
8
core/language/en-GB/Help/savetiddler.tid
Normal file
8
core/language/en-GB/Help/savetiddler.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
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.
|
||||
|
||||
```
|
||||
--savetiddler <title> <filename>
|
||||
```
|
||||
30
core/language/en-GB/Help/server.tid
Normal file
30
core/language/en-GB/Help/server.tid
Normal file
@@ -0,0 +1,30 @@
|
||||
title: $:/language/Help/server
|
||||
description: Provides an HTTP server interface to TiddlyWiki
|
||||
|
||||
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.
|
||||
|
||||
At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.
|
||||
|
||||
```
|
||||
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host>
|
||||
```
|
||||
|
||||
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")
|
||||
* ''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
|
||||
* ''password'' - optional password for basic authentication
|
||||
* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost")
|
||||
|
||||
If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
|
||||
```
|
||||
|
||||
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.
|
||||
8
core/language/en-GB/Help/verbose.tid
Normal file
8
core/language/en-GB/Help/verbose.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: $:/language/Help/verbose
|
||||
description: Triggers verbose output mode
|
||||
|
||||
Triggers verbose output, useful for debugging
|
||||
|
||||
```
|
||||
--verbose
|
||||
```
|
||||
8
core/language/en-GB/Help/version.tid
Normal file
8
core/language/en-GB/Help/version.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: $:/language/Help/version
|
||||
description: Displays the version number of TiddlyWiki
|
||||
|
||||
Displays the version number of TiddlyWiki.
|
||||
|
||||
```
|
||||
--version
|
||||
```
|
||||
4
core/language/en-GB/Misc.multids
Normal file
4
core/language/en-GB/Misc.multids
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/language/
|
||||
|
||||
RecentChanges/DateFormat: DDth MMM YYYY
|
||||
CloseAll/Button: close all
|
||||
@@ -1,8 +1,8 @@
|
||||
title: $:/messages/Download
|
||||
title: $:/language/Modals/Download
|
||||
type: text/vnd.tiddlywiki
|
||||
subtitle: Download changes
|
||||
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
|
||||
help: http://five.tiddlywiki.com/static/DownloadingChanges.html
|
||||
help: http://tiddlywiki.com/static/DownloadingChanges.html
|
||||
|
||||
Your browser only supports manual saving.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
title: $:/messages/SaveInstructions
|
||||
title: $:/language/Modals/SaveInstructions
|
||||
type: text/vnd.tiddlywiki
|
||||
subtitle: Save your work
|
||||
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
|
||||
help: http://five.tiddlywiki.com/static/SavingChanges
|
||||
help: http://tiddlywiki.com/static/SavingChanges.html
|
||||
|
||||
Your changes to this wiki need to be saved as a ~TiddlyWiki HTML file.
|
||||
|
||||
4
core/language/en-GB/Notifications.multids
Normal file
4
core/language/en-GB/Notifications.multids
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/language/Notifications/
|
||||
|
||||
Save/Done: Saved wiki
|
||||
Save/Starting: Starting to save wiki
|
||||
10
core/language/en-GB/Search.multids
Normal file
10
core/language/en-GB/Search.multids
Normal file
@@ -0,0 +1,10 @@
|
||||
title: $:/language/Search/
|
||||
|
||||
Advanced/Matches: //<small><$count filter={{$:/temp/advancedsearch}}/> matches</small>//
|
||||
Filter/Caption: Filter
|
||||
Filter/Hint: Search via a [[filter expression|http://tiddlywiki.com/static/TiddlerFilters.html]]
|
||||
Matches: //<small><$count filter="[!is[system]search{$:/temp/search}]"/> matches</small>//
|
||||
Shadows/Caption: Shadows
|
||||
Shadows/Hint: Search for shadow tiddlers
|
||||
System/Caption: System
|
||||
System/Hint: Search for system tiddlers
|
||||
17
core/language/en-GB/SideBar.multids
Normal file
17
core/language/en-GB/SideBar.multids
Normal file
@@ -0,0 +1,17 @@
|
||||
title: $:/language/SideBar/
|
||||
|
||||
All/Caption: All
|
||||
Drafts/Caption: Drafts
|
||||
Missing/Caption: Missing
|
||||
More/Caption: More
|
||||
Open/Caption: Open
|
||||
Orphans/Caption: Orphans
|
||||
Recent/Caption: Recent
|
||||
Shadows/Caption: Shadows
|
||||
System/Caption: System
|
||||
Tags/Caption: Tags
|
||||
Tags/TagManager/Caption: Tag Manager
|
||||
Tags/Untagged/Caption: untagged
|
||||
Tools/Caption: Tools
|
||||
Types/Caption: Types
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
title: SiteSubtitle
|
||||
title: $:/SiteSubtitle
|
||||
|
||||
a non-linear personal web notebook
|
||||
3
core/language/en-GB/SiteTitle.tid
Normal file
3
core/language/en-GB/SiteTitle.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/SiteTitle
|
||||
|
||||
My ~TiddlyWiki
|
||||
11
core/language/en-GB/TiddlerInfo.multids
Normal file
11
core/language/en-GB/TiddlerInfo.multids
Normal file
@@ -0,0 +1,11 @@
|
||||
title: $:/language/TiddlerInfo/
|
||||
|
||||
Fields/Caption: Fields
|
||||
List/Caption: List
|
||||
List/Empty: This tiddler does not have a list
|
||||
Listed/Caption: Listed
|
||||
Listed/Empty: This tiddler is not listed by any others
|
||||
References/Caption: References
|
||||
References/Empty: No tiddlers link to this one
|
||||
Tagging/Caption: Tagging
|
||||
Tagging/Empty: No tiddlers are tagged with this one
|
||||
3
core/language/en-GB/Types/application_json.tid
Normal file
3
core/language/en-GB/Types/application_json.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/language/Docs/Types/application/json
|
||||
description: JSON data
|
||||
name: application/json
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/application/x-tiddler-dictionary
|
||||
title: $:/language/Docs/Types/application/x-tiddler-dictionary
|
||||
description: Data dictionary
|
||||
name: application/x-tiddler-dictionary
|
||||
3
core/language/en-GB/Types/image_gif.tid
Normal file
3
core/language/en-GB/Types/image_gif.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/language/Docs/Types/image/gif
|
||||
description: GIF image
|
||||
name: image/gif
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/image/jpeg
|
||||
title: $:/language/Docs/Types/image/jpeg
|
||||
description: JPEG image
|
||||
name: image/jpeg
|
||||
3
core/language/en-GB/Types/image_png.tid
Normal file
3
core/language/en-GB/Types/image_png.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/language/Docs/Types/image/png
|
||||
description: PNG image
|
||||
name: image/png
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/image/svg+xml
|
||||
title: $:/language/Docs/Types/image/svg+xml
|
||||
description: Structured Vector Graphics image
|
||||
name: image/svg+xml
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/image/x-icon
|
||||
title: $:/language/Docs/Types/image/x-icon
|
||||
description: ICO format icon file
|
||||
name: image/x-icon
|
||||
3
core/language/en-GB/Types/text_css.tid
Normal file
3
core/language/en-GB/Types/text_css.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/language/Docs/Types/text/css
|
||||
description: Static stylesheet
|
||||
name: text/css
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/text/plain
|
||||
title: $:/language/Docs/Types/text/plain
|
||||
description: Plain text
|
||||
name: text/plain
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/text/vnd.tiddlywiki
|
||||
title: $:/language/Docs/Types/text/vnd.tiddlywiki
|
||||
description: TiddlyWiki version 5 wikitext
|
||||
name: text/vnd.tiddlywiki
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/docs/types/text/x-tiddlywiki
|
||||
title: $:/language/Docs/Types/text/x-tiddlywiki
|
||||
description: TiddlyWiki Classic wikitext
|
||||
name: text/x-tiddlywiki
|
||||
@@ -1,16 +0,0 @@
|
||||
title: $:/messages/EnterEditMode
|
||||
type: text/vnd.tiddlywiki
|
||||
subtitle: Editing this wiki
|
||||
footer: <<button close class:"btn btn-primary"><Close>>
|
||||
help: http://five.tiddlywiki.com/static/EditMode
|
||||
|
||||
You can edit this wiki and save your changes. You are strongly advised to verify that saving is working properly before trusting ~TiddlyWiki with your data.
|
||||
|
||||
The following methods of saving changes are available:
|
||||
|
||||
* Using Firefox's built-in file system access
|
||||
* Uploading to a simple server script
|
||||
* Using HTML5's data URI and download attribute
|
||||
|
||||
|
||||
[x] Don't show this message again
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/messages/Saved
|
||||
|
||||
Saved wiki
|
||||
@@ -1,3 +0,0 @@
|
||||
title: $:/messages/StartingSave
|
||||
|
||||
Starting to save wiki
|
||||
41
core/modules/commands/help.js
Normal file
41
core/modules/commands/help.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/*\
|
||||
title: $:/core/modules/commands/help.js
|
||||
type: application/javascript
|
||||
module-type: command
|
||||
|
||||
Help command
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jshint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
name: "help",
|
||||
synchronous: true
|
||||
};
|
||||
|
||||
var Command = function(params,commander) {
|
||||
this.params = params;
|
||||
this.commander = commander;
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
var subhelp = this.params[0] || "default",
|
||||
helpBase = "$:/language/Help/",
|
||||
text;
|
||||
if(!this.commander.wiki.getTiddler(helpBase + subhelp)) {
|
||||
subhelp = "notfound";
|
||||
}
|
||||
// Wikify the help as formatted text (ie block elements generate newlines)
|
||||
text = this.commander.wiki.renderTiddler("text/plain-formatted",helpBase + subhelp);
|
||||
// Remove any leading linebreaks
|
||||
text = text.replace(/^(\r?\n)*/g,"");
|
||||
this.commander.streams.output.write(text);
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
59
core/modules/commands/init.js
Normal file
59
core/modules/commands/init.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/*\
|
||||
title: $:/core/modules/commands/init.js
|
||||
type: application/javascript
|
||||
module-type: command
|
||||
|
||||
Command to initialise an empty wiki folder
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
name: "init",
|
||||
synchronous: true
|
||||
};
|
||||
|
||||
var Command = function(params,commander) {
|
||||
this.params = params;
|
||||
this.commander = commander;
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
var fs = require("fs"),
|
||||
path = require("path");
|
||||
// Check that we don't already have a valid wiki folder
|
||||
if($tw.boot.wikiTiddlersPath) {
|
||||
return "Wiki folder is not empty";
|
||||
}
|
||||
// Loop through each of the specified editions
|
||||
var editions = this.params.length > 0 ? this.params : ["empty"];
|
||||
for(var editionIndex=0; editionIndex<editions.length; editionIndex++) {
|
||||
var editionName = editions[editionIndex];
|
||||
// Check the edition exists
|
||||
var editionPath = path.resolve($tw.boot.corePath,$tw.config.editionsPath) + "/" + editionName;
|
||||
if(!$tw.utils.isDirectory(editionPath)) {
|
||||
return "Edition '" + editionName + "' not found";
|
||||
}
|
||||
// Copy the edition content
|
||||
var err = $tw.utils.copyDirectory(editionPath,$tw.boot.wikiPath);
|
||||
if(!err) {
|
||||
this.commander.streams.output.write("Copied edition '" + editionName + "' to " + $tw.boot.wikiPath + "\n");
|
||||
} else {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
// Tweak the tiddlywiki.info to remove any included wikis
|
||||
var packagePath = $tw.boot.wikiPath + "/tiddlywiki.info",
|
||||
packageJson = JSON.parse(fs.readFileSync(packagePath));
|
||||
delete packageJson.includeWikis;
|
||||
fs.writeFileSync(packagePath,JSON.stringify(packageJson,null,$tw.config.preferences.jsonSpaces));
|
||||
return null;
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
@@ -1,114 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/commands/print.js
|
||||
type: application/javascript
|
||||
module-type: command
|
||||
|
||||
Print command for inspecting TiddlyWiki internals
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jshint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
name: "print",
|
||||
synchronous: true
|
||||
};
|
||||
|
||||
var Command = function(params,commander) {
|
||||
this.params = params;
|
||||
this.commander = commander;
|
||||
this.output = commander.streams.output;
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
if(this.params.length < 1) {
|
||||
return "Too few parameters for print command";
|
||||
}
|
||||
var subcommand = this.subcommands[this.params[0]];
|
||||
if(subcommand) {
|
||||
return subcommand.call(this);
|
||||
} else {
|
||||
return "Unknown subcommand (" + this.params[0] + ") for print command";
|
||||
}
|
||||
};
|
||||
|
||||
Command.prototype.subcommands = {};
|
||||
|
||||
Command.prototype.subcommands.tiddler = function() {
|
||||
if(this.params.length < 2) {
|
||||
return "Too few parameters for print tiddler command";
|
||||
}
|
||||
var tiddler = this.commander.wiki.getTiddler(this.params[1]);
|
||||
if(!tiddler) {
|
||||
return "No such tiddler as '" + this.params[1] + "'";
|
||||
}
|
||||
this.output.write("Tiddler '" + this.params[1] + "' contains these fields:\n");
|
||||
for(var t in tiddler.fields) {
|
||||
this.output.write(" " + t + ": " + tiddler.getFieldString(t) + "\n");
|
||||
}
|
||||
return null; // No error
|
||||
};
|
||||
|
||||
Command.prototype.subcommands.tiddlers = function() {
|
||||
var tiddlers = this.commander.wiki.getTiddlers();
|
||||
this.output.write("Wiki contains these tiddlers:\n");
|
||||
for(var t=0; t<tiddlers.length; t++) {
|
||||
this.output.write(tiddlers[t] + "\n");
|
||||
}
|
||||
return null; // No error
|
||||
};
|
||||
|
||||
Command.prototype.subcommands.system = function() {
|
||||
var tiddlers = this.commander.wiki.getSystemTitles();
|
||||
this.output.write("Wiki contains these system tiddlers:\n");
|
||||
for(var t=0; t<tiddlers.length; t++) {
|
||||
this.output.write(tiddlers[t] + "\n");
|
||||
}
|
||||
return null; // No error
|
||||
};
|
||||
|
||||
Command.prototype.subcommands.config = function() {
|
||||
var self = this;
|
||||
var quotePropertyName = function(p) {
|
||||
var unquotedPattern = /^[A-Za-z0-9_]*$/mg;
|
||||
if(unquotedPattern.test(p)) {
|
||||
return p;
|
||||
} else {
|
||||
return "[\"" + $tw.utils.stringify(p) + "\"]";
|
||||
}
|
||||
},
|
||||
printConfig = function(object,prefix) {
|
||||
for(var n in object) {
|
||||
var v = object[n];
|
||||
if(typeof v === "object") {
|
||||
printConfig(v,prefix + "." + quotePropertyName(n));
|
||||
} else if(typeof v === "string") {
|
||||
self.output.write(prefix + "." + quotePropertyName(n) + ": \"" + $tw.utils.stringify(v) + "\"\n");
|
||||
} else {
|
||||
self.output.write(prefix + "." + quotePropertyName(n) + ": " + v.toString() + "\n");
|
||||
}
|
||||
}
|
||||
},
|
||||
printObject = function(heading,object) {
|
||||
self.output.write(heading +"\n");
|
||||
for(var n in object) {
|
||||
self.output.write(" " + n + "\n");
|
||||
}
|
||||
};
|
||||
this.output.write("Configuration:\n");
|
||||
printConfig($tw.config," $tw.config");
|
||||
printObject("Tiddler field modules:",$tw.Tiddler.fieldModules);
|
||||
printObject("Loaded modules:",$tw.modules.titles);
|
||||
printObject("Command modules:",$tw.commands);
|
||||
printObject("Parser modules:",$tw.wiki.parsers);
|
||||
printObject("Macro modules:",$tw.wiki.macros);
|
||||
printObject("Deserializer modules:",$tw.Wiki.tiddlerDeserializerModules);
|
||||
return null; // No error
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
@@ -42,7 +42,7 @@ Command.prototype.execute = function() {
|
||||
$tw.utils.each(tiddlers,function(title) {
|
||||
var parser = wiki.parseTiddler(template),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});
|
||||
var container = $tw.document.createElement("div");
|
||||
var container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
var text = type === "text/html" ? container.innerHTML : container.textContent;
|
||||
fs.writeFileSync(path.resolve(pathname,encodeURIComponent(title) + extension),text,"utf8");
|
||||
|
||||
@@ -108,6 +108,9 @@ SimpleServer.prototype.listen = function(port,host) {
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
// Set the encoding for the incoming request
|
||||
// TODO: Presumably this would need tweaking if we supported PUTting binary tiddlers
|
||||
request.setEncoding("utf8");
|
||||
// Dispatch the appropriate method
|
||||
switch(request.method) {
|
||||
case "GET": // Intentional fall-through
|
||||
@@ -157,7 +160,7 @@ var Command = function(params,commander,callback) {
|
||||
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
|
||||
var changeCount = state.wiki.getChangeCount(title).toString();
|
||||
response.writeHead(204, "OK",{
|
||||
Etag: "\"default/" + title + "/" + changeCount + ":\""
|
||||
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\""
|
||||
});
|
||||
response.end();
|
||||
}
|
||||
@@ -265,7 +268,7 @@ Command.prototype.execute = function() {
|
||||
serveType = this.params[3] || "text/html",
|
||||
username = this.params[4],
|
||||
password = this.params[5],
|
||||
host = this.params[6];
|
||||
host = this.params[6] || "127.0.0.1";
|
||||
this.server.set({
|
||||
rootTiddler: rootTiddler,
|
||||
renderType: renderType,
|
||||
|
||||
@@ -35,5 +35,6 @@ exports.htmlEntities = {quot:34, amp:38, apos:39, lt:60, gt:62, nbsp:160, iexcl:
|
||||
|
||||
exports.htmlVoidElements = "area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",");
|
||||
|
||||
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,noscript,ol,output,p,pre,section,table,tfoot,ul,video".split(",");
|
||||
|
||||
})();
|
||||
|
||||
@@ -100,7 +100,7 @@ exports["text/html"] = function(text,fields) {
|
||||
var storeAreaMarkerRegExp = /<div id=["']?storeArea['"]?( style=["']?display:none;["']?)?>/gi,
|
||||
match = storeAreaMarkerRegExp.exec(text);
|
||||
if(match) {
|
||||
// If so, it's either a classic TiddlyWiki file or a TW5 file
|
||||
// If so, it's either a classic TiddlyWiki file or an unencrypted TW5 file
|
||||
// First read the normal tiddlers
|
||||
var results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);
|
||||
// Then any system tiddlers
|
||||
@@ -111,8 +111,15 @@ exports["text/html"] = function(text,fields) {
|
||||
}
|
||||
return results
|
||||
} else {
|
||||
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
|
||||
return deserializeHtmlFile(text,fields);
|
||||
// Check whether we've got an encrypted file
|
||||
var encryptedStoreArea = $tw.utils.extractEncryptedStoreArea(text);
|
||||
if(encryptedStoreArea) {
|
||||
// If so, attempt to decrypt it using the current password
|
||||
return $tw.utils.decryptStoreArea(encryptedStoreArea);
|
||||
} else {
|
||||
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
|
||||
return deserializeHtmlFile(text,fields);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -33,31 +33,55 @@ function parseFilterOperation(operators,filterString,p) {
|
||||
operator.prefix = filterString.charAt(p++);
|
||||
}
|
||||
// Get the operator name
|
||||
bracketPos = filterString.indexOf("[",p);
|
||||
curlyBracketPos = filterString.indexOf("{",p);
|
||||
if((bracketPos === -1) && (curlyBracketPos === -1)) {
|
||||
var nextBracketPos = filterString.substring(p).search(/[\[\{\/]/);
|
||||
if(nextBracketPos === -1) {
|
||||
throw "Missing [ in filter expression";
|
||||
}
|
||||
if(bracketPos === -1 || (curlyBracketPos !== -1 && curlyBracketPos < bracketPos)) {
|
||||
// Curly brackets
|
||||
operator.indirect = true;
|
||||
operator.operator = filterString.substring(p,curlyBracketPos);
|
||||
p = curlyBracketPos + 1;
|
||||
} else {
|
||||
// Square brackets
|
||||
operator.operator = filterString.substring(p,bracketPos);
|
||||
p = bracketPos + 1;
|
||||
nextBracketPos += p;
|
||||
var bracket = filterString.charAt(nextBracketPos);
|
||||
operator.operator = filterString.substring(p,nextBracketPos);
|
||||
|
||||
// Any suffix?
|
||||
var colon = operator.operator.indexOf(':');
|
||||
if(colon > -1) {
|
||||
operator.suffix = operator.operator.substring(colon + 1);
|
||||
operator.operator = operator.operator.substring(0,colon) || "field";
|
||||
}
|
||||
if(operator.operator === "") {
|
||||
// Empty operator means: title
|
||||
else if(operator.operator === "") {
|
||||
operator.operator = "title";
|
||||
}
|
||||
// Get the operand
|
||||
bracketPos = filterString.indexOf(operator.indirect ? "}" : "]",p);
|
||||
if(bracketPos === -1) {
|
||||
|
||||
p = nextBracketPos + 1;
|
||||
switch (bracket) {
|
||||
case '{': // Curly brackets
|
||||
operator.indirect = true;
|
||||
nextBracketPos = filterString.indexOf('}',p);
|
||||
break;
|
||||
case '[': // Square brackets
|
||||
nextBracketPos = filterString.indexOf(']',p);
|
||||
break;
|
||||
case '/': // regexp brackets
|
||||
var rex = /^((?:[^\\\/]*|\\.)*)\/(?:\(([mygi]+)\))?/g,
|
||||
rexMatch = rex.exec(filterString.substring(p));
|
||||
if(rexMatch) {
|
||||
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
|
||||
nextBracketPos = p + rex.lastIndex - 1;
|
||||
}
|
||||
else {
|
||||
throw "Unterminated regular expression in filter expression";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(nextBracketPos === -1) {
|
||||
throw "Missing closing bracket in filter expression";
|
||||
}
|
||||
operator.operand = filterString.substring(p,bracketPos);
|
||||
p = bracketPos + 1;
|
||||
if(!operator.regexp) {
|
||||
operator.operand = filterString.substring(p,nextBracketPos);
|
||||
}
|
||||
p = nextBracketPos + 1;
|
||||
|
||||
// Push this operator
|
||||
operators.push(operator);
|
||||
} while(filterString.charAt(p) !== "]");
|
||||
@@ -161,7 +185,9 @@ exports.compileFilter = function(filterString) {
|
||||
results = operatorFunction(accumulator,{
|
||||
operator: operator.operator,
|
||||
operand: operand,
|
||||
prefix: operator.prefix
|
||||
prefix: operator.prefix,
|
||||
suffix: operator.suffix,
|
||||
regexp: operator.regexp
|
||||
},{
|
||||
wiki: self,
|
||||
currTiddlerTitle: currTiddlerTitle
|
||||
@@ -193,6 +219,7 @@ exports.compileFilter = function(filterString) {
|
||||
});
|
||||
// Return a function that applies the operations to a source array/hashmap of tiddler titles
|
||||
return function(source,currTiddlerTitle) {
|
||||
source = source || self.tiddlers;
|
||||
var results = [];
|
||||
$tw.utils.each(operationFunctions,function(operationFunction) {
|
||||
operationFunction(results,source,currTiddlerTitle);
|
||||
|
||||
27
core/modules/filters/commands.js
Normal file
27
core/modules/filters/commands.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/commands.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning the names of the commands available in this wiki
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.commands = function(source,operator,options) {
|
||||
var results = [];
|
||||
$tw.utils.each($tw.commands,function(commandInfo,name) {
|
||||
results.push(name);
|
||||
});
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -16,12 +16,20 @@ Filter operator for comparing fields for equality
|
||||
Export our filter function
|
||||
*/
|
||||
exports.field = function(source,operator,options) {
|
||||
var results = [];
|
||||
var results = [],
|
||||
fieldname = (operator.suffix || operator.operator).toLowerCase(),
|
||||
isTitle = fieldname === "title";
|
||||
// Function to check an individual title
|
||||
function checkTiddler(title) {
|
||||
var tiddler = options.wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
var match = tiddler.getFieldString(operator.operator) === operator.operand;
|
||||
var tiddler = options.wiki.getTiddler(title),
|
||||
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
|
||||
match;
|
||||
if(text !== null) {
|
||||
if(operator.regexp) {
|
||||
match = !!operator.regexp.exec(text);
|
||||
} else {
|
||||
match = text === operator.operand;
|
||||
}
|
||||
if(operator.prefix === "!") {
|
||||
match = !match;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ exports.has = function(source,operator,options) {
|
||||
function checkTiddler(title) {
|
||||
var tiddler = options.wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
var match = $tw.utils.hop(tiddler.fields,operator.operand);
|
||||
var match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";
|
||||
if(operator.prefix === "!") {
|
||||
match = !match;
|
||||
}
|
||||
|
||||
43
core/modules/filters/indexes.js
Normal file
43
core/modules/filters/indexes.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/indexes.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning the indexes of a data tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.indexes = function(source,operator,options) {
|
||||
var self = this,
|
||||
results = [];
|
||||
// Function to check an individual title
|
||||
function checkTiddler(title) {
|
||||
// Return the fields on the specified tiddler
|
||||
var data = options.wiki.getTiddlerData(title,{});
|
||||
if(data) {
|
||||
$tw.utils.pushTop(results,Object.keys(data));
|
||||
}
|
||||
}
|
||||
// Iterate through the source tiddlers
|
||||
if($tw.utils.isArray(source)) {
|
||||
$tw.utils.each(source,function(title) {
|
||||
checkTiddler(title);
|
||||
});
|
||||
} else {
|
||||
$tw.utils.each(source,function(element,title) {
|
||||
checkTiddler(title);
|
||||
});
|
||||
}
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
43
core/modules/filters/is/image.js
Normal file
43
core/modules/filters/is/image.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/is/image.js
|
||||
type: application/javascript
|
||||
module-type: isfilteroperator
|
||||
|
||||
Filter function for [is[image]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.image = function(source,prefix,options) {
|
||||
var results = [];
|
||||
// Function to check a tiddler
|
||||
function checkTiddler(title) {
|
||||
var match = options.wiki.isImageTiddler(title);
|
||||
if(prefix === "!") {
|
||||
match = !match;
|
||||
}
|
||||
if(match) {
|
||||
results.push(title);
|
||||
}
|
||||
};
|
||||
// Iterate through the source tiddlers
|
||||
if($tw.utils.isArray(source)) {
|
||||
$tw.utils.each(source,function(title) {
|
||||
checkTiddler(title);
|
||||
});
|
||||
} else {
|
||||
$tw.utils.each(source,function(element,title) {
|
||||
checkTiddler(title);
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -17,7 +17,8 @@ Export our filter function
|
||||
*/
|
||||
exports.list = function(source,operator,options) {
|
||||
var results = [],
|
||||
list = options.wiki.getTiddlerList(operator.operand);
|
||||
tr = $tw.utils.parseTextReference(operator.operand),
|
||||
list = options.wiki.getTiddlerList(tr.title || options.currTiddlerTitle,tr.field,tr.index);
|
||||
function checkTiddler(title) {
|
||||
var match = list.indexOf(title) !== -1;
|
||||
if(operator.prefix === "!") {
|
||||
|
||||
87
core/modules/filters/listops.js
Normal file
87
core/modules/filters/listops.js
Normal file
@@ -0,0 +1,87 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/listops.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operators for manipulating the current selection list
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Reverse list
|
||||
*/
|
||||
exports.reverse = function(source,operator,options) {
|
||||
var results = [];
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
$tw.utils.each(source,function(title) {
|
||||
results.unshift(title);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
First entry/entries in list
|
||||
*/
|
||||
exports.first = function(source,operator,options) {
|
||||
var count = parseInt(operator.operand) || 1;
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
return source.slice(0,Math.min(count,source.length));
|
||||
};
|
||||
|
||||
/*
|
||||
Last entry/entries in list
|
||||
*/
|
||||
exports.last = function(source,operator,options) {
|
||||
var count = parseInt(operator.operand) || 1;
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
return source.slice(-count);
|
||||
};
|
||||
|
||||
/*
|
||||
All but the first entry/entries of the list
|
||||
*/
|
||||
exports.rest = function(source,operator,options) {
|
||||
var count = parseInt(operator.operand) || 1;
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
return source.slice(count);
|
||||
};
|
||||
exports.butfirst = exports.rest;
|
||||
exports.bf = exports.rest;
|
||||
|
||||
/*
|
||||
All but the last entry/entries of the list
|
||||
*/
|
||||
exports.butlast = function(source,operator,options) {
|
||||
var count = parseInt(operator.operand) || 1;
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
return source.slice(0,-count);
|
||||
};
|
||||
exports.bl = exports.butlast;
|
||||
|
||||
/*
|
||||
The nth member of the list
|
||||
*/
|
||||
exports.nth = function(source,operator,options) {
|
||||
var count = parseInt(operator.operand) || 1;
|
||||
if(!$tw.utils.isArray(source)) {
|
||||
source = Object.keys(source).sort();
|
||||
}
|
||||
return source.slice(count-1,count);
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -13,23 +13,23 @@ The image parser parses an image into an embeddable HTML element
|
||||
"use strict";
|
||||
|
||||
var ImageParser = function(type,text,options) {
|
||||
var element = "img",
|
||||
var element = {
|
||||
type: "element",
|
||||
tag: "img",
|
||||
attributes: {}
|
||||
},
|
||||
src;
|
||||
if(type === "application/pdf" || type === ".pdf") {
|
||||
src = "data:application/pdf;base64," + text;
|
||||
element = "embed";
|
||||
} else if(type === "image/svg+xml" || type === ".svg") {
|
||||
src = "data:image/svg+xml," + encodeURIComponent(text);
|
||||
} else {
|
||||
src = "data:" + type + ";base64," + text;
|
||||
}
|
||||
this.tree = [{
|
||||
type: "element",
|
||||
tag: element,
|
||||
attributes: {
|
||||
"src": {type: "string", value: src}
|
||||
if(text) {
|
||||
if(type === "application/pdf" || type === ".pdf") {
|
||||
element.attributes.src = {type: "string", value: "data:application/pdf;base64," + text};
|
||||
element.tag = "embed";
|
||||
} else if(type === "image/svg+xml" || type === ".svg") {
|
||||
element.attributes.src = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
|
||||
} else {
|
||||
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
|
||||
}
|
||||
}];
|
||||
}
|
||||
this.tree = [element];
|
||||
};
|
||||
|
||||
exports["image/svg+xml"] = ImageParser;
|
||||
|
||||
@@ -28,6 +28,7 @@ exports["text/x-tiddlywiki"] = TextParser;
|
||||
exports["application/javascript"] = TextParser;
|
||||
exports["application/json"] = TextParser;
|
||||
exports["text/css"] = TextParser;
|
||||
exports["application/x-tiddler-dictionary"] = TextParser;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
@@ -23,14 +23,15 @@ exports.types = {block: true};
|
||||
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /```\r?\n/mg;
|
||||
// Regexp to match and get language if defined
|
||||
this.matchRegExp = /```([\w-]*)\r?\n/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
var reEnd = /(\r?\n```$)/mg;
|
||||
// Move past the match
|
||||
this.parser.pos = this.matchRegExp.lastIndex;
|
||||
|
||||
// Look for the end of the block
|
||||
reEnd.lastIndex = this.parser.pos;
|
||||
var match = reEnd.exec(this.parser.source),
|
||||
@@ -43,14 +44,14 @@ exports.parse = function() {
|
||||
text = this.parser.source.substr(this.parser.pos);
|
||||
this.parser.pos = this.parser.sourceLength;
|
||||
}
|
||||
// Return the pre element
|
||||
// Return the $codeblock widget
|
||||
return [{
|
||||
type: "element",
|
||||
tag: "pre",
|
||||
children: [{
|
||||
type: "text",
|
||||
text: text
|
||||
}]
|
||||
type: "element",
|
||||
tag: "$codeblock",
|
||||
attributes: {
|
||||
code: {type: "string", value: text},
|
||||
language: {type: "string", value: this.match[1]}
|
||||
}
|
||||
}];
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ Wiki text block rule for HTML comments. For example:
|
||||
<!-- This is a comment -->
|
||||
```
|
||||
|
||||
Note that the syntax for comments is simplified to an opening "<!--" sequence and a closing "-->" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
@@ -21,13 +23,26 @@ exports.types = {block: true};
|
||||
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match - HTML comment regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.html
|
||||
this.matchRegExp = /\<![ \r\n\t]*(?:--(?:[^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>\r?\n/mg;
|
||||
this.matchRegExp = /\<!--/mg;
|
||||
this.endMatchRegExp = /--\>/mg;
|
||||
};
|
||||
|
||||
exports.findNextMatch = function(startPos) {
|
||||
this.matchRegExp.lastIndex = startPos;
|
||||
this.match = this.matchRegExp.exec(this.parser.source);
|
||||
if(this.match) {
|
||||
this.endMatchRegExp.lastIndex = startPos + this.match[0].length;
|
||||
this.endMatch = this.endMatchRegExp.exec(this.parser.source);
|
||||
if(this.endMatch) {
|
||||
return this.match.index;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
// Move past the match
|
||||
this.parser.pos = this.matchRegExp.lastIndex;
|
||||
this.parser.pos = this.endMatchRegExp.lastIndex;
|
||||
// Don't return any elements
|
||||
return [];
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user