mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
9feb9dd4eb
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,aCAvBS,OAAOC,IAAIV,IAAI,OAAQ,gBAA5D,MCAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,qC,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,aCA5D,MAAM,EAA+BS,OA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BACb,qBAAqB,kEACxBd,EAAMxC,IAAI,oBAAqBT,EAAE,IAAQ,CACvCoE,GAAI,6CACJR,QAAsD,OAA3CD,EAAexD,KAAKuC,KAAKtB,iBAA0BuC,EAAa,8CAC3EG,SAAUO,IACRlE,KAAKuC,KAAKsB,gBAAgB,CACxB,4CAA6CK,GAC7C,GAEH,qBAAqB,mEAC1B,KJZA,IAAAxB,QAAO,cAA4B,qBAAqB,SAAUI,GAChEA,EAAMxC,IAAI,UAAW,CACnB6D,KAAM,UACNhE,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/Model')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/NotificationGrid')\"","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/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/helpers/icon')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenuItem.js","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.js","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/states/DiscussionListState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/SettingsPage')\"","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/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/NotificationGrid');","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');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nexport default class SubscriptionMenuItem extends Component {\n view() {\n return m(\"button\", {\n className: \"SubscriptionMenuItem hasIcon\",\n onclick: this.attrs.onclick\n }, this.attrs.active && icon('fas fa-check', {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"SubscriptionMenuItem-label\"\n }, icon(this.attrs.icon, {\n className: 'Button-icon'\n }), m(\"strong\", null, this.attrs.label), m(\"span\", {\n className: \"SubscriptionMenuItem-description\"\n }, this.attrs.description)));\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/SubscriptionMenuItem', SubscriptionMenuItem)","import app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport extractText from 'flarum/common/utils/extractText';\nimport classList from 'flarum/common/utils/classList';\nimport SubscriptionMenuItem from './SubscriptionMenuItem';\nexport default class SubscriptionMenu extends Dropdown {\n oninit(vnode) {\n super.oninit(vnode);\n 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 }\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n let buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button');\n let buttonIcon = 'far fa-star';\n const buttonClass = 'SubscriptionMenu-button--' + subscription;\n switch (subscription) {\n case 'follow':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');\n buttonIcon = 'fas fa-star';\n break;\n case 'ignore':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');\n buttonIcon = 'far fa-eye-slash';\n break;\n default:\n // no default\n }\n\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 const button = m(Button, {\n className: classList('Button', 'SubscriptionMenu-button', buttonClass),\n icon: buttonIcon,\n onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? null : 'follow')\n }, buttonLabel);\n return m(\"div\", {\n className: \"Dropdown ButtonGroup SubscriptionMenu\"\n }, shouldShowTooltip ? m(Tooltip, {\n text: tooltipText,\n position: \"bottom\"\n }, button) : button, m(\"button\", {\n className: classList('Dropdown-toggle Button Button--icon', buttonClass),\n \"data-toggle\": \"dropdown\"\n }, icon('fas fa-caret-down', {\n className: 'Button-icon'\n })), m(\"ul\", {\n className: \"Dropdown-menu dropdown-menu Dropdown-menu--right\"\n }, this.options.map(attrs => m(\"li\", null, m(SubscriptionMenuItem, 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 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/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/SettingsPage');","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}\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 Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\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(NotificationGrid.prototype, '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 DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nexport default function addSubscriptionFilter() {\n extend(IndexPage.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 SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\nexport default function () {\n extend(SettingsPage.prototype, '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","SubscriptionMenuItem","view","m","className","onclick","this","attrs","active","icon","label","description","add","SubscriptionMenu","oninit","vnode","super","options","subscription","discussion","buttonLabel","buttonIcon","buttonClass","preferences","notifyEmail","notifyAlert","tooltipText","shouldShowTooltip","button","saveSubscription","bind","indexOf","text","position","map","assign","save","$","tooltip","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","attribute","extend","badges","badge","type","items","context","states","none","follow","ignore","params","onFollowing","filter","q","_preferences","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","redraw","loading","id","val","name"],"sourceRoot":""} |