Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const locale = AVAILABLE_LOCALES[rawLocale] ? rawLocale : "en";
i18n.activate(locale);
AVAILABLE_LOCALES[locale]().then(messages => {
const catalogs = {};
catalogs[locale] = messages;
i18n.load(catalogs);
});
const highContrastEnabled =
typeof parsedQueryString["high-contrast"] !== "undefined";
if (highContrastEnabled) {
highContrastTheme.use();
import("./high-contrast.css");
} else {
theme.use();
}
ReactDOM.render(
,
document.getElementById("root")
);
registerServiceWorker();
import { renderIntoDiv } from "canvas-rce"
import canvasTheme from "@instructure/ui-themes/lib/canvas"
import { getInstance, setLocale } from "./plugin"
import "tinymce/plugins/image"
getInstance(instance => instance.setConfig({ disableContrastCheck: false }))
const lang = (/lang=([^&]+)/.exec(window.location.search) || {})[1]
setLocale(lang || "en")
canvasTheme.use()
function renderEditor(editorEl, textareaId) {
renderIntoDiv(editorEl, {
defaultContent: document.getElementById(textareaId).value,
editorOptions: () => {
return {
height: "600px",
plugins: "link, image, textcolor, table, a11y_checker",
menubar: true,
toolbar: [
"bold,italic,underline,|,link,image,|,forecolor,backcolor,|,alignleft,aligncenter,alignright,|,outdent,indent,|,bullist,numlist,|,fontsizeselect,formatselect,|,check_a11y"
]
}
},
textareaId
})