Skip to content

Instantly share code, notes, and snippets.

@eivindml
Created May 10, 2020 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eivindml/70a5d78d3295eb00d4ef0049e7f75737 to your computer and use it in GitHub Desktop.
Save eivindml/70a5d78d3295eb00d4ef0049e7f75737 to your computer and use it in GitHub Desktop.
let ui = {
setDisplayName: (name) => {
document.getElementById('displayName').innerHTML = name
},
setProfilePicture: (imgBlob) => {
document
.getElementById('profileImg')
.setAttribute('src', URL.createObjectURL(imgBlob))
},
updateOutput: (res) => {
let output = '<pre>'
for (var key in res) {
if (res.hasOwnProperty(key)) {
output += `<span style='color: green;'>"${key}"</span>: "${res[key]}", <br />`
}
}
output += '</pre>'
document.getElementById('output').innerHTML = output
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment