forked from rc/aircox
1 line
7.0 KiB
JavaScript
1 line
7.0 KiB
JavaScript
!function(t){function e(e){for(var i,s,a=e[0],l=e[1],u=e[2],p=0,d=[];p<a.length;p++)s=a[p],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(t[i]=l[i]);for(c&&c(e);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],i=!0,a=1;a<n.length;a++){var l=n[a];0!==r[l]&&(i=!1)}i&&(o.splice(e--,1),t=s(s.s=n[0]))}return t}var i={},r={1:0,2:0},o=[];function s(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(n,i,function(e){return t[e]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="";var a=window.webpackJsonp=window.webpackJsonp||[],l=a.push.bind(a);a.push=e,a=a.slice();for(var u=0;u<a.length;u++)e(a[u]);var c=l;o.push([27,0]),n()}({1:function(t,e,n){"use strict";function i(t,...e){return setTimeout((...e)=>{!document.hidden&&t(...e)},...e)}function r(t,...e){return setInterval((...e)=>{!document.hidden&&t(...e)},...e)}n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r}))},26:function(t,e,n){},27:function(t,e,n){"use strict";n.r(e);var i=n(0),r=(n(26),function(){var t=this.$createElement;return(this._self._c||t)("form",{ref:"form"},[this._t("default",null,{counts:this.counts})],2)});r._withStripped=!0;const o=new RegExp(",s*","g");var s={data:()=>({counts:{}}),methods:{update(){const t=this.$el.querySelectorAll('input[name="data"]:checked'),e={};for(var n of(console.log(t),t))if(n.value)for(var i of n.value.split(o))e[i.trim()]=(e[i.trim()]||0)+1;this.counts=e},onclick(t){}},mounted(){this.$refs.form.addEventListener("change",()=>this.update()),this.update()}},a=n(2),l=Object(a.a)(s,r,[],!1,null,null,null);l.options.__file="assets/admin/statistics.vue";var u=l.exports;n(8);i.a.component("a-statistics",u),window.aircox_admin={filter_menu:function(t){var e=new RegExp(t.target.value,"gi"),n=t.target.closest(".navbar-dropdown");if(t.target.value)for(var i of n.querySelectorAll("a.navbar-item"))i.style.display=-1==i.innerHTML.search(e)?"none":null;else for(var i of n.querySelectorAll("a.navbar-item"))i.style.display=null}}},3:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0);const r={el:"#app",delimiters:["[[","]]"]};var o={};function s(t=null){return new Promise((function(e,n){window.addEventListener("load",(function(){try{t=function(t){return t instanceof Function&&(t=t()),t=null==t?o:t,{...r,...t}}(t);if(!document.querySelector(t.el))return void n("Error: missing element "+t.el);e(new i.a(t))}catch(t){n(t)}}))}))}},7:function(t,e,n){},8:function(t,e,n){"use strict";n.r(e);var i=n(0),r=n(3),o=(n(7),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"media"},[n("div",{staticClass:"media-left"},[n("div",{staticClass:"button",attrs:{title:t.buttonTitle,"aria-label":t.buttonTitle},on:{click:function(e){return t.toggle()}}},[t.playing?n("span",{staticClass:"fas fa-pause"}):n("span",{staticClass:"fas fa-play"})]),t._v(" "),n("audio",{ref:"audio",on:{playing:t.onChange,ended:t.onChange,pause:t.onChange}},[t._t("sources")],2)]),t._v(" "),t.onAir&&t.onAir.cover?n("div",{staticClass:"media-left media-cover"},[n("img",{staticClass:"cover",attrs:{src:t.onAir.cover}})]):t._e(),t._v(" "),t.onAir&&"track"==t.onAir.type?n("div",{staticClass:"media-content"},[t._t("track",null,{onAir:t.onAir,liveInfo:t.liveInfo})],2):t.onAir&&"diffusion"==t.onAir.type?n("div",{staticClass:"media-content"},[t._t("diffusion",null,{onAir:t.onAir,liveInfo:t.liveInfo})],2):n("div",{staticClass:"media-content"},[t._t("empty")],2)])});o._withStripped=!0;var s=n(1),a=class{constructor(t,e){this.url=t,this.timeout=e,this.promise=null,this.items=[]}drop(){this.promise=null}fetch(){const t=fetch(this.url).then(t=>t.ok?t.json():Promise.reject(t)).then(t=>(this.items=t,this.items));return this.promise=t,t}refresh(){const t=this.fetch();return t.then(e=>{if(t!=this.promise)return[];Object(s.b)(()=>this.refresh(),1e3*this.timeout)}),t}};const l=0,u=1,c=2;var p={data(){return{state:l,liveInfo:new a(this.liveInfoUrl,this.liveInfoTimeout)}},props:{buttonTitle:String,liveInfoUrl:String,liveInfoTimeout:{type:Number,default:5},src:String},computed:{paused(){return this.state==l},playing(){return this.state==u},loading(){return this.state==c},onAir(){return this.liveInfo.items&&this.liveInfo.items[0]},buttonStyle(){if(this.onAir)return{backgroundImage:`url(${this.onAir.cover})`}}},methods:{load(t){const e=this.$refs.audio;e.src=t,e.load()},play(t){t&&this.load(t),this.$refs.audio.play().catch(t=>console.error(t))},pause(){this.$refs.audio.pause()},toggle(){console.log("tooogle",this.paused,"-",this.$refs.audio.src),this.paused?this.play():this.pause()},onChange(t){const e=this.$refs.audio;this.state=e.paused?l:u}},mounted(){this.liveInfo.refresh()},destroyed(){this.liveInfo.drop()}},d=n(2),f=Object(d.a)(p,o,[],!1,null,null,null);f.options.__file="assets/public/player.vue";var h=f.exports,v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"control"},[n("Autocomplete",{ref:"autocomplete",attrs:{data:t.data,placeholder:t.placeholder,field:t.field,loading:t.isFetching,"open-on-focus":""},on:{typing:t.fetch,select:function(e){return t.onSelect(e)}}}),t._v(" "),t.valueField?n("input",{ref:"value",attrs:{type:"hidden",name:t.valueField},domProps:{value:t.selected&&t.selected[t.valueAttr||t.valueField]}}):t._e()],1)};v._withStripped=!0;var m=n(5),g=n.n(m),y=n(6),b={props:{url:String,model:Function,placeholder:String,field:{type:String,default:"value"},count:{type:Number,count:10},valueAttr:String,valueField:String},data:()=>({data:[],selected:null,isFetching:!1}),methods:{onSelect(t){console.log("selected",t),i.a.set(this,"selected",t),this.$emit("select",t)},fetch:g()((function(t){t&&(this.isFetching=!0,this.model.fetchAll(this.url.replace("${query}",t)).then(t=>{this.data=t,this.isFetching=!1},t=>{this.isFetching=!1,Promise.reject(t)}))}))},components:{Autocomplete:y.Autocomplete}},_=Object(d.a)(b,v,[],!1,null,null,null);_.options.__file="assets/public/autocomplete.vue";var w=_.exports;i.a.component("a-player",h),i.a.component("a-autocomplete",w),window.aircox={app:null,appConfig:{},playerApp:null,get player(){return this.playerApp&&this.playerApp.$refs.player}},Object(r.a)({el:"#player"}).then(t=>{window.aircox.playerApp=t},()=>{}),Object(r.a)(()=>window.aircox.appConfig).then(t=>{window.aircox.app=t},()=>{})}}); |