debug logs and b64 non encodable

This commit is contained in:
bel
2020-04-08 02:25:24 +00:00
parent cc6b6f9226
commit 84400e4401
9 changed files with 25 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ function format(job) {
btns.forEach(function(e) {
buttons += `
<span>
<input type="button" onclick="job${e.name}(this);" value="&#${e.icon};" alt="${e.name}" title="${e.name}" job="${btoa(JSON.stringify(job))}"/>
<input type="button" onclick="job${e.name}(this);" value="&#${e.icon};" alt="${e.name}" title="${e.name}" job="${btoa(encodeURIComponent(JSON.stringify(job)))}"/>
</span>
`
})
@@ -192,7 +192,8 @@ function getJobElement(id) {
function jobFromInput(input) {
var b64 = input.getAttribute("job")
var json = atob(b64)
var encoded = atob(b64)
var json = decodeURIComponent(encoded)
return JSON.parse(json)
}