Page MenuHomePhabricator

Make mobile web editor use edit stashing
Open, LowPublic

Description

Using https://en.m.wikipedia.org/w/index.php?title=Steven_Novella&section=5#/editor/5 with Galaxy S4 headers shows no edit stash API traffic, unlike the desktop editor.

The mobile editor should have the same logic as action.edit.stash.js. This would greatly improve page save time for such cases.

Event Timeline

aaron updated the task description. (Show Details)

The HTML for the mobile wikitext editor interface is different from desktop's, so the mediawiki.action.edit.stash module won't work as-is. Since we don't want a module in MediaWiki to know anything about the HTML generated by an extension, we have two options:

  1. Create a copy of mediawiki.action.edit.stash in MobileFrontend, and modify it to work on mobile.
  2. Abstract away the DOM by providing a higher-level API.

We could have a custom event that fires whenever the working copy of an edit is modified, and change mediawiki.action.edit.stash to bind to that event. That way we'd avoid duplicating the business logic.

The key problem here is that the wikitext editor is JavaScript based.

I prefer the 2nd option that @ori has suggested.mediawiki.action.edit.stash.js assumes the editor is already loaded. The stashEdit method would need to be generalised so it doesn't rely on a global data object (BTW what populates that data object?) and the event bindings would have to happen outside that module (or preferably via a hook).

I'm not too familiar with this code but am happy to help out with any MobileFrontend tweaks once the above is done.

Deskana lowered the priority of this task from High to Low.Feb 23 2018, 5:18 PM