summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-10-11 19:32:27 +0200
committerYorhel <git@yorhel.nl>2010-10-11 19:32:27 +0200
commitd82cfbc2fc04c230ec12a97bf83ac6a30567214e (patch)
treebe7e130ee961e63848864797656d2342fce7ec25
parente631b3f3b955fa35f8ce0f2b28a6dc446d763163 (diff)
Properly open correct promptPass box when one is already open.
-rw-r--r--script.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/script.js b/script.js
index dd7cf31..9caea0a 100644
--- a/script.js
+++ b/script.js
@@ -68,9 +68,13 @@ function showall() {
function promptPass(t,u,s,b) {
var close = function () { byId('pp').parentNode.removeChild(byId('pp')); return false; };
- if(byId('pp'))
- return close();
- addBody(tag('div', { id: 'pp' }, tag('form', { method: 'post', action: u },
+ if(byId('pp')) {
+ if(byId('pp').pp_u == u)
+ return close();
+ else
+ close();
+ }
+ addBody(tag('div', { id: 'pp', pp_u: u }, tag('form', { method: 'post', action: u },
t, tag('br', null),
tag('input', { type: 'password', name: 'pc', id: 'pc', value: getCookie('secret_passcode') || '' }), tag('br', null),
s ? tag('input', { type: 'checkbox', name: 'psp', id: 'psp', value: 1 }) : '',