Page MenuHomePhabricator

Add JS component in Core for fullscreen handling
Closed, DuplicatePublic

Description

MediaViewer has some fullscreen-handling code which would have a better place in core. Something very simple, just to abstract away browser prefixes - something like $.fullscreen.isSupported() / $.fullscreen.isActive() / $.fullscreen.request() / $.fullscreen.cancel() / $.fullscreen.toggle(), plus triggering the fullscreenchange event if the browser does not support it, plus maybe adding a top-level class.

Docs: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode

Details

Reference
bz57297

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:26 AM
bzimport set Reference to bz57297.
bzimport added a subscriber: Unknown Object (MLST).

Tisza: Wondering if this might be a good candidate for Google Code-in, or if this is too complex? See https://www.mediawiki.org/wiki/Google_Code-In

It would be a good candidate. The task itself is very simple, (a few dozen lines of javascript which can be pretty much copy-pasted from the above MDN link), you just have to find your way around ResourceLoader (and gerrit etc).

Change 110883 had a related patch set uploaded by AalekhN:
jquery.fullscreen.js: Includes toggle handler in jquery.fullscreen

https://gerrit.wikimedia.org/r/110883

matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).
matmarex subscribed.

(The patch has been abandoned.)

I think this can be closed - fullscreen handling was split into an external library (T58477 / github:theopolisme/jquery-fullscreen), whether or not it's in core matters little after that.