Commit graph

67 commits

Author SHA1 Message Date
Jon Robson fef3740fa5 Clean up preferences code
- Reference preview preferences should be defined inside Cite
- Don't use constants for seldom used strings to make the code
more readable.
- The lightweght ext.popups module is now always sent to the user
This was a micro-optimization and not necessary to do

Bug: T365538
Depends-On: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
Change-Id: Ie8fa1672b9fdbb1c6b840dde5c9060a20a625adb
2024-09-20 19:06:38 +00:00
WMDE-Fisch 1912475dae Remove most ReferencePreviews related i18n messages
The keys belong to the Cite extension where they are used already.

Bug: T363156
Depends-On: I788c16c5bddc0df7f00dbbc39625b9adaa5bf184
Change-Id: I1205af0539d6b2693f0e96d70393e7ecb005b7ba
2024-06-04 10:48:54 +02:00
WMDE-Fisch b218a77ca4 Remove all BetaFeature code from ReferencePreviews
The extension is out of beta and will be enabled by default now.
Leaving some hints if we decide to also remove the feature flag.

Bug: T282999
Bug: T351708
Change-Id: I1556b2f3592294d094770ede2c276eddeef8bbe9
2023-11-24 13:07:46 +01:00
Thiemo Kreuz 792324359f Change "graphic" to "figure" in placeholder message
This message is not for stuff that's literally a "graphic", but
for tables and some other block elements. I believe "figure" is
a word typically used in science to refer to tables, diagrams,
and such.

Bug: T220208
Bug: T273967
Change-Id: Ie47a1369657608d97ad421507af25fbfa99aaed5
2021-05-19 10:22:21 +02:00
Svantje Lilienthal 3b6d9ccc9d Renamed settings local from simple to page
We changed the handling of the popup settings. They now contain popup types (pages and references). 
To not get confused with the old setting options (simple, advanced and off), 
we would like to rename the local for the simple setting to page. 
It should already contain the correct string.

Bug: T277639
Change-Id: I8847b890e9e31602277a92d82a188fcdd3eea855
2021-04-23 14:35:06 +00:00
Svantje Lilienthal e5909e06c5 Updated settings link for anonymous users
Bug: T277640
Change-Id: I5abfed7ba1d55286276d03141dd3af33008b7e04
2021-04-23 12:46:31 +02:00
Svantje Lilienthal 09c2c52945 Added popup types handling
We added reference preview as a checkbox the the
anonymous user settings. To handle both popup types
(pages and references), we changed the usage of
preview.enabled. We pass on all types as a map
inside preview.enabled. The footer link to edit the
settings will appear for anonymous users if at least
one type is disabled.

Bug: T277639
Change-Id: I860a1b35ac7749d8d0884575f6acb7186ad8e4d0
2021-04-23 12:14:23 +02:00
Svantje Lilienthal cf9258b0c5 Changed radio button to checkbox in anonymous user settings window
Bug: T277639
Change-Id: Ifa84dda88a8a167fc8ed2cef17254c1b722ade2d
2021-04-21 14:13:47 +02:00
WMDE-Fisch 190962cc5b Remove dead code around cog wheel dialogue
An "advanced" option was first introduced in 2014 via patch I374805e
(originally named "monitor-or-edit", renamed via patch I7b4f6d2).

The isNavPopupsEnabled() function was added in 2016 via patch
Ic660f48.

The code that disables the extension entirely the moment the NavPopups
gadget is enabled was added in 2017 via patch Ia474b1b (T151058) and
patch Ia837816 (T160081).

As of now, the "advanced" option can only be seen in an extreme edge
case:
* Only for anonymous users.
* Only if NavPopups is enabled by default for anonymous users.
* Only if the $wgPopupsConflictingNavPopupsGadgetName setting is
  misconfigured.
* … or if NavPopups is not a gadget in the first place, but e.g.
  loaded via Common.js.

In this situation the settings dialog opens with all *3* options. This
is broken for several reasons:
* The "simple" option enables the extension, but doesn't disable
  NavPopups. Both trigger, resulting in both popups being displayed
  the same time.
* Since "simple" is the default, this bogus behavior is the default
  for anonymous users.
* The "off" option doesn't stick. Every time the settings dialog opens
  "advanced" is checked instead.
* "Off" can't work anyway. There is no code to disable the gadget.
* Only the "advanced" option "works", but more by accident.

It's unclear how to fix this:
* There is no code that does anything with the "advanced" option. It's
  not even stored. The behavior of the option is identical to "off".
* The code appears as if "advanced" was meant to be shown instead of
  "off". I.e. anonymous users can only choose one of the popups, but
  not disable both. But there is no code to hide the "off" option.
* The bug when both popups are displayed was fixed in 2017 via an
  entirely different mechanism. Re-introducing "advanced" does not
  only mean duplication, it's unclear how the 2 mechanisms are meant
  to work together.

