[TWC] Simple "save and continue editing" button in edit toolbar

111 views
Skip to first unread message

Leo Staley

unread,
Mar 4, 2014, 4:17:21 PM3/4/14
to tiddl...@googlegroups.com
Hi,

I want a way to save a Tiddler while editing it, instead of having it go out to view mode, like the normal way of saving. I want to be able to click save (really, ctrl+s most of all), and keep viewing everything as is, including my caret location, text editor size, and whether preview is on or off. I understand this may not be possible, but any help getting as close to it as possible would be deeply appreciated. 

I pulled this plugin from a few others and mashed it together with a few others. Basically it's  mashup of some other toolbar commands i found elsewhere (but can't recall now, exactly where), and its the saveTiddler command mashed together with the editTiddler command, so that instead of going back out to view, it goes straight back to edit. 

But it isn't very good. It basically resets it as you would expect, making it as though i had just clicked edit, reseting the caret position to the beginning, resizing the text area to default, and preview to default. 

Is there a way to have a sort of "justSave" tiddler toolbar command, which allows you to save your work without interupting it? Is there a way to map that command to a hotkey?

Thanks in advance,
Cheers!
-Leo 

Leo Staley

unread,
Mar 4, 2014, 4:19:14 PM3/4/14
to tiddl...@googlegroups.com
Whoops. Forgot to actually paste the text of the plugin.


//{{{
config.commands.justSaveTiddler = {
    text: "Save", 
    tooltip: "Save and continue editing"
}
config.commands.justSaveTiddler.handler = function(event,src,title) {
 var newTitle = story.saveTiddler(title,event.shiftKey);
            var tiddlerElem = story.getTiddler(title);
          var fields = tiddlerElem.getAttribute("tiddlyFields");
 story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE,false,null,fields);
 var e = story.getTiddlerField(title,config.options.txtEditorFocus||"text");
 if(e) {
            setCaretPosition(e,0);
       }
 return false;
}
//}}}

Leo Staley

unread,
Mar 4, 2014, 8:59:20 PM3/4/14
to tiddl...@googlegroups.com

Ludwig Felhofer

unread,
Feb 13, 2017, 4:32:10 AM2/13/17
to TiddlyWiki
I donnot find any plugin that works in your links.
Do you still now how to get such a button?
Reply all
Reply to author
Forward
0 new messages