Commit graph

1298 commits

Author SHA1 Message Date
WMDE-Fisch 179d402344 Add ReferencePreviews config checks to Cite extension
PHP classes and test are somewhat copies from the Popups codebase.
Some refactoring was applied. More could be done. Not to sure if
this should happen more in follow ups though.

Could also reduce the complexity of checks on the JS side. Most of
these things can only change on page load. The only dynamic part
left is the anon user setting managed by the Popups extension.

Note, that I needed to add a new PHP config for here although the
other still exists and is needed in the Popups extension. This
will change, when the user settings code also moves.

I guess it's okay for now though. Both settings default to true
and are not overridden in the config repos.

Also needed to add the Gadget extension as phan dependency.

Bug: T362771
Depends-On: Ia028c41f8aaa1c522dfc7c372e1ce51e40933a5e
Change-Id: Ie6e8bc706235724494036c7f0d873f5c996c46e6
2024-04-25 12:50:27 +02:00
jenkins-bot ca629c3dd1 Merge "Internal config variables renamed from Popups to Cite" 2024-04-22 16:01:31 +00:00
Adam Wight f0849b2b17 Internal config variables renamed from Popups to Cite
This updates the easy variables which are set and get within a single
module, these changes should have no effect and don't need to be
coordinated across extensions.

Bug: T362332
Change-Id: Ibbe69c321e9e2b744ec88cebbdc3476d776f5956
2024-04-22 14:31:55 +02:00
jenkins-bot 7a63c9fa95 Merge "Revert "Remove global for if previews are shown"" 2024-04-22 09:00:09 +00:00
WMDE-Fisch 4f50d3b009 Revert "Remove global for if previews are shown"
This reverts commit afdbf2d46d.

Causing some issues with the dependency. Will do this cleanup in a later step when most of the involved complexity is gone anyways.

Change-Id: I3f29d64503d5088d058bf87dd0448f5754d4c6fe
2024-04-22 08:30:55 +00:00
Translation updater bot d1e164ca8a Localisation updates from https://translatewiki.net.
Change-Id: I5bc4cea5b42fbd4be477cd2452df99593eb2dc0b
2024-04-22 09:27:49 +02:00
Translation updater bot cbfea786d8 Localisation updates from https://translatewiki.net.
Change-Id: If856eec18b5fc87044445ffb1a45edbfa58473c3
2024-04-19 09:46:00 +02:00
jenkins-bot 97ec15d8b1 Merge "Remove global for if previews are shown" 2024-04-18 09:17:37 +00:00
Translation updater bot 98a99171c9 Localisation updates from https://translatewiki.net.
Change-Id: I434483e134ceef88df5d6f53499ac0d60f75cfd8
2024-04-17 09:27:45 +02:00
WMDE-Fisch afdbf2d46d Remove global for if previews are shown
This global was needed to communicate the actual state of the
previews from Popups to Cite. Now this setting can be retrieved
in a more direct way.

Change-Id: I592761bb0121abcf7e8ab279b7385d6920cce37e
2024-04-15 20:17:25 +02:00
Translation updater bot b21dbff0cc Localisation updates from https://translatewiki.net.
Change-Id: I5d6258de46d20fb6375f3bba4c481b99ef67a373
2024-04-15 09:27:38 +02:00
mareikeheuer ce2f65c555 Add 'Extends' section to Wikitext toolbar Help menu in Beta Cluster
Implemented addition of 'extends' feature information to WikiEditor Help menu, under the extends feature flag

Bug: T361088
Change-Id: Ide15286527227f61a48386384b96ac965c5dec42
2024-04-09 18:27:52 +02:00
Translation updater bot 7b8ee26b51 Localisation updates from https://translatewiki.net.
Change-Id: Icfbf342ff65adcfcbd6013e5493a1111025fa784
2024-04-09 09:26:16 +02:00
Translation updater bot 54c8aa860d Localisation updates from https://translatewiki.net.
Change-Id: Ib3b06dc0f0f3efe062ed39d674c0ed6960eda70f
2024-04-05 09:37:44 +02:00
thiemowmde b02028b671 Move ve-cite QUnit tests to top-level tests/ directory
It's just hard to find and confusing when hidden in that
sub-directory.

