mirror of
https://github.com/flarum/framework.git
synced 2025-01-24 02:10:45 +08:00
0bd3f83528
Includes transpiled JS/TS. [skip ci]
2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
(()=>{var t={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return t.d(r,{a:r}),r},d:(o,r)=>{for(var e in r)t.o(r,e)&&!t.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:r[e]})},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 r=flarum.core.compat.extend,e=flarum.core.compat.app;var a=t.n(e);const p=flarum.core.compat["models/Discussion"];var n=t.n(p);const s=flarum.core.compat["models/Post"];var i=t.n(s);const c=flarum.core.compat["components/Badge"];var l=t.n(c);const u=flarum.core.compat["components/DiscussionListItem"];var d=t.n(u);const v=flarum.core.compat["components/Post"];var f=t.n(v);const A=flarum.core.compat["components/CommentPost"];var y=t.n(A);const b=flarum.core.compat["components/Button"];var g=t.n(b);const h=flarum.core.compat["utils/PostControls"];var _=t.n(h);a().initializers.add("flarum-approval",(function(){n().prototype.isApproved=n().attribute("isApproved"),(0,r.extend)(n().prototype,"badges",(function(t){this.isApproved()||t.has("hidden")||t.add("awaitingApproval",m(l(),{type:"awaitingApproval",icon:"fas fa-gavel",label:a().translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))})),i().prototype.isApproved=i().attribute("isApproved"),i().prototype.canApprove=i().attribute("canApprove"),(0,r.extend)(d().prototype,"elementAttrs",(function(t){this.attrs.discussion.isApproved()||(t.className+=" DiscussionListItem--unapproved")})),(0,r.extend)(f().prototype,"elementAttrs",(function(t){this.attrs.post.isApproved()||(t.className+=" Post--unapproved")})),(0,r.extend)(y().prototype,"headerItems",(function(t){this.attrs.post.isApproved()||this.attrs.post.isHidden()||t.add("unapproved",a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"))})),(0,r.override)(f().prototype,"flagReason",(function(t,o){return"approval"===o.type()?a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"):t(o)})),(0,r.extend)(_(),"destructiveControls",(function(t,o){!o.isApproved()&&o.canApprove()&&t.add("approve",m(g(),{icon:"fas fa-check",onclick:_().approveAction.bind(o)},a().translator.trans("flarum-approval.forum.post_controls.approve_button")),10)})),_().approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}}),-10)})(),module.exports=o})();
|
|
//# sourceMappingURL=forum.js.map
|