MediaWiki talk:Gadget-PrettyLog.js
![]() | This script, PrettyLog, is a JavaScript gadget which can be enabled or disabled in your Preferences. The documentation page is located at Help:Gadget-PrettyLog. |
![]() |
i18n | Gadget translations:
internationalisation needs to be implemented |
Conversations older than 7 days will be archived automatically. |
Problem
{{Editprotected}} The gadget won't load on RTL languages. Can someone please add support to RTL?--Épine (talk) 01:33, 23 April 2018 (UTC)
- @Épine: Can you be more concrete. The gadget works for me on Chrome and FF also on RTL. -- User: Perhelion 16:14, 18 July 2018 (UTC)
- @Perhelion: it just didn’t load on ckb wiki, so I had to completely shut it off. If you want to experiment in our wiki to see what the problem is let me know. Thanks.--Épine (talk) 17:06, 18 July 2018 (UTC)
- @Épine: I found the problem. The tool uses the Commons own formated CSS class "mw-search-results". But the rest works for me on your Wiki (you need mediawiki.util loaded). -- User: Perhelion 18:34, 18 July 2018 (UTC)
- So, can you edit the code so it works in our wiki as well?--Épine (talk) 22:26, 18 July 2018 (UTC)
- @Épine:
Done you can now import the Commons version per mw.loader.load. -- User: Perhelion 23:46, 18 July 2018 (UTC)
- @Épine:
- So, can you edit the code so it works in our wiki as well?--Épine (talk) 22:26, 18 July 2018 (UTC)
- @Épine: I found the problem. The tool uses the Commons own formated CSS class "mw-search-results". But the rest works for me on your Wiki (you need mediawiki.util loaded). -- User: Perhelion 18:34, 18 July 2018 (UTC)
- @Perhelion: it just didn’t load on ckb wiki, so I had to completely shut it off. If you want to experiment in our wiki to see what the problem is let me know. Thanks.--Épine (talk) 17:06, 18 July 2018 (UTC)
Performance improvement
{{Edit request}} Can someone please deploy this minor change ? This ensures that not all 50+ images on the page will be requested at once with the thumbnail server, which will reduce the 429 rate limiting to kick in and leaving you with a bunch of unloaded images if the thumbnailer did not yet have the ready to serve just yet. —TheDJ (talk • contribs) 20:36, 17 October 2023 (UTC)
- @TheDJ: Good idea and
Done for now, but is there a reason to use
img.setAttribute( 'loading', 'lazy' );
rather thanimg.loading = 'lazy';
? I would assume that browsers added support for the attribute on theimg
tag and the property on theHTMLImageElement
interface at the same time, and in browsers without support, it would just be a no-op in basically the same way. - I also implemented automatic retrying of thumbnail errors in one of my tools a while back (commit), if you have any thoughts on whether that would be useful to include? (But I’m also happy to just add loading=lazy for now.) Lucas Werkmeister (talk) 18:55, 18 October 2023 (UTC)
- it doesn't really matter. setAttribute can basically never fail, whereas props theoretically can fail. But in this case, it's mostly because i copy pasted the line from another script :D What does matter is the position. it should always be before you set the .src. Wrt retry... I don't think its really needed, lazy loading is pretty reliable as long as you don't put 25+ items on your screen all at once. While theoretically that could be possible here... I'd say a 'give up on this image after x retries' is definitely needed for some situations, as 429's also get thrown for thumbnails that cannot be generated. Infinitely retrying those requests if someone keeps their page open for 10 days seems like a potential problem to me. —TheDJ (talk • contribs) 20:02, 18 October 2023 (UTC)
- Alright, then let’s leave it as it is. Lucas Werkmeister (talk) 20:53, 18 October 2023 (UTC)
- it doesn't really matter. setAttribute can basically never fail, whereas props theoretically can fail. But in this case, it's mostly because i copy pasted the line from another script :D What does matter is the position. it should always be before you set the .src. Wrt retry... I don't think its really needed, lazy loading is pretty reliable as long as you don't put 25+ items on your screen all at once. While theoretically that could be possible here... I'd say a 'give up on this image after x retries' is definitely needed for some situations, as 429's also get thrown for thumbnails that cannot be generated. Infinitely retrying those requests if someone keeps their page open for 10 days seems like a potential problem to me. —TheDJ (talk • contribs) 20:02, 18 October 2023 (UTC)