ES5: quotes

This commit is contained in:
Amine Ben hammou
2017-08-23 16:51:09 +00:00
committed by pavel-mailpoet
parent 80c4eeed5e
commit cd091c2af6
33 changed files with 214 additions and 215 deletions

View File

@ -72,7 +72,6 @@
"one-var": 0, "one-var": 0,
"camelcase": 0, "camelcase": 0,
"spaced-comment": 0, "spaced-comment": 0,
"quotes": 0,
"padded-blocks": 0, "padded-blocks": 0,
"object-curly-spacing": 0, "object-curly-spacing": 0,
"strict": 0, "strict": 0,

View File

@ -2,7 +2,7 @@ function requestFailed(errorMessage, xhr) {
if (xhr.responseJSON) { if (xhr.responseJSON) {
return xhr.responseJSON; return xhr.responseJSON;
} }
var message = errorMessage.replace("%d", xhr.status); var message = errorMessage.replace('%d', xhr.status);
return { return {
errors: [ errors: [
{ {

View File

@ -18,7 +18,7 @@
var eventsCache = []; var eventsCache = [];
function track(name, data){ function track(name, data){
if (typeof window.mixpanel.track !== "function") { if (typeof window.mixpanel.track !== 'function') {
window.mixpanel.init(window.mixpanelTrackingId); window.mixpanel.init(window.mixpanelTrackingId);
} }
window.mixpanel.track(name, data); window.mixpanel.track(name, data);
@ -44,7 +44,7 @@ function trackCachedEvents() {
} }
function initializeMixpanelWhenLoaded() { function initializeMixpanelWhenLoaded() {
if (typeof window.mixpanel === "object") { if (typeof window.mixpanel === 'object') {
exportMixpanel(MailPoet); exportMixpanel(MailPoet);
trackCachedEvents(); trackCachedEvents();
} else { } else {

View File

@ -694,7 +694,7 @@ WysijaForm.DraggableItem = Class.create({
return this.element.up('ul'); return this.element.up('ul');
}, },
insert: function() { insert: function() {
$$("body")[0].insert(this.clone); $$('body')[0].insert(this.clone);
}, },
onMousedown: function(event) { onMousedown: function(event) {
var draggable = new Draggable(this.clone, { var draggable = new Draggable(this.clone, {

View File

@ -19,7 +19,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
} }
// set date format // set date format
var f = block.hash.format || "MMM Do, YYYY"; var f = block.hash.format || 'MMM Do, YYYY';
// check if we passed a timestamp // check if we passed a timestamp
if(parseInt(timestamp, 10) == timestamp) { if(parseInt(timestamp, 10) == timestamp) {
return moment.unix(timestamp).format(f); return moment.unix(timestamp).format(f);
@ -67,7 +67,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
}); });
Handlebars.registerHelper('nl2br', function(value, block) { Handlebars.registerHelper('nl2br', function(value, block) {
return value.gsub("\n", "<br />"); return value.gsub('\n', '<br />');
}); });
Handlebars.registerHelper('json_encode', function(value, block) { Handlebars.registerHelper('json_encode', function(value, block) {
@ -78,7 +78,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
return JSON.parse(value); return JSON.parse(value);
}); });
Handlebars.registerHelper('url', function(value, block) { Handlebars.registerHelper('url', function(value, block) {
var url = window.location.protocol + "//" + window.location.host + window.location.pathname; var url = window.location.protocol + '//' + window.location.host + window.location.pathname;
return url + value; return url + value;
}); });
@ -99,7 +99,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
// extract all lines into an array // extract all lines into an array
if(value === undefined) return ''; if(value === undefined) return '';
var lines = value.trim().split("\n"); var lines = value.trim().split('\n');
// remove header & footer // remove header & footer
lines.shift(); lines.shift();
@ -148,10 +148,10 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
case 'Courier New': return new Handlebars.SafeString("'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace"); case 'Courier New': return new Handlebars.SafeString("'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace");
case 'Georgia': return new Handlebars.SafeString("Georgia, Times, 'Times New Roman', serif"); case 'Georgia': return new Handlebars.SafeString("Georgia, Times, 'Times New Roman', serif");
case 'Lucida': return new Handlebars.SafeString("'Lucida Sans Unicode', 'Lucida Grande', sans-serif"); case 'Lucida': return new Handlebars.SafeString("'Lucida Sans Unicode', 'Lucida Grande', sans-serif");
case 'Tahoma': return new Handlebars.SafeString("Tahoma, Verdana, Segoe, sans-serif"); case 'Tahoma': return new Handlebars.SafeString('Tahoma, Verdana, Segoe, sans-serif');
case 'Times New Roman': return new Handlebars.SafeString("'Times New Roman', Times, Baskerville, Georgia, serif"); case 'Times New Roman': return new Handlebars.SafeString("'Times New Roman', Times, Baskerville, Georgia, serif");
case 'Trebuchet MS': return new Handlebars.SafeString("'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif"); case 'Trebuchet MS': return new Handlebars.SafeString("'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif");
case 'Verdana': return new Handlebars.SafeString("Verdana, Geneva, sans-serif"); case 'Verdana': return new Handlebars.SafeString('Verdana, Geneva, sans-serif');
default: return font; default: return font;
} }
}); });

View File

@ -14,7 +14,7 @@ define('i18n',
translations[key] = value; translations[key] = value;
}, },
t: function(key) { t: function(key) {
return translations[key] || 'TRANSLATION "%$1s" NOT FOUND'.replace("%$1s", key); return translations[key] || 'TRANSLATION "%$1s" NOT FOUND'.replace('%$1s', key);
}, },
all: function() { all: function() {
return translations; return translations;

View File

@ -17,7 +17,7 @@ define('iframe', ['mailpoet'], function(mp) {
iframe.style.height = ( iframe.style.height = (
parseInt(i, 10) + this.marginY parseInt(i, 10) + this.marginY
) + "px"; ) + 'px';
} }
}; };

View File

@ -28,8 +28,8 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(mp, jQuery) {
url: mailpoet_mp2_migrator.log_file_url, url: mailpoet_mp2_migrator.log_file_url,
cache: false cache: false
}).done(function (result) { }).done(function (result) {
jQuery("#logger").html(''); jQuery('#logger').html('');
result.split("\n").forEach(function (resultRow) { result.split('\n').forEach(function (resultRow) {
var row = resultRow; var row = resultRow;
if(row.substr(0, 7) === '[ERROR]' || row.substr(0, 9) === '[WARNING]' || row === MailPoet.I18n.t('import_stopped_by_user')) { if(row.substr(0, 7) === '[ERROR]' || row.substr(0, 9) === '[WARNING]' || row === MailPoet.I18n.t('import_stopped_by_user')) {
row = '<span class="error_msg">' + row + '</span>'; // Mark the errors in red row = '<span class="error_msg">' + row + '</span>'; // Mark the errors in red
@ -39,10 +39,10 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(mp, jQuery) {
jQuery('#import-actions').hide(); jQuery('#import-actions').hide();
jQuery('#upgrade-completed').show(); jQuery('#upgrade-completed').show();
} }
jQuery("#logger").append(row + "<br />\n"); jQuery('#logger').append(row + '<br />\n');
}); });
jQuery("#logger").append('<span class="error_msg">' + MailPoet.MP2Migrator.fatal_error + '</span>' + "<br />\n"); jQuery('#logger').append('<span class="error_msg">' + MailPoet.MP2Migrator.fatal_error + '</span>' + '<br />\n');
}).always(function () { }).always(function () {
if(MailPoet.MP2Migrator.is_logging) { if(MailPoet.MP2Migrator.is_logging) {
MailPoet.MP2Migrator.displayLogs_timeout = setTimeout(MailPoet.MP2Migrator.displayLogs, 1000); MailPoet.MP2Migrator.displayLogs_timeout = setTimeout(MailPoet.MP2Migrator.displayLogs, 1000);

View File

@ -17,7 +17,7 @@ define([
clickoutFiresChange: true, clickoutFiresChange: true,
showInput: true, showInput: true,
showInitial: true, showInitial: true,
preferredFormat: "hex6", preferredFormat: 'hex6',
allowEmpty: true, allowEmpty: true,
chooseText: MailPoet.I18n.t('selectColor'), chooseText: MailPoet.I18n.t('selectColor'),
cancelText: MailPoet.I18n.t('cancelColorSelection') cancelText: MailPoet.I18n.t('cancelColorSelection')

View File

@ -19,8 +19,8 @@ define([
modelField: 'styles.block.height' modelField: 'styles.block.height'
}, },
events: { events: {
"mouseenter": 'showResizeHandle', 'mouseenter': 'showResizeHandle',
"mouseleave": 'hideResizeHandle' 'mouseleave': 'hideResizeHandle'
}, },
onRender: function() { onRender: function() {
this.attachResize(); this.attachResize();

View File

@ -16,7 +16,7 @@ define([
if (_.isFunction(this.$el.sortable)) { if (_.isFunction(this.$el.sortable)) {
this.$el.sortable({ this.$el.sortable({
cursor: "move", cursor: 'move',
start: function(event, ui) { start: function(event, ui) {
ui.item.data('previousIndex', ui.item.index()); ui.item.data('previousIndex', ui.item.index());
}, },

View File

@ -13,12 +13,12 @@ define([
BL.TextEditorBehavior = Marionette.Behavior.extend({ BL.TextEditorBehavior = Marionette.Behavior.extend({
defaults: { defaults: {
selector: '.mailpoet_content', selector: '.mailpoet_content',
toolbar1: "bold italic link unlink forecolor mailpoet_shortcodes", toolbar1: 'bold italic link unlink forecolor mailpoet_shortcodes',
toolbar2: "", toolbar2: '',
validElements: "p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br", validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br',
invalidElements: "script", invalidElements: 'script',
blockFormats: 'Paragraph=p', blockFormats: 'Paragraph=p',
plugins: "link textcolor colorpicker mailpoet_shortcodes", plugins: 'link textcolor colorpicker mailpoet_shortcodes',
configurationFilter: function(originalConfig) { return originalConfig; } configurationFilter: function(originalConfig) { return originalConfig; }
}, },
onDomRefresh: function() { onDomRefresh: function() {

View File

@ -28,7 +28,7 @@ define([
jQuery jQuery
) { ) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -128,12 +128,12 @@ define([
}); });
Module.AutomatedLatestContentBlockView = base.BlockView.extend({ Module.AutomatedLatestContentBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_automated_latest_content_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_automated_latest_content_block mailpoet_droppable_block',
initialize: function() { initialize: function() {
function replaceButtonStylesHandler(data) { function replaceButtonStylesHandler(data) {
this.model.set({"readMoreButton": data}); this.model.set({'readMoreButton': data});
} }
App.getChannel().on("replaceAllButtonStyles", replaceButtonStylesHandler.bind(this)); App.getChannel().on('replaceAllButtonStyles', replaceButtonStylesHandler.bind(this));
}, },
getTemplate: function() { return templates.automatedLatestContentBlock; }, getTemplate: function() { return templates.automatedLatestContentBlock; },
regions: { regions: {
@ -171,28 +171,28 @@ define([
getTemplate: function() { return templates.automatedLatestContentBlockSettings; }, getTemplate: function() { return templates.automatedLatestContentBlockSettings; },
events: function() { events: function() {
return { return {
"click .mailpoet_automated_latest_content_hide_display_options": 'toggleDisplayOptions', 'click .mailpoet_automated_latest_content_hide_display_options': 'toggleDisplayOptions',
"click .mailpoet_automated_latest_content_show_display_options": 'toggleDisplayOptions', 'click .mailpoet_automated_latest_content_show_display_options': 'toggleDisplayOptions',
"click .mailpoet_automated_latest_content_select_button": 'showButtonSettings', 'click .mailpoet_automated_latest_content_select_button': 'showButtonSettings',
"click .mailpoet_automated_latest_content_select_divider": 'showDividerSettings', 'click .mailpoet_automated_latest_content_select_divider': 'showDividerSettings',
"change .mailpoet_automated_latest_content_read_more_type": 'changeReadMoreType', 'change .mailpoet_automated_latest_content_read_more_type': 'changeReadMoreType',
"change .mailpoet_automated_latest_content_display_type": 'changeDisplayType', 'change .mailpoet_automated_latest_content_display_type': 'changeDisplayType',
"change .mailpoet_automated_latest_content_title_format": 'changeTitleFormat', 'change .mailpoet_automated_latest_content_title_format': 'changeTitleFormat',
"change .mailpoet_automated_latest_content_title_as_links": _.partial(this.changeBoolField, 'titleIsLink'), 'change .mailpoet_automated_latest_content_title_as_links': _.partial(this.changeBoolField, 'titleIsLink'),
"change .mailpoet_automated_latest_content_show_divider": _.partial(this.changeBoolField, 'showDivider'), 'change .mailpoet_automated_latest_content_show_divider': _.partial(this.changeBoolField, 'showDivider'),
"input .mailpoet_automated_latest_content_show_amount": _.partial(this.changeField, "amount"), 'input .mailpoet_automated_latest_content_show_amount': _.partial(this.changeField, 'amount'),
"change .mailpoet_automated_latest_content_content_type": _.partial(this.changeField, "contentType"), 'change .mailpoet_automated_latest_content_content_type': _.partial(this.changeField, 'contentType'),
"change .mailpoet_automated_latest_content_include_or_exclude": _.partial(this.changeField, "inclusionType"), 'change .mailpoet_automated_latest_content_include_or_exclude': _.partial(this.changeField, 'inclusionType'),
"change .mailpoet_automated_latest_content_title_alignment": _.partial(this.changeField, "titleAlignment"), 'change .mailpoet_automated_latest_content_title_alignment': _.partial(this.changeField, 'titleAlignment'),
"change .mailpoet_automated_latest_content_image_full_width": _.partial(this.changeBoolField, "imageFullWidth"), 'change .mailpoet_automated_latest_content_image_full_width': _.partial(this.changeBoolField, 'imageFullWidth'),
"change .mailpoet_automated_latest_content_featured_image_position": _.partial(this.changeField, "featuredImagePosition"), 'change .mailpoet_automated_latest_content_featured_image_position': _.partial(this.changeField, 'featuredImagePosition'),
"change .mailpoet_automated_latest_content_show_author": _.partial(this.changeField, "showAuthor"), 'change .mailpoet_automated_latest_content_show_author': _.partial(this.changeField, 'showAuthor'),
"input .mailpoet_automated_latest_content_author_preceded_by": _.partial(this.changeField, "authorPrecededBy"), 'input .mailpoet_automated_latest_content_author_preceded_by': _.partial(this.changeField, 'authorPrecededBy'),
"change .mailpoet_automated_latest_content_show_categories": _.partial(this.changeField, "showCategories"), 'change .mailpoet_automated_latest_content_show_categories': _.partial(this.changeField, 'showCategories'),
"input .mailpoet_automated_latest_content_categories": _.partial(this.changeField, "categoriesPrecededBy"), 'input .mailpoet_automated_latest_content_categories': _.partial(this.changeField, 'categoriesPrecededBy'),
"input .mailpoet_automated_latest_content_read_more_text": _.partial(this.changeField, "readMoreText"), 'input .mailpoet_automated_latest_content_read_more_text': _.partial(this.changeField, 'readMoreText'),
"change .mailpoet_automated_latest_content_sort_by": _.partial(this.changeField, "sortBy"), 'change .mailpoet_automated_latest_content_sort_by': _.partial(this.changeField, 'sortBy'),
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
onRender: function() { onRender: function() {

View File

@ -14,7 +14,7 @@ define([
'modal' 'modal'
], function(App, Marionette, SuperModel, _, jQuery, MailPoet, Modal) { ], function(App, Marionette, SuperModel, _, jQuery, MailPoet, Modal) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
AugmentedView = Marionette.View.extend({}); AugmentedView = Marionette.View.extend({});
@ -55,8 +55,8 @@ define([
'duplicate': 'duplicateBlock' 'duplicate': 'duplicateBlock'
}, },
events: { events: {
"mouseenter": "showTools", 'mouseenter': 'showTools',
"mouseleave": "hideTools" 'mouseleave': 'hideTools'
}, },
behaviors: { behaviors: {
DraggableBehavior: { DraggableBehavior: {
@ -180,11 +180,11 @@ define([
Module.BlockToolsView = AugmentedView.extend({ Module.BlockToolsView = AugmentedView.extend({
getTemplate: function() { return templates.genericBlockTools; }, getTemplate: function() { return templates.genericBlockTools; },
events: { events: {
"click .mailpoet_edit_block": "changeSettings", 'click .mailpoet_edit_block': 'changeSettings',
"click .mailpoet_delete_block_activate": "showDeletionConfirmation", 'click .mailpoet_delete_block_activate': 'showDeletionConfirmation',
"click .mailpoet_delete_block_cancel": "hideDeletionConfirmation", 'click .mailpoet_delete_block_cancel': 'hideDeletionConfirmation',
"click .mailpoet_delete_block_confirm": "deleteBlock", 'click .mailpoet_delete_block_confirm': 'deleteBlock',
"click .mailpoet_duplicate_block": "duplicateBlock" 'click .mailpoet_duplicate_block': 'duplicateBlock'
}, },
// Markers of whether these particular tools will be used for this instance // Markers of whether these particular tools will be used for this instance
tools: { tools: {
@ -298,7 +298,7 @@ define([
behaviors: { behaviors: {
DraggableBehavior: { DraggableBehavior: {
drop: function() { drop: function() {
throw "Unsupported operation"; throw 'Unsupported operation';
} }
} }
} }

View File

@ -9,7 +9,7 @@ define([
'jquery' 'jquery'
], function(App, BaseBlock, MailPoet, _, jQuery) { ], function(App, BaseBlock, MailPoet, _, jQuery) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -41,7 +41,7 @@ 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; },
onDragSubstituteBy: function() { return Module.ButtonWidgetView; }, onDragSubstituteBy: function() { return Module.ButtonWidgetView; },
behaviors: _.extend({}, base.BlockView.prototype.behaviors, { behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
@ -68,34 +68,34 @@ define([
getTemplate: function() { return templates.buttonBlockSettings; }, getTemplate: function() { return templates.buttonBlockSettings; },
events: function() { events: function() {
return { return {
"input .mailpoet_field_button_text": _.partial(this.changeField, "text"), 'input .mailpoet_field_button_text': _.partial(this.changeField, 'text'),
"input .mailpoet_field_button_url": _.partial(this.changeField, "url"), 'input .mailpoet_field_button_url': _.partial(this.changeField, 'url'),
"change .mailpoet_field_button_alignment": _.partial(this.changeField, "styles.block.textAlign"), 'change .mailpoet_field_button_alignment': _.partial(this.changeField, 'styles.block.textAlign'),
"change .mailpoet_field_button_font_color": _.partial(this.changeColorField, "styles.block.fontColor"), 'change .mailpoet_field_button_font_color': _.partial(this.changeColorField, 'styles.block.fontColor'),
"change .mailpoet_field_button_font_family": _.partial(this.changeField, "styles.block.fontFamily"), 'change .mailpoet_field_button_font_family': _.partial(this.changeField, 'styles.block.fontFamily'),
"change .mailpoet_field_button_font_size": _.partial(this.changeField, "styles.block.fontSize"), 'change .mailpoet_field_button_font_size': _.partial(this.changeField, 'styles.block.fontSize'),
"change .mailpoet_field_button_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_button_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"change .mailpoet_field_button_border_color": _.partial(this.changeColorField, "styles.block.borderColor"), 'change .mailpoet_field_button_border_color': _.partial(this.changeColorField, 'styles.block.borderColor'),
"change .mailpoet_field_button_font_weight": "changeFontWeight", 'change .mailpoet_field_button_font_weight': 'changeFontWeight',
"input .mailpoet_field_button_border_width": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width_input', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'input .mailpoet_field_button_border_width': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width_input', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"change .mailpoet_field_button_border_width": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width_input', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'change .mailpoet_field_button_border_width': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width_input', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"input .mailpoet_field_button_border_width_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'input .mailpoet_field_button_border_width_input': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_width', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"input .mailpoet_field_button_border_radius": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius_input', _.partial(this.changePixelField, "styles.block.borderRadius").bind(this)), 'input .mailpoet_field_button_border_radius': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius_input', _.partial(this.changePixelField, 'styles.block.borderRadius').bind(this)),
"change .mailpoet_field_button_border_radius": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius_input', _.partial(this.changePixelField, "styles.block.borderRadius").bind(this)), 'change .mailpoet_field_button_border_radius': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius_input', _.partial(this.changePixelField, 'styles.block.borderRadius').bind(this)),
"input .mailpoet_field_button_border_radius_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius', _.partial(this.changePixelField, "styles.block.borderRadius").bind(this)), 'input .mailpoet_field_button_border_radius_input': _.partial(this.updateValueAndCall, '.mailpoet_field_button_border_radius', _.partial(this.changePixelField, 'styles.block.borderRadius').bind(this)),
"input .mailpoet_field_button_width": _.partial(this.updateValueAndCall, '.mailpoet_field_button_width_input', _.partial(this.changePixelField, "styles.block.width").bind(this)), 'input .mailpoet_field_button_width': _.partial(this.updateValueAndCall, '.mailpoet_field_button_width_input', _.partial(this.changePixelField, 'styles.block.width').bind(this)),
"change .mailpoet_field_button_width": _.partial(this.updateValueAndCall, '.mailpoet_field_button_width_input', _.partial(this.changePixelField, "styles.block.width").bind(this)), 'change .mailpoet_field_button_width': _.partial(this.updateValueAndCall, '.mailpoet_field_button_width_input', _.partial(this.changePixelField, 'styles.block.width').bind(this)),
"input .mailpoet_field_button_width_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_width', _.partial(this.changePixelField, "styles.block.width").bind(this)), 'input .mailpoet_field_button_width_input': _.partial(this.updateValueAndCall, '.mailpoet_field_button_width', _.partial(this.changePixelField, 'styles.block.width').bind(this)),
"input .mailpoet_field_button_line_height": _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height_input', _.partial(this.changePixelField, "styles.block.lineHeight").bind(this)), 'input .mailpoet_field_button_line_height': _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height_input', _.partial(this.changePixelField, 'styles.block.lineHeight').bind(this)),
"change .mailpoet_field_button_line_height": _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height_input', _.partial(this.changePixelField, "styles.block.lineHeight").bind(this)), 'change .mailpoet_field_button_line_height': _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height_input', _.partial(this.changePixelField, 'styles.block.lineHeight').bind(this)),
"input .mailpoet_field_button_line_height_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height', _.partial(this.changePixelField, "styles.block.lineHeight").bind(this)), 'input .mailpoet_field_button_line_height_input': _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height', _.partial(this.changePixelField, 'styles.block.lineHeight').bind(this)),
"click .mailpoet_field_button_replace_all_styles": "applyToAll", 'click .mailpoet_field_button_replace_all_styles': 'applyToAll',
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
templateContext: function() { templateContext: function() {

View File

@ -12,7 +12,7 @@ define([
'newsletter_editor/blocks/base' 'newsletter_editor/blocks/base'
], function(Backbone, Marionette, _, jQuery, App, BaseBlock) { ], function(Backbone, Marionette, _, jQuery, App, BaseBlock) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock, base = BaseBlock,
@ -105,7 +105,7 @@ define([
className: 'mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block', className: 'mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block',
getTemplate: function() { return templates.containerBlock; }, getTemplate: function() { return templates.containerBlock; },
events: _.extend({}, base.BlockView.prototype.events, { events: _.extend({}, base.BlockView.prototype.events, {
"click .mailpoet_newsletter_layer_selector": "toggleEditingLayer" 'click .mailpoet_newsletter_layer_selector': 'toggleEditingLayer'
}), }),
ui: { ui: {
tools: '> .mailpoet_tools' tools: '> .mailpoet_tools'
@ -237,8 +237,8 @@ define([
getTemplate: function() { return templates.containerBlockSettings; }, getTemplate: function() { return templates.containerBlockSettings; },
events: function() { events: function() {
return { return {
"change .mailpoet_field_container_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_container_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
regions: { regions: {

View File

@ -9,7 +9,7 @@ define([
'mailpoet' 'mailpoet'
], function(App, BaseBlock, _, jQuery, MailPoet) { ], function(App, BaseBlock, _, jQuery, MailPoet) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -32,7 +32,7 @@ define([
}); });
Module.DividerBlockView = base.BlockView.extend({ Module.DividerBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_divider_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_divider_block mailpoet_droppable_block',
getTemplate: function() { return templates.dividerBlock; }, getTemplate: function() { return templates.dividerBlock; },
modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'),
behaviors: _.defaults({ behaviors: _.defaults({
@ -87,16 +87,16 @@ define([
getTemplate: function() { return templates.dividerBlockSettings; }, getTemplate: function() { return templates.dividerBlockSettings; },
events: function() { events: function() {
return { return {
"click .mailpoet_field_divider_style": 'changeStyle', 'click .mailpoet_field_divider_style': 'changeStyle',
"input .mailpoet_field_divider_border_width": _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width_input', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'input .mailpoet_field_divider_border_width': _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width_input', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"change .mailpoet_field_divider_border_width": _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width_input', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'change .mailpoet_field_divider_border_width': _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width_input', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"input .mailpoet_field_divider_border_width_input": _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width', _.partial(this.changePixelField, "styles.block.borderWidth").bind(this)), 'input .mailpoet_field_divider_border_width_input': _.partial(this.updateValueAndCall, '.mailpoet_field_divider_border_width', _.partial(this.changePixelField, 'styles.block.borderWidth').bind(this)),
"change .mailpoet_field_divider_border_color": _.partial(this.changeColorField, "styles.block.borderColor"), 'change .mailpoet_field_divider_border_color': _.partial(this.changeColorField, 'styles.block.borderColor'),
"change .mailpoet_field_divider_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_divider_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"click .mailpoet_button_divider_apply_to_all": "applyToAll", 'click .mailpoet_button_divider_apply_to_all': 'applyToAll',
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
modelEvents: function() { modelEvents: function() {

View File

@ -7,7 +7,7 @@ define([
'underscore' 'underscore'
], function(App, BaseBlock, _) { ], function(App, BaseBlock, _) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -37,7 +37,7 @@ define([
}); });
Module.FooterBlockView = base.BlockView.extend({ Module.FooterBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_footer_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_footer_block mailpoet_droppable_block',
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'
@ -78,16 +78,16 @@ define([
getTemplate: function() { return templates.footerBlockSettings; }, getTemplate: function() { return templates.footerBlockSettings; },
events: function() { events: function() {
return { return {
"change .mailpoet_field_footer_text_color": _.partial(this.changeColorField, "styles.text.fontColor"), 'change .mailpoet_field_footer_text_color': _.partial(this.changeColorField, 'styles.text.fontColor'),
"change .mailpoet_field_footer_text_font_family": _.partial(this.changeField, "styles.text.fontFamily"), 'change .mailpoet_field_footer_text_font_family': _.partial(this.changeField, 'styles.text.fontFamily'),
"change .mailpoet_field_footer_text_size": _.partial(this.changeField, "styles.text.fontSize"), 'change .mailpoet_field_footer_text_size': _.partial(this.changeField, 'styles.text.fontSize'),
"change #mailpoet_field_footer_link_color": _.partial(this.changeColorField, "styles.link.fontColor"), 'change #mailpoet_field_footer_link_color': _.partial(this.changeColorField, 'styles.link.fontColor'),
"change #mailpoet_field_footer_link_underline": function(event) { 'change #mailpoet_field_footer_link_underline': function(event) {
this.model.set('styles.link.textDecoration', (event.target.checked) ? event.target.value : 'none'); this.model.set('styles.link.textDecoration', (event.target.checked) ? event.target.value : 'none');
}, },
"change .mailpoet_field_footer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_footer_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"change .mailpoet_field_footer_alignment": _.partial(this.changeField, "styles.text.textAlign"), 'change .mailpoet_field_footer_alignment': _.partial(this.changeField, 'styles.text.textAlign'),
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
templateContext: function() { templateContext: function() {

View File

@ -7,7 +7,7 @@ define([
'underscore' 'underscore'
], function(App, BaseBlock, _) { ], function(App, BaseBlock, _) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -37,7 +37,7 @@ define([
}); });
Module.HeaderBlockView = base.BlockView.extend({ Module.HeaderBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_header_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_header_block mailpoet_droppable_block',
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'
@ -78,16 +78,16 @@ define([
getTemplate: function() { return templates.headerBlockSettings; }, getTemplate: function() { return templates.headerBlockSettings; },
events: function() { events: function() {
return { return {
"change .mailpoet_field_header_text_color": _.partial(this.changeColorField, "styles.text.fontColor"), 'change .mailpoet_field_header_text_color': _.partial(this.changeColorField, 'styles.text.fontColor'),
"change .mailpoet_field_header_text_font_family": _.partial(this.changeField, "styles.text.fontFamily"), 'change .mailpoet_field_header_text_font_family': _.partial(this.changeField, 'styles.text.fontFamily'),
"change .mailpoet_field_header_text_size": _.partial(this.changeField, "styles.text.fontSize"), 'change .mailpoet_field_header_text_size': _.partial(this.changeField, 'styles.text.fontSize'),
"change #mailpoet_field_header_link_color": _.partial(this.changeColorField, "styles.link.fontColor"), 'change #mailpoet_field_header_link_color': _.partial(this.changeColorField, 'styles.link.fontColor'),
"change #mailpoet_field_header_link_underline": function(event) { 'change #mailpoet_field_header_link_underline': function(event) {
this.model.set('styles.link.textDecoration', (event.target.checked) ? event.target.value : 'none'); this.model.set('styles.link.textDecoration', (event.target.checked) ? event.target.value : 'none');
}, },
"change .mailpoet_field_header_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_header_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"change .mailpoet_field_header_alignment": _.partial(this.changeField, "styles.text.textAlign"), 'change .mailpoet_field_header_alignment': _.partial(this.changeField, 'styles.text.textAlign'),
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
templateContext: function() { templateContext: function() {

View File

@ -8,7 +8,7 @@ define([
'mailpoet' 'mailpoet'
], function(App, BaseBlock, _, MailPoet) { ], function(App, BaseBlock, _, MailPoet) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock, base = BaseBlock,
@ -34,7 +34,7 @@ define([
}); });
Module.ImageBlockView = base.BlockView.extend({ Module.ImageBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_image_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_image_block mailpoet_droppable_block',
getTemplate: function() { return templates.imageBlock; }, getTemplate: function() { return templates.imageBlock; },
onDragSubstituteBy: function() { return Module.ImageWidgetView; }, onDragSubstituteBy: function() { return Module.ImageWidgetView; },
templateContext: function() { templateContext: function() {
@ -75,13 +75,13 @@ define([
getTemplate: function() { return templates.imageBlockSettings; }, getTemplate: function() { return templates.imageBlockSettings; },
events: function() { events: function() {
return { return {
"input .mailpoet_field_image_link": _.partial(this.changeField, "link"), 'input .mailpoet_field_image_link': _.partial(this.changeField, 'link'),
"input .mailpoet_field_image_address": 'changeAddress', 'input .mailpoet_field_image_address': 'changeAddress',
"input .mailpoet_field_image_alt_text": _.partial(this.changeField, "alt"), 'input .mailpoet_field_image_alt_text': _.partial(this.changeField, 'alt'),
"change .mailpoet_field_image_full_width": _.partial(this.changeBoolCheckboxField, "fullWidth"), 'change .mailpoet_field_image_full_width': _.partial(this.changeBoolCheckboxField, 'fullWidth'),
"change .mailpoet_field_image_alignment": _.partial(this.changeField, "styles.block.textAlign"), 'change .mailpoet_field_image_alignment': _.partial(this.changeField, 'styles.block.textAlign'),
"click .mailpoet_field_image_select_another_image": "showMediaManager", 'click .mailpoet_field_image_select_another_image': 'showMediaManager',
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
initialize: function(options) { initialize: function(options) {
@ -331,7 +331,7 @@ define([
height: mainSize.height + 'px', height: mainSize.height + 'px',
width: mainSize.width + 'px', width: mainSize.width + 'px',
src: mainSize.url, src: mainSize.url,
alt: (attachment.get('alt') !== "" && attachment.get('alt') !== undefined) ? attachment.get('alt') : attachment.get('title') alt: (attachment.get('alt') !== '' && attachment.get('alt') !== undefined) ? attachment.get('alt') : attachment.get('title')
}); });
// Rerender settings view due to changes from outside of settings view // Rerender settings view due to changes from outside of settings view
that.render(); that.render();

View File

@ -37,7 +37,7 @@ define([
DividerBlock DividerBlock
) { ) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -176,7 +176,7 @@ define([
}); });
Module.PostsBlockView = base.BlockView.extend({ Module.PostsBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_posts_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_posts_block mailpoet_droppable_block',
getTemplate: function() { return templates.postsBlock; }, getTemplate: function() { return templates.postsBlock; },
modelEvents: {}, // Forcefully disable all events modelEvents: {}, // Forcefully disable all events
regions: _.extend({ regions: _.extend({
@ -462,25 +462,25 @@ define([
getTemplate: function() { return templates.displayOptionsPostsBlockSettings; }, getTemplate: function() { return templates.displayOptionsPostsBlockSettings; },
events: function() { events: function() {
return { return {
"click .mailpoet_posts_select_button": 'showButtonSettings', 'click .mailpoet_posts_select_button': 'showButtonSettings',
"click .mailpoet_posts_select_divider": 'showDividerSettings', 'click .mailpoet_posts_select_divider': 'showDividerSettings',
"change .mailpoet_posts_read_more_type": 'changeReadMoreType', 'change .mailpoet_posts_read_more_type': 'changeReadMoreType',
"change .mailpoet_posts_display_type": 'changeDisplayType', 'change .mailpoet_posts_display_type': 'changeDisplayType',
"change .mailpoet_posts_title_format": 'changeTitleFormat', 'change .mailpoet_posts_title_format': 'changeTitleFormat',
"change .mailpoet_posts_title_as_links": _.partial(this.changeBoolField, 'titleIsLink'), 'change .mailpoet_posts_title_as_links': _.partial(this.changeBoolField, 'titleIsLink'),
"change .mailpoet_posts_show_divider": _.partial(this.changeBoolField, 'showDivider'), 'change .mailpoet_posts_show_divider': _.partial(this.changeBoolField, 'showDivider'),
"input .mailpoet_posts_show_amount": _.partial(this.changeField, "amount"), 'input .mailpoet_posts_show_amount': _.partial(this.changeField, 'amount'),
"change .mailpoet_posts_content_type": _.partial(this.changeField, "contentType"), 'change .mailpoet_posts_content_type': _.partial(this.changeField, 'contentType'),
"change .mailpoet_posts_include_or_exclude": _.partial(this.changeField, "inclusionType"), 'change .mailpoet_posts_include_or_exclude': _.partial(this.changeField, 'inclusionType'),
"change .mailpoet_posts_title_alignment": _.partial(this.changeField, "titleAlignment"), 'change .mailpoet_posts_title_alignment': _.partial(this.changeField, 'titleAlignment'),
"change .mailpoet_posts_image_full_width": _.partial(this.changeBoolField, "imageFullWidth"), 'change .mailpoet_posts_image_full_width': _.partial(this.changeBoolField, 'imageFullWidth'),
"change .mailpoet_posts_featured_image_position": _.partial(this.changeField, "featuredImagePosition"), 'change .mailpoet_posts_featured_image_position': _.partial(this.changeField, 'featuredImagePosition'),
"change .mailpoet_posts_show_author": _.partial(this.changeField, "showAuthor"), 'change .mailpoet_posts_show_author': _.partial(this.changeField, 'showAuthor'),
"input .mailpoet_posts_author_preceded_by": _.partial(this.changeField, "authorPrecededBy"), 'input .mailpoet_posts_author_preceded_by': _.partial(this.changeField, 'authorPrecededBy'),
"change .mailpoet_posts_show_categories": _.partial(this.changeField, "showCategories"), 'change .mailpoet_posts_show_categories': _.partial(this.changeField, 'showCategories'),
"input .mailpoet_posts_categories": _.partial(this.changeField, "categoriesPrecededBy"), 'input .mailpoet_posts_categories': _.partial(this.changeField, 'categoriesPrecededBy'),
"input .mailpoet_posts_read_more_text": _.partial(this.changeField, "readMoreText"), 'input .mailpoet_posts_read_more_text': _.partial(this.changeField, 'readMoreText'),
"change .mailpoet_posts_sort_by": _.partial(this.changeField, "sortBy") 'change .mailpoet_posts_sort_by': _.partial(this.changeField, 'sortBy')
}; };
}, },
templateContext: function() { templateContext: function() {

View File

@ -11,7 +11,7 @@ define([
'jquery' 'jquery'
], function(App, BaseBlock, Backbone, Marionette, SuperModel, _, jQuery) { ], function(App, BaseBlock, Backbone, Marionette, SuperModel, _, jQuery) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock, base = BaseBlock,
@ -138,7 +138,7 @@ define([
}, },
events: function() { events: function() {
return { return {
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
}, },
initialize: function() { initialize: function() {
@ -158,11 +158,11 @@ define([
getTemplate: function() { return templates.socialSettingsIcon; }, getTemplate: function() { return templates.socialSettingsIcon; },
events: function() { events: function() {
return { return {
"click .mailpoet_delete_block": "deleteIcon", 'click .mailpoet_delete_block': 'deleteIcon',
"change .mailpoet_social_icon_field_type": _.partial(this.changeField, "iconType"), 'change .mailpoet_social_icon_field_type': _.partial(this.changeField, 'iconType'),
"input .mailpoet_social_icon_field_image": _.partial(this.changeField, "image"), 'input .mailpoet_social_icon_field_image': _.partial(this.changeField, 'image'),
"input .mailpoet_social_icon_field_link": this.changeLink, 'input .mailpoet_social_icon_field_link': this.changeLink,
"input .mailpoet_social_icon_field_text": _.partial(this.changeField, "text") 'input .mailpoet_social_icon_field_text': _.partial(this.changeField, 'text')
}; };
}, },
modelEvents: { modelEvents: {

View File

@ -7,7 +7,7 @@ define([
'underscore' 'underscore'
], function(App, BaseBlock, _) { ], function(App, BaseBlock, _) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -27,7 +27,7 @@ define([
}); });
Module.SpacerBlockView = base.BlockView.extend({ Module.SpacerBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_spacer_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_spacer_block mailpoet_droppable_block',
getTemplate: function() { return templates.spacerBlock; }, getTemplate: function() { return templates.spacerBlock; },
behaviors: _.defaults({ behaviors: _.defaults({
ResizableBehavior: { ResizableBehavior: {
@ -69,8 +69,8 @@ define([
getTemplate: function() { return templates.spacerBlockSettings; }, getTemplate: function() { return templates.spacerBlockSettings; },
events: function() { events: function() {
return { return {
"change .mailpoet_field_spacer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), 'change .mailpoet_field_spacer_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'),
"click .mailpoet_done_editing": "close" 'click .mailpoet_done_editing': 'close'
}; };
} }
}); });

View File

@ -7,7 +7,7 @@ define([
'underscore' 'underscore'
], function(App, BaseBlock, _) { ], function(App, BaseBlock, _) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
base = BaseBlock; base = BaseBlock;
@ -22,17 +22,17 @@ define([
}); });
Module.TextBlockView = base.BlockView.extend({ Module.TextBlockView = base.BlockView.extend({
className: "mailpoet_block mailpoet_text_block mailpoet_droppable_block", className: 'mailpoet_block mailpoet_text_block mailpoet_droppable_block',
getTemplate: function() { return templates.textBlock; }, getTemplate: function() { return templates.textBlock; },
modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), // Prevent rerendering on model change due to text editor redrawing modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), // Prevent rerendering on model change due to text editor redrawing
behaviors: _.extend({}, base.BlockView.prototype.behaviors, { behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
TextEditorBehavior: { TextEditorBehavior: {
toolbar1: "formatselect bold italic forecolor | link unlink", toolbar1: 'formatselect bold italic forecolor | link unlink',
toolbar2: "alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_shortcodes", toolbar2: 'alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_shortcodes',
validElements: "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]", validElements: '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]',
invalidElements: "script", invalidElements: 'script',
blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p', blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p',
plugins: "link lists code textcolor colorpicker mailpoet_shortcodes paste", plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste',
configurationFilter: function(originalSettings) { configurationFilter: function(originalSettings) {
return _.extend({}, originalSettings, { return _.extend({}, originalSettings, {
mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(), mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),

View File

@ -4,7 +4,7 @@ define([
'underscore', 'underscore',
'mailpoet' 'mailpoet'
], function(App, SuperModel, _, MailPoet) { ], function(App, SuperModel, _, MailPoet) {
"use strict"; 'use strict';
var Module = {}; var Module = {};
@ -34,14 +34,14 @@ define([
if (type in Module._blockTypes) { if (type in Module._blockTypes) {
return Module._blockTypes[type].blockModel; return Module._blockTypes[type].blockModel;
} else { } else {
throw "Block type not supported: " + type; throw 'Block type not supported: ' + type;
} }
}; };
Module.getBlockTypeView = function(type) { Module.getBlockTypeView = function(type) {
if (type in Module._blockTypes) { if (type in Module._blockTypes) {
return Module._blockTypes[type].blockView; return Module._blockTypes[type].blockView;
} else { } else {
throw "Block type not supported: " + type; throw 'Block type not supported: ' + type;
} }
}; };

View File

@ -6,7 +6,7 @@ define([
'jquery' 'jquery'
], function(App, Backbone, Marionette, _, jQuery) { ], function(App, Backbone, Marionette, _, jQuery) {
"use strict"; 'use strict';
var Module = {}; var Module = {};
@ -19,8 +19,8 @@ define([
}, },
events: function() { events: function() {
return { return {
'keyup .mailpoet_input_title': _.partial(this.changeField, "subject"), 'keyup .mailpoet_input_title': _.partial(this.changeField, 'subject'),
'keyup .mailpoet_input_preheader': _.partial(this.changeField, "preheader") 'keyup .mailpoet_input_preheader': _.partial(this.changeField, 'preheader')
}; };
}, },
changeField: function(field, event) { changeField: function(field, event) {
@ -33,7 +33,7 @@ define([
MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-subject-line'), { MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-subject-line'), {
tooltipId: 'tooltip-designer-subject-line-ti', tooltipId: 'tooltip-designer-subject-line-ti',
tooltip: MailPoet.I18n.t('helpTooltipDesignerSubjectLine'), tooltip: MailPoet.I18n.t('helpTooltipDesignerSubjectLine'),
place: "right" place: 'right'
}); });
MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-preheader'), { MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-preheader'), {
tooltipId: 'tooltip-designer-preheader-ti', tooltipId: 'tooltip-designer-preheader-ti',

View File

@ -22,7 +22,7 @@ define([
html2canvas html2canvas
) { ) {
"use strict"; 'use strict';
var Module = {}, var Module = {},
saveTimeout; saveTimeout;
@ -82,8 +82,8 @@ define([
// Removes 1px left transparent border from resulting canvas. // Removes 1px left transparent border from resulting canvas.
var oldContext = oldCanvas.getContext('2d'), var oldContext = oldCanvas.getContext('2d'),
newCanvas = document.createElement("canvas"), newCanvas = document.createElement('canvas'),
newContext = newCanvas.getContext("2d"), newContext = newCanvas.getContext('2d'),
leftBorderWidth = 1; leftBorderWidth = 1;
newCanvas.width = oldCanvas.width; newCanvas.width = oldCanvas.width;
@ -300,8 +300,8 @@ define([
var contents = JSON.stringify(jsonObject); var contents = JSON.stringify(jsonObject);
if (App.getConfig().get('validation.validateUnsubscribeLinkPresent') && if (App.getConfig().get('validation.validateUnsubscribeLinkPresent') &&
contents.indexOf("[link:subscription_unsubscribe_url]") < 0 && contents.indexOf('[link:subscription_unsubscribe_url]') < 0 &&
contents.indexOf("[link:subscription_unsubscribe]") < 0) { contents.indexOf('[link:subscription_unsubscribe]') < 0) {
this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing')); this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing'));
return; return;
} }

View File

@ -20,7 +20,7 @@ define([
StickyKit StickyKit
) { ) {
"use strict"; 'use strict';
var Module = {}; var Module = {};
@ -69,7 +69,7 @@ define([
'slideUp', 'slideUp',
{ {
duration: 250, duration: 250,
easing: "easeOut", easing: 'easeOut',
complete: function() { complete: function() {
$openRegion.addClass('closed'); $openRegion.addClass('closed');
}.bind(this) }.bind(this)
@ -81,7 +81,7 @@ define([
'slideDown', 'slideDown',
{ {
duration: 250, duration: 250,
easing: "easeIn", easing: 'easeIn',
complete: function() { complete: function() {
$targetRegion.removeClass('closed'); $targetRegion.removeClass('closed');
} }
@ -180,40 +180,40 @@ define([
}, },
events: function() { events: function() {
return { return {
"change #mailpoet_text_font_color": _.partial(this.changeColorField, 'text.fontColor'), 'change #mailpoet_text_font_color': _.partial(this.changeColorField, 'text.fontColor'),
"change #mailpoet_text_font_family": function(event) { 'change #mailpoet_text_font_family': function(event) {
this.model.set('text.fontFamily', event.target.value); this.model.set('text.fontFamily', event.target.value);
}, },
"change #mailpoet_text_font_size": function(event) { 'change #mailpoet_text_font_size': function(event) {
this.model.set('text.fontSize', event.target.value); this.model.set('text.fontSize', event.target.value);
}, },
"change #mailpoet_h1_font_color": _.partial(this.changeColorField, 'h1.fontColor'), 'change #mailpoet_h1_font_color': _.partial(this.changeColorField, 'h1.fontColor'),
"change #mailpoet_h1_font_family": function(event) { 'change #mailpoet_h1_font_family': function(event) {
this.model.set('h1.fontFamily', event.target.value); this.model.set('h1.fontFamily', event.target.value);
}, },
"change #mailpoet_h1_font_size": function(event) { 'change #mailpoet_h1_font_size': function(event) {
this.model.set('h1.fontSize', event.target.value); this.model.set('h1.fontSize', event.target.value);
}, },
"change #mailpoet_h2_font_color": _.partial(this.changeColorField, 'h2.fontColor'), 'change #mailpoet_h2_font_color': _.partial(this.changeColorField, 'h2.fontColor'),
"change #mailpoet_h2_font_family": function(event) { 'change #mailpoet_h2_font_family': function(event) {
this.model.set('h2.fontFamily', event.target.value); this.model.set('h2.fontFamily', event.target.value);
}, },
"change #mailpoet_h2_font_size": function(event) { 'change #mailpoet_h2_font_size': function(event) {
this.model.set('h2.fontSize', event.target.value); this.model.set('h2.fontSize', event.target.value);
}, },
"change #mailpoet_h3_font_color": _.partial(this.changeColorField, 'h3.fontColor'), 'change #mailpoet_h3_font_color': _.partial(this.changeColorField, 'h3.fontColor'),
"change #mailpoet_h3_font_family": function(event) { 'change #mailpoet_h3_font_family': function(event) {
this.model.set('h3.fontFamily', event.target.value); this.model.set('h3.fontFamily', event.target.value);
}, },
"change #mailpoet_h3_font_size": function(event) { 'change #mailpoet_h3_font_size': function(event) {
this.model.set('h3.fontSize', event.target.value); this.model.set('h3.fontSize', event.target.value);
}, },
"change #mailpoet_a_font_color": _.partial(this.changeColorField, 'link.fontColor'), 'change #mailpoet_a_font_color': _.partial(this.changeColorField, 'link.fontColor'),
"change #mailpoet_a_font_underline": function(event) { 'change #mailpoet_a_font_underline': function(event) {
this.model.set('link.textDecoration', (event.target.checked) ? event.target.value : 'none'); this.model.set('link.textDecoration', (event.target.checked) ? event.target.value : 'none');
}, },
"change #mailpoet_newsletter_background_color": _.partial(this.changeColorField, 'wrapper.backgroundColor'), 'change #mailpoet_newsletter_background_color': _.partial(this.changeColorField, 'wrapper.backgroundColor'),
"change #mailpoet_background_color": _.partial(this.changeColorField, 'body.backgroundColor') 'change #mailpoet_background_color': _.partial(this.changeColorField, 'body.backgroundColor')
}; };
}, },
templateContext: function() { templateContext: function() {

View File

@ -4,7 +4,7 @@ define([
'backbone.supermodel' 'backbone.supermodel'
], function(App, Marionette, SuperModel) { ], function(App, Marionette, SuperModel) {
"use strict"; 'use strict';
var Module = {}; var Module = {};

View File

@ -46,8 +46,8 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function(editor, url) {
// Open window // Open window
editor.windowManager.open({ editor.windowManager.open({
height: parseInt(editor.getParam("plugin_mailpoet_shortcodes_height", 400)), height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400)),
width: parseInt(editor.getParam("plugin_mailpoet_shortcodes_width", 450)), width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450)),
autoScroll: true, autoScroll: true,
title: editor.settings.mailpoet_shortcodes_window_title, title: editor.settings.mailpoet_shortcodes_window_title,
body: shortcodes, body: shortcodes,

View File

@ -1,5 +1,5 @@
define('notice', ['mailpoet', 'jquery'], function(mp, jQuery) { define('notice', ['mailpoet', 'jquery'], function(mp, jQuery) {
"use strict"; 'use strict';
/*================================================================================================== /*==================================================================================================
MailPoet Notice: MailPoet Notice:

View File

@ -13,7 +13,7 @@ define(
Handlebars, Handlebars,
select2 select2
) { ) {
if (!jQuery("#mailpoet_subscribers_export").length) { if (!jQuery('#mailpoet_subscribers_export').length) {
return; return;
} }
jQuery(document).ready(function () { jQuery(document).ready(function () {
@ -27,11 +27,11 @@ define(
jQuery('#mailpoet_subscribers_export > div.inside').html(subscribers_export_template(exportData)); jQuery('#mailpoet_subscribers_export > div.inside').html(subscribers_export_template(exportData));
// define reusable variables // define reusable variables
var segmentsContainerElement = jQuery("#export_lists"), var segmentsContainerElement = jQuery('#export_lists'),
subscriberFieldsContainerElement = jQuery("#export_columns"), subscriberFieldsContainerElement = jQuery('#export_columns'),
exportConfirmedOptionElement = jQuery(':radio[name="option_confirmed"]'), exportConfirmedOptionElement = jQuery(':radio[name="option_confirmed"]'),
groupBySegmentOptionElement = jQuery(':checkbox[name="option_group_by_list"]'), groupBySegmentOptionElement = jQuery(':checkbox[name="option_group_by_list"]'),
nextStepButton = jQuery("a.mailpoet_export_process"), nextStepButton = jQuery('a.mailpoet_export_process'),
renderSegmentsAndFields = function (container, data) { renderSegmentsAndFields = function (container, data) {
if (container.data('select2')) { if (container.data('select2')) {
container container
@ -107,7 +107,7 @@ define(
'first_name', 'first_name',
'last_name', 'last_name',
'status' 'status'
]).trigger("change"); ]).trigger('change');
exportConfirmedOptionElement.change(function () { exportConfirmedOptionElement.change(function () {
var selectedSegments = segmentsContainerElement.val(); var selectedSegments = segmentsContainerElement.val();
@ -144,7 +144,7 @@ define(
data: JSON.stringify({ data: JSON.stringify({
'export_confirmed_option': exportData.exportConfirmedOption, 'export_confirmed_option': exportData.exportConfirmedOption,
'export_format_option': jQuery(':radio[name="option_format"]:checked').val(), 'export_format_option': jQuery(':radio[name="option_format"]:checked').val(),
'group_by_segment_option': (groupBySegmentOptionElement.is(":visible")) ? groupBySegmentOptionElement.prop('checked') : false, 'group_by_segment_option': (groupBySegmentOptionElement.is(':visible')) ? groupBySegmentOptionElement.prop('checked') : false,
'segments': (exportData.segments) ? segmentsContainerElement.val() : false, 'segments': (exportData.segments) ? segmentsContainerElement.val() : false,
'subscriber_fields': subscriberFieldsContainerElement.val() 'subscriber_fields': subscriberFieldsContainerElement.val()
}) })

View File

@ -112,7 +112,7 @@ define(
* Paste * Paste
*/ */
pasteInputElement pasteInputElement
.attr('value', pasteInputPlaceholderElement).css('color', "#999") .attr('value', pasteInputPlaceholderElement).css('color', '#999')
.focus(function () { .focus(function () {
if (jQuery(this).val() === pasteInputPlaceholderElement) { if (jQuery(this).val() === pasteInputPlaceholderElement) {
jQuery(this).attr('value', '').css('color', '#222'); jQuery(this).attr('value', '').css('color', '#222');
@ -120,7 +120,7 @@ define(
}) })
.blur(function () { .blur(function () {
if (jQuery(this).val() === '') { if (jQuery(this).val() === '') {
jQuery(this).attr('value', pasteInputPlaceholderElement).css('color', "#999"); jQuery(this).attr('value', pasteInputPlaceholderElement).css('color', '#999');
} }
}) })
.keyup(function () { .keyup(function () {
@ -378,7 +378,7 @@ define(
processedSubscribers[0] = rowData; processedSubscribers[0] = rowData;
} }
} }
else if (rowData[emailColumnPosition] !== "") { else if (rowData[emailColumnPosition] !== '') {
var email = detectAndCleanupEmail(rowData[emailColumnPosition]); var email = detectAndCleanupEmail(rowData[emailColumnPosition]);
if (_.has(parsedEmails, email)) { if (_.has(parsedEmails, email)) {
duplicateEmails.push(email); duplicateEmails.push(email);
@ -512,7 +512,7 @@ define(
var details = jQuery('.mailpoet_subscribers_data_parse_results_details'); var details = jQuery('.mailpoet_subscribers_data_parse_results_details');
jQuery(details).toggle(); jQuery(details).toggle();
this.text = this.text =
(jQuery(details).is(":visible")) (jQuery(details).is(':visible'))
? MailPoet.I18n.t('hideDetails') ? MailPoet.I18n.t('hideDetails')
: MailPoet.I18n.t('showDetails'); : MailPoet.I18n.t('showDetails');
}); });
@ -626,7 +626,7 @@ define(
// register partial template that will contain subscribers data // register partial template that will contain subscribers data
Handlebars.registerPartial( Handlebars.registerPartial(
"subscribers_data_template_partial", 'subscribers_data_template_partial',
subscribersDataTemplatePartial subscribersDataTemplatePartial
); );