Someone elses solution to edit+save html file

66 views
Skip to first unread message

Mat

unread,
Jun 30, 2019, 7:26:02 AM6/30/19
to TiddlyWikiDev
@Jeremy

I stumbled over this blog post about "Loading, Editing, and Saving a Text File in HTML5 Using Javascript". Just thought it'd be interesting to peek if he's adding anything of value.

<:-)

Mat

unread,
Jun 30, 2019, 7:50:41 AM6/30/19
to TiddlyWikiDev
Actually, that fella has more interesting stuff.

This is his latest post Exploring the ZIP File Format in JavaScript sounds like a plugin mechanism.


Here's possibly something for reading from the disk Reading a String from a File in JavaScript

<:-)


P.S browsing around his blog he seems to be a really sharp guy. I invited him over. Who knows :-)

TonyM

unread,
Jul 2, 2019, 7:44:45 AM7/2/19
to TiddlyWikiDev
Mat,

It does look interesting for a project I have.
  • For others it would be simple, but I want to set a value in a file on the server indicating who has a tiddlywiki checked out.
  • Then I want the wiki to reload and the user can proceed to save if they are the checked out user, 
  • If not they have to wait until the checkout is relinquished, checkout and reload the wiki and get the latest copy.
  • They can do none of this if they do not already have the key to save via tw-receiver
I think I can do the above with an iframe that allows the checkout process and an Iframe busting call that will reload the whole wiki afresh on checkout.

Hopefully I will find some clues on his site. otherwise it will have to wait for my php and javascript self education.

Regards
Tony

Jeremy Ruston

unread,
Jul 2, 2019, 10:01:36 AM7/2/19
to TiddlyWikiDev
Hi Mat

I should briefly comment in case others wonder whether there’s anything helpful.

> I stumbled over this blog post about "Loading, Editing, and Saving a Text File in HTML5 Using Javascript". Just thought it'd be interesting to peek if he's adding anything of value.

This is actually a demonstration of two of techniques already used by TW5:

* Saving a file using the anchor tag and the download attribute
* Processing a local file selected with a “browse…” button

This is his latest post Exploring the ZIP File Format in JavaScript sounds like a plugin mechanism.

That’s a simple parser for reading ZIP files in JavaScript. In TW5 we use the following library for parsing ZIPs (it’s packaged in the official plugin library as “$:/plugins/tiddlywiki/jszip”):

It’s a nice simple starting point. Again, there are more full featured libraries that offer better output.

Here's possibly something for reading from the disk Reading a String from a File in JavaScript

This is an amalgam of the same file reading technique as above and using XMLHttpRequest to read local files. We used to do the latter in TiddlyWiki Classic but it got blocked by browsers a long time ago (as the updates to the post indicate).

Best wishes

Jeremy



<:-)


P.S browsing around his blog he seems to be a really sharp guy. I invited him over. Who knows :-)

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/54ec0d18-34d5-4fd4-8a16-0f0222345db0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages