Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce "Multi Wiki Server" Plugin #7915

Draft
wants to merge 258 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
258 commits
Select commit Hold shift + click to select a range
8543dda
Fix broken test
Jermolene Jan 5, 2024
3f1f7c7
Remove debugging code
Jermolene Jan 5, 2024
1eed613
Fix create recipe SQL bug
Jermolene Jan 5, 2024
0799177
Add another recipe, improve docs
Jermolene Jan 5, 2024
1fb8b2e
Fix broken test
Jermolene Jan 5, 2024
615dc0c
First pass at admin user interface
Jermolene Jan 17, 2024
8941bd1
Server extension framework
Jermolene Jan 17, 2024
50d0b14
Fix CI tests
Jermolene Jan 18, 2024
a16338c
Merge branch 'master' into multi-wiki-support
Jermolene Jan 18, 2024
2f09c32
Fix getTiddler query
Jermolene Jan 18, 2024
82fae45
Admin styling
Jermolene Jan 18, 2024
4f37355
Tests should use a dummy admin wiki
Jermolene Jan 19, 2024
4133e7d
Stream wiki generation
Jermolene Jan 19, 2024
9767e7d
Update entity state tiddlers on startup to read bag and recipe info
Jermolene Jan 19, 2024
4b0df1a
Basic support for creating bags and recipes
Jermolene Jan 19, 2024
26ede28
Add support for _canonical_uri tiddlers
Jermolene Jan 19, 2024
5443248
Add an HTML view of bag listings
Jermolene Jan 19, 2024
02afbb4
Rename some of the routes more logically
Jermolene Jan 19, 2024
5fddd3b
Add support for retrieving tiddlers from bags
Jermolene Jan 19, 2024
70b048f
Fix bag links
Jermolene Jan 19, 2024
8f9ae7e
Clarify method name
Jermolene Jan 19, 2024
01d29ed
get bag tiddler and put recipe tiddler should return the bag name
Jermolene Jan 19, 2024
afa9ad3
Update store.getRecipeTiddler to also return the bag from which the t…
Jermolene Jan 19, 2024
e9f83ca
Add missing LIMIT 1
Jermolene Jan 19, 2024
59aed49
Make getRecipeTiddlers return the bagname as well
Jermolene Jan 20, 2024
d832bbc
Order the results of getRecipeTiddlers
Jermolene Jan 20, 2024
11ecaff
Fix typo
Jermolene Jan 20, 2024
f7914db
Add bag and recipe favicons to dashboard
Jermolene Jan 20, 2024
4f9ba11
Update to newest better-sqlite3
Jermolene Jan 21, 2024
dc86920
Use SQLite's AUTOINCREMENT to give us tiddler version identifiers
Jermolene Jan 21, 2024
da5b316
Split SqlTiddlerStore into SqlTiddlerStore and SqlTiddlerDatabase
Jermolene Jan 22, 2024
e343ecc
Refactor _canonical_uri handling out of route handlers
Jermolene Jan 23, 2024
c131210
Admin UI styling
Jermolene Jan 23, 2024
239ace0
Avoid clients of sqlTiddlerStore having to call updateAdminWIki() exp…
Jermolene Jan 23, 2024
138c7f2
Don't use the filesystem plugin
Jermolene Jan 23, 2024
f6d6478
Add support for recipe descriptions
Jermolene Jan 23, 2024
ddbd6d1
Fix favicon aspect ratio
Jermolene Jan 23, 2024
ff18482
Don't wikify recipe descriptions
Jermolene Jan 23, 2024
4d42d4a
Escape less than sign
Jermolene Jan 23, 2024
627c3e2
Add docs bags
Jermolene Jan 23, 2024
d16746a
Extend image widget to support alternate content if a remote image fa…
Jermolene Jan 23, 2024
26e198b
First pass at MWS icon
Jermolene Jan 23, 2024
41ab949
Renaming tiddlers for consistency
Jermolene Jan 24, 2024
8d95c92
Use $:/state/ tiddler for server entity state tiddlers
Jermolene Jan 24, 2024
ed71ada
Merge branch 'master' into multi-wiki-support
Jermolene Jan 24, 2024
3ad3e19
Merge branch 'master' into multi-wiki-support
Jermolene Jan 24, 2024
0b9749f
Add favicon to bag listing page
Jermolene Jan 24, 2024
b0a6730
Add support for bag descriptions, validate bags and recipes, and comp…
Jermolene Jan 24, 2024
8290d85
Merge branch 'master' into multi-wiki-support
Jermolene Jan 26, 2024
270f62b
Merge branch 'master' into multi-wiki-support
Jermolene Jan 26, 2024
541c166
Error handling for bag and recipe handling
Jermolene Jan 26, 2024
14752cc
Missing comma
Jermolene Jan 26, 2024
f5fdd79
Refresh when creating bags and recipes to get the change instantly
Jermolene Jan 26, 2024
62b2fe3
Add an error when creating a recipe with no bags
Jermolene Jan 26, 2024
84c8a9b
Fix typo
Jermolene Jan 26, 2024
41a5bcc
Fix canonical URI handling
Jermolene Jan 26, 2024
85607f7
Query fixes
Jermolene Jan 28, 2024
51e6466
Allow tilde character in bag and recipe names
Jermolene Jan 28, 2024
4204ff3
A few more tests
Jermolene Jan 28, 2024
3283d38
First draft of a command to read tiddlers, bags and recipes from an a…
Jermolene Jan 28, 2024
4b6872a
Fix typo
Jermolene Jan 29, 2024
262a730
Move the database file into a "store" directory inside the wiki folder
Jermolene Jan 29, 2024
6675358
WIP: Add a multipart/form-data convenience function
Jermolene Feb 2, 2024
2c810fa
Add barebones support for timing HTTP response generation times
Jermolene Feb 2, 2024
f925f03
Introduce $tw.mws for MWS globals
Jermolene Feb 5, 2024
c26acfd
Add NOT NULL constraint to all columns
Jermolene Feb 5, 2024
f2267e2
Merge branch 'master' into multi-wiki-support
Jermolene Feb 16, 2024
59b425f
Update to better-sqlite3 v9.4.1
Jermolene Feb 16, 2024
8edefff
WIP: Support for streaming multipart form data to the file system
Jermolene Feb 16, 2024
6f8a3b9
mws-load command: more validation tiddler files
Jermolene Feb 16, 2024
2d4b334
Merge branch 'master' into multi-wiki-support
Jermolene Feb 19, 2024
bab14b7
Logging
Jermolene Feb 19, 2024
6503fb4
Simple performance logging
Jermolene Feb 20, 2024
b8c1c6c
Allow backslashes in trailing API path components
Jermolene Feb 21, 2024
1eecfb6
Less logging
Jermolene Feb 21, 2024
0d22bf8
Update to latest better-sqlite3
Jermolene Feb 22, 2024
790f431
MWS: Use transactions when modifying multiple resources (#7991)
hoelzro Feb 22, 2024
3fca823
MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996)
Jermolene Feb 22, 2024
a33705e
Fix error
Jermolene Feb 22, 2024
310b5f0
Whitespace
Jermolene Feb 22, 2024
3c58788
Merge branch 'master' into multi-wiki-support
Jermolene Feb 22, 2024
3ad87df
Allow wiki engine to be configured
Jermolene Feb 22, 2024
2361880
createBag should optionally set access control data
Jermolene Feb 23, 2024
f926516
Commands to load and save tiddlers, bags and recipes as a JSON archive
Jermolene Feb 23, 2024
3276703
Fix failing tests
Jermolene Feb 23, 2024
61b5412
Rename mws-load|save to mws-load|save-archive
Jermolene Feb 23, 2024
066e553
Introduce command to load tiddler folders into a bag
Jermolene Feb 23, 2024
b1edbed
Fix bag static HTML to show emoji correctly
Jermolene Feb 23, 2024
343cc33
Add a test tiddler with emoji title
Jermolene Feb 24, 2024
d5aa74d
Improve manual transaction handling
Jermolene Feb 24, 2024
1c0341d
Merge branch 'master' into multi-wiki-support
Jermolene Feb 24, 2024
630b985
Add note about transaction handling
Jermolene Feb 25, 2024
6724fa8
Run the tests on both node-sqlite3-wasm and better-sqlite3
Jermolene Feb 25, 2024
83229ac
Add a config tiddler for selecting the SQLite engine
Jermolene Feb 25, 2024
dd9a3bf
Re-enable loading the tw5.com docs tiddlers
Jermolene Feb 25, 2024
e614e29
Default to better-sqlite3
Jermolene Feb 25, 2024
d7d0733
Remove accidentally committed database file
Jermolene Feb 25, 2024
de4fe13
Unconditionally decrement transaction depth (#8008)
hoelzro Feb 26, 2024
9facf4a
Fix incorrect encoding of description when creating bags and recipes
Jermolene Feb 28, 2024
d97ddf1
Merge branch 'master' into multi-wiki-support
Jermolene Feb 28, 2024
4f9ff1a
Missed closing tag
Jermolene Feb 28, 2024
5fe41fc
Reorder test tiddlers
Jermolene Feb 28, 2024
1a28ec7
Rename upload manager to multipart form manager
Jermolene Feb 28, 2024
8a209d6
Fix typo
Jermolene Mar 1, 2024
89ae201
Merge branch 'master' into multi-wiki-support
Jermolene Mar 4, 2024
2ba3643
Merge branch 'master' into multi-wiki-support
Jermolene Mar 7, 2024
abde67e
MWS: Add support for large tiddlers to be stored as attachment files
Jermolene Mar 10, 2024
3335e87
Remove unneeded option
Jermolene Mar 10, 2024
e355848
Fix mws-save-archive command name
Jermolene Mar 10, 2024
f4ac2b9
Remove unneeded plugins from tw5.com edition
Jermolene Mar 10, 2024
5802834
Remove unneeded highlight plugin from multiwikiserver edition
Jermolene Mar 10, 2024
e3b2776
Update comment
Jermolene Mar 10, 2024
0f5dfb8
Refactor multipart form handling for more reusability
Jermolene Mar 10, 2024
54ff044
MWS: store level tests (#8021)
hoelzro Mar 11, 2024
9df625c
Reorganise JS modules into subdirectories
Jermolene Mar 11, 2024
8b5c374
Refactor command module filenames
Jermolene Mar 11, 2024
24413c5
The listen command shouldn't return until the server is listening
Jermolene Mar 11, 2024
a443e5f
Add new command to test local or remote server via HTTP
Jermolene Mar 11, 2024
f906442
Add npm start command
Jermolene Mar 12, 2024
d6807cb
Update MWS plugin readme
Jermolene Mar 12, 2024
8b6642b
Update the root readme that is visible on GitHub
Jermolene Mar 12, 2024
bc45a16
Fix readme build
Jermolene Mar 12, 2024
c9ab184
TODOs before merging
Jermolene Mar 12, 2024
b923be5
Merge branch 'master' into multi-wiki-support
Jermolene Mar 13, 2024
3da773c
Add HTTP tests to npm test command
Jermolene Mar 13, 2024
e553539
Clarify that process.exit() is a hack
Jermolene Mar 13, 2024
2916cb6
Clarify comment
Jermolene Mar 14, 2024
501f574
Update readme
Jermolene Mar 14, 2024
f675733
POST /wiki/:bag_name/bags/:bag_name/tiddlers/ should also return JSON
Jermolene Mar 15, 2024
9b59ae2
Add an HTTP test for multipart form data upload
Jermolene Mar 15, 2024
d518675
Get rid of some console.logs
Jermolene Mar 15, 2024
b4855b2
Merge branch 'master' into multi-wiki-support
Jermolene Mar 16, 2024
347aa4d
Tests should cover tiddler_ids
Jermolene Mar 17, 2024
69cc45b
Refactor the database engine specific code
Jermolene Mar 17, 2024
dea739f
Introduce delete markers for deleted tiddlers
Jermolene Mar 17, 2024
faa4b97
More consistent variable naming
Jermolene Mar 17, 2024
7eaa9b8
Database methods that mutate tables should return IDs
Jermolene Mar 17, 2024
3d485f0
Expose tiddler_ids in bag and recipe listings
Jermolene Mar 17, 2024
09de919
Typo
Jermolene Mar 17, 2024
f606e33
Stop using the existing core server infrastructure
Jermolene Mar 18, 2024
6a673e6
Stop syncing state tiddlers to the admin wiki
Jermolene Mar 18, 2024
259b3dc
Add a new static index route
Jermolene Mar 18, 2024
1c64646
Fix quit command to work gracefully
Jermolene Mar 19, 2024
6063256
Create new static index route with ability to create/update bags and …
Jermolene Mar 20, 2024
957329d
Add store directories to gitignore
Jermolene Mar 20, 2024
38ee942
Don't do full debug logging during tests
Jermolene Mar 20, 2024
9b3ca52
Introduce multiwikiclient plugin
Jermolene Mar 20, 2024
ae8ef30
Get rid of those annoying missing image icons
Jermolene Mar 20, 2024
cae9dbf
Fix colours in static renderings
Jermolene Mar 20, 2024
6154de0
Rename misnamed route
Jermolene Mar 20, 2024
891f0fd
Fix page body class in static pages
Jermolene Mar 20, 2024
60e6c8b
Fix etag handling
Jermolene Mar 20, 2024
808b944
Fix multipart form data POST test
Jermolene Mar 20, 2024
eaebeb8
Include bagname in tiddler Etags
Jermolene Mar 20, 2024
3aa5607
Stop storing bag and revision details as tiddler fields
Jermolene Mar 20, 2024
1f63bcb
Remove some templates that are no longer needed
Jermolene Mar 20, 2024
52f7638
Remove code relating to revision and bag as fields
Jermolene Mar 22, 2024
08649dd
More efficient syncing
Jermolene Mar 23, 2024
a2012dc
Typo in comment
Jermolene Mar 23, 2024
e66b67d
Only turn binary tiddlers into attachments
Jermolene Mar 23, 2024
8091db3
Merge branch 'master' into multi-wiki-support
Jermolene Mar 23, 2024
6c9b924
GET recipes/name/tiddlers.json should use include_deleted parameter
Jermolene Mar 24, 2024
8198574
Remove code that is unneeded for the moment
Jermolene Mar 24, 2024
708e219
Fix syncing
Jermolene Mar 24, 2024
7a0c434
First pass at SSE support
Jermolene Mar 25, 2024
b58cfe6
SSE client: better state management to avoid multiple connections
Jermolene Mar 25, 2024
d1bb715
Expose the connection status in the UI
Jermolene Mar 25, 2024
464d17b
Update last known tiddler ID for events delivered via SSE
Jermolene Mar 25, 2024
4b1affe
Load streamed tiddlers immediately, rather than scheduling a load
Jermolene Mar 25, 2024
37f6930
Quit command should abort any pending commands
Jermolene Mar 25, 2024
cca1f21
Undo unneeded changes to image widget
Jermolene Mar 25, 2024
fcffff3
npm start should use mws-listen
Jermolene Mar 25, 2024
8a2111f
Update GettingStarted
Jermolene Mar 26, 2024
baee0bb
Fix broken updating of last_known_tiddler_id from streamed data
Jermolene Mar 26, 2024
f2947e7
Filter updates from the server
Jermolene Mar 26, 2024
ad528d6
Fix get wiki crash when serving a recipe with no tiddlers in it
Jermolene Mar 27, 2024
d51ad80
Incoming updates filter should exclude tiddlers prefixed $:/StoryList…
Jermolene Mar 28, 2024
51cdca6
Merge branch 'master' into multi-wiki-support
Jermolene Apr 3, 2024
28a8314
Merge branch 'master' into multi-wiki-support
Jermolene Apr 12, 2024
ce79a4a
Add bag indicator to tiddler info panel
Jermolene Apr 12, 2024
131a5ab
Protect against syncing client state tiddlers to the server
Jermolene Apr 12, 2024
9ba4556
Add support for the plugin library
Jermolene Apr 14, 2024
cc4cb04
Turn on WAL mode for better-sqlite3
Jermolene Apr 14, 2024
db9978f
Syncer should only save existing tiddlers if they have changed
Jermolene Apr 16, 2024
2e4980b
Add some error checking
Jermolene Apr 16, 2024
516a17a
More debugging
Jermolene Apr 16, 2024
471ba99
Debugging
Jermolene Apr 16, 2024
129bbe4
Debugging
Jermolene Apr 16, 2024
aafe775
Debugging
Jermolene Apr 16, 2024
ea318ba
Fix file separator for Windows
Jermolene Apr 16, 2024
268aaeb
Logging
Jermolene Apr 16, 2024
d8eb5cb
Merge branch 'master' into multi-wiki-support
Jermolene May 20, 2024
92a1c56
Merge branch 'master' into multi-wiki-support
Jermolene May 21, 2024
87f4a52
Mark MWS plugins as experimental
Jermolene May 21, 2024
3c7f060
Temporarily Disable SSE
Jermolene May 22, 2024
4c2c726
Make usage of SSE be configurable
Jermolene May 22, 2024
33fb857
Merge branch 'master' into multi-wiki-support
Jermolene May 22, 2024
b4564e3
Merge branch 'master' into multi-wiki-support
Jermolene May 26, 2024
a37d501
Tentative fix for SSE issue
Jermolene May 27, 2024
9b6d677
Fix revision comparisons
Jermolene May 27, 2024
d8fd9af
Fix string vs. number confusion for revisions
Jermolene May 28, 2024
e396334
Disable SSE by default
Jermolene May 28, 2024
109d92a
Update readme
Jermolene May 28, 2024
d03ad0b
Merge branch 'master' into multi-wiki-support
Jermolene May 29, 2024
3c36e4b
Merge branch 'master' into multi-wiki-support
Jermolene May 31, 2024
049951e
Merge branch 'master' into multi-wiki-support
Jermolene May 31, 2024
3f30cb4
Merge branch 'master' into multi-wiki-support
Jermolene May 31, 2024
b8f463d
Merge branch 'master' into multi-wiki-support
Jermolene May 31, 2024
2b2fd4b
Merge branch 'master' into multi-wiki-support
Jermolene Jun 8, 2024
38e1ea8
Merge branch 'master' into multi-wiki-support
Jermolene Jun 22, 2024
0ff3875
Update readme.tid
Jermolene Jun 24, 2024
e9cbb51
Merge branch 'master' into multi-wiki-support
Jermolene Jun 28, 2024
d1edf64
Merge branch 'master' into multi-wiki-support
Jermolene Jul 5, 2024
f1d0e52
New commands
Jermolene Jul 5, 2024
39b7a4f
Adds 'created' field to attachment meta.json file (#8356)
PotOfCoffee2Go Jul 9, 2024
5b53a14
Use $tw.utils.encodeURIComponentExtended for consistency with encodeu…
Jermolene Jul 10, 2024
9e2962b
Merge branch 'master' into multi-wiki-support
Jermolene Jul 10, 2024
e9f3145
Fix failing tests
Jermolene Jul 10, 2024
882438d
Merge branch 'master' into multi-wiki-support
Jermolene Jul 15, 2024
b4664bd
getBagTiddlerStream should return bagname
Jermolene Jul 16, 2024
066771e
Allow attachment handling to be switched off
Jermolene Jul 16, 2024
97db75e
Merge branch 'master' into multi-wiki-support
Jermolene Jul 26, 2024
adb2ffc
Update package.json
Jermolene Jul 31, 2024
2819b53
Merge branch 'master' into multi-wiki-support
Jermolene Jul 31, 2024
6492ed3
Merge branch 'master' into multi-wiki-support
Jermolene Aug 6, 2024
edc32c5
Merge branch 'master' into multi-wiki-support
Jermolene Aug 19, 2024
9eb28a0
Merge branch 'master' into multi-wiki-support
Jermolene Aug 22, 2024
535c440
Remove extraneous storylist tiddler
Jermolene Aug 22, 2024
eac8a2c
Merge branch 'master' into multi-wiki-support
Jermolene Aug 27, 2024
3287dce
MWS: fix editing attachment tiddlers (#8455)
webplusai Aug 28, 2024
8a5a684
Clean ups from #8456
Jermolene Aug 28, 2024
c733116
Merge branch 'master' into multi-wiki-support
Jermolene Aug 28, 2024
90848a1
Change for the sake of CI
Jermolene Aug 29, 2024
a930411
Handle directory creation if doesn't exist for test store (#8562)
webplusai Aug 30, 2024
b698b3e
revert playwright test (#8573)
webplusai Aug 30, 2024
4050ba5
Avoid optional chaining syntax
Jermolene Sep 11, 2024
a9c124c
Whitespace clean up
Jermolene Sep 20, 2024
0f4f60f
Fix load wiki folder command
Jermolene Sep 20, 2024
6e7efeb
Merge branch 'master' into multi-wiki-support
Jermolene Sep 20, 2024
d0b5f41
MWS icon remove redundant paths (#8621)
pmario Sep 30, 2024
517dae8
Merge branch 'master' into multi-wiki-support
Jermolene Sep 30, 2024
6dd6b7b
Refactor conditional function definitions
Jermolene Sep 30, 2024
d0575d6
Merge branch 'master' into multi-wiki-support
Jermolene Oct 17, 2024
5d6ddae
Fix plugin bag names
Jermolene Oct 17, 2024
6a7612d
MWS authentication (#8596)
webplusai Oct 30, 2024
c7531e5
Add user profile management and account deletion functionality (#8712)
webplusai Oct 30, 2024
ad901a9
Merge branch 'master' into multi-wiki-support
Jermolene Nov 6, 2024
3a5f67d
Update dependencies
Jermolene Nov 6, 2024
316bd65
Add success and error message feedback for user profile operations (#…
webplusai Nov 8, 2024
e873518
Admin configuration for anonymous read-write operations (#8736)
webplusai Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
tmp/
output/
node_modules/
store/
/test-results/
/playwright-report/
/playwright/.cache/
$__StoryList.tid
/editions/test/test-store/*
4 changes: 4 additions & 0 deletions TODO BEFORE MERGING THIS PR.md
Original file line number Diff line number Diff line change
@@ -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`)
2 changes: 2 additions & 0 deletions bin/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# test TiddlyWiki5 for tiddlywiki.com

npm install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 15 there is npm install playwright ... which is also added to package.json, which is installed here. -- I think line 15 is redundant


node ./tiddlywiki.js \
./editions/test \
--verbose \
Expand Down
1 change: 1 addition & 0 deletions bin/readme-bld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fi

# tw5.com readmes
node $TW5_BUILD_TIDDLYWIKI \
+plugins/tiddlywiki/multiwikiserver \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does readme-bld.sh need the multiwikiserver plugin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a temporary measure while the PR is in development. It allows us to include content from the MWS plugin in the readme.

editions/tw5.com \
--verbose \
--output . \
Expand Down
2 changes: 2 additions & 0 deletions core/language/en-GB/Buttons.multids
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ ListBullet/Caption: bulleted list
ListBullet/Hint: Apply bulleted list formatting to lines containing selection
ListNumber/Caption: numbered list
ListNumber/Hint: Apply numbered list formatting to lines containing selection
ManageACL/Caption: manage access control
ManageACL/Hint: Manage access control configuration for this wiki
MonoBlock/Caption: monospaced block
MonoBlock/Hint: Apply monospaced block formatting to lines containing selection
MonoLine/Caption: monospaced
Expand Down
7 changes: 7 additions & 0 deletions core/modules/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,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
*/
Expand Down
8 changes: 6 additions & 2 deletions core/modules/commands/listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var Server = require("$:/core/modules/server/server.js").Server;

exports.info = {
name: "listen",
synchronous: true,
synchronous: false,
namedParameterMode: true,
mandatoryParameters: []
};
Expand All @@ -38,7 +38,11 @@ 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;
};
Expand Down
37 changes: 37 additions & 0 deletions core/modules/commands/quit.js
Original file line number Diff line number Diff line change
@@ -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;

})();
5 changes: 5 additions & 0 deletions core/modules/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ Server.prototype.listen = function(port,host,prefix) {
}
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
server.on("listening",function() {
// Stop listening when we get the "th-quit" hook
$tw.hooks.addHook("th-quit",function() {
server.close();
});
// Log listening details
var address = server.address(),
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix;
$tw.utils.log("Serving on " + url,"brown/orange");
Expand Down
10 changes: 9 additions & 1 deletion core/modules/syncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ Save an incoming tiddler in the store, and updates the associated tiddlerInfo
Syncer.prototype.storeTiddler = function(tiddlerFields) {
// Save the tiddler
var tiddler = new $tw.Tiddler(tiddlerFields);
this.wiki.addTiddler(tiddler);
// Only save the tiddler if it has changed
var existingTiddler = this.wiki.getTiddler(tiddlerFields.title);
if(!existingTiddler || !existingTiddler.isEqual(tiddler)) {
this.wiki.addTiddler(tiddler);
}
// Save the tiddler revision and changeCount details
this.tiddlerInfo[tiddlerFields.title] = {
revision: this.getTiddlerRevision(tiddlerFields.title),
Expand Down Expand Up @@ -556,6 +560,7 @@ SaveTiddlerTask.prototype.run = function(callback) {
// Invoke the callback
callback(null);
},{
syncer: self.syncer,
tiddlerInfo: self.syncer.tiddlerInfo[self.title]
});
} else {
Expand Down Expand Up @@ -586,6 +591,7 @@ DeleteTiddlerTask.prototype.run = function(callback) {
// Invoke the callback
callback(null);
},{
syncer: self.syncer,
tiddlerInfo: self.syncer.tiddlerInfo[this.title]
});
};
Expand Down Expand Up @@ -614,6 +620,8 @@ LoadTiddlerTask.prototype.run = function(callback) {
}
// Invoke the callback
callback(null);
},{
syncer: self.syncer
});
};

Expand Down
2 changes: 1 addition & 1 deletion core/modules/widgets/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ ImageWidget.prototype.refresh = function(changedTiddlers) {

exports.image = ImageWidget;

})();
})();
Copy link
Member

@pmario pmario Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought, we wanted remove the "covering" function?

11 changes: 10 additions & 1 deletion core/modules/widgets/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ NavigatorWidget.prototype.render = function(parent,nextSibling) {
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
{type: "tm-manage-acl", handler: "handleManageACLTiddlersEvent"}
]);
this.parentDomNode = parent;
this.computeAttributes();
Expand Down Expand Up @@ -635,6 +636,14 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
});
};

