|
|
|
@ -29,80 +29,3 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
})(Drupal, once); |
|
|
|
})(Drupal, once); |
|
|
|
// (function (Drupal) {
|
|
|
|
|
|
|
|
// window.onload = function () {
|
|
|
|
|
|
|
|
// var inputField = document.getElementById("nouislider-input-from");
|
|
|
|
|
|
|
|
// var str = inputField.value.toString();
|
|
|
|
|
|
|
|
// str = str.slice(0, -3);
|
|
|
|
|
|
|
|
// str = parseInt(str);
|
|
|
|
|
|
|
|
// inputField.value = str;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// var inputField = document.getElementById("nouislider-input-to");
|
|
|
|
|
|
|
|
// var str = inputField.value.toString();
|
|
|
|
|
|
|
|
// str = str.slice(0, -3);
|
|
|
|
|
|
|
|
// str = parseInt(str);
|
|
|
|
|
|
|
|
// inputField.value = str;
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
// })(Drupal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//(function (Drupal, once) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//async function getAudioSourceFromNode(url) {
|
|
|
|
|
|
|
|
//const res = await fetch(url, {
|
|
|
|
|
|
|
|
//headers: { 'X-Requested-With': 'XMLHttpRequest' }
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//const html = await res.text();
|
|
|
|
|
|
|
|
//const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// EXACT match for your markup
|
|
|
|
|
|
|
|
//const source = doc.querySelector(
|
|
|
|
|
|
|
|
//'audio[data-able-player] source[type="audio/mpeg"]'
|
|
|
|
|
|
|
|
//);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//return source?.src;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//function playAbleAudio(src) {
|
|
|
|
|
|
|
|
//const audio = document.getElementById('global-able-player');
|
|
|
|
|
|
|
|
//if (!audio) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//const source = audio.querySelector('source');
|
|
|
|
|
|
|
|
//source.src = src;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//audio.load();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// Access Able Player instance safely
|
|
|
|
|
|
|
|
//if (audio.ablePlayer) {
|
|
|
|
|
|
|
|
//audio.ablePlayer.refreshControls();
|
|
|
|
|
|
|
|
//audio.ablePlayer.playMedia();
|
|
|
|
|
|
|
|
//} else {
|
|
|
|
|
|
|
|
//audio.play();
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//document.getElementById('global-audio-wrapper')
|
|
|
|
|
|
|
|
//?.classList.remove('is-hidden');
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Drupal.behaviors.ablePlayerRemoteLoad = {
|
|
|
|
|
|
|
|
//attach(context) {
|
|
|
|
|
|
|
|
//once('able-player-fetch', '.js-play-audio-from-node', context)
|
|
|
|
|
|
|
|
//.forEach(link => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//link.addEventListener('click', async e => {
|
|
|
|
|
|
|
|
//e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//const src = await getAudioSourceFromNode(link.href);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (!src) {
|
|
|
|
|
|
|
|
//console.warn('No Able Player audio found on page');
|
|
|
|
|
|
|
|
//return;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//playAbleAudio(src);
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//})(Drupal, once);
|
|
|
|
|
|
|
|
|