mirror of
https://github.com/flarum/framework.git
synced 2025-01-24 02:10:45 +08:00
2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
module.exports=function(t){var o={};function e(r){if(o[r])return o[r].exports;var n=o[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=t,e.c=o,e.d=function(t,o,r){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var n in t)e.d(r,n,function(o){return t[o]}.bind(null,n));return r},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=12)}([function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["models/Post"]},,function(t,o){t.exports=flarum.core.compat["utils/PostControls"]},function(t,o){t.exports=flarum.core.compat["models/Discussion"]},function(t,o){t.exports=flarum.core.compat["components/Post"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["components/CommentPost"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionListItem"]},function(t,o){t.exports=flarum.core.compat["components/Badge"]},,function(t,o,e){"use strict";e.r(o);var r=e(1),n=e(0),a=e.n(n),p=e(5),s=e.n(p),i=e(2),u=e.n(i),c=e(10),l=e.n(c),f=e(9),d=e.n(f),v=e(6),b=e.n(v),x=e(8),y=e.n(x),A=e(7),g=e.n(A),h=e(4),_=e.n(h);a.a.initializers.add("flarum-approval",function(){s.a.prototype.isApproved=s.a.attribute("isApproved"),Object(r.extend)(s.a.prototype,"badges",function(t){this.isApproved()||t.has("hidden")||t.add("awaitingApproval",m(l.a,{type:"awaitingApproval",icon:"fas fa-gavel",label:a.a.translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))}),u.a.prototype.isApproved=u.a.attribute("isApproved"),u.a.prototype.canApprove=u.a.attribute("canApprove"),Object(r.extend)(d.a.prototype,"attrs",function(t){this.props.discussion.isApproved()||(t.className+=" DiscussionListItem--unapproved")}),Object(r.extend)(b.a.prototype,"attrs",function(t){this.props.post.isApproved()||(t.className+=" Post--unapproved")}),Object(r.extend)(y.a.prototype,"headerItems",function(t){this.props.post.isApproved()||this.props.post.isHidden()||t.add("unapproved",a.a.translator.trans("flarum-approval.forum.post.awaiting_approval_text"))}),Object(r.override)(b.a.prototype,"flagReason",function(t,o){return"approval"===o.type()?a.a.translator.trans("flarum-approval.forum.post.awaiting_approval_text"):t(o)}),Object(r.extend)(_.a,"destructiveControls",function(t,o){!o.isApproved()&&o.canApprove()&&t.add("approve",m(g.a,{icon:"fas fa-check",onclick:_.a.approveAction.bind(o)},a.a.translator.trans("flarum-approval.forum.post_controls.approve_button")),10)}),_.a.approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}},-10)}]);
|
|
//# sourceMappingURL=forum.js.map
|