Commit graph

12525 commits

Author SHA1 Message Date
jenkins-bot 1cbe8e5313 Merge "Compute entire old DM doc for section diffs" 2021-01-26 15:37:13 +00:00
James D. Forrester cb9a31adac build: Upgrade eslint-config-wikimedia from 0.17.0 to 0.18.0 and make pass
Change-Id: I8c45850965ed5b96a0980de70a25f6d5b355350d
2021-01-25 10:21:32 -08:00
Ed Sanders 865a59d640 Compute entire old DM doc for section diffs
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
2021-01-24 23:12:26 +00:00
Ed Sanders f8c403dffb Update VE core submodule to master (a8919f78e)
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
2021-01-23 19:55:14 +00:00
Ed Sanders d831370ed4 Update VE core submodule to master (ca6a97f42)
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
2021-01-22 20:40:28 +01:00
Ed Sanders 5a51096e5e MWExternalLinkAnnotation: Call core method to evaluate diff
For this key ('href') the core method is identical.

Change-Id: Ibec341c8a5a685f13e690be4107e3066fc7d7040
2021-01-22 17:33:24 +00:00
Adam Wight 9a1072a960 Add edit count bucket to VisualEditorTemplateDialogUse events
Bug: T269986
Change-Id: I68cc15d58a23149a6edc71cac229f6b29d33fd92
2021-01-21 13:17:03 +01:00
Bartosz Dziewoński 1af7c4da6a Fix typo in doc comment
Change-Id: I47d189564928dfd056d83e27b2ee6db23a98a83e
2021-01-21 00:15:13 +01:00
jenkins-bot 932a6a843f Merge "MWWikitextStringTransferHandler: Factor out Parsoid->DOM conversion" 2021-01-20 22:11:34 +00:00
Ed Sanders 38aeaf60f6 MWWikitextStringTransferHandler: Factor out Parsoid->DOM conversion
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
2021-01-20 19:49:27 +00:00
Ed Sanders 1ec49384dc MWSaveDialog: Use MessageWidget (inline, warning) to show save dialog warnings
This is the same style that is recommended for form warnings.

Change-Id: I163f5180c66b9eb165a610184b153bb1da99caab
2021-01-20 19:41:17 +00:00
Ed Sanders e20decc77c MWSaveDialog: Remove wrap option from showMessage
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
2021-01-16 16:22:23 +00:00
Ed Sanders 598cb943de MWSaveDialog: Restore focus to edit summary widget after resize
Change-Id: I1fc1e43d947e9e8472a470bb5eabf67fda07be5d
2021-01-16 16:18:18 +00:00
Ed Sanders 443eaded40 Move newline-stripping filter into MWEditSummaryWidget
Edit summaries should always strip newlines, wherever
this widget is used.

Change-Id: I37177771fef831037067d6244fb27cba5e06528b
2021-01-16 16:16:49 +00:00
Bartosz Dziewoński df43a1ef96 Update save failure logging for EditAttemptStep schema, simplify code
* 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
2021-01-15 20:06:20 +01:00
jenkins-bot 187a5fe7ac Merge "Preserve vehidebetadialog URL flag when switching editor mode" 2021-01-13 17:38:22 +00:00
jenkins-bot 3bd0d4056a Merge "Instrument media search interactions in MWMediaDialog" 2021-01-11 20:23:40 +00:00
jenkins-bot c4676d025a Merge "Try/catch Uri creation" 2021-01-05 20:11:48 +00:00
jdlrobson b89e97f8d8 Try/catch Uri creation
This is generating hard to filter logspam.

Seen on:
https://no.wikipedia.org/w/index.php?oldid=prev&diff=20998556&title=Uformelt%20spr%E5k

