diff --git a/.eslintrc.es5.json b/.eslintrc.es5.json index 93362e57ae..c736e862fe 100644 --- a/.eslintrc.es5.json +++ b/.eslintrc.es5.json @@ -72,7 +72,6 @@ "one-var": 0, "camelcase": 0, "spaced-comment": 0, - "quotes": 0, "padded-blocks": 0, "object-curly-spacing": 0, "strict": 0, diff --git a/assets/js/src/ajax.js b/assets/js/src/ajax.js index 81eb615d9a..70f216ca5e 100644 --- a/assets/js/src/ajax.js +++ b/assets/js/src/ajax.js @@ -2,7 +2,7 @@ function requestFailed(errorMessage, xhr) { if (xhr.responseJSON) { return xhr.responseJSON; } - var message = errorMessage.replace("%d", xhr.status); + var message = errorMessage.replace('%d', xhr.status); return { errors: [ { diff --git a/assets/js/src/analytics_event.js b/assets/js/src/analytics_event.js index 170e7bbcf3..2a4fdc8c8a 100644 --- a/assets/js/src/analytics_event.js +++ b/assets/js/src/analytics_event.js @@ -18,7 +18,7 @@ var eventsCache = []; function track(name, data){ - if (typeof window.mixpanel.track !== "function") { + if (typeof window.mixpanel.track !== 'function') { window.mixpanel.init(window.mixpanelTrackingId); } window.mixpanel.track(name, data); @@ -44,7 +44,7 @@ function trackCachedEvents() { } function initializeMixpanelWhenLoaded() { - if (typeof window.mixpanel === "object") { + if (typeof window.mixpanel === 'object') { exportMixpanel(MailPoet); trackCachedEvents(); } else { diff --git a/assets/js/src/form_editor/form_editor.js b/assets/js/src/form_editor/form_editor.js index 8013794118..58fb388642 100644 --- a/assets/js/src/form_editor/form_editor.js +++ b/assets/js/src/form_editor/form_editor.js @@ -694,7 +694,7 @@ WysijaForm.DraggableItem = Class.create({ return this.element.up('ul'); }, insert: function() { - $$("body")[0].insert(this.clone); + $$('body')[0].insert(this.clone); }, onMousedown: function(event) { var draggable = new Draggable(this.clone, { diff --git a/assets/js/src/handlebars_helpers.js b/assets/js/src/handlebars_helpers.js index 8d095ac34f..d741141941 100644 --- a/assets/js/src/handlebars_helpers.js +++ b/assets/js/src/handlebars_helpers.js @@ -19,7 +19,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) { } // 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 if(parseInt(timestamp, 10) == timestamp) { return moment.unix(timestamp).format(f); @@ -67,7 +67,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) { }); Handlebars.registerHelper('nl2br', function(value, block) { - return value.gsub("\n", "
"); + return value.gsub('\n', '
'); }); Handlebars.registerHelper('json_encode', function(value, block) { @@ -78,7 +78,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) { return JSON.parse(value); }); 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; }); @@ -99,7 +99,7 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) { // extract all lines into an array if(value === undefined) return ''; - var lines = value.trim().split("\n"); + var lines = value.trim().split('\n'); // remove header & footer 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 '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 '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 '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; } }); diff --git a/assets/js/src/i18n.js b/assets/js/src/i18n.js index d23a8f98bc..98581cd35e 100644 --- a/assets/js/src/i18n.js +++ b/assets/js/src/i18n.js @@ -14,7 +14,7 @@ define('i18n', translations[key] = value; }, 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() { return translations; diff --git a/assets/js/src/iframe.js b/assets/js/src/iframe.js index 91a6893135..ea9c55aae6 100644 --- a/assets/js/src/iframe.js +++ b/assets/js/src/iframe.js @@ -17,7 +17,7 @@ define('iframe', ['mailpoet'], function(mp) { iframe.style.height = ( parseInt(i, 10) + this.marginY - ) + "px"; + ) + 'px'; } }; diff --git a/assets/js/src/mp2migrator.js b/assets/js/src/mp2migrator.js index 5bcf32bad7..1ec4ae7e27 100644 --- a/assets/js/src/mp2migrator.js +++ b/assets/js/src/mp2migrator.js @@ -28,8 +28,8 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(mp, jQuery) { url: mailpoet_mp2_migrator.log_file_url, cache: false }).done(function (result) { - jQuery("#logger").html(''); - result.split("\n").forEach(function (resultRow) { + jQuery('#logger').html(''); + result.split('\n').forEach(function (resultRow) { var row = resultRow; if(row.substr(0, 7) === '[ERROR]' || row.substr(0, 9) === '[WARNING]' || row === MailPoet.I18n.t('import_stopped_by_user')) { row = '' + row + ''; // Mark the errors in red @@ -39,10 +39,10 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(mp, jQuery) { jQuery('#import-actions').hide(); jQuery('#upgrade-completed').show(); } - jQuery("#logger").append(row + "
\n"); + jQuery('#logger').append(row + '
\n'); }); - jQuery("#logger").append('' + MailPoet.MP2Migrator.fatal_error + '' + "
\n"); + jQuery('#logger').append('' + MailPoet.MP2Migrator.fatal_error + '' + '
\n'); }).always(function () { if(MailPoet.MP2Migrator.is_logging) { MailPoet.MP2Migrator.displayLogs_timeout = setTimeout(MailPoet.MP2Migrator.displayLogs, 1000); diff --git a/assets/js/src/newsletter_editor/behaviors/ColorPickerBehavior.js b/assets/js/src/newsletter_editor/behaviors/ColorPickerBehavior.js index bfcc9e5051..6fc14a32f8 100644 --- a/assets/js/src/newsletter_editor/behaviors/ColorPickerBehavior.js +++ b/assets/js/src/newsletter_editor/behaviors/ColorPickerBehavior.js @@ -17,7 +17,7 @@ define([ clickoutFiresChange: true, showInput: true, showInitial: true, - preferredFormat: "hex6", + preferredFormat: 'hex6', allowEmpty: true, chooseText: MailPoet.I18n.t('selectColor'), cancelText: MailPoet.I18n.t('cancelColorSelection') diff --git a/assets/js/src/newsletter_editor/behaviors/ResizableBehavior.js b/assets/js/src/newsletter_editor/behaviors/ResizableBehavior.js index 48ac6a540e..9bf478992d 100644 --- a/assets/js/src/newsletter_editor/behaviors/ResizableBehavior.js +++ b/assets/js/src/newsletter_editor/behaviors/ResizableBehavior.js @@ -19,8 +19,8 @@ define([ modelField: 'styles.block.height' }, events: { - "mouseenter": 'showResizeHandle', - "mouseleave": 'hideResizeHandle' + 'mouseenter': 'showResizeHandle', + 'mouseleave': 'hideResizeHandle' }, onRender: function() { this.attachResize(); diff --git a/assets/js/src/newsletter_editor/behaviors/SortableBehavior.js b/assets/js/src/newsletter_editor/behaviors/SortableBehavior.js index 66f0f9ca5d..bc6e93ff9d 100644 --- a/assets/js/src/newsletter_editor/behaviors/SortableBehavior.js +++ b/assets/js/src/newsletter_editor/behaviors/SortableBehavior.js @@ -16,7 +16,7 @@ define([ if (_.isFunction(this.$el.sortable)) { this.$el.sortable({ - cursor: "move", + cursor: 'move', start: function(event, ui) { ui.item.data('previousIndex', ui.item.index()); }, diff --git a/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js b/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js index 06869e1a3a..27599e7287 100644 --- a/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js +++ b/assets/js/src/newsletter_editor/behaviors/TextEditorBehavior.js @@ -13,12 +13,12 @@ define([ BL.TextEditorBehavior = Marionette.Behavior.extend({ defaults: { selector: '.mailpoet_content', - toolbar1: "bold italic link unlink forecolor mailpoet_shortcodes", - toolbar2: "", - validElements: "p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br", - invalidElements: "script", + toolbar1: 'bold italic link unlink forecolor mailpoet_shortcodes', + toolbar2: '', + validElements: 'p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br', + invalidElements: 'script', blockFormats: 'Paragraph=p', - plugins: "link textcolor colorpicker mailpoet_shortcodes", + plugins: 'link textcolor colorpicker mailpoet_shortcodes', configurationFilter: function(originalConfig) { return originalConfig; } }, onDomRefresh: function() { diff --git a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js index 7cc3416374..d57dbae869 100644 --- a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js +++ b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js @@ -28,7 +28,7 @@ define([ jQuery ) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -128,12 +128,12 @@ define([ }); 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() { 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; }, regions: { @@ -171,28 +171,28 @@ define([ getTemplate: function() { return templates.automatedLatestContentBlockSettings; }, events: function() { return { - "click .mailpoet_automated_latest_content_hide_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_divider": 'showDividerSettings', - "change .mailpoet_automated_latest_content_read_more_type": 'changeReadMoreType', - "change .mailpoet_automated_latest_content_display_type": 'changeDisplayType', - "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_show_divider": _.partial(this.changeBoolField, 'showDivider'), - "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_include_or_exclude": _.partial(this.changeField, "inclusionType"), - "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_featured_image_position": _.partial(this.changeField, "featuredImagePosition"), - "change .mailpoet_automated_latest_content_show_author": _.partial(this.changeField, "showAuthor"), - "input .mailpoet_automated_latest_content_author_preceded_by": _.partial(this.changeField, "authorPrecededBy"), - "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_read_more_text": _.partial(this.changeField, "readMoreText"), - "change .mailpoet_automated_latest_content_sort_by": _.partial(this.changeField, "sortBy"), - "click .mailpoet_done_editing": "close" + 'click .mailpoet_automated_latest_content_hide_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_divider': 'showDividerSettings', + 'change .mailpoet_automated_latest_content_read_more_type': 'changeReadMoreType', + 'change .mailpoet_automated_latest_content_display_type': 'changeDisplayType', + '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_show_divider': _.partial(this.changeBoolField, 'showDivider'), + '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_include_or_exclude': _.partial(this.changeField, 'inclusionType'), + '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_featured_image_position': _.partial(this.changeField, 'featuredImagePosition'), + 'change .mailpoet_automated_latest_content_show_author': _.partial(this.changeField, 'showAuthor'), + 'input .mailpoet_automated_latest_content_author_preceded_by': _.partial(this.changeField, 'authorPrecededBy'), + '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_read_more_text': _.partial(this.changeField, 'readMoreText'), + 'change .mailpoet_automated_latest_content_sort_by': _.partial(this.changeField, 'sortBy'), + 'click .mailpoet_done_editing': 'close' }; }, onRender: function() { diff --git a/assets/js/src/newsletter_editor/blocks/base.js b/assets/js/src/newsletter_editor/blocks/base.js index 8a7b7e17fe..aca60706fa 100644 --- a/assets/js/src/newsletter_editor/blocks/base.js +++ b/assets/js/src/newsletter_editor/blocks/base.js @@ -14,7 +14,7 @@ define([ 'modal' ], function(App, Marionette, SuperModel, _, jQuery, MailPoet, Modal) { - "use strict"; + 'use strict'; var Module = {}, AugmentedView = Marionette.View.extend({}); @@ -55,8 +55,8 @@ define([ 'duplicate': 'duplicateBlock' }, events: { - "mouseenter": "showTools", - "mouseleave": "hideTools" + 'mouseenter': 'showTools', + 'mouseleave': 'hideTools' }, behaviors: { DraggableBehavior: { @@ -180,11 +180,11 @@ define([ Module.BlockToolsView = AugmentedView.extend({ getTemplate: function() { return templates.genericBlockTools; }, events: { - "click .mailpoet_edit_block": "changeSettings", - "click .mailpoet_delete_block_activate": "showDeletionConfirmation", - "click .mailpoet_delete_block_cancel": "hideDeletionConfirmation", - "click .mailpoet_delete_block_confirm": "deleteBlock", - "click .mailpoet_duplicate_block": "duplicateBlock" + 'click .mailpoet_edit_block': 'changeSettings', + 'click .mailpoet_delete_block_activate': 'showDeletionConfirmation', + 'click .mailpoet_delete_block_cancel': 'hideDeletionConfirmation', + 'click .mailpoet_delete_block_confirm': 'deleteBlock', + 'click .mailpoet_duplicate_block': 'duplicateBlock' }, // Markers of whether these particular tools will be used for this instance tools: { @@ -298,7 +298,7 @@ define([ behaviors: { DraggableBehavior: { drop: function() { - throw "Unsupported operation"; + throw 'Unsupported operation'; } } } diff --git a/assets/js/src/newsletter_editor/blocks/button.js b/assets/js/src/newsletter_editor/blocks/button.js index f08ac1cb18..1db19f50c2 100644 --- a/assets/js/src/newsletter_editor/blocks/button.js +++ b/assets/js/src/newsletter_editor/blocks/button.js @@ -9,7 +9,7 @@ define([ 'jquery' ], function(App, BaseBlock, MailPoet, _, jQuery) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -41,7 +41,7 @@ define([ }); 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; }, onDragSubstituteBy: function() { return Module.ButtonWidgetView; }, behaviors: _.extend({}, base.BlockView.prototype.behaviors, { @@ -68,34 +68,34 @@ define([ getTemplate: function() { return templates.buttonBlockSettings; }, events: function() { return { - "input .mailpoet_field_button_text": _.partial(this.changeField, "text"), - "input .mailpoet_field_button_url": _.partial(this.changeField, "url"), - "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_family": _.partial(this.changeField, "styles.block.fontFamily"), - "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_border_color": _.partial(this.changeColorField, "styles.block.borderColor"), - "change .mailpoet_field_button_font_weight": "changeFontWeight", + 'input .mailpoet_field_button_text': _.partial(this.changeField, 'text'), + 'input .mailpoet_field_button_url': _.partial(this.changeField, 'url'), + '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_family': _.partial(this.changeField, 'styles.block.fontFamily'), + '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_border_color': _.partial(this.changeColorField, 'styles.block.borderColor'), + '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)), - "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': _.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_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': _.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_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': _.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_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': _.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)), - "click .mailpoet_field_button_replace_all_styles": "applyToAll", - "click .mailpoet_done_editing": "close" + 'click .mailpoet_field_button_replace_all_styles': 'applyToAll', + 'click .mailpoet_done_editing': 'close' }; }, templateContext: function() { diff --git a/assets/js/src/newsletter_editor/blocks/container.js b/assets/js/src/newsletter_editor/blocks/container.js index aaa85d333a..2a010fe9b3 100644 --- a/assets/js/src/newsletter_editor/blocks/container.js +++ b/assets/js/src/newsletter_editor/blocks/container.js @@ -12,7 +12,7 @@ define([ 'newsletter_editor/blocks/base' ], function(Backbone, Marionette, _, jQuery, App, BaseBlock) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock, @@ -105,7 +105,7 @@ define([ className: 'mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block', getTemplate: function() { return templates.containerBlock; }, events: _.extend({}, base.BlockView.prototype.events, { - "click .mailpoet_newsletter_layer_selector": "toggleEditingLayer" + 'click .mailpoet_newsletter_layer_selector': 'toggleEditingLayer' }), ui: { tools: '> .mailpoet_tools' @@ -237,8 +237,8 @@ define([ getTemplate: function() { return templates.containerBlockSettings; }, events: function() { return { - "change .mailpoet_field_container_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), - "click .mailpoet_done_editing": "close" + 'change .mailpoet_field_container_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'), + 'click .mailpoet_done_editing': 'close' }; }, regions: { diff --git a/assets/js/src/newsletter_editor/blocks/divider.js b/assets/js/src/newsletter_editor/blocks/divider.js index 1faec7d3a1..12fd064f0c 100644 --- a/assets/js/src/newsletter_editor/blocks/divider.js +++ b/assets/js/src/newsletter_editor/blocks/divider.js @@ -9,7 +9,7 @@ define([ 'mailpoet' ], function(App, BaseBlock, _, jQuery, MailPoet) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -32,7 +32,7 @@ define([ }); 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; }, modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), behaviors: _.defaults({ @@ -87,16 +87,16 @@ define([ getTemplate: function() { return templates.dividerBlockSettings; }, events: function() { 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)), - "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': _.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)), - "change .mailpoet_field_divider_border_color": _.partial(this.changeColorField, "styles.block.borderColor"), - "change .mailpoet_field_divider_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), - "click .mailpoet_button_divider_apply_to_all": "applyToAll", - "click .mailpoet_done_editing": "close" + 'change .mailpoet_field_divider_border_color': _.partial(this.changeColorField, 'styles.block.borderColor'), + 'change .mailpoet_field_divider_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'), + 'click .mailpoet_button_divider_apply_to_all': 'applyToAll', + 'click .mailpoet_done_editing': 'close' }; }, modelEvents: function() { diff --git a/assets/js/src/newsletter_editor/blocks/footer.js b/assets/js/src/newsletter_editor/blocks/footer.js index ccba5f53ad..bc7f0602fb 100644 --- a/assets/js/src/newsletter_editor/blocks/footer.js +++ b/assets/js/src/newsletter_editor/blocks/footer.js @@ -7,7 +7,7 @@ define([ 'underscore' ], function(App, BaseBlock, _) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -37,7 +37,7 @@ define([ }); 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; }, 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' @@ -78,16 +78,16 @@ define([ getTemplate: function() { return templates.footerBlockSettings; }, events: function() { return { - "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_size": _.partial(this.changeField, "styles.text.fontSize"), - "change #mailpoet_field_footer_link_color": _.partial(this.changeColorField, "styles.link.fontColor"), - "change #mailpoet_field_footer_link_underline": function(event) { + '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_size': _.partial(this.changeField, 'styles.text.fontSize'), + 'change #mailpoet_field_footer_link_color': _.partial(this.changeColorField, 'styles.link.fontColor'), + 'change #mailpoet_field_footer_link_underline': function(event) { 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_alignment": _.partial(this.changeField, "styles.text.textAlign"), - "click .mailpoet_done_editing": "close" + 'change .mailpoet_field_footer_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'), + 'change .mailpoet_field_footer_alignment': _.partial(this.changeField, 'styles.text.textAlign'), + 'click .mailpoet_done_editing': 'close' }; }, templateContext: function() { diff --git a/assets/js/src/newsletter_editor/blocks/header.js b/assets/js/src/newsletter_editor/blocks/header.js index 872e8af486..b5def662d3 100644 --- a/assets/js/src/newsletter_editor/blocks/header.js +++ b/assets/js/src/newsletter_editor/blocks/header.js @@ -7,7 +7,7 @@ define([ 'underscore' ], function(App, BaseBlock, _) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -37,7 +37,7 @@ define([ }); 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; }, 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' @@ -78,16 +78,16 @@ define([ getTemplate: function() { return templates.headerBlockSettings; }, events: function() { return { - "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_size": _.partial(this.changeField, "styles.text.fontSize"), - "change #mailpoet_field_header_link_color": _.partial(this.changeColorField, "styles.link.fontColor"), - "change #mailpoet_field_header_link_underline": function(event) { + '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_size': _.partial(this.changeField, 'styles.text.fontSize'), + 'change #mailpoet_field_header_link_color': _.partial(this.changeColorField, 'styles.link.fontColor'), + 'change #mailpoet_field_header_link_underline': function(event) { 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_alignment": _.partial(this.changeField, "styles.text.textAlign"), - "click .mailpoet_done_editing": "close" + 'change .mailpoet_field_header_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'), + 'change .mailpoet_field_header_alignment': _.partial(this.changeField, 'styles.text.textAlign'), + 'click .mailpoet_done_editing': 'close' }; }, templateContext: function() { diff --git a/assets/js/src/newsletter_editor/blocks/image.js b/assets/js/src/newsletter_editor/blocks/image.js index a8f34b4cea..712800acc5 100644 --- a/assets/js/src/newsletter_editor/blocks/image.js +++ b/assets/js/src/newsletter_editor/blocks/image.js @@ -8,7 +8,7 @@ define([ 'mailpoet' ], function(App, BaseBlock, _, MailPoet) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock, @@ -34,7 +34,7 @@ define([ }); 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; }, onDragSubstituteBy: function() { return Module.ImageWidgetView; }, templateContext: function() { @@ -75,13 +75,13 @@ define([ getTemplate: function() { return templates.imageBlockSettings; }, events: function() { return { - "input .mailpoet_field_image_link": _.partial(this.changeField, "link"), - "input .mailpoet_field_image_address": 'changeAddress', - "input .mailpoet_field_image_alt_text": _.partial(this.changeField, "alt"), - "change .mailpoet_field_image_full_width": _.partial(this.changeBoolCheckboxField, "fullWidth"), - "change .mailpoet_field_image_alignment": _.partial(this.changeField, "styles.block.textAlign"), - "click .mailpoet_field_image_select_another_image": "showMediaManager", - "click .mailpoet_done_editing": "close" + 'input .mailpoet_field_image_link': _.partial(this.changeField, 'link'), + 'input .mailpoet_field_image_address': 'changeAddress', + 'input .mailpoet_field_image_alt_text': _.partial(this.changeField, 'alt'), + 'change .mailpoet_field_image_full_width': _.partial(this.changeBoolCheckboxField, 'fullWidth'), + 'change .mailpoet_field_image_alignment': _.partial(this.changeField, 'styles.block.textAlign'), + 'click .mailpoet_field_image_select_another_image': 'showMediaManager', + 'click .mailpoet_done_editing': 'close' }; }, initialize: function(options) { @@ -331,7 +331,7 @@ define([ height: mainSize.height + 'px', width: mainSize.width + 'px', 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 that.render(); diff --git a/assets/js/src/newsletter_editor/blocks/posts.js b/assets/js/src/newsletter_editor/blocks/posts.js index 724ac1a0a8..92c1a32757 100644 --- a/assets/js/src/newsletter_editor/blocks/posts.js +++ b/assets/js/src/newsletter_editor/blocks/posts.js @@ -37,7 +37,7 @@ define([ DividerBlock ) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -176,7 +176,7 @@ define([ }); 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; }, modelEvents: {}, // Forcefully disable all events regions: _.extend({ @@ -462,25 +462,25 @@ define([ getTemplate: function() { return templates.displayOptionsPostsBlockSettings; }, events: function() { return { - "click .mailpoet_posts_select_button": 'showButtonSettings', - "click .mailpoet_posts_select_divider": 'showDividerSettings', - "change .mailpoet_posts_read_more_type": 'changeReadMoreType', - "change .mailpoet_posts_display_type": 'changeDisplayType', - "change .mailpoet_posts_title_format": 'changeTitleFormat', - "change .mailpoet_posts_title_as_links": _.partial(this.changeBoolField, 'titleIsLink'), - "change .mailpoet_posts_show_divider": _.partial(this.changeBoolField, 'showDivider'), - "input .mailpoet_posts_show_amount": _.partial(this.changeField, "amount"), - "change .mailpoet_posts_content_type": _.partial(this.changeField, "contentType"), - "change .mailpoet_posts_include_or_exclude": _.partial(this.changeField, "inclusionType"), - "change .mailpoet_posts_title_alignment": _.partial(this.changeField, "titleAlignment"), - "change .mailpoet_posts_image_full_width": _.partial(this.changeBoolField, "imageFullWidth"), - "change .mailpoet_posts_featured_image_position": _.partial(this.changeField, "featuredImagePosition"), - "change .mailpoet_posts_show_author": _.partial(this.changeField, "showAuthor"), - "input .mailpoet_posts_author_preceded_by": _.partial(this.changeField, "authorPrecededBy"), - "change .mailpoet_posts_show_categories": _.partial(this.changeField, "showCategories"), - "input .mailpoet_posts_categories": _.partial(this.changeField, "categoriesPrecededBy"), - "input .mailpoet_posts_read_more_text": _.partial(this.changeField, "readMoreText"), - "change .mailpoet_posts_sort_by": _.partial(this.changeField, "sortBy") + 'click .mailpoet_posts_select_button': 'showButtonSettings', + 'click .mailpoet_posts_select_divider': 'showDividerSettings', + 'change .mailpoet_posts_read_more_type': 'changeReadMoreType', + 'change .mailpoet_posts_display_type': 'changeDisplayType', + 'change .mailpoet_posts_title_format': 'changeTitleFormat', + 'change .mailpoet_posts_title_as_links': _.partial(this.changeBoolField, 'titleIsLink'), + 'change .mailpoet_posts_show_divider': _.partial(this.changeBoolField, 'showDivider'), + 'input .mailpoet_posts_show_amount': _.partial(this.changeField, 'amount'), + 'change .mailpoet_posts_content_type': _.partial(this.changeField, 'contentType'), + 'change .mailpoet_posts_include_or_exclude': _.partial(this.changeField, 'inclusionType'), + 'change .mailpoet_posts_title_alignment': _.partial(this.changeField, 'titleAlignment'), + 'change .mailpoet_posts_image_full_width': _.partial(this.changeBoolField, 'imageFullWidth'), + 'change .mailpoet_posts_featured_image_position': _.partial(this.changeField, 'featuredImagePosition'), + 'change .mailpoet_posts_show_author': _.partial(this.changeField, 'showAuthor'), + 'input .mailpoet_posts_author_preceded_by': _.partial(this.changeField, 'authorPrecededBy'), + 'change .mailpoet_posts_show_categories': _.partial(this.changeField, 'showCategories'), + 'input .mailpoet_posts_categories': _.partial(this.changeField, 'categoriesPrecededBy'), + 'input .mailpoet_posts_read_more_text': _.partial(this.changeField, 'readMoreText'), + 'change .mailpoet_posts_sort_by': _.partial(this.changeField, 'sortBy') }; }, templateContext: function() { diff --git a/assets/js/src/newsletter_editor/blocks/social.js b/assets/js/src/newsletter_editor/blocks/social.js index 5d51ce77e2..35be008944 100644 --- a/assets/js/src/newsletter_editor/blocks/social.js +++ b/assets/js/src/newsletter_editor/blocks/social.js @@ -11,7 +11,7 @@ define([ 'jquery' ], function(App, BaseBlock, Backbone, Marionette, SuperModel, _, jQuery) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock, @@ -138,7 +138,7 @@ define([ }, events: function() { return { - "click .mailpoet_done_editing": "close" + 'click .mailpoet_done_editing': 'close' }; }, initialize: function() { @@ -158,11 +158,11 @@ define([ getTemplate: function() { return templates.socialSettingsIcon; }, events: function() { return { - "click .mailpoet_delete_block": "deleteIcon", - "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_link": this.changeLink, - "input .mailpoet_social_icon_field_text": _.partial(this.changeField, "text") + 'click .mailpoet_delete_block': 'deleteIcon', + '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_link': this.changeLink, + 'input .mailpoet_social_icon_field_text': _.partial(this.changeField, 'text') }; }, modelEvents: { diff --git a/assets/js/src/newsletter_editor/blocks/spacer.js b/assets/js/src/newsletter_editor/blocks/spacer.js index 9055068298..9e0f1f23d7 100644 --- a/assets/js/src/newsletter_editor/blocks/spacer.js +++ b/assets/js/src/newsletter_editor/blocks/spacer.js @@ -7,7 +7,7 @@ define([ 'underscore' ], function(App, BaseBlock, _) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -27,7 +27,7 @@ define([ }); 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; }, behaviors: _.defaults({ ResizableBehavior: { @@ -69,8 +69,8 @@ define([ getTemplate: function() { return templates.spacerBlockSettings; }, events: function() { return { - "change .mailpoet_field_spacer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"), - "click .mailpoet_done_editing": "close" + 'change .mailpoet_field_spacer_background_color': _.partial(this.changeColorField, 'styles.block.backgroundColor'), + 'click .mailpoet_done_editing': 'close' }; } }); diff --git a/assets/js/src/newsletter_editor/blocks/text.js b/assets/js/src/newsletter_editor/blocks/text.js index ba19283151..86997daa89 100644 --- a/assets/js/src/newsletter_editor/blocks/text.js +++ b/assets/js/src/newsletter_editor/blocks/text.js @@ -7,7 +7,7 @@ define([ 'underscore' ], function(App, BaseBlock, _) { - "use strict"; + 'use strict'; var Module = {}, base = BaseBlock; @@ -22,17 +22,17 @@ define([ }); 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; }, modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), // Prevent rerendering on model change due to text editor redrawing behaviors: _.extend({}, base.BlockView.prototype.behaviors, { TextEditorBehavior: { - toolbar1: "formatselect bold italic forecolor | link unlink", - 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]", - invalidElements: "script", + toolbar1: 'formatselect bold italic forecolor | link unlink', + 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]', + invalidElements: 'script', 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) { return _.extend({}, originalSettings, { mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(), diff --git a/assets/js/src/newsletter_editor/components/content.js b/assets/js/src/newsletter_editor/components/content.js index ef97ca94e7..f5d466782c 100644 --- a/assets/js/src/newsletter_editor/components/content.js +++ b/assets/js/src/newsletter_editor/components/content.js @@ -4,7 +4,7 @@ define([ 'underscore', 'mailpoet' ], function(App, SuperModel, _, MailPoet) { - "use strict"; + 'use strict'; var Module = {}; @@ -34,14 +34,14 @@ define([ if (type in Module._blockTypes) { return Module._blockTypes[type].blockModel; } else { - throw "Block type not supported: " + type; + throw 'Block type not supported: ' + type; } }; Module.getBlockTypeView = function(type) { if (type in Module._blockTypes) { return Module._blockTypes[type].blockView; } else { - throw "Block type not supported: " + type; + throw 'Block type not supported: ' + type; } }; diff --git a/assets/js/src/newsletter_editor/components/heading.js b/assets/js/src/newsletter_editor/components/heading.js index 080f75c809..0b9dcd0add 100644 --- a/assets/js/src/newsletter_editor/components/heading.js +++ b/assets/js/src/newsletter_editor/components/heading.js @@ -6,7 +6,7 @@ define([ 'jquery' ], function(App, Backbone, Marionette, _, jQuery) { - "use strict"; + 'use strict'; var Module = {}; @@ -19,8 +19,8 @@ define([ }, events: function() { return { - 'keyup .mailpoet_input_title': _.partial(this.changeField, "subject"), - 'keyup .mailpoet_input_preheader': _.partial(this.changeField, "preheader") + 'keyup .mailpoet_input_title': _.partial(this.changeField, 'subject'), + 'keyup .mailpoet_input_preheader': _.partial(this.changeField, 'preheader') }; }, changeField: function(field, event) { @@ -33,7 +33,7 @@ define([ MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-subject-line'), { tooltipId: 'tooltip-designer-subject-line-ti', tooltip: MailPoet.I18n.t('helpTooltipDesignerSubjectLine'), - place: "right" + place: 'right' }); MailPoet.helpTooltip.show(document.getElementById('tooltip-designer-preheader'), { tooltipId: 'tooltip-designer-preheader-ti', diff --git a/assets/js/src/newsletter_editor/components/save.js b/assets/js/src/newsletter_editor/components/save.js index 2493da14b8..5748c8e394 100644 --- a/assets/js/src/newsletter_editor/components/save.js +++ b/assets/js/src/newsletter_editor/components/save.js @@ -22,7 +22,7 @@ define([ html2canvas ) { - "use strict"; + 'use strict'; var Module = {}, saveTimeout; @@ -82,8 +82,8 @@ define([ // Removes 1px left transparent border from resulting canvas. var oldContext = oldCanvas.getContext('2d'), - newCanvas = document.createElement("canvas"), - newContext = newCanvas.getContext("2d"), + newCanvas = document.createElement('canvas'), + newContext = newCanvas.getContext('2d'), leftBorderWidth = 1; newCanvas.width = oldCanvas.width; @@ -300,8 +300,8 @@ define([ var contents = JSON.stringify(jsonObject); if (App.getConfig().get('validation.validateUnsubscribeLinkPresent') && - contents.indexOf("[link:subscription_unsubscribe_url]") < 0 && - contents.indexOf("[link:subscription_unsubscribe]") < 0) { + contents.indexOf('[link:subscription_unsubscribe_url]') < 0 && + contents.indexOf('[link:subscription_unsubscribe]') < 0) { this.showValidationError(MailPoet.I18n.t('unsubscribeLinkMissing')); return; } diff --git a/assets/js/src/newsletter_editor/components/sidebar.js b/assets/js/src/newsletter_editor/components/sidebar.js index ee2a053077..ed0f364dd9 100644 --- a/assets/js/src/newsletter_editor/components/sidebar.js +++ b/assets/js/src/newsletter_editor/components/sidebar.js @@ -20,7 +20,7 @@ define([ StickyKit ) { - "use strict"; + 'use strict'; var Module = {}; @@ -69,7 +69,7 @@ define([ 'slideUp', { duration: 250, - easing: "easeOut", + easing: 'easeOut', complete: function() { $openRegion.addClass('closed'); }.bind(this) @@ -81,7 +81,7 @@ define([ 'slideDown', { duration: 250, - easing: "easeIn", + easing: 'easeIn', complete: function() { $targetRegion.removeClass('closed'); } @@ -180,40 +180,40 @@ define([ }, events: function() { return { - "change #mailpoet_text_font_color": _.partial(this.changeColorField, 'text.fontColor'), - "change #mailpoet_text_font_family": function(event) { + 'change #mailpoet_text_font_color': _.partial(this.changeColorField, 'text.fontColor'), + 'change #mailpoet_text_font_family': function(event) { 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); }, - "change #mailpoet_h1_font_color": _.partial(this.changeColorField, 'h1.fontColor'), - "change #mailpoet_h1_font_family": function(event) { + 'change #mailpoet_h1_font_color': _.partial(this.changeColorField, 'h1.fontColor'), + 'change #mailpoet_h1_font_family': function(event) { 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); }, - "change #mailpoet_h2_font_color": _.partial(this.changeColorField, 'h2.fontColor'), - "change #mailpoet_h2_font_family": function(event) { + 'change #mailpoet_h2_font_color': _.partial(this.changeColorField, 'h2.fontColor'), + 'change #mailpoet_h2_font_family': function(event) { 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); }, - "change #mailpoet_h3_font_color": _.partial(this.changeColorField, 'h3.fontColor'), - "change #mailpoet_h3_font_family": function(event) { + 'change #mailpoet_h3_font_color': _.partial(this.changeColorField, 'h3.fontColor'), + 'change #mailpoet_h3_font_family': function(event) { 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); }, - "change #mailpoet_a_font_color": _.partial(this.changeColorField, 'link.fontColor'), - "change #mailpoet_a_font_underline": function(event) { + 'change #mailpoet_a_font_color': _.partial(this.changeColorField, 'link.fontColor'), + 'change #mailpoet_a_font_underline': function(event) { this.model.set('link.textDecoration', (event.target.checked) ? event.target.value : 'none'); }, - "change #mailpoet_newsletter_background_color": _.partial(this.changeColorField, 'wrapper.backgroundColor'), - "change #mailpoet_background_color": _.partial(this.changeColorField, 'body.backgroundColor') + 'change #mailpoet_newsletter_background_color': _.partial(this.changeColorField, 'wrapper.backgroundColor'), + 'change #mailpoet_background_color': _.partial(this.changeColorField, 'body.backgroundColor') }; }, templateContext: function() { diff --git a/assets/js/src/newsletter_editor/components/styles.js b/assets/js/src/newsletter_editor/components/styles.js index baf170c73a..2e5736785f 100644 --- a/assets/js/src/newsletter_editor/components/styles.js +++ b/assets/js/src/newsletter_editor/components/styles.js @@ -4,7 +4,7 @@ define([ 'backbone.supermodel' ], function(App, Marionette, SuperModel) { - "use strict"; + 'use strict'; var Module = {}; diff --git a/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js b/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js index f6407cc368..50704adab5 100644 --- a/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js +++ b/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js @@ -46,8 +46,8 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function(editor, url) { // Open window editor.windowManager.open({ - height: parseInt(editor.getParam("plugin_mailpoet_shortcodes_height", 400)), - width: parseInt(editor.getParam("plugin_mailpoet_shortcodes_width", 450)), + height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400)), + width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450)), autoScroll: true, title: editor.settings.mailpoet_shortcodes_window_title, body: shortcodes, diff --git a/assets/js/src/notice.js b/assets/js/src/notice.js index 5cd7f72b8c..26dbde4a0f 100644 --- a/assets/js/src/notice.js +++ b/assets/js/src/notice.js @@ -1,5 +1,5 @@ define('notice', ['mailpoet', 'jquery'], function(mp, jQuery) { - "use strict"; + 'use strict'; /*================================================================================================== MailPoet Notice: diff --git a/assets/js/src/subscribers/importExport/export.js b/assets/js/src/subscribers/importExport/export.js index f17c78273a..ae85fd187f 100644 --- a/assets/js/src/subscribers/importExport/export.js +++ b/assets/js/src/subscribers/importExport/export.js @@ -13,7 +13,7 @@ define( Handlebars, select2 ) { - if (!jQuery("#mailpoet_subscribers_export").length) { + if (!jQuery('#mailpoet_subscribers_export').length) { return; } jQuery(document).ready(function () { @@ -27,11 +27,11 @@ define( jQuery('#mailpoet_subscribers_export > div.inside').html(subscribers_export_template(exportData)); // define reusable variables - var segmentsContainerElement = jQuery("#export_lists"), - subscriberFieldsContainerElement = jQuery("#export_columns"), + var segmentsContainerElement = jQuery('#export_lists'), + subscriberFieldsContainerElement = jQuery('#export_columns'), exportConfirmedOptionElement = jQuery(':radio[name="option_confirmed"]'), groupBySegmentOptionElement = jQuery(':checkbox[name="option_group_by_list"]'), - nextStepButton = jQuery("a.mailpoet_export_process"), + nextStepButton = jQuery('a.mailpoet_export_process'), renderSegmentsAndFields = function (container, data) { if (container.data('select2')) { container @@ -107,7 +107,7 @@ define( 'first_name', 'last_name', 'status' - ]).trigger("change"); + ]).trigger('change'); exportConfirmedOptionElement.change(function () { var selectedSegments = segmentsContainerElement.val(); @@ -144,7 +144,7 @@ define( data: JSON.stringify({ 'export_confirmed_option': exportData.exportConfirmedOption, '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, 'subscriber_fields': subscriberFieldsContainerElement.val() }) diff --git a/assets/js/src/subscribers/importExport/import.js b/assets/js/src/subscribers/importExport/import.js index bc251997f5..f862d204c4 100644 --- a/assets/js/src/subscribers/importExport/import.js +++ b/assets/js/src/subscribers/importExport/import.js @@ -112,7 +112,7 @@ define( * Paste */ pasteInputElement - .attr('value', pasteInputPlaceholderElement).css('color', "#999") + .attr('value', pasteInputPlaceholderElement).css('color', '#999') .focus(function () { if (jQuery(this).val() === pasteInputPlaceholderElement) { jQuery(this).attr('value', '').css('color', '#222'); @@ -120,7 +120,7 @@ define( }) .blur(function () { if (jQuery(this).val() === '') { - jQuery(this).attr('value', pasteInputPlaceholderElement).css('color', "#999"); + jQuery(this).attr('value', pasteInputPlaceholderElement).css('color', '#999'); } }) .keyup(function () { @@ -378,7 +378,7 @@ define( processedSubscribers[0] = rowData; } } - else if (rowData[emailColumnPosition] !== "") { + else if (rowData[emailColumnPosition] !== '') { var email = detectAndCleanupEmail(rowData[emailColumnPosition]); if (_.has(parsedEmails, email)) { duplicateEmails.push(email); @@ -512,7 +512,7 @@ define( var details = jQuery('.mailpoet_subscribers_data_parse_results_details'); jQuery(details).toggle(); this.text = - (jQuery(details).is(":visible")) + (jQuery(details).is(':visible')) ? MailPoet.I18n.t('hideDetails') : MailPoet.I18n.t('showDetails'); }); @@ -626,7 +626,7 @@ define( // register partial template that will contain subscribers data Handlebars.registerPartial( - "subscribers_data_template_partial", + 'subscribers_data_template_partial', subscribersDataTemplatePartial );