1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 07:11:17 +02:00

Massive JavaScript cleanup

- Use JSX for templates
- Docblock/comment everything
- Mostly passes ESLint (still some work to do)
- Lots of renaming, refactoring, etc.

CSS hasn't been updated yet.
This commit is contained in:
Toby Zerner
2015-07-15 14:00:11 +09:30
parent 4480e0a83f
commit ab6c03c0cc
220 changed files with 9785 additions and 5919 deletions

View File

@@ -1,18 +1,18 @@
import Model from 'flarum/model';
import Model from 'flarum/Model';
import mixin from 'flarum/utils/mixin';
import computed from 'flarum/utils/computed';
class Notification extends Model {}
export default class Notification extends mixin(Model, {
contentType: Model.attribute('contentType'),
subjectId: Model.attribute('subjectId'),
content: Model.attribute('content'),
time: Model.attribute('time', Model.date),
Notification.prototype.contentType = Model.attribute('contentType');
Notification.prototype.subjectId = Model.attribute('subjectId');
Notification.prototype.content = Model.attribute('content');
Notification.prototype.time = Model.attribute('time', Model.date);
Notification.prototype.isRead = Model.attribute('isRead');
Notification.prototype.unreadCount = Model.attribute('unreadCount');
Notification.prototype.additionalUnreadCount = computed('unreadCount', unreadCount => Math.max(0, unreadCount - 1));
isRead: Model.attribute('isRead'),
unreadCount: Model.attribute('unreadCount'),
additionalUnreadCount: computed('unreadCount', unreadCount => Math.max(0, unreadCount - 1)),
Notification.prototype.user = Model.hasOne('user');
Notification.prototype.sender = Model.hasOne('sender');
Notification.prototype.subject = Model.hasOne('subject');
export default Notification;
user: Model.hasOne('user'),
sender: Model.hasOne('sender'),
subject: Model.hasOne('subject')
}) {}