diff --git a/js/dist/admin.js b/js/dist/admin.js index fc080de..c632b8f 100755 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({0:function(e,t){e.exports=flarum.core.compat.app},11:function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);i.a.initializers.add("ianm-synopsis",(function(){i.a.extensionData.for("ianm-synopsis").registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.excerpt-label"),setting:"ianm-synopsis.excerpt_length",type:"number"}).registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.rich-excerpts"),setting:"ianm-synopsis.rich-excerpts",type:"boolean"}).registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.excerpt-type"),setting:"ianm-synopsis.excerpt-type",options:["first","last"].reduce((function(e,t){return e[t]=i.a.translator.trans("ianm-synopsis.admin.settings."+t+"-label"),e}),{}),type:"select"})}))}}); +module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({0:function(e,t){e.exports=flarum.core.compat["common/app"]},11:function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);i.a.initializers.add("ianm-synopsis",(function(){i.a.extensionData.for("ianm-synopsis").registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.excerpt-label"),setting:"ianm-synopsis.excerpt_length",type:"number"}).registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.rich-excerpts"),setting:"ianm-synopsis.rich-excerpts",type:"boolean"}).registerSetting({label:i.a.translator.trans("ianm-synopsis.admin.settings.excerpt-type"),setting:"ianm-synopsis.excerpt-type",options:["first","last"].reduce((function(e,t){return e[t]=i.a.translator.trans("ianm-synopsis.admin.settings."+t+"-label"),e}),{}),type:"select"})}))}}); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 2acd224..7813515 100755 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/external \"flarum.core.compat['app']\"","webpack://@ianm/synopsis/./src/admin/index.js"],"names":["enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","exports","flarum","core","compat","app","initializers","add","extensionData","registerSetting","label","translator","trans","setting","type","options","reduce","o"],"mappings":"2BACA,SAGA,cAGA,QACA,oBAGA,YACA,IACA,KACA,YAUA,OANA,mCAGA,OAGA,UA0DA,OArDA,MAGA,MAGA,oBACA,UACA,2BAA2CA,YAAY,EAAMC,IAAKC,KAKlE,gBACA,gDACA,4CAAyDC,MAAO,WAEhE,sCAAkDA,OAAO,KAQzD,kBAEA,GADA,cACA,aACA,qDACA,0BAGA,GAFA,OACA,mCAA0CH,YAAY,EAAMG,MAAOA,IACnE,2DAAiH,OAAOA,EAAMC,IAAQC,KAAK,KAAMD,IACjJ,UAIA,gBACA,sBACA,WAA4B,OAAOE,EAAgB,SACnD,WAAkC,OAAOA,GAEzC,OADA,aACA,GAIA,kBAAuD,OAAOC,OAAOC,UAAUC,eAAeC,KAAKC,EAAQC,IAG3G,OAIA,U,kBClFAN,EAAOO,QAAUC,OAAOC,KAAKC,OAAY,K,2DCwBzCC,IAAIC,aAAaC,IAAI,iBAAiB,WAClCF,IAAIG,cAAJ,IACS,iBACJC,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,8CAC5BC,QAAS,+BACTC,KAAM,WAETL,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,8CAC5BC,QAAS,8BACTC,KAAM,YAETL,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,6CAC5BC,QAAS,6BACTE,QAxBD,CAAC,QAAS,QAAQC,QAAO,SAACC,EAAGzB,GAGhC,OAFAyB,EAAEzB,GAAOa,IAAIM,WAAWC,MAAf,gCAAqDpB,EAArD,UAEFyB,IACR,IAqBKH,KAAM","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","module.exports = flarum.core.compat['app'];","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport app from 'flarum/app';\n\nfunction typeOptions() {\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\napp.initializers.add('ianm-synopsis', () => {\n app.extensionData\n .for('ianm-synopsis')\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-label'),\n setting: 'ianm-synopsis.excerpt_length',\n type: 'number',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts'),\n setting: 'ianm-synopsis.rich-excerpts',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type'),\n setting: 'ianm-synopsis.excerpt-type',\n options: typeOptions(),\n type: 'select',\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/external \"flarum.core.compat['common/app']\"","webpack://@ianm/synopsis/./src/admin/index.js"],"names":["enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","exports","flarum","core","compat","app","initializers","add","extensionData","registerSetting","label","translator","trans","setting","type","options","reduce","o"],"mappings":"2BACA,SAGA,cAGA,QACA,oBAGA,YACA,IACA,KACA,YAUA,OANA,mCAGA,OAGA,UA0DA,OArDA,MAGA,MAGA,oBACA,UACA,2BAA2CA,YAAY,EAAMC,IAAKC,KAKlE,gBACA,gDACA,4CAAyDC,MAAO,WAEhE,sCAAkDA,OAAO,KAQzD,kBAEA,GADA,cACA,aACA,qDACA,0BAGA,GAFA,OACA,mCAA0CH,YAAY,EAAMG,MAAOA,IACnE,2DAAiH,OAAOA,EAAMC,IAAQC,KAAK,KAAMD,IACjJ,UAIA,gBACA,sBACA,WAA4B,OAAOE,EAAgB,SACnD,WAAkC,OAAOA,GAEzC,OADA,aACA,GAIA,kBAAuD,OAAOC,OAAOC,UAAUC,eAAeC,KAAKC,EAAQC,IAG3G,OAIA,U,kBClFAN,EAAOO,QAAUC,OAAOC,KAAKC,OAAO,e,2DCwBpCC,IAAIC,aAAaC,IAAI,iBAAiB,WAClCF,IAAIG,cAAJ,IACS,iBACJC,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,8CAC5BC,QAAS,+BACTC,KAAM,WAETL,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,8CAC5BC,QAAS,8BACTC,KAAM,YAETL,gBAAgB,CACbC,MAAOL,IAAIM,WAAWC,MAAM,6CAC5BC,QAAS,6BACTE,QAxBD,CAAC,QAAS,QAAQC,QAAO,SAACC,EAAGzB,GAGhC,OAFAyB,EAAEzB,GAAOa,IAAIM,WAAWC,MAAf,gCAAqDpB,EAArD,UAEFyB,IACR,IAqBKH,KAAM","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","module.exports = flarum.core.compat['common/app'];","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport app from 'flarum/common/app';\n\nfunction typeOptions() {\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\napp.initializers.add('ianm-synopsis', () => {\n app.extensionData\n .for('ianm-synopsis')\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-label'),\n setting: 'ianm-synopsis.excerpt_length',\n type: 'number',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.rich-excerpts'),\n setting: 'ianm-synopsis.rich-excerpts',\n type: 'boolean',\n })\n .registerSetting({\n label: app.translator.trans('ianm-synopsis.admin.settings.excerpt-type'),\n setting: 'ianm-synopsis.excerpt-type',\n options: typeOptions(),\n type: 'select',\n });\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index bd05486..150e0fd 100755 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(e){var s={};function t(n){if(s[n])return s[n].exports;var o=s[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=s,t.d=function(e,s,n){t.o(e,s)||Object.defineProperty(e,s,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,s){if(1&s&&(e=t(e)),8&s)return e;if(4&s&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&s&&"string"!=typeof e)for(var o in e)t.d(n,o,function(s){return e[s]}.bind(null,o));return n},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,s){return Object.prototype.hasOwnProperty.call(e,s)},t.p="",t(t.s=10)}([function(e,s){e.exports=flarum.core.compat.app},function(e,s){e.exports=flarum.core.compat.extend},function(e,s){e.exports=flarum.core.compat["components/SettingsPage"]},function(e,s){e.exports=flarum.core.compat["utils/string"]},function(e,s){e.exports=flarum.core.compat["components/Switch"]},function(e,s){e.exports=flarum.core.compat["utils/Stream"]},function(e,s){e.exports=flarum.core.compat["states/DiscussionListState"]},function(e,s){e.exports=flarum.core.compat["components/DiscussionListItem"]},function(e,s){e.exports=flarum.core.compat["components/FieldSet"]},function(e,s){e.exports=flarum.core.compat["utils/ItemList"]},function(e,s,t){"use strict";t.r(s);var n=t(0),o=t.n(n),r=t(1),i=t(6),a=t.n(i),p=t(7),c=t.n(p),u=t(3);var f=t(2),l=t.n(f),d=t(8),y=t.n(d),x=t(9),h=t.n(x),b=t(4),S=t.n(b),g=t(5),w=t.n(g);o.a.initializers.add("ianm-synopsis",(function(){Object(r.extend)(a.a.prototype,"requestParams",(function(e){e.include.push(["firstPost","lastPost"])})),Object(r.extend)(c.a.prototype,"infoItems",(function(e){var s=this.attrs.discussion;if(!o.a.session.user||o.a.session.user.preferences().showSynopsisExcerpts){var t="first"===o.a.forum.attribute("synopsis.excerpt_type")?s.firstPost():s.lastPost(),n=o.a.forum.attribute("synopsis.excerpt_length"),r=o.a.forum.attribute("synopsis.rich_excerpts"),i=!!o.a.session.user&&o.a.session.user.preferences().showSynopsisExcerptsOnMobile;if(t){var a=m("div",null,r?m.trust(Object(u.truncate)(t.contentHtml(),n)):Object(u.truncate)(t.contentPlain(),n));e.add(i?"excerptM":"excerpt",a,-100)}}})),Object(r.extend)(l.a.prototype,"oninit",(function(){this.showSynopsisExcerpts=w()(this.user.preferences().showSynopsisExcerpts),this.showSynopsisExcerptsOnMobile=w()(this.user.preferences().showSynopsisExcerptsOnMobile)})),Object(r.extend)(l.a.prototype,"settingsItems",(function(e){e.add("synopsis",y.a.component({label:app.translator.trans("ianm-synopsis.forum.user.settings.summaries-heading"),className:"Settings-Synopsis"},this.summariesItems().toArray()))})),l.a.prototype.summariesItems=function(){var e=this,s=new h.a;return s.add("synopsis-excerpts",S.a.component({state:this.user.preferences().showSynopsisExcerpts,onchange:function(s){e.showSynopsisExcerptsLoading=!0,e.user.savePreferences({showSynopsisExcerpts:s}).then((function(){e.showSynopsisExcerptsLoading=!1,m.redraw()}))},loading:this.showSynopsisExcerptsLoading},app.translator.trans("ianm-synopsis.forum.user.settings.show-summaries"))),this.user.preferences().showSynopsisExcerpts&&s.add("synopsis-excerpts-mobile",S.a.component({state:this.user.preferences().showSynopsisExcerptsOnMobile,disabled:!this.user.preferences().showSynopsisExcerpts,onchange:function(s){e.showSynopsisExcerptsOnMobileLoading=!0,e.user.savePreferences({showSynopsisExcerptsOnMobile:s}).then((function(){e.showSynopsisExcerptsOnMobileLoading=!1,window.location.reload()}))},loading:this.showSynopsisExcerptsOnMobileLoading},app.translator.trans("ianm-synopsis.forum.user.settings.show-summaries-mobile"))),s}}))}]); +module.exports=function(e){var s={};function t(o){if(s[o])return s[o].exports;var n=s[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=s,t.d=function(e,s,o){t.o(e,s)||Object.defineProperty(e,s,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,s){if(1&s&&(e=t(e)),8&s)return e;if(4&s&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&s&&"string"!=typeof e)for(var n in e)t.d(o,n,function(s){return e[s]}.bind(null,n));return o},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,s){return Object.prototype.hasOwnProperty.call(e,s)},t.p="",t(t.s=10)}([function(e,s){e.exports=flarum.core.compat["common/app"]},function(e,s){e.exports=flarum.core.compat["common/extend"]},function(e,s){e.exports=flarum.core.compat["common/components/SettingsPage"]},function(e,s){e.exports=flarum.core.compat["common/utils/string"]},function(e,s){e.exports=flarum.core.compat["common/components/Switch"]},function(e,s){e.exports=flarum.core.compat["common/utils/Stream"]},function(e,s){e.exports=flarum.core.compat["common/states/DiscussionListState"]},function(e,s){e.exports=flarum.core.compat["common/components/DiscussionListItem"]},function(e,s){e.exports=flarum.core.compat["common/components/FieldSet"]},function(e,s){e.exports=flarum.core.compat["common/utils/ItemList"]},function(e,s,t){"use strict";t.r(s);var o=t(0),n=t.n(o),r=t(1),i=t(6),c=t.n(i),a=t(7),p=t.n(a),u=t(3);var f=t(2),l=t.n(f),d=t(8),y=t.n(d),x=t(9),h=t.n(x),b=t(4),S=t.n(b),g=t(5),w=t.n(g);n.a.initializers.add("ianm-synopsis",(function(){Object(r.extend)(c.a.prototype,"requestParams",(function(e){e.include.push(["firstPost","lastPost"])})),Object(r.extend)(p.a.prototype,"infoItems",(function(e){var s=this.attrs.discussion;if(!n.a.session.user||n.a.session.user.preferences().showSynopsisExcerpts){var t="first"===n.a.forum.attribute("synopsis.excerpt_type")?s.firstPost():s.lastPost(),o=n.a.forum.attribute("synopsis.excerpt_length"),r=n.a.forum.attribute("synopsis.rich_excerpts"),i=!!n.a.session.user&&n.a.session.user.preferences().showSynopsisExcerptsOnMobile;if(t){var c=m("div",null,r?m.trust(Object(u.truncate)(t.contentHtml(),o)):Object(u.truncate)(t.contentPlain(),o));e.add(i?"excerptM":"excerpt",c,-100)}}})),Object(r.extend)(l.a.prototype,"oninit",(function(){this.showSynopsisExcerpts=w()(this.user.preferences().showSynopsisExcerpts),this.showSynopsisExcerptsOnMobile=w()(this.user.preferences().showSynopsisExcerptsOnMobile)})),Object(r.extend)(l.a.prototype,"settingsItems",(function(e){e.add("synopsis",y.a.component({label:app.translator.trans("ianm-synopsis.forum.user.settings.summaries-heading"),className:"Settings-Synopsis"},this.summariesItems().toArray()))})),l.a.prototype.summariesItems=function(){var e=this,s=new h.a;return s.add("synopsis-excerpts",S.a.component({state:this.user.preferences().showSynopsisExcerpts,onchange:function(s){e.showSynopsisExcerptsLoading=!0,e.user.savePreferences({showSynopsisExcerpts:s}).then((function(){e.showSynopsisExcerptsLoading=!1,m.redraw()}))},loading:this.showSynopsisExcerptsLoading},app.translator.trans("ianm-synopsis.forum.user.settings.show-summaries"))),this.user.preferences().showSynopsisExcerpts&&s.add("synopsis-excerpts-mobile",S.a.component({state:this.user.preferences().showSynopsisExcerptsOnMobile,disabled:!this.user.preferences().showSynopsisExcerpts,onchange:function(s){e.showSynopsisExcerptsOnMobileLoading=!0,e.user.savePreferences({showSynopsisExcerptsOnMobile:s}).then((function(){e.showSynopsisExcerptsOnMobileLoading=!1,window.location.reload()}))},loading:this.showSynopsisExcerptsOnMobileLoading},app.translator.trans("ianm-synopsis.forum.user.settings.show-summaries-mobile"))),s}}))}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index ac9601c..35633c4 100755 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/external \"flarum.core.compat['app']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['extend']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['components/SettingsPage']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['utils/string']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['components/Switch']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['utils/Stream']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['states/DiscussionListState']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['components/FieldSet']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['utils/ItemList']\"","webpack://@ianm/synopsis/./src/forum/index.js","webpack://@ianm/synopsis/./src/forum/addSummaryExcerpt.js","webpack://@ianm/synopsis/./src/forum/addUserPreference.js"],"names":["enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","exports","flarum","core","compat","app","initializers","add","extend","DiscussionListState","params","include","push","DiscussionListItem","items","discussion","this","attrs","session","user","preferences","showSynopsisExcerpts","excerptPost","forum","attribute","firstPost","lastPost","excerptLength","richExcerpt","onMobile","showSynopsisExcerptsOnMobile","excerpt","m","trust","truncate","contentHtml","contentPlain","SettingsPage","Stream","FieldSet","component","label","translator","trans","className","summariesItems","toArray","ItemList","Switch","state","onchange","showSynopsisExcerptsLoading","savePreferences","then","redraw","loading","disabled","showSynopsisExcerptsOnMobileLoading","window","location","reload"],"mappings":"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","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/SettingsPage'];","module.exports = flarum.core.compat['utils/string'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['utils/Stream'];","module.exports = flarum.core.compat['states/DiscussionListState'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['components/FieldSet'];","module.exports = flarum.core.compat['utils/ItemList'];","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport app from 'flarum/app';\n\nimport addSummaryExcerpt from './addSummaryExcerpt';\nimport addUserPreference from './addUserPreference';\n\napp.initializers.add('ianm-synopsis', () => {\n addSummaryExcerpt();\n addUserPreference();\n});\n","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport { truncate } from 'flarum/utils/string';\n\nexport default function addSummaryExcerpt() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push(['firstPost', 'lastPost']);\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (app.session.user && !app.session.user.preferences().showSynopsisExcerpts) {\n return;\n }\n\n const excerptPost = app.forum.attribute('synopsis.excerpt_type') === 'first' ? discussion.firstPost() : discussion.lastPost();\n const excerptLength = app.forum.attribute('synopsis.excerpt_length');\n const richExcerpt = app.forum.attribute('synopsis.rich_excerpts');\n const onMobile = app.session.user ? app.session.user.preferences().showSynopsisExcerptsOnMobile : false;\n\n if (excerptPost) {\n const excerpt = (\n
\n {richExcerpt ? m.trust(truncate(excerptPost.contentHtml(), excerptLength)) : truncate(excerptPost.contentPlain(), excerptLength)}\n
\n );\n\n items.add(onMobile ? 'excerptM' : 'excerpt', excerpt, -100);\n }\n });\n}\n","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { extend } from 'flarum/extend';\nimport SettingsPage from 'flarum/components/SettingsPage';\nimport FieldSet from 'flarum/components/FieldSet';\nimport ItemList from 'flarum/utils/ItemList';\nimport Switch from 'flarum/components/Switch';\nimport Stream from 'flarum/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) {\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"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@ianm/synopsis/webpack/bootstrap","webpack://@ianm/synopsis/external \"flarum.core.compat['common/app']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/extend']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/components/SettingsPage']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/utils/string']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/components/Switch']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/states/DiscussionListState']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/components/DiscussionListItem']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/components/FieldSet']\"","webpack://@ianm/synopsis/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@ianm/synopsis/./src/forum/index.js","webpack://@ianm/synopsis/./src/forum/addSummaryExcerpt.js","webpack://@ianm/synopsis/./src/forum/addUserPreference.js"],"names":["enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","exports","flarum","core","compat","app","initializers","add","extend","DiscussionListState","params","include","push","DiscussionListItem","items","discussion","this","attrs","session","user","preferences","showSynopsisExcerpts","excerptPost","forum","attribute","firstPost","lastPost","excerptLength","richExcerpt","onMobile","showSynopsisExcerptsOnMobile","excerpt","m","trust","truncate","contentHtml","contentPlain","SettingsPage","Stream","FieldSet","component","label","translator","trans","className","summariesItems","toArray","ItemList","Switch","state","onchange","showSynopsisExcerptsLoading","savePreferences","then","redraw","loading","disabled","showSynopsisExcerptsOnMobileLoading","window","location","reload"],"mappings":"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","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = flarum.core.compat['common/app'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/components/SettingsPage'];","module.exports = flarum.core.compat['common/utils/string'];","module.exports = flarum.core.compat['common/components/Switch'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/states/DiscussionListState'];","module.exports = flarum.core.compat['common/components/DiscussionListItem'];","module.exports = flarum.core.compat['common/components/FieldSet'];","module.exports = flarum.core.compat['common/utils/ItemList'];","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport app from 'flarum/common/app';\n\nimport addSummaryExcerpt from './addSummaryExcerpt';\nimport addUserPreference from './addUserPreference';\n\napp.initializers.add('ianm-synopsis', () => {\n addSummaryExcerpt();\n addUserPreference();\n});\n","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { extend } from 'flarum/common/extend';\nimport app from 'flarum/common/app';\nimport DiscussionListState from 'flarum/common/states/DiscussionListState';\nimport DiscussionListItem from 'flarum/common/components/DiscussionListItem';\nimport { truncate } from 'flarum/common/utils/string';\n\nexport default function addSummaryExcerpt() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push(['firstPost', 'lastPost']);\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (app.session.user && !app.session.user.preferences().showSynopsisExcerpts) {\n return;\n }\n\n const excerptPost = app.forum.attribute('synopsis.excerpt_type') === 'first' ? discussion.firstPost() : discussion.lastPost();\n const excerptLength = app.forum.attribute('synopsis.excerpt_length');\n const richExcerpt = app.forum.attribute('synopsis.rich_excerpts');\n const onMobile = app.session.user ? app.session.user.preferences().showSynopsisExcerptsOnMobile : false;\n\n if (excerptPost) {\n const excerpt = (\n
\n {richExcerpt ? m.trust(truncate(excerptPost.contentHtml(), excerptLength)) : truncate(excerptPost.contentPlain(), excerptLength)}\n
\n );\n\n items.add(onMobile ? 'excerptM' : 'excerpt', excerpt, -100);\n }\n });\n}\n","/* This is part of the ianm/synopsis project.\n\n * Additional modifications (c)2020 Ian Morland\n *\n * Modified code (c)2019 Jordan Schnaidt\n *\n * Original code (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/common/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) {\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"],"sourceRoot":""} \ No newline at end of file