Merge branch 'master' of https://github.com/designcreateplay/NodeBB
commit
468688615f
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"title": "Notifications"
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
define(function() {
|
||||||
|
var Notifications = {};
|
||||||
|
|
||||||
|
Notifications.init = function() {
|
||||||
|
var listEl = $('.notifications-list'),
|
||||||
|
markAllReadEl = document.getElementById('mark-all-notifs-read');
|
||||||
|
|
||||||
|
$('span.timeago').timeago();
|
||||||
|
|
||||||
|
// Allow the user to click anywhere in the LI
|
||||||
|
listEl.on('click', 'li', function(e) {
|
||||||
|
this.querySelector('a').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mark all as read button
|
||||||
|
$(markAllReadEl).click(function() {
|
||||||
|
socket.emit('api:notifications.mark_all_read', {}, function() {
|
||||||
|
ajaxify.go('notifications');
|
||||||
|
app.alert({
|
||||||
|
alert_id: "notifications:mark_all_read",
|
||||||
|
title: "All Notifications Read",
|
||||||
|
message: "Successfully marked all notifications read",
|
||||||
|
type: 'success',
|
||||||
|
timeout: 2500
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Notifications;
|
||||||
|
});
|
@ -0,0 +1,14 @@
|
|||||||
|
<h2>[[notifications:title]]</h2>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-default" id="mark-all-notifs-read">Mark All as Read</button>
|
||||||
|
|
||||||
|
<ul class="notifications-list">
|
||||||
|
<!-- BEGIN notifications -->
|
||||||
|
<li data-nid="{notifications.nid}" class="{notifications.readClass}">
|
||||||
|
<p class="timestamp">
|
||||||
|
<span class="timeago" title="{notifications.datetimeISO}"></span>
|
||||||
|
</p>
|
||||||
|
<a href="..{notifications.path}">{notifications.text}</a>
|
||||||
|
</li>
|
||||||
|
<!-- END notifications -->
|
||||||
|
</ul>
|
Loading…
Reference in New Issue