Page MenuHomePhabricator

jQuery-UI inconsistently not loaded on Meta-Wiki depending on namespaces
Closed, InvalidPublic

Description

On Meta-Wiki, {{clickable button}} uses jQuery-UI CSS classes ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-primary ui-icon ui-button-text ui-button-icon-secondary ui-icon.

This template has been used on many pages. It seems to still work well on most pages (in User: or Research: namespaces for example), but to be broken on Template: and Main namespaces, where needed CSS rules are not loaded.

Moreover, from edit page, needed CSS is well loaded, so user may think template well works when they preview whereas it doesn’t work once page is saved.

Event Timeline

jQuery UI seems to be a core module of ResourceLoader.

Jdforrester-WMF subscribed.

jQuery UI seems to be a core module of ResourceLoader.

It isn't.

This appears to be a faulty gadget? jQUI isn't a standard shipped library; we're trying to delete it, not increase its use. Removing the out-of-scope tags, but this is probably Invalid.

On pages where the jQuery UI styles are loaded, it is loaded coincidentally for unrelated reasons (e.g. there might be a gadget or extension loaded on that page that uses jQuery UI for its own purposes).

MediaWiki has never supported loading jQuery UI styles for templates.

Some wikis used to have a snipper of code in Common.js that automatically looked for the "clickable button" template being used on that page, and if so, loaded the megabyte of JS/CSS of jQuery UI in order to make the button blue. This is of course very costly for such a simple visual effect and to my knowledge no wikis do this anymore.

I would recommend changing or replacing the template with something like https://commons.wikimedia.org/wiki/Template:Clickable_button_3 which uses mw-ui-button styles instead, which are supported by MediaWiki, are very light, are automatically loaded when needed, and look consistent with other parts of MediaWiki.

Thanks for feedback and clarifying.

If I well understand, jQuery UI is automatically loaded where it is needed, except for page content which has never been supported.

So indeed, an invalid task.