On Monday, July 13, 2020 at 10:32:55 PM UTC-7, TonyM wrote:
>
> One strong use case it if a user is on a readonly wiki, such as where they 
> do not have a suitable saver or access to save, eg github hosted/php hosted 
> etc.. then they could fill out a survey. Once they export their survey 
> answers, the they are not longer "unsaved" changes, I can reset the dirty 
> indicator and they can leave the site without a warning, until then the 
> dirty indicator will protect them from leaving the site before their 
> changes are saved/exported.
>

*$:/config/SaverFilter *defines a filter that determines whether or not the 
isDirty flag is set.

When you export tiddlers, you could add those tiddlers to 
the $:/config/SaverFilter definition, thereby allowing those tiddlers to be 
ignored when exiting, bypassing the warning.  Of course, you'd also want to 
add -[[$:/config/SaverFilter]] as well, so that the changes to the filter 
itself won't trigger the warning on exit.

Add something like this to your custom export button:
\define newItem() -[[$(item)$]]

<$button> custom export
... do your custom export processing ...
<$list filter="... stuff you've just exported... " variable="item">
   <$action-setfield $tiddler="$:/config/SaverFilter" text={{{ 
[{$:/config/SaverFilter}addsuffix[ ]addsuffix<newItem>] }}} />
</$list>
<$vars item="$:/config/SaverFilter">
   <$action-setfield $tiddler="$:/config/SaverFilter" text={{{ 
[{$:/config/SaverFilter}addsuffix[ ]addsuffix<newItem>] }}} />
</$vars>

note: untested code

Hopefully this should get you most of the way there...

-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/8ef0fac9-e366-4f41-908a-511199f3499fo%40googlegroups.com.

Reply via email to