Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-23 Thread Simon Huber

>
> Especially the tm-modal message: if I want to delete a tiddler in a new 
> window, the modal to confirm the action appears in the root window, 
> tm-notify acts the same way.
>

Sorry, I meant the alerts for cancelling or deleting tiddlers 

Now I figured out how to register the new window at $tw.openWindows but not 
the main window
As I wrote before, I think that fixing just this leaves thoughts open about 
the alerts, modals, notifications

But I'd like to do step by step anyway

Simon

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/aaf2ae5d-ff86-4458-ab8b-b3b3cd618c1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Simon Huber
Hi Jeremy, hi Andreas,

I'm sorry that I cannot dig into this myself, I'm not understanding the 
mechanism wel enough right now. But I'll keep investigating so maybe at one 
point I can contribute.

If we think about solving this, maybe we should also think about tm-modal 
and tm-notify not showing in the new window? Especially the tm-modal 
message: if I want to delete a tiddler in a new window, the modal to 
confirm the action appears in the root window, tm-notify acts the same way.

I think such a new window could also be used controlling a presentation or 
similar, where one may want the behaviour, that modals and notifications 
are shown there...

So how about changing both to show up in the window where they got 
triggered and adding an extension like external="no" to show them in the 
root window if desired?


Another thing, not directly related but maybe to include into this process: 
If I create a tiddler in the new window, then open its draft in the root 
window to edit, then save it in the root window - kind of a mess happens. 
I'm using two different Story-lists where I'm testing, that may be the root 
of the problem, but could this behaviour be fixed with the others, too?

Simon

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/0705592e-3e94-4d38-8fd5-87d557e06583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Jeremy Ruston
Hi All,

The popup mechanism not working with external windows is definitely a bug, and 
it would be terrific to fix it. As you’ve discovered, the two mechanisms were 
written without regard for one another:

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/startup/windows.js
 

 - for the open-in-new-window stuff
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/utils/dom/popup.js
 

 - for the popup mechanism

I agree with Andreas that the fix is to essentially duplicate an instance of 
the popup mechanism for each opened window. I wonder if triggerPopup could 
check the ancestors of the domNode to see which window the popup is in, and 
route it accordingly.

Best wishes

Jeremy.



> On 21 Feb 2018, at 19:07, Simon Huber  wrote:
> 
> No - I'm not having success. Here I depend on help from above
> 
> -- 
> 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 tiddlywikidev+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywikidev@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywikidev 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/31f5df4c-5e0b-4527-be06-7a6133f0f1f7%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/8BF85989-573F-4D65-B1A0-5945AC6C6026%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Simon Huber
No - I'm not having success. Here I depend on help from above

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/31f5df4c-5e0b-4527-be06-7a6133f0f1f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Simon Huber
thanks a lot Andreas,

I've now been trying .../startup/windows.js , which handles the 
tm-open-window message
couldn't I also try to register it from within there, when the window gets 
opened?

I'll take a look at your tips, the second seems more appropriate to me, 
changing that much like in (1) is a bit out of my skill-scope and I guess 
it would need to change many other things, too

Hi Simon,
>
> that is almost the right place yes, if you have a look at 
> core/modules/startup/startup.js [1], you will see that it initializes it 
> without the rootElement being given anyway. The next problem is that all 
> widgets regardless of the window they are rendered in will use 
> $tw.popup.triggerPopup(), so we can't have multiple popup handler (i.e. 
> one per window). The actual event listener however will be registered in 
> $tw.popup.show().
>
> As it stands I see two ways you could make the core properly handle this:
>
>- Turn the global window variable in core/modules/startup/window.js 
>into $tw.openWindows and make sure that all open windows including the 
>main one are listed there and then have the Popup mechanism iterate 
> through 
>these and register itself (to all of them). 
>- Have the Popup mechanism use [2] to register itself to the 
>appropriate window by default and only change this if the rootElement 
>option was set. (Not sure how well this would work in other browsers, but 
>it would require the least change) 
>
> [1] 
> https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/startup/startup.js#L118
>
> [2] https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument
>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/cfae930d-b51a-4e7d-aeef-40ffe06ce056%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread 'Andreas Hahn' via TiddlyWikiDev

Hi Simon,

that is almost the right place yes, if you have a look at 
|core/modules/startup/startup.js| [1], you will see that it initializes 
it without the rootElement being given anyway. The next problem is that 
all widgets regardless of the window they are rendered in will use 
|$tw.popup.triggerPopup()|, so we can't have multiple popup handler 
(i.e. one per window). The actual event listener however will be 
registered in |$tw.popup.show()|.


As it stands I see two ways you could make the core properly handle this:

 * Turn the global window variable in |core/modules/startup/window.js|
   into |$tw.openWindows| and make sure that all open windows including
   the main one are listed there and then have the Popup mechanism
   iterate through these and register itself (to all of them).
 * Have the Popup mechanism use [2] to register itself to the
   appropriate window by default and only change this if the
   rootElement option was set. (Not sure how well this would work in
   other browsers, but it would require the least change)

[1] 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/startup/startup.js#L118


[2] https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument

--
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/54bca73e-ca52-c640-ff4e-cd37d4692dca%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Simon Huber
Hi, Andreas

I tried hacking a bit in popup.js to see if I can register it to something 
different but my js knowledge is limited,
I don't know what to use. Right now it does 

this.rootElement = options.rootElement || document.documentElement;

on top of popup.js
I think this must be where it can be changed

what I'm looking for is an appropriate way for the core to handle it so 
that I could try making a pr

thanks for your reply,
Simon

Am Mittwoch, 21. Februar 2018 13:26:38 UTC+1 schrieb Andreas Hahn:
>
> Hi Simon, 
>
> unfortunately this is a shortcoming of the current PopupMechanism in 
> TiddlyWiki and will require changes to the core. The only way to open 
> and close the popup seems to be with a button. 
>
> If you happen to know javascript you could in theory write a 
> plugin/widget to fix this by adding $tw.popup as an event listener to 
> the window root dom element. Alternatively I imagine this would be fixed 
> by having $tw.popup.show register the event listener on the ownerElement 
> or on all open windows. 
>
> /Andreas 
>
>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/8f11d98a-8f0b-4f94-af49-09b6ff1346ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread 'Andreas Hahn' via TiddlyWikiDev

Hi Simon,

unfortunately this is a shortcoming of the current PopupMechanism in 
TiddlyWiki and will require changes to the core. The only way to open 
and close the popup seems to be with a button.


If you happen to know javascript you could in theory write a 
plugin/widget to fix this by adding $tw.popup as an event listener to 
the window root dom element. Alternatively I imagine this would be fixed 
by having $tw.popup.show register the event listener on the ownerElement 
or on all open windows.


/Andreas

--
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/720519f7-ecd3-8dfa-d394-5f19039044b4%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] [TW5] enable cancelling popups in tc-single-tiddler-window

2018-02-21 Thread Simon Huber
Hi all,

Is there a way to cancel popups or dropdowns created in a single-tiddler 
window by clicking in that window, not in the root window?

As you can see here right now tw doesn't handle that: 
http://rocketdock.tiddlyspot.com
you can click the rocket to open a new window and try the search field for 
a dropdown

Simon

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/3a8e21e9-1bfd-48dc-bc00-8659e1f6854a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.