|
|
@ -90,24 +90,32 @@ $.ready(function () { |
|
|
|
// (a way to pass errors back from server via redirect)
|
|
|
|
// (a way to pass errors back from server via redirect)
|
|
|
|
let errAt = window.location.search.indexOf('err=') |
|
|
|
let errAt = window.location.search.indexOf('err=') |
|
|
|
if (errAt !== -1 && qs('.Box.errors')) { |
|
|
|
if (errAt !== -1 && qs('.Box.errors')) { |
|
|
|
let errs = window.location.search.substr(errAt + 4).split(',') |
|
|
|
let errs = decodeURIComponent(window.location.search.substr(errAt + 4)).split(',') |
|
|
|
let humanReadableErrors = [] |
|
|
|
let humanReadableErrors = [] |
|
|
|
errs.forEach(function (er) { |
|
|
|
errs.forEach(function (er) { |
|
|
|
let lbls = qsa('label[for="' + er + '"]') |
|
|
|
let lbls = qsa('label[for="' + er + '"]') |
|
|
|
for (let i = 0; i < lbls.length; i++) { |
|
|
|
if (lbls) { |
|
|
|
let lbl = lbls[i] |
|
|
|
for (let i = 0; i < lbls.length; i++) { |
|
|
|
lbl.classList.add('error') |
|
|
|
let lbl = lbls[i] |
|
|
|
if (i === 0) humanReadableErrors.push(lbl.childNodes[0].textContent.trim().replace(/: ?$/, '')) |
|
|
|
lbl.classList.add('error') |
|
|
|
|
|
|
|
if (i === 0) humanReadableErrors.push(lbl.childNodes[0].textContent.trim().replace(/: ?$/, '')) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
humanReadableErrors.push(er) |
|
|
|
} |
|
|
|
} |
|
|
|
// else {
|
|
|
|
|
|
|
|
// hres.push(er)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
qs('.Box.errors .list').innerHTML = humanReadableErrors.join(', ') |
|
|
|
qs('.Box.errors .list').innerHTML = humanReadableErrors.join(', ') |
|
|
|
qs('.Box.errors').classList.remove('hidden') |
|
|
|
qs('.Box.errors').classList.remove('hidden') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let msgAt = window.location.search.indexOf('msg=') |
|
|
|
|
|
|
|
if (msgAt !== -1 && qs('.Box.message')) { |
|
|
|
|
|
|
|
let msg = decodeURIComponent(window.location.search.substr(msgAt + 4)) |
|
|
|
|
|
|
|
qs('.Box.message').innerHTML = msg |
|
|
|
|
|
|
|
qs('.Box.message').classList.remove('hidden') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
modal.init() |
|
|
|
modal.init() |
|
|
|
notify.init() |
|
|
|
notify.init() |
|
|
|
|
|
|
|
|
|
|
|