mirror of
https://github.com/flarum/core.git
synced 2025-07-17 14:51:19 +02:00
Recompile JS
This commit is contained in:
88
extensions/flags/js/forum/dist/extension.js
vendored
88
extensions/flags/js/forum/dist/extension.js
vendored
@@ -182,7 +182,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
var reason = flag.reason();
|
var reason = flag.reason();
|
||||||
var detail = flag.reasonDetail();
|
var detail = flag.reasonDetail();
|
||||||
|
|
||||||
return [app.trans(reason ? 'flarum-flags.forum.flagged_by_with_reason' : 'flarum-flags.forum.flagged_by', { user: user, reason: reason }), detail ? m(
|
return [app.translator.trans(reason ? 'flarum-flags.forum.flagged_by_with_reason' : 'flarum-flags.forum.flagged_by', { user: user, reason: reason }), detail ? m(
|
||||||
'span',
|
'span',
|
||||||
{ className: 'Post-flagged-detail' },
|
{ className: 'Post-flagged-detail' },
|
||||||
detail
|
detail
|
||||||
@@ -252,13 +252,12 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
|
|
||||||
function FlagList() {
|
function FlagList() {
|
||||||
babelHelpers.classCallCheck(this, FlagList);
|
babelHelpers.classCallCheck(this, FlagList);
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagList.prototype), 'constructor', this).apply(this, arguments);
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
babelHelpers.get(Object.getPrototypeOf(FlagList.prototype), 'constructor', this).apply(this, args);
|
babelHelpers.createClass(FlagList, [{
|
||||||
|
key: 'init',
|
||||||
|
value: function init() {
|
||||||
/**
|
/**
|
||||||
* Whether or not the notifications are loading.
|
* Whether or not the notifications are loading.
|
||||||
*
|
*
|
||||||
@@ -266,8 +265,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
*/
|
*/
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
babelHelpers.createClass(FlagList, [{
|
|
||||||
key: 'view',
|
key: 'view',
|
||||||
value: function view() {
|
value: function view() {
|
||||||
var flags = app.cache.flags || [];
|
var flags = app.cache.flags || [];
|
||||||
@@ -329,7 +327,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
}) : !this.loading ? m(
|
}) : !this.loading ? m(
|
||||||
'div',
|
'div',
|
||||||
{ className: 'NotificationList-empty' },
|
{ className: 'NotificationList-empty' },
|
||||||
app.trans('flarum-flags.forum.no_flags')
|
app.translator.trans('flarum-flags.forum.no_flags')
|
||||||
) : LoadingIndicator.component({ className: 'LoadingIndicator--block' })
|
) : LoadingIndicator.component({ className: 'LoadingIndicator--block' })
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -345,7 +343,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
value: function load() {
|
value: function load() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if (app.cache.flags && !app.forum.attribute('unreadFlagsCount')) {
|
if (app.cache.flags && !app.session.user.attribute('newFlagsCount')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,11 +351,11 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
m.redraw();
|
m.redraw();
|
||||||
|
|
||||||
app.store.find('flags').then(function (flags) {
|
app.store.find('flags').then(function (flags) {
|
||||||
app.forum.pushAttributes({ unreadFlagsCount: 0 });
|
app.session.user.pushAttributes({ newFlagsCount: 0 });
|
||||||
app.cache.flags = flags.sort(function (a, b) {
|
app.cache.flags = flags.sort(function (a, b) {
|
||||||
return b.time() - a.time();
|
return b.time() - a.time();
|
||||||
});
|
});
|
||||||
|
})['finally'](function () {
|
||||||
_this.loading = false;
|
_this.loading = false;
|
||||||
m.redraw();
|
m.redraw();
|
||||||
});
|
});
|
||||||
@@ -385,18 +383,18 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
|
|
||||||
function FlagPostModal() {
|
function FlagPostModal() {
|
||||||
babelHelpers.classCallCheck(this, FlagPostModal);
|
babelHelpers.classCallCheck(this, FlagPostModal);
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagPostModal.prototype), 'constructor', this).apply(this, arguments);
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
babelHelpers.get(Object.getPrototypeOf(FlagPostModal.prototype), 'constructor', this).apply(this, args);
|
babelHelpers.createClass(FlagPostModal, [{
|
||||||
|
key: 'init',
|
||||||
|
value: function init() {
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagPostModal.prototype), 'init', this).call(this);
|
||||||
|
|
||||||
this.reason = m.prop('');
|
this.reason = m.prop('');
|
||||||
this.reasonDetail = m.prop('');
|
this.reasonDetail = m.prop('');
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
babelHelpers.createClass(FlagPostModal, [{
|
|
||||||
key: 'className',
|
key: 'className',
|
||||||
value: function className() {
|
value: function className() {
|
||||||
return 'FlagPostModal Modal--small';
|
return 'FlagPostModal Modal--small';
|
||||||
@@ -487,10 +485,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
}
|
}
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
return _this.hide();
|
return _this.hide();
|
||||||
}, function () {
|
}, this.loaded.bind(this));
|
||||||
_this.loading = false;
|
|
||||||
m.redraw();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
return FlagPostModal;
|
return FlagPostModal;
|
||||||
@@ -512,29 +507,20 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
FlagsDropdown = (function (_NotificationsDropdown) {
|
FlagsDropdown = (function (_NotificationsDropdown) {
|
||||||
babelHelpers.inherits(FlagsDropdown, _NotificationsDropdown);
|
babelHelpers.inherits(FlagsDropdown, _NotificationsDropdown);
|
||||||
babelHelpers.createClass(FlagsDropdown, null, [{
|
|
||||||
key: 'initProps',
|
|
||||||
value: function initProps(props) {
|
|
||||||
props.label = props.label || 'Flagged Posts';
|
|
||||||
props.icon = props.icon || 'flag';
|
|
||||||
|
|
||||||
babelHelpers.get(Object.getPrototypeOf(FlagsDropdown), 'initProps', this).call(this, props);
|
|
||||||
}
|
|
||||||
}]);
|
|
||||||
|
|
||||||
function FlagsDropdown() {
|
function FlagsDropdown() {
|
||||||
babelHelpers.classCallCheck(this, FlagsDropdown);
|
babelHelpers.classCallCheck(this, FlagsDropdown);
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagsDropdown.prototype), 'constructor', this).apply(this, arguments);
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
|
|
||||||
babelHelpers.get(Object.getPrototypeOf(FlagsDropdown.prototype), 'constructor', this).apply(this, args);
|
|
||||||
|
|
||||||
this.list = new FlagList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
babelHelpers.createClass(FlagsDropdown, [{
|
babelHelpers.createClass(FlagsDropdown, [{
|
||||||
|
key: 'init',
|
||||||
|
value: function init() {
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagsDropdown.prototype), 'init', this).call(this);
|
||||||
|
|
||||||
|
this.list = new FlagList();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
key: 'goToRoute',
|
key: 'goToRoute',
|
||||||
value: function goToRoute() {
|
value: function goToRoute() {
|
||||||
m.route(app.route('flags'));
|
m.route(app.route('flags'));
|
||||||
@@ -542,12 +528,20 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
}, {
|
}, {
|
||||||
key: 'getUnreadCount',
|
key: 'getUnreadCount',
|
||||||
value: function getUnreadCount() {
|
value: function getUnreadCount() {
|
||||||
return app.forum.attribute('unreadFlagsCount');
|
return app.cache.flags ? app.cache.flags.length : app.forum.attribute('flagsCount');
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'getNewCount',
|
key: 'getNewCount',
|
||||||
value: function getNewCount() {
|
value: function getNewCount() {
|
||||||
return app.forum.attribute('newFlagsCount');
|
return app.session.user.attribute('newFlagsCount');
|
||||||
|
}
|
||||||
|
}], [{
|
||||||
|
key: 'initProps',
|
||||||
|
value: function initProps(props) {
|
||||||
|
props.label = props.label || 'Flagged Posts';
|
||||||
|
props.icon = props.icon || 'flag';
|
||||||
|
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagsDropdown), 'initProps', this).call(this, props);
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
return FlagsDropdown;
|
return FlagsDropdown;
|
||||||
@@ -577,12 +571,13 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
|
|
||||||
function FlagsPage() {
|
function FlagsPage() {
|
||||||
babelHelpers.classCallCheck(this, FlagsPage);
|
babelHelpers.classCallCheck(this, FlagsPage);
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagsPage.prototype), 'constructor', this).apply(this, arguments);
|
||||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
args[_key] = arguments[_key];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
babelHelpers.get(Object.getPrototypeOf(FlagsPage.prototype), 'constructor', this).apply(this, args);
|
babelHelpers.createClass(FlagsPage, [{
|
||||||
|
key: 'init',
|
||||||
|
value: function init() {
|
||||||
|
babelHelpers.get(Object.getPrototypeOf(FlagsPage.prototype), 'init', this).call(this);
|
||||||
|
|
||||||
app.history.push('flags');
|
app.history.push('flags');
|
||||||
|
|
||||||
@@ -591,8 +586,7 @@ System.register('flarum/flags/addFlagControl', ['flarum/extend', 'flarum/app', '
|
|||||||
|
|
||||||
this.bodyClass = 'App--flags';
|
this.bodyClass = 'App--flags';
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
babelHelpers.createClass(FlagsPage, [{
|
|
||||||
key: 'view',
|
key: 'view',
|
||||||
value: function view() {
|
value: function view() {
|
||||||
return m(
|
return m(
|
||||||
|
Reference in New Issue
Block a user