Browse Source

Make all notifications show, not just the first unread

Removal of unused varable
main
discomrade 3 years ago
parent
commit
7535aad664
  1. 16
      js/auto-reload.js
  2. 9
      js/mod/recent-posts-auto-reload.js

16
js/auto-reload.js

@ -49,9 +49,8 @@ $(document).ready(function(){
var end_of_page = false; var end_of_page = false;
var new_posts = 0; var new_posts = 0;
var first_new_post = null;
var title = document.title; var title = document.title;
if (typeof update_title == "undefined") { if (typeof update_title == "undefined") {
@ -112,7 +111,6 @@ $(document).ready(function(){
new_posts = 0; new_posts = 0;
} }
update_title(); update_title();
first_new_post = null;
}; };
// automatically updates the thread after a specified delay // automatically updates the thread after a specified delay
@ -153,8 +151,18 @@ $(document).ready(function(){
var id = $(this).attr('id'); var id = $(this).attr('id');
if($('#' + id).length == 0) { if($('#' + id).length == 0) {
if (!new_posts) { if (!new_posts) {
<<<<<<< HEAD
first_new_post = this; first_new_post = this;
} }
=======
makeIcon('reply');
}
if (notify === "all" || (notify === "mention" && $(this).find('.own_post').length)) {
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New reply to "+$('title').text(), {body: $('<div/>').html(body).text()});
}
>>>>>>> 5e4e27bc... Make all notifications show, not just the first unread
$(this).insertAfter($('div.post:not(.post-hover,.inline):last').next()).after('<br class="clear">'); $(this).insertAfter($('div.post:not(.post-hover,.inline):last').next()).after('<br class="clear">');
new_posts++; new_posts++;
loaded_posts++; loaded_posts++;

9
js/mod/recent-posts-auto-reload.js

@ -190,12 +190,9 @@ $(document).ready(function(){
var id = $(this).attr('id'); var id = $(this).attr('id');
// check that this post doesn't already exist // check that this post doesn't already exist
if($('#' + id).length == 0) { if($('#' + id).length == 0) {
if (!new_posts) { if (notify) {
first_new_post = this; var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
if (notify) { var n = new Notification("New reply to "+$('title').text(), {body: $('<div/>').html(body).text()});
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New reply to "+$('title').text(), {body: $('<div/>').html(body).text()});
}
} }
$(this).parent().insertBefore($('.post-wrapper:first')); $(this).parent().insertBefore($('.post-wrapper:first'));
new_posts++; new_posts++;

Loading…
Cancel
Save