From a9baecc504cca8e2846bd1eeab3a0a7d32f3c54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Tue, 23 Feb 2016 18:00:05 +0200 Subject: [PATCH 1/6] Specify encoding for newsletter previews in browser to fix entity issue --- assets/js/src/newsletter_editor/components/sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/src/newsletter_editor/components/sidebar.js b/assets/js/src/newsletter_editor/components/sidebar.js index 3bba26b637..3f0e5a2bbd 100644 --- a/assets/js/src/newsletter_editor/components/sidebar.js +++ b/assets/js/src/newsletter_editor/components/sidebar.js @@ -236,7 +236,7 @@ define([ data: json, }).done(function(response){ console.log('Should open a new window'); - window.open('data:text/html,' + encodeURIComponent(response.rendered_body), '_blank'); + window.open('data:text/html;charset=utf-8,' + encodeURIComponent(response.rendered_body), '_blank'); }).fail(function(error) { console.log('Preview error', json); alert('Something went wrong, check console'); From dfc680f3a19d1b9ed434beaf330f554bcc1f66d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Tue, 23 Feb 2016 18:39:45 +0200 Subject: [PATCH 2/6] Do not rerender header and footer blocks on content change --- assets/js/src/newsletter_editor/blocks/footer.js | 2 +- assets/js/src/newsletter_editor/blocks/header.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/src/newsletter_editor/blocks/footer.js b/assets/js/src/newsletter_editor/blocks/footer.js index 2885d17175..52deaa5e60 100644 --- a/assets/js/src/newsletter_editor/blocks/footer.js +++ b/assets/js/src/newsletter_editor/blocks/footer.js @@ -41,7 +41,7 @@ define([ getTemplate: function() { return templates.footerBlock; }, modelEvents: _.extend({ 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render', - }, base.BlockView.prototype.modelEvents), + }, _.omit(base.BlockView.prototype.modelEvents, 'change')), onDragSubstituteBy: function() { return Module.FooterWidgetView; }, onRender: function() { this.toolsView = new Module.FooterBlockToolsView({ model: this.model }); diff --git a/assets/js/src/newsletter_editor/blocks/header.js b/assets/js/src/newsletter_editor/blocks/header.js index 4ec82d43f6..7349a51f63 100644 --- a/assets/js/src/newsletter_editor/blocks/header.js +++ b/assets/js/src/newsletter_editor/blocks/header.js @@ -41,7 +41,7 @@ define([ getTemplate: function() { return templates.headerBlock; }, modelEvents: _.extend({ 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render', - }, base.BlockView.prototype.modelEvents), + }, _.omit(base.BlockView.prototype.modelEvents, 'change')), onDragSubstituteBy: function() { return Module.HeaderWidgetView; }, onRender: function() { this.toolsView = new Module.HeaderBlockToolsView({ model: this.model }); From a856800e6dbb491bc42e34a4e4fe2db746e7ea37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 24 Feb 2016 14:43:13 +0200 Subject: [PATCH 3/6] Set line height multiplier to golden ratio for editor text blocks --- assets/css/src/newsletter_editor/contentBlocks/base.styl | 4 ++++ views/newsletter/templates/components/styles.hbs | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/css/src/newsletter_editor/contentBlocks/base.styl b/assets/css/src/newsletter_editor/contentBlocks/base.styl index 2ead16df83..c505812d9b 100644 --- a/assets/css/src/newsletter_editor/contentBlocks/base.styl +++ b/assets/css/src/newsletter_editor/contentBlocks/base.styl @@ -30,3 +30,7 @@ $block-hover-highlight-color = $primary-active-color .mailpoet_content position: relative + line-height: 1.61803398875 + + p + line-height: 1.61803398875 diff --git a/views/newsletter/templates/components/styles.hbs b/views/newsletter/templates/components/styles.hbs index 1b405a659f..6850a58b10 100644 --- a/views/newsletter/templates/components/styles.hbs +++ b/views/newsletter/templates/components/styles.hbs @@ -3,25 +3,21 @@ .mailpoet_text_block .mailpoet_content p { color: {{ text.fontColor }}; font-size: {{ text.fontSize }}; - line-height: {{ text.fontSize }}; font-family: {{ text.fontFamily }}; } .mailpoet_text_block .mailpoet_content h1 { color: {{ h1.fontColor }}; font-size: {{ h1.fontSize }}; - line-height: {{ h1.fontSize }}; font-family: {{ h1.fontFamily }}; } .mailpoet_text_block .mailpoet_content h2 { color: {{ h2.fontColor }}; font-size: {{ h2.fontSize }}; - line-height: {{ h2.fontSize }}; font-family: {{ h2.fontFamily }}; } .mailpoet_text_block .mailpoet_content h3 { color: {{ h3.fontColor }}; font-size: {{ h3.fontSize }}; - line-height: {{ h3.fontSize }}; font-family: {{ h3.fontFamily }}; } .mailpoet_content a { From 06ad4488bfe4c43cf448b57e6efb53824809178d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 24 Feb 2016 14:43:50 +0200 Subject: [PATCH 4/6] Homogenize ALC and Posts output, wrap Read More text in a paragraph tag --- lib/Newsletter/Editor/PostTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Newsletter/Editor/PostTransformer.php b/lib/Newsletter/Editor/PostTransformer.php index 824062809f..52bf232c4f 100644 --- a/lib/Newsletter/Editor/PostTransformer.php +++ b/lib/Newsletter/Editor/PostTransformer.php @@ -134,7 +134,7 @@ class PostTransformer { } else { $total_blocks = count($structure); $read_more_text = sprintf( - '%s', + '

%s

', get_permalink($post_id), $this->args['readMoreText'] ); From 5092c3d32862984f5b849880ee58681361458d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 24 Feb 2016 15:32:44 +0200 Subject: [PATCH 5/6] Reduce ALC post refresh timeout to 0.5s instead of 2s --- .../js/src/newsletter_editor/blocks/automatedLatestContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js index bafc21017a..07448b9b6f 100644 --- a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js +++ b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js @@ -81,7 +81,7 @@ define([ * ALC posts on each model change */ _scheduleFetchPosts: function() { - var timeout = 2000, + var timeout = 500, that = this; if (this._fetchPostsTimer !== undefined) { clearTimeout(this._fetchPostsTimer); From da32b243ea9f8393660dcd3272a5f1279b13db8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvidas=20Sipavi=C4=8Dius?= Date: Wed, 24 Feb 2016 17:46:00 +0200 Subject: [PATCH 6/6] Change header, footer and text padding based on Becs' feedback --- .../src/newsletter_editor/contentBlocks/footer.styl | 6 +++++- .../src/newsletter_editor/contentBlocks/header.styl | 6 +++++- .../src/newsletter_editor/contentBlocks/text.styl | 13 +++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/assets/css/src/newsletter_editor/contentBlocks/footer.styl b/assets/css/src/newsletter_editor/contentBlocks/footer.styl index c66a095d93..ad74f5aafc 100644 --- a/assets/css/src/newsletter_editor/contentBlocks/footer.styl +++ b/assets/css/src/newsletter_editor/contentBlocks/footer.styl @@ -1,6 +1,10 @@ .mailpoet_footer_block padding-left: 0 padding-right: 0 + margin-bottom: 0 .mailpoet_content - padding: 5px 20px + padding: 10px 20px + + p + margin: 0 diff --git a/assets/css/src/newsletter_editor/contentBlocks/header.styl b/assets/css/src/newsletter_editor/contentBlocks/header.styl index 62a12591ad..913735c132 100644 --- a/assets/css/src/newsletter_editor/contentBlocks/header.styl +++ b/assets/css/src/newsletter_editor/contentBlocks/header.styl @@ -1,6 +1,10 @@ .mailpoet_header_block padding-left: 0 padding-right: 0 + margin-bottom: 0 .mailpoet_content - padding: 5px 20px + padding: 10px 20px + + p + margin: 0 diff --git a/assets/css/src/newsletter_editor/contentBlocks/text.styl b/assets/css/src/newsletter_editor/contentBlocks/text.styl index 613750520c..923b401487 100644 --- a/assets/css/src/newsletter_editor/contentBlocks/text.styl +++ b/assets/css/src/newsletter_editor/contentBlocks/text.styl @@ -1,16 +1,21 @@ -$text-vertical-padding = 3px - .mailpoet_text_block padding-left: 0 padding-right: 0 & > .mailpoet_content overflow: hidden - padding-top: 13px - padding-bottom: 13px + padding-top: 0 + padding-bottom: 0px padding-left: 20px padding-right: 20px + h1, h2, h3, h4, h5, h6 + padding: 0 + margin: 0 + + p + margin-top: 0 + blockquote margin: 1em padding-left: 1em