From 475b6f33fd1f6abcb7c2c7a7dd3e9a471b4b1564 Mon Sep 17 00:00:00 2001 From: iPurpl3x Date: Wed, 18 Nov 2020 17:53:22 +0100 Subject: [PATCH 1/6] More intelligent discussion routing --- js/src/forum/index.js | 4 +++ js/src/forum/utils/discussionRouting.js | 45 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 js/src/forum/utils/discussionRouting.js diff --git a/js/src/forum/index.js b/js/src/forum/index.js index 5aaf2c2..373e5e0 100644 --- a/js/src/forum/index.js +++ b/js/src/forum/index.js @@ -6,6 +6,7 @@ import BlogOverview from "./pages/BlogOverview"; import redirector from "./utils/redirector"; import BlogMeta from "../common/Models/BlogMeta"; import extendTagOverview from "./utils/extendTagOverview"; +import discussionRouting from "./utils/discussionRouting"; // Register Flarum Blog app.initializers.add('v17development-flarum-blog', app => { @@ -25,4 +26,7 @@ app.initializers.add('v17development-flarum-blog', app => { // Extend tag overview. // Hide tags which are used as blog category extendTagOverview(); + + // Make that blog articles have a blog route and not a discussion route + discussionRouting(); }); \ No newline at end of file diff --git a/js/src/forum/utils/discussionRouting.js b/js/src/forum/utils/discussionRouting.js new file mode 100644 index 0000000..4e2b326 --- /dev/null +++ b/js/src/forum/utils/discussionRouting.js @@ -0,0 +1,45 @@ +export default function () { + // Save the original function before we override it + const original_discussion_route = app.route.discussion; + + /** + * Generate a URL to a discussion OR a Blog Article. + * + * CORE_CODE_OVERRIDE: This overrides the standard function from flarum/core. + * The code is inspired from js/src/forum/routes.js and now handles different types of discussions. + * It will try to keep the original function executed if the discussion being + * processed isn't a blog article. + * + * @param {Discussion} discussion + * @param {Integer} [near] + * @return {String} + */ + app.route.discussion = (discussion, near) => { + const discussionRedirectEnabled = + app.forum.attribute('blogRedirectsEnabled') === 'both' || + app.forum.attribute('blogRedirectsEnabled') === 'discussions_only'; + let shouldRedirect = false; + if (discussionRedirectEnabled && discussion.tags().length > 0) { + const blogTags = app.forum.attribute('blogTags'); + + const foundTags = discussion.tags().filter((tag) => { + return ( + blogTags.indexOf(tag.id()) >= 0 || + (tag.parent() && blogTags.indexOf(tag.parent().id()) >= 0) + ); + }); + + if (foundTags.length > 0) { + shouldRedirect = true; + } + } + if (shouldRedirect) { + const slug = discussion.slug(); + return app.route('blogArticle', { + id: discussion.id() + (slug.trim() ? '-' + slug : ''), + }); + } else { + return original_discussion_route(discussion, near); + } + }; +} From da604a5284a972d158db01620fec9f535b5b3f71 Mon Sep 17 00:00:00 2001 From: iPurpl3x Date: Thu, 19 Nov 2020 08:20:37 +0100 Subject: [PATCH 2/6] Simplification and better UX for redirects --- js/src/forum/utils/redirector.js | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/js/src/forum/utils/redirector.js b/js/src/forum/utils/redirector.js index cc1dd19..8426653 100644 --- a/js/src/forum/utils/redirector.js +++ b/js/src/forum/utils/redirector.js @@ -1,6 +1,5 @@ import IndexPage from 'flarum/components/IndexPage'; import DiscussionPage from 'flarum/components/DiscussionPage'; -import LoadingIndicator from 'flarum/components/LoadingIndicator'; import { extend, override } from 'flarum/extend'; export default function() { @@ -21,37 +20,27 @@ export default function() { }); // Redirect discussion to blog article - override(DiscussionPage.prototype, 'view', function(original) { + override(DiscussionPage.prototype, 'show', function(original, discussion) { const discussionRedirectEnabled = app.forum.attribute('blogRedirectsEnabled') === 'both' || app.forum.attribute('blogRedirectsEnabled') === 'discussions_only'; - if(discussionRedirectEnabled && this.discussion && this.discussion && this.discussion.tags().length > 0) { + if(discussionRedirectEnabled && discussion && discussion && discussion.tags().length > 0) { const blogTags = app.forum.attribute('blogTags'); - const foundTags = this.discussion.tags().filter(tag => { + const foundTags = discussion.tags().filter(tag => { return blogTags.indexOf(tag.id()) >= 0 || (tag.parent() && blogTags.indexOf(tag.parent().id()) >= 0) }); // Only redirect if the discussion has blog tags - if(foundTags.length > 0) { - // Redirect to discussion + if (foundTags.length > 0) { + // Redirect to blog article const url = app.route('blogArticle', { - id: `${this.discussion.id()}-${this.discussion.slug()}` + id: `${discussion.id()}-${discussion.slug()}` }); - document.location.href = url; - - return ( -
- - -

{app.translator.trans('v17development-flarum-blog.forum.utils.redirect.title')}

