diff --git a/extensions/sticky/js/dist/admin.js b/extensions/sticky/js/dist/admin.js index f4c4144d0..1ab022bf8 100644 --- a/extensions/sticky/js/dist/admin.js +++ b/extensions/sticky/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var e={n:s=>{var t=s&&s.__esModule?()=>s.default:()=>s;return e.d(t,{a:t}),t},d:(s,t)=>{for(var r in t)e.o(t,r)&&!e.o(s,r)&&Object.defineProperty(s,r,{enumerable:!0,get:t[r]})},o:(e,s)=>Object.prototype.hasOwnProperty.call(e,s),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},s={};(()=>{"use strict";e.r(s),e.d(s,{extend:()=>m});const t=flarum.reg.get("core","admin/app");var r=e.n(t);const n=flarum.reg.get("core","common/extenders");var a=e.n(n);const i=flarum.reg.get("core","common/query/IGambit"),o=flarum.reg.get("core","common/app");var l=e.n(o);class c extends i.BooleanGambit{key(){return l().translator.trans("flarum-sticky.lib.gambits.discussions.sticky.key",{},!0)}filterKey(){return"sticky"}}flarum.reg.add("flarum-sticky","common/query/discussions/StickyGambit",c);const m=[(new(a().Search)).gambit("discussions",c),(new(a().Admin)).permission((()=>({icon:"fas fa-thumbtack",label:r().translator.trans("flarum-sticky.admin.permissions.sticky_discussions_label"),permission:"discussion.sticky"})),"moderate",95).setting((()=>({setting:"flarum-sticky.only_sticky_unread_discussions",name:"onlyStickyUnreadDiscussions",type:"boolean",label:r().translator.trans("flarum-sticky.admin.settings.only_sticky_unread_discussions_label"),help:r().translator.trans("flarum-sticky.admin.settings.only_sticky_unread_discussions_help")})))];r().initializers.add("flarum-sticky",(()=>{}))})(),module.exports=s})(); +(()=>{var e={n:s=>{var t=s&&s.__esModule?()=>s.default:()=>s;return e.d(t,{a:t}),t},d:(s,t)=>{for(var r in t)e.o(t,r)&&!e.o(s,r)&&Object.defineProperty(s,r,{enumerable:!0,get:t[r]})},o:(e,s)=>Object.prototype.hasOwnProperty.call(e,s),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},s={};(()=>{"use strict";e.r(s),e.d(s,{extend:()=>m});const t=flarum.reg.get("core","admin/app");var r=e.n(t);const a=flarum.reg.get("core","common/extenders");var n=e.n(a);const i=flarum.reg.get("core","common/query/IGambit"),o=flarum.reg.get("core","common/app");var l=e.n(o);class c extends i.BooleanGambit{key(){return l().translator.trans("flarum-sticky.lib.gambits.discussions.sticky.key",{},!0)}filterKey(){return"sticky"}}flarum.reg.add("flarum-sticky","common/query/discussions/StickyGambit",c);const m=[(new(n().Search)).gambit("discussions",c),(new(n().Admin)).permission((()=>({icon:"fas fa-thumbtack",label:r().translator.trans("flarum-sticky.admin.permissions.sticky_discussions_label"),permission:"discussion.sticky"})),"moderate",95).setting((()=>({setting:"flarum-sticky.only_sticky_unread_discussions",name:"onlyStickyUnreadDiscussions",type:"boolean",label:r().translator.trans("flarum-sticky.admin.settings.only_sticky_unread_discussions_label"),help:r().translator.trans("flarum-sticky.admin.settings.only_sticky_unread_discussions_help")})),90).setting((()=>({type:"switch",setting:"flarum-sticky.enable_display_excerpt",label:r().translator.trans("flarum-sticky.admin.settings.enable_display_excerpt")})),100)];r().initializers.add("flarum-sticky",(()=>{}))})(),module.exports=s})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/sticky/js/dist/admin.js.map b/extensions/sticky/js/dist/admin.js.map index aa0b97bcf..693892793 100644 --- a/extensions/sticky/js/dist/admin.js.map +++ b/extensions/sticky/js/dist/admin.js.map @@ -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,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,oB,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,wBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,c,aCE7C,MAAMW,UAAqB,EAAAC,cACxC,GAAAjB,GACE,OAAO,eAAekB,MAAM,mDAAoD,CAAC,GAAG,EACtF,CACA,SAAAC,GACE,MAAO,QACT,EAEFL,OAAOC,IAAIK,IAAI,gBAAiB,wCAAyCJ,GCRzE,MCCA,IDDgB,IAAI,aACnBK,OAAO,cAAeL,ICAU,IAAI,YAAeM,YAAW,KAAM,CACnEC,KAAM,mBACNC,MAAO,eAAeN,MAAM,4DAC5BI,WAAY,uBACV,WAAY,IAAIG,SAAQ,KAAM,CAChCA,QAAS,+CACTC,KAAM,8BACNC,KAAM,UACNH,MAAO,eAAeN,MAAM,qEAC5BU,KAAM,eAAeV,MAAM,yECV7B,iBAAiBE,IAAI,iBAAiB,Q","sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/webpack/runtime/compat get default export","webpack://@flarum/sticky/webpack/runtime/define property getters","webpack://@flarum/sticky/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/sticky/webpack/runtime/make namespace object","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/sticky/./src/common/query/discussions/StickyGambit.ts","webpack://@flarum/sticky/./src/common/extend.ts","webpack://@flarum/sticky/./src/admin/extend.tsx","webpack://@flarum/sticky/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import { BooleanGambit } from 'flarum/common/query/IGambit';\nimport app from 'flarum/common/app';\nexport default class StickyGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-sticky.lib.gambits.discussions.sticky.key', {}, true);\n }\n filterKey() {\n return 'sticky';\n }\n}\nflarum.reg.add('flarum-sticky', 'common/query/discussions/StickyGambit', StickyGambit);","import Extend from 'flarum/common/extenders';\nimport StickyGambit from './query/discussions/StickyGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', StickyGambit)];","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Admin().permission(() => ({\n icon: 'fas fa-thumbtack',\n label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'),\n permission: 'discussion.sticky'\n}), 'moderate', 95).setting(() => ({\n setting: 'flarum-sticky.only_sticky_unread_discussions',\n name: 'onlyStickyUnreadDiscussions',\n type: 'boolean',\n label: app.translator.trans('flarum-sticky.admin.settings.only_sticky_unread_discussions_label'),\n help: app.translator.trans('flarum-sticky.admin.settings.only_sticky_unread_discussions_help')\n}))];","import app from 'flarum/admin/app';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-sticky', () => {\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","StickyGambit","BooleanGambit","trans","filterKey","add","gambit","permission","icon","label","setting","name","type","help"],"sourceRoot":""} \ No newline at end of file +{"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,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,oB,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,wBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,c,aCE7C,MAAMW,UAAqB,EAAAC,cACxC,GAAAjB,GACE,OAAO,eAAekB,MAAM,mDAAoD,CAAC,GAAG,EACtF,CACA,SAAAC,GACE,MAAO,QACT,EAEFL,OAAOC,IAAIK,IAAI,gBAAiB,wCAAyCJ,GCRzE,MCCA,IDDgB,IAAI,aACnBK,OAAO,cAAeL,ICAU,IAAI,YAAeM,YAAW,KAAM,CACnEC,KAAM,mBACNC,MAAO,eAAeN,MAAM,4DAC5BI,WAAY,uBACV,WAAY,IAAIG,SAAQ,KAAM,CAChCA,QAAS,+CACTC,KAAM,8BACNC,KAAM,UACNH,MAAO,eAAeN,MAAM,qEAC5BU,KAAM,eAAeV,MAAM,uEACzB,IAAIO,SAAQ,KAAM,CACpBE,KAAM,SACNF,QAAS,uCACTD,MAAO,eAAeN,MAAM,0DAC1B,MCfJ,iBAAiBE,IAAI,iBAAiB,Q","sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/webpack/runtime/compat get default export","webpack://@flarum/sticky/webpack/runtime/define property getters","webpack://@flarum/sticky/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/sticky/webpack/runtime/make namespace object","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/sticky/./src/common/query/discussions/StickyGambit.ts","webpack://@flarum/sticky/./src/common/extend.ts","webpack://@flarum/sticky/./src/admin/extend.tsx","webpack://@flarum/sticky/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import { BooleanGambit } from 'flarum/common/query/IGambit';\nimport app from 'flarum/common/app';\nexport default class StickyGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-sticky.lib.gambits.discussions.sticky.key', {}, true);\n }\n filterKey() {\n return 'sticky';\n }\n}\nflarum.reg.add('flarum-sticky', 'common/query/discussions/StickyGambit', StickyGambit);","import Extend from 'flarum/common/extenders';\nimport StickyGambit from './query/discussions/StickyGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', StickyGambit)];","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Admin().permission(() => ({\n icon: 'fas fa-thumbtack',\n label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'),\n permission: 'discussion.sticky'\n}), 'moderate', 95).setting(() => ({\n setting: 'flarum-sticky.only_sticky_unread_discussions',\n name: 'onlyStickyUnreadDiscussions',\n type: 'boolean',\n label: app.translator.trans('flarum-sticky.admin.settings.only_sticky_unread_discussions_label'),\n help: app.translator.trans('flarum-sticky.admin.settings.only_sticky_unread_discussions_help')\n}), 90).setting(() => ({\n type: 'switch',\n setting: 'flarum-sticky.enable_display_excerpt',\n label: app.translator.trans('flarum-sticky.admin.settings.enable_display_excerpt')\n}), 100)];","import app from 'flarum/admin/app';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-sticky', () => {\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","StickyGambit","BooleanGambit","trans","filterKey","add","gambit","permission","icon","label","setting","name","type","help"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/sticky/js/dist/forum.js b/extensions/sticky/js/dist/forum.js index aa027dfc2..44da573d2 100644 --- a/extensions/sticky/js/dist/forum.js +++ b/extensions/sticky/js/dist/forum.js @@ -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.${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 r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[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),t.d(e,{extend:()=>B});const s=flarum.reg.get("core","forum/app");var r=t.n(s);const o=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 p=flarum.reg.get("core","forum/states/DiscussionListState");var k=t.n(p);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")];r().initializers.add("flarum-sticky",(()=>{(0,o.extend)(c().prototype,"badges",(function(t){this.isSticky()&&t.add("sticky",m(a(),{type:"sticky",label:r().translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)})),(0,o.extend)(l(),"moderationControls",(function(t,e){e.canSticky()&&t.add("sticky",m(g(),{icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(e)},r().translator.trans(`flarum-sticky.forum.discussion_controls.${e.isSticky()?"unsticky":"sticky"}_button`)))})),l().stickyAction=function(){this.save({isSticky:!this.isSticky()}).then((()=>{r().current.matches(f())&&r().current.get("stream").update(),m.redraw()}))},(0,o.extend)(k().prototype,"requestParams",(function(t){r().forum.attribute("excerptDisplayEnabled")&&(r().current.matches(h())||r().current.matches(f()))&&t.include.push("firstPost")})),(0,o.extend)(v().prototype,"infoItems",(function(t){const e=this.attrs.discussion;if(r().forum.attribute("excerptDisplayEnabled")&&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,o.extend)(v().prototype,"elementAttrs",(function(t){this.attrs.discussion.isSticky()&&(t.className=_()(t.className,"DiscussionListItem--sticky"))}))}))})(),module.exports=e})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/sticky/js/dist/forum.js.map b/extensions/sticky/js/dist/forum.js.map index e2437ed1f..6cb937807 100644 --- a/extensions/sticky/js/dist/forum.js.map +++ b/extensions/sticky/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"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","sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/webpack/runtime/compat get default export","webpack://@flarum/sticky/webpack/runtime/define property getters","webpack://@flarum/sticky/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/sticky/webpack/runtime/make namespace object","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/sticky/./src/forum/components/DiscussionStickiedPost.js","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/sticky/./src/common/query/discussions/StickyGambit.ts","webpack://@flarum/sticky/./src/common/extend.ts","webpack://@flarum/sticky/./src/forum/extend.ts","webpack://@flarum/sticky/./src/forum/index.js","webpack://@flarum/sticky/./src/forum/addStickyBadge.js","webpack://@flarum/sticky/./src/forum/addStickyControl.js","webpack://@flarum/sticky/./src/forum/addStickyExcerpt.js","webpack://@flarum/sticky/./src/forum/addStickyClass.js"],"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', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nexport default class DiscussionStickiedPost extends EventPost {\n icon() {\n return 'fas fa-thumbtack';\n }\n descriptionKey() {\n return this.attrs.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text';\n }\n}\nflarum.reg.add('flarum-sticky', 'forum/components/DiscussionStickiedPost', DiscussionStickiedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import { BooleanGambit } from 'flarum/common/query/IGambit';\nimport app from 'flarum/common/app';\nexport default class StickyGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-sticky.lib.gambits.discussions.sticky.key', {}, true);\n }\n filterKey() {\n return 'sticky';\n }\n}\nflarum.reg.add('flarum-sticky', 'common/query/discussions/StickyGambit', StickyGambit);","import Extend from 'flarum/common/extenders';\nimport StickyGambit from './query/discussions/StickyGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', StickyGambit)];","import Extend from 'flarum/common/extenders';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionStickiedPost from './components/DiscussionStickiedPost';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.PostTypes() //\n.add('discussionStickied', DiscussionStickiedPost), new Extend.Model(Discussion) //\n.attribute('isSticky').attribute('canSticky')];","import app from 'flarum/forum/app';\nimport addStickyBadge from './addStickyBadge';\nimport addStickyControl from './addStickyControl';\nimport addStickyExcerpt from './addStickyExcerpt';\nimport addStickyClass from './addStickyClass';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-sticky', () => {\n addStickyBadge();\n addStickyControl();\n addStickyExcerpt();\n addStickyClass();\n});","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\nexport default function addStickyBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.isSticky()) {\n badges.add('sticky', m(Badge, {\n type: \"sticky\",\n label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'),\n icon: \"fas fa-thumbtack\"\n }), 10);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nexport default function addStickyControl() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canSticky()) {\n items.add('sticky', m(Button, {\n icon: \"fas fa-thumbtack\",\n onclick: this.stickyAction.bind(discussion)\n }, app.translator.trans(`flarum-sticky.forum.discussion_controls.${discussion.isSticky() ? 'unsticky' : 'sticky'}_button`)));\n }\n });\n DiscussionControls.stickyAction = function () {\n this.save({\n isSticky: !this.isSticky()\n }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n };\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport { truncate } from 'flarum/common/utils/string';\nexport default function addStickyExcerpt() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.matches(IndexPage) || app.current.matches(DiscussionPage)) {\n params.include.push('firstPost');\n }\n });\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n if (discussion.isSticky() && !this.attrs.params.q && !discussion.lastReadPostNumber()) {\n const firstPost = discussion.firstPost();\n if (firstPost) {\n const excerpt = truncate(firstPost.contentPlain(), 175);\n\n // Wrapping in
because ItemList entries need to be vnodes\n items.add('excerpt', m(\"div\", null, excerpt), -100);\n }\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nexport default function addStickyClass() {\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (this.attrs.discussion.isSticky()) {\n attrs.className = classList(attrs.className, 'DiscussionListItem--sticky');\n }\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","DiscussionStickiedPost","icon","descriptionKey","this","attrs","post","content","sticky","add","StickyGambit","BooleanGambit","trans","filterKey","gambit","attribute","extend","badges","isSticky","m","type","label","items","discussion","canSticky","onclick","stickyAction","bind","save","then","matches","update","redraw","params","include","push","q","lastReadPostNumber","firstPost","excerpt","truncate","contentPlain","className"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"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","sources":["webpack://@flarum/sticky/webpack/bootstrap","webpack://@flarum/sticky/webpack/runtime/compat get default export","webpack://@flarum/sticky/webpack/runtime/define property getters","webpack://@flarum/sticky/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/sticky/webpack/runtime/make namespace object","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/sticky/./src/forum/components/DiscussionStickiedPost.js","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/sticky/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/sticky/./src/common/query/discussions/StickyGambit.ts","webpack://@flarum/sticky/./src/common/extend.ts","webpack://@flarum/sticky/./src/forum/extend.ts","webpack://@flarum/sticky/./src/forum/index.js","webpack://@flarum/sticky/./src/forum/addStickyBadge.js","webpack://@flarum/sticky/./src/forum/addStickyControl.js","webpack://@flarum/sticky/./src/forum/addStickyExcerpt.js","webpack://@flarum/sticky/./src/forum/addStickyClass.js"],"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', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nexport default class DiscussionStickiedPost extends EventPost {\n icon() {\n return 'fas fa-thumbtack';\n }\n descriptionKey() {\n return this.attrs.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text';\n }\n}\nflarum.reg.add('flarum-sticky', 'forum/components/DiscussionStickiedPost', DiscussionStickiedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","import { BooleanGambit } from 'flarum/common/query/IGambit';\nimport app from 'flarum/common/app';\nexport default class StickyGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-sticky.lib.gambits.discussions.sticky.key', {}, true);\n }\n filterKey() {\n return 'sticky';\n }\n}\nflarum.reg.add('flarum-sticky', 'common/query/discussions/StickyGambit', StickyGambit);","import Extend from 'flarum/common/extenders';\nimport StickyGambit from './query/discussions/StickyGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', StickyGambit)];","import Extend from 'flarum/common/extenders';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionStickiedPost from './components/DiscussionStickiedPost';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.PostTypes() //\n.add('discussionStickied', DiscussionStickiedPost), new Extend.Model(Discussion) //\n.attribute('isSticky').attribute('canSticky')];","import app from 'flarum/forum/app';\nimport addStickyBadge from './addStickyBadge';\nimport addStickyControl from './addStickyControl';\nimport addStickyExcerpt from './addStickyExcerpt';\nimport addStickyClass from './addStickyClass';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-sticky', () => {\n addStickyBadge();\n addStickyControl();\n addStickyExcerpt();\n addStickyClass();\n});","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\nexport default function addStickyBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.isSticky()) {\n badges.add('sticky', m(Badge, {\n type: \"sticky\",\n label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'),\n icon: \"fas fa-thumbtack\"\n }), 10);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nexport default function addStickyControl() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canSticky()) {\n items.add('sticky', m(Button, {\n icon: \"fas fa-thumbtack\",\n onclick: this.stickyAction.bind(discussion)\n }, app.translator.trans(`flarum-sticky.forum.discussion_controls.${discussion.isSticky() ? 'unsticky' : 'sticky'}_button`)));\n }\n });\n DiscussionControls.stickyAction = function () {\n this.save({\n isSticky: !this.isSticky()\n }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n };\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport { truncate } from 'flarum/common/utils/string';\nexport default function addStickyExcerpt() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.forum.attribute('excerptDisplayEnabled') && (app.current.matches(IndexPage) || app.current.matches(DiscussionPage))) {\n params.include.push('firstPost');\n }\n });\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n if (app.forum.attribute('excerptDisplayEnabled') && discussion.isSticky() && !this.attrs.params.q && !discussion.lastReadPostNumber()) {\n const firstPost = discussion.firstPost();\n if (firstPost) {\n const excerpt = truncate(firstPost.contentPlain(), 175);\n\n // Wrapping in
because ItemList entries need to be vnodes\n items.add('excerpt', m(\"div\", null, excerpt), -100);\n }\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nexport default function addStickyClass() {\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (this.attrs.discussion.isSticky()) {\n attrs.className = classList(attrs.className, 'DiscussionListItem--sticky');\n }\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","DiscussionStickiedPost","icon","descriptionKey","this","attrs","post","content","sticky","add","StickyGambit","BooleanGambit","trans","filterKey","gambit","attribute","extend","badges","isSticky","m","type","label","items","discussion","canSticky","onclick","stickyAction","bind","save","then","matches","update","redraw","params","include","push","q","lastReadPostNumber","firstPost","excerpt","truncate","contentPlain","className"],"sourceRoot":""} \ No newline at end of file