From d195890eb957e5b6e40f7c01ce34d07e7ccf22b5 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 26 Nov 2017 11:37:25 +0900 Subject: rename serach engine --- .../components/form/search-engine-form.jsx | 73 ---------------------- .../components/form/search-engine-form.scss | 26 -------- src/settings/components/form/search-form.jsx | 73 ++++++++++++++++++++++ src/settings/components/form/search-form.scss | 26 ++++++++ src/settings/components/index.jsx | 4 +- 5 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 src/settings/components/form/search-engine-form.jsx delete mode 100644 src/settings/components/form/search-engine-form.scss create mode 100644 src/settings/components/form/search-form.jsx create mode 100644 src/settings/components/form/search-form.scss (limited to 'src') diff --git a/src/settings/components/form/search-engine-form.jsx b/src/settings/components/form/search-engine-form.jsx deleted file mode 100644 index faa066f..0000000 --- a/src/settings/components/form/search-engine-form.jsx +++ /dev/null @@ -1,73 +0,0 @@ -import './search-engine-form.scss'; -import { h, Component } from 'preact'; -import AddButton from '../ui/add-button'; -import DeleteButton from '../ui/delete-button'; - -class SearchEngineForm extends Component { - - render() { - let value = this.props.value; - if (!value) { - value = { default: '', engines: []}; - } - let { - default: defaultEngine, - engines - } = value; - - return
-
-
Name
-
URL
-
Default
-
- { - engines.map((engine, index) => { - return
- - -
- - -
-
; - }) - } - -
; - } - - bindValue(e) { - if (!this.props.onChange) { - return; - } - - let name = e.target.name; - let index = e.target.getAttribute('data-index'); - let next = Object.assign({}, this.props.value); - - if (name === 'name') { - next.engines[index][0] = e.target.value; - } else if (name === 'url') { - next.engines[index][1] = e.target.value; - } else if (name === 'default') { - next.default = this.props.value.engines[index][0]; - } else if (name === 'add') { - next.engines.push(['', '']); - } else if (name === 'delete') { - next.engines.splice(index, 1); - } - - this.props.onChange(next); - } -} - -export default SearchEngineForm; diff --git a/src/settings/components/form/search-engine-form.scss b/src/settings/components/form/search-engine-form.scss deleted file mode 100644 index 0d33c23..0000000 --- a/src/settings/components/form/search-engine-form.scss +++ /dev/null @@ -1,26 +0,0 @@ -.form-search-engine-form { - @mixin row-base { - display: flex; - - .column-name { - flex: 1; - } - .column-url { - flex: 5; - } - .column-option { - text-align: right; - flex-basis: 5rem; - } - } - - &-header { - @include row-base; - - font-weight: bold; - } - - &-row { - @include row-base; - } -} diff --git a/src/settings/components/form/search-form.jsx b/src/settings/components/form/search-form.jsx new file mode 100644 index 0000000..9bafb8d --- /dev/null +++ b/src/settings/components/form/search-form.jsx @@ -0,0 +1,73 @@ +import './search-form.scss'; +import { h, Component } from 'preact'; +import AddButton from '../ui/add-button'; +import DeleteButton from '../ui/delete-button'; + +class SearchForm extends Component { + + render() { + let value = this.props.value; + if (!value) { + value = { default: '', engines: []}; + } + let { + default: defaultEngine, + engines + } = value; + + return
+
+
Name
+
URL
+
Default
+
+ { + engines.map((engine, index) => { + return
+ + +
+ + +
+
; + }) + } + +
; + } + + bindValue(e) { + if (!this.props.onChange) { + return; + } + + let name = e.target.name; + let index = e.target.getAttribute('data-index'); + let next = Object.assign({}, this.props.value); + + if (name === 'name') { + next.engines[index][0] = e.target.value; + } else if (name === 'url') { + next.engines[index][1] = e.target.value; + } else if (name === 'default') { + next.default = this.props.value.engines[index][0]; + } else if (name === 'add') { + next.engines.push(['', '']); + } else if (name === 'delete') { + next.engines.splice(index, 1); + } + + this.props.onChange(next); + } +} + +export default SearchForm; diff --git a/src/settings/components/form/search-form.scss b/src/settings/components/form/search-form.scss new file mode 100644 index 0000000..8814ef5 --- /dev/null +++ b/src/settings/components/form/search-form.scss @@ -0,0 +1,26 @@ +.form-search-form { + @mixin row-base { + display: flex; + + .column-name { + flex: 1; + } + .column-url { + flex: 5; + } + .column-option { + text-align: right; + flex-basis: 5rem; + } + } + + &-header { + @include row-base; + + font-weight: bold; + } + + &-row { + @include row-base; + } +} diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx index ae7cd31..b7de259 100644 --- a/src/settings/components/index.jsx +++ b/src/settings/components/index.jsx @@ -1,7 +1,7 @@ import './site.scss'; import { h, Component } from 'preact'; import Input from './ui/input'; -import SearchEngineForm from './form/search-engine-form'; +import SearchForm from './form/search-form'; import KeymapsForm from './form/keymaps-form'; import BlacklistForm from './form/blacklist-form'; import * as settingActions from 'settings/actions/setting'; @@ -49,7 +49,7 @@ class SettingsComponent extends Component {
Search Engines - this.bindForm('search', value)} /> -- cgit v1.2.3