Trevor Parscal
f6eef19021
Added copying of .data( 'node' ) from old wrappers to new wrappers on wrapper updates
...
Change-Id: Ibd9535bd9ebb712910d963eedc5941f8512aaf8d
2012-05-24 14:01:42 -07:00
Trevor Parscal
c8ccdb9813
Moved ve.ve.BranchNode.canNodeHaveSlug to ve.ce.Node.prototype.canHaveSlug
...
Change-Id: I6d5d9ca5a1c9878acb15e9526feb94986822b491
2012-05-24 14:01:17 -07:00
Trevor Parscal
ebfafac3e2
Added missing documentation to methods in ve.ce.BranchNode
...
Change-Id: If6833e3d639e0455025762987b7f41a43892ca4a
2012-05-24 13:22:57 -07:00
Christian Williams
933ff678a4
Focus can now be set in slugs using showCursor or showSelection.
...
Change-Id: I12ab361a30d277a4752579bf885fd37bc46b32ed
2012-05-24 13:18:30 -07:00
Trevor Parscal
3ce705313e
Replaced static array with real logic inside of ve.ce.BranchNode.canNodeHaveSlug
...
Also added more static config getters and fixed some typos in prototype definitions
Change-Id: Ib9093a625b944e6a4ca4da50c51fb475b5895b8d
2012-05-24 13:12:45 -07:00
Trevor Parscal
e150ba2e54
Moved "is slug gable" functionality to a static method of ve.ce.BranchNode
...
Also optimized some query stuff
Change-Id: I5675258c6e276a1ba410dcf1ee111392140a04eb
2012-05-24 11:58:33 -07:00
Inez Korczynski
fe1482e0c4
Added method proxy to ve.ce.Surface
...
Change-Id: I2373df4c738b49685a897c8e13acebdd7ccb3e00
2012-05-23 13:34:52 -07:00
Inez Korczynski
bea881daca
Refactor mechanism of adding slugs in before and after particular nodes in branch
...
Change-Id: I8b3f4a9b27ff09d569f366c32f96e7e8191487c0
2012-05-23 13:24:49 -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
Rob Moen
95e06e96bf
Prepare for MediaWiki integration
...
Create context instance in surface.
Move over getSelectionRect into ce.surface
Cleanup ve.surface contstructor class
Move linmod/html test objects to sandbox.js
Change-Id: I0cf602ef991100bf6128c68750b02a00566911dc
2012-05-21 16:06:30 -07:00
Christian Williams
b7afcff62a
Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-18 15:20:01 -07:00
Christian Williams
6d15028c68
Making showCursor work again!
...
Change-Id: I97e1570ffba368e570b69085daa2798b8b2725f9
2012-05-18 15:19:31 -07:00
Inez Korczynski
19a02f3798
Disable objectResizing and inlineTableEditing within execCommand
...
Change-Id: I06406bfd56e01e72b157fd8cb50da8d6173edc25
2012-05-18 11:40:22 -07:00
Inez Korczynski
32c2366dca
Logic for adding 'slugs' before, after and between nodes in certain cases
...
Change-Id: I91a1c58bdb7819503a9eb24221d6a358c804b57e
2012-05-18 11:34:07 -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
Trevor Parscal
d4363c04f4
Don't set classes on non-wrapped elements
...
* Text nodes do not have a wrapper to set classes on
* Use CSS class names that are equivalent to JS class names, swapping . with -
Change-Id: I49c877dd5c9b5dd2a9afad3137f12b14883043a1
2012-05-10 14:54:33 -07:00
Inez Korczynski
41a7451ea2
Store reference to view node (ve.ce.Node) in jQuery data of it's wrapper
...
Change-Id: I84920b20346b4ef5e1203d834bf4c3fb9657ae69
2012-05-09 22:43:46 -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
Inez Korczynski
bab1a9672c
Fix method getDocument in dm.Surface and start using it
...
Change-Id: I613b1e938cd0d8f3a6ac8a48121901287c8fc5af
2012-05-04 15:20:14 -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
d2480baed0
Removed bubbling update events in dm and ce node trees and splice events from ce branches
...
The bubbling update events are not needed with ce or dm, but were once upon a time useful for es, this just eliminates some unused cruft that was costing extra function call overhead.
Change-Id: Ia16d0f4cd74c84cded5caecada33ee83d0882f30
2012-05-04 12:28:32 -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
Rob Moen
0cd31fba2e
rename surfaceModel to model in ce.Surface
...
Change-Id: I5d49915b4645464729ab1e4552982cbd38f712b1
2012-05-03 16:14:54 -07:00
Rob Moen
bead2050b9
Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-03 16:04:47 -07:00
Rob Moen
da65ad48c8
- extend surface model and surface view with event emitter
...
- added surface view base methods
- enabled toolbar in ve.Surface
Change-Id: Ib6a62ef2509712f812f262283c45bb30c8f97ef1
2012-05-03 16:02:21 -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
6224c60075
Rendering works in very basic version
...
Change-Id: I8789860fe82f2e7db1e503889e20ce51de57bfa2
2012-05-03 14:02:35 -07:00
Trevor Parscal
7b7ff5a503
Added ve.dm.Surface, ve.ce.Surface, ve.ce.Document
...
Change-Id: I382730e1a9f1abcb4b42499267c8dcaf76fc64e1
2012-05-03 13:21:13 -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
b7b2fc1179
Made render for ce leaf nodes abstract and added a test for it
...
Change-Id: Iee228d5f1a18a5c9618680fa81ab132a85472fa6
2012-05-02 15:59:43 -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
8bd0d385eb
Added test for whitespacePattern, getDomText and getDomHash in ce
...
* Also fixed some naming typos in the units under test
Change-Id: I17f753a122f94dd16f7783f60b5c0eb1c6d3e480
2012-05-02 12:54:42 -07:00
Trevor Parscal
676ffa4dbc
Ported getDomText and getDomHtml from ve to ve2
...
Change-Id: I3547d95c2749543eae745722ceddaa0a969e4e80
2012-05-02 12:28:27 -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
Trevor Parscal
c2d4a2d928
Added basic ve.ce nodes
...
* Also removed beforeSplice and afterSplice in favor of just plain splice which is the same as afterSplice used to be - beforeSplice was never used and it was making things more complex looking than needed
Change-Id: Icbbc57eac73a2a206ba35409ab57b3d1a49ab1a5
2012-04-30 16:58:41 -07:00
Trevor Parscal
aaa322642b
Added ve.ce.NodeFactory and tests
...
Also added tests for initialization of factories at ve.ce.factory and ve.dm.factory
Change-Id: Ic6ac74aab86ecdfd4f094d9bb1fa16de930387b7
2012-04-30 16:36:02 -07:00