Commit graph

150 commits

Author SHA1 Message Date
jenkins-bot 23b8ec2f54 Merge "Don't attempt to pin first visible section if firstHeading is visible" 2022-01-28 17:27:06 +00:00
WMDE-Fisch dac7b5206b Allow disabling VE and 2017 wikitext editor from FileImporter
Bug: T298345
Bug: T174180
Change-Id: I80be4648564630b71e6e61d4c5e50538d134ba7a
2022-01-28 08:55:15 +00:00
Ed Sanders 4af235822b Don't attempt to pin first visible section if firstHeading is visible
This prevents an unwanted scroll when the main edit link is used
and the first section is below the viewport.

Change-Id: Ib99ebe2dc5c105c3fcbd687ef5740166267f5536
2022-01-28 00:02:09 +00:00
jenkins-bot 3c7d81aa2f Merge "Remove conflicting section IDs in diff views" 2022-01-26 00:04:22 +00:00
Ed Sanders 6f5fe8cdb0 Position VE desktop loading bar with position:fixed
This doesn't change the position of the loading bar, but it keeps it
still if any scrolling happens. Previously we expected the user probably
wouldn't scroll while VE is loading, but in subsequent commits we
will trigger automatic scrolling in section editing mode.

Change-Id: I1404ccd77583d808ef79291c6cb4f561e76bd41c
2022-01-25 16:04:12 +00:00
Ed Sanders 868ab40826 Tweak vertical alignment of progress bar within toolbar (source mode)
Change-Id: I0937763448ce4fde6e2298bdeea1855664288a1e
2022-01-25 16:04:12 +00:00
WMDE-Fisch 04c48afce8 Remove left over from old two column conflict UI trigger
This was forgotten while removing the code from the old UI and it
is not needed by the new UI.

See https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TwoColConflict/+/530565/1/includes/InlineTwoColConflict/InlineTwoColConflictHelper.php#b603

Bug: T222714
Change-Id: I0d8dea47e677886e84bcbc359f06aef70565d65d
2022-01-24 15:00:51 +01:00
jenkins-bot 43b2b3de95 Merge "Revert "Re-duplicate deduplicated TemplateStyles"" 2022-01-21 21:29:41 +00:00
Bartosz Dziewoński 3c1d167b33 Revert "Re-duplicate deduplicated TemplateStyles"
This reverts commit 005a8d24ef.

Reason for revert: Causes page corruption

Bug: T287675
Bug: T299251
Bug: T299767
Change-Id: Ib6b88114f6bdcd11ada0daf8ef6ec088569c88a6
2022-01-21 21:10:27 +00:00
Ed Sanders 75edbaad08 Convert ve.init.mw.DesktopArticleTarget.init.css to less
Change-Id: Icab13075903d6fad4007847c2381696d6b98fa96
2022-01-21 00:04:27 +00:00
Ed Sanders 110db0e3c7 Remove conflicting section IDs in diff views
Bug: T218492
Change-Id: I84c60a36859190efc37c68e380ae44225be06d9c
2022-01-19 01:26:14 +00:00
jenkins-bot 8d119a4356 Merge "Re-duplicate deduplicated TemplateStyles" 2022-01-16 00:24:31 +00:00
Bartosz Dziewoński 005a8d24ef Re-duplicate deduplicated TemplateStyles
Bug: T287675
Bug: T299251
Change-Id: I7711c30131cb441f84b3e2137983f0ba2a50b46f
2022-01-14 21:35:11 +00:00
Ed Sanders c0f3fc3a78 Pass visibleSection & visibleSectionOffset to target
* Find the first section below the top of the viewport
  (usually visible) and measure its offset.
* After loading the editor, ensure this heading is still
  at the same position on the page.

Bug: T296910
Change-Id: I9a05ea74ba3c19a4a91ddc1bc0afe311851c53e6
2022-01-11 20:39:27 +00:00
Ed Sanders 40a50cac4a DiffPage: Only set user pref on 'choose' event
This prevents your preference being changed if you just
followed a link with a diffmode parameter.

Change-Id: I755563bde285e95c0367119d49a40e1dd3c5e178
2022-01-06 16:48:02 +00:00
Ed Sanders 302303de46 DiffPage.init: Move and rename some vars
Change-Id: Ibcef23650e6c77d9142055e9e7357ce095ba3b49
2022-01-06 16:47:35 +00:00
Ed Sanders 1c6dbf433f Remove more DOM garbage introduced by 'Web of Trust' extension
Bug: T297862
Change-Id: Ib6efe0c4ea68a1b17efd37839cec428dc9ebf6b7
2021-12-20 17:54:20 +00:00
Ed Sanders b57fe3e8ba Only set diffmode-historical user option when it has changed
Bug: T290703
Change-Id: I289e0c20db9235a432f7f49a425328ab617d57f3
2021-12-20 14:27:37 +00:00
Ed Sanders 4d13a4f4ed eslint: Enable no-jquery/no-append-html
Prevents accidentally treating plain text or user input
as HTML, which could be an XSS vulnerability.

