Commit graph

1480 commits

Author SHA1 Message Date
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 8286508491 Include jquery.json.js in both demos to fix error
Change-Id: Ic5810536317e6de8a23232b602aced877412b1ea
2012-05-21 12:49:14 -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 0a32898f3a Added annotation and attribute tests for transaction constructors
Change-Id: I61e5f37b1f866afc4a3b9a18cd6e7e7a08e0958f
2012-05-21 12:21:07 -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
Rob Moen 3d5da75782 Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite 2012-05-21 11:01:16 -07:00
Gabriel Wicke 7e21b7380a Merge "Round-trip nowiki" 2012-05-21 17:16:56 +00:00
Gabriel Wicke bd30e51b38 Merge "Serializer and table round-tripping improvements" 2012-05-21 16:38:20 +00:00
Siebrand cfac325df5 Merge "Add .gitignore" 2012-05-21 16:25:19 +00:00
Gabriel Wicke fb7d5418a5 Round-trip nowiki
Change-Id: I5f7e6a43f5fdc1708ee710b2a601b20db733452c
2012-05-21 18:06:09 +02:00
Gabriel Wicke a6610e52c2 Serializer and table round-tripping improvements
* added stx: 'html' round-trip information for html tags
* added t_stx: 'row' info for row-wise table wiki syntax, and support for it
  in the serializer
* the first table row is implicit in wikitext
* renamed lastToken to prevToken in serializer
* strip first newline in an initial chunkCB

Change-Id: I014b046539d1b674d830551c5fd1b74a67f81993
2012-05-21 14:59:53 +02:00
Gabriel Wicke e069e7cb1c Merge "Support table captions and properly delimit the end of table options" 2012-05-21 12:51:58 +00:00
Reedy 2b08cf237b Add .gitignore
Change-Id: I48c8b2939ef7c749a9b0a718f77e58238c01889e
2012-05-21 01:50:53 +01: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
Rob Moen 62959bec7a ported traverseLeafNodes and tests to new dm
Change-Id: I98487267d6e3efc9e0c07a02b3d5acc8f8cdb4c6
2012-05-18 13:47:14 -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
Gabriel Wicke 54e75b93b7 Support table captions and properly delimit the end of table options
Change-Id: I15eb8df19528cfceadfee368370501b30f0e36a0
2012-05-18 10:46:43 +02:00
Gabriel Wicke c39eb36968 Use outerHTML to serialize unhandled DOM node in serializer
Change-Id: I37350712c9450c34025740a8d6de51344739c2b7
2012-05-18 10:03:16 +02:00
Gabriel Wicke 3c6d829708 Fix first bug caught by new roundtrip mode for parserTests
Change-Id: Id152fd29606d8ee34ac300945f41e2a5f48f087f
2012-05-18 09:55:22 +02:00
GWicke 5ae2653697 Merge "First pass updating parserTests to verify dom->wikitext serialization." 2012-05-18 07:53:40 +00:00
Subramanya Sastry 9b84e931db First pass updating parserTests to verify dom->wikitext serialization.
- Just a quick first pass updating the parserTests.js script so we can
  test DOM -> wikitext serialization (but which in effect really tests
  roundtripping).
- There is no output normalization yet which is needed for now since we
  are not yet preserving white-space.

Change-Id: Ie52058e0dc3330f852c24fa05641dced19f950e0
2012-05-18 09:51:22 +02:00
Trevor Parscal 4dd9a143ae Added newFromAttributeChange and newFromAnnotation
Change-Id: I1e85ccee3fa1591867fea52359508bfa99bad7df
2012-05-17 15:17:17 -07:00
Trevor Parscal 445006d4a8 Made tests a bit stricter before iterating over annotations
Change-Id: I7c7f11395cfb4ad392bad9380119b647c0c1b629
2012-05-17 14:58:01 -07:00
Trevor Parscal 43d62ee8a7 Refactored getMatchingAnnotations and it's tests, and added offsetContainsMatchingAnnotations
Change-Id: I9098ef8d9c7f3a4f5db112cfdcb9edb7ffd17b80
2012-05-17 14:37:29 -07:00
Christian Williams b78875e8fd oops
Change-Id: I485e6f51c4184c557187f1ef104adc11c3ba3950
2012-05-17 14:12:09 -07:00
Christian Williams e3cfaca6ea New demo for cursor placement
Change-Id: I7740e6e0dfc7ddda8b7062bfcac3900811e8653b
2012-05-17 13:59:45 -07:00
Rob Moen a937ad22f7 Fix getAnnotatedRange to return propper contained range.
Fixed tests

