Commit graph

1379 commits

Author SHA1 Message Date
Adam Wight 5b2cbc48bd Wire subref counting into the numbering renderer
Significant change is that footnote marker numbers are changed from
being a CSS-rendered marker to using the rendered "fallback" text.
This could be avoided using the same trick as is implemented for the
reflist: send an inline style variable with the marker content; but
let's only do this if really necessary for user experience.

Template-produced refs are still wrong, but this patch continues to
render them as they come from Parsoid, in the content script.

TODO in later patches:
* reuse of a subref is rendered as '3.2.1' in reader view but '3.0'
and '3.1' in the editor.
* subref numbering is backwards in RTL languages

Bug: T247921
Change-Id: Ieff73769f8ebbc3724f6a9b498487c4e7d09aa2e
2024-07-15 07:08:06 +00:00
WMDE-Fisch 9266cce141 Ignore placeholders when getting refs from document
Citoid uses placeholder refs to preview where a new/re-used ref
would be added. This also influences the counting and preview in
the reference list for the moment the placeholder is visible.

I can image this that this might become a feature in the future
but for the moment it's a distraction IMO.

Bug: T247921
Change-Id: I5c5e84ae4b183f99530fda0736a58139e9e25d1a
2024-07-12 18:14:36 +02:00
Adam Wight a0af51b476 Fix: safely handle refs which have no "firstNode"
This can apparently happen when pasting refs from another document.

Bug: T247921
Change-Id: Ibe8c4d1625d2b6c9a11d9b4fea85c305f84265fa
2024-07-12 12:41:01 +02:00
Translation updater bot 81bb451395
Localisation updates from https://translatewiki.net.
Change-Id: I0ae952009d28914848da86ee6b290a41b8cb2686
2024-07-08 09:32:30 +02:00
jenkins-bot 5dc88f01db Merge "Promote orphaned subrefs to the top level" 2024-07-05 11:25:58 +00:00
jenkins-bot 1f4175593b Merge "Display extends warning message when editing a reference" 2024-07-05 10:55:58 +00:00
jenkins-bot 0030cfde68 Merge "Don't update the editors re-use warning when re-using a reference" 2024-07-05 10:55:57 +00:00
jenkins-bot 0122adb8ba Merge "Extract some methods around the reference insert/update workflow" 2024-07-05 10:55:57 +00:00
Adam Wight de7f294f91 Promote orphaned subrefs to the top level
This isn't the ideal solution since it doesn't exactly match the
rendered reader view, but it's a reasonable workaround and an
improvement on "undefined" numbering.

Bug: T247921
Change-Id: Ic0d88123d50e2fcb7f25e897280dbfdb6d494501
2024-07-05 11:46:26 +02:00
Translation updater bot 12c9c1c0e6
Localisation updates from https://translatewiki.net.
Change-Id: I1fb24fb5e14c718ecc0fe2e952dde653d1321aa8
2024-07-05 09:47:23 +02:00
jenkins-bot c5a9012b67 Merge "Replace "shield" hack in MWReferenceResultWidget with CSS" 2024-07-04 07:38:00 +00:00
Translation updater bot b1a4ad72a4
Localisation updates from https://translatewiki.net.
Change-Id: I5e7cc90b15a75387d0f11ac5456eb34a0258c9e2
2024-07-04 09:23:20 +02:00
jenkins-bot de1445d2e3 Merge "Render subrefs indented under parent" 2024-07-03 09:55:58 +00:00
jenkins-bot 30de08bfe9 Merge "[refactor] switch reflist rendering source of truth" 2024-07-03 09:54:52 +00:00
mareikeheuer 2ffbf1fa66 Display extends warning message when editing a reference
MVP implementation for adding a warning when editing a reference
that's the extension of another. In the current approach we're
just using the elements .text() like we do when you create an
extended reference.

Bug: T247922
Change-Id: I2fc574152059937b4aa3fc25ee486d363cc809d5
2024-07-03 07:18:35 +02:00
WMDE-Fisch f317419bb9 Don't update the editors re-use warning when re-using a reference
We only need to set some values that are needed by the `insert`
action triggered that then handles the insertion of the ref.

The form to edit or add a reference will never be visible
in the re-use workflow. No need to update that message then.

