pixelfed/public/js/status.js

1 line
122 KiB
JavaScript
Raw Normal View History

2021-07-21 00:15:30 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{"2Jpm":function(t,e,i){"use strict";i.r(e);var s={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")}}},n=(i("XWj2"),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",{staticClass:"content-label-wrapper"},[i("div",{staticClass:"text-light content-label"},[t._m(0),t._v(" "),i("p",{staticClass:"h4 font-weight-bold text-center"},[t._v("\n\t\t\tSensitive Content\n\t\t")]),t._v(" "),i("p",{staticClass:"text-center py-2"},[t._v("\n\t\t\t"+t._s(t.status.spoiler_text?t.status.spoiler_text:"This post may contain sensitive content.")+"\n\t\t")]),t._v(" "),i("p",{staticClass:"mb-0"},[i("button",{staticClass:"btn btn-outline-light btn-block btn-sm font-weight-bold",on:{click:function(e){return t.toggleContentWarning()}}},[t._v("See Post")])])]),t._v(" "),i("blur-hash-image",{attrs:{width:"32",height:"32",punch:1,hash:t.status.media_attachments[0].blurhash,alt:t.altText(t.status)}})],1):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}})])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-eye-slash fa-2x"})])}],!1,null,"4b79c47a",null);e.default=a.exports},"34Mn":function(t,e,i){var s=i("RSJq");"string"==typeof s&&(s=[[t.i,s,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};i("aET+")(s,n);s.locals&&(t.exports=s.locals)},"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.no