aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-08-05 12:51:46 +0000
committerGitHub <noreply@github.com>2018-08-05 12:51:46 +0000
commit2795025d0a6b002ea68b4905f5d73c32e7773fc1 (patch)
tree88ed345092600796defe4ce98a31e9f755772026 /src
parent8ea004f629021a0fb5fcbce9398f2cf2f952938a (diff)
parentfddb4914ad3b126cb18395c30eca6be5805460c3 (diff)
Merge pull request #444 from ueokande/qa-0.16
QA 0.16
Diffstat (limited to 'src')
-rw-r--r--src/background/usecases/link.js2
-rw-r--r--src/settings/components/index.jsx9
-rw-r--r--src/settings/reducers/setting.js3
-rw-r--r--src/shared/settings/default.js9
-rw-r--r--src/shared/settings/properties.js2
-rw-r--r--src/shared/settings/validator.js2
6 files changed, 17 insertions, 10 deletions
diff --git a/src/background/usecases/link.js b/src/background/usecases/link.js
index 1339fdf..af152fe 100644
--- a/src/background/usecases/link.js
+++ b/src/background/usecases/link.js
@@ -15,7 +15,7 @@ export default class LinkInteractor {
let settings = await this.settingRepository.get();
let { adjacenttab } = settings.properties;
if (adjacenttab) {
- return this.tabPresenter.create(url, {
+ return this.tabPresenter.createAdjacent(url, {
openerTabId: openerId, active: !background
});
}
diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx
index 66dc940..9633359 100644
--- a/src/settings/components/index.jsx
+++ b/src/settings/components/index.jsx
@@ -68,6 +68,7 @@ class SettingsComponent extends Component {
render() {
let fields = null;
+ let disabled = this.props.error.length > 0;
if (this.props.source === 'form') {
fields = this.renderFormFields(this.props.form);
} else if (this.props.source === 'json') {
@@ -84,7 +85,8 @@ class SettingsComponent extends Component {
label='Use form'
checked={this.props.source === 'form'}
value='form'
- onChange={this.bindSource.bind(this)} />
+ onChange={this.bindSource.bind(this)}
+ disabled={disabled} />
<Input
type='radio'
@@ -92,8 +94,8 @@ class SettingsComponent extends Component {
label='Use plain JSON'
checked={this.props.source === 'json'}
value='json'
- onChange={this.bindSource.bind(this)} />
-
+ onChange={this.bindSource.bind(this)}
+ disabled={disabled} />
{ fields }
</form>
</div>
@@ -128,6 +130,7 @@ class SettingsComponent extends Component {
} else if (from === 'json' && to === 'form') {
let b = window.confirm(DO_YOU_WANT_TO_CONTINUE);
if (!b) {
+ this.forceUpdate();
return;
}
this.props.dispatch(settingActions.switchToForm(this.props.json));
diff --git a/src/settings/reducers/setting.js b/src/settings/reducers/setting.js
index 8e4a415..54033aa 100644
--- a/src/settings/reducers/setting.js
+++ b/src/settings/reducers/setting.js
@@ -14,11 +14,10 @@ export default function reducer(state = defaultState, action = {}) {
source: action.source,
json: action.json,
form: action.form,
- errors: '',
error: '', };
case actions.SETTING_SHOW_ERROR:
return { ...state,
- error: action.text,
+ error: action.error,
json: action.json, };
case actions.SETTING_SWITCH_TO_FORM:
return { ...state,
diff --git a/src/shared/settings/default.js b/src/shared/settings/default.js
index a435099..55dbc3a 100644
--- a/src/shared/settings/default.js
+++ b/src/shared/settings/default.js
@@ -40,7 +40,7 @@ export default {
"zi": { "type": "zoom.in" },
"zo": { "type": "zoom.out" },
"zz": { "type": "zoom.neutral" },
- "f": { "type": "follow.start", "newTab": false, "background": false },
+ "f": { "type": "follow.start", "newTab": false },
"F": { "type": "follow.start", "newTab": true, "background": false },
"H": { "type": "navigate.history.prev" },
"L": { "type": "navigate.history.next" },
@@ -70,6 +70,11 @@ export default {
}
},
"properties": {
- }
+ "hintchars": "abcdefghijklmnopqrstuvwxyz",
+ "smoothscroll": false,
+ "adjacenttab": true
+ },
+ "blacklist": [
+ ]
}`,
};
diff --git a/src/shared/settings/properties.js b/src/shared/settings/properties.js
index b392cbb..e8d06da 100644
--- a/src/shared/settings/properties.js
+++ b/src/shared/settings/properties.js
@@ -16,7 +16,7 @@ const defaults = {
};
const docs = {
- hintchars: 'Hint characters on follow mode',
+ hintchars: 'hint characters on follow mode',
smoothscroll: 'smooth scroll',
adjacenttab: 'open adjacent tabs',
};
diff --git a/src/shared/settings/validator.js b/src/shared/settings/validator.js
index 1589420..a800a52 100644
--- a/src/shared/settings/validator.js
+++ b/src/shared/settings/validator.js
@@ -27,7 +27,7 @@ const validateKeymaps = (keymaps) => {
const validateSearch = (search) => {
let engines = search.engines;
for (let key of Object.keys(engines)) {
- if (/\s/.test(key)) {
+ if ((/\s/).test(key)) {
throw new Error(
`While space in search engine name is not allowed: "${key}"`
);