Commit graph

7926 commits

Author SHA1 Message Date
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 dd862a837d MobileArticleTarget: Move MWBackTool to a separate file
Change-Id: I1561f454bcc779f97c758ba7178b09d15f52fe42
2020-07-31 16:15:10 +00: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
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
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
Ed Sanders 5a017602c6 MWSignatureNode: Use template's rendering hash object
Bug: T256969
Change-Id: Ie573c677d1bf7f4e0306bcfcb0052e2b64025e89
2020-07-08 22:18:35 +02:00
Ed Sanders a8753df147 MWSignatureNode: Don't inherit from TransclusionNode
We don't share much functionality, and we have to do a bunch
of hacks to disable functionality we don't want.

Change-Id: I9861123d8f1cbab1923f1aa5be713c2dadaed53d
2020-07-08 22:18:35 +02:00
jenkins-bot 51b8ff5a72 Merge "Remove warning shown when editing a translatable page source" 2020-07-08 20:18:19 +00:00
jenkins-bot 0e67319854 Merge "ArticleTargetSaver: Use request action to fetch data from response" 2020-07-08 19:51:01 +00:00
jenkins-bot c7dedaa353 Merge "ve.ui.MWSignatureContextItem: Keep the $body element, just empty" 2020-07-08 18:34:34 +00:00
Bartosz Dziewoński 4ea0cf0cab MobileArticleTarget: Double-check that section is not 'undefined'
It's supposed to be a string or null. The parent class sets
`this.section = null` for us by default.

Bug: T257355
Change-Id: I375a3f6724235f22888bb7f0cb77a7081153768e
2020-07-07 20:50:59 +02:00
Abijeet 24c8b2d2b6 Remove warning shown when editing a translatable page source
Translate itself will show an warning dialog when user tries to edit
a translatable page in visual mode. Editing in the source mode is
allowed.

Bug: T192052
Depends-On: I03ea64353b2d5b28d684f90936cab75ea4fd40d2
Change-Id: Ie4f3a6003c27773c6d0c5086c876fe424befe25a
2020-07-07 11:49:19 +05:30
Akinwale Alagbe 2a581819ec Fix: Adding accessibility labels to Visual Editor template elements
Bug: T245669
Change-Id: I3b792ffde571047d9900920188e92634b8f50298
2020-07-06 18:46:59 +00:00
Bartosz Dziewoński 36bd09c429 Also check for revid conflict when RESTBase says page doesn't exist
There used to be similar code here, but it was removed in 2015 in
85b745666f because it wasn't correct in
some cases. Restore it and instead separately check for those cases.

Bug: T257124
Change-Id: Id4a17266111d064805aa0ca865182bb2f4b019eb
2020-07-05 19:42:12 +02:00
Ed Sanders a87939670c ArticleTargetSaver: Use request action to fetch data from response
In DiscussionTools we will use a different action in the save API.

Change-Id: I587ffe2ead1b0706f6ba04947c55630ab1bb6bda
2020-07-02 11:25:26 +01:00
Volker E 9c9c86613d Use standard WikimediaUI theme styles
Follow-up to change in OOUI v0.39.2.

Bug: T256713
Change-Id: I09e990222b0068b07f59cc4b6449451b9e5df3d2
2020-06-30 20:37:01 +00:00
jenkins-bot e679ea1e94 Merge "Adds focus visualization to parameter result widget" 2020-06-26 12:40:23 +00:00
bkudiess-msft 748cdffd0b Adds focus visualization to parameter result widget
Bug: T253665
Change-Id: Ie7109375a0d61fb4f8e7b4f6ad54484582c47194
2020-06-26 14:14:57 +02:00
jenkins-bot 6f6c4828a7 Merge "When returning to section, avoid counting sections outside the content" 2020-06-22 22:30:44 +00:00
Bartosz Dziewoński ff271d7b43 ve.ui.MWSignatureContextItem: Keep the $body element, just empty
The rendering is the same as before, but keeping the element around
makes it possible to override getDescription() to return some extra
text and have it appear as expected.

Change-Id: I1ef38abffbdb405121ea6b0b2ac368bbbb008cd7
2020-06-22 20:00:48 +02:00
Mvolz 842a728488 Revert "Allow generic params to be passed to getWikitextFragment"
This reverts commit e5c1ef651b.

