From e3badef708a2c5eaa6fab5b33e33a3dd09614e55 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 8 Oct 2024 20:56:04 +0200 Subject: [PATCH] Remove MMV options dialog in favour of Special:Preferences MMV options dialog only allows to disable/enable MVV. Rely on Special:Preferences instead. Strips more than 2kB off the bundlesize. Bug: T77349 Change-Id: I707ef2c0b6b8d4d13c05182078b82ddc99e32d12 --- bundlesize.config.json | 2 +- extension.json | 16 - i18n/en.json | 13 - i18n/qqq.json | 13 - resources/mmv.bootstrap/mmv.bootstrap.js | 17 +- .../mmv.ui.reuse/mmv.ui.download.dialog.js | 1 - resources/mmv.ui.reuse/mmv.ui.reuse.dialog.js | 1 - resources/mmv/mmv.js | 2 - resources/mmv/mmv.lightboxinterface.js | 6 - resources/mmv/ui/mmv.ui.canvas.js | 12 +- resources/mmv/ui/mmv.ui.canvasButtons.js | 17 - resources/mmv/ui/mmv.ui.canvasButtons.less | 9 - resources/mmv/ui/mmv.ui.viewingOptions.js | 368 ------------------ resources/mmv/ui/mmv.ui.viewingOptions.less | 137 ------- tests/qunit/mmv/index.js | 1 - .../mmv/ui/mmv.ui.viewingOptions.test.js | 126 ------ 16 files changed, 3 insertions(+), 738 deletions(-) delete mode 100644 resources/mmv/ui/mmv.ui.viewingOptions.js delete mode 100644 resources/mmv/ui/mmv.ui.viewingOptions.less delete mode 100644 tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js diff --git a/bundlesize.config.json b/bundlesize.config.json index 984f7e7c5..f9c2bf18c 100644 --- a/bundlesize.config.json +++ b/bundlesize.config.json @@ -2,7 +2,7 @@ "modules": [ { "resourceModule": "mmv", - "maxSize": "26.9 kB" + "maxSize": "24.7 kB" }, { "resourceModule": "mmv.ui.restriction", diff --git a/extension.json b/extension.json index d9b266a16..d99006dc1 100644 --- a/extension.json +++ b/extension.json @@ -68,7 +68,6 @@ "mmv/ui/mmv.ui.js", "mmv/ui/mmv.ui.dialog.js", "mmv/ui/mmv.ui.description.js", - "mmv/ui/mmv.ui.viewingOptions.js", "mmv/ui/mmv.ui.canvas.js", "mmv/ui/mmv.ui.canvasButtons.js", "mmv/ui/mmv.ui.permission.js", @@ -81,7 +80,6 @@ ], "styles": [ "mmv/ui/mmv.ui.dialog.less", - "mmv/ui/mmv.ui.viewingOptions.less", "mmv/ui/mmv.ui.canvas.less", "mmv/ui/mmv.ui.canvasButtons.less", "mmv/ui/mmv.ui.permission.less", @@ -108,13 +106,7 @@ "messages": [ "license-header", "multimediaviewer-file-page", - "multimediaviewer-options-learn-more", - "multimediaviewer-options-dialog-header", - "multimediaviewer-option-submit-button", - "multimediaviewer-option-cancel-button", - "multimediaviewer-options-text-header", "multimediaviewer-enable-alert", - "multimediaviewer-options-text-body", "multimediaviewer-disable-confirmation-header", "multimediaviewer-disable-confirmation-text", "multimediaviewer-enable-dialog-header", @@ -131,7 +123,6 @@ "multimediaviewer-errorreport-privacywarning", "multimediaviewer-download-link", "multimediaviewer-reuse-link", - "multimediaviewer-options-tooltip", "multimediaviewer-close-popup-text", "multimediaviewer-fullscreen-popup-text", "multimediaviewer-defullscreen-popup-text", @@ -173,12 +164,6 @@ "multimediaviewer-geoloc-coords", "multimediaviewer-geolocation", "multimediaviewer-about-mmv", - "multimediaviewer-optout-mmv", - "multimediaviewer-optin-mmv", - "multimediaviewer-optout-pending-mmv", - "multimediaviewer-optin-pending-mmv", - "multimediaviewer-optout-help", - "multimediaviewer-optin-help", "mypreferences", "multimediaviewer-metadata-error", "multimediaviewer-title-popup-text", @@ -385,7 +370,6 @@ "tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js", "tests/qunit/mmv/ui/mmv.ui.reuse.utils.test.js", "tests/qunit/mmv/ui/mmv.ui.truncatableTextField.test.js", - "tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js", "tests/qunit/mmv/mmv.testhelpers.js" ], "dependencies": [ diff --git a/i18n/en.json b/i18n/en.json index 1f3311ff5..81fc6132d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -58,12 +58,6 @@ "multimediaviewer-restriction-default": "This image may be restricted by legal provisions outside of copyright law. See the file description page for details.", "multimediaviewer-restriction-default-and-others": "This image may be further restricted by other legal provisions outside of copyright law. See the file description page for details.", "multimediaviewer-about-mmv": "About Media Viewer", - "multimediaviewer-optout-mmv": "Disable Media Viewer", - "multimediaviewer-optin-mmv": "Enable Media Viewer", - "multimediaviewer-optout-pending-mmv": "Disabling Media Viewer", - "multimediaviewer-optin-pending-mmv": "Enabling Media Viewer", - "multimediaviewer-optout-help": "Media Viewer will no longer be used to show images. To use it again, click on the \"{{int:multimediaviewer-view-expanded}}\" button next to any image. Then click on \"{{int:multimediaviewer-optin-mmv}}\".", - "multimediaviewer-optin-help": "Media Viewer will be used to show images.", "multimediaviewer-geoloc-north": "N", "multimediaviewer-geoloc-east": "E", "multimediaviewer-geoloc-south": "S", @@ -137,13 +131,6 @@ "multimediaviewer-reuse-warning-generic": "Check [$1 its details] before using it.", "multimediaviewer-attr-plain": "Plain", "multimediaviewer-attr-html": "HTML", - "multimediaviewer-options-tooltip": "Enable or disable Media Viewer", - "multimediaviewer-options-dialog-header": "Disable Media Viewer?", - "multimediaviewer-options-text-header": "Skip this viewing feature for all files.", - "multimediaviewer-options-text-body": "You can enable it later through the file details page.", - "multimediaviewer-options-learn-more": "Learn more", - "multimediaviewer-option-submit-button": "Disable Media Viewer", - "multimediaviewer-option-cancel-button": "Cancel", "multimediaviewer-disable-confirmation-header": "You have disabled Media Viewer", "multimediaviewer-disable-confirmation-text": "Next time you click on a thumbnail on $1, you will directly view all file details.", "multimediaviewer-enable-dialog-header": "Enable Media Viewer?", diff --git a/i18n/qqq.json b/i18n/qqq.json index 0daf4b696..940c31484 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -71,12 +71,6 @@ "multimediaviewer-restriction-default": "Text of the tooltip for the default restriction label, that is displayed when hovered over.", "multimediaviewer-restriction-default-and-others": "Text of the tooltip for the default restriction label when other restriction labels are present, that is displayed when hovered over.", "multimediaviewer-about-mmv": "Text for a link to a page with more information about Media Viewer software.", - "multimediaviewer-optout-mmv": "Text for the opt-out link. Clicking on the link will turn off MediaViewer.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optout-pending-mmv}}\n* {{msg-mw|Multimediaviewer-optin-mmv}}", - "multimediaviewer-optin-mmv": "Text for the opt-back link. Clicking it will undo the opt-out.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optin-pending-mmv}}\n* {{msg-mw|Multimediaviewer-optout-mmv}}", - "multimediaviewer-optout-pending-mmv": "Text shown for the opt-out link while the optout request is being processed.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optout-mmv}}\n* {{msg-mw|Multimediaviewer-optin-pending-mmv}}", - "multimediaviewer-optin-pending-mmv": "Text shown for the opt-in link while the optin request is being processed.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optin-mmv}}\n* {{msg-mw|Multimediaviewer-optout-pending-mmv}}", - "multimediaviewer-optout-help": "Tooltip shown over the disabling link labeled {{msg-mw|Multimediaviewer-optout-mmv}}.\n\nRefers to {{msg-mw|Multimediaviewer-view-expanded}} and {{msg-mw|Multimediaviewer-optin-mmv}}.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optin-help}}", - "multimediaviewer-optin-help": "Tooltip shown over the enabling link.\n\nThe link text is {{msg-mw|Multimediaviewer-optin-mmv}}.\n\nSee also:\n* {{msg-mw|Multimediaviewer-optout-mmv}}\n* {{msg-mw|Multimediaviewer-optout-help}}", "multimediaviewer-geoloc-north": "{{optional}}\nSymbol for representing \"north\" in geolocation coordinates.\n\nUsed as $4 in {{msg-mw|Multimediaviewer-geoloc-coord}}.", "multimediaviewer-geoloc-east": "{{optional}}\nSymbol for representing \"east\" in geolocation coordinates.\n\nUsed as $4 in {{msg-mw|Multimediaviewer-geoloc-coord}}.", "multimediaviewer-geoloc-south": "{{optional}}\nSymbol for representing \"south\" in geolocation coordinates.\n\nUsed as $4 in {{msg-mw|Multimediaviewer-geoloc-coord}}.", @@ -150,13 +144,6 @@ "multimediaviewer-reuse-warning-generic": "Generic message at the end of every warning. $1 is the link to the file page.\n\nIt = the file", "multimediaviewer-attr-plain": "Label for a button that lets the user pick plain text as an output format.", "multimediaviewer-attr-html": "{{optional}}\nLabel for a button that lets the user pick HTML as an output format.\n{{Identical|HTML}}", - "multimediaviewer-options-tooltip": "Tooltip for a button that opens a panel for enabling or disabling the media viewer.", - "multimediaviewer-options-dialog-header": "Header for a dialog that gives the user the option to disable the media viewer.", - "multimediaviewer-options-text-header": "Text explaining the changes that happen when a user disables media viewer.", - "multimediaviewer-options-text-body": "Text explaining how to re-enable the media viewer after disabling.", - "multimediaviewer-options-learn-more": "Text for a link to more information about the media viewer.", - "multimediaviewer-option-submit-button": "Button for submitting a preference change that modifies the default behavior for image clicks - disables the viewer.", - "multimediaviewer-option-cancel-button": "Button for canceling an action on a preference change that modifies the default behavior for image clicks - closes the dialog with no action.\n{{Identical|Cancel}}", "multimediaviewer-disable-confirmation-header": "Header on a dialog that informs the user they've successfully disabled the media viewer.", "multimediaviewer-disable-confirmation-text": "Text informing the user that they've successfully disabled the media viewer. $1 is the wiki's name.", "multimediaviewer-enable-dialog-header": "Header for a dialog that allows users to re-enable media viewer.", diff --git a/resources/mmv.bootstrap/mmv.bootstrap.js b/resources/mmv.bootstrap/mmv.bootstrap.js index 79cd37f66..c498dd474 100644 --- a/resources/mmv.bootstrap/mmv.bootstrap.js +++ b/resources/mmv.bootstrap/mmv.bootstrap.js @@ -392,16 +392,9 @@ class MultimediaViewerBootstrap { .append( ' ' ) .append( mw.msg( 'multimediaviewer-view-expanded' ) ); - const $configButton = $( '