Skip to content

Commit

Permalink
Merge pull request #34 from snowsunny/bugfix
Browse files Browse the repository at this point in the history
bugfix content script for rate, pitch, volume
  • Loading branch information
snowsunny authored Feb 24, 2020
2 parents ef0187c + e80ef5a commit 216b54a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion novels-reader-crx/content.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions novels-reader-crx/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2 class="subtitle">web page reader for syosetu.com</h2>
<div class="field">
<label class="label">速度</label>
<div class="control">
<input class="input" name="rate" type="number" step="0.1" min="0.1" max="10" placeholder="例: 1">
<input class="input" name="rate" type="number" step="0.01" min="0.1" max="10" placeholder="例: 1">
</div>
<p class="help">初期値: 1.0, 最小値: 0.1, 最大値: 10.0</p>
</div>
Expand All @@ -71,7 +71,7 @@ <h2 class="subtitle">web page reader for syosetu.com</h2>
<div class="field">
<label class="label">ピッチ</label>
<div class="control">
<input class="input" name="pitch" type="number" step="0.1" min="0" max="2" placeholder="例: 1">
<input class="input" name="pitch" type="number" step="0.01" min="0" max="2" placeholder="例: 1">
</div>
<p class="help">声の高さを設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 2.0</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ initializeData().then(() => {
}

let roudokukaOptions = {}
if(options.rate != undefined) {
if(options.rate != undefined && options.rate != '') {
roudokukaOptions.rate = Number(options.rate)
}
if(options.pitch != undefined) {
if(options.pitch != undefined && options.pitch != '') {
roudokukaOptions.pitch = Number(options.pitch)
}
if(options.volume != undefined) {
if(options.volume != undefined && options.volume != '') {
roudokukaOptions.volume = Number(options.volume)
}
if(options.voiceType != undefined && options.voiceType != -1) {
Expand Down
4 changes: 2 additions & 2 deletions src/pug/options.pug
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ html
.field
label.label 速度
.control
input.input(name='rate' type='number', step='0.1', min='0.1', max='10', placeholder='例: 1')
input.input(name='rate' type='number', step='0.01', min='0.1', max='10', placeholder='例: 1')
p.help 初期値: 1.0, 最小値: 0.1, 最大値: 10.0
.column
.field
label.label ピッチ
.control
input.input(name='pitch' type='number', step='0.1', min='0', max='2', placeholder='例: 1')
input.input(name='pitch' type='number', step='0.01', min='0', max='2', placeholder='例: 1')
p.help 声の高さを設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 2.0
.column
.field
Expand Down

0 comments on commit 216b54a

Please sign in to comment.