diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 9ac2635489..776acae892 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -189,8 +189,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s return; } - // TODO: The JSON contains location & udi - // Need to add UDI as attr + // Put UDI into localstorage (used to update the img with data-udi later on) + localStorage.setItem(`tinymce__${json.location}`, json.udi); success(json.location); }; @@ -205,6 +205,46 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s xhr.send(formData); } + function initEvents(editor){ + + editor.on('SetContent', function (e) { + console.log('setcontent', e); + + var content = e.content; + + // Upload BLOB images (dragged/pasted ones) + if(content.indexOf('