In live note taking situations, it is desirable to save the text every now 
and then - but it is very unpractical to have the tiddler exit edit mode 
for this only to have to enter edit mode again, including the seconds of 
waiting for this. It would be much better if there was also a "save but 
stay in edit" button. (Actually, that really is a *save*, whereas the 
current behaviour is a *done*)

I have localized the key tiddler for this to be 
$:/core/modules/widgets/navigator.js 
<http://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fwidgets%2Fnavigator.js> 
which contains:

var NavigatorWidget = function(parseTreeNode,options) {
>     this.initialise(parseTreeNode,options);
>     this.addEventListeners([
> [...]  
>         {type: "tm-save-tiddler", handler: "handleSaveTiddlerEvent"},
> [...]  
>     ]);
> };
>


...and handleSaveTiddlerEvent reads:

// Take a tiddler out of edit mode, saving the changes
> NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
>     var title = event.param || event.tiddlerTitle,
>         tiddler = this.wiki.getTiddler(title),
>         storyList = this.getStoryList();
>     // Replace the original tiddler with the draft
>     if(tiddler) {
>         var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
>             draftOf = (tiddler.fields["draft.of"] || "").trim();
>         if(draftTitle) {
>             var isRename = draftOf !== draftTitle,
>                 isConfirmed = true;
>             if(isRename && this.wiki.tiddlerExists(draftTitle)) {
>                 isConfirmed = confirm($tw.language.getString(
>                     "ConfirmOverwriteTiddler",
>                     {variables:
>                         {title: draftTitle}
>                     }
>                 ));
>             }
>             if(isConfirmed) {
>                 // Save the draft tiddler as the real tiddler
>                 this.wiki.addTiddler(new 
> $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
>                     title: draftTitle,
>                     "draft.title": undefined,
>                     "draft.of": undefined
>                 },this.wiki.getModificationFields()));
>                 // Remove the draft tiddler
>                 this.wiki.deleteTiddler(title);
>                 // Remove the original tiddler if we're renaming it
>                 if(isRename) {
>                     this.wiki.deleteTiddler(draftOf);
>                 }
>                 // Replace the draft in the story with the original
>                 this.replaceFirstTitleInStory(storyList,title,draftTitle);
>                 this.addToHistory(draftTitle,event.navigateFromClientRect);
>                 if(draftTitle !== this.storyTitle) {
>                     this.saveStoryList(storyList);
>                 }
>                 // Trigger an autosave
>                 $tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
>             }
>         }
>     }
>     return false;
> };
>


I'm unsure which part that closes the edit view and opens the view mode, 
but I'm also thinking that bit may be necessary in order to do the rest.

Could anyone help out a bit, please?

<:-)

-- 
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to