PageSourceSearch

https://xcp-ng.org/forum/assets/forum/account-info.0b38d0982d36130abe04.min.js

js xcp-ng.org collected 2026-10-01 11:29:42 UTC 13,500 bytes, 1 lines download raw bytes

1(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[4884,50723,62648,97082],{67910(g,v,c){"use strict";var m,l;m=[c(36684),c(72254),c(52473),c(17459),c(47283),c(28061),c(7524),c(49897),c(65303),c(29930)],l=(function(h,t,a,n,e,i,r,o,d,u){const s={};let p;s.init=function(){p=ajaxify.data.isAdmin||ajaxify.data.isSelf||ajaxify.data.isGlobalModerator,x(),p&&A(),a.get("account/follow").on("click",()=>C("follow")),a.get("account/unfollow").on("click",()=>C("unfollow")),a.get("account/chat").on("click",async function(){const{roomId:f}=await o.get(`/users/${encodeURIComponent(ajaxify.data.uid)}/chat`),y=await app.require("chat");f?y.openChat(f):y.newChat(ajaxify.data.uid)}),a.get("account/new-chat").on("click",async function(){(await app.require("chat")).newChat(ajaxify.data.uid,function(){a.get("account/chat").parent().removeClass("hidden")})}),a.get("account/ban").on("click",()=>i.banAccount(ajaxify.data.theirid)),a.get("account/mute").on("click",()=>i.muteAccount(ajaxify.data.theirid)),a.get("account/unban").on("click",()=>i.unbanAccount(ajaxify.data.theirid)),a.get("account/unmute").on("click",()=>i.unmuteAccount(ajaxify.data.theirid)),a.get("account/delete-account").on("click",()=>e.account(ajaxify.data.theirid)),a.get("account/delete-content").on("click",()=>e.content(ajaxify.data.theirid)),a.get("account/delete-all").on("click",()=>e.purge(ajaxify.data.theirid)),a.get("account/flag").on("click",j),a.get("account/already-flagged").on("click",k),a.get("account/block").on("click",()=>D("block")),a.get("account/unblock").on("click",()=>D("unblock"))};function x(){$('[component="profile/change/picture"]').on("click",function(){return r.openChangeModal(),!1})}function A(){h.init(a.get("account/cover"),function(f,y,b){socket.emit("user.updateCover",{uid:ajaxify.data.uid,imageData:f,position:y},b)},function(){t.show({title:"[[user:upload-cover-picture]]",socketMethod:"user.updateCover",aspectRatio:NaN,allowSkippingCrop:!0,restrictImageDimension:!1,paramName:"uid",paramValue:ajaxify.data.theirid,accept:".png,.jpg,.bmp"},function(f){f=(f.startsWith("http")?"":config.relative_path)+f+"?"+Date.now(),a.get("account/cover").css("background-image","url("+f+")")})},w)}function C(f){if(!app.user.uid){let b;return utils.isNumber(ajaxify.data.uid)?b=config.url+"/user/"+ajaxify.data.uid:b=ajaxify.data.userslug,c.e(91722).then(()=>c(91722)).then(({trigger:E})=>{E("follow",{object:b})}),!1}const y=isFinite(ajaxify.data.uid)?ajaxify.data.uid:encodeURIComponent(ajaxify.data.userslug);return o[f==="follow"?"put":"del"]("/users/"+y+"/follow",void 0,function(b){if(b)return u.error(b);a.get("account/follow").toggleClass("hide",f==="follow"),a.get("account/unfollow").toggleClass("hide",f==="unfollow"),u.success("[[global:alert."+f+", "+ajaxify.data.username+"]]")}),!1}function j(){c.e(6574).then(function(){var f=[c(6574)];(function(y){y.showFlagModal({type:"user",id:ajaxify.data.uid})}).apply(null,f)}).catch(c.oe)}function k(){const f=$(this).data("flag-id");c.e(6574).then(function(){var y=[c(6574)];(function(b){d.confirm("[[flags:modal-confirm-rescind]]",function(E){E&&b.rescind(f)})}).apply(null,y)}).catch(c.oe)}function D(f){return socket.emit("user.toggleBlock",{blockeeUid:ajaxify.data.uid,blockerUid:app.user.uid,action:f},function(y,b){if(y)return u.error(y);a.get("account/block").toggleClass("hidden",b),a.get("account/unblock").toggleClass("hidden",!b)}),!1}function w(){d.confirm("[[user:remove-cover-picture-confirm]]",function(f){f&&socket.emit("user.removeCover",{uid:ajaxify.data.uid},function(y){y?u.error(y):ajaxify.refresh()})})}return s}).apply(v,m),l!==void 0&&(g.exports=l)},48435(g,v,c){"use strict";var m,l;m=[c(67910),c(29930),c(41326)],l=(function(h,t,a){const n={};n.init=function(){h.init(),e(),a.prepareSessionRevocation()};function e(){const i=$('[component="account/moderation-note/list"]');function r(o){o.css({height:o.prop("scrollHeight")+"px"})}$('[component="account/save-moderation-note"]').on("click",function(){const o=$('[component="account/moderation-note"]'),d=o.val();socket.emit("user.setModerationNote",{uid:ajaxify.data.uid,note:d},function(u,s){if(u)return t.error(u);o.val(""),app.parseAndTranslate("account/info","moderationNotes",{moderationNotes:s},function(p){i.prepend(p),p.find(".timeago").timeago()})})}),i.on("click",'[component="account/moderation-note/delete"]',async function(){const o=$(this).parents("[data-id]");socket.emit("user.deleteModerationNote",{uid:ajaxify.data.uid,id:o.attr("data-id")}).then(()=>{o.remove()}).catch(t.error)}),i.on("click",'[component="account/moderation-note/edit"]',function(){const o=$(this).parents("[data-id]"),d=o.find('[component="account/moderation-note/content-area"]'),u=o.find('[component="account/moderation-note/edit-area"]');d.addClass("hidden"),u.removeClass("hidden"),r(u.find("textarea")),u.find("textarea").trigger("focus").putCursorAtEnd()}),i.on("click",'[component="account/moderation-note/save-edit"]',function(){const o=$(this).parents("[data-id]"),d=o.find('[component="account/moderation-note/content-area"]'),u=o.find('[component="account/moderation-note/edit-area"]');d.removeClass("hidden");const s=u.find("textarea");socket.emit("user.editModerationNote",{uid:ajaxify.data.uid,id:o.attr("data-id"),note:s.val()},function(p,x){if(p)return t.error(p);s.css({height:s.prop("scrollHeight")+"px"}),u.addClass("hidden"),d.find(".content").html(x[0].note)})}),i.on("click",'[component="account/moderation-note/cancel-edit"]',function(){const o=$(this).parents("[data-id]"),d=o.find('[component="account/moderation-note/content-area"]'),u=o.find('[component="account/moderation-note/edit-area"]');d.removeClass("hidden"),u.addClass("hidden")})}return n}).apply(v,m),l!==void 0&&(g.exports=l)},41326(g,v,c){"use strict";var m,l;m=[c(67910),c(52473),c(49897),c(29930)],l=(function(h,t,a,n){const e={};return e.init=function(){h.init(),e.prepareSessionRevocation()},e.prepareSessionRevocation=function(){t.get("user/sessions").on("click","[data-action]",function(){const i=$(this).parents("[data-uuid]"),r=i.attr("data-uuid");
1r&&a.del(`/users/${ajaxify.data.uid}/sessions/${r}`,{}).then(()=>{i.remove()}).catch(o=>{try{const d=JSON.parse(o.responseText);d.loggedIn===!1&&(window.location.href=config.relative_path+"/login?error="+d.title),n.error(d.title)}catch(d){console.error(d),n.error("[[error:invalid-data]]")}})})},e}).apply(v,m),l!==void 0&&(g.exports=l)},47283(g,v,c){"use strict";var m,l;m=[c(49897),c(65303),c(29930)],l=(function(h,t,a){const n={};n.account=function(i,r){e(i,"[[user:delete-this-account-confirm]]","/account","[[user:account-deleted]]",r)},n.content=function(i,r){e(i,"[[user:delete-account-content-confirm]]","/content","[[user:account-content-deleted]]",r)},n.purge=function(i,r){e(i,"[[user:delete-all-confirm]]","","[[user:account-deleted]]",r)};function e(i,r,o,d,u){t.confirm(r,function(s){s&&h.del(`/users/${encodeURIComponent(i)}${o}`,{}).then(()=>{if(a.success(d),typeof u=="function")return u()}).catch(a.error)})}return n}).apply(v,m),l!==void 0&&(g.exports=l)},28061(g,v,c){"use strict";var m,l;m=[c(49897),c(65303),c(29930),c(81335)],l=(function(h,t,a,n){const e={};e.banAccount=function(r,o){r=r||ajaxify.data.theirid,i({tpl:"modals/temporary-ban",title:"[[user:ban-account]]",type:"ban",onSubmit:function(d){h.put("/users/"+encodeURIComponent(r)+"/ban",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof o=="function")return o();ajaxify.refresh()}).catch(a.error)}})},e.unbanAccount=function(r){i({tpl:"modals/unban",title:"[[user:unban-account]]",type:"ban",onSubmit:function(o){h.del("/users/"+encodeURIComponent(r)+"/ban",{reason:o.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})},e.muteAccount=function(r,o){r=r||ajaxify.data.theirid,i({tpl:"modals/temporary-mute",title:"[[user:mute-account]]",type:"mute",onSubmit:function(d){h.put("/users/"+r+"/mute",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof o=="function")return o();ajaxify.refresh()}).catch(a.error)}})},e.unmuteAccount=function(r){i({tpl:"modals/unmute",title:"[[user:unmute-account]]",onSubmit:function(o){h.del("/users/"+r+"/mute",{reason:o.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})};async function i(r){const o=await socket.emit("user.getCustomReasons",{type:r.type||""}),d=await n.render(r.tpl,{reasons:o}),u=await t.dialog({title:r.title,message:d,onEscape:!0,buttons:{close:{label:"[[global:close]]",className:"btn-link"},submit:{label:r.title,callback:function(){const s=u.find("form").serializeArray().reduce(function(p,x){return p[x.name]=x.value,p},{});if(Object.hasOwn(s,"length")){const x=parseInt(s.unit,10)?24:1;s.until=s.length>0?Date.now()+s.length*36e5*x:0}else s.until=0;r.onSubmit(s)}}}});return u.find("[data-key]").on("click",function(){const s=o.find(p=>String(p.key)===$(this).attr("data-key"));s&&s.body&&u.find('[name="reason"]').val(s.body)}),u}return e.throwModal=i,e}).apply(v,m),l!==void 0&&(g.exports=l)},36684(g,v,c){"use strict";var m,l;m=[c(29930),c(18675)],l=(function(h){const t={coverEl:null,saveFn:null};t.init=function(n,e,i,r){t.coverEl=n,t.saveFn=e,n.find(".upload").on("click",i),n.find(".resize").on("click",function(){a(n)}),n.find(".remove").on("click",r),n.on("dragover",t.onDragOver).on("drop",t.onDrop),n.find(".save").on("click",t.save),n.addClass("initialised")},t.onDragOver=function(n){n.stopPropagation(),n.preventDefault(),n.originalEvent.dataTransfer.dropEffect="copy"},t.onDrop=function(n){n.stopPropagation(),n.preventDefault();const e=n.originalEvent.dataTransfer.files,i=new FileReader;e.length&&e[0].type.match("image.*")&&(i.onload=function(r){t.coverEl.css("background-image","url("+r.target.result+")"),t.newCover=r.target.result},i.readAsDataURL(e[0]),a(t.coverEl))};function a(n){n.toggleClass("active",1).backgroundDraggable({axis:"y",units:"percent"}),h.alert({alert_id:"drag_start",title:"[[modules:cover.dragging-title]]",message:"[[modules:cover.dragging-message]]",timeout:5e3})}return t.save=function(){t.coverEl.addClass("saving"),t.saveFn(t.newCover||void 0,t.coverEl.css("background-position"),function(n){n?h.error(n):(t.coverEl.toggleClass("active",0),t.coverEl.backgroundDraggable("disable"),t.coverEl.off("dragover",t.onDragOver),t.coverEl.off("drop",t.onDrop),h.success("[[modules:cover.saved]]")),t.coverEl.removeClass("saving")})},t}).apply(v,m),l!==void 0&&(g.exports=l)},18675(){(function(g){var v=g(window),c=function(t,a,n,e){if(arguments.length===3||e){if(n<t)return t;if(n>a)return a}return n},m=function(t){t.clientX=t.originalEvent.touches[0].clientX,t.clientY=t.originalEvent.touches[0].clientY},l=function(t){var a=(t.css("background-image").match(/^url\(['"]?(.*?)['"]?\)$/i)||[])[1];if(a){var n={width:0,height:0},e=new Image;return e.onload=function(){if(t.css("background-size")=="cover"){var i=t.innerWidth(),r=t.innerHe
1ight(),o=i/r,d=e.width/e.height,u=1;d>=o?u=r/e.height:u=i/e.width,n.width=e.width*u,n.height=e.height*u}else n.width=e.width,n.height=e.height},e.src=a,n}};function h(t,a){this.element=t,this.options=a,this.init()}h.prototype.init=function(){var t=g(this.element),a=(t.css("background-image").match(/^url\(['"]?(.*?)['"]?\)$/i)||[])[1],n=this.options;if(a){var e={width:0,height:0};(n.bound||n.units=="percent")&&(e=l(t)),g(window).on("keydown.dbg",i=>{var r=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],o=parseInt(r[1])||0,d=parseInt(r[2])||0;n.units=="percent"&&(o=Math.round(o/-200*e.width),d=Math.round(d/-200*e.height));var u=0,s=0;return i.which===37?u=-5:i.which===39?u=5:i.which===38?s=-5:i.which===40&&(s=5),n.units==="percent"?(o=n.axis==="y"?o:c(-e.width/2,0,o+u,n.bound),d=n.axis==="x"?d:c(-e.height/2,0,d+s,n.bound),t.css("background-position",o/e.width*-200+"% "+d/e.height*-200+"%")):(o=n.axis==="y"?o:c(t.innerWidth()-e.width,0,o+u,n.bound),d=n.axis==="x"?d:c(t.innerHeight()-e.height,0,d+s,n.bound)),[37,38,39,40].includes(i.which)?!1:void 0}),t.on("mousedown.dbg touchstart.dbg",function(i){if(i.target===t[0]){if(i.preventDefault(),i.originalEvent.touches)m(i);else if(i.which!==1)return;var r=i.clientX,o=i.clientY,d=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],u=parseInt(d[1])||0,s=parseInt(d[2])||0;n.units=="percent"&&(u=Math.round(u/-200*e.width),s=Math.round(s/-200*e.height)),v.on("mousemove.dbg touchmove.dbg",function(p){p.preventDefault(),p.originalEvent.touches&&m(p);var x=p.clientX,A=p.clientY;n.units=="percent"?(u=n.axis==="y"?u:c(-e.width/2,0,u+x-r,n.bound),s=n.axis==="x"?s:c(-e.height/2,0,s+A-o,n.bound),t.css("background-position",u/e.width*-200+"% "+s/e.height*-200+"%")):(u=n.axis==="y"?u:c(t.innerWidth()-e.width,0,u+x-r,n.bound),s=n.axis==="x"?s:c(t.innerHeight()-e.height,0,s+A-o,n.bound),t.css("background-position",u+"px "+s+"px")),r=x,o=A}),v.on("mouseup.dbg touchend.dbg mouseleave.dbg",function(){n.done&&n.done(),v.off("mousemove.dbg touchmove.dbg"),v.off("mouseup.dbg touchend.dbg mouseleave.dbg")})}})}},h.prototype.disable=function(){var t=g(this.element);t.off("mousedown.dbg touchstart.dbg"),v.off("mousemove.dbg touchmove.dbg mouseup.dbg touchend.dbg mouseleave.dbg keydown.dbg")},g.fn.backgroundDraggable=function(t){var a=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=g(this),e;typeof t>"u"||typeof t=="object"?(t=g.extend({},g.fn.backgroundDraggable.defaults,t),e=new h(this,t),n.data("dbg",e)):typeof t=="string"&&n.data("dbg")&&(e=n.data("dbg"),h.prototype[t].apply(e,a))})},g.fn.backgroundDraggable.defaults={bound:!0,axis:void 0,units:"pixels"}})(jQuery)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.