Merge "Use a checkbox for the preference"

This commit is contained in:
jenkins-bot 2020-11-17 12:31:32 +00:00 committed by Gerrit Code Review
commit 46ece02214
3 changed files with 4 additions and 14 deletions

View file

@ -20,9 +20,7 @@
"popups-preview-disambiguation": "This title relates to more than one page", "popups-preview-disambiguation": "This title relates to more than one page",
"popups-preview-disambiguation-link": "View similar pages", "popups-preview-disambiguation-link": "View similar pages",
"prefs-reading": "Reading preferences", "prefs-reading": "Reading preferences",
"popups-prefs-optin-title": "Page previews (get quick previews of a topic while reading a page):", "popups-prefs-optin": "Enable page previews (quick previews of a topic while reading a page)",
"popups-prefs-optin-enabled-label": "Enable",
"popups-prefs-optin-disabled-label": "Disable",
"popups-prefs-disable-nav-gadgets-info": "You have to [[$1 | disable Navigation Popups Gadget]] from Gadgets tab to enable Page Previews", "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-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", "popups-refpreview-reference": "Reference",

View file

@ -30,9 +30,7 @@
"popups-preview-disambiguation": "The description shown on a preview for a disambiguation page", "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", "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)", "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": "Label 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-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-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-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 <ref> tags (also known as footnotes).\n{{Identical|Reference}}", "popups-refpreview-reference": "Default heading for popups that show previews of references as provided by the Cite extension's <ref> tags (also known as footnotes).\n{{Identical|Reference}}",

View file

@ -50,15 +50,9 @@ class PopupsHooks {
} }
$option = [ $option = [
'type' => 'radio', 'type' => 'toggle',
'label-message' => 'popups-prefs-optin-title', 'label-message' => 'popups-prefs-optin',
'help-message' => 'popups-prefs-conflicting-gadgets-info', '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 'section' => self::PREVIEWS_PREFERENCES_SECTION
]; ];
if ( $context->conflictsWithNavPopupsGadget( $user ) ) { if ( $context->conflictsWithNavPopupsGadget( $user ) ) {