Bug: T270331
Change-Id: I4ba537dbb942e977cb01d5943e83e4646cbccfe0
2021-01-05 19:39:45 +00:00
jenkins-bot 883d37fbb2 Merge "ArticleTargetLoader: Allow customizing 'editintro' parameter" 2021-01-05 14:23:28 +00:00
Gergő Tisza c88ee8cd54
Preserve vehidebetadialog URL flag when switching editor mode
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
2021-01-04 19:54:32 -08:00
Ed Sanders 3cde92d60e AceEditorWidget: Fix toggleLineNumbers
Change-Id: I1a48e4351b2249b1ccf0af5c9b2fadd9a97d5f04
2021-01-03 00:23:08 +00:00
Bartosz Dziewoński 504e47e03a ArticleTargetLoader: Allow customizing 'editintro' parameter
Bug: T269310
Change-Id: Ic77ce84172f114795708f48a4a7457b2965568f9
2020-12-17 02:01:09 +01:00
Arlo Breault 2402f430b4 Preserve inline media tag name in galleries across edits
Follow up to I37799076852fa6f062c9d85bcebb15998fb44a80

Hat tip to Bartosz for pointing this out.

Change-Id: Ic2968240a015bac2f831203e586535d2f9574963
2020-12-16 17:28:51 -05:00
WMDE-Fisch 2ce9934ab9 Add tracking of template usage
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
2020-12-16 12:56:45 +01:00
jenkins-bot ac04c9a644 Merge "Switch back to using <span> for gallery images" 2020-12-16 01:01:31 +00:00
jenkins-bot 5783dc75cd Merge "Preserve the passed in inline media tag name in gallery" 2020-12-16 01:01:28 +00:00
jenkins-bot 6029c3565a Merge "Switch back to using <span> for inline images" 2020-12-16 01:01:24 +00:00
Eric Gardner a7c1e4e985 Instrument media search interactions in MWMediaDialog
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
2020-12-15 14:45:10 -08:00
Arlo Breault 895274c20b Switch back to using <span> for gallery images
Similar to I74fe96a47d8a4d7717891c16e49f5a4d6599018a

Bug: T266143
Change-Id: I632cff28ec428828d82fcd7cc66e5545c45c2161
2020-12-15 15:43:48 -05:00
Arlo Breault e3daaaf280 Preserve the passed in inline media tag name in gallery
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
2020-12-15 14:42:00 -05:00
WMDE-Fisch 094a9aa044 Replace deprecated doNotIgnoreMissingTitles
This parameter name was deprecated and replaced in 1.31. See also
Ie5fe2097cda45968bb080643d3afcac0b2868a6c

Change-Id: Ie9d6c70d3dfe3954504d3d698c122dceede7603d
2020-12-15 12:52:55 +01:00
Ed Sanders 85a856e016 MWDefinedTransclusionContextItem: Add param getter
Change-Id: I7fdd4810118e72b9719b840fa5e0887006a74a25
2020-12-14 14:29:06 +00:00
Ed Sanders 5e170b63ca Switch back to using <span> for inline images
Bug: T266143
Change-Id: I74fe96a47d8a4d7717891c16e49f5a4d6599018a
2020-12-13 18:02:06 +00:00
jenkins-bot 4974c3a362 Merge "Reset originalDmDocPromise when setting doc" 2020-12-11 18:33:22 +00:00
jenkins-bot 5edd5045aa Merge "MWInlineImageNode: Rename figureInline to container" 2020-12-11 18:29:31 +00:00
jenkins-bot 46a00601a3 Merge "Preserve the passed in inline media tag name" 2020-12-11 16:42:50 +00:00
Ed Sanders eafa3d2861 MWInlineImageNode: Rename figureInline to container
Change-Id: Ieda967dbd26532f44f71b4388e2357e780a381ce
2020-12-11 16:09:42 +00:00
Arlo Breault 6acddba351 Preserve the passed in inline media tag name
Bug: T266143
Change-Id: Ic79aba4d4364227c3ecf7fb5411e90532b531f44
2020-12-10 18:19:35 -05:00
WMDE-Fisch 185875f5ea Update link to TemplateData spec
Change-Id: I656ac283e38540c915c5e38e703caec3e5f6419b
2020-12-10 16:48:33 +01:00
Ed Sanders 069e9c68ed Reset originalDmDocPromise when setting doc
originalDmDocPromise is dervied from target.doc, so if that changes
ensure the promise is cleared.

