Bundled output for commit a47bd2d457

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot 2024-10-19 17:44:34 +00:00
parent a47bd2d457
commit caefacbecd
98 changed files with 98 additions and 98 deletions

View File

@ -1,2 +1,2 @@
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const r=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","forum/app");var a=e.n(o);const n=flarum.reg.get("core","forum/utils/PostControls");var s=e.n(n);const l=flarum.reg.get("core","forum/components/Post");var u=e.n(l);a().initializers.add("flarum-akismet",(()=>{(0,r.extend)(s(),"destructiveControls",(function(e,t){if(e.has("approve")){const r=t.flags();if(r&&r.some((e=>"akismet"===(null==e?void 0:e.type())))){const t=e.get("approve");t&&"object"==typeof t&&"children"in t&&(t.children=a().translator.trans("flarum-akismet.forum.post.not_spam_button"))}}})),(0,r.override)(u().prototype,"flagReason",(function(e,t){return"akismet"===t.type()?a().translator.trans("flarum-akismet.forum.post.akismet_flagged_text"):e(t)}))}))})(),module.exports=t})(); (()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{"use strict";const t=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var o=e.n(r);const a=flarum.reg.get("core","forum/utils/PostControls");var n=e.n(a);const s=flarum.reg.get("core","forum/components/Post");var m=e.n(s);o().initializers.add("flarum-akismet",(()=>{(0,t.extend)(n(),"destructiveControls",(function(e,t){if(e.has("approve")){const r=t.flags();if(r&&r.some((e=>"akismet"===e?.type()))){const t=e.get("approve");t&&"object"==typeof t&&"children"in t&&(t.children=o().translator.trans("flarum-akismet.forum.post.not_spam_button"))}}})),(0,t.override)(m().prototype,"flagReason",(function(e,t){return"akismet"===t.type()?o().translator.trans("flarum-akismet.forum.post.akismet_flagged_text"):e(t)}))}))})(),module.exports={}})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

View File

@ -1 +1 @@
{"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,+BCL9D,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,yB,aCI5D,iBAAiBW,IAAI,kBAAkB,MACrC,IAAAC,QAAO,IAAc,uBAAuB,SAAUC,EAAOC,GAC3D,GAAID,EAAME,IAAI,WAAY,CACxB,MAAMC,EAAQF,EAAKE,QACnB,GAAIA,GAASA,EAAMC,MAAKC,GAAkD,aAAjC,MAARA,OAAe,EAASA,EAAKC,UAAwB,CACpF,MAAMC,EAAcP,EAAMb,IAAI,WAC1BoB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAW,eAAeC,MAAM,6CAEhD,CACF,CACF,KACA,IAAAC,UAAS,cAAyB,cAAc,SAAUC,EAAUN,GAClE,MAAoB,YAAhBA,EAAKC,OACA,eAAeG,MAAM,kDAEvBE,EAASN,EAClB,GAAE,G","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/webpack/runtime/make namespace object","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/utils/PostControls')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/akismet/./src/forum/index.ts"],"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', 'forum/utils/PostControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport PostComponent from 'flarum/forum/components/Post';\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items, post) {\n if (items.has('approve')) {\n const flags = post.flags();\n if (flags && flags.some(flag => (flag == null ? void 0 : flag.type()) === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n override(PostComponent.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n return original(flag);\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","add","extend","items","post","has","flags","some","flag","type","approveItem","children","trans","override","original"],"sourceRoot":""} {"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,I,mBCAlF,MAAM,EAA+BI,OAAOC,IAAIP,IAAI,OAAQ,iBCAtD,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BM,OAAOC,IAAIP,IAAI,OAAQ,yB,aCI5D,iBAAiBQ,IAAI,kBAAkB,MACrC,IAAAC,QAAO,IAAc,uBAAuB,SAAUC,EAAOC,GAC3D,GAAID,EAAME,IAAI,WAAY,CACxB,MAAMC,EAAQF,EAAKE,QACnB,GAAIA,GAASA,EAAMC,MAAKC,GAAyB,YAAjBA,GAAMC,SAAuB,CAC3D,MAAMC,EAAcP,EAAMV,IAAI,WAC1BiB,GAAsC,iBAAhBA,GAA4B,aAAcA,IAClEA,EAAYC,SAAW,eAAeC,MAAM,6CAEhD,CACF,CACF,KACA,IAAAC,UAAS,cAAyB,cAAc,SAAUC,EAAUN,GAClE,MAAoB,YAAhBA,EAAKC,OACA,eAAeG,MAAM,kDAEvBE,EAASN,EAClB,GAAE,G","sources":["webpack://@flarum/akismet/webpack/bootstrap","webpack://@flarum/akismet/webpack/runtime/compat get default export","webpack://@flarum/akismet/webpack/runtime/define property getters","webpack://@flarum/akismet/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/utils/PostControls')\"","webpack://@flarum/akismet/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/akismet/./src/forum/index.ts"],"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))","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', 'forum/utils/PostControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport PostComponent from 'flarum/forum/components/Post';\napp.initializers.add('flarum-akismet', () => {\n extend(PostControls, 'destructiveControls', function (items, post) {\n if (items.has('approve')) {\n const flags = post.flags();\n if (flags && flags.some(flag => flag?.type() === 'akismet')) {\n const approveItem = items.get('approve');\n if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {\n approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');\n }\n }\n }\n });\n override(PostComponent.prototype, 'flagReason', function (original, flag) {\n if (flag.type() === 'akismet') {\n return app.translator.trans('flarum-akismet.forum.post.akismet_flagged_text');\n }\n return original(flag);\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","reg","add","extend","items","post","has","flags","some","flag","type","approveItem","children","trans","override","original"],"sourceRoot":""}

View File