Bug: T358851
Change-Id: I19ffe73b79fa9add52af12f477afe7abbc6db836
2024-04-03 12:03:33 +02:00
Translation updater bot c9a93cb3f4 Localisation updates from https://translatewiki.net.
Change-Id: I662c8bfc31d27125e969f8c7dfe8440effec62e8
2024-03-29 08:46:22 +01:00
jenkins-bot f4c690fa1a Merge "ce.MWReferenceListNode: Only open dialog on unmodified left clicks" 2024-03-28 16:14:32 +00:00
Ed Sanders d368f45c17 ce.MWReferenceListNode: Only open dialog on unmodified left clicks
Change-Id: I06f6e2cc89f595e6dcc931b78c908ff2270e4629
2024-03-28 15:30:43 +00:00
jenkins-bot 7906b2147a Merge "Remove confusing, unnecessary .length check on a string" 2024-03-27 08:15:09 +00:00
thiemowmde 61a49f4337 Remove confusing, unnecessary .length check on a string
I find this particularly confusing because it makes it look like this is
an array. As a reminder, while empty arrays are false in PHP they are
not in JavaScript. An extra `if ( array && array.length )` is really
critical. But this is a string. Empty strings are false in JavaScript.
No problem.

This was originally written in 2013 via Ib244ff6 as a pure .length
check. The duplication was added a year later via Id401d97 for an
unknown reason.

Bug: T356871
Change-Id: Ied335f170a9a0a7bbc8c8fd12f95b6902f401bbf
2024-03-27 07:16:54 +00:00
Translation updater bot 6ca87923bb Localisation updates from https://translatewiki.net.
Change-Id: I0c667f3a28bf61f9304ffe4f3c7844f17cf6af8e
2024-03-26 08:19:09 +01:00
jenkins-bot 78363709a3 Merge "Make use of LESS mixins in ext.cite.styles.less" 2024-03-22 22:29:29 +00:00
jenkins-bot b0b356f4e8 Merge "Add initial QUnit tests relevant for reference re-use in VE" 2024-03-22 10:49:33 +00:00
jenkins-bot c7eb279260 Merge "Use design tokens in Cite extension" 2024-03-22 08:31:29 +00:00
thiemowmde 9e7b365531 Make use of LESS mixins in ext.cite.styles.less
Bug: T360720
Change-Id: Ibef7df801f1dc5d550e6663200fa38ddf8c21054
2024-03-22 09:08:28 +01:00
Translation updater bot 7535cf0b3d Localisation updates from https://translatewiki.net.
Change-Id: I7b2bb4d2cf0dd4180484dc9fdd1361ddc1a576ac
2024-03-22 08:43:46 +01:00
Jon Robson 75b4682dbf Use design tokens in Cite extension
Upstream this value from Minerva where it is being
overriden.

Bug: T360720
Change-Id: I03536d033c7cc0f2420550f22fd4b094e0d179ba
2024-03-21 15:11:23 -07:00
thiemowmde d6a58cfa8d Add initial QUnit tests relevant for reference re-use in VE
Note these are more meant as regression test to better cover what's
done in other patches. Everybody should feel free to delete a test
when it gets in the way. I marked a few especially fragile places
with respective comments.

