Mercurial > xmpp-account-manager
comparison avatar.js @ 13:8724e28ccbd7
Improve styling.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 22 Dec 2018 18:07:00 +0100 |
parents | aedf80eefc19 |
children | 3eed9fe0bd7c |
comparison
equal
deleted
inserted
replaced
12:139b223dafb0 | 13:8724e28ccbd7 |
---|---|
110 } | 110 } |
111 | 111 |
112 function onAvatarDataUpload(iq) | 112 function onAvatarDataUpload(iq) |
113 { | 113 { |
114 console.log('Avatar successfully uploaded!', iq); | 114 console.log('Avatar successfully uploaded!', iq); |
115 avatar_change.disabled = true; | 115 avatar_change.hidden = true; |
116 avatar_size.innerHTML = ''; | 116 avatar_size.innerHTML = ''; |
117 spinner_img.hidden = true; | 117 spinner_img.hidden = true; |
118 } | 118 } |
119 | 119 |
120 function onAvatarUploadError(iq) | 120 function onAvatarUploadError(iq) |
149 const sha1 = (Array | 149 const sha1 = (Array |
150 .from(new Uint8Array(digest)) | 150 .from(new Uint8Array(digest)) |
151 .map(b => b.toString(16).padStart(2, "0")) | 151 .map(b => b.toString(16).padStart(2, "0")) |
152 .join("")); | 152 .join("")); |
153 avatar_data.id = sha1; | 153 avatar_data.id = sha1; |
154 avatar_change.disabled = false; | 154 avatar_change.hidden = false; |
155 } | 155 } |
156 sha1_reader.readAsArrayBuffer(file); | 156 sha1_reader.readAsArrayBuffer(file); |
157 }); | 157 }); |
158 | 158 |
159 function friendlyDataSize(bytes) { | 159 function friendlyDataSize(bytes) { |