diff --git a/CHANGELOG.md b/CHANGELOG.md index 8945d146d..949a88602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Updated PostComponent, fix missing like button on comments ([132c1dce](https://github.com/pixelfed/pixelfed/commit/132c1dce)) - Updated PostComponent.vue, fix load more comments button ([847599ad](https://github.com/pixelfed/pixelfed/commit/847599ad)) - Updated 2FA Checkpoint, add username + logout button and numeric inputmode ([26affb11](https://github.com/pixelfed/pixelfed/commit/26affb11)) +- Updated RemoteProfile, fix missing content warnings ([e487527a](https://github.com/pixelfed/pixelfed/commit/e487527a)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) diff --git a/public/js/rempro.js b/public/js/rempro.js index b4de8b4fd..87e98ae6a 100644 --- a/public/js/rempro.js +++ b/public/js/rempro.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{"+GUX":function(t,e,n){Vue.component("remote-profile",n("9Y9R").default)},21:function(t,e,n){t.exports=n("+GUX")},"33Jl":function(t,e,n){var i=n("6oqA");"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,o);i.locals&&(t.exports=i.locals)},"6oqA":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n@media (min-width: 1200px) {\n.container[data-v-1c70ea71] {\n\t\tmax-width: 1050px;\n}\n}\n",""])},"9Y9R":function(t,e,n){"use strict";n.r(e);function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0})).map((function(t){return{id:t.id,caption:{text:t.content_text,html:t.content},count:{likes:t.favourites_count,shares:t.reblogs_count,comments:t.reply_count},thumb:t.media_attachments[0].preview_url,media:t.media_attachments,timestamp:t.created_at,type:t.pf_type,url:t.url}})),o=n.map((function(t){return t.id}));t.ids=o,t.min_id=Math.max.apply(Math,i(o)),t.max_id=Math.min.apply(Math,i(o)),t.feed=n,t.loading=!1})).catch((function(t){swal("Oops, something went wrong","Please release the page.","error")}))},fetchRelationships:function(){var t=this;0!=document.querySelectorAll("body")[0].classList.contains("loggedIn")&&axios.get("/api/pixelfed/v1/accounts/relationships",{params:{"id[]":this.profileId}}).then((function(e){e.data.length&&(t.relationship=e.data[0],1==e.data[0].blocking&&(t.loading=!1,t.warning=!0))}))},postPreviewUrl:function(t){return'background: url("'+t.thumb+'");background-size:cover'},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},remoteProfileUrl:function(t){return"/i/web/profile/_/"+t.id},remotePostUrl:function(t){return"/i/web/post/_/"+this.profile.id+"/"+t.id},followProfile:function(){var t=this;axios.post("/i/follow",{item:this.profileId}).then((function(e){swal("Followed","You are now following "+t.profile.username+"!","success"),t.relationship.following=!0})).catch((function(t){swal("Oops!","Something went wrong, please try again later.","error")}))},unfollowProfile:function(){var t=this;axios.post("/i/follow",{item:this.profileId}).then((function(e){swal("Unfollowed","You are no longer following "+t.profile.username+".","warning"),t.relationship.following=!1})).catch((function(t){swal("Oops!","Something went wrong, please try again later.","error")}))},showCtxMenu:function(){this.$refs.visitorContextMenu.show()},copyProfileLink:function(){navigator.clipboard.writeText(window.location.href),this.$refs.visitorContextMenu.hide()},muteProfile:function(){var t=this,e=this.profileId;axios.post("/i/mute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully muted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},unmuteProfile:function(){var t=this,e=this.profileId;axios.post("/i/unmute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unmuted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},blockProfile:function(){var t=this,e=this.profileId;axios.post("/i/block",{type:"user",item:e}).then((function(e){t.warning=!0,t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully blocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},unblockProfile:function(){var t=this,e=this.profileId;axios.post("/i/unblock",{type:"user",item:e}).then((function(e){t.warning=!1,t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unblocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},reportProfile:function(){window.location.href="/l/i/report?type=profile&id="+this.profileId,this.$refs.visitorContextMenu.hide()},ctxMenu:function(t){this.ctxMenuStatus=t;var e=this;axios.get("/api/pixelfed/v1/accounts/relationships",{params:{"id[]":e.profileId}}).then((function(t){e.ctxMenuRelationship=t.data[0],e.$refs.ctxModal.show()}))},closeCtxMenu:function(){this.ctxMenuStatus=!1,this.ctxMenuRelationship=!1,this.$refs.ctxModal.hide()},ctxMenuCopyLink:function(){var t=this.ctxMenuStatus;navigator.clipboard.writeText(t.url),this.closeCtxMenu()},ctxMenuGoToPost:function(){var t=this.ctxMenuStatus;window.location.href=this.statusUrl(t),this.closeCtxMenu()},statusUrl:function(t){return"/i/web/post/_/"+this.profile.id+"/"+t.id},deletePost:function(t){var e=this;0!=this.user.is_admin&&0!=window.confirm("Are you sure you want to delete this post?")&&axios.post("/i/delete",{type:"status",item:t.id}).then((function(n){e.feed=e.feed.filter((function(e){return e.id!=t.id})),e.$refs.ctxModal.hide()})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}}},r=(n("NKSr"),n("KHd+")),s=Object(r.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.relationship&&t.relationship.blocking&&t.warning?n("div",{staticClass:"bg-white pt-3 border-bottom"},[n("div",{staticClass:"container"},[n("p",{staticClass:"text-center font-weight-bold"},[t._v("You are blocking this account")]),t._v(" "),n("p",{staticClass:"text-center font-weight-bold"},[t._v("Click "),n("a",{staticClass:"cursor-pointer",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.warning=!1}}},[t._v("here")]),t._v(" to view profile")])])]):t._e(),t._v(" "),t.loading?n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"80vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]):t._e(),t._v(" "),t.loading||t.warning?t._e():n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-4 pt-5"},[n("div",{staticClass:"card shadow-none border"},[n("div",{staticClass:"card-header p-0 m-0"},[t.profile.header_bg?n("img",{staticStyle:{width:"100%",height:"140px","object-fit":"cover"},attrs:{src:t.profile.header_bg}}):n("div",{staticClass:"bg-primary",staticStyle:{width:"100%",height:"140px"}})]),t._v(" "),n("div",{staticClass:"card-body pb-0"},[n("div",{staticClass:"mt-n5 mb-3"},[n("img",{staticClass:"rounded-circle p-1 border mt-n4 bg-white shadow",attrs:{src:t.profile.avatar,width:"90px",height:"90px;"}}),t._v(" "),n("span",{staticClass:"float-right mt-n1"},[n("span",[t.relationship&&0==t.relationship.following?n("button",{staticClass:"btn btn-outline-light py-0 px-3 mt-n1",staticStyle:{"font-size":"13px","font-weight":"500"},on:{click:function(e){return t.followProfile()}}},[t._v("Follow")]):t._e(),t._v(" "),t.relationship&&1==t.relationship.following?n("button",{staticClass:"btn btn-outline-light py-0 px-3 mt-n1",staticStyle:{"font-size":"13px","font-weight":"500"},on:{click:function(e){return t.unfollowProfile()}}},[t._v("Unfollow")]):t._e()]),t._v(" "),n("span",{staticClass:"ml-3"},[n("button",{staticClass:"btn btn-outline-light btn-sm mt-n1",staticStyle:{"padding-top":"2px","padding-bottom":"1px"},on:{click:function(e){return t.showCtxMenu()}}},[n("i",{staticClass:"fas fa-cog cursor-pointer",staticStyle:{"font-size":"13px"}})])])])]),t._v(" "),n("p",{staticClass:"pl-2 h4 font-weight-bold mb-1"},[t._v(t._s(t.profile.display_name))]),t._v(" "),n("p",{staticClass:"pl-2 font-weight-bold mb-1 text-muted"},[t._v(t._s(t.profile.acct))]),t._v(" "),n("p",{staticClass:"pl-2 text-muted small pt-3",domProps:{innerHTML:t._s(t.profile.note)}}),t._v(" "),n("p",{staticClass:"pl-2 text-muted small d-flex justify-content-between"},[n("span",[n("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.statuses_count))]),t._v(" "),n("span",[t._v("Posts")])]),t._v(" "),n("span",[n("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.following_count))]),t._v(" "),n("span",[t._v("Following")])]),t._v(" "),n("span",[n("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.followers_count))]),t._v(" "),n("span",[t._v("Followers")])])])])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-8 pt-5"},[n("div",{staticClass:"row"},t._l(t.feed,(function(e,i){return n("div",{key:"remprop"+i,staticClass:"col-12 mb-2"},[n("div",{staticClass:"card mb-sm-4 status-card card-md-rounded-0 shadow-none border cursor-pointer"},[n("div",{staticClass:"card-header d-inline-flex align-items-center bg-white"},[n("img",{staticStyle:{"border-radius":"38px"},attrs:{src:t.profile.avatar,width:"38px",height:"38px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}}),t._v(" "),n("div",{staticClass:"pl-2"},[n("span",{staticClass:"username font-weight-bold text-dark"},[t._v(t._s(t.profile.username)+"\n\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),n("div",{staticClass:"text-right",staticStyle:{"flex-grow":"1"}},[n("button",{staticClass:"btn btn-link text-dark py-0",attrs:{type:"button"},on:{click:function(n){return t.ctxMenu(e)}}},[n("span",{staticClass:"fas fa-ellipsis-h text-lighter"})])])]),t._v(" "),n("div",{staticClass:"card-body p-0"},[n("a",{attrs:{href:e.url}},[t._o(n("img",{staticClass:"w-100 h-100",attrs:{src:e.thumb}}),0,"remprop"+i)])]),t._v(" "),n("div",{staticClass:"card-body"},[n("div",{staticClass:"caption"},[n("p",{staticClass:"mb-2 read-more",staticStyle:{overflow:"hidden"}},[n("span",{staticClass:"username font-weight-bold"},[n("bdi",[n("span",{staticClass:"text-dark"},[t._v(t._s(t.profile.username))])])]),t._v(" "),n("span",{staticClass:"status-content",domProps:{innerHTML:t._s(e.caption.html)}})])]),t._v(" "),n("div",{staticClass:"timestamp mt-2"},[n("p",{staticClass:"small text-uppercase mb-0"},[n("a",{staticClass:"text-muted",attrs:{href:t.remotePostUrl(e)}},[n("timeago",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],attrs:{datetime:e.timestamp,"auto-update":90,"converter-options":{includeSeconds:!0},title:t.timestampFormat(e.timestamp)}})],1)])])])])])})),0)])]),t._v(" "),n("b-modal",{ref:"visitorContextMenu",attrs:{id:"visitor-context-menu","hide-footer":"","hide-header":"",centered:"",size:"sm","body-class":"list-group-flush p-0"}},[t.relationship?n("div",{staticClass:"list-group"},[n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.copyProfileLink}},[t._v("\n\t\t\t\t\tCopy Link\n\t\t\t\t")]),t._v(" "),!t.user||t.owner||t.relationship.muting?t._e():n("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.muteProfile}},[t._v("\n\t\t\t\t\tMute\n\t\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.muting?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.unmuteProfile}},[t._v("\n\t\t\t\t\tUnmute\n\t\t\t\t")]):t._e(),t._v(" "),t.user&&!t.owner?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.reportProfile}},[t._v("\n\t\t\t\t\tReport User\n\t\t\t\t")]):t._e(),t._v(" "),!t.user||t.owner||t.relationship.blocking?t._e():n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.blockProfile}},[t._v("\n\t\t\t\t\tBlock\n\t\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.blocking?n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.unblockProfile}},[t._v("\n\t\t\t\t\tUnblock\n\t\t\t\t")]):t._e(),t._v(" "),n("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-muted",on:{click:function(e){return t.$refs.visitorContextMenu.hide()}}},[t._v("\n\t\t\t\t\tClose\n\t\t\t\t")])]):t._e()]),t._v(" "),n("b-modal",{ref:"ctxModal",attrs:{id:"ctx-modal","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[n("div",{staticClass:"list-group text-center"},[t.ctxMenuStatus&&t.profile.id!=t.profile.id?n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-danger",on:{click:function(e){return t.ctxMenuReportPost()}}},[t._v("Report inappropriate")]):t._e(),t._v(" "),t.ctxMenuStatus&&t.profile.id!=t.profile.id&&t.ctxMenuRelationship&&t.ctxMenuRelationship.following?n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-danger",on:{click:function(e){return t.ctxMenuUnfollow()}}},[t._v("Unfollow")]):t._e(),t._v(" "),t.ctxMenuStatus&&t.profile.id!=t.profile.id&&t.ctxMenuRelationship&&!t.ctxMenuRelationship.following?n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-primary",on:{click:function(e){return t.ctxMenuFollow()}}},[t._v("Follow")]):t._e(),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxMenuGoToPost()}}},[t._v("Go to post")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxMenuCopyLink()}}},[t._v("Copy Link")]),t._v(" "),t.profile&&1==t.profile.is_admin?n("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxModMenuShow()}}},[t._v("Moderation Tools")]):t._e(),t._v(" "),t.ctxMenuStatus&&(t.profile.is_admin||t.profile.id==t.profile.id)?n("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.deletePost(t.ctxMenuStatus)}}},[t._v("Delete")]):t._e(),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.closeCtxMenu()}}},[t._v("Cancel")])])])],1)])}),[],!1,null,"1c70ea71",null);e.default=s.exports},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,r=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(o=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:i+r.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=(s=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(r).concat([o]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},o=0;o=0&&f.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return w(e,t.attrs),v(t,e),e}function w(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function x(t,e){var n,i,o,r;if(e.transform&&t.css){if(!(r="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=r}if(e.singleton){var s=u++;n=c||(c=g(e)),i=y.bind(null,n,s,!1),o=y.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",w(e,t.attrs),v(t,e),e}(e),i=M.bind(null,n,e),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),i=C.bind(null,n),o=function(){m(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var i=[],o=0;o0})).map((function(t){return{id:t.id,caption:{text:t.content_text,html:t.content},count:{likes:t.favourites_count,shares:t.reblogs_count,comments:t.reply_count},thumb:t.media_attachments[0].preview_url,media:t.media_attachments,timestamp:t.created_at,type:t.pf_type,url:t.url,sensitive:t.sensitive,cw:t.sensitive}})),o=i.map((function(t){return t.id}));t.ids=o,t.min_id=Math.max.apply(Math,n(o)),t.max_id=Math.min.apply(Math,n(o)),t.feed=i,t.loading=!1})).catch((function(t){swal("Oops, something went wrong","Please release the page.","error")}))},fetchRelationships:function(){var t=this;0!=document.querySelectorAll("body")[0].classList.contains("loggedIn")&&axios.get("/api/pixelfed/v1/accounts/relationships",{params:{"id[]":this.profileId}}).then((function(e){e.data.length&&(t.relationship=e.data[0],1==e.data[0].blocking&&(t.loading=!1,t.warning=!0))}))},postPreviewUrl:function(t){return'background: url("'+t.thumb+'");background-size:cover'},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},remoteProfileUrl:function(t){return"/i/web/profile/_/"+t.id},remotePostUrl:function(t){return"/i/web/post/_/"+this.profile.id+"/"+t.id},followProfile:function(){var t=this;axios.post("/i/follow",{item:this.profileId}).then((function(e){swal("Followed","You are now following "+t.profile.username+"!","success"),t.relationship.following=!0})).catch((function(t){swal("Oops!","Something went wrong, please try again later.","error")}))},unfollowProfile:function(){var t=this;axios.post("/i/follow",{item:this.profileId}).then((function(e){swal("Unfollowed","You are no longer following "+t.profile.username+".","warning"),t.relationship.following=!1})).catch((function(t){swal("Oops!","Something went wrong, please try again later.","error")}))},showCtxMenu:function(){this.$refs.visitorContextMenu.show()},copyProfileLink:function(){navigator.clipboard.writeText(window.location.href),this.$refs.visitorContextMenu.hide()},muteProfile:function(){var t=this,e=this.profileId;axios.post("/i/mute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully muted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},unmuteProfile:function(){var t=this,e=this.profileId;axios.post("/i/unmute",{type:"user",item:e}).then((function(e){t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unmuted "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},blockProfile:function(){var t=this,e=this.profileId;axios.post("/i/block",{type:"user",item:e}).then((function(e){t.warning=!0,t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully blocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},unblockProfile:function(){var t=this,e=this.profileId;axios.post("/i/unblock",{type:"user",item:e}).then((function(e){t.warning=!1,t.fetchRelationships(),t.$refs.visitorContextMenu.hide(),swal("Success","You have successfully unblocked "+t.profile.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")})),this.$refs.visitorContextMenu.hide()},reportProfile:function(){window.location.href="/l/i/report?type=profile&id="+this.profileId,this.$refs.visitorContextMenu.hide()},ctxMenu:function(t){this.ctxMenuStatus=t;var e=this;axios.get("/api/pixelfed/v1/accounts/relationships",{params:{"id[]":e.profileId}}).then((function(t){e.ctxMenuRelationship=t.data[0],e.$refs.ctxModal.show()}))},closeCtxMenu:function(){this.ctxMenuStatus=!1,this.ctxMenuRelationship=!1,this.$refs.ctxModal.hide()},ctxMenuCopyLink:function(){var t=this.ctxMenuStatus;navigator.clipboard.writeText(t.url),this.closeCtxMenu()},ctxMenuGoToPost:function(){var t=this.ctxMenuStatus;window.location.href=this.statusUrl(t),this.closeCtxMenu()},statusUrl:function(t){return"/i/web/post/_/"+this.profile.id+"/"+t.id},deletePost:function(t){var e=this;0!=this.user.is_admin&&0!=window.confirm("Are you sure you want to delete this post?")&&axios.post("/i/delete",{type:"status",item:t.id}).then((function(i){e.feed=e.feed.filter((function(e){return e.id!=t.id})),e.$refs.ctxModal.hide()})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))}}},r=(i("djXL"),i("KHd+")),s=Object(r.a)(o,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.relationship&&t.relationship.blocking&&t.warning?i("div",{staticClass:"bg-white pt-3 border-bottom"},[i("div",{staticClass:"container"},[i("p",{staticClass:"text-center font-weight-bold"},[t._v("You are blocking this account")]),t._v(" "),i("p",{staticClass:"text-center font-weight-bold"},[t._v("Click "),i("a",{staticClass:"cursor-pointer",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.warning=!1}}},[t._v("here")]),t._v(" to view profile")])])]):t._e(),t._v(" "),t.loading?i("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"80vh"}},[i("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]):t._e(),t._v(" "),t.loading||t.warning?t._e():i("div",{staticClass:"container"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12 col-md-4 pt-5"},[i("div",{staticClass:"card shadow-none border"},[i("div",{staticClass:"card-header p-0 m-0"},[t.profile.header_bg?i("img",{staticStyle:{width:"100%",height:"140px","object-fit":"cover"},attrs:{src:t.profile.header_bg}}):i("div",{staticClass:"bg-primary",staticStyle:{width:"100%",height:"140px"}})]),t._v(" "),i("div",{staticClass:"card-body pb-0"},[i("div",{staticClass:"mt-n5 mb-3"},[i("img",{staticClass:"rounded-circle p-1 border mt-n4 bg-white shadow",attrs:{src:t.profile.avatar,width:"90px",height:"90px;"}}),t._v(" "),i("span",{staticClass:"float-right mt-n1"},[i("span",[t.relationship&&0==t.relationship.following?i("button",{staticClass:"btn btn-outline-light py-0 px-3 mt-n1",staticStyle:{"font-size":"13px","font-weight":"500"},on:{click:function(e){return t.followProfile()}}},[t._v("Follow")]):t._e(),t._v(" "),t.relationship&&1==t.relationship.following?i("button",{staticClass:"btn btn-outline-light py-0 px-3 mt-n1",staticStyle:{"font-size":"13px","font-weight":"500"},on:{click:function(e){return t.unfollowProfile()}}},[t._v("Unfollow")]):t._e()]),t._v(" "),i("span",{staticClass:"ml-3"},[i("button",{staticClass:"btn btn-outline-light btn-sm mt-n1",staticStyle:{"padding-top":"2px","padding-bottom":"1px"},on:{click:function(e){return t.showCtxMenu()}}},[i("i",{staticClass:"fas fa-cog cursor-pointer",staticStyle:{"font-size":"13px"}})])])])]),t._v(" "),i("p",{staticClass:"pl-2 h4 font-weight-bold mb-1"},[t._v(t._s(t.profile.display_name))]),t._v(" "),i("p",{staticClass:"pl-2 font-weight-bold mb-1 text-muted"},[t._v(t._s(t.profile.acct))]),t._v(" "),i("p",{staticClass:"pl-2 text-muted small pt-3",domProps:{innerHTML:t._s(t.profile.note)}}),t._v(" "),i("p",{staticClass:"pl-2 text-muted small d-flex justify-content-between"},[i("span",[i("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.statuses_count))]),t._v(" "),i("span",[t._v("Posts")])]),t._v(" "),i("span",[i("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.following_count))]),t._v(" "),i("span",[t._v("Following")])]),t._v(" "),i("span",[i("span",{staticClass:"font-weight-bold text-dark"},[t._v(t._s(t.profile.followers_count))]),t._v(" "),i("span",[t._v("Followers")])])])])])]),t._v(" "),i("div",{staticClass:"col-12 col-md-8 pt-5"},[i("div",{staticClass:"row"},t._l(t.feed,(function(e,n){return i("div",{key:"remprop"+n,staticClass:"col-12 mb-2"},[i("div",{staticClass:"card mb-sm-4 status-card card-md-rounded-0 shadow-none border cursor-pointer"},[i("div",{staticClass:"card-header d-inline-flex align-items-center bg-white"},[i("img",{staticStyle:{"border-radius":"38px"},attrs:{src:t.profile.avatar,width:"38px",height:"38px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}}),t._v(" "),i("div",{staticClass:"pl-2"},[i("span",{staticClass:"username font-weight-bold text-dark"},[t._v(t._s(t.profile.username)+"\n\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),i("div",{staticClass:"text-right",staticStyle:{"flex-grow":"1"}},[i("button",{staticClass:"btn btn-link text-dark py-0",attrs:{type:"button"},on:{click:function(i){return t.ctxMenu(e)}}},[i("span",{staticClass:"fas fa-ellipsis-h text-lighter"})])])]),t._v(" "),i("div",{staticClass:"card-body p-0"},[1==e.sensitive?i("div",[i("details",{staticClass:"details-animated",on:{click:function(t){e.sensitive=!1}}},[t._m(0,!0),t._v(" "),i("a",{attrs:{href:e.url}},[t._o(i("img",{staticClass:"w-100 h-100",attrs:{src:e.thumb}}),0,"remprop"+n)])])]):i("div",[i("a",{attrs:{href:e.url}},[t._o(i("img",{staticClass:"w-100 h-100",attrs:{src:e.thumb}}),1,"remprop"+n)]),t._v(" "),1==e.cw&&0==e.sensitive?i("button",{staticClass:"btn btn-block btn-primary font-weight-bold rounded-0",on:{click:function(t){e.sensitive=!0}}},[t._v("Hide Media")]):t._e()])]),t._v(" "),i("div",{staticClass:"card-body"},[i("div",{staticClass:"caption"},[i("p",{staticClass:"mb-2 read-more",staticStyle:{overflow:"hidden"}},[i("span",{staticClass:"username font-weight-bold"},[i("bdi",[i("span",{staticClass:"text-dark"},[t._v(t._s(t.profile.username))])])]),t._v(" "),i("span",{staticClass:"status-content",domProps:{innerHTML:t._s(e.caption.html)}})])]),t._v(" "),i("div",{staticClass:"timestamp mt-2"},[i("p",{staticClass:"small text-uppercase mb-0"},[i("a",{staticClass:"text-muted",attrs:{href:t.remotePostUrl(e)}},[i("timeago",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],attrs:{datetime:e.timestamp,"auto-update":90,"converter-options":{includeSeconds:!0},title:t.timestampFormat(e.timestamp)}})],1)])])])])])})),0)])]),t._v(" "),i("b-modal",{ref:"visitorContextMenu",attrs:{id:"visitor-context-menu","hide-footer":"","hide-header":"",centered:"",size:"sm","body-class":"list-group-flush p-0"}},[t.relationship?i("div",{staticClass:"list-group"},[i("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.copyProfileLink}},[t._v("\n\t\t\t\t\tCopy Link\n\t\t\t\t")]),t._v(" "),!t.user||t.owner||t.relationship.muting?t._e():i("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.muteProfile}},[t._v("\n\t\t\t\t\tMute\n\t\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.muting?i("div",{staticClass:"list-group-item cursor-pointer text-center rounded",on:{click:t.unmuteProfile}},[t._v("\n\t\t\t\t\tUnmute\n\t\t\t\t")]):t._e(),t._v(" "),t.user&&!t.owner?i("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.reportProfile}},[t._v("\n\t\t\t\t\tReport User\n\t\t\t\t")]):t._e(),t._v(" "),!t.user||t.owner||t.relationship.blocking?t._e():i("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.blockProfile}},[t._v("\n\t\t\t\t\tBlock\n\t\t\t\t")]),t._v(" "),t.user&&!t.owner&&t.relationship.blocking?i("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-dark",on:{click:t.unblockProfile}},[t._v("\n\t\t\t\t\tUnblock\n\t\t\t\t")]):t._e(),t._v(" "),i("div",{staticClass:"list-group-item cursor-pointer text-center rounded text-muted",on:{click:function(e){return t.$refs.visitorContextMenu.hide()}}},[t._v("\n\t\t\t\t\tClose\n\t\t\t\t")])]):t._e()]),t._v(" "),i("b-modal",{ref:"ctxModal",attrs:{id:"ctx-modal","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[i("div",{staticClass:"list-group text-center"},[t.ctxMenuStatus&&t.profile.id!=t.profile.id?i("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-danger",on:{click:function(e){return t.ctxMenuReportPost()}}},[t._v("Report inappropriate")]):t._e(),t._v(" "),t.ctxMenuStatus&&t.profile.id!=t.profile.id&&t.ctxMenuRelationship&&t.ctxMenuRelationship.following?i("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-danger",on:{click:function(e){return t.ctxMenuUnfollow()}}},[t._v("Unfollow")]):t._e(),t._v(" "),t.ctxMenuStatus&&t.profile.id!=t.profile.id&&t.ctxMenuRelationship&&!t.ctxMenuRelationship.following?i("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold text-primary",on:{click:function(e){return t.ctxMenuFollow()}}},[t._v("Follow")]):t._e(),t._v(" "),i("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxMenuGoToPost()}}},[t._v("Go to post")]),t._v(" "),i("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxMenuCopyLink()}}},[t._v("Copy Link")]),t._v(" "),t.profile&&1==t.profile.is_admin?i("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.ctxModMenuShow()}}},[t._v("Moderation Tools")]):t._e(),t._v(" "),t.ctxMenuStatus&&(t.profile.is_admin||t.profile.id==t.profile.id)?i("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:function(e){return t.deletePost(t.ctxMenuStatus)}}},[t._v("Delete")]):t._e(),t._v(" "),i("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.closeCtxMenu()}}},[t._v("Cancel")])])])],1)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("summary",[e("p",{staticClass:"mb-0 lead font-weight-bold"},[this._v("CW / NSFW / Hidden Media")]),this._v(" "),e("p",{staticClass:"font-weight-light"},[this._v("(click to show)")])])}],!1,null,"7a23ca4c",null);e.default=s.exports},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var i=e.protocol+"//"+e.host,n=i+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,r=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(o=0===r.indexOf("//")?r:0===r.indexOf("/")?i+r:n+r.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=function(t,e){var i=t[1]||"",n=t[3];if(!n)return i;if(e&&"function"==typeof btoa){var o=(s=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=n.sources.map((function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"}));return[i].concat(r).concat([o]).join("\n")}var s;return[i].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i})).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},o=0;o=0&&d.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return i.nc}();n&&(t.attrs.nonce=n)}return w(e,t.attrs),v(t,e),e}function w(t,e){Object.keys(e).forEach((function(i){t.setAttribute(i,e[i])}))}function _(t,e){var i,n,o,r;if(e.transform&&t.css){if(!(r="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=r}if(e.singleton){var s=u++;i=l||(l=g(e)),n=C.bind(null,i,s,!1),o=C.bind(null,i,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",w(e,t.attrs),v(t,e),e}(e),n=M.bind(null,i,e),o=function(){m(i),i.href&&URL.revokeObjectURL(i.href)}):(i=g(e),n=y.bind(null,i),o=function(){m(i)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var i=h(t,e);return p(i,e),function(t){for(var n=[],o=0;o
- - - +
+
+ +

CW / NSFW / Hidden Media

+

(click to show)

+
+ + + +
+
+
+ + + + +
@@ -225,7 +239,9 @@ media: status.media_attachments, timestamp: status.created_at, type: status.pf_type, - url: status.url + url: status.url, + sensitive: status.sensitive, + cw: status.sensitive } }); let ids = data.map(status => status.id);