diff --git a/html/index.html.in b/html/index.html.in index 010ce86..9f80234 100644 --- a/html/index.html.in +++ b/html/index.html.in @@ -16,8 +16,17 @@ + +

start up engine, please wait ...

diff --git a/html/menu.svg b/html/menu.svg index ade9275..5d58ed9 100644 --- a/html/menu.svg +++ b/html/menu.svg @@ -4,8 +4,8 @@ - - - + + + diff --git a/html/safechat.css b/html/safechat.css index b2491fd..1972390 100644 --- a/html/safechat.css +++ b/html/safechat.css @@ -75,9 +75,14 @@ td:last-child { background-color: green; color: white; } +#header #togglemenu { + display: inline; + float: right; +} #header h1 { font-weight: bold; font-size: 100%; + display: inline; } #status { @@ -89,11 +94,9 @@ td:last-child { padding: 0 1em 0 1em; text-align: right; } -@media (min-width: 45em) { - #status { - bottom: auto; - left: auto; - top: 0; +@media (max-width: 45em) { + #username { + display: none; } } #status.error { @@ -109,8 +112,28 @@ td:last-child { color: black; } +#menu { + clear: both; + padding: 2em 0em 1em 0em; + margin: 0 1em 0 1em; + float: right; + background-color: lightblue; + list-style-type: none; + border: 1px solid black; +} +#menu li { + padding: 0 1em 0 1em; + cursor: pointer; +} +#menu li + li { + border-top: 1px solid black; + margin-top: 0.5em; + padding-top: 0.5em; +} + #main { padding: 2em 1em 2em 1em; + clear: both; } .clear { diff --git a/html/safechat.js b/html/safechat.js index 6492d36..83ce0b1 100644 --- a/html/safechat.js +++ b/html/safechat.js @@ -132,6 +132,33 @@ function alert() { (new Audio("A-Tone-His_Self-1266414414.mp3")).play(); } +/// Toggle Menu Display +function togglemenu() { + $("#menu").toggle(); +} + +/// Download Profile Backup +function backup() { + status("

Starting Download...

"); + var download = document.createElement('a'); + download.href = 'data:attachment/text,'+encodeURI(JSON.stringify(localStorage)); + download.target = '_blank'; + function pad(n) {return n<10 ? '0'+n : n} + var now = new Date(); + download.download = + pad(now.getFullYear())+pad(now.getMonth()+1)+pad(now.getDate())+ + "-safechat.bak"; + var clickEvent = new MouseEvent("click", { + "view": window, + "bubbles": true, + "cancelable": false + }); + download.dispatchEvent(clickEvent); + status("

Download:

"+download.outerHTML.replace("<", "<")+"
"); + togglemenu(); + setTimeout(start, 20000); +} + /// Check if user name is available /** Calls checknewuser.php on server and displays an error, if the user name is already in use. This function is used when creating a @@ -484,6 +511,7 @@ function getpwd() { get() which polls for new messages. */ function chat() { if (!password) return getpwd(); + $("#username").html(userid()+"@safechat.ch"); $.ajax({url: "chat.html", success: function(res) { status(res); setTimeout(get, 2000);