Change-Id: I51219e06109b0ccf1a17c920131b764862be85e1
2020-12-08 17:28:28 +00:00
jenkins-bot 4f91dbbf75 Merge "Add 'close' flags to closing actions in dialogs" 2020-12-07 19:37:44 +00:00
Ed Sanders 2f4140117a Add 'close' flags to closing actions in dialogs
Change-Id: Ib0eb947432c3cdaa316d1a8116d4ab91f791930d
2020-12-07 18:53:16 +00:00
jenkins-bot eb9ab46d16 Merge "ve.dm.MWExternalLinkAnnotation: Alienate malformed links" 2020-12-07 14:22:35 +00:00
Bartosz Dziewoński d52097cfdb ve.dm.MWExternalLinkAnnotation: Alienate malformed links
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
2020-12-07 13:56:43 +00:00
jenkins-bot 97156150fa Merge "CollabTarget: Fix focus of authorList" 2020-12-04 19:06:08 +00:00
Ed Sanders 4b9ad322ea CollabTarget: Fix focus of authorList
Change-Id: I91e4fb75af6b65df9da2d8b2f7277e685d54d0f8
2020-12-04 17:59:48 +00:00
jenkins-bot b4c26620e1 Merge "Send EventLogging when adding template parameters" 2020-12-04 17:09:28 +00:00
jenkins-bot 18be32a9dd Merge "Send EventLogging when editing parameter values" 2020-12-04 17:06:22 +00:00
jenkins-bot 4e436dc2ea Merge "Send an event when the template doc link is clicked" 2020-12-04 16:50:49 +00:00
jenkins-bot 2cba844265 Merge "ve.dm.MWInlineImageNode: Alienate malformed figures" 2020-12-03 11:49:46 +00:00
Thiemo Kreuz fb0e33f987 Fix incomplete return in DesktopArticleTarget.tryTeardown()
If a teardown has started, there should be a teardownPromise,
otherwise return a rejected promise.

Bug: T268358
Change-Id: Ia5cbd6b409a38f97243234ea7c87d24f71bdf3d6
2020-12-02 21:22:10 +00:00
Ed Sanders 3e6d5c6817 Remove upstreamed clearfix
Change-Id: I9c5c56bd8a30b96b43fe680bcc8a7151de5f78be
Depends-On: I840ecdf2cfd3f4fba51418199346164fd0c439b6
2020-12-02 21:21:49 +00:00
James D. Forrester 688edf1d64 build: Use "Grade A" rules for stylelint
Change-Id: I54b16407450960fefd5522a25cb733853d2f9372
2020-12-01 08:35:03 -08:00
David Lynch efd2cc0d03 Give revision_id a fallback that'll validate
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
2020-11-30 11:17:23 -06:00
jenkins-bot 2b34787241 Merge "Don't block media dialog on initialising upload booklet" 2020-11-26 20:10:47 +00:00
Adam Wight 9925ad3a88 Send EventLogging when editing parameter values
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
2020-11-26 11:13:14 +01:00
Adam Wight 46dad92e7d Send an event when the template doc link is clicked
Bug: T258920
Change-Id: I579472f2f9a683f63a08abc97f69c080e84bed35
2020-11-26 11:12:20 +01:00
Adam Wight 19723ba681 Send EventLogging when adding template parameters
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
2020-11-26 11:10:48 +01:00
jenkins-bot df622d3b9e Merge "Remove maxLength from new section title in NWE" 2020-11-26 00:03:45 +00:00
Bartosz Dziewoński c49f919d90 Remove maxLength from new section title in NWE
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
2020-11-26 00:22:36 +01:00
Ed Sanders 6a238b784e stylelint: Remove needless disables
Change-Id: I83c778f1b08b96e6a34068f497c7a72f2887ad4c
2020-11-19 23:38:11 +00:00
James D. Forrester 726e63cca7 build: Upgrade stylelint-config-wikimedia from 0.10.1 to 0.10.3
Change-Id: Idca06a9c5f8e3b1fa7be156613380e1ed99973fd
2020-11-19 23:37:03 +00:00
Máté Szabó d127dc48b7 ve.dm.MWTemplateModel: Don't add spurious empty parameters
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
2020-11-16 19:54:44 +01:00
jenkins-bot f612cb90d5 Merge "ArticleTargetLoader: Add ve.loadModules hook" 2020-11-11 01:37:37 +00:00
Roan Kattouw 4f5c27be09 ArticleTargetLoader: Add ve.loadModules hook
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
2020-11-10 23:31:07 +00:00
Bartosz Dziewoński 0337f665af Update reference paste test with "reference" class
Needed by I9d6856f03071c09617b8ae7db938135a3e30fe8e in Cite.

