2022-01-20 16:57:32 +08:00
|
|
|
(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)o.o(n,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t);const n=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/app"];var s=o.n(r);const a=flarum.core.compat["common/Model"];var i=o.n(a);const e=flarum.core.compat["common/models/Discussion"];var c=o.n(e);const l=flarum.core.compat["forum/components/IndexPage"];var u=o.n(l);const f=flarum.core.compat["forum/components/NotificationGrid"];var p=o.n(f);const b=flarum.core.compat["common/components/Badge"];var d=o.n(b);const g=flarum.core.compat["common/components/Button"];var w=o.n(g);const _=flarum.core.compat["forum/components/DiscussionPage"];var v=o.n(_);const y=flarum.core.compat["forum/utils/DiscussionControls"];var h=o.n(y);function x(){return x=Object.assign||function(o){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[r]=n[r])}return o},x.apply(this,arguments)}function S(o,t){return S=Object.setPrototypeOf||function(o,t){return o.__proto__=t,o},S(o,t)}function P(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,S(o,t)}const N=flarum.core.compat["common/components/Dropdown"];var O=o.n(N);const k=flarum.core.compat["common/components/Tooltip"];var M=o.n(k);const B=flarum.core.compat["common/helpers/icon"];var j=o.n(B);const D=flarum.core.compat["common/utils/extractText"];var I=o.n(D);const T=flarum.core.compat["common/utils/classList"];var A=o.n(T);const L=flarum.core.compat["common/Component"];var R=function(o){function t(){return o.apply(this,arguments)||this}return P(t,o),t.prototype.view=function(){return m("button",{className:"SubscriptionMenuItem hasIcon",onclick:this.attrs.onclick},this.attrs.active?j()("fas fa-check",{className:"Button-icon"}):"",m("span",{className:"SubscriptionMenuItem-label"},j()(this.attrs.icon,{className:"Button-icon"}),m("strong",null,this.attrs.label),m("span",{className:"SubscriptionMenuItem-description"},this.attrs.description)))},t}(o.n(L)()),C=function(o){function t(){return o.apply(this,arguments)||this}P(t,o);var n=t.prototype;return n.oninit=function(t){o.prototype.oninit.call(this,t),this.options=[{subscription:null,icon:"far fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]},n.view=function(){var o=this,t=this.attrs.discussion,n=t.subscription(),r=s().translator.trans("flarum-subscriptions.forum.sub_controls.follow_button"),a="far fa-star",i="SubscriptionMenu-button--"+n;switch(n){case"follow":r=s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),a="fas fa-star";break;case"ignore":r=s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),a="far fa-eye-slash"}var e=s().session.user.preferences(),c=e.notify_newPost_email,l=e.notify_newPost_alert,u=I()(s().translator.trans(c?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),f=(c||l)&&null===n,p=m(w(),{className:A()("Button","SubscriptionMenu-button",i),icon:a,onclick:this.saveSubscription.bind(this,t,-1!==["follow","ignore"].indexOf(n)?null:"follow")},r);return m("div",{className:"Dropdown ButtonGroup
|