mirror of
https://github.com/flarum/framework.git
synced 2025-01-07 11:03:36 +08:00
b5c3d630d5
Includes transpiled JS/TS. [skip ci]
2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
module.exports=function(t){var o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=o,n.d=function(t,o,e){n.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,o){if(1&o&&(t=n(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)n.d(e,r,function(o){return t[o]}.bind(null,r));return e},n.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(o,"a",o),o},n.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},n.p="",n(n.s=11)}([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/Discussion"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,o){t.exports=flarum.core.compat["components/NotificationGrid"]},function(t,o){t.exports=flarum.core.compat["components/EventPost"]},function(t,o){t.exports=flarum.core.compat["components/Notification"]},function(t,o){t.exports=flarum.core.compat["components/Badge"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o,n){"use strict";n.r(o);var e=n(1),r=n(0),c=n.n(r),i=n(3),a=n.n(i),s=n(2),u=n.n(s),f=n(5),p=n.n(f);function l(t,o){return(l=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}function d(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,l(t,o)}var k=n(6),b=function(t){function o(){return t.apply(this,arguments)||this}d(o,t);var n=o.prototype;return n.icon=function(){return this.attrs.post.content().locked?"fas fa-lock":"fas fa-unlock"},n.descriptionKey=function(){return this.attrs.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"},o}(n.n(k).a),y=n(7),_=function(t){function o(){return t.apply(this,arguments)||this}d(o,t);var n=o.prototype;return n.icon=function(){return"fas fa-lock"},n.href=function(){var t=this.attrs.notification;return app.route.discussion(t.subject(),t.content().postNumber)},n.content=function(){return app.translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.attrs.notification.fromUser()})},o}(n.n(y).a),x=n(8),h=n.n(x);var v=n(4),j=n.n(v),L=n(9),O=n.n(L),g=n(10),P=n.n(g);c.a.initializers.add("flarum-lock",(function(){c.a.postComponents.discussionLocked=b,c.a.notificationComponents.discussionLocked=_,u.a.prototype.isLocked=a.a.attribute("isLocked"),u.a.prototype.canLock=a.a.attribute("canLock"),Object(e.extend)(u.a.prototype,"badges",(function(t){this.isLocked()&&t.add("locked",h.a.component({type:"locked",label:app.translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))})),Object(e.extend)(j.a,"moderationControls",(function(t,o){o.canLock()&&t.add("lock",P.a.component({icon:"fas fa-lock",onclick:this.lockAction.bind(o)},app.translator.trans(o.isLocked()?"flarum-lock.forum.discussion_controls.unlock_button":"flarum-lock.forum.discussion_controls.lock_button")))})),j.a.lockAction=function(){this.save({isLocked:!this.isLocked()}).then((function(){app.current.matches(O.a)&&app.current.get("stream").update(),m.redraw()}))},Object(e.extend)(p.a.prototype,"notificationTypes",(function(t){t.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:c.a.translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})}))}))}]);
|
|
//# sourceMappingURL=forum.js.map
|