From c86ff05306bff836acad52aa847fbc037f2b171d Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Mon, 13 May 2024 10:53:03 +0200 Subject: [PATCH] added: button to add a blank embedded item to the content --- languages/en.php | 4 ++++ languages/nl.php | 4 ++++ views/default/ckeditor/config/newsletter.js | 19 +++++++++++++++++++ .../default/forms/newsletter/edit/content.css | 2 +- views/default/newsletter/embed.php | 5 +++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index 2fadb9f..225f968 100644 --- a/languages/en.php +++ b/languages/en.php @@ -67,6 +67,10 @@ // embed 'newsletter:embed:show_all' => "Show all content, not just group content", + 'newsletter:embed:blank' => "Add empty item", + 'newsletter:embed:blank:title' => "Item title", + 'newsletter:embed:blank:description' => "Item description", + 'newsletter:embed:blank:img' => "Add image here", 'newsletter:embed:format:description:title' => "Show description", 'newsletter:embed:format:description:option:full' => "Full", 'newsletter:embed:format:description:option:excerpt' => "Excerpt", diff --git a/languages/nl.php b/languages/nl.php index 799eed0..b6b9df3 100644 --- a/languages/nl.php +++ b/languages/nl.php @@ -233,6 +233,10 @@ 'newsletter:action:unsubscribe:success:all' => 'Je bent uitgeschreven van alle nieuwsbrieven', 'newsletter:action:unsubscribe:success:entity' => 'Je bent uitgeschreven van de %s nieuwsbrief', 'newsletter:embed:show_all' => 'Toon all content, niet alleen van de groep', + 'newsletter:embed:blank' => 'Blanco item toevoegen', + 'newsletter:embed:blank:title' => "Item titel", + 'newsletter:embed:blank:description' => "Item omschrijving", + 'newsletter:embed:blank:img' => "Hier afbeelding invoegen", 'newsletter:embed:format:description:title' => 'Toon tekst van de content', 'newsletter:embed:format:description:option:full' => 'Volledig', 'newsletter:embed:format:description:option:excerpt' => 'Klein stukje (met meer knop)', diff --git a/views/default/ckeditor/config/newsletter.js b/views/default/ckeditor/config/newsletter.js index bc3e7cc..8107b52 100644 --- a/views/default/ckeditor/config/newsletter.js +++ b/views/default/ckeditor/config/newsletter.js @@ -99,6 +99,25 @@ define(['jquery', 'elgg', 'elgg/hooks', 'elgg/i18n', 'elgg/lightbox', 'elgg/Ajax } }); }); + + $(document).on('click', '#newsletter-embed-add-blank', function(event) { + event.preventDefault(); + + var content = ''; + + content += ""; + content += ""; + content += ""; + content += ""; + content += "
" + i18n.echo('newsletter:embed:blank:img') + "

"; + content += "" + i18n.echo('newsletter:embed:blank:title') + ""; + content += "

"; + content += i18n.echo('newsletter:embed:blank:description'); + content += ""; + content += "
"; + + embed(content); + }); $(document).on('change', '#newsletter-embed-format-description, #newsletter-embed-format-icon', function() { embed_format_preview(); diff --git a/views/default/forms/newsletter/edit/content.css b/views/default/forms/newsletter/edit/content.css index bb27a00..d476703 100644 --- a/views/default/forms/newsletter/edit/content.css +++ b/views/default/forms/newsletter/edit/content.css @@ -1,5 +1,5 @@ #newsletter-embed-list { - width: 700px; + max-width: 1000px; > li { padding: 5px; diff --git a/views/default/newsletter/embed.php b/views/default/newsletter/embed.php index 6930d5b..90cb661 100644 --- a/views/default/newsletter/embed.php +++ b/views/default/newsletter/embed.php @@ -70,6 +70,11 @@ '#type' => 'submit', 'text' => elgg_echo('search'), ], + [ + '#type' => 'button', + 'id' => 'newsletter-embed-add-blank', + 'text' => elgg_echo('newsletter:embed:blank'), + ], ], ]);