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,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,E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unction __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