This change caused an error where templates failed to be inserted
into wikitext in the 2017 wikitext editor.

Bug: T255785
Change-Id: Ie57c49e68e594be22af2b1b479840f29e46131db
2020-06-19 13:15:23 +00:00
Ed Sanders 013b7419bf build: Update eslint-config-wikimedia to 0.16.2
Use jsduck config

Change-Id: I5cd7bbcee83b0fa148b8fb8c3b4adcf08f96cefc
2020-06-18 19:16:52 +01:00
jenkins-bot 15443d35c5 Merge "Allow generic params to be passed to getWikitextFragment" 2020-06-15 20:42:45 +00:00
jenkins-bot 1bc368e01d Merge "Move restbaseId stripping to ve.utils.parsoid" 2020-06-12 18:49:17 +00:00
Ed Sanders 310b4d6e4c ve.dm.Node: blacklistedAnnotationTypes -> disallowedAnnotationTypes
Pulls through I69bea8829091b72f52e8486f7171d70e3194c6ef

Bug: T254646
Change-Id: Ibe880de0436e58416a857756d45fa4dc194196b1
2020-06-12 11:11:34 +01:00
jenkins-bot bb1416dd22 Merge "ve.dm.MWIncludesNode: Change label for includeonly nodes per feedback" 2020-06-11 12:15:22 +00:00
jenkins-bot bfdd39ed79 Merge "Update VisualEditorFeatureUse with new fields" 2020-06-10 19:53:49 +00:00
Ed Sanders 877d1e3359 Move restbaseId stripping to ve.utils.parsoid
De-duplicates the two implementations we had.

Bug: T253584
Change-Id: If5d15dd4e7e0d3704ca8d75c0a25c529b06f17fb
2020-06-10 20:31:16 +01:00
jenkins-bot fd8265c8ac Merge "Make VisualEditorDisableForAnons only hide the tabs, not disable the editor" 2020-06-10 19:17:58 +00:00
jenkins-bot 17598354c8 Merge "Remove 'blacklist' in documentation" 2020-06-10 15:56:16 +00:00
Ed Sanders 9c8195f823 Replace browser blacklist/whitelist with (un)supportedList
Bug: T254646
Change-Id: Iac0fc850520f2a83954d3fac21b38715e2f76a8c
2020-06-10 16:30:57 +01:00
Ed Sanders 590dc0988d Remove 'blacklist' in documentation
Bug: T254646
Change-Id: I9bad51ee248084f92de4c35d9e10d3d983f53831
2020-06-10 16:19:50 +01:00
David Lynch 648bffd3b9 Update VisualEditorFeatureUse with new fields
Bug: T252925
Change-Id: I02c41e6b5f42405b60dda87340787afd92b0da4b
2020-06-09 16:05:45 -05:00
Bartosz Dziewoński 89b6a8d71c ve.dm.MWIncludesNode: Change label for includeonly nodes per feedback
<includeonly /> is not valid wikitext markup, which is distracting.
Let's use <includeonly>…</includeonly> instead.

Bug: T250937
Change-Id: I9eac8b265eca16118d390da2628e0da7ca409ed8
2020-06-09 21:37:10 +02:00
Bartosz Dziewoński dd6c27ae65 ve.ui.MWIncludesContextItem: Fix hiding includeonly tags for multi-line content
Change-Id: Ic3cb24b7470bb71688b25c0c90673ff4d16176d0
2020-06-08 21:06:27 +02:00
Bartosz Dziewoński f81f34f59d Make VisualEditorDisableForAnons only hide the tabs, not disable the editor
Bug: T253941
Change-Id: Id08514b3827c4315d69651bc2313bf8317ba12fc
2020-06-08 20:05:58 +02:00
Bartosz Dziewoński 27ca1082a9 When returning to section, avoid counting sections outside the content
Bug: T254593
Change-Id: I8126e21b3732b45c0a5b418e3832ccc4c72a1b73
2020-06-05 17:56:08 +02:00
Ed Sanders e5c1ef651b Allow generic params to be passed to getWikitextFragment
mw.Target doesn't know about revid and etag, so move that logic
to ArticleTarget, where the param can still just be a boolean.