Bug: T358652
Change-Id: I7844907fe3ef4f3439717381b4ecdac9e2d0a825
2024-03-21 09:37:26 +01:00
Translation updater bot 9bc74e7694 Localisation updates from https://translatewiki.net.
Change-Id: I2d2a414f5fa41f47d6418302e8712bf2e1f30aba
2024-03-21 08:54:27 +01:00
Translation updater bot e6f17fd477 Localisation updates from https://translatewiki.net.
Change-Id: Icb746719a0a9d1b12c9ab23577a6fb4068c0957a
2024-03-20 08:23:14 +01:00
WMDE-Fisch 463e25b742 [Cypress] Streamline some selectors and click paths
Change-Id: I9c897f3c94a44f50de5c7a31822645a52cb3d70d
2024-03-19 11:33:23 +00:00
Translation updater bot 8dff3e20c5 Localisation updates from https://translatewiki.net.
Change-Id: I512a36ea005567c4acd4b5d158720922307a8351
2024-03-19 08:24:41 +01:00
jenkins-bot dbff601ebf Merge "Remove obsolete @method annotations" 2024-03-18 10:00:17 +00:00
jenkins-bot 974401489d Merge "Move reference previews to Cite extension" 2024-03-15 19:15:16 +00:00
jenkins-bot 2f1b3477f7 Merge "Remove broken CSS for ve.ui.MWReferenceGroupInputWidget" 2024-03-14 09:07:48 +00:00
Translation updater bot 5b7e331563 Localisation updates from https://translatewiki.net.
Change-Id: Ia5d8a16095d0a5893728799260bec416226e6e59
2024-03-14 09:02:36 +01:00
jenkins-bot cb725645ea Merge "Fix broken deletion of non-existing <ref refGroup="…">" 2024-03-13 16:37:43 +00:00
Jon Robson dcb513eb0e Move reference previews to Cite extension
The ext.cite.referencePreviews module will transparently replace the
ext.popups.referencePreviews module after this patch.  Configuration
stays in Popups for now, we can migrate it in later work.

CSS classes may be renamed in the future but this will be handled
separately since it could be a breaking change for on-wiki
customizations.

A lot of fancy footwork happens in this patch to emulate a soft
dependency on Popups.  This mechanism doesn't exist explicitly in
either ResourceLoader or QUnit, so lots of workarounds are used, to
conditionally load the module and to dynamically skip dependent tests.

renderer.test.js is fully skipped for now, but can be wired up in
later work.

Bug: T355194
Change-Id: I0dc47abb59a40d4e41e7dda0eb7b415a2e1ae508
2024-03-12 17:43:51 +01:00
thiemowmde fa77ef25bd Remove broken CSS for ve.ui.MWReferenceGroupInputWidget
This CSS exists since I2ab47e7 from August 2014. The original idea
was to dim the default "General references" when you edit a <ref> or
<references> list in VisualEditor.

Steps to reproduce:
* Start VisualEditor.
* Edit a <ref> or <references> list.
* Edit the group.
* You will see the dimmed text "General references". This is not the
  CSS in this patch, but the default styling for OOUI placeholders.
* Open the dropdown. The list will show a "General references" item.
  It's not dimmed. This is where the CSS was meant to be.

The CSS class name in the OOUI mixin was actually changed from
"oo-ui-flaggableElement-…" to "oo-ui-flaggedElement-…" via I1abecd8,
just a few days later.

In addition the selector wouldn't work anyway for other reasons.
The dropdown is not inside the `.ve-ui-mwReferenceGroupInputWidget`
container any more but placed outside by the OOUI window manager.
And the selector's specifity is to low, at least since Ic57b3ff.

I argue it's not worth fixing it. Nobody missed it for 10 years.
Light gray text would be illegible anyway on the light gray/light
blue backgrounds used in the dropdown menu. Let's consider it dead
code and just remove it.

The class name doesn't appear anywhere else (any more):
https://codesearch.wmcloud.org/search/?q=flaggableElement

Change-Id: Ia802303737ba35cd4b14fae924b7227472f905fd
2024-03-12 16:36:22 +01:00
thiemowmde ae786bc2ef Fix broken deletion of non-existing <ref refGroup="…">
This can be quite confusing:
* A node does have attributes. One of the attributes is called
  "refGroup", another one "mw".
* mw contains a JSON structure with just a few elements, most
  notably a "body" and an "attrs" element. These reflect what was
  originally written in the wikitext.
* mw.attrs reflects the original properties a.k.a. attributes from
  the <ref …> or <references …> tag.

