We were selecting outside the annotation, when converting a LinkNode to a
LinkAnnotation. This meant that typing would overwrite the annotation as well
as the label. Speculatively, this is probably a side-effect of recent changes
to how nails and cursor offsets interact.
Bug: T121448
Change-Id: Ib2274bc5857294c5b691b3c3567b135d68bfa596
Depends-On: I3954c7f8f8e5870b13a8f6c4f0e86fb3b20b3cd3
This causes the inspector to take focus early (line 291) on
first load, and is not necessary as this method fires when
needed anyway.
Bug: T129228
Change-Id: Ia69f76b68e89daf5cb01449c40e71de4ec32d400
Otherwise the selection will/won't contain the opening node of the
link, depending on where in the paragraph it is. This makes the
experience of starting to type unpredictable to the user. By forcing
it to always have the contents of the node selected, typing always
just updates the label.
Bug: T114643
Depends-On: I7c46a917d9752145174919f41066b4841b203218
Change-Id: Ic1c573c2c28ced49f685ec6082506cb20d5163cd
If you create an autolink in the middle of bolded text, the magic link
should also be bolded. Similarly, if you convert a bolded simple link
to a magic link, the magic link should stay bolded.
Change-Id: I38c7f3c0c275851049088a37f3b37d815ed38e4e
Applying staging doesn't emit an update event on the node, so
forcefully emit one with 'staged' equal to false, so the full
error is rendered (if present).
Logically depends on I8ebb26d4bc in core.
Bug: T114480
Change-Id: I7ba54b67982fc5b10839426cdc216e14c0e33c01
As part of the plan to render extension errors in the
inspector instead of the view, append an element to
contain the error. More specifically, the element is
a div that contains a LabelWidget (in which the error
message is displayed) and a ButtonWidget (to expand
and collapse the error).
Initially the error element is hidden, but if Parsoid
returns an error, the element will be shown. If the
error is longer than 1 line, it is truncated but can
be expanded. On closing the inspector, any remaining
error is collapsed and hidden.
Depends on I6002d9870d2b to work
Bug: T113172
Change-Id: Ie84130d4ac0da9a738bf98ad0a3677d47566d585
Call updatePreview in insertOrUpdate node, when closing the
inspector. If edits have only been made to attributes that
don't affect the rendering, updatePreview will not have been
called, so the model won't have changed. Therefore
updatePreview should be called every time the inspector is
closed to make sure such edits are applied.
Bug: T113078
Change-Id: I48fb291487f76fc515f122646d205366a60dca62
New changes:
18e46b6 [BREAKING CHANGE] LinkAnnotationWidget: Abstract .text property to getTextInputWidget
Local channges:
* MWLinkAnnotationInspector: Use new getTextInputWidget method
Change-Id: Ia33797d612be7b4521e7212047a38480ee2520df
* Don't insert/update/remove nodes on cancel in MWExtensionInspector
* Don't forget to popStaging on cancel in MWLiveExtensionInspector
Bug: T110992
Change-Id: I1e30206595e304eb502c7e745bf5e00d145d12d7
Implement a special node type, context item, and inspector for
ISBN/PMID/RFC magic links. Add buttons to the link inspectors
to convert back and forth between "simple" links, and magic links.
Depends on I5d000d8b63dafdfe0a2753069d3f0ac5b03b8829 in Parsoid
for clean round-tripping of localized ISBN magic links.
Bug: T63558
Change-Id: Id5b7a2ae3c80b0e5eed598f0bd024d3e94f7e9aa
You can now do this from the context menu. No need to have extra buttons, and
this makes it consistent with the MWInternal/MWExternal link inspector.
Bug: T109646
Change-Id: Ifd4b3645c66ba2f32ccee7e2848967cf5e7ec82e
Add ve.dm.MWInternalLinkAnnotation.static.newFromTitle to build an
appropriate internal link annotation from a mw.Title. Tweaked some
method signatures to avoid repeated reparsing of the title text.
Also refactor ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
to explicitly return a boolean indicating whether the result was determined
to be an internal link.
Bug: T64816
Change-Id: I74385d7b3ede1794398dabb749185f4080509b99
LinkAnnotationInspector in VE core calls
this.setAnnotation( null ); on teardown, which causes
MWLinkAnnotationInspector#onInternalLinkChange to be invoked
with a null fragment.
Bug: T103176
Bug: T104231
Change-Id: Ibb50ba1696609bebdfc2857ea292ee30b6b5126a
Get the HtmlDocument in a different way that doesn't involve
ve.init.target.
For page (non-Flow) MW VE, I checked that it yields the same result.
Bug: T103176
Change-Id: I54bdf4f29f6acf4359be45b5b2ddfd23b5835c34
Although an internal link is unlikely to be a valid external link, this
prevents an annoying experience when the user switches to external and
then back to internal while exploring features.
Change-Id: I178cf3f641db683f5dd0a49c246c204ded89760c
Don't use the full IndexLayout for now as it doesn't
work easily in variable height situations.
Depends on this feature being preset in MW core.
Bug: T97878
Change-Id: I5d949bf69b0721b288c37c1f12210b0265658eb5
New changes:
68959f2 Localisation updates from https://translatewiki.net.
2c0224d [BREAKING CHANGE] Link widget refactor
f81eefa [BREAKING CHANGE] Rename LinkInspector to LinkAnnotationInspector
Local changes:
Adjust for link inspector refactor
Create separate widgets for internal and external link
annotations. Remove annotation specific logic from link
target input widget.
Change-Id: I054c3fe7ac9c61fbc3302471abd58cab89fed5a4
MWExtensionNode:
* Inherit from LeafNode at the top level. Inline and block only
differ in CE where inline has isContent set.
MWAlienExtensionNode:
* Inhert from MW(Inline|Block)ExtensionNode respectively. Both
mixin MWAlienExtensionNode.
Bonus:
* Bring in paragraph unwrapping on inline nodes from MWMathNode
Bug: T93712
Change-Id: Ib04234f740cf1f27c861d8b3cfeea5e323b94678
Also fix up logic duplicated between ExtensionInspector
and LiveExtensionInspector.
BREAKING CHANGE:
* nodeModel property no longer exists, use NodeInspector's modelClasses
property, which is an array.
Bug: T93592
Change-Id: Ib0131c9485a903d73b770090bf8a938056782ba3