2019-12-30 02:19:07 -05:00
|
|
|
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",
|
2020-01-15 03:02:28 -05:00
|
|
|
{ dismissable: true, dismissDuration: moment.duration(1, "week") }
|
2019-12-30 02:19:07 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "discourse-internet-explorer",
|
|
|
|
|
|
|
|
initialize() {
|
|
|
|
withPluginApi("0.8.37", initializeInternetExplorerDeprecation);
|
|
|
|
}
|
|
|
|
};
|