// Store the title, to later append notifications count var page_title = document.title; /** * Adds a new notification to the top of the notification list. */ function addNotification(no) { var $notifications_list = $('#notifications-list'); // There is a notification to be shown, so remove any "no notifications yet" message. $notifications_list.find('li.nc-item-empty').remove(); console.log('New notification:', no); return; // // // Increase the unread_new counter // if (!no['is_read']){ unread_new++ }; // // // Check if the current item has been read, to style it // var is_read = no['is_read'] ? 'is_read' : ''; // // var read_info = 'data-id="'+ no['_id'] + '" data-read="' + no['is_read'] + '"'; // // // Notification list item // var content = '