It really, really feels like this was just forgotten.

Bug: T278949
Change-Id: Iab21f3a649a5b2f19ebb0d0dbb45ce1450c65678
2021-04-15 15:29:16 +02:00
Clare Ming 4908f82c01 Add title attribute to settings gear icon
Add message, description, extension for title. Update createPagePreview, renderPagePreview methods to add title attribute to settings gear icon. Add test for title attribute. Increase maxSize, maxAssetSize, maxEntrypointSize. Add compiled js files.

Bug: T274887
Change-Id: Ibb29deb3418569d8283b954b4b22074423e78bda
2021-04-02 13:30:07 -06:00
Andrew Kostka e4e07e509a Separate page and reference preview preferences
Bug: T277638
Change-Id: I8144625e0d3a2626511f35d4e92d082b6fa44bb4
2021-03-29 14:09:27 +02:00
Andrew Kostka 9a7539391f Messages for a separate reference previews preference
Bug: T277638
Change-Id: I8294cea7f8677b8ff09ce7deff3e69ed6e6ea93a
2021-03-24 10:25:56 +01:00
Thiemo Kreuz 919a7a5a30 Don't use {{int:…}} in full sentence messages
Directly referencing other messages is sometimes a good idea,
e.g. in a sentence like "Please look for a button with the
label \"{{int:cancel}}\"."

But here the word is used as part of a sentence. "This is
really not great, because in some languages the word can
change according to grammar." (T276218#6886266)

This patch doesn't change the wording of the messages, and
should not need PM approval. The qqq.json entries are
annotations for tranalators and don't need PM approval either.

The only additional change is that I update the gadget's names
to be their canonical ones everywhere.

Bug: T276218
Change-Id: I8a05f3871fa1d5d0570e1cba90ead29f9ea3b7df
2021-03-05 16:01:00 +01:00
Thiemo Kreuz 66b5e307e1 Minor tweaks to the wording of gadget-related messages
Bug: T276218
Change-Id: I6b9ebec33f39e938855c5ee9b2f9665ea92560d0
2021-03-04 09:53:41 +01:00
WMDE-Fisch f7e60f2016 Change wording around gadgets and user scripts
The text could be misleading. There are global user scripts but no
global gadgets currently.

Also removing spaces around the pipes in links.

Bug: T276218
Change-Id: Ic29258c107393640e605bffff2ebf1c73e09c363
2021-03-03 12:22:28 +01:00
Andrew Kostka 82d54945e4 Combine page and reference preview preferences
Update copy and remove unnecessary reference preview preference
in favor of using the default preference. It seems there is no
stable method to link to the subsections on the preference page
for gadgets. So in all cases does the link just point to the
gadgets pref page.

These changes should only be visible when reference previews
are no longer marked as a beta feature.

Bug: T265709
Change-Id: I7b8ab91331092ada04b230315373548673b9272c
2021-02-25 10:21:16 +00:00
Thiemo Kreuz ef4b032513 Add new reference type "note" without an icon
Bug: T274343
Change-Id: Ib9f3fe98baf1d194e686b007a9c535f2b49ac19d
2021-02-11 10:15:36 +01:00
jenkins-bot 46ece02214 Merge "Use a checkbox for the preference" 2020-11-17 12:31:32 +00:00
Svantje Lilienthal 0b6c859a2b hide reference previews when reference tooltip gadget is active
Change-Id: I5f43270bfeba944c05dc09adf771ed07057237c7
2020-11-16 18:36:04 +01:00
Adam Wight 789cedc168 Remove reference preview "Jump to reference" link
Now that the footnote label links to the references section, we don't
need this additional link.

Bug: T265482
Change-Id: Ib9b2939eb49e7b826c7699a5b7fa0e8255fa9da1
2020-10-30 11:33:24 +00:00
Bartosz Dziewoński 310d587732 Use a checkbox for the preference
Bug: T174726
Change-Id: Ie7dff009adc97653fdb3106f58ea97d26da49f49
2020-10-28 20:40:25 +01:00
Thiemo Kreuz 1cf721e2a2 Handle collapsible & sortable elements in reference popups
Elements that are marked as collapsible (often tables, but can
actually be anything) are most certainly marked as such because
they are big and don't fit in a popup.

Another plugin makes tables sortable.

In both cases non-functional UI elements appear in the popup.
We decided:
* Hide collapsible elements (no matter if currently collapsed
  or not), and show a placeholder text instead.
* Remove sortable arrows.

This is a baseline patch that solves everything, except the
(i) icon is missing. This will be added in the next patch.

