Page MenuHomePhabricator

Provide jquery.ui.dialog API OOjsUI-backed shim
Closed, ResolvedPublic

Description

A comment from one of my friends.
"Now that we have marked jquery.ui.dialog as an deprecated module and our willingness is to migrate current gadgets jquery.ui usages to OOjsUI for sake of UI/UX unification across different tools/gadgets, I guess it would be a good idea to provide some jquery.ui.dialog API OOjs-backed shim to provide simple things like movable dialogs, HTML content and '''CSS''' button but instead with an easy API and specially to not contain "static", "super" and other local and "OO" concepts, very similar to "jquery.ui.dialog" API, to encourage gadget developers the migration."

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 11 2016, 12:12 PM

I'm not sure if this is really feasible. We could probably write something that would mostly work for a limited subset of jQuery UI dialog functionality, but there would be unexpectedly missing or broken features. And debugging issues with dialogs using such a thing would probably be a royal pain.

If you're looking for a simple API to display simple OOjs UI dialogs, there is OO.ui.alert() / OO.ui.confirm() (which apparently are not really documented other than https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui-method-alert, whoops). You can pass a jQuery object with any HTML to them too, although the dialogs are rather too small for any interesting interface to be shown inside them.

Ebraminio closed this task as Resolved.EditedApr 1 2017, 6:34 PM
Ebraminio claimed this task.
Ebraminio added a subscriber: Ebraminio.

Thank you so much @matmarex, I've found https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui-method-alert (and its siblings and source) good and enough for our need and today most of Persian Wikipedia specific tools are converted to oojs-ui, there is one little issue with it however which is filed as T161959.

…there is OO.ui.alert() / OO.ui.confirm() (which apparently are not really documented other than https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui-method-alert, whoops)…

T158494: Where else should this be documented? Along with the Mediawiki documentation?

(They are also documented at https://www.mediawiki.org/wiki/OOjs_UI/Windows/Simple_messages now, looks like I wrote that just after the comment on this task.)

Ebraminio added a comment.EditedApr 4 2017, 12:45 PM

Another issue: T162127

(on the documentation, the interesting part for me was to pass a jQuery html object that's why I could quickly migrate legacy form elements to it, that probably worth to be mentioned somewhere on the documentation maybe also)