mediawiki-extensions-Visual.../modules/ve
Catrope 54a232a92b Allow nodes to handle their own children
For data->DOM, this is easy: .toDataElements() can optionally return an
array instead of an object, and that will be treated as the data to
insert. If this happens, the converter won't descend. The node handler
can recursively invoke the converter if it needs to (although I suspect
the current implementation is broken when converting block content in an
inline context).

For DOM->data, this is a bit more complex. The node sets
.static.handlesOwnChildren = true; , which triggers the converter to
pass a data slice rather than a single data element, and not to
descend. The node handler can invoke the converter to recursively
convert DOM subtrees to data.

ve.dm.Converter (data->DOM):
* Renamed createDataElement() to createDataElements()
** .toDataElement() may return element or array, handle this
* Renamed childDataElement to childDataElements, is now an array
* Actually alienate if .toDataElement() returns null
** Shockingly, this claimed to be supported before but wasn't
* Rather than pushing to data, concat to it
** Add closing if needed
* Don't descend if .toDataElement() returned an array of length >1, or
  if the node has .handlesOwnChildren = true

ve.dm.Converter (DOM->data):
* Split getDomSubtreeFromData() and getDomFromData()
* When converting a node that handles its own children, pass in a data
  slice and skip over that data

Change-Id: I196cb4c0895cbf0b428a189adb61b56565573ab3
2013-04-11 22:41:18 +00:00
..
actions No more confusing boolean argument for closing windows 2013-04-10 12:31:49 -07:00
ce Image node refactor 2013-04-10 14:56:08 -07:00
dm Allow nodes to handle their own children 2013-04-11 22:41:18 +00:00
init Add ve.ce.View as a common base class for ce.Node and ce.Annotation 2013-04-09 12:05:05 -07:00
styles Toolbar style fixes 2013-03-15 12:48:49 -07:00
test Image node refactor 2013-04-10 14:56:08 -07:00
ui Dialog button changes 2013-04-10 12:34:52 -07:00
ve.Action.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.ActionFactory.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.BranchNode.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.CommandRegistry.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.debug.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.Document.js Emit a transact event on the ve.dm.Document when a transaction occurs 2013-03-14 23:35:50 -07:00
ve.EventEmitter.js Fix documentation to place @emits in the correct place 2013-03-25 21:06:05 +00:00
ve.Factory.js Remove more periods 2013-03-20 22:55:50 +00:00
ve.js Fix for custom hash with keys in different order 2013-04-09 00:20:44 +01:00
ve.LeafNode.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.NamedClassFactory.js Rename ve.NodeFactory to ve.NamedClassFactory 2013-04-09 12:05:05 -07:00
ve.Node.js Move common Node/Annotation/MetaItem code into ve.dm.Model 2013-04-09 12:05:05 -07:00
ve.Range.js Clickable inline images 2013-04-08 17:58:46 -07:00
ve.Registry.js Document and clean up events in all the things 2013-03-20 09:58:27 -07:00
ve.Surface.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.Trigger.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.TriggerRegistry.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00