Unread Count actually requires the nodes to be on the page
Unfortunately
This commit is contained in:
parent
743810647d
commit
6bd1d44b68
@ -1473,16 +1473,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
DataBoard.prototype.disconnect = function() {
|
DataBoard.prototype.disconnect = function() {
|
||||||
var key, _i, _len, _results;
|
|
||||||
$.desync(this.key);
|
$.desync(this.key);
|
||||||
_results = [];
|
delete this.sync;
|
||||||
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
return delete this.data;
|
||||||
key = this[_i];
|
|
||||||
if (this.hasOwnKey(key)) {
|
|
||||||
_results.push(delete this[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return DataBoard;
|
return DataBoard;
|
||||||
@ -9680,13 +9673,13 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
disconnect: function() {
|
disconnect: function() {
|
||||||
var hr, name, parent, _i, _len, _ref;
|
var hr, name, _i, _len, _ref;
|
||||||
if (!Unread.db) {
|
if (!Unread.db) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.db.disconnect();
|
Unread.db.disconnect();
|
||||||
if (parent = (hr = Unread.hr).parentElement) {
|
if (hr = Unread.hr, Unread) {
|
||||||
$.rm(hr, parent);
|
$.rm(hr);
|
||||||
}
|
}
|
||||||
_ref = ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost'];
|
_ref = ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost'];
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -9727,7 +9720,9 @@
|
|||||||
posts.push(post);
|
posts.push(post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unread.addPosts(posts);
|
if (!Conf['Quote Threading']) {
|
||||||
|
Unread.addPosts(posts);
|
||||||
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
QuoteThreading.force();
|
QuoteThreading.force();
|
||||||
}
|
}
|
||||||
@ -12132,7 +12127,11 @@
|
|||||||
var board;
|
var board;
|
||||||
board = $('.board');
|
board = $('.board');
|
||||||
$.rmAll(board);
|
$.rmAll(board);
|
||||||
return $.add(board, Navigate.threadRoot);
|
$.add(board, Navigate.threadRoot);
|
||||||
|
if (Conf['Unread Count']) {
|
||||||
|
Unread.read();
|
||||||
|
return Unread.update();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
popstate: function() {
|
popstate: function() {
|
||||||
var a;
|
var a;
|
||||||
|
|||||||
@ -1479,16 +1479,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
DataBoard.prototype.disconnect = function() {
|
DataBoard.prototype.disconnect = function() {
|
||||||
var key, _i, _len, _results;
|
|
||||||
$.desync(this.key);
|
$.desync(this.key);
|
||||||
_results = [];
|
delete this.sync;
|
||||||
for (_i = 0, _len = this.length; _i < _len; _i++) {
|
return delete this.data;
|
||||||
key = this[_i];
|
|
||||||
if (this.hasOwnKey(key)) {
|
|
||||||
_results.push(delete this[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return DataBoard;
|
return DataBoard;
|
||||||
@ -9663,13 +9656,13 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
disconnect: function() {
|
disconnect: function() {
|
||||||
var hr, name, parent, _i, _len, _ref;
|
var hr, name, _i, _len, _ref;
|
||||||
if (!Unread.db) {
|
if (!Unread.db) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Unread.db.disconnect();
|
Unread.db.disconnect();
|
||||||
if (parent = (hr = Unread.hr).parentElement) {
|
if (hr = Unread.hr, Unread) {
|
||||||
$.rm(hr, parent);
|
$.rm(hr);
|
||||||
}
|
}
|
||||||
_ref = ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost'];
|
_ref = ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost'];
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
@ -9710,7 +9703,9 @@
|
|||||||
posts.push(post);
|
posts.push(post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unread.addPosts(posts);
|
if (!Conf['Quote Threading']) {
|
||||||
|
Unread.addPosts(posts);
|
||||||
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
QuoteThreading.force();
|
QuoteThreading.force();
|
||||||
}
|
}
|
||||||
@ -12121,7 +12116,11 @@
|
|||||||
var board;
|
var board;
|
||||||
board = $('.board');
|
board = $('.board');
|
||||||
$.rmAll(board);
|
$.rmAll(board);
|
||||||
return $.add(board, Navigate.threadRoot);
|
$.add(board, Navigate.threadRoot);
|
||||||
|
if (Conf['Unread Count']) {
|
||||||
|
Unread.read();
|
||||||
|
return Unread.update();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
popstate: function() {
|
popstate: function() {
|
||||||
return Navigate.popstate = function() {
|
return Navigate.popstate = function() {
|
||||||
|
|||||||
@ -280,6 +280,9 @@ Navigate =
|
|||||||
board = $ '.board'
|
board = $ '.board'
|
||||||
$.rmAll board
|
$.rmAll board
|
||||||
$.add board, Navigate.threadRoot
|
$.add board, Navigate.threadRoot
|
||||||
|
if Conf['Unread Count']
|
||||||
|
Unread.read()
|
||||||
|
Unread.update()
|
||||||
|
|
||||||
popstate: -> <% if (type === 'crx') { %> Navigate.popstate = -> <% } %> # blink/webkit throw a popstate on page load. Not what we want.
|
popstate: -> <% if (type === 'crx') { %> Navigate.popstate = -> <% } %> # blink/webkit throw a popstate on page load. Not what we want.
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
|
|||||||
@ -13,8 +13,7 @@ class DataBoard
|
|||||||
@sync = sync
|
@sync = sync
|
||||||
$.on d, '4chanXInitFinished', init
|
$.on d, '4chanXInitFinished', init
|
||||||
|
|
||||||
save: ->
|
save: -> $.set @key, @data
|
||||||
$.set @key, @data
|
|
||||||
|
|
||||||
delete: ({boardID, threadID, postID}) ->
|
delete: ({boardID, threadID, postID}) ->
|
||||||
if postID
|
if postID
|
||||||
@ -93,4 +92,5 @@ class DataBoard
|
|||||||
|
|
||||||
disconnect: ->
|
disconnect: ->
|
||||||
$.desync @key
|
$.desync @key
|
||||||
delete @[key] for key in @ when @hasOwnKey key
|
delete @sync
|
||||||
|
delete @data
|
||||||
@ -16,7 +16,7 @@ Unread =
|
|||||||
return unless Unread.db
|
return unless Unread.db
|
||||||
|
|
||||||
Unread.db.disconnect()
|
Unread.db.disconnect()
|
||||||
$.rm hr, parent if parent = (hr = Unread.hr).parentElement
|
$.rm hr if {hr} = Unread
|
||||||
|
|
||||||
delete @[name] for name in ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost']
|
delete @[name] for name in ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost']
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ Unread =
|
|||||||
$.off d, '4chanXInitFinished', Unread.ready
|
$.off d, '4chanXInitFinished', Unread.ready
|
||||||
posts = []
|
posts = []
|
||||||
posts.push post for ID, post of Unread.thread.posts when post.isReply
|
posts.push post for ID, post of Unread.thread.posts when post.isReply
|
||||||
Unread.addPosts posts
|
Unread.addPosts posts unless Conf['Quote Threading']
|
||||||
QuoteThreading.force() if Conf['Quote Threading']
|
QuoteThreading.force() if Conf['Quote Threading']
|
||||||
Unread.scroll() if Conf['Scroll to Last Read Post']
|
Unread.scroll() if Conf['Scroll to Last Read Post']
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user