From bd46f533a313659dbb2dae0c5af284e682cad17b Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 3 Dec 2018 23:52:29 +0000 Subject: [PATCH] Bundled output for commit afd6e5a2914e6e6b39ee726c2e4119c18b6c05c3 [skip ci] --- extensions/pusher/js/dist/forum.js | 2 +- extensions/pusher/js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/pusher/js/dist/forum.js b/extensions/pusher/js/dist/forum.js index e31ceea73..56624b266 100644 --- a/extensions/pusher/js/dist/forum.js +++ b/extensions/pusher/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat["components/DiscussionList"]},function(e,t){e.exports=flarum.core.compat["components/IndexPage"]},function(e,t){e.exports=flarum.core.compat["components/DiscussionPage"]},function(e,t){e.exports=flarum.core.compat["components/Button"]},,,function(e,t,n){"use strict";n.r(t);var o=n(1),s=n(0),r=n.n(s),i=n(2),u=n.n(i),a=n(4),c=n.n(a),d=n(3),p=n.n(d),f=n(5),l=n.n(f);r.a.initializers.add("flarum-pusher",function(){var e=m.deferred();$.getScript("//js.pusher.com/3.0/pusher.min.js",function(){var t=new Pusher(r.a.forum.attribute("pusherKey"),{authEndpoint:r.a.forum.attribute("apiUrl")+"/pusher/auth",cluster:r.a.forum.attribute("pusherCluster"),auth:{headers:{"X-CSRF-Token":r.a.session.csrfToken}}});e.resolve({main:t.subscribe("public"),user:r.a.session.user?t.subscribe("private-user"+r.a.session.user.id()):null})}),r.a.pusher=e.promise,r.a.pushedUpdates=[],Object(o.extend)(u.a.prototype,"config",function(e,t,n){var s=this;t||r.a.pusher.then(function(e){e.main.bind("newPost",function(e){var t=s.props.params;if(!t.q&&!t.sort&&!t.filter){if(t.tags){var n=r.a.store.getBy("tags","slug",t.tags);if(-1===e.tagIds.indexOf(n.id()))return}var o=String(e.discussionId);r.a.current.discussion&&o===r.a.current.discussion.id()||-1!==r.a.pushedUpdates.indexOf(o)||(r.a.pushedUpdates.push(o),r.a.current instanceof p.a&&r.a.setTitleCount(r.a.pushedUpdates.length),m.redraw())}}),Object(o.extend)(n,"onunload",function(){return e.main.unbind("newPost")})})}),Object(o.extend)(u.a.prototype,"view",function(e){var t=this;if(r.a.pushedUpdates){var n=r.a.pushedUpdates.length;n&&e.children.unshift(l.a.component({className:"Button Button--block DiscussionList-update",onclick:function(){t.refresh(!1).then(function(){t.loadingUpdated=!1,r.a.pushedUpdates=[],r.a.setTitleCount(0),m.redraw()}),t.loadingUpdated=!0},loading:this.loadingUpdated,children:r.a.translator.transChoice("flarum-pusher.forum.discussion_list.show_updates_text",n,{count:n})}))}}),Object(o.extend)(u.a.prototype,"addDiscussion",function(e,t){var n=r.a.pushedUpdates.indexOf(t.id());-1!==n&&r.a.pushedUpdates.splice(n,1),r.a.current instanceof p.a&&r.a.setTitleCount(r.a.pushedUpdates.length),m.redraw()}),Object(o.extend)(c.a.prototype,"config",function(e,t,n){var s=this;t||r.a.pusher.then(function(e){e.main.bind("newPost",function(e){var t=String(e.discussionId);if(s.discussion&&s.discussion.id()===t&&s.stream){var n=s.discussion.commentsCount();r.a.store.find("discussions",s.discussion.id()).then(function(){s.stream.update(),document.hasFocus()||(r.a.setTitleCount(Math.max(0,s.discussion.commentsCount()-n)),$(window).one("focus",function(){return r.a.setTitleCount(0)}))})}}),Object(o.extend)(n,"onunload",function(){return e.main.unbind("newPost")})})}),Object(o.extend)(p.a.prototype,"actionItems",function(e){e.remove("refresh")}),r.a.pusher.then(function(e){e.user&&e.user.bind("notification",function(){r.a.session.user.pushAttributes({unreadNotificationsCount:r.a.session.user.unreadNotificationsCount()+1,newNotificationsCount:r.a.session.user.newNotificationsCount()+1}),delete r.a.cache.notifications,m.redraw()})})})}]); +module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat["components/DiscussionList"]},function(e,t){e.exports=flarum.core.compat["components/IndexPage"]},function(e,t){e.exports=flarum.core.compat["components/DiscussionPage"]},function(e,t){e.exports=flarum.core.compat["components/Button"]},,,function(e,t,n){"use strict";n.r(t);var o=n(1),s=n(0),r=n.n(s),i=n(2),u=n.n(i),a=n(4),c=n.n(a),d=n(3),p=n.n(d),f=n(5),l=n.n(f);r.a.initializers.add("flarum-pusher",function(){var e=m.deferred();$.getScript("//js.pusher.com/3.0/pusher.min.js",function(){var t=new Pusher(r.a.forum.attribute("pusherKey"),{authEndpoint:r.a.forum.attribute("apiUrl")+"/pusher/auth",cluster:r.a.forum.attribute("pusherCluster"),auth:{headers:{"X-CSRF-Token":r.a.session.csrfToken}}});e.resolve({main:t.subscribe("public"),user:r.a.session.user?t.subscribe("private-user"+r.a.session.user.id()):null})}),r.a.pusher=e.promise,r.a.pushedUpdates=[],Object(o.extend)(u.a.prototype,"config",function(e,t,n){var s=this;t||r.a.pusher.then(function(e){e.main.bind("newPost",function(e){var t=s.props.params;if(!t.q&&!t.sort&&!t.filter){if(t.tags){var n=r.a.store.getBy("tags","slug",t.tags);if(-1===e.tagIds.indexOf(n.id()))return}var o=String(e.discussionId);r.a.current.discussion&&o===r.a.current.discussion.id()||-1!==r.a.pushedUpdates.indexOf(o)||(r.a.pushedUpdates.push(o),r.a.current instanceof p.a&&r.a.setTitleCount(r.a.pushedUpdates.length),m.redraw())}}),Object(o.extend)(n,"onunload",function(){return e.main.unbind("newPost")})})}),Object(o.extend)(u.a.prototype,"view",function(e){var t=this;if(r.a.pushedUpdates){var n=r.a.pushedUpdates.length;n&&e.children.unshift(l.a.component({className:"Button Button--block DiscussionList-update",onclick:function(){t.refresh(!1).then(function(){t.loadingUpdated=!1,r.a.pushedUpdates=[],r.a.setTitleCount(0),m.redraw()}),t.loadingUpdated=!0},loading:this.loadingUpdated,children:r.a.translator.transChoice("flarum-pusher.forum.discussion_list.show_updates_text",n,{count:n})}))}}),Object(o.extend)(u.a.prototype,"addDiscussion",function(e,t){var n=r.a.pushedUpdates.indexOf(t.id());-1!==n&&r.a.pushedUpdates.splice(n,1),r.a.current instanceof p.a&&r.a.setTitleCount(r.a.pushedUpdates.length),m.redraw()}),Object(o.extend)(c.a.prototype,"config",function(e,t,n){var s=this;t||r.a.pusher.then(function(e){e.main.bind("newPost",function(e){var t=String(e.discussionId);if(s.discussion&&s.discussion.id()===t&&s.stream){var n=s.discussion.commentCount();r.a.store.find("discussions",s.discussion.id()).then(function(){s.stream.update(),document.hasFocus()||(r.a.setTitleCount(Math.max(0,s.discussion.commentCount()-n)),$(window).one("focus",function(){return r.a.setTitleCount(0)}))})}}),Object(o.extend)(n,"onunload",function(){return e.main.unbind("newPost")})})}),Object(o.extend)(p.a.prototype,"actionItems",function(e){e.remove("refresh")}),r.a.pusher.then(function(e){e.user&&e.user.bind("notification",function(){r.a.session.user.pushAttributes({unreadNotificationCount:r.a.session.user.unreadNotificationCount()+1,newNotificationCount:r.a.session.user.newNotificationCount()+1}),delete r.a.cache.notifications,m.redraw()})})})}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/pusher/js/dist/forum.js.map b/extensions/pusher/js/dist/forum.js.map index 334a07061..9612b74f6 100644 --- a/extensions/pusher/js/dist/forum.js.map +++ b/extensions/pusher/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/pusher/webpack/bootstrap","webpack://@flarum/pusher/external \"flarum.core.compat['app']\"","webpack://@flarum/pusher/external \"flarum.core.compat['extend']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/DiscussionList']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/IndexPage']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/pusher/./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","app","initializers","add","loadPusher","deferred","$","getScript","socket","Pusher","forum","attribute","authEndpoint","cluster","auth","headers","X-CSRF-Token","session","csrfToken","resolve","main","subscribe","user","id","pusher","promise","pushedUpdates","extend","DiscussionList","x","isInitialized","context","_this","this","then","channels","data","params","props","q","sort","filter","tags","tag","store","getBy","tagIds","indexOf","String","discussionId","current","discussion","push","IndexPage","setTitleCount","length","redraw","unbind","vdom","_this2","count","children","unshift","Button","component","className","onclick","refresh","loadingUpdated","loading","translator","transChoice","returned","index","splice","DiscussionPage","_this3","stream","oldCount","commentsCount","find","update","document","hasFocus","Math","max","window","one","items","remove","pushAttributes","unreadNotificationsCount","newNotificationsCount","cache","notifications"],"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,O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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 = 8);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/DiscussionList'];","module.exports = flarum.core.compat['components/IndexPage'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/Button'];","/*global Pusher*/\n\nimport { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport DiscussionList from 'flarum/components/DiscussionList';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Button from 'flarum/components/Button';\n\napp.initializers.add('flarum-pusher', () => {\n const loadPusher = m.deferred();\n\n $.getScript('//js.pusher.com/3.0/pusher.min.js', () => {\n const socket = new Pusher(app.forum.attribute('pusherKey'), {\n authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',\n cluster: app.forum.attribute('pusherCluster'),\n auth: {\n headers: {\n 'X-CSRF-Token': app.session.csrfToken\n }\n }\n });\n\n loadPusher.resolve({\n main: socket.subscribe('public'),\n user: app.session.user ? socket.subscribe('private-user' + app.session.user.id()) : null\n });\n });\n\n app.pusher = loadPusher.promise;\n app.pushedUpdates = [];\n\n extend(DiscussionList.prototype, 'config', function(x, isInitialized, context) {\n if (isInitialized) return;\n\n app.pusher.then(channels => {\n channels.main.bind('newPost', data => {\n const params = this.props.params;\n\n if (!params.q && !params.sort && !params.filter) {\n if (params.tags) {\n const tag = app.store.getBy('tags', 'slug', params.tags);\n\n if (data.tagIds.indexOf(tag.id()) === -1) return;\n }\n\n const id = String(data.discussionId);\n\n if ((!app.current.discussion || id !== app.current.discussion.id()) && app.pushedUpdates.indexOf(id) === -1) {\n app.pushedUpdates.push(id);\n\n if (app.current instanceof IndexPage) {\n app.setTitleCount(app.pushedUpdates.length);\n }\n\n m.redraw();\n }\n }\n });\n\n extend(context, 'onunload', () => channels.main.unbind('newPost'));\n });\n });\n\n extend(DiscussionList.prototype, 'view', function(vdom) {\n if (app.pushedUpdates) {\n const count = app.pushedUpdates.length;\n\n if (count) {\n vdom.children.unshift(\n Button.component({\n className: 'Button Button--block DiscussionList-update',\n onclick: () => {\n this.refresh(false).then(() => {\n this.loadingUpdated = false;\n app.pushedUpdates = [];\n app.setTitleCount(0);\n m.redraw();\n });\n this.loadingUpdated = true;\n },\n loading: this.loadingUpdated,\n children: app.translator.transChoice('flarum-pusher.forum.discussion_list.show_updates_text', count, {count})\n })\n );\n }\n }\n });\n\n // Prevent any newly-created discussions from triggering the discussion list\n // update button showing.\n // TODO: Might be better pause the response to the push updates while the\n // composer is loading? idk\n extend(DiscussionList.prototype, 'addDiscussion', function(returned, discussion) {\n const index = app.pushedUpdates.indexOf(discussion.id());\n\n if (index !== -1) {\n app.pushedUpdates.splice(index, 1);\n }\n\n if (app.current instanceof IndexPage) {\n app.setTitleCount(app.pushedUpdates.length);\n }\n\n m.redraw();\n });\n\n extend(DiscussionPage.prototype, 'config', function(x, isInitialized, context) {\n if (isInitialized) return;\n\n app.pusher.then(channels => {\n channels.main.bind('newPost', data => {\n const id = String(data.discussionId);\n\n if (this.discussion && this.discussion.id() === id && this.stream) {\n const oldCount = this.discussion.commentsCount();\n\n app.store.find('discussions', this.discussion.id()).then(() => {\n this.stream.update();\n\n if (!document.hasFocus()) {\n app.setTitleCount(Math.max(0, this.discussion.commentsCount() - oldCount));\n\n $(window).one('focus', () => app.setTitleCount(0));\n }\n });\n }\n });\n\n extend(context, 'onunload', () => channels.main.unbind('newPost'));\n });\n });\n\n extend(IndexPage.prototype, 'actionItems', items => {\n items.remove('refresh');\n });\n\n app.pusher.then(channels => {\n if (channels.user) {\n channels.user.bind('notification', () => {\n app.session.user.pushAttributes({\n unreadNotificationsCount: app.session.user.unreadNotificationsCount() + 1,\n newNotificationsCount: app.session.user.newNotificationsCount() + 1\n });\n delete app.cache.notifications;\n m.redraw();\n });\n }\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/pusher/webpack/bootstrap","webpack://@flarum/pusher/external \"flarum.core.compat['app']\"","webpack://@flarum/pusher/external \"flarum.core.compat['extend']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/DiscussionList']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/IndexPage']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/pusher/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/pusher/./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","app","initializers","add","loadPusher","deferred","$","getScript","socket","Pusher","forum","attribute","authEndpoint","cluster","auth","headers","X-CSRF-Token","session","csrfToken","resolve","main","subscribe","user","id","pusher","promise","pushedUpdates","extend","DiscussionList","x","isInitialized","context","_this","this","then","channels","data","params","props","q","sort","filter","tags","tag","store","getBy","tagIds","indexOf","String","discussionId","current","discussion","push","IndexPage","setTitleCount","length","redraw","unbind","vdom","_this2","count","children","unshift","Button","component","className","onclick","refresh","loadingUpdated","loading","translator","transChoice","returned","index","splice","DiscussionPage","_this3","stream","oldCount","commentCount","find","update","document","hasFocus","Math","max","window","one","items","remove","pushAttributes","unreadNotificationCount","newNotificationCount","cache","notifications"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAA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ASA,GAAMqD,EAAKC,OAAQ,CACjE,IAAMC,EAAWF,EAAKzB,WAAW4B,eAEjC9E,IAAI2C,MAAMoC,KAAK,cAAeJ,EAAKzB,WAAW5B,MAAMW,KAAK,WACvD0C,EAAKC,OAAOI,SAEPC,SAASC,aACZlF,IAAIqD,cAAc8B,KAAKC,IAAI,EAAGT,EAAKzB,WAAW4B,eAAiBD,IAE/DxE,EAAEgF,QAAQC,IAAI,QAAS,kBAAMtF,IAAIqD,cAAc,WAMvD3B,iBAAOI,EAAS,WAAY,kBAAMI,EAASf,KAAKqC,OAAO,iBAI3D9B,iBAAO0B,IAAU3D,UAAW,cAAe,SAAA8F,GACzCA,EAAMC,OAAO,aAGfxF,IAAIuB,OAAOU,KAAK,SAAAC,GACVA,EAASb,MACXa,EAASb,KAAKhC,KAAK,eAAgB,WACjCW,IAAIgB,QAAQK,KAAKoE,eAAe,CAC9BC,wBAAyB1F,IAAIgB,QAAQK,KAAKqE,0BAA4B,EACtEC,qBAAsB3F,IAAIgB,QAAQK,KAAKsE,uBAAyB,WAE3D3F,IAAI4F,MAAMC,cACjB5H,EAAEsF","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 = 8);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/DiscussionList'];","module.exports = flarum.core.compat['components/IndexPage'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['components/Button'];","/*global Pusher*/\n\nimport { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport DiscussionList from 'flarum/components/DiscussionList';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Button from 'flarum/components/Button';\n\napp.initializers.add('flarum-pusher', () => {\n const loadPusher = m.deferred();\n\n $.getScript('//js.pusher.com/3.0/pusher.min.js', () => {\n const socket = new Pusher(app.forum.attribute('pusherKey'), {\n authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',\n cluster: app.forum.attribute('pusherCluster'),\n auth: {\n headers: {\n 'X-CSRF-Token': app.session.csrfToken\n }\n }\n });\n\n loadPusher.resolve({\n main: socket.subscribe('public'),\n user: app.session.user ? socket.subscribe('private-user' + app.session.user.id()) : null\n });\n });\n\n app.pusher = loadPusher.promise;\n app.pushedUpdates = [];\n\n extend(DiscussionList.prototype, 'config', function(x, isInitialized, context) {\n if (isInitialized) return;\n\n app.pusher.then(channels => {\n channels.main.bind('newPost', data => {\n const params = this.props.params;\n\n if (!params.q && !params.sort && !params.filter) {\n if (params.tags) {\n const tag = app.store.getBy('tags', 'slug', params.tags);\n\n if (data.tagIds.indexOf(tag.id()) === -1) return;\n }\n\n const id = String(data.discussionId);\n\n if ((!app.current.discussion || id !== app.current.discussion.id()) && app.pushedUpdates.indexOf(id) === -1) {\n app.pushedUpdates.push(id);\n\n if (app.current instanceof IndexPage) {\n app.setTitleCount(app.pushedUpdates.length);\n }\n\n m.redraw();\n }\n }\n });\n\n extend(context, 'onunload', () => channels.main.unbind('newPost'));\n });\n });\n\n extend(DiscussionList.prototype, 'view', function(vdom) {\n if (app.pushedUpdates) {\n const count = app.pushedUpdates.length;\n\n if (count) {\n vdom.children.unshift(\n Button.component({\n className: 'Button Button--block DiscussionList-update',\n onclick: () => {\n this.refresh(false).then(() => {\n this.loadingUpdated = false;\n app.pushedUpdates = [];\n app.setTitleCount(0);\n m.redraw();\n });\n this.loadingUpdated = true;\n },\n loading: this.loadingUpdated,\n children: app.translator.transChoice('flarum-pusher.forum.discussion_list.show_updates_text', count, {count})\n })\n );\n }\n }\n });\n\n // Prevent any newly-created discussions from triggering the discussion list\n // update button showing.\n // TODO: Might be better pause the response to the push updates while the\n // composer is loading? idk\n extend(DiscussionList.prototype, 'addDiscussion', function(returned, discussion) {\n const index = app.pushedUpdates.indexOf(discussion.id());\n\n if (index !== -1) {\n app.pushedUpdates.splice(index, 1);\n }\n\n if (app.current instanceof IndexPage) {\n app.setTitleCount(app.pushedUpdates.length);\n }\n\n m.redraw();\n });\n\n extend(DiscussionPage.prototype, 'config', function(x, isInitialized, context) {\n if (isInitialized) return;\n\n app.pusher.then(channels => {\n channels.main.bind('newPost', data => {\n const id = String(data.discussionId);\n\n if (this.discussion && this.discussion.id() === id && this.stream) {\n const oldCount = this.discussion.commentCount();\n\n app.store.find('discussions', this.discussion.id()).then(() => {\n this.stream.update();\n\n if (!document.hasFocus()) {\n app.setTitleCount(Math.max(0, this.discussion.commentCount() - oldCount));\n\n $(window).one('focus', () => app.setTitleCount(0));\n }\n });\n }\n });\n\n extend(context, 'onunload', () => channels.main.unbind('newPost'));\n });\n });\n\n extend(IndexPage.prototype, 'actionItems', items => {\n items.remove('refresh');\n });\n\n app.pusher.then(channels => {\n if (channels.user) {\n channels.user.bind('notification', () => {\n app.session.user.pushAttributes({\n unreadNotificationCount: app.session.user.unreadNotificationCount() + 1,\n newNotificationCount: app.session.user.newNotificationCount() + 1\n });\n delete app.cache.notifications;\n m.redraw();\n });\n }\n });\n});\n"],"sourceRoot":""} \ No newline at end of file