pixelfed/public/js/status.js

1 line
119 KiB
JavaScript
Raw Normal View History

2021-05-25 05:25:59 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{"1WxE":function(t,e,i){(t.exports=i("I1BE")(!1)).push([t.i,"\n.momentui .bg-dark[data-v-3257e7f8] {\n background: #000 !important;\n}\n.momentui .carousel.slide[data-v-3257e7f8],\n.momentui .carousel-item[data-v-3257e7f8] {\n background: #000 !important;\n}\n.reply-btn[disabled][data-v-3257e7f8] {\n opacity: .3;\n color: #3897f0;\n}\n",""])},"2Jpm":function(t,e,i){"use strict";i.r(e);var s={props:["status"],methods:{playOrPause:function(t){var e=t.target;1==e.getAttribute("playing")?(e.removeAttribute("playing"),e.pause()):(e.setAttribute("playing",1),e.play())}}},n=i("KHd+"),a=Object(n.a)(s,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return 1==t.status.sensitive?i("div",[i("details",{staticClass:"details-animated"},[i("summary",[i("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),i("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),i("div",{staticClass:"embed-responsive embed-responsive-1by1"},[i("video",{staticClass:"video",attrs:{preload:"none",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id},on:{click:function(e){return t.playOrPause(e)}}},[i("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])])]):i("div",{staticClass:"embed-responsive embed-responsive-16by9"},[i("video",{staticClass:"video",attrs:{controls:"",preload:"metadata",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id}},[i("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])}),[],!1,null,null,null);e.default=a.exports},"4KG8":function(t,e,i){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function i(t,i,s){return i&&e(t.prototype,i),s&&e(t,s),t}if(Array.prototype.find||(Array.prototype.find=function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),s=i.length>>>0,n=arguments[1],a=0;a<s;a++)if(e=i[a],t.call(n,e,a,i))return e}),window&&"function"!=typeof window.CustomEvent){var s=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i};void 0!==window.Event&&(s.prototype=window.Event.prototype),window.CustomEvent=s}var n=function(){function e(i){t(this,e),this.tribute=i,this.tribute.events=this}return i(e,[{key:"bind",value:function(t){t.boundKeydown=this.keydown.bind(t,this),t.boundKeyup=this.keyup.bind(t,this),t.boundInput=this.input.bind(t,this),t.addEventListener("keydown",t.boundKeydown,!1),t.addEventListener("keyup",t.boundKeyup,!1),t.addEventListener("input",t.boundInput,!1)}},{key:"unbind",value:function(t){t.removeEventListener("keydown",t.boundKeydown,!1),t.removeEventListener("keyup",t.boundKeyup,!1),t.removeEventListener("input",t.boundInput,!1),delete t.boundKeydown,delete t.boundKeyup,delete t.boundInput}},{key:"keydown",value:function(t,i){t.shouldDeactivate(i)&&(t.tribute.isActive=!1,t.tribute.hideMenu());var s=this;t.commandEvent=!1,e.keys().forEach((function(e){e.key===i.keyCode&&(t.commandEvent=!0,t.callbacks()[e.value.toLowerCase()](i,s))}))}},{key:"input",value:function(t,e){t.inputEvent=!0,t.keyup.call(this,t,e)}},{key:"click",value:function(t,e){var i=t.tribute;if(i.menu&&i.menu.contains(e.target)){var s=e.target;for(e.preventDefault(),e.stopPropagation();"li"!==s.nodeName.toLowerCase();)if(!(s=s.parentNode)||s===i.menu)throw new Error("cannot find the <li> container for the click");i.selectItemAtIndex(s.getAttribute("data-index"),e),i.hideMenu()}else i.current.element&&!i.current.externalTrigger&&(i.cu