Commit a380e693 authored by Robert Lyon's avatar Robert Lyon

Bug 1502371: Allowing the tinymce to record alt text for an embedded image

based on either the description or the title of the image

behatnotneeded

Change-Id: I6deb362339ceeac29c6bb6425e853b120702ddae
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 5edaff77)
parent 1017cff4
......@@ -245,7 +245,12 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
if (data.style === '') {
data.style = null;
}
// As we can only select one image at a time we can accept the first in the array as selected item
var keys = Object.keys(window.imgbrowserconf_artefactid.selecteddata);
var selected = window.imgbrowserconf_artefactid.selecteddata[keys[0]];
if (selected) {
data.alt = selected.description ? selected.description : selected.title;
}
data = {
src: data.src,
alt: data.alt,
......
......@@ -78,6 +78,7 @@ class EmbeddedImage {
$imgnode->setAttribute('width', $image->getAttribute('width'));
$imgnode->setAttribute('height', $image->getAttribute('height'));
$imgnode->setAttribute('style', $image->getAttribute('style'));
$imgnode->setAttribute('alt', $image->getAttribute('alt'));
if (!empty($groupid)) {
$searchpattern = '`group=(\d+)`';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment