Remove console.log statements from newsletter editor
This commit is contained in:
@ -12,9 +12,19 @@ define([
|
|||||||
'newsletter_editor/blocks/button',
|
'newsletter_editor/blocks/button',
|
||||||
'newsletter_editor/blocks/divider',
|
'newsletter_editor/blocks/divider',
|
||||||
'newsletter_editor/components/communication',
|
'newsletter_editor/components/communication',
|
||||||
|
'mailpoet',
|
||||||
'underscore',
|
'underscore',
|
||||||
'jquery'
|
'jquery'
|
||||||
], function(App, BaseBlock, ButtonBlock, DividerBlock, CommunicationComponent, _, jQuery) {
|
], function(
|
||||||
|
App,
|
||||||
|
BaseBlock,
|
||||||
|
ButtonBlock,
|
||||||
|
DividerBlock,
|
||||||
|
CommunicationComponent,
|
||||||
|
MailPoet,
|
||||||
|
_,
|
||||||
|
jQuery
|
||||||
|
) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@ -73,7 +83,7 @@ define([
|
|||||||
that.get('_container').get('blocks').reset(content, {parse: true});
|
that.get('_container').get('blocks').reset(content, {parse: true});
|
||||||
that.trigger('postsChanged');
|
that.trigger('postsChanged');
|
||||||
}).fail(function(error) {
|
}).fail(function(error) {
|
||||||
console.log('ALC fetchPosts error', arguments);
|
MailPoet.Notice(MailPoetI18n.failedToFetchRenderedPosts);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -101,7 +101,7 @@ define([
|
|||||||
that.get('_selectedPosts').reset(); // Empty out the collection
|
that.get('_selectedPosts').reset(); // Empty out the collection
|
||||||
that.trigger('change:_availablePosts');
|
that.trigger('change:_availablePosts');
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log('Posts fetchPosts error', arguments);
|
MailPoet.Notice(MailPoetI18n.failedToFetchAvailablePosts);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_refreshTransformedPosts: function() {
|
_refreshTransformedPosts: function() {
|
||||||
@ -118,7 +118,7 @@ define([
|
|||||||
CommunicationComponent.getTransformedPosts(data).done(function(posts) {
|
CommunicationComponent.getTransformedPosts(data).done(function(posts) {
|
||||||
that.get('_transformedPosts').get('blocks').reset(posts, {parse: true});
|
that.get('_transformedPosts').get('blocks').reset(posts, {parse: true});
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log('Posts _refreshTransformedPosts error', arguments);
|
MailPoet.Notice(MailPoetI18n.failedToFetchRenderedPosts);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_insertSelectedPosts: function() {
|
_insertSelectedPosts: function() {
|
||||||
@ -134,7 +134,7 @@ define([
|
|||||||
CommunicationComponent.getTransformedPosts(data).done(function(posts) {
|
CommunicationComponent.getTransformedPosts(data).done(function(posts) {
|
||||||
collection.add(posts, { at: index });
|
collection.add(posts, { at: index });
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log('Posts fetchPosts error', arguments);
|
MailPoet.Notice(MailPoetI18n.failedToFetchRenderedPosts);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -206,12 +206,10 @@ define([
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log('Saving template with ', templateName, templateDescription);
|
|
||||||
Module.saveTemplate({
|
Module.saveTemplate({
|
||||||
name: templateName,
|
name: templateName,
|
||||||
description: templateDescription,
|
description: templateDescription,
|
||||||
}).done(function() {
|
}).done(function() {
|
||||||
console.log('Template saved', arguments);
|
|
||||||
MailPoet.Notice.success(
|
MailPoet.Notice.success(
|
||||||
MailPoetI18n.templateSaved,
|
MailPoetI18n.templateSaved,
|
||||||
{
|
{
|
||||||
@ -220,7 +218,6 @@ define([
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log('Template save failed', arguments);
|
|
||||||
MailPoet.Notice.error(
|
MailPoet.Notice.error(
|
||||||
MailPoetI18n.templateSaveFailed,
|
MailPoetI18n.templateSaveFailed,
|
||||||
{
|
{
|
||||||
@ -262,7 +259,6 @@ define([
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log('Exporting template with ', templateName, templateDescription);
|
|
||||||
Module.exportTemplate({
|
Module.exportTemplate({
|
||||||
name: templateName,
|
name: templateName,
|
||||||
description: templateDescription,
|
description: templateDescription,
|
||||||
@ -278,7 +274,6 @@ define([
|
|||||||
next: function() {
|
next: function() {
|
||||||
this.hideOptionContents();
|
this.hideOptionContents();
|
||||||
if(!this.$('.mailpoet_save_next').hasClass('button-disabled')) {
|
if(!this.$('.mailpoet_save_next').hasClass('button-disabled')) {
|
||||||
console.log('Next');
|
|
||||||
window.location.href = App.getConfig().get('urls.send');
|
window.location.href = App.getConfig().get('urls.send');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -245,8 +245,6 @@ define([
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendPreview: function() {
|
sendPreview: function() {
|
||||||
// testing sending method
|
|
||||||
console.log('trying to send a preview');
|
|
||||||
// get form data
|
// get form data
|
||||||
var $emailField = this.$('#mailpoet_preview_to_email');
|
var $emailField = this.$('#mailpoet_preview_to_email');
|
||||||
var data = {
|
var data = {
|
||||||
|
@ -313,6 +313,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= localize({
|
<%= localize({
|
||||||
|
'failedToFetchAvailablePosts': __('Failed to fetch available posts'),
|
||||||
|
'failedToFetchRenderedPosts': __('Failed to fetch rendered posts'),
|
||||||
'customFieldsWindowTitle': __('Select a shortcode'),
|
'customFieldsWindowTitle': __('Select a shortcode'),
|
||||||
'unsubscribeLinkMissing': __('All newsletters must include an "unsubscribe" link. Add a footer widget to your newsletter to continue.'),
|
'unsubscribeLinkMissing': __('All newsletters must include an "unsubscribe" link. Add a footer widget to your newsletter to continue.'),
|
||||||
'newsletterPreviewEmailMissing': __('Please enter an email where newsletter preview should be sent to.'),
|
'newsletterPreviewEmailMissing': __('Please enter an email where newsletter preview should be sent to.'),
|
||||||
|
Reference in New Issue
Block a user