Merge pull request #418 from xwiki-labs/cryptDriveStuff

Crypt drive stuff
This commit is contained in:
ansuz
2019-08-08 17:27:31 +02:00
committed by GitHub
3 changed files with 163 additions and 79 deletions

View File

@@ -230,9 +230,15 @@ define([
if (!Visible.currently()) { to = window.setTimeout(interval, Thumb.UPDATE_FIRST); }
};
var addThumbnail = function (err, thumb, $span, cb) {
var u8 = Nacl.util.decodeBase64(thumb.split(',')[1]);
var blob = new Blob([u8], {
type: 'image/png'
});
var url = URL.createObjectURL(blob);
var img = new Image();
img.src = thumb.slice(0,5) === 'data:' ? thumb : 'data:image/png;base64,'+thumb;
img.src = url;
$span.find('.cp-icon').hide();
$span.prepend(img);
cb($(img));