AI OnAI Off
you can subsribe to ContentSaving event and alter image data there.
[InitializableModule] [ModuleDependency(typeof(InitializationModule))] public class ImgProcessingSetup : IInitializableModule { public void Initialize(InitializationEngine context) { var emitter = ServiceLocator.Current.GetInstance<IContentEvents>(); emitter.CreatedContent += OnImageCreated; } public void Uninitialize(InitializationEngine context) { var emitter = ServiceLocator.Current.GetInstance<IContentEvents>(); emitter.CreatedContent -= OnImageCreated; } private void OnImageCreated(object sender, ContentEventArgs args) { // do the magic here } }
Thanks for advice but I am affraid there are neither in sender nor args accesible properties or fields relevant to description (img attribute alt) and title (img attribute title).
There is a file image.js (image.js.uncompressed.js) where exist property updateImageData in variable ImageDialog like code beneath.
updateImageData : function() { var f = document.forms[0], t = ImageDialog; if (f.width.value == "") f.width.value = t.preloadImg.width; if (f.height.value == "") f.height.value = t.preloadImg.height; },
I need de facto the same functionality but for setting the description (alt) and title (title). There is laso tinyMCEPopup class with onInit event that could server for this purpose.
I would like know how to autofulfill image properties title and alt on picture choose in Insert/Edit Image dialog window as is foreshadowed in following pictures.
Image choose dialog
Insert/Edit Image dialog