Change-Id: I61a2132f3876e2d9567d985358f51eb51c479813
2020-11-06 18:50:00 +01:00
Bartosz Dziewoński 80691d9404 ve.dm.MWInlineImageNode: Alienate malformed figures
Parsoid sometimes emits empty <figure-inline> tags. We can't edit
that, so alienate them, instead of throwing exceptions.

Bug: T267282
Change-Id: Ie6a659a9137a1c5e82f10e0a51abb5d60f68d43e
2020-11-05 22:47:35 +01:00
jenkins-bot 46678e1d57 Merge "Allow alien extension node encapsulation wrappers to be of various types" 2020-11-05 00:55:37 +00:00
jenkins-bot 098778cada Merge "Tweak alignment of save checkboxes" 2020-11-05 00:40:37 +00:00
jenkins-bot b92f3ac6d7 Merge "[vector modern] VisualEditor margins are tied to Vector variables." 2020-11-05 00:33:25 +00:00
Ed Sanders 5e1e619949 Tweak alignment of save checkboxes
Change-Id: Id48eb28535ecc2decc1f3203ac92237137738f2f
2020-10-27 21:43:53 +00:00
jdlrobson 80415f3b0f Change selector vectorTabs => vector-menu-tabs
the former is no longer present
note: i assume the style is still needed, I have
not tested

Bug: T255718
Change-Id: I4e7851362fc0d64097aeff5ec1535f8fe7480682
2020-10-26 18:17:42 +00:00
Arlo Breault d02c0bbf45 Allow alien extension node encapsulation wrappers to be of various types
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
2020-10-20 11:44:54 -04:00
jenkins-bot 37cd9d77a3 Merge "Convert ve.init.mw.DesktopArticleTarget.init-vector.css to LESS" 2020-10-15 14:52:15 +00:00
Gergő Tisza de7c6e913b
Avoid undefined in Math.max
Math.max( undefined, x ) is NaN.

Change-Id: I60bde01d4fc6e9a52182753f79232045f48d1f8b
2020-10-14 23:51:02 -07:00
jdlrobson 9954dd0bc4 [vector modern] VisualEditor margins are tied to Vector variables.
Bug: T259331
Bug: T259272
Depends-On: Ibbc6f1905ea384a3d159088e3f5eca947eb6ec08
Change-Id: Ic918e9c4ba580ecc54ef51607ce9698e2461c679
2020-10-14 14:52:32 +01:00
Ed Sanders 6c36e403aa Convert ve.init.mw.DesktopArticleTarget.init-vector.css to LESS
Change-Id: I5e7c56ebf9e68706e8fc39b1bd4bf81be878ffe4
2020-10-14 13:11:48 +01:00
David Lynch cf9d3a29df MWLinkAction: update call to window.open
Bug: T264146
Change-Id: Ie3f91cb0ca281d57976b71045f2b54ec96160068
2020-10-08 18:37:47 +00:00
Ed Sanders f0891fc174 Update VE core submodule to master (68c5f1a3c)
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
2020-10-08 19:09:12 +01:00
James D. Forrester 8539f75b54 MWCategoryMetaItem: Allow trailing whitespace (e.g. \n) in category names
Encountered on a page with [[d:Template:Translation_categories]].

Change-Id: Ib2df3518e3047d32626a156c32d5ef9e37ea9b3a
2020-10-06 12:17:30 -07:00
Ed Sanders 9811b36fc7 Don't set alt text if attribute was originally 'null'
Bug: T264533
Change-Id: I0ae1f6e6b770f90579ea1cefa2ac564f655d43ae
2020-10-04 17:57:02 +01:00
Ed Sanders 0f5cd19e08 Don't block media dialog on initialising upload booklet
Bug: T264441
Change-Id: If2533c7bdf08e92443b28f267b1ede22699a4179
2020-10-02 20:32:49 +01:00
Ed Sanders 4915cbaed4 Return language code if language name not found
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
2020-10-02 14:54:19 +01:00
jenkins-bot 05ec421073 Merge "Don't navigate back immediately when trying to teardown" 2020-10-02 00:22:23 +00:00
jenkins-bot e247a605d2 Merge "Fix cancelled browser-back on desktop" 2020-10-02 00:22:19 +00:00
Ed Sanders 5c84f0cd88 Rewrite EducationPopup so it isn't a mixin
Reference images are moved to Cite and used by Citoid.

