Break setUpSurface into a bunch of parts that setTimeout() each other.
This breaks the initialization of the editor as a whole up into the
following phases:
0) Receive AJAX response, parse HTML
1) Build linear model data
2) Build DM tree
3) Build CE tree, CE DOM, create surface
4) Initialize surface, some UI initialization
5) Launch sanity check, remaining setup, unlock editor
This is a bit hacky right now, we'll probably want to refactor later.
ve.dm.InternalList.js:
* Allow construction without a dm.Document
ve.ui.Surface.js:
* Allow construction based on a dm.Document
Change-Id: Ibf48a7e85cd7376c8f6205ed165ff57e71e34c35
We currently change <ref name="foo">Foo</ref> ... <ref name="foo">Foo</ref>
to <ref name="foo">Foo</ref> ... <ref name="foo" /> , because know
that the second ref tag isn't canonical and so we blank it.
Instead, we now preserve the contents of all ref tags that come after
the canonical one.
Change-Id: I45a51a879271890fe46c4184f1029f12d27af678
<table>\n\n</table> round-tripped to <table>\n\n\n\n</table> because
we would store '\n\n' in both the innerPre and innerPost fields.
Fixed by not setting innerPost if the element is empty.
Change-Id: I0393bfaf9793fdebc8fff72c8760113fa69bb2bd
The converter wasn't setting .annotations on meta items created to
represent empty annotations, which meant that HTML like
<i>Foo<b></b></i> would end up as <i>Foo</i><b></b> in the linmod.
Change-Id: I13d7d9820beeee1e8c3673e08051361d6c6ac4cd
If you had <meta /><b>Annotated text</b> in a wrapper paragraph,
the converter would swap them and output the linear model equivalent
of <p wrapper><b>Annotated text</b></p><meta />.
This happened because the meta item was queued, and annotations didn't
trigger metadata queue flushes. The fix is to trigger a metadata queue
flush whenever we're about to write something that isn't itself queued.
Change-Id: I168abc0392fbec5503271d1653ee5c38518f857d
Objective:
* Fix issue where async behavior of addTemplate caused templates to be added in the wrong order
Bonus:
* Get rid of special adders for transclusion parts, just construct objects outside and use addPart
Change-Id: Ibe579f033873446376d72d3bd1b9f92d9f361de5
Objectives:
* Use template data for templates added to a transclusion using
the list controls
* Cache template data between different instances of the dialog
* Allow placeholders to be replaced with templates asynchronously
* Save http request and abort pending requests on close
Also:
* Fix breakage of (unused) method getParameterAliases
(dont delete aliases)
* Remove unused method getTemplateSpec.
Bug: 49778
Change-Id: I391e51cb900ef5560455d6f3d4d2a8b99ed2b034
Ed & Roan:
Disable editing of references of which we are unable to find the
source (e.g. <ref name="x"> without a target, or when the target is
currently nested in something we don't yet process such as inside a
<references> block or a template).
Timo:
Improve UI to not be a regular focusable node where the inspector just
won't show up but add a not-allowed cursor and explanatory tooltip.
James:
Fix messages to refer to VisualEditor instead of "the" VisualEditor.
Change-Id: Ib2bca092ce13c9187fa8b27ad6a6404cae02aea2
Objectives:
* Split reference dialog (at least for now) an edit and an insert dialog
* Add reference search widget for selecting an existing source, or
choosing to add a new one
* Abstract reference names, don't allow editing them and generate them
when needed
* When editing groups, move the internal item and update all references
to it
* Resolve name conflicts when moving a reference to a new group by
generating a new list key
Bonus:
* Add getNodeGroups method to internal list
* Add getUniqueListKey method to internal list
* Add destroy functionality to ce.node to release events and references
Bug: 49733
Change-Id: Ib244ff6ad9b4cee1decfd9b9e1d3d4e9cdcfb78c
* Port the class preservation logic from BlockImage to InlineImage
* Add preservation for unrecognized classes
* Add the logic for collapsing spaces in the class attribute in more
places
Change-Id: I26faad7e00ab2f0a0f5d076552e56b32c692ae74
This ensures that attributes and properties that are supposed to be
stripped on copypaste are actually stripped.
Bug: 49307
Change-Id: I8c90f4a0b33acba6eea3180cc077f8dc440e6e7b
We need to normalise titles so 'user:foo_bar' == 'User:Foo bar', and
we also need to some HTML attribute removal as links from Parsoid
will have href and rel set (again, this should be fixed in by Parsoid
when the do the merging at their end).
Bug: 49985
Change-Id: I5fb5bfc69c344ca4ce4803d7b6116074648a8d7e
Use the 'all' mode of SurfaceFragment#getAnnotations to correctly
handle the selections which include linked and non-linked text
in the LinkInspector.
Bug: 50208
Change-Id: I1cab7f3cc4fc9589eced01ad38c59fe5b9622a57
This bug caused all references containing complex content (e.g. links
or templates) to be dirty-DOMed and reformatted by Parsoid.
ve.dm.MWReferenceNode.js:
* Parse the original body.html and check if it's semantically equal to
the new value. If so, don't set it.
ve.dm.Converter.js:
* .normalize() the converter output to remove empty text nodes and
merge adjacent text nodes
ve.dm.example.js:
* Update reused reference test to have body.html absent, not empty
* Add a link to one of the reference tests so this bug is triggered
** The link's attributes are ordered specifically so that toDomElements
will reorder them, at least in Chrome (may behave differently in
other browsers)
** This test fails without this fix in place
Change-Id: Idc091a14422fbb117a3d06fc6bb9497768086fc3
Broke reference insertion because it removed
newFromNodeReplacement(), which is still in use.
This reverts commit 1765e39b40
Change-Id: I043997715474ad4850329ff903eb7a8c61c8b453
HTML like <td><span>Foo<!--bar--></span></td> would lose the comment
when converting to linmod, and so we'd drop the comment when converting
back to HTML.
This happened because we were queueing up meta items to possibly move
them and their whitespace out of the wrapper paragraph even if we were
inside of an annotation and there was no way we could move things out
at all. The fix is simply to detect these case and not queue up meta
items in that case.
[12:11] marktraceur Let the comments hit the floor, let the comments hit the floor
[12:11] marktraceur (to the tune of the Drowning Pool "Let the Bodies Hit the Floor")
Bug: 50071
Change-Id: I5a844e2e0655bc1db152b3805718324ca0bb04df
The UI still needs a simplified version of annotation comparison
so it can clear/set annotations, whereas for serailisation we need
to compare selected HTML attributes (and once Parsoid is fixed,
compare all attributes).
Change-Id: I1a5521a3f51ea373a21cfbc9a007a2381c12f4fe
This was a big gaping DOM diff that's been in there since the beginning,
but which we only found today.
Change-Id: Ie4e791b212ddd3210bc1d5c11308452bb57ae3ce
Remove enableAboutGrouping from GCNode and move it to the subclasses
so we can have GCNodes without grouping.
Having matchTagNames there doesn't make sense now that GCNode is a
mixin rather than a base class.
Also removed unused .static.generatedContent property.
Change-Id: I2b5350e70b7829cf009c752d066919e5a3593db0
Build the new set of classes as an array (avoiding the leading space),
and only set it if it differs from what was there before. This avoids
reordering the class attribute.
Change-Id: I863ec8de2e7637f76690c4e0b7db5e153fb7e408
Prevents changing of DOM attributes on unmodified transclusions
as they can clash in the store.
Also use 'original' over 'orig' consistently.
Bug: 50079
Change-Id: Ib13bb206c49b1f5b186e40632a5c109def0f042e
Previously we were just passing a slice of the visible data, instead
of using getFullData.
Bug: 50059
Change-Id: I3bbea49132ef4a720a147ba9b170c39a0c00f711