From 2991d9552f5df0a71d4beb3ef185263d498fd71f Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Tue, 26 Sep 2023 01:11:35 +0000 Subject: [PATCH] Bundled output for commit 0bac011d7292bd3ebad0a80df646f710fcae25f7 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 8dcf06a..8ba8c41 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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AAgBJ,KAAKI,gBAEnBC,CACR,KAEDP,EAAAA,EAAAA,QAAOC,IAAAA,UAAwB,UAAU,SAAUO,GACjDA,EAAMC,IACJ,0BACA,SAAKlB,UAAU,cACb,eAAQH,IAAAA,WAAAA,MAAqB,sDAC7B,WAAOG,UAAU,cAAcI,KAAK,SAASe,IAAI,IAAIC,KAAMT,KAAKI,gBAChE,aAAMlB,IAAAA,WAAAA,MAAqB,sDAE7B,GAEFoB,EAAMC,IACJ,yBACA,SAAKlB,UAAU,cACb,aACE,WAAOA,UAAU,YACf,WAAOI,KAAK,WAAWgB,KAAMT,KAAKC,eACjCf,IAAAA,WAAAA,MAAqB,sDAG1B,aAAMA,IAAAA,WAAAA,MAAqB,qDAE7B,EAEH,IFNJ,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';\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","registerSetting","extensions","className","label","help","setting","type","options","reduce","Tag","Model","extend","EditTagModal","this","richExcerpts","Stream","tag","excerptLength","data","items","add","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,cAAA,IACO,iBACJE,iBAAgB,WACf,GAAM,gBAAiBL,OAAOM,WAC9B,OACE,SAAKC,UAAU,cACb,OAAGA,UAAU,YAAYJ,IAAAA,WAAeK,MAAM,8CAGnD,IAC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KH,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 diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index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A,MAAqB,6DAKpBS,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 { getPlainContent } from './util/getPlainContent';\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 * as 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","Tag","Model","extend","DiscussionListState","params","include","push","DiscussionListItem","items","discussion","this","attrs","showSynopsisExcerpts","tag","tags","length","excerptPost","firstPost","lastPost","excerptLength","richExcerpt","richExcerpts","onMobile","showSynopsisExcerptsOnMobile","contentHtml","content","m","trust","truncate","contentPlain","excerpt","add","SettingsPage","Stream","user","preferences","FieldSet","label","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,OAAO,uBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,mB,aCAxD,MAAM,EAA+BF,OAAOC,KAAK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C/ByB,UAAWtC,KAAKE,KAAKC,cAAcC,qBACnC4B,SAAU,SAACrD,GACT,EAAK4D,qCAAsC,EAE3C,EAAKrC,KAAKgC,gBAAgB,CAAErB,6BAA8BlC,IAASwD,MAAK,WACtE,EAAKI,qCAAsC,EAC3CC,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