PageSourceSearch

https://mistarg.cn/assets/forum/account-edit-password.45faf6ae98ba3067c8f1.min.js

js mistarg.cn collected 2026-10-06 13:19:57 UTC 12,509 bytes, 1 lines download raw bytes

1(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[4884,66123,97082],{6043(h,b,o){"use strict";var p,g;p=[o(67910),o(17459),o(7065),o(49897),o(29930)],g=(function(m,t,a,n,e){const s={};s.init=function(){m.init(),i()};function i(){const r=$("#inputCurrentPassword"),c=$("#password-notify"),l=$("#password-confirm-notify"),v=$("#inputNewPassword"),x=$("#inputNewPasswordAgain");let C=!1,E=!1;function D(){C=!1;try{if(utils.assertPasswordValidity(v.val(),a),v.val()===ajaxify.data.username)throw new Error("[[user:password-same-as-username]]");if(v.val()===ajaxify.data.email)throw new Error("[[user:password-same-as-email]]");d(c),C=!0}catch(A){u(c,A.message)}}function j(){v.val()!==x.val()?(u(l,"[[user:change-password-error-match]]"),E=!1):(v.val()?d(l):(l.parent().removeClass("alert-success alert-danger"),l.children().show(),l.find(".msg").html("")),E=!0)}v.on("input",D),x.on("input",j),$("#changePasswordBtn").on("click",function(){D(),j();const A=$(this);return C&&E?(A.addClass("disabled").find("i").removeClass("hide"),n.put("/users/"+ajaxify.data.theirid+"/password",{currentPassword:r.val(),newPassword:v.val()}).then(()=>{parseInt(app.user.uid,10)===parseInt(ajaxify.data.uid,10)?window.location.href=config.relative_path+"/login":ajaxify.go("user/"+ajaxify.data.userslug+"/edit")}).catch(e.error).finally(()=>{A.removeClass("disabled").find("i").addClass("hide"),r.val(""),v.val(""),x.val(""),c.parent().removeClass("show-success show-danger"),l.parent().removeClass("show-success show-danger"),E=!1,C=!1})):(E||e.error("[[user:change-password-error-match]]"),C||e.error("[[user:change-password-error]]")),!1})}function u(r,c){t.translate(c,function(l){r.html(l).removeClass("text-success").addClass("text-danger")})}function d(r){r.html("").removeClass("text-danger").addClass("text-success")}return s}).apply(b,p),g!==void 0&&(h.exports=g)},67910(h,b,o){"use strict";var p,g;p=[o(36684),o(72254),o(52473),o(17459),o(47283),o(28061),o(7524),o(49897),o(65303),o(29930)],g=(function(m,t,a,n,e,s,i,u,d,r){const c={};let l;c.init=function(){l=ajaxify.data.isAdmin||ajaxify.data.isSelf||ajaxify.data.isGlobalModerator,v(),l&&x(),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 u.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",()=>s.banAccount(ajaxify.data.theirid)),a.get("account/mute").on("click",()=>s.muteAccount(ajaxify.data.theirid)),a.get("account/unban").on("click",()=>s.unbanAccount(ajaxify.data.theirid)),a.get("account/unmute").on("click",()=>s.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",E),a.get("account/already-flagged").on("click",D),a.get("account/block").on("click",()=>j("block")),a.get("account/unblock").on("click",()=>j("unblock"))};function v(){$('[component="profile/change/picture"]').on("click",function(){return i.openChangeModal(),!1})}function x(){m.init(a.get("account/cover"),function(f,y,w){socket.emit("user.updateCover",{uid:ajaxify.data.uid,imageData:f,position:y},w)},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+")")})},A)}function C(f){if(!app.user.uid){let w;return utils.isNumber(ajaxify.data.uid)?w=config.url+"/user/"+ajaxify.data.uid:w=ajaxify.data.userslug,o.e(91722).then(o.bind(o,91722)).then(({trigger:k})=>{k("follow",{object:w})}),!1}const y=isFinite(ajaxify.data.uid)?ajaxify.data.uid:encodeURIComponent(ajaxify.data.userslug);return u[f==="follow"?"put":"del"]("/users/"+y+"/follow",void 0,function(w){if(w)return r.error(w);a.get("account/follow").toggleClass("hide",f==="follow"),a.get("account/unfollow").toggleClass("hide",f==="unfollow"),r.success("[[global:alert."+f+", "+ajaxify.data.username+"]]")}),!1}function E(){o.e(6574).then(function(){var f=[o(6574)];(function(y){y.showFlagModal({type:"user",id:ajaxify.data.uid})}).apply(null,f)}).catch(o.oe)}function D(){const f=$(this).data("flag-id");o.e(6574).then(function(){var y=[o(6574)];(function(w){d.confirm("[[flags:modal-confirm-rescind]]",function(k){k&&w.rescind(f)})}).apply(null,y)}).catch(o.oe)}function j(f){return socket.emit("user.toggleBlock",{blockeeUid:ajaxify.data.uid,blockerUid:app.user.uid,action:f}
1,function(y,w){if(y)return r.error(y);a.get("account/block").toggleClass("hidden",w),a.get("account/unblock").toggleClass("hidden",!w)}),!1}function A(){d.confirm("[[user:remove-cover-picture-confirm]]",function(f){f&&socket.emit("user.removeCover",{uid:ajaxify.data.uid},function(y){y?r.error(y):ajaxify.refresh()})})}return c}).apply(b,p),g!==void 0&&(h.exports=g)},47283(h,b,o){"use strict";var p,g;p=[o(49897),o(65303),o(29930)],g=(function(m,t,a){const n={};n.account=function(s,i){e(s,"[[user:delete-this-account-confirm]]","/account","[[user:account-deleted]]",i)},n.content=function(s,i){e(s,"[[user:delete-account-content-confirm]]","/content","[[user:account-content-deleted]]",i)},n.purge=function(s,i){e(s,"[[user:delete-all-confirm]]","","[[user:account-deleted]]",i)};function e(s,i,u,d,r){t.confirm(i,function(c){c&&m.del(`/users/${encodeURIComponent(s)}${u}`,{}).then(()=>{if(a.success(d),typeof r=="function")return r()}).catch(a.error)})}return n}).apply(b,p),g!==void 0&&(h.exports=g)},28061(h,b,o){"use strict";var p,g;p=[o(49897),o(65303),o(29930),o(81335)],g=(function(m,t,a,n){const e={};e.banAccount=function(i,u){i=i||ajaxify.data.theirid,s({tpl:"modals/temporary-ban",title:"[[user:ban-account]]",type:"ban",onSubmit:function(d){m.put("/users/"+encodeURIComponent(i)+"/ban",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof u=="function")return u();ajaxify.refresh()}).catch(a.error)}})},e.unbanAccount=function(i){s({tpl:"modals/unban",title:"[[user:unban-account]]",type:"ban",onSubmit:function(u){m.del("/users/"+encodeURIComponent(i)+"/ban",{reason:u.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})},e.muteAccount=function(i,u){i=i||ajaxify.data.theirid,s({tpl:"modals/temporary-mute",title:"[[user:mute-account]]",type:"mute",onSubmit:function(d){m.put("/users/"+i+"/mute",{until:d.until,reason:d.reason||""}).then(()=>{if(typeof u=="function")return u();ajaxify.refresh()}).catch(a.error)}})},e.unmuteAccount=function(i){s({tpl:"modals/unmute",title:"[[user:unmute-account]]",onSubmit:function(u){m.del("/users/"+i+"/mute",{reason:u.reason||""}).then(()=>{ajaxify.refresh()}).catch(a.error)}})};async function s(i){const u=await socket.emit("user.getCustomReasons",{type:i.type||""}),d=await n.render(i.tpl,{reasons:u}),r=await t.dialog({title:i.title,message:d,onEscape:!0,buttons:{close:{label:"[[global:close]]",className:"btn-link"},submit:{label:i.title,callback:function(){const c=r.find("form").serializeArray().reduce(function(l,v){return l[v.name]=v.value,l},{});if(Object.hasOwn(c,"length")){const v=parseInt(c.unit,10)?24:1;c.until=c.length>0?Date.now()+c.length*36e5*v:0}else c.until=0;i.onSubmit(c)}}}});return r.find("[data-key]").on("click",function(){const c=u.find(l=>String(l.key)===$(this).attr("data-key"));c&&c.body&&r.find('[name="reason"]').val(c.body)}),r}return e.throwModal=s,e}).apply(b,p),g!==void 0&&(h.exports=g)},36684(h,b,o){"use strict";var p,g;p=[o(29930),o(18675)],g=(function(m){const t={coverEl:null,saveFn:null};t.init=function(n,e,s,i){t.coverEl=n,t.saveFn=e,n.find(".upload").on("click",s),n.find(".resize").on("click",function(){a(n)}),n.find(".remove").on("click",i),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,s=new FileReader;e.length&&e[0].type.match("image.*")&&(s.onload=function(i){t.coverEl.css("background-image","url("+i.target.result+")"),t.newCover=i.target.result},s.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(b,p),g!==void 0&&(h.exports=g)},18675(){(function(h){var b=h(window),o=function(t,a,n,e){if(arguments.length===3||e){if(n<t)return t;if(n>a)return a}return n},p=function(t){t.clientX=t.originalEvent.touches[0].clientX,t.clientY=t.originalEvent.touches[0].clientY},g=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 s=t.innerWidth(),i=t.innerHe
1ight(),u=s/i,d=e.width/e.height,r=1;d>=u?r=i/e.height:r=s/e.width,n.width=e.width*r,n.height=e.height*r}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=g(t)),h(window).on("keydown.dbg",s=>{var i=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],u=parseInt(i[1])||0,d=parseInt(i[2])||0;n.units=="percent"&&(u=Math.round(u/-200*e.width),d=Math.round(d/-200*e.height));var r=0,c=0;return s.which===37?r=-5:s.which===39?r=5:s.which===38?c=-5:s.which===40&&(c=5),n.units==="percent"?(u=n.axis==="y"?u:o(-e.width/2,0,u+r,n.bound),d=n.axis==="x"?d:o(-e.height/2,0,d+c,n.bound),t.css("background-position",u/e.width*-200+"% "+d/e.height*-200+"%")):(u=n.axis==="y"?u:o(t.innerWidth()-e.width,0,u+r,n.bound),d=n.axis==="x"?d:o(t.innerHeight()-e.height,0,d+c,n.bound)),[37,38,39,40].includes(s.which)?!1:void 0}),t.on("mousedown.dbg touchstart.dbg",function(s){if(s.target===t[0]){if(s.preventDefault(),s.originalEvent.touches)p(s);else if(s.which!==1)return;var i=s.clientX,u=s.clientY,d=t.css("background-position").match(/(-?\d+).*?\s(-?\d+)/)||[],r=parseInt(d[1])||0,c=parseInt(d[2])||0;n.units=="percent"&&(r=Math.round(r/-200*e.width),c=Math.round(c/-200*e.height)),b.on("mousemove.dbg touchmove.dbg",function(l){l.preventDefault(),l.originalEvent.touches&&p(l);var v=l.clientX,x=l.clientY;n.units=="percent"?(r=n.axis==="y"?r:o(-e.width/2,0,r+v-i,n.bound),c=n.axis==="x"?c:o(-e.height/2,0,c+x-u,n.bound),t.css("background-position",r/e.width*-200+"% "+c/e.height*-200+"%")):(r=n.axis==="y"?r:o(t.innerWidth()-e.width,0,r+v-i,n.bound),c=n.axis==="x"?c:o(t.innerHe
1ight()-e.height,0,c+x-u,n.bound),t.css("background-position",r+"px "+c+"px")),i=v,u=x}),b.on("mouseup.dbg touchend.dbg mouseleave.dbg",function(){n.done&&n.done(),b.off("mousemove.dbg touchmove.dbg"),b.off("mouseup.dbg touchend.dbg mouseleave.dbg")})}})}},m.prototype.disable=function(){var t=h(this.element);t.off("mousedown.dbg touchstart.dbg"),b.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.