mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
connect: hide "use real pw" when no accs (#242)
Disable the "use the real password" button on the connect page when there's no accounts
This commit is contained in:
commit
025942a7d6
|
@ -36,7 +36,7 @@
|
||||||
<span class="os lin mac">
|
<span class="os lin mac">
|
||||||
{% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
|
{% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
|
||||||
</span>
|
</span>
|
||||||
<a href="#" id="setpw">use real password</a>
|
{% if accs %}<a href="#" id="setpw">use real password</a>{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ function setos(os) {
|
||||||
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
|
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
|
||||||
|
|
||||||
|
|
||||||
ebi('setpw').onclick = function (e) {
|
function setpw() {
|
||||||
ev(e);
|
ev(e);
|
||||||
modal.prompt('password:', '', function (v) {
|
modal.prompt('password:', '', function (v) {
|
||||||
if (!v)
|
if (!v)
|
||||||
|
@ -57,7 +57,7 @@ ebi('setpw').onclick = function (e) {
|
||||||
|
|
||||||
var pw0 = ebi('pw0').innerHTML,
|
var pw0 = ebi('pw0').innerHTML,
|
||||||
oa = QSA('b');
|
oa = QSA('b');
|
||||||
|
|
||||||
for (var a = 0; a < oa.length; a++)
|
for (var a = 0; a < oa.length; a++)
|
||||||
if (oa[a].innerHTML == pw0)
|
if (oa[a].innerHTML == pw0)
|
||||||
oa[a].textContent = v;
|
oa[a].textContent = v;
|
||||||
|
@ -65,3 +65,5 @@ ebi('setpw').onclick = function (e) {
|
||||||
add_dls();
|
add_dls();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (ebi('setpw'))
|
||||||
|
ebi('setpw').onclick = setpw;
|
||||||
|
|
Loading…
Reference in a new issue