mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 15:03:44 +08:00
1 line
34 KiB
Plaintext
1 line
34 KiB
Plaintext
{"version":3,"sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/external \"flarum.core.compat['app']\"","webpack://@flarum/flags/external \"flarum.core.compat['Model']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/withAttr']\"","webpack://@flarum/flags/external \"flarum.core.compat['extend']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Post']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/PostControls']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/Stream']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Page']\"","webpack://@flarum/flags/external \"flarum.core.compat['Component']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Link']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/avatar']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/username']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/flags/external \"flarum.core.compat['helpers/humanTime']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/HeaderSecondary']\"","webpack://@flarum/flags/external \"flarum.core.compat['components/NotificationsDropdown']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/ItemList']\"","webpack://@flarum/flags/external \"flarum.core.compat['utils/humanTime']\"","webpack://@flarum/flags/external \"flarum.core\"","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/flags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flags/./src/forum/models/Flag.js","webpack://@flarum/flags/./src/forum/components/FlagList.js","webpack://@flarum/flags/./src/forum/components/FlagsPage.js","webpack://@flarum/flags/./src/forum/states/FlagListState.js","webpack://@flarum/flags/./src/forum/components/FlagPostModal.js","webpack://@flarum/flags/./src/forum/addFlagControl.js","webpack://@flarum/flags/./src/forum/components/FlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsToPosts.js","webpack://@flarum/flags/./src/forum/compat.js","webpack://@flarum/flags/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_extends","assign","target","arguments","length","source","apply","this","_inheritsLoose","subClass","superClass","constructor","__proto__","Flag","Model","type","attribute","reason","reasonDetail","createdAt","transformDate","post","hasOne","user","FlagList","oninit","vnode","state","attrs","view","flags","cache","className","app","translator","trans","map","flag","href","route","onclick","e","index","redraw","avatar","icon","username","em","discussion","title","humanTime","contentPlain","loading","LoadingIndicator","component","Component","FlagsPage","history","push","load","bodyClass","Page","FlagListState","session","store","find","then","pushAttributes","newFlagCount","sort","a","b","catch","FlagPostModal","success","Stream","content","hide","guidelinesUrl","forum","checked","withAttr","placeholder","oninput","undefined","disabled","onsubmit","preventDefault","createRecord","save","relationships","errorHandler","onerror","loaded","Modal","extend","PostControls","items","isHidden","contentType","canFlag","add","modal","show","FlagsDropdown","initAttrs","label","getMenu","menuClassName","menuClick","showing","goToRoute","set","getUnreadCount","getNewCount","NotificationsDropdown","HeaderSecondary","Post","dismissFlag","body","data","subtree","invalidate","some","splice","next","nextPost","request","url","apiEndpoint","method","flagActionItems","ItemList","controls","destructiveControls","keys","forEach","k","toArray","vdom","revealContent","unshift","flagReason","detail","time","addFlagsToPosts","addFlagControl","addFlagsDropdown","initializers","models","posts","hasMany","routes","path","flagsCompat"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiB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a,SAASzG,GACnC,GAAoB,SAAhBA,EAAKtB,OAAmB,CAC1B,IAAMQ,EAAOc,EAAKd,OACZN,EAASoB,EAAKpB,SACd8H,EAAS1G,EAAKnB,eACd8H,EAAO9F,KAAUb,EAAKlB,aAE5B,MAAO,CACLc,IAAIC,WAAWC,MAAMlB,EAAS,sDAAwD,0CAA2C,CAAC+H,OAAMzH,OAAMN,WAC9I8H,EAAS,UAAM/G,UAAU,uBAAuB+G,GAAiB,OCvG1D,IACb,wBAAyBE,GACzB,uBAAwBC,EACxB,yBAA0BC,EAC1B,oBAAqBtI,EACrB,4BAA6BW,EAC7B,iCAAkCiD,EAClC,6BAA8BjB,EAC9B,iCAAkCgD,G,SCPpCvE,IAAImH,aAAa/C,IAAI,gBAAgB,WACnCpE,IAAI+B,MAAMqF,OAAOC,MAAM7J,UAAUqC,MAAQhB,IAAMyI,QAAQ,SACvDtH,IAAI+B,MAAMqF,OAAOC,MAAM7J,UAAU2G,QAAUtF,IAAME,UAAU,WAE3DiB,IAAI+B,MAAMqF,OAAOvH,MAAQjB,EAEzBoB,IAAIuH,OAAO1H,MAAQ,CAAE2H,KAAM,SAAUnG,UAAWE,GAEhDvB,IAAIH,MAAQ,IAAIgC,EAAc7B,KAE9BiH,IACAC,IACAF,QAOF,EAAclJ,UAAQ2J","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['utils/withAttr'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Post'];","module.exports = flarum.core.compat['utils/PostControls'];","module.exports = flarum.core.compat['utils/Stream'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/Link'];","module.exports = flarum.core.compat['components/LoadingIndicator'];","module.exports = flarum.core.compat['helpers/avatar'];","module.exports = flarum.core.compat['helpers/username'];","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/HeaderSecondary'];","module.exports = flarum.core.compat['components/NotificationsDropdown'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['utils/humanTime'];","module.exports = flarum.core;","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Model from 'flarum/Model';\n\nclass Flag extends Model {}\n\nObject.assign(Flag.prototype, {\n type: Model.attribute('type'),\n reason: Model.attribute('reason'),\n reasonDetail: Model.attribute('reasonDetail'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n\n post: Model.hasOne('post'),\n user: Model.hasOne('user')\n});\n\nexport default Flag;\n","import Component from 'flarum/Component';\nimport Link from 'flarum/components/Link';\nimport LoadingIndicator from 'flarum/components/LoadingIndicator';\nimport avatar from 'flarum/helpers/avatar';\nimport username from 'flarum/helpers/username';\nimport icon from 'flarum/helpers/icon';\nimport humanTime from 'flarum/helpers/humanTime';\n\nexport default class FlagList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = this.attrs.state;\n }\n\n view() {\n const flags = this.state.cache || [];\n\n return (\n <div className=\"NotificationList FlagList\">\n <div className=\"NotificationList-header\">\n <h4 className=\"App-titleControl App-titleControl--text\">{app.translator.trans('flarum-flags.forum.flagged_posts.title')}</h4>\n </div>\n <div className=\"NotificationList-content\">\n <ul className=\"NotificationGroup-content\">\n {flags.length\n ? flags.map(flag => {\n const post = flag.post();\n\n return (\n <li>\n <Link href={app.route.post(post)} className=\"Notification Flag\" onclick={e => {\n app.flags.index = post;\n e.redraw = false;\n }}>\n {avatar(post.user())}\n {icon('fas fa-flag', {className: 'Notification-icon'})}\n <span className=\"Notification-content\">\n {app.translator.trans('flarum-flags.forum.flagged_posts.item_text', {username: username(post.user()), em: <em/>, discussion: post.discussion().title()})}\n </span>\n {humanTime(flag.createdAt())}\n <div className=\"Notification-excerpt\">\n {post.contentPlain()}\n </div>\n </Link>\n </li>\n );\n })\n : !this.state.loading\n ? <div className=\"NotificationList-empty\">{app.translator.trans('flarum-flags.forum.flagged_posts.empty_text')}</div>\n : LoadingIndicator.component({className: 'LoadingIndicator--block'})}\n </ul>\n </div>\n </div>\n );\n }\n}\n","import Page from 'flarum/components/Page';\n\nimport FlagList from './FlagList';\n\n/**\n * The `FlagsPage` component shows the flags list. It is only\n * used on mobile devices where the flags dropdown is within the drawer.\n */\nexport default class FlagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('flags');\n\n app.flags.load();\n\n this.bodyClass = 'App--flags';\n }\n\n view() {\n return <div className=\"FlagsPage\"><FlagList state={app.flags}></FlagList></div>;\n }\n}\n","export default class FlagListState {\n constructor(app) {\n this.app = app;\n\n /**\n * Whether or not the flags are loading.\n *\n * @type {Boolean}\n */\n this.loading = false;\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (this.cache && !this.app.session.user.attribute('newFlagCount')) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n this.app.store.find('flags')\n .then(flags => {\n this.app.session.user.pushAttributes({ newFlagCount: 0 });\n this.cache = flags.sort((a, b) => b.createdAt() - a.createdAt());\n })\n .catch(() => { })\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\n","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nimport Stream from 'flarum/utils/Stream';\nimport withAttr from 'flarum/utils/withAttr';\n\nexport default class FlagPostModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.success = false;\n\n this.reason = Stream('');\n this.reasonDetail = Stream('');\n }\n\n className() {\n return 'FlagPostModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n\n content() {\n if (this.success) {\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <p className=\"helpText\">{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}</p>\n <div className=\"Form-group\">\n <Button className=\"Button Button--primary Button--block\" onclick={this.hide.bind(this)}>\n {app.translator.trans('flarum-flags.forum.flag_post.dismiss_button')}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <div className=\"Form-group\">\n <div>\n <label className=\"checkbox\">\n <input type=\"radio\" name=\"reason\" checked={this.reason() === 'off_topic'} value=\"off_topic\" onclick={withAttr('value', this.reason)}/>\n <strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_label')}</strong>\n {app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_text')}\n {this.reason() === 'off_topic' ? (\n <textarea className=\"FormControl\" placeholder={app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder')} value={this.reasonDetail()} oninput={withAttr('value', this.reasonDetail)}></textarea>\n ) : ''}\n </label>\n\n <label className=\"checkbox\">\n <input type=\"radio\" name=\"reason\" checked={this.reason() === 'inappropriate'} value=\"inappropriate\" onclick={withAttr('value', this.reason)}/>\n <strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_label')}</strong>\n {app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_text', {\n a: guidelinesUrl ? <a href={guidelinesUrl} target=\"_blank\"/> : undefined\n })}\n {this.reason() === 'inappropriate' ? (\n <textarea className=\"FormControl\" placeholder={app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder')} value={this.reasonDetail()} oninput={withAttr('value', this.reasonDetail)}></textarea>\n ) : ''}\n </label>\n\n <label className=\"checkbox\">\n <input type=\"radio\" name=\"reason\" checked={this.reason() === 'spam'} value=\"spam\" onclick={withAttr('value', this.reason)}/>\n <strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_spam_label')}</strong>\n {app.translator.trans('flarum-flags.forum.flag_post.reason_spam_text')}\n {this.reason() === 'spam' ? (\n <textarea className=\"FormControl\" placeholder={app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder')} value={this.reasonDetail()} oninput={withAttr('value', this.reasonDetail)}></textarea>\n ) : ''}\n </label>\n\n <label className=\"checkbox\">\n <input type=\"radio\" name=\"reason\" checked={this.reason() === 'other'} value=\"other\" onclick={withAttr('value', this.reason)}/>\n <strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_other_label')}</strong>\n {this.reason() === 'other' ? (\n <textarea className=\"FormControl\" value={this.reasonDetail()} oninput={withAttr('value', this.reasonDetail)}></textarea>\n ) : ''}\n </label>\n </div>\n </div>\n\n <div className=\"Form-group\">\n <Button\n className=\"Button Button--primary Button--block\"\n type=\"submit\"\n loading={this.loading}\n disabled={!this.reason()}>\n {app.translator.trans('flarum-flags.forum.flag_post.submit_button')}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.store.createRecord('flags').save({\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n user: app.session.user,\n post: this.attrs.post\n }\n }, {errorHandler: this.onerror.bind(this)})\n .then(() => this.success = true)\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PostControls from 'flarum/utils/PostControls';\nimport Button from 'flarum/components/Button';\n\nimport FlagPostModal from './components/FlagPostModal';\n\nexport default function() {\n extend(PostControls, 'userControls', function(items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag()) return;\n\n items.add('flag',\n <Button icon=\"fas fa-flag\" onclick={() => app.modal.show(FlagPostModal, {post})}>{app.translator.trans('flarum-flags.forum.post_controls.flag_button')}</Button>\n );\n });\n}\n","import NotificationsDropdown from 'flarum/components/NotificationsDropdown';\n\nimport FlagList from './FlagList';\n\nexport default class FlagsDropdown extends NotificationsDropdown {\n static initAttrs(attrs) {\n attrs.label = attrs.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n attrs.icon = attrs.icon || 'fas fa-flag';\n\n super.initAttrs(attrs);\n }\n\n getMenu() {\n return (\n <div className={'Dropdown-menu ' + this.attrs.menuClassName} onclick={this.menuClick.bind(this)}>\n {this.showing ? FlagList.component({ state: this.attrs.state }) : ''}\n </div>\n );\n }\n\n goToRoute() {\n m.route.set(app.route('flags'));\n }\n\n getUnreadCount() {\n return app.flags.cache ? app.flags.cache.length : app.forum.attribute('flagCount');\n }\n\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport HeaderSecondary from 'flarum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default function() {\n extend(HeaderSecondary.prototype, 'items', function(items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', <FlagsDropdown state={app.flags} />, 15);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Post from 'flarum/components/Post';\nimport Button from 'flarum/components/Button';\nimport ItemList from 'flarum/utils/ItemList';\nimport PostControls from 'flarum/utils/PostControls';\nimport humanTime from 'flarum/utils/humanTime';\n\nexport default function() {\n extend(Post.prototype, 'elementAttrs', function(attrs) {\n if (this.attrs.post.flags().length) {\n attrs.className += ' Post--flagged';\n }\n });\n\n Post.prototype.dismissFlag = function(body) {\n const post = this.attrs.post;\n\n delete post.data.relationships.flags;\n\n this.subtree.invalidate();\n\n if (app.flags.cache) {\n app.flags.cache.some((flag, i) => {\n if (flag.post() === post) {\n app.flags.cache.splice(i, 1);\n\n if (app.flags.index === post) {\n let next = app.flags.cache[i];\n\n if (!next) next = app.flags.cache[0];\n\n if (next) {\n const nextPost = next.post();\n app.flags.index = nextPost;\n m.route.set(app.route.post(nextPost));\n }\n }\n\n return true;\n }\n });\n }\n\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n body\n });\n };\n\n Post.prototype.flagActionItems = function() {\n const items = new ItemList();\n\n const controls = PostControls.destructiveControls(this.attrs.post);\n\n Object.keys(controls.items).forEach(k => {\n const attrs = controls.get(k).attrs;\n\n attrs.className = 'Button';\n\n extend(attrs, 'onclick', () => this.dismissFlag());\n });\n\n items.add('controls', (\n <div className=\"ButtonGroup\">\n {controls.toArray()}\n </div>\n ));\n\n items.add('dismiss', (\n <Button className=\"Button\" icon=\"far fa-eye-slash\" onclick={this.dismissFlag.bind(this)}>\n {app.translator.trans('flarum-flags.forum.post.dismiss_flag_button')}\n </Button>\n ), -100);\n\n return items;\n };\n\n extend(Post.prototype, 'content', function(vdom) {\n const post = this.attrs.post;\n const flags = post.flags();\n\n if (!flags.length) return;\n\n if (post.isHidden()) this.revealContent = true;\n\n vdom.unshift(\n <div className=\"Post-flagged\">\n <div className=\"Post-flagged-flags\">\n {flags.map(flag =>\n <div className=\"Post-flagged-flag\">\n {this.flagReason(flag)}\n </div>\n )}\n </div>\n <div className=\"Post-flagged-actions\">\n {this.flagActionItems().toArray()}\n </div>\n </div>\n );\n });\n\n Post.prototype.flagReason = function(flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason();\n const detail = flag.reasonDetail();\n const time = humanTime(flag.createdAt());\n\n return [\n app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {time, user, reason}),\n detail ? <span className=\"Post-flagged-detail\">{detail}</span> : ''\n ];\n }\n };\n}\n","import addFlagsToPosts from './addFlagsToPosts';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport Flag from './models/Flag';\nimport FlagList from './components/FlagList';\nimport FlagPostModal from './components/FlagPostModal';\nimport FlagsPage from './components/FlagsPage';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default {\n 'flags/addFlagsToPosts': addFlagsToPosts,\n 'flags/addFlagControl': addFlagControl,\n 'flags/addFlagsDropdown': addFlagsDropdown,\n 'flags/models/Flag': Flag,\n 'flags/components/FlagList': FlagList,\n 'flags/components/FlagPostModal': FlagPostModal,\n 'flags/components/FlagsPage': FlagsPage,\n 'flags/components/FlagsDropdown': FlagsDropdown,\n};\n","import app from 'flarum/app';\nimport Model from 'flarum/Model';\n\nimport Flag from './models/Flag';\nimport FlagsPage from './components/FlagsPage';\nimport FlagListState from './states/FlagListState';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\n\napp.initializers.add('flarum-flags', () => {\n app.store.models.posts.prototype.flags = Model.hasMany('flags');\n app.store.models.posts.prototype.canFlag = Model.attribute('canFlag');\n\n app.store.models.flags = Flag;\n\n app.routes.flags = { path: '/flags', component: FlagsPage };\n\n app.flags = new FlagListState(app);\n\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, flagsCompat);\n"],"sourceRoot":""} |