Change-Id: Id4af48447a0907962a57340cb60aca08df9cc505
2021-12-16 02:04:11 +01:00
jenkins-bot 9853498756 Merge "Update multi-tab code after changes in Minerva" 2021-11-25 11:22:30 +00:00
Bartosz Dziewoński 7fff473cf7 Update multi-tab code after changes in Minerva
Bug: T294192
Change-Id: I20c60711147e36366229b58f481df0508e2278ee
2021-11-16 14:10:56 +01:00
Ed Sanders 86c405a2e1 Prefere ve.extendObject over $.extend
Change-Id: I37fef45701653cef08de9ec699865aa4fdf477bc
2021-11-15 21:30:19 +00:00
Bartosz Dziewoński f5f26d848d ArticleTargetSaver: ve.init may be undefined
Bug: T294981
Change-Id: Ibd1cf9db9ebb58e7b7721e35991dd4027506c0dd
2021-11-03 22:12:33 +01:00
David Lynch 03264d55a5 Pass editingSessionId through to API save requests
Bug: T286076
Change-Id: Iaec4fa50affddf01462156f11236c1210f76cc91
2021-10-28 21:17:55 +02:00
jenkins-bot fed17e94b6 Merge "Give skins/extensions ability to trigger VisualEditor" 2021-10-20 23:45:14 +00:00
jdlrobson d5b3d2bcbe Give skins/extensions ability to trigger VisualEditor
It should be possible for extensions/skins to trigger the click event

It should be possible to do $('#ca-edit').trigger('click') so that
Vector's sticky header can trigger the VisualEditor.

Bug: T293159
Change-Id: I58625ffca982edfbc4cdcb14a666d79093e1b89d
2021-10-20 16:20:02 -07:00
Ed Sanders 789519012e Add mobile 'content' class to visual diff
Bug: T293392
Change-Id: I7d0d6fee5a50fc2d965ebf0ad20c49dd26c70901
2021-10-14 17:26:03 +01:00
David Lynch 760ae6643f Give the categories box a highlight on hover
Most block-level things that can be interacted with by clicking have a
highlight. Categories don't, and that makes it harder to discover that
you can edit them.

Change-Id: I6be3824c34b36bd09bbae8cab9a9f36b6bcdb767
2021-09-22 21:17:40 -05:00
Thiemo Kreuz aa556e3ef8 Update and fix all @param config and @cfg documentation
I tried to review all of them. Some of the changes I did:
* Make sure the `config` parameter is not marked as optional
  when it is not.
* Make sure default values are mentioned.
* List individual `@cfg` options when it makes sense.

Note I don't list all options a class could accept (e.g. via all
its parent classes and mixins). That's too much. Instead I checked
how a class is actually used and list only these options.

Even then I don't list everything, e.g. unspecific options
like "classes" that can be used pretty much everywhere.

Change-Id: Idf4fbe1dc3608ace277df9e385f2f140df3a2f50
2021-09-12 12:35:27 +00:00
Thiemo Kreuz 36bd65dda7 Cleanups and optimizations related to .parseDom()
E.g. avoid calling the rather expensive method multiple times
in a row, if only 1 of the results is needed.

Change-Id: Iff1d2c0892367e927303f6f45d3231e04c045cab
2021-09-02 18:29:09 +00:00
WMDE-Fisch 685bd0b303 Remove some stylelint rules not needed anymore
Got stylelint feedback from local npm test runs about that.

Change-Id: I4e2f1f8baeeac1608f104982c709aaec01e372b5
2021-08-30 17:07:43 +02:00
jwbth 6d7a062dbb Fix history.replaceState call on diff pages
The history.replaceState call in onReviewModeButtonSelectSelect() (1)
ignores any changes to the document URL made by external tools such as
RevisionSlider, (2) replaces with an empty string the history entry
state object if it was set by external tools such as, again,
RevisionSlider. Both 1 and 2 result in a wrong URL ending up in the
address bar at some point. This patch addresses these problems, (1)
creating a new mw.Uri() object every time
onReviewModeButtonSelectSelect() is called, (2) keeping the current
history.state object.

The original variable storing the URI object is renamed to avoid
shadowing (optionally can be replaced with its value as it's used only
once).

