About this board

Previous discussion was archived at Talk:OOjs UI/Archive 1 on 2016-12-12.

GZWDer (talkcontribs)

See phab:T241180 - does it mean after migration from jQuery UI and MediaWiki UI to OOUI, we will migrate all special pages to Vue.js?

Jdforrester (WMF) (talkcontribs)

We don't know yet. Possibly we'll be able to re-tool OOUI to use Vue.js, possibly we'll create a new library for the same use cases, possibly something else. We're still at the exploratory stages.

Volker E. (WMF) (talkcontribs)

What @Jdforrester (WMF) said, we're currently exploring and evaluating different paths. In the short-term we're commited to continue development and maintainenance of OOUI as it's used widely in our ecosystem. When alternatives have been reached a production-ready level, it will highly-probable be deprecated. (talkcontribs)

Will there be an attempt to remove jquery from ooui and switch to vanilla javacript?

Jdforrester (WMF) (talkcontribs)

No. We're already exceedingly sparing in where we use jQuery (only when it's faster than falling back to writing bespoke wrappers around native methods). As MediaWiki isn't planning to get rid of jQuery ever, the work to remove the last few uses when it's always around in the main environment for which we've built it isn't worth it. (talkcontribs)

There seems to be a push to remove jquery from existing software (like github did). What exactly is the point of doing this? Is it really much slower in terms of execution and loading up the jquery file ? I'm debating whether I should try to remove jquery from my wikipedia setup. The thing is that I use OOUI rather extensively (dialogs and forms) and I'd have to say goodbye to OOUI. I feel like OOUI is too complicated, large and slow to load. My gut tells me I should stop doing anything with OOUI for the time being. I tried to use OOUI as much as possible instead of using other third party libraries, but I find it annoying that I have to load the entire thing just to infuse a form and get a modern look.

Jdforrester (WMF) (talkcontribs)

As I said, we aren't planning to get rid of jQuery from MediaWiki. Attempting to do so on a third party installation is very likely to go poorly. I would not advise it.

Reply to "Will OOUI be deprecated?" (talkcontribs)


I'm migrating a wiki via upgrade. The new installation uses ooui. It's images aren't rendering. I don't know what the requirement is. They appear as invisible user interfaces like with this (wiki/Sword_of_Moonlight/installing) slideshow. I finally realized they weren't showing at all, where previously I thought they were text labels only.

Wiki is en (dot) swordofmoonlight (dot) org

Volker E. (WMF) (talkcontribs)

Could you clarify what you mean by “not rendering”. Can you access one of the images directly? If not there could be several issues involved including a ResourceLoader issue. Are any icons shown. The URL you've provided doesn't seem to use an updated MediaWiki yet. (talkcontribs)

The link is a direct link, that prints the error "Image generation failed". The wiki is upgraded to 1.33.1. The skin is based on an earlier version of MonoBook that I had to transfer to the new version. I think the new version is based on BaseTemplate instead of QuickTemplate but I didn't change that. I don't see anything in BaseTemplate that seems like OOUI would depend on its being there. But that's a possibility. I expect it's more likely something about my environment, but I'm open to anything.

BTW: I hacked in some Unicode triangles so that the slideshow buttons are visible, but those are unrelated to OOUI. Also there's a serious (unrelated) but in the slideshow I've reported here (Topic:Vcppuzq1pmnea4z3) that seems like staff should take very seriously and fix ASAP. (talkcontribs)

*bug. Also, thank you for replying :)

MSchottlender-WMF (talkcontribs)

This sounds like there's a problem of the webserver itself to produce an image (png?) from the original svg. Could you check into whether imageMagick (or whatever library is set up?) works for you in general? (talkcontribs)

ImageMagick is available and in use elsewhere. The upgrade web installer indicated it's in working order. I could try to do a test with an SVG file to see if can convert to a PNG for example... if you think that's a possibility. I don't know how to do that off the top of my head (I don't want to spend an afternoon figuring it out unless necessary.)

MSchottlender-WMF (talkcontribs)