Change-Id: I710862bdc1bde6a8ce663d863d721cbf075494f0
2024-07-02 12:30:26 +02:00
WMDE-Fisch b483c829ab Extract some methods around the reference insert/update workflow
Includes renaming the method so it's more clear what it's doing.

As preparation for adding the extends warning to the edit pane and
to allow easier identification of parts belonging to the edit
workflow.

Change-Id: If84c5dbdee19c0ebc0a28b50dda93fef3f558c6e
2024-07-02 12:30:11 +02:00
Adam Wight 2748f659a8 Render subrefs indented under parent
With this patch, we show reflists in a hierarchical view with subrefs
listed under their parent.

TODO in follow-up patch: numbering of subrefs is still incorrect.

Change-Id: Ia82658af72caebd29241b9bd329d236ddc3f1e6d
2024-07-02 09:20:53 +00:00
Adam Wight d03d2d8d20 [refactor] switch reflist rendering source of truth
Pure refactor which shouldn't change output in production.  Switches
to interfacing with MWDocumentReferences to get refs in index order.
Temporarily suppresses any subrefs, we only show top-level refs.

Bug: T247921
Change-Id: I9c8347b064173027f436722c87e15e0381c958bd
2024-07-02 11:20:16 +02:00
jenkins-bot 2957948239 Merge "Display reference preview with sub reference" 2024-07-01 08:52:52 +00:00
mareikeheuer 7380a861f0 Display reference preview with sub reference
Identify both parent and child reference (reference and extended
reference) and display them in the reference preview popup.

This is a very simple basic implementation so at least avoid that
the sub referenc content is shown without context.

Bug: T239228
Change-Id: I857e1be32db9fd72073015cbba1b1bd37e32085f
2024-06-28 14:23:27 +02:00
Translation updater bot 94ebc6a8f8
Localisation updates from https://translatewiki.net.
Change-Id: I3e0ad8d57b6cd23accc955beb2284b64c57fe3f0
2024-06-28 09:40:54 +02:00
Translation updater bot da045950b0
Localisation updates from https://translatewiki.net.
Change-Id: I4cfed8bf3be5afe4bc6ce04c487b21710edb6449
2024-06-26 09:21:04 +02:00
WMDE-Fisch 20c3798055 Fix re-use search activity tracking name
C&P mistake in the original implementation. Otherwise we end up
with an undefined in the name.

Bug: T362347
Change-Id: I5c6957ca9fc81e6a5211aab050025eea5d0addbe
2024-06-25 17:02:04 +02:00
Ed Sanders 66fb3e661a Fix some documentation warnings
Change-Id: I7a97c99a919796f987a05ba17e25357fb5ef14c5
2024-06-21 18:00:45 +01:00
Ed Sanders 43333cd6b8 Re-enable pointer events in reference preview
This partially reverts I7e82e03ecfe.

Bug: T368119
Change-Id: Ibfd917b2413e306073e1ef4b3e50f06066a7c967
2024-06-21 12:49:53 +01:00
Adam Wight a2eec914cd [refactor] Split out reflist item rendering
Should be a no-op.

This change is made to prepare for recursively rendering subrefs.

Bug: T247921
Change-Id: Iebf546743c29a4a591ec1f085cc2e1b3496a38fa
2024-06-19 12:29:50 +02:00
thiemowmde bc7f1a7005 Replace "shield" hack in MWReferenceResultWidget with CSS
Same as in I7e82e03. The extra "shield" element was added in
2013 (!), see Ib244ff6. Back then we couldn't use the CSS property.
But nowadays we can.

Bug: T360034
Bug: T367030
Change-Id: Ib41e062491e65eabc8a52facefe283ba04ce16ff
2024-06-18 12:06:37 +00:00
Translation updater bot eeb4852be3
Localisation updates from https://translatewiki.net.
Change-Id: I3c2ca5242030964eec5b61b6bd72103ae39f76e7
2024-06-17 09:30:17 +02:00
jenkins-bot c197e9e519 Merge "Fix preview of parent reference in context item" 2024-06-15 07:02:12 +00:00
WMDE-Fisch 15bcfdcc70 Implement support to convert extended notes with auto names
To make sure also the parent gets a name even if it is not re-used
we need to iterate the list of reference to see if there's at least
one child that matches the parent.

The rest will be taken care of by getUniqueListKey that makes sure
that the matching temporary names will result in matching literal
names.

