Skip to content

Commit c0a1d05

Browse files
committed
tempate literals
1 parent 0841fec commit c0a1d05

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

chrome/src/options/options.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ function initOptions (defaultOptions) {
1818
var optionsWrapper = document.getElementById('options')
1919

2020
for (var key in options) {
21-
html = '<div class=\'option\'><label>' + key + '</label>'
22-
html += '<p class=\'description\'>' + options[key].description + '<br><span class=\'help\'>*' + options[key].hint + '</span></p>'
23-
html += '<input name=\'' + key + '\' value=\'' + options[key].val +'\' type=\'text\' /></div>'
24-
optionsWrapper.innerHTML += html
21+
optionsWrapper.innerHTML += `
22+
<div class="option"><label>${key}</label>
23+
<p class="description">${options[key].description}<br><span class="help">*${options[key].hint}</span></p>
24+
<input name="${key}" value="${options[key].val}" type="text"></div>
25+
`
2526
}
2627

2728
for(const el of document.querySelectorAll('[name="Shortcut"], [name="BackgroundShortcut"], [name="MuteShortcut"]')) {
@@ -30,7 +31,7 @@ function initOptions (defaultOptions) {
3031
code = ''
3132
keys = ['shift', 'alt', 'meta', 'ctrl']
3233
keys.map(function(key) {
33-
if( eval('e.' + key + 'Key' ) ) { code += key + " + " }
34+
if( eval(`e.${key}Key` ) ) { code += `${key} + ` }
3435
})
3536
code += e.keyCode
3637
el.value = code

0 commit comments

Comments
 (0)