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>
#4093 and #4100 are bundled in this PR
* qualified state-tiddlers for the tags input and fieldname + fieldvalue inputs
* newTagName, newFieldNameTiddler and newFieldValueTiddler variables defined in EditTemplate (all qualified through `qualify` macro)
* save-tiddler-actions macro in the EditTemplate (reused by the save-tiddler button)
* enter (configurable) in the fieldvalue field adds the field and sets focus to the next fieldname input
Edit:
* storyview="pop" for fields list
* First pass at dynamic loading/unloading
* Show warning for changes to plugins containing JS modules
* Use $:/config/RegisterPluginType/* for configuring whether a plugin type is automatically registered
Where "registered" means "the constituent shadows are loaded".
* Fix the info plugin
The previous mechanism re-read all plugin info during startup
* Don't prettify JSON in the plugin library
* Indicate in plugin library whether a plugin requires reloading
* Display the highlighted plugin name in the plugin chooser
And if there's no name field fall back to the part of the title after the final slash.
* Transform GitHub saver to work with GitLab as well
You can choose which provider you want to use, the data is given in the
same place.
I tried to avoid code duplication, so service providers' unique
properties are in separate files, the settings of the selected provider
are loaded.
In two fields I am not sure that it fits into the current structure:
* module-type: gitservice
Which module is a `gitservice` type, it will be listed in the
drop-down menu.
* default-api-url: https://gitlab.com/api/v4
The default URL to access the provider's API.
This is just a sketch, not a final version, suggestions for modification
are welcome!
* Rename saver from GitHub to GitService, update docs
* Split GitHub and GitLab to separate savers, apply common lingo
Sadly, it doesn't seem to make much sense to search for common parts in
the code, because there might be a Git service that is very different
from the GitHub API (such as BitBucket). Therefore, I feel that Git
savers are not able to share other than the translations.
I deleted the defaults values from the translations and set it to the
text entry because they should not depend on the translations.
* Add more information about the password field
It is not clear how to create a personal access token, thus added a link
to the help pages. In addition, GitLab only accepts personal access
token, GitHub also accepts the password, so I made this clear.
* Extract commit message to lingo
* Fix indentation
* Use improved base64 encoder
Fix conflict with a06acc4eb8
* add PaletteManager
* add hint for "external" palette-names
* macro utility, for local \import only
this tiddler is never meant to be tagged $:/tags/Macro
contains only a colour macro which allows to call `<<colour "...">>` within a tiddler and get the parameter-name instead of the resolved color
used in the PaletteManager to reveal the original color below the color that just uses its color with the colour macrocall
example:
```
\define get-real-index(string)
\import $:/core/macros/utils
<$wikify $name="result" text="""$string$"""> <- does the "colour" macrocall, but the one that returns the parameter name
<<result>>
</$wikify>
\end
<$set name="color" value={{{ [{$:/palette}getindex[color-of-interest]] }}}>
-> <<colour primary>>
<$wikify name="real-color-index" text="""<$macrocall $name="get-real-index" string=<<color>>/>""">
<<real-color-index>> -> primary
...
```
* transclude PaletteManager in snippets/paletteeditor
* transclude PaletteManager in core/ui/ControlPanel/Palette
* Update ControlPanel.multids
* add style for color inputs in PaletteManager
* Update PaletteManager.tid
* Update PaletteManager.tid
* add tooltips & aria-labels
* Update ControlPanel.multids
* Update PaletteManager.tid
* Update PaletteManager.tid
* Update PaletteManager.tid
Made this new PR for for the master branch, and closed#3697
This PR is needed for text shown in the update PR #3680 which is for the tiddlywiki-com branch
* Minor rewording of prompt text
* Moved the colon into the translation string, reasoning that it may need to be changed for languages that use punctuation differently
* Corrected expand/collapse arrows
* Moved prompt into expand/collapse button, making it easier to hit use
* List backlinks when renaming tiddler
* List references inplace
* TiddlerInfo/References accepting specific tiddler
If `operandTitle` is set, it will show its references instead of current
tiddler's.
It's purpose is to prevent code duplication (the references are listed
when renaming tiddler).
* Don't use variable for References template, use <$tiddler>
Set the `current` to desired title with `<$tiddler>` widget.
* List references in a separate block
* Rename state tiddler
* Use qualified state
* Module-ize server routes and add static file support (#2510)
* Refactor server routes to modules
New module type: serverroute
Caveats: Loading order is not deterministic but this would only matter
if two route modules attempted to use the same path regexp (that would
be silly).
* Add static assets plugin
This plugin allows the node server to fetch static assets in the /assets
directory. I felt that this was a feature that goes above the core
functionality. That is why I added it as a plugin. with the modular
route extensions this was a breeze.
* Add serverroute description to ModuleTypes
* Coding standards tweaks
* Fix filename typo
* Move support for attachments from a plugin into the core
* Missing "else"
* Refactor server handling
* Introduce a new named parameter scheme for commands
* Move the SimpleServer class into it's own module
* Deprecate the --server command because of the unwieldy syntax
* Add a new --listen command using the new syntax
For example:
tiddlywiki mywiki --listen host:0.0.0.0 port:8090
* Add check for unknown parameters
* Add support for multiple basic authentication credentials in a CSV file
Beware: Passwords are stored in plain text. If that's a problem, use an authenticating proxy and the trusted header authentication approach.
* Refactor module locations
* Rename "serverroute" module type to "route"
* Remove support for verifying optional named command parameters
The idea was to be able to flag unknown parameter names, but requiring a command to pre-specify all the parameter names makes it harder for (say) the listen command to be extensible so that plugins can add new optional parameters that they handle. (This is particularly in the context of work in progress to encapsulate authenticators into their own modules).
* Refactor the two authenticators into separate modules and add support for authorization
* Correct mistaken path.join vs. path.resolve
See https://stackoverflow.com/a/39836259
* Docs for the named command parameters
I'd be grateful if anyone with sufficient Windows experience could confirm that the note about double quotes in "NamedCommandParameters" is correct.
* Be consistent about lower case parameter names
* Do the right thing when we have a username but no password
With a username parameter but no password parameter we'll attribute edits to that username, but not require authentication.
* Remove obsolete code
* Add support for requiring authentication without restricting the username
* Refactor authorization checks
* Return read_only status in /status response
* Fix two code typos
* Add basic support for detecting readonly status and avoiding write errors
We now have syncadaptors returning readonly status and avoid attempting to write to the server if it's going to fail
* Add readonly-styles
We hide editing-related buttons in read only mode
I've made this part of the tiddlyweb plugin but I think a case could be made for putting it into the core.
* Add custom request header as CSRF mitigation
By default we require the header X-Requested-With to be set to TiddlyWiki. Can be overriden by setting csrfdisable to "yes"
See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Protecting_REST_Services:_Use_of_Custom_Request_Headers
* Add support for HTTPS
* First pass at a route for serving rendered tiddlers
cc @Drakor
* Tweaks to the single tiddler static view
Adding a simple sidebar
* Switch to "dash" separated parameter names
* Typo
* Docs: Update ServerCommand and ListenCommand
* First pass at docs for the new web server stuff
Writing the docs is turning out to be quite an undertaking, much harder than writing the code!
* Get rid of extraneous paragraphs in static renderings
* Rejig anonymous user handling
Now we can support wikis that are read-only for anonymous access, but allow a user to login for read/write access.
* More docs
Slowly getting there...
* Static tiddler rendering: Fix HTML content in page title
* Docs updates
* Fix server command parameter names
Missed off 30ce7ea
* Docs: Missing quotes
* Avoid inadvertent dependency on Node.js > v9.6.0
The listenOptions parameter of the plain HTTP version of CreateServer was only introduced in v9.6.0
cc @Drakor @pmario
* Typo