Fix: i18n config dialog

This commit is contained in:
eight 2017-09-12 01:59:56 +08:00
parent 381ee88e94
commit 20481c9180
2 changed files with 12 additions and 2 deletions

View File

@ -7,6 +7,10 @@
"message": "Add Style", "message": "Add Style",
"description": "Title of the page for adding styles" "description": "Title of the page for adding styles"
}, },
"alphaChannel": {
"message": "Alpha channel",
"description": "Label of alpha channel input"
},
"appliesAdd": { "appliesAdd": {
"message": "Add", "message": "Add",
"description": "Label for the button to add an 'applies' entry" "description": "Label for the button to add an 'applies' entry"

View File

@ -33,8 +33,14 @@ function configDialog(style) {
let appendChild; let appendChild;
if (va.type === 'color') { if (va.type === 'color') {
va.inputColor = $element({tag: 'input', type: 'color'}); va.inputColor = $element({tag: 'input', type: 'color'});
// FIXME: i18n va.inputAlpha = $element({
va.inputAlpha = $element({tag: 'input', type: 'range', min: 0, max: 1, title: 'Opacity', step: 'any'}); tag: 'input',
type: 'range',
min: 0,
max: 1,
title: chrome.i18n.getMessage('alphaChannel'),
step: 'any'
});
va.inputColor.onchange = va.inputAlpha.oninput = () => { va.inputColor.onchange = va.inputAlpha.oninput = () => {
va.dirty = true; va.dirty = true;
const color = colorParser.parse(va.inputColor.value); const color = colorParser.parse(va.inputColor.value);