The fact you're getting an empty message "Image generation failed" indicates to me that it's something about the server operation. I can be (very possibly) wrong, but I thought I'd point to this direction as something to verify, since I am not sure what else could prevent this other than making sure you run `composer update` and potentially `npm install`

Reply to "Image generation failed"

Getting OOUI object reference from an element?

2 (talkcontribs)

For example, I simply want to disable a button. Before I could just set the disabled property, but now I need to call the disable method on the button's OOUI object. If the button was a PHP object, I could infuse it to get the object, but for buttons created in JS (by other scripts I have no control over, for instance), infuse doesn't work.

Matma Rex (talkcontribs)

There is no way to do this. If the other script wanted you to be able to disable its button, it would allow you to get the OOUI object.

For example, the other script could do something like this:

fooWidget.$ 'ooui', fooWidget );

…but if it doesn't, there's no way to get the OOUI object from the DOM element.

How I can binding widget to select?

2 (talkcontribs)

Hello. I want to add delete reasons by script.

OO.ui.DropdownWidget.static.infuse( $( '#' + $('#wpDeleteReasonList').parent().attr('id') ) ) OO.ui.MenuOptionWidget({ data: data, label: label }), position);

It works fine, but when i choose one of my “custom reasons”, mediawiki not to provide it in delete log. For example, instead What am I doing wrong? (talkcontribs)

Sorry, wrong wikimarkup. I can’t edit previous message. My code:

OO.ui.DropdownWidget.static.infuse( $( '#' + $('#wpDeleteReasonList').parent().attr('id') ) ) OO.ui.MenuOptionWidget({
    data: data,
    label: label
}), position);
Reply to "How I can binding widget to select?"
Ainz Ooal Gown (talkcontribs)

So I recently found out about OOUI and after that I have completely rewritten my script per OOUI. My script basically adds some buttons. I noticed that all buttons' styles are based on WikimediaUI. I want to use Apex and WikimediaUI together. How to do it? It's not like I don't like this WikimediaUI. It's just I don't prefer this style. Here's the link to my script w:en:User:Masumrezarock100/mobilemorelinks/common.js.

Jdforrester (WMF) (talkcontribs)

Hey there,

The OOUI theme is decided at the MediaWiki skin level, and not available for individual on-wiki tools to adjust, sorry.

Ainz Ooal Gown (talkcontribs)

Hmm, Thanks anyway.

Why OOUI has not been developed as a separate skin ?

Shawn (talkcontribs)

Can someone please explain to me why OOUI impacts all skins and has not been developed as a skin on its own. It would allows users to use the old beautiful "Vector" skin without all the ugly (on my opinon) changes made by OOUI. It makes using Wikipedia on a computer not very practical (widgets like text input, check boxes, radio buttons too big, too much spaces between elements...).

  • So why OOUI has not been developed as a separate skin ?
  • How to disable OOUI and revert back to legacy Vector skin ?
Jdforrester (WMF) (talkcontribs)

The OOUI library is not a skin, it's an interface toolkit designed to be the interface for all of MediaWiki. The equivalent question is why Firefox has been developed as a browser and not a website.

how can I see the code of the demos

ԱշոտՏՆՂ (talkcontribs)

Hi, there are nice demos here but I can't find there code. Help me, please.

Jayprakash12345 (talkcontribs)

Validating text field inputs as page names

Enterprisey (talkcontribs)

In a user script, how can I make a text field that validates its input as a page name?

Enterprisey (talkcontribs)

That would be a "TitleInputWidget", available in MediaWiki\Widget or mw.widgets.

How do I go back to mediawiki.UI for legacy reasons?

MitchTarps (talkcontribs)

I'm put in charge of a private wiki for a university here. I've been told to bring back the old UI, as apparently for the dean, "The new interface is too hard and fancy!". My job's on the line here. Can anyone tell me how the hell do I go back to mw-ui? I tried commenting all the dependencies in Resources.PHP and commented out OOjs style from ResourceLoader.PHP. Yet, I could not get a few forms like in the special:movepage to prevent generating the OOjs classes. Please tell me there is a way!

Whatamidoing (WMF) (talkcontribs)

