aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components/form
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/components/form')
-rw-r--r--src/settings/components/form/BlacklistForm.tsx6
-rw-r--r--src/settings/components/form/KeymapsForm.tsx4
-rw-r--r--src/settings/components/form/PartialBlacklistForm.tsx10
-rw-r--r--src/settings/components/form/PropertiesForm.tsx10
-rw-r--r--src/settings/components/form/SearchForm.tsx12
5 files changed, 21 insertions, 21 deletions
diff --git a/src/settings/components/form/BlacklistForm.tsx b/src/settings/components/form/BlacklistForm.tsx
index 4e96cbf..51c32f4 100644
--- a/src/settings/components/form/BlacklistForm.tsx
+++ b/src/settings/components/form/BlacklistForm.tsx
@@ -43,9 +43,9 @@ class BlacklistForm extends React.Component<Props> {
}
bindValue(e: any) {
- let name = e.target.name;
- let index = e.target.getAttribute('data-index');
- let items = this.props.value.items;
+ const name = e.target.name;
+ const index = e.target.getAttribute('data-index');
+ const items = this.props.value.items;
if (name === 'url') {
items[index] = new BlacklistItem(e.target.value, false, []);
diff --git a/src/settings/components/form/KeymapsForm.tsx b/src/settings/components/form/KeymapsForm.tsx
index 94934ae..dc74de3 100644
--- a/src/settings/components/form/KeymapsForm.tsx
+++ b/src/settings/components/form/KeymapsForm.tsx
@@ -18,14 +18,14 @@ class KeymapsForm extends React.Component<Props> {
};
render() {
- let values = this.props.value.toJSON();
+ const values = this.props.value.toJSON();
return <div className='form-keymaps-form'>
{
keymaps.fields.map((group, index) => {
return <div key={index} className='form-keymaps-form-field-group'>
{
group.map(([name, label]) => {
- let value = values[name] || '';
+ const value = values[name] || '';
return <Input
type='text' id={name} name={name} key={name}
label={label} value={value}
diff --git a/src/settings/components/form/PartialBlacklistForm.tsx b/src/settings/components/form/PartialBlacklistForm.tsx
index 0702913..1807e28 100644
--- a/src/settings/components/form/PartialBlacklistForm.tsx
+++ b/src/settings/components/form/PartialBlacklistForm.tsx
@@ -52,15 +52,15 @@ class PartialBlacklistForm extends React.Component<Props> {
}
bindValue(e: any) {
- let name = e.target.name;
- let index = e.target.getAttribute('data-index');
- let items = this.props.value.items;
+ const name = e.target.name;
+ const index = e.target.getAttribute('data-index');
+ const items = this.props.value.items;
if (name === 'url') {
- let current = items[index];
+ const current = items[index];
items[index] = new BlacklistItem(e.target.value, true, current.keys);
} else if (name === 'keys') {
- let current = items[index];
+ const current = items[index];
items[index] = new BlacklistItem(
current.pattern, true, e.target.value.split(','));
} else if (name === 'add') {
diff --git a/src/settings/components/form/PropertiesForm.tsx b/src/settings/components/form/PropertiesForm.tsx
index db8c8e5..e648971 100644
--- a/src/settings/components/form/PropertiesForm.tsx
+++ b/src/settings/components/form/PropertiesForm.tsx
@@ -17,13 +17,13 @@ class PropertiesForm extends React.Component<Props> {
};
render() {
- let types = this.props.types;
- let values = this.props.value;
+ const types = this.props.types;
+ const values = this.props.value;
return <div className='form-properties-form'>
{
Object.keys(types).map((name) => {
- let type = types[name];
+ const type = types[name];
let inputType = '';
let onChange = this.bindValue.bind(this);
if (type === 'string') {
@@ -59,8 +59,8 @@ class PropertiesForm extends React.Component<Props> {
}
bindValue(e: React.ChangeEvent<HTMLInputElement>) {
- let name = e.target.name;
- let next = { ...this.props.value };
+ const name = e.target.name;
+ const next = { ...this.props.value };
if (e.target.type.toLowerCase() === 'checkbox') {
next[name] = e.target.checked;
} else if (e.target.type.toLowerCase() === 'number') {
diff --git a/src/settings/components/form/SearchForm.tsx b/src/settings/components/form/SearchForm.tsx
index 0aaf6fd..5dc786b 100644
--- a/src/settings/components/form/SearchForm.tsx
+++ b/src/settings/components/form/SearchForm.tsx
@@ -18,7 +18,7 @@ class SearchForm extends React.Component<Props> {
};
render() {
- let value = this.props.value.toJSON();
+ const value = this.props.value.toJSON();
return <div className='form-search-form'>
<div className='form-search-form-header'>
<div className='column-name'>Name</div>
@@ -56,10 +56,10 @@ class SearchForm extends React.Component<Props> {
// eslint-disable-next-line max-statements
bindValue(e: any) {
- let value = this.props.value.toJSON();
- let name = e.target.name;
- let index = Number(e.target.getAttribute('data-index'));
- let next: typeof value = {
+ const value = this.props.value.toJSON();
+ const name = e.target.name;
+ const index = Number(e.target.getAttribute('data-index'));
+ const next: typeof value = {
default: value.default,
engines: value.engines.slice(),
};
@@ -76,7 +76,7 @@ class SearchForm extends React.Component<Props> {
} else if (name === 'delete' && value.engines.length > 1) {
next.engines.splice(index, 1);
if (value.engines[index][0] === value.default) {
- let nextIndex = Math.min(index, next.engines.length - 1);
+ const nextIndex = Math.min(index, next.engines.length - 1);
next.default = next.engines[nextIndex][0];
}
}