Commit graph

187 commits

Author SHA1 Message Date
Inez Korczynski a62e78292f Add slugs inside empty branch nodes so cursor can be correctly placed.
Change-Id: I075a76da50bd4927c3832a660fdf96bbd250e3b0
2012-06-20 18:18:49 -07:00
Christian Williams 93594d1c22 Pressing backspace or delete at boundary of dislike nodes will cause adoption
Change-Id: Idd6cd40c8d4f34081851fc9ea1cc70037915244b
2012-06-20 16:28:13 -07:00
Rob Moen 4b8833942c If user is anonymous, mw.page.watch is not loaded. Only call
method if module is loaded.

Change-Id: Ieb549b701f05f1dab322baa79d59366225f42727
2012-06-20 16:22:10 -07:00
Trevor Parscal 5968991d25 Broke the grouping functionality of ve.ui.ListButtonTool.list method into ve.Document.getCoveredSiblingGroups
Also fixed unlisting to not break when unlisting a range that includes things that are not list nodes

Change-Id: Ib9d4ea851c3ed9bf72a93aa87e470ce40c308453
2012-06-20 15:49:41 -07:00
Inez Korczynski bbaa17a6c4 * Replace spaces at the beginning and at the end of text node with  
* Alternate double spaces with &nbsp, "  " -> "  "

Change-Id: Ib4351ed6263e69f0d98957c2d0d8411e040fece7
2012-06-20 15:32:14 -07:00
Rob Moen 8178237c27 Update list tool updateState method so that if you have nodes not
contained by a list node the button is off.  Button is now only toggled on
if all nodes in selection have a parent list node.
Patchset 2 - cleanup whitespace
Change-Id: Ia9adc39c0d5c75e2e96580f0e172f5b602540ac3
2012-06-20 15:12:08 -07:00
Catrope 37600d020c Add ve.dm.Transaction.translateOffset() and translateRange()
Change-Id: I21bde38056862a1de167646f6cf3030e38d3497b
2012-06-20 14:52:44 -07:00
Rob Moen cc47a4d05c Add Hook for 'watch' event triggered on MW watch link or icon
to update save dialog checkbox with correct watched state.
Call mw.page.watch.updateWatchLink onSave to refresh icon
with watched state.
Patchset 2- updated event name
Change-Id: I23ef1aad9c8ace13df1b9a6bf0bfeddb9d8bcb37
2012-06-20 13:05:56 -07:00
Catrope 3877a0d58d Merge "Rewrote listification" 2012-06-20 19:39:28 +00:00
Trevor Parscal 5df5d8470a Rewrote listification
Now handles wrapping or converting properly, in any combination

Change-Id: If8b573f576555c9129f8316bc9f06557eda06e85
2012-06-20 12:39:03 -07:00
Trevor Parscal d429113eb8 Merge "After creating a page, refresh the page rather than going back" 2012-06-20 19:35:42 +00:00
Trevor Parscal bcf93eb695 Automatically bind and unbind context's window event bindings on documentNode focus and blur
Change-Id: Ie43165da49a36a7d0d13a52318d9c5438dad9605
2012-06-20 12:34:20 -07:00
Trevor Parscal 7a1d74fd18 Change state variable so updates work more than once
Change-Id: I7c701761b09e96e01e26164080d22cafe43019e0
2012-06-20 12:28:01 -07:00
Catrope 427406a0bc After creating a page, refresh the page rather than going back
We can't go back in this case because the action tabs etc. will be wrong

Change-Id: I8e26c43b7735ea8a2ef010bd4141f0ee8d4b1c68
2012-06-20 12:16:27 -07:00
Catrope 9f5f43f18a Fix residual selectNodes() breakage from fc4ba3019a
Change-Id: Icc317eab71d4e360905e902a0ae7cc88deab4cbe
2012-06-20 11:39:20 -07:00
Rob Moen b9eb06349f Switch path from ve2 to ve help with Dmrewrite merge
Change-Id: I8fbbfcb3e47a9319398af7262effc1f7cf3df51f
2012-06-20 10:49:00 -07:00
Catrope 6afed5e5cc Move ve2/ back to ve/
Change-Id: Ie51d8e48171fb1f84045d1560ee603cee62b91f6
2012-06-19 18:20:28 -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
Christian Williams 32b9ccd0bf Moving alien node styling to CSS file
Change-Id: I21e4593b81669b48cec831236398866f89616f9a
2012-05-23 12:03:28 -07:00
Rob Moen b05347ac4e removed margin-top for documentNode
Change-Id: I6e888ca858bc2d9e6772150715b10ab157f84b46
2012-05-03 16:07:51 -07:00
Trevor Parscal f1505a0e62 Merge remote-tracking branch 'origin/master' into dmrewrite
Change-Id: I43a3cd999ec0a5d3d05ee1e5bb71c450d485bc01
2012-05-02 10:17:44 -07:00
Inez Korczynski d6ae8390f5 Get rid of selectionDirection. Introduce getDirection() methdo in
ve.Range.

