From 7fdc1cbb52d5cd49b6080271384b655c74a5ae40 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 18 Sep 2023 11:32:48 +0000 Subject: [PATCH] Bundled output for commit 716466fe49f6c582660c6006eaa82d7ef5468de6 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index e15b191..4eececc 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const n=flarum.core.compat["admin/app"];var a=t.n(n);function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}const r=flarum.core.compat["admin/components/ExtensionPage"];var l=t.n(r);const s=flarum.core.compat["common/Component"];var c=t.n(s);const d=flarum.core.compat["common/components/LoadingIndicator"];var u=t.n(d);const h=flarum.core.compat["common/components/Placeholder"];var p=t.n(h);const f=flarum.core.compat["common/components/Button"];var b=t.n(f);const v=flarum.core.compat["common/components/Switch"];var g=t.n(v);const y=flarum.core.compat["common/components/Modal"];var _=t.n(y);const N=flarum.core.compat["common/utils/Stream"];var x=t.n(N),P=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.item=this.attrs.item||a().store.createRecord("html-headers"),this.description=x()(this.item.description()||""),this.header=x()(this.item.header()||""),this.loading=!1},n.className=function(){return"Modal--medium"},n.title=function(){return this.item.exists?a().translator.trans("ianm-html-head.admin.modal.edit_title"):a().translator.trans("ianm-html-head.admin.modal.create_title")},n.content=function(){return m("div",{className:"Modal-body"},m("p",null,a().translator.trans("ianm-html-head.admin.modal.text")),m("div",{className:"Form-group"},m("label",{className:"label"},a().translator.trans("ianm-html-head.admin.modal.description_label")),m("input",{type:"text",className:"FormControl",bidi:this.description,required:!0})),m("div",{className:"Form-group"},m("label",{className:"label"},a().translator.trans("ianm-html-head.admin.modal.header_label")),m("input",{type:"text",className:"FormControl",bidi:this.header,required:!0,placeholder:''})),m("div",{className:"Form-group"},m(b(),{className:"Button Button--primary",type:"submit",loading:this.loading},a().translator.trans("ianm-html-head.admin.modal.save_button"))))},n.onsubmit=function(t){if(t.preventDefault(),this.header()){this.loading=!0;var e={description:this.description(),header:this.header()};this.item.save(e).then(this.hide.bind(this),this.onerror.bind(this),this.loaded.bind(this))}},e}(_()),w=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.item=this.attrs.headItem},n.view=function(){var t=this;return m("tr",null,m("td",null,this.item.description()),m("td",null,m("code",null,this.item.header())),m("td",null,g().component({state:this.item.data.attributes.active,onchange:function(e){t.activeLoading=!0,a().request({method:"PATCH",url:a().forum.attribute("apiUrl")+"/html-headers/"+t.item.id(),body:{active:e}}).then((function(e){t.item.data=e.data,t.activeLoading=!1,m.redraw()}))},loading:this.activeLoading})),m("td",null,m("div",{className:"Button--group"},b().component({className:"Button Button--secondary",onclick:function(){return a().modal.show(P,{item:t.item})}},a().translator.trans("ianm-html-head.admin.table.edit_button")),b().component({className:"Button Button--danger",onclick:function(){t.deleting=!0,t.item.delete().then((function(){t.deleting=!1,m.redraw()}))},loading:this.deleting},a().translator.trans("ianm-html-head.admin.table.delete_button")))))},e}(c()),B=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.refresh()},n.view=function(){return m("div",null,m("div",{className:"HtmlHeadSettingsPage--controls"},b().component({className:"Button Button--primary",icon:"fas fa-plus",onclick:function(){return a().modal.show(P)}},a().translator.trans("ianm-html-head.admin.create_button"))),m("br",null),m("div",{className:"HtmlHeadSettingsPage-table"},this.loading?u().component():a().store.all("html-headers").length?m("table",{style:{width:"100%",textAlign:"left"},className:"table"},m("thead",null,m("tr",null,m("th",null,a().translator.trans("ianm-html-head.admin.table.description_label")),m("th",null,a().translator.trans("ianm-html-head.admin.table.header_label")),m("th",null,a().translator.trans("ianm-html-head.admin.table.active_label")),m("th",null))),m("tbody",null,a().store.all("html-headers").map((function(t){return w.component({headItem:t})})))):m("div",null,p().component({text:a().translator.trans("ianm-html-head.admin.table.empty_text")}))))},n.refresh=function(){return this.loadResults().then(this.parseResults.bind(this))},n.loadResults=function(){return a().store.find("html-headers")},n.parseResults=function(t){this.loading=!1,m.redraw()},e}(c()),S=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e)},n.content=function(){return[m("div",{className:"container"},m("div",{className:"HtmlHeadSettingsPage"},m(B,null)))]},e}(l());const O=flarum.core.compat["common/Model"];var H=t.n(O),M=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),o=0;o{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const n=flarum.core.compat["admin/app"];var a=t.n(n);function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}const r=flarum.core.compat["admin/components/ExtensionPage"];var l=t.n(r);const s=flarum.core.compat["common/Component"];var c=t.n(s);const d=flarum.core.compat["common/components/LoadingIndicator"];var u=t.n(d);const h=flarum.core.compat["common/components/Placeholder"];var p=t.n(h);const f=flarum.core.compat["common/components/Button"];var b=t.n(f);const v=flarum.core.compat["common/components/Switch"];var g=t.n(v);const y=flarum.core.compat["common/components/Modal"];var _=t.n(y);const N=flarum.core.compat["common/utils/Stream"];var x=t.n(N),P=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.item=this.attrs.item||a().store.createRecord("html-headers"),this.description=x()(this.item.description()||""),this.header=x()(this.item.header()||""),this.loading=!1},n.className=function(){return"Modal--medium"},n.title=function(){return this.item.exists?a().translator.trans("ianm-html-head.admin.modal.edit_title"):a().translator.trans("ianm-html-head.admin.modal.create_title")},n.content=function(){return m("div",{className:"Modal-body"},m("p",null,a().translator.trans("ianm-html-head.admin.modal.text")),m("div",{className:"Form-group"},m("label",{className:"label"},a().translator.trans("ianm-html-head.admin.modal.description_label")),m("input",{type:"text",className:"FormControl",bidi:this.description,required:!0})),m("div",{className:"Form-group"},m("label",{className:"label"},a().translator.trans("ianm-html-head.admin.modal.header_label")),m("input",{type:"text",className:"FormControl",bidi:this.header,required:!0,placeholder:''})),m("div",{className:"Form-group"},m(b(),{className:"Button Button--primary",type:"submit",loading:this.loading},a().translator.trans("ianm-html-head.admin.modal.save_button"))))},n.onsubmit=function(t){t.preventDefault(),this.loading=!0;var e={description:this.description(),header:this.header()};this.item.save(e).then(this.hide.bind(this),this.onerror.bind(this),this.loaded.bind(this))},e}(_()),w=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.item=this.attrs.headItem},n.view=function(){var t=this;return m("tr",null,m("td",null,this.item.description()),m("td",null,m("code",null,this.item.header())),m("td",null,g().component({state:this.item.active(),onchange:function(e){t.activeLoading=!0,a().request({method:"PATCH",url:a().forum.attribute("apiUrl")+"/html-headers/"+t.item.id(),body:{active:e}}).then((function(e){t.item.data=e.data,t.activeLoading=!1,m.redraw()}))},loading:this.activeLoading})),m("td",null,m("div",{className:"Button--group"},b().component({className:"Button Button--secondary",onclick:function(){return a().modal.show(P,{item:t.item})}},a().translator.trans("ianm-html-head.admin.table.edit_button")),b().component({className:"Button Button--danger",onclick:function(){t.deleting=!0,t.item.delete().then((function(){t.deleting=!1,m.redraw()}))},loading:this.deleting},a().translator.trans("ianm-html-head.admin.table.delete_button")))))},e}(c()),B=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.refresh()},n.view=function(){return m("div",null,m("div",{className:"HtmlHeadSettingsPage--controls"},b().component({className:"Button Button--primary",icon:"fas fa-plus",onclick:function(){return a().modal.show(P)}},a().translator.trans("ianm-html-head.admin.create_button"))),m("br",null),m("div",{className:"HtmlHeadSettingsPage-table"},this.loading?u().component():a().store.all("html-headers").length?m("table",{style:{width:"100%",textAlign:"left"},className:"table"},m("thead",null,m("tr",null,m("th",null,a().translator.trans("ianm-html-head.admin.table.description_label")),m("th",null,a().translator.trans("ianm-html-head.admin.table.header_label")),m("th",null,a().translator.trans("ianm-html-head.admin.table.active_label")),m("th",null))),m("tbody",null,a().store.all("html-headers").map((function(t){return w.component({headItem:t})})))):m("div",null,p().component({text:a().translator.trans("ianm-html-head.admin.table.empty_text")}))))},n.refresh=function(){return this.loadResults().then(this.parseResults.bind(this))},n.loadResults=function(){return a().store.find("html-headers")},n.parseResults=function(t){this.loading=!1,m.redraw()},e}(c()),S=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e)},n.content=function(){return[m("div",{className:"container"},m("div",{className:"HtmlHeadSettingsPage"},m(B,null)))]},e}(l());const O=flarum.core.compat["common/Model"];var H=t.n(O),M=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),o=0;o {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class CreateHeadItemModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.item || app.store.createRecord('html-headers');\n\n this.description = Stream(this.item.description() || '');\n this.header = Stream(this.item.header() || '');\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return this.item.exists\n ? app.translator.trans('ianm-html-head.admin.modal.edit_title')\n : app.translator.trans('ianm-html-head.admin.modal.create_title');\n }\n\n content() {\n return (\n
\n

{app.translator.trans('ianm-html-head.admin.modal.text')}

\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (!this.header()) return;\n\n this.loading = true;\n\n const attrs = {\n description: this.description(),\n header: this.header(),\n };\n\n this.item.save(attrs).then(this.hide.bind(this), this.onerror.bind(this), this.loaded.bind(this));\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport CreateHeadItemModal from './CreateHeadItemModal';\n\nexport default class HeadItemListItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.headItem;\n }\n\n view() {\n return (\n \n {this.item.description()}\n \n {this.item.header()}\n \n \n {Switch.component({\n state: this.item.data.attributes.active,\n onchange: (value) => {\n this.activeLoading = true;\n\n app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/html-headers/${this.item.id()}`,\n body: {\n active: value,\n },\n })\n .then((response) => {\n this.item.data = response.data;\n this.activeLoading = false;\n\n m.redraw();\n });\n },\n loading: this.activeLoading,\n })}\n \n \n
\n {Button.component(\n {\n className: 'Button Button--secondary',\n onclick: () => app.modal.show(CreateHeadItemModal, { item: this.item }),\n },\n app.translator.trans('ianm-html-head.admin.table.edit_button')\n )}\n {Button.component(\n {\n className: 'Button Button--danger',\n onclick: () => {\n this.deleting = true;\n this.item.delete().then(() => {\n this.deleting = false;\n m.redraw();\n });\n },\n loading: this.deleting,\n },\n app.translator.trans('ianm-html-head.admin.table.delete_button')\n )}\n
\n \n \n );\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport Button from 'flarum/common/components/Button';\nimport HeadItemListItem from './HeadItemListItem';\nimport CreateHeadItemModal from './CreateHeadItemModal';\n\nexport default class HeadItemList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = true;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.refresh();\n }\n\n view() {\n return (\n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n icon: 'fas fa-plus',\n onclick: () => app.modal.show(CreateHeadItemModal),\n },\n app.translator.trans('ianm-html-head.admin.create_button')\n )}\n
\n
\n
\n {this.loading ? (\n LoadingIndicator.component()\n ) : app.store.all('html-headers').length ? (\n \n \n \n \n \n \n \n \n {app.store.all('html-headers').map((headItem) => HeadItemListItem.component({ headItem }))}\n
{app.translator.trans('ianm-html-head.admin.table.description_label')}{app.translator.trans('ianm-html-head.admin.table.header_label')}{app.translator.trans('ianm-html-head.admin.table.active_label')}\n
\n ) : (\n
{Placeholder.component({ text: app.translator.trans('ianm-html-head.admin.table.empty_text') })}
\n )}\n
\n
\n );\n }\n\n refresh() {\n return this.loadResults().then(this.parseResults.bind(this));\n }\n\n /**\n * Load a new page of HeadItem results.\n *\n * @param {Integer} page number.\n * @return {Promise}\n */\n loadResults() {\n return app.store.find('html-headers');\n }\n\n /**\n * Parse results and append them to the page list.\n *\n * @param {Page[]} results\n * @return {Page[]}\n */\n parseResults(results) {\n this.loading = false;\n\n m.redraw();\n }\n}\n","import ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport HeadItem from './components/HeadItemList';\n\nexport default class HtmlHeadSettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n content() {\n return [\n
\n
\n \n
\n
,\n ];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class HeadItem extends Model {\n id = Model.attribute('id');\n description = Model.attribute('description');\n header = Model.attribute('header');\n active = Model.attribute('active');\n}\n","import app from 'flarum/admin/app';\nimport HtmlHeadSettingsPage from './htmlHeadSettingsPage';\nimport HeadItem from './model/HeadItem';\n\napp.initializers.add('ianm-html-head', () => {\n app.store.models['html-headers'] = HeadItem;\n app.extensionData.for('ianm-html-head').registerPage(HtmlHeadSettingsPage);\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","CreateHeadItemModal","oninit","vnode","this","item","attrs","app","description","Stream","header","loading","className","title","exists","content","type","bidi","required","placeholder","onsubmit","e","preventDefault","save","then","hide","bind","onerror","loaded","Modal","HeadItemListItem","headItem","view","Switch","state","data","attributes","active","onchange","activeLoading","method","url","id","body","response","m","redraw","Button","onclick","deleting","Component","HeadItemList","oncreate","refresh","icon","LoadingIndicator","length","style","width","textAlign","map","component","Placeholder","text","loadResults","parseResults","results","HtmlHeadSettingsPage","ExtensionPage","HeadItem","Model","registerPage"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,E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AAO,gBAAkBH,EACnCnE,IAAAA,cAAA,IAAsB,kBAAkBuE,aAAaN,EACtD,G","sources":["webpack://@ianm/html-head/webpack/bootstrap","webpack://@ianm/html-head/webpack/runtime/compat get default export","webpack://@ianm/html-head/webpack/runtime/define property getters","webpack://@ianm/html-head/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/html-head/webpack/runtime/make namespace object","webpack://@ianm/html-head/external root \"flarum.core.compat['admin/app']\"","webpack://@ianm/html-head/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@ianm/html-head/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@ianm/html-head/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/Component']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/components/Button']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@ianm/html-head/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/html-head/./src/admin/components/CreateHeadItemModal.js","webpack://@ianm/html-head/./src/admin/components/HeadItemListItem.js","webpack://@ianm/html-head/./src/admin/components/HeadItemList.js","webpack://@ianm/html-head/./src/admin/htmlHeadSettingsPage.js","webpack://@ianm/html-head/external root \"flarum.core.compat['common/Model']\"","webpack://@ianm/html-head/./src/admin/model/HeadItem.js","webpack://@ianm/html-head/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class CreateHeadItemModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.item || app.store.createRecord('html-headers');\n\n this.description = Stream(this.item.description() || '');\n this.header = Stream(this.item.header() || '');\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return this.item.exists\n ? app.translator.trans('ianm-html-head.admin.modal.edit_title')\n : app.translator.trans('ianm-html-head.admin.modal.create_title');\n }\n\n content() {\n return (\n
\n

{app.translator.trans('ianm-html-head.admin.modal.text')}

\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const attrs = {\n description: this.description(),\n header: this.header(),\n };\n\n this.item.save(attrs).then(this.hide.bind(this), this.onerror.bind(this), this.loaded.bind(this));\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport CreateHeadItemModal from './CreateHeadItemModal';\n\nexport default class HeadItemListItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.headItem;\n }\n\n view() {\n return (\n \n {this.item.description()}\n \n {this.item.header()}\n \n \n {Switch.component({\n state: this.item.active(),\n onchange: (value) => {\n this.activeLoading = true;\n\n app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/html-headers/${this.item.id()}`,\n body: {\n active: value,\n },\n })\n .then((response) => {\n this.item.data = response.data;\n this.activeLoading = false;\n\n m.redraw();\n });\n },\n loading: this.activeLoading,\n })}\n \n \n
\n {Button.component(\n {\n className: 'Button Button--secondary',\n onclick: () => app.modal.show(CreateHeadItemModal, { item: this.item }),\n },\n app.translator.trans('ianm-html-head.admin.table.edit_button')\n )}\n {Button.component(\n {\n className: 'Button Button--danger',\n onclick: () => {\n this.deleting = true;\n this.item.delete().then(() => {\n this.deleting = false;\n m.redraw();\n });\n },\n loading: this.deleting,\n },\n app.translator.trans('ianm-html-head.admin.table.delete_button')\n )}\n
\n \n \n );\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport Button from 'flarum/common/components/Button';\nimport HeadItemListItem from './HeadItemListItem';\nimport CreateHeadItemModal from './CreateHeadItemModal';\n\nexport default class HeadItemList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = true;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.refresh();\n }\n\n view() {\n return (\n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n icon: 'fas fa-plus',\n onclick: () => app.modal.show(CreateHeadItemModal),\n },\n app.translator.trans('ianm-html-head.admin.create_button')\n )}\n
\n
\n
\n {this.loading ? (\n LoadingIndicator.component()\n ) : app.store.all('html-headers').length ? (\n \n \n \n \n \n \n \n \n {app.store.all('html-headers').map((headItem) => HeadItemListItem.component({ headItem }))}\n
{app.translator.trans('ianm-html-head.admin.table.description_label')}{app.translator.trans('ianm-html-head.admin.table.header_label')}{app.translator.trans('ianm-html-head.admin.table.active_label')}\n
\n ) : (\n
{Placeholder.component({ text: app.translator.trans('ianm-html-head.admin.table.empty_text') })}
\n )}\n
\n
\n );\n }\n\n refresh() {\n return this.loadResults().then(this.parseResults.bind(this));\n }\n\n /**\n * Load a new page of HeadItem results.\n *\n * @param {Integer} page number.\n * @return {Promise}\n */\n loadResults() {\n return app.store.find('html-headers');\n }\n\n /**\n * Parse results and append them to the page list.\n *\n * @param {Page[]} results\n * @return {Page[]}\n */\n parseResults(results) {\n this.loading = false;\n\n m.redraw();\n }\n}\n","import ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport HeadItem from './components/HeadItemList';\n\nexport default class HtmlHeadSettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n content() {\n return [\n
\n
\n \n
\n
,\n ];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class HeadItem extends Model {\n id = Model.attribute('id');\n description = Model.attribute('description');\n header = Model.attribute('header');\n active = Model.attribute('active');\n}\n","import app from 'flarum/admin/app';\nimport HtmlHeadSettingsPage from './htmlHeadSettingsPage';\nimport HeadItem from './model/HeadItem';\n\napp.initializers.add('ianm-html-head', () => {\n app.store.models['html-headers'] = HeadItem;\n app.extensionData.for('ianm-html-head').registerPage(HtmlHeadSettingsPage);\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","CreateHeadItemModal","oninit","vnode","this","item","attrs","app","createRecord","description","Stream","header","loading","className","title","exists","trans","content","type","bidi","required","placeholder","onsubmit","e","preventDefault","save","then","hide","bind","onerror","loaded","Modal","HeadItemListItem","headItem","view","Switch","state","active","onchange","activeLoading","method","url","attribute","id","body","response","data","m","redraw","Button","onclick","show","deleting","Component","HeadItemList","oncreate","refresh","icon","LoadingIndicator","all","length","style","width","textAlign","map","component","Placeholder","text","loadResults","parseResults","find","results","HtmlHeadSettingsPage","ExtensionPage","HeadItem","Model","add","models","registerPage"],"sourceRoot":""} \ No newline at end of file