I'm sorry; I don't know how to solve the technical problem. I can't even tell you whether it's possible.

On the human side, have you talked to the dean yourself about this? In my experience, these messages are not always accurately relayed, so if you think you're getting the message second- or third-hand, then it might be worth double-checking. Also, people's initial reaction often changes after they've used something a few more times. And, of course, it's possible that the dean has discovered a bug. In that case, I'd be happy to help you file a bug report.

MitchTarps (talkcontribs)

Yeah, I did. The university got used to the regular UI. They were using an old MediaWiki 1.21. I updated it on their request, fixed all the breaking changes. Now I'm tasked with removing the OOjs library or the UI elements for the least. So far, I have successfully stopped the OOjs core styles from loading up via resource loader. But most things like movepage and search are still using the OOjs UI elements. I see they are defined in that way. Is there a way to go back to mediawiki ui?

Jdforrester (WMF) (talkcontribs)

I'm afraid there's no easy way to keep a latest version of MediaWiki but without the OOUI design; moving all of MediaWiki to it has been a key part of the (still incomplete) marathon job of modernising all the interfaces. Depending on which skin you're using, the "Apex theme" (which loads for Monobook) might be more appealing to the design sensibilities of your users, but other than that I can only recommend reverting which version of MediaWIki you're using.

MitchTarps (talkcontribs)

I also noticed that due to this incomplete transition, some parts of MediaWiki is slow as well. I have submitted a request to revert back to the older version. The problem is I have to patch all the security updates manually. I literally fainted imagining that!

Matma Rex (talkcontribs)

I guess the OOjs UI widgets will mostly work fine if you remove (or heavily trim down) the styles. This is not supported and you will probably face all kinds of problems with tools which depend on OOjs UI more heavily (e.g. UploadWizard or VisualEditor), but if you're desperate… The style files are in /resources/lib/oojs-ui (see also Do not hack MediaWiki core).

Implementing an "unstyled" OOjs UI theme could probably be kind of cool, though. Maybe we should do that at some point.

Matma Rex (talkcontribs)

Also, like James suggested, try using the Apex theme instead – it's a lot less "modern-looking" (but still different from the old lack of styling). If you want it for Vector, you'll need to hack skins/Vector/skin.json and add the following at the end before "manifest_version": 1 (please note, the same warnings about hacking core apply here, but this is likely to cause a lot less problems):

	"SkinOOUIThemes": {
		"vector": "Apex"

OOUI buttons not loading in background

Jon Harald Søby (talkcontribs)

I have a peculiar issue. I have a couple of scripts on Wikidata where I've used OOUI buttons. The issue appears with multiple scripts, so I made a script as easy as it gets that still has the problem here: d:User:Jon Harald Søby/testscript.js. The script just puts a button after the page title on user pages.

The problem is that the button only loads when the tab is active while the page is being loaded. That is, if I open a tab that should have a button in the background (with Ctrl+click), the button doesn't appear. If I reload and stay in that tab while the page loads, the button appears. If I reload the page and immediately switch to another tab, the button doesn't appear. This happens in both Chrome and Firefox (I'm on Ubuntu 17.10 if that matters).

You can test it yourself by including that script (on Wikidata) with importScript ( 'User:Jon Harald Søby/testscript.js' ); in your common.js.

Am I doing something wrong in that script?

Matma Rex (talkcontribs)

Your script does not specify a dependency on OOjs UI, which means that it might work or not depending on whether something else on the page has loaded OOjs UI first. Perhaps the browsers load scripts in inactive tabs later or in a different order for some reason.

Try wrapping the entire script in a mw.loader.using call to make it reliable, like this:

( function ( $, OO ) {
	mw.loader.using('oojs-ui').then( function () {
		var button = new OO.ui.ButtonWidget( {
			icon: 'lightbulb',
			label: 'Test button that does nothing',
			flags: [
		$("body.ns-2 h1").after(button.$element);
	} );
})( jQuery, OO );
Jon Harald Søby (talkcontribs)

Yes, that seems to work! Thanks a lot! :-)

Return to "OOUI" page.