1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-29 11:15:09 +00:00
pixelfed/public/js/loops.js

1 line
4.6 KiB
JavaScript
Raw Normal View History

2022-03-31 06:22:49 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[215],{85528:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var s=n(19755);Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});const a={data:function(){return{loading:!0,version:1,loops:[],tab:"new"}},mounted:function(){var t=this;axios.get("/api/v2/loops").then((function(e){t.loops=e.data,t.loading=!1}))},methods:{videoSrc:function(t){return t.media_attachments[0].url},posterSrc:function(t){return t.media_attachments[0].preview_url},setTab:function(t){this.tab=t},toggleVideo:function(t,e){var n=e.target;s("video").each((function(){n.src!=s(this)[0].src&&s(this)[0].pause()})),n.playing?n.pause():n.play()},incrementLoop:function(t){},timestamp:function(t){return new Date(t.created_at).toLocaleDateString()},getTitle:function(t){return(t.content?t.content:"Untitled").trim()},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;return _.truncate(t,{length:e})}}}},45502:(t,e,n)=>{Vue.component("loops-component",n(41091).default)},83796:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var s=n(23645),a=n.n(s)()((function(t){return t[1]}));a.push([t.id,".loops-container .card{box-shadow:none}.loops-container .card .card-img-top{border-radius:0}.loops-container a{color:#343a40}.loops-container .card-body a:hover,a.hashtag{color:#28a745!important}",""]);const r=a},44402:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var s=n(93379),a=n.n(s),r=n(83796),o={insert:"head",singleton:!1};a()(r.default,o);const i=r.default.locals||{}},41091:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var s=n(6939),a=n(61539),r={};for(const t in a)"default"!==t&&(r[t]=()=>a[t]);n.d(e,r);n(48264);const o=(0,n(51900).default)(a.default,s.render,s.staticRenderFns,!1,null,null,null).exports},61539:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var s=n(85528),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);n.d(e,a);const r=s.default},48264:(t,e,n)=>{"use strict";n.r(e);var s=n(44402),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);n.d(e,a)},6939:(t,e,n)=>{"use strict";n.r(e);var s=n(54995),a={};for(const t in s)"default"!==t&&(a[t]=()=>s[t]);n.d(e,a)},54995:(t,e,n)=>{"use strict";n.r(e),n.d(e,{render:()=>s,staticRenderFns:()=>a});var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"w-100 h-100"},[t.loading?n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{"min-height":"400px"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]):n("div",[n("div",{staticClass:"mb-4"},[n("p",{staticClass:"text-center"},[n("a",{class:["new"==t.tab?"btn font-weight-bold py-0 btn-success":"btn font-weight-bold py-0 btn-outline-success"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.setTab("new")}}},[t._v("New")]),t._v(" "),n("a",{class:["about"==t.tab?"btn font-weight-bold py-0 btn-success":"btn font-weight-bold py-0 btn-outline-success"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.setTab("about")}}},[t._v("About")])])]),t._v(" "),"about"!=t.tab?n("div",{staticClass:"row loops-container"},t._l(t.loops,(function(e,s){return n("div",{staticClass:"col-12 col-md-4 mb-3"},[n("div",{staticClass:"card border border-success"},[n("div",{staticClass:"embed-responsive embed-responsive-1by1"},[n("video",{staticClass:"embed-responsive-item",attrs:{src:t.videoSrc(e),preload:"none",width:"100%",height:"100%",loop:"",poster:t.posterSrc(e)},on:{click:function(n){return t.toggleVideo(e,n)}}})]),t._v(" "),n("div",{staticClass:"card-body"},[n("p",{staticClass:"username font-weight-bolder lead d-flex justify-content-between"},[n("a",{attrs:{href:e.account.url,title:e.account.acct}},[t._v(t._s(t.truncate(e.account.acct)))]),t._v(" "),n("a",{attrs:{href:e.url}},[t._v(t._s(t.timestamp(e)))])]),t._v(" "),n("p",{staticClass:"small text-muted text-truncate",domProps:{innerHTML:t._s(t.getTitle(e))}}),t._v(" "),n("div",{staticClass:"small text-muted d-flex