Commit graph

23 commits

Author SHA1 Message Date
Inez Korczynski 1a4e488b06 Merge branch 'dmrewrite' of ssh://review/mediawiki/extensions/VisualEditor into dmrewrite 2012-05-09 22:40:51 -07:00
Inez Korczynski ee39e837b8 Get Alien node (leaftnode) working - it reads its content from attribute
'html'

Change-Id: Idd84da9af61369277df18fee577032de765b1205
2012-05-09 22:36:25 -07:00
Trevor Parscal 1798a478e7 Massive refactor of node trees, generalizing lots of previously dm only stuff
Change-Id: I9dbb7094f86338ea2e725ad29f66e9e4ca2b52ed
2012-05-09 21:11:09 -07:00
Trevor Parscal e34ec4b479 Added canHaveChildren and canHaveGrandchildren to all nodes
Change-Id: Ibe53292f7269736750e03da49e5bb5913c0124ab
2012-05-04 17:50:54 -07:00
Trevor Parscal dc27d8acb4 Refactored dom wrapper functionality in ce nodes
* Moved implementation of getting and updating a DOM wrapper to ve.ce.BranchNode
* Updated ve.ce.BranchNode tests
* Renamed ve.NodeFactory.createNode to ve.NodeFactory.create
* Added  ve.NodeFactory.lookup which gets the constructor of a type
* Added attribute pass-through to ve.dm.BranchNodeStub

Change-Id: I8f5b7d3d3ae616cc5f39828b24b655163d782ae5
2012-05-04 13:31:14 -07:00
Trevor Parscal 9887dbd96f Split Broke DefinitionListNode out of ListNode and DefinitionListItemNode out of ListItemNode
* Makes it simpler in the linear model because we don't have to use style: "item" for regular list items and style: "definition" for definition lists
* Enforces correct nesting through existing node rules systems
* Updates tests accordingly

Change-Id: I64d80af938e325f1961226505bdc386bb35ccdda
2012-05-04 11:56:32 -07:00
Trevor Parscal a9b26c8b55 Removed recursive rendering calls in favor of 100% event driven updates
Change-Id: I636222518e4cbeddb1c02901b79a9dcb09eeb952
2012-05-03 17:19:01 -07:00
Christian Williams 99e841d31a Making document contenteditable
Change-Id: If79bb8c69431e07de2a42cc5b565b3093c29c4cd
2012-05-03 15:42:02 -07:00
Inez Korczynski d01d27cc09 Get more tags/nodes working in the demo
Change-Id: I5335fbbe15d010a73a06f24bc56ebb3c3c6bd2d7
2012-05-03 15:00:34 -07:00
Inez Korczynski 619f10108c Minor fixes to getHtml method in TextNode
Change-Id: I53c873b6e307d53cc87c2e111ab99f694972b17b
2012-05-03 11:11:46 -07:00
Inez Korczynski a1db1537ad Minor fixes to getHtml method in TextNode
Change-Id: I4d0b1a0295071ead413d68945310d3a4ef6fe7e4
2012-05-03 10:11:39 -07:00
Inez Korczynski 09c7393901 Minot fix
Change-Id: If10f9135f9bf33af17be6f8a2db59433d9898944
2012-05-02 22:32:34 -07:00
Inez Korczynski a3b32b6615 Big refactoring to TextNode to make it work with new format of storing
annotations.

Change-Id: If84fcfdd04ff42e9b2449e1c8186d64fec4fb1ac
2012-05-02 22:28:57 -07:00
Inez Korczynski 9f11f437d2 Merge branch 'dmrewrite' of ssh://review/mediawiki/extensions/VisualEditor into dmrewrite 2012-05-02 19:29:49 -07:00
Inez Korczynski d81b972cdf Very dirty but working version of getHtml method for TextNode (with bunch
of tests that are passing now).

Change-Id: Ie76bd59bc0a5e10e2a3b3e014b2d0e4701fcc368
2012-05-02 19:29:03 -07:00
Trevor Parscal 947c3ddf22 Fixed incorrect class name for method typo
Change-Id: I82390896ef7136bfc8ed8734d8bd9014e756af5e
2012-05-02 15:59:15 -07:00
Inez Korczynski ff40652099 Get rid of range parameter in ve.ce.TextNode.prototype.getHtml as it is
not being used anyway.

Change-Id: I7c54d35001fa0db6d7ab9d12f35ab2d841016f0d
2012-05-02 14:21:41 -07:00
Inez Korczynski dd6094842e Created a test file for ve.ce.TextNode and fixed some minor issues.
Change-Id: Ifbf6b7ba2a27eedf6d5d4f6cb06b98c38eb52c5b
2012-05-02 14:18:02 -07:00
Trevor Parscal fd28fff50f Added test for replaceDomWrapper and onSplice in ve.ce.BranchNode
* Also fixed calls to addListenerMethod
* Also routed adding children in the constructor of ve.dm.BranchNode to the splice method
* Renamed types of ve.dm stub nodes to avoid collisions (since we have to register ce nodes by the same names for them to be generated by onSplice)

Change-Id: Ia2e75cf0a62186cc0e214683feb25c619590318a
2012-05-02 13:58:50 -07:00
Trevor Parscal 1d94af144a Added update handlers to heading, list, list item and image ce nodes
* Also renamed convertDomElement to replaceDomWrapper in ve.ce.BranchNode
* Also added extra documentation for node rules

Change-Id: Ia8ac6be34e2b021be96974ac1ba9119bd8077d60
2012-05-02 11:30:37 -07:00
Trevor Parscal 94f53dc6c7 Made text nodes not rely on a wrapper
By using this.$ as a selection of contiguous top-level nodes (text or otherwise) we can avoid wrapping each text node in a span

Change-Id: I141c2df8f13646db3fff0da93d218c2dcf154c8a
2012-05-02 10:58:14 -07:00
Trevor Parscal 370070dfa2 Lots of ce porting, got text nodes fully supported
* Fixed constructor of ve.ce.BranchNode which was calling the wrong method to perform an onSplice and with the wrong arguments
* Removed/renamed events emitted from ve.ce.BranchNode.onSplice
* Reintroduced .$ to all ce nodes
* Ported over functionality for DOM node type variance used in headings, lists and list items
* Moved the old ve.ce.Content guts to ve.ce.TextNode
* Added getOffsetFromNode and getDataFromNode to ve.dm.DocumentFragment
* Added setDocument and getDocument to dm nodes

Change-Id: I185423ba2f1a858dde562cb2f5bc3852aec930db
2012-04-30 19:38:42 -07:00
Trevor Parscal 35af704173 Added initial ce nodes
Change-Id: Ibdcb4502a8fdc5b1a6c22ae0e9c42c86b3a7d4dc
2012-04-30 17:36:22 -07:00