import {setEditMode} from "../util/setEditMode"; import {lineNumberRender} from "../markdown/highlightRender"; import {scrollEvent} from "../scroll/event"; import {isMobile} from "../../util/functions"; import {Constants} from "../../constants"; export const initUI = (protyle: IProtyle) => { protyle.contentElement = document.createElement("div"); protyle.contentElement.className = "protyle-content"; if (protyle.options.render.background) { protyle.contentElement.appendChild(protyle.background.element); } if (protyle.options.render.title) { protyle.contentElement.appendChild(protyle.title.element); } protyle.contentElement.appendChild(protyle.wysiwyg.element); scrollEvent(protyle, protyle.contentElement); protyle.element.append(protyle.contentElement); protyle.element.appendChild(protyle.preview.element); if (protyle.upload) { protyle.element.appendChild(protyle.upload.element); } if (protyle.scroll) { protyle.element.appendChild(protyle.scroll.element); } if (protyle.gutter) { protyle.element.appendChild(protyle.gutter.element); } protyle.element.appendChild(protyle.hint.element); protyle.selectElement = document.createElement("div"); protyle.selectElement.className = "protyle-select fn__none"; protyle.element.appendChild(protyle.selectElement); protyle.element.appendChild(protyle.toolbar.element); protyle.element.appendChild(protyle.toolbar.subElement); addLoading(protyle); setEditMode(protyle, protyle.options.mode); document.execCommand("DefaultParagraphSeparator", false, "p"); }; export const addLoading = (protyle: IProtyle) => { protyle.element.insertAdjacentHTML("beforeend", "