mirror of
https://github.com/flarum/framework.git
synced 2025-01-30 13:34:16 +08:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
{"version":3,"sources":["webpack://@flarum/likes/webpack/bootstrap","webpack://@flarum/likes/external \"flarum.core.compat['app']\"","webpack://@flarum/likes/external \"flarum.core.compat['extend']\"","webpack://@flarum/likes/external \"flarum.core.compat['components/CommentPost']\"","webpack://@flarum/likes/external \"flarum.core.compat['helpers/username']\"","webpack://@flarum/likes/external \"flarum.core.compat['models/Post']\"","webpack://@flarum/likes/external \"flarum.core.compat['Model']\"","webpack://@flarum/likes/external \"flarum.core.compat['components/NotificationGrid']\"","webpack://@flarum/likes/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/likes/external \"flarum.core.compat['helpers/punctuateSeries']\"","webpack://@flarum/likes/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/likes/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/likes/external \"flarum.core.compat['helpers/avatar']\"","webpack://@flarum/likes/external \"flarum.core.compat['components/Notification']\"","webpack://@flarum/likes/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/likes/./src/forum/components/PostLikesModal.js","webpack://@flarum/likes/./src/forum/components/PostLikedNotification.js","webpack://@flarum/likes/./src/forum/index.js","webpack://@flarum/likes/./src/forum/addLikeAction.js","webpack://@flarum/likes/./src/forum/addLikesList.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","_inheritsLoose","subClass","superClass","constructor","__proto__","PostLikesModal","className","title","app","translator","trans","content","this","props","post","likes","map","user","href","route","config","avatar","username","Modal","PostLikedNotification","icon","notification","subject","fromUser","transChoice","excerpt","contentPlain","Notification","initializers","add","notificationComponents","postLiked","Post","canLike","Model","attribute","hasMany","extend","CommentPost","items","isHidden","isLiked","session","some","Button","component","children","onclick","save","data","relationships","like","id","splice","unshift","type","length","overLimit","names","sort","a","slice","limit","count","push","e","preventDefault","modal","show","users","punctuateSeries","NotificationGrid","label"],"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,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAA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OADV,EAKRE,EAAQhD,EAAMiD,KAAK,SAAAC,GAAC,OAAIA,IAAMzD,IAAIuC,QAAQ9B,MAAQ,EAAI,IACzDiD,MAAM,EAAGJ,EAAYK,EANV,GAOXnD,IAAI,SAAAC,GACH,OACEhD,EAAA,KAAGiD,KAAMV,IAAIW,MAAMF,KAAKA,GAAOG,OAAQnD,EAAEkD,OACtCF,IAAST,IAAIuC,QAAQ9B,KAAOT,IAAIC,WAAWC,MAAM,oCAAsCY,IAASL,MAQzG,GAAI6C,EAAW,CACb,IAAMM,EAAQrD,EAAM8C,OAASE,EAAMF,OAEnCE,EAAMM,KACJpG,EAAA,KAAGiD,KAAK,IAAIkC,QAAS,SAAAkB,GACnBA,EAAEC,iBACF/D,IAAIgE,MAAMC,KAAK,IAAIpE,GAAgBS,YAElCN,IAAIC,WAAWoB,YAAY,sCAAuCuC,GAAQA,YAKjFxB,EAAMV,IAAI,QACRjE,EAAA,OAAKqC,UAAU,gBACZmB,IAAK,oBACLjB,IAAIC,WAAWoB,YAAY,oCAAsCd,EAAM,KAAOP,IAAIuC,QAAQ9B,KAAO,QAAU,IAAM,QAAS8C,EAAMF,QAC/HO,MAAOL,EAAMF,OACba,MAAOC,IAAgBZ,UFhCjCrB,iBAAOkC,IAAiBnF,UAAW,oBAAqB,SAAUmD,GAChEA,EAAMV,IAAI,aACR9D,KAAM,YACNqD,KAAM,mBACNoD,MAAOrE,IAAIC,WAAWC,MAAM","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 = 14);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/CommentPost'];","module.exports = flarum.core.compat['helpers/username'];","module.exports = flarum.core.compat['models/Post'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['components/NotificationGrid'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['helpers/punctuateSeries'];","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['helpers/avatar'];","module.exports = flarum.core.compat['components/Notification'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Modal from 'flarum/components/Modal';\nimport avatar from 'flarum/helpers/avatar';\nimport username from 'flarum/helpers/username';\n\nexport default class PostLikesModal extends Modal {\n className() {\n return 'PostLikesModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-likes.forum.post_likes.title');\n }\n\n content() {\n return (\n <div className=\"Modal-body\">\n <ul className=\"PostLikesModal-list\">\n {this.props.post.likes().map(user => (\n <li>\n <a href={app.route.user(user)} config={m.route}>\n {avatar(user)} {' '}\n {username(user)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n );\n }\n}\n","import Notification from 'flarum/components/Notification';\n\nexport default class PostLikedNotification extends Notification {\n icon() {\n return 'far fa-thumbs-up';\n }\n\n href() {\n return app.route.post(this.props.notification.subject());\n }\n\n content() {\n const notification = this.props.notification;\n const user = notification.fromUser();\n\n return app.translator.transChoice('flarum-likes.forum.notifications.post_liked_text', 1, {user});\n }\n\n excerpt() {\n return this.props.notification.subject().contentPlain();\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Post from 'flarum/models/Post';\nimport Model from 'flarum/Model';\nimport NotificationGrid from 'flarum/components/NotificationGrid';\n\nimport addLikeAction from './addLikeAction';\nimport addLikesList from './addLikesList';\nimport PostLikedNotification from './components/PostLikedNotification';\n\napp.initializers.add('flarum-likes', () => {\n app.notificationComponents.postLiked = PostLikedNotification;\n\n Post.prototype.canLike = Model.attribute('canLike');\n Post.prototype.likes = Model.hasMany('likes');\n\n addLikeAction();\n addLikesList();\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('postLiked', {\n name: 'postLiked',\n icon: 'far fa-thumbs-up',\n label: app.translator.trans('flarum-likes.forum.settings.notify_post_liked_label')\n });\n });\n});\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Button from 'flarum/components/Button';\nimport CommentPost from 'flarum/components/CommentPost';\n\nexport default function() {\n extend(CommentPost.prototype, 'actionItems', function(items) {\n const post = this.props.post;\n\n if (post.isHidden() || !post.canLike()) return;\n\n let isLiked = app.session.user && post.likes().some(user => user === app.session.user);\n\n items.add('like',\n Button.component({\n children: app.translator.trans(isLiked ? 'flarum-likes.forum.post.unlike_link' : 'flarum-likes.forum.post.like_link'),\n className: 'Button Button--link',\n onclick: () => {\n isLiked = !isLiked;\n\n post.save({isLiked});\n\n // We've saved the fact that we do or don't like the post, but in order\n // to provide instantaneous feedback to the user, we'll need to add or\n // remove the like from the relationship data manually.\n const data = post.data.relationships.likes.data;\n data.some((like, i) => {\n if (like.id === app.session.user.id()) {\n data.splice(i, 1);\n return true;\n }\n });\n\n if (isLiked) {\n data.unshift({type: 'users', id: app.session.user.id()});\n }\n }\n })\n );\n });\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport CommentPost from 'flarum/components/CommentPost';\nimport punctuateSeries from 'flarum/helpers/punctuateSeries';\nimport username from 'flarum/helpers/username';\nimport icon from 'flarum/helpers/icon';\n\nimport PostLikesModal from './components/PostLikesModal';\n\nexport default function() {\n extend(CommentPost.prototype, 'footerItems', function(items) {\n const post = this.props.post;\n const likes = post.likes();\n\n if (likes && likes.length) {\n const limit = 4;\n const overLimit = likes.length > limit;\n\n // Construct a list of names of users who have liked this post. Make sure the\n // current user is first in the list, and cap a maximum of 4 items.\n const names = likes.sort(a => a === app.session.user ? -1 : 1)\n .slice(0, overLimit ? limit - 1 : limit)\n .map(user => {\n return (\n <a href={app.route.user(user)} config={m.route}>\n {user === app.session.user ? app.translator.trans('flarum-likes.forum.post.you_text') : username(user)}\n </a>\n );\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = likes.length - names.length;\n\n names.push(\n <a href=\"#\" onclick={e => {\n e.preventDefault();\n app.modal.show(new PostLikesModal({post}));\n }}>\n {app.translator.transChoice('flarum-likes.forum.post.others_link', count, {count})}\n </a>\n );\n }\n\n items.add('liked', (\n <div className=\"Post-likedBy\">\n {icon('far fa-thumbs-up')}\n {app.translator.transChoice('flarum-likes.forum.post.liked_by' + (likes[0] === app.session.user ? '_self' : '') + '_text', names.length, {\n count: names.length,\n users: punctuateSeries(names)\n })}\n </div>\n ));\n }\n });\n}\n"],"sourceRoot":""} |