Commit ce86d43e authored by Tino Goratsch's avatar Tino Goratsch

extend the ESLint configuration and fix some more ESLint errors

parent ae5691e3
......@@ -5,6 +5,7 @@ ACP3/Modules/ACP3/System/Resources/Assets/js/bootbox.js
ACP3/Modules/ACP3/System/Resources/Assets/js/dataTables.bootstrap.js
ACP3/Modules/ACP3/System/Resources/Assets/js/js.cookie.js
ACP3/Modules/ACP3/System/Resources/Assets/js/jquery.dataTables.js
build/*
cache/*
vendor/*
uploads/*
{
"env": {
"browser": true,
"jquery": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
"env": {
"browser": true,
"jquery": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"grecaptcha": true,
"bootbox": true,
"Cookies": true
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-unused-vars": [
"error",
{
"vars": "local"
}
],
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
}
}
]
}
}
......@@ -22,33 +22,33 @@ jQuery(document).ready(function ($) {
// Seitentyp
$mode.change(function () {
var mode = this.value;
var mode = parseInt(this.value);
if (mode == 1) {
if (mode === 1) {
$module.show();
$hints.hide();
$link.hide();
$articles.hide();
// Modul im Dropdown-Menü selektieren, falls zuvor als Modus eine dynamische Seite aktiv war
if (currentMode == 2) {
if (currentMode === 2) {
var $linkUri = $('#uri'),
match = $linkUri.val().match(/^([a-z\d_\-]+)\/([a-z\d_\-]+\/)+$/);
match = $linkUri.val().match(/^([a-z\d_-]+)\/([a-z\d_-]+\/)+$/);
if (!$linkUri.val().match(articlesPattern) && match[1] != null && $('#module').find('option[value="' + match[1] + '"]').length > 0) {
$('#link-module').val(match[1]);
}
}
} else if (mode == 2) {
} else if (mode === 2) {
$module.hide();
$hints.show();
$link.show();
$articles.hide();
} else if (mode == 3) {
} else if (mode === 3) {
$module.hide();
$hints.hide();
$link.show();
$articles.hide();
} else if (mode == 4) {
} else if (mode === 4) {
$module.hide();
$hints.hide();
$link.hide();
......
......@@ -52,7 +52,7 @@
$(that.settings.aliasElement).val(responseData.alias);
}
} catch (err) {
console.log(err.message);
console.error(err.message);
} finally {
$(that.element).removeClass('disabled');
}
......
......@@ -180,7 +180,7 @@
self.hideLoadingLayer($submitButton);
} catch (err) {
console.log(err.message);
console.error(err.message);
self.hideLoadingLayer($submitButton);
}
......
/* global wysiwygCallback */
jQuery(document).ready(function ($) {
$('#page-break-form').find('.modal-footer button.btn-primary').click(function (e) {
e.preventDefault();
......@@ -14,4 +16,4 @@ jQuery(document).ready(function ($) {
wysiwygCallback(text);
$('#page-break-form').modal('hide');
});
});
\ No newline at end of file
});
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