Bug: T220208
Change-Id: I58f3036bf4988d0ebe5716b0a54506446fca10c3
2020-10-28 17:23:12 +01:00
Yuki Shira e7c0997cf5 Add Special:MyLanguage for better user experience
Change-Id: If3617ed687ed25a1f0b92d51fa81e1a00c897528
2020-05-10 13:54:41 +09:00
Thiemo Kreuz dc82c423fa Add the word "popups" to this extensions description
Previously, the name was "Page Previews". This is not true any more.
Reference as well as Math previews are developed. We changed the name
to "Previews".

This creates confusion because Special:Version does not contain the
word "popup" any more. I think it's worth fixing this.

Bug: T219153
Depends-On: Ie0060125cf4646d80f8c88eedd01551f66e3fb89
Change-Id: Id9862f45690f1c8b391f55d7fcaf88aa15f65912
2020-03-13 15:11:58 +00:00
jenkins-bot eadbbb444c Merge "Change the extensions name on Special:Version" 2019-10-22 07:09:38 +00:00
Thiemo Kreuz fb5809d61e Change the extensions name on Special:Version
The extension is not only about "Page Preview" any more. It already
renders Reference Previews, and might render math expressions as well.

Bug: T219153
Change-Id: I5aa616d9eff3e65e018a9d64955b8d32d4f7e690
2019-10-17 11:41:47 +02:00
Thiemo Kreuz a63a1cf91c Split user preferences for Page and Reference previews
Bug: T233813
Change-Id: I89205658c561961b90abaa133a004e54beebfab5
2019-10-17 11:21:21 +02:00
Thiemo Kreuz 1d2becc25a Consistently talk about "Reference" instead of "Footnote"
During story time on 2019-03-12 it was decided to consistently talk
about "References" in all messages. Main motivation is that this is
the term the community is most familiar with, and it is also the term
that is used in reference section headings most of the time.

Bug: T215063
Change-Id: Iaab8d2c0da1546a3c9d27bc8e2e1c784050ed135
2019-03-13 09:29:26 +01:00
WMDE-Fisch 7e6afa7bbb Add missing "the"
Bug: T215896
Change-Id: If04f26d4d134ba58e1121331879bb01e825cd955
2019-02-27 13:46:55 +01:00
Thiemo Kreuz 7e41bed5d0 Update type-specific reference headings according to requirements
According to the now refined acceptance criteria in T215281.

Bug: T215281
Change-Id: Ib96ce2289ecdda36ca4621b2237acf0a7bc49df5
2019-02-26 12:02:32 +01:00
Andrew Kostka f91c160214 Add a beta feature switch for reference previews
Bug: T215896
Change-Id: I6a4cc2103d594dc11f62da247891d3f190619899
2019-02-25 20:38:12 +01:00
Thiemo Kreuz d81415a040 Add all reference type icons and messages
These icons are currently unused because the gateway does not deliver
the necessary information. This will be used starting with I6223cbb.
This patch aims to introduce all resources needed by the later.

Bug: T214908
Change-Id: Ie0c3c059222700169f2605c3123554c74d974256
2019-02-20 09:32:11 +01:00
Johannes Kroll d4d8cefac4 Rename link in footer to "Jump to footnote"
Bug: T215063
Change-Id: I18201bdeee65418ef147203a845f34447c24e163
2019-02-13 16:01:24 +01:00
Thiemo Kreuz 671c39ef4a Add reference preview type
This adds support for preview popups on reference/footnotes from
the Cite extension. For that a new preview type was introduced and
integrated into the existing structures.

The essential starting points were this code comes into action are
added behind the feature flag introduced in the previous patches.

Bug: T213415
Change-Id: Ie0ccb03117bd654373d0f458b62cc52018361c67
2019-01-23 12:12:36 +01:00
Volker E 3cfb1d346a Amend preferences message to unify with messages elsewhere
The other messages when announcing a widget below use a ':' at the
end of line and add extra information in brackets, not on a new line.

Bug: T203992
Change-Id: Ide151e39159df01fa1c97c808bcf7ad29c671580
2018-09-24 16:50:03 -07:00
Volker E 567bd4176f Remove unique and misplaced italicized text from preferences setting
This is the first step, in a second after the OOUI rollout we should also
remove the paragraphs within the `label`, for appearance and HTML validation
reasons.

Bug: T203992
Change-Id: I4a12e4572ae2518079616e3765a5d3954aab794b
2018-09-12 15:44:10 -07:00
Stephen Niedzielski 007efbef05 Hygiene: remove unused strings
Remove popups-redirects and popups-send-feedback, which are unused. They
appear to be remnants of the code before the rewrite:

- popups-redirects was removed in I42fb9cc1a8b26eaf6807243e4e7bdbf0b56dc35c
- send-feedback was removed in If545873bb97b1da8ea5001dce575b1ef512903fb

Also, add detail to prefs-reading qqq string.

