Hi Andreas.

Thanks for the reply!

I'm particularly interested in the final stage - i.e. how exactly the 
browser is commanded to save the (dynamic) changes to the page.

(If you have the time, I posted *this*  
<http://stackoverflow.com/questions/30260026/saving-offline-changes-in-internet-explorer>on
 
StackOverflow recently, which kind of gives a wider context as to what I've 
been researching.)

As what is saved is basically an updated version of the whole document, is 
the dataUrl link that you mentioned in your stage 4 a complete duplicate of 
the whole document?

>From what you write after that, would I be right in guessing that 
TiddlyWiki then conditionally branches into browser-specific code to do the 
actual final saving?

The saving can be so easily implemented in some browsers (e.g. with the 
anchor download attribute in Chrome), but it would be so much more elegant 
to be able to use the exact same HTML5/CSS3/Javascript code for all 
browsers!

I'll attempt another plough through the source code following your guidance.

Thanks again for your help!

Kind regards from (not so) sunny Cambridge, England,

Rick.



On Friday, 22 May 2015 22:04:59 UTC+1, Andreas Hahn wrote:
>
> Hi Rick, 
>
> without having the evidence in code to support my claims, from memory, I 
> recall that the process should work like this: 
>
> 1) Tiddlywiki renders a tiddler called $:/core/save/all (or similiar) 
> internally and hands off the result to a saver module (not syncer) 
> 2) The saver module is specially selected depending on the situation, 
> but for the normal browser-save option is either called "manualdownload" 
> or just "download" 
> 3) Basically what the download saver-module does is get the rendered 
> version of a tiddler in a form that fits the data contained (either text 
> or binary) 
> 4) And it then injects a link into the DOM containing a data-url which 
> contains all the data that is supposed to be saved and clicks that link 
> (and then removes it from the DOM) 
>
> Depending on the situation, it might employ more sophisticated things 
> (like the browser's API if existent) to influence the filename for 
> example. 
>
> Don't nail me on the specifics, but that should be the general process. 
> (I am afraid that I don't have the time to actually dig in TW's code 
> right now, but I can take a look and figure out the details more clearly 
> later) 
>
> Hope this was of some help. 
>
> /Andreas 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/ab64f12c-0068-48a4-a390-e744a2655775%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to