mirror of
https://github.com/flarum/framework.git
synced 2024-12-16 09:28:13 +08:00
d345734a8e
Includes transpiled JS/TS. [skip ci]
1 line
13 KiB
Plaintext
Generated
1 line
13 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,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OAAOiB,gBAAkB,SAAyBlB,EAAGiB,GAErE,OADAjB,EAAEmB,UAAYF,EACPjB,CACR,EAEMgB,EAAgBhB,EAAGiB,EAC3B,CCPD,MAAM,EAA+BJ,OAAOC,KAAKC,OAAO,8B,ICEnCK,EAAAA,SAAAA,GCDN,IAAwBC,EAAUC,E,kDAAAA,E,GAAVD,E,GAC5Bd,UAAYN,OAAOsB,OAAOD,EAAWf,WAC9Cc,EAASd,UAAUiB,YAAcH,EACjCH,EAAe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,IAAAA,QAAAA,QAAoBoB,MACtBpB,IAAAA,QAAAA,IAAgB,UAAUqB,SAG5BC,EAAEC,QACH,GACF,GCzBDpB,EAAAA,EAAAA,QAAOqB,IAAAA,UAA+B,iBAAiB,SAAUC,IAC3DzB,IAAAA,QAAAA,QAAoB0B,MAAc1B,IAAAA,QAAAA,QAAoBoB,OACxDK,EAAOE,QAAQC,KAAK,YAEvB,KAEDzB,EAAAA,EAAAA,QAAO0B,IAAAA,UAA8B,aAAa,SAAUlB,GAC1D,IAAMC,EAAalB,KAAKC,MAAMiB,WAE9B,GAAIA,EAAWP,aAAeX,KAAKC,MAAM8B,OAAOK,IAAMlB,EAAWmB,qBAAsB,CACrF,IAAMC,EAAYpB,EAAWoB,YAE7B,GAAIA,EAAW,CACb,IAAMC,GAAUC,EAAAA,EAAAA,UAASF,EAAUG,eAAgB,KAGnDxB,EAAML,IAAI,UAAW,aAAM2B,IAAiB,IAC7C,CACF,CACF,KCtBD9B,EAAAA,EAAAA,QAAO0B,IAAAA,UAA8B,gBAAgB,SAAUlC,GACzDD,KAAKC,MAAMiB,WAAWP,aACxBV,EAAMyC,UAAYC,IAAU1C,EAAMyC,UAAW,8BAEhD,GJUF,G","sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/webpack/runtime/compat get default export","webpack://@flarum/sticky/webpack/runtime/define property getters","webpack://@flarum/sticky/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/sticky/webpack/runtime/make namespace object","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/sticky/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@flarum/sticky/./src/forum/components/DiscussionStickiedPost.js","webpack://@flarum/sticky/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/sticky/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/utils/string']\"","webpack://@flarum/sticky/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/sticky/./src/forum/index.js","webpack://@flarum/sticky/./src/forum/addStickyBadge.js","webpack://@flarum/sticky/./src/forum/addStickyControl.js","webpack://@flarum/sticky/./src/forum/addStickyExcerpt.js","webpack://@flarum/sticky/./src/forum/addStickyClass.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.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import EventPost from 'flarum/forum/components/EventPost';\n\nexport default class DiscussionStickiedPost extends EventPost {\n icon() {\n return 'fas fa-thumbtack';\n }\n\n descriptionKey() {\n return this.attrs.post.content().sticky\n ? 'flarum-sticky.forum.post_stream.discussion_stickied_text'\n : 'flarum-sticky.forum.post_stream.discussion_unstickied_text';\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\n\nimport DiscussionStickiedPost from './components/DiscussionStickiedPost';\nimport addStickyBadge from './addStickyBadge';\nimport addStickyControl from './addStickyControl';\nimport addStickyExcerpt from './addStickyExcerpt';\nimport addStickyClass from './addStickyClass';\n\napp.initializers.add('flarum-sticky', () => {\n app.postComponents.discussionStickied = DiscussionStickiedPost;\n\n Discussion.prototype.isSticky = Model.attribute('isSticky');\n Discussion.prototype.canSticky = Model.attribute('canSticky');\n\n addStickyBadge();\n addStickyControl();\n addStickyExcerpt();\n addStickyClass();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\n\nexport default function addStickyBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.isSticky()) {\n badges.add(\n 'sticky',\n Badge.component({\n type: 'sticky',\n label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'),\n icon: 'fas fa-thumbtack',\n }),\n 10\n );\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\n\nexport default function addStickyControl() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canSticky()) {\n items.add(\n 'sticky',\n Button.component(\n {\n icon: 'fas fa-thumbtack',\n onclick: this.stickyAction.bind(discussion),\n },\n app.translator.trans(\n discussion.isSticky()\n ? 'flarum-sticky.forum.discussion_controls.unsticky_button'\n : 'flarum-sticky.forum.discussion_controls.sticky_button'\n )\n )\n );\n }\n });\n\n DiscussionControls.stickyAction = function () {\n this.save({ isSticky: !this.isSticky() }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n });\n };\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default function addStickyControl() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.matches(IndexPage) || app.current.matches(DiscussionPage)) {\n params.include.push('firstPost');\n }\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (discussion.isSticky() && !this.attrs.params.q && !discussion.lastReadPostNumber()) {\n const firstPost = discussion.firstPost();\n\n if (firstPost) {\n const excerpt = truncate(firstPost.contentPlain(), 175);\n\n // Wrapping in <div> because ItemList entries need to be vnodes\n items.add('excerpt', <div>{excerpt}</div>, -100);\n }\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\n\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\n\nexport default function addStickyClass() {\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (this.attrs.discussion.isSticky()) {\n attrs.className = classList(attrs.className, 'DiscussionListItem--sticky');\n }\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","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","DiscussionStickiedPost","subClass","superClass","create","constructor","icon","descriptionKey","this","attrs","post","content","sticky","EventPost","app","Discussion","Model","extend","badges","isSticky","add","Badge","type","label","DiscussionControls","items","discussion","canSticky","Button","onclick","stickyAction","bind","save","then","DiscussionPage","update","m","redraw","DiscussionListState","params","IndexPage","include","push","DiscussionListItem","q","lastReadPostNumber","firstPost","excerpt","truncate","contentPlain","className","classList"],"sourceRoot":""} |