mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
754 B
37 lines
754 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import './style/index.scss';
|
|
import { renderOverlay } from './render';
|
|
import { getBaseUrl } from './utils';
|
|
|
|
const baseUrl = getBaseUrl();
|
|
|
|
function init() {
|
|
renderOverlay(baseUrl);
|
|
renderStyles();
|
|
}
|
|
|
|
function renderStyles() {
|
|
if (!baseUrl) {
|
|
return;
|
|
}
|
|
|
|
const styleElement = document.createElement('link');
|
|
|
|
styleElement.rel = 'stylesheet';
|
|
styleElement.href = `${baseUrl}/scripts/embed-sdk.css`;
|
|
styleElement.type = 'text/css';
|
|
|
|
document.head?.appendChild(styleElement);
|
|
}
|
|
|
|
if (document.readyState === 'complete') {
|
|
init();
|
|
} else {
|
|
window.addEventListener('load', () => init());
|
|
}
|