Change-Id: I072d416b2805a2a05e76aa28f083db730e0a523a
2018-04-11 22:47:54 +00:00
Stephen Niedzielski c4b50b04ac Hygiene: remove unused resources
In I7395e3438836149becdd576942bdaf6f21b4163f the settings templates
were rewritten so that they no longer displayed an image.

descriptionText and images were dropped from the template but not from
the template provider. These are artifacts from relating to that patch
and are no longer used.

Change-Id: I1be7ef288d37f338e83dab3cf041e628a06608d2
2018-03-21 17:07:18 -05:00
Jan Drewniak 1e946a379d Custom page preview for disambiguation pages
Creating a different page preview for disambiguation pages.

This patch:
- modifies the Preview model to accept a new 'type' property
- modifies the Restbase Gateway to pass the 'type' prop to the Preview model
- creates a new template to accept both generic/disambig previews
- modifies the renderer to render the new template
- generates icons for new template through resource loader
- adds new i18n strings
- modifies event-logging "preview seen" event to send new "disambiguation" previewType
- updates event logging schema version
- adds tests for Preview model and renderer for new preview type
- does way too much? yes, yes it does.

Bug: T168392
Change-Id: Idc936cc3eabbdd99a3d98f43c66b4cdbb7d24917
2018-03-14 11:24:26 -07:00
Stephen Niedzielski 6ba57786fb Update: missing preview copy
Update the placeholder extract and button text shown when a page preview
is unavailable from:

  "popups-preview-no-preview": "Looks like there isn't a preview for this page"
  "popups-preview-footer-read": "Read"

To:

  "popups-preview-no-preview": "There was an issue displaying this preview"
  "popups-preview-footer-read": "Go to this page"

Bug: T183151
Change-Id: I0600dbc2e4d51a13675041d3c0741a793f4eae37
2018-01-16 18:36:54 -06:00
jdlrobson 48da56b1b4 Update gadget warning to mention global gadgets
Bug: T178566
Change-Id: I783a4dacfedd32adbc39b6c9dbb03eff36f2c3d8
2017-10-31 16:47:20 -07:00
Umherirrender 40b4c053d8 Remove dot at end from extension description
Consistency tweak for extension active on translatewiki.net
Description on Special:Version does not end with a dot

Change-Id: I458dcdc62e609f1f002785e31d222d45514b55d4
2017-08-24 20:47:53 +02:00
Amire80 9df91fd043 Change "article" to "page"
This is the usual practice in MediaWiki extensions,
for consistency among wikis where pages are
not necessarily articles.

Change-Id: I25d8ccb9090c31e4672998c8a01ebdfcaf625e9f
2017-07-04 07:15:44 +03:00
jdlrobson ded774528b i18n: changes to Page previews in beta tab of preferences
* Add full stop
* Simplify description
* Rename from Hovercards to Page previews

Bug: T153599
Change-Id: I0f6fc5aa6b29070b44b452bf73b7d16117d4ecef
2017-03-15 18:56:24 +00:00
jenkins-bot ba99b1f535 Merge "Remove last modified line" into mpga 2017-02-02 11:44:33 +00:00
jdlrobson 09ccfa9a13 Remove last modified line
Note this is a breaking change in the sense that it breaks the function
signature for createModel which no longer needs to be passed the last
modified time. Given this change is in the mpga branch at current time
and hasnt been exposed for public use I have deemed this okay.

The change removes tests relating to the last modified bar, removes
lines in the templates and updates existing tests and code to reflect
the new function signature for create model.

Settings icon is floated to right which will be flipped for RTL
users.

Bug: T137775
Change-Id: I7737e37d956c62f1f1c0694d7a25a58d91651f4d
2017-02-02 11:28:11 +00:00
jdlrobson f9e402bd26 Changes to copy
Bug: T156368
Change-Id: Ibb570743a9be0028b1f593c465ef95578752b8a5
2017-02-01 10:55:54 -08:00
Piotr Miazga 05060a3073 Inform users about conflicting gadgets/customizations
Changes:
 - Added a default help copy under Page Previews enable switch

Bug: T151058
Change-Id: I4f24906147e1e9d8a8f132a9a84606153c8694d7
2017-01-17 20:49:34 +01:00
Piotr Miazga 211f1d1658 Disable Page Previews preferences when NavPopups are enabled
Changes:
 - introduced PopupsGadgetsIntegration class handles all checks
 - show help message on Preferences page when NavPopups is enabled
 - unit test everything

Bug: T151058
Change-Id: Ia474b1b30378efe84dedf3ad47c1f833e88d69b5
2017-01-11 01:06:48 +01:00
Piotr Miazga 05c57ef05f Update enable previews copy
Changes:
 - change english copy for enable previews radio button

Bug: T151058
Change-Id: If52c0ccad1d7345dd7f4063f802cbf7c36cd35f2
2017-01-09 19:41:44 +01:00