Skip to content

Commit

Permalink
Merge pull request #8 from snowsunny/add_volume_option
Browse files Browse the repository at this point in the history
add volume option
  • Loading branch information
snowsunny authored Jul 7, 2019
2 parents aeddb57 + 8f77f3e commit 417e019
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions novels-reader-crx/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -15778,6 +15778,10 @@ if ($('#novel_honbun').length) {
if (options.pitch != undefined) {
roudokukaOptions.pitch = Number(options.pitch);
}
console.log(options);
if (options.volume != undefined) {
roudokukaOptions.volume = Number(options.volume);
}
roudokukaOptions.onend = function (e, lineInfo) {
lineUnHighlight();
if (linesInfo[lineInfo.index + 1]) {
Expand Down
9 changes: 9 additions & 0 deletions novels-reader-crx/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ <h2 class="subtitle">web page reader for syosetu.com</h2>
<p class="help">声の高さを設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 2.0</p>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">音量</label>
<div class="control">
<input class="input" name="volume" type="number" step="0.01" min="0" max="1" placeholder="例: 1">
</div>
<p class="help">声の音量を設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 1.0</p>
</div>
</div>
</div>
<div class="title">ハイライト設定</div>
<div class="columns">
Expand Down
4 changes: 4 additions & 0 deletions src/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ if(options.rate != undefined) {
if(options.pitch != undefined) {
roudokukaOptions.pitch = Number(options.pitch)
}
console.log(options)
if(options.volume != undefined) {
roudokukaOptions.volume = Number(options.volume)
}
roudokukaOptions.onend = (e, lineInfo) => {
lineUnHighlight()
if(linesInfo[lineInfo.index + 1]) {
Expand Down
6 changes: 6 additions & 0 deletions src/pug/options.pug
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ html
.control
input.input(name='pitch' type='number', step='0.1', min='0', max='2', placeholder='例: 1')
p.help 声の高さを設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 2.0
.column
.field
label.label 音量
.control
input.input(name='volume' type='number', step='0.01', min='0', max='1', placeholder='例: 1')
p.help 声の音量を設定出来ます。 初期値: 1.0, 最小値: 0, 最大値: 1.0

.title ハイライト設定
.columns
Expand Down

0 comments on commit 417e019

Please sign in to comment.