Change-Id: I305eb81644fb3c804455b4fc13bdabcce97ea471
2012-05-17 13:17:18 -07:00
Trevor Parscal 3eb31dae09 Whitespace fixes and removed some console.log statements
Change-Id: Ifcf8a496fb4b649cbf3ce07290b8f6dda60f179d
2012-05-17 11:29:50 -07:00
Trevor Parscal 24c35b853f Whitespace fixes
Change-Id: I691c4e16cf22de8dce0858cdcad522d1f6cfef72
2012-05-17 11:27:25 -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 e8f15204e5 Added skeletons for transaction builders
Change-Id: Iabb2707d20c8b645ffef683f9d8160911c6dc92f
2012-05-17 10:51:01 -07:00
Rob Moen c2a89626d5 Rewrite getMatchingAnnotations to return a hashmap of matching anntations
in the new DM.  Change method name getAnnotationRange from offset to
getAnnotatedRangeFromOffset.  Write tests

Change-Id: I7028803065409e271ceced73e4803954d4a956dc
2012-05-17 10:46:27 -07:00
Subramanya Sastry ae4810b201 Renamed items to itemCount for better code readability.
Change-Id: I53851c07a4746928fddec4b3737136f081d49178
2012-05-17 12:32:46 -05:00
Subramanya Sastry 58da03bc85 Track list prefixes in the list start handler and use them to output
serialized text in list item handlers.

Change-Id: Ic7562d531d2313bedcf3b7450b4f28f02bc2b5a3
2012-05-17 12:12:46 -05:00
Gabriel Wicke 04fc74c76a Strip RDFa attributes in parserTests
We are adding some extra information in those, which should not make tests
fail.

Change-Id: I42cca596330252efeff5d51508f97ef1c566475b
2012-05-17 17:03:44 +02:00
Gabriel Wicke e2815b516c Start to handle links
Change-Id: I1fb975910651820fd889d77152562fd4fbcb5db8
2012-05-17 14:32:56 +02:00
Gabriel Wicke b7fd4498a9 Use single _serializeToken handler for both DOM and tokens
Change-Id: I45e1d90b53a5ddc678f7744f27274bebcfc375fe
2012-05-17 13:20:39 +02:00
Gabriel Wicke 8dbc2f573f Simplistic wikitext round-tripping with parse.js --wikitext
Lists are a bit tricky, as nested lists are not wrapped in a separate list
item. Should work now though.

Change-Id: I2e5f29f6afa6bdd2d5e5c0c5d019b70c611b73d1
2012-05-17 12:44:46 +02:00
Trevor Parscal 58aa0e8137 Whitespace fixes and cleanup
Change-Id: Id2220009ed7af7e895990dd4bb373b43d6089b7b
2012-05-16 20:26:05 -07:00
Catrope bcd7431818 Remove getScope(), no longer used
Change-Id: I79e067a8e6b3eb151d3ebe1dfc3aaebe242aed39
2012-05-16 20:16:47 -07:00
Catrope 80db7a593e Rethink of structural replacement code
Splits and merges now work, or at least the tests for it pass

The strategy I used is to gather the affected ranges for each of the
following:
* removed stuff
* the entirety of each node touched by a non-zero removal
* if the inserted data busts out of its parent, the entirety of that
  parent node (the 'scope')
then get the covering range of all those ranges, and rebuild that.

Change-Id: I7c3b421abc0ba134157ac8b59042675bb1b5073c
2012-05-16 16:48:02 -07:00
Catrope 5e4f0293f2 Add ve.Range.coveringRange()
Change-Id: Ifd9932d7a9f9dae2354fa7aa75cee2e3e639ef42
2012-05-16 16:48:02 -07:00
Catrope 6f4b68274d Rename removeLevel to insertLevel
Change-Id: I339c830547d19af0b04927e1ebccd0468c9e2a20
2012-05-16 16:48:02 -07:00
Rob Moen fbaea888b9 Rewrite data model methods needed for ui tools
getAnnotationRangeFromOffset and offsetContainsAnnotation
which deprecated getAnnotationBoundaries, and getIndexOfAnnotation
write unit tests for proof

Change-Id: I6c0d4e3ca96dd569b1909cd22fce68c3a6fe382c
2012-05-16 15:55:01 -07:00