TiddlyWiki5 icon indicating copy to clipboard operation
TiddlyWiki5 copied to clipboard

Allow savers to receive options and variables

Open danielo515 opened this issue 8 years ago • 4 comments

This pull request allows sending options to the savers. This may be useful if you want to configure the way the saver behaves when you send the save event, or even to allow communication between savers (or the same saver) if you save mechanism happens in two phases/steps.

The previous code was a bit confusing because it was saving optioins.variables into variables just for rebuilt the same object later {variables: { filename: variables.filename}}.

danielo515 avatar Jun 24 '17 10:06 danielo515

Hi @danielo515 the problem here is that we already use the "options" parameter that is passed into SaverHandler.prototype.saveWiki() in the call to this.wiki.renderTiddler(). If we now also pass the same "options" parameter through to saver.save() then we will have created a subtle and troublesome dependency between the options supported by these two unrelated methods.

At this point, I think the best alternative is to add a new option member to SaverHandler.prototype.saveWiki() called optionsSaveWiki and to pass that through to saver.save().

Jermolene avatar Jun 28 '17 17:06 Jermolene

@danielo515, can you decouple the two, see which options are actually relevant and then recommit?

tobibeer avatar Dec 10 '17 06:12 tobibeer

I did a similar PR. "2 way communication between contentScript and tiddlyfox.js #3010" will have to check that one too :)

pmario avatar Dec 10 '17 17:12 pmario

I have to take some time to see if I can decouple them, because at this moment I'm not sure that I understand the problem.

danielo515 avatar Dec 11 '17 12:12 danielo515