Bug: T170919
Bug: T171292
Depends-On: I02041246dda1b3d3ad1bcc0b014fa022e8259b62
Change-Id: Id97659ed1fa64a1223a8957fefaf2a149edd0e9c
2020-09-24 21:33:50 +01:00
James D. Forrester 2a7f31b5b9 Update VE core submodule to master (95f9f5681)
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
2020-09-22 18:56:17 +02:00
Ed Sanders 27e19025a4 Fix cancelled browser-back on desktop
Bug: T263464
Change-Id: I808f7effffca5fbe9d8416d447df61dde57776c3
2020-09-21 16:23:18 +01:00
Ed Sanders 587dc1a3c8 Don't navigate back immediately when trying to teardown
Let MobileFrontend deal with all the history management.

Bug: T247171
Change-Id: I666b31285761c80407b4f0fe65c48f76b3e72bf2
2020-09-21 15:21:24 +01:00
jdlrobson 29efc96cd5 Fixes: Error: Bad constructor arguments
Change-Id: I2f1146946bfb96d50f9580f2f7a9bd5dcb926ef1
2020-09-17 11:00:41 -07:00
Ed Sanders 7a61992fbb Store revid as undefined when document doesn't exist (revid=0)
Bug: T262838
Change-Id: I9ac1815e281544916ea9aded8e80039245c9d871
2020-09-16 11:13:38 +00:00
jenkins-bot 9e256b9a5f Merge "Drop iceweasel and blackberry tests for new jQuery.client" 2020-09-10 14:25:36 +00:00
Ed Sanders 1c9bb2518c Drop iceweasel and blackberry tests for new jQuery.client
Change-Id: Ie5fd40415b6c38471ef6df875f67678326007552
2020-09-10 13:49:03 +01:00
jenkins-bot 4e55aa9488 Merge "Disable ArticleTargetLoader on invalid UTF-8 URIs" 2020-09-09 12:17:55 +00:00
jenkins-bot 2afe857c82 Merge "Fix copy-paste mistake in MWTransclusionContentModel" 2020-09-09 12:13:44 +00:00
Thiemo Kreuz 99b0a1e6c0 Fix copy-paste mistake in MWTransclusionContentModel
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
2020-09-09 10:31:27 +02:00
jdlrobson 0d64cd8649 Disable ArticleTargetLoader on invalid UTF-8 URIs
Bug: T106244
Change-Id: Ieb2c7610e9f49fd33df63a920ebf871110f0b2e6
2020-09-08 15:57:59 -07:00
jenkins-bot 0eb07cebde Merge "Init: Remove duplicate check for showBetaWelcome" 2020-09-08 14:54:23 +00:00
jenkins-bot ed905afdc1 Merge "Init: Reuse isEditPage" 2020-09-08 14:52:24 +00:00
Ed Sanders 4f192c8cca Init: Remove duplicate check for showBetaWelcome
This is already checked in #shouldShowWelcomeDialog

Change-Id: Ic2a5ab94b70a2480b6c0f3bf894db30da249b23a
2020-09-08 11:55:49 +01:00
Ed Sanders fafd0b93ad Init: Reuse isEditPage
Change-Id: I7611c02c72804d0efd7ef699c371b9069b3a60d2
2020-09-08 11:54:17 +01:00
jenkins-bot c7c20dfb10 Merge "Fix config argument to explicitly pass api" 2020-09-07 19:42:48 +00:00
Bartosz Dziewoński e6a524d761 ve.ui.MWSignatureContextItem: Remove useless 'command'
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
2020-09-02 22:09:21 +00:00
jenkins-bot 4afad48527 Merge "Show image autocomplete for "File" parameters" 2020-09-01 21:29:24 +00:00
jenkins-bot bf4aba90bc Merge "Reduce duplication/clutter in MWParameterResultWidget" 2020-09-01 21:26:09 +00:00
Adam Wight 1e96f47563 Fix config argument to explicitly pass api
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
2020-09-01 09:36:24 +02:00
David Lynch 8cb67a83ea Cast fallback revision_id to a number so it validates
EditAttemptStep requires an integer, and just getting the value of an
input is always a string.

