1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-02 10:13:16 +00:00
Commit Graph

285 Commits

Author SHA1 Message Date
Jeremy Ruston
68163684a2 Fix publishFilter in save templates
Fixes #4252
2019-09-11 11:40:45 +01:00
Jermolene
8b04cfd4d5 Fix problem with extraneous raw markup in saved files
Previously, raw markup tiddlers were being saved even if they weren't included in the saveTiddlerFilter. This meant that, for example, using "save empty" button in GettingStarted would include the splash screen markup tiddler.
2019-02-07 18:30:17 +00:00
Bram Chen
557053ab35 Fix outdated external-js template. (#3657)
Fix outdated external-js template.

Add the missing raw markup sections:
  * the top of the head
  * the top of the body
  * the bottom of the body
2019-01-14 09:18:57 +00:00
Jermolene
f162f4bc7b Typos missed from a9dd8c2 2018-09-28 18:18:07 +01:00
Jermolene
a9dd8c2f52 Use the new import pragma
Good for the core to show best practice
2018-09-28 16:25:54 +01:00
Jermolene
cfb2d7c9c8 Add support for splash screens during loading
Fixes #3417

Addresses some of the requirements discussed in #2254
2018-09-27 09:47:55 +01:00
Jermolene
f2a38960fc Fix external JS template to work with the TW5 webserver
It's a bit gross that we have to change the filename used to reference the JS file. This is to make it work with the webserver.

At the moment, the webserver exposes system tiddlers as plain text renderings, and ordinary tiddlers as full HTML renderings through a view template. So we have to use a system tiddler title for the JS file.

The workaround I'm thinking of is to remove the blanket exposure of system tiddlers, and instead have a list of system tiddlers that are specifically exposed through a namespace like `127.0.0.1:8080\lib\tiddlywiki.js`. That can't clash with a tiddler title because tiddler titles are URI encoded and so can't contain slashes.
2018-09-05 08:57:29 +01:00
Jeremy Ruston
3d10a35fb7
Add support for externalising TW's JavaScript (#3423)
* Explore externalising TiddlyWiki's JS core into a separate file

* Fix missing newline after copyright notice

* Add an error alert if tiddlywiki.js can't be loaded
2018-09-05 08:44:27 +01:00
snlhnk
c05c0d3df6 Module-ize server routes, add static file support and other enhancements(#2679)
* 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
2018-07-18 16:54:43 +01:00
Jermolene
29364cbd08 Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
Jermolene
b6f948b61e Add another canonical_uri template
This one doesn’t include a subdirectory
2017-08-19 10:31:42 +01:00
Jermolene
b99a1b6496 Remove extraneous text/vnd.tiddlywiki from system tiddlers in light of #2883
There’s no special reason for these tiddlers to be viewed wikified
2017-06-09 15:42:32 +01:00
Jermolene
af45d509eb Adjust capitalisation of X-UA-Compatible meta tag
The docs suggest that the capitalised form is correct
2017-03-27 10:00:05 +01:00
Jermolene
24f29ac605 Add support for wikified raw markup tiddlers 2017-03-23 17:02:37 +00:00
Jermolene
779e62a30f Add support for JSON files containing a single tiddler
At the moment, we support JSON files containing an array of tiddlers.
With this change the core will import files containing a single
tiddler. Also adding templates for saving individual tiddlers in JSON
format
2017-03-17 14:19:43 +00:00
Brent Maxwell
19e699d330 Added mobile-web-app-capable meta tag for Android Chrome (#2456)
* Added mobile-web-app-capable meta tag for Android Chrome

* Added "mobile-web-app-capable" meta tag to the rest of the templates.
2016-07-11 11:16:58 +01:00
Jermolene
e8e9759816 Add more flexible support for static content
Passing the static content through the `$:/core/templates/html-tiddler`
template made it impossible to produce output that wasn’t HTML encoded
(eg stylesheets).
2016-06-23 16:29:51 +01:00
Jermolene
bc0cbf9070 Add a lazy loading template for all non-system tiddlers
With this new template you can run TiddlyWiki under Node.js such that
all non-system tiddlers are lazily loaded, and not baked into the HTML
file.
2015-11-05 12:33:20 +00:00
Jermolene
a204784c0c Limited implementation of external text tiddlers in the browser
Triggered by the discussion in #1917
2015-08-29 16:33:04 +01:00
Jermolene
e0aacc84d5 Add publishFilter to default save template
Making #1800 a bit more useful
2015-07-12 09:08:11 +01:00
Jermolene
9aa9b59284 Include tiddler caption/title in static page titles 2015-06-15 09:54:56 +01:00
Jermolene
fdeb8a925f Introduce template for single tiddler windows
Lets us include global macros etc.
2015-05-03 14:58:33 +01:00
James Welford Anderson
99499c0403 staticmeta 2015-01-11 09:28:18 +09:00
Jermolene
bb74be7ac1 Fix problem with static "all tiddlers" export 2014-12-04 07:58:30 +00:00
Jermolene
e6043b07b9 Update export button to use tiddler title as filename base 2014-11-22 14:19:10 +00:00
Jermolene
64d661f6e4 Update alltiddlers.template.html to use new exporter 2014-11-13 16:04:56 +00:00
Jermolene
4dec771c20 Make exporter descriptions translatable 2014-11-13 16:03:09 +00:00
Jermolene
6fc5c70ace First pass at export button
New export button appears as a page control toolbar button, a tiddler
toolbar button, and a button in the advanced search filter tab.

Initially supports exporting as static HTML, CSV, JSON or `.tid` file.

Still to do:

* Made the exporter descriptions translatable
* Hide the export button by default
* User docs
* Cleaning up the existing templates (eg,
`$:/core/templates/alltiddlers.template.html` should work by
transcluding `$:/core/templates/exporters/Static`)
* Docs for the new macros `exportButton`, `csvtiddlers` and
`jsontiddlers`

Issues:

* OS X Numbers refuses to open CSV files that have been generated in
Chrome, because it thinks they’ve been downloaded from the Internet.
Firefox works OK
* The export button won’t work within the tiddler info panel, or from
the *more* popup (this is because we don’t support nested popups)
2014-11-10 20:59:15 +00:00
Jermolene
89fd5379dd Change "tw-*" variables to "tv-*" 2014-08-28 22:28:02 +01:00
Jermolene
88c9c0c3ee Hide toolbar buttons from static renderings 2014-08-28 20:21:25 +01:00
Jermolene
f8b9471549 Rename more tw- classes to tc-
Part of #764
2014-08-28 19:00:57 +01:00
Jermolene
87cb520343 Rename "story-river" class to "tc-story-river"
Part of #764
2014-08-28 17:26:21 +01:00
Jermolene
3ff7462afd Avoid saving $:/HistoryList
Otherwise it just keeps growing on each navigation.
2014-07-03 14:33:20 +01:00
Jermolene
0fae9ee992 Improve handling of popup state
An improvement to 6fb992690d

By making sure that all the popup state tiddlers have the prefix
$:/state/popup/ we can be more selective and just exclude popup state
tiddlers when we save. The end result is that once again other kinds of
state are persisted as expected (eg tabs, and sidebar visibility).
2014-06-22 11:14:11 +01:00
Jermolene
6fb992690d Exclude state tiddlers when saving changes
This might be a controversial change as it also means that it is no
longer possible to include `$:/state/…` tiddlers in a wiki to set up
the initial configuration.
2014-06-16 17:21:41 +01:00
Jermolene
ca34cc437c Rename $:/core/templates/canonical-uri-external-image
As per @pmario’s suggestion.
2014-06-13 10:04:31 +01:00
Jermolene
9ab0c84140 Support global macros via the importvariables widget
The new importvariables widget imports macro/variable definitions from
the specified tiddlers and makes them available to its children.

Allows us to split PageMacros up into separate tiddlers.

We still support loading macros from $:/core/ui/PageMacros to help
people upgrading.

Fixes #644 and #559
2014-06-12 18:01:33 +01:00
Jermolene
d2796d0c9c Introduce setfield command
This new command will let us do the manipulations needed to set up
external image tiddlers
2014-06-11 10:05:35 +01:00
Jermolene
f14ecf4eb8 Add support for $:/tags/RawMarkup 2014-05-26 22:50:54 +01:00
Jermolene
8f9d88f25b Fix static stylesheets 2014-02-20 19:28:17 +00:00
Jermolene
0480bf023d Fix static CSS generation 2014-02-20 18:33:01 +00:00
Jermolene
bea8730a47 Fix problem with tiddlers of the type text/css
Fixes #395
2014-02-14 19:25:38 +00:00
Jermolene
fa59382215 Add support for serving TW5 with lazily loaded images 2014-01-29 09:05:00 +00:00
Jermolene
762940adbc No longer save system modules separately in the main HTML template
These tiddlers were being handled as `<script>` tags to make it easier
to debug them. But in fact modern dev tools are quite happy to debug
code that has been eval’d, and this arrangement was causing problems
for importing.

Fixes #335
2014-01-25 21:22:43 +00:00
Jermolene
5dff212e5a Clarify comment in main template 2014-01-12 11:58:45 +00:00
Jermolene
e48e7e9443 Style improvements for alltiddlers.html 2013-12-31 11:34:10 +00:00
Jermolene
b9e80a270b All-in-one static HTML support
Added a first pass at generating an all-in-one static HTML
representation of a wiki, incorporating anchor links for wiki links
2013-12-31 09:43:46 +00:00
Jermolene
73c5ecdaa7 Added a green version of the favicon for the static pages 2013-12-24 09:09:01 +00:00
Jermolene
eef32e70e3 Added support for dynamic favicons
Now it’s possible to edit $:/favicon.ico with the image editor, and see
the changes instantly reflected in the browser.
2013-12-24 09:08:25 +00:00
Jermolene
c740792105 Fixed illegal HTML comments
Pointed out by @Skeeve, double hyphens are not allowed inside HTML
comments
2013-12-20 18:22:01 +00:00