fix display editor

This commit is contained in:
Pierre Dubouilh 2019-02-07 20:13:26 +01:00
parent 8e2f79067e
commit c3a3966927
No known key found for this signature in database
GPG key ID: 8FE8BEDA9D4DB0D7
3 changed files with 16 additions and 6 deletions

View file

@ -89,7 +89,7 @@ window.onClickLink = e => {
let softStatePushed
function pushSoftState (d) {
if (softStatePushed) { return }
softStatepushed = true
softStatePushed = true
history.pushState({}, '', encodeURI(d))
}
@ -289,7 +289,7 @@ function padOff () {
saveText(() => {
clearInterval(window.padTimer)
window.onbeforeunload = null
editor.style.display = crossIcon.style.display = 'none'
resetView()
softPrev()
refresh()
}, () => {
@ -325,6 +325,7 @@ async function displayPad (a) {
console.log('editing file', fileEdited)
editor.style.display = crossIcon.style.display = 'block'
table.style.display = 'none'
editor.focus()
window.onbeforeunload = warningMsg
window.padTimer = setInterval(saveText, 5000)
@ -334,6 +335,11 @@ async function displayPad (a) {
window.displayPad = displayPad
// quit pictures or editor
function resetView () {
table.style.display = 'table'
editor.style.display = pics.style.display = crossIcon.style.display = 'none'
}
window.quitAll = () => picsOff() || padOff()
// Mkdir icon
@ -447,6 +453,7 @@ function setImage () {
function picsOn (href) {
imgsIndex = allImgs.findIndex(el => el.includes(href))
setImage()
table.style.display = 'none'
crossIcon.style.display = 'block'
pics.style.display = 'flex'
pushSoftState(href.split('/').pop())
@ -455,9 +462,8 @@ function picsOn (href) {
function picsOff () {
if (!isPicMode()) { return }
resetView()
softPrev()
pics.src = ''
pics.style.display = crossIcon.style.display = 'none'
return true
}

View file

@ -207,7 +207,7 @@ h1 {
}
#text-editor {
font-family: mono;
font-family: monospace;
background-color: #2d3436;
position: fixed;
left: 0px;
@ -218,10 +218,10 @@ h1 {
overflow-y: auto;
word-wrap: anywhere;
padding: 20px;
margin-bottom: 20px;
outline: none;
width: -moz-available;
width: -webkit-fill-available;
border-bottom: 20px #2d3436 solid;
}

View file

@ -2,6 +2,10 @@
<html>
<head>
<meta charset="utf-8">
<meta name="theme-color" content="#070909">
<meta name="msapplication-navbutton-color" content="#070909">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width">
<title>{{.Title}}</title>
<link href="data:image/png;base64,favicon_will_be_here" rel="icon" type="image/png" />