mirror of
https://github.com/9001/copyparty.git
synced 2026-01-12 15:52:39 -07:00
reject blank password in login ui (#1105)
inlines css in msg.html to remove a roundtrip; response now requires multiple tcp-packets but probably always did realistically (https) Co-authored-by: stackxp <tillijungblut@gmail.com> Co-authored-by: ed <s@ocv.me>
This commit is contained in:
parent
5a1f0a330c
commit
08474dbe14
|
|
@ -86,7 +86,6 @@ web/md2.js
|
||||||
web/mde.css
|
web/mde.css
|
||||||
web/mde.html
|
web/mde.html
|
||||||
web/mde.js
|
web/mde.js
|
||||||
web/msg.css
|
|
||||||
web/msg.html
|
web/msg.html
|
||||||
web/opds.xml
|
web/opds.xml
|
||||||
web/rups.css
|
web/rups.css
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
:root {
|
|
||||||
--font-main: sans-serif;
|
|
||||||
--font-serif: serif;
|
|
||||||
--font-mono: 'scp';
|
|
||||||
}
|
|
||||||
html,body,tr,th,td,#files,a {
|
|
||||||
color: inherit;
|
|
||||||
background: none;
|
|
||||||
font-weight: inherit;
|
|
||||||
font-size: inherit;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
html {
|
|
||||||
color: #ccc;
|
|
||||||
background: #333;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-family: var(--font-main), sans-serif;
|
|
||||||
text-shadow: 1px 1px 0px #000;
|
|
||||||
touch-action: manipulation;
|
|
||||||
}
|
|
||||||
html, body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#box {
|
|
||||||
padding: .5em 1em;
|
|
||||||
background: #2c2c2c;
|
|
||||||
}
|
|
||||||
pre {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
font-family: var(--font-mono), monospace, monospace;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #fc5;
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,12 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=0.8">
|
<meta name="viewport" content="width=device-width, initial-scale=0.8">
|
||||||
<meta name="theme-color" content="#{{ tcolor }}">
|
<meta name="theme-color" content="#{{ tcolor }}">
|
||||||
<link rel="stylesheet" media="screen" href="{{ r }}/.cpr/msg.css?_={{ ts }}">
|
<style>:root{--font-main:sans-serif;--font-mono:monospace}
|
||||||
|
html,body,a{margin:0;padding:0;border:none;color:#ccc;background:none;font-family:sans-serif;font-family:var(--font-main),sans-serif}
|
||||||
|
pre{font-family:monospace,monospace;font-family:var(--font-mono),monospace}
|
||||||
|
html{touch-action:manipulation;background:#333}
|
||||||
|
#box{padding:.5em 1em;background:#2c2c2c}
|
||||||
|
a{color:#fc5}</style>
|
||||||
{{ html_head }}
|
{{ html_head }}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
@ -43,7 +48,7 @@
|
||||||
<script>
|
<script>
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
location.replace("{{ redir }}");
|
location.replace("{{ redir }}");
|
||||||
}, 600);
|
}, 800);
|
||||||
</script>
|
</script>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if js %}
|
{%- if js %}
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@
|
||||||
{%- if ahttps %}
|
{%- if ahttps %}
|
||||||
<a id="w" href="{{ ahttps }}">switch to https</a>
|
<a id="w" href="{{ ahttps }}">switch to https</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
<div id="lm"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
|
@ -149,6 +150,7 @@
|
||||||
{%- if ahttps %}
|
{%- if ahttps %}
|
||||||
<a id="w" href="{{ ahttps }}">switch to https</a>
|
<a id="w" href="{{ ahttps }}">switch to https</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
<div id="lm"></div>
|
||||||
</form>
|
</form>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ Ls.eng = {
|
||||||
"ta1": "fill in your new password first",
|
"ta1": "fill in your new password first",
|
||||||
"ta2": "repeat to confirm new password:",
|
"ta2": "repeat to confirm new password:",
|
||||||
"ta3": "found a typo; please try again",
|
"ta3": "found a typo; please try again",
|
||||||
|
"nop": "ERROR: Password cannot be blank",
|
||||||
|
"nou": "ERROR: Username and/or password cannot be blank",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -95,8 +97,17 @@ if (/\&re=/.test('' + location))
|
||||||
ebi('x').onclick = function (e) {
|
ebi('x').onclick = function (e) {
|
||||||
ev(e);
|
ev(e);
|
||||||
if (!pwi.value)
|
if (!pwi.value)
|
||||||
return redo(d.ta1);
|
return ebi('lm').innerHTML = d.ta1;
|
||||||
|
|
||||||
modal.prompt(d.ta2, "y", mok, null, stars);
|
modal.prompt(d.ta2, "y", mok, null, stars);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
if (ebi('lf'))
|
||||||
|
ebi('lf').onsubmit = function() {
|
||||||
|
var un = ebi('lu');
|
||||||
|
if (ebi('lp').value && (!un || un.value))
|
||||||
|
return true;
|
||||||
|
ebi('lm').innerHTML = un ? d.nou : d.nop;
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,6 @@ copyparty/web/md2.js,
|
||||||
copyparty/web/mde.css,
|
copyparty/web/mde.css,
|
||||||
copyparty/web/mde.html,
|
copyparty/web/mde.html,
|
||||||
copyparty/web/mde.js,
|
copyparty/web/mde.js,
|
||||||
copyparty/web/msg.css,
|
|
||||||
copyparty/web/msg.html,
|
copyparty/web/msg.html,
|
||||||
copyparty/web/opds.xml,
|
copyparty/web/opds.xml,
|
||||||
copyparty/web/rups.css,
|
copyparty/web/rups.css,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue