Commit ae5691e3 authored by Tino Goratsch's avatar Tino Goratsch

fix most of the ESLint errors

parent 8c4beff1
......@@ -3,10 +3,10 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
;(function ($) {
"use strict";
(function ($) {
'use strict';
var pluginName = "suggestAlias",
var pluginName = 'suggestAlias',
defaults = {
prefix: '',
slugBaseElement: null,
......@@ -48,7 +48,7 @@
},
success: function (responseData) {
try {
if (typeof responseData.alias !== "undefined" && responseData.alias.length > 0) {
if (typeof responseData.alias !== 'undefined' && responseData.alias.length > 0) {
$(that.settings.aliasElement).val(responseData.alias);
}
} catch (err) {
......@@ -72,8 +72,8 @@
$.fn[pluginName] = function (options) {
return this.each(function () {
if (!$.data(this, "plugin_" + pluginName)) {
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
}
});
};
......
......@@ -3,10 +3,10 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
;(function ($, window, document) {
"use strict";
(function ($, window, document) {
'use strict';
var pluginName = "formSubmit",
var pluginName = 'formSubmit',
defaults = {
targetElement: '#content',
customFormData: null
......@@ -54,8 +54,8 @@
},
findSubmitButton: function () {
$(this.element).find(':submit').click(function () {
$(":submit", $(this).closest("form")).removeAttr("data-clicked");
$(this).attr("data-clicked", "true");
$(':submit', $(this).closest('form')).removeAttr('data-clicked');
$(this).attr('data-clicked', 'true');
});
},
preValidateForm: function (form) {
......@@ -75,7 +75,7 @@
for (var i = 0; i < form.elements.length; i++) {
field = form.elements[i];
if (field.nodeName !== "INPUT" && field.nodeName !== "TEXTAREA" && field.nodeName !== "SELECT") {
if (field.nodeName !== 'INPUT' && field.nodeName !== 'TEXTAREA' && field.nodeName !== 'SELECT') {
continue;
}
......@@ -160,7 +160,7 @@
window[callback](responseData);
} else {
if (responseData.redirect_url) {
if (typeof hash !== "undefined") {
if (typeof hash !== 'undefined') {
window.location.href = responseData.redirect_url + hash;
window.location.reload();
} else {
......@@ -173,7 +173,7 @@
$(self.settings.targetElement).html(responseData);
if (typeof hash !== "undefined") {
if (typeof hash !== 'undefined') {
window.location.hash = hash;
}
}
......@@ -216,7 +216,7 @@
$loadingLayer.addClass('loading-layer__active');
}
if (typeof $submitButton !== "undefined") {
if (typeof $submitButton !== 'undefined') {
$submitButton.prop('disabled', true);
}
},
......@@ -238,7 +238,7 @@
hideLoadingLayer: function ($submitButton) {
$('#loading-layer').removeClass('loading-layer__active');
if (typeof $submitButton !== "undefined") {
if (typeof $submitButton !== 'undefined') {
$submitButton.prop('disabled', false);
}
},
......@@ -291,8 +291,8 @@
$.fn[pluginName] = function (options) {
return this.each(function () {
if (!$.data(this, "plugin_" + pluginName)) {
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
}
});
};
......
......@@ -13,8 +13,8 @@ jQuery(document).ready(function ($) {
$datepickerStart.datetimepicker();
$datepickerEnd.datetimepicker();
$datepickerStart.on("dp.change", function (e) {
$datepickerEnd.data("DateTimePicker").minDate(e.date);
$datepickerStart.on('dp.change', function (e) {
$datepickerEnd.data('DateTimePicker').minDate(e.date);
});
$datepickerEnd.data('DateTimePicker').minDate(datepickers.startDefaultDate);
......
......@@ -30,25 +30,28 @@ jQuery.fn.highlightTableRow = function (checkboxName) {
var $this = $(this);
$this.parents('thead')
.next('tbody').find('tr:has(:checkbox)').click(function (e) {
var $tableRow = $(this),
$tbody = $tableRow.closest('tbody');
if (e.target.type !== 'checkbox') {
if (e.target.nodeName === 'A') {
return;
.next('tbody')
.find('tr:has(:checkbox)')
.click(
function (e) {
var $tableRow = $(this),
$tbody = $tableRow.closest('tbody');
if (e.target.type !== 'checkbox') {
if (e.target.nodeName === 'A') {
return;
}
var $elem = $('input[name="' + checkboxName + '[]"]', this);
$elem.prop('checked', !$elem.is(':checked'));
}
var $elem = $('input[name="' + checkboxName + '[]"]', this);
$elem.prop('checked', !$elem.is(':checked'));
}
$tableRow.toggleClass(cssClassName);
$tableRow.toggleClass(cssClassName);
// Alle Datensätze auf einer Seite wurden markiert
$this.prop('checked', ($tbody.find('input[name="' + checkboxName + '[]"]:visible').length === $tbody.find('tr.' + cssClassName + ':visible').length));
}
);
// Alle Datensätze auf einer Seite wurden markiert
$this.prop('checked', ($tbody.find('input[name="' + checkboxName + '[]"]:visible').length === $tbody.find('tr.' + cssClassName + ':visible').length));
}
);
return $this;
};
......@@ -86,7 +89,7 @@ jQuery.fn.deleteMarkedResults = function (options) {
if (result) {
var $form = $this.closest('form');
$form.formSubmit({ customFormData: data });
$form.formSubmit({customFormData: data});
$form.triggerHandler('submit');
}
});
......@@ -98,7 +101,7 @@ jQuery.fn.deleteMarkedResults = function (options) {
return $this;
};
jQuery(document).ready(function($) {
jQuery(document).ready(function ($) {
var $markAll = $('[data-mark-all-id]');
$markAll.each(function () {
......
......@@ -4,7 +4,7 @@
*/
module.exports = function (gulp) {
"use strict";
'use strict';
return function () {
var nodeBasePath = './node_modules',
......@@ -47,5 +47,5 @@ module.exports = function (gulp) {
}
return 0;
}
};
};
......@@ -4,7 +4,7 @@
*/
module.exports = function (gulp, plugins) {
"use strict";
'use strict';
return function () {
return gulp.src(
......@@ -22,8 +22,8 @@ module.exports = function (gulp, plugins) {
.pipe(plugins.plumber())
.pipe(plugins.less())
.pipe(plugins.rename(function (path) {
path.dirname = path.dirname.substring(0, path.dirname.length - 4) + 'css'
path.dirname = path.dirname.substring(0, path.dirname.length - 4) + 'css';
}))
.pipe(gulp.dest('./'));
}
};
};
......@@ -4,7 +4,7 @@
*/
module.exports = function (gulp) {
"use strict";
'use strict';
return function () {
// Watch all the .less files, then run the less task
......@@ -18,5 +18,5 @@ module.exports = function (gulp) {
{cwd: './'},
['less']
);
}
};
};
......@@ -4,7 +4,7 @@
*/
(function () {
"use strict";
'use strict';
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')();
......
......@@ -19,9 +19,9 @@ jQuery(document).ready(function ($) {
$.post(
ajaxUrl,
{
"db_host": $('#db-host').val(),
"db_user": $('#db-user').val(),
"db_password": $('#db-password').val()
'db_host': $('#db-host').val(),
'db_user': $('#db-user').val(),
'db_password': $('#db-password').val()
},
function (response) {
if (response.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment