Commit graph

23 commits

Author SHA1 Message Date
Adam Wight 1c947a808d Fix for nested #tag:references
It's possible to nest <references> by using tricky constructs like the
{{#tag function, and this breaks our rollback logic.  Try to show normal
output, otherwise show an error.

Includes regression tests.

Bug: T242437
Change-Id: I33e497cdf8508ce7ccb7f0f315c00af5eee47d0e
2020-01-15 12:44:29 +01:00
Adam Wight 475d2aeb75 Clean up i18n messages
* Standardize "Parameters" sections.
* Drop "Cite extension" because it's redundant with the
  translatewiki.net interface.
* Add missing documentation.

Change-Id: If35a80fe6d47d87fa640b3cc454ccbe65f36ba60
2019-12-20 10:58:29 +01:00
Amir Aharoni 00c31ffc7e Split apihelp messages to a separate file
Bug: T189982
Change-Id: I7808076245d39fa10d75d67c9a9180dccd708f40
2019-07-11 18:03:42 +03:00
jenkins-bot c6e13db74f Merge "Simplify weirdly complex [\n\t ] regex" 2018-11-30 23:50:55 +00:00
WMDE-Fisch 6dda36a1e7 Improve a11y support on backlinks
This changes the a11y support on the main backlinks by introducing the usage
of title and aria-labels. The support for these elements increased a lot since
the topic was first tackled and seems the appropriate way to go.

A new message was introduced for the link that will be set when directly
coming from a clicked refrence to emphasize that the can jump back to where
he came from.

Bug: T206323
Change-Id: Ifa56d41bcdb8100e19f29619796b62bb3c886d2f
2018-11-26 11:36:26 +01:00
Thiemo Kreuz (WMDE) 7c06347fc7 Simplify weirdly complex [\n\t ] regex
This change does have two consequences:

1. A few more whitespace characters act as separators. This should not
have any consequence in real life situations, and is mainly done to
make the code easier to read and less surprising.

2. Sequences of two or more whitespace characters previously resulted
in partly *empty* results. This was a potential source of errors. The
additional + fixes this.

Change-Id: Ib58326109c740dd0cbd05d8fddb4af2145f232fe
2018-11-21 17:33:25 +00:00
James D. Forrester 05c006abd6 i18n: Use &lt; rather than <nowiki>< for security testing sanity
Change-Id: I260669a240b7c3a661928140ac2e540ffe064c35
2018-10-25 15:22:05 -07:00
Eranroz 1ca27aa0d8 Support directionality for reference
Adding option for dir attribute in ref tags. The value must be a valid
direction ('ltr' or 'rtl', case insensitive) or the direction will be
stripped out.

The directionality of the li element is set using a css class accordingly.

Bug: T15673
Change-Id: Iff480bc8cc4f81403b310e8efecd43e29d1d4449
2018-05-02 17:27:32 +02:00
Translation updater bot 8580d41a81 Localisation updates from https://translatewiki.net.
Change-Id: Iaf7a80f14a34389fe8f44de033e908feba6d8fe4
2018-01-29 22:19:47 +01:00
Translation updater bot 1854db1134 Localisation updates from https://translatewiki.net.
Change-Id: I6d251b9ca2737ba6b52e44bbc40ca15ff7eef32b
2018-01-24 22:20:41 +01:00
Brad Jorsch c4ce7c98e1 API: Split description messages into summary + additional text
See MediaWiki core patch I778bab2b

Change-Id: I2cea2a9d95886ff8aed655bf0be08857fca082db
2017-06-13 13:27:48 -04:00
James D. Forrester efce5f2b49 Drop the pointless "AllowCiteGroups" config setting
Bug: T161144
Change-Id: Ie1454926b8bfa108a62d088991e66b6dae9c9f10
2017-04-20 22:56:08 +00:00
Timo Tijhof 04c3ad0107 Implement responsive columns for reference lists
This is based on the popular 'count' parameter from Template:Reflist on
English Wikipedia, which has also been adopted by many other wikis.

That template's 'count' parameter allows maximum flexibility on a per-
page basis. This was important because the template can't know how many
references the list will contain. Users typically manually add (and
later, increment) the 'count' parameter when the list exceeds a certain
threshold.

The template currently sets an exact column count (via the CSS3
property `column-count`).

This patch improves on that by instead using the closely related CSS3
`column-width` property. This automatically derives the column count
based on the available space in the browser window. It will thus create
two or three columns on a typical desktop screen, and two or no columns
on a mobile device.

The specified width is the minimum width of a column. This ensures that
the list is not split when rendered on a narrow screen or mobile device.

It also hooks into the raw list before parsing and adds the class only
when the list will contain more than a certain number of items. This
prevents very short lists from being split into multiple columns.

Templates like Template:Reflist on English Wikipedia currently are not
able to set inline styles on the list element directly, which is why
they set it on a `<div>` wrapping the `<references />` output. Because
of this, the feature of the Cite extension must not be enabled at the
same time, as that would result in both the template's wrapper and the
references list being split. The end result would involve sitations with
three columns split in four sub-columns, creating a complicated mess of
nine intermixed columns.

To provide a smooth migration for wikis, this feature can be disabled by
default using `$wgCiteResponsiveReferences = false`. Each individual
template createing reference list can then be migrated, by removing the
wrapper column styles and instead settting the new "responsive"
attribute, like so: `<references responsive />`.

Once any conflicting templates have been migrated, the default for the
wiki can be swapped by setting `$wgCiteResponsiveReferences = true`.

If wikis wish for some templates to keep their custom column splitting
behaviour, templates can also opt-out by setting `responsive="0"`, which
will make sure that it will keep behaving the current way even after the
feature becomes enabled by default for the wiki.

In summary, when disabled by default, pages can opt into this system
with `<references responsive />`. When enabled by default, pages can opt
out of the system with `<references responsive=0 />`.

* Deprecate cite_references_prefix/cite_references_suffix.

  This message is rarely used and opens up compatibility hazards.
  It was already removed by Parsoid, but the PHP implementation
  still had it. It's typically used to add inline styles to the
  wrapper which is more appropiately done in Common.css (or
  obsoleted as part of the skin or Cite extenion itself nowadays
  depending on what style in question).

  It was also a HTML-style message with separated open and close
  segments, which is an anti-pattern in itself.

* Declare module target explicitly and include mobile. The absence of
  this stylesheet caused subtle BiDi/RTL bugs on mobile.

Bug: T33597
Change-Id: Ia535f9b722e825e71e792b36356febc3bd444387
2017-03-07 22:42:47 +00:00
Brad Jorsch d51d8b304f Update for API error i18n
See Iae0e2ce3.

Change-Id: I8f214dd95876e1eadc4a0463cba3d5a13d783014
2016-11-14 12:48:23 -05:00
jdlrobson 509741dc17 Surface references via api query property
* The query request prop=references will return a JSON blob of all
references in the page
* Conveniently references are returned with an array id key that corresponds
to an anchor tag in the HTML
* When references storage is disabled the API request will trigger an
error.

Bug: T123290
Change-Id: I81a965bcb47d17df18f1e415e3c25f88f6b48ffc
2016-02-26 19:02:12 +00:00
cenarium 71889ff017 In section preview, add preview of references to its own section
This is to make it apparent that this isn't part of the preview
of the section itself. A span class is also added.

Bug: T125981
Change-Id: I62c8dca8ee42e79c6b7cd7f837f4e7ee65f77770
2016-02-07 16:34:09 +00:00
Translation updater bot f42e769174 Localisation updates from https://translatewiki.net.
Change-Id: I021f89a195bf6e0a6da78f0354a27e72dcb3fd4d
2016-01-20 21:05:43 +01:00
PiRSquared17 739962b6d1 Add reference list to section preview if missing
For a section preview with missing <references/> tag,
add reference lists for each group.

Bug: T7984
Change-Id: I2ca1b62fc068b20b7df4b0af2e3e79535e656259
2016-01-20 04:25:46 +00:00
jenkins-bot f75e136ec7 Merge "Add pages with Cite errors to a tracking category" 2015-10-08 19:40:45 +00:00
eranroz 5d0fb0309b Show an error if a named ref is defined multiple times
Bug: T85386
Change-Id: I6e7a7594628b3e0c09724c11e5d9f650dde25906
2015-09-30 21:27:35 +03:00
Amir E. Aharoni 68304fcacd Add pages with Cite errors to a tracking category
Bug: T104792
Change-Id: I6f8b12788a20480bd8880332238d545ee70a8ef9
2015-09-24 12:16:13 +03:00
Translation updater bot 63773883d6 Localisation updates from https://translatewiki.net.
Change-Id: I721132f76a3f0cea30aaa48b2c88612f563f4cd4
2015-03-24 22:20:37 +01:00
James D. Forrester 7f10ca97f1 Remove Special:Cite, now moved to its own repository
Change-Id: I6ae358b6855911016793c3227bfc1c04a8637428
2014-10-28 12:02:21 -07:00
Renamed from i18n/core/qqq.json (Browse further)