Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/modules/audio-player.min.js
Назад
((O,w)=>{"use strict";const L=O.click,k=/iPhone|iPad|iPod|Mac OS/i.test(window.navigator.userAgent),F=t=>{t=1/0===t?0:t;const e=new Date(1e3*t).toISOString().substr(11,8).split(":");return"00"===e[0]&&e.splice(0,1),e.join(":")},P=(t,f)=>{const u=t.tracks,_=!!t.artists,m=!!t.images,l=!!t.tracknumbers,h=w.createElement("div"),e=w.createElement("div"),o=w.createDocumentFragment();e.className="tf_audio_playlist",h.className="tf_playlist_current";let v=!0;for(let n=0,t=u.length;n<t;++n)if(u[n].src){u[n].src=u[n].src.trim();let t=w.createElement("div"),e=w.createElement("div"),a=w.createElement("a"),s=w.createElement("span"),i=new Audio(u[n].src);if(!u[n].type||i.canPlayType(u[n].type)){if(t.className="tf_playlist_item tf_w tf_rel",a.href=u[n].src,a.className="tf_playlist_caption tf_w",e.className="tf_playlist_length",!isNaN(i.duration)||u[n].meta?.length_formatted?(e.textContent=isNaN(i.duration)?u[n].meta.length_formatted:F(i.duration),i=null):(t.className+=" tf_lazy",i.tfOn("durationchange",function(){e.textContent=F(this.duration),i=null,t.classList.remove("tf_lazy")},{passive:!0,once:!0})),!0==l&&(a.textContent=n+1+"."),s.className="tf_playlist_title",u[n].caption?s.textContent=u[n].caption:u[n].title&&(s.textContent=u[n].title),!0==_&&u[n].meta?.artists){let t=w.createElement("span");t.className="tf_playlist_artist",t.textContent="-"+u[n].meta.artists,a.appendChild(t)}a.appendChild(s),t.append(a,e),o.appendChild(t)}else u.splice(n,1)}else u.splice(n,1);return e.tfOn(L,function(t){const e=t.target.closest(".tf_playlist_caption"),a=e.parentNode.classList.contains("tf_audio_current");if(e){if(t.preventDefault(),t.stopPropagation(),!a||f.paused)if(a)f.play();else{const s=this.tfClass("tf_audio_current")[0],i=O.convert(this.children).indexOf(e.parentNode),n=w.createElement("div"),l=w.createElement("span");if(n.className="tf_playlist_caption",!(l.className="tf_playlist_title")===v&&(f.pause(),f.tfOn("canplay",function(){this.play()},{passive:!0,once:!0}).src=e.getAttribute("href"),f.load()),s&&s.classList.remove("tf_audio_current"),e.parentNode.classList.add("tf_audio_current"),h.innerHTML="",u[i]){const o=u[i];if(m&&o.thumb&&o.thumb.src){const r=new Image,c=w.createElement("div");void 0!==o.thumb.width&&(r.width=o.thumb.width),void 0!==o.thumb.height&&(r.height=o.thumb.height),r.decoding="async",r.src=o.thumb.src,c.className="post-image",r.decode().catch(()=>{}).finally(()=>{c.appendChild(r)}),h.appendChild(c)}if(l.textContent=o.title||o.caption||"",n.appendChild(l),u.meta){if(u.meta.album){const p=w.createElement("span");p.className=" tf_playlist_album",p.textContent=u.meta.album,n.appendChild(p)}if(_&&u.meta.artists){const d=w.createElement("span");d.className=" tf_playlist_artist",d.textContent=u.meta.artists,n.appendChild(d)}}h.appendChild(n)}}v=!1}}),e.appendChild(o),f.before(h),O.triggerEvent(e.tfClass("tf_playlist_caption")[0],L),e},T=async(t,e)=>{if(t.paused){t.dataset.playing||(t.dataset.playing=1);try{await t.play()}catch(t){if(e)throw t}}},i=(o,t)=>{if(!o.previousElementSibling?.classList.contains("tf_audio_container")){const e=w.createElement("div"),s=w.createElement("div"),i=w.createElement("div"),n=w.createElement("div"),r=w.createElement("div"),c=w.createElement("div"),p=w.createElement("input"),d=w.createElement("input"),f=w.createElement("div"),u=w.createElement("div"),_=w.createElement("div"),m=w.createElement("button"),h=w.createElement("button"),v=w.createElement("div"),y=o.parentNode.closest(".track"),g=w.createElement("div"),b=t&&t.tracks;let a=!0,l=!1;if(e.className="tf_audio_container tf_w tf_rel tf_box",s.className="tf_audio_wrap tf_w tf_rel tf_box",_.className="tf_audio_controls",i.className="tf_audio_progress_wrap tf_rel tf_textl",n.className="tf_audio_progress_loaded tf_w tf_h tf_abs",r.className="tf_audio_progress_current tf_w tf_h tf_abs",p.className="tf_audio_progress_range tf_h tf_abs",d.min=p.min=0,d.max=p.max=100,d.type=p.type="range",p.value=0,d.value="50%",f.className="tf_audio_volumn_wrap",u.className="tf_audio_volumn_inner",d.className="tf_audio_volumn_range tf_h tf_overflow",m.className="tf_audio_mute",h.className="tf_auido_play",h.tabIndex=m.tabIndex=0,h.type=m.type="button",o.muted&&(m.className+=" tf_muted"),v.className="tf_audio_current_time",g.className="tf_audio_total_time",c.className="tf_audio_hover tf_abs tf_hide tf_box tf_textc",v.textContent=F(o.currentTime),g.textContent=F(o.duration),h.tfOn(L,t=>{"click"===t.type&&(t.preventDefault(),t.stopPropagation()),o.paused?T(o):o.pause()},{passive:"click"!==L}),y){const N=y.tfClass("track-title")[0];N&&N.tfOn(L,t=>{t.preventDefault(),O.triggerEvent(h,L)})}if(m.tfOn(L,t=>{"click"===t.type&&(t.preventDefault(),t.stopPropagation()),o.muted=!o.muted},{passive:"click"!==L}),O.isTouch||i.tfOn("mouseenter",function(){if(!isNaN(o.duration)){c.classList.remove("tf_hide");const s=this.clientWidth,i=parseFloat(c.clientWidth/2),n=o.duration,t=t=>{const e=void 0!==t.layerX?t.layerX:t.offsetX,a=O.isRTL?e+i:e-i;0<a&&0<=e&&e<=s&&(c.style.transform="translateX("+a+"px)",!1===l)&&(c.textContent=F(parseFloat(e/s)*n))};this.tfOn("mouseleave",function(){c.classList.add("tf_hide"),this.tfOff("mousemove",t,{passive:!0})},{passive:!0,once:!0}).tfOn("mousemove",t,{passive:!0})}},{passive:!0}),p.tfOn("input",function(t){if(t.preventDefault(),t.stopPropagation(),!isNaN(o.duration)){o.paused||!0!==a||o.pause(),l=!0;const e=parseInt(this.value);o.currentTime=100===e?o.duration-1:parseFloat(e*o.duration/100).toFixed(4)}}).tfOn("change",t=>{t.preventDefault(),t.stopPropagation(),isNaN(o.duration)||(l=a=!1,o.paused&&o.play().catch({}).finally(()=>{a=!0}))}),o.tfOn("progress",function(){0<this.buffered.length&&(n.style.transform="scaleX("+parseFloat(this.buffered.end(0)/this.duration).toFixed(4)+")")},{passive:!0}).tfOn("durationchange",function(){g.textContent=F(this.duration)},{passive:!0}).tfOn("waiting emptied",function(){i.classList.add("tf_audio_waiting"),this.tfOn("playing",()=>{i.classList.remove("tf_audio_waiting")},{passive:!0,once:!0})},{passive:!0}).tfOn("pause",()=>{h.classList.remove("tf_audio_playing")},{passive:!0}).tfOn("play",function(){h.classList.add("tf_audio_playing");const e=w.tfTag("audio");for(let t=e.length-1;-1<t;--t)e[t]!==this&&e[t].pause()},{passive:!0}).tfOn("timeupdate",function(){if(!isNaN(this.duration)){v.textContent=F(this.currentTime);let t=parseFloat(this.currentTime/this.duration);r.style.transform="scaleX("+t.toFixed(4)+")",!1===l&&(p.value=parseInt(100*t))}},{passive:!0}).tfOn("volumechange",function(){const t=m.classList;0!==this.volume&&t.remove("tf_mute_disabled"),!0===this.muted||0===this.volume?(0===this.volume&&t.add("tf_mute_disabled"),t.add("tf_muted")):t.remove("tf_muted")},{passive:!0}),i.append(n,r,p,c),f.appendChild(m),!1===k&&(d.tfOn("input",function(t){t.preventDefault(),t.stopPropagation(),o.volume=parseFloat(this.value/100).toFixed(3)}),u.appendChild(d),f.appendChild(u)),s.append(_,v,i,g,f),e.appendChild(s),b){const C=e.appendChild(P(t,o)),E=w.createElement("button"),x=w.createElement("button");E.className="tf_playlist_prev tf_play_disabled",x.className="tf_playlist_next",C.children.length<=1&&(x.className+=" tf_play_disabled"),E.tabIndex=x.tabIndex=0,E.type=x.type="button",_.tfOn(L,t=>{const e=t.target,a=e.classList;if(!a.contains("tf_play_disabled")&&(a.contains("tf_playlist_prev")||a.contains("tf_playlist_next"))){"click"===t.type&&(t.preventDefault(),t.stopPropagation());const s=C.tfClass("tf_audio_current")[0];if(s){const i=a.contains("tf_playlist_prev")?s.previousElementSibling:s.nextElementSibling;i&&(O.triggerEvent(i.tfClass("tf_playlist_caption")[0],L),a.contains("tf_playlist_prev")?(x.classList.remove("tf_play_disabled"),a.toggle("tf_play_disabled",!i.previousElementSibling)):(E.classList.remove("tf_play_disabled"),a.toggle("tf_play_disabled",!i.nextElementSibling)))}}},{passive:"click"!==L}),o.tfOn("ended",function(){if(x.classList.contains("tf_play_disabled")){if(this.hasAttribute("data-loop")||this.hasAttribute("loop")){const t=C.tfClass("tf_playlist_caption")[0];t&&(E.classList.add("tf_play_disabled"),x.classList.toggle("tf_play_disabled",C.children.length<=1),O.triggerEvent(t,L))}}else O.triggerEvent(x,L)},{passive:!0}),_.append(E,h,x)}else _.appendChild(h);requestAnimationFrame(()=>{o.parentNode.classList.remove("tf_lazy"),o.before(e);const t=o.closest(".tf_lazy");null!==t&&t.classList.remove("tf_lazy"),o.dataset.autoplay&&T(o)})}};O.on("tf_audio_init",(t,e)=>{((a,s)=>{for(let e=a.length-1;-1<e;--e){let t=a[e];if(!s){let e=t.parentNode.parentNode;if(e.classList.contains("wp-audio-playlist")){let t=e.tfClass("tf-playlist-script")[0]||e.tfClass("wp-playlist-script")[0];t&&"audio"!==(s=JSON.parse(t.textContent)).type&&(s=!1)}}if(!t.hasAttribute("src")&&!t.tfTag("source")[0]){if(!s?.tracks)continue;let e=s.tracks[0].src;if(!e)for(let t=1;t<s.tracks.length;++t)if(s.tracks[t].src){e=s.tracks[t].src;break}if(!e)continue;t.src=e}4===t.readyState?i(t,s):O.requestIdleCallback(()=>{t.tfOn("loadedmetadata",function(){i(this,s)},{passive:!0,once:!0}).load()},-1,200)}})(t=void 0===t.length?[t]:t,e)})})(Themify,document);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка