* Allow the rendering of fields to be extended
This commit extends the `$:/core/ui/EditTemplate/fields` tiddler to
use a new cascade (Field Editor Cascade) to allow customizing the
rendering of the field editor.
It provides a default element for the cascade that displays the standard
EditTextWidget as a fallback. That way, the implementation is completely
backwards compatible. The `currentTiddler` and `currentField` variables
are available in the transcluded tiddler. This has the additional
benefit, that not only the `EditTextWidget` can be used. The user can
use a dropdown-list or even something completely crazy. As long as it
can be put into a tiddler that updates the field, it will be fine.
* Make `select` Tags in Fields look like the rest
This patch updates the CSS to make `tc-edit-texteditor` usable on
`select`-tags as well.
I'm not sure what `-webkit-appearance: none;` is for, but it hides the
DropDown-arrow in Chrome and makes the select-tag hard to discover. I've
changed the css to only apply it to the input tag. Maybe it can be
removed altogether.
* Add documentation for the Field Editor Cascade
* Initial Commit
* Set currentTiddler and ..currentTiddler for filter evaulation
* Precompile the filters for performance
* Add explicit test for empty result when no filter passes
* Use the cascade filter run prefix to choose the view template body template
* Use the cascade mechanism to choose between the edit and view templates
* Simplify cascade filter
Thanks @saqimtiaz
* Add control panel UI for inspecting the template cascades
* Refactor import listing and plugin listing as alternate body templates
As suggested by @pmario
* Refer to $:/core/ui/{View|Edit}Template via their associated config tiddlers
* Fix typo in previous commit
* Add demo of custom story tiddler template
* Tweak control panel wording
* Standardise "Story Tiddler Template" nomenclature
* Add a cascade for the editor template body
* Add a cascade for the view template title
* Avoid unwanted whitespace
* Add a cascade for dynamically choosing tiddler icons
This reverts commit 17b4f53ba2 according to Github Desktop.
git checkout that commit
revert commit in GitHub Desktop
git switch -c revert-sse
uncommit in Github Desktop
switch to master, bringing changes
resolve deletions with command line
* Add support for JSON-formatted tiddler store, and make it the default
The change to `getTiddlersAsJson()` is to allow experimentation
* Move JSON tiddlers into their own store area, and fix support for encrypted tiddlers
Also add a dummy old-style store area for backwards compatibility
The current arrangement is that JSON tiddlers will always override old-style tiddlers.
* Use the deserialiser mechanism to decode the content
* Refactor $:/core/modules/deserializers.js before we start extending it
Cleaning up the helper function names and ordering
* Drop support for the "systemArea" div
It was only used in really old v5.0.x
* Update deserializer to support JSON store format and add some tests
* Life UI restrictions on characters in fieldnames
* Add another test case
* Correct mis-merge
* Remove toLowerCase() methods applied to fieldnames
* Insert line breaks in output of getTiddlersAsJson (#5786)
Rather than have the entire store on one line, insert a line break
after each tiddler.
* Refactor #5786 for backwards compatibility
* Only read .tiddlywiki-tiddler-store blocks from script tags
Prompted by @simonbaird's comment here: https://github.com/Jermolene/TiddlyWiki5/pull/5708#discussion_r648833367
* Clean up escaping of unsafe script characters
It seems that escaping `<` is sufficient
* Add docs from @saqimtiaz
Thanks @saqimtiaz
* Docs tweaks
* Remove excess whitespace
Thanks @simonbaird
* Fix templates for lazy loading
* Remove obsolete item from release note
* Clean up whitespace
* Docs for the jsontiddler widget
* Fix whitespace
Fixes#5840
* Comments
* Fix newlines in JSON store area
* Remove obsolete docs change
Co-authored-by: Simon Baird <simon.baird@gmail.com>
* Fix problems with building single-file wiki using external-js template
* core/templates/external-js/tiddlywiki5-external-js.html.tid,
core/templates/external-js/save-all-external-js.tid,
core/templates/external-js/save-offline-external-js.tid
core/templates/external-js/load-external-js.tid:
Fix#5343. Exclude client-server plugins in tiddler imports and to
specify a working URL for loading tiddlywiki5.js from local disk.
Mirror save/all and save/offline templates in the regular server
edition.
Fix#4717 (tiddlywiki5-external-js.html.tid)
* core/modules/saver-handler.js:
Need the change to make single file autosave work with the external-js
template.
* editions/server-external-js/tiddlywiki.info:
Provide external-js related build targets.
* core/language/en-GB/Snippets/ExtJSReadme.tid:
Temporary doc to supplement TW5.com's external-js section. Demonstrate
that upgrade could be done on single-file wikis with an externalized
TW core.
* core/language/en-GB/Snippets/GetTiddlyWikiJS.tid:
Documentation. Meant to be included in every wiki and to help end
users acquire tiddlywiki5.js.
* Pre-configure save-wiki template for end-users
* Remove the newline character at the end of the file.
* Trim "template" value in saveWiki()
* Safeguard the code from extraneous whitespaces in transcluded result.
* Rename and add versioning to downloaded tiddlywiki core JS
* Rename "tiddlywiki5.js" to "twcore-VERSION.js"
* Preload $:/config/SaveWikiButton/Template tiddler with the required
external-js template value.
* Update external-js user documentation
* Add "download tiddlywiki core JS" menu item to the "cloud" button.
* Update build's target defintions associated with external-js template.
* Move the user doc to the tw5.com edition.
* Coding style update
* Undo template name changes
* Correct text & fill colors on some disabled buttons
* Add new "export tiddlywiki core" button under page control tools
This new button can export tiddlywiki's core JS from user's wiki as
long as the wiki is served with the regular "root" template. The
button will be ineffective, thus disabled, if the core has already been
externalized by the "external-js" template.
With this button, a full standalone html wiki can obtain the matching
core JS without TiddlyWiki on node.js. Once this is done, the html wiki
can be converted to using the "external-js" template.
* Alternate version of "save tiddlywiki core for offline use"
This version will fire up a "Save File" dialogue box when clicked,
instead of directing the user to a helper doc for further instruction.
It achieves this by using the "download" attribute of the <a> html tag.
It works on most modern desktop browsers, but older browsers (e.g. IE)
may display the file instead.
* Adjust font-weight to match other menu items
* Merge two user documentations into one
* Add user-browser-cache=yes to --listen command
* Update "export tiddlywiki core" button hint
* Simpler implementation for switching btw online/offline core URL
Shave off one template by using filtered transclusion to control
online/offline core URL.
* Update user doc
Update the user doc to clarify that build index step is not needed to
initialize a new wiki.
* Rename twcore to tiddlywikicore
* Reformat the user doc
* Rework export-tiddlywikicore button
Popup an error message instead of disabling the button when export
core cannot be performed.
* Revert "Correct text & fill colors on some disabled buttons"
This reverts commit e7dbb7e712.
* Merge
* Clean up
* More clean up
* Ensure image import works when type is not set, clean up post import actions
* Removed spurious new line
* For non image files insert a tiddler link
* Added documentation for new settings and features
Mention TiddlyHost and link to some documentation on the
configuration options.
Also remove the TiddlySpot control panel and backups links since
they no longer work.
Notes:
* The last three fields are no use for TiddlySpot or TiddlyHost, but
it's possible that someone, somewhere is still using the old
store.php from Bidix's UploadPlugin, and would miss them if they
were removed.
I'd be happy to remove them in a future PR, if it's decided they
can be retired.
(If they were removed, I could delete the last row here:)
https://github.com/simonbaird/tiddlyhost/wiki/TiddlySpot-Saver-configuration-for-Tiddlyhost-and-Tiddlyspot
* It's still called "TiddlySpot Saver" which I think is fine for
now. TiddlyHost might use a different saving method in future
so keeping the existing name seems best.
* Create server-sent-events.js
* Create sse-change-listener.js
* Implement server sent events
* Convert to ES5 and wrap in function
* Use the host string from tiddlyweb
* Improve comments in sse-server.js
* Can't use object reference as key
* Add retry timeout
* Fix a bug
* bug fix
* Fix formatting
* Fix ES5 compat
* capitalize comments
* more fixes
* Refactor tiddlywek/sse-server.js
* Extract helper functions for handling wikis and connections.
* Replace JSDoc comments.
* Fix formatting according to TW core.
* Simplify the logic for adding and removing connections.
* Fix formatting of tiddlyweb/sse-client.js
Fix formatting according to TW core.
* Fix formatting of server-sent-events.js
Fix formatting and comments following TW core guidelines.
* Extract a debounce function in sse-client.js
* Avoid using startsWith in server-sent-events.js
startsWith is part of ES2015, while TiddlyWiki uses the 5.1 dialect.
* New sse-enabled WebServer parameter
* If not set to "yes", disabled SSE request handling.
* Add documentation for the parameter in core/language/en-GB/Help/listen.tid
* Add new tiddler editions/tw5.com/tiddlers/webserver/WebServer Parameter_ sse-enabled.tid
* Disable polling for changes if SSE is enabled
* Add sse_enabled to /status JSON response
* Store syncer polling status in $:/config/SyncDisablePolling
* Handled disabling polling in core/modules/syncer.js
* Simply boolean logic in syncer.js
* Delete trailing whitespaces in syncer.js
Co-authored-by: Arlen22 <arlenbee@gmail.com>
* Alternative switcher using a parameter via tm-show-switcher
* Add CSS class for centered modals
* Changed keyboardshortcut and removed transition CSS
* Resolved wording issues
* First pass at refactoring filter code to support named filter run prefixes
* Remove filter prefix for now
* renamed module type and filter run prefixes
* Moved inline handling for no filter run prefix to 'or' filter run prefix.
* Added error handling for undefined filter run prefixes
* First commit
* Add throttling of saves
Now we refuse to save a tiddler more often than once per second.
* Wait for a timeout before trying again after an error
* Modest optimisations of isDirty() method
* Synchronise system tiddlers and deletions from the server
Fixes two long-standing issues:
* Changes to system tiddlers are not synchronised from the server to the browser
* Deletions of tiddlers on the server are not propagated to browser clients
* Make sure we update the dirty status even if there isn't a task to perform
* Replace save-wiki button with popup sync menu
* Remove the "Server" control panel tab
We don't need it with the enhanced sync dropdown
* Add indentation to the save-wiki button
* Fix spacing in dropdown menu items
* Switch between cloud icons according to dirty status
* Add a menu item to copy syncer logs to the clipboard
* Improve animated icon
* Remove indentation from save-wiki button
@pmario the annoying thing is that using `\trim whitespace` trims significant whitespace too, so it means we have to use <$text text=" "/> when we need a space that won't be trimmed. For the moment, I've removed the indentation but will keep thinking about it.
* Further icon, UI and copy text tweaks
Move the icons and styles from the core into the TiddlyWeb plugin
* Clean up PR diff
* Tweak animation durations
* Break the actions from the syncer dropdown into separate tiddlers
@pmario I think this makes things a bit easier to follow
* Refactor syncadaptor creation and logging
The goal is for the syncadaptor to be able to log to the same logger as the syncer, so that the "copy syncer logs to clipboard" data is more useful.
* Don't transition the dirty indicator container colour, just the SVG's colour
* Only trigger a sync for changes to tiddlers we're interested in
Otherwise it is triggered by the creation of the alert tiddlers used to display errors.
* Restore deleting local tiddlers removed from the server
(I had commented it out for some testing and accidentally commited it).
* Guard against missing adaptor info
* We still need to trigger a timeout when there was no task to process
* Avoid repeatedly polling for changes
Instead we only trigger a timeout call at if there is a pending task (ie a tiddler that has changed but isn't yet old enough to save).
* Lazy loading: include skinny versions of lazily loaded tiddlers in the index.html
* Introduce _is_skinny field for indicating that a tiddler is subject to lazy loading
* Remove savetrail plugin from prerelease
It doesn't yet work with the new syncer
* Make the savetrail plugin work again
* Clear outstanding alerts when synchronisation is restored
* Logger: only remove alerts from the same component
Missed off 9f5c0de07
* Make the saving throttle interval configurable (#4385)
After switching Bob to use the core syncer the throttle interval makes saving feel very sluggish compared to the message queue setup that I had before.
The editing lock that I use to prevent conflicts with multiple users doesn't go away until the save is completed, and with the 1 second delay it means that if you edit a tiddler and save it than you have to wait one second before you can edit it again.
* Tweaks to appearance of alerts
* Exclude temp tiddlers from offline snapshots
Otherwise alerts will persist
* Tweak appearance of status line in dropdown
* Update release note
* Web server: Don't include full path in error messages
Fixes#3724
* In change event handler check for deletions
* Disable the official plugin library when the tiddlyweb plugin is loaded
* Hide error details from browser for /files/ route
See https://github.com/Jermolene/TiddlyWiki5/issues/3724#issuecomment-565702492 -- thanks @pmario
* Revert all the changes to the relationship between the syncer and the syncadaptor
Previously we had some major rearrangements to make it possible for the syncadaptor to route it's logging to the logger used by the syncer. The motivation is so that the "copy logs to clipboard" button is more useful.
On reflection, changing the interface this drastically is undesirable from a backwards compatibility perspective, so I'm going to investigate other ways to achieve the logger sharing
* Make the tiddlyweb adaptor use the syncer's logger
So that both are availavble when copying the syncer logs to the clipboard
* Update release note
* Support setting port=0 to get an OS assigned port
Quite useful
* Update code comment
* UI: Use "Get latest changes from server" instead of "Refresh"
* Add getUpdatedTiddlers() method to syncadaptor API
See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573579495
* Refactor revision handling within the syncer
Thanks @pmario
* Fix typo in tiddlywebadaptor
* Improve presentation of errors
See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573695267
* Add docs for getTiddlerRevision()
* Remove unused error animation
* Update comment for GET /recipes/default/tiddlers/tiddlers.json
* Optimise SVG cloud image
* Add optional list of allowed filters for get all tiddlers route
An attempt to address @Arlen22's concern here:
https://github.com/Jermolene/TiddlyWiki5/pull/4373#pullrequestreview-342146190
* Fix network error alert text translatability
* Fix error code and logging for GET /recipes/default/tiddlers/tiddlers.json
Thanks @Arlen22
* Flip GET /recipes/default/tiddlers/tiddlers.json allowed filter handling to be secure by default
* Validate updates received from getUpdatedTiddlers()
* Add syncer method to force loading of a tiddler from the server
* Remove the release note update to remove the merge conflict
* Fix crash when there's no config section in the tiddlywiki.info file
* Use config tiddler title to check filter query (merge into fix-syncer) (#4478)
* Use config tiddler title to check filter query
* Create config-tiddlers-filter.tid
* Add config switch to enable all filters on GET /recipes/default/tiddlers/tiddlers.json
And update docs
* Fix bug when deleting a tiddler with a shadow
Reported by @kookma at https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-604027528
Co-authored-by: jed <inmysocks@fastmail.com>
Co-authored-by: Arlen22 <arlenbee@gmail.com>