From fce922ee22cce392d60fa942a0ecfdbbe406c9ba Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Tue, 14 Nov 2023 08:51:30 +0000 Subject: [PATCH] Bundled output for commit 09eaf9c743ebc60df66a74d1e6403a7597923e83 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 8ba8c41..19e60f9 100755 --- a/js/dist/admin.js.map +++ b/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,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,mB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,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EnBM,CACR,KAEDL,EAAAA,EAAAA,QAAOC,IAAAA,UAAwB,UAAU,SAAUK,GACjDA,EAAMtB,IACJ,0BACA,SAAKG,UAAU,cACb,eAAQJ,IAAAA,WAAeK,MAAM,sDAC7B,WAAOD,UAAU,cAAcK,KAAK,SAASe,IAAI,IAAIC,KAAMN,KAAKH,gBAChE,aAAMhB,IAAAA,WAAeK,MAAM,sDAE7B,GAEFkB,EAAMtB,IACJ,yBACA,SAAKG,UAAU,cACb,aACE,WAAOA,UAAU,YACf,WAAOK,KAAK,WAAWgB,KAAMN,KAAKL,eACjCd,IAAAA,WAAeK,MAAM,sDAG1B,aAAML,IAAAA,WAAeK,MAAM,qDAE7B,EAEH,IFPJ,G","sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/webpack/runtime/compat get default export","webpack://@ianm/synopsis/webpack/runtime/define property getters","webpack://@ianm/synopsis/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/synopsis/webpack/runtime/make namespace object","webpack://@ianm/synopsis/external root \"flarum.core.compat['admin/app']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/components/EditTagModal']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/Model']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/synopsis/./src/admin/index.tsx","webpack://@ianm/synopsis/./src/admin/util/typeOptions.js","webpack://@ianm/synopsis/./src/admin/extendEditTagModal.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.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/EditTagModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport extendEditTagModal from './extendEditTagModal';\nimport typeOptions from './util/typeOptions';\n\napp.initializers.add('ianm-synopsis', () => {\n app.extensionData\n .for('ianm-synopsis')\n .registerSetting(function () {\n if (!('flarum-tags' in flarum.extensions)) return;\n return (\n
\n

{app.translator.trans('ianm-synopsis.admin.settings.tags-enabled')}

