Merge branch 'v3'
Conflicts: builds/appchan-x.user.js builds/crx/script.js
This commit is contained in:
commit
51219252aa
@ -12142,13 +12142,13 @@
|
|||||||
ready: function() {
|
ready: function() {
|
||||||
var posts;
|
var posts;
|
||||||
$.off(d, '4chanXInitFinished', Unread.ready);
|
$.off(d, '4chanXInitFinished', Unread.ready);
|
||||||
posts = [];
|
|
||||||
Unread.thread.posts.forEach(function(post) {
|
|
||||||
if (post.isReply) {
|
|
||||||
return posts.push(post);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!Conf['Quote Threading']) {
|
if (!Conf['Quote Threading']) {
|
||||||
|
posts = [];
|
||||||
|
Unread.thread.posts.forEach(function(post) {
|
||||||
|
if (post.isReply) {
|
||||||
|
return posts.push(post);
|
||||||
|
}
|
||||||
|
});
|
||||||
Unread.addPosts(posts);
|
Unread.addPosts(posts);
|
||||||
}
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
@ -12219,9 +12219,7 @@
|
|||||||
})) {
|
})) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(post.prev || post.next)) {
|
Unread.posts.push(post);
|
||||||
Unread.posts.push(post);
|
|
||||||
}
|
|
||||||
Unread.addPostQuotingYou(post);
|
Unread.addPostQuotingYou(post);
|
||||||
}
|
}
|
||||||
if (Conf['Unread Line']) {
|
if (Conf['Unread Line']) {
|
||||||
@ -12266,8 +12264,11 @@
|
|||||||
onUpdate: function(e) {
|
onUpdate: function(e) {
|
||||||
if (e.detail[404]) {
|
if (e.detail[404]) {
|
||||||
return Unread.update();
|
return Unread.update();
|
||||||
} else {
|
} else if (!Conf['Quote Threading']) {
|
||||||
return Unread.addPosts(e.detail.newPosts);
|
return Unread.addPosts(e.detail.newPosts);
|
||||||
|
} else {
|
||||||
|
Unread.read();
|
||||||
|
return Unread.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
readSinglePost: function(post) {
|
readSinglePost: function(post) {
|
||||||
@ -15860,11 +15861,11 @@
|
|||||||
},
|
},
|
||||||
updateContext: function(view) {
|
updateContext: function(view) {
|
||||||
var oldView;
|
var oldView;
|
||||||
if (view === g.VIEW) {
|
g.DEAD = false;
|
||||||
return;
|
if (view !== g.VIEW) {
|
||||||
|
$.rmClass(doc, g.VIEW);
|
||||||
|
$.addClass(doc, view);
|
||||||
}
|
}
|
||||||
$.rmClass(doc, g.VIEW);
|
|
||||||
$.addClass(doc, view);
|
|
||||||
oldView = g.VIEW;
|
oldView = g.VIEW;
|
||||||
g.VIEW = view;
|
g.VIEW = view;
|
||||||
return {
|
return {
|
||||||
@ -16096,7 +16097,6 @@
|
|||||||
Main.callbackNodes(Thread, [thread]);
|
Main.callbackNodes(Thread, [thread]);
|
||||||
Main.callbackNodes(Post, posts);
|
Main.callbackNodes(Post, posts);
|
||||||
Navigate.ready('Quote Threading', QuoteThreading.force, Conf['Quote Threading'] && !Conf['Unread Count']);
|
Navigate.ready('Quote Threading', QuoteThreading.force, Conf['Quote Threading'] && !Conf['Unread Count']);
|
||||||
Navigate.ready('Unread Count', Unread.ready, Conf['Unread Count']);
|
|
||||||
Navigate.buildThread();
|
Navigate.buildThread();
|
||||||
return Header.hashScroll.call(window);
|
return Header.hashScroll.call(window);
|
||||||
},
|
},
|
||||||
@ -16106,8 +16106,7 @@
|
|||||||
$.rmAll(board);
|
$.rmAll(board);
|
||||||
$.add(board, [Navigate.threadRoot, $.el('hr')]);
|
$.add(board, [Navigate.threadRoot, $.el('hr')]);
|
||||||
if (Conf['Unread Count']) {
|
if (Conf['Unread Count']) {
|
||||||
Unread.read();
|
return Navigate.ready('Unread Count', Unread.ready, Conf['Unread Count']);
|
||||||
return Unread.update();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
popstate: function() {
|
popstate: function() {
|
||||||
|
|||||||
@ -12133,13 +12133,13 @@
|
|||||||
ready: function() {
|
ready: function() {
|
||||||
var posts;
|
var posts;
|
||||||
$.off(d, '4chanXInitFinished', Unread.ready);
|
$.off(d, '4chanXInitFinished', Unread.ready);
|
||||||
posts = [];
|
|
||||||
Unread.thread.posts.forEach(function(post) {
|
|
||||||
if (post.isReply) {
|
|
||||||
return posts.push(post);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!Conf['Quote Threading']) {
|
if (!Conf['Quote Threading']) {
|
||||||
|
posts = [];
|
||||||
|
Unread.thread.posts.forEach(function(post) {
|
||||||
|
if (post.isReply) {
|
||||||
|
return posts.push(post);
|
||||||
|
}
|
||||||
|
});
|
||||||
Unread.addPosts(posts);
|
Unread.addPosts(posts);
|
||||||
}
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
@ -12210,9 +12210,7 @@
|
|||||||
})) {
|
})) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(post.prev || post.next)) {
|
Unread.posts.push(post);
|
||||||
Unread.posts.push(post);
|
|
||||||
}
|
|
||||||
Unread.addPostQuotingYou(post);
|
Unread.addPostQuotingYou(post);
|
||||||
}
|
}
|
||||||
if (Conf['Unread Line']) {
|
if (Conf['Unread Line']) {
|
||||||
@ -12257,8 +12255,11 @@
|
|||||||
onUpdate: function(e) {
|
onUpdate: function(e) {
|
||||||
if (e.detail[404]) {
|
if (e.detail[404]) {
|
||||||
return Unread.update();
|
return Unread.update();
|
||||||
} else {
|
} else if (!Conf['Quote Threading']) {
|
||||||
return Unread.addPosts(e.detail.newPosts);
|
return Unread.addPosts(e.detail.newPosts);
|
||||||
|
} else {
|
||||||
|
Unread.read();
|
||||||
|
return Unread.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
readSinglePost: function(post) {
|
readSinglePost: function(post) {
|
||||||
@ -15863,11 +15864,11 @@
|
|||||||
},
|
},
|
||||||
updateContext: function(view) {
|
updateContext: function(view) {
|
||||||
var oldView;
|
var oldView;
|
||||||
if (view === g.VIEW) {
|
g.DEAD = false;
|
||||||
return;
|
if (view !== g.VIEW) {
|
||||||
|
$.rmClass(doc, g.VIEW);
|
||||||
|
$.addClass(doc, view);
|
||||||
}
|
}
|
||||||
$.rmClass(doc, g.VIEW);
|
|
||||||
$.addClass(doc, view);
|
|
||||||
oldView = g.VIEW;
|
oldView = g.VIEW;
|
||||||
g.VIEW = view;
|
g.VIEW = view;
|
||||||
return {
|
return {
|
||||||
@ -16099,7 +16100,6 @@
|
|||||||
Main.callbackNodes(Thread, [thread]);
|
Main.callbackNodes(Thread, [thread]);
|
||||||
Main.callbackNodes(Post, posts);
|
Main.callbackNodes(Post, posts);
|
||||||
Navigate.ready('Quote Threading', QuoteThreading.force, Conf['Quote Threading'] && !Conf['Unread Count']);
|
Navigate.ready('Quote Threading', QuoteThreading.force, Conf['Quote Threading'] && !Conf['Unread Count']);
|
||||||
Navigate.ready('Unread Count', Unread.ready, Conf['Unread Count']);
|
|
||||||
Navigate.buildThread();
|
Navigate.buildThread();
|
||||||
return Header.hashScroll.call(window);
|
return Header.hashScroll.call(window);
|
||||||
},
|
},
|
||||||
@ -16109,8 +16109,7 @@
|
|||||||
$.rmAll(board);
|
$.rmAll(board);
|
||||||
$.add(board, [Navigate.threadRoot, $.el('hr')]);
|
$.add(board, [Navigate.threadRoot, $.el('hr')]);
|
||||||
if (Conf['Unread Count']) {
|
if (Conf['Unread Count']) {
|
||||||
Unread.read();
|
return Navigate.ready('Unread Count', Unread.ready, Conf['Unread Count']);
|
||||||
return Unread.update();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
popstate: function() {
|
popstate: function() {
|
||||||
|
|||||||
@ -90,10 +90,12 @@ Navigate =
|
|||||||
QR.generatePostableThreadsList()
|
QR.generatePostableThreadsList()
|
||||||
|
|
||||||
updateContext: (view) ->
|
updateContext: (view) ->
|
||||||
return if view is g.VIEW
|
g.DEAD = false
|
||||||
|
|
||||||
|
unless view is g.VIEW
|
||||||
|
$.rmClass doc, g.VIEW
|
||||||
|
$.addClass doc, view
|
||||||
|
|
||||||
$.rmClass doc, g.VIEW
|
|
||||||
$.addClass doc, view
|
|
||||||
oldView = g.VIEW
|
oldView = g.VIEW
|
||||||
g.VIEW = view
|
g.VIEW = view
|
||||||
{
|
{
|
||||||
@ -286,7 +288,6 @@ Navigate =
|
|||||||
Main.callbackNodes Post, posts
|
Main.callbackNodes Post, posts
|
||||||
|
|
||||||
Navigate.ready 'Quote Threading', QuoteThreading.force, Conf['Quote Threading'] and not Conf['Unread Count']
|
Navigate.ready 'Quote Threading', QuoteThreading.force, Conf['Quote Threading'] and not Conf['Unread Count']
|
||||||
Navigate.ready 'Unread Count', Unread.ready, Conf['Unread Count']
|
|
||||||
|
|
||||||
Navigate.buildThread()
|
Navigate.buildThread()
|
||||||
Header.hashScroll.call window
|
Header.hashScroll.call window
|
||||||
@ -297,8 +298,7 @@ Navigate =
|
|||||||
$.add board, [Navigate.threadRoot, $.el 'hr']
|
$.add board, [Navigate.threadRoot, $.el 'hr']
|
||||||
|
|
||||||
if Conf['Unread Count']
|
if Conf['Unread Count']
|
||||||
Unread.read()
|
Navigate.ready 'Unread Count', Unread.ready, Conf['Unread Count']
|
||||||
Unread.update()
|
|
||||||
|
|
||||||
popstate: ->
|
popstate: ->
|
||||||
return if window.location.pathname is Navigate.path
|
return if window.location.pathname is Navigate.path
|
||||||
|
|||||||
@ -41,9 +41,10 @@ Unread =
|
|||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
$.off d, '4chanXInitFinished', Unread.ready
|
$.off d, '4chanXInitFinished', Unread.ready
|
||||||
posts = []
|
unless Conf['Quote Threading']
|
||||||
Unread.thread.posts.forEach (post) -> posts.push post if post.isReply
|
posts = []
|
||||||
Unread.addPosts posts unless Conf['Quote Threading']
|
Unread.thread.posts.forEach (post) -> posts.push post if post.isReply
|
||||||
|
Unread.addPosts posts
|
||||||
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']
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ Unread =
|
|||||||
threadID: post.thread.ID
|
threadID: post.thread.ID
|
||||||
postID: ID
|
postID: ID
|
||||||
}
|
}
|
||||||
Unread.posts.push post unless post.prev or post.next
|
Unread.posts.push post
|
||||||
Unread.addPostQuotingYou post
|
Unread.addPostQuotingYou post
|
||||||
if Conf['Unread Line']
|
if Conf['Unread Line']
|
||||||
# Force line on visible threads if there were no unread posts previously.
|
# Force line on visible threads if there were no unread posts previously.
|
||||||
@ -125,8 +126,11 @@ Unread =
|
|||||||
onUpdate: (e) ->
|
onUpdate: (e) ->
|
||||||
if e.detail[404]
|
if e.detail[404]
|
||||||
Unread.update()
|
Unread.update()
|
||||||
else
|
else if !Conf['Quote Threading']
|
||||||
Unread.addPosts e.detail.newPosts
|
Unread.addPosts e.detail.newPosts
|
||||||
|
else
|
||||||
|
Unread.read()
|
||||||
|
Unread.update()
|
||||||
|
|
||||||
readSinglePost: (post) ->
|
readSinglePost: (post) ->
|
||||||
{ID} = post
|
{ID} = post
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user