From 310d587732b8f51116e5209d54b8e5e8a1961cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 28 Oct 2020 20:40:16 +0100 Subject: [PATCH] Use a checkbox for the preference Bug: T174726 Change-Id: Ie7dff009adc97653fdb3106f58ea97d26da49f49 --- i18n/en.json | 4 +--- i18n/qqq.json | 4 +--- includes/PopupsHooks.php | 10 ++-------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 87ed1133e..aa1dd12d8 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -20,9 +20,7 @@ "popups-preview-disambiguation": "This title relates to more than one page", "popups-preview-disambiguation-link": "View similar pages", "prefs-reading": "Reading preferences", - "popups-prefs-optin-title": "Page previews (get quick previews of a topic while reading a page):", - "popups-prefs-optin-enabled-label": "Enable", - "popups-prefs-optin-disabled-label": "Disable", + "popups-prefs-optin": "Enable page previews (quick previews of a topic while reading a page)", "popups-prefs-disable-nav-gadgets-info": "You have to [[$1 | disable Navigation Popups Gadget]] from Gadgets tab to enable Page Previews", "popups-prefs-conflicting-gadgets-info": "Certain gadgets and other customizations may affect the performance of this feature. If you experience problems please review your gadgets and user scripts, including global ones.", "popups-refpreview-reference": "Reference", diff --git a/i18n/qqq.json b/i18n/qqq.json index d5bb3ede1..52793b515 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -30,9 +30,7 @@ "popups-preview-disambiguation": "The description shown on a preview for a disambiguation page", "popups-preview-disambiguation-link": "The link shown on a preview for a disambiguation page", "prefs-reading": "Title for 'Reading preferences' section on preferences page; it's a magic message derived from PREVIEWS_PREFERENCES_SECTION (see commit f597e34)", - "popups-prefs-optin-title": "Title for Page Previews option (description for Page Previews option)", - "popups-prefs-optin-enabled-label": "Label for Page Previews opt in\n{{Identical|Enable}}", - "popups-prefs-optin-disabled-label": "Label for Page Previews opt out\n{{Identical|Disable}}", + "popups-prefs-optin": "Label for Page Previews option (description for Page Previews option)", "popups-prefs-disable-nav-gadgets-info": "Help message telling to disable Navigation Popups gadget in order to enable page previews.\n\nParameters:\n* $1 – Link to the Gadgets tab of Preferences", "popups-prefs-conflicting-gadgets-info": "Help message informing about possible conflicts with other gadgets/customizations", "popups-refpreview-reference": "Default heading for popups that show previews of references as provided by the Cite extension's tags (also known as footnotes).\n{{Identical|Reference}}", diff --git a/includes/PopupsHooks.php b/includes/PopupsHooks.php index dedb1cf48..20182ac79 100644 --- a/includes/PopupsHooks.php +++ b/includes/PopupsHooks.php @@ -50,15 +50,9 @@ class PopupsHooks { } $option = [ - 'type' => 'radio', - 'label-message' => 'popups-prefs-optin-title', + 'type' => 'toggle', + 'label-message' => 'popups-prefs-optin', 'help-message' => 'popups-prefs-conflicting-gadgets-info', - 'options' => [ - wfMessage( 'popups-prefs-optin-enabled-label' )->escaped() - => PopupsContext::PREVIEWS_ENABLED, - wfMessage( 'popups-prefs-optin-disabled-label' )->escaped() - => PopupsContext::PREVIEWS_DISABLED - ], 'section' => self::PREVIEWS_PREFERENCES_SECTION ]; if ( $context->conflictsWithNavPopupsGadget( $user ) ) {