Bug: T288636
Change-Id: Ieb97b561a6c076aa28aae231fe286ac4d1051bbd
2021-08-14 10:51:24 +00:00
Bartosz Dziewoński ec3341c9a1 Avoid conflicts between 2017 wikitext editor and DiscussionTools new topic tool
They both want to handle the same URLs. If we detect that
DiscussionTools new topic tool will open, then do not open 2017
wikitext editor.

Bug: T282204
Change-Id: Ic7dd677ea219938969f60bab91387c2e03ebdbe6
2021-07-28 16:10:22 +02:00
Thiemo Kreuz fae6118071 Document and use mw.Api parameter defaults
Reasoning:
* format=json must be the default. Nothing else makes sense in
  the context of this code. This should not be a surprise.
* formatversion=2 is only a default when the custom
  getContentApi() is used, but not when mw.Api is used. One
  might argue that it's safer to always specify formatversion=2.
  However, this is not done in other places in this codebase.
  It should never be done or always.
* I find it confusing when the action=… is missing. Let's not
  rely on this default.

Change-Id: I6ca29f76bffc0849103c5bcff4aaf28fcaaa4c52
2021-07-12 09:13:59 +02:00
Thiemo Kreuz c2017f74b2 Remove @param/@return docs that literally repeat the code
These don't add any knowledge but make the code harder to read
and maintain, and are an additional source of errors.

Change-Id: Ied57741a3f985e355adfddb4e75378d5c497faa9
2021-06-14 15:44:51 +02:00
Thiemo Kreuz 0ad9e90c37 Use term "wikitext" when working with TempWikitextEditorWidget
This reflects better what the widget actually does.

However, the config option `value` as well as the method
`getValue` are not renamed. These intentionally mirror a OOUI
convention.

Change-Id: I26e733b760501e57b3314d5da2d65bfdd4b38346
2021-06-09 10:23:36 +02:00
Ed Sanders 857014fae9 Support watchlist expiry
Bug: T251348
Change-Id: I017a54784c758c5e97fb640721bd456adc0fbab5
2021-06-08 20:14:45 +00:00
jenkins-bot 13f8d7db67 Merge "Remove obsolete vendor prefixed properties" 2021-05-18 01:25:08 +00:00
jenkins-bot 68f8f26fd7 Merge "ArticleTargetLoader/Saver: Move vars inline" 2021-05-06 16:14:13 +00:00
Ed Sanders 2cf163fa23 Move vars inline in preinit code
Change-Id: Ice86931a48b4563a881af16d2fe8e344d49bc73f
2021-05-05 18:06:37 +01:00
Ed Sanders db90e1e610 ArticleTargetLoader/Saver: Move vars inline
Change-Id: I4afe5d0c68cb6284fe5178674e8942afb2b9d5bd
2021-05-05 16:56:49 +01:00
Volker E c468f529fc Remove obsolete vendor prefixed properties
With updated basic support, let's remove obsolete vendor prefixed
properties.

Bug: T278670
Change-Id: I13ceec520559745c877588200024ebce16944da1
2021-05-03 08:09:01 -07:00
Bartosz Dziewoński ee7c5d9d1a Handle errors when fetching revisions for visual diffs
Bug: T171937
Change-Id: Ic300b0b2995ea3f8b93af1557e06503fc8470c7c
2021-02-23 01:21:55 +01:00
Bartosz Dziewoński b91c8647fe Ignore user prefs for enabling/disabling VE which are not settable
We have two preferences used for enabling/disabling VE:
'visualeditor-enable' and 'visualeditor-betatempdisable'.
(And 'visualeditor-autodisable', which sometimes overrides
them both, but it's not relevant here.)

The user can only set 'visualeditor-enable' when VE is Beta Feature,
and they can only set 'visualeditor-betatempdisable' when it is not.

However, when deciding if VE should be loaded, we always checked both
of the preferences. This gives incorrect results when the preference
that is not supposed to be settable actually exists, due to being set
in GlobalPreferences on another wiki where it's settable.

A similar issue could occur if VE configuration is changed from Beta
Feature to a normal preference (or the other way around), and the
preference values for the previous configuration still persist.

Bug: T271434
Change-Id: I7399b3c516f762429050a662ac85d1d392392323
2021-02-05 12:40:51 +00:00
David Lynch 2ee500ed70 Logging init mechanism consistency
Support the `url-new` mechanism so we can distinguish between
new/existing sections in direct navigation.

Also, mechanism will now correctly be `new` when clicking the "create"
tab on a previously empty page.

Bug: T272544
Change-Id: I667a1c45c3948ec6dfed8f348a1327bffaba58a5
Depends-On: I3cee7a3a4c4b646692dce4a1180c4ba18a61f4bc
2021-01-29 20:28:11 -06: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
jenkins-bot 187a5fe7ac Merge "Preserve vehidebetadialog URL flag when switching editor mode" 2021-01-13 17:38:22 +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
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