diff --git a/bootstrap.php b/bootstrap.php deleted file mode 100644 index aec6c04..0000000 --- a/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ -subscribe(Listeners\AddDiscussionViewHandler::class); - $events->subscribe(Listeners\AddAssets::class); - $events->subscribe(Listeners\AddDiscussionApiAttributes::class); - $events->subscribe(Listeners\AddPopularSort::class); - $events->subscribe(Listeners\SaveDiscussionFromModal::class); -}; diff --git a/composer.json b/composer.json index 5742471..65bb8c3 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Add views to flarum discussions", "type": "flarum-extension", "require": { - "flarum/core": "^0.1.0-beta.7" + "flarum/core": "^0.1.0-beta.8" }, "license": "MIT", "authors": [ @@ -25,10 +25,13 @@ "flarum-extension": { "title": "Discussion views", "icon": { - "name": "eye", + "name": "far fa-eye", "backgroundColor": "#88CC23", "color": "#fff" } + }, + "flagrow": { + "discuss": "https://discuss.flarum.org/d/7339" } } } \ No newline at end of file diff --git a/extend.php b/extend.php new file mode 100644 index 0000000..b2173ec --- /dev/null +++ b/extend.php @@ -0,0 +1,24 @@ +css(__DIR__ . '/less/extension.less') + ->js(__DIR__. '/js/dist/forum.js'), + + (new Frontend('admin')) + ->js(__DIR__ . '/js/dist/admin.js'), + + new Locales(__DIR__ . '/locale'), + + function (Dispatcher $events) { + $events->subscribe(Listeners\AddDiscussionViewHandler::class); + $events->subscribe(Listeners\AddDiscussionApiAttributes::class); + $events->subscribe(Listeners\AddPopularSort::class); + $events->subscribe(Listeners\SaveDiscussionFromModal::class); + } +]; diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 0000000..13dc041 --- /dev/null +++ b/js/admin.js @@ -0,0 +1 @@ +export * from './src/admin'; \ No newline at end of file diff --git a/js/admin/Gulpfile.js b/js/admin/Gulpfile.js deleted file mode 100644 index 6c4b0bb..0000000 --- a/js/admin/Gulpfile.js +++ /dev/null @@ -1,7 +0,0 @@ -var flarum = require('flarum-gulp'); - -flarum({ - modules: { - 'michaelbelgium/flarum-discussion-views': 'src/**/*.js' - } -}); \ No newline at end of file diff --git a/js/admin/dist/extension.js b/js/admin/dist/extension.js deleted file mode 100644 index c28fecb..0000000 --- a/js/admin/dist/extension.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -System.register('michaelbelgium/flarum-discussion-views/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export, _context) { - "use strict"; - - var extend, app, PermissionGrid; - return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - }, function (_flarumApp) { - app = _flarumApp.default; - }, function (_flarumComponentsPermissionGrid) { - PermissionGrid = _flarumComponentsPermissionGrid.default; - }], - execute: function () { - - app.initializers.add('michaelbelgium-admin-discussion-views', function () { - extend(PermissionGrid.prototype, 'moderateItems', function (items) { - items.add('resetViews', { - icon: 'eye', - label: app.translator.trans('flarum_discussion_views.admin.permissions.reset_views_label'), - permission: 'discussion.resetViews' - }); - }); - }); - } - }; -}); \ No newline at end of file diff --git a/js/admin/package.json b/js/admin/package.json deleted file mode 100644 index 6216d68..0000000 --- a/js/admin/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "devDependencies": { - "flarum-gulp": "^0.2.0", - "gulp": "^3.9.1" - } -} diff --git a/js/dist/admin.js b/js/dist/admin.js new file mode 100644 index 0000000..6e5246f --- /dev/null +++ b/js/dist/admin.js @@ -0,0 +1,2 @@ +module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat.app},,,,,,,,,function(e,t){e.exports=flarum.core.compat["components/PermissionGrid"]},,function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),i=r.n(o),u=r(10),s=r.n(u);i.a.initializers.add("michaelbelgium-admin-discussion-views",function(){Object(n.extend)(s.a.prototype,"moderateItems",function(e){e.add("resetViews",{icon:"far fa-eye",label:i.a.translator.trans("flarum_discussion_views.admin.permissions.reset_views_label"),permission:"discussion.resetViews"})})})}]); +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map new file mode 100644 index 0000000..5d64ca6 --- /dev/null +++ b/js/dist/admin.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://@michaelbelgium/flarum-discussion-views/webpack/bootstrap","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['extend']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['app']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://@michaelbelgium/flarum-discussion-views/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","app","initializers","add","extend","PermissionGrid","items","icon","label","translator","trans","permission"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF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AhC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,sBCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,2BCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,+GCIAC,IAAIC,aAAaC,IAAI,wCAAyC,WAC7DC,iBAAOC,IAAeX,UAAW,gBAAiB,SAAAY,GACjDA,EAAMH,IAAI,aAAc,CACvBI,KAAM,aACNC,MAAOP,IAAIQ,WAAWC,MAAM,+DAC5BC,WAAY","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 = 12);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/PermissionGrid'];","import { extend } from 'flarum/extend';\r\nimport app from 'flarum/app';\r\nimport PermissionGrid from 'flarum/components/PermissionGrid';\r\n\r\napp.initializers.add('michaelbelgium-admin-discussion-views', () => {\r\n\textend(PermissionGrid.prototype, 'moderateItems', items => {\r\n\t\titems.add('resetViews', {\r\n\t\t\ticon: 'far fa-eye',\r\n\t\t\tlabel: app.translator.trans('flarum_discussion_views.admin.permissions.reset_views_label'),\r\n\t\t\tpermission: 'discussion.resetViews'\r\n\t\t});\r\n\t});\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js new file mode 100644 index 0000000..824ebdd --- /dev/null +++ b/js/dist/forum.js @@ -0,0 +1,2 @@ +module.exports=function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)e.d(n,r,function(o){return t[o]}.bind(null,r));return n},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=11)}([function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["models/Discussion"]},function(t,o){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionList"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionListItem"]},function(t,o){t.exports=flarum.core.compat["utils/abbreviateNumber"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},,function(t,o,e){"use strict";e.r(o);var n=e(1),r=e.n(n),s=e(0),i=e(6),u=e.n(i),a=e(3),c=e.n(a),p=e(4),l=e.n(p),f=e(7),d=e.n(f),v=e(8),b=e.n(v),w=e(2),h=e.n(w),y=e(5),_=e.n(y);var x=e(9),g=function(t){var o,e;function n(){return t.apply(this,arguments)||this}e=t,(o=n).prototype=Object.create(e.prototype),o.prototype.constructor=o,o.__proto__=e;var r=n.prototype;return r.init=function(){t.prototype.init.call(this),this.discussion=this.props.discussion,this.currentViewsCount=this.props.discussion.views(),this.newViewsCount=m.prop(this.currentViewsCount)},r.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum_discussion_views.forum.modal_resetviews.label")),m("input",{className:"FormControl",type:"number",min:"0",bidi:this.newViewsCount})),m("div",{className:"Form-group"},h.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading,children:app.translator.trans("flarum_discussion_views.forum.modal_resetviews.submit")}))))},r.title=function(){return app.translator.trans("flarum_discussion_views.forum.modal_resetviews.title")},r.className=function(){return"Modal--small"},r.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0;var e=parseInt(this.newViewsCount()),n=this.currentViewsCount;e>=0&&e!==n&&this.props.discussion.save({views:e}).then(function(){m.redraw()}).catch(function(t){o.loading=!1,console.log(t)}),this.hide()},n}(e.n(x).a);r.a.initializers.add("michaelbelgium-discussion-views",function(){Object(s.extend)(u.a.prototype,"sortMap",function(t){t.popular="-view_count",t.unpopular="view_count"}),l.a.prototype.views=c.a.attribute("views"),l.a.prototype.canReset=c.a.attribute("canReset"),Object(s.extend)(d.a.prototype,"infoItems",function(t){var o=this.props.discussion;t.add("discussion-views",b()(o.views()))}),Object(s.extend)(_.a,"moderationControls",function(t,o){o.canReset()&&t.add("reset",h.a.component({children:app.translator.trans("flarum_discussion_views.forum.discussion_controls.resetviews_button"),icon:"far fa-eye",onclick:this.resetViewsAction.bind(o)}))}),_.a.resetViewsAction=function(){return app.modal.show(new g({discussion:this}))}})}]); +//# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map new file mode 100644 index 0000000..753eaaa --- /dev/null +++ b/js/dist/forum.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://@michaelbelgium/flarum-discussion-views/webpack/bootstrap","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['extend']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['app']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['components/Button']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['Model']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['models/Discussion']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['components/DiscussionList']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['utils/abbreviateNumber']\"","webpack://@michaelbelgium/flarum-discussion-views/external \"flarum.core.compat['components/Modal']\"","webpack://@michaelbelgium/flarum-discussion-views/./src/forum/components/ResetDiscussionViewsModal.js","webpack://@michaelbelgium/flarum-discussion-views/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@michaelbelgium/flarum-discussion-views/./src/forum/index.js","webpack://@michaelbelgium/flarum-discussion-views/./src/forum/components/AddPopularSort.js","webpack://@michaelbelgium/flarum-discussion-views/./src/forum/components/AddViewsToModelAndDisplay.js","webpack://@michaelbelgium/flarum-discussion-views/./src/forum/components/AddModerationControl.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","ResetDiscussionViewsModal","subClass","superClass","constructor","__proto__","init","_Modal","this","discussion","props","currentViewsCount","views","newViewsCount","prop","content","className","app","translator","trans","type","min","bidi","Button","component","loading","children","title","onsubmit","e","_this","preventDefault","newViews","parseInt","currentViews","save","then","redraw","catch","reason","console","log","hide","Modal","initializers","add","extend","DiscussionList","map","popular","unpopular","Discussion","Model","attribute","canReset","DiscussionListItem","items","abbreviateNumber","DiscussionControls","icon","onclick","resetViewsAction","modal","show"],"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2DAGhCH,qBAEI,MAAO,kBAGXY,kBAASC,GACT,IAAAC,EAAAtB,KACIqB,EAAEE,iBACFvB,KAAKiB,SAAU,EAEf,IAAMO,EAAWC,SAASzB,KAAKK,iBACzBqB,EAAe1B,KAAKG,kBAEtBqB,GAAY,GAAKA,IAAaE,GAE9B1B,KAAKE,MAAMD,WACN0B,KAAK,CAAEvB,MAAOoB,IACdI,KAAK,WAAQlE,EAAEmE,WACfC,MAAM,SAACC,GACJT,EAAKL,SAAU,EACfe,QAAQC,IAAIF,KAIxB/B,KAAKkC,kBA7D0CC,GEEvD1B,IAAI2B,aAAaC,IAAI,kCAAmC,WCDpDC,iBAAOC,IAAerD,UAAW,UAAW,SAAUsD,GAClDA,EAAIC,QAAU,cACdD,EAAIE,UAAY,eCCpBC,IAAWzD,UAAUkB,MAAQwC,IAAMC,UAAU,SAC7CF,IAAWzD,UAAU4D,SAAWF,IAAMC,UAAU,YAEhDP,iBAAOS,IAAmB7D,UAAW,YAAa,SAAS8D,GACvD,IAAM/C,EAAaD,KAAKE,MAAMD,WAC9B+C,EAAMX,IAAI,mBAAoBY,IAAiBhD,EAAWG,YCN9DkC,iBAAOY,IAAoB,qBAAsB,SAASF,EAAO/C,GAC1DA,EAAW6C,YAEVE,EAAMX,IAAI,QAAStB,IAAOC,UAAU,CAChCE,SAAUT,IAAIC,WAAWC,MAAM,uEAC/BwC,KAAM,aACNC,QAASpD,KAAKqD,iBAAiBvE,KAAKmB,QAKhDiD,IAAmBG,iBAAmB,WAClC,OAAO5C,IAAI6C,MAAMC,KAAK,IAAI9D,EAA0B,CAChDQ,WAAYD","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 = 11);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['components/DiscussionList'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/abbreviateNumber'];","module.exports = flarum.core.compat['components/Modal'];","import Modal from 'flarum/components/Modal';\r\nimport Button from 'flarum/components/Button';\r\n\r\nexport default class ResetDiscussionViewsModal extends Modal {\r\n init()\r\n {\r\n super.init();\r\n\r\n this.discussion = this.props.discussion;\r\n this.currentViewsCount = this.props.discussion.views();\r\n this.newViewsCount = m.prop(this.currentViewsCount);\r\n }\r\n\r\n content()\r\n {\r\n return (\r\n