pixelfed/public/js/timeline.js

1 line
137 KiB
JavaScript
Raw Permalink Normal View History

2024-07-23 08:22:54 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[6631],{33422:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>a});const a={props:["status"]}},36639:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});var a=s(18634);const i={props:["status"],data:function(){return{sensitive:this.status.sensitive,cursor:0}},created:function(){},beforeDestroy:function(){},methods:{toggleContentWarning:function(t){this.$emit("togglecw")},toggleLightbox:function(t){(0,a.default)({el:t.target,gallery:"#carousel-"+this.status.id,position:this.$refs.carousel.currentPage})},altText:function(t){var e=t.description;return e||"Photo was not tagged with any alt text."},keypressNavigation:function(t){var e=this.$refs.carousel;if("37"==t.keyCode){t.preventDefault();var s="backward";e.advancePage(s),e.$emit("navigation-click",s)}if("39"==t.keyCode){t.preventDefault();var a="forward";e.advancePage(a),e.$emit("navigation-click",a)}}}}},9266:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});var a=s(18634);const i={props:["status"],data:function(){return{sensitive:this.status.sensitive}},mounted:function(){},methods:{altText:function(t){var e=t.media_attachments[0].description;return e||"Photo was not tagged with any alt text."},toggleContentWarning:function(t){this.$emit("togglecw")},toggleLightbox:function(t){(0,a.default)({el:t.target})},width:function(){if(this.status.media_attachments[0].meta&&this.status.media_attachments[0].meta.original&&this.status.media_attachments[0].meta.original.width)return this.status.media_attachments[0].meta.original.width},height:function(){if(this.status.media_attachments[0].meta&&this.status.media_attachments[0].meta.original&&this.status.media_attachments[0].meta.original.height)return this.status.media_attachments[0].meta.original.height}}}},35986:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>a});const a={props:["status"]}},25189:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>a});const a={props:["status"],methods:{altText:function(t){var e=t.media_attachments[0].description;return e||"Video was not tagged with any alt text."},playOrPause:function(t){var e=t.target;1==e.getAttribute("playing")?(e.removeAttribute("playing"),e.pause()):(e.setAttribute("playing",1),e.play())},toggleContentWarning:function(t){this.$emit("togglecw")},poster:function(){var t=this.status.media_attachments[0].preview_url;if(!t.endsWith("no-preview.jpg")&&!t.endsWith("no-preview.png"))return t}}}},25137:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});var a=s(74692);const i={data:function(){return{announcements:[],announcement:{},cursor:0,showNext:!0,showPrev:!1}},mounted:function(){this.fetchAnnouncements()},updated:function(){a('[data-toggle="tooltip"]').tooltip()},methods:{fetchAnnouncements:function(){var t=this,e=JSON.parse(window.localStorage.getItem("metro-tips-closed"));axios.get("/api/pixelfed/v1/newsroom/timeline").then((function(s){t.announcements=s.data.filter((function(t){return!e||-1==e.indexOf(t.id)})),t.announcement=t.announcements[0],1==t.announcements.length&&(t.showNext=!1)}))},loadNext:function(){this.showNext&&(this.cursor+=1,this.announcement=this.announcements[this.cursor],this.cursor+1==this.announcements.length&&(this.showNext=!1),this.cursor>=1&&(this.showPrev=!0))},loadPrev:function(){this.showPrev&&(this.cursor-=1,this.announcement=this.announcements[this.cursor],0==this.cursor&&(this.showPrev=!1),this.cursor<this.announcements.length&&(this.showNext=!0))},closeNewsroomPost:function(t,e){var s="metro-tips-closed",a=[],i=window.localStorage.getItem(s);i&&(a=JSON.parse(i)),a.push(t),window.localStorage.setItem(s,JSON.stringify(a)),this.newsroomPosts=this.newsroomPosts.filter((function(e){return e.id!==t})),0==this.newsroomPosts.length?this.showTips=!1:this.newsroomPost=[this.newsroomPosts[0]]},close:function(){window.localStorage.setItem("metro-tips",!1),this.$emit("show-tips",!1)},markAsRead:function(){var t=this;axios.post("/api/pixelfed/v1/newsroom/markasread",{id:this.announcement.id}).then((function(e){var s=t.cursor;t.announcements.splice(s,1),t.announcement=t.announcements[0],t.curs