These changes allow us to be more aggressive in autolinking ISBNs (no
need anymore to wait for the user to type a space or move their
selection) and more correct in autolinking RFCs and PMIDs (stray
spaces and dashes no longer mess them up).
* ISBN numbers can only be 10 or 13 digits long. We don't need to
handle arbitrary lengths.
* If a number does not begin with 978 or 979, it's the ISBN-10 variant
and we can autolink it as soon as the user types 10 digits.
* If a number begins with 978 or 979, it can be either.
* But if we already have 13 digits typed, autolink immediately.
* Otherwise, use a delayed sequence to see if it ends at 10 digits.
* RFC and PMID numbers can consist only of digits, no optional spaces
or dashes are allowed. Typing a space or dash will immediately
autolink the number.
Bug: T117165
Change-Id: I6a085cd78d910661245a351f3ceb3fabe2f093cf
The trailing space at the end of the regexp is no longer required to
prevent matching (and executing) too soon. We also don't need to know
about trailing punctuation.
However, to prevent the match from ending in the middle of typing, we
have to allow for ' ' and '-' at the end of the match.
Tweaked tests to better match the intent now that a trailing space is
not included, but they pass without changes too, the command is quite
permissive.
Bug: T117165
Depends-On: Ie36046fa43ce49f8a25c99f2de577eb296d68a51
Depends-On: I2af0a738afa43295bf6d7d612cac4349bc6cd20d
Change-Id: I7c28d5c93b1a441387ad05a75846af83d2b21b6a
The floating tooltip breaks inside OOUI dialogs. In the absence
of an upstream fix, just anchor it to the bottom of the textbox.
Bug: T160245
Change-Id: I9055c4e4947f5581605bd490f076415c1edaf8ec
After 79ccfb9372cb57afa569036ef39ead13abfba673, MediaWiki's `<pre>`
tags get rendered as `<pre typeof="mw:Extension/pre">` in Parsoid HTML.
MediaWiki's indent-pre syntax (block indented by a single space) is
still rendered as `<pre>` in Parsoid HTML, however.
Indent-pre is still handled by MWPreformattedNode (no changes).
Introducing MWPreNode, which will handle `<pre>` extension tags,
and MWPreDialog to change its contents (and allow converting
to MWPreformattedNode).
Pieces copied from MWGalleryNode, MWLinkNodeInspector, CommentInspector.
Possible future improvements:
* Add a specific icon for MWPreContextItem
* Avoid API roundtrips for rendering (but rendering wikitext <pre>
is not as simple as it looks)
* Consider a way to insert these other than '<pre' sequence
Bug: T159900
Change-Id: I5bc4ea6e5d893736f65ef0dd43b08c18cb1a1e85
Updated tests to stop assuming that MWWikitextStringTransferHandler
always goes through an API request and Parsoid.
Bug: T117165
Change-Id: I24dffaaf3b4051b1b807ec29ac456d24da2f1fe9
A gallery tag is parsed line by line, so captions
(and other image data) should not contain line breaks
Bug: T153373
Change-Id: Ib1d1c18216d07c83b2d4358d2dda71c9d17e3e44
It's actually a bit surprising that the only thing broken by using
OptionWidget instead of MenuOptionWidget is some missing styles.
Change-Id: I3961fedbfc61f2f17d91dc7375d47a3cdff2a257
It doesn't work, you can't turn a MWMagicLinkNode into text by
clearing its styling. (You can still do that by clicking 'Edit',
'Convert to simple link', 'Clear styling'.)
`clearable = true` was being inherited from ve.ui.LinkContextItem.
Change-Id: Ib40e952554966fb74b3e72662a6e1e44ad748a57
Fixing T107251 made it so that clicking "save" always switched back to the
save panel momentarily, causing a flicker of "maybe I can edit this"
experience. With this change, we can only switch back to the save panel when
saving from other panels if a message is being shown.
Bug: T156891
Change-Id: I8f67693283e61c39cfce40ee12d5c6788dd97932
We don't support editing <div>s right now (as they're BranchNodes) nor
<span>s (as they're annotations), but most of those are inside templates
and so not editable in VE anyway.
Bug: T157989
Change-Id: I647b2a544fd16952696d0de8d07cb72189b27ecb
We now use dialog's overlay in every case where we have a FieldsetLayout
or a FieldLayout with a help popup inside a dialog.
Bug: T100571
Change-Id: I8bd0ed430637feca63ec0f13cb7e1e1c659391a5
The dialog already supports cancelling by pressing Escape,
but the usual dedicated button was missing.
Change-Id: Ic63b5b59940a43474051466bdbbba0dbeb4342a9
This is currently used to display a warning about missing edit summary
and to display a CAPTCHA field. They now appear in a separated area at
the bottom of the dialog, which slides into view when a message is
added.
Change-Id: I7541284a92d5fd2fa8f469d479e059098c59c0ac
* Remove the checkbox; an empty field, or a value exactly equal to the page
title means no displaytitle.
* Automatically fill the field with the current page title
* The field was mispositioned
Bug: T155818
Bug: T156665
Change-Id: I46db6b14616c9a021e757284972537cac00546a1
Firefox throws exceptions when trying to focus hidden inputs. Using the
"preview" keyboard shortcut entirely bypasses the save panel, but the ready
process assumes it'll always be opened first.
Bug: T153958
Change-Id: Ifb3861116565e77c30b3874fe47889298c3ace6d
Make inspectors inheriting from MWLiveExtensionInspector
and dialogs inheriting from MWExtensionPreviewDialog
update their 'done' action every time updatePreview is
called. Since both mix in ExtensionWindow, two new methods,
updateActions and isModified are added there.
This should make it more difficult to insert an empty node
accidentally or create a transaction just by opening and
closing an inspector or dialog.
For more complicated dialogs, or inspectors or dialogs
that don't live-update, this behaviour will have to be
implemented separately.
Bug: T155330
Change-Id: Iacafa01fcd419faaec9b112c96be86693a57d561
The hacks contained within context were ancient and no
longer used, and thanks to a typo in mw.MobileArticleTarget
neither of these classes was being used anyway.
Change-Id: I52f2b6d5aa5ddbcc45ac6107eaf9407570b73672