Page MenuHomePhabricator

MediaViewer should adopt mediawiki.router
Closed, ResolvedPublic

Description

Migrated from: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/282

The current implementation of hash handling has some drawbacks:

  • It happens as a complex interaction between the viewer and the bootstrap classes, which is hard to follow, and causes mmv.js hash handling to not work when it is loaded by some other means than the bootstrap. (Also, we use to flags for the same thing, viewer.comingFromHashChange, and the closure scope variablecomingFromHashChange - that is probably unintentional)
  • It has too much low-level detail, mmv.js should be a high-level class coordinating other classes.
  • It is hard to scale; plugins will probably want to interact with the hash.

We now have a standard library used by other extensions - mediawiki.router - that would be better.

We should come up with a better system; probably remove most hash handling from the bootstrap (it should just listen to hash changes while the viewer is not loaded, then once it detects a MediaViewer/... hash, unregister itself,load the viewer and call its hash handler), and come up with some sort of routing system.

Event Timeline

MingleTerminator raised the priority of this task from to Normal.
Tgr added a subscriber: Tgr.
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:29 PM
Restricted Application added a subscriber: Matanya. · View Herald TranscriptSep 4 2015, 6:29 PM

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

Jdlrobson renamed this task from Figure out better place of hash handling to MediaViewer should adopt mediawiki.router.Jul 7 2016, 4:54 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from To Triage to Triaged but Future on the Readers-Web-Backlog board.
MarkTraceur moved this task from Triaged but Future to In Process on the MediaViewer board.
MarkTraceur added a subscriber: MarkTraceur.

Taking this now, as it is a requirement for mobile support.

Change 510804 had a related patch set uploaded (by Simon04; owner: Simon04):
[mediawiki/extensions/MultimediaViewer@master] Adopt mediawiki.router

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

Change 510804 merged by jenkins-bot:
[mediawiki/extensions/MultimediaViewer@master] Adopt mediawiki.router

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

Jdforrester-WMF closed this task as Resolved.Tue, May 28, 6:27 PM