mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-23 03:14:40 +00:00
Compare commits
312 Commits
filter-ins
...
multi-wiki
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7dc21aa81 | ||
|
|
19e341c760 | ||
|
|
739ba3288b | ||
|
|
b4583ef9c5 | ||
|
|
2a9f646ec4 | ||
|
|
6d448499c7 | ||
|
|
b8f2800dab | ||
|
|
d72a4c9826 | ||
|
|
ddfc8c469c | ||
|
|
faf5d6982e | ||
|
|
1f1b785524 | ||
|
|
1d65f0070c | ||
|
|
0198eb2a1a | ||
|
|
1c5648826e | ||
|
|
02a9fdcd06 | ||
|
|
d0a3c79383 | ||
|
|
e48ea2dbe6 | ||
|
|
060bea89ae | ||
|
|
67232aab15 | ||
|
|
ae5bd9d4cd | ||
|
|
a00e3e79d6 | ||
|
|
ab5a48747f | ||
|
|
239aacfa03 | ||
|
|
e3ce053745 | ||
|
|
2735ce23d8 | ||
|
|
cb6c471967 | ||
|
|
8defedd611 | ||
|
|
d7eb39c88e | ||
|
|
ac59af19dd | ||
|
|
0cd2190ddf | ||
|
|
266b32bfee | ||
|
|
a697a664fa | ||
|
|
9f48e75945 | ||
|
|
4dc2486d4b | ||
|
|
d9256707f4 | ||
|
|
e85cfdefa6 | ||
|
|
b198270cb5 | ||
|
|
3836a5d08c | ||
|
|
83f7b9023d | ||
|
|
9362121e8d | ||
|
|
07c3081e7f | ||
|
|
7c4d0d7f5e | ||
|
|
520188dc2b | ||
|
|
aa0d59e4ba | ||
|
|
c1a441b7a1 | ||
|
|
0f558a1442 | ||
|
|
31a7d648e5 | ||
|
|
a6c5b86343 | ||
|
|
ffbf24ae92 | ||
|
|
12e48af372 | ||
|
|
f61a131119 | ||
|
|
8d53a37d34 | ||
|
|
386af03f6d | ||
|
|
8ac2730eb1 | ||
|
|
e873518d6f | ||
|
|
316bd65296 | ||
|
|
3a5f67d4f5 | ||
|
|
ad901a9f50 | ||
|
|
c7531e53ab | ||
|
|
6a7612ddf8 | ||
|
|
5d6ddaee7e | ||
|
|
d0575d6e8e | ||
|
|
6dd6b7bef1 | ||
|
|
517dae8242 | ||
|
|
d0b5f413a4 | ||
|
|
6e7efeb126 | ||
|
|
0f4f60f978 | ||
|
|
a9c124cffd | ||
|
|
4050ba5f92 | ||
|
|
b698b3e9cf | ||
|
|
a930411cfd | ||
|
|
90848a1e96 | ||
|
|
c73311684b | ||
|
|
8a5a684218 | ||
|
|
3287dce40c | ||
|
|
eac8a2c3d8 | ||
|
|
535c440741 | ||
|
|
9eb28a0e5f | ||
|
|
edc32c5262 | ||
|
|
6492ed36bf | ||
|
|
2819b53c04 | ||
|
|
adb2ffcd4d | ||
|
|
97db75e741 | ||
|
|
066771e6e9 | ||
|
|
b4664bd7d1 | ||
|
|
882438db14 | ||
|
|
e9f314579d | ||
|
|
9e2962b24e | ||
|
|
5b53a14903 | ||
|
|
39b7a4fb71 | ||
|
|
f1d0e52ff7 | ||
|
|
d1edf6424d | ||
|
|
e9cbb51f68 | ||
|
|
0ff3875b8a | ||
|
|
38e1ea8f90 | ||
|
|
2b2fd4bdb7 | ||
|
|
b8f463d8ba | ||
|
|
3f30cb4991 | ||
|
|
049951e269 | ||
|
|
3c36e4bd55 | ||
|
|
d03ad0bca6 | ||
|
|
109d92ae68 | ||
|
|
e396334b20 | ||
|
|
d8fd9af63a | ||
|
|
9b6d677726 | ||
|
|
a37d50166f | ||
|
|
b4564e31bd | ||
|
|
33fb857d6b | ||
|
|
4c2c7266d7 | ||
|
|
3c7f06009b | ||
|
|
87f4a525f8 | ||
|
|
92a1c56d31 | ||
|
|
d8eb5cb459 | ||
|
|
268aaebaf0 | ||
|
|
ea318bab6e | ||
|
|
aafe775779 | ||
|
|
129bbe421c | ||
|
|
471ba99a5d | ||
|
|
516a17a6f0 | ||
|
|
2e4980bb97 | ||
|
|
db9978f8c2 | ||
|
|
cc4cb04900 | ||
|
|
9ba4556250 | ||
|
|
131a5abeb8 | ||
|
|
ce79a4add8 | ||
|
|
28a831489b | ||
|
|
51cdca6841 | ||
|
|
d51ad80f80 | ||
|
|
ad528d6b1f | ||
|
|
f2947e73b3 | ||
|
|
baee0bb301 | ||
|
|
8a2111f150 | ||
|
|
fcffff3964 | ||
|
|
cca1f21d02 | ||
|
|
37f6930bf2 | ||
|
|
4b1affee50 | ||
|
|
464d17b522 | ||
|
|
d1bb7159b8 | ||
|
|
b58cfe6324 | ||
|
|
7a0c43436f | ||
|
|
708e21951f | ||
|
|
8198574087 | ||
|
|
6c9b92400e | ||
|
|
8091db37e8 | ||
|
|
e66b67dedc | ||
|
|
a2012dcff8 | ||
|
|
08649dd1eb | ||
|
|
52f76380c7 | ||
|
|
1f63bcbbd0 | ||
|
|
3aa5607a3a | ||
|
|
eaebeb87c9 | ||
|
|
808b94468e | ||
|
|
60e6c8bcb2 | ||
|
|
891f0fd599 | ||
|
|
6154de0d2c | ||
|
|
cae9dbf5d1 | ||
|
|
ae8ef305fa | ||
|
|
9b3ca525ee | ||
|
|
38ee942d8f | ||
|
|
957329d515 | ||
|
|
6063256439 | ||
|
|
1c64646393 | ||
|
|
259b3dca1b | ||
|
|
6a673e6aea | ||
|
|
f606e33415 | ||
|
|
09de91940e | ||
|
|
3d485f0706 | ||
|
|
7eaa9b8aec | ||
|
|
faa4b9700a | ||
|
|
dea739ff07 | ||
|
|
69cc45bf5c | ||
|
|
347aa4d546 | ||
|
|
b4855b25c4 | ||
|
|
d518675e03 | ||
|
|
9b59ae2b73 | ||
|
|
f67573315e | ||
|
|
501f57499e | ||
|
|
2916cb6fd9 | ||
|
|
e553539b2a | ||
|
|
3da773c27f | ||
|
|
b923be5e94 | ||
|
|
c9ab184c65 | ||
|
|
bc45a16f40 | ||
|
|
8b6642b56d | ||
|
|
d6807cb471 | ||
|
|
f9064428c5 | ||
|
|
a443e5f0ad | ||
|
|
24413c53dd | ||
|
|
8b5c3746f8 | ||
|
|
9df625c44d | ||
|
|
54ff0446c6 | ||
|
|
0f5dfb89ad | ||
|
|
e3b27768d2 | ||
|
|
580283433e | ||
|
|
f4ac2b92e7 | ||
|
|
e35584843d | ||
|
|
3335e87ef4 | ||
|
|
abde67e5df | ||
|
|
2ba3643a0c | ||
|
|
89ae2012c7 | ||
|
|
8a209d643f | ||
|
|
1a28ec7ea4 | ||
|
|
5fe41fc896 | ||
|
|
4f9ff1ae81 | ||
|
|
d97ddf1eec | ||
|
|
9facf4a067 | ||
|
|
de4fe132a7 | ||
|
|
d7d0733177 | ||
|
|
e614e291a2 | ||
|
|
dd9a3bfeeb | ||
|
|
83229ace63 | ||
|
|
6724fa804b | ||
|
|
630b98520f | ||
|
|
1c0341de51 | ||
|
|
d5aa74d9af | ||
|
|
343cc33bbe | ||
|
|
b1edbed6a5 | ||
|
|
066e553f84 | ||
|
|
61b54125be | ||
|
|
3276703edd | ||
|
|
f9265169fd | ||
|
|
2361880c45 | ||
|
|
3ad87df154 | ||
|
|
3c58788e37 | ||
|
|
310b5f058a | ||
|
|
a33705e348 | ||
|
|
3fca82321e | ||
|
|
790f431df0 | ||
|
|
0d22bf8418 | ||
|
|
1eecfb6b3a | ||
|
|
b8c1c6c8de | ||
|
|
6503fb4a04 | ||
|
|
bab14b7053 | ||
|
|
2d4b3341f6 | ||
|
|
6f8a3b9261 | ||
|
|
8edefffbc5 | ||
|
|
59b425fd5c | ||
|
|
f2267e2af0 | ||
|
|
c26acfdb42 | ||
|
|
f925f036c9 | ||
|
|
2c810faeeb | ||
|
|
6675358e85 | ||
|
|
262a730534 | ||
|
|
4b6872aa42 | ||
|
|
3283d38867 | ||
|
|
4204ff367e | ||
|
|
51e646690c | ||
|
|
85607f7846 | ||
|
|
41a5bcc3a1 | ||
|
|
84c8a9be9b | ||
|
|
62b2fe3e2f | ||
|
|
f5fdd79c7f | ||
|
|
14752ccb0c | ||
|
|
541c166863 | ||
|
|
270f62bbb2 | ||
|
|
8290d853c9 | ||
|
|
b0a67300cc | ||
|
|
0b9749f3a4 | ||
|
|
3ad3e19392 | ||
|
|
ed71adac7e | ||
|
|
8d95c92bfb | ||
|
|
41ab94978f | ||
|
|
26e198b7d8 | ||
|
|
d16746ab38 | ||
|
|
627c3e20cc | ||
|
|
4d42d4a190 | ||
|
|
ff184822ca | ||
|
|
ddbd6d1e82 | ||
|
|
f6d6478944 | ||
|
|
138c7f2665 | ||
|
|
239ace0c07 | ||
|
|
c1312100aa | ||
|
|
e343eccdc3 | ||
|
|
da5b316358 | ||
|
|
dc8692044c | ||
|
|
4f9ba11489 | ||
|
|
f7914db019 | ||
|
|
11ecaff7db | ||
|
|
d832bbcc70 | ||
|
|
59aed49e98 | ||
|
|
e9f83ca735 | ||
|
|
afa9ad3cde | ||
|
|
01d29ed11e | ||
|
|
8f9ae7e4d5 | ||
|
|
70b048f356 | ||
|
|
5fddd3b104 | ||
|
|
02afbb4000 | ||
|
|
54432485e7 | ||
|
|
26ede2839b | ||
|
|
4b0df1a7ae | ||
|
|
9767e7d3b7 | ||
|
|
4133e7d6d6 | ||
|
|
4f37355a9f | ||
|
|
82fae45656 | ||
|
|
2f09c32d2d | ||
|
|
a16338ce11 | ||
|
|
50d0b1412d | ||
|
|
8941bd1747 | ||
|
|
615dc0c4a3 | ||
|
|
1fb8b2e279 | ||
|
|
0799177cf4 | ||
|
|
1eed61397b | ||
|
|
3f1f7c7ef7 | ||
|
|
8543dda4aa | ||
|
|
68a89b615d | ||
|
|
e9d3f67c5c | ||
|
|
a980390870 | ||
|
|
299781bdba | ||
|
|
f42d3e0536 | ||
|
|
993eb5c90d | ||
|
|
f8f8319324 | ||
|
|
12d84c43c9 |
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -4,18 +4,19 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- tiddlywiki-com
|
||||
- multi-wiki-support
|
||||
env:
|
||||
NODE_VERSION: "22"
|
||||
NODE_VERSION: "23"
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE_VERSION }}"
|
||||
- run: "./bin/ci-test.sh"
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
@@ -30,8 +31,8 @@ jobs:
|
||||
TW5_BUILD_MAIN_EDITION: "./editions/prerelease"
|
||||
TW5_BUILD_OUTPUT: "./output/prerelease"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE_VERSION }}"
|
||||
- run: "./bin/ci-pre-build.sh"
|
||||
@@ -62,8 +63,8 @@ jobs:
|
||||
TW5_BUILD_OUTPUT: "./output"
|
||||
TW5_BUILD_ARCHIVE: "./output"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE_VERSION }}"
|
||||
- run: "./bin/ci-pre-build.sh"
|
||||
@@ -82,3 +83,14 @@ jobs:
|
||||
- run: "./bin/build-tw-org.sh"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
|
||||
build-mws-tiddlywiki-com:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/multi-wiki-support'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ env.NODE_VERSION }}"
|
||||
- run: "./bin/build-mws-site.sh"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,7 +5,9 @@
|
||||
tmp/
|
||||
output/
|
||||
node_modules/
|
||||
store/
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
$__StoryList.tid
|
||||
/editions/test/test-store/*
|
||||
4
TODO BEFORE MERGING THIS PR.md
Normal file
4
TODO BEFORE MERGING THIS PR.md
Normal file
@@ -0,0 +1,4 @@
|
||||
The `multi-wiki-support` branch includes some changes that are not intended to be merged into the `master` branch:
|
||||
|
||||
* Readme update (see `editions/tw5.com/tiddlers/readme/ReadMe.tid`)
|
||||
* Remove `multiwikiserver` plugin from `readme-bld.sh` (see `bin/readme-bld.sh`)
|
||||
97
bin/build-mws-site.sh
Executable file
97
bin/build-mws-site.sh
Executable file
@@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build mws.tiddlywiki.com assets.
|
||||
|
||||
# Default to the version of TiddlyWiki installed in this repo
|
||||
|
||||
if [ -z "$MWSTWCOM_BUILD_TIDDLYWIKI" ]; then
|
||||
MWSTWCOM_BUILD_TIDDLYWIKI=./tiddlywiki.js
|
||||
fi
|
||||
|
||||
echo "Using MWSTWCOM_BUILD_TIDDLYWIKI as [$MWSTWCOM_BUILD_TIDDLYWIKI]"
|
||||
|
||||
# Set up the build details
|
||||
|
||||
if [ -z "$MWSTWCOM_BUILD_DETAILS" ]; then
|
||||
MWSTWCOM_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)"
|
||||
fi
|
||||
|
||||
echo "Using MWSTWCOM_BUILD_DETAILS as [$MWSTWCOM_BUILD_DETAILS]"
|
||||
|
||||
if [ -z "$MWSTWCOM_BUILD_COMMIT" ]; then
|
||||
MWSTWCOM_BUILD_COMMIT="$(git rev-parse HEAD)"
|
||||
fi
|
||||
|
||||
echo "Using MWSTWCOM_BUILD_COMMIT as [$MWSTWCOM_BUILD_COMMIT]"
|
||||
|
||||
# Set up the build output directory
|
||||
|
||||
if [ -z "$MWSTWCOM_BUILD_OUTPUT" ]; then
|
||||
MWSTWCOM_BUILD_OUTPUT=$(mktemp -d)
|
||||
fi
|
||||
|
||||
mkdir -p $MWSTWCOM_BUILD_OUTPUT
|
||||
|
||||
if [ ! -d "$MWSTWCOM_BUILD_OUTPUT" ]; then
|
||||
echo 'A valid MWSTWCOM_BUILD_OUTPUT environment variable must be set'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using MWSTWCOM_BUILD_OUTPUT as [$MWSTWCOM_BUILD_OUTPUT]"
|
||||
|
||||
# Pull existing GitHub pages content
|
||||
|
||||
git clone --depth=1 --branch=main "https://github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" $MWSTWCOM_BUILD_OUTPUT
|
||||
|
||||
# Make the CNAME file that GitHub Pages requires
|
||||
|
||||
echo "mws.tiddlywiki.com" > $MWSTWCOM_BUILD_OUTPUT/CNAME
|
||||
|
||||
# Delete any existing static content
|
||||
|
||||
mkdir -p $MWSTWCOM_BUILD_OUTPUT/static
|
||||
rm $MWSTWCOM_BUILD_OUTPUT/static/*
|
||||
|
||||
# Put the build details into a .tid file so that it can be included in each build (deleted at the end of this script)
|
||||
|
||||
echo -e -n "title: $:/build\ncommit: $MWSTWCOM_BUILD_COMMIT\n\n$MWSTWCOM_BUILD_DETAILS\n" > $MWSTWCOM_BUILD_OUTPUT/build.tid
|
||||
|
||||
######################################################
|
||||
#
|
||||
# mws.tiddlywiki.com distribution
|
||||
#
|
||||
######################################################
|
||||
|
||||
# /index.html Main site
|
||||
# /favicon.ico Favicon for main site
|
||||
# /static.html Static rendering of default tiddlers
|
||||
# /alltiddlers.html Static rendering of all tiddlers
|
||||
# /static/* Static single tiddlers
|
||||
# /static/static.css Static stylesheet
|
||||
# /static/favicon.ico Favicon for static pages
|
||||
node $MWSTWCOM_BUILD_TIDDLYWIKI \
|
||||
editions/multiwikidocs \
|
||||
--verbose \
|
||||
--version \
|
||||
--load $MWSTWCOM_BUILD_OUTPUT/build.tid \
|
||||
--output $MWSTWCOM_BUILD_OUTPUT \
|
||||
--build favicon static index \
|
||||
|| exit 1
|
||||
|
||||
# Delete the temporary build tiddler
|
||||
|
||||
rm $MWSTWCOM_BUILD_OUTPUT/build.tid || exit 1
|
||||
|
||||
# Push output back to GitHub
|
||||
|
||||
# Exit script immediately if any command fails
|
||||
set -e
|
||||
|
||||
pushd $MWSTWCOM_BUILD_OUTPUT
|
||||
git config --global user.email "actions@github.com"
|
||||
git config --global user.name "GitHub Actions"
|
||||
git add -A .
|
||||
git commit --message "GitHub build: $GITHUB_RUN_NUMBER of $TW5_BUILD_BRANCH ($(date +'%F %T %Z'))"
|
||||
git remote add deploy "https://$GH_TOKEN@github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" &>/dev/null
|
||||
git push deploy main &>/dev/null
|
||||
popd
|
||||
@@ -105,34 +105,20 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
fi
|
||||
|
||||
# /index.html Main site
|
||||
# /external-(version).html External core version of main site
|
||||
# /favicon.ico Favicon for main site
|
||||
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
$TW5_BUILD_MAIN_EDITION \
|
||||
--version \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--build favicon index external-js \
|
||||
|| exit 1
|
||||
|
||||
# /static.html Static rendering of default tiddlers
|
||||
# /alltiddlers.html Static rendering of all tiddlers
|
||||
# /static/* Static single tiddlers
|
||||
# /static/static.css Static stylesheet
|
||||
# /static/favicon.ico Favicon for static pages
|
||||
|
||||
# Conditionally build static files if $TW5_BUILD_STATIC variable is not set or is set to 0
|
||||
if [ -z "$TW5_BUILD_STATIC" ] || [ "$TW5_BUILD_STATIC" = "0" ]; then
|
||||
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
$TW5_BUILD_MAIN_EDITION \
|
||||
--version \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--build static \
|
||||
--build favicon static index \
|
||||
|| exit 1
|
||||
fi
|
||||
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
@@ -169,7 +155,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/tour \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js tour.html text/plain \
|
||||
--rendertiddler $:/core/save/all tour.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# /share.html Custom edition for sharing via the URL
|
||||
@@ -203,15 +189,12 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
#
|
||||
######################################################
|
||||
|
||||
# Conditionally build editions if $TW5_BUILD_EDITIONS variable is not set or is set to 0
|
||||
if [ -z "$TW5_BUILD_EDITIONS" ] || [ "$TW5_BUILD_EDITIONS" = "0" ]; then
|
||||
|
||||
# /editions/xlsx-utils/index.html xlsx-utils edition
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/xlsx-utils \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/resumebuilder/index.html Resume builder edition
|
||||
@@ -227,7 +210,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/text-slicer \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/text-slicer/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/translators/index.html Translators edition
|
||||
@@ -259,7 +242,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/tw5.com-docs \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/twitter-archivist/index.html Twitter Archivist edition
|
||||
@@ -270,25 +253,19 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
######################################################
|
||||
#
|
||||
# Plugin demos
|
||||
#
|
||||
######################################################
|
||||
|
||||
# Conditionally build plugin demos if $TW5_BUILD_PLUGIN_DEMOS variable is not set
|
||||
if [ -z "$TW5_BUILD_PLUGIN_DEMOS" ] || [ "$TW5_BUILD_PLUGIN_DEMOS" = "0" ]; then
|
||||
|
||||
# /plugins/tiddlywiki/innerwiki/index.html Demo wiki with Innerwiki plugin
|
||||
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/innerwikidemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/innerwiki/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/innerwiki/index.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# /plugins/tiddlywiki/dynaview/index.html Demo wiki with DynaView plugin
|
||||
@@ -298,7 +275,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/dynaviewdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/dynaview/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/dynaview/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/dynaview/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -312,7 +289,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/katexdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/katex/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/katex/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -342,7 +319,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/codemirrordemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/codemirror/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/codemirror/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -352,7 +329,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/markdowndemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/markdown/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/markdown/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -362,7 +339,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/classicparserdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/tw2parser/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/tw2parser/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -372,7 +349,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/highlightdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/highlight/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -382,21 +359,16 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/geospatialdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/geospatial/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/geospatial/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
fi
|
||||
|
||||
######################################################
|
||||
#
|
||||
# Language editions
|
||||
#
|
||||
######################################################
|
||||
|
||||
# Conditionally build language editions if $TW5_BUILD_LANGUAGE_DEMOS variable is not set
|
||||
if [ -z "$TW5_BUILD_LANGUAGE_DEMOS" ] || [ "$TW5_BUILD_LANGUAGE_DEMOS" = "0" ]; then
|
||||
|
||||
# Delete any existing static content
|
||||
|
||||
rm -rf $TW5_BUILD_OUTPUT/languages/de-AT/static/*
|
||||
@@ -480,17 +452,12 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
--build empty index \
|
||||
|| exit 1
|
||||
|
||||
fi
|
||||
|
||||
######################################################
|
||||
#
|
||||
# Plugin library
|
||||
#
|
||||
######################################################
|
||||
|
||||
# Conditionally build plugin library if $TW5_BUILD_PLUGIN_LIBRARY variable is not set
|
||||
if [ -z "$TW5_BUILD_PLUGIN_LIBRARY" ] || [ "$TW5_BUILD_PLUGIN_LIBRARY" = "0" ]; then
|
||||
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/pluginlibrary \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
@@ -498,8 +465,6 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
--build library\
|
||||
|| exit 1
|
||||
|
||||
fi
|
||||
|
||||
# Delete the temporary build tiddler
|
||||
|
||||
rm $TW5_BUILD_OUTPUT/build.tid || exit 1
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
# test TiddlyWiki5 for tiddlywiki.com
|
||||
|
||||
npm install
|
||||
|
||||
node ./tiddlywiki.js \
|
||||
./editions/test \
|
||||
--verbose \
|
||||
|
||||
@@ -10,6 +10,7 @@ fi
|
||||
|
||||
# tw5.com readmes
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
+plugins/tiddlywiki/multiwikiserver \
|
||||
editions/tw5.com \
|
||||
--verbose \
|
||||
--output . \
|
||||
|
||||
39
boot/boot.js
39
boot/boot.js
@@ -232,10 +232,10 @@ $tw.utils.error = function(err) {
|
||||
var link = dm("a"),
|
||||
text = JSON.stringify(tiddlers);
|
||||
if(Blob !== undefined) {
|
||||
var blob = new Blob([text], {type: "application/json"});
|
||||
var blob = new Blob([text], {type: "text/html"});
|
||||
link.setAttribute("href", URL.createObjectURL(blob));
|
||||
} else {
|
||||
link.setAttribute("href","data:application/json," + encodeURIComponent(text));
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
}
|
||||
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
|
||||
document.body.appendChild(link);
|
||||
@@ -1902,16 +1902,8 @@ $tw.loadTiddlersFromFile = function(filepath,fields) {
|
||||
extensionInfo = $tw.utils.getFileExtensionInfo(ext),
|
||||
type = extensionInfo ? extensionInfo.type : null,
|
||||
typeInfo = type ? $tw.config.contentTypeInfo[type] : null,
|
||||
fileSize = fs.statSync(filepath).size,
|
||||
data;
|
||||
if(fileSize > $tw.config.maxEditFileSize) {
|
||||
data = "File " + filepath + "not loaded because it is too large";
|
||||
console.log("Warning: " + data);
|
||||
ext = ".txt";
|
||||
} else {
|
||||
data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8");
|
||||
}
|
||||
var tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
|
||||
data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8"),
|
||||
tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
|
||||
metadata = $tw.loadMetadataForFile(filepath);
|
||||
if(metadata) {
|
||||
if(type === "application/json") {
|
||||
@@ -2000,7 +1992,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
var value = tiddler[name];
|
||||
switch(fieldInfo.source) {
|
||||
case "subdirectories":
|
||||
value = $tw.utils.stringifyList(path.relative(rootPath, filename).split(path.sep).slice(0, -1));
|
||||
value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
|
||||
break;
|
||||
case "filepath":
|
||||
value = path.relative(rootPath, filename).split(path.sep).join('/');
|
||||
@@ -2021,10 +2013,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
value = path.extname(filename);
|
||||
break;
|
||||
case "created":
|
||||
value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).birthtime));
|
||||
value = new Date(fs.statSync(pathname).birthtime);
|
||||
break;
|
||||
case "modified":
|
||||
value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).mtime));
|
||||
value = new Date(fs.statSync(pathname).mtime);
|
||||
break;
|
||||
}
|
||||
if(fieldInfo.prefix) {
|
||||
@@ -2471,15 +2463,13 @@ $tw.boot.initStartup = function(options) {
|
||||
$tw.utils.registerFileType("image/webp","base64",".webp",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/heic","base64",".heic",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/heif","base64",".heif",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/avif","base64",".avif",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/vnd.microsoft.icon","base64",".ico",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
|
||||
$tw.utils.registerFileType("application/wasm","base64",".wasm");
|
||||
$tw.utils.registerFileType("font/woff","base64",".woff");
|
||||
$tw.utils.registerFileType("font/woff2","base64",".woff2");
|
||||
$tw.utils.registerFileType("font/ttf","base64",".ttf");
|
||||
$tw.utils.registerFileType("font/otf","base64",".otf");
|
||||
$tw.utils.registerFileType("application/font-woff","base64",".woff");
|
||||
$tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
|
||||
$tw.utils.registerFileType("application/font-woff2","base64",".woff2");
|
||||
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
|
||||
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
||||
$tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]);
|
||||
@@ -2732,15 +2722,14 @@ $tw.hooks.removeHook = function(hookName,definition) {
|
||||
/*
|
||||
Invoke the hook by key
|
||||
*/
|
||||
$tw.hooks.invokeHook = function(hookName, firstArgument /*, value,... */) {
|
||||
if(Object.prototype.hasOwnProperty.call($tw.hooks.names,hookName)) {
|
||||
var args = Array.prototype.slice.call(arguments,1);
|
||||
$tw.hooks.invokeHook = function(hookName /*, value,... */) {
|
||||
var args = Array.prototype.slice.call(arguments,1);
|
||||
if($tw.utils.hop($tw.hooks.names,hookName)) {
|
||||
for(var i = 0; i < $tw.hooks.names[hookName].length; i++) {
|
||||
args[0] = $tw.hooks.names[hookName][i].apply(null,args);
|
||||
}
|
||||
return args[0];
|
||||
}
|
||||
return firstArgument;
|
||||
return args[0];
|
||||
};
|
||||
|
||||
/////////////////////////// Main boot function to decrypt tiddlers and then startup
|
||||
|
||||
@@ -19,10 +19,6 @@ var _bootprefix = (function($tw) {
|
||||
$tw = $tw || Object.create(null);
|
||||
$tw.boot = $tw.boot || Object.create(null);
|
||||
|
||||
// Config
|
||||
$tw.config = $tw.config || Object.create(null);
|
||||
$tw.config.maxEditFileSize = 100 * 1024 * 1024; // 100MB
|
||||
|
||||
// Detect platforms
|
||||
if(!("browser" in $tw)) {
|
||||
$tw.browser = typeof(window) !== "undefined" && typeof(document) !== "undefined" ? {} : null;
|
||||
|
||||
@@ -5,3 +5,7 @@ TiddlyWiki incorporates code from these fine OpenSource projects:
|
||||
* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]
|
||||
* [[The Jasmine JavaScript Test Framework|https://jasmine.github.io/]]
|
||||
* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]
|
||||
|
||||
And media from these projects:
|
||||
|
||||
* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
title: $:/core/images/language
|
||||
tags: $:/tags/Image
|
||||
|
||||
\parameters (size:"22pt")
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-language tc-image-button" viewBox="0 0 92 92"><path d="M0 0h2480.32v3507.87H0z" style="fill:none" transform="scale(.03696 .02613)"/><path d="M71.508 62.298c-1.243 15.83-16.758 28.344-35.714 28.344-5.713 0-11.113-1.136-15.905-3.158-2.977 2.498-8.618 4.183-15.088 4.183-.929 0-1.84-.034-2.73-.102 4.499-1.5 7.989-4.886 9.298-9.099C4.373 76.918 0 69.016 0 60.246 0 49.773 6.237 40.537 15.729 35.07c1.235 7.764 5.492 14.713 11.724 19.953l-7.269 18.453c-.393.976-.676 1.737-.847 2.285a5.326 5.326 0 0 0-.256 1.591c0 .89.368 1.686 1.103 2.388.736.702 1.583 1.052 2.542 1.052 1.13 0 1.942-.33 2.438-.988.497-.659 1.096-1.93 1.797-3.812l1.797-4.826h15.3l1.797 4.723c.239.582.526 1.254.86 2.015.333.762.646 1.327.936 1.695.291.368.65.659 1.078.873.428.213.942.32 1.54.32a3.586 3.586 0 0 0 2.632-1.09c.727-.728 1.09-1.528 1.09-2.4 0-.84-.384-2.183-1.154-4.031l-3.545-8.755c2.142.3 4.34.455 6.58.455 5.541 0 10.824-.951 15.636-2.674Zm-30.563.247 1.059 2.898H30.76l2.32-6.467a43.152 43.152 0 0 0 7.865 3.569Z"/><path d="M71.778 57.635c-4.793 2.023-10.191 3.157-15.907 3.157-19.767 0-35.793-13.61-35.793-30.396S36.104.001 55.87.001c19.772 0 35.797 13.61 35.797 30.395 0 8.77-4.373 16.674-11.371 22.221 1.309 4.211 4.8 7.6 9.299 9.1-.89.067-1.802.1-2.73.1-6.47 0-12.11-1.686-15.088-4.182Zm-15.59-15.887a44.237 44.237 0 0 0 3.3 2.496c4.284 2.942 9.06 5.381 14.33 7.315l2.334-3.517c-5.134-1.871-9.696-4.125-13.69-6.763a42.558 42.558 0 0 1-3.37-2.483c4.247-4.806 7.374-10.43 9.38-16.869h6.698V17.78h-16.7a47.226 47.226 0 0 0-1.528-2.959 52.943 52.943 0 0 0-2.885-4.562l-4.218 1.554a36.467 36.467 0 0 1 2.971 3.983c.427.661.833 1.323 1.217 1.984H36.394v4.148h6.77a36.878 36.878 0 0 0 5.422 11.56 42.918 42.918 0 0 0 4.591 5.497c-4.687 4.017-10.548 6.932-17.582 8.744l2.247 3.709c7.746-2.44 13.861-5.67 18.347-9.689Zm-9.047-19.82h16.991c-1.86 5.668-4.528 10.402-8 14.204a42.526 42.526 0 0 1-4.247-4.922c-2.126-2.883-3.71-5.977-4.744-9.283Z"/></svg>
|
||||
@@ -4,12 +4,12 @@ _canonical_uri: The full URI of an external image tiddler
|
||||
author: Name of the author of a plugin
|
||||
bag: The name of the bag from which a tiddler came
|
||||
caption: The text to be displayed on a tab or button
|
||||
class: The CSS class applied to a tiddler when rendering it. Also used for Modals
|
||||
class: The CSS class applied to a tiddler when rendering it - see [[Custom styles by user-class]]. Also used for [[Modals]]
|
||||
code-body: The view template will display the tiddler as code if set to ''yes''
|
||||
color: The CSS color value associated with a tiddler
|
||||
component: The name of the component responsible for an alert tiddler
|
||||
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
||||
core-version: For a plugin, indicates what version of TiddlyWiki with which it is compatible
|
||||
current-tiddler: Used to cache the top tiddler in a history list
|
||||
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
|
||||
|
||||
@@ -3,9 +3,7 @@ title: $:/language/Search/
|
||||
DefaultResults/Caption: List
|
||||
Filter/Caption: Filter
|
||||
Filter/Hint: Search via a [[filter expression|https://tiddlywiki.com/static/Filters.html]]
|
||||
Filter/Placeholder: Filter expression
|
||||
Filter/Matches: //<small><<resultCount>> matches</small>//
|
||||
Filter/FilterResults/Results/Caption: Results
|
||||
Matches: //<small><<resultCount>> matches</small>//
|
||||
Matches/All: All matches:
|
||||
Matches/NoMatch: //No match//
|
||||
|
||||
13
core/language/en-GB/icon.tid
Normal file
13
core/language/en-GB/icon.tid
Normal file
@@ -0,0 +1,13 @@
|
||||
title: $:/languages/en-GB/icon
|
||||
type: image/svg+xml
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
|
||||
<clipPath id="t">
|
||||
<path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
|
||||
</clipPath>
|
||||
<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
|
||||
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
|
||||
<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
|
||||
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
|
||||
<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
|
||||
</svg>
|
||||
@@ -6,7 +6,10 @@ module-type: global
|
||||
The $tw.Commander class is a command interpreter
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -35,6 +38,13 @@ Commander.prototype.log = function(str) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Clear pending commands
|
||||
*/
|
||||
Commander.prototype.clearCommands = function() {
|
||||
this.commandTokens = this.commandTokens.slice(0,this.nextToken);
|
||||
};
|
||||
|
||||
/*
|
||||
Write a string if verbose flag is set
|
||||
*/
|
||||
@@ -170,3 +180,5 @@ Commander.initCommands = function(moduleType) {
|
||||
};
|
||||
|
||||
exports.Commander = Commander;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to build a build target
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -45,3 +48,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Clear password for crypto operations
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -26,3 +29,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -7,6 +7,10 @@ Runs the commands returned from a filter
|
||||
|
||||
\*/
|
||||
|
||||
(function() {
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -34,3 +38,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to delete tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -35,3 +38,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to list the available editions
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -32,3 +35,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Commands to fetch external tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -168,3 +171,5 @@ Command.prototype.processBody = function(body,type,options,url) {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Help command
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jshint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -34,3 +37,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to import tiddlers from a file
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -41,3 +44,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to initialise an empty wiki folder
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -52,3 +55,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,14 +6,17 @@ module-type: command
|
||||
Listen for HTTP requests and serve tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Server = require("$:/core/modules/server/server.js").Server;
|
||||
|
||||
exports.info = {
|
||||
name: "listen",
|
||||
synchronous: true,
|
||||
synchronous: false,
|
||||
namedParameterMode: true,
|
||||
mandatoryParameters: []
|
||||
};
|
||||
@@ -35,9 +38,15 @@ Command.prototype.execute = function() {
|
||||
wiki: this.commander.wiki,
|
||||
variables: self.params
|
||||
});
|
||||
var nodeServer = this.server.listen();
|
||||
var nodeServer = this.server.listen(null,null,null,{
|
||||
callback: function() {
|
||||
self.callback();
|
||||
}
|
||||
});
|
||||
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer,"tiddlywiki");
|
||||
return null;
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to load tiddlers from a file or directory
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -44,3 +47,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to pack all of the plugins in the library into a plugin tiddler of type "library"
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -38,3 +41,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to set the default output location (defaults to current working directory)
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -31,3 +34,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Save password for crypto operations
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -29,3 +32,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
37
core/modules/commands/quit.js
Normal file
37
core/modules/commands/quit.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*\
|
||||
title: $:/core/modules/commands/quit.js
|
||||
type: application/javascript
|
||||
module-type: command
|
||||
|
||||
Immediately ends the TiddlyWiki process
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
name: "quit",
|
||||
synchronous: true
|
||||
};
|
||||
|
||||
var Command = function(params,commander,callback) {
|
||||
var self = this;
|
||||
this.params = params;
|
||||
this.commander = commander;
|
||||
this.callback = callback;
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
// Clear any pending commands
|
||||
this.commander.clearCommands();
|
||||
// We don't actually quit, we just issue the "th-quit" hook to give listeners a chance to exit
|
||||
$tw.hooks.invokeHook("th-quit");
|
||||
return null;
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Render individual tiddlers and save the results to the specified files
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
@@ -63,3 +66,6 @@ Render individual tiddlers and save the results to the specified files
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to render a tiddler and save it to a file
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -50,3 +53,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to render several tiddlers to a folder of files
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
@@ -62,3 +65,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Saves individual tiddlers in their raw text or binary format to the specified files
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -61,3 +64,6 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -16,7 +16,10 @@ The pathname specifies the pathname to the folder in which the JSON files should
|
||||
The skinnylisting specifies the title of the tiddler to which a JSON catalogue of the subtiddlers will be saved. The JSON file contains the same data as the bundle tiddler but with the `text` field removed.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -91,3 +94,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to save the content of a tiddler to a file
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -44,3 +47,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to save several tiddlers to a folder of files
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
@@ -49,3 +52,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -15,7 +15,10 @@ The following options are supported:
|
||||
Supports backward compatibility with --savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -218,3 +221,5 @@ WikiFolderMaker.prototype.saveFile = function(filename,encoding,data) {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Deprecated legacy command for serving tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Server = require("$:/core/modules/server/server.js").Server;
|
||||
@@ -48,3 +51,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to modify selected tiddlers to set a field to the text of a template tiddler that has been wikified with the selected tiddler as the current tiddler.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
@@ -51,3 +54,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Command to extract the shadow tiddlers from within a plugin
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -37,3 +40,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Verbose command
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -27,3 +30,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: command
|
||||
Version command
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
@@ -25,3 +28,5 @@ Command.prototype.execute = function() {
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: config
|
||||
Core configuration constants
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.preferences = {};
|
||||
@@ -34,3 +37,5 @@ exports.htmlVoidElements = "area,base,br,col,command,embed,hr,img,input,keygen,l
|
||||
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,nav,ol,p,pre,section,summary,table,tfoot,ul,video".split(",");
|
||||
|
||||
exports.htmlUnsafeElements = "script".split(",");
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: tiddlerdeserializer
|
||||
Functions to deserialise tiddlers from a block of text
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["application/x-tiddler-html-div"] = function(text,fields) {
|
||||
@@ -178,3 +181,5 @@ var deserializeTiddlerDiv = function(text /* [,fields] */) {
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: library
|
||||
Text editor engine based on a simple input or textarea within an iframe. This is done so that the selection is preserved even when clicking away from the textarea
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true,browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
|
||||
@@ -270,3 +273,5 @@ FramedEngine.prototype.executeTextOperation = function(operation) {
|
||||
};
|
||||
|
||||
exports.FramedEngine = FramedEngine;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: library
|
||||
Text editor engine based on a simple input or textarea tag
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
|
||||
@@ -169,3 +172,5 @@ SimpleEngine.prototype.executeTextOperation = function(operation) {
|
||||
};
|
||||
|
||||
exports.SimpleEngine = SimpleEngine;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: library
|
||||
Factory for constructing text editor widgets with specified engines for the toolbar and non-toolbar cases
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var DEFAULT_MIN_TEXT_AREA_HEIGHT = "100px"; // Minimum height of textareas in pixels
|
||||
@@ -383,3 +386,5 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
||||
}
|
||||
|
||||
exports.editTextWidgetFactory = editTextWidgetFactory;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: bitmapeditoroperation
|
||||
Bitmap editor operation to clear the image
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["clear"] = function(event) {
|
||||
@@ -17,3 +20,5 @@ exports["clear"] = function(event) {
|
||||
// Save changes
|
||||
this.strokeEnd();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: bitmapeditoroperation
|
||||
Bitmap editor operation to resize the image
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["resize"] = function(event) {
|
||||
@@ -22,3 +25,5 @@ exports["resize"] = function(event) {
|
||||
// Save the image into the tiddler
|
||||
this.saveChanges();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: bitmapeditoroperation
|
||||
Bitmap editor operation to rotate the image left by 90 degrees
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["rotate-left"] = function(event) {
|
||||
@@ -17,3 +20,5 @@ exports["rotate-left"] = function(event) {
|
||||
// Save the image into the tiddler
|
||||
this.saveChanges();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to excise the selection to a new tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
function isMarkdown(mediaType) {
|
||||
@@ -50,3 +53,5 @@ exports["excise"] = function(event,operation) {
|
||||
operation.newSelStart = operation.selStart;
|
||||
operation.newSelEnd = operation.selStart + operation.replacement.length;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -4,9 +4,14 @@ type: application/javascript
|
||||
module-type: texteditoroperation
|
||||
Simply focus the Text editor
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["focus-editor"] = function(event,operation) {
|
||||
operation = null;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation insert text at the caret position. If there is a selection it is replaced.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["insert-text"] = function(event,operation) {
|
||||
@@ -16,3 +19,5 @@ exports["insert-text"] = function(event,operation) {
|
||||
operation.newSelStart = operation.selStart + operation.replacement.length;
|
||||
operation.newSelEnd = operation.newSelStart;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to make a link
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["make-link"] = function(event,operation) {
|
||||
@@ -22,3 +25,5 @@ exports["make-link"] = function(event,operation) {
|
||||
operation.newSelStart = operation.selStart + operation.replacement.length;
|
||||
operation.newSelEnd = operation.newSelStart;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to add a prefix to the selected lines
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["prefix-lines"] = function(event,operation) {
|
||||
@@ -48,3 +51,5 @@ exports["prefix-lines"] = function(event,operation) {
|
||||
operation.newSelEnd = operation.newSelStart + operation.replacement.length;
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to replace the entire text
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["replace-all"] = function(event,operation) {
|
||||
@@ -16,3 +19,5 @@ exports["replace-all"] = function(event,operation) {
|
||||
operation.newSelStart = 0;
|
||||
operation.newSelEnd = operation.replacement.length;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to replace the selection
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["replace-selection"] = function(event,operation) {
|
||||
@@ -16,3 +19,5 @@ exports["replace-selection"] = function(event,operation) {
|
||||
operation.newSelStart = operation.selStart;
|
||||
operation.newSelEnd = operation.selStart + operation.replacement.length;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to save the current selection in a specified tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["save-selection"] = function(event,operation) {
|
||||
@@ -16,3 +19,5 @@ exports["save-selection"] = function(event,operation) {
|
||||
this.wiki.setText(tiddler,field,null,operation.text.substring(operation.selStart,operation.selEnd));
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to wrap the selected lines with a prefix and suffix
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["wrap-lines"] = function(event,operation) {
|
||||
@@ -40,3 +43,5 @@ exports["wrap-lines"] = function(event,operation) {
|
||||
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: texteditoroperation
|
||||
Text editor operation to wrap the selection with the specified prefix and suffix
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["wrap-selection"] = function(event,operation) {
|
||||
@@ -131,3 +134,5 @@ exports["wrap-selection"] = function(event,operation) {
|
||||
addPrefixSuffix();
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -7,7 +7,10 @@ Union of sets without de-duplication.
|
||||
Equivalent to = filter run prefix.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -18,3 +21,5 @@ exports.all = function(operationSubFunction) {
|
||||
results.push.apply(results, operationSubFunction(source,widget));
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -7,7 +7,10 @@ Intersection of sets.
|
||||
Equivalent to + filter run prefix.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -21,3 +24,5 @@ exports.and = function(operationSubFunction,options) {
|
||||
results.pushTop(operationSubFunction(source,widget));
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -3,7 +3,10 @@ title: $:/core/modules/filterrunprefixes/cascade.js
|
||||
type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -36,3 +39,5 @@ exports.cascade = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: filterrunprefix
|
||||
Equivalent to ~ filter run prefix.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -20,3 +23,5 @@ exports.else = function(operationSubFunction) {
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -7,7 +7,10 @@ Difference of sets.
|
||||
Equivalent to - filter run prefix.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -18,3 +21,5 @@ exports.except = function(operationSubFunction) {
|
||||
results.remove(operationSubFunction(source,widget));
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -4,7 +4,10 @@ type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -32,3 +35,5 @@ exports.filter = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -4,7 +4,10 @@ type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -24,3 +27,5 @@ exports.intersection = function(operationSubFunction) {
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -3,7 +3,10 @@ title: $:/core/modules/filterrunprefixes/map.js
|
||||
type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -37,3 +40,5 @@ exports.map = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: filterrunprefix
|
||||
Equivalent to a filter run with no prefix.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -17,3 +20,5 @@ exports.or = function(operationSubFunction) {
|
||||
results.pushTop(operationSubFunction(source,widget));
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -3,7 +3,10 @@ title: $:/core/modules/filterrunprefixes/reduce.js
|
||||
type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -33,3 +36,5 @@ exports.reduce = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -4,7 +4,10 @@ type: application/javascript
|
||||
module-type: filterrunprefix
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -45,3 +48,5 @@ exports.sort = function(operationSubFunction,options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: filterrunprefix
|
||||
Replace results of previous runs unless empty
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -25,3 +28,5 @@ exports.then = function(operationSubFunction) {
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: wikimethod
|
||||
Adds tiddler filtering methods to the $tw.Wiki object.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var widgetClass = require("$:/core/modules/widgets/widget.js").widget;
|
||||
@@ -220,25 +223,13 @@ exports.filterTiddlers = function(filterString,widget,source) {
|
||||
Compile a filter into a function with the signature fn(source,widget) where:
|
||||
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
|
||||
widget: an optional widget node for retrieving the current tiddler etc.
|
||||
|
||||
Parameters:
|
||||
filterString: the filter string to compile
|
||||
options: includes:
|
||||
|
||||
wrappers: a hashmap of wrapper functions to apply to the compiled filter function
|
||||
*/
|
||||
exports.compileFilter = function(filterString,options) {
|
||||
options = options || {};
|
||||
var self = this;
|
||||
var wrappers = options.wrappers || {};
|
||||
// Invoke the hook to allow the filter to be inspected
|
||||
wrappers = $tw.hooks.invokeHook("th-filter-evaluation",filterString,wrappers) || wrappers;
|
||||
// Get the result from the cache if we can
|
||||
exports.compileFilter = function(filterString) {
|
||||
if(!this.filterCache) {
|
||||
this.filterCache = Object.create(null);
|
||||
this.filterCacheCount = 0;
|
||||
}
|
||||
if(this.filterCache[filterString] !== undefined && !wrappers.prefix && !wrappers.operation && !wrappers.operator && !wrappers.start && !wrappers.done) {
|
||||
if(this.filterCache[filterString] !== undefined) {
|
||||
return this.filterCache[filterString];
|
||||
}
|
||||
var filterParseTree;
|
||||
@@ -247,14 +238,7 @@ exports.compileFilter = function(filterString,options) {
|
||||
} catch(e) {
|
||||
// We do not cache this result, so it adjusts along with localization changes
|
||||
return function(source,widget) {
|
||||
if(wrappers.start) {
|
||||
wrappers.start(source,widget);
|
||||
}
|
||||
var resultsArray = [$tw.language.getString("Error/Filter") + ": " + e];
|
||||
if(wrappers.done) {
|
||||
wrappers.done(resultsArray);
|
||||
}
|
||||
return resultsArray;
|
||||
return [$tw.language.getString("Error/Filter") + ": " + e];
|
||||
};
|
||||
}
|
||||
// Get the hashmap of filter operator functions
|
||||
@@ -268,64 +252,52 @@ exports.compileFilter = function(filterString,options) {
|
||||
var operationSubFunction = function(source,widget) {
|
||||
var accumulator = source,
|
||||
results = [],
|
||||
currTiddlerTitle = widget && widget.getVariable("currentTiddler"),
|
||||
handleOperation = function() {
|
||||
$tw.utils.each(operation.operators,function(operator) {
|
||||
var operands = [],
|
||||
operatorName,operatorFunction;
|
||||
if(!operator.operator) {
|
||||
// Use the "title" operator if no operator is specified
|
||||
operatorName = "title";
|
||||
} else if(!filterOperators[operator.operator]) {
|
||||
// Unknown operators treated as "[unknown]" - at run time we can distinguish between a custom operator and falling back to the default "field" operator
|
||||
operatorName = "[unknown]";
|
||||
} else {
|
||||
// Use the operator function
|
||||
operatorName = operator.operator;
|
||||
}
|
||||
operatorFunction = filterOperators[operatorName];
|
||||
$tw.utils.each(operator.operands,function(operand) {
|
||||
if(operand.indirect) {
|
||||
operand.value = self.getTextReference(operand.text,"",currTiddlerTitle);
|
||||
} else if(operand.variable) {
|
||||
var varTree = $tw.utils.parseFilterVariable(operand.text);
|
||||
operand.value = widgetClass.evaluateVariable(widget,varTree.name,{params: varTree.params, source: source})[0] || "";
|
||||
} else {
|
||||
operand.value = operand.text;
|
||||
}
|
||||
operands.push(operand.value);
|
||||
currTiddlerTitle = widget && widget.getVariable("currentTiddler");
|
||||
$tw.utils.each(operation.operators,function(operator) {
|
||||
var operands = [],
|
||||
operatorFunction;
|
||||
if(!operator.operator) {
|
||||
// Use the "title" operator if no operator is specified
|
||||
operatorFunction = filterOperators.title;
|
||||
} else if(!filterOperators[operator.operator]) {
|
||||
// Unknown operators treated as "[unknown]" - at run time we can distinguish between a custom operator and falling back to the default "field" operator
|
||||
operatorFunction = filterOperators["[unknown]"];
|
||||
} else {
|
||||
// Use the operator function
|
||||
operatorFunction = filterOperators[operator.operator];
|
||||
}
|
||||
$tw.utils.each(operator.operands,function(operand) {
|
||||
if(operand.indirect) {
|
||||
operand.value = self.getTextReference(operand.text,"",currTiddlerTitle);
|
||||
} else if(operand.variable) {
|
||||
var varTree = $tw.utils.parseFilterVariable(operand.text);
|
||||
operand.value = widgetClass.evaluateVariable(widget,varTree.name,{params: varTree.params, source: source})[0] || "";
|
||||
} else {
|
||||
operand.value = operand.text;
|
||||
}
|
||||
operands.push(operand.value);
|
||||
});
|
||||
|
||||
// Invoke the appropriate filteroperator module
|
||||
results = operatorFunction(accumulator,{
|
||||
operator: operator.operator,
|
||||
operand: operands.length > 0 ? operands[0] : undefined,
|
||||
operands: operands,
|
||||
prefix: operator.prefix,
|
||||
suffix: operator.suffix,
|
||||
suffixes: operator.suffixes,
|
||||
regexp: operator.regexp
|
||||
},{
|
||||
wiki: self,
|
||||
widget: widget
|
||||
});
|
||||
// Wrap the filter operator module if required
|
||||
if(wrappers.operator) {
|
||||
operatorFunction = wrappers.operator.bind(self,operatorFunction);
|
||||
}
|
||||
// Invoke the appropriate filteroperator module
|
||||
results = operatorFunction(accumulator,{
|
||||
parseTree: operator,
|
||||
operator: operator.operator,
|
||||
operatorName: operatorName,
|
||||
operand: operands.length > 0 ? operands[0] : undefined,
|
||||
operands: operands,
|
||||
prefix: operator.prefix,
|
||||
suffix: operator.suffix,
|
||||
suffixes: operator.suffixes,
|
||||
regexp: operator.regexp
|
||||
},{
|
||||
wiki: self,
|
||||
widget: widget
|
||||
});
|
||||
if($tw.utils.isArray(results)) {
|
||||
accumulator = self.makeTiddlerIterator(results);
|
||||
} else {
|
||||
accumulator = results;
|
||||
}
|
||||
});
|
||||
};
|
||||
if(wrappers.operation) {
|
||||
handleOperation = wrappers.operation.bind(self,handleOperation,operation);
|
||||
}
|
||||
handleOperation();
|
||||
if($tw.utils.isArray(results)) {
|
||||
if($tw.utils.isArray(results)) {
|
||||
accumulator = self.makeTiddlerIterator(results);
|
||||
} else {
|
||||
accumulator = results;
|
||||
}
|
||||
});
|
||||
if($tw.utils.isArray(results)) {
|
||||
return results;
|
||||
} else {
|
||||
var resultArray = [];
|
||||
@@ -338,45 +310,27 @@ exports.compileFilter = function(filterString,options) {
|
||||
var filterRunPrefixes = self.getFilterRunPrefixes();
|
||||
// Wrap the operator functions in a wrapper function that depends on the prefix
|
||||
operationFunctions.push((function() {
|
||||
var prefixName;
|
||||
var options = {wiki: self, suffixes: operation.suffixes || []};
|
||||
switch(operation.prefix || "") {
|
||||
case "": // No prefix means that the operation is unioned into the result
|
||||
prefixName = "or";
|
||||
break;
|
||||
return filterRunPrefixes["or"](operationSubFunction, options);
|
||||
case "=": // The results of the operation are pushed into the result without deduplication
|
||||
prefixName = "all";
|
||||
break;
|
||||
return filterRunPrefixes["all"](operationSubFunction, options);
|
||||
case "-": // The results of this operation are removed from the main result
|
||||
prefixName = "except";
|
||||
break;
|
||||
return filterRunPrefixes["except"](operationSubFunction, options);
|
||||
case "+": // This operation is applied to the main results so far
|
||||
prefixName = "and";
|
||||
break;
|
||||
return filterRunPrefixes["and"](operationSubFunction, options);
|
||||
case "~": // This operation is unioned into the result only if the main result so far is empty
|
||||
prefixName = "else";
|
||||
break;
|
||||
default:
|
||||
prefixName = operation.namedPrefix;
|
||||
break;
|
||||
}
|
||||
if(prefixName && filterRunPrefixes[prefixName]) {
|
||||
var options = {
|
||||
wiki: self,
|
||||
suffixes: operation.suffixes || [],
|
||||
prefixName: prefixName,
|
||||
prefix: operation.prefix
|
||||
},
|
||||
filterRunPrefixFunction = filterRunPrefixes[prefixName];
|
||||
// Wrap the filter operator module if required
|
||||
if(wrappers.prefix) {
|
||||
filterRunPrefixFunction = wrappers.prefix.bind(self,filterRunPrefixFunction);
|
||||
}
|
||||
return filterRunPrefixFunction(operationSubFunction,options);
|
||||
} else {
|
||||
return function(results,source,widget) {
|
||||
results.clear();
|
||||
results.push($tw.language.getString("Error/FilterRunPrefix"));
|
||||
};
|
||||
return filterRunPrefixes["else"](operationSubFunction, options);
|
||||
default:
|
||||
if(operation.namedPrefix && filterRunPrefixes[operation.namedPrefix]) {
|
||||
return filterRunPrefixes[operation.namedPrefix](operationSubFunction, options);
|
||||
} else {
|
||||
return function(results,source,widget) {
|
||||
results.clear();
|
||||
results.push($tw.language.getString("Error/FilterRunPrefix"));
|
||||
};
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
||||
@@ -390,9 +344,6 @@ exports.compileFilter = function(filterString,options) {
|
||||
if(!widget) {
|
||||
widget = $tw.rootWidget;
|
||||
}
|
||||
if(wrappers.start) {
|
||||
wrappers.start(source,widget);
|
||||
}
|
||||
var results = new $tw.utils.LinkedList();
|
||||
self.filterRecursionCount = (self.filterRecursionCount || 0) + 1;
|
||||
if(self.filterRecursionCount < MAX_FILTER_DEPTH) {
|
||||
@@ -403,11 +354,7 @@ exports.compileFilter = function(filterString,options) {
|
||||
results.push("/**-- Excessive filter recursion --**/");
|
||||
}
|
||||
self.filterRecursionCount = self.filterRecursionCount - 1;
|
||||
var resultsArray = results.toArray();
|
||||
if(wrappers.done) {
|
||||
wrappers.done(resultsArray);
|
||||
}
|
||||
return resultsArray;
|
||||
return results.toArray();
|
||||
});
|
||||
if(this.filterCacheCount >= 2000) {
|
||||
// To prevent memory leak, we maintain an upper limit for cache size.
|
||||
@@ -416,9 +363,9 @@ exports.compileFilter = function(filterString,options) {
|
||||
this.filterCache = Object.create(null);
|
||||
this.filterCacheCount = 0;
|
||||
}
|
||||
if(!wrappers.prefix && !wrappers.operator) {
|
||||
this.filterCache[filterString] = fnMeasured;
|
||||
this.filterCacheCount++;
|
||||
}
|
||||
this.filterCache[filterString] = fnMeasured;
|
||||
this.filterCacheCount++;
|
||||
return fnMeasured;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -8,7 +8,10 @@ especially useful in contexts where only a filter expression is allowed
|
||||
and macro substitution isn't available.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -21,3 +24,5 @@ exports.addprefix = function(source,operator,options) {
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -8,7 +8,10 @@ especially useful in contexts where only a filter expression is allowed
|
||||
and macro substitution isn't available.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -21,3 +24,5 @@ exports.addsuffix = function(source,operator,options) {
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator returning the tiddler from the current list that is after the tiddler named in the operand.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -24,3 +27,5 @@ exports.after = function(source,operator,options) {
|
||||
return [results[index + 1]];
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -8,7 +8,10 @@ Filter operator for selecting tiddlers
|
||||
[all[shadows+tiddlers]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var allFilterOperators;
|
||||
@@ -51,3 +54,5 @@ exports.all = function(source,operator,options) {
|
||||
}
|
||||
return results.makeTiddlerIterator(options.wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[current]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -20,3 +23,5 @@ exports.current = function(source,prefix,options) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[missing]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -15,3 +18,5 @@ Export our filter function
|
||||
exports.missing = function(source,prefix,options) {
|
||||
return options.wiki.getMissingTitles();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[orphans]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -15,3 +18,5 @@ Export our filter function
|
||||
exports.orphans = function(source,prefix,options) {
|
||||
return options.wiki.getOrphanTitles();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[shadows]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -15,3 +18,5 @@ Export our filter function
|
||||
exports.shadows = function(source,prefix,options) {
|
||||
return options.wiki.allShadowTitles();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[tags]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -15,3 +18,5 @@ Export our filter function
|
||||
exports.tags = function(source,prefix,options) {
|
||||
return Object.keys(options.wiki.getTagMap());
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: allfilteroperator
|
||||
Filter function for [all[tiddlers]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -15,3 +18,5 @@ Export our filter function
|
||||
exports.tiddlers = function(source,prefix,options) {
|
||||
return options.wiki.allTitles();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for returning all the backlinks from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -19,3 +22,5 @@ exports.backlinks = function(source,operator,options) {
|
||||
});
|
||||
return results.makeTiddlerIterator(options.wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,6 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for returning all the backtranscludes from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -18,3 +22,5 @@ exports.backtranscludes = function(source,operator,options) {
|
||||
});
|
||||
return results.makeTiddlerIterator(options.wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator returning the tiddler from the current list that is before the tiddler named in the operand.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -24,3 +27,5 @@ exports.before = function(source,operator,options) {
|
||||
return [results[index - 1]];
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ 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";
|
||||
|
||||
/*
|
||||
@@ -20,3 +23,5 @@ exports.commands = function(source,operator,options) {
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
General purpose comparison operator
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.compare = function(source,operator,options) {
|
||||
@@ -33,3 +36,5 @@ var modes = {
|
||||
"lteq": function(value) {return value <= 0;},
|
||||
"lt": function(value) {return value < 0;}
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for finding values in array fields
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -38,3 +41,5 @@ exports.contains = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator returning the number of entries in the current list.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -19,3 +22,5 @@ exports.count = function(source,operator,options) {
|
||||
});
|
||||
return [count + ""];
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operators for cryptography, using the Stanford JavaScript library
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.sha256 = function(source,operator,options) {
|
||||
@@ -17,3 +20,5 @@ exports.sha256 = function(source,operator,options) {
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ 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";
|
||||
|
||||
/*
|
||||
@@ -43,3 +46,5 @@ exports.days = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -4,7 +4,10 @@ type: application/javascript
|
||||
module-type: filteroperator
|
||||
Filter operator for deserializing string data into JSON representing tiddlers
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports["deserialize"] = function(source,operator,options) {
|
||||
@@ -32,3 +35,5 @@ exports["deserialize"] = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for returning the names of the deserializers in this wiki
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -20,3 +23,5 @@ exports.deserializers = function(source,operator,options) {
|
||||
results.sort();
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter function for [duplicateslugs[]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -29,3 +32,5 @@ exports.duplicateslugs = function(source,operator,options) {
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -7,7 +7,10 @@ Filter operator that selects one tiddler for each unique value of the specified
|
||||
With suffix "list", selects all tiddlers that are values in a specified list field.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -60,3 +63,5 @@ exports.each = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator that selects one tiddler for each unique day covered by the specified date field
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -32,3 +35,5 @@ exports.eachday = function(source,operator,options) {
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for returning the descriptions of the specified edition names
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -26,3 +29,5 @@ exports.editiondescription = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,7 +6,10 @@ module-type: filteroperator
|
||||
Filter operator for returning the names of the available editions in this wiki
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -25,3 +28,5 @@ exports.editions = function(source,operator,options) {
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user