mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 23:53:42 +08:00
db0d9cb006
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
1 line
25 KiB
Plaintext
Generated
1 line
25 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,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,2B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,mC,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,kC,aCA7C,SAASW,EAAQV,GAG9B,OAAOU,EAAU,mBAAqBL,QAAU,iBAAmBA,OAAOM,SAAW,SAAUX,GAC7F,cAAcA,CAChB,EAAI,SAA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B,KAAK6D,yBAA0B,EAC/B7D,KAAKyC,KAAKqB,gBAAgB,CACxBH,iBAAkBjF,IACjBqF,MAAK,KACN/D,KAAK6D,yBAA0B,EAC/B3C,EAAE8C,QAAQ,GACV,EAEJC,QAASjE,KAAK6D,yBACb,qBAAqB,kEACxBZ,EAAMf,IAAI,oBAAqBhB,EAAE,IAAQ,CACvCgD,GAAI,6CACJR,QAAsD,OAA3CD,EAAezD,KAAKyC,KAAK5B,iBAA0B4C,EAAa,8CAC3EG,SAAUO,IACRnE,KAAKyC,KAAKqB,gBAAgB,CACxB,4CAA6CK,GAC7C,GAEH,qBAAqB,mEAC1B,KJdA,IAAAtB,QAAO,2CAA4C,qBAAqB,SAAUI,GAChFA,EAAMf,IAAI,UAAW,CACnBkC,KAAM,UACNlE,KAAM,cACNC,MAAO,qBAAqB,8DAEhC,GACF,G","sources":["webpack://@flarum/subscriptions/webpack/bootstrap","webpack://@flarum/subscriptions/webpack/runtime/compat get default export","webpack://@flarum/subscriptions/webpack/runtime/define property getters","webpack://@flarum/subscriptions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/subscriptions/webpack/runtime/make namespace object","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/DetailedDropdownItem')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/SplitDropdown')\"","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.tsx","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Switch')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/subscriptions/./src/forum/components/NewPostNotification.js","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/subscriptions/./src/forum/extend.ts","webpack://@flarum/subscriptions/./src/forum/index.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionBadge.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionControls.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionFilter.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionSettings.tsx"],"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', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","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}","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/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/DetailedDropdownItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/SplitDropdown');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport DetailedDropdownItem from 'flarum/common/components/DetailedDropdownItem';\nimport SplitDropdown from 'flarum/common/components/SplitDropdown';\nexport default class SubscriptionMenu extends Dropdown {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"options\", [{\n subscription: null,\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')\n }, {\n subscription: 'follow',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')\n }, {\n subscription: 'ignore',\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text')\n }]);\n _defineProperty(this, \"possibleButtonAttrs\", {\n null: {\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button')\n },\n follow: {\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button')\n },\n ignore: {\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button')\n }\n });\n }\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n const buttonAttrs = this.possibleButtonAttrs[subscription];\n const preferences = app.session.user.preferences();\n const notifyEmail = preferences['notify_newPost_email'];\n const notifyAlert = preferences['notify_newPost_alert'];\n const tooltipText = extractText(app.translator.trans(notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'));\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n return m(SplitDropdown, {\n className: \"SubscriptionMenu\",\n buttonClassName: \"SubscriptionMenu-button--\".concat(subscription),\n tooltip: shouldShowTooltip ? tooltipText : null,\n mainAction: m(Button, {\n className: 'SubscriptionMenu-button',\n icon: buttonAttrs.icon,\n onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? null : 'follow')\n }, buttonAttrs.label)\n }, this.options.map(attrs => m(DetailedDropdownItem, Object.assign({}, attrs, {\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription\n }))));\n }\n saveSubscription(discussion, subscription) {\n discussion.save({\n subscription\n });\n\n // @ts-ignore\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/SubscriptionMenu', SubscriptionMenu);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Switch');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n return app.route.discussion(discussion, content.postNumber);\n }\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {\n user: this.attrs.notification.fromUser()\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/NewPostNotification', NewPostNotification);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","import Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nexport default [new Extend.Routes() //\n.add('following', '/following', IndexPage), new Extend.Model(Discussion) //\n.attribute('subscription')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\nimport NewPostNotification from './components/NewPostNotification';\nexport { default as extend } from './extend';\napp.initializers.add('subscriptions', function () {\n app.notificationComponents.newPost = NewPostNotification;\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('newPost', {\n name: 'newPost',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')\n });\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';\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n let badge;\n switch (this.subscription()) {\n case 'follow':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: \"fas fa-star\",\n type: \"following\"\n });\n break;\n case 'ignore':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),\n icon: \"far fa-eye-slash\",\n type: \"ignoring\"\n });\n break;\n }\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport SubscriptionMenu from './components/SubscriptionMenu';\nexport default function addSubscriptionControls() {\n extend(DiscussionControls, 'userControls', function (items, discussion, context) {\n if (app.session.user && !(context instanceof DiscussionPage)) {\n const states = {\n none: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'),\n icon: 'fas fa-star',\n save: 'follow'\n },\n follow: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'),\n icon: 'far fa-star',\n save: null\n },\n ignore: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'),\n icon: 'fas fa-eye',\n save: null\n }\n };\n const subscription = discussion.subscription() || 'none';\n items.add('subscription', m(Button, {\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, {\n subscription: states[subscription].save\n })\n }, states[subscription].label));\n }\n });\n extend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n if (app.session.user) {\n const discussion = this.discussion;\n items.add('subscription', m(SubscriptionMenu, {\n discussion: discussion\n }), 80);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nexport default function addSubscriptionFilter() {\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n if (app.session.user) {\n const params = app.search.stickyParams();\n items.add('following', m(LinkButton, {\n href: app.route('following', params),\n icon: \"fas fa-star\"\n }, app.translator.trans('flarum-subscriptions.forum.index.following_link')), 50);\n }\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'following') {\n app.setTitle(app.translator.trans('flarum-subscriptions.forum.following.meta_title_text'));\n }\n });\n extend(GlobalSearchState.prototype, 'params', function (params) {\n // We can't set `q` here directly, as that would make the search bar\n // think that text has been entered, and display the \"clear\" button.\n params.onFollowing = app.current.get('routeName') === 'following';\n });\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter || (params.filter = {});\n if (params.filter.q) {\n params.filter.q += ' is:following';\n } else {\n params.filter.subscription = 'following';\n }\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Switch from 'flarum/common/components/Switch';\nexport default function () {\n extend('flarum/forum/components/SettingsPage', 'notificationsItems', function (items) {\n var _preferences;\n items.add('followAfterReply', m(Switch, {\n state: this.user.preferences().followAfterReply,\n onchange: value => {\n this.followAfterReplyLoading = true;\n this.user.savePreferences({\n followAfterReply: value\n }).then(() => {\n this.followAfterReplyLoading = false;\n m.redraw();\n });\n },\n loading: this.followAfterReplyLoading\n }, app.translator.trans('flarum-subscriptions.forum.settings.follow_after_reply_label')));\n items.add('notifyForAllPosts', m(Switch, {\n id: \"flarum_subscriptions__notify_for_all_posts\",\n state: !!((_preferences = this.user.preferences()) != null && _preferences['flarum-subscriptions.notify_for_all_posts']),\n onchange: val => {\n this.user.savePreferences({\n 'flarum-subscriptions.notify_for_all_posts': val\n });\n }\n }, app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')));\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","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","SubscriptionMenu","super","arguments","this","subscription","icon","label","description","null","follow","ignore","view","discussion","attrs","buttonAttrs","possibleButtonAttrs","preferences","notifyEmail","notifyAlert","tooltipText","shouldShowTooltip","m","className","buttonClassName","concat","tooltip","mainAction","onclick","saveSubscription","bind","indexOf","options","map","assign","active","save","$","add","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","excerpt","attribute","extend","badges","badge","type","items","context","states","none","params","onFollowing","filter","q","_preferences","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","redraw","loading","id","val","name"],"sourceRoot":""} |