PageSourceSearch

https://brownsboard.com/assets/forum/account-edit-username.d4faa4b0b3f65ec2b1d7.min.js

js brownsboard.com collected 2026-10-09 22:42:45 UTC 12,464 bytes, 1 lines download raw bytes

1(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1374,4884,5512,6174,7082],{182(h,p,c){"use strict";var m,l;m=[c(7910),c(9897),c(3230),c(9930)],l=(function(f,n,o,t){const a={};return a.init=function(){f.init(),$("#submitBtn").on("click",function(){const i={uid:$("#inputUID").val(),username:$("#inputNewUsername").val(),password:$("#inputCurrentPassword").val()};if(!i.username)return;if(i.username===i.password)return t.error("[[user:username-same-as-password]]");const r=$(this);return r.addClass("disabled").find("i").removeClass("hide"),n.put("/users/"+i.uid,i).then(d=>{const e=o(i.username);i.username&&e&&parseInt(i.uid,10)===parseInt(app.user.uid,10)&&($('[component="header/profilelink"]').attr("href",config.relative_path+"/user/"+e),$('[component="header/profilelink/edit"]').attr("href",config.relative_path+"/user/"+e+"/edit"),$('[component="header/profilelink/settings"]').attr("href",config.relative_path+"/user/"+e+"/settings"),$('[component="header/username"]').text(i.username),$('[component="header/usericon"]').css("background-color",d["icon:bgColor"]).text(d["icon:text"]),$('[component="avatar/icon"]').css("background-color",d["icon:bgColor"]).text(d["icon:text"])),ajaxify.go("user/"+e+"/edit")}).catch(t.error).finally(()=>{r.removeClass("disabled").find("i").addClass("hide")}),!1})},a}
1).apply(p,m),l!==void 0&&(h.exports=l)},7910(h,p,c){"use strict";var m,l;m=[c(6684),c(2254),c(2473),c(7459),c(7283),c(8061),c(7524),c(9897),c(5303),c(9930)],l=(function(f,n,o,t,a,u,i,r,d,e){const s={};let b;s.init=function(){b=ajaxify.data.isAdmin||ajaxify.data.isSelf||ajaxify.data.isGlobalModerator,x(),b&&E(),o.get("account/follow").on("click",()=>C("follow")),o.get("account/unfollow").on("click",()=>C("unfollow")),o.get("account/chat").on("click",async function(){const{roomId:g}=await r.get(`/users/${encodeURIComponent(ajaxify.data.uid)}/chat`),v=await app.require("chat");g?v.openChat(g):v.newChat(ajaxify.data.uid)}),o.get("account/new-chat").on("click",async function(){(await app.require("chat")).newChat(ajaxify.data.uid,function(){o.get("account/chat").parent().removeClass("hidden")})}),o.get("account/ban").on("click",()=>u.banAccount(ajaxify.data.theirid)),o.get("account/mute").on("click",()=>u.muteAccount(ajaxify.data.theirid)),o.get("account/unban").on("click",()=>u.unbanAccount(ajaxify.data.theirid)),o.get("account/unmute").on("click",()=>u.unmuteAccount(ajaxify.data.theirid)),o.get("account/delete-account").on("click",()=>a.account(ajaxify.data.theirid)),o.get("account/delete-content").on("click",()=>a.content(ajaxify.data.theirid)),o.get("account/delete-all").on("click",()=>a.purge(ajaxify.data.theirid)),o.get("account/flag").on("click",w),o.get("account/already-flagged").on("click",k),o.get("account/block").on("click",()=>D("block")),o.get("account/unblock").on("click",()=>D("unblock"))};function x(){$('[component="profile/change/picture"]').on("click",function(){return i.openChangeModal(),!1})}function E(){f.init(o.get("account/cover"),function(g,v,y){socket.emit("user.updateCover",{uid:ajaxify.data.uid,imageData:g,position:v},y)},function(){n.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(g){g=(g.startsWith("http")?"":config.relative_path)+g+"?"+Date.now(),o.get("account/cover").css("background-image","url("+g+")")})},j)}function C(g){if(!app.user.uid){let y;return utils.isNumber(ajaxify.data.uid)?y=config.url+"/user/"+ajaxify.data.uid:y=ajaxify.data.userslug,c.e(1722).then(()=>c(1722)).then(({trigger:A})=>{A("follow",{object:y})}),!1}const v=isFinite(ajaxify.data.uid)?ajaxify.data.uid:encodeURIComponent(ajaxify.data.userslug);return r[g==="follow"?"put":"del"]("/users/"+v+"/follow",void 0,function(y){if(y)return e.error(y);o.get("account/follow").toggleClass("hide",g==="follow"),o.get("account/unfollow").toggleClass("hide",g==="unfollow"),e.success("[[global:alert."+g+", "+ajaxify.data.username+"]]")}),!1}function w(){c.e(6574).then(function(){var g=[c(6574)];(function(v){v.showFlagModal({type:"user",id:ajaxify.data.uid})}).apply(null,g)}).catch(c.oe)}function k(){const g=$(this).data("flag-id");c.e(6574).then(function(){var v=[c(6574)];(function(y){d.confirm("[[flags:modal-confirm-rescind]]",function(A){A&&y.rescind(g)})}).apply(null,v)}).catch(c.oe)}function D(g){return socket.emit("user.toggleBlock",{blockeeUid:ajaxify.data.uid,blockerUid:app.user.uid,action:g},function(v,y){if(v)return e.error(v);o.get("account/block").toggleClass("hidden",y),o.get("account/unblock").toggleClass("hidden",!y)}),!1}function j(){d.confirm("[[user:remove-cover-picture-confirm]]",function(g){g&&socket.emit("user.removeCover",{uid:ajaxify.data.uid},function(v){v?e.error(v):ajaxify.refresh()})})}return s}).apply(p,m),l!==void 0&&(h.exports=l)},7283(h,p,c){"use strict";var m,l;m=[c(9897),c(5303),c(9930)],l=(function(f,n,o){const t={};t.account=function(u,i){a(u,"[[user:delete-this-account-confirm]]","/account","[[user:account-deleted]]",i)},t.content=function(u,i){a(u,"[[user:delete-account-content-confirm]]","/content","[[user:account-content-deleted]]",i)},t.purge=function(u,i){a(u,"[[user:delete-all-confirm]]","","[[user:account-deleted]]",i)};function a(u,i,r,d,e){n.confirm(i,function(s){s&&f.del(`/users/${encodeURIComponent(u)}${r}`,{}).then(()=>{if(o.success(d),typeof e=="function")return e()}).catch(o.error)})}return t}
1).apply(p,m),l!==void 0&&(h.exports=l)},8061(h,p,c){"use strict";var m,l;m=[c(9897),c(5303),c(9930),c(1335)],l=(function(f,n,o,t){const a={};a.banAccount=function(i,r){i=i||ajaxify.data.theirid,u({tpl:"modals/temporary-ban",title:"[[user:ban-account]]",type:"ban",onSubmit:function(d){f.put("/users/"+encodeURIComponent(i)+"/ban",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof r=="function")return r();ajaxify.refresh()}).catch(o.error)}})},a.unbanAccount=function(i){u({tpl:"modals/unban",title:"[[user:unban-account]]",type:"ban",onSubmit:function(r){f.del("/users/"+encodeURIComponent(i)+"/ban",{reason:r.reason||""}).then(()=>{ajaxify.refresh()}).catch(o.error)}})},a.muteAccount=function(i,r){i=i||ajaxify.data.theirid,u({tpl:"modals/temporary-mute",title:"[[user:mute-account]]",type:"mute",onSubmit:function(d){f.put("/users/"+i+"/mute",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof r=="function")return r();ajaxify.refresh()}).catch(o.error)}})},a.unmuteAccount=function(i){u({tpl:"modals/unmute",title:"[[user:unmute-account]]",onSubmit:function(r){f.del("/users/"+i+"/mute",{reason:r.reason||""}).then(()=>{ajaxify.refresh()}).catch(o.error)}})};async function u(i){const r=await socket.emit("user.getCustomReasons",{type:i.type||""}),d=await t.render(i.tpl,{reasons:r}),e=await n.dialog({title:i.title,message:d,onEscape:!0,buttons:{close:{label:"[[global:close]]",className:"btn-link"},submit:{label:i.title,callback:function(){const s=e.find("form").serializeArray().reduce(function(b,x){return b[x.name]=x.value,b},{});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;i.onSubmit(s)}}}});return e.find("[data-key]").on("click",function(){const s=r.find(b=>String(b.key)===$(this).attr("data-key"));s&&s.body&&e.find('[name="reason"]').val(s.body)}),e}return a.throwModal=u,a}).apply(p,m),l!==void 0&&(h.exports=l)},6684(h,p,c){"use strict";var m,l;m=[c(9930),c(1056)],l=(function(f){const n={coverEl:null,saveFn:null};n.init=function(t,a,u,i){n.coverEl=t,n.saveFn=a,t.find(".upload").on("click",u),t.find(".resize").on("click",function(){o(t)}),t.find(".remove").on("click",i),t.on("dragover",n.onDragOver).on("drop",n.onDrop),t.find(".save").on("click",n.save),t.addClass("initialised")},n.onDragOver=function(t){t.stopPropagation(),t.preventDefault(),t.originalEvent.dataTransfer.dropEffect="copy"},n.onDrop=function(t){t.stopPropagation(),t.preventDefault();const a=t.originalEvent.dataTransfer.files,u=new FileReader;a.length&&a[0].type.match("image.*")&&(u.onload=function(i){n.coverEl.css("background-image","url("+i.target.result+")"),n.newCover=i.target.result},u.readAsDataURL(a[0]),o(n.coverEl))};function o(t){t.toggleClass("active",1).backgroundDraggable({axis:"y",units:"percent"}),f.alert({alert_id:"drag_start",title:"[[modules:cover.dragging-title]]",message:"[[modules:cover.dragging-message]]",timeout:5e3})}return n.save=function(){n.coverEl.addClass("saving"),n.saveFn(n.newCover||void 0,n.coverEl.css("background-position"),function(t){t?f.error(t):(n.coverEl.toggleClass("active",0),n.coverEl.backgroundDraggable("disable"),n.coverEl.off("dragover",n.onDragOver),n.coverEl.off("drop",n.onDrop),f.success("[[modules:cover.saved]]")),n.coverEl.removeClass("saving")})},n}).apply(p,m),l!==void 0&&(h.exports=l)},3230(h,p,c){"use strict";var m,l;(function(f){m=f,l=typeof m=="function"?m.call(p,c,p,h):m,l!==void 0&&(h.exports=l)})(function(){const f=/[^\p{L}\s\d\-_@.]/gu,n=/[^\w\s\d\-_@.]/g,o=/^\s+|\s+$/g,t=/\s+/g,a=/-+/g,u=/-$/g,i=/^-/g,r=/^[\w\d\s.,\-@]+$/;return function(e,s){return!e||(e=String(e).replace(o,""),r.test(e)?e=e.replace(n,"-"):e=e.replace(f,"-"),e=s?e:e.toLocaleLowerCase(),e=e.replace(t,"-"),e=e.replace(a,"-"),e=e.replace(u,""),e=e.replace(i,""),e==="."||e==="..")?"":e}})},1056(){(function(h){var p=h(window),c=function(n,o,t,a){if(arguments.length===3||a){if(t<n)return n;if(t>o)return o}return t},m=function(n){n.clientX=n.originalEvent.touches[0].clientX,n.clientY=n.originalEvent.touches[0].clientY},l=function(n){var o=(n.css("background-image").match(/^url\(['"]?(.*?)['"]?\)$/i)||[])[1];if(o){var t={width:0,height:0},a=new Image;return a.onload=function(){if(n.css("background-size")=="cover"){var u=n.innerWidth(),i=n.innerHeight(),r=u/i,d=a.width/a.height,e=1;d>=r?e=i/a.height:e=u/a.width,t.width=a.width*e,t.height=a.height*e}else t.width=a.width,t.height=a.height},a.src=o,t}};function f(n,o){this.element=n,this.options=o,this.init()}f.prototype.init=function(){var n=h(this.element),o=(n.css("background-image").match(/^url\(['"]?(.*?)['"]?\)$/i)||[])[1],t=this.options;if(o){var a={width:0,height:0};(t.bound||t.units=="percent")&&(a=l(n)),h(window).on("keydown.dbg",u=>{var i=n.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],r=parseInt(i[1])||0,d=parseInt(i[2])||0;t.units=="percent"&&(r=Math.round(r/-200*a.width),d=Math.round(d/-200*a.height));var e=0,s=0;return u.which===37?e=-5:u.which===39?e=5:u.which===38?s=-5:u.which===40&&(s=5),t.units==="percent"?(r=t.axis==="y"?r:c(-a.width/2,0,r+e,t.bound),d=t.axis==="x"?d:c(-a.height/2,0,d+s,t.bound),n.css("background-position",r/a.width*-200+"% "+d/a.height*-200+"%")):(r=t.axis==="y"?r:c(n.innerWidth()-a.width,0,r+e,t.bound),d=t.axis==="x"?d:c(n.innerHeight()-a.height,0,d+s,t.bound)),[37,38,39,40].includes(u.which)?!1:void 0}),n.on("mousedown.dbg touchstart.dbg",function(u){if(u.target===n[0]){if(u.preventDefault(),u.originalEvent.touches)m(u);else if(u.which!==1)return;var i=u.clientX,r=u.clientY,d=n.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],e=parseInt(d[1])||0,s=parseInt(d[2])||0;t.units=="percent"&&(e=Math.round(e/-200*a.width),s=Math.round(s/-200*a.height)),p.on("mousemove.dbg touchmove.dbg",function(b){b.preventDefault(),b.originalEvent.touches&&m(b);var x=b.clientX,E=b.clientY;t.units=="percent"?(e=t.axis==="y"?e:c(-a.width/2,0,e+x-i,t.bound),s=t.axis==="x"?s:c(-a.height/2,0,s+E-r,t.bound),n.css("background-position",e/a.width*-200+"% "+s/a.height*-200+"%")):(e=t.axis==="y"?e:c(n.innerWidth()-a.width,0,e+x-i,t.bound),s=t.axis==="x"?s:c(n.innerHeight()-a.height,0,s+E-r,t.bound),n.css("background-position",e+"px "+s+"px")),i=x,r=E}),p.on("mouseup.dbg touchend.dbg mouseleave.dbg",function(){t.done&&t.done(),p.off("mousemove.dbg touchmove.dbg"),p.off("mouseup.dbg touchend.dbg mouseleave.dbg")})}})}},f.prototype.disable=function(){var n=h(this.element);n.off("mousedown.dbg touchstart.dbg"),p.off("mousemove.dbg touchmove.dbg mouseup.dbg touchend.dbg mouseleave.dbg keydown.dbg")},h.fn.backgroundDraggable=function(n){var o=Array.prototype.slice.call(arguments,1
1);return this.each(function(){var t=h(this),a;typeof n>"u"||typeof n=="object"?(n=h.extend({},h.fn.backgroundDraggable.defaults,n),a=new f(this,n),t.data("dbg",a)):typeof n=="string"&&t.data("dbg")&&(a=t.data("dbg"),f.prototype[n].apply(a,o))})},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.