Change-Id: Idf4632cd28554aaf5bbf5f2b44ded047c0c4b182
2020-06-04 22:45:09 +01:00
jenkins-bot a28a263192 Merge "Drop linting from the VE API" 2020-06-04 17:12:54 +00:00
Ed Sanders f01d4ab35d Drop linting from the VE API
Calling the linter is very slow as the result is not
cached. Extensions needing this (DiscussionTools) should
just call the Linter extension API directly.

Bug: T253799
Change-Id: I994b52ca70c29a32900741a36087f10144396720
2020-06-04 18:51:38 +02:00
jenkins-bot 7a2fffae39 Merge "When switching from wikitext to visual, preserve the edit checkboxes" 2020-06-04 15:10:51 +00:00
Bartosz Dziewoński 186f5dc424 When switching from wikitext to visual, preserve the edit checkboxes
This handles the minor edit and watch checkboxes, as well as any added
by extensions (e.g. FlaggedRevs).

Switching in the other direction already works fine, that is
implemented in ArticleTarget#getSaveFields.

It doesn't seem ideal to put this code into the constructor of
ve.init.mw.DesktopArticleTarget, but that's where we already have
similar logic for the edit summary. I filed T253696 about this.

Bug: T250388
Change-Id: Ia6a9c0465ed215e8f74b9fff4590593383e9a1e6
2020-06-03 23:30:45 +02:00
jenkins-bot be3ad7d93a Merge "Handle <noinclude> etc. as nodes rather than metaitems" 2020-06-03 13:23:03 +00:00
Ed Sanders 6076708ff3 build: Update eslint-config-wikimedia to 0.16.0
Change-Id: I638e0f82949597e2a2e4ea18fc2f0258f225358c
2020-06-02 21:30:00 +01:00
jenkins-bot 6dd197a10f Merge "init: Manage education popup state the same way as welcome popup state" 2020-06-01 20:57:40 +00:00
Roan Kattouw 501518cb4d init: Check for disabled welcome dialog again async
The first time we check, it's too early for any code that might have
wanted to call stopShowingWelcomeDialog() to have done so (because we
check synchronously after making that function available).

I'm not sure if checking twice like this is the best solution, or if it
would be better to defer the whole thing and only check once.

Change-Id: If5b88bb50c3becaa3d7931c8b8e4d0faed7b69d2
2020-06-01 13:10:49 -07:00
Bartosz Dziewoński 1fc11e0146 Handle <noinclude> etc. as nodes rather than metaitems
The difference is that metaitems are not visible on the editing
surface, and their exact position is not preserved when the paragraph
containing them is edited.

This behavior is desirable for e.g. categories, but not for
<noinclude> and related tags, which are intentionally placed in
specific places in the text.

Note that we don't really have any editing interface for these nodes
yet. But you can see them (and they come with descriptions and links
to documentation pages), and delete or copy-paste them.

Bug: T250937
Change-Id: I104e7abbd650567df0e59813653c46a66d955d58
2020-06-01 18:47:14 +02:00
jenkins-bot 68ebb8b2b8 Merge "SaveDialog: only allow vertical resize of summary" 2020-05-31 16:29:03 +00:00
jenkins-bot 4b81264bbd Merge "ve.dm.MWAlienMetaItem: Never match mw:Extension nodes" 2020-05-29 11:09:07 +00:00
bkudiess-msft fb2290f032 Fixes edit section being cropped on page with zoom
Bug: T253601
Change-Id: Ifa449d927e69c38ad5fa8fcb004b14417fab5e7d
2020-05-28 21:43:34 +02:00
Bartosz Dziewoński a6647a258a ve.dm.MWAlienMetaItem: Never match mw:Extension nodes
Bug: T247001
Change-Id: I11771fc2537585622852e6756e800c3d5e530ac8
2020-05-25 19:14:46 +00:00
Lucas Werkmeister fd974c25c2 SaveDialog: only allow vertical resize of summary
By default, many browsers permit resizing the textarea in both
dimensions; however, the SaveDialog doesn’t handle horizontal resizing
very well (the textarea is no longer centered and the options don’t
adapt to the new width), so add some CSS to limit the resizing to
vertical only.

Change-Id: I91bf63357237ddc2e3ede8e661480ab0cb48d10e
2020-05-23 11:22:13 +02:00
jenkins-bot dc90695d8c Merge "Refactor getPreferredEditor and expose reusable parts" 2020-05-20 18:48:21 +00:00
Ed Sanders d6823dbdb4 Use fake server for link inspector tests
Also remove fake server constants in other fake server tests