- {app.translator.trans('v17development-flarum-blog.forum.utils.redirect.link', { - a: - })} -
- ); + // Setting the 3rd argument to true replaces the current state in the browser history, that way the browser back button works as expected. + m.route(url, null, true); } + } else { + return original(); } - - return original(); }); } \ No newline at end of file From 12375211d788c01e288436c4c9789103acfc5dd0 Mon Sep 17 00:00:00 2001 From: Jasper Vriends <4417659+jaspervriends@users.noreply.github.com> Date: Mon, 11 Jan 2021 01:38:30 +0100 Subject: [PATCH 3/6] Fix #28 #26 #23 #19 #24 #15 --- js/dist/admin.js | 798 ++++++- js/dist/admin.js.map | 2 +- js/dist/forum.js | 1891 ++++++++++++++++- js/dist/forum.js.map | 2 +- js/package-lock.json | 7 +- .../components/BlogItemSidebar/BlogAuthor.js | 40 + .../BlogItemSidebar/BlogItemSidebar.js | 27 + js/src/forum/pages/BlogComposer.js | 47 + js/src/forum/pages/BlogItem.js | 56 +- js/src/forum/pages/BlogOverview.js | 5 +- less/Forum/Item.less | 61 +- src/Controller/BlogOverviewController.php | 3 +- 12 files changed, 2880 insertions(+), 59 deletions(-) create mode 100644 js/src/forum/components/BlogItemSidebar/BlogAuthor.js create mode 100644 js/src/forum/components/BlogItemSidebar/BlogItemSidebar.js create mode 100644 js/src/forum/pages/BlogComposer.js diff --git a/js/dist/admin.js b/js/dist/admin.js index c4e1046..a322c73 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,798 @@ -module.exports=function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},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=34)}([function(e,t,n){"use strict";function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return a}))},function(e,t){e.exports=flarum.core.compat["components/Button"]},function(e,t){e.exports=flarum.core.compat["components/Switch"]},function(e,t){e.exports=flarum.core.compat.extend},,function(e,t){e.exports=flarum.core.compat["components/Alert"]},function(e,t){e.exports=flarum.core.compat["components/Page"]},function(e,t){e.exports=flarum.core.compat.Component},function(e,t){e.exports=flarum.core.compat["components/Modal"]},function(e,t){e.exports=flarum.core.compat["utils/ItemList"]},function(e,t){e.exports=flarum.core.compat["utils/saveSettings"]},,function(e,t){e.exports=flarum.core.compat["components/FieldSet"]},,,,,,,,,,,,,,,,function(e,t){e.exports=flarum.core.compat["components/AdminNav"]},function(e,t){e.exports=flarum.core.compat["components/AdminLinkButton"]},function(e,t){e.exports=flarum.core.compat["components/BasicsPage"]},function(e,t){e.exports=flarum.core.compat["components/PermissionGrid"]},,,function(e,t,n){"use strict";n.r(t);var a=n(0),o=n(6),s=n.n(o),i=n(10),r=n.n(i),l=n(5),c=n.n(l),d=n(7),g=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.view=function(){return m("div",null,m("div",{className:"FlarumBlog-header"},m("div",{className:"header-container"},m("h2",null,"Flarum Blog"),m("p",null,"Adds a blog to your forum"),m("div",{className:"clear"}))),m("div",{className:"container"},m("p",null,"Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the ",m("a",{href:"https://join.slack.com/t/v17dev/shared_invite/zt-g6ky1fd3-RreB9UB~636jL~QjDGfZHg"},"V17 Development Slack workspace"),". Also, for tips & tricks, check our ",m("a",{href:"https://community.v17.dev/knowledgebase/category/flarum-blog",target:"_blank"},"knowledge base"),". Do you want to contribute? Check the ",m("a",{href:"https://github.com/v17development/flarum-blog"},"GitHub repository")),m("h2",{style:{marginTop:"25px"}},"Blog settings")))},t}(n.n(d).a),p=n(1),u=n.n(p),h=n(12),b=n.n(h),f=n(2),v=n.n(f),y=n(8),_=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){e.prototype.init.call(this),this.blogCategoriesOriginal=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.isSaving=!1,this.hasChanges=!1},n.title=function(){return"Select blog categories"},n.className=function(){return"Modal modal-dialog FlarumBlog-TagsModal"},n.content=function(){var e=this;return m("div",null,m("div",{className:"Modal-body"},m("p",null,"Please select one or more tags that are considered blog tags. ",m("a",{href:app.forum.attribute("baseUrl")+"/blog",target:"_blank"},"Visit your blog.")),m("table",{className:"FlarumBlog-TagsTable"},m("thead",null,m("th",{width:"35"}),m("th",null,"Tag name"),m("th",{width:"50"})),m("tbody",null,0===app.store.all("tags").length&&m("tr",null,m("td",{colspan:"3"},"You currently have no tags.")),app.store.all("tags").map((function(t){if(!t.parent()){var n=function(){var n=e.blogCategories.indexOf(t.id());e.hasChanges=!0,n>=0?e.blogCategories.splice(n,1):e.blogCategories.push(t.id())};return m("tr",null,m("td",null,m("i",{className:t.icon()})),m("td",{onclick:n},t.name()),m("td",null,m(v.a,{state:e.blogCategories.indexOf(t.id())>=0,onchange:n})))}}))))),m("div",{style:"padding: 25px 30px; text-align: center;"},m(u.a,{type:"submit",className:"Button Button--primary",loading:this.loading},this.hasChanges?"Save changes":"Close")))},n.onsubmit=function(e){var t=this;e.preventDefault(),this.hasChanges?(this.isSaving=!0,r()({blog_tags:this.blogCategories.join("|")}).then((function(){app.alerts.show(new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")})),t.hide()})).catch((function(){app.alerts.show(new c.a({type:"error",children:app.translator.trans("core.lib.error.generic_message")}))})).then((function(){t.isSaving=!1}))):this.hide()},t}(n.n(y).a),w=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.init=function(){this.hasChanges=!1,this.isSaving=!1,this.blogCategories=app.data.settings.blog_tags?app.data.settings.blog_tags.split("|"):[],this.redirectsEnabled=app.data.settings.blog_redirects_enabled?app.data.settings.blog_redirects_enabled:"both",this.hideTagsInList=!app.data.settings.blog_hide_tags||app.data.settings.blog_hide_tags,this.allowComments=!app.data.settings.blog_allow_comments||app.data.settings.blog_allow_comments,this.requiresReviewOnPost=!!app.data.settings.blog_requires_review&&app.data.settings.blog_requires_review,this.addCategoryHierarchy=!app.data.settings.blog_category_hierarchy||app.data.settings.blog_category_hierarchy},n.view=function(){var e=this;return m("div",{className:"BasicsPage FlarumBlog"},g.component(),m("div",{className:"container"},m("div",{className:"FlarumBlog-SelectCategories"},this.blogCategories.length>=1?"You have "+this.blogCategories.length+" categories selected":"No categories selected",m(u.a,{className:"Button",onclick:function(){app.modal.show(new _)}},"Select blog categories")),b.a.component({label:"Blog",children:[v.a.component({state:1==this.allowComments,onchange:function(t){e.allowComments=t,e.hasChanges=!0},children:[m("b",null,"Allow comments"),m("div",{className:"helpText"},"By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. ",m("b",null,"Note:")," Changing this setting will not affect pre-existing blog posts.")]}),v.a.component({state:1==this.requiresReviewOnPost,onchange:function(t){e.requiresReviewOnPost=t,e.hasChanges=!0},children:[m("b",null,"Blog posts requires review"),m("div",{className:"helpText"},"When posting an article, it will not be visible directly and needs to be reviewed by a moderator.")]})]}),b.a.component({label:"Categories",children:[v.a.component({state:1==this.hideTagsInList,onchange:function(t){e.hideTagsInList=t,e.hasChanges=!0},children:[m("b",null,"Hide tags in taglist"),m("div",{className:"helpText"},"When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.")]}),v.a.component({state:1==this.addCategoryHierarchy,onchange:function(t){e.addCategoryHierarchy=t,e.hasChanges=!0},children:[m("b",null,"Show tag hierarchy"),m("div",{className:"helpText"},"Add spacing to child-categories and give the category-list a hierarchy.")]})]}),b.a.component({label:"Redirects",children:[v.a.component({state:"both"===this.redirectsEnabled||"discussions_only"===this.redirectsEnabled,onchange:function(t){t?"tags_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="discussions_only"):"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="tags_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog articles"),m("div",{className:"helpText"},"When enabled, this extension will redirect original discussion URLs to their blog URL.")]}),v.a.component({state:"both"===this.redirectsEnabled||"tags_only"===this.redirectsEnabled,onchange:function(t){t?"discussions_only"===e.redirectsEnabled?e.redirectsEnabled="both":"none"===e.redirectsEnabled&&(e.redirectsEnabled="tags_only"):"tags_only"===e.redirectsEnabled?e.redirectsEnabled="none":e.redirectsEnabled="discussions_only",e.hasChanges=!0},children:[m("b",null,"Redirect blog tags"),m("div",{className:"helpText"},"When enabled, this extension redirects blog tag URLs to the blog category URL.")]})]}),m(u.a,{loading:this.isSaving,className:"Button Button--primary",onclick:function(){return e.save()},disabled:!this.hasChanges},app.translator.trans("core.admin.basics.submit_button"))))},n.save=function(){var e=this;this.isSaving=!0,r()({blog_redirects_enabled:this.redirectsEnabled,blog_hide_tags:this.hideTagsInList,blog_requires_review:this.requiresReviewOnPost,blog_allow_comments:this.allowComments,blog_category_hierarchy:this.addCategoryHierarchy}).then((function(){e.hasChanges=!1,app.alerts.show(e.successAlert=new c.a({type:"success",children:app.translator.trans("core.admin.basics.saved_message")}))})).catch((function(){})).then((function(){e.isSaving=!1,m.redraw()}))},t}(s.a),x=n(3),C=n(28),B=n.n(C),N=n(29),O=n.n(N),S=n(30),E=n.n(S),j=n(31),P=n.n(j),T=n(9),k=n.n(T);function A(){var e=new k.a;return e.add("writeArticles",{icon:"fas fa-pencil-alt",label:"Write and edit blog articles",permission:"blog.writeArticles"},100),e.add("autoApprovePosts",{icon:"far fa-star",label:"Auto approve articles",permission:"blog.autoApprovePosts"},90),e.add("approvePreview",{icon:"far fa-thumbs-up",label:"Can approve blog articles",permission:"blog.canApprovePosts"},90),e}app.initializers.add("v17development-flarum-blog",(function(){app.routes.blog={path:"/blog",component:w.component()},Object(x.extend)(E.a.prototype,"homePageItems",(function(e){e.add("v17development-flarum-blog",{path:"/blog",label:"Blog"})})),Object(x.extend)(B.a.prototype,"items",(function(e){e.add("blog",O.a.component({href:app.route("blog"),icon:"fas fa-blog",children:"Blog",description:"Configure your forum's blog."}))})),Object(x.extend)(P.a.prototype,"permissionItems",(function(e){e.add("v17-development-blog",{label:"Blog",children:A().toArray()},80)}))}))}]); +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./admin.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./admin.js": +/*!******************!*\ + !*** ./admin.js ***! + \******************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _src_admin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/admin */ "./src/admin/index.js"); +/* empty/unused harmony star reexport */ + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; }); +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +/***/ }), + +/***/ "./src/admin/Components/Header/Header.js": +/*!***********************************************!*\ + !*** ./src/admin/Components/Header/Header.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Header; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Component */ "flarum/Component"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Component__WEBPACK_IMPORTED_MODULE_1__); + + + +var Header = /*#__PURE__*/function (_Component) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Header, _Component); + + function Header() { + return _Component.apply(this, arguments) || this; + } + + var _proto = Header.prototype; + + _proto.view = function view() { + return m("div", null, m("div", { + className: "FlarumBlog-header" + }, m("div", { + className: "header-container" + }, m("h2", null, "Flarum Blog"), m("p", null, "Adds a blog to your forum"), m("div", { + className: "clear" + }))), m("div", { + className: "container" + }, m("p", null, "Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the ", m("a", { + href: "https://join.slack.com/t/v17dev/shared_invite/zt-g6ky1fd3-RreB9UB~636jL~QjDGfZHg" + }, "V17 Development Slack workspace"), ". Also, for tips & tricks, check our ", m("a", { + href: "https://community.v17.dev/knowledgebase/category/flarum-blog", + target: "_blank" + }, "knowledge base"), ". Do you want to contribute? Check the ", m("a", { + href: "https://github.com/v17development/flarum-blog" + }, "GitHub repository")), m("h2", { + style: { + marginTop: '25px' + } + }, "Blog settings"))); + }; + + return Header; +}(flarum_Component__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/admin/addPermissions.js": +/*!*************************************!*\ + !*** ./src/admin/addPermissions.js ***! + \*************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return blogPermissions; }); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/utils/ItemList */ "flarum/utils/ItemList"); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_0__); + +function blogPermissions() { + var items = new flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_0___default.a(); + items.add('writeArticles', { + icon: 'fas fa-pencil-alt', + label: "Write and edit blog articles", + permission: 'blog.writeArticles' + }, 100); + items.add('autoApprovePosts', { + icon: 'far fa-star', + label: "Auto approve articles", + permission: 'blog.autoApprovePosts' + }, 90); + items.add('approvePreview', { + icon: 'far fa-thumbs-up', + label: "Can approve blog articles", + permission: 'blog.canApprovePosts' + }, 90); + return items; +} + +/***/ }), + +/***/ "./src/admin/addRoutes.js": +/*!********************************!*\ + !*** ./src/admin/addRoutes.js ***! + \********************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _pages_BlogSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pages/BlogSettings */ "./src/admin/pages/BlogSettings.js"); + +/* harmony default export */ __webpack_exports__["default"] = (function () { + // Main page + app.routes.blog = { + path: '/blog', + component: _pages_BlogSettings__WEBPACK_IMPORTED_MODULE_0__["default"].component() + }; +}); +; + +/***/ }), + +/***/ "./src/admin/components/Modals/SelectCategoriesModal.js": +/*!**************************************************************!*\ + !*** ./src/admin/components/Modals/SelectCategoriesModal.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectCategoriesModal; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Modal */ "flarum/components/Modal"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/components/Alert */ "flarum/components/Alert"); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/utils/saveSettings */ "flarum/utils/saveSettings"); +/* harmony import */ var flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/components/Switch */ "flarum/components/Switch"); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Switch__WEBPACK_IMPORTED_MODULE_5__); + + + + + + + +var SelectCategoriesModal = /*#__PURE__*/function (_Modal) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(SelectCategoriesModal, _Modal); + + function SelectCategoriesModal() { + return _Modal.apply(this, arguments) || this; + } + + var _proto = SelectCategoriesModal.prototype; + + _proto.init = function init() { + _Modal.prototype.init.call(this); + + this.blogCategoriesOriginal = app.data.settings.blog_tags ? app.data.settings.blog_tags.split("|") : []; + this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split("|") : []; + this.isSaving = false; + this.hasChanges = false; + }; + + _proto.title = function title() { + return 'Select blog categories'; + }; + + _proto.className = function className() { + return 'Modal modal-dialog FlarumBlog-TagsModal'; + }; + + _proto.content = function content() { + var _this = this; + + return m("div", null, m("div", { + className: "Modal-body" + }, m("p", null, "Please select one or more tags that are considered blog tags. ", m("a", { + href: app.forum.attribute('baseUrl') + "/blog", + target: "_blank" + }, "Visit your blog.")), m("table", { + className: "FlarumBlog-TagsTable" + }, m("thead", null, m("th", { + width: "35" + }), m("th", null, "Tag name"), m("th", { + width: "50" + })), m("tbody", null, app.store.all('tags').length === 0 && m("tr", null, m("td", { + colspan: "3" + }, "You currently have no tags.")), app.store.all('tags').map(function (obj) { + // Skip all tags who aren't main categories + if (obj.parent()) { + return; + } // Toggle tag + + + var toggleTag = function toggleTag() { + var currentIndex = _this.blogCategories.indexOf(obj.id()); + + _this.hasChanges = true; // Remove tag + + if (currentIndex >= 0) { + _this.blogCategories.splice(currentIndex, 1); + } else { + // Add tag + _this.blogCategories.push(obj.id()); + } + }; + + return m("tr", null, m("td", null, m("i", { + className: obj.icon() + })), m("td", { + onclick: toggleTag + }, obj.name()), m("td", null, m(flarum_components_Switch__WEBPACK_IMPORTED_MODULE_5___default.a, { + state: _this.blogCategories.indexOf(obj.id()) >= 0, + onchange: toggleTag + }))); + })))), m("div", { + style: "padding: 25px 30px; text-align: center;" + }, m(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default.a, { + type: "submit", + className: "Button Button--primary", + loading: this.loading + }, this.hasChanges ? 'Save changes' : 'Close'))); + } // Close or save setting + ; + + _proto.onsubmit = function onsubmit(e) { + var _this2 = this; + + e.preventDefault(); + + if (!this.hasChanges) { + this.hide(); + return; + } + + this.isSaving = true; + flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_4___default()({ + blog_tags: this.blogCategories.join('|') + }).then(function () { + app.alerts.show(new flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3___default.a({ + type: 'success', + children: app.translator.trans('core.admin.basics.saved_message') + })); + + _this2.hide(); + })["catch"](function () { + app.alerts.show(new flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3___default.a({ + type: 'error', + children: app.translator.trans('core.lib.error.generic_message') + })); + }).then(function () { + _this2.isSaving = false; + }); + }; + + return SelectCategoriesModal; +}(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/admin/index.js": +/*!****************************!*\ + !*** ./src/admin/index.js ***! + \****************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _addRoutes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addRoutes */ "./src/admin/addRoutes.js"); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/extend */ "flarum/extend"); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_extend__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_AdminNav__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/AdminNav */ "flarum/components/AdminNav"); +/* harmony import */ var flarum_components_AdminNav__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_AdminNav__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_components_AdminLinkButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/components/AdminLinkButton */ "flarum/components/AdminLinkButton"); +/* harmony import */ var flarum_components_AdminLinkButton__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_components_AdminLinkButton__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_components_BasicsPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/components/BasicsPage */ "flarum/components/BasicsPage"); +/* harmony import */ var flarum_components_BasicsPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_components_BasicsPage__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var flarum_components_PermissionGrid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/components/PermissionGrid */ "flarum/components/PermissionGrid"); +/* harmony import */ var flarum_components_PermissionGrid__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_components_PermissionGrid__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _addPermissions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./addPermissions */ "./src/admin/addPermissions.js"); + + + + + + + // import { knowledgeBasePermissions, supportTicketPermissions } from './addPermissions'; + +app.initializers.add('v17development-flarum-blog', function () { + Object(_addRoutes__WEBPACK_IMPORTED_MODULE_0__["default"])(); // Add home page option + + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_components_BasicsPage__WEBPACK_IMPORTED_MODULE_4___default.a.prototype, 'homePageItems', function (items) { + items.add('v17development-flarum-blog', { + path: '/blog', + label: 'Blog' + }); + }); // Add Admin navigation + + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_components_AdminNav__WEBPACK_IMPORTED_MODULE_2___default.a.prototype, 'items', function (items) { + items.add('blog', flarum_components_AdminLinkButton__WEBPACK_IMPORTED_MODULE_3___default.a.component({ + href: app.route('blog'), + icon: 'fas fa-blog', + children: 'Blog', + description: 'Configure your forum\'s blog.' + })); + }); // Add addPermissions + + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_components_PermissionGrid__WEBPACK_IMPORTED_MODULE_5___default.a.prototype, 'permissionItems', function (items) { + items.add('v17-development-blog', { + label: "Blog", + children: Object(_addPermissions__WEBPACK_IMPORTED_MODULE_6__["default"])().toArray() + }, 80); + }); +}); + +/***/ }), + +/***/ "./src/admin/pages/BlogSettings.js": +/*!*****************************************!*\ + !*** ./src/admin/pages/BlogSettings.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogSettings; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Page */ "flarum/components/Page"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/utils/saveSettings */ "flarum/utils/saveSettings"); +/* harmony import */ var flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/components/Alert */ "flarum/components/Alert"); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _Components_Header_Header__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Components/Header/Header */ "./src/admin/Components/Header/Header.js"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/components/FieldSet */ "flarum/components/FieldSet"); +/* harmony import */ var flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/components/Switch */ "flarum/components/Switch"); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _components_Modals_SelectCategoriesModal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/Modals/SelectCategoriesModal */ "./src/admin/components/Modals/SelectCategoriesModal.js"); + + + + + + + + + + +var BlogSettings = /*#__PURE__*/function (_Page) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogSettings, _Page); + + function BlogSettings() { + return _Page.apply(this, arguments) || this; + } + + var _proto = BlogSettings.prototype; + + _proto.init = function init() { + // Form + this.hasChanges = false; + this.isSaving = false; // Settings + + this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split("|") : []; + this.redirectsEnabled = app.data.settings.blog_redirects_enabled ? app.data.settings.blog_redirects_enabled : 'both'; + this.hideTagsInList = app.data.settings.blog_hide_tags ? app.data.settings.blog_hide_tags : true; + this.allowComments = app.data.settings.blog_allow_comments ? app.data.settings.blog_allow_comments : true; + this.requiresReviewOnPost = app.data.settings.blog_requires_review ? app.data.settings.blog_requires_review : false; + this.addCategoryHierarchy = app.data.settings.blog_category_hierarchy ? app.data.settings.blog_category_hierarchy : true; + }; + + _proto.view = function view() { + var _this = this; + + return m("div", { + className: "BasicsPage FlarumBlog" + }, _Components_Header_Header__WEBPACK_IMPORTED_MODULE_4__["default"].component(), m("div", { + className: "container" + }, m("div", { + className: "FlarumBlog-SelectCategories" + }, this.blogCategories.length >= 1 ? "You have " + this.blogCategories.length + " categories selected" : 'No categories selected', m(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a, { + className: "Button", + onclick: function onclick() { + app.modal.show(new _components_Modals_SelectCategoriesModal__WEBPACK_IMPORTED_MODULE_8__["default"]()); + } + }, "Select blog categories")), flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6___default.a.component({ + label: "Blog", + children: [flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.allowComments == true, + onchange: function onchange(val) { + _this.allowComments = val; + _this.hasChanges = true; + }, + children: [m("b", null, "Allow comments"), m("div", { + className: "helpText" + }, "By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. ", m("b", null, "Note:"), " Changing this setting will not affect pre-existing blog posts.")] + }), flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.requiresReviewOnPost == true, + onchange: function onchange(val) { + _this.requiresReviewOnPost = val; + _this.hasChanges = true; + }, + children: [m("b", null, "Blog posts requires review"), m("div", { + className: "helpText" + }, "When posting an article, it will not be visible directly and needs to be reviewed by a moderator.")] + })] + }), flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6___default.a.component({ + label: "Categories", + children: [flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.hideTagsInList == true, + onchange: function onchange(val) { + _this.hideTagsInList = val; + _this.hasChanges = true; + }, + children: [m("b", null, "Hide tags in taglist"), m("div", { + className: "helpText" + }, "When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.")] + }), flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.addCategoryHierarchy == true, + onchange: function onchange(val) { + _this.addCategoryHierarchy = val; + _this.hasChanges = true; + }, + children: [m("b", null, "Show tag hierarchy"), m("div", { + className: "helpText" + }, "Add spacing to child-categories and give the category-list a hierarchy.")] + })] + }), flarum_components_FieldSet__WEBPACK_IMPORTED_MODULE_6___default.a.component({ + label: "Redirects", + children: [flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'discussions_only', + onchange: function onchange(val) { + if (val) { + // Add + if (_this.redirectsEnabled === 'tags_only') { + _this.redirectsEnabled = 'both'; + } else if (_this.redirectsEnabled === 'none') { + _this.redirectsEnabled = 'discussions_only'; + } + } else { + if (_this.redirectsEnabled === 'discussions_only') { + _this.redirectsEnabled = 'none'; + } else { + _this.redirectsEnabled = 'tags_only'; + } + } + + _this.hasChanges = true; + }, + children: [m("b", null, "Redirect blog articles"), m("div", { + className: "helpText" + }, "When enabled, this extension will redirect original discussion URLs to their blog URL.")] + }), flarum_components_Switch__WEBPACK_IMPORTED_MODULE_7___default.a.component({ + state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'tags_only', + onchange: function onchange(val) { + if (val) { + // Add + if (_this.redirectsEnabled === 'discussions_only') { + _this.redirectsEnabled = 'both'; + } else if (_this.redirectsEnabled === 'none') { + _this.redirectsEnabled = 'tags_only'; + } + } else { + if (_this.redirectsEnabled === 'tags_only') { + _this.redirectsEnabled = 'none'; + } else { + _this.redirectsEnabled = 'discussions_only'; + } + } + + _this.hasChanges = true; + }, + children: [m("b", null, "Redirect blog tags"), m("div", { + className: "helpText" + }, "When enabled, this extension redirects blog tag URLs to the blog category URL.")] + })] + }), m(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a, { + loading: this.isSaving, + className: "Button Button--primary", + onclick: function onclick() { + return _this.save(); + }, + disabled: !this.hasChanges + }, app.translator.trans('core.admin.basics.submit_button')))); + } + /** + * Save data + */ + ; + + _proto.save = function save() { + var _this2 = this; + + this.isSaving = true; + flarum_utils_saveSettings__WEBPACK_IMPORTED_MODULE_2___default()({ + blog_redirects_enabled: this.redirectsEnabled, + blog_hide_tags: this.hideTagsInList, + blog_requires_review: this.requiresReviewOnPost, + blog_allow_comments: this.allowComments, + blog_category_hierarchy: this.addCategoryHierarchy + }).then(function () { + _this2.hasChanges = false; // Show saved message + + app.alerts.show(_this2.successAlert = new flarum_components_Alert__WEBPACK_IMPORTED_MODULE_3___default.a({ + type: 'success', + children: app.translator.trans('core.admin.basics.saved_message') + })); + })["catch"](function () {}).then(function () { + _this2.isSaving = false; + m.redraw(); + }); + }; + + return BlogSettings; +}(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "flarum/Component": +/*!**************************************************!*\ + !*** external "flarum.core.compat['Component']" ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['Component']; + +/***/ }), + +/***/ "flarum/components/AdminLinkButton": +/*!*******************************************************************!*\ + !*** external "flarum.core.compat['components/AdminLinkButton']" ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/AdminLinkButton']; + +/***/ }), + +/***/ "flarum/components/AdminNav": +/*!************************************************************!*\ + !*** external "flarum.core.compat['components/AdminNav']" ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/AdminNav']; + +/***/ }), + +/***/ "flarum/components/Alert": +/*!*********************************************************!*\ + !*** external "flarum.core.compat['components/Alert']" ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Alert']; + +/***/ }), + +/***/ "flarum/components/BasicsPage": +/*!**************************************************************!*\ + !*** external "flarum.core.compat['components/BasicsPage']" ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/BasicsPage']; + +/***/ }), + +/***/ "flarum/components/Button": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['components/Button']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Button']; + +/***/ }), + +/***/ "flarum/components/FieldSet": +/*!************************************************************!*\ + !*** external "flarum.core.compat['components/FieldSet']" ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/FieldSet']; + +/***/ }), + +/***/ "flarum/components/Modal": +/*!*********************************************************!*\ + !*** external "flarum.core.compat['components/Modal']" ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Modal']; + +/***/ }), + +/***/ "flarum/components/Page": +/*!********************************************************!*\ + !*** external "flarum.core.compat['components/Page']" ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Page']; + +/***/ }), + +/***/ "flarum/components/PermissionGrid": +/*!******************************************************************!*\ + !*** external "flarum.core.compat['components/PermissionGrid']" ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/PermissionGrid']; + +/***/ }), + +/***/ "flarum/components/Switch": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['components/Switch']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Switch']; + +/***/ }), + +/***/ "flarum/extend": +/*!***********************************************!*\ + !*** external "flarum.core.compat['extend']" ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['extend']; + +/***/ }), + +/***/ "flarum/utils/ItemList": +/*!*******************************************************!*\ + !*** external "flarum.core.compat['utils/ItemList']" ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/ItemList']; + +/***/ }), + +/***/ "flarum/utils/saveSettings": +/*!***********************************************************!*\ + !*** external "flarum.core.compat['utils/saveSettings']" ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/saveSettings']; + +/***/ }) + +/******/ }); //# 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 e1df7fa..ba613f4 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@v17development/flarum-blog/webpack/bootstrap","webpack://@v17development/flarum-blog/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Button']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Switch']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['extend']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Alert']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Page']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Component']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Modal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/ItemList']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/saveSettings']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/FieldSet']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminNav']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminLinkButton']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/BasicsPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@v17development/flarum-blog/./src/admin/Components/Header/Header.js","webpack://@v17development/flarum-blog/./src/admin/components/Modals/SelectCategoriesModal.js","webpack://@v17development/flarum-blog/./src/admin/pages/BlogSettings.js","webpack://@v17development/flarum-blog/./src/admin/addPermissions.js","webpack://@v17development/flarum-blog/./src/admin/index.js","webpack://@v17development/flarum-blog/./src/admin/addRoutes.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","_inheritsLoose","subClass","superClass","constructor","__proto__","flarum","core","compat","Header","view","className","href","target","style","marginTop","Component","SelectCategoriesModal","init","this","blogCategoriesOriginal","app","data","settings","blog_tags","split","blogCategories","isSaving","hasChanges","title","content","forum","attribute","width","store","all","length","colspan","map","obj","parent","toggleTag","currentIndex","indexOf","id","splice","push","icon","onclick","state","onchange","type","loading","onsubmit","e","preventDefault","saveSettings","join","then","alerts","show","Alert","children","translator","trans","hide","Modal","BlogSettings","redirectsEnabled","blog_redirects_enabled","hideTagsInList","blog_hide_tags","allowComments","blog_allow_comments","requiresReviewOnPost","blog_requires_review","addCategoryHierarchy","blog_category_hierarchy","component","modal","FieldSet","label","Switch","val","save","disabled","successAlert","redraw","Page","blogPermissions","items","ItemList","add","permission","initializers","routes","blog","path","extend","BasicsPage","AdminNav","AdminLinkButton","route","description","PermissionGrid","toArray"],"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,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO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tB,IAAMC,EAAQ,IAAIC,IAoBlB,OAlBAD,EAAME,IAAI,gBAAiB,CACzB7C,KAAM,oBACNkC,MAAO,+BACPY,WAAY,sBACX,KAEHH,EAAME,IAAI,mBAAoB,CAC5B7C,KAAM,cACNkC,MAAO,wBACPY,WAAY,yBACX,IAEHH,EAAME,IAAI,iBAAkB,CAC1B7C,KAAM,mBACNkC,MAAO,4BACPY,WAAY,wBACX,IAEIH,ECdTrE,IAAIyE,aAAaF,IAAI,8BAA8B,WCLjDvE,IAAI0E,OAAOC,KAAO,CAChBC,KAAM,QACNnB,UAAWX,EAAaW,aDO1BoB,iBAAOC,IAAWtG,UAAW,iBAAiB,SAAA6F,GAC5CA,EAAME,IAAI,6BAA8B,CACtCK,KAAM,QACNhB,MAAO,YAKXiB,iBAAOE,IAASvG,UAAW,SAAS,SAAA6F,GAClCA,EAAME,IACJ,OACAS,IAAgBvB,UAAU,CACxBlE,KAAMS,IAAIiF,MAAM,QAChBvD,KAAM,cACNe,SAAU,OACVyC,YAAa,qCAMnBL,iBAAOM,IAAe3G,UAAW,mBAAmB,SAAA6F,GAClDA,EAAME,IAAI,uBAAwB,CAChCX,MAAO,OACPnB,SAAU2B,IAAkBgB,WAC3B","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 = 34);\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Alert'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['utils/saveSettings'];","module.exports = flarum.core.compat['components/FieldSet'];","module.exports = flarum.core.compat['components/AdminNav'];","module.exports = flarum.core.compat['components/AdminLinkButton'];","module.exports = flarum.core.compat['components/BasicsPage'];","module.exports = flarum.core.compat['components/PermissionGrid'];","import Component from 'flarum/Component';\r\n\r\nexport default class Header extends Component {\r\n view() {\r\n return (\r\n
\r\n
\r\n
\r\n

