framework/extensions/sticky/js/dist/forum.js.map
2018-09-21 01:04:13 +00:00

1 line
12 KiB
Plaintext

{"version":3,"sources":["webpack://@flarum/flarum-ext-sticky/webpack/bootstrap","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['extend']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['app']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['models/Discussion']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['Model']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/EventPost']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/Badge']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/DiscussionList']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@flarum/flarum-ext-sticky/external \"flarum.core.compat['utils/string']\"","webpack://@flarum/flarum-ext-sticky/./src/forum/components/DiscussionStickiedPost.js","webpack://@flarum/flarum-ext-sticky/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flarum-ext-sticky/./src/forum/index.js","webpack://@flarum/flarum-ext-sticky/./src/forum/addStickyBadge.js","webpack://@flarum/flarum-ext-sticky/./src/forum/addStickyControl.js","webpack://@flarum/flarum-ext-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","props","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","children","onclick","stickyAction","save","then","current","DiscussionPage","stream","update","redraw","DiscussionList","params","include","push","DiscussionListItem","q","lastReadPostNumber","firstPost","excerpt","truncate","contentPlain"],"mappings":"2BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,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ACPK,EAAOT,IAAI,SAAUU,IAAMC,WACzBC,KAAM,SACNC,MAAOf,IAAIgB,WAAWC,MAAM,4CAC5BzB,KAAM,qBACJ,MCLRkB,iBAAOQ,IAAoB,qBAAsB,SAASC,EAAOC,GAC3DA,EAAWX,aACbU,EAAMjB,IAAI,SAAUmB,IAAOR,WACzBS,SAAUtB,IAAIgB,WAAWC,MAAMG,EAAWd,WAAa,0DAA4D,yDACnHd,KAAM,mBACN+B,QAAS7B,KAAK8B,aAAahD,KAAK4C,QAKtCF,IAAmBM,aAAe,WAChC9B,KAAK+B,MAAMnB,UAAWZ,KAAKY,aAAaoB,KAAK,WACvC1B,IAAI2B,mBAAmBC,KACzB5B,IAAI2B,QAAQE,OAAOC,SAGrB1E,EAAE2E,YChBNrB,iBAAOsB,IAAepD,UAAW,gBAAiB,SAASqD,GACzDA,EAAOC,QAAQC,KAAK,eAGtBzB,iBAAO0B,IAAmBxD,UAAW,YAAa,SAASuC,GACzD,IAAMC,EAAa1B,KAAKC,MAAMyB,WAE9B,GAAIA,EAAWd,aAAeZ,KAAKC,MAAMsC,OAAOI,IAAMjB,EAAWkB,qBAAsB,CACrF,IAAMC,EAAYnB,EAAWmB,YAE7B,GAAIA,EAAW,CACb,IAAMC,EAAUC,mBAASF,EAAUG,eAAgB,KAEnDvB,EAAMjB,IAAI,UAAWsC,GAAU","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['components/DiscussionList'];","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.props.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 children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'),\n icon: 'fas fa-thumbtack',\n onclick: this.stickyAction.bind(discussion)\n }));\n }\n });\n\n DiscussionControls.stickyAction = function() {\n this.save({isSticky: !this.isSticky()}).then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n\n m.redraw();\n });\n };\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionList from 'flarum/components/DiscussionList';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport { truncate } from 'flarum/utils/string';\n\nexport default function addStickyControl() {\n extend(DiscussionList.prototype, 'requestParams', function(params) {\n params.include.push('firstPost');\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function(items) {\n const discussion = this.props.discussion;\n\n if (discussion.isSticky() && !this.props.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', excerpt, -100);\n }\n }\n });\n}\n"],"sourceRoot":""}