1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-31 23:26:18 +00:00
Commit Graph

72 Commits

Author SHA1 Message Date
Sebastian Silva
895447c40c Add write condition for DAT protocol (#3244)
In order to write to a DAT with Beaker Browser, it needs to have access to the file via `dat:` protocol.
2018-05-02 15:57:47 +01:00
Jermolene
df1f7e9798 Put saver: fix missing "else"
Thanks @arlen22
2018-04-08 09:37:49 +01:00
Arlen22
c069d48a2a Remove URI encoding from PUT saver (#2974)
Remove URI encoding from PUT saver and let the browser handle it as necessary. This seems to be the normal way of doing things. We have confirmed that several WebDAV servers do not expect the file names to be double-encoded.
2017-09-16 15:30:13 +01:00
Jermolene
ccac0258af Apply URL decoding in download saver
document.location gives us an URL encoded version of the original
filename, so we decode it to recover the original filename for saving.

Fixes #2828

Fixes #2819
2017-07-01 12:39:25 +01:00
Jermolene
a5e565e198 Tweaks for #2918
A couple of fixes:

* Fixed problem with loading saver in a file URI within Beaker
* Fixed problem when saving to a directory-style URI with an implicit
“/index.html”
* Switched to double quotes for strings
2017-06-24 22:30:26 +01:00
Mario Pietsch
ef9efbc399 Fix for beaker 072 - new dat API (#2918)
* initial version that works again with beaker 0.7.2

* activate path again
2017-06-24 21:54:44 +01:00
Jermolene
b37178dda1 Fix download saver for Safari 10.1
Safari now finally supports the ‘download’ attribute for the anchor
tag, meaning that the download saver works properly.
2017-03-29 09:21:49 +01:00
Jermolene
91b341e8e0 Better error trapping for WebDAV saver
Without these checks we get a startup crash when using TiddlyWiki in
client-server configuration.
2017-02-18 12:12:29 +00:00
FND
6505e6f448 WebDAV file overwrite protection (#2614)
* putSaver: detect edit conflicts to prevent clobbering, if possible

if the server supplies an ETag, we send it back when saving, allowing
the server to detect edit conflicts and respond with 412 (cf.
https://www.w3.org/1999/04/Editing/)

caveats:
* this only kicks in after the first save, as we don't have access to
  the ETag when first loading the document
* there's no recovery mechanism (e.g. resetting `this.etag` in order to
  force clobbering), other than manually reloading the document

* putSaver: retrieve ETag upon initialization for clobbering protection

this addresses one of the caveats from the previous commit
(2d75cb83af) - while theoretically prone
to a race condition, it seems unlikely that saving will be triggered
before the server responds

* putSaver: simplify URI extraction

this simplifies the approach introduced in
f51f6bf774, with the purpose of removing
the fragment identifier

* putSaver: localize error message

* putSaver: switch to built-in HTTP helper

in the process, fixed ETag assignment in `#save` method (was
`this.etag`, now `self.etag`) as well as a syntax error due to a missing
closing brace

* putSaver: consolidate URI handling
2017-02-17 12:26:15 +00:00
Jermolene
b5059c612a Adds support for autosave with the download saver
Also does some reorganisation of control panel to move “saving” related
settings together, and expose a UI for savers to plug into.

Fixes #2741
2017-01-30 18:19:28 +00:00
Jermolene
ab1b1f2cde Fix problem with beaker saver and default index pages
As discussed on the mailing list, we need to check for a URL that is
missing the default `/index.html`

https://groups.google.com/d/msg/tiddlywikidev/n6yUdu2zHWo/m32R2BuIDgAJ
2016-12-29 16:45:47 +00:00
Jermolene
ba9d6187af Rename the dat saver to Beaker
It’s actually specific to the API provided by the Beaker browser, and
not a generic Dat saver
2016-12-22 08:15:16 +00:00
Jermolene
a20da9f530 Add preliminary Dat file saver
See https://datproject.org/ and https://beakerbrowser.com/
2016-12-21 12:09:08 +00:00
Arlen22
66a13cb915 TiddlyFox saver canSave() should always return true (#2626)
Whether saving is allowed should be determined by the parent side of the TiddlyFox, as this plugin can be used in many places.
2016-12-17 15:27:25 +00:00
Jermolene
f51f6bf774 Fix URI in "put" save handler
We don’t want the location hash
2016-06-23 16:23:36 +01:00
Myeongjin
6388f859d1 Add localisable strings for error (#2447)
* Add localisable strings for error

* Update tiddler Transclusion Basic Usage in fr-FR
2016-05-17 21:58:47 +01:00
Jermolene
3a3754aebb Add rel="noopener noreferrer" to external links
Background:
https://medium.com/@jitbit/target-blank-the-most-underestimated-vulnerab
ility-ever-96e328301f4c#.hduwdbjlb
2016-05-05 11:49:40 +01:00
webninjasi
47d518d6d4 Fix invalid header in upload plugin 2016-03-03 19:08:24 +02:00
Eric Drechsel
60d585f7d5 putSaver: probe for server support on startup
save fails until probe succeeds,
allowing other saver methods to take over

Follow up to #2288, #2277
2016-02-16 10:53:15 -08:00
Eric Drechsel
dd43759ecc putSaver: return null on save success, TODOs 2016-02-15 15:20:30 -08:00
Eric Drechsel
f8565443d7 add a simple put saver, for saving to a webdav or REST server 2016-02-08 13:40:10 -08:00
Andreas Hahn
513e1c8cbb Filename will now be set to "tiddlywiki.html" when path does not contain a filename. 2014-12-16 00:53:20 +01:00
Jermolene
b520efdeb8 Update savers to specify variables, including filename
Now the `tm-download-file` and `tm-save-file` messages use the hashmap
to specify variables to be applied when rendering the tiddler.

We also add a convention that the variable “filename” is used to
specify a filename for the download.
2014-11-10 19:54:19 +00:00
Jermolene
23c2d90ee8 Added error handling to upload saver
A further fix for #251
2014-09-27 10:47:31 +01:00
Jermolene
3a67fdb768 Obeisance to JSHint for core modules
There are still some warnings about making functions in a loop, but
I’ll fix those as a separate pull request because the fixes are more
than typographic errors.
2014-08-30 20:44:26 +01:00
Jermolene
9d871309c2 Remove stray console.log 2014-08-27 09:59:15 +01:00
Jermolene
ab41462af3 Ensure that savers invoke the callback 2014-08-27 09:59:01 +01:00
Jermolene
887e9d978b Fix problem with saving if URL contains # 2014-05-05 13:30:31 +01:00
Jermolene
4758874d13 Add path conversions from TiddlyWiki Classic
TiddlyWiki Classic converts local file URIs to various local native
formats. The same conversions are now performed by the TiddlyFox
adaptor for TW5.
2014-04-17 22:30:14 +01:00
Jermolene
e051eb7d90 Making more things translateable
Now we’re done with the text that lives in tiddlers, and we’ll need to
get on with the text that is embedded in code modules.
2014-02-16 09:46:43 +00:00
Jermolene
1d685df928 Add support for autosave
Causes the wiki to be autosaved whenever clicking “done” after editing
a tiddler. Only works with savers that support autosave. We should
probably make autosave configurable
2014-02-04 21:21:01 +00:00
Jermolene
6ba9bf9a95 Boost the priority of the upload saver
If we’ve got an upload wiki name then we should always use the upload
saver.

See https://groups.google.com/d/topic/tiddlywiki/Jqd2jbPmYFA/discussion
2014-01-25 16:38:08 +00:00
Jermolene
3414f1ca8e Move node-webkit saver into a plugin
We don’t need it for TiddlyDesktop now that it reuses the TiddlyFox
saver. But it is still useful for embedding a TW directly into a
node-webkit app
2014-01-18 14:57:42 +00:00
Jermolene
e254529763 More configuration controls for TiddlySpot saver
And more reliable checking of the result returned from the server
2014-01-12 12:05:15 +00:00
Jermolene
027421f5e6 More coding style consistency 2014-01-03 10:54:00 +00:00
Jermolene
1a74e2538c Cleaning up further coding style inconsistencies that have crept in 2014-01-03 10:50:00 +00:00
Jermolene
87fbd988f1 Add support for running TiddlyWiki under node-webkit 2014-01-01 17:59:47 +00:00
David Jade
cffe9375b2 Added TiddlyIE and FSO saver modules
Modified tiddlywiki5 template to support TiddlyIE and HTAs
Added empty.hta creation to bld scripts
Added TiddlyIE topics
2013-12-11 12:45:35 -08:00
Jermolene
0956ae10a0 Add support for downloading files
We were re-using the `tw-save-wiki` message both for saving the current
wiki and downloading a new wiki. Now we’ll use the separate
`tw-download-file` message for downloading.

Fixes #236
2013-11-27 20:51:08 +00:00
Jermolene
584043deee Add a notification when starting to save with the upload plugin 2013-11-26 22:46:20 +00:00
Jermolene
42fce1929c Improve save notifications for TiddlySpot 2013-11-26 12:50:40 +00:00
Jermolene
24e361da77 Removed inadvertent alert() 2013-11-12 20:58:54 +00:00
Jermolene
791033d751 First pass at a saver for IE10 and above
It's not great, sadly. Clicking save in the browser pulls up an
unobtrusive bar at the bottom of the browser window where you can click
"save". You then get a new copy of your wiki in the downloads folder.
2013-11-12 20:49:00 +00:00
natecain
c45f4d1c62 Small revision to previous commit, avoids double encoding.
We don't need to encodeURIComponent at all when using blob links.
The data never goes into the dom directly, just a guid reference.

This makes saving with blobs very fast!
2013-10-01 17:35:58 -04:00
natecain
aef8e63cf8 Use Blob api to generate data links in download saver
This should fix crashing on large wikis under chrome
  see chrome bug: https://code.google.com/p/chromium/issues/detail?id=103234
This should also speed up generating the download html by a couple of seconds
  it avoids repeatedly marshalling the base64 encoded href string across the sandbox boundary
  it avoids some time and memory consumed by "large" dom manipulation
  major remaining delay is in encodeURIComponent
    TODO: consider using iconv on the server
    TODO: consider async invocation of regular expressions to avoid client "lockup"

Conflicts:
	core/modules/savers/download.js
2013-10-01 17:35:47 -04:00
Jeremy Ruston
d0db2221d3 Fix problem with lowercase drive letters when saving with TiddlyFox under Windows 2013-09-19 13:50:28 +01:00
Jeremy Ruston
dec7870eeb Update HTML5 saver to use current filename where possible
Most browsers still ignore the specified filename, sadly.
2013-09-19 10:50:14 +01:00
Jeremy Ruston
1fd59a4bd3 First pass at a saver for the AndTidWiki app on Android 2013-08-19 13:55:40 +01:00
Jeremy Ruston
1e5842dc1c Fix download saver on Firefox
Turns out that Firefox needs the link to be in the document before it
will honour the click on it.
2013-05-23 11:26:47 +01:00
Jeremy Ruston
c0683fd65c Added a saver for the TWEdit iPad/iPhone app 2013-05-14 20:20:48 +01:00