@ -1,2 +1,2 @@
(()=>{var o={n:t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},d:(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[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 e=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var a=o.n(r);const n=flarum.reg.get("core","common/models/Discussion");var p=o.n(n);const s=flarum.reg.get("core","common/models/Post");var i=o.n(s);const c=flarum.reg.get("core","common/components/Badge");var u=o.n(c);const l=flarum.reg.get("core","forum/components/DiscussionListItem");var d=o.n(l);const v=flarum.reg.get("core","forum/components/Post");var f=o.n(v);const g=flarum.reg.get("core","forum/components/CommentPost");var A=o.n(g);const y=flarum.reg.get("core","common/components/Button");var b=o.n(y);const h=flarum.reg.get("core","forum/utils/PostControls");var _=o.n(h);a().initializers.add("flarum-approval",(()=>{p().prototype.isApproved=p().attribute("isApproved"),(0,e.extend)(p().prototype,"badges",(function(o){this.isApproved()||o.has("hidden")||o.add("awaitingApproval",m(u(),{type:"awaitingApproval",icon:"fas fa-gavel",label:a().translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))})),i().prototype.isApproved=i().attribute("isApproved"),i().prototype.canApprove=i().attribute("canApprove"),(0,e.extend)(d().prototype,"elementAttrs",(function(o){this.attrs.discussion.isApproved()||(o.className+=" DiscussionListItem--unapproved")})),(0,e.extend)(f().prototype,"elementAttrs",(function(o){this.attrs.post.isApproved()||(o.className+=" Post--unapproved")})),(0,e.extend)(A().prototype,"headerItems",(function(o){this.attrs.post.isApproved()||this.attrs.post.isHidden()||o.add("unapproved",a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"))})),(0,e.override)(f().prototype,"flagReason",(function(o,t){return"approval"===t.type()?a().translator.trans("flarum-approval.forum.post.awaiting_approval_text"):o(t)})),(0,e.extend)(_(),"destructiveControls",(function(o,t){!t.isApproved()&&t.canApprove()&&o.add("approve",m(b(),{icon:"fas fa-check",onclick:_().approveAction.bind(t)},a().translator.trans("flarum-approval.forum.post_controls.approve_button")),10)})),_().approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}}),-10)})(),module.exports=t})(); (()=>{var t={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return t.d(r,{a:r}),r},d:(o,r)=>{for(var e in r)t.o(r,e)&&!t.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:r[e]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o)};(()=>{"use strict";const o=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var e=t.n(r);const a=flarum.reg.get("core","common/models/Discussion");var n=t.n(a);const p=flarum.reg.get("core","common/models/Post");var s=t.n(p);const i=flarum.reg.get("core","common/components/Badge");var c=t.n(i);const u=flarum.reg.get("core","forum/components/DiscussionListItem");var l=t.n(u);const d=flarum.reg.get("core","forum/components/Post");var v=t.n(d);const f=flarum.reg.get("core","forum/components/CommentPost");var g=t.n(f);const A=flarum.reg.get("core","common/components/Button");var h=t.n(A);const b=flarum.reg.get("core","forum/utils/PostControls");var y=t.n(b);e().initializers.add("flarum-approval",(()=>{n().prototype.isApproved=n().attribute("isApproved"),(0,o.extend)(n().prototype,"badges",(function(t){this.isApproved()||t.has("hidden")||t.add("awaitingApproval",m(c(),{type:"awaitingApproval",icon:"fas fa-gavel",label:e().translator.trans("flarum-approval.forum.badge.awaiting_approval_tooltip")}))})),s().prototype.isApproved=s().attribute("isApproved"),s().prototype.canApprove=s().attribute("canApprove"),(0,o.extend)(l().prototype,"elementAttrs",(function(t){this.attrs.discussion.isApproved()||(t.className+=" DiscussionListItem--unapproved")})),(0,o.extend)(v().prototype,"elementAttrs",(function(t){this.attrs.post.isApproved()||(t.className+=" Post--unapproved")})),(0,o.extend)(g().prototype,"headerItems",(function(t){this.attrs.post.isApproved()||this.attrs.post.isHidden()||t.add("unapproved",e().translator.trans("flarum-approval.forum.post.awaiting_approval_text"))})),(0,o.override)(v().prototype,"flagReason",(function(t,o){return"approval"===o.type()?e().translator.trans("flarum-approval.forum.post.awaiting_approval_text"):t(o)})),(0,o.extend)(y(),"destructiveControls",(function(t,o){!o.isApproved()&&o.canApprove()&&t.add("approve",m(h(),{icon:"fas fa-check",onclick:y().approveAction.bind(o)},e().translator.trans("flarum-approval.forum.post_controls.approve_button")),10)})),y().approveAction=function(){this.save({isApproved:!0}),1===this.number()&&this.discussion().pushAttributes({isApproved:!0})}}),-10)})(),module.exports={}})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

2
extensions/embed/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/emoji/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/flags/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/likes/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/lock/js/dist/forum.js generated vendored
View File

@ -1,2 +1,2 @@
(()=>{var o={n:e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},d:(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},e={};(()=>{"use strict";o.r(e),o.d(e,{extend:()=>N});const t=flarum.reg.get("core","common/extend"),n=flarum.reg.get("core","forum/app");var r=o.n(n);const s=flarum.reg.get("core","common/models/Discussion");var c=o.n(s);const a=flarum.reg.get("core","common/components/Badge");var i=o.n(a);const l=flarum.reg.get("core","forum/utils/DiscussionControls");var u=o.n(l);const d=flarum.reg.get("core","forum/components/DiscussionPage");var f=o.n(d);const k=flarum.reg.get("core","common/components/Button");var g=o.n(k);const p=flarum.reg.get("core","common/extenders");var b=o.n(p);const y=flarum.reg.get("core","forum/components/EventPost");var _=o.n(y);class v extends(_()){icon(){return this.attrs.post.content().locked?"fas fa-lock":"fas fa-unlock"}descriptionKey(){return this.attrs.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"}}flarum.reg.add("flarum-lock","forum/components/DiscussionLockedPost",v);const x=flarum.reg.get("core","common/query/IGambit"),L=flarum.reg.get("core","common/app");var h=o.n(L);class P extends x.BooleanGambit{key(){return h().translator.trans("flarum-lock.lib.gambits.discussions.locked.key",{},!0)}filterKey(){return"locked"}}flarum.reg.add("flarum-lock","common/query/discussions/LockedGambit",P);const w=[(new(b().Search)).gambit("discussions",P)],S=flarum.reg.get("core","forum/components/Notification");var j=o.n(S);class D extends(j()){icon(){return"fas fa-lock"}href(){const o=this.attrs.notification;return r().route.discussion(o.subject(),o.content().postNumber)}content(){return r().translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.attrs.notification.fromUser()})}excerpt(){return null}}flarum.reg.add("flarum-lock","forum/components/DiscussionLockedNotification",D);const N=[...w,(new(b().PostTypes)).add("discussionLocked",v),(new(b().Notification)).add("discussionLocked",D),new(b().Model)(c()).attribute("isLocked").attribute("canLock")];r().initializers.add("flarum-lock",(()=>{(0,t.extend)(c().prototype,"badges",(function(o){this.isLocked()&&o.add("locked",m(i(),{type:"locked",label:r().translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))})),(0,t.extend)(u(),"moderationControls",(function(o,e){e.canLock()&&o.add("lock",m(g(),{icon:"fas fa-lock",onclick:this.lockAction.bind(e)},r().translator.trans("flarum-lock.forum.discussion_controls.".concat(e.isLocked()?"unlock":"lock","_button"))))})),u().lockAction=function(){this.save({isLocked:!this.isLocked()}).then((()=>{r().current.matches(f())&&r().current.get("stream").update(),m.redraw()}))},(0,t.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(o){o.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:r().translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})}))}))})(),module.exports=e})(); (()=>{var o={n:e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},d:(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},e={};(()=>{"use strict";o.r(e),o.d(e,{extend:()=>N});const t=flarum.reg.get("core","common/extend"),n=flarum.reg.get("core","forum/app");var r=o.n(n);const s=flarum.reg.get("core","common/models/Discussion");var c=o.n(s);const a=flarum.reg.get("core","common/components/Badge");var i=o.n(a);const l=flarum.reg.get("core","forum/utils/DiscussionControls");var u=o.n(l);const d=flarum.reg.get("core","forum/components/DiscussionPage");var f=o.n(d);const k=flarum.reg.get("core","common/components/Button");var g=o.n(k);const p=flarum.reg.get("core","common/extenders");var b=o.n(p);const y=flarum.reg.get("core","forum/components/EventPost");var _=o.n(y);class v extends(_()){icon(){return this.attrs.post.content().locked?"fas fa-lock":"fas fa-unlock"}descriptionKey(){return this.attrs.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"}}flarum.reg.add("flarum-lock","forum/components/DiscussionLockedPost",v);const x=flarum.reg.get("core","common/query/IGambit"),L=flarum.reg.get("core","common/app");var h=o.n(L);class P extends x.BooleanGambit{key(){return h().translator.trans("flarum-lock.lib.gambits.discussions.locked.key",{},!0)}filterKey(){return"locked"}}flarum.reg.add("flarum-lock","common/query/discussions/LockedGambit",P);const w=[(new(b().Search)).gambit("discussions",P)],S=flarum.reg.get("core","forum/components/Notification");var j=o.n(S);class D extends(j()){icon(){return"fas fa-lock"}href(){const o=this.attrs.notification;return r().route.discussion(o.subject(),o.content().postNumber)}content(){return r().translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.attrs.notification.fromUser()})}excerpt(){return null}}flarum.reg.add("flarum-lock","forum/components/DiscussionLockedNotification",D);const N=[...w,(new(b().PostTypes)).add("discussionLocked",v),(new(b().Notification)).add("discussionLocked",D),new(b().Model)(c()).attribute("isLocked").attribute("canLock")];r().initializers.add("flarum-lock",(()=>{(0,t.extend)(c().prototype,"badges",(function(o){this.isLocked()&&o.add("locked",m(i(),{type:"locked",label:r().translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))})),(0,t.extend)(u(),"moderationControls",(function(o,e){e.canLock()&&o.add("lock",m(g(),{icon:"fas fa-lock",onclick:this.lockAction.bind(e)},r().translator.trans(`flarum-lock.forum.discussion_controls.${e.isLocked()?"unlock":"lock"}_button`)))})),u().lockAction=function(){this.save({isLocked:!this.isLocked()}).then((()=>{r().current.matches(f())&&r().current.get("stream").update(),m.redraw()}))},(0,t.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(o){o.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:r().translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})}))}))})(),module.exports=e})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
/*! For license information please see admin.js.LICENSE.txt */ /*! For license information please see admin.js.LICENSE.txt */
(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.reg.get("core","admin/app");var r=t.n(o);const i=flarum.reg.get("core","common/app");var n=t.n(i);const a=flarum.reg.get("core","common/extend"),l=flarum.reg.get("core","common/utils/BasicEditorDriver");var c=t.n(l);const s=flarum.reg.get("core","common/utils/styleSelectedText");var d=t.n(s);const f=flarum.reg.get("core","common/Component");var u=t.n(f);class p extends(u()){view(t){return m("div",{className:"MarkdownToolbar"},t.children)}}flarum.reg.add("flarum-markdown","common/components/MarkdownToolbar",p);const k=flarum.reg.get("core","common/components/Icon");var h=t.n(k);const g=flarum.reg.get("core","common/components/Tooltip");var x=t.n(g);class b extends(u()){oncreate(t){super.oncreate(t)}view(){const t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},m(h(),{name:this.attrs.icon}));return this.attrs.title?m(x(),{text:this.attrs.title},t):t}keydown(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())}}flarum.reg.add("flarum-markdown","common/components/MarkdownButton",b);const y=flarum.reg.get("core","common/utils/ItemList");var v=t.n(y);const w=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",_={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},T=(t,e)=>{d()(e.el,_[t])};function S(t,e,o){return function(r){r.key===e&&(r.metaKey&&"⌘"===w||r.ctrlKey&&"ctrl"===w)&&(r.preventDefault(),T(t,o))}}function M(t){const e="function"==typeof t?t():new(v());function o(t,e){return n().translator.trans("flarum-markdown.lib.composer.".concat(t,"_tooltip"))+(e?" <".concat(w,"-").concat(e,">"):"")}const r=t=>()=>T(t,this.attrs.composer.editor);return e.add("header",m(b,{title:o("header"),icon:"fas fa-heading",onclick:r("header")}),1e3),e.add("bold",m(b,{title:o("bold","b"),icon:"fas fa-bold",onclick:r("bold")}),900),e.add("italic",m(b,{title:o("italic","i"),icon:"fas fa-italic",onclick:r("italic")}),800),e.add("strikethrough",m(b,{title:o("strikethrough"),icon:"fas fa-strikethrough",onclick:r("strikethrough")}),700),e.add("quote",m(b,{title:o("quote"),icon:"fas fa-quote-left",onclick:r("quote")}),600),e.add("spoiler",m(b,{title:o("spoiler"),icon:"fas fa-exclamation-triangle",onclick:r("spoiler")}),500),e.add("code",m(b,{title:o("code"),icon:"fas fa-code",onclick:r("code")}),400),e.add("link",m(b,{title:o("link"),icon:"fas fa-link",onclick:r("link")}),300),e.add("image",m(b,{title:o("image"),icon:"fas fa-image",onclick:r("image")}),200),e.add("unordered_list",m(b,{title:o("unordered_list"),icon:"fas fa-list-ul",onclick:r("unordered_list")}),100),e.add("ordered_list",m(b,{title:o("ordered_list"),icon:"fas fa-list-ol",onclick:r("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(c().prototype,"keyHandlers",(function(t){t.add("bold",S("bold","b",this)),t.add("italic",S("italic","i",this))})),(0,a.override)("flarum/common/components/TextEditor","markdownToolbarItems",M),(0,a.extend)("flarum/common/components/TextEditor","toolbarItems",(function(t){t.add("markdown",m(p,{for:this.textareaId,setShortcutHandler:t=>shortcutHandler=t},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=e})(); (()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{"use strict";const e=flarum.reg.get("core","admin/app");var o=t.n(e);const r=flarum.reg.get("core","common/app");var i=t.n(r);const n=flarum.reg.get("core","common/extend"),a=flarum.reg.get("core","common/utils/BasicEditorDriver");var l=t.n(a);const c=flarum.reg.get("core","common/utils/styleSelectedText");var s=t.n(c);const d=flarum.reg.get("core","common/Component");var f=t.n(d);class u extends(f()){view(t){return m("div",{className:"MarkdownToolbar"},t.children)}}flarum.reg.add("flarum-markdown","common/components/MarkdownToolbar",u);const p=flarum.reg.get("core","common/components/Icon");var k=t.n(p);const h=flarum.reg.get("core","common/components/Tooltip");var g=t.n(h);class x extends(f()){oncreate(t){super.oncreate(t)}view(){const t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},m(k(),{name:this.attrs.icon}));return this.attrs.title?m(g(),{text:this.attrs.title},t):t}keydown(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())}}flarum.reg.add("flarum-markdown","common/components/MarkdownButton",x);const b=flarum.reg.get("core","common/utils/ItemList");var v=t.n(b);const w=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",y={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},_=(t,e)=>{s()(e.el,y[t])};function T(t,e,o){return function(r){r.key===e&&(r.metaKey&&"⌘"===w||r.ctrlKey&&"ctrl"===w)&&(r.preventDefault(),_(t,o))}}function F(t){const e="function"==typeof t?t():new(v());function o(t,e){return i().translator.trans(`flarum-markdown.lib.composer.${t}_tooltip`)+(e?` <${w}-${e}>`:"")}const r=t=>()=>_(t,this.attrs.composer.editor);return e.add("header",m(x,{title:o("header"),icon:"fas fa-heading",onclick:r("header")}),1e3),e.add("bold",m(x,{title:o("bold","b"),icon:"fas fa-bold",onclick:r("bold")}),900),e.add("italic",m(x,{title:o("italic","i"),icon:"fas fa-italic",onclick:r("italic")}),800),e.add("strikethrough",m(x,{title:o("strikethrough"),icon:"fas fa-strikethrough",onclick:r("strikethrough")}),700),e.add("quote",m(x,{title:o("quote"),icon:"fas fa-quote-left",onclick:r("quote")}),600),e.add("spoiler",m(x,{title:o("spoiler"),icon:"fas fa-exclamation-triangle",onclick:r("spoiler")}),500),e.add("code",m(x,{title:o("code"),icon:"fas fa-code",onclick:r("code")}),400),e.add("link",m(x,{title:o("link"),icon:"fas fa-link",onclick:r("link")}),300),e.add("image",m(x,{title:o("image"),icon:"fas fa-image",onclick:r("image")}),200),e.add("unordered_list",m(x,{title:o("unordered_list"),icon:"fas fa-list-ul",onclick:r("unordered_list")}),100),e.add("ordered_list",m(x,{title:o("ordered_list"),icon:"fas fa-list-ol",onclick:r("ordered_list")}),0),e}o().initializers.add("flarum-markdown",(function(t){(0,n.extend)(l().prototype,"keyHandlers",(function(t){t.add("bold",T("bold","b",this)),t.add("italic",T("italic","i",this))})),(0,n.override)("flarum/common/components/TextEditor","markdownToolbarItems",F),(0,n.extend)("flarum/common/components/TextEditor","toolbarItems",(function(t){t.add("markdown",m(u,{for:this.textareaId,setShortcutHandler:t=>shortcutHandler=t},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports={}})();
//# sourceMappingURL=admin.js.map //# sourceMappingURL=admin.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
/*! For license information please see forum.js.LICENSE.txt */ /*! For license information please see forum.js.LICENSE.txt */
(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.reg.get("core","forum/app");var r=t.n(o);const i=flarum.reg.get("core","common/app");var n=t.n(i);const a=flarum.reg.get("core","common/extend"),l=flarum.reg.get("core","common/utils/BasicEditorDriver");var c=t.n(l);const s=flarum.reg.get("core","common/utils/styleSelectedText");var d=t.n(s);const f=flarum.reg.get("core","common/Component");var u=t.n(f);class p extends(u()){view(t){return m("div",{className:"MarkdownToolbar"},t.children)}}flarum.reg.add("flarum-markdown","common/components/MarkdownToolbar",p);const k=flarum.reg.get("core","common/components/Icon");var h=t.n(k);const g=flarum.reg.get("core","common/components/Tooltip");var x=t.n(g);class b extends(u()){oncreate(t){super.oncreate(t)}view(){const t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},m(h(),{name:this.attrs.icon}));return this.attrs.title?m(x(),{text:this.attrs.title},t):t}keydown(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())}}flarum.reg.add("flarum-markdown","common/components/MarkdownButton",b);const y=flarum.reg.get("core","common/utils/ItemList");var v=t.n(y);const w=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",_={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},T=(t,e)=>{d()(e.el,_[t])};function S(t,e,o){return function(r){r.key===e&&(r.metaKey&&"⌘"===w||r.ctrlKey&&"ctrl"===w)&&(r.preventDefault(),T(t,o))}}function M(t){const e="function"==typeof t?t():new(v());function o(t,e){return n().translator.trans("flarum-markdown.lib.composer.".concat(t,"_tooltip"))+(e?" <".concat(w,"-").concat(e,">"):"")}const r=t=>()=>T(t,this.attrs.composer.editor);return e.add("header",m(b,{title:o("header"),icon:"fas fa-heading",onclick:r("header")}),1e3),e.add("bold",m(b,{title:o("bold","b"),icon:"fas fa-bold",onclick:r("bold")}),900),e.add("italic",m(b,{title:o("italic","i"),icon:"fas fa-italic",onclick:r("italic")}),800),e.add("strikethrough",m(b,{title:o("strikethrough"),icon:"fas fa-strikethrough",onclick:r("strikethrough")}),700),e.add("quote",m(b,{title:o("quote"),icon:"fas fa-quote-left",onclick:r("quote")}),600),e.add("spoiler",m(b,{title:o("spoiler"),icon:"fas fa-exclamation-triangle",onclick:r("spoiler")}),500),e.add("code",m(b,{title:o("code"),icon:"fas fa-code",onclick:r("code")}),400),e.add("link",m(b,{title:o("link"),icon:"fas fa-link",onclick:r("link")}),300),e.add("image",m(b,{title:o("image"),icon:"fas fa-image",onclick:r("image")}),200),e.add("unordered_list",m(b,{title:o("unordered_list"),icon:"fas fa-list-ul",onclick:r("unordered_list")}),100),e.add("ordered_list",m(b,{title:o("ordered_list"),icon:"fas fa-list-ol",onclick:r("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(c().prototype,"keyHandlers",(function(t){t.add("bold",S("bold","b",this)),t.add("italic",S("italic","i",this))})),(0,a.override)("flarum/common/components/TextEditor","markdownToolbarItems",M),(0,a.extend)("flarum/common/components/TextEditor","toolbarItems",(function(t){t.add("markdown",m(p,{for:this.textareaId,setShortcutHandler:t=>shortcutHandler=t},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=e})(); (()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{"use strict";const e=flarum.reg.get("core","forum/app");var o=t.n(e);const r=flarum.reg.get("core","common/app");var i=t.n(r);const n=flarum.reg.get("core","common/extend"),a=flarum.reg.get("core","common/utils/BasicEditorDriver");var l=t.n(a);const c=flarum.reg.get("core","common/utils/styleSelectedText");var s=t.n(c);const d=flarum.reg.get("core","common/Component");var f=t.n(d);class u extends(f()){view(t){return m("div",{className:"MarkdownToolbar"},t.children)}}flarum.reg.add("flarum-markdown","common/components/MarkdownToolbar",u);const p=flarum.reg.get("core","common/components/Icon");var k=t.n(p);const h=flarum.reg.get("core","common/components/Tooltip");var g=t.n(h);class x extends(f()){oncreate(t){super.oncreate(t)}view(){const t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},m(k(),{name:this.attrs.icon}));return this.attrs.title?m(g(),{text:this.attrs.title},t):t}keydown(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())}}flarum.reg.add("flarum-markdown","common/components/MarkdownButton",x);const b=flarum.reg.get("core","common/utils/ItemList");var v=t.n(b);const w=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",y={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},_=(t,e)=>{s()(e.el,y[t])};function T(t,e,o){return function(r){r.key===e&&(r.metaKey&&"⌘"===w||r.ctrlKey&&"ctrl"===w)&&(r.preventDefault(),_(t,o))}}function F(t){const e="function"==typeof t?t():new(v());function o(t,e){return i().translator.trans(`flarum-markdown.lib.composer.${t}_tooltip`)+(e?` <${w}-${e}>`:"")}const r=t=>()=>_(t,this.attrs.composer.editor);return e.add("header",m(x,{title:o("header"),icon:"fas fa-heading",onclick:r("header")}),1e3),e.add("bold",m(x,{title:o("bold","b"),icon:"fas fa-bold",onclick:r("bold")}),900),e.add("italic",m(x,{title:o("italic","i"),icon:"fas fa-italic",onclick:r("italic")}),800),e.add("strikethrough",m(x,{title:o("strikethrough"),icon:"fas fa-strikethrough",onclick:r("strikethrough")}),700),e.add("quote",m(x,{title:o("quote"),icon:"fas fa-quote-left",onclick:r("quote")}),600),e.add("spoiler",m(x,{title:o("spoiler"),icon:"fas fa-exclamation-triangle",onclick:r("spoiler")}),500),e.add("code",m(x,{title:o("code"),icon:"fas fa-code",onclick:r("code")}),400),e.add("link",m(x,{title:o("link"),icon:"fas fa-link",onclick:r("link")}),300),e.add("image",m(x,{title:o("image"),icon:"fas fa-image",onclick:r("image")}),200),e.add("unordered_list",m(x,{title:o("unordered_list"),icon:"fas fa-list-ul",onclick:r("unordered_list")}),100),e.add("ordered_list",m(x,{title:o("ordered_list"),icon:"fas fa-list-ol",onclick:r("ordered_list")}),0),e}o().initializers.add("flarum-markdown",(function(t){(0,n.extend)(l().prototype,"keyHandlers",(function(t){t.add("bold",T("bold","b",this)),t.add("italic",T("italic","i",this))})),(0,n.override)("flarum/common/components/TextEditor","markdownToolbarItems",F),(0,n.extend)("flarum/common/components/TextEditor","toolbarItems",(function(t){t.add("markdown",m(u,{for:this.textareaId,setShortcutHandler:t=>shortcutHandler=t},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports={}})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkmodule_exports=self.webpackChunkmodule_exports||[]).push([[619],{331:(t,a,s)=>{s.r(a),s.d(a,{default:()=>N});var e=s(488),i=s.n(e),o=s(950),r=s.n(o),n=s(47),l=s.n(n),u=s(684),d=s(104),c=s.n(d),g=s(906),f=s.n(g),h=s(547),p=s.n(h),v=s(336),_=s.n(v);class N extends(r()){oninit(t){super.oninit(t)}view(){const t=this.attrs.state;return m(l(),{className:"DialogDropdownList",title:i().translator.trans("flarum-messages.forum.dialog_list.title"),controls:this.controlItems(),hasItems:t.hasItems(),loading:t.isLoading(),emptyText:i().translator.trans("flarum-messages.forum.messages_page.empty_text"),loadMore:()=>t.hasNext()&&!t.isLoadingNext()&&t.loadNext(),footer:()=>m("h4",null,m(c(),{href:i().route("messages"),className:"Button Button--link",icon:"fas fa-inbox"},i().translator.trans("flarum-messages.forum.dialog_list.view_all")))},m("div",{className:"HeaderListGroup-content"},this.content()))}controlItems(){const t=new(f()),a=this.attrs.state;return i().session.user.attribute("messageCount")>0&&t.add("mark_all_as_read",m(p(),{text:i().translator.trans("flarum-messages.forum.messages_page.mark_all_as_read_tooltip")},m(_(),{className:"Button Button--link","data-container":".DialogDropdownList",icon:"fas fa-check",title:i().translator.trans("flarum-messages.forum.messages_page.mark_all_as_read_tooltip"),onclick:a.markAllAsRead.bind(a)})),70),t}content(){return m(u.A,{state:this.attrs.state,hideMore:!0,itemActions:!0})}}flarum.reg.add("flarum-messages","forum/components/DialogDropdownList",N)},684:(t,a,s)=>{s.d(a,{A:()=>I});var e=s(488),i=s.n(e),o=s(950),r=s.n(o),n=s(336),l=s.n(n),u=s(443),d=s.n(u),c=s(88),g=s.n(c),f=s(917),h=s.n(f),p=s(521),v=s.n(p),_=s(167),N=s.n(_),D=s(906),L=s.n(D);class k extends(r()){view(t){var a;const s=this.attrs.dialog,e=s.recipient(),o=s.lastMessage();return m("li",{className:d()("DialogListItem",{"DialogListItem--unread":s.unreadCount(),active:this.attrs.active})},m(g(),{href:i().route.dialog(s),className:d()("DialogListItem-button",{active:this.attrs.active})},m("div",{className:"DialogListItem-avatar"},m(h(),{user:e}),!!s.unreadCount()&&m("div",{className:"Bubble Bubble--primary"},s.unreadCount())),m("div",{className:"DialogListItem-content"},m("div",{className:"DialogListItem-title"},v()(e),N()(s.lastMessageAt()),this.attrs.actions&&m("div",{className:"DialogListItem-actions"},this.actionItems().toArray())),m("div",{className:"DialogListItem-lastMessage"},o?null==(a=o.contentPlain())?void 0:a.slice(0,80):""))))}actionItems(){const t=new(L());return t.add("markAsRead",m(l(),{className:"Notification-action Button Button--link",icon:"fas fa-check","aria-label":i().translator.trans("flarum-messages.forum.dialog_list.mark_as_read_tooltip"),onclick:t=>{var a;t.preventDefault(),t.stopPropagation(),this.attrs.dialog.save({lastReadMessageId:(null==(a=this.attrs.dialog.data.relationships)?void 0:a.lastMessage.data).id}).finally((()=>{var t;0===this.attrs.dialog.unreadCount()&&i().session.user.pushAttributes({messageCount:(null!=(t=i().session.user.attribute("messageCount"))?t:1)-1}),m.redraw()}))}}),100),t}}flarum.reg.add("flarum-messages","forum/components/DialogListItem",k);class I extends(r()){oninit(t){super.oninit(t)}oncreate(t){super.oncreate(t)}onupdate(t){super.onupdate(t)}view(){return m("div",{className:"DialogList"},m("ul",{className:"DialogList-list"},this.attrs.state.getAllItems().map((t=>{var a;return m(k,{dialog:t,active:(null==(a=this.attrs.activeDialog)?void 0:a.id())===t.id(),actions:this.attrs.itemActions})}))),this.attrs.state.hasNext()&&!this.attrs.hideMore&&m("div",{className:"DialogList-loadMore"},m(l(),{className:"Button",onclick:this.attrs.state.loadNext.bind(this.attrs.state)},i().translator.trans("flarum-messages.forum.dialog_list.load_more_button"))))}}flarum.reg.add("flarum-messages","forum/components/DialogList",I)}}]); "use strict";(self.webpackChunkmodule_exports=self.webpackChunkmodule_exports||[]).push([[619],{331:(t,s,a)=>{a.r(s),a.d(s,{default:()=>N});var e=a(488),i=a.n(e),o=a(950),r=a.n(o),n=a(47),l=a.n(n),u=a(684),d=a(104),c=a.n(d),g=a(906),f=a.n(g),h=a(547),p=a.n(h),_=a(336),v=a.n(_);class N extends(r()){oninit(t){super.oninit(t)}view(){const t=this.attrs.state;return m(l(),{className:"DialogDropdownList",title:i().translator.trans("flarum-messages.forum.dialog_list.title"),controls:this.controlItems(),hasItems:t.hasItems(),loading:t.isLoading(),emptyText:i().translator.trans("flarum-messages.forum.messages_page.empty_text"),loadMore:()=>t.hasNext()&&!t.isLoadingNext()&&t.loadNext(),footer:()=>m("h4",null,m(c(),{href:i().route("messages"),className:"Button Button--link",icon:"fas fa-inbox"},i().translator.trans("flarum-messages.forum.dialog_list.view_all")))},m("div",{className:"HeaderListGroup-content"},this.content()))}controlItems(){const t=new(f()),s=this.attrs.state;return i().session.user.attribute("messageCount")>0&&t.add("mark_all_as_read",m(p(),{text:i().translator.trans("flarum-messages.forum.messages_page.mark_all_as_read_tooltip")},m(v(),{className:"Button Button--link","data-container":".DialogDropdownList",icon:"fas fa-check",title:i().translator.trans("flarum-messages.forum.messages_page.mark_all_as_read_tooltip"),onclick:s.markAllAsRead.bind(s)})),70),t}content(){return m(u.A,{state:this.attrs.state,hideMore:!0,itemActions:!0})}}flarum.reg.add("flarum-messages","forum/components/DialogDropdownList",N)},684:(t,s,a)=>{a.d(s,{A:()=>I});var e=a(488),i=a.n(e),o=a(950),r=a.n(o),n=a(336),l=a.n(n),u=a(443),d=a.n(u),c=a(88),g=a.n(c),f=a(917),h=a.n(f),p=a(521),_=a.n(p),v=a(167),N=a.n(v),D=a(906),L=a.n(D);class k extends(r()){view(t){const s=this.attrs.dialog,a=s.recipient(),e=s.lastMessage();return m("li",{className:d()("DialogListItem",{"DialogListItem--unread":s.unreadCount(),active:this.attrs.active})},m(g(),{href:i().route.dialog(s),className:d()("DialogListItem-button",{active:this.attrs.active})},m("div",{className:"DialogListItem-avatar"},m(h(),{user:a}),!!s.unreadCount()&&m("div",{className:"Bubble Bubble--primary"},s.unreadCount())),m("div",{className:"DialogListItem-content"},m("div",{className:"DialogListItem-title"},_()(a),N()(s.lastMessageAt()),this.attrs.actions&&m("div",{className:"DialogListItem-actions"},this.actionItems().toArray())),m("div",{className:"DialogListItem-lastMessage"},e?e.contentPlain()?.slice(0,80):""))))}actionItems(){const t=new(L());return t.add("markAsRead",m(l(),{className:"Notification-action Button Button--link",icon:"fas fa-check","aria-label":i().translator.trans("flarum-messages.forum.dialog_list.mark_as_read_tooltip"),onclick:t=>{t.preventDefault(),t.stopPropagation(),this.attrs.dialog.save({lastReadMessageId:(this.attrs.dialog.data.relationships?.lastMessage.data).id}).finally((()=>{0===this.attrs.dialog.unreadCount()&&i().session.user.pushAttributes({messageCount:(i().session.user.attribute("messageCount")??1)-1}),m.redraw()}))}}),100),t}}flarum.reg.add("flarum-messages","forum/components/DialogListItem",k);class I extends(r()){oninit(t){super.oninit(t)}oncreate(t){super.oncreate(t)}onupdate(t){super.onupdate(t)}view(){return m("div",{className:"DialogList"},m("ul",{className:"DialogList-list"},this.attrs.state.getAllItems().map((t=>m(k,{dialog:t,active:this.attrs.activeDialog?.id()===t.id(),actions:this.attrs.itemActions})))),this.attrs.state.hasNext()&&!this.attrs.hideMore&&m("div",{className:"DialogList-loadMore"},m(l(),{className:"Button",onclick:this.attrs.state.loadNext.bind(this.attrs.state)},i().translator.trans("flarum-messages.forum.dialog_list.load_more_button"))))}}flarum.reg.add("flarum-messages","forum/components/DialogList",I)}}]);
//# sourceMappingURL=DialogDropdownList.js.map //# sourceMappingURL=DialogDropdownList.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkmodule_exports=self.webpackChunkmodule_exports||[]).push([[451],{761:(s,e,t)=>{t.r(e),t.d(e,{default:()=>C});var i=t(805),r=t(488),o=t.n(r),a=t(592),n=t.n(a),l=t(233),c=t.n(l),d=t(821),p=t.n(d),u=t(336),h=t.n(u),f=t(732),g=t.n(f),b=t(917),x=t.n(b),v=t(547),y=t.n(v);class C extends(n()){constructor(){super(...arguments),(0,i.A)(this,"recipients",void 0)}static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||c()(o().translator.trans("flarum-messages.forum.composer.placeholder",{},!0)),s.submitLabel=s.submitLabel||o().translator.trans("flarum-messages.forum.composer.submit_button",{},!0),s.confirmExit=s.confirmExit||c()(o().translator.trans("flarum-messages.forum.composer.discard_confirmation",{},!0)),s.className="ComposerBody--message"}oninit(s){var e;super.oninit(s);let t=(null==(e=this.attrs.replyingTo)?void 0:e.users())||this.attrs.recipients||[];t&&(t=t.filter((s=>s&&s.id()!==o().session.user.id()))),this.composer.fields.recipients=this.composer.fields.recipients||p()(t),this.recipients=this.composer.fields.recipients}headerItems(){const s=super.headerItems();return s.add("recipients",m("div",{className:"MessageComposer-recipients"},!this.attrs.replyingTo&&m(h(),{type:"button",className:"Button Button--outline Button--compact",onclick:()=>o().modal.show(g(),{title:o().translator.trans("flarum-messages.forum.recipient_selection_modal.title",{},!0),selected:this.recipients(),maxItems:1,excluded:[o().session.user.id()],onsubmit:s=>{this.recipients(s)}})},o().translator.trans("flarum-messages.forum.composer.recipients")),!!this.recipients().length&&m("div",{className:"MessageComposer-recipients-label"},o().translator.trans("flarum-messages.forum.composer.to")),m("ul",{className:"MessageComposer-recipients-list"},this.recipients().map((s=>m("li",null,m(y(),{text:s.username()},m(x(),{user:s}))))))),100),s}data(){const s={content:this.composer.fields.content()};return this.attrs.replyingTo?s.relationships={dialog:{data:{id:this.attrs.replyingTo.id(),type:"dialogs"}}}:s.users=this.recipients().map((s=>({id:s.id()}))),s}onsubmit(){this.loading=!0;const s=this.data();o().store.createRecord("dialog-messages").save(s,{params:{include:["dialog"]}}).then((s=>{var e,t;this.composer.hide(),m.route.set(o().route("dialog",{id:s.data.relationships.dialog.data.id})),null==(e=(t=this.attrs).onsubmit)||e.call(t,s)}),this.loaded.bind(this))}}(0,i.A)(C,"focusOnSelector",(()=>".TextEditor-editor")),flarum.reg.add("flarum-messages","forum/components/MessageComposer",C)}}]); "use strict";(self.webpackChunkmodule_exports=self.webpackChunkmodule_exports||[]).push([[451],{761:(s,e,t)=>{t.r(e),t.d(e,{default:()=>_});var i=t(805),r=t(488),o=t.n(r),a=t(592),n=t.n(a),l=t(233),c=t.n(l),d=t(821),p=t.n(d),u=t(336),h=t.n(u),f=t(732),g=t.n(f),b=t(917),x=t.n(b),y=t(547),C=t.n(y);class _ extends(n()){constructor(){super(...arguments),(0,i.A)(this,"recipients",void 0)}static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||c()(o().translator.trans("flarum-messages.forum.composer.placeholder",{},!0)),s.submitLabel=s.submitLabel||o().translator.trans("flarum-messages.forum.composer.submit_button",{},!0),s.confirmExit=s.confirmExit||c()(o().translator.trans("flarum-messages.forum.composer.discard_confirmation",{},!0)),s.className="ComposerBody--message"}oninit(s){super.oninit(s);let e=this.attrs.replyingTo?.users()||this.attrs.recipients||[];e&&(e=e.filter((s=>s&&s.id()!==o().session.user.id()))),this.composer.fields.recipients=this.composer.fields.recipients||p()(e),this.recipients=this.composer.fields.recipients}headerItems(){const s=super.headerItems();return s.add("recipients",m("div",{className:"MessageComposer-recipients"},!this.attrs.replyingTo&&m(h(),{type:"button",className:"Button Button--outline Button--compact",onclick:()=>o().modal.show(g(),{title:o().translator.trans("flarum-messages.forum.recipient_selection_modal.title",{},!0),selected:this.recipients(),maxItems:1,excluded:[o().session.user.id()],onsubmit:s=>{this.recipients(s)}})},o().translator.trans("flarum-messages.forum.composer.recipients")),!!this.recipients().length&&m("div",{className:"MessageComposer-recipients-label"},o().translator.trans("flarum-messages.forum.composer.to")),m("ul",{className:"MessageComposer-recipients-list"},this.recipients().map((s=>m("li",null,m(C(),{text:s.username()},m(x(),{user:s}))))))),100),s}data(){const s={content:this.composer.fields.content()};return this.attrs.replyingTo?s.relationships={dialog:{data:{id:this.attrs.replyingTo.id(),type:"dialogs"}}}:s.users=this.recipients().map((s=>({id:s.id()}))),s}onsubmit(){this.loading=!0;const s=this.data();o().store.createRecord("dialog-messages").save(s,{params:{include:["dialog"]}}).then((s=>{this.composer.hide(),m.route.set(o().route("dialog",{id:s.data.relationships.dialog.data.id})),this.attrs.onsubmit?.(s)}),this.loaded.bind(this))}}(0,i.A)(_,"focusOnSelector",(()=>".TextEditor-editor")),flarum.reg.add("flarum-messages","forum/components/MessageComposer",_)}}]);
//# sourceMappingURL=MessageComposer.js.map //# sourceMappingURL=MessageComposer.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/pusher/js/dist/forum.js generated vendored
View File

@ -1,2 +1,2 @@
(()=>{var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const s=flarum.reg.get("core","forum/app");var n=e.n(s);const o=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/components/DiscussionList");var i=e.n(r);const u=flarum.reg.get("core","forum/components/DiscussionPage");var a=e.n(u);const d=flarum.reg.get("core","forum/components/IndexPage");var c=e.n(d);const p=flarum.reg.get("core","common/components/Button");var l=e.n(p);n().initializers.add("flarum-pusher",(()=>{n().pusher=(async()=>{await import("//cdn.jsdelivr.net/npm/pusher-js@7.0.3/dist/web/pusher.min.js");const e=new Pusher(n().forum.attribute("pusherKey"),{authEndpoint:"".concat(n().forum.attribute("apiUrl"),"/pusher/auth"),cluster:n().forum.attribute("pusherCluster"),auth:{headers:{"X-CSRF-Token":n().session.csrfToken}}});return{channels:{main:e.subscribe("public"),user:n().session.user?e.subscribe("private-user".concat(n().session.user.id())):null},pusher:e}})(),n().pushedUpdates=[],(0,o.extend)(i().prototype,"oncreate",(function(){n().pusher.then((e=>{e.pusher.bind("newPost",(e=>{const t=n().discussions.getParams();if(!t.q&&!t.sort&&!t.filter){if(t.tags){const s=n().store.getBy("tags","slug",t.tags),o=null==s?void 0:s.id();if(!o||!e.tagIds.includes(o))return}const s=String(e.discussionId);n().current.get("discussion")&&s===n().current.get("discussion").id()||-1!==n().pushedUpdates.indexOf(s)||(n().pushedUpdates.push(s),n().current.matches(c())&&n().setTitleCount(n().pushedUpdates.length),m.redraw())}}))}))})),(0,o.extend)(i().prototype,"onremove",(function(){n().pusher.then((e=>{e.pusher.unbind("newPost")}))})),(0,o.extend)(i().prototype,"view",(function(e){if(n().pushedUpdates){const t=n().pushedUpdates.length;t&&"object"==typeof e&&e&&"children"in e&&e.children instanceof Array&&e.children.unshift(m(l(),{className:"Button Button--block DiscussionList-update",onclick:()=>{this.attrs.state.refresh().then((()=>{this.loadingUpdated=!1,n().pushedUpdates=[],n().setTitleCount(0),m.redraw()})),this.loadingUpdated=!0},loading:this.loadingUpdated},n().translator.trans("flarum-pusher.forum.discussion_list.show_updates_text",{count:t})))}})),(0,o.extend)(a().prototype,"oncreate",(function(){n().pusher.then((e=>{e.pusher.bind("newPost",(e=>{var t;const s=String(e.discussionId),o=null==(t=this.discussion)?void 0:t.id();if(this.discussion&&o===s&&this.stream){var r;const e=null!=(r=this.discussion.commentCount())?r:0;n().store.find("discussions",o).then((()=>{var t,s,o;null==(t=this.stream)||t.update().then(m.redraw),document.hasFocus()||(n().setTitleCount(Math.max(0,(null!=(s=null==(o=this.discussion)?void 0:o.commentCount())?s:0)-e)),window.addEventListener("focus",(()=>n().setTitleCount(0)),{once:!0}))}))}}))}))})),(0,o.extend)(a().prototype,"onremove",(function(){n().pusher.then((e=>{e.pusher.unbind("newPost")}))})),(0,o.extend)(c().prototype,"actionItems",(e=>{e.remove("refresh")})),n().pusher.then((e=>{const t=e.channels;t.user&&t.user.bind("notification",(()=>{var e,t;n().session.user&&n().session.user.pushAttributes({unreadNotificationCount:null!=(e=n().session.user.unreadNotificationCount())?e:1,newNotificationCount:null!=(t=n().session.user.newNotificationCount())?t:1}),n().notifications.clear(),m.redraw()}))}))}))})(),module.exports=t})(); (()=>{var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{"use strict";const t=flarum.reg.get("core","forum/app");var s=e.n(t);const n=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","forum/components/DiscussionList");var r=e.n(o);const i=flarum.reg.get("core","forum/components/DiscussionPage");var u=e.n(i);const a=flarum.reg.get("core","forum/components/IndexPage");var c=e.n(a);const d=flarum.reg.get("core","common/components/Button");var p=e.n(d);s().initializers.add("flarum-pusher",(()=>{s().pusher=(async()=>{await import("//cdn.jsdelivr.net/npm/pusher-js@7.0.3/dist/web/pusher.min.js");const e=new Pusher(s().forum.attribute("pusherKey"),{authEndpoint:`${s().forum.attribute("apiUrl")}/pusher/auth`,cluster:s().forum.attribute("pusherCluster"),auth:{headers:{"X-CSRF-Token":s().session.csrfToken}}});return{channels:{main:e.subscribe("public"),user:s().session.user?e.subscribe(`private-user${s().session.user.id()}`):null},pusher:e}})(),s().pushedUpdates=[],(0,n.extend)(r().prototype,"oncreate",(function(){s().pusher.then((e=>{e.pusher.bind("newPost",(e=>{const t=s().discussions.getParams();if(!t.q&&!t.sort&&!t.filter){if(t.tags){const n=s().store.getBy("tags","slug",t.tags),o=n?.id();if(!o||!e.tagIds.includes(o))return}const n=String(e.discussionId);s().current.get("discussion")&&n===s().current.get("discussion").id()||-1!==s().pushedUpdates.indexOf(n)||(s().pushedUpdates.push(n),s().current.matches(c())&&s().setTitleCount(s().pushedUpdates.length),m.redraw())}}))}))})),(0,n.extend)(r().prototype,"onremove",(function(){s().pusher.then((e=>{e.pusher.unbind("newPost")}))})),(0,n.extend)(r().prototype,"view",(function(e){if(s().pushedUpdates){const t=s().pushedUpdates.length;t&&"object"==typeof e&&e&&"children"in e&&e.children instanceof Array&&e.children.unshift(m(p(),{className:"Button Button--block DiscussionList-update",onclick:()=>{this.attrs.state.refresh().then((()=>{this.loadingUpdated=!1,s().pushedUpdates=[],s().setTitleCount(0),m.redraw()})),this.loadingUpdated=!0},loading:this.loadingUpdated},s().translator.trans("flarum-pusher.forum.discussion_list.show_updates_text",{count:t})))}})),(0,n.extend)(u().prototype,"oncreate",(function(){s().pusher.then((e=>{e.pusher.bind("newPost",(e=>{const t=String(e.discussionId),n=this.discussion?.id();if(this.discussion&&n===t&&this.stream){const e=this.discussion.commentCount()??0;s().store.find("discussions",n).then((()=>{this.stream?.update().then(m.redraw),document.hasFocus()||(s().setTitleCount(Math.max(0,(this.discussion?.commentCount()??0)-e)),window.addEventListener("focus",(()=>s().setTitleCount(0)),{once:!0}))}))}}))}))})),(0,n.extend)(u().prototype,"onremove",(function(){s().pusher.then((e=>{e.pusher.unbind("newPost")}))})),(0,n.extend)(c().prototype,"actionItems",(e=>{e.remove("refresh")})),s().pusher.then((e=>{const t=e.channels;t.user&&t.user.bind("notification",(()=>{s().session.user&&s().session.user.pushAttributes({unreadNotificationCount:s().session.user.unreadNotificationCount()??1,newNotificationCount:s().session.user.newNotificationCount()??1}),s().notifications.clear(),m.redraw()}))}))}))})(),module.exports={}})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/sticky/js/dist/forum.js generated vendored
View File

@ -1,2 +1,2 @@
(()=>{var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{extend:()=>B});const s=flarum.reg.get("core","forum/app");var o=t.n(s);const r=flarum.reg.get("core","common/extend"),n=flarum.reg.get("core","common/models/Discussion");var c=t.n(n);const i=flarum.reg.get("core","common/components/Badge");var a=t.n(i);const u=flarum.reg.get("core","forum/utils/DiscussionControls");var l=t.n(u);const d=flarum.reg.get("core","forum/components/DiscussionPage");var f=t.n(d);const y=flarum.reg.get("core","common/components/Button");var g=t.n(y);const k=flarum.reg.get("core","forum/states/DiscussionListState");var p=t.n(k);const b=flarum.reg.get("core","forum/components/DiscussionListItem");var v=t.n(b);const S=flarum.reg.get("core","forum/components/IndexPage");var h=t.n(S);const x=flarum.reg.get("core","common/utils/string"),P=flarum.reg.get("core","common/utils/classList");var _=t.n(P);const D=flarum.reg.get("core","common/extenders");var w=t.n(D);const I=flarum.reg.get("core","forum/components/EventPost");var O=t.n(I);class j extends(O()){icon(){return"fas fa-thumbtack"}descriptionKey(){return this.attrs.post.content().sticky?"flarum-sticky.forum.post_stream.discussion_stickied_text":"flarum-sticky.forum.post_stream.discussion_unstickied_text"}}flarum.reg.add("flarum-sticky","forum/components/DiscussionStickiedPost",j);const q=flarum.reg.get("core","common/query/IGambit"),L=flarum.reg.get("core","common/app");var M=t.n(L);class A extends q.BooleanGambit{key(){return M().translator.trans("flarum-sticky.lib.gambits.discussions.sticky.key",{},!0)}filterKey(){return"sticky"}}flarum.reg.add("flarum-sticky","common/query/discussions/StickyGambit",A);const B=[(new(w().Search)).gambit("discussions",A),(new(w().PostTypes)).add("discussionStickied",j),new(w().Model)(c()).attribute("isSticky").attribute("canSticky")];o().initializers.add("flarum-sticky",(()=>{(0,r.extend)(c().prototype,"badges",(function(t){this.isSticky()&&t.add("sticky",m(a(),{type:"sticky",label:o().translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)})),(0,r.extend)(l(),"moderationControls",(function(t,e){e.canSticky()&&t.add("sticky",m(g(),{icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(e)},o().translator.trans("flarum-sticky.forum.discussion_controls.".concat(e.isSticky()?"unsticky":"sticky","_button"))))})),l().stickyAction=function(){this.save({isSticky:!this.isSticky()}).then((()=>{o().current.matches(f())&&o().current.get("stream").update(),m.redraw()}))},(0,r.extend)(p().prototype,"requestParams",(function(t){(o().current.matches(h())||o().current.matches(f()))&&t.include.push("firstPost")})),(0,r.extend)(v().prototype,"infoItems",(function(t){const e=this.attrs.discussion;if(e.isSticky()&&!this.attrs.params.q&&!e.lastReadPostNumber()){const s=e.firstPost();if(s){const e=(0,x.truncate)(s.contentPlain(),175);t.add("excerpt",m("div",null,e),-100)}}})),(0,r.extend)(v().prototype,"elementAttrs",(function(t){this.attrs.discussion.isSticky()&&(t.className=_()(t.className,"DiscussionListItem--sticky"))}))}))})(),module.exports=e})(); (()=>{var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{extend:()=>B});const s=flarum.reg.get("core","forum/app");var o=t.n(s);const r=flarum.reg.get("core","common/extend"),n=flarum.reg.get("core","common/models/Discussion");var c=t.n(n);const i=flarum.reg.get("core","common/components/Badge");var a=t.n(i);const u=flarum.reg.get("core","forum/utils/DiscussionControls");var l=t.n(u);const d=flarum.reg.get("core","forum/components/DiscussionPage");var f=t.n(d);const y=flarum.reg.get("core","common/components/Button");var g=t.n(y);const k=flarum.reg.get("core","forum/states/DiscussionListState");var p=t.n(k);const b=flarum.reg.get("core","forum/components/DiscussionListItem");var v=t.n(b);const S=flarum.reg.get("core","forum/components/IndexPage");var h=t.n(S);const x=flarum.reg.get("core","common/utils/string"),P=flarum.reg.get("core","common/utils/classList");var _=t.n(P);const D=flarum.reg.get("core","common/extenders");var w=t.n(D);const I=flarum.reg.get("core","forum/components/EventPost");var O=t.n(I);class j extends(O()){icon(){return"fas fa-thumbtack"}descriptionKey(){return this.attrs.post.content().sticky?"flarum-sticky.forum.post_stream.discussion_stickied_text":"flarum-sticky.forum.post_stream.discussion_unstickied_text"}}flarum.reg.add("flarum-sticky","forum/components/DiscussionStickiedPost",j);const q=flarum.reg.get("core","common/query/IGambit"),L=flarum.reg.get("core","common/app");var M=t.n(L);class A extends q.BooleanGambit{key(){return M().translator.trans("flarum-sticky.lib.gambits.discussions.sticky.key",{},!0)}filterKey(){return"sticky"}}flarum.reg.add("flarum-sticky","common/query/discussions/StickyGambit",A);const B=[(new(w().Search)).gambit("discussions",A),(new(w().PostTypes)).add("discussionStickied",j),new(w().Model)(c()).attribute("isSticky").attribute("canSticky")];o().initializers.add("flarum-sticky",(()=>{(0,r.extend)(c().prototype,"badges",(function(t){this.isSticky()&&t.add("sticky",m(a(),{type:"sticky",label:o().translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)})),(0,r.extend)(l(),"moderationControls",(function(t,e){e.canSticky()&&t.add("sticky",m(g(),{icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(e)},o().translator.trans(`flarum-sticky.forum.discussion_controls.${e.isSticky()?"unsticky":"sticky"}_button`)))})),l().stickyAction=function(){this.save({isSticky:!this.isSticky()}).then((()=>{o().current.matches(f())&&o().current.get("stream").update(),m.redraw()}))},(0,r.extend)(p().prototype,"requestParams",(function(t){(o().current.matches(h())||o().current.matches(f()))&&t.include.push("firstPost")})),(0,r.extend)(v().prototype,"infoItems",(function(t){const e=this.attrs.discussion;if(e.isSticky()&&!this.attrs.params.q&&!e.lastReadPostNumber()){const s=e.firstPost();if(s){const e=(0,x.truncate)(s.contentPlain(),175);t.add("excerpt",m("div",null,e),-100)}}})),(0,r.extend)(v().prototype,"elementAttrs",(function(t){this.attrs.discussion.isSticky()&&(t.className=_()(t.className,"DiscussionListItem--sticky"))}))}))})(),module.exports=e})();
//# sourceMappingURL=forum.js.map //# sourceMappingURL=forum.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
(()=>{var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};(()=>{"use strict";e.r(r),e.d(r,{extend:()=>u});const t=flarum.reg.get("core","common/extenders");var o=e.n(t);const s=flarum.reg.get("core","common/app");var n=e.n(s);const i=flarum.reg.get("core","common/query/IGambit");class a extends i.BooleanGambit{key(){return[n().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.following_key",{},!0),n().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key",{},!0)]}toFilter(e,r){const t=(r?"-":"")+this.filterKey();return{[t]:e[1]}}filterKey(){return"subscription"}fromFilter(e,r){return"".concat(r?"-":"","is:").concat(e)}enabled(){return!!n().session.user}}flarum.reg.add("flarum-subscriptions","common/query/discussions/SubscriptionGambit",a);const u=[(new(o().Search)).gambit("discussions",a)]})(),module.exports=r})(); (()=>{var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var s in t)e.o(t,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:t[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};(()=>{"use strict";e.r(r),e.d(r,{extend:()=>u});const t=flarum.reg.get("core","common/extenders");var s=e.n(t);const o=flarum.reg.get("core","common/app");var n=e.n(o);const i=flarum.reg.get("core","common/query/IGambit");class a extends i.BooleanGambit{key(){return[n().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.following_key",{},!0),n().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key",{},!0)]}toFilter(e,r){const t=(r?"-":"")+this.filterKey();return{[t]:e[1]}}filterKey(){return"subscription"}fromFilter(e,r){return`${r?"-":""}is:${e}`}enabled(){return!!n().session.user}}flarum.reg.add("flarum-subscriptions","common/query/discussions/SubscriptionGambit",a);const u=[(new(s().Search)).gambit("discussions",a)]})(),module.exports=r})();
//# sourceMappingURL=admin.js.map //# sourceMappingURL=admin.js.map

View File

@ -1 +1 @@
{"version":3,"file":"admin.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,oB,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,c,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,wBCE7C,MAAMW,UAA2B,EAAAC,cAC9C,GAAAjB,GACE,MAAO,CAAC,eAAekB,MAAM,0EAA2E,CAAC,GAAG,GAAO,eAAeA,MAAM,yEAA0E,CAAC,GAAG,GACxN,CACA,QAAAC,CAASC,EAASC,GAChB,MAAMrB,GAAOqB,EAAS,IAAM,IAAMC,KAAKC,YACvC,MAAO,CACL,CAACvB,GAAMoB,EAAQ,GAEnB,CACA,SAAAG,GACE,MAAO,cACT,CACA,UAAAC,CAAWX,EAAOQ,GAChB,MAAO,GAAGI,OAAOJ,EAAS,IAAM,GAAI,OAAOI,OAAOZ,EACpD,CACA,OAAAa,GACE,QAAS,YAAYC,IACvB,EAEFb,OAAOC,IAAIa,IAAI,uBAAwB,8CAA+CZ,GCpBtF,UAAgB,IAAI,aACnBa,OAAO,cAAeb,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/extenders')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/subscriptions/./src/common/query/discussions/SubscriptionGambit.ts","webpack://@flarum/subscriptions/./src/common/extend.ts"],"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/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SubscriptionGambit extends BooleanGambit {\n key() {\n return [app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.following_key', {}, true), app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key', {}, true)];\n }\n toFilter(matches, negate) {\n const key = (negate ? '-' : '') + this.filterKey();\n return {\n [key]: matches[1]\n };\n }\n filterKey() {\n return 'subscription';\n }\n fromFilter(value, negate) {\n return \"\".concat(negate ? '-' : '', \"is:\").concat(value);\n }\n enabled() {\n return !!app.session.user;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'common/query/discussions/SubscriptionGambit', SubscriptionGambit);","import Extend from 'flarum/common/extenders';\nimport SubscriptionGambit from './query/discussions/SubscriptionGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', SubscriptionGambit)];"],"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","SubscriptionGambit","BooleanGambit","trans","toFilter","matches","negate","this","filterKey","fromFilter","concat","enabled","user","add","gambit"],"sourceRoot":""} {"version":3,"file":"admin.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,oB,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,c,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,wBCE7C,MAAMW,UAA2B,EAAAC,cAC9C,GAAAjB,GACE,MAAO,CAAC,eAAekB,MAAM,0EAA2E,CAAC,GAAG,GAAO,eAAeA,MAAM,yEAA0E,CAAC,GAAG,GACxN,CACA,QAAAC,CAASC,EAASC,GAChB,MAAMrB,GAAOqB,EAAS,IAAM,IAAMC,KAAKC,YACvC,MAAO,CACL,CAACvB,GAAMoB,EAAQ,GAEnB,CACA,SAAAG,GACE,MAAO,cACT,CACA,UAAAC,CAAWX,EAAOQ,GAChB,MAAO,GAAGA,EAAS,IAAM,QAAQR,GACnC,CACA,OAAAY,GACE,QAAS,YAAYC,IACvB,EAEFZ,OAAOC,IAAIY,IAAI,uBAAwB,8CAA+CX,GCpBtF,UAAgB,IAAI,aACnBY,OAAO,cAAeZ,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/extenders')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/subscriptions/./src/common/query/discussions/SubscriptionGambit.ts","webpack://@flarum/subscriptions/./src/common/extend.ts"],"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/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SubscriptionGambit extends BooleanGambit {\n key() {\n return [app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.following_key', {}, true), app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key', {}, true)];\n }\n toFilter(matches, negate) {\n const key = (negate ? '-' : '') + this.filterKey();\n return {\n [key]: matches[1]\n };\n }\n filterKey() {\n return 'subscription';\n }\n fromFilter(value, negate) {\n return `${negate ? '-' : ''}is:${value}`;\n }\n enabled() {\n return !!app.session.user;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'common/query/discussions/SubscriptionGambit', SubscriptionGambit);","import Extend from 'flarum/common/extenders';\nimport SubscriptionGambit from './query/discussions/SubscriptionGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', SubscriptionGambit)];"],"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","SubscriptionGambit","BooleanGambit","trans","toFilter","matches","negate","this","filterKey","fromFilter","enabled","user","add","gambit"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/tags/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**! /**!
* Sortable 1.15.2 * Sortable 1.15.3
* @author RubaXa <trash@rubaxa.org> * @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com> * @author owenm <owen23355@gmail.com>
* @license MIT * @license MIT

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/tags/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
import type { IPageAttrs } from '../../common/components/Page'; import type { IPageAttrs } from '../../common/components/Page';
import type Mithril from 'mithril'; import type Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril'; import type Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
import type { IPageAttrs } from '../../common/components/Page'; import type { IPageAttrs } from '../../common/components/Page';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
import type { Children } from 'mithril'; import type { Children } from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
/// <reference types="mithril" /> /// <reference types="mithril" />
import SettingsModal from './SettingsModal'; import SettingsModal from './SettingsModal';
export default class EditCustomCssModal extends SettingsModal { export default class EditCustomCssModal extends SettingsModal {

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
/// <reference types="mithril" /> /// <reference types="mithril" />
import SettingsModal from './SettingsModal'; import SettingsModal from './SettingsModal';
export default class EditCustomFooterModal extends SettingsModal { export default class EditCustomFooterModal extends SettingsModal {

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
/// <reference types="mithril" /> /// <reference types="mithril" />
import SettingsModal from './SettingsModal'; import SettingsModal from './SettingsModal';
export default class EditCustomHeaderModal extends SettingsModal { export default class EditCustomHeaderModal extends SettingsModal {

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import Modal, { IInternalModalAttrs } from '../../common/components/Modal'; import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
export interface ILoadingModalAttrs extends IInternalModalAttrs { export interface ILoadingModalAttrs extends IInternalModalAttrs {
} }

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
import type { IPageAttrs } from '../../common/components/Page'; import type { IPageAttrs } from '../../common/components/Page';
import type { AlertIdentifier } from '../../common/states/AlertManagerState'; import type { AlertIdentifier } from '../../common/states/AlertManagerState';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
/// <reference types="mithril" /> /// <reference types="mithril" />
import AdminPage from './AdminPage'; import AdminPage from './AdminPage';
export default class PermissionsPage extends AdminPage { export default class PermissionsPage extends AdminPage {

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import Modal, { IInternalModalAttrs } from '../../common/components/Modal'; import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
import ExtensionReadme from '../models/ExtensionReadme'; import ExtensionReadme from '../models/ExtensionReadme';
import type Mithril from 'mithril'; import type Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import Mithril from 'mithril'; import Mithril from 'mithril';
import type User from '../../common/models/User'; import type User from '../../common/models/User';
import type { IPageAttrs } from '../../common/components/Page'; import type { IPageAttrs } from '../../common/components/Page';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import ItemList from '../utils/ItemList'; import ItemList from '../utils/ItemList';
import Stream from '../utils/Stream'; import Stream from '../utils/Stream';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';
import type Mithril from 'mithril'; import type Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import Mithril from 'mithril'; import Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import Notification from './Notification'; import Notification from './Notification';
/** /**
* The `DiscussionRenamedNotification` component displays a notification which * The `DiscussionRenamedNotification` component displays a notification which

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';
import Mithril from 'mithril'; import Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';
import Mithril from 'mithril'; import Mithril from 'mithril';

View File

@ -1,4 +1,4 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" /> /// <reference path="../../../src/@types/translator-icu-rich.d.ts" />
import FormModal, { IFormModalAttrs } from '../../common/components/FormModal'; import FormModal, { IFormModalAttrs } from '../../common/components/FormModal';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import Stream from '../../common/utils/Stream'; import Stream from '../../common/utils/Stream';

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[234],{422:(s,t,i)=>{i.r(t),i.d(t,{default:()=>A});var e=i(8805),r=i(5114),a=i(2855),n=i(7880),o=i(3550),d=i(4583),l=i(117),u=i(6064),h=i(4311),c=i(374);class A extends a.A{constructor(){super(...arguments),(0,e.A)(this,"username",void 0),(0,e.A)(this,"email",void 0),(0,e.A)(this,"isEmailConfirmed",void 0),(0,e.A)(this,"setPassword",void 0),(0,e.A)(this,"password",void 0),(0,e.A)(this,"groups",{})}oninit(s){super.oninit(s);const t=this.attrs.user;this.username=(0,h.A)(t.username()||""),this.email=(0,h.A)(t.email()||""),this.isEmailConfirmed=(0,h.A)(t.isEmailConfirmed()||!1),this.setPassword=(0,h.A)(!1),this.password=(0,h.A)(t.password()||"");const i=t.groups()||[];r.A.store.all("groups").filter((s=>![d.A.GUEST_ID,d.A.MEMBER_ID].includes(s.id()))).forEach((s=>this.groups[s.id()]=(0,h.A)(i.includes(s))))}className(){return"EditUserModal Modal--small"}title(){return r.A.translator.trans("core.lib.edit_user.title")}content(){const s=this.fields().toArray();return m("div",{className:"Modal-body"},s.length>1?m(c.A,null,this.fields().toArray()):r.A.translator.trans("core.lib.edit_user.nothing_available"))}fields(){const s=new u.A;return this.attrs.user.canEditCredentials()&&(s.add("username",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.A.session.user!==this.attrs.user&&(s.add("email",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.email_heading")),m("input",{className:"FormControl",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()}),!this.isEmailConfirmed()&&this.userIsAdmin(r.A.session.user)&&m(n.A,{className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.A.translator.trans("core.lib.edit_user.activate_button"))),30),s.add("password",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:s=>{const t=s.target;this.setPassword(t.checked),m.redraw.sync(),t.checked&&this.$("[name=password]").select(),s.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.A.translator.trans("core.lib.edit_user.set_password_label"))),this.setPassword()&&m("input",{className:"FormControl",type:"password",name:"password",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()})),20))),this.attrs.user.canEditGroups()&&s.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.A.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((s=>r.A.store.getById("groups",s))).filter(Boolean).map((s=>s&&m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.groups[s.id()],disabled:s.id()===d.A.ADMINISTRATOR_ID&&(this.attrs.user===r.A.session.user||!this.userIsAdmin(r.A.session.user))}),m(o.A,{group:s,label:null})," ",s.nameSingular()))))),10),s.add("submit",m("div",{className:"Form-group Form-controls"},m(n.A,{className:"Button Button--primary",type:"submit",loading:this.loading},r.A.translator.trans("core.lib.edit_user.submit_button"))),-10),s}activate(){this.loading=!0;const s={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(s,{errorHandler:this.onerror.bind(this)}).then((()=>{this.isEmailConfirmed(!0),this.loading=!1,m.redraw()})).catch((()=>{this.loading=!1,m.redraw()}))}data(){const s={},t={};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(s.username=this.username(),r.A.session.user!==this.attrs.user&&(s.email=this.email()),this.setPassword()&&(s.password=this.password())),this.attrs.user.canEditGroups()&&(t.groups=Object.keys(this.groups).filter((s=>this.groups[s]())).map((s=>r.A.store.getById("groups",s))).filter((s=>s instanceof d.A))),s.relationships=t,s}onsubmit(s){s.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))}nonAdminEditingAdmin(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.A.session.user)}userIsAdmin(s){return!!((null==s?void 0:s.groups())||[]).some((s=>(null==s?void 0:s.id())===d.A.ADMINISTRATOR_ID))}}flarum.reg.add("core","common/components/EditUserModal",A)}}]); "use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[234],{422:(s,t,i)=>{i.r(t),i.d(t,{default:()=>A});var e=i(8805),r=i(5114),a=i(2855),n=i(7880),o=i(3550),d=i(4583),l=i(117),u=i(6064),h=i(4311),c=i(374);class A extends a.A{constructor(){super(...arguments),(0,e.A)(this,"username",void 0),(0,e.A)(this,"email",void 0),(0,e.A)(this,"isEmailConfirmed",void 0),(0,e.A)(this,"setPassword",void 0),(0,e.A)(this,"password",void 0),(0,e.A)(this,"groups",{})}oninit(s){super.oninit(s);const t=this.attrs.user;this.username=(0,h.A)(t.username()||""),this.email=(0,h.A)(t.email()||""),this.isEmailConfirmed=(0,h.A)(t.isEmailConfirmed()||!1),this.setPassword=(0,h.A)(!1),this.password=(0,h.A)(t.password()||"");const i=t.groups()||[];r.A.store.all("groups").filter((s=>![d.A.GUEST_ID,d.A.MEMBER_ID].includes(s.id()))).forEach((s=>this.groups[s.id()]=(0,h.A)(i.includes(s))))}className(){return"EditUserModal Modal--small"}title(){return r.A.translator.trans("core.lib.edit_user.title")}content(){const s=this.fields().toArray();return m("div",{className:"Modal-body"},s.length>1?m(c.A,null,this.fields().toArray()):r.A.translator.trans("core.lib.edit_user.nothing_available"))}fields(){const s=new u.A;return this.attrs.user.canEditCredentials()&&(s.add("username",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.A.session.user!==this.attrs.user&&(s.add("email",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.email_heading")),m("input",{className:"FormControl",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()}),!this.isEmailConfirmed()&&this.userIsAdmin(r.A.session.user)&&m(n.A,{className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.A.translator.trans("core.lib.edit_user.activate_button"))),30),s.add("password",m("div",{className:"Form-group"},m("label",null,r.A.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:s=>{const t=s.target;this.setPassword(t.checked),m.redraw.sync(),t.checked&&this.$("[name=password]").select(),s.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.A.translator.trans("core.lib.edit_user.set_password_label"))),this.setPassword()&&m("input",{className:"FormControl",type:"password",name:"password",placeholder:(0,l.A)(r.A.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()})),20))),this.attrs.user.canEditGroups()&&s.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.A.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((s=>r.A.store.getById("groups",s))).filter(Boolean).map((s=>s&&m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.groups[s.id()],disabled:s.id()===d.A.ADMINISTRATOR_ID&&(this.attrs.user===r.A.session.user||!this.userIsAdmin(r.A.session.user))}),m(o.A,{group:s,label:null})," ",s.nameSingular()))))),10),s.add("submit",m("div",{className:"Form-group Form-controls"},m(n.A,{className:"Button Button--primary",type:"submit",loading:this.loading},r.A.translator.trans("core.lib.edit_user.submit_button"))),-10),s}activate(){this.loading=!0;const s={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(s,{errorHandler:this.onerror.bind(this)}).then((()=>{this.isEmailConfirmed(!0),this.loading=!1,m.redraw()})).catch((()=>{this.loading=!1,m.redraw()}))}data(){const s={},t={};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(s.username=this.username(),r.A.session.user!==this.attrs.user&&(s.email=this.email()),this.setPassword()&&(s.password=this.password())),this.attrs.user.canEditGroups()&&(t.groups=Object.keys(this.groups).filter((s=>this.groups[s]())).map((s=>r.A.store.getById("groups",s))).filter((s=>s instanceof d.A))),s.relationships=t,s}onsubmit(s){s.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))}nonAdminEditingAdmin(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.A.session.user)}userIsAdmin(s){return!!(s?.groups()||[]).some((s=>s?.id()===d.A.ADMINISTRATOR_ID))}}flarum.reg.add("core","common/components/EditUserModal",A)}}]);
//# sourceMappingURL=EditUserModal.js.map //# sourceMappingURL=EditUserModal.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[814],{6296:(s,e,t)=>{t.d(e,{A:()=>u});var o=t(8805),i=t(5710),r=t(43);class n extends i.A{handler(){return this.attrs.when()||void 0}oncreate(s){super.oncreate(s),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(s){super.onremove(s),$(window).off("beforeunload",this.boundHandler)}view(s){return m("[",null,s.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=t(1611),d=t(5673),l=t(6064),c=t(4268),h=t(7891);class u extends i.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(s){super.oninit(s),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){var s;return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,c.A)("ComposerBody",this.attrs.className)},m(h.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,d.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:null==(s=this.jumpToPreview)?void 0:s.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(r.A,{display:"unset",containerClassName:(0,c.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const s=this.composer.fields.content();return Boolean(s)&&s!==this.attrs.originalContent}headerItems(){return new l.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(u,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",u)},1201:(s,e,t)=>{t.r(e),t.d(e,{default:()=>a});var o=t(3554),i=t(6296),r=t(117),n=t(4311);class a extends i.A{static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.body_placeholder")),s.submitLabel=s.submitLabel||o.A.translator.trans("core.forum.composer_discussion.submit_button"),s.confirmExit=s.confirmExit||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.discard_confirmation")),s.titlePlaceholder=s.titlePlaceholder||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.title_placeholder")),s.className="ComposerBody--discussion"}oninit(s){super.oninit(s),this.composer.fields.title=this.composer.fields.title||(0,n.A)(""),this.title=this.composer.fields.title}headerItems(){const s=super.headerItems();return s.add("title",m("h3",null,o.A.translator.trans("core.forum.composer_discussion.title")),100),s.add("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))),s}onkeydown(s){13===s.which&&(s.preventDefault(),this.composer.editor.moveCursorTo(0)),s.redraw=!1}hasChanges(){return this.title()||this.composer.fields.content()}data(){return{title:this.title(),content:this.composer.fields.content()}}onsubmit(){this.loading=!0;const s=this.data();o.A.store.createRecord("discussions").save(s).then((s=>{this.composer.hide(),o.A.discussions.refresh(),m.route.set(o.A.route.discussion(s))}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/DiscussionComposer",a)}}]); "use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[814],{6296:(s,e,t)=>{t.d(e,{A:()=>u});var o=t(8805),i=t(5710),r=t(43);class n extends i.A{handler(){return this.attrs.when()||void 0}oncreate(s){super.oncreate(s),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(s){super.onremove(s),$(window).off("beforeunload",this.boundHandler)}view(s){return m("[",null,s.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=t(1611),d=t(5673),l=t(6064),c=t(4268),h=t(7891);class u extends i.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(s){super.oninit(s),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,c.A)("ComposerBody",this.attrs.className)},m(h.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,d.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview?.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(r.A,{display:"unset",containerClassName:(0,c.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const s=this.composer.fields.content();return Boolean(s)&&s!==this.attrs.originalContent}headerItems(){return new l.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(u,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",u)},1201:(s,e,t)=>{t.r(e),t.d(e,{default:()=>a});var o=t(3554),i=t(6296),r=t(117),n=t(4311);class a extends i.A{static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.body_placeholder")),s.submitLabel=s.submitLabel||o.A.translator.trans("core.forum.composer_discussion.submit_button"),s.confirmExit=s.confirmExit||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.discard_confirmation")),s.titlePlaceholder=s.titlePlaceholder||(0,r.A)(o.A.translator.trans("core.forum.composer_discussion.title_placeholder")),s.className="ComposerBody--discussion"}oninit(s){super.oninit(s),this.composer.fields.title=this.composer.fields.title||(0,n.A)(""),this.title=this.composer.fields.title}headerItems(){const s=super.headerItems();return s.add("title",m("h3",null,o.A.translator.trans("core.forum.composer_discussion.title")),100),s.add("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))),s}onkeydown(s){13===s.which&&(s.preventDefault(),this.composer.editor.moveCursorTo(0)),s.redraw=!1}hasChanges(){return this.title()||this.composer.fields.content()}data(){return{title:this.title(),content:this.composer.fields.content()}}onsubmit(){this.loading=!0;const s=this.data();o.A.store.createRecord("discussions").save(s).then((s=>{this.composer.hide(),o.A.discussions.refresh(),m.route.set(o.A.route.discussion(s))}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/DiscussionComposer",a)}}]);
//# sourceMappingURL=DiscussionComposer.js.map //# sourceMappingURL=DiscussionComposer.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[948],{6296:(t,s,e)=>{e.d(s,{A:()=>h});var o=e(8805),r=e(5710),i=e(43);class n extends r.A{handler(){return this.attrs.when()||void 0}oncreate(t){super.oncreate(t),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(t){super.onremove(t),$(window).off("beforeunload",this.boundHandler)}view(t){return m("[",null,t.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=e(1611),d=e(5673),c=e(6064),l=e(4268),u=e(7891);class h extends r.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(t){super.oninit(t),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){var t;return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,l.A)("ComposerBody",this.attrs.className)},m(u.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,d.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:null==(t=this.jumpToPreview)?void 0:t.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(i.A,{display:"unset",containerClassName:(0,l.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const t=this.composer.fields.content();return Boolean(t)&&t!==this.attrs.originalContent}headerItems(){return new c.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(h,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",h)},4191:(t,s,e)=>{e.r(s),e.d(s,{default:()=>c});var o=e(3554),r=e(6296),i=e(7880),n=e(7709),a=e(7479);function d(t){o.A.composer.isFullScreen()&&(o.A.composer.minimize(),t.stopPropagation())}class c extends r.A{static initAttrs(t){super.initAttrs(t),t.submitLabel=t.submitLabel||o.A.translator.trans("core.forum.composer_edit.submit_button"),t.confirmExit=t.confirmExit||o.A.translator.trans("core.forum.composer_edit.discard_confirmation"),t.originalContent=t.originalContent||t.post.content(),t.user=t.user||t.post.user(),t.post.editedContent=t.originalContent}headerItems(){const t=super.headerItems(),s=this.attrs.post;return t.add("title",m("h3",null,m(a.A,{name:"fas fa-pencil-alt"})," ",m(n.A,{href:o.A.route.discussion(s.discussion(),s.number()),onclick:d},o.A.translator.trans("core.forum.composer_edit.post_link",{number:s.number(),discussion:s.discussion().title()})))),t}jumpToPreview(t){d(t),m.route.set(o.A.route.post(this.attrs.post))}data(){return{content:this.composer.fields.content()}}onsubmit(){const t=this.attrs.post.discussion();this.loading=!0;const s=this.data();this.attrs.post.save(s).then((s=>{if(o.A.viewingDiscussion(t))o.A.current.get("stream").goToNumber(s.number());else{const t=o.A.alerts.show({type:"success",controls:[m(i.A,{className:"Button Button--link",onclick:()=>{m.route.set(o.A.route.post(s)),o.A.alerts.dismiss(t)}},o.A.translator.trans("core.forum.composer_edit.view_button"))]},o.A.translator.trans("core.forum.composer_edit.edited_message"))}this.composer.hide()}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/EditPostComposer",c)}}]); "use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[948],{6296:(t,s,e)=>{e.d(s,{A:()=>h});var o=e(8805),r=e(5710),i=e(43);class n extends r.A{handler(){return this.attrs.when()||void 0}oncreate(t){super.oncreate(t),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(t){super.onremove(t),$(window).off("beforeunload",this.boundHandler)}view(t){return m("[",null,t.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=e(1611),c=e(5673),d=e(6064),l=e(4268),u=e(7891);class h extends r.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(t){super.oninit(t),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,l.A)("ComposerBody",this.attrs.className)},m(u.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,c.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview?.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(i.A,{display:"unset",containerClassName:(0,l.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const t=this.composer.fields.content();return Boolean(t)&&t!==this.attrs.originalContent}headerItems(){return new d.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(h,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",h)},4191:(t,s,e)=>{e.r(s),e.d(s,{default:()=>d});var o=e(3554),r=e(6296),i=e(7880),n=e(7709),a=e(7479);function c(t){o.A.composer.isFullScreen()&&(o.A.composer.minimize(),t.stopPropagation())}class d extends r.A{static initAttrs(t){super.initAttrs(t),t.submitLabel=t.submitLabel||o.A.translator.trans("core.forum.composer_edit.submit_button"),t.confirmExit=t.confirmExit||o.A.translator.trans("core.forum.composer_edit.discard_confirmation"),t.originalContent=t.originalContent||t.post.content(),t.user=t.user||t.post.user(),t.post.editedContent=t.originalContent}headerItems(){const t=super.headerItems(),s=this.attrs.post;return t.add("title",m("h3",null,m(a.A,{name:"fas fa-pencil-alt"})," ",m(n.A,{href:o.A.route.discussion(s.discussion(),s.number()),onclick:c},o.A.translator.trans("core.forum.composer_edit.post_link",{number:s.number(),discussion:s.discussion().title()})))),t}jumpToPreview(t){c(t),m.route.set(o.A.route.post(this.attrs.post))}data(){return{content:this.composer.fields.content()}}onsubmit(){const t=this.attrs.post.discussion();this.loading=!0;const s=this.data();this.attrs.post.save(s).then((s=>{if(o.A.viewingDiscussion(t))o.A.current.get("stream").goToNumber(s.number());else{const t=o.A.alerts.show({type:"success",controls:[m(i.A,{className:"Button Button--link",onclick:()=>{m.route.set(o.A.route.post(s)),o.A.alerts.dismiss(t)}},o.A.translator.trans("core.forum.composer_edit.view_button"))]},o.A.translator.trans("core.forum.composer_edit.edited_message"))}this.composer.hide()}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/EditPostComposer",d)}}]);
//# sourceMappingURL=EditPostComposer.js.map //# sourceMappingURL=EditPostComposer.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[378],{6296:(s,e,t)=>{t.d(e,{A:()=>h});var o=t(8805),r=t(5710),i=t(43);class n extends r.A{handler(){return this.attrs.when()||void 0}oncreate(s){super.oncreate(s),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(s){super.onremove(s),$(window).off("beforeunload",this.boundHandler)}view(s){return m("[",null,s.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=t(1611),c=t(5673),l=t(6064),d=t(4268),u=t(7891);class h extends r.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(s){super.oninit(s),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){var s;return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,d.A)("ComposerBody",this.attrs.className)},m(u.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,c.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:null==(s=this.jumpToPreview)?void 0:s.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(i.A,{display:"unset",containerClassName:(0,d.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const s=this.composer.fields.content();return Boolean(s)&&s!==this.attrs.originalContent}headerItems(){return new l.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(h,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",h)},6349:(s,e,t)=>{t.r(e),t.d(e,{default:()=>d});var o=t(3554),r=t(6296),i=t(7880),n=t(7709),a=t(117),c=t(7479);function l(s){o.A.composer.isFullScreen()&&(o.A.composer.minimize(),s.stopPropagation())}class d extends r.A{static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||(0,a.A)(o.A.translator.trans("core.forum.composer_reply.body_placeholder")),s.submitLabel=s.submitLabel||o.A.translator.trans("core.forum.composer_reply.submit_button"),s.confirmExit=s.confirmExit||(0,a.A)(o.A.translator.trans("core.forum.composer_reply.discard_confirmation"))}headerItems(){const s=super.headerItems(),e=this.attrs.discussion;return s.add("title",m("h3",null,m(c.A,{name:"fas fa-reply"})," ",m(n.A,{href:o.A.route.discussion(e),onclick:l},e.title()))),s}jumpToPreview(s){l(s),m.route.set(o.A.route.discussion(this.attrs.discussion,"reply"))}data(){return{content:this.composer.fields.content(),relationships:{discussion:this.attrs.discussion}}}onsubmit(){const s=this.attrs.discussion;this.loading=!0,m.redraw();const e=this.data();o.A.store.createRecord("posts").save(e).then((e=>{if(o.A.viewingDiscussion(s)){const s=o.A.current.get("stream");s.update().then((()=>s.goToNumber(e.number())))}else{let s;const t=m(i.A,{className:"Button Button--link",onclick:()=>{m.route.set(o.A.route.post(e)),o.A.alerts.dismiss(s)}},o.A.translator.trans("core.forum.composer_reply.view_button"));s=o.A.alerts.show({type:"success",controls:[t]},o.A.translator.trans("core.forum.composer_reply.posted_message"))}this.composer.hide()}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/ReplyComposer",d)}}]); "use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[378],{6296:(s,e,t)=>{t.d(e,{A:()=>h});var o=t(8805),r=t(5710),i=t(43);class n extends r.A{handler(){return this.attrs.when()||void 0}oncreate(s){super.oncreate(s),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)}onremove(s){super.onremove(s),$(window).off("beforeunload",this.boundHandler)}view(s){return m("[",null,s.children)}}flarum.reg.add("core","common/components/ConfirmDocumentUnload",n);var a=t(1611),c=t(5673),l=t(6064),d=t(4268),u=t(7891);class h extends r.A{constructor(){super(...arguments),(0,o.A)(this,"loading",!1),(0,o.A)(this,"composer",void 0),(0,o.A)(this,"jumpToPreview",void 0)}oninit(s){super.oninit(s),this.composer=this.attrs.composer,this.attrs.confirmExit&&this.composer.preventClosingWhen((()=>this.hasChanges()),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")}view(){return m(n,{when:this.hasChanges.bind(this)},m("div",{className:(0,d.A)("ComposerBody",this.attrs.className)},m(u.A,{user:this.attrs.user,className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},(0,c.A)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},m(a.A,{submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview?.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(i.A,{display:"unset",containerClassName:(0,d.A)("ComposerBody-loading",this.loading&&"active"),size:"large"})))}hasChanges(){const s=this.composer.fields.content();return Boolean(s)&&s!==this.attrs.originalContent}headerItems(){return new l.A}loaded(){this.loading=!1,m.redraw()}}(0,o.A)(h,"focusOnSelector",null),flarum.reg.add("core","forum/components/ComposerBody",h)},6349:(s,e,t)=>{t.r(e),t.d(e,{default:()=>d});var o=t(3554),r=t(6296),i=t(7880),n=t(7709),a=t(117),c=t(7479);function l(s){o.A.composer.isFullScreen()&&(o.A.composer.minimize(),s.stopPropagation())}class d extends r.A{static initAttrs(s){super.initAttrs(s),s.placeholder=s.placeholder||(0,a.A)(o.A.translator.trans("core.forum.composer_reply.body_placeholder")),s.submitLabel=s.submitLabel||o.A.translator.trans("core.forum.composer_reply.submit_button"),s.confirmExit=s.confirmExit||(0,a.A)(o.A.translator.trans("core.forum.composer_reply.discard_confirmation"))}headerItems(){const s=super.headerItems(),e=this.attrs.discussion;return s.add("title",m("h3",null,m(c.A,{name:"fas fa-reply"})," ",m(n.A,{href:o.A.route.discussion(e),onclick:l},e.title()))),s}jumpToPreview(s){l(s),m.route.set(o.A.route.discussion(this.attrs.discussion,"reply"))}data(){return{content:this.composer.fields.content(),relationships:{discussion:this.attrs.discussion}}}onsubmit(){const s=this.attrs.discussion;this.loading=!0,m.redraw();const e=this.data();o.A.store.createRecord("posts").save(e).then((e=>{if(o.A.viewingDiscussion(s)){const s=o.A.current.get("stream");s.update().then((()=>s.goToNumber(e.number())))}else{let s;const t=m(i.A,{className:"Button Button--link",onclick:()=>{m.route.set(o.A.route.post(e)),o.A.alerts.dismiss(s)}},o.A.translator.trans("core.forum.composer_reply.view_button"));s=o.A.alerts.show({type:"success",controls:[t]},o.A.translator.trans("core.forum.composer_reply.posted_message"))}this.composer.hide()}),this.loaded.bind(this))}}flarum.reg.add("core","forum/components/ReplyComposer",d)}}]);
//# sourceMappingURL=ReplyComposer.js.map //# sourceMappingURL=ReplyComposer.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[559],{9509:(t,s,a)=>{a.r(s),a.d(s,{default:()=>h});var e=a(8805),r=a(3554),i=a(2855),o=a(7880),n=a(1005),l=a(117),d=a(6064),u=a(4311);class h extends i.A{constructor(){super(...arguments),(0,e.A)(this,"username",void 0),(0,e.A)(this,"email",void 0),(0,e.A)(this,"password",void 0)}oninit(t){super.oninit(t),this.username=(0,u.A)(this.attrs.username||""),this.email=(0,u.A)(this.attrs.email||""),this.password=(0,u.A)(this.attrs.password||"")}className(){return"Modal--small SignUpModal"}title(){return r.A.translator.trans("core.forum.sign_up.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}isProvided(t){var s,a;return null!=(s=null==(a=this.attrs.provided)?void 0:a.includes(t))&&s}body(){return[!this.attrs.token&&m(n.A,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const t=new d.A,s=(0,l.A)(r.A.translator.trans("core.forum.sign_up.username_placeholder")),a=(0,l.A)(r.A.translator.trans("core.forum.sign_up.email_placeholder")),e=(0,l.A)(r.A.translator.trans("core.forum.sign_up.password_placeholder"));return t.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:s,"aria-label":s,bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),t.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:a,"aria-label":a,bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:e,"aria-label":e,bidi:this.password,disabled:this.loading})),10),t.add("submit",m("div",{className:"Form-group"},m(o.A,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.A.translator.trans("core.forum.sign_up.submit_button"))),-10),t}footer(){return[m("p",{className:"SignUpModal-logIn"},r.A.translator.trans("core.forum.sign_up.log_in_text",{a:m(o.A,{className:"Button Button--text Button--link",onclick:this.logIn.bind(this)})}))]}logIn(){const t={identification:this.email()||this.username()};r.A.modal.show((()=>a.e(226).then(a.bind(a,1793))),t)}onready(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()}onsubmit(t){t.preventDefault(),this.loading=!0;const s=this.submitData();r.A.request({url:r.A.forum.attribute("baseUrl")+"/register",method:"POST",body:s,errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}submitData(){const t=this.attrs.token?{token:this.attrs.token}:{password:this.password()};return{username:this.username(),email:this.email(),...t}}}flarum.reg.add("core","forum/components/SignUpModal",h)}}]); "use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[559],{9509:(t,s,e)=>{e.r(s),e.d(s,{default:()=>h});var a=e(8805),r=e(3554),i=e(2855),o=e(7880),n=e(1005),l=e(117),d=e(6064),u=e(4311);class h extends i.A{constructor(){super(...arguments),(0,a.A)(this,"username",void 0),(0,a.A)(this,"email",void 0),(0,a.A)(this,"password",void 0)}oninit(t){super.oninit(t),this.username=(0,u.A)(this.attrs.username||""),this.email=(0,u.A)(this.attrs.email||""),this.password=(0,u.A)(this.attrs.password||"")}className(){return"Modal--small SignUpModal"}title(){return r.A.translator.trans("core.forum.sign_up.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}isProvided(t){return this.attrs.provided?.includes(t)??!1}body(){return[!this.attrs.token&&m(n.A,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const t=new d.A,s=(0,l.A)(r.A.translator.trans("core.forum.sign_up.username_placeholder")),e=(0,l.A)(r.A.translator.trans("core.forum.sign_up.email_placeholder")),a=(0,l.A)(r.A.translator.trans("core.forum.sign_up.password_placeholder"));return t.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:s,"aria-label":s,bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),t.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:e,"aria-label":e,bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:a,"aria-label":a,bidi:this.password,disabled:this.loading})),10),t.add("submit",m("div",{className:"Form-group"},m(o.A,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.A.translator.trans("core.forum.sign_up.submit_button"))),-10),t}footer(){return[m("p",{className:"SignUpModal-logIn"},r.A.translator.trans("core.forum.sign_up.log_in_text",{a:m(o.A,{className:"Button Button--text Button--link",onclick:this.logIn.bind(this)})}))]}logIn(){const t={identification:this.email()||this.username()};r.A.modal.show((()=>e.e(226).then(e.bind(e,1793))),t)}onready(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()}onsubmit(t){t.preventDefault(),this.loading=!0;const s=this.submitData();r.A.request({url:r.A.forum.attribute("baseUrl")+"/register",method:"POST",body:s,errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}submitData(){const t=this.attrs.token?{token:this.attrs.token}:{password:this.password()};return{username:this.username(),email:this.email(),...t}}}flarum.reg.add("core","forum/components/SignUpModal",h)}}]);
//# sourceMappingURL=SignUpModal.js.map //# sourceMappingURL=SignUpModal.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long