return false;
});
+ if ($('.sound + .content .text ').length) {
+ var text_content = $('.sound + .content .text')[0];
+ text_content.innerHTML = text_content.innerHTML.replace(
+ /[0-9][0-9]+:[0-9][0-9]/g,
+ function(x) { return '<span class="timestamp">' + x + "</span>"; });
+ $(text_content).find('span.timestamp').on('click', function() {
+ var $waveform = $('div.waveform');
+ var total_duration = parseFloat($waveform.data('duration'));
+ var nb_ticks = $waveform.find('span').length;
+ var timestamp = $(this).text().split(':');
+ var timestamp_position = timestamp[0] * 60 + timestamp[1] * 1;
+ var tick_idx = parseInt(nb_ticks * timestamp_position / total_duration);
+ // twice to get play then set position
+ $('span[data-tick-index=' + tick_idx + ']').trigger('click');
+ $('span[data-tick-index=' + tick_idx + ']').trigger('click');
+ });
+ }
+
if (document.cookie.indexOf('panikdb=on') != -1) {
panikdb_path = null;
if (window.location.pathname.indexOf('/emissions/') == 0) {