forum-oauth-center/js/dist/forum.js

2 lines
2.6 KiB
JavaScript
Raw Normal View History

2023-09-29 14:47:36 +08:00
(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["common/app"];t.n(e)().initializers.add("foskym/flarum-oauth-center",(function(){console.log("[foskym/flarum-oauth-center] Hello, forum and admin!")}));const r=flarum.core.compat["forum/app"];var n=t.n(r);const a=flarum.core.compat["common/extend"],u=flarum.core.compat["forum/components/UserPage"];var s=t.n(u);const c=flarum.core.compat["common/components/LinkButton"];var i=t.n(c);function p(t,o){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},p(t,o)}function f(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,p(t,o)}flarum.core.compat["common/components/Page"];const l=flarum.core.compat["forum/components/IndexPage"];var d=t.n(l);const h=flarum.core.compat["forum/components/LogInModal"];var y=t.n(h);const v=flarum.core.compat["common/utils/extractText"];var g=t.n(v),b=function(t){function o(){return t.apply(this,arguments)||this}f(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),n().session.user||setTimeout((function(){return n().modal.show(y())}),500),m.route.param()},e.setTitle=function(){n().setTitle(g()(n().translator.trans("foskym-oauth-center.forum.page.title.authorize"))),n().setTitleCount(0)},e.view=function(){return m("div",{className:"AuthorizePage"},m("div",{className:"container"}))},o}(d()),z=function(t){function o(){return t.apply(this,arguments)||this}f(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loadUser(m.route.param("username"))},e.content=function(){return m("div",{className:"AuthorizedPage"})},o}(s());n().initializers.add("foskym/flarum-oauth-center",(function(){n().routes["oauth.authorize"]={path:"/oauth/authorize",component:b},n().routes["user.authorized"]={path:"/u/:username/authorized",component:z},(0,a.extend)(s().prototype,"navItems",(function(t){n().session.user&&n().session.user.id()===this.user.id()&&t.add("authorized",i().component({href:n().route("user.authorized",{username:this.user.username()}),icon:"fas fa-user-friends"},[n().translator.trans("foskym-oauth-center.forum.page.label.authorized")]),-110)}))}))})(),module.exports=o})();
2023-09-28 17:47:09 +08:00
//# sourceMappingURL=forum.js.map