fixed conflicts
This commit is contained in:
@ -38,18 +38,21 @@
|
|||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
background-color: rgba(255, 255, 255, 0.0)
|
background-color: rgba(255, 255, 255, 0.0)
|
||||||
|
opacity: 0
|
||||||
|
transition: all 200ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background-color: rgba(255, 255, 255, 0.7)
|
background-color: rgba(255, 255, 255, 0.7)
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
&::after
|
&::after
|
||||||
content: " "
|
content: " "
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
left: 0
|
left: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
right: 0
|
right: 0
|
||||||
background: url(../img/preview_magnifying_glass.svg) no-repeat center center
|
background: url(../img/preview_magnifying_glass.svg) no-repeat center center
|
||||||
|
|
||||||
.mailpoet_boxes .mailpoet_description
|
.mailpoet_boxes .mailpoet_description
|
||||||
float:left
|
float:left
|
||||||
|
@ -76,13 +76,24 @@ $layer-selector-width = 30px
|
|||||||
display: inline-block
|
display: inline-block
|
||||||
padding: 2px
|
padding: 2px
|
||||||
vertical-align: top
|
vertical-align: top
|
||||||
|
animation-background-color()
|
||||||
|
|
||||||
.mailpoet_tool
|
.mailpoet_tool
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
|
.mailpoet_delete_block_activate
|
||||||
|
max-width: 100%
|
||||||
|
display: inline-block
|
||||||
|
opacity: 1
|
||||||
|
animation-fade-in-and-scale-horizontally()
|
||||||
|
|
||||||
.mailpoet_delete_block_confirm,
|
.mailpoet_delete_block_confirm,
|
||||||
.mailpoet_delete_block_cancel
|
.mailpoet_delete_block_cancel
|
||||||
display: none
|
max-width: 0
|
||||||
|
opacity: 0
|
||||||
|
overflow: hidden
|
||||||
|
display: inline-block
|
||||||
|
animation-fade-in-and-scale-horizontally()
|
||||||
|
|
||||||
.mailpoet_delete_block_activated
|
.mailpoet_delete_block_activated
|
||||||
width: auto
|
width: auto
|
||||||
@ -93,11 +104,14 @@ $layer-selector-width = 30px
|
|||||||
height: auto
|
height: auto
|
||||||
|
|
||||||
.mailpoet_delete_block_activate
|
.mailpoet_delete_block_activate
|
||||||
display: none
|
overflow: hidden
|
||||||
|
max-width: 0
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
.mailpoet_delete_block_confirm,
|
.mailpoet_delete_block_confirm,
|
||||||
.mailpoet_delete_block_cancel
|
.mailpoet_delete_block_cancel
|
||||||
display: inline-block
|
max-width: 100%
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
.mailpoet_delete_block_confirm
|
.mailpoet_delete_block_confirm
|
||||||
color: $warning-text-color
|
color: $warning-text-color
|
||||||
|
@ -52,6 +52,7 @@ $draggable-widget-z-index = 2
|
|||||||
padding: 0
|
padding: 0
|
||||||
margin: 0
|
margin: 0
|
||||||
z-index: $draggable-widget-z-index
|
z-index: $draggable-widget-z-index
|
||||||
|
animation-fade-in-and-scale-up()
|
||||||
|
|
||||||
.mailpoet_widget_icon
|
.mailpoet_widget_icon
|
||||||
padding: 0
|
padding: 0
|
||||||
|
@ -32,7 +32,7 @@ $widget-icon-width = 30px
|
|||||||
|
|
||||||
.mailpoet_region_content
|
.mailpoet_region_content
|
||||||
max-height: 2000px
|
max-height: 2000px
|
||||||
transition: max-height 0.2s ease
|
transition: max-height 300ms ease
|
||||||
padding: 0 20px
|
padding: 0 20px
|
||||||
margin-top: 12px
|
margin-top: 12px
|
||||||
|
|
||||||
|
@ -18,3 +18,6 @@
|
|||||||
|
|
||||||
& > .mailpoet_block
|
& > .mailpoet_block
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
|
.mailpoet_automated_latest_content_display_options
|
||||||
|
animation-slide-open-downwards()
|
||||||
|
@ -30,3 +30,8 @@ $block-hover-highlight-color = $primary-active-color
|
|||||||
|
|
||||||
.mailpoet_content
|
.mailpoet_content
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
|
.mailpoet_block_transition_in
|
||||||
|
animation-fade-in-and-scale-up()
|
||||||
|
.mailpoet_block_transition_out
|
||||||
|
animation-fade-out-and-scale-down()
|
||||||
|
@ -79,3 +79,4 @@ $three-column-width = ($newsletter-width / 3) - (2 * $column-margin)
|
|||||||
box-shadow(inset 1px 2px 1px $primary-inactive-color)
|
box-shadow(inset 1px 2px 1px $primary-inactive-color)
|
||||||
color: #656565
|
color: #656565
|
||||||
border-radius(3px)
|
border-radius(3px)
|
||||||
|
animation-background-color()
|
||||||
|
@ -15,7 +15,11 @@
|
|||||||
.mailpoet_posts_categories_and_tags
|
.mailpoet_posts_categories_and_tags
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
.mailpoet_settings_posts_show_display_options
|
.mailpoet_settings_posts_display_options
|
||||||
|
.mailpoet_settings_posts_selection
|
||||||
|
animation-slide-open-downwards()
|
||||||
|
|
||||||
|
.mailpoet_settings_posts_show_display_options,
|
||||||
.mailpoet_settings_posts_show_post_selection
|
.mailpoet_settings_posts_show_post_selection
|
||||||
display: block
|
display: block
|
||||||
margin-top: 10px
|
margin-top: 10px
|
||||||
|
53
assets/css/src/newsletter_editor/mixins/transitions.styl
Normal file
53
assets/css/src/newsletter_editor/mixins/transitions.styl
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
animation-slide-open-downwards()
|
||||||
|
transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */
|
||||||
|
max-height: 2000px
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
|
&.mailpoet_closed
|
||||||
|
max-height: 0
|
||||||
|
opacity: 0
|
||||||
|
overflow-y: hidden
|
||||||
|
|
||||||
|
animation-background-color()
|
||||||
|
transition: background 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */
|
||||||
|
|
||||||
|
animation-fade-in-and-scale-up()
|
||||||
|
animation-name: fadeInAndScaleUp
|
||||||
|
animation-duration: 500ms
|
||||||
|
animation-fill-mode: forwards
|
||||||
|
|
||||||
|
animation-fade-out-and-scale-down()
|
||||||
|
animation-name: fadeOutAndScaleDown
|
||||||
|
animation-duration: 500ms
|
||||||
|
animation-fill-mode: forwards
|
||||||
|
|
||||||
|
animation-fade-in-and-scale-horizontally()
|
||||||
|
transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */
|
||||||
|
|
||||||
|
@keyframes fadeInAndScaleUp {
|
||||||
|
0% {
|
||||||
|
opacity: 0.3
|
||||||
|
max-height: 0
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1
|
||||||
|
max-height: 5000px
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeOutAndScaleDown {
|
||||||
|
0% {
|
||||||
|
opacity: 1
|
||||||
|
max-height: 5000px
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0.3
|
||||||
|
max-height: 0
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@
|
|||||||
@require 'mixins/border-radius'
|
@require 'mixins/border-radius'
|
||||||
@require 'mixins/box-shadow'
|
@require 'mixins/box-shadow'
|
||||||
@require 'mixins/filter-shadow'
|
@require 'mixins/filter-shadow'
|
||||||
|
@require 'mixins/transitions'
|
||||||
|
|
||||||
@require 'variables'
|
@require 'variables'
|
||||||
@require 'common'
|
@require 'common'
|
||||||
|
@ -226,11 +226,11 @@ define([
|
|||||||
toggleDisplayOptions: function(event) {
|
toggleDisplayOptions: function(event) {
|
||||||
var el = this.$('.mailpoet_automated_latest_content_display_options'),
|
var el = this.$('.mailpoet_automated_latest_content_display_options'),
|
||||||
showControl = this.$('.mailpoet_automated_latest_content_show_display_options');
|
showControl = this.$('.mailpoet_automated_latest_content_show_display_options');
|
||||||
if (el.hasClass('mailpoet_hidden')) {
|
if (el.hasClass('mailpoet_closed')) {
|
||||||
el.removeClass('mailpoet_hidden');
|
el.removeClass('mailpoet_closed');
|
||||||
showControl.addClass('mailpoet_hidden');
|
showControl.addClass('mailpoet_hidden');
|
||||||
} else {
|
} else {
|
||||||
el.addClass('mailpoet_hidden');
|
el.addClass('mailpoet_closed');
|
||||||
showControl.removeClass('mailpoet_hidden');
|
showControl.removeClass('mailpoet_hidden');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -48,6 +48,7 @@ define([
|
|||||||
},
|
},
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
'change': 'render',
|
'change': 'render',
|
||||||
|
'delete': 'deleteBlock',
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
"mouseenter": "showTools",
|
"mouseenter": "showTools",
|
||||||
@ -88,7 +89,9 @@ define([
|
|||||||
this.$el.addClass('mailpoet_editor_view_' + this.cid);
|
this.$el.addClass('mailpoet_editor_view_' + this.cid);
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.on('showSettings', this.showSettings);
|
this.on('showSettings', this.showSettings, this);
|
||||||
|
this.on('dom:refresh', this.showBlock, this);
|
||||||
|
this._isFirstRender = true;
|
||||||
},
|
},
|
||||||
showTools: function(_event) {
|
showTools: function(_event) {
|
||||||
if (!this.showingToolsDisabled) {
|
if (!this.showingToolsDisabled) {
|
||||||
@ -121,6 +124,34 @@ define([
|
|||||||
return newModel;
|
return newModel;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
showBlock: function() {
|
||||||
|
if (this._isFirstRender) {
|
||||||
|
this.transitionIn();
|
||||||
|
this._isFirstRender = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteBlock: function() {
|
||||||
|
this.transitionOut().done(function() {
|
||||||
|
this.model.destroy();
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
transitionIn: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_in');
|
||||||
|
},
|
||||||
|
transitionOut: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_out');
|
||||||
|
},
|
||||||
|
_transition: function(className) {
|
||||||
|
var that = this,
|
||||||
|
promise = jQuery.Deferred();
|
||||||
|
|
||||||
|
this.$el.addClass(className);
|
||||||
|
this.$el.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd animationend', function() {
|
||||||
|
that.$el.removeClass('mailpoet_block_transition_out');
|
||||||
|
promise.resolve();
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.BlockToolsView = AugmentedView.extend({
|
Module.BlockToolsView = AugmentedView.extend({
|
||||||
@ -168,9 +199,9 @@ define([
|
|||||||
},
|
},
|
||||||
deleteBlock: function(event) {
|
deleteBlock: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.model.destroy();
|
this.model.trigger('delete');
|
||||||
return false;
|
return false;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.BlockSettingsView = Marionette.LayoutView.extend({
|
Module.BlockSettingsView = Marionette.LayoutView.extend({
|
||||||
|
@ -42,16 +42,12 @@ define([
|
|||||||
Module.ButtonBlockView = base.BlockView.extend({
|
Module.ButtonBlockView = base.BlockView.extend({
|
||||||
className: "mailpoet_block mailpoet_button_block mailpoet_droppable_block",
|
className: "mailpoet_block mailpoet_button_block mailpoet_droppable_block",
|
||||||
getTemplate: function() { return templates.buttonBlock; },
|
getTemplate: function() { return templates.buttonBlock; },
|
||||||
modelEvents: {
|
|
||||||
'change': 'render',
|
|
||||||
},
|
|
||||||
onDragSubstituteBy: function() { return Module.ButtonWidgetView; },
|
onDragSubstituteBy: function() { return Module.ButtonWidgetView; },
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
base.BlockView.prototype.initialize.apply(this, arguments);
|
base.BlockView.prototype.initialize.apply(this, arguments);
|
||||||
var that = this;
|
|
||||||
|
|
||||||
// Listen for attempts to change all dividers in one go
|
// Listen for attempts to change all dividers in one go
|
||||||
this._replaceButtonStylesHandler = function(data) { that.model.set(data); };
|
this._replaceButtonStylesHandler = function(data) { this.model.set(data); }.bind(this);
|
||||||
App.getChannel().on('replaceAllButtonStyles', this._replaceButtonStylesHandler);
|
App.getChannel().on('replaceAllButtonStyles', this._replaceButtonStylesHandler);
|
||||||
},
|
},
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
|
@ -75,7 +75,8 @@ define([
|
|||||||
getEmptyView: function() { return Module.ContainerBlockEmptyView; },
|
getEmptyView: function() { return Module.ContainerBlockEmptyView; },
|
||||||
emptyViewOptions: function() { return { renderOptions: this.renderOptions }; },
|
emptyViewOptions: function() { return { renderOptions: this.renderOptions }; },
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
'change': 'render'
|
'change': 'render',
|
||||||
|
'delete': 'deleteBlock',
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
"mouseenter": "showTools",
|
"mouseenter": "showTools",
|
||||||
@ -136,6 +137,8 @@ define([
|
|||||||
},
|
},
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
this.renderOptions = _.defaults(options.renderOptions || {}, {});
|
this.renderOptions = _.defaults(options.renderOptions || {}, {});
|
||||||
|
this.on('dom:refresh', this.showBlock, this);
|
||||||
|
this._isFirstRender = true;
|
||||||
},
|
},
|
||||||
// Determines which view type should be used for a child
|
// Determines which view type should be used for a child
|
||||||
getChildView: function(model) {
|
getChildView: function(model) {
|
||||||
@ -236,6 +239,34 @@ define([
|
|||||||
return newModel;
|
return newModel;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
showBlock: function() {
|
||||||
|
if (this._isFirstRender) {
|
||||||
|
this.transitionIn();
|
||||||
|
this._isFirstRender = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteBlock: function() {
|
||||||
|
this.transitionOut().done(function() {
|
||||||
|
this.model.destroy();
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
transitionIn: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_in');
|
||||||
|
},
|
||||||
|
transitionOut: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_out');
|
||||||
|
},
|
||||||
|
_transition: function(className) {
|
||||||
|
var that = this,
|
||||||
|
promise = jQuery.Deferred();
|
||||||
|
|
||||||
|
this.$el.addClass(className);
|
||||||
|
this.$el.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd animationend', function() {
|
||||||
|
that.$el.removeClass('mailpoet_block_transition_out');
|
||||||
|
promise.resolve();
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.ContainerBlockEmptyView = Marionette.ItemView.extend({
|
Module.ContainerBlockEmptyView = Marionette.ItemView.extend({
|
||||||
|
@ -222,8 +222,8 @@ define([
|
|||||||
},
|
},
|
||||||
switchToDisplayOptions: function() {
|
switchToDisplayOptions: function() {
|
||||||
// Switch content view
|
// Switch content view
|
||||||
this.$('.mailpoet_settings_posts_selection').addClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_selection').addClass('mailpoet_closed');
|
||||||
this.$('.mailpoet_settings_posts_display_options').removeClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_display_options').removeClass('mailpoet_closed');
|
||||||
|
|
||||||
// Switch controls
|
// Switch controls
|
||||||
this.$('.mailpoet_settings_posts_show_display_options').addClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_show_display_options').addClass('mailpoet_hidden');
|
||||||
@ -231,8 +231,8 @@ define([
|
|||||||
},
|
},
|
||||||
switchToPostSelection: function() {
|
switchToPostSelection: function() {
|
||||||
// Switch content view
|
// Switch content view
|
||||||
this.$('.mailpoet_settings_posts_display_options').addClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_display_options').addClass('mailpoet_closed');
|
||||||
this.$('.mailpoet_settings_posts_selection').removeClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_selection').removeClass('mailpoet_closed');
|
||||||
|
|
||||||
// Switch controls
|
// Switch controls
|
||||||
this.$('.mailpoet_settings_posts_show_post_selection').addClass('mailpoet_hidden');
|
this.$('.mailpoet_settings_posts_show_post_selection').addClass('mailpoet_hidden');
|
||||||
|
@ -103,7 +103,8 @@ define([
|
|||||||
getTemplate: function() { return templates.socialBlock; },
|
getTemplate: function() { return templates.socialBlock; },
|
||||||
childViewContainer: '.mailpoet_social',
|
childViewContainer: '.mailpoet_social',
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
'change': 'render'
|
'change': 'render',
|
||||||
|
'delete': 'deleteBlock',
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
"mouseover": "showTools",
|
"mouseover": "showTools",
|
||||||
@ -145,6 +146,10 @@ define([
|
|||||||
arguments[0].collection = arguments[0].model.get('icons');
|
arguments[0].collection = arguments[0].model.get('icons');
|
||||||
Marionette.CompositeView.apply(this, arguments);
|
Marionette.CompositeView.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
initialize: function() {
|
||||||
|
this.on('dom:refresh', this.showBlock, this);
|
||||||
|
this._isFirstRender = true;
|
||||||
|
},
|
||||||
// Determines which view type should be used for a child
|
// Determines which view type should be used for a child
|
||||||
childView: SocialIconView,
|
childView: SocialIconView,
|
||||||
templateHelpers: function() {
|
templateHelpers: function() {
|
||||||
@ -194,6 +199,34 @@ define([
|
|||||||
this.regionManager.destroy();
|
this.regionManager.destroy();
|
||||||
_.extend(this, this._buildRegions(this.regions));
|
_.extend(this, this._buildRegions(this.regions));
|
||||||
},
|
},
|
||||||
|
showBlock: function() {
|
||||||
|
if (this._isFirstRender) {
|
||||||
|
this.transitionIn();
|
||||||
|
this._isFirstRender = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deleteBlock: function() {
|
||||||
|
this.transitionOut().done(function() {
|
||||||
|
this.model.destroy();
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
transitionIn: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_in');
|
||||||
|
},
|
||||||
|
transitionOut: function() {
|
||||||
|
return this._transition('mailpoet_block_transition_out');
|
||||||
|
},
|
||||||
|
_transition: function(className) {
|
||||||
|
var that = this,
|
||||||
|
promise = jQuery.Deferred();
|
||||||
|
|
||||||
|
this.$el.addClass(className);
|
||||||
|
this.$el.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd animationend', function() {
|
||||||
|
that.$el.removeClass('mailpoet_block_transition_out');
|
||||||
|
promise.resolve();
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.SocialBlockToolsView = base.BlockToolsView.extend({
|
Module.SocialBlockToolsView = base.BlockToolsView.extend({
|
||||||
|
@ -47,20 +47,36 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Module.saveTemplate = function(options) {
|
|
||||||
return MailPoet.Ajax.post({
|
|
||||||
endpoint: 'newsletterTemplates',
|
|
||||||
action: 'save',
|
|
||||||
data: _.extend(options || {}, {
|
|
||||||
body: App.getBody(),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Module.getThumbnail = function(element, options) {
|
Module.getThumbnail = function(element, options) {
|
||||||
return html2canvas(element, options || {});
|
return html2canvas(element, options || {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Module.saveTemplate = function(options) {
|
||||||
|
var that = this,
|
||||||
|
promise = jQuery.Deferred();
|
||||||
|
|
||||||
|
promise.then(function(thumbnail) {
|
||||||
|
var data = _.extend(options || {}, {
|
||||||
|
thumbnail: thumbnail.toDataURL('image/jpeg'),
|
||||||
|
body: App.getBody(),
|
||||||
|
});
|
||||||
|
|
||||||
|
return MailPoet.Ajax.post({
|
||||||
|
endpoint: 'newsletterTemplates',
|
||||||
|
action: 'save',
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
Module.getThumbnail(
|
||||||
|
jQuery('#mailpoet_editor_content > .mailpoet_block').get(0)
|
||||||
|
).then(function(thumbnail) {
|
||||||
|
promise.resolve(thumbnail);
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
|
};
|
||||||
|
|
||||||
Module.exportTemplate = function(options) {
|
Module.exportTemplate = function(options) {
|
||||||
var that = this;
|
var that = this;
|
||||||
return Module.getThumbnail(
|
return Module.getThumbnail(
|
||||||
|
@ -99,7 +99,7 @@ define(
|
|||||||
"MailPoet's Guide",
|
"MailPoet's Guide",
|
||||||
description:
|
description:
|
||||||
"This is the standard template that comes with MailPoet.",
|
"This is the standard template that comes with MailPoet.",
|
||||||
readonly: true
|
readonly: "1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ define(
|
|||||||
Preview
|
Preview
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{ (template.readonly) ? false : deleteLink }
|
{ (template.readonly === "1") ? false : deleteLink }
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
@ -131,10 +131,12 @@ const item_actions = [
|
|||||||
label: 'Update',
|
label: 'Update',
|
||||||
className: 'update',
|
className: 'update',
|
||||||
onClick: function(item, refresh) {
|
onClick: function(item, refresh) {
|
||||||
return MailPoet.Ajax.post({
|
MailPoet.Modal.loading(true);
|
||||||
|
MailPoet.Ajax.post({
|
||||||
endpoint: 'segments',
|
endpoint: 'segments',
|
||||||
action: 'synchronize'
|
action: 'synchronize'
|
||||||
}).done(function(response) {
|
}).done(function(response) {
|
||||||
|
MailPoet.Modal.loading(false);
|
||||||
if(response === true) {
|
if(response === true) {
|
||||||
MailPoet.Notice.success(
|
MailPoet.Notice.success(
|
||||||
('List "%$1s" has been synchronized.').replace('%$1s', item.name)
|
('List "%$1s" has been synchronized.').replace('%$1s', item.name)
|
||||||
|
@ -99,8 +99,9 @@ class Migrator {
|
|||||||
'id mediumint(9) NOT NULL AUTO_INCREMENT,',
|
'id mediumint(9) NOT NULL AUTO_INCREMENT,',
|
||||||
'name varchar(250) NOT NULL,',
|
'name varchar(250) NOT NULL,',
|
||||||
'description varchar(250) NOT NULL,',
|
'description varchar(250) NOT NULL,',
|
||||||
'body longtext,',
|
'body LONGTEXT,',
|
||||||
'thumbnail longtext,',
|
'thumbnail LONGTEXT,',
|
||||||
|
'readonly TINYINT(1) DEFAULT 0',
|
||||||
'created_at TIMESTAMP NOT NULL DEFAULT 0,',
|
'created_at TIMESTAMP NOT NULL DEFAULT 0,',
|
||||||
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
||||||
'PRIMARY KEY (id)'
|
'PRIMARY KEY (id)'
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace MailPoet\Config;
|
namespace MailPoet\Config;
|
||||||
|
|
||||||
use MailPoet\Config\PopulatorData\Templates\SampleTemplate;
|
use MailPoet\Config\PopulatorData\Templates\FranksRoastHouseTemplate;
|
||||||
|
use MailPoet\Config\PopulatorData\Templates\BlankTemplate;
|
||||||
|
use \MailPoet\Models\Segment;
|
||||||
|
use \MailPoet\Segments\WP;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -39,6 +42,39 @@ class Populator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
array_map(array($this, 'populate'), $this->models);
|
array_map(array($this, 'populate'), $this->models);
|
||||||
|
|
||||||
|
$this->createDefaultSegments();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createDefaultSegments() {
|
||||||
|
// WP Users segment
|
||||||
|
$wp_users_segment = Segment::getWPUsers();
|
||||||
|
|
||||||
|
if($wp_users_segment === false) {
|
||||||
|
// create the wp users list
|
||||||
|
$wp_users_segment = Segment::create();
|
||||||
|
$wp_users_segment->hydrate(array(
|
||||||
|
'name' => __('WordPress Users'),
|
||||||
|
'description' =>
|
||||||
|
__('The list containing all of your WordPress users.'),
|
||||||
|
'type' => 'wp_users'
|
||||||
|
));
|
||||||
|
$wp_users_segment->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Synchronize WP Users
|
||||||
|
WP::synchronizeUsers();
|
||||||
|
|
||||||
|
// Default segment
|
||||||
|
if(Segment::where('type', 'default')->count() === 0) {
|
||||||
|
$default_segment = Segment::create();
|
||||||
|
$default_segment->hydrate(array(
|
||||||
|
'name' => __('My First List'),
|
||||||
|
'description' =>
|
||||||
|
__('The list created automatically on install of MailPoet')
|
||||||
|
));
|
||||||
|
$default_segment->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function newsletter_option_fields() {
|
function newsletter_option_fields() {
|
||||||
@ -89,7 +125,8 @@ class Populator {
|
|||||||
|
|
||||||
private function newsletter_templates() {
|
private function newsletter_templates() {
|
||||||
return array(
|
return array(
|
||||||
(new SampleTemplate(Env::$assets_url))->get(),
|
(new FranksRoastHouseTemplate(Env::$assets_url))->get(),
|
||||||
|
(new BlankTemplate(Env::$assets_url))->get(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
215
lib/Config/PopulatorData/Templates/BlankTemplate.php
Normal file
215
lib/Config/PopulatorData/Templates/BlankTemplate.php
Normal file
File diff suppressed because one or more lines are too long
350
lib/Config/PopulatorData/Templates/FranksRoastHouseTemplate.php
Normal file
350
lib/Config/PopulatorData/Templates/FranksRoastHouseTemplate.php
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -63,8 +63,12 @@ class Daemon {
|
|||||||
$this->abortWithError('invalid token');
|
$this->abortWithError('invalid token');
|
||||||
}
|
}
|
||||||
|
|
||||||
$worker = new Worker($this->timer);
|
try {
|
||||||
$worker->process();
|
$worker = new Worker($this->timer);
|
||||||
|
$worker->process();
|
||||||
|
} catch(Exception $e) {
|
||||||
|
}
|
||||||
|
|
||||||
$elapsedTime = microtime(true) - $this->timer;
|
$elapsedTime = microtime(true) - $this->timer;
|
||||||
if($elapsedTime < 30) {
|
if($elapsedTime < 30) {
|
||||||
sleep(30 - $elapsedTime);
|
sleep(30 - $elapsedTime);
|
||||||
@ -76,7 +80,7 @@ class Daemon {
|
|||||||
$daemonData['token'] = $this->refreshedToken;
|
$daemonData['token'] = $this->refreshedToken;
|
||||||
$daemon->value = json_encode($daemonData);
|
$daemon->value = json_encode($daemonData);
|
||||||
$daemon->save();
|
$daemon->save();
|
||||||
$this->callSelf();
|
if($daemonData['status'] === 'strated') $this->callSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDaemon() {
|
function getDaemon() {
|
||||||
|
@ -4,8 +4,8 @@ namespace MailPoet\Cron;
|
|||||||
use MailPoet\Models\Newsletter;
|
use MailPoet\Models\Newsletter;
|
||||||
use MailPoet\Models\NewsletterStatistics;
|
use MailPoet\Models\NewsletterStatistics;
|
||||||
use MailPoet\Models\SendingQueue;
|
use MailPoet\Models\SendingQueue;
|
||||||
use MailPoet\Models\Setting;
|
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
|
use MailPoet\Newsletter\Renderer\Renderer;
|
||||||
use MailPoet\Router\Mailer;
|
use MailPoet\Router\Mailer;
|
||||||
|
|
||||||
if(!defined('ABSPATH')) exit;
|
if(!defined('ABSPATH')) exit;
|
||||||
@ -21,25 +21,21 @@ class Worker {
|
|||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->whereNull('status')
|
->whereNull('status')
|
||||||
->findResultSet();
|
->findResultSet();
|
||||||
// TODO: usee Mailer's method to get the mailer from DB
|
|
||||||
$mailer = new Mailer();
|
$mailer = new Mailer();
|
||||||
$mailer->mailer['method'] = 'MailPoet';
|
$mailerMethod = $mailer->buildMailer();
|
||||||
$mailer->mailer['class'] = 'MailPoet\\Mailer\\MailPoet';
|
|
||||||
$mailer->mailer['api_key'] = Setting::getValue('api_key', 'dhNSqj1XHkVltIliyQDvMiKzQShOA5rs0m_DdRUVZHU');
|
|
||||||
foreach($queues as $queue) {
|
foreach($queues as $queue) {
|
||||||
if($this->checkExecutionTimer()) break;
|
|
||||||
$newsletter = Newsletter::findOne($queue->newsletter_id);
|
$newsletter = Newsletter::findOne($queue->newsletter_id);
|
||||||
if(!$newsletter) {
|
if(!$newsletter) {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
$newsletter = $newsletter->asArray();
|
$newsletter = $newsletter->asArray();
|
||||||
// TODO: render newsletter
|
$renderer = new Renderer(json_decode($newsletter['body'], true));
|
||||||
$newsletter = array(
|
$newsletter = array(
|
||||||
'subject' => $newsletter['subject'],
|
'subject' => $newsletter['subject'],
|
||||||
'id' => $newsletter['id'],
|
'id' => $newsletter['id'],
|
||||||
'body' => array(
|
'body' => array(
|
||||||
'html' => 'rendering not yet implemented',
|
'html' => $renderer->renderAll(),
|
||||||
'text' => 'rendering not yet implemented'
|
'text' => '' // TODO: add text body
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$subscribers = json_decode($queue->subscribers, true);
|
$subscribers = json_decode($queue->subscribers, true);
|
||||||
@ -47,20 +43,14 @@ class Worker {
|
|||||||
if(!isset($subscribers['failed'])) $subscribers['failed'] = array();
|
if(!isset($subscribers['failed'])) $subscribers['failed'] = array();
|
||||||
if(!isset($subscribers['processed'])) $subscribers['processed'] = array();
|
if(!isset($subscribers['processed'])) $subscribers['processed'] = array();
|
||||||
foreach(array_chunk($subscribersToProcess, 200) as $subscriberIds) {
|
foreach(array_chunk($subscribersToProcess, 200) as $subscriberIds) {
|
||||||
if($this->checkExecutionTimer()) break;
|
|
||||||
$dbSubscribers = Subscriber::whereIn('id', $subscriberIds)
|
$dbSubscribers = Subscriber::whereIn('id', $subscriberIds)
|
||||||
->findArray();
|
->findArray();
|
||||||
foreach($dbSubscribers as $i => $dbSubscriber) {
|
foreach($dbSubscribers as $i => $dbSubscriber) {
|
||||||
if($this->checkExecutionTimer()) break;
|
$this->checkExecutionTimer();
|
||||||
// TODO: replace shortcodes in the newsletter
|
// TODO: replace shortcodes in the newsletter
|
||||||
$result = $mailer->send(
|
$result = $mailerMethod->send(
|
||||||
$newsletter,
|
$newsletter,
|
||||||
sprintf(
|
$mailer->transformSubscriber($dbSubscriber)
|
||||||
"%s %s <%s>",
|
|
||||||
$dbSubscriber['first_name'],
|
|
||||||
$dbSubscriber['last_name'],
|
|
||||||
$dbSubscriber['email']
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
$newsletterStatistics = NewsletterStatistics::create();
|
$newsletterStatistics = NewsletterStatistics::create();
|
||||||
$newsletterStatistics->subscriber_id = $dbSubscriber['id'];
|
$newsletterStatistics->subscriber_id = $dbSubscriber['id'];
|
||||||
@ -97,6 +87,6 @@ class Worker {
|
|||||||
|
|
||||||
function checkExecutionTimer() {
|
function checkExecutionTimer() {
|
||||||
$elapsedTime = microtime(true) - $this->timer;
|
$elapsedTime = microtime(true) - $this->timer;
|
||||||
return ($elapsedTime >= 28) ? true : false;
|
if ($elapsedTime >= 28) throw new \Exception('Maximum execution time reached.');
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -77,20 +77,7 @@ class Segment extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function getWPUsers() {
|
static function getWPUsers() {
|
||||||
$segment = self::where('type', 'wp_users')->findOne();
|
return self::where('type', 'wp_users')->findOne();
|
||||||
|
|
||||||
if($segment === false) {
|
|
||||||
// create the wp users list
|
|
||||||
$segment = self::create();
|
|
||||||
$segment->hydrate(array(
|
|
||||||
'name' => __('WordPress Users'),
|
|
||||||
'type' => 'wp_users'
|
|
||||||
));
|
|
||||||
$segment->save();
|
|
||||||
return self::findOne($segment->id());
|
|
||||||
}
|
|
||||||
|
|
||||||
return $segment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function search($orm, $search = '') {
|
static function search($orm, $search = '') {
|
||||||
|
@ -9,9 +9,20 @@ if(!defined('ABSPATH')) exit;
|
|||||||
|
|
||||||
class Mailer {
|
class Mailer {
|
||||||
function __construct() {
|
function __construct() {
|
||||||
list($this->fromName, $this->fromEmail) = $this->getSetting('sender');
|
list($this->fromName, $this->fromEmail, $this->fromNameEmail)
|
||||||
|
= $this->getSetting('sender');
|
||||||
|
$this->mailerType = array(
|
||||||
|
'AmazonSES' => 'API',
|
||||||
|
'ElasticEmail' => 'API',
|
||||||
|
'MailGun' => 'API',
|
||||||
|
'Mandrill' => 'API',
|
||||||
|
'SendGrid' => 'API',
|
||||||
|
'MailPoet' => null,
|
||||||
|
'SMTP' => null,
|
||||||
|
'WPMail' => null
|
||||||
|
);
|
||||||
|
|
||||||
$this->mailer = $this->getSetting('mailer');
|
$this->mailer = $this->getSetting('mailer');
|
||||||
$this->from = sprintf('%s <%s>', $this->fromName, $this->fromEmail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function send($newsletter, $subscriber) {
|
function send($newsletter, $subscriber) {
|
||||||
@ -27,7 +38,7 @@ class Mailer {
|
|||||||
$this->mailer['region'],
|
$this->mailer['region'],
|
||||||
$this->mailer['access_key'],
|
$this->mailer['access_key'],
|
||||||
$this->mailer['secret_key'],
|
$this->mailer['secret_key'],
|
||||||
$this->from
|
$this->fromNameEmail
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'ElasticEmail':
|
case 'ElasticEmail':
|
||||||
@ -40,7 +51,7 @@ class Mailer {
|
|||||||
$mailer = new $this->mailer['class'](
|
$mailer = new $this->mailer['class'](
|
||||||
$this->mailer['domain'],
|
$this->mailer['domain'],
|
||||||
$this->mailer['api_key'],
|
$this->mailer['api_key'],
|
||||||
$this->from
|
$this->fromNameEmail
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'MailPoet':
|
case 'MailPoet':
|
||||||
@ -63,6 +74,12 @@ class Mailer {
|
|||||||
$this->fromName
|
$this->fromName
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'WPMail':
|
||||||
|
$mailer = new $this->mailer['class'](
|
||||||
|
$this->fromEmail,
|
||||||
|
$this->fromName
|
||||||
|
);
|
||||||
|
break;
|
||||||
case 'SMTP':
|
case 'SMTP':
|
||||||
$mailer = new $this->mailer['class'](
|
$mailer = new $this->mailer['class'](
|
||||||
$this->mailer['host'],
|
$this->mailer['host'],
|
||||||
@ -70,7 +87,11 @@ class Mailer {
|
|||||||
$this->mailer['authentication'],
|
$this->mailer['authentication'],
|
||||||
$this->mailer['encryption'],
|
$this->mailer['encryption'],
|
||||||
$this->fromEmail,
|
$this->fromEmail,
|
||||||
$this->fromName);
|
$this->fromName
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new \Exception('Mailing method does not exist.');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $mailer;
|
return $mailer;
|
||||||
@ -89,66 +110,23 @@ class Mailer {
|
|||||||
function getSetting($setting) {
|
function getSetting($setting) {
|
||||||
switch($setting) {
|
switch($setting) {
|
||||||
case 'mailer':
|
case 'mailer':
|
||||||
// TODO: remove
|
|
||||||
/* $mailers = array(
|
|
||||||
array(
|
|
||||||
'method' => 'AmazonSES',
|
|
||||||
'type' => 'API',
|
|
||||||
'access_key' => 'AKIAJM6Y5HMGXBLDNSRA',
|
|
||||||
'secret_key' => 'P3EbTbVx7U0LXKQ9nTm2eIrP+9aPiLyvaRDsFxXh',
|
|
||||||
'region' => 'us-east-1'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'ElasticEmail',
|
|
||||||
'type' => 'API',
|
|
||||||
'api_key' => '997f1f7f-41de-4d7f-a8cb-86c8481370fa'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'MailGun',
|
|
||||||
'type' => 'API',
|
|
||||||
'api_key' => 'key-6cf5g5qjzenk-7nodj44gdt8phe6vam2',
|
|
||||||
'domain' => 'mrcasual.com'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'MailPoet',
|
|
||||||
'api_key' => 'dhNSqj1XHkVltIliyQDvMiKzQShOA5rs0m_DdRUVZHU'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'Mandrill',
|
|
||||||
'type' => 'API',
|
|
||||||
'api_key' => '692ys1B7REEoZN7R-dYwNA'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'SendGrid',
|
|
||||||
'type' => 'API',
|
|
||||||
'api_key' => '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'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'SMTP',
|
|
||||||
'host' => 'email-smtp.us-west-2.amazonaws.com',
|
|
||||||
'port' => 587,
|
|
||||||
'authentication' => array(
|
|
||||||
'login' => 'AKIAIGPBLH6JWG5VCBQQ',
|
|
||||||
'password' => 'AudVHXHaYkvr54veCzqiqOxDiMMyfQW3/V6F1tYzGXY3'
|
|
||||||
),
|
|
||||||
'encryption' => 'tls'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'method' => 'WPMail'
|
|
||||||
)
|
|
||||||
);*/
|
|
||||||
$mailer = Setting::getValue('mta', null);
|
$mailer = Setting::getValue('mta', null);
|
||||||
if(!$mailer) throw new \Exception('Mailing method has not been configured.');
|
if(!$mailer || !isset($mailer['method'])) throw new \Exception('Mailing method is not configured.');
|
||||||
$mailer['class'] = 'MailPoet\\Mailer\\' .
|
$mailer['class'] = 'MailPoet\\Mailer\\' .
|
||||||
((isset($mailer['type'])) ?
|
(($this->mailerType[$mailer['method']]) ?
|
||||||
$mailer['type'] . '\\' . $mailer['method'] :
|
$this->mailerType[$mailer['method']] . '\\' . $mailer['method'] :
|
||||||
$mailer['method']
|
$mailer['method']
|
||||||
);
|
);
|
||||||
return $mailer;
|
return $mailer;
|
||||||
break;;
|
break;;
|
||||||
case 'sender':
|
case 'sender':
|
||||||
$sender = Setting::getValue($setting, null);
|
$sender = Setting::getValue($setting, null);
|
||||||
return array($sender['name'], $sender['address']);
|
if(!$sender) throw new \Exception('Sender name and email are not configured.');
|
||||||
|
return array(
|
||||||
|
$sender['name'],
|
||||||
|
$sender['address'],
|
||||||
|
sprintf('%s <%s>', $sender['name'], $sender['address'])
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return Setting::getValue($setting, null);
|
return Setting::getValue($setting, null);
|
||||||
|
@ -6,7 +6,9 @@ use \MailPoet\Models\Segment;
|
|||||||
class WP {
|
class WP {
|
||||||
static function synchronizeUser($wp_user_id) {
|
static function synchronizeUser($wp_user_id) {
|
||||||
$wpUser = \get_userdata($wp_user_id);
|
$wpUser = \get_userdata($wp_user_id);
|
||||||
if($wpUser === false) return;
|
$segment = Segment::getWPUsers();
|
||||||
|
|
||||||
|
if($wpUser === false or $segment === false) return;
|
||||||
|
|
||||||
$subscriber = Subscriber::where('wp_user_id', $wpUser->ID)
|
$subscriber = Subscriber::where('wp_user_id', $wpUser->ID)
|
||||||
->findOne();
|
->findOne();
|
||||||
@ -46,8 +48,9 @@ class WP {
|
|||||||
$subscriber = Subscriber::createOrUpdate($data);
|
$subscriber = Subscriber::createOrUpdate($data);
|
||||||
|
|
||||||
if($subscriber !== false && $subscriber->id()) {
|
if($subscriber !== false && $subscriber->id()) {
|
||||||
$segment = Segment::getWPUsers();
|
if($segment !== false) {
|
||||||
$segment->addSubscriber($subscriber->id());
|
$segment->addSubscriber($subscriber->id());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"backbone": "1.2.3",
|
"backbone": "1.2.3",
|
||||||
"backbone.marionette": "2.4.3",
|
"backbone.marionette": "2.4.4",
|
||||||
"backbone.radio": "0.9.0",
|
"backbone.radio": "0.9.0",
|
||||||
"backbone.supermodel": "1.2.0",
|
"backbone.supermodel": "1.2.0",
|
||||||
"c3": "~0.4.10",
|
"c3": "~0.4.10",
|
||||||
|
@ -96,7 +96,13 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('triggers template saving when clicked on save as template button', function() {
|
it('triggers template saving when clicked on save as template button', function() {
|
||||||
var mock = sinon.mock({ post: function() {} }).expects('post').once().returns(jQuery.Deferred());
|
var mock = sinon.mock({ post: function() {} }).expects('post').once().returns(jQuery.Deferred()),
|
||||||
|
html2canvasMock = jQuery.Deferred();
|
||||||
|
|
||||||
|
html2canvasMock.resolve({
|
||||||
|
toDataURL: function() { return 'somedataurl'; },
|
||||||
|
});
|
||||||
|
|
||||||
EditorApplication.getBody = sinon.stub();
|
EditorApplication.getBody = sinon.stub();
|
||||||
var module = SaveInjector({
|
var module = SaveInjector({
|
||||||
'mailpoet': {
|
'mailpoet': {
|
||||||
@ -105,6 +111,7 @@ define([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'newsletter_editor/App': EditorApplication,
|
'newsletter_editor/App': EditorApplication,
|
||||||
|
'html2canvas': function() { return html2canvasMock; },
|
||||||
});
|
});
|
||||||
var view = new (module.SaveView)();
|
var view = new (module.SaveView)();
|
||||||
view.render();
|
view.render();
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<div class="mailpoet_form_field">
|
<div class="mailpoet_form_field">
|
||||||
<a href="javascript:;" class="mailpoet_automated_latest_content_show_display_options"><%= __('Display options') %></a>
|
<a href="javascript:;" class="mailpoet_automated_latest_content_show_display_options"><%= __('Display options') %></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="mailpoet_automated_latest_content_display_options mailpoet_hidden">
|
<div class="mailpoet_automated_latest_content_display_options mailpoet_closed">
|
||||||
<div class="mailpoet_form_field">
|
<div class="mailpoet_form_field">
|
||||||
<a href="javascript:;" class="mailpoet_automated_latest_content_hide_display_options"><%= __('Hide display options') %></a>
|
<a href="javascript:;" class="mailpoet_automated_latest_content_hide_display_options"><%= __('Hide display options') %></a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,12 +2,6 @@
|
|||||||
<%= source('newsletter/templates/svg/block-tools/settings-column.svg') %>
|
<%= source('newsletter/templates/svg/block-tools/settings-column.svg') %>
|
||||||
</a>{{/if}}{{#if tools.settings}}<a href="javascript:;" class="mailpoet_tool mailpoet_edit_block" title="<%= __('Edit settings') %>">
|
</a>{{/if}}{{#if tools.settings}}<a href="javascript:;" class="mailpoet_tool mailpoet_edit_block" title="<%= __('Edit settings') %>">
|
||||||
<%= source('newsletter/templates/svg/block-tools/settings.svg') %>
|
<%= source('newsletter/templates/svg/block-tools/settings.svg') %>
|
||||||
</a>{{/if}}{{#if tools.delete}}<div class="mailpoet_delete_block">
|
</a>{{/if}}{{#if tools.delete}}<div class="mailpoet_delete_block"><a href="javascript:;" class="mailpoet_tool mailpoet_delete_block_activate" title="<%= __('Delete') %>"><%= source('newsletter/templates/svg/block-tools/trash.svg') %></a><a href="javascript:;" class="mailpoet_delete_block_confirm" title="<%= __('Confirm deletion') %>"><%= __('Delete') %></a><a href="javascript:;" class="mailpoet_delete_block_cancel" title="<%= __('Cancel deletion') %>"><%= __('Cancel') %></a></div>{{/if}}{{#if tools.move}}<a href="javascript:;" class="mailpoet_tool mailpoet_move_block" title="<%= __('Drag to move') %>">
|
||||||
<a href="javascript:;" class="mailpoet_tool mailpoet_delete_block_activate" title="<%= __('Delete') %>">
|
|
||||||
<%= source('newsletter/templates/svg/block-tools/trash.svg') %>
|
|
||||||
</a>
|
|
||||||
<a href="javascript:;" class="mailpoet_delete_block_confirm" title="<%= __('Confirm deletion') %>"><%= __('Delete') %></a>
|
|
||||||
<a href="javascript:;" class="mailpoet_delete_block_cancel" title="<%= __('Cancel deletion') %>"><%= __('Cancel') %></a>
|
|
||||||
</div>{{/if}}{{#if tools.move}}<a href="javascript:;" class="mailpoet_tool mailpoet_move_block" title="<%= __('Drag to move') %>">
|
|
||||||
<%= source('newsletter/templates/svg/block-tools/move.svg') %>
|
<%= source('newsletter/templates/svg/block-tools/move.svg') %>
|
||||||
</a>{{/if}}<div class="clearfix"></div>
|
</a>{{/if}}<div class="clearfix"></div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h3><%= __('Post selection') %></h3>
|
<h3><%= __('Post selection') %></h3>
|
||||||
<div class="mailpoet_settings_posts_selection"></div>
|
<div class="mailpoet_settings_posts_selection"></div>
|
||||||
<div class="mailpoet_settings_posts_display_options mailpoet_hidden"></div>
|
<div class="mailpoet_settings_posts_display_options mailpoet_closed"></div>
|
||||||
<div class="mailpoet_settings_posts_controls">
|
<div class="mailpoet_settings_posts_controls">
|
||||||
<div class="mailpoet_form_field">
|
<div class="mailpoet_form_field">
|
||||||
<a href="javascript:;" class="mailpoet_settings_posts_show_post_selection mailpoet_hidden"><%= __('Back to selection') %></a>
|
<a href="javascript:;" class="mailpoet_settings_posts_show_post_selection mailpoet_hidden"><%= __('Back to selection') %></a>
|
||||||
|
Reference in New Issue
Block a user