mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 08:16:55 +08:00
FEATURE: internet explorer deprecation global notice (#8577)
This commit is contained in:
parent
6fa5725292
commit
c15d702ae6
@ -0,0 +1,23 @@
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
|
||||
function initializeInternetExplorerDeprecation(api) {
|
||||
const siteSettings = api.container.lookup("site-settings:main");
|
||||
if (siteSettings.discourse_internet_explorer_deprecation_warning) {
|
||||
const { isIE11 } = api.container.lookup("capabilities:main");
|
||||
if (isIE11) {
|
||||
api.addGlobalNotice(
|
||||
I18n.t("discourse_internet_explorer.deprecation_warning"),
|
||||
"deprecate-internet-explorer",
|
||||
{ dismissable: true }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "discourse-internet-explorer",
|
||||
|
||||
initialize() {
|
||||
withPluginApi("0.8.37", initializeInternetExplorerDeprecation);
|
||||
}
|
||||
};
|
@ -0,0 +1,4 @@
|
||||
en:
|
||||
js:
|
||||
discourse_internet_explorer:
|
||||
deprecation_warning: Internet Explorer support is ending in early 2020.
|
@ -1,3 +1,4 @@
|
||||
en:
|
||||
site_settings:
|
||||
discourse_internet_explorer_enabled: "Internet Explorer support"
|
||||
discourse_internet_explorer_deprecation_warning: "Show an Internet Explorer deprecation warning"
|
||||
|
@ -1,3 +1,6 @@
|
||||
plugins:
|
||||
discourse_internet_explorer_enabled:
|
||||
default: true
|
||||
discourse_internet_explorer_deprecation_warning:
|
||||
default: false
|
||||
client: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user