TODO:
- Write a ve.dm.Convertor test which shows the auto-name being
added.

Bug: T367031
Change-Id: I6ef42c8ffc8a4ff9224bfb2a910682d2c44f0dd2
2024-06-14 13:05:52 +00:00
thiemowmde 44afa99d49 Fix preview of parent reference in context item
I believe this was a mistake in the previous patch Idd57997. Using
only the .text() of the parent reference is not sufficient. Think of
a reference that contains a <math> formula or – even worse – is
nothing but a <math> formula. The preview will be empty in this case.

Click handlers in the preview need to be disabled. It's only a
preview.

Bug: T367030
Change-Id: I7e82e03ecfeb4e9cf132985684cff5e191506307
2024-06-14 14:32:21 +02:00
WMDE-Fisch aa5368ad32 Use full listKey for extends in the model
This makes it much easier to deal with the internal auto names
used on new elements created during one edit session.

We're ignoring the correct generation of the auto name literals
for now.

Bug: T367031
Bug: T367030
Change-Id: Idd579970cb64500dac27053213e9b116f23b6d76
2024-06-14 14:03:07 +02:00
Translation updater bot 04b0547c25 Localisation updates from https://translatewiki.net.
Change-Id: I53193a27f67f715e04fb5b5cd98a7c9b9592ab1d
2024-06-11 09:53:43 +02:00
Ed Sanders ed1501c577 JSDoc: Update jsdoc-wmf-theme to 1.0.1
Change-Id: I8237dd3aa9ad73dce59e9a9bf001d6af5de8e185
2024-06-10 16:15:48 +01:00
jenkins-bot f415239d11 Merge "build: Update eslint-config-wikimedia to 0.28.0" 2024-06-06 19:00:16 +00:00
jenkins-bot 20c6967f76 Merge "Preserve reflist CSS in dynamic mode" 2024-06-06 18:00:29 +00:00
Ed Sanders 77b7f347c8 build: Update eslint-config-wikimedia to 0.28.0
Change-Id: I9f69e865d47e7cf4a8273bb0fdffbb9dac28b5cb
2024-06-06 16:28:53 +01:00
jenkins-bot e3dbe7dd3a Merge "MWCitationDialog: Use const instead of let" 2024-06-05 10:10:16 +00:00
jenkins-bot 70dd8cf815 Merge "Use array spread syntax instead of Array#concat" 2024-06-05 10:10:16 +00:00
jenkins-bot 27dc7e46b5 Merge "Remove unnecessary local variable for this" 2024-06-05 10:07:47 +00:00
jenkins-bot 863dd201ad Merge "ESLint: Enforce prefer-arrow-callback" 2024-06-05 10:07:46 +00:00
Translation updater bot 943326590e Localisation updates from https://translatewiki.net.
Change-Id: I7e122c6273d34aabba5f3e797e915c5eb27ed0cf
2024-06-05 09:22:31 +02:00
Ed Sanders cc2105e4a3 MWCitationDialog: Use const instead of let
Change-Id: I4f516505566ade57ede2a5c644f6215c786920c5
2024-06-03 12:31:33 +01:00
Ed Sanders d468e9fd55 Use array spread syntax instead of Array#concat
Change-Id: I38db1d3db51033e99dd55ccc867fb6ad0452640f
2024-06-03 12:31:33 +01:00
Ed Sanders aaeedee289 Remove unnecessary local variable for this
Change-Id: Id71b30552597e052f861de21347d3b4f55debee3
2024-06-03 12:31:33 +01:00
Ed Sanders 5a2154de38 ESLint: Enforce prefer-arrow-callback
Change-Id: I8d96b69e8c15bc8ad84cfb0c511396e5b3e7ac20
2024-06-03 12:31:33 +01:00
Translation updater bot 85fddfb1e4 Localisation updates from https://translatewiki.net.
Change-Id: I067a734c6a89950aa56be3551e9ae3fedc4f9fed
2024-06-03 09:31:09 +02:00
thiemowmde 7981f4d430 JSDoc: convert @cfg to @param
Bug: T138401
Change-Id: I5aec31b9a05b41ceb6a4a78c75cb0395aa1880b7
2024-05-28 10:38:26 +02:00
jenkins-bot fc9a610c2f Merge "Streamline code dealing with (undeployed) extends attribute" 2024-05-24 10:57:03 +00:00