Skip to content

Commit

Permalink
added: embedded items now have classes for styling purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed May 6, 2024
1 parent 6dee47b commit 5fc2126
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions views/default/ckeditor/config/newsletter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ define(['jquery', 'elgg', 'elgg/hooks', 'elgg/i18n', 'elgg/lightbox', 'elgg/Ajax
content_description += data.description;
} else if (description_option === 'excerpt') {
content_description += data.excerpt;
content_description += "<p><a href='" + data.url + "'>" + i18n.echo('newsletter:embed:read_more') + " ></a></p>";
content_description += "<p><a class='newsletter-read-more' href='" + data.url + "'>" + i18n.echo('newsletter:embed:read_more') + " ></a></p>";
}

content += "<table style='width: 100%'>";
content += "<table class='newsletter-item' style='width: 100%'>";

if (data.iconUrl && icon_option) {
content += "<tr><td><img src='" + data.iconUrl + "' class='image_resized' style='width: 600px'/></td></tr>";
Expand Down Expand Up @@ -138,6 +138,16 @@ define(['jquery', 'elgg', 'elgg/hooks', 'elgg/i18n', 'elgg/lightbox', 'elgg/Ajax

result.toolbar.items.push('newsletter');

// the following allows the custom styled elements
result.htmlSupport.allow.push({
name: 'table',
classes: ['newsletter-item']
});
result.htmlSupport.allow.push({
name: 'a',
classes: ['newsletter-read-more']
});

return result;
});

Expand Down

0 comments on commit 5fc2126

Please sign in to comment.