Deleting mw.refGroup doesn't do anything because the attribute is
called <ref group="…"> in the wikitext, not <ref refGroup="…">.

You can actually see this bug in action on all wikis: Go to a page
that uses references in non-standard groups, e.g.
https://en.wikipedia.org/wiki/Historic_Cherokee_settlements
Start VisualEditor. Find e.g. the [notes 1] reference. Edit it
and change the group from "notes" to "General references". Click
"Publish…" and "Review" your changes. The visual diff works because
it apparently uses other information. The wikitext diff is empty.
This is also what's saved: nothing. The edit is lost.

Bug: T359943
Change-Id: I798605d2fd60a6b8f317ec85a4e4d08fd245e084
2024-03-12 14:44:00 +00:00
Adam Wight ba137fba88 Clean up top-level docs
* Include the README in generated JS docs.
* Tweak stray top-level files to explain their role.  Note that the
wmf template forces these files to appear on the docs home page...

Bug: T358641
Change-Id: If421414340903991f50a06a76551bd7cd2904c5e
2024-03-12 12:23:18 +01:00
thiemowmde 644597c402 Move Parsoid-specific CSS into a subdirectory
The first two files have been added to the root modules/ directory
via I487095d in 2015. No problem.

Many, many more files have been added via I000b453 in 2022. It's
really hard to tell what is what since then.

I'm not absolutely sure what the naming convention for this folder
should be. Could as well be "localized-styles/" or just "Parsoid/".

Bug: T156350
Change-Id: Ibcf8c7a6db5400ed8a9811244a070e03ff372a39
2024-03-11 12:42:25 +00:00
Translation updater bot 7b308564e0 Localisation updates from https://translatewiki.net.
Change-Id: I1273544798e72192a48ab0219f7e1748ffb95e33
2024-03-11 08:26:28 +01:00
Translation updater bot 15663dc283 Localisation updates from https://translatewiki.net.
Change-Id: I8eb8c35e3283224b8101ea59b421648f4dca24ad
2024-03-04 08:23:03 +01:00
Adam Wight 8d0202a664 Minor logic cleanup
This didn't mean what it looked like: `||` has higher priority, so an
undefined elem would not result in an empty string.

Change-Id: I1e361842f060815b04802a1ab8f077faa1a8bc6b
2024-02-29 12:12:56 +00:00
Adam Wight 73c90a0e7d Clean up and fix some jsdoc annotations
Some of the annotations were used in a way that confused jsdoc.  This
cleans up redundant annotations and uses more canonical tags.

These changes cause all classes to now appear in the generated pages.

Includes linking to external docs.

Bug: T358641
Change-Id: Iaee1dadcc19a70c27839d0d27dfa6a07a70fb46b
2024-02-29 13:05:42 +01:00
thiemowmde 5d8e256fbc Remove obsolete @method annotations
These tags are 10 years old. Current documentation generators don't
need them.

Tagging something explicitely as being a @method can be useful in
an interface where the elements are initialized with e.g. `= null;`
instead of having an implementation. But we have implementations
here. Sure these are methods. No need to say that in the
documentation.

Also removing a comment that's obviously a copy-paste mistake from
what was the ve.ui.MWMediaSearchWidget back then. See Ib244ff6 and
before.

Change-Id: I7df6c789d10fd89e7fe97d56c942fd22c56d8458
2024-02-22 20:07:33 +01:00
jenkins-bot 5bad2b183f Merge "Revert "Avoid creating a MWReferenceModel if not needed"" 2024-02-16 08:30:13 +00:00
DLynch 6bc1ae4146 Revert "Avoid creating a MWReferenceModel if not needed"
This reverts commit 74f66bc478.

Reason for revert: this broke reference reuse from Citoid

Change-Id: I86efea4945c1795dbfd61f4e020d78ca81a6f4d1
2024-02-16 03:54:34 +00:00
Translation updater bot 11591f72cd Localisation updates from https://translatewiki.net.
Change-Id: I6fa8273a3bb51c75ec72e928d78d00a0ed66e137
2024-02-14 08:18:28 +01:00