Commit graph

1372 commits

Author SHA1 Message Date
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
jenkins-bot 2b352c577c Merge "(bug 45029) Transactions for metadata modification." 2013-02-15 01:28:44 +00:00
Ed Sanders 67e9d5d1dd (bug 45029) Transactions for metadata modification.
Have created builders for insertion, removal, and single element replacement.

In adding Document.getMetadata which is nearly identical to Document.getData,
the two functions have been refactored to use a common static method
getDataSlice, with this.data/this.metadata as an argument.

Document.spliceMetadata has been added. It is essentially spliceData with
the data/metadata synchronisation issue.

Metadata cursor position is now tracked in the TransactionProcessor. Cursor
advancement has been moved to a function so the metadata cursor can be reset
every time the data cursor is moved.

There were unhit bugs in the TransactionProcessor run test section, where
the data being loaded into the test documents wasn't always being deep-copied,
and the assert was looking at getData instead of getFulldata (which wouldn't
be able to test metadata changes).

Change-Id: Ieb20ab3e7827bc7ff04148f147da6728eb1eb666
2013-02-14 17:27:27 -08:00
jenkins-bot 92e5f94e41 Merge "Add user interface widgets" 2013-02-14 19:04:59 +00:00
jenkins-bot a1bd1db241 Merge "Use .static.isMeta to communicate meta-ness" 2013-02-14 18:47:48 +00:00
Trevor Parscal d0ff691f9e Add user interface widgets
* New! Button and InputLabel widgets
* Using new buttons in the demo
* Moved styles around to generalize input styles

Change-Id: Ic42e133f8fe0fffcb61374c09dd5668db82a4799
TODO: Use these buttons other places! (like ve.init)
2013-02-13 18:04:04 -08:00
jenkins-bot 385606d6fe Merge "Added new icons" 2013-02-14 00:09:53 +00:00
Trevor Parscal d42a52bb59 Added new icons
Icons needed for upcoming generated content editor.

* Parameter (big and small)
* Parameter Set
* Source (big and small)
* Template (big and small)

Change-Id: I9c5df7970e3f0991ac6a66590212f40d83af9c0a
2013-02-13 16:06:29 -08:00
Inez Korczyński f0bc9935d2 (bug 41199) Fix the problem with placing cursor by clicking next to article content.
The specific use case is when user clicks on the left side of the inline alien node which
is at the beginning of the line or on the right side of the inline alien node at the end of
the line. This fix does not cover Monobook.

Change-Id: Ib24b03e30e753850698ed6b10be49b4f2642c92b
2013-02-13 15:36:45 -08:00
jenkins-bot 6b51b0f635 Merge "Annotate newly inserted target text as a link." 2013-02-11 20:00:26 +00:00
jenkins-bot 8d274c19e6 Merge "Implement inline documentation examples." 2013-02-09 01:50:44 +00:00
Timo Tijhof 62aeb254d9 Implement inline documentation examples.
Refactored the (previously unused) eg-iframe file to be a
template with 2 placeholders for script and styles.

The previous version was just the basic version to execute
javascript code, but that's not good enough since we need a
whole bunch of classes to be loaded.

A bash file processes the template into proper html, with the
help of the makeStaticLoader maintenance script we already had.

Updated demo.css, cleaned up redundant properties restyled
slightly to be more like the Vector skin and less "raw".

Fixed default $IP path in makeStaticLoader.php to work with simple mediawiki core installs having the extension in the
regular extensions directory, and prefixed __DIR__ so it
doesn't rely on the directory you call it from.

Change-Id: Ic789121dfeca08d9db69564d2ad2e52b3fa45de9
2013-02-08 17:47:10 -08:00
jenkins-bot 5ee7b12119 Merge "ve.dm.DocumentSlice does not extend ve.Node" 2013-02-08 23:22:22 +00:00
Trevor Parscal 9eed973ca5 ve.dm.DocumentSlice does not extend ve.Node
Change-Id: I11d28d6eb1c7db1d6b5796ec36c8e9a6f46b7c9e
2013-02-08 14:11:11 -08:00
Catrope 28512c9488 Use .static.isMeta to communicate meta-ness
This gets rid of the meta-specific hack in ve.dm.Document

Later on, I want to use this to get rid of meta-specific hacks in the
converter too, by pushing some of that logic into the ModelFactory.

Change-Id: I1dbee1654fa32d9c7cd521ec325b2553cde219d1
2013-02-07 17:17:34 -08:00
Rob Moen 4d3ccb7b99 Annotate newly inserted target text as a link.
Fixes (Bug 44086)

Changes:
ve.ui.LinkInspector.js
- Annotate fragment for affected range.
- Fragment returned by insertContent was a zero length range, therefore
no content was being annotated.  It is questionable whether insertContent
should return the affected range or not.
- Also changes behavior of editing existing link annotations so that the cursor is after the annotation rather than covering it when the inspector is closed

Change-Id: Ic53b9844f84781cad05ac1f63964c9aaf7de68c3
2013-02-07 16:06:08 -08:00