Flarum Blog

\r\n\r\n

Adds a blog to your forum

\r\n\r\n
\r\n
\r\n
\r\n
\r\n

Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the V17 Development Slack workspace. Also, for tips & tricks, check our knowledge base. Do you want to contribute? Check the GitHub repository

\r\n\r\n

Blog settings

\r\n
\r\n
\r\n )\r\n }\r\n}","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport Alert from 'flarum/components/Alert';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class SelectCategoriesModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.blogCategoriesOriginal = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n\r\n this.isSaving = false;\r\n this.hasChanges = false;\r\n }\r\n\r\n title() {\r\n return 'Select blog categories';\r\n }\r\n\r\n className() {\r\n return 'Modal modal-dialog FlarumBlog-TagsModal';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n

Please select one or more tags that are considered blog tags. Visit your blog.

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {app.store.all('tags').length === 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {app.store.all('tags').map(obj => {\r\n // Skip all tags who aren't main categories\r\n if(obj.parent()) {\r\n return;\r\n }\r\n\r\n // Toggle tag\r\n const toggleTag = () => {\r\n const currentIndex = this.blogCategories.indexOf(obj.id());\r\n this.hasChanges = true;\r\n\r\n // Remove tag\r\n if(currentIndex >= 0) {\r\n this.blogCategories.splice(currentIndex, 1);\r\n }else {\r\n // Add tag\r\n this.blogCategories.push(obj.id());\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n })}\r\n \r\n
Tag name
You currently have no tags.
{obj.name()}\r\n = 0}\r\n onchange={toggleTag}\r\n />\r\n
\r\n
\r\n
\r\n \r\n {this.hasChanges ? 'Save changes' : 'Close'}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n // Close or save setting\r\n onsubmit(e) {\r\n e.preventDefault();\r\n\r\n if(!this.hasChanges) {\r\n this.hide();\r\n return;\r\n }\r\n\r\n this.isSaving = true;\r\n\r\n saveSettings({\r\n blog_tags: this.blogCategories.join('|')\r\n })\r\n .then(() => {\r\n app.alerts.show(new Alert({\r\n type: 'success', \r\n children: app.translator.trans('core.admin.basics.saved_message')\r\n }));\r\n\r\n this.hide();\r\n })\r\n .catch(() => {\r\n app.alerts.show(new Alert({\r\n type: 'error', \r\n children: app.translator.trans('core.lib.error.generic_message')\r\n }));\r\n })\r\n .then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n}","import Page from 'flarum/components/Page';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Alert from 'flarum/components/Alert';\r\nimport Header from '../Components/Header/Header';\r\nimport Button from 'flarum/components/Button';\r\nimport FieldSet from 'flarum/components/FieldSet';\r\nimport Switch from 'flarum/components/Switch';\r\nimport SelectCategoriesModal from '../components/Modals/SelectCategoriesModal';\r\n\r\nexport default class BlogSettings extends Page {\r\n init() {\r\n // Form\r\n this.hasChanges = false;\r\n this.isSaving = false;\r\n\r\n // Settings\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.redirectsEnabled = app.data.settings.blog_redirects_enabled ? app.data.settings.blog_redirects_enabled : 'both';\r\n this.hideTagsInList = app.data.settings.blog_hide_tags ? app.data.settings.blog_hide_tags : true;\r\n this.allowComments = app.data.settings.blog_allow_comments ? app.data.settings.blog_allow_comments : true;\r\n this.requiresReviewOnPost = app.data.settings.blog_requires_review ? app.data.settings.blog_requires_review : false;\r\n this.addCategoryHierarchy = app.data.settings.blog_category_hierarchy ? app.data.settings.blog_category_hierarchy : true;\r\n }\r\n\r\n view() {\r\n return (\r\n
\r\n {Header.component()}\r\n\r\n
\r\n
\r\n {this.blogCategories.length >= 1 ? `You have ${this.blogCategories.length} categories selected` : 'No categories selected'}\r\n\r\n \r\n
\r\n\r\n {FieldSet.component({\r\n label: \"Blog\",\r\n children: [\r\n Switch.component({\r\n state: this.allowComments == true,\r\n onchange: (val) => {\r\n this.allowComments = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Allow comments, \r\n
By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. Note: Changing this setting will not affect pre-existing blog posts.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.requiresReviewOnPost == true,\r\n onchange: (val) => {\r\n this.requiresReviewOnPost = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Blog posts requires review, \r\n
When posting an article, it will not be visible directly and needs to be reviewed by a moderator.
,\r\n ]\r\n })\r\n ]\r\n })}\r\n \r\n {FieldSet.component({\r\n label: \"Categories\",\r\n children: [\r\n Switch.component({\r\n state: this.hideTagsInList == true,\r\n onchange: (val) => {\r\n this.hideTagsInList = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Hide tags in taglist, \r\n
When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.addCategoryHierarchy == true,\r\n onchange: (val) => {\r\n this.addCategoryHierarchy = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Show tag hierarchy, \r\n
Add spacing to child-categories and give the category-list a hierarchy.
,\r\n ]\r\n }),\r\n ]\r\n })}\r\n\r\n {FieldSet.component({\r\n label: \"Redirects\",\r\n children: [\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'discussions_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog articles, \r\n
When enabled, this extension will redirect original discussion URLs to their blog URL.
\r\n ],\r\n }),\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'tags_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog tags, \r\n
When enabled, this extension redirects blog tag URLs to the blog category URL.
\r\n ],\r\n })\r\n ]\r\n })}\r\n\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Save data\r\n */\r\n save() {\r\n this.isSaving = true;\r\n \r\n saveSettings({\r\n blog_redirects_enabled: this.redirectsEnabled,\r\n blog_hide_tags: this.hideTagsInList,\r\n blog_requires_review: this.requiresReviewOnPost,\r\n blog_allow_comments: this.allowComments,\r\n blog_category_hierarchy: this.addCategoryHierarchy\r\n })\r\n .then(() => {\r\n this.hasChanges = false;\r\n\r\n // Show saved message\r\n app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.translator.trans('core.admin.basics.saved_message')}));\r\n })\r\n .catch(() => {})\r\n .then(() => {\r\n this.isSaving = false;\r\n m.redraw();\r\n });\r\n }\r\n}","import ItemList from 'flarum/utils/ItemList';\r\n\r\nexport default function blogPermissions() {\r\n const items = new ItemList();\r\n\r\n items.add('writeArticles', {\r\n icon: 'fas fa-pencil-alt',\r\n label: \"Write and edit blog articles\",\r\n permission: 'blog.writeArticles',\r\n }, 100);\r\n\r\n items.add('autoApprovePosts', {\r\n icon: 'far fa-star',\r\n label: \"Auto approve articles\",\r\n permission: 'blog.autoApprovePosts'\r\n }, 90);\r\n\r\n items.add('approvePreview', {\r\n icon: 'far fa-thumbs-up',\r\n label: \"Can approve blog articles\",\r\n permission: 'blog.canApprovePosts'\r\n }, 90);\r\n \r\n return items;\r\n}\r\n","import addRoutes from './addRoutes';\r\nimport { extend } from 'flarum/extend';\r\nimport AdminNav from 'flarum/components/AdminNav';\r\nimport AdminLinkButton from 'flarum/components/AdminLinkButton';\r\nimport BasicsPage from 'flarum/components/BasicsPage';\r\nimport PermissionGrid from 'flarum/components/PermissionGrid';\r\nimport blogPermissions from './addPermissions';\r\n// import { knowledgeBasePermissions, supportTicketPermissions } from './addPermissions';\r\n\r\napp.initializers.add('v17development-flarum-blog', () => {\r\n addRoutes();\r\n\r\n // Add home page option\r\n extend(BasicsPage.prototype, 'homePageItems', items => {\r\n items.add('v17development-flarum-blog', {\r\n path: '/blog',\r\n label: 'Blog',\r\n });\r\n });\r\n\r\n // Add Admin navigation\r\n extend(AdminNav.prototype, 'items', items => {\r\n items.add(\r\n 'blog',\r\n AdminLinkButton.component({\r\n href: app.route('blog'),\r\n icon: 'fas fa-blog',\r\n children: 'Blog',\r\n description: 'Configure your forum\\'s blog.',\r\n })\r\n );\r\n });\r\n\r\n // Add addPermissions\r\n extend(PermissionGrid.prototype, 'permissionItems', items => {\r\n items.add('v17-development-blog', {\r\n label: \"Blog\",\r\n children: blogPermissions().toArray()\r\n }, 80);\r\n });\r\n});","import BlogSettings from './pages/BlogSettings';\r\n\r\nexport default function() {\r\n // Main page\r\n app.routes.blog = {\r\n path: '/blog',\r\n component: BlogSettings.component()\r\n };\r\n};"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@v17development/flarum-blog/webpack/bootstrap","webpack://@v17development/flarum-blog/./admin.js","webpack://@v17development/flarum-blog/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@v17development/flarum-blog/./src/admin/Components/Header/Header.js","webpack://@v17development/flarum-blog/./src/admin/addPermissions.js","webpack://@v17development/flarum-blog/./src/admin/addRoutes.js","webpack://@v17development/flarum-blog/./src/admin/components/Modals/SelectCategoriesModal.js","webpack://@v17development/flarum-blog/./src/admin/index.js","webpack://@v17development/flarum-blog/./src/admin/pages/BlogSettings.js","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Component']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminLinkButton']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/AdminNav']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Alert']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/BasicsPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Button']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/FieldSet']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Modal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Page']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Switch']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['extend']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/ItemList']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/saveSettings']\""],"names":["Header","view","marginTop","Component","blogPermissions","items","ItemList","add","icon","label","permission","app","routes","blog","path","component","BlogSettings","SelectCategoriesModal","init","blogCategoriesOriginal","data","settings","blog_tags","split","blogCategories","isSaving","hasChanges","title","className","content","forum","attribute","store","all","length","map","obj","parent","toggleTag","currentIndex","indexOf","id","splice","push","name","loading","onsubmit","e","preventDefault","hide","saveSettings","join","then","alerts","show","Alert","type","children","translator","trans","Modal","initializers","addRoutes","extend","BasicsPage","prototype","AdminNav","AdminLinkButton","href","route","description","PermissionGrid","toArray","redirectsEnabled","blog_redirects_enabled","hideTagsInList","blog_hide_tags","allowComments","blog_allow_comments","requiresReviewOnPost","blog_requires_review","addCategoryHierarchy","blog_category_hierarchy","modal","FieldSet","Switch","state","onchange","val","save","successAlert","m","redraw","Page"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA,wC;;;;;;;;;;;;ACAA;AAAA;AAAe;AACf;AACA;AACA;AACA,C;;;;;;;;;;;;;;;;;;ACJA;;IAEqBA,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;;;;ACAA,wD;;;;;;;;;;;ACAA,6D;;;;;;;;;;;ACAA,yD;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,wD;;;;;;;;;;;ACAA,uD;;;;;;;;;;;ACAA,iE;;;;;;;;;;;ACAA,yD;;;;;;;;;;;ACAA,8C;;;;;;;;;;;ACAA,sD;;;;;;;;;;;ACAA,0D","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 = \"./admin.js\");\n","export * from './src/admin';","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/Component';\r\n\r\nexport default class Header extends Component {\r\n view() {\r\n return (\r\n
\r\n
\r\n
\r\n

Flarum Blog

\r\n\r\n

Adds a blog to your forum

\r\n\r\n
\r\n
\r\n
\r\n
\r\n

Welcome to the Flarum Blog settings. If you have found a bug, have feedback or an idea, join the V17 Development Slack workspace. Also, for tips & tricks, check our knowledge base. Do you want to contribute? Check the GitHub repository

\r\n\r\n

Blog settings

\r\n
\r\n
\r\n )\r\n }\r\n}","import ItemList from 'flarum/utils/ItemList';\r\n\r\nexport default function blogPermissions() {\r\n const items = new ItemList();\r\n\r\n items.add('writeArticles', {\r\n icon: 'fas fa-pencil-alt',\r\n label: \"Write and edit blog articles\",\r\n permission: 'blog.writeArticles',\r\n }, 100);\r\n\r\n items.add('autoApprovePosts', {\r\n icon: 'far fa-star',\r\n label: \"Auto approve articles\",\r\n permission: 'blog.autoApprovePosts'\r\n }, 90);\r\n\r\n items.add('approvePreview', {\r\n icon: 'far fa-thumbs-up',\r\n label: \"Can approve blog articles\",\r\n permission: 'blog.canApprovePosts'\r\n }, 90);\r\n \r\n return items;\r\n}\r\n","import BlogSettings from './pages/BlogSettings';\r\n\r\nexport default function() {\r\n // Main page\r\n app.routes.blog = {\r\n path: '/blog',\r\n component: BlogSettings.component()\r\n };\r\n};","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport Alert from 'flarum/components/Alert';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class SelectCategoriesModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.blogCategoriesOriginal = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n\r\n this.isSaving = false;\r\n this.hasChanges = false;\r\n }\r\n\r\n title() {\r\n return 'Select blog categories';\r\n }\r\n\r\n className() {\r\n return 'Modal modal-dialog FlarumBlog-TagsModal';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n

Please select one or more tags that are considered blog tags. Visit your blog.

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {app.store.all('tags').length === 0 && (\r\n \r\n \r\n \r\n )}\r\n\r\n {app.store.all('tags').map(obj => {\r\n // Skip all tags who aren't main categories\r\n if(obj.parent()) {\r\n return;\r\n }\r\n\r\n // Toggle tag\r\n const toggleTag = () => {\r\n const currentIndex = this.blogCategories.indexOf(obj.id());\r\n this.hasChanges = true;\r\n\r\n // Remove tag\r\n if(currentIndex >= 0) {\r\n this.blogCategories.splice(currentIndex, 1);\r\n }else {\r\n // Add tag\r\n this.blogCategories.push(obj.id());\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n })}\r\n \r\n
Tag name
You currently have no tags.
{obj.name()}\r\n = 0}\r\n onchange={toggleTag}\r\n />\r\n
\r\n
\r\n
\r\n \r\n {this.hasChanges ? 'Save changes' : 'Close'}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n // Close or save setting\r\n onsubmit(e) {\r\n e.preventDefault();\r\n\r\n if(!this.hasChanges) {\r\n this.hide();\r\n return;\r\n }\r\n\r\n this.isSaving = true;\r\n\r\n saveSettings({\r\n blog_tags: this.blogCategories.join('|')\r\n })\r\n .then(() => {\r\n app.alerts.show(new Alert({\r\n type: 'success', \r\n children: app.translator.trans('core.admin.basics.saved_message')\r\n }));\r\n\r\n this.hide();\r\n })\r\n .catch(() => {\r\n app.alerts.show(new Alert({\r\n type: 'error', \r\n children: app.translator.trans('core.lib.error.generic_message')\r\n }));\r\n })\r\n .then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n}","import addRoutes from './addRoutes';\r\nimport { extend } from 'flarum/extend';\r\nimport AdminNav from 'flarum/components/AdminNav';\r\nimport AdminLinkButton from 'flarum/components/AdminLinkButton';\r\nimport BasicsPage from 'flarum/components/BasicsPage';\r\nimport PermissionGrid from 'flarum/components/PermissionGrid';\r\nimport blogPermissions from './addPermissions';\r\n// import { knowledgeBasePermissions, supportTicketPermissions } from './addPermissions';\r\n\r\napp.initializers.add('v17development-flarum-blog', () => {\r\n addRoutes();\r\n\r\n // Add home page option\r\n extend(BasicsPage.prototype, 'homePageItems', items => {\r\n items.add('v17development-flarum-blog', {\r\n path: '/blog',\r\n label: 'Blog',\r\n });\r\n });\r\n\r\n // Add Admin navigation\r\n extend(AdminNav.prototype, 'items', items => {\r\n items.add(\r\n 'blog',\r\n AdminLinkButton.component({\r\n href: app.route('blog'),\r\n icon: 'fas fa-blog',\r\n children: 'Blog',\r\n description: 'Configure your forum\\'s blog.',\r\n })\r\n );\r\n });\r\n\r\n // Add addPermissions\r\n extend(PermissionGrid.prototype, 'permissionItems', items => {\r\n items.add('v17-development-blog', {\r\n label: \"Blog\",\r\n children: blogPermissions().toArray()\r\n }, 80);\r\n });\r\n});","import Page from 'flarum/components/Page';\r\nimport saveSettings from 'flarum/utils/saveSettings';\r\nimport Alert from 'flarum/components/Alert';\r\nimport Header from '../Components/Header/Header';\r\nimport Button from 'flarum/components/Button';\r\nimport FieldSet from 'flarum/components/FieldSet';\r\nimport Switch from 'flarum/components/Switch';\r\nimport SelectCategoriesModal from '../components/Modals/SelectCategoriesModal';\r\n\r\nexport default class BlogSettings extends Page {\r\n init() {\r\n // Form\r\n this.hasChanges = false;\r\n this.isSaving = false;\r\n\r\n // Settings\r\n this.blogCategories = app.data.settings.blog_tags ? app.data.settings.blog_tags.split(\"|\") : [];\r\n this.redirectsEnabled = app.data.settings.blog_redirects_enabled ? app.data.settings.blog_redirects_enabled : 'both';\r\n this.hideTagsInList = app.data.settings.blog_hide_tags ? app.data.settings.blog_hide_tags : true;\r\n this.allowComments = app.data.settings.blog_allow_comments ? app.data.settings.blog_allow_comments : true;\r\n this.requiresReviewOnPost = app.data.settings.blog_requires_review ? app.data.settings.blog_requires_review : false;\r\n this.addCategoryHierarchy = app.data.settings.blog_category_hierarchy ? app.data.settings.blog_category_hierarchy : true;\r\n }\r\n\r\n view() {\r\n return (\r\n
\r\n {Header.component()}\r\n\r\n
\r\n
\r\n {this.blogCategories.length >= 1 ? `You have ${this.blogCategories.length} categories selected` : 'No categories selected'}\r\n\r\n \r\n
\r\n\r\n {FieldSet.component({\r\n label: \"Blog\",\r\n children: [\r\n Switch.component({\r\n state: this.allowComments == true,\r\n onchange: (val) => {\r\n this.allowComments = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Allow comments, \r\n
By default, allow comments on blog posts. When disabled, it can be enabled individually per blog post. Note: Changing this setting will not affect pre-existing blog posts.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.requiresReviewOnPost == true,\r\n onchange: (val) => {\r\n this.requiresReviewOnPost = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Blog posts requires review, \r\n
When posting an article, it will not be visible directly and needs to be reviewed by a moderator.
,\r\n ]\r\n })\r\n ]\r\n })}\r\n \r\n {FieldSet.component({\r\n label: \"Categories\",\r\n children: [\r\n Switch.component({\r\n state: this.hideTagsInList == true,\r\n onchange: (val) => {\r\n this.hideTagsInList = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Hide tags in taglist, \r\n
When enabled, this extension will hide the blog tags from your homepage. After changing this setting, clear the cache of your forum.
,\r\n ]\r\n }),\r\n Switch.component({\r\n state: this.addCategoryHierarchy == true,\r\n onchange: (val) => {\r\n this.addCategoryHierarchy = val;\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Show tag hierarchy, \r\n
Add spacing to child-categories and give the category-list a hierarchy.
,\r\n ]\r\n }),\r\n ]\r\n })}\r\n\r\n {FieldSet.component({\r\n label: \"Redirects\",\r\n children: [\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'discussions_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog articles, \r\n
When enabled, this extension will redirect original discussion URLs to their blog URL.
\r\n ],\r\n }),\r\n Switch.component({\r\n state: this.redirectsEnabled === 'both' || this.redirectsEnabled === 'tags_only',\r\n onchange: (val) => {\r\n if(val) {\r\n // Add\r\n if(this.redirectsEnabled === 'discussions_only') {\r\n this.redirectsEnabled = 'both';\r\n }else if(this.redirectsEnabled === 'none') {\r\n this.redirectsEnabled = 'tags_only';\r\n }\r\n }else{\r\n if(this.redirectsEnabled === 'tags_only') {\r\n this.redirectsEnabled = 'none';\r\n }else {\r\n this.redirectsEnabled = 'discussions_only';\r\n }\r\n }\r\n\r\n this.hasChanges = true;\r\n },\r\n children: [\r\n Redirect blog tags, \r\n
When enabled, this extension redirects blog tag URLs to the blog category URL.
\r\n ],\r\n })\r\n ]\r\n })}\r\n\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Save data\r\n */\r\n save() {\r\n this.isSaving = true;\r\n \r\n saveSettings({\r\n blog_redirects_enabled: this.redirectsEnabled,\r\n blog_hide_tags: this.hideTagsInList,\r\n blog_requires_review: this.requiresReviewOnPost,\r\n blog_allow_comments: this.allowComments,\r\n blog_category_hierarchy: this.addCategoryHierarchy\r\n })\r\n .then(() => {\r\n this.hasChanges = false;\r\n\r\n // Show saved message\r\n app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.translator.trans('core.admin.basics.saved_message')}));\r\n })\r\n .catch(() => {})\r\n .then(() => {\r\n this.isSaving = false;\r\n m.redraw();\r\n });\r\n }\r\n}","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/AdminLinkButton'];","module.exports = flarum.core.compat['components/AdminNav'];","module.exports = flarum.core.compat['components/Alert'];","module.exports = flarum.core.compat['components/BasicsPage'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/FieldSet'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['components/PermissionGrid'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['utils/saveSettings'];"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index cb932c5..4d5f7e7 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,1891 @@ -module.exports=function(t){var e={};function a(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=t,a.c=e,a.d=function(t,e,o){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(o,i,function(e){return t[e]}.bind(null,i));return o},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=33)}([function(t,e,a){"use strict";function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a.d(e,"a",(function(){return o}))},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/Switch"]},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat["components/Alert"]},function(t,e){t.exports=flarum.core.compat["components/Page"]},function(t,e){t.exports=flarum.core.compat.Component},function(t,e){t.exports=flarum.core.compat["components/Modal"]},function(t,e){t.exports=flarum.core.compat["utils/ItemList"]},,function(t,e){t.exports=flarum.core.compat["utils/DiscussionControls"]},,function(t,e){t.exports=flarum.core.compat["helpers/humanTime"]},function(t,e){t.exports=flarum.core.compat["helpers/avatar"]},function(t,e){t.exports=flarum.core.compat["components/PostStream"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagDiscussionModal"]},function(t,e){t.exports=flarum.core.compat["components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["components/EditPostComposer"]},function(t,e){t.exports=flarum.core.compat["utils/extractText"]},function(t,e){t.exports=flarum.core.compat["utils/string"]},function(t,e){t.exports=flarum.core.compat["models/Discussion"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionComposer"]},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["components/LoadingIndicator"]},function(t,e){t.exports=flarum.core.compat["utils/mixin"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagsPage"]},,,,,function(t,e){t.exports=flarum.core.compat["components/ReplyComposer"]},function(t,e,a){"use strict";a.r(e);var o=a(0),i=a(6),s=a.n(i),r=a(14),l=a.n(r),n=a(1),u=a.n(n),c=(a(32),a(15)),p=a.n(c),d=a(7),g=a.n(d),f=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.blogCategories=app.forum.attribute("blogTags")},a.view=function(){var t=this;return m("div",{className:"BlogCategories"},m("h3",null,app.translator.trans("v17development-flarum-blog.forum.categories")),this.blogCategories&&this.blogCategories.map((function(e){var a=app.store.getById("tags",e);if(!a)return null;var o=[];return o.push(t.categoryItem(a)),app.store.all("tags").forEach((function(e){e.isChild()&&e.parent().id()===a.id()&&o.push(t.categoryItem(e))})),o})))},a.categoryItem=function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),className:"BlogCategories-item BlogCategories-item-"+t.id()+" "+(t.isChild()&&1==app.forum.attribute("blogCategoryHierarchy")?"BlogCategories-item-child":""),config:m.route},m("span",{className:""===t.icon()?"BlogCategories-item-colored":"",style:{backgroundColor:""===t.icon()?t.color():null}},m("i",{className:t.icon()})),t.name())},e}(g.a),h=a(16),v=a.n(h),b=a(11),y=a.n(b),N=a(5),B=a.n(N),w=a(17),A=a.n(w),F=a(8),x=a.n(F),P=a(9),M=a.n(P),_=a(2),C=a.n(_),I=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.isNew=!this.props.article.blogMeta(),this.meta=this.props.article.blogMeta()?this.props.article.blogMeta():app.store.createRecord("blogMeta"),this.summary=m.prop(this.meta.summary()||""),this.featuredImage=m.prop(this.meta.featuredImage()||""),this.isFeatured=m.prop(this.meta.isFeatured()||!1),this.isSized=m.prop(this.meta.isSized()||!1),this.isPendingReview=m.prop(this.meta.isPendingReview()||!1)},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return"Blog post settings"},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new M.a;return e.add("summary",m("div",{className:"Form-group"},m("label",null,"Article summary:"),m("textarea",{className:"FormControl",style:{maxWidth:"100%",minWidth:"100%",width:"100%",minHeight:"120px"},value:this.summary(),placeholder:"Please enter a summary",oninput:m.withAttr("value",this.summary)}),m("small",null,"This summary will be visible on the blog overview page and will be used for SEO purposes.")),30),e.add("image",m("div",{className:"Form-group"},m("label",null,"Article image URL:"),m("input",{type:"text",className:"FormControl",value:this.featuredImage(),placeholder:"https://",oninput:m.withAttr("value",this.featuredImage)}),m("small",null,"Best image resolution for social media: 1200x630"),""!=this.featuredImage()&&m("img",{src:this.featuredImage(),alt:this.props.article.title(),title:"Blog post image",width:"100%",style:{marginTop:"15px"}})),30),e.add("sized",m("div",{className:"Form-group"},C.a.component({state:1==this.isSized(),onchange:function(e){t.isSized(e)},children:[m("b",null,"Highlighted post"),m("div",{className:"helpText",style:{fontWeight:500}},"Give this post a big image on the blog overview page.")]})),-10),e.add("submit",m("div",{className:"Form-group"},u.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{summary:this.summary(),featuredImage:this.featuredImage(),isFeatured:this.isFeatured(),isSized:this.isSized(),isPendingReview:this.isPendingReview(),relationships:this.isNew&&{discussion:this.props.article}}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.meta.save(this.submitData()).then((function(){e.isNew&&e.props.article.pushData({relationships:{blogMeta:e.meta}}),e.hide(),m.redraw()}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(x.a),k=a(18),O=a.n(k),R=a(19),L=a.n(R),S=a(20),T=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),this.article=this.props.article,this.name=m.prop(this.article.title()||""),this.slug=m.prop(this.article.slug()||""),this.redirect=this.props.redirect},a.className=function(){return"Modal--small Support-Modal"},a.title=function(){return app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},a.fields=function(){var t=this,e=new M.a;return e.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.title"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.title"),value:this.name(),oninput:function(e){t.name(e.target.value),t.slug(Object(S.slug)(e.target.value))}})),50),e.add("slug",m("div",{className:"Form-group"},m("label",null,app.translator.trans("v17development-flarum-blog.forum.article.slug"),":"),m("input",{className:"FormControl",placeholder:app.translator.trans("v17development-flarum-blog.forum.article.slug"),value:this.slug(),oninput:m.withAttr("value",this.slug)})),40),e.add("submit",m("div",{className:"Form-group"},u.a.component({type:"submit",className:"Button Button--primary SupportModal-save",loading:this.loading,children:"Update"})),-10),e},a.submitData=function(){return{title:this.name(),slug:this.slug()}},a.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.article.save({title:this.name(),slug:this.slug()}).then((function(){if(e.hide(),e.redirect){var t="/knowledgebase/"+e.article.id()+"-"+e.slug();m.route(t,!0),window.history.replaceState(null,document.title,t)}}),(function(t){e.loading=!1,e.handleErrors(t)}))},e}(x.a),D=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){this.loadedPost=!1},a.view=function(){var t=this,e=this.props.article,a=[];e.canRename()&&a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new T({article:e}))},icon:"fas fa-pencil-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.rename_article")}));var o=e.firstPost()?e.firstPost():app.store.getById("posts",e.firstPostId());return a.push(u.a.component({className:"Button",disabled:!o||!o.canEdit(),onclick:function(){app.composer.load(new O.a({post:o})),app.composer.show()},icon:"fas fa-edit",children:app.translator.trans("v17development-flarum-blog.forum.tools.edit_article")})),a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new I({article:e}))},icon:"fas fa-cogs",children:app.translator.trans("v17development-flarum-blog.forum.tools.article_settings")})),e.canTag()&&a.push(u.a.component({className:"Button",onclick:function(){return app.modal.show(new v.a({discussion:e}))},icon:"fas fa-tag",children:app.translator.trans("v17development-flarum-blog.forum.tools.update_category")})),e.blogMeta()&&e.blogMeta().isPendingReview()&&(a.push(m("li",{className:"Dropdown-separator"})),a.push(u.a.component({className:"Button",disabled:!app.forum.attribute("canApproveBlogPosts"),onclick:function(){e.blogMeta().save({isPendingReview:!1}).then((function(){app.alerts.show(new B.a({type:"success",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article_approved")}))}),(function(e){t.loading=!1,t.handleErrors(e)}))},icon:"fas fa-thumbs-up",children:app.translator.trans("v17development-flarum-blog.forum.review_article.approve_article")}))),a.push(m("li",{className:"Dropdown-separator"})),e.canLock()&&a.push(u.a.component({className:"Button",onclick:y.a.lockAction.bind(e),icon:"fas "+(e.isLocked()?"fa-comments":"fa-comment-slash"),children:e.isLocked()?app.translator.trans("v17development-flarum-blog.forum.tools.enable_comments"):app.translator.trans("v17development-flarum-blog.forum.tools.disable_comments")})),e.canHide()&&(e.isHidden()?(a.push(u.a.component({className:"Button",onclick:y.a.restoreAction.bind(e),icon:"fas fa-eye",children:app.translator.trans("v17development-flarum-blog.forum.tools.recover_article")})),e.canDelete()&&a.push(u.a.component({className:"Button",onclick:function(){if(confirm(L()(app.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return"blogArticle"===app.history.getCurrent().name&&(app.previous?app.history.back():m.route(app.route("blog"))),e.delete().then((function(){m.redraw()}))},icon:"far fa-trash-alt",children:app.translator.trans("v17development-flarum-blog.forum.tools.delete_forever")}))):a.push(u.a.component({className:"Button",onclick:y.a.hideAction.bind(e),icon:"fas fa-eye-slash",children:app.translator.trans("v17development-flarum-blog.forum.tools.hide_article")}))),m("div",{className:"FlarumBlog-Article-Content-Edit-Button"},m("div",{className:"FlarumBlog-Article-Content-Edit-Dropdown"},A.a.component({icon:"fas fa-cog",label:"Manage",buttonClassName:"Button",menuClassName:"Dropdown-menu--right",children:a,onshow:function(){!o||o.canEdit()||t.loadedPost||(t.loadedPost=!0,app.store.find("posts",e.firstPost()?e.firstPost().id():e.firstPostId()).then((function(){})).catch((function(){})).then((function(){return m.redraw()})))}})))},e}(g.a),j=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),app.history.push("blogArticle"),this.bodyClass="BlogItemPage",this.loading=!0,this.found=!1,this.article=null,this.loadBlogItem()},a.loadBlogItem=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",m.route.param("id").split("-")[0]).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){this.article=t,app.setTitle(t.title()+" - "+app.translator.trans("v17development-flarum-blog.forum.blog")),this.loading=!1;var e=[];if(t.payload&&t.payload.included){var a=t.id();e=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===a})).map((function(t){return app.store.getById("posts",t.id)})).sort((function(t,e){return t.id()-e.id()})).slice(0,20)}this.stream=new p.a({discussion:t,includedPosts:e}),this.stream.on("positionChanged",this.positionChanged.bind(this)),m.lazyRedraw()},a.view=function(){var t=this.article&&this.article.blogMeta()&&this.article.blogMeta().featuredImage()?"url("+this.article.blogMeta().featuredImage()+")":null,e=null;return!this.loading&&this.article&&(e=this.article.firstPost()?this.article.firstPost():app.store.getById("posts",this.article.firstPostId())),m("div",{className:"FlarumBlogItem"},m("div",{className:"container"},m("div",{className:"FlarumBlog-Article"},m("div",{className:"FlarumBlog-Article-Container"},m("div",{className:"FlarumBlog-Article-Content"},m("div",{className:"FlarumBlog-Article-Image FlarumBlog-default-image "+(this.loading?"FlarumBlog-Article-GhostImage":""),style:{backgroundImage:t,opacity:this.article&&this.article.isHidden()?.4:null}}),this.article&&app.session.user&&(app.session.user.canEdit()||this.article.canRename()||this.article.posts()&&this.article.posts()[0].canEdit())&&m(D,{article:this.article}),m("div",{className:"FlarumBlog-Article-Categories"},!this.loading&&this.article&&this.article.tags()&&this.article.tags().map((function(t){return m("a",{href:app.route("blogCategory",{slug:t.slug()}),config:m.route},t.name())})),this.loading&&[0,1].map((function(){return m("span",{className:"FlarumBlog-Article-GhostCategory"},"Category")}))),m("div",{className:"FlarumBlog-Article-Post"},m("h3",{className:this.loading?"FlarumBlog-Article-GhostTitle":null},this.article?this.article.title():"Ghost title",this.article&&this.article.isHidden()&&"("+app.translator.trans("v17development-flarum-blog.forum.hidden")+")"),this.loading&&[0,1,2].map((function(){return m("div",null,m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",{className:"FlarumBlog-Article-GhostParagraph"}," "),m("p",null," "))})),m("div",{className:"Post-body"},!this.loading&&this.article.blogMeta()&&1==this.article.blogMeta().isPendingReview()&&m("blockquote",{class:"uncited",style:{fontSize:"16px"}},m("div",null,m("span",{className:"far fa-clock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"))),!this.loading&&e&&m.trust(e.contentHtml())))),m("div",{className:"FlarumBlog-Article-Comments"},m("h4",null,app.translator.trans("v17development-flarum-blog.forum.comment_section.comments")," (",this.article?this.article.commentCount()-1:0,")"),!this.loading&&this.article.isLocked&&this.article.isLocked()&&m("div",{className:"Post-body"},m("blockquote",{class:"uncited"},m("div",null,m("span",{className:"far fa-lock",style:{marginRight:"5px"}})," ",app.translator.trans("v17development-flarum-blog.forum.comment_section.locked")))),!this.loading&&this.stream&&this.stream.render())),m("div",{className:"FlarumBlog-Article-Author"},m("div",{className:"FlarumBlog-Article-Author-Info"},m("div",{className:"FlarumBlog-Article-Author-background "+(this.loading?"FlarumBlog-Author-Ghost":""),style:{backgroundColor:this.article&&this.article.user()?this.article&&this.article.user().color():null}}),m("div",{className:"FlarumBlog-Article-Author-Avatar"},this.article&&this.article.user()?l()(this.article.user()):m("span",{className:"Avatar FlarumBlog-Author-Ghost"})),this.article&&this.article.user()&&m("div",{style:{padding:"0 20px 20px"}},m("span",{className:"FlarumBlog-Article-Author-Name"},this.article.user().displayName()),m("p",{className:"FlarumBlog-Article-Author-Bio"},this.article.user().bio())),this.loading&&m("div",null,m("span",{className:"FlarumBlog-Article-Author-Name FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "),m("p",{className:"FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost"}," "))),m(f,null)))))},a.positionChanged=function(t,e){var a=this.article;app.session.user&&e>(a.lastReadPostNumber()||0)&&(a.save({lastReadPostNumber:e}),m.redraw())},e}(s.a),z=a(4),E=a.n(z),G=a(21),H=a.n(G),W=a(13),q=a.n(W),U=a(22),J=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e.prototype.onsubmit=function(){this.loading=!0;var t=this.data();app.store.createRecord("discussions").save(t).then((function(t){app.composer.hide(),m.route(app.route("blogArticle",{id:t.id()+"-"+t.slug()}))}),this.loaded.bind(this))},e}(a.n(U).a);function K(t){$(t).tooltip()}var Q=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var a=e.prototype;return a.init=function(){t.prototype.init.call(this),app.setTitle(app.translator.trans("v17development-flarum-blog.forum.blog")),this.bodyClass="BlogOverviewPage",this.isLoading=!0,this.featuredPosts=[],this.posts=[],this.hasMore=null,app.history.push("blog"),this.loadBlogOverview()},a.loadBlogOverview=function(){var t=app.preloadedApiDocument();t?setTimeout(this.show.bind(this,t),0):app.store.find("discussions",{filter:{q:"is:blog"+(m.route.param("slug")?" tag:"+m.route.param("slug"):"")}}).then(this.show.bind(this)).catch((function(){m.redraw()})),m.lazyRedraw()},a.show=function(t){if(0===t.length)return this.isLoading=!1,void m.lazyRedraw();this.featuredPosts=t.slice(0,3),this.posts=t.length>=4?t.slice(3,t.length):[],this.isLoading=!1,m.lazyRedraw()},a.title=function(){if(!m.route.param("slug"))return m("h2",null,app.translator.trans("v17development-flarum-blog.forum.recent_posts"));var t=app.store.all("tags").filter((function(t){return t.slug()===m.route.param("slug")}));return m("h2",null,t&&t[0]&&t[0].name(),m("small",null," - ",m("a",{href:app.route("blog"),config:m.route},app.translator.trans("v17development-flarum-blog.forum.return_to_overview"))))},a.view=function(){var t=this;return m("div",{className:"FlarumBlogOverview"},m("div",{className:"container"},m("div",{className:"BlogFeatured"},app.forum.attribute("canWriteBlogPosts")&&m(u.a,{className:"Button FlarumBlogWrite",onclick:function(){return t.newArticle()},icon:"fas fa-pencil"},app.translator.trans("v17development-flarum-blog.forum.compose.write_article")),this.title(),m("div",{style:{clear:"both"}}),m("div",{className:"BlogFeatured-list"},this.isLoading&&[0,1,2].map((function(){return m("div",{className:"BlogFeatured-list-item BlogFeatured-list-item-ghost"},m("div",{className:"BlogFeatured-list-item-details"},m("h4",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.featuredPosts.length>=0&&this.featuredPosts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.tags()?e.tags().filter((function(t){return t.isChild()})):[];return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogFeatured-list-item FlarumBlog-default-image",style:{backgroundImage:a},config:m.route},m("div",{className:"BlogFeatured-list-item-top"},o[0]&&m("span",null,o[0].name()),e.isSticky()&&m("span",null,m("i",{className:"fas fa-thumbtack"})),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("span",null,m("i",{className:"fas fa-eye-slash"})),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("span",{title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:K.bind(t),"data-placement":"bottom"},m("i",{className:"far fa-clock"})," ",app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review_title"))),m("div",{className:"BlogFeatured-list-item-details"},m("h4",null,e.title()),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",q()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})))),m("div",{className:"BlogScrubber"},m("div",{className:"BlogList"},this.isLoading&&[!1,!1,!0,!1].map((function(t){return m("div",{className:"BlogList-item BlogList-item-"+(!0===t?"sized":"default")+" BlogList-item-ghost"},m("div",{className:"BlogList-item-photo FlarumBlog-default-image"}),m("div",{className:"BlogList-item-content"},m("h4",null," "),m("p",null," "),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-wave"})))))})),!this.isLoading&&this.posts.length>=1&&this.posts.map((function(e){var a=e.blogMeta()&&e.blogMeta().featuredImage()?"url("+e.blogMeta().featuredImage()+")":null,o=e.blogMeta()&&e.blogMeta().isSized(),i=e.blogMeta()&&e.blogMeta().summary()?e.blogMeta().summary():"";return m("a",{href:app.route("blogArticle",{id:e.id()+"-"+e.slug()}),className:"BlogList-item BlogList-item-"+(o?"sized":"default"),config:m.route},m("div",{className:"BlogList-item-photo FlarumBlog-default-image",style:{backgroundImage:a}}),m("div",{className:"BlogList-item-content"},m("h4",null,e.title(),(e.blogMeta()&&1==e.blogMeta().isPendingReview()||e.isHidden())&&m("i",{className:"fas fa-eye-slash"}),e.blogMeta()&&1==e.blogMeta().isPendingReview()&&m("i",{className:"far fa-clock",title:app.translator.trans("v17development-flarum-blog.forum.review_article.pending_review"),config:K.bind(t)})),m("p",null,i),m("div",{className:"data"},m("span",null,m("i",{className:"far fa-clock"})," ",q()(e.createdAt())),m("span",null,m("i",{className:"far fa-user"})," ",e.user()?e.user().displayName():"[Deleted]"),m("span",null,m("i",{className:"far fa-comment"})," ",e.commentCount()))))})),!this.isLoading&&this.featuredPosts.length>0&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.no_more_posts")),!this.isLoading&&0===this.featuredPosts.length&&0===this.posts.length&&m("p",{className:"FlarumBlog-reached-end"},app.translator.trans("v17development-flarum-blog.forum.category_empty"))),m("div",{className:"Sidebar"},m(f,null)))))},a.newArticle=function(){var t=new J({user:app.session.user}),e=[];app.forum.attribute("blogTags").forEach((function(t){var a=app.store.getById("tags",t);0!==e.length||a.isChild()||e.push(a)})),t.tags=e,app.composer.load(t),app.composer.show()},e}(s.a),V=a(23),X=a.n(V),Y=a(24),Z=a.n(Y),tt=a(25),et=a.n(tt),at=a(3),ot=function(){Object(at.extend)(X.a.prototype,"config",(function(){var t=this.currentTag(),e="both"===app.forum.attribute("blogRedirectsEnabled")||"tags_only"===app.forum.attribute("blogRedirectsEnabled");if(t&&e){var a=app.forum.attribute("blogTags");(a.indexOf(t.id())>=0||t.parent()&&a.indexOf(t.parent().id())>=0)&&m.route(app.route("blog"))}})),Object(at.override)(Z.a.prototype,"view",(function(t){if(("both"===app.forum.attribute("blogRedirectsEnabled")||"discussions_only"===app.forum.attribute("blogRedirectsEnabled"))&&this.discussion&&this.discussion&&this.discussion.tags().length>0){var e=app.forum.attribute("blogTags");if(this.discussion.tags().filter((function(t){return e.indexOf(t.id())>=0||t.parent()&&e.indexOf(t.parent().id())>=0})).length>0){var a=app.route("blogArticle",{id:this.discussion.id()+"-"+this.discussion.slug()});return document.location.href=a,m("div",{style:{textAlign:"center",padding:"40px 20px"}},m(et.a,{size:"large"}),m("h2",{style:{marginTop:"40px"}},app.translator.trans("v17development-flarum-blog.forum.utils.redirect.title")),app.translator.trans("v17development-flarum-blog.forum.utils.redirect.link",{a:m("a",{href:a})}))}}return t()}))},it=a(26),st=function(t){function e(){return t.apply(this,arguments)||this}return Object(o.a)(e,t),e}(a.n(it)()(E.a,{discussion:E.a.hasOne("discussion"),featuredImage:E.a.attribute("featuredImage"),summary:E.a.attribute("summary"),isFeatured:E.a.attribute("isFeatured"),isSized:E.a.attribute("isSized"),isPendingReview:E.a.attribute("isPendingReview")})),rt=a(27),lt=a.n(rt);function nt(){Object(at.extend)(lt.a.prototype,"view",(function(t){var e=this;if(0==app.forum.attribute("blogHideTags"))return t;var a=app.forum.attribute("blogTags")||[],o=t.children[1].children[1].children[0].children;return t.children[1].children[1].children[0].children=o.map((function(t,o){return a.indexOf(e.tags[o].id())>=0?null:t})),t}))}app.initializers.add("v17development-flarum-blog",(function(t){t.routes.blog={path:"/blog",component:Q.component()},t.routes.blogCategory={path:"/blog/category/:slug",component:Q.component()},t.routes.blogArticle={path:"/blog/:id",component:j.component()},t.store.models.blogMeta=st,H.a.prototype.blogMeta=E.a.hasOne("blogMeta"),ot(),nt()}))}]); +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./forum.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./forum.js": +/*!******************!*\ + !*** ./forum.js ***! + \******************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _src_forum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/forum */ "./src/forum/index.js"); +/* empty/unused harmony star reexport */ + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; }); +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +/***/ }), + +/***/ "./src/common/Models/BlogMeta.js": +/*!***************************************!*\ + !*** ./src/common/Models/BlogMeta.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogMeta; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Model */ "flarum/Model"); +/* harmony import */ var flarum_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Model__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_utils_mixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/utils/mixin */ "flarum/utils/mixin"); +/* harmony import */ var flarum_utils_mixin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_mixin__WEBPACK_IMPORTED_MODULE_2__); + + + + +var BlogMeta = /*#__PURE__*/function (_mixin) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogMeta, _mixin); + + function BlogMeta() { + return _mixin.apply(this, arguments) || this; + } + + return BlogMeta; +}(flarum_utils_mixin__WEBPACK_IMPORTED_MODULE_2___default()(flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a, { + discussion: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.hasOne('discussion'), + featuredImage: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.attribute('featuredImage'), + summary: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.attribute('summary'), + isFeatured: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.attribute('isFeatured'), + isSized: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.attribute('isSized'), + isPendingReview: flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.attribute('isPendingReview') +})); + + + +/***/ }), + +/***/ "./src/forum/components/BlogCategories.js": +/*!************************************************!*\ + !*** ./src/forum/components/BlogCategories.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogCategories; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Component */ "flarum/Component"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Component__WEBPACK_IMPORTED_MODULE_1__); + + + +var BlogCategories = /*#__PURE__*/function (_Component) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogCategories, _Component); + + function BlogCategories() { + return _Component.apply(this, arguments) || this; + } + + var _proto = BlogCategories.prototype; + + _proto.init = function init() { + this.blogCategories = app.forum.attribute('blogTags'); + }; + + _proto.view = function view() { + var _this = this; + + return m("div", { + className: "BlogCategories" + }, m("h3", null, app.translator.trans('v17development-flarum-blog.forum.categories')), this.blogCategories && this.blogCategories.map(function (tagId) { + var tag = app.store.getById('tags', tagId); + if (!tag) return null; + var tags = []; // Add tag + + tags.push(_this.categoryItem(tag)); // Add tags + + app.store.all('tags').forEach(function (_tag) { + if (_tag.isChild() && _tag.parent().id() === tag.id()) { + tags.push(_this.categoryItem(_tag)); + } + }); + return tags; + })); + } // Category item + ; + + _proto.categoryItem = function categoryItem(tag) { + return m("a", { + href: app.route("blogCategory", { + slug: tag.slug() + }), + className: "BlogCategories-item BlogCategories-item-" + tag.id() + " " + (tag.isChild() && app.forum.attribute('blogCategoryHierarchy') == true ? 'BlogCategories-item-child' : ''), + config: m.route + }, m("span", { + className: tag.icon() === '' ? 'BlogCategories-item-colored' : '', + style: { + backgroundColor: tag.icon() === '' ? tag.color() : null + } + }, m("i", { + className: tag.icon() + })), tag.name()); + }; + + return BlogCategories; +}(flarum_Component__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/BlogItemSidebar/BlogAuthor.js": +/*!************************************************************!*\ + !*** ./src/forum/components/BlogItemSidebar/BlogAuthor.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogAuthor; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Component */ "flarum/Component"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Component__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/utils/ItemList */ "flarum/utils/ItemList"); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/helpers/listItems */ "flarum/helpers/listItems"); +/* harmony import */ var flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_helpers_avatar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/helpers/avatar */ "flarum/helpers/avatar"); +/* harmony import */ var flarum_helpers_avatar__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_helpers_avatar__WEBPACK_IMPORTED_MODULE_4__); + + + + + + +var BlogAuthor = /*#__PURE__*/function (_Component) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogAuthor, _Component); + + function BlogAuthor() { + return _Component.apply(this, arguments) || this; + } + + var _proto = BlogAuthor.prototype; + + _proto.view = function view() { + return m("div", { + className: "FlarumBlog-Article-Author" + }, m("div", { + className: "FlarumBlog-Article-Author-background " + (this.props.loading ? 'FlarumBlog-Author-Ghost' : ''), + style: { + backgroundColor: this.props.article && this.props.article.user() ? this.props.article && this.props.article.user().color() : null + } + }), m("div", { + className: "FlarumBlog-Article-Author-Avatar" + }, this.props.article && this.props.article.user() ? flarum_helpers_avatar__WEBPACK_IMPORTED_MODULE_4___default()(this.props.article.user()) : m("span", { + className: "Avatar FlarumBlog-Author-Ghost" + })), this.props.article && this.props.article.user() && m("div", { + className: "FlarumBlog-Article-Author-Info" + }, m("span", { + className: "FlarumBlog-Article-Author-Name" + }, this.props.article.user().displayName()), m("p", { + className: "FlarumBlog-Article-Author-Bio" + }, this.props.article.user().bio && this.props.article.user().bio()), m("ul", { + className: "FlarumBlog-Article-Author-Extended" + }, flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3___default()(this.items().toArray()))), this.props.loading && m("div", null, m("span", { + className: "FlarumBlog-Article-Author-Name FlarumBlog-Author-Ghost" + }, "\xA0"), m("p", { + className: "FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost" + }, "\xA0"), m("p", { + className: "FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost" + }, "\xA0"), m("p", { + className: "FlarumBlog-Article-Author-Bio FlarumBlog-Author-Ghost" + }, "\xA0"))); + }; + + _proto.items = function items() { + return new flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default.a(); + }; + + return BlogAuthor; +}(flarum_Component__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/BlogItemSidebar/BlogItemSidebar.js": +/*!*****************************************************************!*\ + !*** ./src/forum/components/BlogItemSidebar/BlogItemSidebar.js ***! + \*****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogItemSidebar; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Component */ "flarum/Component"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Component__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/utils/ItemList */ "flarum/utils/ItemList"); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/helpers/listItems */ "flarum/helpers/listItems"); +/* harmony import */ var flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _BlogAuthor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BlogAuthor */ "./src/forum/components/BlogItemSidebar/BlogAuthor.js"); +/* harmony import */ var _BlogCategories__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../BlogCategories */ "./src/forum/components/BlogCategories.js"); + + + + + + + +var BlogItemSidebar = /*#__PURE__*/function (_Component) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogItemSidebar, _Component); + + function BlogItemSidebar() { + return _Component.apply(this, arguments) || this; + } + + var _proto = BlogItemSidebar.prototype; + + _proto.view = function view() { + return m("div", { + className: "FlarumBlog-Article-Sidebar" + }, m("ul", null, flarum_helpers_listItems__WEBPACK_IMPORTED_MODULE_3___default()(this.items().toArray()))); + }; + + _proto.items = function items() { + var itemlist = new flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default.a(); + itemlist.add("author", _BlogAuthor__WEBPACK_IMPORTED_MODULE_4__["default"].component(this.props), 0); + itemlist.add("categories", _BlogCategories__WEBPACK_IMPORTED_MODULE_5__["default"].component(this.props), 0); + return itemlist; + }; + + return BlogItemSidebar; +}(flarum_Component__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/BlogPostController.js": +/*!****************************************************!*\ + !*** ./src/forum/components/BlogPostController.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogPostController; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Component */ "flarum/Component"); +/* harmony import */ var flarum_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Component__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_tags_components_TagDiscussionModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/tags/components/TagDiscussionModal */ "flarum/tags/components/TagDiscussionModal"); +/* harmony import */ var flarum_tags_components_TagDiscussionModal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_tags_components_TagDiscussionModal__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/utils/DiscussionControls */ "flarum/utils/DiscussionControls"); +/* harmony import */ var flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/components/Alert */ "flarum/components/Alert"); +/* harmony import */ var flarum_components_Alert__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Alert__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var flarum_components_Dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/components/Dropdown */ "flarum/components/Dropdown"); +/* harmony import */ var flarum_components_Dropdown__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Dropdown__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _Modals_BlogPostSettingsModal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modals/BlogPostSettingsModal */ "./src/forum/components/Modals/BlogPostSettingsModal.js"); +/* harmony import */ var flarum_components_EditPostComposer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/components/EditPostComposer */ "flarum/components/EditPostComposer"); +/* harmony import */ var flarum_components_EditPostComposer__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_components_EditPostComposer__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var flarum_utils_extractText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/utils/extractText */ "flarum/utils/extractText"); +/* harmony import */ var flarum_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_extractText__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _Modals_RenameArticleModal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Modals/RenameArticleModal */ "./src/forum/components/Modals/RenameArticleModal.js"); + + + + + + + + + + + + +var BlogPostController = /*#__PURE__*/function (_Component) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogPostController, _Component); + + function BlogPostController() { + return _Component.apply(this, arguments) || this; + } + + var _proto = BlogPostController.prototype; + + _proto.init = function init() { + this.loadedPost = false; + }; + + _proto.view = function view() { + var _this = this; + + var article = this.props.article; + var buttons = []; // Rename article + + if (article.canRename()) { + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: function onclick() { + return app.modal.show(new _Modals_RenameArticleModal__WEBPACK_IMPORTED_MODULE_10__["default"]({ + article: article + })); + }, + icon: 'fas fa-pencil-alt', + children: app.translator.trans('v17development-flarum-blog.forum.tools.rename_article') + })); + } + + var articlePost = article.firstPost() ? article.firstPost() : app.store.getById('posts', article.firstPostId()); // Edit article + + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + disabled: !articlePost || !articlePost.canEdit(), + onclick: function onclick() { + app.composer.load(new flarum_components_EditPostComposer__WEBPACK_IMPORTED_MODULE_8___default.a({ + post: articlePost + })); + app.composer.show(); + }, + icon: 'fas fa-edit', + children: app.translator.trans('v17development-flarum-blog.forum.tools.edit_article') + })); // Article settings + + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: function onclick() { + return app.modal.show(new _Modals_BlogPostSettingsModal__WEBPACK_IMPORTED_MODULE_7__["default"]({ + article: article + })); + }, + icon: 'fas fa-cogs', + children: app.translator.trans('v17development-flarum-blog.forum.tools.article_settings') + })); // Update categories + + if (article.canTag()) { + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: function onclick() { + return app.modal.show(new flarum_tags_components_TagDiscussionModal__WEBPACK_IMPORTED_MODULE_2___default.a({ + discussion: article + })); + }, + icon: 'fas fa-tag', + children: app.translator.trans('v17development-flarum-blog.forum.tools.update_category') + })); + } // Approve article + + + if (article.blogMeta() && article.blogMeta().isPendingReview()) { + buttons.push(m("li", { + className: "Dropdown-separator" + })); + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + disabled: !app.forum.attribute('canApproveBlogPosts'), + onclick: function onclick() { + article.blogMeta().save({ + isPendingReview: false + }).then(function () { + app.alerts.show(new flarum_components_Alert__WEBPACK_IMPORTED_MODULE_4___default.a({ + type: 'success', + children: app.translator.trans('v17development-flarum-blog.forum.review_article.approve_article_approved') + })); + }, function (response) { + _this.loading = false; + + _this.handleErrors(response); + }); + }, + icon: 'fas fa-thumbs-up', + children: app.translator.trans('v17development-flarum-blog.forum.review_article.approve_article') + })); + } + + buttons.push(m("li", { + className: "Dropdown-separator" + })); // Lock article + + if (article.canLock()) { + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3___default.a.lockAction.bind(article), + icon: "fas " + (article.isLocked() ? 'fa-comments' : 'fa-comment-slash'), + children: article.isLocked() ? app.translator.trans('v17development-flarum-blog.forum.tools.enable_comments') : app.translator.trans('v17development-flarum-blog.forum.tools.disable_comments') + })); + } // Hide/show/delete + + + if (article.canHide()) { + // Article is hidden + if (article.isHidden()) { + // Recover article + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3___default.a.restoreAction.bind(article), + icon: 'fas fa-eye', + children: app.translator.trans('v17development-flarum-blog.forum.tools.recover_article') + })); // Delete article + + if (article.canDelete()) { + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: function onclick() { + // Confirm deletion + if (confirm(flarum_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default()(app.translator.trans('core.forum.discussion_controls.delete_confirmation')))) { + // Redirect if the current page is an blog article + if (app.history.getCurrent().name === 'blogArticle') { + if (app.previous) { + app.history.back(); + } else { + m.route(app.route('blog')); + } + } + + return article["delete"]().then(function () { + m.redraw(); + }); + } + }, + icon: 'far fa-trash-alt', + children: app.translator.trans('v17development-flarum-blog.forum.tools.delete_forever') + })); + } + } else { + // Hide article + buttons.push(flarum_components_Button__WEBPACK_IMPORTED_MODULE_5___default.a.component({ + className: 'Button', + onclick: flarum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_3___default.a.hideAction.bind(article), + icon: 'fas fa-eye-slash', + children: app.translator.trans('v17development-flarum-blog.forum.tools.hide_article') + })); + } + } + + return m("div", { + className: "FlarumBlog-Article-Content-Edit-Button" + }, m("div", { + className: "FlarumBlog-Article-Content-Edit-Dropdown" + }, flarum_components_Dropdown__WEBPACK_IMPORTED_MODULE_6___default.a.component({ + icon: 'fas fa-cog', + label: 'Manage', + buttonClassName: 'Button', + menuClassName: 'Dropdown-menu--right', + children: buttons, + onshow: function onshow() { + // Get post data to make sure they can edit the post + if (articlePost && !articlePost.canEdit() && !_this.loadedPost) { + _this.loadedPost = true; + app.store.find('posts', article.firstPost() ? article.firstPost().id() : article.firstPostId()).then(function () {})["catch"](function () {}).then(function () { + return m.redraw(); + }); + } + } + }))); + }; + + return BlogPostController; +}(flarum_Component__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/Modals/BlogPostSettingsModal.js": +/*!**************************************************************!*\ + !*** ./src/forum/components/Modals/BlogPostSettingsModal.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogPostSettingsModal; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Modal */ "flarum/components/Modal"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/utils/ItemList */ "flarum/utils/ItemList"); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/components/Switch */ "flarum/components/Switch"); +/* harmony import */ var flarum_components_Switch__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Switch__WEBPACK_IMPORTED_MODULE_4__); + + + + + + +var BlogPostSettingsModal = /*#__PURE__*/function (_Modal) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogPostSettingsModal, _Modal); + + function BlogPostSettingsModal() { + return _Modal.apply(this, arguments) || this; + } + + var _proto = BlogPostSettingsModal.prototype; + + _proto.init = function init() { + _Modal.prototype.init.call(this); + + this.isNew = this.props.article.blogMeta() ? false : true; + this.meta = this.props.article.blogMeta() ? this.props.article.blogMeta() : app.store.createRecord('blogMeta'); + this.summary = m.prop(this.meta.summary() || ''); + this.featuredImage = m.prop(this.meta.featuredImage() || ''); + this.isFeatured = m.prop(this.meta.isFeatured() || false); + this.isSized = m.prop(this.meta.isSized() || false); + this.isPendingReview = m.prop(this.meta.isPendingReview() || false); + }; + + _proto.className = function className() { + return 'Modal--small Support-Modal'; + }; + + _proto.title = function title() { + return 'Blog post settings'; + }; + + _proto.content = function content() { + return m("div", { + className: "Modal-body" + }, m("div", { + className: "Form" + }, this.fields().toArray())); + }; + + _proto.fields = function fields() { + var _this = this; + + var items = new flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default.a(); + items.add('summary', m("div", { + className: "Form-group" + }, m("label", null, "Article summary:"), m("textarea", { + className: "FormControl", + style: { + maxWidth: '100%', + minWidth: '100%', + width: '100%', + minHeight: '120px' + }, + value: this.summary(), + placeholder: "Please enter a summary", + oninput: m.withAttr('value', this.summary) + }), m("small", null, "This summary will be visible on the blog overview page and will be used for SEO purposes.")), 30); + items.add('image', m("div", { + className: "Form-group" + }, m("label", null, "Article image URL:"), m("input", { + type: "text", + className: "FormControl", + value: this.featuredImage(), + placeholder: "https://", + oninput: m.withAttr('value', this.featuredImage) + }), m("small", null, "Best image resolution for social media: 1200x630"), this.featuredImage() != "" && m("img", { + src: this.featuredImage(), + alt: this.props.article.title(), + title: "Blog post image", + width: "100%", + style: { + marginTop: '15px' + } + })), 30); + items.add('sized', m("div", { + className: "Form-group" + }, flarum_components_Switch__WEBPACK_IMPORTED_MODULE_4___default.a.component({ + state: this.isSized() == true, + onchange: function onchange(val) { + _this.isSized(val); + }, + children: [m("b", null, "Highlighted post"), m("div", { + className: "helpText", + style: { + fontWeight: 500 + } + }, "Give this post a big image on the blog overview page.")] + })), -10); + items.add('submit', m("div", { + className: "Form-group" + }, flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default.a.component({ + type: 'submit', + className: 'Button Button--primary SupportModal-save', + loading: this.loading, + children: 'Update' + })), -10); + return items; + }; + + _proto.submitData = function submitData() { + return { + summary: this.summary(), + featuredImage: this.featuredImage(), + isFeatured: this.isFeatured(), + isSized: this.isSized(), + isPendingReview: this.isPendingReview(), + relationships: this.isNew && { + discussion: this.props.article + } + }; + }; + + _proto.onsubmit = function onsubmit(e) { + var _this2 = this; + + e.preventDefault(); + this.loading = true; + this.meta.save(this.submitData()).then(function () { + if (_this2.isNew) { + _this2.props.article.pushData({ + relationships: { + blogMeta: _this2.meta + } + }); + } + + _this2.hide(); + + m.redraw(); + }, function (response) { + _this2.loading = false; + + _this2.handleErrors(response); + }); + }; + + return BlogPostSettingsModal; +}(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/Modals/RenameArticleModal.js": +/*!***********************************************************!*\ + !*** ./src/forum/components/Modals/RenameArticleModal.js ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RenameArticleModal; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Modal */ "flarum/components/Modal"); +/* harmony import */ var flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/utils/ItemList */ "flarum/utils/ItemList"); +/* harmony import */ var flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_utils_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/utils/string */ "flarum/utils/string"); +/* harmony import */ var flarum_utils_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_utils_string__WEBPACK_IMPORTED_MODULE_4__); + + + + + + +var RenameArticleModal = /*#__PURE__*/function (_Modal) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(RenameArticleModal, _Modal); + + function RenameArticleModal() { + return _Modal.apply(this, arguments) || this; + } + + var _proto = RenameArticleModal.prototype; + + _proto.init = function init() { + _Modal.prototype.init.call(this); + + this.article = this.props.article; + this.name = m.prop(this.article.title() || ''); + this.slug = m.prop(this.article.slug() || ''); + this.redirect = this.props.redirect; + }; + + _proto.className = function className() { + return 'Modal--small Support-Modal'; + }; + + _proto.title = function title() { + return app.translator.trans('v17development-flarum-blog.forum.tools.rename_article'); + }; + + _proto.content = function content() { + return m("div", { + className: "Modal-body" + }, m("div", { + className: "Form" + }, this.fields().toArray())); + }; + + _proto.fields = function fields() { + var _this = this; + + var items = new flarum_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default.a(); + items.add('name', m("div", { + className: "Form-group" + }, m("label", null, app.translator.trans('v17development-flarum-blog.forum.article.title'), ":"), m("input", { + className: "FormControl", + placeholder: app.translator.trans('v17development-flarum-blog.forum.article.title'), + value: this.name(), + oninput: function oninput(e) { + _this.name(e.target.value); + + _this.slug(Object(flarum_utils_string__WEBPACK_IMPORTED_MODULE_4__["slug"])(e.target.value)); + } + })), 50); + items.add('slug', m("div", { + className: "Form-group" + }, m("label", null, app.translator.trans('v17development-flarum-blog.forum.article.slug'), ":"), m("input", { + className: "FormControl", + placeholder: app.translator.trans('v17development-flarum-blog.forum.article.slug'), + value: this.slug(), + oninput: m.withAttr('value', this.slug) + })), 40); + items.add('submit', m("div", { + className: "Form-group" + }, flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default.a.component({ + type: 'submit', + className: 'Button Button--primary SupportModal-save', + loading: this.loading, + children: 'Update' + })), -10); + return items; + }; + + _proto.submitData = function submitData() { + return { + title: this.name(), + slug: this.slug() + }; + }; + + _proto.onsubmit = function onsubmit(e) { + var _this2 = this; + + e.preventDefault(); + this.loading = true; + this.article.save({ + title: this.name(), + slug: this.slug() + }).then(function () { + _this2.hide(); // Redirect + + + if (_this2.redirect) { + var url = "/knowledgebase/" + _this2.article.id() + "-" + _this2.slug(); + + m.route(url, true); + window.history.replaceState(null, document.title, url); + } + }, function (response) { + _this2.loading = false; + + _this2.handleErrors(response); + }); + }; + + return RenameArticleModal; +}(flarum_components_Modal__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/index.js": +/*!****************************!*\ + !*** ./src/forum/index.js ***! + \****************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _pages_BlogItem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pages/BlogItem */ "./src/forum/pages/BlogItem.js"); +/* harmony import */ var flarum_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/Model */ "flarum/Model"); +/* harmony import */ var flarum_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_Model__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_models_Discussion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/models/Discussion */ "flarum/models/Discussion"); +/* harmony import */ var flarum_models_Discussion__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_models_Discussion__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _pages_BlogOverview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pages/BlogOverview */ "./src/forum/pages/BlogOverview.js"); +/* harmony import */ var _utils_redirector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/redirector */ "./src/forum/utils/redirector.js"); +/* harmony import */ var _common_Models_BlogMeta__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/Models/BlogMeta */ "./src/common/Models/BlogMeta.js"); +/* harmony import */ var _utils_extendTagOverview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/extendTagOverview */ "./src/forum/utils/extendTagOverview.js"); + + + + + + + // Register Flarum Blog + +app.initializers.add('v17development-flarum-blog', function (app) { + app.routes.blog = { + path: '/blog', + component: _pages_BlogOverview__WEBPACK_IMPORTED_MODULE_3__["default"].component() + }; + app.routes.blogCategory = { + path: '/blog/category/:slug', + component: _pages_BlogOverview__WEBPACK_IMPORTED_MODULE_3__["default"].component() + }; + app.routes.blogArticle = { + path: '/blog/:id', + component: _pages_BlogItem__WEBPACK_IMPORTED_MODULE_0__["default"].component() + }; + app.store.models.blogMeta = _common_Models_BlogMeta__WEBPACK_IMPORTED_MODULE_5__["default"]; + flarum_models_Discussion__WEBPACK_IMPORTED_MODULE_2___default.a.prototype.blogMeta = flarum_Model__WEBPACK_IMPORTED_MODULE_1___default.a.hasOne('blogMeta'); // Redirect discussions/tags to their blog post/overview + + Object(_utils_redirector__WEBPACK_IMPORTED_MODULE_4__["default"])(); // Extend tag overview. + // Hide tags which are used as blog category + + Object(_utils_extendTagOverview__WEBPACK_IMPORTED_MODULE_6__["default"])(); +}); + +/***/ }), + +/***/ "./src/forum/pages/BlogItem.js": +/*!*************************************!*\ + !*** ./src/forum/pages/BlogItem.js ***! + \*************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogItem; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Page */ "flarum/components/Page"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_components_CommentPost__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/components/CommentPost */ "flarum/components/CommentPost"); +/* harmony import */ var flarum_components_CommentPost__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_components_CommentPost__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/components/ReplyComposer */ "flarum/components/ReplyComposer"); +/* harmony import */ var flarum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var flarum_components_PostStream__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/components/PostStream */ "flarum/components/PostStream"); +/* harmony import */ var flarum_components_PostStream__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_components_PostStream__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _components_BlogPostController__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../components/BlogPostController */ "./src/forum/components/BlogPostController.js"); +/* harmony import */ var _components_BlogItemSidebar_BlogItemSidebar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/BlogItemSidebar/BlogItemSidebar */ "./src/forum/components/BlogItemSidebar/BlogItemSidebar.js"); + + + + + + + + + +var BlogItem = /*#__PURE__*/function (_Page) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogItem, _Page); + + function BlogItem() { + return _Page.apply(this, arguments) || this; + } + + var _proto = BlogItem.prototype; + + _proto.init = function init() { + _Page.prototype.init.call(this); + + app.setTitle(app.translator.trans('v17development-flarum-blog.forum.blog')); // Send history push + + app.history.push('blogArticle'); + this.bodyClass = 'BlogItemPage'; + this.loading = true; + this.found = false; + this.article = null; // this.posts = []; + + this.loadBlogItem(); + } // Load blog overview + ; + + _proto.loadBlogItem = function loadBlogItem() { + var preloadBlogOverview = app.preloadedApiDocument(); + + if (preloadBlogOverview) { + // We must wrap this in a setTimeout because if we are mounting this + // component for the first time on page load, then any calls to m.redraw + // will be ineffective and thus any configs (scroll code) will be run + // before stuff is drawn to the page. + setTimeout(this.show.bind(this, preloadBlogOverview), 0); + } else { + app.store.find('discussions', m.route.param('id').split('-')[0]).then(this.show.bind(this))["catch"](function () { + m.redraw(); + }); + } + + m.lazyRedraw(); + } // Show blog post + ; + + _proto.show = function show(article) { + // Set article data + this.article = article; // Update title + + app.setTitle(article.title() + " - " + app.translator.trans('v17development-flarum-blog.forum.blog')); + this.loading = false; + var includedPosts = []; + + if (article.payload && article.payload.included) { + var articleId = article.id(); + includedPosts = article.payload.included.filter(function (record) { + return record.type === 'posts' && record.relationships && record.relationships.discussion && record.relationships.discussion.data.id === articleId; + }).map(function (record) { + return app.store.getById('posts', record.id); + }).sort(function (a, b) { + return a.id() - b.id(); + }).slice(0, 20); + } + + this.stream = new flarum_components_PostStream__WEBPACK_IMPORTED_MODULE_5___default.a({ + discussion: article, + includedPosts: includedPosts + }); + this.stream.on('positionChanged', this.positionChanged.bind(this)); + m.lazyRedraw(); + }; + + _proto.view = function view() { + var blogImage = this.article && this.article.blogMeta() && this.article.blogMeta().featuredImage() ? "url(" + this.article.blogMeta().featuredImage() + ")" : null; + var articlePost = null; + + if (!this.loading && this.article) { + articlePost = this.article.firstPost() ? this.article.firstPost() : app.store.getById('posts', this.article.firstPostId()); + } + + return m("div", { + className: "FlarumBlogItem" + }, m("div", { + className: "container" + }, m("div", { + className: "FlarumBlog-ToolButtons" + }, m(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default.a, { + className: "Button", + onclick: function onclick() { + if (app.previous && app.previous.props.routeName === "blog") { + app.history.back(); + } else { + m.route(app.route("blog")); + } + }, + icon: "fas fa-angle-left" + }, app.translator.trans('v17development-flarum-blog.forum.return_to_overview'))), m("div", { + className: "FlarumBlog-Article" + }, m("div", { + className: "FlarumBlog-Article-Container" + }, m("div", { + className: "FlarumBlog-Article-Content" + }, m("div", { + className: "FlarumBlog-Article-Image FlarumBlog-default-image " + (this.loading ? 'FlarumBlog-Article-GhostImage' : ''), + style: { + backgroundImage: blogImage, + opacity: this.article && this.article.isHidden() ? 0.4 : null + } + }), this.article && app.session.user && (app.session.user.canEdit() || this.article.canRename() || this.article.posts() && this.article.posts()[0].canEdit()) && m(_components_BlogPostController__WEBPACK_IMPORTED_MODULE_6__["default"], { + article: this.article + }), m("div", { + className: "FlarumBlog-Article-Categories" + }, !this.loading && this.article && this.article.tags() && this.article.tags().map(function (tag) { + return m("a", { + href: app.route("blogCategory", { + slug: tag.slug() + }), + config: m.route + }, tag.name()); + }), this.loading && [0, 1].map(function () { + return m("span", { + className: "FlarumBlog-Article-GhostCategory" + }, "Category"); + })), m("div", { + className: "FlarumBlog-Article-Post" + }, m("h3", { + className: this.loading ? 'FlarumBlog-Article-GhostTitle' : null + }, this.article ? this.article.title() : 'Ghost title', this.article && this.article.isHidden() && "(" + app.translator.trans('v17development-flarum-blog.forum.hidden') + ")"), this.loading && [0, 1, 2].map(function () { + return m("div", null, m("p", { + className: "FlarumBlog-Article-GhostParagraph" + }, "\xA0"), m("p", { + className: "FlarumBlog-Article-GhostParagraph" + }, "\xA0"), m("p", { + className: "FlarumBlog-Article-GhostParagraph" + }, "\xA0"), m("p", null, "\xA0")); + }), !this.loading && this.article.blogMeta() && this.article.blogMeta().isPendingReview() == true && m("div", { + className: "Post" + }, m("blockquote", { + "class": "uncited", + style: { + fontSize: '16px' + } + }, m("div", null, m("span", { + className: "far fa-clock", + style: { + marginRight: '5px' + } + }), " ", app.translator.trans('v17development-flarum-blog.forum.review_article.pending_review')))), !this.loading && articlePost && m(flarum_components_CommentPost__WEBPACK_IMPORTED_MODULE_3___default.a, { + post: articlePost + }))), m("div", { + className: "FlarumBlog-Article-Comments" + }, m("h4", null, app.translator.trans('v17development-flarum-blog.forum.comment_section.comments'), " (", this.article ? this.article.commentCount() - 1 : 0, ")"), !this.loading && this.article.isLocked && this.article.isLocked() && m("div", { + className: "Post-body" + }, m("blockquote", { + "class": "uncited" + }, m("div", null, m("span", { + className: "far fa-lock", + style: { + marginRight: '5px' + } + }), " ", app.translator.trans('v17development-flarum-blog.forum.comment_section.locked')))), !this.loading && this.stream && this.stream.render())), m(_components_BlogItemSidebar_BlogItemSidebar__WEBPACK_IMPORTED_MODULE_7__["default"], { + article: this.article, + loading: this.loading + })))); + }; + + _proto.positionChanged = function positionChanged(startNumber, endNumber) { + var article = this.article; + + if (app.session.user && endNumber > (article.lastReadPostNumber() || 0)) { + article.save({ + lastReadPostNumber: endNumber + }); + m.redraw(); + } + }; + + return BlogItem; +}(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/pages/BlogOverview.js": +/*!*****************************************!*\ + !*** ./src/forum/pages/BlogOverview.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogOverview; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/Page */ "flarum/components/Page"); +/* harmony import */ var flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/Button */ "flarum/components/Button"); +/* harmony import */ var flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_helpers_humanTime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/helpers/humanTime */ "flarum/helpers/humanTime"); +/* harmony import */ var flarum_helpers_humanTime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_helpers_humanTime__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _components_BlogCategories__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/BlogCategories */ "./src/forum/components/BlogCategories.js"); +/* harmony import */ var _utils_BlogComposer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/BlogComposer */ "./src/forum/utils/BlogComposer.js"); +/* harmony import */ var _utils_tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/tooltip */ "./src/forum/utils/tooltip.js"); + + + + + + + + +var BlogOverview = /*#__PURE__*/function (_Page) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogOverview, _Page); + + function BlogOverview() { + return _Page.apply(this, arguments) || this; + } + + var _proto = BlogOverview.prototype; + + _proto.init = function init() { + _Page.prototype.init.call(this); + + app.setTitle(app.translator.trans('v17development-flarum-blog.forum.blog')); + this.bodyClass = 'BlogOverviewPage'; + this.isLoading = true; + this.featuredPosts = []; + this.posts = []; + this.hasMore = null; // Send history push + + app.history.push('blog'); + this.loadBlogOverview(); + } // Load blog overview + ; + + _proto.loadBlogOverview = function loadBlogOverview() { + var preloadBlogOverview = app.preloadedApiDocument(); + + if (preloadBlogOverview) { + // We must wrap this in a setTimeout because if we are mounting this + // component for the first time on page load, then any calls to m.redraw + // will be ineffective and thus any configs (scroll code) will be run + // before stuff is drawn to the page. + setTimeout(this.show.bind(this, preloadBlogOverview), 0); + } else { + app.store.find('discussions', { + filter: { + q: "is:blog" + (m.route.param('slug') ? " tag:" + m.route.param('slug') : '') + }, + sort: '-createdAt' + }).then(this.show.bind(this))["catch"](function () { + m.redraw(); + }); + } + + m.lazyRedraw(); + } // Show blog posts + ; + + _proto.show = function show(articles) { + if (articles.length === 0) { + this.isLoading = false; + m.lazyRedraw(); + return; + } + + this.featuredPosts = articles.slice(0, 3); + this.posts = articles.length >= 4 ? articles.slice(3, articles.length) : []; + this.isLoading = false; + m.lazyRedraw(); + }; + + _proto.title = function title() { + if (!m.route.param('slug')) { + return m("h2", null, app.translator.trans('v17development-flarum-blog.forum.recent_posts')); + } + + var tag = app.store.all('tags').filter(function (tag) { + return tag.slug() === m.route.param('slug'); + }); + return m("h2", null, tag && tag[0] && tag[0].name(), m("small", null, " - ", m("a", { + href: app.route("blog"), + config: m.route + }, app.translator.trans('v17development-flarum-blog.forum.return_to_overview')))); + }; + + _proto.view = function view() { + var _this = this; + + return m("div", { + className: "FlarumBlogOverview" + }, m("div", { + className: "container" + }, m("div", { + className: "BlogFeatured" + }, app.forum.attribute('canWriteBlogPosts') && m(flarum_components_Button__WEBPACK_IMPORTED_MODULE_2___default.a, { + className: "Button FlarumBlogWrite", + onclick: function onclick() { + return _this.newArticle(); + }, + icon: "fas fa-pencil" + }, app.translator.trans('v17development-flarum-blog.forum.compose.write_article')), this.title(), m("div", { + style: { + clear: 'both' + } + }), m("div", { + className: "BlogFeatured-list" + }, this.isLoading && [0, 1, 2].map(function () { + return m("div", { + className: "BlogFeatured-list-item BlogFeatured-list-item-ghost" + }, m("div", { + className: "BlogFeatured-list-item-details" + }, m("h4", null, "\xA0"), m("div", { + className: "data" + }, m("span", null, m("i", { + className: "far fa-wave" + }))))); + }), !this.isLoading && this.featuredPosts.length >= 0 && this.featuredPosts.map(function (article) { + var blogImage = article.blogMeta() && article.blogMeta().featuredImage() ? "url(" + article.blogMeta().featuredImage() + ")" : null; + var blogTag = article.tags() ? article.tags().filter(function (tag) { + return tag.isChild(); + }) : []; + return m("a", { + href: app.route("blogArticle", { + id: article.id() + "-" + article.slug() + }), + className: "BlogFeatured-list-item FlarumBlog-default-image", + style: { + backgroundImage: blogImage + }, + config: m.route + }, m("div", { + className: "BlogFeatured-list-item-top" + }, blogTag[0] && m("span", null, blogTag[0].name()), article.isSticky() && m("span", null, m("i", { + className: "fas fa-thumbtack" + })), (article.blogMeta() && article.blogMeta().isPendingReview() == true || article.isHidden()) && m("span", null, m("i", { + className: "fas fa-eye-slash" + })), article.blogMeta() && article.blogMeta().isPendingReview() == true && m("span", { + title: app.translator.trans('v17development-flarum-blog.forum.review_article.pending_review'), + config: _utils_tooltip__WEBPACK_IMPORTED_MODULE_6__["default"].bind(_this), + "data-placement": "bottom" + }, m("i", { + className: "far fa-clock" + }), " ", app.translator.trans('v17development-flarum-blog.forum.review_article.pending_review_title'))), m("div", { + className: "BlogFeatured-list-item-details" + }, m("h4", null, article.title()), m("div", { + className: "data" + }, m("span", null, m("i", { + className: "far fa-clock" + }), " ", flarum_helpers_humanTime__WEBPACK_IMPORTED_MODULE_3___default()(article.createdAt())), m("span", null, m("i", { + className: "far fa-user" + }), " ", article.user() ? article.user().displayName() : '[Deleted]'), m("span", null, m("i", { + className: "far fa-comment" + }), " ", article.commentCount())))); + }))), m("div", { + className: "BlogScrubber" + }, m("div", { + className: "BlogList" + }, this.isLoading && [false, false, true, false].map(function (state) { + return m("div", { + className: "BlogList-item BlogList-item-" + (state === true ? 'sized' : 'default') + " BlogList-item-ghost" + }, m("div", { + className: "BlogList-item-photo FlarumBlog-default-image" + }), m("div", { + className: "BlogList-item-content" + }, m("h4", null, "\xA0"), m("p", null, "\xA0"), m("div", { + className: "data" + }, m("span", null, m("i", { + className: "far fa-wave" + }))))); + }), !this.isLoading && this.posts.length >= 1 && this.posts.map(function (article) { + var blogImage = article.blogMeta() && article.blogMeta().featuredImage() ? "url(" + article.blogMeta().featuredImage() + ")" : null; + var isSized = article.blogMeta() && article.blogMeta().isSized(); + var summary = article.blogMeta() && article.blogMeta().summary() ? article.blogMeta().summary() : ""; + return m("a", { + href: app.route("blogArticle", { + id: article.id() + "-" + article.slug() + }), + className: "BlogList-item BlogList-item-" + (isSized ? 'sized' : 'default'), + config: m.route + }, m("div", { + className: "BlogList-item-photo FlarumBlog-default-image", + style: { + backgroundImage: blogImage + } + }), m("div", { + className: "BlogList-item-content" + }, m("h4", null, article.title(), (article.blogMeta() && article.blogMeta().isPendingReview() == true || article.isHidden()) && m("i", { + className: "fas fa-eye-slash" + }), article.blogMeta() && article.blogMeta().isPendingReview() == true && m("i", { + className: "far fa-clock", + title: app.translator.trans('v17development-flarum-blog.forum.review_article.pending_review'), + config: _utils_tooltip__WEBPACK_IMPORTED_MODULE_6__["default"].bind(_this) + })), m("p", null, summary), m("div", { + className: "data" + }, m("span", null, m("i", { + className: "far fa-clock" + }), " ", flarum_helpers_humanTime__WEBPACK_IMPORTED_MODULE_3___default()(article.createdAt())), m("span", null, m("i", { + className: "far fa-user" + }), " ", article.user() ? article.user().displayName() : '[Deleted]'), m("span", null, m("i", { + className: "far fa-comment" + }), " ", article.commentCount())))); + }), !this.isLoading && this.featuredPosts.length > 0 && this.posts.length === 0 && m("p", { + className: "FlarumBlog-reached-end" + }, app.translator.trans('v17development-flarum-blog.forum.no_more_posts')), !this.isLoading && this.featuredPosts.length === 0 && this.posts.length === 0 && m("p", { + className: "FlarumBlog-reached-end" + }, app.translator.trans('v17development-flarum-blog.forum.category_empty'))), m("div", { + className: "Sidebar" + }, m(_components_BlogCategories__WEBPACK_IMPORTED_MODULE_4__["default"], null))))); + }; + + _proto.newArticle = function newArticle() { + var component = new _utils_BlogComposer__WEBPACK_IMPORTED_MODULE_5__["default"]({ + user: app.session.user + }); + var tags = []; + app.forum.attribute('blogTags').forEach(function (tagId) { + var tag = app.store.getById('tags', tagId); + + if (tag && tags.length === 0 && !tag.isChild()) { + tags.push(tag); + } + }); // Update tags + + component.tags = tags; + app.composer.load(component); + app.composer.show(); + }; + + return BlogOverview; +}(flarum_components_Page__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/utils/BlogComposer.js": +/*!*****************************************!*\ + !*** ./src/forum/utils/BlogComposer.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlogComposer; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/DiscussionComposer */ "flarum/components/DiscussionComposer"); +/* harmony import */ var flarum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_1__); + + + +var BlogComposer = /*#__PURE__*/function (_DiscussionComposer) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BlogComposer, _DiscussionComposer); + + function BlogComposer() { + return _DiscussionComposer.apply(this, arguments) || this; + } + + var _proto = BlogComposer.prototype; + + _proto.onsubmit = function onsubmit() { + this.loading = true; + var data = this.data(); + app.store.createRecord('discussions').save(data).then(function (article) { + app.composer.hide(); + m.route(app.route('blogArticle', { + id: article.id() + '-' + article.slug() + })); + }, this.loaded.bind(this)); + }; + + return BlogComposer; +}(flarum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/utils/extendTagOverview.js": +/*!**********************************************!*\ + !*** ./src/forum/utils/extendTagOverview.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return extendTagOverview; }); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/extend */ "flarum/extend"); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_extend__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var flarum_tags_components_TagsPage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/tags/components/TagsPage */ "flarum/tags/components/TagsPage"); +/* harmony import */ var flarum_tags_components_TagsPage__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_tags_components_TagsPage__WEBPACK_IMPORTED_MODULE_1__); + + +function extendTagOverview() { + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_0__["extend"])(flarum_tags_components_TagsPage__WEBPACK_IMPORTED_MODULE_1___default.a.prototype, 'view', function (markup) { + var _this = this; + + if (app.forum.attribute('blogHideTags') == false) return markup; // Get knowledge base tag ID's + + var knowledgeBaseTags = app.forum.attribute('blogTags') || []; // Get tiles + + var tag_tiles = markup.children[1].children[1].children[0].children; // Map through the tiles and remove tiles that are part of the knowledge base + + markup.children[1].children[1].children[0].children = tag_tiles.map(function (tile, i) { + return knowledgeBaseTags.indexOf(_this.tags[i].id()) >= 0 ? null : tile; + }); + return markup; + }); +} + +/***/ }), + +/***/ "./src/forum/utils/redirector.js": +/*!***************************************!*\ + !*** ./src/forum/utils/redirector.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var flarum_components_IndexPage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/components/IndexPage */ "flarum/components/IndexPage"); +/* harmony import */ var flarum_components_IndexPage__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_components_IndexPage__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var flarum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/components/DiscussionPage */ "flarum/components/DiscussionPage"); +/* harmony import */ var flarum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/components/LoadingIndicator */ "flarum/components/LoadingIndicator"); +/* harmony import */ var flarum_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/extend */ "flarum/extend"); +/* harmony import */ var flarum_extend__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_extend__WEBPACK_IMPORTED_MODULE_3__); + + + + +/* harmony default export */ __webpack_exports__["default"] = (function () { + // Redirect tag to blog category + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_3__["extend"])(flarum_components_IndexPage__WEBPACK_IMPORTED_MODULE_0___default.a.prototype, 'config', function () { + var tag = this.currentTag(); + var tagRedirectEnabled = app.forum.attribute('blogRedirectsEnabled') === 'both' || app.forum.attribute('blogRedirectsEnabled') === 'tags_only'; // Only trigger when it's a tag page and the redirects are enabled + + if (tag && tagRedirectEnabled) { + var blogTags = app.forum.attribute('blogTags'); // Tag is inside list + + if (blogTags.indexOf(tag.id()) >= 0 || tag.parent() && blogTags.indexOf(tag.parent().id()) >= 0) { + m.route(app.route('blog')); + } + } + }); // Redirect discussion to blog article + + Object(flarum_extend__WEBPACK_IMPORTED_MODULE_3__["override"])(flarum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_1___default.a.prototype, 'view', function (original) { + var discussionRedirectEnabled = app.forum.attribute('blogRedirectsEnabled') === 'both' || app.forum.attribute('blogRedirectsEnabled') === 'discussions_only'; + + if (discussionRedirectEnabled && this.discussion && this.discussion && this.discussion.tags().length > 0) { + var blogTags = app.forum.attribute('blogTags'); + var foundTags = this.discussion.tags().filter(function (tag) { + return blogTags.indexOf(tag.id()) >= 0 || tag.parent() && blogTags.indexOf(tag.parent().id()) >= 0; + }); // Only redirect if the discussion has blog tags + + if (foundTags.length > 0) { + // Redirect to discussion + var url = app.route('blogArticle', { + id: this.discussion.id() + "-" + this.discussion.slug() + }); + document.location.href = url; + return m("div", { + style: { + textAlign: 'center', + padding: '40px 20px' + } + }, m(flarum_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_2___default.a, { + size: "large" + }), m("h2", { + style: { + marginTop: '40px' + } + }, app.translator.trans('v17development-flarum-blog.forum.utils.redirect.title')), app.translator.trans('v17development-flarum-blog.forum.utils.redirect.link', { + a: m("a", { + href: url + }) + })); + } + } + + return original(); + }); +}); + +/***/ }), + +/***/ "./src/forum/utils/tooltip.js": +/*!************************************!*\ + !*** ./src/forum/utils/tooltip.js ***! + \************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return tooltip; }); +function tooltip(element) { + $(element).tooltip(); +} + +/***/ }), + +/***/ "flarum/Component": +/*!**************************************************!*\ + !*** external "flarum.core.compat['Component']" ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['Component']; + +/***/ }), + +/***/ "flarum/Model": +/*!**********************************************!*\ + !*** external "flarum.core.compat['Model']" ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['Model']; + +/***/ }), + +/***/ "flarum/components/Alert": +/*!*********************************************************!*\ + !*** external "flarum.core.compat['components/Alert']" ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Alert']; + +/***/ }), + +/***/ "flarum/components/Button": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['components/Button']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Button']; + +/***/ }), + +/***/ "flarum/components/CommentPost": +/*!***************************************************************!*\ + !*** external "flarum.core.compat['components/CommentPost']" ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/CommentPost']; + +/***/ }), + +/***/ "flarum/components/DiscussionComposer": +/*!**********************************************************************!*\ + !*** external "flarum.core.compat['components/DiscussionComposer']" ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/DiscussionComposer']; + +/***/ }), + +/***/ "flarum/components/DiscussionPage": +/*!******************************************************************!*\ + !*** external "flarum.core.compat['components/DiscussionPage']" ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/DiscussionPage']; + +/***/ }), + +/***/ "flarum/components/Dropdown": +/*!************************************************************!*\ + !*** external "flarum.core.compat['components/Dropdown']" ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Dropdown']; + +/***/ }), + +/***/ "flarum/components/EditPostComposer": +/*!********************************************************************!*\ + !*** external "flarum.core.compat['components/EditPostComposer']" ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/EditPostComposer']; + +/***/ }), + +/***/ "flarum/components/IndexPage": +/*!*************************************************************!*\ + !*** external "flarum.core.compat['components/IndexPage']" ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/IndexPage']; + +/***/ }), + +/***/ "flarum/components/LoadingIndicator": +/*!********************************************************************!*\ + !*** external "flarum.core.compat['components/LoadingIndicator']" ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/LoadingIndicator']; + +/***/ }), + +/***/ "flarum/components/Modal": +/*!*********************************************************!*\ + !*** external "flarum.core.compat['components/Modal']" ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Modal']; + +/***/ }), + +/***/ "flarum/components/Page": +/*!********************************************************!*\ + !*** external "flarum.core.compat['components/Page']" ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Page']; + +/***/ }), + +/***/ "flarum/components/PostStream": +/*!**************************************************************!*\ + !*** external "flarum.core.compat['components/PostStream']" ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/PostStream']; + +/***/ }), + +/***/ "flarum/components/ReplyComposer": +/*!*****************************************************************!*\ + !*** external "flarum.core.compat['components/ReplyComposer']" ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/ReplyComposer']; + +/***/ }), + +/***/ "flarum/components/Switch": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['components/Switch']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['components/Switch']; + +/***/ }), + +/***/ "flarum/extend": +/*!***********************************************!*\ + !*** external "flarum.core.compat['extend']" ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['extend']; + +/***/ }), + +/***/ "flarum/helpers/avatar": +/*!*******************************************************!*\ + !*** external "flarum.core.compat['helpers/avatar']" ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['helpers/avatar']; + +/***/ }), + +/***/ "flarum/helpers/humanTime": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['helpers/humanTime']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['helpers/humanTime']; + +/***/ }), + +/***/ "flarum/helpers/listItems": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['helpers/listItems']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['helpers/listItems']; + +/***/ }), + +/***/ "flarum/models/Discussion": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['models/Discussion']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['models/Discussion']; + +/***/ }), + +/***/ "flarum/tags/components/TagDiscussionModal": +/*!***************************************************************************!*\ + !*** external "flarum.core.compat['tags/components/TagDiscussionModal']" ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['tags/components/TagDiscussionModal']; + +/***/ }), + +/***/ "flarum/tags/components/TagsPage": +/*!*****************************************************************!*\ + !*** external "flarum.core.compat['tags/components/TagsPage']" ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['tags/components/TagsPage']; + +/***/ }), + +/***/ "flarum/utils/DiscussionControls": +/*!*****************************************************************!*\ + !*** external "flarum.core.compat['utils/DiscussionControls']" ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/DiscussionControls']; + +/***/ }), + +/***/ "flarum/utils/ItemList": +/*!*******************************************************!*\ + !*** external "flarum.core.compat['utils/ItemList']" ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/ItemList']; + +/***/ }), + +/***/ "flarum/utils/extractText": +/*!**********************************************************!*\ + !*** external "flarum.core.compat['utils/extractText']" ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/extractText']; + +/***/ }), + +/***/ "flarum/utils/mixin": +/*!****************************************************!*\ + !*** external "flarum.core.compat['utils/mixin']" ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/mixin']; + +/***/ }), + +/***/ "flarum/utils/string": +/*!*****************************************************!*\ + !*** external "flarum.core.compat['utils/string']" ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['utils/string']; + +/***/ }) + +/******/ }); //# 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 f9911ea..b894d30 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@v17development/flarum-blog/webpack/bootstrap","webpack://@v17development/flarum-blog/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Button']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Switch']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['extend']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Model']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Alert']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Page']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['Component']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Modal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/ItemList']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['helpers/humanTime']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['helpers/avatar']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/PostStream']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['tags/components/TagDiscussionModal']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/Dropdown']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/EditPostComposer']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/extractText']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/string']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['models/Discussion']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/DiscussionComposer']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/IndexPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['utils/mixin']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['tags/components/TagsPage']\"","webpack://@v17development/flarum-blog/external \"flarum.core.compat['components/ReplyComposer']\"","webpack://@v17development/flarum-blog/./src/forum/components/BlogCategories.js","webpack://@v17development/flarum-blog/./src/forum/components/Modals/BlogPostSettingsModal.js","webpack://@v17development/flarum-blog/./src/forum/components/Modals/RenameArticleModal.js","webpack://@v17development/flarum-blog/./src/forum/components/BlogPostController.js","webpack://@v17development/flarum-blog/./src/forum/pages/BlogItem.js","webpack://@v17development/flarum-blog/./src/forum/utils/BlogComposer.js","webpack://@v17development/flarum-blog/./src/forum/utils/tooltip.js","webpack://@v17development/flarum-blog/./src/forum/pages/BlogOverview.js","webpack://@v17development/flarum-blog/./src/forum/utils/redirector.js","webpack://@v17development/flarum-blog/./src/common/Models/BlogMeta.js","webpack://@v17development/flarum-blog/./src/forum/utils/extendTagOverview.js","webpack://@v17development/flarum-blog/./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","_inheritsLoose","subClass","superClass","constructor","__proto__","flarum","core","compat","BlogCategories","init","this","blogCategories","app","forum","attribute","view","className","translator","trans","map","tagId","tag","store","getById","tags","push","categoryItem","all","forEach","_tag","isChild","parent","id","href","route","slug","config","icon","style","backgroundColor","color","Component","BlogPostSettingsModal","isNew","props","article","blogMeta","meta","createRecord","summary","prop","featuredImage","isFeatured","isSized","isPendingReview","title","content","fields","toArray","items","ItemList","add","maxWidth","minWidth","width","minHeight","placeholder","oninput","withAttr","type","src","alt","marginTop","Switch","component","state","onchange","val","children","fontWeight","Button","loading","submitData","relationships","discussion","onsubmit","e","preventDefault","save","then","pushData","hide","redraw","response","handleErrors","Modal","RenameArticleModal","redirect","target","url","window","history","replaceState","document","BlogPostController","loadedPost","buttons","canRename","onclick","modal","show","articlePost","firstPost","firstPostId","disabled","canEdit","composer","load","EditPostComposer","post","canTag","TagDiscussionModal","alerts","Alert","canLock","DiscussionControls","lockAction","isLocked","canHide","isHidden","restoreAction","canDelete","confirm","extractText","getCurrent","previous","back","hideAction","Dropdown","label","buttonClassName","menuClassName","onshow","find","BlogItem","setTitle","bodyClass","found","loadBlogItem","preloadBlogOverview","preloadedApiDocument","setTimeout","param","split","lazyRedraw","includedPosts","payload","included","articleId","filter","record","data","sort","a","b","slice","stream","PostStream","on","positionChanged","blogImage","backgroundImage","opacity","session","user","posts","class","fontSize","marginRight","trust","contentHtml","commentCount","render","avatar","padding","displayName","bio","startNumber","endNumber","lastReadPostNumber","Page","BlogComposer","loaded","DiscussionComposer","tooltip","element","$","BlogOverview","isLoading","featuredPosts","hasMore","loadBlogOverview","q","articles","length","newArticle","clear","blogTag","isSticky","data-placement","humanTime","createdAt","extend","IndexPage","currentTag","tagRedirectEnabled","blogTags","indexOf","override","DiscussionPage","original","location","textAlign","size","BlogMeta","mixin","Model","hasOne","extendTagOverview","TagsPage","markup","knowledgeBaseTags","tag_tiles","tile","initializers","routes","blog","path","blogCategory","blogArticle","models","Discussion","redirector"],"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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N,aAAa7K,IAAI,8BAA8B,SAAAjD,GACjDA,EAAI+N,OAAOC,KAAO,CAAEC,KAAM,QAASnK,UAAW2H,EAAa3H,aAE3D9D,EAAI+N,OAAOG,aAAe,CAAED,KAAM,uBAAwBnK,UAAW2H,EAAa3H,aAElF9D,EAAI+N,OAAOI,YAAc,CAAEF,KAAM,YAAanK,UAAWsE,EAAStE,aAElE9D,EAAIU,MAAM0N,OAAOlM,SAAWkL,GAE5BiB,IAAWrP,UAAUkD,SAAWoL,IAAMC,OAAO,YAG7Ce,KAIAd","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 = 33);\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['components/Alert'];","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['helpers/avatar'];","module.exports = flarum.core.compat['components/PostStream'];","module.exports = flarum.core.compat['tags/components/TagDiscussionModal'];","module.exports = flarum.core.compat['components/Dropdown'];","module.exports = flarum.core.compat['components/EditPostComposer'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['utils/string'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","module.exports = flarum.core.compat['components/IndexPage'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/LoadingIndicator'];","module.exports = flarum.core.compat['utils/mixin'];","module.exports = flarum.core.compat['tags/components/TagsPage'];","module.exports = flarum.core.compat['components/ReplyComposer'];","import Component from 'flarum/Component';\r\n\r\nexport default class BlogCategories extends Component {\r\n init() {\r\n this.blogCategories = app.forum.attribute('blogTags');\r\n }\r\n \r\n view() {\r\n return (\r\n
\r\n

{app.translator.trans('v17development-flarum-blog.forum.categories')}

\r\n\r\n {this.blogCategories && this.blogCategories.map(tagId => {\r\n const tag = app.store.getById('tags', tagId);\r\n\r\n if(!tag) return null; \r\n\r\n const tags = [];\r\n\r\n // Add tag\r\n tags.push(\r\n this.categoryItem(tag)\r\n );\r\n\r\n // Add tags\r\n app.store.all('tags').forEach(_tag => {\r\n if(_tag.isChild() && _tag.parent().id() === tag.id()) {\r\n tags.push(this.categoryItem(_tag));\r\n }\r\n });\r\n \r\n return tags;\r\n })}\r\n
\r\n )\r\n }\r\n\r\n // Category item\r\n categoryItem(tag) {\r\n return (\r\n \r\n \r\n \r\n \r\n {tag.name()}\r\n \r\n )\r\n }\r\n}","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\nimport ItemList from 'flarum/utils/ItemList';\r\nimport Switch from 'flarum/components/Switch';\r\n\r\nexport default class BlogPostSettingsModal extends Modal {\r\n init() {\r\n super.init();\r\n\r\n this.isNew = this.props.article.blogMeta() ? false : true;\r\n this.meta = this.props.article.blogMeta() ? this.props.article.blogMeta() : app.store.createRecord('blogMeta');\r\n \r\n this.summary = m.prop(this.meta.summary() || '');\r\n\r\n this.featuredImage = m.prop(this.meta.featuredImage() || '');\r\n\r\n this.isFeatured = m.prop(this.meta.isFeatured() || false);\r\n this.isSized = m.prop(this.meta.isSized() || false);\r\n this.isPendingReview = m.prop(this.meta.isPendingReview() || false);\r\n }\r\n\r\n className() {\r\n return 'Modal--small Support-Modal';\r\n }\r\n\r\n title() {\r\n return 'Blog post settings';\r\n }\r\n\r\n content() {\r\n return (\r\n
\r\n
\r\n {this.fields().toArray()}\r\n
\r\n
\r\n );\r\n }\r\n\r\n fields() {\r\n const items = new ItemList();\r\n\r\n items.add('summary', (\r\n
\r\n \r\n