Change-Id: Iaf11b2dbfb7ae82a7f54ee205cd6cdc8ee235aef
2012-04-27 17:36:55 -07:00
Inez Korczynski af6a9f9ccc Created a named method inside a Surface (instead of anonymouse one) to
handle logic for rangeChange event handler.

Change-Id: Ief32e647f9399e3ea47c5613902cebcbaaf4874c
2012-04-27 17:31:49 -07:00
Trevor Parscal f19897fefa Merge "Build out ve.Surface constructor to support multiple editor instances Now setting up multiple toolbars per config Tools & Modes are now configurable per toolbar per instance Base elements are created on demand and no longer id specific Note: There are some bugs with multiple instances." 2012-04-27 21:01:10 +00:00
Inez Korczynski f188772259 Introduce new method called "proxy" in surfaceView to avoid using the same
construct with anonynous function over and over.

Change-Id: I1e96cf1efaa6fa5d551fdfa8bb5a80c31e519579
2012-04-26 14:49:12 -07:00
Rob Moen 94479bd79d Build out ve.Surface constructor to support multiple editor instances
Now setting up multiple toolbars per config
Tools & Modes are now configurable per toolbar per instance
Base elements are created on demand and no longer id specific
Note: There are some bugs with multiple instances.

Change-Id: Id0bbbca2d1b76fd2db3f3b0f9abd90194930b610
2012-04-26 11:56:47 -07:00
Demon 5feb5ebcbf Merge "Fix typo" 2012-04-25 14:51:47 +00:00
Trevor Parscal 8ce68e1ac8 Merge "Modify rangeChange event to save selection direction. Renamed Selection method to more suitable name. Misc cleanup Patchset 2, whitespace cleanup Patchset 3: Change values used with selection direction to -1 or 1 1 for left to right (normal) -1 for right to left (opposite) Change-Id: If9ecc721ace1c7550903170f92395947f1ccc22c" 2012-04-20 23:29:21 +00:00
Rob Moen 5fc9f1c7e4 Modify rangeChange event to save selection direction.
Renamed Selection method to more suitable name.
Misc cleanup
Patchset 2, whitespace cleanup
Patchset 3: Change values used with selection direction to -1 or 1
1 for left to right (normal)
-1 for right to left (opposite)
Change-Id: If9ecc721ace1c7550903170f92395947f1ccc22c
2012-04-20 16:27:26 -07:00
Trevor Parscal 29d1ebeca7 Merge "Put a space in the toolbarDropdownTool-label div for default Addresses dropdown tool ui inconsistency on load" 2012-04-20 22:56:36 +00:00
Rob Moen 8398696fe0 Put a space in the toolbarDropdownTool-label div for default
Addresses dropdown tool ui inconsistency on load

Change-Id: I855ac15e939fa895adb67daaeb45aadbac01f10b
2012-04-19 15:31:09 -07:00
Rob Moen 1a68c42049 Modify VE constructor to have the default set of tool configuration
Configuration options are to extend base options in the constructor.

Change-Id: Ic430a6489d8cf9a703e374c3f416feaf0e3d2521
2012-04-19 15:14:57 -07:00
Trevor Parscal 7ea475ebcf Initial commit of data model rewrite
Ground-up rewrite of the data model. Putting this in the ve2 directory for now so we still have the old code floating around.

Main changes so far in this rewrite:
* Renamed hasChildren() to canHaveChildren()
* Added canHaveGrandchildren()
* Added a new node type TwigNode that can have children but not grandchildren (so all of its children must be LeafNodes)
* Implemented push/pop/shift/unshift as wrappers around splice()
* Renamed getElementType() to getType(). Nodes now take a string as a type, and the element stuff is gone and won't be back
* Removed clearRoot(), replaced it with setRoot( this ) where needed

Change-Id: I23f3bb1b4a2473575e5446e87fdf17af107bacf6
2012-04-19 13:54:34 -07:00
Catrope 4b6e1401a3 Fix typo
Function was renamed but error message wasn't updated

