Hi donmor,

Could you please help me with finding out what attribute would change when 
> the two functions triggered? I don't want to use timer if possible. 
>

currently, there is not such attribute, but we can improve the situation 
with minimal efforts from you. I think the good plan is:

1. you explain, what exactly Tiddloid is watching in TW5? That's why I 
asked before:

Did I get you correctly that Tiddloid is looking for the "total-dirty" 
> attribute of some DOM element to check whether TW is dirty? If so which 
> element should that be?
>

you wrote

I use a listener to listen to the class "tc-dirty"
>

so did I get you correctly: setting the "tc-dirty" class to any DOM element 
makes Tiddloid think there are unsaved changes and vise versa, if no 
element has this class, TW is considered to have no unsaved changes? 
Doesn't sound truthy since TWC is always considered unsaved (by Tiddloid) 
instead of being never considered unsaved. So again, what's the exact 
check/thing being watched?

2. I try to implement adding/removing that attribute in a TWC plugin and 
test how it goes

3. We reconsider how it went and what options we have and either I add the 
attribute toggling in TWC core, making it closer to TW5 or you add the code 
from the plugin to Tiddloid (which is good for backward compability). The 
first approach is preferrable; I suppose the TWC plugin would be enough for 
backward compability, but we'll see.

***

Another thing that confuses me is, should I keep the capability to TWC in 
> newly opened Tiddloid Lite? I want to cut off some dependencies in the lite 
> version, most of which were to support TWC. And the support of Tiddloid is 
> not being dropped. 
>

I definitely vote for keeping support of TWC. Again, I can try to help 
minimizing the codebase by making TWC core closer to TW5 in some aspects, 
but that requires more discussion. Perhaps we could use some chat for 
quicker conversation about this, let me know what you think.

window.config.messages.confirmExit only exists in TWC. And another thing is 
> that pull requests are welcomed, so if someone contributes a localized 
> string.xml, not only the dialog, but the whole app will soon localized in 
> the next update
>

Sounds reasonable. Is it enough to add a folder like 
https://github.com/donmor/Tiddloid/tree/master/app/src/main/res/values-de 
and the string.xml file in it or should such commit/PR contain also a 
change in some file that lists available locales?

Best regards,
Yakov.

>
> Best regards, 
> donmor 
>
> 在 2019年8月29日星期四 UTC+8上午5:18:34,Yakov写道: 
> > Hi donmor, 
> > 
> > could you clarify the dirty attribute thing? Did I get you correctly 
> that Tiddloid is looking for the "total-dirty" attribute of some DOM 
> element to check whether TW is dirty? If so which element should that be? 
> > 
> > Currently, TiddlyWiki Classic has 2 dirtiness markers: 
> > the dirty property of the global store object (window.store in browser, 
> an instance of TiddlyWiki "class") which is supposed to be got via the 
> store.isDirty() helper and this property means "there are some changed but 
> unsaved tiddlers"the dirtiness of the story global object which is 
> calculated using the story.areAnyDirty() helper which looks at each tiddler 
> element's dirty attribute and doesn't store a single flag anywhere; this 
> dirtiness means "some edit fields got some changes but those were not 
> applied to tiddlers yet" 
> > Ideally, the warning should be shown when either dirtiness is present, 
> like ShowUnsavedPlugin checks; to be precise, areAnyDirty currently checks 
> whether any tiddler is in the edit mode (regardless any its field was 
> touched or not) which is something to improved, but don't bother with this. 
> > 
> > My main question is – can Tiddloid check those 2 markers in TWC and show 
> the "are you sure to exit with unsaved changes?" dialog only when one of 
> those markers is dirty? Or the only way is to implement the "total-dirty" 
> attribute somewhere? 
> > 
> > Another question is – for the sake of localization, can Tiddloid use the 
> message from (window.)config.messages.confirmExit for the dialog? (this 
> way, if someone has a translation installed, they will get a localized 
> dialog) 
> > 
> > Best regards, 
> > Yakov. 
> > 
> > воскресенье, 18 августа 2019 г., 20:11:57 UTC+3 пользователь donmor3000 
> написал: 
> > Sorry but the total-dirty attribute of the whole TWC document not found 
> yet. That's why Tiddloid's dirty indicator works only with TW5.I've never 
> had this problem. Maybe try updating the app and click SAVE in every wiki? 
> > 在 2019年8月6日星期二 UTC+8下午8:13:27,Vincent Yeh写道:No more extra confirmation 
> to close a tiddler, thanks a lot for the update! 
> > I am now, however, having two issues using it. One is that the dirty 
> flag does not comply with the store.setDirty() function in the classic 
> version. My view mode editor plugins, twve, rely on this API function to 
> inform the TWC about changes made through my plugins. It is not working 
> now, Tiddloid is not aware of any change made through twve. 
> > The other is that the tiddler list shown upon opening the app does not 
> contain the title of tiddlers as it did. Every tiddler is shown as 
> TiddlyWiki and that's it. I am not able to tell which one is which any 
> more! I opened tiddlers existing in another folder, if that helps. 
> > Like I said, it is a great work and I really enjoyed using it. If these 
> two issues can be fixed somehow, that will be very much appreciated! 
> > Best, 
> > Vincent 
>
>

-- 
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/851dfc87-0877-49cd-93b4-a5ed25feb7e5%40googlegroups.com.

Reply via email to