error indication via GET arg err=...

This commit is contained in:
2017-07-23 01:47:18 +02:00
parent b238390ca8
commit 3c202a1f50
13 changed files with 235 additions and 24 deletions
+19
View File
@@ -61,7 +61,26 @@ $.ready(function () {
e.preventDefault();
});
var errAt = location.search.indexOf('err=');
if (errAt !== -1 && qs('.Box.errors')) {
var errs = location.search.substr(errAt+4).split(',');
var hres = [];
errs.forEach(function(er) {
var lbl = qs('label[for="'+er+'"]');
if (lbl) {
lbl.classList.add('error');
hres.push(lbl.childNodes[0].textContent.trim().replace(/: ?$/, ''));
} else {
hres.push(er);
}
});
qs('.Box.errors .list').innerHTML = hres.join(', ');
qs('.Box.errors').classList.remove('hidden');
}
Modal.init();
Notify.init();
});
$._loader = function(vis) {