Stop the Dirty flag that forces "Changes that you made may not be saved" Message

100 views
Skip to first unread message

TonyM

unread,
Jun 17, 2020, 11:28:01 PM6/17/20
to TiddlyWikiDev
Folks,

If I visit half a dozen tiddlywiki sites in by browser that are read only on the internet, I can play and experiment. Sometimes I want to be protected from leaving the site without exporting some Tiddlers I modified so the dirty indicators can be useful on read only sites.

However most of the time, I know I will not need to save the wiki (I am not permitted to do so anyway), I would like to flag the wiki as never dirty.

Unfortunately If I place say [[none]] in the Tiddler $:/config/SaverFilter the dirty indicator has already being triggered. 

Why;

Because closing my browser is a chore I am sick of, for each wiki with unsaved changes I am forced to approve every site I want to leave and to make it worse If I stop to look at one, I have to do the close again and respond to the leave prompt again for everyone in the browser. Whilst I would like them to remain in a tab for when I return to the browser.
  • This should save many of us a lot of time
  • It may also reduce carbon emissions by making it easier to shutdown a computer rather than leave it on or suspend it (Sometime breaks servers)
  • It could be a useful feature on Local Storage activated sites (with all the caveats) like my playground 

What,

Can anyone tell me a way to set a tiddler or two to clear the dirty flag and or not trigger it. I would create a bookmarklet, or drop-able tiddler, that as I exit or just prior or when I am prompted to save a page, I can click it and on closing next time I would not be prompted with the leave warning.

Since the wiki can't be saved it will be restored to the default behaviour each load.

I have tried to do this myself but it is as yet beyond my skills, despite help.

Regards
Tony

PMario

unread,
Jun 18, 2020, 2:51:39 AM6/18/20
to TiddlyWikiDev
Hi,

If this happens to me, I just click the close browser button a second time. It ignores the dialogs and closes the window.
I'm using FF

-mario

TonyM

unread,
Jun 18, 2020, 11:55:48 PM6/18/20
to TiddlyWikiDev
Mario,

Good tip if I know I can ignore all changes in the window, but I would like it to ignore the changes in wikis I set to do so. I want the protection but I want to choose when I don't, on a per wiki basis. Consciously selected exceptions hence the OT

Regards
Tony

TonyM

unread,
Jun 19, 2020, 11:24:00 PM6/19/20
to TiddlyWikiDev
Bump,

This still needs A resolution please.

Tony

Saq Imtiaz

unread,
Jun 21, 2020, 4:24:46 PM6/21/20
to TiddlyWikiDev
Not sure I fully understand the problem despite re-reading the OP a few times, but I don't think you can reset the dirty status from wikitext.

The following run from the dev console or via a bookmarklet will reset the dirty status:

$tw.saverHandler.numChanges = 0;
$tw
.saverHandler.updateDirtyStatus();

TonyM

unread,
Jun 21, 2020, 9:57:43 PM6/21/20
to TiddlyWikiDev
Saq,

That is exactly what I want and is "almost" perfect. Whilst it would be nice that it were possible to set internally/programaticaly in the wiki, such as when relying on local storage, as a bookmarklet it is of great value to the designer.

Unfortunately I do not know how to create the bookmarklet but have tried.. 

If someone can create a simple widget or I expect, action/action message, to set OR clear the dirty status as desired It could be used programaticaly according to different conditions. 

I May use it in a check in and out process I am building. eg; If not checked out, change save filter (to nothing) and clear dirty status, so no save will take place (but local storage will). If someone is checking in with no changes I can change the save filter (already would be) and force a save to leave the tab.

Regards
Tony

TonyM

unread,
Jun 22, 2020, 3:46:56 AM6/22/20
to TiddlyWikiDev
In Relation to the checkout Process

I wonder if there is a way to obtain a unique session id for a browser session within tiddlywiki, the reason is I would like to be able to tell if a user opens the same single file wiki or hosted server wiki in another browser or tab, simply to refuse saving, ie disallow the dirty flag, for the same user in a different session to that checked out. It can I check out using a given user name and session ID, such should the same user try and checkout in another reason, it will find it is checked out to that user, but not give the new session save rights that could overwrite changes.

Perhaps Tiddlywiki can generate this session ID and save it in the browser, subsequent generation would be different. And not allow save of the apparently checked out document.

Serial Editing tools for single file wikis are my dream to support collaboration. Security is not so important when the possible users are friends and colleagues, but a layer could be added later

Regards
Tony.

Saq Imtiaz

unread,
Jun 22, 2020, 4:38:28 AM6/22/20
to tiddly...@googlegroups.com

Unfortunately I do not know how to create the bookmarklet but have tried.. 

javascript:(function(){ $tw.saverHandler.numChanges = 0; $tw.saverHandler.updateDirtyStatus(); })();  

<a href="javascript:(function(){ $tw.saverHandler.numChanges = 0; $tw.saverHandler.updateDirtyStatus(); })();">reset dirty</a>

See: http://js.do/blog/bookmarklets/

TonyM

unread,
Jun 22, 2020, 6:31:09 AM6/22/20
to TiddlyWikiDev
Saw

Thanks heaps. I am sure I tried those combinations but.

I will try and build a generic solution.

Regareds
Re tones

Reply all
Reply to author
Forward
0 new messages