\n
\n );\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.help'),\n setting: 'ianm-synopsis.excerpt_length',\n type: 'number',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.help'),\n setting: 'ianm-synopsis.rich-excerpts',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type.help'),\n setting: 'ianm-synopsis.excerpt-type',\n options: typeOptions(),\n type: 'select',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.disable-when-searching.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.disable-when-searching.help'),\n setting: 'ianm-synopsis.disable-when-searching',\n type: 'switch',\n });\n\n extendEditTagModal();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n let opts;\n opts = ['first', 'last'].reduce((o, key) => {\n o[key] = app.translator.trans(`ianm-synopsis.admin.settings.${key}-label`);\n\n return o;\n }, {});\n return opts;\n}\n","import app from 'flarum/admin/app';\nimport EditTagModal from 'flarum/tags/components/EditTagModal';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport Stream from 'flarum/common/utils/Stream';\nimport type Mithril from 'mithril';\n\nexport default function () {\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.richExcerpts = Model.attribute('richExcerpts');\n Tag.prototype.excerptLength = Model.attribute('excerptLength');\n\n extend(EditTagModal.prototype, 'oninit', function () {\n this.richExcerpts = new Stream(this.tag.richExcerpts());\n this.excerptLength = new Stream(this.tag.excerptLength());\n });\n\n extend(EditTagModal.prototype, 'submitData', function (data) {\n data.richExcerpts = this.richExcerpts();\n data.excerptLength = this.excerptLength();\n\n return data;\n });\n\n extend(EditTagModal.prototype, 'fields', function (items: ItemList) {\n items.add(\n 'synopsis-excerpt-length',\n
\n \n \n
{app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.help')}
\n
,\n 5\n );\n items.add(\n 'synopsis-rich-excerpts',\n
\n
\n \n
\n
{app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.help')}
\n
,\n 5\n );\n });\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","core","compat","app","add","registerSetting","extensions","className","trans","label","help","setting","type","options","reduce","has","Tag","richExcerpts","Model","excerptLength","extend","EditTagModal","this","Stream","tag","data","items","min","bidi"],"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,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,mB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uB,aCIxDC,IAAAA,aAAiBC,IAAI,iBAAiB,WACpCD,IAAAA,cAAiB,IACV,iBACJE,iBAAgB,WACf,GAAM,gBAAiBL,OAAOM,WAC9B,OACEC,EAAA,OAAKC,UAAU,cACbD,EAAA,KAAGC,UAAU,YAAYL,IAAAA,WAAeM,M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,cAAcK,KAAK,SAASe,IAAI,IAAIC,KAAMN,KAAKH,gBAChEb,EAAA,WAAMJ,IAAAA,WAAeM,MAAM,sDAE7B,GAEFkB,EAAMvB,IACJ,yBACAG,EAAA,OAAKC,UAAU,cACbD,EAAA,WACEA,EAAA,SAAOC,UAAU,YACfD,EAAA,SAAOM,KAAK,WAAWgB,KAAMN,KAAKL,eACjCf,IAAAA,WAAeM,MAAM,sDAG1BF,EAAA,WAAMJ,IAAAA,WAAeM,MAAM,qDAE7B,EAEJ,IFPJ,G","sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/webpack/runtime/compat get default export","webpack://@ianm/synopsis/webpack/runtime/define property getters","webpack://@ianm/synopsis/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/synopsis/webpack/runtime/make namespace object","webpack://@ianm/synopsis/external root \"flarum.core.compat['admin/app']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/components/EditTagModal']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/Model']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/synopsis/./src/admin/index.tsx","webpack://@ianm/synopsis/./src/admin/util/typeOptions.js","webpack://@ianm/synopsis/./src/admin/extendEditTagModal.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.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/EditTagModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport extendEditTagModal from './extendEditTagModal';\nimport typeOptions from './util/typeOptions';\n\napp.initializers.add('ianm-synopsis', () => {\n app.extensionData\n .for('ianm-synopsis')\n .registerSetting(function () {\n if (!('flarum-tags' in flarum.extensions)) return;\n return (\n
\n

{app.translator.trans('ianm-synopsis.admin.settings.tags-enabled')}

\n
\n );\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.help'),\n setting: 'ianm-synopsis.excerpt_length',\n type: 'number',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.help'),\n setting: 'ianm-synopsis.rich-excerpts',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type.help'),\n setting: 'ianm-synopsis.excerpt-type',\n options: typeOptions(),\n type: 'select',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.disable-when-searching.label'),\n help: app.translator.trans('ianm-synopsis.admin.settings.disable-when-searching.help'),\n setting: 'ianm-synopsis.disable-when-searching',\n type: 'switch',\n });\n\n extendEditTagModal();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n let opts;\n opts = ['first', 'last'].reduce((o, key) => {\n o[key] = app.translator.trans(`ianm-synopsis.admin.settings.${key}-label`);\n\n return o;\n }, {});\n return opts;\n}\n","import app from 'flarum/admin/app';\nimport EditTagModal from 'flarum/tags/components/EditTagModal';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport Stream from 'flarum/common/utils/Stream';\nimport type Mithril from 'mithril';\n\nexport default function () {\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.richExcerpts = Model.attribute('richExcerpts');\n Tag.prototype.excerptLength = Model.attribute('excerptLength');\n\n extend(EditTagModal.prototype, 'oninit', function () {\n this.richExcerpts = new Stream(this.tag.richExcerpts());\n this.excerptLength = new Stream(this.tag.excerptLength());\n });\n\n extend(EditTagModal.prototype, 'submitData', function (data) {\n data.richExcerpts = this.richExcerpts();\n data.excerptLength = this.excerptLength();\n\n return data;\n });\n\n extend(EditTagModal.prototype, 'fields', function (items: ItemList) {\n items.add(\n 'synopsis-excerpt-length',\n
\n \n \n
{app.translator.trans('ianm-synopsis.admin.settings.excerpt-length.help')}
\n
,\n 5\n );\n items.add(\n 'synopsis-rich-excerpts',\n
\n
\n \n
\n
{app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts.help')}
\n
,\n 5\n );\n });\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","core","compat","app","add","registerSetting","extensions","m","className","trans","label","help","setting","type","options","reduce","has","Tag","richExcerpts","Model","excerptLength","extend","EditTagModal","this","Stream","tag","data","items","min","bidi"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index c7160d1..4e2840d 100755 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -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,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,oC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,mB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,8B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,yB,aCAxD,MAAM,EAA+BF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C3CC,OAAOC,SAASC,QACjB,GACF,EACDL,QAASrC,KAAKuC,qCAEhBxD,IAAAA,WAAe0C,MAAM,6DAKpB5B,CACR,CFjEF,G","sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/webpack/runtime/compat get default export","webpack://@ianm/synopsis/webpack/runtime/define property getters","webpack://@ianm/synopsis/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/synopsis/webpack/runtime/make namespace object","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/app']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/string']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/Model']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/synopsis/./src/forum/index.ts","webpack://@ianm/synopsis/./src/forum/addSummaryExcerpt.tsx","webpack://@ianm/synopsis/./src/forum/addUserPreference.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.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/forum/app';\n\nimport addSummaryExcerpt from './addSummaryExcerpt';\nimport addUserPreference from './addUserPreference';\n\napp.initializers.add('ianm-synopsis', () => {\n addSummaryExcerpt();\n addUserPreference();\n});\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport { truncate } from 'flarum/common/utils/string';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport type Mithril from 'mithril';\n\nexport default function addSummaryExcerpt() {\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.richExcerpts = Model.attribute('richExcerpts');\n Tag.prototype.excerptLength = Model.attribute('excerptLength');\n }\n\n extend(DiscussionListState.prototype, 'requestParams', function (params: any) {\n if (app.forum.attribute('synopsis.excerpt_type') === 'first') params.include.push('firstPost');\n else params.include.push('lastPost');\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items: ItemList) {\n // Skip if we are searching to preserve most relevant post content as excerpt,\n // that way we also preserve highlighting of search terms in the most relevant post.\n if (app.forum.attribute('synopsis.disable_when_searching') && app.discussions.params.q) return;\n\n const discussion = this.attrs.discussion;\n\n if (app.session.user && !app.session.user.preferences().showSynopsisExcerpts) {\n return;\n }\n\n const tags = discussion.tags();\n let tag;\n if (tags) {\n tag = tags[tags.length - 1];\n }\n\n const excerptPost = app.forum.attribute('synopsis.excerpt_type') === 'first' ? discussion.firstPost() : discussion.lastPost();\n const excerptLength = typeof tag?.excerptLength() === 'number' ? tag?.excerptLength() : app.forum.attribute('synopsis.excerpt_length');\n const richExcerpt = typeof tag?.richExcerpts() === 'number' ? tag?.richExcerpts() : app.forum.attribute('synopsis.rich_excerpts');\n const onMobile = app.session.user ? app.session.user.preferences().showSynopsisExcerptsOnMobile : false;\n\n // A length of zero means we don't want a synopsis for this discussion, so do nothing.\n if (excerptLength === 0) {\n return;\n }\n\n if (!excerptPost?.contentHtml?.()) return;\n const content = richExcerpt ? m.trust(truncate(excerptPost.contentHtml(), excerptLength)) : truncate(excerptPost.contentPlain(), excerptLength);\n\n if (excerptPost) {\n const excerpt =
{content}
;\n\n items.add(onMobile ? 'excerptM' : 'excerpt', excerpt, -100);\n }\n });\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Switch from 'flarum/common/components/Switch';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default function () {\n extend(SettingsPage.prototype, 'oninit', function () {\n this.showSynopsisExcerpts = Stream(this.user.preferences().showSynopsisExcerpts);\n this.showSynopsisExcerptsOnMobile = Stream(this.user.preferences().showSynopsisExcerptsOnMobile);\n });\n\n extend(SettingsPage.prototype, 'settingsItems', function (items: ItemList) {\n items.add(\n 'synopsis',\n FieldSet.component(\n {\n label: app.translator.trans('ianm-synopsis.forum.user.settings.summaries-heading'),\n className: 'Settings-Synopsis',\n },\n this.summariesItems().toArray()\n )\n );\n });\n\n SettingsPage.prototype['summariesItems'] = function () {\n const items = new ItemList();\n\n items.add(\n 'synopsis-excerpts',\n Switch.component(\n {\n state: this.user.preferences().showSynopsisExcerpts,\n onchange: (value) => {\n this.showSynopsisExcerptsLoading = true;\n\n this.user.savePreferences({ showSynopsisExcerpts: value }).then(() => {\n this.showSynopsisExcerptsLoading = false;\n m.redraw();\n });\n },\n loading: this.showSynopsisExcerptsLoading,\n },\n app.translator.trans('ianm-synopsis.forum.user.settings.show-summaries')\n )\n );\n\n if (this.user.preferences().showSynopsisExcerpts) {\n items.add(\n 'synopsis-excerpts-mobile',\n Switch.component(\n {\n state: this.user.preferences().showSynopsisExcerptsOnMobile,\n disabled: !this.user.preferences().showSynopsisExcerpts,\n onchange: (value) => {\n this.showSynopsisExcerptsOnMobileLoading = true;\n\n this.user.savePreferences({ showSynopsisExcerptsOnMobile: value }).then(() => {\n this.showSynopsisExcerptsOnMobileLoading = false;\n window.location.reload();\n });\n },\n loading: this.showSynopsisExcerptsOnMobileLoading,\n },\n app.translator.trans('ianm-synopsis.forum.user.settings.show-summaries-mobile')\n )\n );\n }\n\n return items;\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","core","compat","app","add","has","Tag","richExcerpts","Model","excerptLength","extend","DiscussionListState","params","attribute","include","push","DiscussionListItem","items","q","discussion","this","attrs","user","preferences","showSynopsisExcerpts","tag","tags","length","excerptPost","firstPost","lastPost","richExcerpt","onMobile","showSynopsisExcerptsOnMobile","contentHtml","content","m","trust","truncate","contentPlain","excerpt","SettingsPage","Stream","FieldSet","label","trans","className","summariesItems","toArray","ItemList","Switch","state","onchange","showSynopsisExcerptsLoading","savePreferences","then","redraw","loading","disabled","showSynopsisExcerptsOnMobileLoading","window","location","reload"],"sourceRoot":""} \ No newline at end of file +{"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,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,oC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OA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AStC,KAAKkC,6BAEhBvD,IAAAA,WAAe8C,MAAM,sDAIrBzB,KAAKE,KAAKC,cAAcC,sBAC1BX,EAAMb,IACJ,2BACAmD,IAAAA,UACE,CACEC,MAAOhC,KAAKE,KAAKC,cAAcU,6BAC/B0B,UAAWvC,KAAKE,KAAKC,cAAcC,qBACnC6B,SAAU,SAAC1D,GACTsD,EAAKW,qCAAsC,EAE3CX,EAAK3B,KAAKiC,gBAAgB,CAAEtB,6BAA8BtC,IAAS6D,MAAK,WACtEP,EAAKW,qCAAsC,EAC3CC,OAAOC,SAASC,QAClB,GACF,EACAL,QAAStC,KAAKwC,qCAEhB7D,IAAAA,WAAe8C,MAAM,6DAKpBhC,CACT,CFjEF,G","sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/webpack/runtime/compat get default export","webpack://@ianm/synopsis/webpack/runtime/define property getters","webpack://@ianm/synopsis/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/synopsis/webpack/runtime/make namespace object","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/app']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/string']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['tags/models/Tag']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/Model']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@ianm/synopsis/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/synopsis/./src/forum/index.ts","webpack://@ianm/synopsis/./src/forum/addSummaryExcerpt.tsx","webpack://@ianm/synopsis/./src/forum/addUserPreference.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.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/models/Tag'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/forum/app';\n\nimport addSummaryExcerpt from './addSummaryExcerpt';\nimport addUserPreference from './addUserPreference';\n\napp.initializers.add('ianm-synopsis', () => {\n addSummaryExcerpt();\n addUserPreference();\n});\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport { truncate } from 'flarum/common/utils/string';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tag from 'flarum/tags/models/Tag';\nimport Model from 'flarum/common/Model';\nimport type Mithril from 'mithril';\n\nexport default function addSummaryExcerpt() {\n if (app.initializers.has('flarum-tags')) {\n Tag.prototype.richExcerpts = Model.attribute('richExcerpts');\n Tag.prototype.excerptLength = Model.attribute('excerptLength');\n }\n\n extend(DiscussionListState.prototype, 'requestParams', function (params: any) {\n if (app.forum.attribute('synopsis.excerpt_type') === 'first') params.include.push('firstPost');\n else params.include.push('lastPost');\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items: ItemList) {\n // Skip if we are searching to preserve most relevant post content as excerpt,\n // that way we also preserve highlighting of search terms in the most relevant post.\n if (app.forum.attribute('synopsis.disable_when_searching') && app.discussions.params.q) return;\n\n const discussion = this.attrs.discussion;\n\n if (app.session.user && !app.session.user.preferences().showSynopsisExcerpts) {\n return;\n }\n\n const tags = discussion.tags();\n let tag;\n if (tags) {\n tag = tags[tags.length - 1];\n }\n\n const excerptPost = app.forum.attribute('synopsis.excerpt_type') === 'first' ? discussion.firstPost() : discussion.lastPost();\n const excerptLength = typeof tag?.excerptLength() === 'number' ? tag?.excerptLength() : app.forum.attribute('synopsis.excerpt_length');\n const richExcerpt = typeof tag?.richExcerpts() === 'number' ? tag?.richExcerpts() : app.forum.attribute('synopsis.rich_excerpts');\n const onMobile = app.session.user ? app.session.user.preferences().showSynopsisExcerptsOnMobile : false;\n\n // A length of zero means we don't want a synopsis for this discussion, so do nothing.\n if (excerptLength === 0) {\n return;\n }\n\n if (!excerptPost?.contentHtml?.()) return;\n const content = richExcerpt ? m.trust(truncate(excerptPost.contentHtml(), excerptLength)) : truncate(excerptPost.contentPlain(), excerptLength);\n\n if (excerptPost) {\n const excerpt =
{content}
;\n\n items.add(onMobile ? 'excerptM' : 'excerpt', excerpt, -100);\n }\n });\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Switch from 'flarum/common/components/Switch';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default function () {\n extend(SettingsPage.prototype, 'oninit', function () {\n this.showSynopsisExcerpts = Stream(this.user.preferences().showSynopsisExcerpts);\n this.showSynopsisExcerptsOnMobile = Stream(this.user.preferences().showSynopsisExcerptsOnMobile);\n });\n\n extend(SettingsPage.prototype, 'settingsItems', function (items: ItemList) {\n items.add(\n 'synopsis',\n FieldSet.component(\n {\n label: app.translator.trans('ianm-synopsis.forum.user.settings.summaries-heading'),\n className: 'Settings-Synopsis',\n },\n this.summariesItems().toArray()\n )\n );\n });\n\n SettingsPage.prototype['summariesItems'] = function () {\n const items = new ItemList();\n\n items.add(\n 'synopsis-excerpts',\n Switch.component(\n {\n state: this.user.preferences().showSynopsisExcerpts,\n onchange: (value) => {\n this.showSynopsisExcerptsLoading = true;\n\n this.user.savePreferences({ showSynopsisExcerpts: value }).then(() => {\n this.showSynopsisExcerptsLoading = false;\n m.redraw();\n });\n },\n loading: this.showSynopsisExcerptsLoading,\n },\n app.translator.trans('ianm-synopsis.forum.user.settings.show-summaries')\n )\n );\n\n if (this.user.preferences().showSynopsisExcerpts) {\n items.add(\n 'synopsis-excerpts-mobile',\n Switch.component(\n {\n state: this.user.preferences().showSynopsisExcerptsOnMobile,\n disabled: !this.user.preferences().showSynopsisExcerpts,\n onchange: (value) => {\n this.showSynopsisExcerptsOnMobileLoading = true;\n\n this.user.savePreferences({ showSynopsisExcerptsOnMobile: value }).then(() => {\n this.showSynopsisExcerptsOnMobileLoading = false;\n window.location.reload();\n });\n },\n loading: this.showSynopsisExcerptsOnMobileLoading,\n },\n app.translator.trans('ianm-synopsis.forum.user.settings.show-summaries-mobile')\n )\n );\n }\n\n return items;\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","core","compat","app","add","has","Tag","richExcerpts","Model","excerptLength","extend","DiscussionListState","params","attribute","include","push","DiscussionListItem","items","_tag","_tag2","_tag3","_tag4","q","discussion","this","attrs","user","preferences","showSynopsisExcerpts","tag","tags","length","excerptPost","firstPost","lastPost","richExcerpt","onMobile","showSynopsisExcerptsOnMobile","contentHtml","content","m","trust","truncate","contentPlain","excerpt","SettingsPage","Stream","FieldSet","label","trans","className","summariesItems","toArray","_this","ItemList","Switch","state","onchange","showSynopsisExcerptsLoading","savePreferences","then","redraw","loading","disabled","showSynopsisExcerptsOnMobileLoading","window","location","reload"],"sourceRoot":""} \ No newline at end of file