diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index ccc28ebc..1f9a97bc 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -21,14 +21,20 @@ ones are marked like "v1.0.0-fork".
### Fixed
-* Fixes [#113](https://github.com/HugoFara/lwt/issues/113): changing a language name was making text-to-speech unusable and may prompt a warning.
-* Since 2.9.0, tests may be unable to run due to a missing key in an AJAX request ("type"). This is fixed.
+* Fixes [#113](https://github.com/HugoFara/lwt/issues/113): changing a language name
+was making text-to-speech unusable and may prompt a warning.
+* Since 2.9.0, tests may be unable to run due to a missing key in an AJAX request ("type").
* Since 2.9.0, audio position was not saved properly.
* On `upload_words.php`, "update only empty fields" was broken.
* Translation were not set by default properly when editing terms translations table.
* The field MeCab was set for japanese even when not asked for.
-Signalled on PR [#155](https://github.com/HugoFara/lwt/pull/155), thanks to [@ProgramComputer](https://github.com/ProgramComputer).
-* Since 2.8.1, japanese word romanization was not displayed any more. Thanks to 아르노 for signalling the bug on Discord!
+Signalled on PR [#155](https://github.com/HugoFara/lwt/pull/155), thanks to
+[@ProgramComputer](https://github.com/ProgramComputer).
+* Since 2.8.1, japanese word romanization was not displayed any more.
+Thanks to 아르노 for signalling the bug on Discord!
+* The go slower/faster feature on audio was broken
+([#138](https://github.com/HugoFara/lwt/issues/138)), as functions `click_slower`
+and `click_faster` were declared two times in `src/js/audio_controller.js`.
### Deprecated
diff --git a/docs/info.html b/docs/info.html
index 075c6880..af978aaa 100644
--- a/docs/info.html
+++ b/docs/info.html
@@ -2200,14 +2200,20 @@
Changed
Fixed
-- Fixes #113: changing a language name was making text-to-speech unusable and may prompt a warning.
-- Since 2.9.0, tests may be unable to run due to a missing key in an AJAX request ("type"). This is fixed.
+- Fixes #113: changing a language name
+was making text-to-speech unusable and may prompt a warning.
+- Since 2.9.0, tests may be unable to run due to a missing key in an AJAX request ("type").
- Since 2.9.0, audio position was not saved properly.
- On
upload_words.php
, "update only empty fields" was broken.
- Translation were not set by default properly when editing terms translations table.
- The field MeCab was set for japanese even when not asked for.
-Signalled on PR #155, thanks to @ProgramComputer.
-- Since 2.8.1, japanese word romanization was not displayed any more. Thanks to 아르노 for signalling the bug on Discord!
+Signalled on PR #155, thanks to
+@ProgramComputer.
+- Since 2.8.1, japanese word romanization was not displayed any more.
+Thanks to 아르노 for signalling the bug on Discord!
+- The go slower/faster feature on audio was broken
+(#138), as functions
click_slower
+and click_faster
were declared two times in src/js/audio_controller.js
.
Deprecated
diff --git a/inc/session_utility.php b/inc/session_utility.php
index e69c18e3..f4bd12fd 100644
--- a/inc/session_utility.php
+++ b/inc/session_utility.php
@@ -5184,13 +5184,18 @@ function addjPlayerMedia () {
if ($('#jquery_jplayer_1').data().jPlayer.status.playbackRateEnabled) {
$("#playbackrateContainer").css("margin-top",".2em")
.html(
- `
+ `
-
+
-
+
≪
1.0
≫
@@ -5228,9 +5233,9 @@ function prepareMediaInteractions() {
set_current_playbackrate();
});
- $("#slower").on('click', click_slower);
- $("#faster").on('click', click_faster);
- $("#stdspeed").on('click', click_stdspeed);
+ $("#slower").on('click', lwt_audio_controller.setSlower);
+ $("#faster").on('click', lwt_audio_controller.setFaster);
+ $("#stdspeed").on('click', lwt_audio_controller.setStdSpeed);
$("#backbutt").on('click', click_back);
$("#forwbutt").on('click', click_forw);
$("#do-single").on('click', click_single);
diff --git a/js/pgm.js b/js/pgm.js
index dd326a59..eeb7e823 100644
--- a/js/pgm.js
+++ b/js/pgm.js
@@ -3,10 +3,10 @@
*
* @license Unlicense
*/
-const lwt_audio_controller={newPosition:function(position){$("#jquery_jplayer_1").jPlayer("playHead",position)},setNewPlayerseconds:function(){const newval=$("#backtime :selected").val();do_ajax_save_setting('currentplayerseconds',newval)},setNewPlaybackrate:function(){const newval=$("#playbackrate :selected").val();do_ajax_save_setting('currentplaybackrate',newval);$("#jquery_jplayer_1").jPlayer("option","playbackRate",newval*0.1)},setCurrentPlaybackrate:function(){const val=$("#playbackrate :selected").val();$("#jquery_jplayer_1").jPlayer("option","playbackRate",val*0.1)},clickSingle:function(){$("#jquery_jplayer_1").off('bind',$.jPlayer.event.ended+".jp-repeat");$("#do-single").addClass('hide');$("#do-repeat").removeClass('hide');do_ajax_save_setting('currentplayerrepeatmode','0');return!1},clickRepeat:function(){$("#jquery_jplayer_1").on('bind',$.jPlayer.event.ended+".jp-repeat",function(_event){$(this).jPlayer("play")});$("#do-repeat").addClass('hide');$("#do-single").removeClass('hide');do_ajax_save_setting('currentplayerrepeatmode','1');return!1},clickBack:function(){const t=parseInt($("#playTime").text(),10);const b=parseInt($("#backtime").val(),10);let nt=t-b;let st='pause';if(nt<0)
+const lwt_audio_controller={newPosition:function(position){$("#jquery_jplayer_1").jPlayer("playHead",position)},setNewPlayerseconds:function(){const newval=$("#backtime :selected").val();do_ajax_save_setting('currentplayerseconds',newval)},setNewPlaybackRate:function(){const newval=$("#playbackrate :selected").val();do_ajax_save_setting('currentplaybackrate',newval);$("#jquery_jplayer_1").jPlayer("option","playbackRate",newval*0.1)},setCurrentPlaybackrate:function(){const val=$("#playbackrate :selected").val();$("#jquery_jplayer_1").jPlayer("option","playbackRate",val*0.1)},clickSingle:function(){$("#jquery_jplayer_1").off('bind',$.jPlayer.event.ended+".jp-repeat");$("#do-single").addClass('hide');$("#do-repeat").removeClass('hide');do_ajax_save_setting('currentplayerrepeatmode','0');return!1},clickRepeat:function(){$("#jquery_jplayer_1").on('bind',$.jPlayer.event.ended+".jp-repeat",function(_event){$(this).jPlayer("play")});$("#do-repeat").addClass('hide');$("#do-single").removeClass('hide');do_ajax_save_setting('currentplayerrepeatmode','1');return!1},clickBack:function(){const t=parseInt($("#playTime").text(),10);const b=parseInt($("#backtime").val(),10);let nt=t-b;let st='pause';if(nt<0)
nt=0;if(!$('#jquery_jplayer_1').data().jPlayer.status.paused)
st='play';$("#jquery_jplayer_1").jPlayer(st,nt)},clickForward:function(){const t=parseInt($("#playTime").text(),10);const b=parseInt($("#backtime").val(),10);const nt=t+b;let st='pause';if(!$('#jquery_jplayer_1').data().jPlayer.status.paused)
-st='play';$("#jquery_jplayer_1").jPlayer(st,nt)},clickSlower:function(){const val=parseFloat($("#pbvalue").text())-0.1;if(val>=0.5){$("#pbvalue").text(val.toFixed(1)).css({'color':'#BBB'}).animate({color:'#888'},150,function(){});$("#jquery_jplayer_1").jPlayer("playbackRate",val)}},clickFaster:function(){const val=parseFloat($("#pbvalue").text())+0.1;if(val<=4.0){$("#pbvalue").text(val.toFixed(1)).css({'color':'#BBB'}).animate({color:'#888'},150,function(){});$("#jquery_jplayer_1").jPlayer("playbackRate",val)}},clickStdSpeed:function(){$("#playbackrate").val(10);this.setNewPlaybackRate()},clickSlower:function(){let val=$("#playbackrate :selected").val();if(val>5){val--;$("#playbackrate").val(val);this.setNewPlaybackRate()}},clickFaster:function(){let val=$("#playbackrate :selected").val();if(val<15){val++;$("#playbackrate").val(val);this.setNewPlaybackRate()}},}
+st='play';$("#jquery_jplayer_1").jPlayer(st,nt)},clickSlower:function(){const val=parseFloat($("#pbvalue").text())-0.1;if(val>=0.5){$("#pbvalue").text(val.toFixed(1)).css({'color':'#BBB'}).animate({color:'#888'},150,function(){});$("#jquery_jplayer_1").jPlayer("playbackRate",val)}},clickFaster:function(){const val=parseFloat($("#pbvalue").text())+0.1;if(val<=4.0){$("#pbvalue").text(val.toFixed(1)).css({'color':'#BBB'}).animate({color:'#888'},150,function(){});$("#jquery_jplayer_1").jPlayer("playbackRate",val)}},setStdSpeed:function(){$("#playbackrate").val(10);lwt_audio_controller.setNewPlaybackRate()},setSlower:function(){let val=$("#playbackrate :selected").val();if(val>5){val--;$("#playbackrate").val(val);lwt_audio_controller.setNewPlaybackRate()}},setFaster:function(){let val=$("#playbackrate :selected").val();if(val<15){val++;$("#playbackrate").val(val);lwt_audio_controller.setNewPlaybackRate()}},}
function new_pos(p){return lwt_audio_controller.newPosition(p)}
function set_new_playerseconds(){return lwt_audio_controller.setNewPlayerseconds()}
function set_new_playbackrate(){return lwt_audio_controller.setNewPlaybackrate()}
@@ -17,9 +17,9 @@ function click_back(){return lwt_audio_controller.clickBack()}
function click_forw(){return lwt_audio_controller.clickForward()}
function click_slower(){return lwt_audio_controller.clickSlower()}
function click_faster(){return lwt_audio_controller.clickFaster()}
-function click_stdspeed(){return lwt_audio_controller.clickStdSpeed()}
-function click_slower(){return lwt_audio_controller.clickSlower()}
-function click_faster(){return lwt_audio_controller.clickFaster()};function CountUp(server_now,server_start,id,dontrun){if(server_now0){r+=hr<10?("0"+hr):hr;r+=":"}
r+=min<10?("0"+min):min;r+=":";r+=sec<10?("0"+sec):sec;document.getElementById(id).innerHTML=r;if(this.dontrun)return;var self=this;setTimeout(function(){self.update(id)},1000)};/**
* Control the interactions for making an automated feed wizard.
diff --git a/src/js/audio_controller.js b/src/js/audio_controller.js
index 7767b66b..64048d1b 100644
--- a/src/js/audio_controller.js
+++ b/src/js/audio_controller.js
@@ -23,7 +23,7 @@ const lwt_audio_controller = {
do_ajax_save_setting('currentplayerseconds', newval);
},
- setNewPlaybackrate: function () {
+ setNewPlaybackRate: function () {
const newval = $("#playbackrate :selected").val();
do_ajax_save_setting('currentplaybackrate', newval);
$("#jquery_jplayer_1").jPlayer("option","playbackRate", newval * 0.1);
@@ -93,26 +93,26 @@ const lwt_audio_controller = {
}
},
- clickStdSpeed: function () {
+ setStdSpeed: function () {
$("#playbackrate").val(10);
- this.setNewPlaybackRate();
+ lwt_audio_controller.setNewPlaybackRate();
},
- clickSlower: function () {
+ setSlower: function () {
let val = $("#playbackrate :selected").val();
if (val > 5) {
val--;
$("#playbackrate").val(val);
- this.setNewPlaybackRate();
+ lwt_audio_controller.setNewPlaybackRate();
}
},
- clickFaster: function () {
+ setFaster: function () {
let val = $("#playbackrate :selected").val();
if (val < 15) {
val++;
$("#playbackrate").val(val);
- this.setNewPlaybackRate();
+ lwt_audio_controller.setNewPlaybackRate();
}
},
@@ -166,13 +166,13 @@ function click_faster() {
}
function click_stdspeed() {
- return lwt_audio_controller.clickStdSpeed();
+ return lwt_audio_controller.setStdSpeed();
}
function click_slower() {
- return lwt_audio_controller.clickSlower();
+ return lwt_audio_controller.setSlower();
}
function click_faster() {
- return lwt_audio_controller.clickFaster();
+ return lwt_audio_controller.setFaster();
}