Bug: T261664
Change-Id: I57e76857086474365124b5b016902211b0e63166
2020-08-31 11:04:20 -05:00
Adam Wight bf72437d63 Show image autocomplete for "File" parameters
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
2020-08-28 09:55:04 +00:00
jenkins-bot a7832b6bf5 Merge "Start using edit api results for watchlist UI updates" 2020-08-26 23:32:44 +00:00
Dayllan Maza 4fc73112ee Start using edit api results for watchlist UI updates
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
2020-08-26 23:08:47 +00:00
James D. Forrester 8a78603988 Drop support for wgCommentByteLimit, hard-coded null in MW nowadays
Change-Id: I767e0633415568134c46fccbafdaceb1ab76dea3
2020-08-26 20:25:38 +00:00
jenkins-bot 6a6cbf40d9 Merge "Fix URL in console warning" 2020-08-25 21:13:55 +00:00
Ammar Abdulhamid e15d1903fa Fix URL in console warning
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
2020-08-25 12:58:50 +01:00
jenkins-bot 1518aaa9e3 Merge "ve.init.mw.MobileArticleTarget: Fix floating toolbar workaround for iOS 13.6" 2020-08-22 11:20:02 +00:00
Bartosz Dziewoński b9a0def93a ve.init.mw.MobileArticleTarget: Fix floating toolbar workaround for iOS 13.6
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
2020-08-21 23:33:37 +02:00
jenkins-bot dd95e88589 Merge "ve.ui.MWGalleryDialog: Allow "Add new image" button label to wrap" 2020-08-20 13:41:24 +00:00
Thiemo Kreuz 5e2b7506b6 Reduce duplication/clutter in MWParameterResultWidget
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
2020-08-20 12:32:02 +02:00
Ed Sanders d62fc8b49a Use Array.prototype.forEach.call in copyAttributes
Change-Id: I6c890fecf6f6002d44b32f0c85a3193c0c2632e3
2020-08-18 23:17:03 +01:00
C. Scott Ananian 879f006b7b Fix regression when opening save dialog
DOM attributes are not arrays, and so don't have Array#forEach.

Fixed regression introduced in 4545f53245.

Change-Id: I1f0f44747a0f8a376c1fb7cbb8862c096a9d1dc9
2020-08-18 18:10:31 -04:00
Ed Sanders 4545f53245 build: Update eslint-config-wikimedia to 0.17.0
Fix instances of variable shadowing.

Change-Id: I6e2befb020d7d4b506c7b46131eafacd951aa6d1
2020-08-18 13:16:49 +01:00
Ed Sanders 42c7096dbf Gallery: Handle invalid titles
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
2020-08-17 18:22:42 +00:00
Bartosz Dziewoński adc4346652 ve.ui.MWGalleryDialog: Allow "Add new image" button label to wrap
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
2020-08-11 16:07:13 +02:00
jenkins-bot 7d3be3f3a6 Merge "Ignore non-checkbox fields for page saving dialog" 2020-08-10 18:04:44 +00:00
Sam Wilson 82bfa015ec Ignore non-checkbox fields for page saving dialog
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
2020-08-07 13:18:41 +08:00
jenkins-bot 2f92c6ead6 Merge "French spacing (mw:DisplaySpace) doesn't have mw:Placeholder any more" 2020-08-04 19:17:33 +00:00
Ed Sanders 09f4af2a63 CollabTarget: Add close button on mobile
Move comment button into 'insert' menu to make room.

