Fix func-names rule in es5

Please remove those comments if you work on those files
[MAILPOET-1143]
This commit is contained in:
Pavel Dohnal
2018-01-08 14:56:00 +00:00
parent 7465398d17
commit 699017532e
53 changed files with 301 additions and 286 deletions

View File

@@ -1,3 +1,5 @@
'use strict';
/**
* Text content block
*/
@@ -6,14 +8,12 @@ define([
'newsletter_editor/blocks/base',
'underscore',
'mailpoet'
], function (App, BaseBlock, _, MailPoet) {
'use strict';
], function (App, BaseBlock, _, MailPoet) { // eslint-disable-line func-names
var Module = {};
var base = BaseBlock;
Module.TextBlockModel = base.BlockModel.extend({
defaults: function () {
defaults: function () { // eslint-disable-line func-names
return this._getDefaults({
type: 'text',
text: 'Edit this to insert text'
@@ -23,7 +23,7 @@ define([
Module.TextBlockView = base.BlockView.extend({
className: 'mailpoet_block mailpoet_text_block mailpoet_droppable_block',
getTemplate: function () { return window.templates.textBlock; },
getTemplate: function () { return window.templates.textBlock; }, // eslint-disable-line func-names
modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), // Prevent rerendering on model change due to text editor redrawing
behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
TextEditorBehavior: {
@@ -33,7 +33,7 @@ define([
invalidElements: 'script',
blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p',
plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste',
configurationFilter: function (originalSettings) {
configurationFilter: function (originalSettings) { // eslint-disable-line func-names
return _.extend({}, originalSettings, {
mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle')
@@ -41,7 +41,7 @@ define([
}
}
}),
initialize: function (options) {
initialize: function (options) { // eslint-disable-line func-names
base.BlockView.prototype.initialize.apply(this, arguments);
this.renderOptions = _.defaults(options.renderOptions || {}, {
@@ -50,8 +50,8 @@ define([
this.disableTextEditor = this.renderOptions.disableTextEditor;
},
onDragSubstituteBy: function () { return Module.TextWidgetView; },
onRender: function () {
onDragSubstituteBy: function () { return Module.TextWidgetView; }, // eslint-disable-line func-names
onRender: function () { // eslint-disable-line func-names
this.toolsView = new Module.TextBlockToolsView({
model: this.model,
tools: {
@@ -60,40 +60,40 @@ define([
});
this.showChildView('toolsRegion', this.toolsView);
},
onTextEditorChange: function (newContent) {
onTextEditorChange: function (newContent) { // eslint-disable-line func-names
this.model.set('text', newContent);
},
onTextEditorFocus: function () {
onTextEditorFocus: function () { // eslint-disable-line func-names
this.disableDragging();
this.disableShowingTools();
},
onTextEditorBlur: function () {
onTextEditorBlur: function () { // eslint-disable-line func-names
this.enableDragging();
this.enableShowingTools();
}
});
Module.TextBlockToolsView = base.BlockToolsView.extend({
getSettingsView: function () { return Module.TextBlockSettingsView; }
getSettingsView: function () { return Module.TextBlockSettingsView; } // eslint-disable-line func-names
});
Module.TextBlockSettingsView = base.BlockSettingsView.extend({
getTemplate: function () { return window.templates.textBlockSettings; }
getTemplate: function () { return window.templates.textBlockSettings; } // eslint-disable-line func-names
});
Module.TextWidgetView = base.WidgetView.extend({
getTemplate: function () { return window.templates.textInsertion; },
getTemplate: function () { return window.templates.textInsertion; }, // eslint-disable-line func-names
behaviors: {
DraggableBehavior: {
cloneOriginal: true,
drop: function () {
drop: function () { // eslint-disable-line func-names
return new Module.TextBlockModel();
}
}
}
});
App.on('before:start', function (BeforeStartApp) {
App.on('before:start', function (BeforeStartApp) { // eslint-disable-line func-names
BeforeStartApp.registerBlockType('text', {
blockModel: Module.TextBlockModel,
blockView: Module.TextBlockView