From eb27de36f44e416b15e6a9ed487c7be267137c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 10 Feb 2016 17:15:32 +0200 Subject: [PATCH] Select active block format and allow custom colors in TinyMCe --- assets/js/src/newsletter_editor/blocks/footer.js | 6 ++---- assets/js/src/newsletter_editor/blocks/header.js | 6 ++---- assets/js/src/newsletter_editor/blocks/text.js | 12 +++--------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/assets/js/src/newsletter_editor/blocks/footer.js b/assets/js/src/newsletter_editor/blocks/footer.js index bf229b6b52..2885d17175 100644 --- a/assets/js/src/newsletter_editor/blocks/footer.js +++ b/assets/js/src/newsletter_editor/blocks/footer.js @@ -60,11 +60,9 @@ define([ valid_elements: "p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br", invalid_elements: "script", - style_formats: [ - {title: 'Paragraph', block: 'p'}, - ], + block_formats: 'Paragraph=p', - plugins: "link textcolor mailpoet_custom_fields", + plugins: "link textcolor colorpicker mailpoet_custom_fields", setup: function(editor) { editor.on('change', function(e) { diff --git a/assets/js/src/newsletter_editor/blocks/header.js b/assets/js/src/newsletter_editor/blocks/header.js index 6031021593..4ec82d43f6 100644 --- a/assets/js/src/newsletter_editor/blocks/header.js +++ b/assets/js/src/newsletter_editor/blocks/header.js @@ -60,11 +60,9 @@ define([ valid_elements: "p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br", invalid_elements: "script", - style_formats: [ - {title: 'Paragraph', block: 'p'}, - ], + block_formats: 'Paragraph=p', - plugins: "link textcolor mailpoet_custom_fields", + plugins: "link textcolor colorpicker mailpoet_custom_fields", setup: function(editor) { editor.on('change', function(e) { diff --git a/assets/js/src/newsletter_editor/blocks/text.js b/assets/js/src/newsletter_editor/blocks/text.js index 810e633be1..1d015c7cf3 100644 --- a/assets/js/src/newsletter_editor/blocks/text.js +++ b/assets/js/src/newsletter_editor/blocks/text.js @@ -52,21 +52,15 @@ define([ inline: true, menubar: false, - toolbar1: "styleselect bold italic forecolor | link unlink", + toolbar1: "formatselect bold italic forecolor | link unlink", toolbar2: "alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_custom_fields", //forced_root_block: 'p', valid_elements: "p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style]", invalid_elements: "script", - style_formats: [ - {title: 'Heading 1', block: 'h1'}, - {title: 'Heading 2', block: 'h2'}, - {title: 'Heading 3', block: 'h3'}, + block_formats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p', - {title: 'Paragraph', block: 'p'}, - ], - - plugins: "link code textcolor mailpoet_custom_fields", + plugins: "link code textcolor colorpicker mailpoet_custom_fields", setup: function(editor) { editor.on('change', function(e) {