[divan] balises temps du sommaire cliquables

This commit is contained in:
Esenjin 2021-10-21 21:49:10 +02:00
parent 76a78d8e06
commit 1f22391336

View File

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html class="no-js" lang="zxx"> <html class="no-js" lang="fr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -26,6 +26,7 @@
<link rel="stylesheet" href="css/slick.css"> <link rel="stylesheet" href="css/slick.css">
<link rel="stylesheet" href="css/slicknav.css"> <link rel="stylesheet" href="css/slicknav.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<!-- <link rel="stylesheet" href="css/responsive.css"> --> <!-- <link rel="stylesheet" href="css/responsive.css"> -->
</head> </head>
@ -138,9 +139,25 @@
<!-- music_area end --> <!-- music_area end -->
<!-- timecode -->
<script type="text/javascript">
$("document").ready(function () {
$("p").each(function (k, v) {
let texte = v.textContent;
let match = texte.match(/(.*)\[(.*)\](.*)/);
if (Array.isArray(match)) {
let times = match[2].split(":");
let time = (Number(times[0]) * 3600) + (Number(times[1]) * 60) + Number(times[2])
v.innerHTML = match[1] + "<a href='#!' class='gotime' data-time='" + time + "'>[" + match[2] + "]</a>" + match[3];
}
});
<!-- link that opens popup --> $(".gotime").click(function (e) {
e.preventDefault();
$("audio").prop("currentTime", $(this).data("time"))
})
}</script>
<!-- JS here --> <!-- JS here -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"