Move the mediatag and avatar code outsite of common-ui-elements

This commit is contained in:
yflory
2020-03-30 12:09:12 +02:00
parent 7047abe407
commit 75e5d3cc42
11 changed files with 55 additions and 249 deletions

View File

@@ -404,6 +404,8 @@ define([
if (data.type === 'file') {
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
framework._.sfCommon.displayMediatagImage($(mt), function (err, $image) {
// Convert src from blob URL to base64 data URL
// XXX base64 is heavy...
Util.blobURLToImage($image.attr('src'), function (imgSrc) {
var img = new Image();
img.onload = function () { addImageToCanvas(img); };