Trevor Parscal
46d26b9f22
Added getNodeFromOffset to ce
...
WARNING: This is not as fast as the implementation of getNodeFromOffset in dm
Change-Id: I5fbe9b6edc66169b9caaa6751fde1b7b752814d1
NOTE: ve.ce.getNodeFromOffset and ve.dm.getNodeFromOffset should be renamed to getBranchNodeFromOffset to clarify that they only return branch nodes.
2012-05-30 14:38:18 -07:00
Trevor Parscal
8328fc8786
Removed aliases for node type constants, on the client we have them already in Node
...
Change-Id: Id68dd43930a51a857e73af0215fd215c89e9bbbe
2012-05-30 14:38:18 -07:00
Inez Korczynski
5f9ea545cf
Refactoring and performance optimizations to getOffset method in Surface view.
...
Change-Id: I8b57c9dc069894c82a6bafc5f282aefda505d061
2012-05-30 14:06:44 -07:00
Christian Williams
e216a6f8ab
Fixed scroll jumping when pasting
...
Change-Id: I9607dee6d1b0ca1820a9da5f48966310214e5edf
2012-05-30 13:06:19 -07:00
Christian Williams
11b1bd8884
Using string constants for node types
...
Change-Id: I2d18d4f54c776e299bc10206386b655605dae839
2012-05-30 11:41:31 -07:00
Inez Korczynski
8a52b41076
Working (but dirty) implementation of getOffset, getDOMNodeAndOffset and handlers for keydown/mousedown - to be refactored very soon
...
Change-Id: I57923218fc8e5f3e1cdde339cdc1cb5e859cdedf
2012-05-25 23:52:52 -07:00
Inez Korczynski
e5897dffa4
Merge branch 'dmrewrite' of ssh://review/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-25 23:36:54 -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
Christian Williams
8db39d0bb5
Support for plain text paste
...
Change-Id: I60846900d61b50138fe06dacee4693166e59651e
2012-05-25 16:26:46 -07:00
Christian Williams
64b9b33eec
IE and its silly events
...
Change-Id: I81f46eca20cc5197305cbd355751c4c90e3b670b
2012-05-25 16:12:58 -07:00
Christian Williams
83e7eddfaf
Support for paste
...
Change-Id: Id0a3d5d421aef56eb3296a56d00686ef7d07b433
2012-05-25 15:46:58 -07:00
Inez Korczynski
1e5e14c2c1
Add method hasSlugAtOffset to ve.ce.BranchNode
...
Change-Id: Id107bf890710096bb49111ae3d0d60e3315ecb89
2012-05-25 13:44:12 -07:00
Trevor Parscal
14862a1212
Fixed bug in isStructuralOffset which didn't consider neighboring a non-content leaf to be a structural offset
...
This was caused by the fact that a non-structural leaf can not have children, which makes it appear incompatible as a sibling to an arbitrary structural element (like a paragraph) but since it can not contain content we can check that instead.
Change-Id: Ie3c58b4b43f2aa6921f8f82aa82511e231207854
2012-05-25 13:19:56 -07:00
Rob Moen
7b47af516a
Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-25 12:52:46 -07:00
Rob Moen
61413c49eb
Create base integration core module
...
Works on VisualEditor Namespace
Created VE api wrapper for parsoid service to roundtrip pages
Change-Id: I3f2967730c1a3ece31b7262a46bef31ea8b38613
2012-05-25 12:50:48 -07:00
Christian Williams
80ed03f2a2
Support for copying
...
Change-Id: Icf4665f9c48896e26cb536af033ca55410af49db
2012-05-25 12:02:56 -07:00
Inez Korczynski
8f4f076340
Added handles for mouse events (down, up, move). Implemented method SurfaceView.getOffset and applied significant fixes to SurfaceView.getDOMNodeAndOffset.
...
Change-Id: I06cbfa9e0e7afc7aaf19d5cda8b91fe93aeb51f8
2012-05-24 20:55:45 -07:00
Inez Korczynski
afe18a685a
Fix methods getNearestStructuralOffset and getNearestContentOffset for case of passing offsets that are already structural or content
...
Change-Id: I23cd2daab9cef181b01131b3b9c6ead5ec47f9f4
2012-05-24 20:53:50 -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
Trevor Parscal
ea9191b5b4
Copied CSS styles from ve to ve2
...
Change-Id: Iabd5ee3edde5747952c4b78ef6e9cd5949016050
2012-05-24 15:15:29 -07:00
Christian Williams
0a3b5df6de
Image nodes are not draggable
...
Change-Id: Ie1080045939af7c9b7ac8c30527ad6057fe7e3f6
2012-05-24 15:10:16 -07:00
Christian Williams
88e25e77f2
Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-24 14:47:41 -07:00
Christian Williams
1cc8aca16d
Using invisible space character in slugs
...
Change-Id: I36752f4bea96bad61dedfbbb4fc00422d773227b
2012-05-24 14:47:24 -07:00
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
Trevor Parscal
c9dddf60da
Made getRelativeOffset return -1 if no valid offset is found in document
...
Change-Id: If4cef5fe800b241c3efe1d27cdf01cd1ceef2248
2012-05-24 11:43:47 -07:00
Trevor Parscal
1ddaec8acb
Added getRelativeOffset and several wrappers around it
...
Change-Id: Ifd10922366650165bc4c21ea8cfdd2f9b7163432
2012-05-23 17:43:24 -07:00
Trevor Parscal
541d786ced
Added optional "unrestricted" argument to isStructuralOffset
...
Using this argument will only return true if the offset is a place you can add any element to (hence the unrestricted part of it). This is good for testing if a paragraph could potentially be inserted there.
Change-Id: I6cc91da437c52493de03eb687b28966198270fea
2012-05-23 14:56: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
Catrope
cce32103ff
Implement newFromInsertion()
...
Mostly just wraps around fixupInsertion()
Change-Id: I5c9128439b9ed29b112590c0004a749f9b529346
2012-05-23 12:45:28 -07:00
Catrope
3be3f55c91
Rough first stab at ve.dm.fixupInsertion()
...
This code still needs a lot of work, but it seems to work for most
cases. Things that still need to be done:
* Documentation and comments
* Handling of content and text nodes
** Use Trevor's isContent/canContainContent code which I don't have yet
* Preserve attributes when reopening closed elements
* Tests :)
Change-Id: I3bc16c964ef158693490a61ce12beb21e6fe2a9d
2012-05-23 12:45:28 -07:00
Catrope
9a1ec62f0d
Remove pushInsert() and pushRemove()
...
The 'insert' and 'remove' operations weren't implemented in the
transaction processor and were a holdover from the old DM
implementation.
Also migrated the tests, especially those that asserted that consecutive
insert/remove operations were combined (this is no longer the case now
that they are replace operations)
Change-Id: I2379fe92b331c5316f70f4b695397da41581cce9
2012-05-23 12:45:27 -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
9af03a29b1
Updated demo and fixed HTML converter
...
Removed hard-coding of alien nodes, now aliens are automatically used for anything unknown, and block or inline aliens are selected based on whether the parent element can contain content or not.
Change-Id: I5d2a521ead4f4c96cb44d084a5c160cc20d8048e
2012-05-23 10:15:44 -07:00
Trevor Parscal
86591e5325
Restructured static node rules
...
Change-Id: I7023e1f334694d59767491f1010e7c4c59c0ce54
2012-05-21 17:39:12 -07:00
Rob Moen
0b9411c531
Cleanup Sanxbox.js
...
Change-Id: Id8ba1aacecdbb5d31888e289d23ab03a16346c60
2012-05-21 17:03:57 -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
Rob Moen
7bf15b4377
Copy ui modules to ve2
...
Switch sandbox demo to use new ui modules
Update VisualEditor.php to use ve2 modules
SpecialPageSandbox working
Change-Id: I8261d6bf6ceb6ae7b7bfa5f61aec6a0121906765
2012-05-21 12:39:36 -07:00
Trevor Parscal
c38a552442
Fixed case on mapping to $.toJSON
...
* Also made uses of JSON.stringify use ve.getHash
Change-Id: I05dc0374e05b72c798ae0fd44239e5f8bb45ca52
2012-05-21 12:21:07 -07:00
Rob Moen
272f502693
Modify getAnnotationsFromOffset to account for annotated leaf nodes.
...
Refactor remaining annotation methods
Refactor tests to use correct annotation types
Change-Id: Ia3ce42b3d11296b4d63277e0e2a1997d23236613
2012-05-21 12:02:04 -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
Rob Moen
f19c5917f2
remove hasChildren method as I was using it to debug something on
...
previous commit. change traverseLeafNode test name to follow
ve2 test naming scheme
Change-Id: I8b953e3405f42cd58a80da676ac9b16d64f5e72d
2012-05-18 14:11:23 -07:00
Rob Moen
e4a7a36761
Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite
2012-05-18 13:48:03 -07:00