Added logout
This commit is contained in:
parent
38c8c5c519
commit
ef4a6b0ba3
2
main.go
2
main.go
@ -15,7 +15,7 @@ import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
const VERSION = "v0.1.1";
|
||||
const VERSION = "v0.1.2";
|
||||
const LISTEN_HOST = "0.0.0.0";
|
||||
const DB_SCHEMA = 2
|
||||
|
||||
|
@ -55,8 +55,12 @@ h1 {
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid #aaa;
|
||||
user-select: none;
|
||||
font-size: 0.85em;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
#menu .item.separator {
|
||||
border-bottom: 3px solid #000;
|
||||
}
|
||||
#menu .item:hover {
|
||||
background: #ddd;
|
||||
}
|
||||
|
@ -53,13 +53,14 @@ export class NodeUI extends Component {
|
||||
<div id="menu-blackout" class="${this.menu.value ? 'show' : ''}" onclick=${()=>this.menu.value = false}></div>
|
||||
<div id="menu" class="${this.menu.value ? 'show' : ''}">
|
||||
<div class="item" onclick=${()=>this.renameNode()}>Rename</div>
|
||||
<div class="item" onclick=${()=>this.deleteNode()}>Delete</div>
|
||||
<div class="item separator" onclick=${()=>this.deleteNode()}>Delete</div>
|
||||
<div class="item" onclick=${()=>this.logout()}>Log out</div>
|
||||
</div>
|
||||
|
||||
<header class="${modified}" onclick=${()=>this.saveNode()}>
|
||||
<div class="name">Notes</div>
|
||||
<div class="add" onclick=${()=>this.createNode()}>+</div>
|
||||
<div class="menu" onclick=${()=>this.showMenu()}>☰</div>
|
||||
<div class="add" onclick=${evt=>this.createNode(evt)}>+</div>
|
||||
<div class="menu" onclick=${evt=>this.showMenu(evt)}>☰</div>
|
||||
</header>
|
||||
|
||||
<div class="crumbs">${crumbs}</crumbs>
|
||||
@ -110,9 +111,14 @@ export class NodeUI extends Component {
|
||||
evt.stopPropagation()
|
||||
}
|
||||
}//}}}
|
||||
showMenu() {//{{{
|
||||
showMenu(evt) {//{{{
|
||||
evt.stopPropagation()
|
||||
this.menu.value = true
|
||||
}//}}}
|
||||
logout() {//{{{
|
||||
window.localStorage.removeItem('session.UUID')
|
||||
location.href = '/'
|
||||
}//}}}
|
||||
|
||||
goToNode(nodeID, dontPush) {//{{{
|
||||
if(this.props.app.nodeModified.value) {
|
||||
@ -128,7 +134,8 @@ export class NodeUI extends Component {
|
||||
this.node.value = node
|
||||
})
|
||||
}//}}}
|
||||
createNode() {//{{{
|
||||
createNode(evt) {//{{{
|
||||
evt.stopPropagation()
|
||||
let name = prompt("Name")
|
||||
if(!name)
|
||||
return
|
||||
|
@ -64,8 +64,13 @@ h1 {
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid #aaa;
|
||||
user-select: none;
|
||||
font-size: 0.85em;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
&.separator {
|
||||
border-bottom: 3px solid #000;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #ddd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user