diff --git a/copyparty/web/svcs.html b/copyparty/web/svcs.html
index a4b57746..26fd5267 100644
--- a/copyparty/web/svcs.html
+++ b/copyparty/web/svcs.html
@@ -37,6 +37,7 @@
{% if accs %}{{ pw }}
=password, {% endif %}mp
=mountpoint
{% if accs %}use real password{% endif %}
+ show qr
diff --git a/copyparty/web/svcs.js b/copyparty/web/svcs.js
index 0de94523..dad7faab 100644
--- a/copyparty/web/svcs.js
+++ b/copyparty/web/svcs.js
@@ -49,12 +49,14 @@ function setos(os) {
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
+var pw = '';
function setpw(e) {
ev(e);
modal.prompt('password:', '', function (v) {
if (!v)
return;
+ pw = v;
var pw0 = ebi('pw0').innerHTML,
oa = QSA('b');
@@ -67,3 +69,12 @@ function setpw(e) {
}
if (ebi('setpw'))
ebi('setpw').onclick = setpw;
+
+
+ebi('qr').onclick = function () {
+ var url = ('' + location).split('?')[0];
+ if (pw)
+ url += '?pw=' + pw;
+ var txt = esc(url) + '
';
+ modal.alert(txt);
+};