Change-Id: I61a9effa8dedcbdbc75c5c6842fb05f909561327
2012-04-16 12:20:16 -07:00
Trevor Parscal 387b3160ca Merge "Add and update an offset map in DocumentNode" 2012-04-13 23:48:57 +00:00
Catrope 7465b670e1 Add and update an offset map in DocumentNode
This has some TODOs still but I want to land it now anyway, and fix the
TODOs later.

* Add this.offsetMap which maps each linear model offset to a model tree node
* Refactor createNodesFromData()
** Rename it to buildSubtreeFromData()
** Have it build an offset map as well as a node subtree
** Have it set the root on the fake root node so that when the subtree
   is attached to the main tree later, we don't get a rippling root
   update all the way down
** Normalize the way the loop processes content, that way adding offsets
   for content is easier
* Add rebuildNodes() which uses buildSubtreeFromData() to rebuild stuff
* Use rebuildNodes() in DocumentSynchronizer
* Use pushRebuild() in TransactionProcessor
* Optimize setRoot() for the case where the root is already set correctly

Change-Id: I8b827d0823c969e671615ddd06e5f1bd70e9d54c
2012-04-13 16:46:02 -07:00
Rob Moen d37a325f44 Cleanup terms used in annotation method
Change-Id: I509a1f1b680cc8a2973188f0ed7c7d67b8a15f4f
2012-04-12 16:37:23 -07:00
Rob Moen 1fa462ce92 Fix up FormatDropdownTool
Effectively stopping & starting polling prior to conversion
Getting Selection from model
Reselecting after conversion (TODO: modify selection to entire block ?)

Change-Id: I9ba331b5393bf568cc8d137646b43244ae2640a8
2012-04-12 16:21:10 -07:00
Rob Moen 961f83d326 Elminiated isSelection method
Determine actual selection from model by checking length

Change-Id: I1c58a4de31b26d49b55c7a2c55c9c6462741bdfb
2012-04-12 14:05:14 -07:00
Rob Moen 28e86c8688 New Method isSelection() in Surface View
Used to properly hide/show Context menu and UI elements.

Change-Id: I8b3750c270651498b7e6c54a1921f5012cf33ea6
2012-04-12 10:22:42 -07:00
Rob Moen b5befb1d57 On annotate, get current selection from model
Fixes link annotation, and any annotation that pops up an inspector as selection is lost.

Change-Id: Idd8812b05f4fddfa4e613dea28a1a8421792656d
2012-04-11 14:15:52 -07:00
Rob Moen 224cc1f9a0 Migrate tools from SurfaceObserver Class
ContextView positioning, Italic, and Bold annotations working

Change-Id: Ifc68bd61c8f27b6a14d314dc2999753af6e0ee04
2012-04-11 13:19:58 -07:00
Rob Moen 01e02e888d Fix copy / paste errors for setStyle method in ListNode and ListeItemNode
Change-Id: Ifc8183e047398fd7f4b0436e61768992a3a94612
2012-04-06 11:37:53 -07:00
Robmoen 8a06ea5adc Merge "Changed to using structured lists" 2012-04-06 18:28:04 +00:00
Inez Korczynski 50acc0c785 Make toolbar and context menu works
Change-Id: Ice981390b22a257158b3417dda3a1945d777cb14
2012-04-06 17:43:14 +02:00
Inez Korczynski 68cf13fb1e getLeafNode is now a static method and should be called as a static method
Change-Id: I4f079523add81ef14537c950b29436422e1de850
2012-04-06 17:13:43 +02:00
Inez Korczynski 5827843182 Merge changes from branch ce-poll
Change-Id: Id7602ed33a09720c53310a032d2824395b82ff7f
2012-04-06 17:11:35 +02:00
Inez Korczynski a57ae2692e Merge changes from branch ce-poll
Change-Id: Ibb6da1ac5229ed5afeda1a3944fe7deff3bfb9a7
2012-04-06 17:10:30 +02:00
Inez Korczynski 090e42c8d9 Just a test
Change-Id: I74fb371a26b4b6068fee593bf7e6ee950080bca8
2012-04-06 16:49:30 +02:00
Trevor Parscal 85b807ed5d Changed to using structured lists
This makes it possible to get identical rendering in the editor, but may make other things more complex. The Wikitext serializer is no longer compatible for rendering lists so it's been stubbed out. Also the way the toolbar works with lists is broken, so that's been disabled. The HTML serializer has been fixed to work correctly and no-longer-used styles have been removed.

Change-Id: If156f55068b1f6d229b3fa789164f28b2e3dfc76
2012-04-05 14:32:08 -07:00