Commit graph

45 commits

Author SHA1 Message Date
Trevor Parscal 722c30466d Got rid of wrapping whitespace (like \n and \t) in a span that made text white
This was causing some issues when you started typing there, and it's not clear that the white text is really the best way to go anyways

Change-Id: I8a9d6571ea204603729e96b7ff77184279a31a95
2012-06-12 10:40:44 -07:00
Christian Williams 1e4c52237c Enter key handling
Change-Id: I1b5f901a542328c3ae7c19a5cd816112dcac4042
2012-06-11 19:40:09 -07:00
Trevor Parscal 21ff108c28 Bring link converter in line with Parsoid
Parsoid outputs rel="mw:wikiLink" or rel="mw:extLink", so we convert that to link/wikiLink and wiki/extLink respectively.

Also preserve the data-mw attribute; we probably need to do this more generally but this'll do for now.

Change-Id: I32e570bffa5a73a733a120d52cfd8b75d3191e02
2012-06-11 00:36:20 -07:00
Trevor Parscal c40dd953ca Remove stray debugger statement
Change-Id: Ie7c37e658d6d6bc15d5d7c24b2f5cd13945c5243
2012-06-11 00:33:13 -07:00
Trevor Parscal 2e1b304a48 Cleaned up styles for editor in both demo and sandbox/integration
Change-Id: I9b4a3727fd04b3c3ff3f297c6656db2592856173
2012-06-08 16:20:37 -07:00
Trevor Parscal 89b2260bfc Revert "Support for basic text insertion - typing"
This reverts commit 21056ff5ec.

Change-Id: I86bb28d868b2c931f4b6e18ba5023a8a75b40231
2012-06-08 15:54:05 -07:00
Inez Korczynski 21056ff5ec Support for basic text insertion - typing 2012-06-08 15:31:29 -07:00
Trevor Parscal 402d6dc53a Added rendering for link/unknown
Change-Id: I47cdc8679c533f15059b290bf30ae74518dce724
2012-06-08 15:15:43 -07:00
Trevor Parscal 2e0d4ef094 Make tableCell represent both <td> and <th>
Adding a 'style' attribute which is set to either 'data' or 'header'

This breaks even more tests because of missing style attributes

Change-Id: I0a75d8c1578b4414eeae8c484f6c4d6f8a59472a
2012-06-08 12:27:22 -07:00
Trevor Parscal c614d3391b Add ve.dm.TableSectionNode and ve.ce.TableSectionNode
Yes, this breaks a bunch of tests, because tableRows are now required to be inside tableSections

Change-Id: Idb52d988df69173647c85f7602344650456e078e
2012-06-08 12:26:45 -07:00
Trevor Parscal 18461387c0 Roan officially does not owe the team lunch (at this precise moment)
Change-Id: I90a6198da97ea90f60d9668c21d7386984a03ff0
2012-06-07 11:33:58 -07:00
Christian Williams 77d5cae575 Consecutive spaces
Change-Id: I3f51ce0a2ee0a78e56c55de94bd45796b400680d
2012-06-06 16:29:02 -07:00
Trevor Parscal e7f03c6d70 More cleanup, removed ObjectAnnotation (they are inline elements now)
Change-Id: I2c53c145eed1a801392c954001de7641f928216c
2012-05-31 17:18:28 -07:00
Trevor Parscal f6864b0c04 Changed use of "factory" to "nodeFactory" to make way for other kinds of factories
Change-Id: I96db0f28bb220f1c3b23990824e9523278cb8f9b
2012-05-31 15:20:58 -07:00
Inez Korczynski e9230968fe Set contenteditable=false for Alien wrappers (both inline and block)
Change-Id: I5fd8fcfd0b6d98b525a75b3818cc77e3aca833c9
2012-05-25 23:36:18 -07:00
Inez Korczynski b56b6bad6d Just for purpose of testing add some hardcoded border and cellspacing to all tables
Change-Id: I97ff937d7e7d6a91ee3f411d7f77d5e3798ba567
2012-05-24 20:51:31 -07:00
Inez Korczynski 6017050b3f Add class ve-ce-imageNode to all image nodes, also comment out mousedown event handler
Change-Id: I7565d8822bbe0547e731df1859cdde4ac78de6f2
2012-05-24 20:50:36 -07:00
Christian Williams 0a3b5df6de Image nodes are not draggable
Change-Id: Ie1080045939af7c9b7ac8c30527ad6057fe7e3f6
2012-05-24 15:10:16 -07:00
Christian Williams 32b9ccd0bf Moving alien node styling to CSS file
Change-Id: I21e4593b81669b48cec831236398866f89616f9a
2012-05-23 12:03:28 -07:00
Trevor Parscal 86591e5325 Restructured static node rules
Change-Id: I7023e1f334694d59767491f1010e7c4c59c0ce54
2012-05-21 17:39:12 -07:00
Trevor Parscal 08765feab3 Merged ve.dm.DocumentFragment and ve.dm.Document
* Also fixed lots of whitespace issues and some global variable introductions

Change-Id: Ia6c82ef0c3b5c4938cf72afa86da6d79e4cb385a
2012-05-17 11:23:56 -07:00
Trevor Parscal e0de881a8a Removed trailing whitespace in multi-line comment blocks
JSHint and various git tools complain about this, so let's just do away with them altogether

Change-Id: I731866bd21f1ee0088fb0a71df3abf92692aca23
2012-05-14 15:05:09 -07:00
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