diff --git a/extensions/subscriptions/js/dist/forum.js b/extensions/subscriptions/js/dist/forum.js index ea5d0f1e2..1d8ec9ee4 100644 --- a/extensions/subscriptions/js/dist/forum.js +++ b/extensions/subscriptions/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var o={};function n(r){if(o[r])return o[r].exports;var s=o[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=o,n.d=function(t,o,r){n.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,o){if(1&o&&(t=n(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var s in t)n.d(r,s,function(o){return t[o]}.bind(null,s));return r},n.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(o,"a",o),o},n.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},n.p="",n(n.s=21)}([function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["components/IndexPage"]},function(t,o){t.exports=flarum.core.compat["helpers/icon"]},function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat["models/Discussion"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["components/Badge"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["components/NotificationGrid"]},function(t,o){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,o){t.exports=flarum.core.compat["components/Dropdown"]},function(t,o){t.exports=flarum.core.compat["utils/extractText"]},function(t,o){t.exports=flarum.core.compat.Component},function(t,o){t.exports=flarum.core.compat["components/LinkButton"]},function(t,o){t.exports=flarum.core.compat["states/DiscussionListState"]},function(t,o){t.exports=flarum.core.compat["states/GlobalSearchState"]},function(t,o){t.exports=flarum.core.compat["components/SettingsPage"]},function(t,o){t.exports=flarum.core.compat["components/Switch"]},function(t,o){t.exports=flarum.core.compat["components/Notification"]},function(t,o){t.exports=flarum.core.compat["helpers/username"]},function(t,o,n){"use strict";n.r(o);var r=n(0),s=n(3),e=n.n(s),a=n(8),i=n.n(a),c=n(4),u=n.n(c),l=n(1),p=n.n(l),f=n(9),b=n.n(f),d=n(6),g=n.n(d);var _=n(5),w=n.n(_),y=n(7),h=n.n(y),x=n(10),v=n.n(x);function O(){return(O=Object.assign||function(t){for(var o=1;o\n {this.attrs.active ? icon('fas fa-check', {className: 'Button-icon'}) : ''}\n \n {icon(this.attrs.icon, {className: 'Button-icon'})}\n {this.attrs.label}\n {this.attrs.description}\n \n \n );\n }\n}\n","import Dropdown from 'flarum/components/Dropdown';\nimport Button from 'flarum/components/Button';\nimport icon from 'flarum/helpers/icon';\nimport extractText from 'flarum/utils/extractText';\n\nimport SubscriptionMenuItem from './SubscriptionMenuItem';\n\nexport default class SubscriptionMenu extends Dropdown {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [\n {\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 {\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 {\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 }\n\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n\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\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\n case 'ignore':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');\n buttonIcon = 'far fa-eye-slash';\n break;\n\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 title = extractText(app.translator.trans(notifyEmail\n ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip'\n : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'));\n\n const buttonAttrs = {\n className: 'Button SubscriptionMenu-button ' + buttonClass,\n icon: buttonIcon,\n onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? null : 'follow'),\n title: title\n };\n\n if ((notifyEmail || notifyAlert) && subscription === null) {\n buttonAttrs.oncreate = buttonAttrs.onupdate = vnode => {\n $(vnode.dom).tooltip({\n container: '.SubscriptionMenu',\n placement: 'bottom',\n delay: 250,\n title\n });\n }\n } else {\n buttonAttrs.onupdate = vnode => $(vnode.dom).tooltip('destroy');\n }\n\n return (\n
\n {Button.component(buttonAttrs, buttonLabel)}\n\n \n\n \n
\n );\n }\n\n saveSubscription(discussion, subscription) {\n discussion.save({subscription});\n\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\n","import Notification from 'flarum/components/Notification';\nimport username from 'flarum/helpers/username';\n\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {user: this.attrs.notification.fromUser()});\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\nimport NotificationGrid from 'flarum/components/NotificationGrid';\n\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\n\nimport NewPostNotification from './components/NewPostNotification';\n\napp.initializers.add('subscriptions', function () {\n app.routes.following = { path: '/following', component: IndexPage };\n app.notificationComponents.newPost = NewPostNotification;\n\n Discussion.prototype.subscription = Model.attribute('subscription');\n\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n\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});\n","import { extend } from 'flarum/extend';\nimport Discussion from 'flarum/models/Discussion';\nimport Badge from 'flarum/components/Badge';\n\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function(badges) {\n let badge;\n\n switch (this.subscription()) {\n case 'follow':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: 'fas fa-star',\n type: 'following'\n });\n break;\n\n case 'ignore':\n badge = Badge.component({\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 default:\n // no default\n }\n\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport Button from 'flarum/components/Button';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\n\nimport SubscriptionMenu from './components/SubscriptionMenu';\n\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: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'fas fa-star', save: 'follow'},\n follow: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'far fa-star', save: null},\n ignore: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'fas fa-eye', save: null}\n };\n\n const subscription = discussion.subscription() || 'none';\n\n items.add('subscription', Button.component({\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, {subscription: states[subscription].save})\n }, states[subscription].label));\n }\n });\n\n extend(DiscussionPage.prototype, 'sidebarItems', function(items) {\n if (app.session.user) {\n const discussion = this.discussion;\n\n items.add('subscription', SubscriptionMenu.component({discussion}));\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport LinkButton from 'flarum/components/LinkButton';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/states/GlobalSearchState';\n\nexport default function addSubscriptionFilter() {\n extend(IndexPage.prototype, 'navItems', function(items) {\n if (app.session.user) {\n const params = app.search.stickyParams();\n\n items.add('following', LinkButton.component({\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\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\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\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter.subscription = 'following';\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport SettingsPage from 'flarum/components/SettingsPage';\nimport Switch from 'flarum/components/Switch';\n\nexport default function () {\n extend(SettingsPage.prototype, 'notificationsItems', function (items) {\n items.add('followAfterReply',\n Switch.component({\n state: this.user.preferences().followAfterReply,\n onchange: (value) => {\n this.followAfterReplyLoading = true;\n\n this.user.savePreferences({ followAfterReply: value }).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 );\n });\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/subscriptions/webpack/bootstrap","webpack://@flarum/subscriptions/external \"flarum.core.compat['extend']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/IndexPage']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['app']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['models/Discussion']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/Badge']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['utils/classList']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['Model']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/NotificationGrid']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/Dropdown']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['utils/extractText']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['Component']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/LinkButton']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['states/DiscussionListState']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['states/GlobalSearchState']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/SettingsPage']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/Switch']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['components/Notification']\"","webpack://@flarum/subscriptions/external \"flarum.core.compat['helpers/username']\"","webpack://@flarum/subscriptions/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/subscriptions/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenuItem.js","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.js","webpack://@flarum/subscriptions/./src/forum/components/NewPostNotification.js","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.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","_extends","assign","target","arguments","length","source","apply","this","_inheritsLoose","subClass","superClass","constructor","__proto__","SubscriptionMenuItem","view","className","onclick","attrs","active","icon","label","description","Component","SubscriptionMenu","oninit","vnode","options","subscription","app","translator","trans","discussion","buttonLabel","buttonIcon","buttonClass","preferences","session","user","notifyEmail","notifyAlert","tooltipText","extractText","shouldShowTooltip","button","classList","saveSubscription","indexOf","text","position","data-toggle","map","component","save","$","tooltip","Dropdown","NewPostNotification","href","notification","subject","content","route","postNumber","fromUser","Notification","initializers","add","routes","following","path","IndexPage","notificationComponents","newPost","Discussion","Model","attribute","extend","badges","badge","Badge","type","DiscussionControls","items","context","DiscussionPage","states","none","follow","ignore","Button","params","search","stickyParams","LinkButton","current","setTitle","GlobalSearchState","onFollowing","DiscussionListState","filter","SettingsPage","Switch","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","redraw","loading","NotificationGrid"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,S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I,aAGNC,QAAStG,KAAKkG,yBACb7E,IAAIC,WAAWC,MAAM,qEJO5B8C,iBAAOkC,IAAiBrH,UAAW,qBAAqB,SAASyF,GAC/DA,EAAMhB,IAAI,UAAW,CACnB9F,KAAM,UACN+C,KAAM,cACNC,MAAOQ,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 = 23);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/IndexPage'];","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Badge'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['utils/classList'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['components/NotificationGrid'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['components/Dropdown'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/LinkButton'];","module.exports = flarum.core.compat['states/DiscussionListState'];","module.exports = flarum.core.compat['states/GlobalSearchState'];","module.exports = flarum.core.compat['components/SettingsPage'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['components/Notification'];","module.exports = flarum.core.compat['helpers/username'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\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 Component from 'flarum/Component';\nimport icon from 'flarum/helpers/icon';\n\nexport default class SubscriptionMenuItem extends Component {\n view() {\n return (\n \n );\n }\n}\n","import Dropdown from 'flarum/components/Dropdown';\nimport Button from 'flarum/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/helpers/icon';\nimport extractText from 'flarum/utils/extractText';\nimport classList from 'flarum/utils/classList';\n\nimport SubscriptionMenuItem from './SubscriptionMenuItem';\n\nexport default class SubscriptionMenu extends Dropdown {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [\n {\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 {\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 {\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 }\n\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n\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\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\n case 'ignore':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');\n buttonIcon = 'far fa-eye-slash';\n break;\n\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(\n app.translator.trans(\n notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'\n )\n );\n\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n\n const button = (\n \n {buttonLabel}\n \n );\n\n return (\n
\n {shouldShowTooltip ? (\n \n {button}\n \n ) : (\n button\n )}\n\n \n\n
    \n {this.options.map((attrs) => (\n
  • \n {SubscriptionMenuItem.component({\n ...attrs,\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription,\n })}\n
  • \n ))}\n
\n
\n );\n }\n\n saveSubscription(discussion, subscription) {\n discussion.save({ subscription });\n\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\n","import Notification from 'flarum/components/Notification';\nimport username from 'flarum/helpers/username';\n\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {user: this.attrs.notification.fromUser()});\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\nimport NotificationGrid from 'flarum/components/NotificationGrid';\n\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\n\nimport NewPostNotification from './components/NewPostNotification';\n\napp.initializers.add('subscriptions', function () {\n app.routes.following = { path: '/following', component: IndexPage };\n app.notificationComponents.newPost = NewPostNotification;\n\n Discussion.prototype.subscription = Model.attribute('subscription');\n\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n\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});\n","import { extend } from 'flarum/extend';\nimport Discussion from 'flarum/models/Discussion';\nimport Badge from 'flarum/components/Badge';\n\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function(badges) {\n let badge;\n\n switch (this.subscription()) {\n case 'follow':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: 'fas fa-star',\n type: 'following'\n });\n break;\n\n case 'ignore':\n badge = Badge.component({\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 default:\n // no default\n }\n\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport Button from 'flarum/components/Button';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\n\nimport SubscriptionMenu from './components/SubscriptionMenu';\n\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: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'fas fa-star', save: 'follow'},\n follow: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'far fa-star', save: null},\n ignore: {label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'fas fa-eye', save: null}\n };\n\n const subscription = discussion.subscription() || 'none';\n\n items.add('subscription', Button.component({\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, {subscription: states[subscription].save})\n }, states[subscription].label));\n }\n });\n\n extend(DiscussionPage.prototype, 'sidebarItems', function(items) {\n if (app.session.user) {\n const discussion = this.discussion;\n\n items.add('subscription', SubscriptionMenu.component({discussion}));\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport LinkButton from 'flarum/components/LinkButton';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/states/GlobalSearchState';\n\nexport default function addSubscriptionFilter() {\n extend(IndexPage.prototype, 'navItems', function(items) {\n if (app.session.user) {\n const params = app.search.stickyParams();\n\n items.add('following', LinkButton.component({\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\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\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\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter.subscription = 'following';\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport SettingsPage from 'flarum/components/SettingsPage';\nimport Switch from 'flarum/components/Switch';\n\nexport default function () {\n extend(SettingsPage.prototype, 'notificationsItems', function (items) {\n items.add('followAfterReply',\n Switch.component({\n state: this.user.preferences().followAfterReply,\n onchange: (value) => {\n this.followAfterReplyLoading = true;\n\n this.user.savePreferences({ followAfterReply: value }).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 );\n });\n}\n"],"sourceRoot":""} \ No newline at end of file