framework/extensions/flags/js/dist/forum.js

2 lines
11 KiB
JavaScript
Raw Normal View History

(()=>{var t={n:a=>{var o=a&&a.__esModule?()=>a.default:()=>a;return t.d(o,{a:o}),o},d:(a,o)=>{for(var s in o)t.o(o,s)&&!t.o(a,s)&&Object.defineProperty(a,s,{enumerable:!0,get:o[s]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";function o(){return o=Object.assign||function(t){for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},o.apply(this,arguments)}t.r(a);const s=flarum.core.compat.app;var e=t.n(s);const r=flarum.core.compat.Model;var n=t.n(r);function l(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}var i=function(t){function a(){return t.apply(this,arguments)||this}return l(a,t),a}(n());o(i.prototype,{type:n().attribute("type"),reason:n().attribute("reason"),reasonDetail:n().attribute("reasonDetail"),createdAt:n().attribute("createdAt",n().transformDate),post:n().hasOne("post"),user:n().hasOne("user")});const c=i,p=flarum.core.compat["components/Page"];var u=t.n(p);const f=flarum.core.compat.Component;var g=t.n(f);const d=flarum.core.compat["components/Link"];var h=t.n(d);const v=flarum.core.compat["components/LoadingIndicator"];var _=t.n(v);const y=flarum.core.compat["helpers/avatar"];var b=t.n(y);const N=flarum.core.compat["helpers/username"];var F=t.n(N);const x=flarum.core.compat["helpers/icon"];var k=t.n(x);const w=flarum.core.compat["helpers/humanTime"];var C=t.n(w),D=function(t){function a(){return t.apply(this,arguments)||this}l(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.state=this.attrs.state},o.view=function(){var t=this.state.cache||[];return m("div",{className:"NotificationList FlagList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},app.translator.trans("flarum-flags.forum.flagged_posts.title"))),m("div",{className:"NotificationList-content"},m("ul",{className:"NotificationGroup-content"},t.length?t.map((function(t){var a=t.post();return m("li",null,m(h(),{href:app.route.post(a),className:"Notification Flag",onclick:function(t){app.flags.index=a,t.redraw=!1}},b()(a.user()),k()("fas fa-flag",{className:"Notification-icon"}),m("span",{className:"Notification-content"},app.translator.trans("flarum-flags.forum.flagged_posts.item_text",{username:F()(a.user()),em:m("em",null),discussion:a.discussion().title()})),C()(t.createdAt()),m("div",{className:"Notification-excerpt"},a.contentPlain())))})):this.state.loading?_().component({className:"LoadingIndicator--block"}):m("div",{className:"NotificationList-empty"},app.translator.trans("flarum-flags.forum.flagged_posts.empty_text")))))},a}(g()),P=function(t){function a(){return t.apply(this,arguments)||this}l(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),app.history.push("flags"),app.flags.load(),this.bodyClass="App--flags"},o.view=function(){return m("div",{className:"FlagsPage"},m(D,{state:app.flags}))},a}(u()),A=function(){function t(t){this.app=t,this.loading=!1}return t.prototype.load=function(){var t=this;this.cache&&!this.app.session.user.attribute("newFlagCount")||(this.loading=!0,m.redraw(),this.app.store.find("flags").then((function(a){t.app.session.user.pushAttributes({newFlagCount:0}),t.cache=a.sort((function(t,a){return a.createdAt()-t.createdAt()}))})).catch((function(){})).then((function(){t.loading=!1,m.redraw()})))},t}();const M=flarum.core.compat.extend,O=flarum.core.compat["utils/PostControls"];var L=t.n(O);const B=flarum.core.compat["components/Button"];var T=t.n(B);const j=flarum.core.compat["components/Modal"];var S=t.n(j);const E=flarum.core.compat["utils/Stream"];var I=t.n(E);const H=flarum.core.compat["utils/withAttr"];var R=t.n(H),U=function(t){function a(){return t.apply(this,arguments)||this}l(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.succes
//# sourceMappingURL=forum.js.map