Bug: T247278
Change-Id: If091c73ad411ac7b16900448bc96745dc84997ba
2020-05-20 15:54:04 +01:00
jenkins-bot 29940cc99d Merge "Improve deactivating tabs when switching/exiting on MonoBook etc." 2020-05-18 23:39:10 +00:00
jenkins-bot 0410ed44ba Merge "DesktopArticleTarget.init: Set veEditSourceUri in SET mode too" 2020-05-18 23:08:32 +00:00
jenkins-bot d2dd31b805 Merge "Fix #unwrapParsoidSections for pseudo-sections (generated by templates)" 2020-05-18 20:32:28 +00:00
Bartosz Dziewoński 4f70ead440 Fix #unwrapParsoidSections for pseudo-sections (generated by templates)
In 92c3055628 I changed `sectionId > 0`
to `sectionId !== '0'`. That was actually a mistake, as Parsoid's
section IDs can be negative, which indicates pseudo-sections, which
may not have headings.

https://www.mediawiki.org/wiki/Specs/HTML/2.1.0#Headings_and_Sections

Bug: T252238
Change-Id: I9133d4365a71d6db1fa58b69ae3b970166d15c1e
2020-05-18 21:41:13 +02:00
jenkins-bot 5b21c5b67a Merge "Don't log VEFeatureUse from DiscussionTools" 2020-05-18 17:54:13 +00:00
David Lynch 92f4e5432e Don't log VEFeatureUse from DiscussionTools
Change-Id: Ie02381e1e65175871c5b43c8089688f632a5066c
2020-05-18 10:25:27 -05:00
jenkins-bot 38034b1051 Merge "Treat links to diffs and history pages as external links" 2020-05-14 18:54:04 +00:00
Bartosz Dziewoński 61de7530c7 Improve deactivating tabs when switching/exiting on MonoBook etc.
Previously we didn't deactivate them, so if you opened VE, then
switched to NWE, then exited the editor, all three tabs would appear
active.

Change-Id: I904d6daf2896ceadf004f5e57a88c2359f33fd44
2020-05-14 20:24:57 +02:00
Bartosz Dziewoński 21b25bd77d Fix deleting signature nodes
Code in ve.dm.MWTransclusionNode (which ve.dm.MWSignatureNode extends)
expects the node data to have an 'attributes' property.

We could override a bunch of methods to fix this, or add checks in the
original code, but it seems more future-proof to instead ensure that
the property exists.

Bug: T248585
Change-Id: I5bd721ca73605a396509669145b740db7283afd3
2020-05-12 01:01:18 +02:00
jenkins-bot 9e33d28050 Merge "Update toolbar styles for Vector changes" 2020-05-08 20:13:14 +00:00
Bartosz Dziewoński 3866ad7f77 Update toolbar styles for Vector changes
Depends-On: I52938689fc7d99a710510349aaa573a87864a367
Bug: T251648
Change-Id: Ica07cf1dab2cf522532a08fadec599bd2fcade5c
2020-05-08 16:23:57 +02:00
Bartosz Dziewoński 91f3a971f4 DesktopArticleTarget.init: Identify our events on multi section edit links
This is now consistent with all other events.

Needed for I9904e8af4a60b0f5e9a6e263cd4fd8e1e3fd1f98.

Change-Id: If52aa9d619eac08456874fc75c0f6e1adff01246
2020-05-07 21:42:56 +02:00
Ed Sanders 50db102c4d Refactor getPreferredEditor and expose reusable parts
Separate out logic specific to edit pages

Change-Id: I5b3b47feeeca2085fcd283d55d7e9ceafa73be70
2020-05-07 14:33:21 +01:00
Bartosz Dziewoński b1f40f4f9f DesktopArticleTarget.init: Set veEditSourceUri in SET mode too
Bug: T192974
Change-Id: I1a2485e6f6ba3cb21d669e5f675ce50e4ba81d8f
2020-05-06 19:56:28 +00:00
Roan Kattouw 31db495bcf init: Manage education popup state the same way as welcome popup state
And factor out the common code for using a preference with a fallback to
localStorage or a cookie.

