PageSourceSearch

https://mistarg.cn/assets/forum/account-blocks.b2c855c574273bb6a327.min.js

js mistarg.cn collected 2026-10-06 13:18:17 UTC 12,618 bytes, 1 lines download raw bytes

1(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[4884,34229,97082],{60089(h,v,i){"use strict";var b,f;b=[i(67910),i(49897),i(91749),i(29930)],f=(function(m,t,a,n){const e={};e.init=function(){m.init();const o=$('[component="blocks/search/list"]'),u=o.find('[component="blocks/start-typing"]'),d=o.find('[component="blocks/no-users"]');$("#user-search").on("keyup",utils.debounce(function(){const s=this.value;if(!s){o.find('[component="blocks/search/match"]').remove(),u.removeClass("hidden"),d.addClass("hidden");return}u.addClass("hidden"),t.get("/api/users",{query:s,searchBy:"username",paginate:!1},function(r,g){if(r)return n.error(r);if(!g.users.length){o.find('[component="blocks/search/match"]').remove(),d.removeClass("hidden");return}d.addClass("hidden"),g.matchCount>10&&(g.users.length=10),app.parseAndTranslate("account/blocks","edit",{edit:g.users},function(x){o.find('[component="blocks/search/match"]').remove(),x.insertAfter(d)})})},200)),$(".block-edit").on("click",'[data-action="block"], [data-action="unblock"]',async function(){const s=parseInt(this.getAttribute("data-uid"),10),r=$(this).attr("data-action"),g=$(this);await c(s,r),g.addClass("hidden").siblings("[data-action]").removeClass("hidden"),e.refreshList()}),$("#users-container").on("click",'[data-action="unblock"]',async function(){await c($(this).attr("data-uid"),$(this).attr("data-action")),e.refreshList()})};async function c(o,u){return socket.emit("user.toggleBlock",{blockeeUid:o,blockerUid:ajaxify.data.uid,action:u}).catch(n.error)}return e.refreshList=function(){$.get(config.relative_path+"/api/"+ajaxify.currentPage).done(function(o){app.parseAndTranslate("account/blocks","users",o,function(u){u.find(".timeago").timeago(),$("#users-container").html(u),$("#users-container").siblings("div.alert")[u.length?"hide":"show"]()}),a.fire("action:user.blocks.toggle",{data:o})}).fail(function(){ajaxify.go(ajaxify.currentPage)})},e}).apply(v,b),f!==void 0&&(h.exports=f)},67910(h,v,i){"use strict";var b,f;b=[i(36684),i(72254),i(52473),i(17459),i(47283),i(28061),i(7524),i(49897),i(65303),i(29930)],f=(function(m,t,a,n,e,c,o,u,d,s){const r={};let g;r.init=function(){g=ajaxify.data.isAdmin||ajaxify.data.isSelf||ajaxify.data.isGlobalModerator,x(),g&&k(),a.get("account/follow").on("click",()=>A("follow")),a.get("account/unfollow").on("click",()=>A("unfollow")),a.get("account/chat").on("click",async function(){const{roomId:l}=await u.get(`/users/${encodeURIComponent(ajaxify.data.uid)}/chat`),p=await app.require("chat");l?p.openChat(l):p.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",()=>c.banAccount(ajaxify.data.theirid)),a.get("account/mute").on("click",()=>c.muteAccount(ajaxify.data.theirid)),a.get("account/unban").on("click",()=>c.unbanAccount(ajaxify.data.theirid)),a.get("account/unmute").on("click",()=>c.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",D),a.get("account/already-flagged").on("click",w),a.get("account/block").on("click",()=>C("block")),a.get("account/unblock").on("click",()=>C("unblock"))};function x(){$('[component="profile/change/picture"]').on("click",function(){return o.openChangeModal(),!1})}function k(){m.init(a.get("account/cover"),function(l,p,y){socket.emit("user.updateCover",{uid:ajaxify.data.uid,imageData:l,position:p},y)},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(l){l=(l.startsWith("http")?"":config.relative_path)+l+"?"+Date.now(),a.get("account/cover").css("background-image","url("+l+")")})},j)}function A(l){if(!app.user.uid){let y;return utils.isNumber(ajaxify.data.uid)?y=config.url+"/user/"+ajaxify.data.uid:y=ajaxify.data.userslug,i.e(91722).then(i.bind(i,91722)).then(({trigger:E})=>{E("follow",{object:y})}),!1}const p=isFinite(ajaxify.data.uid)?ajaxify.data.uid:encodeURIComponent(ajaxify.data.userslug);return u[l==="follow"?"put":"del"]("/users/"+p+"/follow",void 0,function(y){if(y)return s.error(y);a.get("account/follow").toggleClass("hide",l==="follow"),a.get("account/unfollow").toggleClass("hide",l==="unfollow"),s.success("[[global:alert."+l+", "+ajaxify.data.username+"]]")}),!1}function D(){i.e(6574).then(function(){var l=[i(6574)];(function(p){p.showFlagModal({type:"user",id:ajaxify.data.uid})}).apply(null,l)}).catch(i.oe)}function w(){const l=$(this).data("flag-id");i.e(6574).then(function(){var p=[i(6574)];(function(y){d.confirm("[[flags:modal-confirm-rescind]]",function(E){E&&y.rescind(l)})}).apply(null,p)}).catch(i.oe)}function C(l){return socket.emit("user.toggleBlock",{blockeeUid:ajaxify.data.uid,blockerUid:app.user.uid,action:l}
1,function(p,y){if(p)return s.error(p);a.get("account/block").toggleClass("hidden",y),a.get("account/unblock").toggleClass("hidden",!y)}),!1}function j(){d.confirm("[[user:remove-cover-picture-confirm]]",function(l){l&&socket.emit("user.removeCover",{uid:ajaxify.data.uid},function(p){p?s.error(p):ajaxify.refresh()})})}return r}).apply(v,b),f!==void 0&&(h.exports=f)},47283(h,v,i){"use strict";var b,f;b=[i(49897),i(65303),i(29930)],f=(function(m,t,a){const n={};n.account=function(c,o){e(c,"[[user:delete-this-account-confirm]]","/account","[[user:account-deleted]]",o)},n.content=function(c,o){e(c,"[[user:delete-account-content-confirm]]","/content","[[user:account-content-deleted]]",o)},n.purge=function(c,o){e(c,"[[user:delete-all-confirm]]","","[[user:account-deleted]]",o)};function e(c,o,u,d,s){t.confirm(o,function(r){r&&m.del(`/users/${encodeURIComponent(c)}${u}`,{}).then(()=>{if(a.success(d),typeof s=="function")return s()}).catch(a.error)})}return n}).apply(v,b),f!==void 0&&(h.exports=f)},28061(h,v,i){"use strict";var b,f;b=[i(49897),i(65303),i(29930),i(81335)],f=(function(m,t,a,n){const e={};e.banAccount=function(o,u){o=o||ajaxify.data.theirid,c({tpl:"modals/temporary-ban",title:"[[user:ban-account]]",type:"ban",onSubmit:function(d){m.put("/users/"+encodeURIComponent(o)+"/ban",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof u=="function")return u();ajaxify.refresh()}).catch(a.error)}})},e.unbanAccount=function(o){c({tpl:"modals/unban",title:"[[user:unban-account]]",type:"ban",onSubmit:function(u){m.del("/users/"+encodeURIComponent(o)+"/ban",{reason:u.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})},e.muteAccount=function(o,u){o=o||ajaxify.data.theirid,c({tpl:"modals/temporary-mute",title:"[[user:mute-account]]",type:"mute",onSubmit:function(d){m.put("/users/"+o+"/mute",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof u=="function")return u();ajaxify.refresh()}).catch(a.error)}})},e.unmuteAccount=function(o){c({tpl:"modals/unmute",title:"[[user:unmute-account]]",onSubmit:function(u){m.del("/users/"+o+"/mute",{reason:u.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})};async function c(o){const u=await socket.emit("user.getCustomReasons",{type:o.type||""}),d=await n.render(o.tpl,{reasons:u}),s=await t.dialog({title:o.title,message:d,onEscape:!0,buttons:{close:{label:"[[global:close]]",className:"btn-link"},submit:{label:o.title,callback:function(){const r=s.find("form").serializeArray().reduce(function(g,x){return g[x.name]=x.value,g},{});if(Object.hasOwn(r,"length")){const x=parseInt(r.unit,10)?24:1;r.until=r.length>0?Date.now()+r.length*36e5*x:0}else r.until=0;o.onSubmit(r)}}}});return s.find("[data-key]").on("click",function(){const r=u.find(g=>String(g.key)===$(this).attr("data-key"));r&&r.body&&s.find('[name="reason"]').val(r.body)}),s}return e.throwModal=c,e}).apply(v,b),f!==void 0&&(h.exports=f)},36684(h,v,i){"use strict";var b,f;b=[i(29930),i(18675)],f=(function(m){const t={coverEl:null,saveFn:null};t.init=function(n,e,c,o){t.coverEl=n,t.saveFn=e,n.find(".upload").on("click",c),n.find(".resize").on("click",function(){a(n)}),n.find(".remove").on("click",o),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,c=new FileReader;e.length&&e[0].type.match("image.*")&&(c.onload=function(o){t.coverEl.css("background-image","url("+o.target.result+")"),t.newCover=o.target.result},c.readAsDataURL(e[0]),a(t.coverEl))};function a(n){n.toggleClass("active",1).backgroundDraggable({axis:"y",units:"percent"}),m.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?m.error(n):(t.coverEl.toggleClass("active",0),t.coverEl.backgroundDraggable("disable"),t.coverEl.off("dragover",t.onDragOver),t.coverEl.off("drop",t.onDrop),m.success("[[modules:cover.saved]]")),t.coverEl.removeClass("saving")})},t}).apply(v,b),f!==void 0&&(h.exports=f)},18675(){(function(h){var v=h(window),i=function(t,a,n,e){if(arguments.length===3||e){if(n<t)return t;if(n>a)return a}return n},b=function(t){t.clientX=t.originalEvent.touches[0].clientX,t.clientY=t.originalEvent.touches[0].clientY},f=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 c=t.innerWidth(),o=t.innerHe
1ight(),u=c/o,d=e.width/e.height,s=1;d>=u?s=o/e.height:s=c/e.width,n.width=e.width*s,n.height=e.height*s}else n.width=e.width,n.height=e.height},e.src=a,n}};function m(t,a){this.element=t,this.options=a,this.init()}m.prototype.init=function(){var t=h(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=f(t)),h(window).on("keydown.dbg",c=>{var o=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],u=parseInt(o[1])||0,d=parseInt(o[2])||0;n.units=="percent"&&(u=Math.round(u/-200*e.width),d=Math.round(d/-200*e.height));var s=0,r=0;return c.which===37?s=-5:c.which===39?s=5:c.which===38?r=-5:c.which===40&&(r=5),n.units==="percent"?(u=n.axis==="y"?u:i(-e.width/2,0,u+s,n.bound),d=n.axis==="x"?d:i(-e.height/2,0,d+r,n.bound),t.css("background-position",u/e.width*-200+"% "+d/e.height*-200+"%")):(u=n.axis==="y"?u:i(t.innerWidth()-e.width,0,u+s,n.bound),d=n.axis==="x"?d:i(t.innerHeight()-e.height,0,d+r,n.bound)),[37,38,39,40].includes(c.which)?!1:void 0}),t.on("mousedown.dbg touchstart.dbg",function(c){if(c.target===t[0]){if(c.preventDefault(),c.originalEvent.touches)b(c);else if(c.which!==1)return;var o=c.clientX,u=c.clientY,d=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],s=parseInt(d[1])||0,r=parseInt(d[2])||0;n.units=="percent"&&(s=Math.round(s/-200*e.width),r=Math.round(r/-200*e.height)),v.on("mousemove.dbg touchmove.dbg",function(g){g.preventDefault(),g.originalEvent.touches&&b(g);var x=g.clientX,k=g.clientY;n.units=="percent"?(s=n.axis==="y"?s:i(-e.width/2,0,s+x-o,n.bound),r=n.axis==="x"?r:i(-e.height/2,0,r+k-u,n.bound),t.css("background-position",s/e.width*-200+"% "+r/e.height*-200+"%")):(s=n.axis==="y"?s:i(t.innerWidth()-e.width,0,s+x-o,n.bound),r=n.axis==="x"?r:i(t.innerHeight()-e.height,0,r+k-u,n.bound),t.css("background-position",s+"px "+r+"px")),o=x,u=k}),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")})}})}},m.prototype.disable=function(){var t=h(this.element);t.off("mousedown.dbg touchstart.dbg"),v.off("mousemove.dbg touchmove.dbg mouseup.dbg touchend.dbg mouseleave.dbg keydown.dbg")},h.fn.backgroundDraggable=function(t){var a=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=h(this),e;typeof t>"u"||typeof t=="object"?(t=h.extend({},h.fn.backgroundDraggable.defaults,t),e=new m(this,t),n.data("dbg",e)):typeof t=="string"&&n.data("dbg")&&(e=n.data("dbg"),m.prototype[t].apply(e,a))})},h.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.