NavigatorWidget.prototype.handleManageACLTiddlersEvent = function() {
var pathname = window.location.pathname;
var paths = pathname.split("/");
var recipeName = paths[paths.length - 1];
var bagName = document.querySelector("h1.tc-site-title").innerHTML;
window.location.href = "/admin/acl/"+recipeName+"/"+bagName
};

exports.navigator = NavigatorWidget;

})();
15 changes: 15 additions & 0 deletions core/ui/PageControls/manage-acl.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: $:/core/ui/Buttons/manage-acl
tags: $:/tags/PageControls
caption: {{$:/core/images/globe}} {{$:/language/Buttons/ManageACL/Caption}}
description: {{$:/language/Buttons/ManageACL/Hint}}

\whitespace trim
<$button tooltip={{$:/language/Buttons/ManageACL/Hint}} aria-label={{$:/language/Buttons/ManageACL/Caption}} class=<<tv-config-toolbar-class>>>
<$action-managetiddler tiddler=<<currentTiddler>>/>
{{$:/core/images/globe}}
<%if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/ManageACL/Caption}}/>
</span>
<%endif%>
</$button>
2 changes: 1 addition & 1 deletion core/wiki/tags/PageControls.tid
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
title: $:/tags/PageControls
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/layout]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/network-activity]] [[$:/core/ui/Buttons/more-page-actions]]
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/layout]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/manage-acl]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/network-activity]] [[$:/core/ui/Buttons/more-page-actions]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: $:/config/MultiWikiServer/Engine
text: better
47 changes: 47 additions & 0 deletions editions/multiwikiserver/tiddlywiki.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"description": "Multiple wiki client-server edition",
"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem",
"tiddlywiki/multiwikiclient",
"tiddlywiki/multiwikiserver"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"build": {
"mws-add-user": [
"--mws-add-permission", "READ", "Allows user to create tiddlers",
"--mws-add-permission", "WRITE", "Gives the user the permission to edit and delete tiddlers",
"--mws-add-role", "ADMIN", "System Administrator",
"--mws-assign-role-permission", "ADMIN", "READ",
"--mws-assign-role-permission", "ADMIN", "WRITE",
"--mws-add-user", "user", "pass123",
"--mws-assign-user-role", "user", "ADMIN"
],
"load-mws-demo-data": [
"--mws-load-wiki-folder","./editions/tw5.com","docs", "TiddlyWiki Documentation from https://tiddlywiki.com","docs","TiddlyWiki Documentation from https://tiddlywiki.com",
"--mws-load-wiki-folder","./editions/dev","dev","TiddlyWiki Developer Documentation from https://tiddlywiki.com/dev","dev-docs", "TiddlyWiki Developer Documentation from https://tiddlywiki.com/dev",
"--mws-load-wiki-folder","./editions/tour","tour","TiddlyWiki Interactive Tour from https://tiddlywiki.com","tour", "TiddlyWiki Interactive Tour from https://tiddlywiki.com",
"--mws-create-bag","bag-alpha","A test bag",
"--mws-create-bag","bag-beta","Another test bag",
"--mws-create-bag","bag-gamma","A further test bag",
"--mws-create-recipe","recipe-rho","bag-alpha bag-beta","First wiki",
"--mws-create-recipe","recipe-sigma","bag-alpha bag-gamma","Second Wiki",
"--mws-create-recipe","recipe-tau","bag-alpha","Third Wiki",
"--mws-create-recipe","recipe-upsilon","bag-alpha bag-gamma bag-beta","Fourth Wiki",
"--mws-save-tiddler-text","bag-alpha","$:/SiteTitle","bag-alpha",
"--mws-save-tiddler-text","bag-alpha","😀😃😄😁😆🥹😅😂","bag-alpha",
"--mws-save-tiddler-text","bag-beta","$:/SiteTitle","bag-beta",
"--mws-save-tiddler-text","bag-gamma","$:/SiteTitle","bag-gamma",
"--mws-add-permission", "READ", "Allows user to create tiddlers",
"--mws-add-permission", "WRITE", "Gives the user the permission to edit and delete tiddlers",
"--mws-add-role", "ADMIN", "System Administrator",
"--mws-add-role", "USER", "Basic User",
"--mws-assign-role-permission", "ADMIN", "READ",
"--mws-assign-role-permission", "ADMIN", "WRITE",
"--mws-assign-role-permission", "USER", "READ"
]
}
}
4 changes: 2 additions & 2 deletions editions/test/playwright.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ test('get started link', async ({ page }) => {

// Load the generated test TW html
await page.goto(`file:///${crossPlatformIndexPath}`);

const title = await page.title();
// Sanity check
await expect(page.locator('.tc-site-title'), "Expected correct page title to verify the test page was loaded").toHaveText('TiddlyWiki5');
await expect(title, "Expected correct page title to verify the test page was loaded").toContain('TiddlyWiki5');

// Wait for jasmine results bar to appear
await expect(page.locator('.jasmine-overall-result'), "Expected jasmine test results bar to be present").toBeVisible({timeout});
Expand Down
1 change: 1 addition & 0 deletions editions/test/tiddlywiki.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"description": "TiddlyWiki core tests",
"plugins": [
"tiddlywiki/jasmine",
"tiddlywiki/multiwikiserver",
"tiddlywiki/geospatial"
],
"themes": [
Expand Down
18 changes: 17 additions & 1 deletion editions/tw5.com/tiddlers/readme/ReadMe.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ type: text/vnd.tiddlywiki
\define tv-wikilink-template() https://tiddlywiki.com/static/$uri_doubleencoded$.html
\import [subfilter{$:/core/config/GlobalImportFilter}]

! Welcome
---

! ~TiddlyWiki ~MultiWikiServer

UNDER DEVELOPMENT

This is a branch of TiddlyWiki that adds the ~MultiWikiServer plugin.

!! Readme

{{$:/plugins/tiddlywiki/multiwikiserver/readme}}

!! Docs

{{$:/plugins/tiddlywiki/multiwikiserver/docs}}

---

Welcome to TiddlyWiki, a non-linear personal web notebook that anyone can use and keep forever, independently of any corporation.

Expand Down
Loading
Loading