Change-Id: I00ace1477d08041e9af6d81ae2e6635151575f8b
2020-08-03 07:55:06 +00:00
Ed Sanders dd862a837d MobileArticleTarget: Move MWBackTool to a separate file
Change-Id: I1561f454bcc779f97c758ba7178b09d15f52fe42
2020-07-31 16:15:10 +00:00
Ed Sanders 76cea9b235 ExportWikitextDialog: Make height of wikitext input fit dialog
Change-Id: If60dc55a442ffb255248d3bf5c3e1d0e14b2821f
2020-07-31 16:27:27 +01:00
jenkins-bot d377cbe9d1 Merge "Use mw.cookie instead of jquery.cookie" 2020-07-30 22:36:46 +00:00
David Lynch deb218aeec Use mw.cookie instead of jquery.cookie
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
2020-07-30 17:07:40 -05:00
jenkins-bot 42c533cfdd Merge "Follow-up I0a1a889: Show user uploads in gallery dialog" 2020-07-30 17:10:02 +00:00
Ed Sanders 69d8a195e5 Follow-up I0a1a889: Show user uploads in gallery dialog
Gallery dialog should behave the same as media dialog.

Bug: T62398
Change-Id: I601df9370b82868ba981e415fe24bd4f29399cdb
2020-07-30 17:01:04 +01:00
Ed Sanders ec872093aa ExportWikitextDialog: Add help text
Change-Id: I5508c167aa8119eb86356858fc0eedf69cc093bf
2020-07-30 16:43:59 +01:00
Ed Sanders a9d7884d3b ExportWikitextDialog: Add ellipses to "Export" buttons
This indicates these are not the final actions in the process.

Change-Id: I88227a1025f56ea59ef76a59b81cde22e81a959a
2020-07-30 16:23:02 +01:00
Ed Sanders 3ebcf5695d ExportWikitextDialog: Add copy button to wikitext
Change-Id: I8ed63a0ac38a812b09e51738b25b6b384ba30c04
2020-07-30 16:17:32 +01:00
Ed Sanders d8a0f475e4 ExportWikitextDialog: Fix title comparison
getImportTitle may be null

Change-Id: I04d3504e1b4d815859d3ea57fb846ea2277ee5fa
2020-07-30 16:17:32 +01:00
jenkins-bot b55ba6f1dc Merge "Also check for revid conflict when RESTBase says page doesn't exist" 2020-07-27 21:29:50 +00:00
David Lynch d2242731b3 VisualEditorFeatureUse should respect oversampling config as well
Bug: T252925
Change-Id: Ic8fbbcdf65e24e13d3f6fdfb35e7ae733c61dc6b
2020-07-23 17:21:59 -05:00
jenkins-bot 9d1b3a6d49 Merge "Always rebuild category list from Parsoid data on surfaceReady" 2020-07-17 16:01:23 +00:00
David Lynch c190fab8ea Always rebuild category list from Parsoid data on surfaceReady
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
2020-07-17 10:24:00 -05:00
Bartosz Dziewoński 8702d59879 Toggle TemplateStyles at a better time during (de)activation to avoid flashing
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
2020-07-15 21:27:27 +00:00
C. Scott Ananian ed3579245e French spacing (mw:DisplaySpace) doesn't have mw:Placeholder any more
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
2020-07-15 20:14:30 +00:00
jenkins-bot b097557733 Merge "Fix: focus order and screen reader issue in help popup dialog" 2020-07-13 19:58:59 +00:00
jenkins-bot c17c7047ef Merge "Fix: provide proper focus order to Category popup" 2020-07-13 19:58:56 +00:00
Akinwale Alagbe 92f2fb1522 Fix: focus order and screen reader issue in help popup dialog
Bug: T257175
Change-Id: Ib1e72caf06de827d5867e2badfd16408d32e9593
2020-07-13 21:32:43 +02:00
Akinwale Alagbe 2f7765d1e8 Fix: provide proper focus order to Category popup
Bug: T257173
Change-Id: I99e9332adb83bf1197da827583b9f22f68b2f395
2020-07-13 21:30:38 +02:00
Ed Sanders 7d722c5f9a MWMediaDialog: Show user uploads when no query provided
Bug: T62398
Depends-On: Iff4b9fab47764e5b775f6757de1163a245f58ed5
Change-Id: I0a1a88933efa9003a75373c61f194f56bb083219
2020-07-13 08:39:40 +00:00
jenkins-bot 6ccaee2828 Merge "MWSignatureNode: Use template's rendering hash object" 2020-07-08 20:47:20 +00:00
jenkins-bot f197832398 Merge "MWSignatureNode: Don't inherit from TransclusionNode" 2020-07-08 20:44:16 +00:00