Bug: T235566
Change-Id: Ibb983319edcd2987225fe89677fd10e3ff8f9df6
2020-05-01 19:12:30 -07:00
Ed Sanders 0c6b6e3e89 Improve shortcut in getWikitextFragment
Use hasContent to
1. Catch cases where the document is empty, e.g. <p></p>
2. Avoid having to use the converter

Change-Id: Ib1bb36824ca871e535bef38cef8137fdfb81b53e
2020-04-29 17:32:09 +01:00
jenkins-bot e4fe634201 Merge "ApiVisualEditor: Add option to return lint errors from Parsoid" 2020-04-24 10:03:40 +00:00
jenkins-bot 8f924cf543 Merge "DesktopArticleTarget.init: Add mw.libs.ve.disableWelcomeDialog()" 2020-04-21 21:27:07 +00:00
jenkins-bot 3e519667a1 Merge "DesktopArticleTarget: Move shouldShowWelcomeDialog() to init" 2020-04-21 21:27:04 +00:00
jenkins-bot 3e70794645 Merge "ArticleTarget: Move shouldShowWelcomeDialog() into DesktopArticleTarget" 2020-04-21 21:27:01 +00:00
jenkins-bot c8cffbd394 Merge "ArticleTarget: Clean up WelcomeDialog show/hide handling" 2020-04-21 21:25:36 +00:00
Bartosz Dziewoński ae86f7290b ApiVisualEditor: Add option to return lint errors from Parsoid
Depends-On: I6bbe2fc5aea07c65eb99768f2c44ed42601792a3
Depends-On: I6bdf5635763ef8a44d44a031c64cd7f289261a32
Change-Id: I723ec766d1244d117f8d624440026fe5af0d3403
2020-04-21 22:49:29 +02:00
Roan Kattouw ab763f37df DesktopArticleTarget.init: Add mw.libs.ve.disableWelcomeDialog()
This allows code in other extensions to suppress the welcome dialog
temporarily (just for that one page view), without touching the user's
preferences.

Bug: T235566
Change-Id: Ief6545289cf59fda851aa944b059994abd90253e
2020-04-21 11:43:36 -07:00
Roan Kattouw e0125e3e9d DesktopArticleTarget: Move shouldShowWelcomeDialog() to init
Move shouldShowWelcomeDialog() and stopShowingWelcomeDialog() from
DesktopArticleTarget to DesktopArticleTarget.init, and use them to
deduplicate code in init that manages the wikitext welcome dialog.

Look for both the vehidebetadialog and hidewelcomedialog URL params.
The code in DesktopArticleTarget used vehidebetadialog, but the code in
init for the wikitext welcome dialog used hidewelcomedialog.

Bug: T249954
Change-Id: I19f1a2da36bc65addb52811c3d3c73c1259bc8f5
2020-04-21 11:41:59 -07:00
Bartosz Dziewoński b01c69a800 mw.ArticleTarget: Fix #saveErrorBadToken / #saveErrorNewUser calls
Follow-up to 8065fdf2b9.
I noticed this while trying to reproduce an unrelated bug.

Change-Id: If5b18b055cbee6fc2513161a4f445667dd2a72e0
2020-04-21 18:52:02 +02:00
Roan Kattouw e1f4e3f148 ArticleTarget: Move shouldShowWelcomeDialog() into DesktopArticleTarget
The base class doesn't use it, it only defines it, and
DesktopArticleTarget is the only subclass that uses it.
MobileArticleTarget calls it, but also overrides it to be a no-op.

Change-Id: Ib3feea94844f4e1ed71dccece7657450516cac89
2020-04-17 15:46:07 -07:00
Roan Kattouw 7457834dc5 ArticleTarget: Clean up WelcomeDialog show/hide handling
Factor out the logic for whether the WelcomeDialog should be shown into
its own method, and write it in a less confusing way. Do the same thing
with the logic for setting the preference/storage/cookie for hiding the
WelcomeDialog.

This makes maybeShowWelcomeDialog() much simpler, and removes duplicated
code in DesktopArticleTarget.

There is one minor change in behavior: if the WelcomeDialog is
suppressed using the URL parameter, that no longer causes the preference
to be updated as if the dialog had been shown.

Change-Id: I1d4f912c5f6bd7a2bbad2b209b97c3ec1f250a07
2020-04-17 15:46:07 -07:00