pixelfed/public/js/groups.js

1 line
312 KiB
JavaScript
Raw Normal View History

2024-10-06 06:53:38 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[7610],{19933:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});var a=s(18115),o=s(71307),i=s(49139);const r={props:{groupId:{type:String},path:{type:String}},data:function(){return{tab:"home"}},components:{"groups-home":a.default,"create-group":i.default,"group-feed":o.default},mounted:function(){this.groupId&&(this.tab="show")},methods:{switchTab:function(t){this.tab=t}}}},22681:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var a=s(71347),o=s(69104),i=s(40482),r=s(62181);const n={components:{"text-input":a.default,"select-input":o.default,"text-area-input":i.default,"checkbox-input":r.default},data:function(){return{hide:!0,name:null,page:1,maxPage:1,description:null,membership:"placeholder",submitting:!1,categories:[],category:"",limit:{name:{max:60},description:{max:500}},configuration:{types:{text:!0,photos:!0,videos:!0,polls:!0},federation:!0,adult:!1,discoverable:!1,autospam:!1,dms:!1,slowjoin:{enabled:!1,age:90,limit:{post:1,comment:20,threads:2,likes:5,hashtags:5,mentions:1,autolinks:1}}},hasConfirmed:!1,permissionChecked:!1,membershipCategories:[{key:"Public",value:"public"}]}},mounted:function(){this.permissionCheck(),this.fetchCategories()},methods:{permissionCheck:function(){var t=this;axios.post("/api/v0/groups/permission/create").then((function(e){0==e.data.permission?(swal("Limit reached","You cannot create any more groups","error"),t.hide=!0):t.hide=!1,t.permissionChecked=!0}))},submit:function(t){t.preventDefault(),this.submitting=!0,axios.post("/api/v0/groups/create",{name:this.name,description:this.description,membership:this.membership}).then((function(t){console.log(t.data),window.location.href=t.data.url})).catch((function(t){console.log(t.response)}))},fetchCategories:function(){var t=this;axios.get("/api/v0/groups/categories/list").then((function(e){t.categories=e.data.map((function(t){return{key:t,value:t}}))}))},createGroup:function(){axios.post("/api/v0/groups/create",{name:this.name,description:this.description,membership:this.membership,configuration:this.configuration}).then((function(t){console.log(t.data),location.href=t.data.url}))},handleUpdate:function(t,e){this[t]=e}}}},72233:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>h});var a=s(79984),o=s(17108),i=s(95002),r=s(13094),n=s(58753),l=s(94559),c=s(19413),d=s(49268),u=s(33457),p=s(52505);function f(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var s={}.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?m(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,a=Array(e);s<e;s++)a[s]=t[s];return a}const h={props:{groupId:{type:String},path:{type:String},permalinkMode:{type:Boolean,default:!1},permalinkId:{type:String}},components:{"status-card":a.default,"group-status":i.default,"group-compose":o.default,"group-info-card":r.default,"leave-group":n.default,"search-modal":l.default,"invite-modal":c.default,"group-banner":d.default,"group-header-details":p.default,"group-nav-tabs":u.default},data:function(){return{initalLoad:!1,profile:void 0,group:{},isMember:!1,isAdmin:!1,tab:"feed",requestingMembership:!1,composeText:null,feed:[],ids:[],maxId:null,status:void 0,likes:[],likesPage:1,likesId:void 0,renderIdx:1,atabs:{moderation_count:0,request_count:0}}},created:function(){this.fetchSelf()},methods:{fetchSelf:function(){var t=this;axios.get("/api/v1/accounts/verify_credentials?_pe=1").then((function(e){t.profile=e.data})).catch((function(t){window.location.href="/login?_next="+encodeURIComponent(window.location.href)})).finally((function(){t.fetchGrou