framework/extensions/sticky/js/dist/forum.js.map
2020-09-29 14:41:24 +00:00

1 line
12 KiB
Plaintext

{"version":3,"sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/external \"flarum.core.compat['extend']\"","webpack://@flarum/sticky/external \"flarum.core.compat['app']\"","webpack://@flarum/sticky/external \"flarum.core.compat['models/Discussion']\"","webpack://@flarum/sticky/external \"flarum.core.compat['Model']\"","webpack://@flarum/sticky/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@flarum/sticky/external \"flarum.core.compat['components/EventPost']\"","webpack://@flarum/sticky/external \"flarum.core.compat['components/Badge']\"","webpack://@flarum/sticky/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/sticky/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/sticky/external \"flarum.core.compat['states/DiscussionListState']\"","webpack://@flarum/sticky/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@flarum/sticky/external \"flarum.core.compat['utils/string']\"","webpack://@flarum/sticky/./src/forum/components/DiscussionStickiedPost.js","webpack://@flarum/sticky/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","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"],"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","DiscussionStickiedPost","subClass","superClass","constructor","__proto__","icon","descriptionKey","this","attrs","post","content","sticky","EventPost","app","initializers","add","postComponents","discussionStickied","Discussion","isSticky","Model","attribute","canSticky","extend","badges","Badge","component","type","label","translator","trans","DiscussionControls","items","discussion","Button","onclick","stickyAction","save","then","current","matches","DiscussionPage","update","redraw","DiscussionListState","params","include","push","DiscussionListItem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,iBAAOL,IAAWzB,UAAW,UAAU,SAAS+B,GAC1CjB,KAAKY,YACPK,EAAOT,IAAI,SAAUU,IAAMC,UAAU,CACnCC,KAAM,SACNC,MAAOf,IAAIgB,WAAWC,MAAM,4CAC5BzB,KAAM,qBACJ,OCLRkB,iBAAOQ,IAAoB,sBAAsB,SAASC,EAAOC,GAC3DA,EAAWX,aACbU,EAAMjB,IAAI,SAAUmB,IAAOR,UAAU,CACnCrB,KAAM,mBACN8B,QAAS5B,KAAK6B,aAAa/C,KAAK4C,IAC/BpB,IAAIgB,WAAWC,MAAMG,EAAWd,WAAa,0DAA4D,8DAIhHY,IAAmBK,aAAe,WAChC7B,KAAK8B,KAAK,CAAClB,UAAWZ,KAAKY,aAAamB,MAAK,WACvCzB,IAAI0B,QAAQC,QAAQC,MACtB5B,IAAI0B,QAAQ7D,IAAI,UAAUgE,SAG5BzE,EAAE0E,aCfNpB,iBAAOqB,IAAoBnD,UAAW,iBAAiB,SAASoD,GAC9DA,EAAOC,QAAQC,KAAK,gBAGtBxB,iBAAOyB,IAAmBvD,UAAW,aAAa,SAASuC,GACzD,IAAMC,EAAa1B,KAAKC,MAAMyB,WAE9B,GAAIA,EAAWd,aAAeZ,KAAKC,MAAMqC,OAAOI,IAAMhB,EAAWiB,qBAAsB,CACrF,IAAMC,EAAYlB,EAAWkB,YAE7B,GAAIA,EAAW,CACb,IAAMC,EAAUC,mBAASF,EAAUG,eAAgB,KAEnDtB,EAAMjB,IAAI,UAAW9C,EAAEsF,MAAMH,IAAW","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 = 13);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['components/EventPost'];","module.exports = flarum.core.compat['components/Badge'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['states/DiscussionListState'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/string'];","import EventPost from 'flarum/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","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import app from 'flarum/app';\nimport Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\n\nimport DiscussionStickiedPost from './components/DiscussionStickiedPost';\nimport addStickyBadge from './addStickyBadge';\nimport addStickyControl from './addStickyControl';\nimport addStickyExcerpt from './addStickyExcerpt';\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});\n\n","import { extend } from 'flarum/extend';\nimport Discussion from 'flarum/models/Discussion';\nimport Badge from 'flarum/components/Badge';\n\nexport default function addStickyBadge() {\n extend(Discussion.prototype, 'badges', function(badges) {\n if (this.isSticky()) {\n badges.add('sticky', Badge.component({\n type: 'sticky',\n label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'),\n icon: 'fas fa-thumbtack'\n }), 10);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\n\nexport default function addStickyControl() {\n extend(DiscussionControls, 'moderationControls', function(items, discussion) {\n if (discussion.canSticky()) {\n items.add('sticky', Button.component({\n icon: 'fas fa-thumbtack',\n onclick: this.stickyAction.bind(discussion)\n }, app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button')));\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 { extend } from 'flarum/extend';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport { truncate } from 'flarum/utils/string';\n\nexport default function addStickyControl() {\n extend(DiscussionListState.prototype, 'requestParams', function(params) {\n params.include.push('firstPost');\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 items.add('excerpt', m.trust(excerpt), -100);\n }\n }\n });\n}\n"],"sourceRoot":""}