User talk:Jack who built the house/Gadget-referenceTooltips.js

Latest comment: 5 years ago by Jack who built the house in topic Two minor issues

Two minor issues

edit

@Jack who built the house:

  • This should probably load ext.popups.images from en.wikipedia instead of ru.wikipedia.
  • Using mw.cookie without overriding the prefix would result in existing users losing their current settings. This could be fixed by replacing mw.cookie.get( 'RTsettings' ); with mw.cookie.get( 'RTsettings', '' ); and { path: '/', expires: 90 * SECONDS_IN_A_DAY } with { path: '/', expires: 90 * SECONDS_IN_A_DAY, prefix: '' } .

--Yair rand (talk) 17:24, 30 December 2018 (UTC)Reply

Yair rand, well noticed! Done. Jack who built the house (talk) 04:49, 31 December 2018 (UTC)Reply
@Jack who built the house: One more thing I just noticed: The extra style tags added via mw.util.addCSS when the tooltip is at the right edge aren't ever removed. Instead, they keep piling up in the head every time the user hovers over a reference, even if it's the same reference twice. I recommend removing the tags rather than just disabling them once they're no longer needed, or even better, set the styles to the element directly, rather than adding a style tag which I assume would be harder on performance. --Yair rand (talk) 06:22, 31 December 2018 (UTC)Reply
Yair rand, thank you again, done. As I remember, the reason why I used mw.util.addCSS here at all was the fact that I was messing with pseudoelements, and you can't reach them from style attribute. At some moment, that changed, but the code was left untouched. Jack who built the house (talk) 07:13, 31 December 2018 (UTC)Reply
Also, the bit around line 425 should probably check whether COMMENTED_TEXT_CLASS is empty. . alone isn't a valid selector, so it breaks the script. --Yair rand (talk) 07:08, 31 December 2018 (UTC)Reply
Yair rand, thanks, fixed. Jack who built the house (talk) 07:25, 31 December 2018 (UTC)Reply
Yair rand, hm, do settings work with the current version at all? I try to change them, only to see the same behaviour after page refresh. Jack who built the house (talk) 06:32, 31 December 2018 (UTC)Reply
@Yair rand: here, I'm talking about the current version of the gadget. Jack who built the house (talk) 07:27, 31 December 2018 (UTC)Reply
@Jack who built the house: (Tests.) It works for me... --Yair rand (talk) 07:29, 31 December 2018 (UTC)Reply
Probably some cookie interfered. Jack who built the house (talk) 08:45, 31 December 2018 (UTC)Reply