Commit 7fbb5e99 authored by xjm's avatar xjm
Browse files

Issue #2916294 by dawehner: JS codestyle: no-useless-escape

parent ff6381f7
{
"extends": "./.eslintrc.json",
"rules": {
"no-useless-escape": "off",
"no-use-before-define": "off",
"no-throw-literal": "off",
"no-shadow": "off",
......
......@@ -144,7 +144,7 @@
// should be returned to the same state it was in before the columns
// were revealed, so it is necessary to remove the display none value
// from the style attribute.
const match = /^display\s*\:\s*none$/;
const match = /^display\s*:\s*none$/;
for (let i = 0; i < properties.length; i++) {
const prop = properties[i];
prop.trim();
......
......@@ -79,7 +79,7 @@
var properties = $cell.attr('style').split(';');
var newProps = [];
var match = /^display\s*\:\s*none$/;
var match = /^display\s*:\s*none$/;
for (var i = 0; i < properties.length; i++) {
var prop = properties[i];
prop.trim();
......
......@@ -194,7 +194,7 @@
.find('input')
.addClass('error')
.attr('aria-invalid', 'true');
$(`<div class=\"description\" >${Drupal.t('Please provide a name for the button group.')}</div>`).insertAfter(form.elements[0]);
$(`<div class="description" >${Drupal.t('Please provide a name for the button group.')}</div>`).insertAfter(form.elements[0]);
}
return true;
}
......
......@@ -23,7 +23,7 @@
.on('change', function () {
// If the filename is fully the language code or the filename
// ends with a language code, pre-select that one.
const matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/);
const matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/);
if (matches && $langcode.find(`option[value="${matches[2]}"]`).length) {
$langcode.val(matches[2]);
}
......
......@@ -12,7 +12,7 @@
if ($form.length) {
var $langcode = $form.find('.langcode-input');
$form.find('.file-import-input').on('change', function () {
var matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/);
var matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/);
if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) {
$langcode.val(matches[2]);
}
......
......@@ -92,7 +92,7 @@
const fieldModel = this.fieldModel;
// Generate a DOM-compatible ID for the form container DOM element.
const id = `quickedit-form-for-${fieldModel.id.replace(/[\/\[\]]/g, '_')}`;
const id = `quickedit-form-for-${fieldModel.id.replace(/[/[\]]/g, '_')}`;
// Render form container.
const $formContainer = $(Drupal.theme('quickeditFormContainer', {
......
......@@ -57,7 +57,7 @@
loadForm: function loadForm() {
var fieldModel = this.fieldModel;
var id = 'quickedit-form-for-' + fieldModel.id.replace(/[\/\[\]]/g, '_');
var id = 'quickedit-form-for-' + fieldModel.id.replace(/[/[\]]/g, '_');
var $formContainer = $(Drupal.theme('quickeditFormContainer', {
id: id,
......
......@@ -185,7 +185,7 @@
save() {
const fieldModel = this.fieldModel;
const editorModel = this.model;
const backstageId = `quickedit_backstage-${this.fieldModel.id.replace(/[\/\[\]\_\s]/g, '-')}`;
const backstageId = `quickedit_backstage-${this.fieldModel.id.replace(/[/[\]_\s]/g, '-')}`;
function fillAndSubmitForm(value) {
const $form = $(`#${backstageId}`).find('form');
......
......@@ -73,7 +73,7 @@
save: function save() {
var fieldModel = this.fieldModel;
var editorModel = this.model;
var backstageId = 'quickedit_backstage-' + this.fieldModel.id.replace(/[\/\[\]\_\s]/g, '-');
var backstageId = 'quickedit_backstage-' + this.fieldModel.id.replace(/[/[\]_\s]/g, '-');
function fillAndSubmitForm(value) {
var $form = $('#' + backstageId).find('form');
......
......@@ -47,7 +47,7 @@
this.$root = this.$el;
// Generate a DOM-compatible ID for the form container DOM element.
this._id = `quickedit-toolbar-for-${this.model.id.replace(/[\/\[\]]/g, '_')}`;
this._id = `quickedit-toolbar-for-${this.model.id.replace(/[/[\]]/g, '_')}`;
this.listenTo(this.model, 'change:state', this.stateChange);
},
......
......@@ -19,7 +19,7 @@
this.$root = this.$el;
this._id = 'quickedit-toolbar-for-' + this.model.id.replace(/[\/\[\]]/g, '_');
this._id = 'quickedit-toolbar-for-' + this.model.id.replace(/[/[\]]/g, '_');
this.listenTo(this.model, 'change:state', this.stateChange);
},
......
......@@ -154,8 +154,8 @@
},
// HTML segments for tip layout.
template: {
link: '<a href=\"#close\" class=\"joyride-close-tip\">&times;</a>',
button: '<a href=\"#\" class=\"button button--primary joyride-next-tip\"></a>',
link: '<a href="#close" class="joyride-close-tip">&times;</a>',
button: '<a href="#" class="button button--primary joyride-next-tip"></a>',
},
});
this.model.set({ isActive: true, activeTour: $tour });
......
......@@ -71,8 +71,8 @@
},
template: {
link: '<a href=\"#close\" class=\"joyride-close-tip\">&times;</a>',
button: '<a href=\"#\" class=\"button button--primary joyride-next-tip\"></a>'
link: '<a href="#close" class="joyride-close-tip">&times;</a>',
button: '<a href="#" class="button button--primary joyride-next-tip"></a>'
}
});
this.model.set({ isActive: true, activeTour: $tour });
......
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