Merge pull request #366 from mailpoet/newsletter_rendering
Newsletter rendering
This commit is contained in:
@ -30,3 +30,7 @@ $block-hover-highlight-color = $primary-active-color
|
|||||||
|
|
||||||
.mailpoet_content
|
.mailpoet_content
|
||||||
position: relative
|
position: relative
|
||||||
|
line-height: 1.61803398875
|
||||||
|
|
||||||
|
p
|
||||||
|
line-height: 1.61803398875
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
.mailpoet_footer_block
|
.mailpoet_footer_block
|
||||||
padding-left: 0
|
padding-left: 0
|
||||||
padding-right: 0
|
padding-right: 0
|
||||||
|
margin-bottom: 0
|
||||||
|
|
||||||
.mailpoet_content
|
.mailpoet_content
|
||||||
padding: 5px 20px
|
padding: 10px 20px
|
||||||
|
|
||||||
|
p
|
||||||
|
margin: 0
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
.mailpoet_header_block
|
.mailpoet_header_block
|
||||||
padding-left: 0
|
padding-left: 0
|
||||||
padding-right: 0
|
padding-right: 0
|
||||||
|
margin-bottom: 0
|
||||||
|
|
||||||
.mailpoet_content
|
.mailpoet_content
|
||||||
padding: 5px 20px
|
padding: 10px 20px
|
||||||
|
|
||||||
|
p
|
||||||
|
margin: 0
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
$text-vertical-padding = 3px
|
|
||||||
|
|
||||||
.mailpoet_text_block
|
.mailpoet_text_block
|
||||||
padding-left: 0
|
padding-left: 0
|
||||||
padding-right: 0
|
padding-right: 0
|
||||||
|
|
||||||
& > .mailpoet_content
|
& > .mailpoet_content
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
padding-top: 13px
|
padding-top: 0
|
||||||
padding-bottom: 13px
|
padding-bottom: 0px
|
||||||
padding-left: 20px
|
padding-left: 20px
|
||||||
padding-right: 20px
|
padding-right: 20px
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6
|
||||||
|
padding: 0
|
||||||
|
margin: 0
|
||||||
|
|
||||||
|
p
|
||||||
|
margin-top: 0
|
||||||
|
|
||||||
blockquote
|
blockquote
|
||||||
margin: 1em
|
margin: 1em
|
||||||
padding-left: 1em
|
padding-left: 1em
|
||||||
|
@ -81,7 +81,7 @@ define([
|
|||||||
* ALC posts on each model change
|
* ALC posts on each model change
|
||||||
*/
|
*/
|
||||||
_scheduleFetchPosts: function() {
|
_scheduleFetchPosts: function() {
|
||||||
var timeout = 2000,
|
var timeout = 500,
|
||||||
that = this;
|
that = this;
|
||||||
if (this._fetchPostsTimer !== undefined) {
|
if (this._fetchPostsTimer !== undefined) {
|
||||||
clearTimeout(this._fetchPostsTimer);
|
clearTimeout(this._fetchPostsTimer);
|
||||||
|
@ -41,7 +41,7 @@ define([
|
|||||||
getTemplate: function() { return templates.footerBlock; },
|
getTemplate: function() { return templates.footerBlock; },
|
||||||
modelEvents: _.extend({
|
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',
|
'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; },
|
onDragSubstituteBy: function() { return Module.FooterWidgetView; },
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
this.toolsView = new Module.FooterBlockToolsView({ model: this.model });
|
this.toolsView = new Module.FooterBlockToolsView({ model: this.model });
|
||||||
|
@ -41,7 +41,7 @@ define([
|
|||||||
getTemplate: function() { return templates.headerBlock; },
|
getTemplate: function() { return templates.headerBlock; },
|
||||||
modelEvents: _.extend({
|
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',
|
'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; },
|
onDragSubstituteBy: function() { return Module.HeaderWidgetView; },
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
this.toolsView = new Module.HeaderBlockToolsView({ model: this.model });
|
this.toolsView = new Module.HeaderBlockToolsView({ model: this.model });
|
||||||
|
@ -236,7 +236,7 @@ define([
|
|||||||
data: json,
|
data: json,
|
||||||
}).done(function(response){
|
}).done(function(response){
|
||||||
console.log('Should open a new window');
|
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) {
|
}).fail(function(error) {
|
||||||
console.log('Preview error', json);
|
console.log('Preview error', json);
|
||||||
alert('Something went wrong, check console');
|
alert('Something went wrong, check console');
|
||||||
|
@ -134,7 +134,7 @@ class PostTransformer {
|
|||||||
} else {
|
} else {
|
||||||
$total_blocks = count($structure);
|
$total_blocks = count($structure);
|
||||||
$read_more_text = sprintf(
|
$read_more_text = sprintf(
|
||||||
'<a href="%s">%s</a>',
|
'<p><a href="%s">%s</a></p>',
|
||||||
get_permalink($post_id),
|
get_permalink($post_id),
|
||||||
$this->args['readMoreText']
|
$this->args['readMoreText']
|
||||||
);
|
);
|
||||||
|
@ -3,25 +3,21 @@
|
|||||||
.mailpoet_text_block .mailpoet_content p {
|
.mailpoet_text_block .mailpoet_content p {
|
||||||
color: {{ text.fontColor }};
|
color: {{ text.fontColor }};
|
||||||
font-size: {{ text.fontSize }};
|
font-size: {{ text.fontSize }};
|
||||||
line-height: {{ text.fontSize }};
|
|
||||||
font-family: {{ text.fontFamily }};
|
font-family: {{ text.fontFamily }};
|
||||||
}
|
}
|
||||||
.mailpoet_text_block .mailpoet_content h1 {
|
.mailpoet_text_block .mailpoet_content h1 {
|
||||||
color: {{ h1.fontColor }};
|
color: {{ h1.fontColor }};
|
||||||
font-size: {{ h1.fontSize }};
|
font-size: {{ h1.fontSize }};
|
||||||
line-height: {{ h1.fontSize }};
|
|
||||||
font-family: {{ h1.fontFamily }};
|
font-family: {{ h1.fontFamily }};
|
||||||
}
|
}
|
||||||
.mailpoet_text_block .mailpoet_content h2 {
|
.mailpoet_text_block .mailpoet_content h2 {
|
||||||
color: {{ h2.fontColor }};
|
color: {{ h2.fontColor }};
|
||||||
font-size: {{ h2.fontSize }};
|
font-size: {{ h2.fontSize }};
|
||||||
line-height: {{ h2.fontSize }};
|
|
||||||
font-family: {{ h2.fontFamily }};
|
font-family: {{ h2.fontFamily }};
|
||||||
}
|
}
|
||||||
.mailpoet_text_block .mailpoet_content h3 {
|
.mailpoet_text_block .mailpoet_content h3 {
|
||||||
color: {{ h3.fontColor }};
|
color: {{ h3.fontColor }};
|
||||||
font-size: {{ h3.fontSize }};
|
font-size: {{ h3.fontSize }};
|
||||||
line-height: {{ h3.fontSize }};
|
|
||||||
font-family: {{ h3.fontFamily }};
|
font-family: {{ h3.fontFamily }};
|
||||||
}
|
}
|
||||||
.mailpoet_content a {
|
.mailpoet_content a {
|
||||||
|
Reference in New Issue
Block a user