diff --git a/composer.json b/composer.json
index 00cbfd1..6f433d9 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,8 @@
"type": "flarum-extension",
"license": "MIT",
"require": {
- "flarum/core": "^0.1.0-beta.8"
+ "flarum/core": "^0.1.0-beta.14",
+ "fof/components": "^0.2.0"
},
"authors": [
{
diff --git a/extend.php b/extend.php
index b66db34..b9f57f0 100644
--- a/extend.php
+++ b/extend.php
@@ -12,9 +12,11 @@
namespace FoF\CustomFooter;
use Flarum\Extend;
+use FoF\Components\Extend\AddFofComponents;
use Illuminate\Contracts\Events\Dispatcher;
return [
+ new AddFofComponents(),
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/resources/less/forum.less'),
diff --git a/js/dist/admin.js b/js/dist/admin.js
index cd9b360..285e1ed 100644
--- a/js/dist/admin.js
+++ b/js/dist/admin.js
@@ -1,2 +1,2 @@
-module.exports=function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e,o){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}o.d(e,"a",function(){return r})},function(t,e){t.exports=flarum.core.compat.app},,,,function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},,function(t,e,o){"use strict";o.r(e);var r=o(1),n=o.n(r),a=o(0),u=o(5),i=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var o=e.prototype;return o.className=function(){return"CustomFooterSettingsModal Modal--medium"},o.title=function(){return app.translator.trans("fof-custom-footer.admin.settings.title")},o.form=function(){return[m("div",{className:"Form-group"},m("label",null,app.translator.trans("fof-custom-footer.admin.settings.text")),m("textarea",{rows:"5",required:!0,className:"FormControl",type:"text",bidi:this.setting("fof-custom-footer.text")})),m("div",{className:"Form-group"},m("label",null,app.translator.trans("fof-custom-footer.admin.settings.height")," (px)"),m("input",{className:"FormControl",type:"number",placeholder:"50",bidi:this.setting("fof-custom-footer.height")})),m("div",{className:"Form-group"},m("label",null,app.translator.trans("fof-custom-footer.admin.settings.js")),m("textarea",{rows:"5",className:"FormControl",type:"text",bidi:this.setting("fof-custom-footer.js")}))]},e}(o.n(u).a);n.a.initializers.add("fof-custom-footer",function(){n.a.extensionSettings["fof-custom-footer"]=function(){return n.a.modal.show(new i)}})}]);
+module.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=6)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e){t.exports=flarum.extensions["fof-components"]},,,,,function(t,e,o){"use strict";o.r(e);var n=o(0),r=o.n(n),s=o(1),i=s.settings.SettingsModal,a=s.settings.items,u=a.StringItem,f=(a.BooleanItem,a.NumberItem);r.a.initializers.add("fof-custom-footer",(function(){r.a.extensionSettings["fof-custom-footer"]=function(){return r.a.modal.show(i,{title:r.a.translator.trans("fof-custom-footer.admin.settings.title"),size:"medium",items:function(t){return[m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("fof-custom-footer.admin.settings.text")),m(u,{setting:t,name:"fof-custom-footer.text",simple:!0})),m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("fof-custom-footer.admin.settings.height")," (px)"),m(f,{setting:t,name:"fof-custom-footer.height",simple:!0,placeholder:"50"})),m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("fof-custom-footer.admin.settings.js")),m(u,{setting:t,name:"fof-custom-footer.js",simple:!0}))]}})}}))}]);
//# 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 2787a28..b88f22f 100644
--- a/js/dist/admin.js.map
+++ b/js/dist/admin.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://@fof/custom-footer/webpack/bootstrap","webpack://@fof/custom-footer/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/custom-footer/external \"flarum.core.compat['app']\"","webpack://@fof/custom-footer/external \"flarum.core.compat['components/SettingsModal']\"","webpack://@fof/custom-footer/./src/admin/components/CustomFooterSettingsModal.js","webpack://@fof/custom-footer/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_inheritsLoose","subClass","superClass","constructor","__proto__","__webpack_exports__","flarum","core","compat","CustomFooterSettingsModal","className","title","app","translator","trans","form","rows","required","type","bidi","this","setting","placeholder","SettingsModal","initializers","add","extensionSettings","modal","show"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAA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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 = 7);\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['app'];","module.exports = flarum.core.compat['components/SettingsModal'];","import SettingsModal from 'flarum/components/SettingsModal';\n\nexport default class CustomFooterSettingsModal extends SettingsModal {\n className() {\n return 'CustomFooterSettingsModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-custom-footer.admin.settings.title');\n }\n\n form() {\n return [\n
\n \n \n
,\n\n \n \n \n
,\n\n \n \n \n
,\n ];\n }\n}\n","import app from 'flarum/app';\nimport CustomFooterSettingsModal from './components/CustomFooterSettingsModal';\n\napp.initializers.add('fof-custom-footer', () => {\n app.extensionSettings['fof-custom-footer'] = () => app.modal.show(new CustomFooterSettingsModal());\n});\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://@fof/custom-footer/webpack/bootstrap","webpack://@fof/custom-footer/external \"flarum.core.compat['app']\"","webpack://@fof/custom-footer/external \"flarum.extensions['fof-components']\"","webpack://@fof/custom-footer/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","extensions","SettingsModal","settings","items","StringItem","NumberItem","BooleanItem","app","initializers","add","extensionSettings","modal","show","title","translator","trans","size","className","setting","simple","placeholder"],"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,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBClFrDhC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAY,K,cCAzCnC,EAAOD,QAAUkC,OAAOG,WAAW,mB,mECI/BC,EAEAC,WAFAD,c,EAEAC,WADAC,MAASC,E,EAAAA,WAAyBC,G,EAAbC,Y,EAAaD,YAGtCE,IAAIC,aAAaC,IAAI,qBAAqB,WACtCF,IAAIG,kBAAkB,qBAAuB,kBACzCH,IAAII,MAAMC,KAAKX,EAAe,CAC1BY,MAAON,IAAIO,WAAWC,MAAM,0CAC5BC,KAAM,SACNb,MAAO,SAAAP,GAAC,MAAI,CACR,SAAKqB,UAAU,cACX,eAAQV,IAAIO,WAAWC,MAAM,0CAC7B,EAACX,EAAD,CAAYc,QAAStB,EAAGxB,KAAK,yBAAyB+C,QAAM,KAEhE,SAAKF,UAAU,cACX,eAAQV,IAAIO,WAAWC,MAAM,2CAA7B,SACA,EAACV,EAAD,CAAYa,QAAStB,EAAGxB,KAAK,2BAA2B+C,QAAM,EAACC,YAAY,QAE/E,SAAKH,UAAU,cACX,eAAQV,IAAIO,WAAWC,MAAM,wCAC7B,EAACX,EAAD,CAAYc,QAAStB,EAAGxB,KAAK,uBAAuB+C,QAAM","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 = 6);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.extensions['fof-components'];","import app from 'flarum/app';\r\nimport { settings } from '@fof-components';\r\n\r\nconst {\r\n SettingsModal,\r\n items: { StringItem, BooleanItem, NumberItem },\r\n} = settings;\r\n\r\napp.initializers.add('fof-custom-footer', () => {\r\n app.extensionSettings['fof-custom-footer'] = () =>\r\n app.modal.show(SettingsModal, {\r\n title: app.translator.trans('fof-custom-footer.admin.settings.title'),\r\n size: 'medium',\r\n items: s => [\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 ]\r\n });\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/js/dist/forum.js b/js/dist/forum.js
index cb82860..f255878 100644
--- a/js/dist/forum.js
+++ b/js/dist/forum.js
@@ -1,2 +1,2 @@
-module.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=6)}([function(t,e,o){"use strict";function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}o.d(e,"a",function(){return n})},,function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat.Application},function(t,e){t.exports=flarum.core.compat.Component},,function(t,e,o){"use strict";o.r(e);var n=o(2),r=o(3),i=o.n(r),u=o(0),c=o(4),a=function(t){function e(){return t.apply(this,arguments)||this}Object(u.a)(e,t);var o=e.prototype;return o.init=function(){this.open=!1;var t=app.forum.attribute("fof-custom-footer.js");t&&$("body").append("`);\n }\n }\n\n view() {\n return (\n \n );\n }\n}\n","import { extend } from 'flarum/extend';\nimport Application from 'flarum/Application';\n\nimport CustomFooter from './components/CustomFooter';\n\napp.initializers.add('fof-custom-footer', () => {\n extend(Application.prototype, 'mount', () => {\n const footer = document.createElement('div');\n\n m.mount(document.body.appendChild(footer), CustomFooter.component());\n });\n});\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://@fof/custom-footer/webpack/bootstrap","webpack://@fof/custom-footer/external \"flarum.core.compat['extend']\"","webpack://@fof/custom-footer/external \"flarum.core.compat['Application']\"","webpack://@fof/custom-footer/external \"flarum.core.compat['Component']\"","webpack://@fof/custom-footer/./src/forum/components/CustomFooter.js","webpack://@fof/custom-footer/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/custom-footer/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","CustomFooter","subClass","superClass","constructor","__proto__","init","this","open","js","app","forum","attribute","$","append","trim","view","id","className","style","trust","onclick","Component","initializers","add","extend","Application","footer","document","createElement","mount","body","appendChild"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAA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ASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,kBClFrDhC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAe,Q,cCA5CnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAoB,a,cCAjDnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAkB,W,0ECE1BC,E,YCFN,IAAwBC,EAAUC,E,kDAAAA,E,GAAVD,E,GAC5BR,UAAYlB,OAAOY,OAAOe,EAAWT,WAC9CQ,EAASR,UAAUU,YAAcF,EACjCA,EAASG,UAAYF,E,2BDAnBG,KAAA,WACIC,KAAKC,MAAO,EAEZ,IAAMC,EAAKC,IAAIC,MAAMC,UAAU,wBAC3BH,GACAI,EAAE,QAAQC,OAAV,WAA4BL,EAAGM,OAA/B,e,EAIRC,KAAA,WAAO,WACH,OACI,SAAKC,GAAG,eAAeC,UAAWX,KAAKC,MAAQ,WAC3C,SAAKU,UAAU,aACX,SAAKA,UAAU,kBAAkBC,MAAK,YAAaZ,KAAKC,KAAOE,IAAIC,MAAMC,UAAU,6BAA+B,GAAK,GAAjF,OACjC1C,EAAEkD,MAAMV,IAAIC,MAAMC,UAAU,2BAA6B,KAE9D,SAAKM,UAAU,iBACX,OAAGA,UAAS,mCAAoCX,KAAKC,MAAQ,UAAYa,QAAS,kBAAO,EAAKb,MAAO,KACrG,OAAGU,UAAS,mCAAoCX,KAAKC,MAAQ,UAAYa,QAAS,kBAAO,EAAKb,MAAO,S,UAnBnFc,GEG1CZ,IAAIa,aAAaC,IAAI,qBAAqB,WACtCC,iBAAOC,IAAYhC,UAAW,SAAS,WACnC,IAAMiC,EAASC,SAASC,cAAc,OAEtC3D,EAAE4D,MAAMF,SAASG,KAAKC,YAAYL,GAAS1B","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 = 5);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['Application'];","module.exports = flarum.core.compat['Component'];","import Component from 'flarum/Component';\r\n\r\nexport default class CustomFooter extends Component {\r\n init() {\r\n this.open = false;\r\n\r\n const js = app.forum.attribute('fof-custom-footer.js');\r\n if (js) {\r\n $('body').append(``);\r\n }\r\n }\r\n\r\n view() {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import { extend } from 'flarum/extend';\r\nimport Application from 'flarum/Application';\r\n\r\nimport CustomFooter from './components/CustomFooter';\r\n\r\napp.initializers.add('fof-custom-footer', () => {\r\n extend(Application.prototype, 'mount', () => {\r\n const footer = document.createElement('div');\r\n\r\n m.mount(document.body.appendChild(footer), CustomFooter);\r\n });\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/js/src/admin/index.js b/js/src/admin/index.js
index 45b8d45..7858da5 100644
--- a/js/src/admin/index.js
+++ b/js/src/admin/index.js
@@ -1,6 +1,29 @@
import app from 'flarum/app';
-import CustomFooterSettingsModal from './components/CustomFooterSettingsModal';
+import { settings } from '@fof-components';
+
+const {
+ SettingsModal,
+ items: { StringItem, BooleanItem, NumberItem },
+} = settings;
app.initializers.add('fof-custom-footer', () => {
- app.extensionSettings['fof-custom-footer'] = () => app.modal.show(new CustomFooterSettingsModal());
+ app.extensionSettings['fof-custom-footer'] = () =>
+ app.modal.show(SettingsModal, {
+ title: app.translator.trans('fof-custom-footer.admin.settings.title'),
+ size: 'medium',
+ items: s => [
+
+
+
+
,
+
+
+
+
,
+
+
+
+
,
+ ]
+ });
});
diff --git a/js/src/forum/index.js b/js/src/forum/index.js
index 988fa8d..df80625 100644
--- a/js/src/forum/index.js
+++ b/js/src/forum/index.js
@@ -7,6 +7,6 @@ app.initializers.add('fof-custom-footer', () => {
extend(Application.prototype, 'mount', () => {
const footer = document.createElement('div');
- m.mount(document.body.appendChild(footer), CustomFooter.component());
+ m.mount(document.body.appendChild(footer), CustomFooter);
});
});
diff --git a/js/webpack.config.js b/js/webpack.config.js
index ef35ea0..427449c 100644
--- a/js/webpack.config.js
+++ b/js/webpack.config.js
@@ -1 +1,3 @@
-module.exports = require('flarum-webpack-config')();
+module.exports = require('flarum-webpack-config')({
+ useExtensions: ['fof-components']
+ });