47 lines
976 B
Go Template
47 lines
976 B
Go Template
{{ define "page" }}
|
|
<div id="notes2">
|
|
<div id="tree" tabindex=0></div>
|
|
<div id="crumbs"></div>
|
|
<div id="sync-progress">
|
|
<!--
|
|
<progress min=0 max=1 value=0></progress>
|
|
<div class="count">0 / 1</div>
|
|
-->
|
|
</div>
|
|
|
|
<div id="note"></div>
|
|
<!--div id="blank"></div-->
|
|
</div>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/notes2.css">
|
|
|
|
<script type="module">
|
|
import { h, Component, render, createRef } from 'preact'
|
|
import htm from 'htm'
|
|
{{ if .Data._dev -}}
|
|
import 'preact/debug'
|
|
import 'preact/devtools'
|
|
{{- end }}
|
|
import { NodeStore } from 'node_store'
|
|
import { App } from "/js/{{ .VERSION }}/app.mjs"
|
|
import { API } from 'api'
|
|
import { Sync } from 'sync'
|
|
|
|
window.Sync = Sync
|
|
|
|
if (!API.hasAuthenticationToken()) {
|
|
location.href = '/login'
|
|
} else {
|
|
const html = htm.bind(h)
|
|
try {
|
|
window.nodeStore = new NodeStore()
|
|
window.nodeStore.initializeDB().then(() => {
|
|
window._app = new App()
|
|
})
|
|
} catch (e) {
|
|
alert(e)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
{{ end }}
|