2019-07-08 15:49:46 -06:00
|
|
|
import { renderDictionaryDetails, renderPartsOfSpeech } from './details';
|
|
|
|
import { renderWords } from './words';
|
2020-07-31 15:14:41 -06:00
|
|
|
import { renderTemplateSelectOptions } from './settings';
|
2019-07-08 15:49:46 -06:00
|
|
|
|
|
|
|
export function renderAll() {
|
|
|
|
renderTheme();
|
2019-07-10 14:59:37 -06:00
|
|
|
renderCustomCSS();
|
2019-07-08 15:49:46 -06:00
|
|
|
renderDictionaryDetails();
|
|
|
|
renderPartsOfSpeech();
|
2020-07-31 15:14:41 -06:00
|
|
|
renderTemplateSelectOptions();
|
2019-07-08 15:49:46 -06:00
|
|
|
renderWords();
|
|
|
|
}
|
|
|
|
|
|
|
|
export function renderTheme() {
|
|
|
|
const { theme } = window.currentDictionary.settings;
|
|
|
|
document.body.id = theme + 'Theme';
|
|
|
|
}
|
2019-07-10 14:59:37 -06:00
|
|
|
|
|
|
|
export function renderCustomCSS() {
|
|
|
|
const { customCSS } = window.currentDictionary.settings;
|
|
|
|
const stylingId = 'customCSS';
|
|
|
|
const stylingElement = document.getElementById(stylingId);
|
|
|
|
if (!stylingElement) {
|
|
|
|
const styling = document.createElement('style');
|
|
|
|
styling.id = stylingId;
|
|
|
|
styling.innerHTML = customCSS;
|
|
|
|
document.body.appendChild(styling);
|
|
|
|
} else {
|
|
|
|
stylingElement.innerHTML = customCSS;
|
|
|
|
}
|
|
|
|
}
|