last day (23 days later) » 

Hi! Good morning!
Yep, tell me
Good morning (actually night here :-) )!
You had stated you were unable to get the .select() and .focus() to function after the alert() unless you placed them in a setTimeout(). In my testing, I'm unable to duplicate that issue. In both Firefox and Chrome there was no need for the setTimeout(). In fact, the .focus() and .select() don't appear to be needed, as the text remained selected after the alert() is dismissed. How were you testing (OS, browser, etc.)?
I was using Windows 10, Chrome 61
You are probably right about not requiring .select() again
I had probably assumed that the focus would shift to the copy button/link.
Regarding the setTimeout - I am pretty sure it wasn't working without it. So I can confirm that in the evening (10 hours from now in India) and get back to you, if you want.
Hmmm... I've been testing on Chrome 62, which indicates how long I've let this go. I'm sorry, again, that I've been so busy. The textarea is selected after the "copy" is clicked (which is needed in case someone used the keyboard to select the link and activate it.
I'd appreciate your testing again. At least for my own knowledge, I'd like to be able to duplicate the problem, so I can investigate what's going on, as the setTimeout() shouldn't be needed.
Sure. Hopefully I will be able to respond back in 12 hours.
05:30
@NisargShah That should be more than quick enough. Please actually ping me (@Makyen) here when you're done. Without a ping, I might not be notified.
Will do. :)
Thanks.
 
11 hours later…
16:12
@Makyen I just checked about both points: (1) if I call elem.select() or elem.focus() after alert without setTimeout they do not work, and (2) the focus and text selection is lost as soon as the alert is triggered in the browser.
You can see the second point in the GIF above. I didn't record the first one as it looks identical.
@NisargShah OK. Thanks. Interesting. That's definitely not what I experience (also Win10, but Chrome 62) (and Firefox 56, 57, 58 & 52 ESR). For me the text within the textarea remains selected. Are you still on Chrome 61, or has it auto-updated at this point? I'll have to try some other things to see if I can duplicate (longer term issue, shouldn't block moving forward with this code).
Hmm weird! I was still on 61. Gimme a few mins. I will check with 62.
16:36
The issue is still there with Chrome 62.
I will try and repro it on Codepen with minimal code.
Final update: I can reproduce the issue here: codepen.io/Nisargshah02/pen/ZaOmax?editors=1010.
So I tried disabling all other userscripts on the page, but the issue is still there with CV-pls.
16:54
Okay now I have figured out the steps to reproduce this. In the GIF you'll see that the text doesn't get selected after alert if the cv-pls menu is open. But if it is not open, the text does get copied.
I also verified that on FF51.
@NisargShah OK. Thanks. I'm going to adjust some things to see if I can duplicate.
17:09
As I started to make changes, I realized what causes this. The issue is interaction with the other click event handler we use, which gets called after the one for the "copy" as the event bubbles up the DOM. I had already made an associated change which prevents it from being called. Thanks for working on this.
Great!
Btw which handler are you talking about? I can't remember having any other click handler in the notification.
And, I am assuming the event from notification would not bubble up to the click handlers around the cv-pls menu.
`$('a:not(.cvrgui a)').on('click',function(){
if(CVRGUI.list.is(':visible'))
hideMenu();
});`
This one?
@NisargShah It's the click handler used to hide the GUI menu when someone clicks elsewhere in the page, which is on document (hence the bubbling up). If the GUI is visible, then it calls hideMenu().
@NisargShah Nope, not that one.
$(document).on('click',function(){
if(CVRGUI.list.is(':visible'))
hideMenu();
});
This one, right?
@NisargShah Yep, that one.
haha that was a great mystery :D
Anyway thanks for all the support! I've learned a lot.
Do tell me if I can be helpful with something else!
17:17
@NisargShah No problem. I'm glad I've been able to help.
@NisargShah Thank you for your help. It's certainly appreciated.
@Makyen Do you need anything else from me on the Pull request?
@NisargShah Until the 15th (or whenever I finish the updates needed due to the Greasemonkey update), I'll probably defer any additional PRs (mostly to make my life easier). But after that, feel free to work on what you see needs to happen.
@NisargShah No. At this point, my plan is to merge it into a different branch, make some modifications, merge the other pending PR for this script, then make the updates to roll the revision number (causing people to update) and merge into main.
@Makyen Sounds good. See ya later!
@NisargShah Do you want me to write up an explanation of the changes I'm making?
@Makyen Changes to what? The userscript?
17:28
@NisargShah Changes to the code you've added.
@Makyen Nope. Don't worry about that. I will be able to compare the diffs. If I don't understand something, I will just search on internet.
@NisargShah That's what I figured, but I wanted to offer. Feel free to ask. Some are just style.
Sure! Thanks!

  last day (23 days later) »