@ZeLonewolf: I took the liberty of making a couple messages and numbers localizable. Apart from that, here are a couple things that need attention before going live:
- Template:TaginfoAJAX and User:ZeLonewolf/taginfo.js appear to rely pretty heavily on
ids, which makes it risky to embed a template for the same tag multiple times on the same page. (IDs are supposed to be unique.) Let's try to rely on
classes or relative selectors as much as possible. – Minh Nguyễn 💬 06:50, 3 January 2021 (UTC)
taginfo-hiddenspans add some hidden text to the page. If CSS happens to be turned off for some reason, these strings will show. It also isn't great for screen reader accessibility, to the extent that we're concerned about it. MediaWiki supports HTML5 data attributes, so you can store this text in e.g.
data-ti-error="…"on the outermost tag, which is cleaner and avoids these issues. – Minh Nguyễn 💬 06:50, 3 January 2021 (UTC)
- I replaced
mw.language.convertNumber(), so if your browser is set to English but your wiki preferences are set to French, you'll see French-formatted numbers alongside the French-language messages. Unfortunately, this library doesn't provide percentage formatting (which differs between English and French and other languages). Fortunately, MediaWiki:Percent provides the percentage format, but we'll have to stuff it in one of those data attributes on one of the tags. – Minh Nguyễn 💬 06:50, 3 January 2021 (UTC)
- How does the script handle relations whose members predominantly have no role, such as on Relation:route_master? – Minh Nguyễn 💬 07:06, 3 January 2021 (UTC)
First of all a big thank you for the effort to create an improving replacement for taginfo template! Two first impressions:
I notice, the new displays need more space than old ones. That leeds to once more longer tables. Perhaps the layout or formating could be tuned again to save space.
In mobile view of the Wiki there occur some issues for me (Firefox Android): large whitespaces, not all % symbols are shown, overlapping text if rotating device. Chris2map (talk) 14:36, 3 January 2021 (UTC)
- Thanks for the review! I was thinking that we could make the tag name, "powered by taginfo", and "all types count" suppressible, which would give you up to 3 rows back. I'll have to take a look on mobile to see what's going on re: strange display artifacts. --ZeLonewolf (talk) 14:42, 3 January 2021 (UTC)
- These optional parameters would be good. Maybe one to show the "all types count" only? --Chris2map (talk) 17:31, 3 January 2021 (UTC)
- Done. Each part of this (tag link, taginfo link, percentages, node/way/relation/all counts) can be individually disabled.
- Layout should look good on mobile, I switched all of the sizings to em. --ZeLonewolf (talk) 02:08, 4 January 2021 (UTC)
That is a point. Perhaps the icons could link to the tag on taginfo (rather hidden). Or the "all counts" is in bold text and works as link at the same time.
I suggest to rename parameter taginfoLink into footer. It's clearer / easier to understand IMO. -- Chris2map (talk) 12:49, 5 January 2021 (UTC)
Alternative Taginfo instances
- Can you describe what you mean by that? Are there multiple instances of taginfo? It would certainly be possible to parameterize a URL for an alternative taginfo instance. --ZeLonewolf (talk) 20:23, 4 January 2021 (UTC)
How it works?
Looking at the template code I have no idea at all how it works or even where API is called. Is it maybe possible to document it a bit? At least the part that it makes API calls on each page load (it works this way, right?) What #tag:osmtaginfo is doing and where it is defined and so on would be also nice. Mateusz Konieczny (talk) 10:05, 11 January 2021 (UTC)
- How's this? Template:Taginfo2/doc#See_also. The code for osmtaginfo is here. --ZeLonewolf (talk) 03:25, 12 January 2021 (UTC)