Commit graph

12336 commits

Author SHA1 Message Date
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