Move code specific to page editing out of ve.init.mw.Target
Closed, ResolvedPublic8 Story Points

Description

Right now, Flow doesn't use ve.init.mw.Target because its multi-surface support isn't as good as sa.Target's, and mw.Target contains a lot of code Flow doesn't need (because mw.Target assumes you're only editing one page, rather than a multitude of non-page things). However, there are a number of things in mw.Target that Flow could and should benefit from (e.g. getHtml for T97165: Flow doesn't strip browser plugin garbage or fixBase and related functionality for T96492: Previewing a link to a File in Flow's VE-mode, opens a broken destination due to /w/ ). So we should split MW-specific code (in ve.init.mw.Target) from "MW page editing-specific code" (in ve.init.mw.PageTarget or something?)

Catrope created this task.Apr 24 2015, 8:00 PM
Catrope updated the task description. (Show Details)
Catrope raised the priority of this task from to Needs Triage.
Catrope added a subscriber: Catrope.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptApr 24 2015, 8:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 258158 had a related patch set uploaded (by Esanders):
Rename mw.Target to mw.ArticleTarget

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

Change 258158 merged by jenkins-bot:
Rename mw.Target to mw.ArticleTarget

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

Flow/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js:		ve.init.mw.Target.static.fixBase( htmlDoc );
Flow/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js:		// Based on ve.init.mw.Target.prototype.setupSurface
Flow/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js:		ve.init.mw.Target.static.fixBase( htmlDoc );
Flow/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js:		ve.init.mw.Target.static.fixBase( htmlDoc );
 Flow/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js:		// Based on ve.init.mw.Target.prototype.setupSurface
 Flow/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js:		ve.init.mw.Target.static.fixBase( htmlDoc );

https://gerrit.wikimedia.org/r/#/c/258174/ for the fix.

Change 258452 had a related patch set uploaded (by Esanders):
[BREAKING CHANGE] Create ve.init.mw.Target base class

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

Would this be a blocker of T48580?

Change 258452 merged by jenkins-bot:
[BREAKING CHANGE] Create ve.init.mw.Target base class

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