Commit graph

1714 commits

Author SHA1 Message Date
Catrope ae48f152f9 Fix display of edit summary message in save dialog
Fixed by adding the specialMessages module which is only loaded once the
editor loads. Then after it's loaded we use the summary message from
there to update the (possibly broken) summary message in the save
dialog.

Change-Id: I67f5c59501cdf7c66c925cef8d4dd42b0f2cfde3
2012-06-21 13:39:27 -07:00
Inez Korczynski 6381709703 In case of IE use non-breaking spaces inside slugs instead of invisible separators - as in different browsers.
Change-Id: Ib6ae077206de1ad772e47e212a9f276f6b0081e0
2012-06-21 13:34:13 -07:00
Rob Moen 3f8863b05a If siteNotice is visible, add class and slide it up. On ve exit,
SlideDown fast if hidden by ve

Change-Id: I2a4104590de15da1302181a68d38bf271bcca249
2012-06-21 13:01:42 -07:00
Trevor Parscal d4e51abac6 Merge "Tear down the beforeUnload handler when redirecting after page creation" 2012-06-21 19:48:51 +00:00
Trevor Parscal 51809e728b Merge "Fix external link inspector" 2012-06-21 19:48:06 +00:00
Catrope 3a704b7491 Merge "Create init methods which hide and restore siteNotice if present." 2012-06-21 19:46:17 +00:00
Rob Moen f28a2399f4 Create init methods which hide and restore siteNotice if present.
Change-Id: I2fbc74ae46474cdb2559ecaa083cc7353b050937
2012-06-21 12:44:33 -07:00
Catrope fba013bedf Tear down the beforeUnload handler when redirecting after page creation
Change-Id: If182eb62068c3c585a98535cc6761d98ad7dd56d
2012-06-21 12:41:39 -07:00
Catrope 5784d2b55c Fix external link inspector
Wasn't loading the link target due to a typo

Change-Id: I77533f949363e79dab9b478e6ba10d05b9486acc
2012-06-21 12:40:28 -07:00
Trevor Parscal 437649e062 Merge "Fix problem in hasSlugAtOffset when a given offset is out of range of the document - so no node is returned from getNodeAtOffset" 2012-06-21 18:19:51 +00:00
Inez Korczynski 82d3040d76 Fix problem in hasSlugAtOffset when a given offset is out of range of the document - so no node is returned from getNodeAtOffset
Change-Id: I91951528c21ddd57f56d7f4854d0e626d96e04a1
2012-06-21 11:09:41 -07:00
Trevor Parscal f35c8adac8 Merge "Aggressive keyboard shortcut fix for all browsers and platforms" 2012-06-21 18:09:24 +00:00
Christian Williams 8f7ce742de Aggressive keyboard shortcut fix for all browsers and platforms
Change-Id: Ic9e6359a06752861a05526dba090b08ccd39b83f
2012-06-21 11:09:30 -07:00
Inez Korczynski 847fddd639 Fix for drawing selection in IE - temporary approach
Change-Id: Ia944e4c96b1d1d78274f9c23e7120954f694ca08
2012-06-21 11:04:26 -07:00
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
Gabriel Wicke cc1afb2ad3 Support dt/dd transitions in the middle of the stack
Change-Id: I1d75caa7782d02a2c33413a078e99b17ccc4141c
2012-06-21 18:40:40 +02:00
Gabriel Wicke b3bd2ffe8d Fix definition list parsing and round-trip single vs. multi-line dt/dd
* Removed murky ' :' -> ' :' replacement in tokenizer. This breaks four
  parser tests, and should be fixed in a token stream transformer or DOM
  postprocessor. This replacement clashes with round-tripping, and is not
  terribly important visually.
* Added stx:row annotation to single-line dt/dd pairs and use it to preserve
  single-line syntax in the serializer. There is no attempt yet to support the
  addition of nested lists in an originally single-line dd. We'd need to look
  ahead in the serializer to support this. Perhaps the editor can simply drop
  data-mw in that case.
* Switched default dt/dd serialization to multi-line. This supports all nested
  lists and multiple dds.
* Don't close dls when switching from dt to dd or back in the token stream
  ListHandler.

Overall 290 round-trip tests are passing now (up from 284, some due to  ,
some due to lists). The number of passing parser tests dropped slightly from
303 to 297 (or 301/295 on weekdays other than Thursday).

Change-Id: I85ff40571833713388c6523e6a4ba2e94daa3807
2012-06-21 17:34:25 +02:00
Gabriel Wicke e584e35ecb Improve nested definition list serialization
Basically only prefix all bullets if the serialization output is going to be
in start-of-line context. The test for that is currently inline, but should
perhaps be factored out to a method or state flag instead.

We could alternatively consider to return the start-of-line prefix and let it
be used in _serializeToken in case we end up in start-of-line context.

This patch also fixes a newline issue on input like this:

:d1
::: d3

Both the list and list item handlers now set the startsNewline flag
dynamically depending on the context, so that we don't depend on the
suppression of newlines from list syntax by the singleLineMode any more.

There is still an extra newline inserted between list items in the following
example:

;t1 :d1
;;t2 ::d2

This looks like a bug in the produced DOM and not in the serializer, since the
outer definition list is closed and re-opened between d1 and t2.

Change-Id: I78e3a1ef34cf9159d5a1e86fb64c774ff111e71d
2012-06-21 15:28:43 +02:00
Gabriel Wicke ab286d6a59 Empty elements only use the start handler info
Thus move the 'endsLine' attribute to the start section.

Change-Id: I8490d866b84aa99205ca9e8e3ee137026fb18501
2012-06-21 10:30:11 +02: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 &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
Gabriel Wicke 5ff4aa4c2d Merge "First attempt at the definition list bug (work in progress)" 2012-06-20 22:03:16 +00:00
Catrope 37600d020c Add ve.dm.Transaction.translateOffset() and translateRange()
Change-Id: I21bde38056862a1de167646f6cf3030e38d3497b
2012-06-20 14:52:44 -07:00
Gabriel Wicke cf32b34b0a First attempt at the definition list bug (work in progress)
The main issue is that the bullets from dd/dt were not stored on the stack. I
added a separate field for it in each stack entry, which now fixes the basic
indent case without (afaik) breaking anything else.

There are still some newline issues, and the need to handle the single-line
dd/dt vs. the multi-line variant.

Change-Id: I65939c05e2c5dde0789bf8aefd7651161a2f137c
2012-06-20 23:51:39 +02: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
Gabriel Wicke e8c517e48e Merge "Improve preformatted text handling" 2012-06-20 19:08:48 +00:00
Catrope 9f5f43f18a Fix residual selectNodes() breakage from fc4ba3019a
Change-Id: Icc317eab71d4e360905e902a0ae7cc88deab4cbe
2012-06-20 11:39:20 -07:00