diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 7a4740e..84e19a6 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@askvortsov/flarum-categories/webpack/bootstrap","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/extend']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['admin/components/BasicsPage']\"","webpack://@askvortsov/flarum-categories/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","app","initializers","add","extensionData","registerSetting","class","translator","trans","setting","label","type","help","extend","BasicsPage","items","path"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB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ACTC,MAAOT,IAAIM,WAAWC,MAAM,0DAC5BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,2DAC9EH,gBAAgB,CACfI,QAAS,2CACTC,MAAOT,IAAIM,WAAWC,MAAM,yDAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,kDACTC,MAAOT,IAAIM,WAAWC,MAAM,gEAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,4CACTC,MAAOT,IAAIM,WAAWC,MAAM,0DAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,sDACTC,MAAOT,IAAIM,WAAWC,MAAM,oEAC5BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,0DAC9EH,gBAAgB,CACfI,QAAS,wCACTC,MAAOT,IAAIM,WAAWC,MAAM,sDAC5BI,KAAMX,IAAIM,WAAWC,MAAM,oDAC3BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,wDAC9EH,gBAAgB,CACfI,QAAS,8CACTC,MAAOT,IAAIM,WAAWC,MAAM,4DAC5BG,KAAM,WAGVE,iBAAOC,IAAWpB,UAAW,iBAAiB,SAACqB,GAC7CA,EAAMZ,IAAI,aAAc,CACtBa,KAAM,cACNN,MAAOT,IAAIM,WAAWC,MAAM","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 = 22);\n","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['admin/components/BasicsPage'];","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\n\napp.initializers.add('askvortsov/flarum-categories', () => {\n app.extensionData\n .for('askvortsov-categories')\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.nav')}, 10)\n .registerSetting(\n {\n setting: 'askvortsov-categories.keep-tags-nav',\n label: app.translator.trans('askvortsov-categories.admin.labels.keep_tags_nav'),\n type: 'switch',\n },\n 9\n )\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.layout')})\n .registerSetting({\n setting: 'askvortsov-categories.full-page-desktop',\n label: app.translator.trans('askvortsov-categories.admin.labels.full_page_desktop'),\n help: app.translator.trans('askvortsov-categories.admin.help.full_page_desktop'),\n type: 'switch',\n })\n .registerSetting({\n setting: 'askvortsov-categories.compact-mobile',\n label: app.translator.trans('askvortsov-categories.admin.labels.compact_mobile_mode'),\n type: 'switch',\n })\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.parent_display')})\n .registerSetting({\n setting: 'askvortsov-categories.parent-remove-icon',\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_icon'),\n type: 'switch',\n })\n .registerSetting({\n setting: 'askvortsov-categories.parent-remove-description',\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_description'),\n type: 'switch',\n })\n .registerSetting({\n setting: 'askvortsov-categories.parent-remove-stats',\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_stats'),\n type: 'switch',\n })\n .registerSetting({\n setting: 'askvortsov-categories.parent-remove-last-discussion',\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_last_discussion'),\n type: 'switch',\n })\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.child_display')})\n .registerSetting({\n setting: 'askvortsov-categories.child-bare-icon',\n label: app.translator.trans('askvortsov-categories.admin.labels.child_bare_icon'),\n help: app.translator.trans('askvortsov-categories.admin.help.child_bare_icon'),\n type: 'switch',\n })\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.performance')})\n .registerSetting({\n setting: 'askvortsov-categories.small-forum-optimized',\n label: app.translator.trans('askvortsov-categories.admin.labels.small_forum_optimized'),\n type: 'switch',\n });\n\n extend(BasicsPage.prototype, 'homePageItems', (items) => {\n items.add('categories', {\n path: '/categories',\n label: app.translator.trans('askvortsov-categories.admin.basics.categories_label'),\n });\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@askvortsov/flarum-categories/webpack/bootstrap","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/extend']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['admin/components/BasicsPage']\"","webpack://@askvortsov/flarum-categories/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","app","initializers","add","extensionData","registerSetting","class","translator","trans","setting","label","type","help","extend","BasicsPage","items","path"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EA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AM,oDAC5BG,KAAM,UAER,GAEDN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,mDAC9EH,gBAAgB,CACfI,QAAS,0CACTC,MAAOT,IAAIM,WAAWC,MAAM,wDAC5BI,KAAMX,IAAIM,WAAWC,MAAM,sDAC3BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,uCACTC,MAAOT,IAAIM,WAAWC,MAAM,0DAC5BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,2DAC9EH,gBAAgB,CACfI,QAAS,2CACTC,MAAOT,IAAIM,WAAWC,MAAM,yDAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,kDACTC,MAAOT,IAAIM,WAAWC,MAAM,gEAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,4CACTC,MAAOT,IAAIM,WAAWC,MAAM,0DAC5BG,KAAM,WAEPN,gBAAgB,CACfI,QAAS,sDACTC,MAAOT,IAAIM,WAAWC,MAAM,oEAC5BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,0DAC9EH,gBAAgB,CACfI,QAAS,wCACTC,MAAOT,IAAIM,WAAWC,MAAM,sDAC5BI,KAAMX,IAAIM,WAAWC,MAAM,oDAC3BG,KAAM,WAEPN,iBAAgB,kBAAM,YAAQC,MAAM,qBAAqBL,IAAIM,WAAWC,MAAM,wDAC9EH,gBAAgB,CACfI,QAAS,8CACTC,MAAOT,IAAIM,WAAWC,MAAM,4DAC5BG,KAAM,WAGVE,iBAAOC,IAAWpB,UAAW,iBAAiB,SAACqB,GAC7CA,EAAMZ,IAAI,aAAc,CACtBa,KAAM,cACNN,MAAOT,IAAIM,WAAWC,MAAM","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 = 22);\n","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['admin/components/BasicsPage'];","import { extend } from 'flarum/common/extend';\r\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\r\n\r\napp.initializers.add('askvortsov/flarum-categories', () => {\r\n app.extensionData\r\n .for('askvortsov-categories')\r\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.nav')}, 10)\r\n .registerSetting(\r\n {\r\n setting: 'askvortsov-categories.keep-tags-nav',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.keep_tags_nav'),\r\n type: 'switch',\r\n },\r\n 9\r\n )\r\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.layout')})\r\n .registerSetting({\r\n setting: 'askvortsov-categories.full-page-desktop',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.full_page_desktop'),\r\n help: app.translator.trans('askvortsov-categories.admin.help.full_page_desktop'),\r\n type: 'switch',\r\n })\r\n .registerSetting({\r\n setting: 'askvortsov-categories.compact-mobile',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.compact_mobile_mode'),\r\n type: 'switch',\r\n })\r\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.parent_display')})\r\n .registerSetting({\r\n setting: 'askvortsov-categories.parent-remove-icon',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_icon'),\r\n type: 'switch',\r\n })\r\n .registerSetting({\r\n setting: 'askvortsov-categories.parent-remove-description',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_description'),\r\n type: 'switch',\r\n })\r\n .registerSetting({\r\n setting: 'askvortsov-categories.parent-remove-stats',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_stats'),\r\n type: 'switch',\r\n })\r\n .registerSetting({\r\n setting: 'askvortsov-categories.parent-remove-last-discussion',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.parent_remove_last_discussion'),\r\n type: 'switch',\r\n })\r\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.child_display')})\r\n .registerSetting({\r\n setting: 'askvortsov-categories.child-bare-icon',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.child_bare_icon'),\r\n help: app.translator.trans('askvortsov-categories.admin.help.child_bare_icon'),\r\n type: 'switch',\r\n })\r\n .registerSetting(() => {app.translator.trans('askvortsov-categories.admin.headings.performance')})\r\n .registerSetting({\r\n setting: 'askvortsov-categories.small-forum-optimized',\r\n label: app.translator.trans('askvortsov-categories.admin.labels.small_forum_optimized'),\r\n type: 'switch',\r\n });\r\n\r\n extend(BasicsPage.prototype, 'homePageItems', (items) => {\r\n items.add('categories', {\r\n path: '/categories',\r\n label: app.translator.trans('askvortsov-categories.admin.basics.categories_label'),\r\n });\r\n });\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 3b4293c..5eb1d51 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var a={};function o(e){if(a[e])return a[e].exports;var s=a[e]={i:e,l:!1,exports:{}};return t[e].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=t,o.c=a,o.d=function(t,a,e){o.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,a){if(1&a&&(t=o(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var s in t)o.d(e,s,function(a){return t[a]}.bind(null,s));return e},o.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(a,"a",a),a},o.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},o.p="",o(o.s=21)}([function(t,a){t.exports=flarum.core.compat["common/extend"]},function(t,a){t.exports=flarum.core.compat["common/Component"]},function(t,a){t.exports=flarum.core.compat["forum/components/IndexPage"]},function(t,a){t.exports=flarum.core.compat["common/components/Link"]},function(t,a){t.exports=flarum.core.compat["common/helpers/icon"]},function(t,a){t.exports=flarum.core.compat["tags/utils/sortTags"]},function(t,a){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,a){t.exports=flarum.core.compat["common/components/LinkButton"]},function(t,a){t.exports=flarum.core.compat["common/Model"]},function(t,a){t.exports=flarum.core.compat["tags/models/Tag"]},function(t,a){t.exports=flarum.core.compat["common/components/Page"]},function(t,a){t.exports=flarum.core.compat["common/components/LoadingIndicator"]},function(t,a){t.exports=flarum.core.compat["forum/components/AffixedSidebar"]},function(t,a){t.exports=flarum.core.compat["common/helpers/listItems"]},function(t,a){t.exports=flarum.core.compat["tags/helpers/tagLabel"]},function(t,a){t.exports=flarum.core.compat["common/helpers/avatar"]},function(t,a){t.exports=flarum.core.compat["common/helpers/username"]},function(t,a){t.exports=flarum.core.compat["common/helpers/humanTime"]},function(t,a){t.exports=flarum.core.compat["common/utils/string"]},function(t,a){t.exports=flarum.core.compat["forum/components/UserCard"]},,function(t,a,o){"use strict";o.r(a);var e=o(0),s=o(2),r=o.n(s),n=o(7),i=o.n(n),c=o(8),u=o.n(c),l=o(9),p=o.n(l);function d(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}var f=o(10),g=o.n(f),h=o(11),v=o.n(h),C=o(12),y=o.n(C),b=o(13),T=o.n(b),x=o(5),w=o.n(x),k=o(14),D=o.n(k),P=o(1),L=o.n(P),_=o(3),I=o.n(_),N=o(4),M=o.n(N),S=o(6),A=o.n(S),j=function(t){function a(){return t.apply(this,arguments)||this}return d(a,t),a.prototype.view=function(){var t=app.forum.attribute("categories.compactMobile")&&window.innerWidth<767;return m("div",{class:"StatWidget"},m("div",{class:"StatWidget-count"},this.attrs.count),m("div",{class:"StatWidget-label"},t?M()(this.attrs.icon):this.attrs.label))},a}(L.a),O=o(15),U=o.n(O),B=o(16),R=o.n(B),W=o(17),V=o.n(W),z=o(18),E=o(19),q=o.n(E),F=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.cardVisible=!1},o.view=function(){var t=this.attrs.discussion;if(!t)return m("div",{class:"LastDiscussion"},app.translator.trans("askvortsov-categories.forum.last_discussion_widget.no_discussions"));var a=t.lastPostedUser(),o="";return a&&this.cardVisible&&(o=q.a.component({user:a,className:"UserCard--popover",controlsButtonClassName:"Button Button--icon Button--flat"})),m(I.a,{class:"LastDiscussion",href:app.route.discussion(t)},m(I.a,{className:"LastDiscussion-avatar",href:a?app.route.user(a):"#"},U()(a)),m("div",{class:"LastDiscussion-content"},m("div",{class:"LastDiscussion-bottomRow"},V()(t.lastPostedAt())," ",m(I.a,{className:"LastDiscussion-usernameLink",href:a?app.route.user(a):"#"}," ","| ",R()(a))),m("div",{class:"LastDiscussion-topRow"},Object(z.truncate)(t.title(),26))),m("div",{class:"LastDiscussion-userCardContainer"},o))},o.oncreate=function(a){var o,e=this;t.prototype.oncreate.call(this,a),this.$().on("mouseover",".LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard",(function(){clearTimeout(o),o=setTimeout(e.showCard.bind(e),300)})).on("mouseout",".LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard",(function(){clearTimeout(o),o=setTimeout(e.hideCard.bind(e),150)}))},o.showCard=function(){var t=this;this.cardVisible=!0,m.redraw(),setTimeout((function(){return t.$(".UserCard").addClass("in")}))},o.hideCard=function(){$(".UserCard").removeClass("in"),this.cardVisible=!1,m.redraw()},a}(L.a),G=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.tag=this.attrs.model,this.isChild=null!=this.attrs.parent&&null!=this.attrs.parent,this.collapsed=!1,window.addEventListener("resize",(function(){m.redraw()}))},o.view=function(){var t=this,o=this.tag;if(!o)return"";this.compactMobileMode=window.innerWidth<=767&&app.forum.attribute("categories.compactMobile");var e=this.isChild?[]:w()(o.children()||[]),s=this.isChild?{}:{backgroundColor:o.color()},r=["TagCategory","TagCategory-"+o.slug()];this.isChild?r.push("SubCategory"):r.push("ParentCategory"),this.compactMobileMode&&r.push("compactMobile");var n=(o.lastPostedDiscussion()?["TagCategory-lastDiscussion"]:["TagCategory-lastDiscussion empty"]).join(" "),i=!this.isChild&&this.compactMobileMode,c=m("ol",{className:"TagCategory-subTagList"},e.map((function(o){return[a.component({model:o,parent:t})]})));return m("li",{class:r.join(" ")},m(I.a,{class:"TagCategory-content TagCategory-content-"+o.slug(),style:s,href:app.route.tag(o)},m("div",{class:"TagCategory-alignStart"},m("div",{class:"TagCategory-alignStart-main"},m("span",{class:"TagCategory-icon"},this.iconItems().toArray()),m("div",{class:"TagCategory-main"},this.mainItems().toArray())),0==e.length?"":m("p",{class:"TagCategory-toggleArrow",onclick:function(a){t.toggleArrow(a)}},M()(this.collapsed?"fas fa-caret-down":"fas fa-caret-up"))),m("div",{class:"TagCategory-alignEnd"},m("div",{class:"TagCategory-stats StatWidgetList"},this.statItems().toArray()),m("div",{class:n},this.lastDiscussionItems().toArray())),i&&!this.collapsed?c:""),i||this.isChild?"":c)},o.iconItems=function(){var t=new A.a;if(this.tag.icon()&&this.isChild){var a={},o="fa-stack-1x CategoryIcon";app.forum.attribute("categories.childBareIcon")&&(a.color=this.tag.color(),o+=" NoBackgroundCategoryIcon");var e=this.compactMobileMode?"fa-stack fa-1x":"fa-stack fa-2x";t.add("icon",m("span",{class:e},app.forum.attribute("categories.childBareIcon")?"":m("i",{class:"fa fa-circle fa-stack-2x icon-background",style:{color:this.tag.color()}}),M()(this.tag.icon(),{className:o,style:a})),10)}else if(this.tag.icon()&&!app.forum.attribute("categories.parentRemoveIcon")){var s=this.compactMobileMode?"fa-stack fa-2x":"fa-stack fa-3x";t.add("icon",m("span",{class:s},M()(this.tag.icon(),{className:"fa-stack-1x CategoryIcon"})),10)}return t},o.mainItems=function(){var t=new A.a;return t.add("name",m("h4",{class:"TagCategory-name"},this.tag.name()),15),!this.tag.description()||!this.isChild&&app.forum.attribute("categories.parentRemoveDescription")||t.add("description",m("div",{class:"TagCategory-description"},this.tag.description()),10),t},o.statItems=function(){var t=new A.a;return!this.isChild&&app.forum.attribute("categories.parentRemoveStats")||(t.add("discussionCount",j.component({count:this.tag.discussionCount(),label:app.translator.trans("askvortsov-categories.forum.stat-widgets.discussion_label"),icon:"fas fa-file-alt"}),15),t.add("postCount",j.component({count:this.tag.postCount(),label:app.translator.trans("askvortsov-categories.forum.stat-widgets.post_label"),icon:"fas fa-comment"}),10)),t},o.lastDiscussionItems=function(){var t=new A.a;return!this.isChild&&app.forum.attribute("categories.parentRemoveLastDiscussion")||t.add("lastDiscussion",F.component({discussion:this.tag.lastPostedDiscussion()}),10),t},o.oncreate=function(a){t.prototype.oncreate.call(this,a),this.$(".TagCategory-content,.TagCategory-toggleArrow").bind("mouseenter",(function(t){$(this).addClass("hover"),($(this).parent().hasClass("SubCategory")||$(this).hasClass("TagCategory-toggleArrow"))&&$(this).closest(".ParentCategory").children(".TagCategory-content").removeClass("hover")})),this.$(".TagCategory-content,.TagCategory-toggleArrow").bind("mouseleave",(function(t){$(this).removeClass("hover"),($(this).parent().hasClass("SubCategory")||$(this).hasClass("TagCategory-toggleArrow"))&&$(this).closest(".ParentCategory").children(".TagCategory-content").addClass("hover")}))},o.toggleArrow=function(t){t.preventDefault(),t.stopPropagation(),this.collapsed=!this.collapsed,m.redraw()},a}(L.a),H=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){var o=this;t.prototype.oninit.call(this,a),app.history.push("categories",app.translator.trans("askvortsov-category.forum.header.back_to_categories_tooltip")),this.tags=[];var e=app.preloadedApiDocument();e?this.tags=w()(e.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","lastPostedDiscussion.lastPostedUser"]).then((function(){o.tags=w()(app.store.all("tags").filter((function(t){return!t.isChild()}))),o.loading=!1,m.redraw()})))},o.view=function(){if(this.loading)return m(v.a,null);var t=this.tags.filter((function(t){return null!==t.position()})),a=this.tags.filter((function(t){return null===t.position()})),o=app.forum.attribute("categories.fullPageDesktop")?["CategoriesPage","TagsPage"]:["CategoriesPage"];return m("div",{className:o.join(" ")},r.a.prototype.hero(),m("div",{className:"container"},m("div",{className:app.forum.attribute("categories.fullPageDesktop")?"":"sideNavContainer"},m(y.a,null,m("nav",{className:"CategoriesPage-nav TagsPage-nav IndexPage-nav sideNav"},m("ul",null,T()(r.a.prototype.sidebarItems().toArray())))),m("div",{className:"CategoriesPage-content sideNavOffset"},m("ol",{className:"TagCategoryList"},t.map((function(t){return G.component({model:t})}))),a.length?m("div",{className:"TagCloud"},a.map((function(t){return[D()(t,{link:!0})," "]}))):""))))},o.oncreate=function(a){t.prototype.oncreate.call(this,a),app.setTitle(app.translator.trans("askvortsov-categories.forum.all_categories.meta_title_text"))},a}(g.a);app.initializers.add("askvortsov/flarum-categories",(function(){app.routes.categories={path:"/categories",component:H},p.a.prototype.postCount=u.a.attribute("postCount"),Object(e.extend)(r.a.prototype,"navItems",(function(t){return t.has("tags")&&!app.forum.attribute("categories.keepTagsNav")&&t.remove("tags"),t.add("categories",m(i.a,{icon:"fas fa-th-list",href:app.route("categories")},app.translator.trans("askvortsov-categories.forum.index.categories_link")),-9.5),t.has("moreTags")&&t.replace("moreTags",m(i.a,{href:app.route("categories")},app.translator.trans("flarum-tags.forum.index.more_link"))),t})),Object(e.extend)(r.a.prototype,"sidebarItems",(function(t){if(app.current.matches(H)&&app.forum.attribute("categories.fullPageDesktop"))for(var a in t.items)"newDiscussion"!==a&&"nav"!==a&&t.remove(a);return t}))}))}]); +module.exports=function(t){var a={};function o(e){if(a[e])return a[e].exports;var s=a[e]={i:e,l:!1,exports:{}};return t[e].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=t,o.c=a,o.d=function(t,a,e){o.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,a){if(1&a&&(t=o(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var s in t)o.d(e,s,function(a){return t[a]}.bind(null,s));return e},o.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(a,"a",a),a},o.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},o.p="",o(o.s=21)}([function(t,a){t.exports=flarum.core.compat["common/extend"]},function(t,a){t.exports=flarum.core.compat["common/Component"]},function(t,a){t.exports=flarum.core.compat["forum/components/IndexPage"]},function(t,a){t.exports=flarum.core.compat["common/components/Link"]},function(t,a){t.exports=flarum.core.compat["common/helpers/icon"]},function(t,a){t.exports=flarum.core.compat["tags/utils/sortTags"]},function(t,a){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,a){t.exports=flarum.core.compat["common/components/LinkButton"]},function(t,a){t.exports=flarum.core.compat["common/Model"]},function(t,a){t.exports=flarum.core.compat["tags/models/Tag"]},function(t,a){t.exports=flarum.core.compat["common/components/Page"]},function(t,a){t.exports=flarum.core.compat["common/components/LoadingIndicator"]},function(t,a){t.exports=flarum.core.compat["forum/components/AffixedSidebar"]},function(t,a){t.exports=flarum.core.compat["common/helpers/listItems"]},function(t,a){t.exports=flarum.core.compat["tags/helpers/tagLabel"]},function(t,a){t.exports=flarum.core.compat["common/helpers/avatar"]},function(t,a){t.exports=flarum.core.compat["common/helpers/username"]},function(t,a){t.exports=flarum.core.compat["common/helpers/humanTime"]},function(t,a){t.exports=flarum.core.compat["common/utils/string"]},function(t,a){t.exports=flarum.core.compat["forum/components/UserCard"]},,function(t,a,o){"use strict";o.r(a);var e=o(0),s=o(2),r=o.n(s),n=o(7),i=o.n(n),c=o(8),u=o.n(c),l=o(9),p=o.n(l);function d(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a}var f=o(10),g=o.n(f),h=o(11),v=o.n(h),C=o(12),y=o.n(C),b=o(13),T=o.n(b),x=o(5),w=o.n(x),k=o(14),D=o.n(k),P=o(1),L=o.n(P),_=o(3),I=o.n(_),N=o(4),M=o.n(N),S=o(6),A=o.n(S),j=function(t){function a(){return t.apply(this,arguments)||this}return d(a,t),a.prototype.view=function(){var t=app.forum.attribute("categories.compactMobile")&&window.innerWidth<767;return m("div",{class:"StatWidget"},m("div",{class:"StatWidget-count"},this.attrs.count),m("div",{class:"StatWidget-label"},t?M()(this.attrs.icon):this.attrs.label))},a}(L.a),O=o(15),U=o.n(O),B=o(16),R=o.n(B),W=o(17),V=o.n(W),z=o(18),E=o(19),q=o.n(E),F=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.cardVisible=!1},o.view=function(){var t=this.attrs.discussion;if(!t)return m("div",{class:"LastDiscussion"},app.translator.trans("askvortsov-categories.forum.last_discussion_widget.no_discussions"));var a=t.lastPostedUser(),o="";return a&&this.cardVisible&&(o=q.a.component({user:a,className:"UserCard--popover",controlsButtonClassName:"Button Button--icon Button--flat"})),m(I.a,{class:"LastDiscussion",href:app.route.discussion(t,t.lastPostNumber())},m(I.a,{className:"LastDiscussion-avatar",href:a?app.route.user(a):"#"},U()(a)),m("div",{class:"LastDiscussion-content"},m("div",{class:"LastDiscussion-bottomRow"},V()(t.lastPostedAt())," ",m(I.a,{className:"LastDiscussion-usernameLink",href:a?app.route.user(a):"#"}," ","| ",R()(a))),m("div",{class:"LastDiscussion-topRow"},Object(z.truncate)(t.title(),26))),m("div",{class:"LastDiscussion-userCardContainer"},o))},o.oncreate=function(a){var o,e=this;t.prototype.oncreate.call(this,a),this.$().on("mouseover",".LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard",(function(){clearTimeout(o),o=setTimeout(e.showCard.bind(e),300)})).on("mouseout",".LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard",(function(){clearTimeout(o),o=setTimeout(e.hideCard.bind(e),150)}))},o.showCard=function(){var t=this;this.cardVisible=!0,m.redraw(),setTimeout((function(){return t.$(".UserCard").addClass("in")}))},o.hideCard=function(){$(".UserCard").removeClass("in"),this.cardVisible=!1,m.redraw()},a}(L.a),G=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.tag=this.attrs.model,this.isChild=null!=this.attrs.parent&&null!=this.attrs.parent,this.collapsed=!1,window.addEventListener("resize",(function(){m.redraw()}))},o.view=function(){var t=this,o=this.tag;if(!o)return"";this.compactMobileMode=window.innerWidth<=767&&app.forum.attribute("categories.compactMobile");var e=this.isChild?[]:w()(o.children()||[]),s=this.isChild?{}:{backgroundColor:o.color()},r=["TagCategory","TagCategory-"+o.slug()];this.isChild?r.push("SubCategory"):r.push("ParentCategory"),this.compactMobileMode&&r.push("compactMobile");var n=(o.lastPostedDiscussion()?["TagCategory-lastDiscussion"]:["TagCategory-lastDiscussion empty"]).join(" "),i=!this.isChild&&this.compactMobileMode,c=m("ol",{className:"TagCategory-subTagList"},e.map((function(o){return[a.component({model:o,parent:t})]})));return m("li",{class:r.join(" ")},m(I.a,{class:"TagCategory-content TagCategory-content-"+o.slug(),style:s,href:app.route.tag(o)},m("div",{class:"TagCategory-alignStart"},m("div",{class:"TagCategory-alignStart-main"},m("span",{class:"TagCategory-icon"},this.iconItems().toArray()),m("div",{class:"TagCategory-main"},this.mainItems().toArray())),0==e.length?"":m("p",{class:"TagCategory-toggleArrow",onclick:function(a){t.toggleArrow(a)}},M()(this.collapsed?"fas fa-caret-down":"fas fa-caret-up"))),m("div",{class:"TagCategory-alignEnd"},m("div",{class:"TagCategory-stats StatWidgetList"},this.statItems().toArray()),m("div",{class:n},this.lastDiscussionItems().toArray())),i&&!this.collapsed?c:""),i||this.isChild?"":c)},o.iconItems=function(){var t=new A.a;if(this.tag.icon()&&this.isChild){var a={},o="fa-stack-1x CategoryIcon";app.forum.attribute("categories.childBareIcon")&&(a.color=this.tag.color(),o+=" NoBackgroundCategoryIcon");var e=this.compactMobileMode?"fa-stack fa-1x":"fa-stack fa-2x";t.add("icon",m("span",{class:e},app.forum.attribute("categories.childBareIcon")?"":m("i",{class:"fa fa-circle fa-stack-2x icon-background",style:{color:this.tag.color()}}),M()(this.tag.icon(),{className:o,style:a})),10)}else if(this.tag.icon()&&!app.forum.attribute("categories.parentRemoveIcon")){var s=this.compactMobileMode?"fa-stack fa-2x":"fa-stack fa-3x";t.add("icon",m("span",{class:s},M()(this.tag.icon(),{className:"fa-stack-1x CategoryIcon"})),10)}return t},o.mainItems=function(){var t=new A.a;return t.add("name",m("h4",{class:"TagCategory-name"},this.tag.name()),15),!this.tag.description()||!this.isChild&&app.forum.attribute("categories.parentRemoveDescription")||t.add("description",m("div",{class:"TagCategory-description"},this.tag.description()),10),t},o.statItems=function(){var t=new A.a;return!this.isChild&&app.forum.attribute("categories.parentRemoveStats")||(t.add("discussionCount",j.component({count:this.tag.discussionCount(),label:app.translator.trans("askvortsov-categories.forum.stat-widgets.discussion_label"),icon:"fas fa-file-alt"}),15),t.add("postCount",j.component({count:this.tag.postCount(),label:app.translator.trans("askvortsov-categories.forum.stat-widgets.post_label"),icon:"fas fa-comment"}),10)),t},o.lastDiscussionItems=function(){var t=new A.a;return!this.isChild&&app.forum.attribute("categories.parentRemoveLastDiscussion")||t.add("lastDiscussion",F.component({discussion:this.tag.lastPostedDiscussion()}),10),t},o.oncreate=function(a){t.prototype.oncreate.call(this,a),this.$(".TagCategory-content,.TagCategory-toggleArrow").bind("mouseenter",(function(t){$(this).addClass("hover"),($(this).parent().hasClass("SubCategory")||$(this).hasClass("TagCategory-toggleArrow"))&&$(this).closest(".ParentCategory").children(".TagCategory-content").removeClass("hover")})),this.$(".TagCategory-content,.TagCategory-toggleArrow").bind("mouseleave",(function(t){$(this).removeClass("hover"),($(this).parent().hasClass("SubCategory")||$(this).hasClass("TagCategory-toggleArrow"))&&$(this).closest(".ParentCategory").children(".TagCategory-content").addClass("hover")}))},o.toggleArrow=function(t){t.preventDefault(),t.stopPropagation(),this.collapsed=!this.collapsed,m.redraw()},a}(L.a),H=function(t){function a(){return t.apply(this,arguments)||this}d(a,t);var o=a.prototype;return o.oninit=function(a){var o=this;t.prototype.oninit.call(this,a),app.history.push("categories",app.translator.trans("askvortsov-category.forum.header.back_to_categories_tooltip")),this.tags=[];var e=app.preloadedApiDocument();e?this.tags=w()(e.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","lastPostedDiscussion.lastPostedUser"]).then((function(){o.tags=w()(app.store.all("tags").filter((function(t){return!t.isChild()}))),o.loading=!1,m.redraw()})))},o.view=function(){if(this.loading)return m(v.a,null);var t=this.tags.filter((function(t){return null!==t.position()})),a=this.tags.filter((function(t){return null===t.position()})),o=app.forum.attribute("categories.fullPageDesktop")?["CategoriesPage","TagsPage"]:["CategoriesPage"];return m("div",{className:o.join(" ")},r.a.prototype.hero(),m("div",{className:"container"},m("div",{className:app.forum.attribute("categories.fullPageDesktop")?"":"sideNavContainer"},m(y.a,null,m("nav",{className:"CategoriesPage-nav TagsPage-nav IndexPage-nav sideNav"},m("ul",null,T()(r.a.prototype.sidebarItems().toArray())))),m("div",{className:"CategoriesPage-content sideNavOffset"},m("ol",{className:"TagCategoryList"},t.map((function(t){return G.component({model:t})}))),a.length?m("div",{className:"TagCloud"},a.map((function(t){return[D()(t,{link:!0})," "]}))):""))))},o.oncreate=function(a){t.prototype.oncreate.call(this,a),app.setTitle(app.translator.trans("askvortsov-categories.forum.all_categories.meta_title_text"))},a}(g.a);app.initializers.add("askvortsov/flarum-categories",(function(){app.routes.categories={path:"/categories",component:H},p.a.prototype.postCount=u.a.attribute("postCount"),Object(e.extend)(r.a.prototype,"navItems",(function(t){return t.has("tags")&&!app.forum.attribute("categories.keepTagsNav")&&t.remove("tags"),t.add("categories",m(i.a,{icon:"fas fa-th-list",href:app.route("categories")},app.translator.trans("askvortsov-categories.forum.index.categories_link")),-9.5),t.has("moreTags")&&t.replace("moreTags",m(i.a,{href:app.route("categories")},app.translator.trans("flarum-tags.forum.index.more_link"))),t})),Object(e.extend)(r.a.prototype,"sidebarItems",(function(t){if(app.current.matches(H)&&app.forum.attribute("categories.fullPageDesktop"))for(var a in t.items)"newDiscussion"!==a&&"nav"!==a&&t.remove(a);return t}))}))}]); //# 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 4f55711..bf23fde 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@askvortsov/flarum-categories/webpack/bootstrap","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/extend']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/Component']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/Link']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/utils/sortTags']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/LinkButton']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/Model']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/models/Tag']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/Page']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/AffixedSidebar']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/listItems']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/helpers/tagLabel']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/avatar']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/username']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/utils/string']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/UserCard']\"","webpack://@askvortsov/flarum-categories/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@askvortsov/flarum-categories/./src/forum/components/StatWidget.js","webpack://@askvortsov/flarum-categories/./src/forum/components/LastDiscussionWidget.js","webpack://@askvortsov/flarum-categories/./src/forum/components/Category.js","webpack://@askvortsov/flarum-categories/./src/forum/components/CategoriesPage.js","webpack://@askvortsov/flarum-categories/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","StatWidget","view","compactMobile","app","forum","attribute","window","innerWidth","class","this","attrs","count","icon","label","Component","LastDiscussionWidget","oninit","vnode","cardVisible","discussion","translator","trans","user","lastPostedUser","card","UserCard","component","className","controlsButtonClassName","href","route","avatar","humanTime","lastPostedAt","username","truncate","title","oncreate","timeout","$","on","clearTimeout","setTimeout","showCard","hideCard","redraw","addClass","removeClass","Category","tag","model","isChild","parent","undefined","collapsed","addEventListener","compactMobileMode","children","sortTags","cardStyle","backgroundColor","color","classNames","slug","push","lastDiscussionClassNames","lastPostedDiscussion","join","childrenInContent","renderedChildren","map","child","style","iconItems","toArray","mainItems","length","onclick","e","toggleArrow","statItems","lastDiscussionItems","items","ItemList","iconClasses","classes","add","description","discussionCount","postCount","hasClass","closest","preventDefault","stopPropagation","CategoriesPage","history","tags","preloaded","preloadedApiDocument","filter","loading","tagList","load","then","store","all","pinned","position","cloud","IndexPage","hero","listItems","sidebarItems","tagLabel","link","setTitle","Page","initializers","routes","categories","path","Tag","Model","extend","has","remove","replace","current","matches","item"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAU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U,2BAC5C6E,EAAM2C,OAAO,QAEf3C,EAAMI,IACJ,aACA,EAAC,IAAD,CAAY1E,KAAK,iBAAiBiB,KAAM1B,IAAI2B,MAAM,eAC/C3B,IAAIiB,WAAWC,MAAM,uDAEvB,KAGC6D,EAAM0C,IAAI,aACZ1C,EAAM4C,QAAQ,WAAY,EAAC,IAAD,CAAYjG,KAAM1B,IAAI2B,MAAM,eAAgB3B,IAAIiB,WAAWC,MAAM,uCAGtF6D,KAGTyC,iBAAOd,IAAUzH,UAAW,gBAAgB,SAAU8F,GACpD,GAAI/E,IAAI4H,QAAQC,QAAQlC,IAAmB3F,IAAIC,MAAMC,UAAU,8BAC7D,IAAK,IAAM4H,KAAQ/C,EAAMA,MACV,kBAAT+C,GAAqC,QAATA,GAC9B/C,EAAM2C,OAAOI,GAInB,OAAO/C","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 = 21);\n","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['common/components/Link'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['tags/utils/sortTags'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['tags/models/Tag'];","module.exports = flarum.core.compat['common/components/Page'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['forum/components/AffixedSidebar'];","module.exports = flarum.core.compat['common/helpers/listItems'];","module.exports = flarum.core.compat['tags/helpers/tagLabel'];","module.exports = flarum.core.compat['common/helpers/avatar'];","module.exports = flarum.core.compat['common/helpers/username'];","module.exports = flarum.core.compat['common/helpers/humanTime'];","module.exports = flarum.core.compat['common/utils/string'];","module.exports = flarum.core.compat['forum/components/UserCard'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default class StatWidget extends Component {\n view() {\n const compactMobile = app.forum.attribute('categories.compactMobile') && window.innerWidth < 767;\n return (\n
\n
{this.attrs.count}
\n
{compactMobile ? icon(this.attrs.icon) : this.attrs.label}
\n
\n );\n }\n}\n","import Component from 'flarum/common/Component';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport { truncate } from 'flarum/common/utils/string';\nimport Link from 'flarum/common/components/Link';\nimport UserCard from 'flarum/forum/components/UserCard';\n\nexport default class LastDiscussionWidget extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n /**\n * Whether or not the user hover card is visible.\n *\n * @type {Boolean}\n */\n this.cardVisible = false;\n }\n\n view() {\n const discussion = this.attrs.discussion;\n\n if (!discussion) {\n return
{app.translator.trans('askvortsov-categories.forum.last_discussion_widget.no_discussions')}
;\n }\n\n const user = discussion.lastPostedUser();\n\n let card = '';\n\n if (user && this.cardVisible) {\n card = UserCard.component({\n user,\n className: 'UserCard--popover',\n controlsButtonClassName: 'Button Button--icon Button--flat',\n });\n }\n\n return (\n \n \n {avatar(user)}\n \n
\n
\n {humanTime(discussion.lastPostedAt())}{' '}\n \n {' '}\n | {username(user)}\n \n
\n
{truncate(discussion.title(), 26)}
\n
\n
{card}
\n \n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n let timeout;\n\n this.$()\n .on('mouseover', '.LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard', () => {\n clearTimeout(timeout);\n timeout = setTimeout(this.showCard.bind(this), 300);\n })\n .on('mouseout', '.LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard', () => {\n clearTimeout(timeout);\n timeout = setTimeout(this.hideCard.bind(this), 150);\n });\n }\n\n /**\n * Show the user card.\n */\n showCard() {\n this.cardVisible = true;\n\n m.redraw();\n\n setTimeout(() => this.$('.UserCard').addClass('in'));\n }\n\n /**\n * Hide the user card.\n */\n hideCard() {\n $('.UserCard').removeClass('in');\n this.cardVisible = false;\n m.redraw();\n }\n}\n","import Component from 'flarum/common/Component';\nimport Link from 'flarum/common/components/Link';\n\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport sortTags from 'flarum/tags/utils/sortTags';\n\nimport StatWidget from './StatWidget';\nimport LastDiscussionWidget from './LastDiscussionWidget';\n\nexport default class Category extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tag = this.attrs.model;\n\n this.isChild = this.attrs.parent != null && this.attrs.parent != undefined;\n\n this.collapsed = false;\n\n window.addEventListener('resize', function () {\n m.redraw();\n });\n }\n\n view() {\n const tag = this.tag;\n\n if (!tag) {\n return '';\n }\n\n this.compactMobileMode = window.innerWidth <= 767 && app.forum.attribute('categories.compactMobile');\n\n const children = this.isChild ? [] : sortTags(tag.children() || []);\n\n const cardStyle = this.isChild ? {} : { backgroundColor: tag.color() };\n\n const classNames = ['TagCategory', `TagCategory-${tag.slug()}`];\n if (this.isChild) {\n classNames.push('SubCategory');\n } else {\n classNames.push('ParentCategory');\n }\n if (this.compactMobileMode) {\n classNames.push('compactMobile');\n }\n\n const lastDiscussionClassNames = (tag.lastPostedDiscussion() ? ['TagCategory-lastDiscussion'] : ['TagCategory-lastDiscussion empty']).join(' ');\n\n const childrenInContent = !this.isChild && this.compactMobileMode;\n\n const renderedChildren = (\n
    {children.map((child) => [Category.component({ model: child, parent: this })])}
\n );\n\n return (\n
  • \n \n
    \n
    \n {this.iconItems().toArray()}\n
    {this.mainItems().toArray()}
    \n
    \n {children.length == 0 ? (\n ''\n ) : (\n {\n this.toggleArrow(e);\n }}\n >\n {icon(this.collapsed ? 'fas fa-caret-down' : 'fas fa-caret-up')}\n

    \n )}\n
    \n
    \n
    {this.statItems().toArray()}
    \n
    {this.lastDiscussionItems().toArray()}
    \n
    \n {childrenInContent && !this.collapsed ? renderedChildren : ''}\n \n {!childrenInContent && !this.isChild ? renderedChildren : ''}\n
  • \n );\n }\n\n iconItems() {\n const items = new ItemList();\n\n if (this.tag.icon() && this.isChild) {\n const style = {};\n let iconClasses = 'fa-stack-1x CategoryIcon';\n if (app.forum.attribute('categories.childBareIcon')) {\n style.color = this.tag.color();\n iconClasses += ' NoBackgroundCategoryIcon';\n }\n const classes = this.compactMobileMode ? 'fa-stack fa-1x' : 'fa-stack fa-2x';\n items.add(\n 'icon',\n \n {app.forum.attribute('categories.childBareIcon') ? (\n ''\n ) : (\n \n )}\n {icon(this.tag.icon(), { className: iconClasses, style: style })}\n ,\n 10\n );\n } else if (this.tag.icon() && !app.forum.attribute('categories.parentRemoveIcon')) {\n const classes = this.compactMobileMode ? 'fa-stack fa-2x' : 'fa-stack fa-3x';\n items.add('icon', {icon(this.tag.icon(), { className: 'fa-stack-1x CategoryIcon' })}, 10);\n }\n\n return items;\n }\n\n mainItems() {\n const items = new ItemList();\n\n items.add('name',

    {this.tag.name()}

    , 15);\n\n if (this.tag.description() && (this.isChild || !app.forum.attribute('categories.parentRemoveDescription'))) {\n items.add('description',
    {this.tag.description()}
    , 10);\n }\n\n return items;\n }\n\n statItems() {\n const items = new ItemList();\n\n if (this.isChild || !app.forum.attribute('categories.parentRemoveStats')) {\n items.add(\n 'discussionCount',\n StatWidget.component({\n count: this.tag.discussionCount(),\n label: app.translator.trans('askvortsov-categories.forum.stat-widgets.discussion_label'),\n icon: 'fas fa-file-alt',\n }),\n 15\n );\n\n items.add(\n 'postCount',\n StatWidget.component({\n count: this.tag.postCount(),\n label: app.translator.trans('askvortsov-categories.forum.stat-widgets.post_label'),\n icon: 'fas fa-comment',\n }),\n 10\n );\n }\n\n return items;\n }\n\n lastDiscussionItems() {\n const items = new ItemList();\n\n if (this.isChild || !app.forum.attribute('categories.parentRemoveLastDiscussion')) {\n items.add(\n 'lastDiscussion',\n LastDiscussionWidget.component({\n discussion: this.tag.lastPostedDiscussion(),\n }),\n 10\n );\n }\n\n return items;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$('.TagCategory-content,.TagCategory-toggleArrow').bind('mouseenter', function (e) {\n $(this).addClass('hover');\n if ($(this).parent().hasClass('SubCategory') || $(this).hasClass('TagCategory-toggleArrow')) {\n $(this).closest('.ParentCategory').children('.TagCategory-content').removeClass('hover');\n }\n });\n\n this.$('.TagCategory-content,.TagCategory-toggleArrow').bind('mouseleave', function (e) {\n $(this).removeClass('hover');\n if ($(this).parent().hasClass('SubCategory') || $(this).hasClass('TagCategory-toggleArrow')) {\n $(this).closest('.ParentCategory').children('.TagCategory-content').addClass('hover');\n }\n });\n }\n\n toggleArrow(e) {\n e.preventDefault();\n e.stopPropagation();\n this.collapsed = !this.collapsed;\n m.redraw();\n }\n}\n","import Page from 'flarum/common/components/Page';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport AffixedSidebar from 'flarum/forum/components/AffixedSidebar';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\n\nimport sortTags from 'flarum/tags/utils/sortTags';\nimport tagLabel from 'flarum/tags/helpers/tagLabel';\n\nimport Category from './Category';\n\nexport default class CategoriesPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('categories', app.translator.trans('askvortsov-category.forum.header.back_to_categories_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\n return;\n }\n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion', 'lastPostedDiscussion.lastPostedUser']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n view() {\n if (this.loading) {\n return ;\n }\n\n const pinned = this.tags.filter((tag) => tag.position() !== null);\n const cloud = this.tags.filter((tag) => tag.position() === null);\n\n const classes = app.forum.attribute('categories.fullPageDesktop') ? ['CategoriesPage', 'TagsPage'] : ['CategoriesPage'];\n\n return (\n
    \n {IndexPage.prototype.hero()}\n
    \n
    \n \n \n \n\n
    \n
      \n {pinned.map((tag) => {\n return Category.component({ model: tag });\n })}\n
    \n\n {cloud.length ?
    {cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
    : ''}\n
    \n
    \n
    \n
    \n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('askvortsov-categories.forum.all_categories.meta_title_text'));\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Model from 'flarum/common/Model';\nimport Tag from 'flarum/tags/models/Tag';\nimport CategoriesPage from './components/CategoriesPage';\n\napp.initializers.add('askvortsov/flarum-categories', () => {\n app.routes.categories = {\n path: '/categories',\n component: CategoriesPage,\n };\n\n Tag.prototype.postCount = Model.attribute('postCount');\n\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (items.has('tags') && !app.forum.attribute('categories.keepTagsNav')) {\n items.remove('tags');\n }\n items.add(\n 'categories',\n \n {app.translator.trans('askvortsov-categories.forum.index.categories_link')}\n ,\n -9.5\n );\n\n if (items.has('moreTags')) {\n items.replace('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')});\n }\n\n return items;\n });\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n if (app.current.matches(CategoriesPage) && app.forum.attribute('categories.fullPageDesktop')) {\n for (const item in items.items) {\n if (item !== 'newDiscussion' && item !== 'nav') {\n items.remove(item);\n }\n }\n }\n return items;\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@askvortsov/flarum-categories/webpack/bootstrap","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/extend']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/Component']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/Link']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/utils/sortTags']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/LinkButton']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/Model']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/models/Tag']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/Page']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/AffixedSidebar']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/listItems']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['tags/helpers/tagLabel']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/avatar']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/username']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['common/utils/string']\"","webpack://@askvortsov/flarum-categories/external \"flarum.core.compat['forum/components/UserCard']\"","webpack://@askvortsov/flarum-categories/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@askvortsov/flarum-categories/./src/forum/components/StatWidget.js","webpack://@askvortsov/flarum-categories/./src/forum/components/LastDiscussionWidget.js","webpack://@askvortsov/flarum-categories/./src/forum/components/Category.js","webpack://@askvortsov/flarum-categories/./src/forum/components/CategoriesPage.js","webpack://@askvortsov/flarum-categories/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","StatWidget","view","compactMobile","app","forum","attribute","window","innerWidth","class","this","attrs","count","icon","label","Component","LastDiscussionWidget","oninit","vnode","cardVisible","discussion","translator","trans","user","lastPostedUser","card","UserCard","component","className","controlsButtonClassName","href","route","lastPostNumber","avatar","humanTime","lastPostedAt","username","truncate","title","oncreate","timeout","$","on","clearTimeout","setTimeout","showCard","hideCard","redraw","addClass","removeClass","Category","tag","model","isChild","parent","undefined","collapsed","addEventListener","compactMobileMode","children","sortTags","cardStyle","backgroundColor","color","classNames","slug","push","lastDiscussionClassNames","lastPostedDiscussion","join","childrenInContent","renderedChildren","map","child","style","iconItems","toArray","mainItems","length","onclick","e","toggleArrow","statItems","lastDiscussionItems","items","ItemList","iconClasses","classes","add","description","discussionCount","postCount","hasClass","closest","preventDefault","stopPropagation","CategoriesPage","history","tags","preloaded","preloadedApiDocument","filter","loading","tagList","load","then","store","all","pinned","position","cloud","IndexPage","hero","listItems","sidebarItems","tagLabel","link","setTitle","Page","initializers","routes","categories","path","Tag","Model","extend","has","remove","replace","current","matches","item"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,E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AKhD,UAAU,wCACb,QAAIA,UAAU,mBACXgF,EAAOpC,KAAI,SAACrB,GACX,OAAOD,EAASvB,UAAU,CAAEyB,MAAOD,QAItC2D,EAAMhC,OAAS,SAAKlD,UAAU,YAAYkF,EAAMtC,KAAI,SAACrB,GAAD,MAAS,CAACgE,IAAShE,EAAK,CAAEiE,MAAM,IAAS,SAAe,Q,EAQzH7E,SAAA,SAASrB,GACP,YAAMqB,SAAN,UAAerB,GAEfd,IAAIiH,SAASjH,IAAIiB,WAAWC,MAAM,gE,GAjEMgG,KCJ5ClH,IAAImH,aAAa/B,IAAI,gCAAgC,WACnDpF,IAAIoH,OAAOC,WAAa,CACtBC,KAAM,cACN/F,UAAWqE,GAGb2B,IAAItI,UAAUsG,UAAYiC,IAAMtH,UAAU,aAE1CuH,iBAAOd,IAAU1H,UAAW,YAAY,SAAU+F,GAgBhD,OAfIA,EAAM0C,IAAI,UAAY1H,IAAIC,MAAMC,UAAU,2BAC5C8E,EAAM2C,OAAO,QAEf3C,EAAMI,IACJ,aACA,EAAC,IAAD,CAAY3E,KAAK,iBAAiBiB,KAAM1B,IAAI2B,MAAM,eAC/C3B,IAAIiB,WAAWC,MAAM,uDAEvB,KAGC8D,EAAM0C,IAAI,aACZ1C,EAAM4C,QAAQ,WAAY,EAAC,IAAD,CAAYlG,KAAM1B,IAAI2B,MAAM,eAAgB3B,IAAIiB,WAAWC,MAAM,uCAGtF8D,KAGTyC,iBAAOd,IAAU1H,UAAW,gBAAgB,SAAU+F,GACpD,GAAIhF,IAAI6H,QAAQC,QAAQlC,IAAmB5F,IAAIC,MAAMC,UAAU,8BAC7D,IAAK,IAAM6H,KAAQ/C,EAAMA,MACV,kBAAT+C,GAAqC,QAATA,GAC9B/C,EAAM2C,OAAOI,GAInB,OAAO/C","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 = 21);\n","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['common/components/Link'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['tags/utils/sortTags'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['tags/models/Tag'];","module.exports = flarum.core.compat['common/components/Page'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['forum/components/AffixedSidebar'];","module.exports = flarum.core.compat['common/helpers/listItems'];","module.exports = flarum.core.compat['tags/helpers/tagLabel'];","module.exports = flarum.core.compat['common/helpers/avatar'];","module.exports = flarum.core.compat['common/helpers/username'];","module.exports = flarum.core.compat['common/helpers/humanTime'];","module.exports = flarum.core.compat['common/utils/string'];","module.exports = flarum.core.compat['forum/components/UserCard'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Component from 'flarum/common/Component';\r\nimport icon from 'flarum/common/helpers/icon';\r\n\r\nexport default class StatWidget extends Component {\r\n view() {\r\n const compactMobile = app.forum.attribute('categories.compactMobile') && window.innerWidth < 767;\r\n return (\r\n
    \r\n
    {this.attrs.count}
    \r\n
    {compactMobile ? icon(this.attrs.icon) : this.attrs.label}
    \r\n
    \r\n );\r\n }\r\n}\r\n","import Component from 'flarum/common/Component';\r\nimport avatar from 'flarum/common/helpers/avatar';\r\nimport username from 'flarum/common/helpers/username';\r\nimport humanTime from 'flarum/common/helpers/humanTime';\r\nimport { truncate } from 'flarum/common/utils/string';\r\nimport Link from 'flarum/common/components/Link';\r\nimport UserCard from 'flarum/forum/components/UserCard';\r\n\r\nexport default class LastDiscussionWidget extends Component {\r\n oninit(vnode) {\r\n super.oninit(vnode);\r\n\r\n /**\r\n * Whether or not the user hover card is visible.\r\n *\r\n * @type {Boolean}\r\n */\r\n this.cardVisible = false;\r\n }\r\n\r\n view() {\r\n const discussion = this.attrs.discussion;\r\n\r\n if (!discussion) {\r\n return
    {app.translator.trans('askvortsov-categories.forum.last_discussion_widget.no_discussions')}
    ;\r\n }\r\n\r\n const user = discussion.lastPostedUser();\r\n\r\n let card = '';\r\n\r\n if (user && this.cardVisible) {\r\n card = UserCard.component({\r\n user,\r\n className: 'UserCard--popover',\r\n controlsButtonClassName: 'Button Button--icon Button--flat',\r\n });\r\n }\r\n\r\n return (\r\n \r\n \r\n {avatar(user)}\r\n \r\n
    \r\n
    \r\n {humanTime(discussion.lastPostedAt())}{' '}\r\n \r\n {' '}\r\n | {username(user)}\r\n \r\n
    \r\n
    {truncate(discussion.title(), 26)}
    \r\n
    \r\n
    {card}
    \r\n \r\n );\r\n }\r\n\r\n oncreate(vnode) {\r\n super.oncreate(vnode);\r\n\r\n let timeout;\r\n\r\n this.$()\r\n .on('mouseover', '.LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard', () => {\r\n clearTimeout(timeout);\r\n timeout = setTimeout(this.showCard.bind(this), 300);\r\n })\r\n .on('mouseout', '.LastDiscussion-avatar, .LastDiscussion-usernameLinkUserCard, .username, .UserCard', () => {\r\n clearTimeout(timeout);\r\n timeout = setTimeout(this.hideCard.bind(this), 150);\r\n });\r\n }\r\n\r\n /**\r\n * Show the user card.\r\n */\r\n showCard() {\r\n this.cardVisible = true;\r\n\r\n m.redraw();\r\n\r\n setTimeout(() => this.$('.UserCard').addClass('in'));\r\n }\r\n\r\n /**\r\n * Hide the user card.\r\n */\r\n hideCard() {\r\n $('.UserCard').removeClass('in');\r\n this.cardVisible = false;\r\n m.redraw();\r\n }\r\n}\r\n","import Component from 'flarum/common/Component';\r\nimport Link from 'flarum/common/components/Link';\r\n\r\nimport icon from 'flarum/common/helpers/icon';\r\nimport ItemList from 'flarum/common/utils/ItemList';\r\nimport sortTags from 'flarum/tags/utils/sortTags';\r\n\r\nimport StatWidget from './StatWidget';\r\nimport LastDiscussionWidget from './LastDiscussionWidget';\r\n\r\nexport default class Category extends Component {\r\n oninit(vnode) {\r\n super.oninit(vnode);\r\n\r\n this.tag = this.attrs.model;\r\n\r\n this.isChild = this.attrs.parent != null && this.attrs.parent != undefined;\r\n\r\n this.collapsed = false;\r\n\r\n window.addEventListener('resize', function () {\r\n m.redraw();\r\n });\r\n }\r\n\r\n view() {\r\n const tag = this.tag;\r\n\r\n if (!tag) {\r\n return '';\r\n }\r\n\r\n this.compactMobileMode = window.innerWidth <= 767 && app.forum.attribute('categories.compactMobile');\r\n\r\n const children = this.isChild ? [] : sortTags(tag.children() || []);\r\n\r\n const cardStyle = this.isChild ? {} : { backgroundColor: tag.color() };\r\n\r\n const classNames = ['TagCategory', `TagCategory-${tag.slug()}`];\r\n if (this.isChild) {\r\n classNames.push('SubCategory');\r\n } else {\r\n classNames.push('ParentCategory');\r\n }\r\n if (this.compactMobileMode) {\r\n classNames.push('compactMobile');\r\n }\r\n\r\n const lastDiscussionClassNames = (tag.lastPostedDiscussion() ? ['TagCategory-lastDiscussion'] : ['TagCategory-lastDiscussion empty']).join(' ');\r\n\r\n const childrenInContent = !this.isChild && this.compactMobileMode;\r\n\r\n const renderedChildren = (\r\n
      {children.map((child) => [Category.component({ model: child, parent: this })])}
    \r\n );\r\n\r\n return (\r\n
  • \r\n \r\n
    \r\n
    \r\n {this.iconItems().toArray()}\r\n
    {this.mainItems().toArray()}
    \r\n
    \r\n {children.length == 0 ? (\r\n ''\r\n ) : (\r\n {\r\n this.toggleArrow(e);\r\n }}\r\n >\r\n {icon(this.collapsed ? 'fas fa-caret-down' : 'fas fa-caret-up')}\r\n

    \r\n )}\r\n
    \r\n
    \r\n
    {this.statItems().toArray()}
    \r\n
    {this.lastDiscussionItems().toArray()}
    \r\n
    \r\n {childrenInContent && !this.collapsed ? renderedChildren : ''}\r\n \r\n {!childrenInContent && !this.isChild ? renderedChildren : ''}\r\n
  • \r\n );\r\n }\r\n\r\n iconItems() {\r\n const items = new ItemList();\r\n\r\n if (this.tag.icon() && this.isChild) {\r\n const style = {};\r\n let iconClasses = 'fa-stack-1x CategoryIcon';\r\n if (app.forum.attribute('categories.childBareIcon')) {\r\n style.color = this.tag.color();\r\n iconClasses += ' NoBackgroundCategoryIcon';\r\n }\r\n const classes = this.compactMobileMode ? 'fa-stack fa-1x' : 'fa-stack fa-2x';\r\n items.add(\r\n 'icon',\r\n \r\n {app.forum.attribute('categories.childBareIcon') ? (\r\n ''\r\n ) : (\r\n \r\n )}\r\n {icon(this.tag.icon(), { className: iconClasses, style: style })}\r\n ,\r\n 10\r\n );\r\n } else if (this.tag.icon() && !app.forum.attribute('categories.parentRemoveIcon')) {\r\n const classes = this.compactMobileMode ? 'fa-stack fa-2x' : 'fa-stack fa-3x';\r\n items.add('icon', {icon(this.tag.icon(), { className: 'fa-stack-1x CategoryIcon' })}, 10);\r\n }\r\n\r\n return items;\r\n }\r\n\r\n mainItems() {\r\n const items = new ItemList();\r\n\r\n items.add('name',

    {this.tag.name()}

    , 15);\r\n\r\n if (this.tag.description() && (this.isChild || !app.forum.attribute('categories.parentRemoveDescription'))) {\r\n items.add('description',
    {this.tag.description()}
    , 10);\r\n }\r\n\r\n return items;\r\n }\r\n\r\n statItems() {\r\n const items = new ItemList();\r\n\r\n if (this.isChild || !app.forum.attribute('categories.parentRemoveStats')) {\r\n items.add(\r\n 'discussionCount',\r\n StatWidget.component({\r\n count: this.tag.discussionCount(),\r\n label: app.translator.trans('askvortsov-categories.forum.stat-widgets.discussion_label'),\r\n icon: 'fas fa-file-alt',\r\n }),\r\n 15\r\n );\r\n\r\n items.add(\r\n 'postCount',\r\n StatWidget.component({\r\n count: this.tag.postCount(),\r\n label: app.translator.trans('askvortsov-categories.forum.stat-widgets.post_label'),\r\n icon: 'fas fa-comment',\r\n }),\r\n 10\r\n );\r\n }\r\n\r\n return items;\r\n }\r\n\r\n lastDiscussionItems() {\r\n const items = new ItemList();\r\n\r\n if (this.isChild || !app.forum.attribute('categories.parentRemoveLastDiscussion')) {\r\n items.add(\r\n 'lastDiscussion',\r\n LastDiscussionWidget.component({\r\n discussion: this.tag.lastPostedDiscussion(),\r\n }),\r\n 10\r\n );\r\n }\r\n\r\n return items;\r\n }\r\n\r\n oncreate(vnode) {\r\n super.oncreate(vnode);\r\n\r\n this.$('.TagCategory-content,.TagCategory-toggleArrow').bind('mouseenter', function (e) {\r\n $(this).addClass('hover');\r\n if ($(this).parent().hasClass('SubCategory') || $(this).hasClass('TagCategory-toggleArrow')) {\r\n $(this).closest('.ParentCategory').children('.TagCategory-content').removeClass('hover');\r\n }\r\n });\r\n\r\n this.$('.TagCategory-content,.TagCategory-toggleArrow').bind('mouseleave', function (e) {\r\n $(this).removeClass('hover');\r\n if ($(this).parent().hasClass('SubCategory') || $(this).hasClass('TagCategory-toggleArrow')) {\r\n $(this).closest('.ParentCategory').children('.TagCategory-content').addClass('hover');\r\n }\r\n });\r\n }\r\n\r\n toggleArrow(e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.collapsed = !this.collapsed;\r\n m.redraw();\r\n }\r\n}\r\n","import Page from 'flarum/common/components/Page';\r\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\r\nimport AffixedSidebar from 'flarum/forum/components/AffixedSidebar';\r\nimport IndexPage from 'flarum/forum/components/IndexPage';\r\nimport listItems from 'flarum/common/helpers/listItems';\r\n\r\nimport sortTags from 'flarum/tags/utils/sortTags';\r\nimport tagLabel from 'flarum/tags/helpers/tagLabel';\r\n\r\nimport Category from './Category';\r\n\r\nexport default class CategoriesPage extends Page {\r\n oninit(vnode) {\r\n super.oninit(vnode);\r\n\r\n app.history.push('categories', app.translator.trans('askvortsov-category.forum.header.back_to_categories_tooltip'));\r\n\r\n this.tags = [];\r\n\r\n const preloaded = app.preloadedApiDocument();\r\n\r\n if (preloaded) {\r\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\r\n return;\r\n }\r\n\r\n this.loading = true;\r\n\r\n app.tagList.load(['children', 'lastPostedDiscussion', 'lastPostedDiscussion.lastPostedUser']).then(() => {\r\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\r\n\r\n this.loading = false;\r\n\r\n m.redraw();\r\n });\r\n }\r\n\r\n view() {\r\n if (this.loading) {\r\n return ;\r\n }\r\n\r\n const pinned = this.tags.filter((tag) => tag.position() !== null);\r\n const cloud = this.tags.filter((tag) => tag.position() === null);\r\n\r\n const classes = app.forum.attribute('categories.fullPageDesktop') ? ['CategoriesPage', 'TagsPage'] : ['CategoriesPage'];\r\n\r\n return (\r\n
    \r\n {IndexPage.prototype.hero()}\r\n
    \r\n
    \r\n \r\n \r\n \r\n\r\n
    \r\n
      \r\n {pinned.map((tag) => {\r\n return Category.component({ model: tag });\r\n })}\r\n
    \r\n\r\n {cloud.length ?
    {cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
    : ''}\r\n
    \r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n\r\n oncreate(vnode) {\r\n super.oncreate(vnode);\r\n\r\n app.setTitle(app.translator.trans('askvortsov-categories.forum.all_categories.meta_title_text'));\r\n }\r\n}\r\n","import { extend } from 'flarum/common/extend';\r\nimport IndexPage from 'flarum/forum/components/IndexPage';\r\nimport LinkButton from 'flarum/common/components/LinkButton';\r\nimport Model from 'flarum/common/Model';\r\nimport Tag from 'flarum/tags/models/Tag';\r\nimport CategoriesPage from './components/CategoriesPage';\r\n\r\napp.initializers.add('askvortsov/flarum-categories', () => {\r\n app.routes.categories = {\r\n path: '/categories',\r\n component: CategoriesPage,\r\n };\r\n\r\n Tag.prototype.postCount = Model.attribute('postCount');\r\n\r\n extend(IndexPage.prototype, 'navItems', function (items) {\r\n if (items.has('tags') && !app.forum.attribute('categories.keepTagsNav')) {\r\n items.remove('tags');\r\n }\r\n items.add(\r\n 'categories',\r\n \r\n {app.translator.trans('askvortsov-categories.forum.index.categories_link')}\r\n ,\r\n -9.5\r\n );\r\n\r\n if (items.has('moreTags')) {\r\n items.replace('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')});\r\n }\r\n\r\n return items;\r\n });\r\n\r\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\r\n if (app.current.matches(CategoriesPage) && app.forum.attribute('categories.fullPageDesktop')) {\r\n for (const item in items.items) {\r\n if (item !== 'newDiscussion' && item !== 'nav') {\r\n items.remove(item);\r\n }\r\n }\r\n }\r\n return items;\r\n });\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/forum/components/LastDiscussionWidget.js b/js/src/forum/components/LastDiscussionWidget.js index a847edb..e7456a0 100644 --- a/js/src/forum/components/LastDiscussionWidget.js +++ b/js/src/forum/components/LastDiscussionWidget.js @@ -38,7 +38,7 @@ export default class LastDiscussionWidget extends Component { } return ( - + {avatar(user)}