Trevor Parscal
fc7e96b2b5
Merge "Rename watch to watchpage, per https://gerrit.wikimedia.org/r/12423 "
2012-06-21 17:52:25 +00:00
Catrope
ff39a448a3
Merge "Fixed output of translateOffset when collapsing a range"
2012-06-21 17:48:43 +00:00
Catrope
a904bcc0f3
Rename watch to watchpage, per https://gerrit.wikimedia.org/r/12423
...
Change-Id: Ic38ea27ead9f98b22b1fbbad5dcbb8de2205f51a
2012-06-21 10:46:47 -07:00
Trevor Parscal
5aa3bbedc7
Fixed output of translateOffset when collapsing a range
...
Change-Id: Ifb40dd1f9de557d4237660f5fb7119d6aa940c65
2012-06-21 10:45:58 -07:00
Christian Williams
f27425eb91
Firefox has some crazy bindings for browser features. This prevents it and properly annotates.
...
Change-Id: Ide294efda8b661e16f24cc1f3584a8f08785ff5b
2012-06-21 10:33:40 -07:00
Trevor Parscal
861ce8d54f
Fixed pressing backspace in a slug, now we just move the cursor to some nearby content
...
Change-Id: Idaf61264fb493169cfef1c48613036c292d590f0
2012-06-21 00:01:32 -07:00
Trevor Parscal
c548b3cdba
Merge changes I44515c86,Ife902ace,Ia6510de1
...
* changes:
Got rid of iteration to get the surface
Removed attach and detach methods from ve.ce.Node
Track adjustments in DocumentSynchronizer and apply them to oldRange
2012-06-21 06:41:57 +00:00
Trevor Parscal
07eb2df53a
Got rid of iteration to get the surface
...
Also added a safety check to make it easier to spot a regression
Change-Id: I44515c867852f2f726be74161f6b8e466c0933da
2012-06-20 23:40:38 -07:00
Trevor Parscal
00c555ebe5
Removed attach and detach methods from ve.ce.Node
...
Added some needed functionality in ve.Node to make up for this
Change-Id: Ife902aceb4e8535411dc653ae61087aecf67a0c6
2012-06-20 23:40:38 -07:00
Catrope
dc646ff32c
Track adjustments in DocumentSynchronizer and apply them to oldRange
...
This is needed because oldRange is relative to the state of the model before any changes were made, but when we call selectNodes() it's gonna operate on a partially updated model tree.
This is a genuine bug in DocumentSynchronizer proper, which means I owe the entire team lunch
Change-Id: Ia6510de19df02e961c7f25fb8e7833abceb8d25b
2012-06-20 23:40:38 -07:00
Trevor Parscal
cb3eba185d
Merge "Fix adjustment of newRange in TransactionProcessor"
2012-06-21 06:38:42 +00:00
Catrope
df4e5f0200
Merge "Fix minor bug with space replacement in TextNode"
2012-06-21 06:37:56 +00:00
Catrope
0b9934b2cc
Fix adjustment of newRange in TransactionProcessor
...
* Adjust both start and end for preceding operations
* Adjust end for the current operation as well
Change-Id: I2f96d609bddf3788aa5700ad1f0b46208f3517d7
2012-06-20 23:37:55 -07:00
Inez Korczynski
74440be132
Fix minor bug with space replacement in TextNode
...
Change-Id: Iafdc59d9fd8654444079e55a2ad36a40cc21fa4c
2012-06-20 23:33:22 -07:00
Inez Korczynski
ab16987ae8
Better support for left & right arrow keys
...
Change-Id: Iad56f8179d3ed90828e31ad0203a5cec9e9d2458
2012-06-20 23:06:47 -07:00
Trevor Parscal
3008b04126
Merge "Properly hide and show inspectors."
2012-06-21 05:56:30 +00:00
Trevor Parscal
709c5946ed
Merge "Allow initial value to be accepted in link inspector if it is the default text."
2012-06-21 05:55:40 +00:00
Trevor Parscal
88ef5b1517
Merge "Logic for moving cursor left and right programmatically"
2012-06-21 05:54:50 +00:00
Trevor Parscal
c12eca96fc
Merge "Support protocol-relative URLs in the link inspector"
2012-06-21 05:53:43 +00:00
Trevor Parscal
7e892daac9
Merge "Fixing backspace when at the beginning of the document."
2012-06-21 05:52:45 +00:00
Trevor Parscal
a7b47a2c00
Merge "Pressing enter in the last listItem, if empty, will exit the list"
2012-06-21 05:50:51 +00:00
Trevor Parscal
e657cd802f
Merge "Support for insertion in slugs."
2012-06-21 05:50:09 +00:00
Rob Moen
4d7e467780
Properly hide and show inspectors.
...
Change-Id: I1de85c8364df67bf547b4fec498829e61f7ab07f
2012-06-20 22:29:50 -07:00
Inez Korczynski
9b1e96cd46
Logic for moving cursor left and right programmatically
...
Change-Id: I48844cfbebaf3933ad61dc462ab5ea73be45a8aa
2012-06-20 22:24:12 -07:00
Inez Korczynski
772716bce9
Fix the exception that is thrown when document is passed as a start parameter to traverseLeafNodes method.
...
Change-Id: Ie8c5a0fd9ad8e003fef706fdf61749499ad27e31
2012-06-20 21:53:42 -07:00
Rob Moen
11c3e8b0fb
Allow initial value to be accepted in link inspector if it is the
...
default text.
Change-Id: Ife8e8742b57bc9ff75cf147d6abc913f2a2ada7c
2012-06-20 21:52:42 -07:00
Catrope
dd1db50a3c
Support protocol-relative URLs in the link inspector
...
Change-Id: I78ed64d90e562de1a972807c16196f10d805b959
2012-06-20 21:51:07 -07:00
Christian Williams
4df69b01de
Fixing backspace when at the beginning of the document.
...
Change-Id: Ib4c463c6a1eb27897a39c96c46617047d8ee4325
2012-06-20 21:34:11 -07:00
Inez Korczynski
7eae9cdba6
Support for insertion in slugs.
...
Change-Id: I8e144206520b59271edf854020b87ce947fe0559
2012-06-20 21:32:26 -07:00
Christian Williams
0ab3b65c03
Pressing enter in the last listItem, if empty, will exit the list
...
Change-Id: I084fabac09654adf50db97b554e937d2772f9a37
2012-06-20 21:10:48 -07:00
Catrope
48bba8fcb8
Merge "Added onbeforeunload handler which warns before someone leaves the page if they have unsaved changes"
2012-06-21 03:51:36 +00:00
Catrope
ed399608fc
Merge "Added getSelectionText method to link inspector so that the default text for a link is the selected text. patchset 2 - add case for if data offset is an object, be sure it is a string prior to adding it. truncate to 255 chars. patchset 3 - actually add the patched file Change-Id: Ibddf942c2a0ba3412d93cf9730f74eb858025fad"
2012-06-21 03:48:53 +00:00
Rob Moen
8bccdf9d78
Added getSelectionText method to link inspector so that the default
...
text for a link is the selected text.
patchset 2 - add case for if data offset is an object, be sure it
is a string prior to adding it. truncate to 255 chars.
patchset 3 - actually add the patched file
Change-Id: Ibddf942c2a0ba3412d93cf9730f74eb858025fad
2012-06-20 20:45:56 -07:00
Trevor Parscal
36ee49614c
Added onbeforeunload handler which warns before someone leaves the page if they have unsaved changes
...
Change-Id: I0ffb17987ee40995f7f7e3ffc386aa71c9db37a7
2012-06-20 20:16:10 -07:00
Christian Williams
8556888a9a
Fixing handleEnter to allow splitting headlines
...
Change-Id: I4f75ee1b454f66c4b112a1ab59386994bb249792
2012-06-20 20:02:25 -07:00
Trevor Parscal
a9d62184ed
Merge "Disable indentation button tool, doesn't work yet"
2012-06-21 02:42:53 +00:00
Trevor Parscal
9c0b8f57b2
Merge "Use getClonedElement() rather than manually building a node"
2012-06-21 02:40:11 +00:00
Trevor Parscal
1bfb8f7579
Merge "Hide each inspector in the iframe, works for now. Will need to be rewritten for multiple inspectors"
2012-06-21 02:38:25 +00:00
Trevor Parscal
f529c5ebbe
Merge "i18n for error messages"
2012-06-21 02:37:21 +00:00
Trevor Parscal
9ecb3053e4
Merge "Document how to remove attributes"
2012-06-21 02:36:29 +00:00
Christian Williams
691de5fb76
i18n for error messages
...
Change-Id: Ib0d3350985a64df28a4a2d2c5e68d7dc341330b3
2012-06-20 19:33:19 -07:00
Catrope
9b514b7cbf
Fix off-by-one bug in the ve.msg's fallback $1 replacement
...
Change-Id: I62df4ce4b801c7eec5c08958e1c3b4f835f60957
2012-06-20 19:26:03 -07:00
Trevor Parscal
f49ef7dfc0
Cleaned up selection and focus code for inspectors
...
Change-Id: Iee1a3525015967f1de461c9e0ebea84834346172
2012-06-20 19:22:38 -07:00
Inez Korczynski
7291485ce5
Move slugs logic into doSlugs since it is being used in onSplice and in cleanup methods.
...
Change-Id: I10395bbdfd71fda2913e6da736189f0ff8216702
2012-06-20 19:10:28 -07:00
Catrope
ac835c2d69
Merge "Keyboard shortcuts for bold and italic"
2012-06-21 02:09:28 +00:00
Christian Williams
14054becb5
Keyboard shortcuts for bold and italic
...
Change-Id: I12b80134152bbbbd2dfa42b32fec072cde29baa5
2012-06-20 19:09:06 -07:00
Rob Moen
f3b74549cf
Hide each inspector in the iframe, works for now.
...
Will need to be rewritten for multiple inspectors
Change-Id: If94b60d4a1024bdbcdba24f94e318a29341bf18a
2012-06-20 19:03:48 -07:00
Catrope
319ff040bb
Merge "Fix method hasSlugAtOffset to return true when length of the element is 0"
2012-06-21 02:00:51 +00:00
Trevor Parscal
09fd90f66f
Merge "Add slugs inside empty branch nodes so cursor can be correctly placed."
2012-06-21 02:00:17 +00:00
Catrope
7be404f818
Merge "Removed trailing whitespace and other cruft"
2012-06-21 01:59:57 +00:00
Catrope
e8702e8f0f
Use getClonedElement() rather than manually building a node
...
Change-Id: I3d6390830c6a01235e55b1484e161d1f6737ac01
2012-06-20 18:59:12 -07:00
Catrope
7f3106802c
Merge "Modified handleEnter to insert a paragraph above/below a non-paragraph if at the edges"
2012-06-21 01:57:58 +00:00
Trevor Parscal
3743b75d59
Modified handleEnter to insert a paragraph above/below a non-paragraph if at the edges
...
Change-Id: Icfe650890ceb32f77c79347bebdf8be9612cfdbb
2012-06-20 18:57:35 -07:00
Catrope
01407b1ec5
Merge "Typo fixes throughout the codebase"
2012-06-21 01:49:15 +00:00
Catrope
22677ac475
Merge "When there is a selection range, pressing arrow keys should not remove the selection in Firefox."
2012-06-21 01:48:30 +00:00
Christian Williams
58917f5015
When there is a selection range, pressing arrow keys should not remove the selection in Firefox.
...
Change-Id: I93bca05dd0f37fd8f87eba3f407a68c922ed66e3
2012-06-20 18:48:02 -07:00
Catrope
9f2a8757f4
Merge "Add commented-out tab key support for indentation button tool"
2012-06-21 01:46:36 +00:00
Rob Moen
1462a6cf37
Add commented-out tab key support for indentation button tool
...
Change-Id: I4741182bb79becf08288287142a930ddf7f547ad
2012-06-20 18:45:44 -07:00
Catrope
c5ddfb7c7a
Disable indentation button tool, doesn't work yet
...
Change-Id: I582289067139e3e1b7ef14c32d82373d1a1c2b5a
2012-06-20 18:42:27 -07:00
Catrope
f2c178f020
Document how to remove attributes
...
Change-Id: I9a30a6510d62fb2ee4e6341ef74f2f5558125e72
2012-06-20 18:40:24 -07:00
Rob Moen
5ac30a2f5f
Apparently every object in FF has a watch() method. Added better
...
Checking for this for when mw.page.watch module is not loaded.
Change-Id: I67688288dba59aa52bba9d538682374a15169285
2012-06-20 18:35:07 -07:00
Inez Korczynski
c1225acb68
Fix method hasSlugAtOffset to return true when length of the element is 0
...
Change-Id: Icf43eb6adfcc45eaf1ae8ff146a029546341ba33
2012-06-20 18:18:49 -07:00
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
Trevor Parscal
6fe115a563
Removed trailing whitespace and other cruft
...
Change-Id: I8c439d2a272e01b9e26bfd6b13d9e600d324930b
2012-06-20 17:42:12 -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
e175292c07
Typo fixes throughout the codebase
...
And a missing semicolon
Change-Id: I8487525ae2a7fa8f58e00c92c7dff600d9bd9520
2012-06-20 16:01:02 -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  , " " -> " "
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
Trevor Parscal
a2eee63525
Updated CSS classes and rules for CE, which for the most part uses native elements
...
Also:
* Simplified ve.ce.Surface.getLeafNode, which may be better to just be removed and be used inline in the few places it's being used.
* Removed method wrapper for static function ve.ce.Surface.getLeafNode
Change-Id: I1d4cf0bb7ecc8f07f030753e40a13ebef7d02daa
2012-04-04 11:54:06 -07:00
Trevor Parscal
519d225d2f
Cleanup of white space, missing semi-colons, line breaks, etc.
...
Change-Id: Ifa96a9f70fa8d149a4c403521aaa88a3e0546ef0
2012-04-02 15:28:26 -07:00
Rob Moen
d8de26d7e9
On selection, update selection in the model. Fixes selection.clone() error.
...
Change-Id: Ibd5cf0398002e5fbb2c50549e4a7043ba8fd00a7
2012-04-02 14:19:53 -07:00
Rob Moen
c1300ba949
Fixed surfaceView undefined error
...
Change-Id: Iba3ae54b4e508afbfa132e0f0b2b0b237e685395
2012-04-02 13:49:45 -07:00
Trevor Parscal
19f3d5c107
Added ve.Surface, a wrapper around an editor instance
...
* This high level surface object is responsible for creating & managing editor instances
* Revised Sandbox demo to invoke in this way.
Change-Id: I4043779af9a2ab964deaf26079a992e82ebeef27
2012-03-29 15:55:33 -07:00
Catrope
7a726b0278
Add tree synchronization for replace
...
To handle replace operations that are not themselves consistent (these
are common, for instance when replacing an opening element in one place,
then replacing the closing element somewhere else), we process
subsequent replace operations inside the first one until things are
balanced again, then issue a single rebuild for the whole thing.
Change-Id: Ide4613f046fabfeeef383138c39e350b1b710033
2012-03-26 02:51:30 -07:00
Catrope
826437950c
adding clearState function for tools and using clearState if no selection exists
...
Originally committed in SVN as r114418 by Christian, missed the git
conversion
Change-Id: I56e91c170670519fa2b482a4b7f30cdcbc8ff163
2012-03-22 14:22:15 -07:00
Rob Moen
e5df79229d
make clear button tool work with annotate method in ce surface
2012-03-16 22:20:16 +00:00
Inez Korczynski
299c77db84
Make LinkInspector works (using annotate method in SurfaceView)
2012-03-16 22:16:15 +00:00
Inez Korczynski
b2f4b48a9a
Use on and off insteaf of bind and unbind.
2012-03-16 22:01:09 +00:00
Rob Moen
277e239796
CE surface has no hidden input, removed input focus
2012-03-16 22:00:42 +00:00
Inez Korczynski
6ef8ac182a
No more endless looping! And fix getSelectionRect to return document relative coordiantes instead of viewport relative.
2012-03-16 21:52:17 +00:00
Rob Moen
cde7a3bf7e
adapt LinkInspector to use surfaceObserver for selection
2012-03-16 20:18:26 +00:00
Rob Moen
93376d68eb
add surfaceObserver on select methods to ui toolbar and surfaceView for responding to select event. tools now updating to selected node annotations. revise getSelectionRect to return actual start & end pos. context icon properly showing on range selection
2012-03-15 22:06:40 +00:00
Roan Kattouw
05333b1f3d
Put the invert state / method (commit or rollback) in the TransactionProcessor object and no longer pass it as a parameter to each operation. This makes it easier for operations to execute other operations.
2012-03-14 21:02:36 +00:00
Roan Kattouw
bf5ea06db5
Factor out process() into nextOperation() and executeOperation()
2012-03-14 21:02:34 +00:00
Roan Kattouw
2c43a34f74
Rewrite the rebuild action to take two ranges rather than a node and some data.
2012-03-14 21:02:31 +00:00
Roan Kattouw
37a59016e8
Break out pushAction() into separate functions for each action. This will allow me to change the rebuild action to take totally different parameters.
2012-03-14 21:02:29 +00:00
Roan Kattouw
bd9a86dd55
Remove the offset adjustment feature from DocumentSynchronizer. It gets in the way when I try to use this class in TransactionProcessor.
2012-03-14 21:02:27 +00:00
Roan Kattouw
1e17285afb
Move computation of missing offset from pushAction() to synchronize(), and only compute offsets for actions that require them. This also fixes an issue where offsets computed by pushAction() would be adjusted incorrectly by pushAction().
2012-03-14 21:02:26 +00:00
Roan Kattouw
7dd2b8b725
Make DocumentSynchronizer clear the queue after it's done with it
2012-03-14 21:02:24 +00:00
Inez Korczynski
f87709d6bb
Use <h[1-6]> tags for rendering headings (instead of divs)
2012-03-14 00:51:04 +00:00
Rob Moen
d77c0b91dc
fix dropdown tool to use selection from ce surfaceView
2012-03-14 00:29:41 +00:00
Inez Korczynski
294d474c54
Replace CursorObserver and ContentObserver with SurfaceObserver
2012-03-14 00:04:24 +00:00
christian
d174809b54
replacing showCursorAt calls with correct showCursor method
2012-03-13 18:12:57 +00:00
christian
010c97acc8
removing min height attribute to fix IE bug
2012-03-12 23:31:08 +00:00
christian
ba437744b3
preventing native contenteditable resizing tools
2012-03-12 23:06:47 +00:00
Rob Moen
350a53fd93
rework context icon positioning for CE surface using new getSelectionRect method
2012-03-12 22:14:43 +00:00
Rob Moen
22a351e855
small fix: getSelectionRange was breaking the surface layer, changed to saved state member
2012-03-12 22:04:29 +00:00
Rob Moen
65170e13df
port over select event listener, and updateSelection methods for setting and removing context icon, add getSelectionRect method for context icon position
2012-03-12 21:50:22 +00:00
christian
56b9068d03
switch to getSelectionRange and fixing IME native menu
2012-03-12 20:39:08 +00:00
Alexandre Emsenhuber
99a31bacbc
svn:eol-style native
2012-03-11 18:38:27 +00:00
Roan Kattouw
29f416937e
Fix some usages of splice.apply in the data model to use
...
ve.batchedSplice(). Added FIXME comments for occurrences outside of DM
2012-03-10 00:31:28 +00:00
Inez Korczynski
9a8f7059fc
Make ContentObserver pass information about content when emiting change event.
2012-03-09 23:15:23 +00:00
Trevor Parscal
02592b3ec0
More cleanup
2012-03-09 22:55:49 +00:00
Trevor Parscal
60c9c484aa
More cleanup (jshint complaints)
2012-03-09 22:51:00 +00:00
Trevor Parscal
ce824d6299
Cleanup
2012-03-09 22:45:22 +00:00
Inez Korczynski
4bc7dbbe5e
Initial import of CursorObserver and ContentObserver (not being used yet).
2012-03-09 22:18:24 +00:00
Trevor Parscal
2f9fcde16e
Removed duplicate static methods and members that were copied to ve.dm - lets just leave them in ve.dm.DocumentNode for now.
2012-03-09 21:54:00 +00:00
Roan Kattouw
b13d0a849d
Add a check for the length of unwrapOuter, and add a test for each
...
exception
2012-03-09 01:44:31 +00:00
Roan Kattouw
bc600b34be
Make prepareWrap() use the data from the model rather than the unwrap
...
parameters. This fixes the case where rolling back a list unwrap would
restore the list items without their attributes
2012-03-09 01:14:41 +00:00
Roan Kattouw
04910777d9
Fix stupid typos so wrapEach actually works
2012-03-09 00:38:34 +00:00
Roan Kattouw
ab26581b2e
Fix cursor adjustment in replace()
2012-03-08 23:21:28 +00:00
Roan Kattouw
5054ed320e
Implement prepareWrap and add tests for it
2012-03-08 23:21:26 +00:00
Roan Kattouw
9b66749575
Add documentation for to-be-written prepareWrap function
2012-03-08 23:21:24 +00:00
Roan Kattouw
d978797fca
Add a very simple transaction builder for content replacements
2012-03-08 23:21:21 +00:00
Roan Kattouw
cac9971299
Implement the replace operation for the linear model
2012-03-08 23:21:20 +00:00
Roan Kattouw
46dbb30b7a
Factor the batched splice code out from ve.insertIntoArray() into a
...
separate function
2012-03-08 23:21:18 +00:00
Roan Kattouw
93deba7b5c
Add replace operation
2012-03-08 23:21:17 +00:00
Trevor Parscal
becb1daa39
Added more tests for ve.dm.DocumentSynchronizer and fixed some bugs along the way
2012-03-08 19:35:51 +00:00
Alexandre Emsenhuber
62e8312535
svn:eol-style native
2012-03-08 12:27:02 +00:00
Trevor Parscal
459c4fa271
Added some basic tests for resize and insert. Fixed some bugs in both of those code paths along the way.
2012-03-08 00:52:30 +00:00
Trevor Parscal
de0f83643b
Typo in file name
2012-03-07 23:48:58 +00:00
christian
df4f017b21
preserve range after applying annotation
2012-03-07 23:35:38 +00:00
Inez Korczynski
ab496f7bc9
Get rid of showCursorAt method. And replace calls to it with calls to showCursor.
2012-03-07 23:33:41 +00:00
Inez Korczynski
8e56acbaca
Added getDOMNodeAndOffset and showSelection methods to Surface. Ohhh and little wrapper around it - showCursor.
2012-03-07 23:32:26 +00:00
christian
76b7127e29
removing usage of rangy anchornode for determining rendering scope - using model and autoRender
2012-03-07 21:41:53 +00:00
Inez Korczynski
73f53e89c6
Small refactoring. Changed method name, from Surface.getSelection to Surface.getSelectionRange.
2012-03-07 21:37:39 +00:00
christian
22ce25dc69
replacing cursor after annotating works
2012-03-07 21:06:07 +00:00
Trevor Parscal
55cf0c8ada
Added sketch for ve.dm.DocumentSynchronizer which is a utility object for queueing up actions to be performed on the model tree such as deletion, insertion, rebuilding, resizing and updating of node. Using this approach, we can collect actions across multiple steps, and then normalize them to avoid duplicate work and mutate the model tree in a single step.
2012-03-07 20:21:32 +00:00
Rob Moen
0520e64d97
port over annotation methods from ES to CE, remove unused renderDomNode method
2012-03-07 19:37:17 +00:00
Rob Moen
73fbbe29ab
cleanup whitespace
2012-03-07 19:33:00 +00:00
christian
816a6717a6
adding autoRender property to SurfaceView to enable/disable automatic rendering of view when model is updated
2012-03-07 08:13:12 +00:00
Trevor Parscal
a82ddeae51
Fixed some jshint complaints and enforced 100char line endings
2012-03-06 23:51:31 +00:00
Inez Korczynski
2e9ab44719
Update class names, from ve.es to ve.cs, and update code that uses those classes
2012-03-06 22:39:43 +00:00
Inez Korczynski
594a0e6d6c
Rename bunch of files from ve.es.* to ve.ce.* (and update references)
2012-03-06 22:35:42 +00:00
Inez Korczynski
8dcd638249
Copy files from ve/es to ve/ce and update references
2012-03-06 22:31:44 +00:00
Rob Moen
809df81282
enable CE demo toolbar, added annnotation and renderDomNode methods
2012-03-05 22:08:35 +00:00
Rob Moen
da5a148f9c
prevent insert for stand alone command key.
2012-03-05 17:57:54 +00:00
Rob Moen
714f15cef7
minor changes: remove whitespace and add semicolons
2012-03-03 00:17:15 +00:00
Inez Korczynski
01e84a558c
Improvements to changes polling mechanism
2012-03-02 02:07:55 +00:00
Inez Korczynski
90cfb62cb6
Added basic support for enter key
2012-03-02 01:35:34 +00:00
christian
923e9380cd
event binding cleanup
2012-03-02 01:12:18 +00:00
christian
3a1ee7e5b9
adding paste fixes to cut handler
2012-03-02 00:37:01 +00:00
Inez Korczynski
b16a1c3899
Fix bug in Chrome when moving cursor with left/right arrow in between <table> and textnode
2012-03-02 00:34:31 +00:00
christian
5ec5fb77e6
better cut-copy-paste support
2012-03-02 00:27:04 +00:00
Inez Korczynski
7de9e98583
Fix couple of poll interval bugs in Surface and add new parameter called 'byref' to method getAnnotationsFromOffset which makes it return array references instead of copy of arrays.
2012-03-02 00:10:08 +00:00
christian
3f1ed0be6d
adding cut-copy-paste
2012-03-01 22:27:23 +00:00
Inez Korczynski
8120b0b624
Cleanup for JSLint
2012-03-01 22:14:14 +00:00
Inez Korczynski
45cd5a11d0
Explicitly pass parameter global=true to getOffset method
2012-03-01 20:52:22 +00:00
Inez Korczynski
5dc284efaf
Added getSelection method to Surface
2012-03-01 20:49:21 +00:00
Inez Korczynski
3bb7f81714
Migreate text input method from playground to ce and ce demo
2012-03-01 01:28:39 +00:00
Sam Reed
fc49422e1d
More image compression of extensions with WMF interest
2012-02-29 22:02:03 +00:00
christian
13fe37193a
re-enabling native browser spellcheck
2012-02-28 23:43:38 +00:00
Rob Moen
f6f05241c7
fixed my typo follow up r112555
2012-02-28 01:37:38 +00:00
Rob Moen
78eedb8c74
cleanup previous commit. follow up r112552
2012-02-28 00:46:23 +00:00
Rob Moen
37ffc61c19
prototype RTL text mode cursor handling. Need to complete the unicode regular expression, and make helper methods for RTL boundary
2012-02-28 00:35:17 +00:00
christian
7053e0517c
prevent dragging and dropping text - can be removed later if operation supported via model
2012-02-27 21:56:56 +00:00
Rob Moen
0575db24f7
added a left positioning to input to properly position ime context menu
2012-02-27 19:44:02 +00:00
Rob Moen
ed35395ba2
fix typo which prevented readInterval from stopping onBlur
2012-02-24 17:41:22 +00:00
Rob Moen
dab0396b54
minor fixes: removed whitespace, added semicolon
2012-02-24 00:49:28 +00:00
Rob Moen
8cf2fe9f33
follow up to r112276, fixed bug which prevented word selection
2012-02-24 00:32:44 +00:00
Trevor Parscal
7baae71363
very minor fixes
2012-02-24 00:05:29 +00:00
Rob Moen
26ab5f7408
Fixed bug when moving cursor with click. Calling showCursor after input regains focus prevents browser from freakishly scrolling
2012-02-24 00:04:21 +00:00
Rob Moen
297d41bb63
Rework general input to no longer clear during IME. Polling interval for non keyDown text comparison. Chunked text insertion for all normal keys which makes nice transactions and clears input.
2012-02-23 23:20:47 +00:00
Trevor Parscal
7366a22046
Added support for respecting new lines in pre-formatted blocks - using Shift+Enter will show this in action!
2012-02-23 01:18:01 +00:00
Trevor Parscal
696f5cb2a0
Replaced "set" and "clear" method for attribute transactions with "replace" method, which allows correct reversion. Also fixed list item tools to correctly use the new function signature.
2012-02-22 21:23:28 +00:00
christian
8b3bc2e439
turning off native spellcheck for now
2012-02-15 23:42:43 +00:00
Trevor Parscal
5f033c9bfe
Changed the way widths are calculated when rendering lines of text. Now we let the browser do it's normal layout thing, and use a set of floated divs to figure out the effective line width. Using this technique, we pretty much support floating content from a rendering perspective. Interaction is still a problem however.
2012-02-14 20:30:40 +00:00
Inez Korczynski
d5ad9a9ad4
New approach to text input and IME (part I)
2012-02-13 22:45:18 +00:00
christian
0e6fe86a05
Commenting out fake cursor for now, fixing paste binding
2012-02-13 19:51:39 +00:00
christian
c532488b40
creating showFakeCursorAt method and cleaning up code
2012-02-13 19:48:05 +00:00
Inez Korczynski
3ee4da941d
Render real <b> and <i> tags insteaf of <span>s
2012-02-13 19:38:31 +00:00
Inez Korczynski
0ce3c67872
Working prototype of insertion of the text with annotations
2012-02-11 01:04:14 +00:00
Inez Korczynski
001a432fa3
Get rid of console.logs
2012-02-10 22:27:17 +00:00
Inez Korczynski
b3453dc71c
Add new method: getDOMText
2012-02-10 22:19:12 +00:00
christian
f0e60248fb
fake cursor demo
2012-02-10 18:18:35 +00:00
Alexandre Emsenhuber
bfa0a28968
svn:eol-style native
2012-02-10 16:57:02 +00:00
Inez Korczynski
acd819b28b
Fix showCursorAt method - missing "break;"
2012-02-10 05:39:28 +00:00
christian
ed7dc80db9
reorginization of event handlers
2012-02-09 22:11:33 +00:00
Brion Vibber
d0abf39168
ve.js isn't the edit surface, that's es.js :)
2012-02-09 22:04:06 +00:00
christian
ffad7ef3d8
removing beforepaste event for now. it was hyper
2012-02-09 08:41:36 +00:00
christian
6a23449ecb
using transact
2012-02-09 07:39:43 +00:00
Inez Korczynski
3f843bb1a6
First implementation of IME for content editable
2012-02-09 00:51:59 +00:00
christian
f84fc1cbf1
paste handler no longer causes fast viewport shift when pasting
2012-02-08 23:37:52 +00:00
christian
13921a0468
layout tweaks
2012-02-08 22:50:34 +00:00
christian
e3e3150399
using execcommand to undo cut - model controls mutation
2012-02-08 18:06:03 +00:00
christian
cdbe9a7d13
fixing scroll after paste
2012-02-08 07:18:15 +00:00
christian
df78da31ca
removing offset override
2012-02-08 06:55:12 +00:00
christian
212d4d7559
adding overflow hidden to allow clicking on floated elements
2012-02-08 06:31:51 +00:00
christian
1dd6d8f2b5
working on getSelection and getOffset for triple click
2012-02-08 06:28:38 +00:00
christian
75bec9fba1
cut support
2012-02-08 02:12:21 +00:00
christian
2d058f7a4d
copy and paste support
2012-02-08 00:47:51 +00:00
Inez Korczynski
746e603184
Implement: surfaceView.showCursorAt(int n)
2012-02-08 00:30:40 +00:00
Inez Korczynski
beda113281
Delete scanBoundaries method from Content, as it does not make sense anymore for content editable approach
2012-02-08 00:26:18 +00:00
Inez Korczynski
2d531ed213
Get getSelection in contenteditable working
2012-02-08 00:02:08 +00:00
Inez Korczynski
a046c0d2cf
Cleanup Surface.js - only functionality that is needed for content editable
2012-02-07 22:59:30 +00:00
Inez Korczynski
db0aea6965
Make paragraphs in content editable use real <p> tags
2012-02-07 22:22:49 +00:00
Inez Korczynski
0ced900973
Added missing CSS and PNG so ce demo does not complain anymore.
2012-02-07 22:03:39 +00:00
Inez Korczynski
e0c10cdfff
Cleanup ve.es.Content.js for ContentEditable and setup toolbar as empty (as there is no working functionality for now)
2012-02-07 22:02:11 +00:00
Alexandre Emsenhuber
f162145298
svn:eol-style native
2012-02-07 19:13:19 +00:00
christian
2a076da93a
removing outline from contenteditable
2012-02-07 02:01:26 +00:00
christian
be552732c0
tweaks to margins
2012-02-07 02:00:08 +00:00
Inez Korczynski
9173608afb
Adapt ContentEditable code to new schema of directories and files
2012-02-07 01:43:49 +00:00
Trevor Parscal
8078b0f8a2
Fixed backspace - another issue related the r110805 (or as we are now calling it, "The Great Code Migration of 2012")
2012-02-07 01:11:32 +00:00
Trevor Parscal
d172b220b7
Minor fixes (line length breaking, jshint nagging, etc)
2012-02-07 00:42:16 +00:00
Trevor Parscal
6dcc39fe11
Migrated es.* to new ve.* namespace which is more structured, and will make it easier to keep data model, edit surface, user interface and content editable work separated cleanly
2012-02-06 23:50:56 +00:00