platypush/platypush/backend/http/dist/static/js/chunk-5ebb7d11.84af44e9.js

2 lines
4.7 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5ebb7d11"],{"711e":function(e,t,r){},"7aad":function(e,t,r){"use strict";r("711e")},"9e28":function(e,t,r){},c845:function(e,t,r){"use strict";r.r(t);var a=r("7a23"),s=Object(a["F"])("data-v-f99ee6f4");Object(a["u"])("data-v-f99ee6f4");var o={class:"image-carousel"},i={ref:"background",class:"background"},n={key:1,class:"row info-container"},h={class:"col-6 weather-container"},c={key:0},u={class:"col-6 date-time-container"};Object(a["s"])();var d=s((function(e,t,r,s,d,m){var f=Object(a["z"])("Loading"),l=Object(a["z"])("Weather"),w=Object(a["z"])("DateTime");return Object(a["r"])(),Object(a["e"])("div",o,[d.images.length?Object(a["f"])("",!0):(Object(a["r"])(),Object(a["e"])(f,{key:0})),Object(a["h"])("div",i,null,512),Object(a["h"])("img",{ref:"img",src:m.imgURL,alt:"Your carousel images",style:{display:d.images.length?"block":"none"}},null,12,["src"]),m._showDate||m._showTime?(Object(a["r"])(),Object(a["e"])("div",n,[Object(a["h"])("div",h,[m._showWeather?(Object(a["r"])(),Object(a["e"])(l,{key:1,"show-icon":m._showWeatherIcon,"show-summary":m._showWeatherSummary,"show-temperature":m._showTemperature,"icon-color":r.weatherIconColor,"icon-size":r.weatherIconSize,animate:m._animateWeatherIcon},null,8,["show-icon","show-summary","show-temperature","icon-color","icon-size","animate"])):(Object(a["r"])(),Object(a["e"])("span",c," "))]),Object(a["h"])("div",u,[m._showTime||m._showDate?(Object(a["r"])(),Object(a["e"])(w,{key:0,"show-date":m._showDate,"show-time":m._showTime,"show-seconds":m._showSeconds},null,8,["show-date","show-time","show-seconds"])):Object(a["f"])("",!0)])])):Object(a["f"])("",!0)])})),m=(r("a9e3"),r("96cf"),r("1da1")),f=r("3e54"),l=r("3a5e"),w=r("365a"),g=r("5b43"),p={name:"ImageCarousel",components:{Weather:g["default"],DateTime:w["default"],Loading:l["a"]},mixins:[f["a"]],props:{imgDir:{type:String,required:!0},refreshSeconds:{type:Number,required:!1,default:15},showDate:{type:Boolean,required:!1,default:!1},showTime:{type:Boolean,required:!1,default:!1},showSeconds:{type:Boolean,required:!1,default:!1},showWeather:{type:Boolean,required:!1,default:!1},showTemperature:{type:Boolean,required:!1,default:!0},showWeatherIcon:{type:Boolean,required:!1,default:!0},showWeatherSummary:{type:Boolean,required:!1,default:!0},weatherIconColor:{type:String,required:!1,default:"white"},weatherIconSize:{type:Number,required:!1,default:40},animateWeatherIcon:{required:!1,default:!0}},data:function(){return{images:[],currentImage:void 0,loading:!1}},computed:{imgURL:function(){var e=8008;return"backend.http"in this.$root.config&&"port"in this.$root.config["backend.http"]&&(e=this.$root.config["backend.http"].port),"//"+window.location.hostname+":"+e+this.currentImage},_showDate:function(){return this.parseBoolean(this.showDate)},_showTime:function(){return this.parseBoolean(this.showTime)},_showSeconds:function(){return this.parseBoolean(this.showSeconds)},_showTemperature:function(){return this.parseBoolean(this.showTemperature)},_showWeather:function(){return this.parseBoolean(this.showWeather)},_showWeatherIcon:function(){return this.parseBoolean(this.showWeatherIcon)},_showWeatherSummary:function(){return this.parseBoolean(this.showWeatherSummary)},_animateWeatherIcon:function(){return this.parseBoolean(this.animateWeatherIcon)}},methods:{refresh:function(){var e=this;return Object(m["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.images.length){t.next=10;break}return e.loading=!0,t.prev=2,t.next=5,e.request("utils.search_web_directory",{directory:e.imgDir,extensions:[".jpg",".jpeg",".png"]});case 5:e.images=t.sent,e.shuffleImages();case 7:return t.prev=7,e.loading=!1,t.finish(7);case 10:e.images.length&&(e.currentImage=e.images.pop());case 11:case"end":return t.stop()}}),t,null,[[2,,7,10]])})))()},onNewImage:function(){if(this.$refs.img&&(this.$refs.background.style["background-image"]="url("+this.imgURL+")",this.$refs.img.style.width="auto",this.$refs.img.width>this.$refs.img.height)){var e=this.$refs.img.width/this.$refs.img.height;4/3<=e<=16/9&&(this.$refs.img.style.width="100%"),e<=4/3&&(this.$refs.img.style.height="100%")}},shuffleImages:function(){for(var e=this.images.length-1;e>0;e--){var t=Math.floor(Math.random()*(e+1)),r=this.images[e];this.images[e]=this.images[t],this.images[t]=r}}},mounted:function(){this.$refs.img.addEventListener("load",this.onNewImage),this.$refs.img.addEventListener("error",this.refresh),this.refresh(),setInterval(this.refresh,Math.round(1e3*this.refreshSeconds))}};r("7aad"),r("d233");p.render=d,p.__scopeId="data-v-f99ee6f4";t["default"]=p},d233:function(e,t,r){"use strict";r("9e28")}}]);
//# sourceMappingURL=chunk-5ebb7d11.84af44e9.js.map