Hi Vincent,

I have found another very interesting stuff: the contenteditable attribute 
[1,2]. Although saving changes to wikitext from DOM is still quite tricky, 
this stuff can ease implementing WYSIWYG tremendously. In fact, CKEditor 
uses this, although their task is simpler since they save the DOM itself 
and in TW we have to either convert it back to wikitext or somehow sync 
while editing..

Best regards,
Yakov.

[1] http://html5demos.com/contenteditable
[2] http://stackoverflow.com/questions/1391278/contenteditable-change-events


> Hi Vincent,
>
>
> Now, the "boring" part.
>
> 1. create a one-line tiddler with text alpha __beta__ gamma. Click to 
> edit the only block. Add a new line (enter) and apply (ctrl+enter). Enter 
> the ordinary edit mode (click "edit"). Press esc to cancel. What is 
> expected: the changes are already applied, and since I haven't changed 
> anything in the ordinary edit mode I will just leave. What actually 
> happens: the editor asks if we should leave without saving changes (as 
> thought as they were done in the edit mode, not in twve).
>
>
> I think that's because the tiddler was not saved after the new-line being 
> added. This behavior is of TiddlyWiki (without AutoSave), not of *twve*.
>
> Not quite. The thing about autosave is what would be on leaving TW, not 
> the tiddler edit mode. This looks like no store.notify was called (and 
> hence no store.saveTiddler was called) and because of that no refreshing 
> was done, though I'm not totally sure.
>
>
> The *twve* stores *every* accepted change back to the tiddler text, right 
> at the time being accepted, even in the case of one single character. You 
> do not see a whole tiddler refreshing because *twve* avoids it and does 
> partial refreshing for you. I decided to do partial refreshing because it 
> improves performance significantly. Technically it avoids whole tiddler 
> refreshing by using the unrecommended way:
>
> tiddler.set(...the changed text and other necessary info....);
>
> store.setDirty(true);
>
>
> It is the *store.setDirty(true)* that informs the TiddlyWiki that 
> something has been changed. I do think it makes sense to do so even after a 
> single character change.
>
> So, if you disable the *autoSave* option, which is commonly desired 
> probably, then before you manually save it the tiddler remains *dirty* after 
> any change, and what you described shall happen naturally.
>
> Thanks a lot for sharing the idea of a formatter, something that I still 
> can't figure out by myself. I will spend time studying it and see what I 
> can do. This is really helping and highly appreciated. Thanks again for 
> sharing.
>
> Have fun!
>
> Vincent
>
>
> Recently I've came to an idea how to create a formatter that 
>
> ...

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/be94a17c-310d-44c2-8b48-ba451e25ef63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to