template readonly, make it plain html for fast

This commit is contained in:
Bel LaPointe
2022-02-17 11:58:37 -07:00
parent 20c1b738a6
commit 553df97240
6 changed files with 62 additions and 8 deletions

View File

@@ -3,20 +3,18 @@
<html>
<header>
<title>{{ .This.Title }}</title>
{{ template "_import" }}
{{ template "_import" }}
</header>
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
<div class="rows" style="height: inherit;">
{{ template "_searchbar" }}
{{ template "_searchbar" }}
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
{{ template "_filetree" . }}
{{ template "_filetree" . }}
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
{{ if .This.ReadOnly }}
<div id="readonly"></div>
{{ .This.Content }}
</script>
{{ template "_readonly" . }}
{{ else }}
{{ template "_editor" . }}
{{ template "_editor" . }}
{{ end }}
</div>
</div>

View File

@@ -0,0 +1,9 @@
{{ define "_readonly" }}
<div class="fullscreen tb_fullscreen">
<article id="article">
</article>
<script>
document.getElementById("article").innerHTML = {{ .This.Content }}
</script>
</div>
{{ end }}

View File

@@ -0,0 +1,8 @@
{{ define "_readonly" }}
<div class="fullscreen tb_fullscreen">
<article id="article"></article>
<script>
document.getElementById("article").innerHTML = {{ .This.Content }}
</script>
</div>
{{ end }}