We need the whole DM doc to show reference diffs
correctly. We can filter down to the active section
after the conversion like we do with the editor.
Bug: T272813
Change-Id: I2081dd520ff414caadaed2efda955d600953c957
New changes:
c17816c5f Diff sidebar: Make font size slightly smaller
f8439f4cc Deep-freeze linear data
a8919f78e Deep-freeze linear data added by transactions
Local changes:
Fixes for deep-frozen linear model
Bug: T119236
Change-Id: Iae4362c8dab0f2bd335e24498f3e0522b8b1d4fc
New changes:
4589f5f00 Clear node offset cache when leaving read-only mode
68b0f8372 Show attribute changes as diffs when appropriate
Local changes:
Pull through for Ic6ec7f5ebabc912235ff7e688425f415f2c3ff20
Bug: T272603
Change-Id: I574fc56799ed165e63e16881429c4ed740850234
The conversion to a DM doc and subsequent cleanup is a generally
useful step that should be available as its own method.
Change-Id: Ia53c0a641b231bb81c25c011624357acf4dc42a3
This was used when we used to pass API errors to showMessage, but
is now unused by the two remaining users (missing edit summary, and
"press ctrl+enter to submit").
Change-Id: I8a6b4db78d4e451cf3ec85fcdfd8293328aaaa3c
* Remove custom internal events in ArticleTarget for every error type.
The indirection was just making it harder to figure out what data
goes where.
* Centralize the actual logging in ArticleTarget, instead of doing it
in a dozen methods.
* Directly use the error code from the API for 'save_failure_message'.
Previously we'd lose the original error code and generate a new one
in the event indirection stuff, except for 'responseUnknown'.
* Update 'save_failure_type' map. Remove unused error codes, update
the ones that changed, and sort in the order in which the types are
listed on the schema page.
Bug: T272162
Change-Id: Ied602c456f4b0e7e9bb135e3200bec5ce65641ba
Switching from visual editor to old wikitext editor results in a
page reload and loss of the mw.libs.ve.disableWelcomeDialog()
flag. Use an URL parameter to preserve the flag.
Bug: T235812
Change-Id: I3968e5b7ae536d45fd764a8b7c3ea1f6d616033f
The names in the schema are roughly following what's
done in Schema:TemplateWizard. The information if
templates have TemplateData will be logged seperatly.
Bug: T259705
Change-Id: Iafa7256f675dbfd6a5a6de794061901780e3c55d
Before we can integrate our new media search functionality into VE,
we need to add instrumentation that can measure the effectiveness of
the current media search tools to provide a baseline for comparison.
Bug: T265101
Change-Id: I980d6ae10045b0a4e56694473006196c2132c930
Similar to Ic79aba4d4364227c3ecf7fb5411e90532b531f44
This only works if the gallery goes unedited. Probably something needs
to be done in ve.ce.MWGalleryImageNode if we care to be complete.
However, as noted in T214648, the DOM diff'er doesn't traverse into
gallery content and notice these element names. So, it's purely
academic to be doing this anyways.
Bug: T266143
Change-Id: I37799076852fa6f062c9d85bcebb15998fb44a80
This parameter name was deprecated and replaced in 1.31. See also
Ie5fe2097cda45968bb080643d3afcac0b2868a6c
Change-Id: Ie9d6c70d3dfe3954504d3d698c122dceede7603d
originalDmDocPromise is dervied from target.doc, so if that changes
ensure the promise is cleared.
Change-Id: I51219e06109b0ccf1a17c920131b764862be85e1
Parsoid sometimes emits malformed links (with no 'rel') when a
misnested <figure-inline> tag is moved around. Converting them to
internal links, and adding the 'rel' attribute, makes the element no
longer match in selser, and causes dirty diffs. Alienate them instead.
Bug: T64473
Bug: T150196
Bug: T267282
Change-Id: Ic7b48eb2e61585445a1fb98dc2b516d3b6da3cc4
If a teardown has started, there should be a teardownPromise,
otherwise return a rejected promise.
Bug: T268358
Change-Id: Ia5cbd6b409a38f97243234ea7c87d24f71bdf3d6
In the new-page case, wgRevisionId will be 0 so it'll try looking for
parentRevId and the cast-to-int on an undefined will get us NaN. That
fails validation, so we should give one last fallback to 0.
It's _possible_ that we could instead make this an explicit check for
using wgRevisionId if it's anything not-undefined, but I'm not certain
about whether there are cases that wouldn't cover.
Bug: T237063
Change-Id: I8a38c0f3b8f8b2b596f5d0933e1a9e7f1326d7be
The first edit to a parameter will cause an event to be sent,
subsequent edits to the same parameter will not send an event.
Bug: T258920
Change-Id: Ibe663ce99a8fdf85a5add17186fb44fdbd4176bf
Record that a parameter was added, and whether it was known or
unknown--whether it's documented the TemplateData. Note that
`.isParameterKnown` returns true after an unknown parameter is added
to the template, so we need to set up the event early.
Bug: T258920
Change-Id: I5f8d8d06226474160a0a82c2e85a7fa4e22ba8cb
MediaWiki doesn't have such a limitation. This might have been copied
from the edit summary code, which used to be limited to 255 bytes.
Change-Id: I4afe9b1cde0663c47c0c2502b6e32116b912208b
Make ve.dm.MWTemplateModel#serialize ignore empty parameters if they were not
present in the transclusion before the edit. This avoids dirty diffs where an
user edits a template transclusion via VisualEditor, and the editor adds all
available template parameters to the edit wikitext, even if they were not
changed during the edit.
This logic was ported from the old Wikia-WMF VisualEditor project.[1]
Additionally, add tests for ve.dm.MWTemplateModel serialization.
---
[1] https://github.com/Wikia/app/pull/6450/commits/858eaa9
Bug: T101075
Change-Id: I35f8812724658904d30034db4e4684193a661c1e
This provides a consistent entry point for registering plugins on both
desktop and mobile, without needing to do strange things if the right
ResourceLoader module hasn't loaded yet.
Without this, registering a plugin module in JS requires ugly code,
and on mobile it wasn't possible at all.
Bug: T267692
Change-Id: Ie2c320c33ec2b064fba4fb45ba62545b9211439a
the former is no longer present
note: i assume the style is still needed, I have
not tested
Bug: T255718
Change-Id: I4e7851362fc0d64097aeff5ec1535f8fe7480682
Like transclusions, extensions can contain nodes of other types. This
hasn't been an issue because the legacy parser doesn't generate content
with these annotations. But, moving forward, as Parsoid becoming
responsible for more extensions. This is the case for the new ImageMap
implementation.
Matches I95767e466803f0744b6626204a0a3a1514fff174
Change-Id: I6ff81a01207e2734090c626b177e5f4d10bb6d61
New changes:
c53286843 Make NodeWindow a standalone mixin
a787fbef1 Update OOUI to v0.40.4
0d74538ee Refactor dialog logging out of ui.Command into ui.WindowAction
ea55ede8d [BREAKING CHANGE] Improve structure of special character definitions
Local changes:
Fix output of fetchSpecialCharList to match new format
Bug: T264146
Bug: T264690
Change-Id: I2a28bb9c3e54cb5f9308ab361dee99bc801b467a
A language code is better than an empty string.
The string would be used in the LanguageContext to
describe an annotation like <span lang="en-fakeVariant">.
Change-Id: Ibc18c238d6216927447ca26f336e9d973c6b93eb
Reference images are moved to Cite and used by Citoid.
Bug: T170919
Bug: T171292
Depends-On: I02041246dda1b3d3ad1bcc0b014fa022e8259b62
Change-Id: Id97659ed1fa64a1223a8957fefaf2a149edd0e9c
New changes:
cb4613044 FindAndReplace: Always highlight results when opening
cf480dbb6 ElementLinearData: Remap annotations on nodes too when sanitizing pastes
705743230 ElementLinearData: Remap annotations on moved meta nodes too
16be2c262 ElementLinearData: Remove moved metadata too when removing metadata
6d51882e2 ElementLinearData: Deduplicate annotations when sanitizing pastes
Bug: T191487
Bug: T259730
Bug: T262877
Change-Id: I0918ad9833c15998b1696ec40c1681c0d8f14236
I'm not 100% sure, but this looks like a copy-paste mistake to
me. Something like this (a subclass modifying the base class)
is not done anywhere else.
Change-Id: I24677c2deb721b68d1b534f1569c925b386d4d3d
The 'mwSignature' command replaces the selected content with your
signature. So basically, if you double-click this node, it gets
deleted and an identical one is inserted. This is useless.
I think I added this when this class was inheriting from
ve.ui.MWTransclusionContextItem, to override the command that would
open the transclusion dialog, but even then this should have instead
been `null`.
Change-Id: Id4492e36e9d89001df655e48b528d07eb608289e
These constructors only take a single argument, so the api config was
being ignored and the input would fall back to the default `new
mw.Api()`.
The order is changed so that the "api" config is merely a default,
and can be changed by whatever comes later.
The UserInputWidget currently doesn't accept an "api" config. This
will be fixed in Ifb1dd9d. But this is not a blocker. Merging this
patch here before the other won't have any consequence. It will just
continue to ignore the "api" config. ;-)
Change-Id: I15c35216c717576c6767927cac06ef72198fc95a
EditAttemptStep requires an integer, and just getting the value of an
input is always a string.
Bug: T261664
Change-Id: I57e76857086474365124b5b016902211b0e63166
The input field becomes a title autocomplete, showing small preview
images and searching only the File namespace.
This is consistent with how TemplateWizard behaves when editing a
File parameter.
Bug: T260886
Change-Id: I7a114e279436ec1ff6f7b8ab66443138ab12637f
This patch starts using watchlist related values from ApiEditPage
results instead of updating the "watch link" based on whether the
checkbox was selected or not at the time of saving the article.
This change does not depend on T261030 and can be merged without it
but T261030 needs to be fixed or temporarily watched items will not
display the right tooltip when hovering the "watch link" or star icon.
Bug: T260434
Change-Id: I2c844223620d7d28f36a0cd8ae3dee4b0c8ae5bf
Remove angle bracket from the url. The closing character is breaking
the hyperlinking and is not necessary anyway. Also bypass redirect.
Bug: T261126
Change-Id: Id9839623f5f77766042a0df0dfdd5f93d6faf625
If we call getBoundingClientRect() while the 'transform' animation is
still ongoing, it's going to return values reflecting the transform
- that is, the rect will be partially offscreen - which will trigger
our code that runs the animation again.
I don't know why this wasn't a problem on iOS 13.3 and earlier. Either
the timing was slightly different and the 'transform' animation was
able to finish earlier, or getBoundingClientRect() was buggy and
returned wrong values that conveniently worked right for us.
Bug: T259321
Change-Id: I6be0ddaeb6df54295fb14c45ba15fee41d61e33f
The MWParameterSearchWidget that shows a list of all available
template parameters displays the (human-readable) label and
description of each parameter (both given via <templatedata>), as
well as the parameter's internal name and aliases, if there are
any.
This turns out to be non-helpful in the majority of situations:
* When there is no <templatedata> yet, there are no labels.
Instead, the names are used as labels, which means they are
*all* identical and everything is shown twice.
* The same happens when manually adding an "unknown field". Simply
start typing, and you can add parameters with any name. What you
type is shown twice (actually 3 times, 1 time in the input
field, 2 times in the result widget).
* Many template parameters are already nice, human-readable. Even
if <templatedata> exists and specifies labels, these labels are
often identical to the names. There is no need to come up with
something else if the name is already good enough. (Exception:
Localizations, but these are rare.)
Furthermore, this is a *search* result widget. The pretty much
only reason the names and aliases are shown is because the user
can search for them, and needs to understand why a parameter was
found. This still works fine.
For comparison, when a parameter is required you will *never* see
it's name, because the parameter is always there, and never shows
up as a search result.
Change-Id: I6b1dca1c94b2c496930b5bfdfe1c6f76898faa2a
DOM attributes are not arrays, and so don't have Array#forEach.
Fixed regression introduced in 4545f53245.
Change-Id: I1f0f44747a0f8a376c1fb7cbb8862c096a9d1dc9
Items which are invalid titles will still get discarded if
the gallery is edited, but this is better than crashing.
Bug: T260584
Change-Id: I5dc20c233fd9ab41bdf48531829bddca2c5b25df
The interface has enough space for 2 or 3 lines of text.
(On mobile, the button has only an icon and no label.)
Bug: T260074
Change-Id: I50b08029f843e91d10b8c81985f6dfacbb96c8e7
The 'checkbox' part of the edit form is now allowed to contain
non-checkbox form widgets, but these are not yet supported
by VisualEditor. Until they are, this skips them entirely
in order that no broken form field be shown.
Bug: T259546
Change-Id: If62c11b174df235be611b9d32eb28e4759ba5f66
jquery.cookie is no longer maintained, and we're coming up on maybe
running into issues with sameSite which jquery.cookie doesn't support.
Moving to mw.cookie will let us centralize that fix.
Also, removed some dependencies on jquery.cookie in code that doesn't
seem to ever use it.
Bug: T252597
Change-Id: I8634cfd42c2a5ab3c9d712417a7d1a55508274fd
Rebuild the category list from the data we got from the API. This makes
it work regardless of whether we came here from activating on an
existing page, switching from source mode, or loading via an edit URL.
Because Parsoid doesn't include redlink status on the <link>s it
represents the categories as, we do have to manually update those
styles.
Bug: T251398
Change-Id: Iaaef3223816269bba1371fbb07956119a120c1ca
Change $originalContent to $editableContent, as counter-intuitively
the editing surface is attached inside $originalContent, while
$editableContent contains only the hidden existing page content.
It was not a problem previously because of the order.
Bug: T254518
Change-Id: I68f7ddb45f09dff475b183ccfeaf98e67b83066e
The mw:Placeholder attribute semantically means, "don't touch this,"
but french spacing should be freely editable. It's just a funny way
to write a plain wikitext space.
Bug: T254502
Depends-On: Ia164dd1318d45924aa965919e7939c6f817f5d0d
Change-Id: I56e0f0c6526649ea041e023698a48936176dec4b