mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
1 line
34 KiB
Plaintext
Generated
1 line
34 KiB
Plaintext
Generated
{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA7C,SAASW,EAAQV,GAG9B,OAAOU,EAAU,mBAAqBL,QAAU,iBAAmBA,OAAOM,SAAW,SAAUX,GAC7F,cAAcA,CAChB,EAAI,SAAUA,GACZ,OAAOA,GAAO,mBAAqBK,QAAUL,EAAIY,cAAgBP,QAAUL,IAAQK,OAAOH,UAAY,gBAAkBF,CAC1H,EAAGU,EAAQV,EACb,CCRA,MAAM,EAA+BQ,OAAOC,IAAIV,IAAI,OAAQ,oC,aCE7C,MAAMc,UAAsB,KACzCD,YAAYE,GCFC,IAAyBd,EAAKN,EAAKa,EDG9CQ,MAAM,CAAC,EAAG,EAAG,MCHuBf,EDIpBgB,KCJ8BT,ODIjB,GCH/Bb,ECAa,SAAwBuB,GACrC,IAAIvB,ECFS,SAAsBw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,CACVH,UAAW,sBACVuE,EAAM9B,KAAIC,GAAQvC,EAAE,MAAO,CAC5BH,UAAW,qBACVjC,KAAK4H,WAAWjD,OAAUvC,EAAE,MAAO,CACpCH,UAAW,wBACVjC,KAAK6H,kBAAkBpF,WAC5B,IACA,yBAA4B,SAAUkC,GACpC,GAAoB,SAAhBA,EAAK9D,OAAmB,CAC1B,MAAMI,EAAO0D,EAAK1D,OACZc,EAAS4C,EAAK5C,SAAW,qBAAqB,uCAAuC+F,OAAOnD,EAAK5C,SAAU,WAAa,KACxHgG,EAASpD,EAAK3C,eACdgG,EAAO,IAAUrD,EAAKS,aAC5B,MAAO,CAAC,qBAAqBrD,EAAS,sDAAwD,0CAA2C,CACvIiG,OACA/G,OACAc,aACIgG,GAAU3F,EAAE,OAAQ,CACxBH,UAAW,uBACV8F,GACL,CACF,CH7EiB,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/flags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/flags/./src/forum/states/FlagListState.tsx","webpack://@flarum/flags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/flags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/flags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/utils/PostControls')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/flags/./src/forum/components/FlagPostModal.js","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/components/HeaderSecondary')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/components/HeaderDropdown')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/components/HeaderList')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/components/HeaderListItem')\"","webpack://@flarum/flags/./src/forum/components/FlagList.tsx","webpack://@flarum/flags/./src/forum/components/FlagsDropdown.tsx","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/utils/humanTime')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/flags/./src/forum/components/FlagsPage.js","webpack://@flarum/flags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/flags/./src/forum/models/Flag.ts","webpack://@flarum/flags/./src/forum/extend.ts","webpack://@flarum/flags/./src/forum/index.ts","webpack://@flarum/flags/./src/forum/addFlagControl.js","webpack://@flarum/flags/./src/forum/addFlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsToPosts.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class FlagListState extends PaginatedListState {\n constructor(app) {\n super({}, 1, null);\n _defineProperty(this, \"app\", void 0);\n this.app = app;\n }\n get type() {\n return 'flags';\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n var _this$app$session$use;\n if ((_this$app$session$use = this.app.session.user) != null && _this$app$session$use.attribute('newFlagCount')) {\n this.pages = [];\n this.location = {\n page: 1\n };\n }\n if (this.pages.length > 0) {\n return Promise.resolve();\n }\n return super.loadNext();\n }\n}\nflarum.reg.add('flarum-flags', 'forum/states/FlagListState', FlagListState);","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/PostControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Form from 'flarum/common/components/Form';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nexport default class FlagPostModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n this.success = false;\n this.reason = Stream('');\n this.reasonDetail = Stream('');\n }\n className() {\n return 'FlagPostModal Modal--medium';\n }\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n content() {\n if (this.success) {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"p\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n onclick: this.hide.bind(this)\n }, app.translator.trans('flarum-flags.forum.flag_post.dismiss_button')))));\n }\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, this.flagReasons().toArray())), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(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 }\n flagReasons() {\n const items = new ItemList();\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n items.add('off-topic', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"reason\",\n checked: this.reason() === 'off_topic',\n value: \"off_topic\",\n onclick: withAttr('value', this.reason)\n }), m(\"strong\", null, app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_label')), app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_text'), this.reason() === 'off_topic' && m(\"textarea\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder'),\n value: this.reasonDetail(),\n oninput: withAttr('value', this.reasonDetail)\n })), 70);\n items.add('inappropriate', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"reason\",\n checked: this.reason() === 'inappropriate',\n value: \"inappropriate\",\n onclick: withAttr('value', this.reason)\n }), m(\"strong\", null, app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_label')), app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_text', {\n a: guidelinesUrl ? m(\"a\", {\n href: guidelinesUrl,\n target: \"_blank\"\n }) : undefined\n }), this.reason() === 'inappropriate' && m(\"textarea\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder'),\n value: this.reasonDetail(),\n oninput: withAttr('value', this.reasonDetail)\n })), 60);\n items.add('spam', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"reason\",\n checked: this.reason() === 'spam',\n value: \"spam\",\n onclick: withAttr('value', this.reason)\n }), m(\"strong\", null, app.translator.trans('flarum-flags.forum.flag_post.reason_spam_label')), app.translator.trans('flarum-flags.forum.flag_post.reason_spam_text'), this.reason() === 'spam' && m(\"textarea\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-flags.forum.flag_post.reason_details_placeholder'),\n value: this.reasonDetail(),\n oninput: withAttr('value', this.reasonDetail)\n })), 50);\n items.add('other', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"reason\",\n checked: this.reason() === 'other',\n value: \"other\",\n onclick: withAttr('value', this.reason)\n }), m(\"strong\", null, app.translator.trans('flarum-flags.forum.flag_post.reason_other_label')), this.reason() === 'other' && m(\"textarea\", {\n className: \"FormControl\",\n value: this.reasonDetail(),\n oninput: withAttr('value', this.reasonDetail)\n })), 10);\n return items;\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n app.store.createRecord('flags').save({\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n post: this.attrs.post\n }\n }, {\n errorHandler: this.onerror.bind(this)\n }).then(() => this.success = true).catch(() => {}).then(this.loaded.bind(this));\n }\n}\nflarum.reg.add('flarum-flags', 'forum/components/FlagPostModal', FlagPostModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderSecondary');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Avatar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/username');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/HeaderListItem');","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Avatar from 'flarum/common/components/Avatar';\nimport username from 'flarum/common/helpers/username';\nimport HeaderList from 'flarum/forum/components/HeaderList';\nimport HeaderListItem from 'flarum/forum/components/HeaderListItem';\nexport default class FlagList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n }\n view() {\n const state = this.attrs.state;\n return m(HeaderList, {\n className: \"FlagList\",\n title: app.translator.trans('flarum-flags.forum.flagged_posts.title'),\n hasItems: state.hasItems(),\n loading: state.isLoading(),\n emptyText: app.translator.trans('flarum-flags.forum.flagged_posts.empty_text'),\n loadMore: () => state.hasNext() && !state.isLoadingNext() && state.loadNext()\n }, m(\"ul\", {\n className: \"HeaderListGroup-content\"\n }, this.content(state)));\n }\n content(state) {\n if (!state.isLoading() && state.hasItems()) {\n return state.getPages().map(page => {\n return page.items.map(flag => {\n const post = flag.post();\n return m(\"li\", null, m(HeaderListItem, {\n className: \"Flag\",\n avatar: m(Avatar, {\n user: post.user() || null\n }),\n icon: \"fas fa-flag\",\n content: app.translator.trans('flarum-flags.forum.flagged_posts.item_text', {\n username: username(post.user()),\n em: m(\"em\", null),\n discussion: post.discussion().title()\n }),\n excerpt: post.contentPlain(),\n datetime: flag.createdAt(),\n href: app.route.post(post),\n onclick: e => {\n e.redraw = false;\n }\n }));\n });\n });\n }\n return null;\n }\n}\nflarum.reg.add('flarum-flags', 'forum/components/FlagList', FlagList);","import app from 'flarum/forum/app';\nimport HeaderDropdown from 'flarum/forum/components/HeaderDropdown';\nimport classList from 'flarum/common/utils/classList';\nimport FlagList from './FlagList';\nexport default class FlagsDropdown extends HeaderDropdown {\n static initAttrs(attrs) {\n attrs.className = classList('FlagsDropdown', attrs.className);\n attrs.label = attrs.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n attrs.icon = attrs.icon || 'fas fa-flag';\n super.initAttrs(attrs);\n }\n getContent() {\n return m(FlagList, {\n state: this.attrs.state\n });\n }\n goToRoute() {\n m.route.set(app.route('flags'));\n }\n getUnreadCount() {\n return app.forum.attribute('flagCount');\n }\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\nflarum.reg.add('flarum-flags', 'forum/components/FlagsDropdown', FlagsDropdown);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/humanTime');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","import app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\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 app.history.push('flags');\n app.flags.load();\n this.bodyClass = 'App--flags';\n }\n view() {\n return m(\"div\", {\n className: \"FlagsPage\"\n }, m(FlagList, {\n state: app.flags\n }));\n }\n}\nflarum.reg.add('flarum-flags', 'forum/components/FlagsPage', FlagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import Model from 'flarum/common/Model';\nexport default class Flag extends Model {\n type() {\n return Model.attribute('type').call(this);\n }\n reason() {\n return Model.attribute('reason').call(this);\n }\n reasonDetail() {\n return Model.attribute('reasonDetail').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n post() {\n return Model.hasOne('post').call(this);\n }\n user() {\n return Model.hasOne('user').call(this);\n }\n}\nflarum.reg.add('flarum-flags', 'forum/models/Flag', Flag);","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport FlagsPage from './components/FlagsPage';\nimport Flag from './models/Flag';\nexport default [new Extend.Routes() //\n.add('flags', '/flags', FlagsPage), new Extend.Store() //\n.add('flags', Flag), new Extend.Model(Post) //\n.hasMany('flags').attribute('canFlag')];","import app from 'flarum/forum/app';\nimport FlagListState from './states/FlagListState';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-flags', () => {\n app.flags = new FlagListState(app);\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\nimport './forum';","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport Button from 'flarum/common/components/Button';\nimport FlagPostModal from './components/FlagPostModal';\nexport default function () {\n extend(PostControls, 'userControls', function (items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag()) return;\n items.add('flag', m(Button, {\n icon: \"fas fa-flag\",\n onclick: () => app.modal.show(FlagPostModal, {\n post\n })\n }, app.translator.trans('flarum-flags.forum.post_controls.flag_button')));\n });\n}","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\nexport default function () {\n extend(HeaderSecondary.prototype, 'items', function (items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', m(FlagsDropdown, {\n state: app.flags\n }), 15);\n }\n });\n}","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Post from 'flarum/forum/components/Post';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport humanTime from 'flarum/common/utils/humanTime';\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 Post.prototype.dismissFlag = function (body) {\n const post = this.attrs.post;\n delete post.data.relationships.flags;\n this.subtree.invalidate();\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 if (app.flags.index === post) {\n let next = app.flags.cache[i];\n if (!next) next = app.flags.cache[0];\n if (next) {\n const nextPost = next.post();\n app.flags.index = nextPost;\n m.route.set(app.route.post(nextPost));\n }\n }\n return true;\n }\n });\n }\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n body\n });\n };\n Post.prototype.flagActionItems = function () {\n const items = new ItemList();\n const controls = PostControls.destructiveControls(this.attrs.post);\n Object.keys(controls.toObject()).forEach(k => {\n const attrs = controls.get(k).attrs;\n attrs.className = 'Button';\n extend(attrs, 'onclick', () => this.dismissFlag());\n });\n items.add('controls', m(\"div\", {\n className: \"ButtonGroup\"\n }, controls.toArray()));\n items.add('dismiss', m(Button, {\n className: \"Button\",\n icon: \"far fa-eye-slash\",\n onclick: this.dismissFlag.bind(this)\n }, app.translator.trans('flarum-flags.forum.post.dismiss_flag_button')), -100);\n return items;\n };\n override(Post.prototype, 'header', function (vdom) {\n const post = this.attrs.post;\n const flags = post.flags();\n if (!flags.length) return;\n if (post.isHidden()) this.revealContent = true;\n return m(\"div\", {\n className: \"Post-flagged\"\n }, m(\"div\", {\n className: \"Post-flagged-flags\"\n }, flags.map(flag => m(\"div\", {\n className: \"Post-flagged-flag\"\n }, this.flagReason(flag)))), m(\"div\", {\n className: \"Post-flagged-actions\"\n }, this.flagActionItems().toArray()));\n });\n Post.prototype.flagReason = function (flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason() ? app.translator.trans(\"flarum-flags.forum.flag_post.reason_\".concat(flag.reason(), \"_label\")) : null;\n const detail = flag.reasonDetail();\n const time = humanTime(flag.createdAt());\n return [app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {\n time,\n user,\n reason\n }), !!detail && m(\"span\", {\n className: \"Post-flagged-detail\"\n }, detail)];\n }\n };\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","FlagListState","app","super","this","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","type","load","_this$app$session$use","session","user","attribute","pages","location","page","length","Promise","resolve","loadNext","add","FlagPostModal","oninit","vnode","success","reason","reasonDetail","className","title","content","m","onclick","hide","bind","flagReasons","toArray","loading","disabled","items","guidelinesUrl","name","checked","placeholder","oninput","href","target","onsubmit","e","preventDefault","save","relationships","post","attrs","errorHandler","onerror","then","catch","loaded","FlagList","view","state","hasItems","isLoading","emptyText","loadMore","hasNext","isLoadingNext","getPages","map","flag","avatar","icon","username","em","discussion","excerpt","contentPlain","datetime","createdAt","redraw","FlagsDropdown","static","label","initAttrs","getContent","goToRoute","route","set","getUnreadCount","getNewCount","FlagsPage","bodyClass","Flag","hasMany","extend","isHidden","contentType","canFlag","flags","body","data","subtree","invalidate","i","next","nextPost","url","apiEndpoint","method","controls","keys","toObject","forEach","k","dismissFlag","override","vdom","revealContent","flagReason","flagActionItems","concat","detail","time"],"sourceRoot":""} |