Merge branch 'v3'
Conflicts: builds/crx/script.js
This commit is contained in:
commit
dbc8e21297
@ -16,6 +16,7 @@
|
|||||||
- Linkifier Rewrite.
|
- Linkifier Rewrite.
|
||||||
- Fix Quote Threading toggle.
|
- Fix Quote Threading toggle.
|
||||||
- Added Twitch.tv and Vine embedding (with @ihavenoface)
|
- Added Twitch.tv and Vine embedding (with @ihavenoface)
|
||||||
|
- Keybinds to scroll to posts that quote you.
|
||||||
- Minor optimizations.
|
- Minor optimizations.
|
||||||
- Minor fixes.
|
- Minor fixes.
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -389,7 +389,9 @@
|
|||||||
'Next reply': ['j', 'Select next reply.'],
|
'Next reply': ['j', 'Select next reply.'],
|
||||||
'Previous reply': ['k', 'Select previous reply.'],
|
'Previous reply': ['k', 'Select previous reply.'],
|
||||||
'Deselect reply': ['Shift+d', 'Deselect reply.'],
|
'Deselect reply': ['Shift+d', 'Deselect reply.'],
|
||||||
'Hide': ['x', 'Hide thread.']
|
'Hide': ['x', 'Hide thread.'],
|
||||||
|
'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'],
|
||||||
|
'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.']
|
||||||
},
|
},
|
||||||
updater: {
|
updater: {
|
||||||
checkbox: {
|
checkbox: {
|
||||||
@ -6496,6 +6498,38 @@
|
|||||||
$.addClass(this.nodes.root, 'quotesYou');
|
$.addClass(this.nodes.root, 'quotesYou');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
cb: {
|
||||||
|
seek: function(type) {
|
||||||
|
var post, posts, result, str;
|
||||||
|
|
||||||
|
if (!QuoteYou.lastRead) {
|
||||||
|
if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
|
||||||
|
new Notification('warning', 'No posts are currently quoting you, loser.', 20);
|
||||||
|
}
|
||||||
|
if (QuoteYou.cb.scroll(post)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = "" + type + "::div[contains(@class,'quotesYou')]";
|
||||||
|
result = $.X(str, QuoteYou.lastRead);
|
||||||
|
while (post = result.snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {
|
||||||
|
if (QuoteYou.cb.scroll(post)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
posts = $$('.quotesYou');
|
||||||
|
return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
|
||||||
|
},
|
||||||
|
scroll: function(post) {
|
||||||
|
QuoteYou.lastRead = post;
|
||||||
|
if (Get.postFromRoot(post).isHidden) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Header.scrollToPost(post);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -10303,6 +10337,11 @@
|
|||||||
bottom = post.nodes.root.getBoundingClientRect().bottom;
|
bottom = post.nodes.root.getBoundingClientRect().bottom;
|
||||||
if (bottom < height) {
|
if (bottom < height) {
|
||||||
ID = post.ID;
|
ID = post.ID;
|
||||||
|
if (Conf['Mark Quotes of You']) {
|
||||||
|
if (post.info.yours) {
|
||||||
|
QuoteYou.lastRead = post.nodes.root;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
posts.splice(i, 1);
|
posts.splice(i, 1);
|
||||||
continue;
|
continue;
|
||||||
@ -12923,6 +12962,12 @@
|
|||||||
ThreadHiding.toggle(thread);
|
ThreadHiding.toggle(thread);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Conf['Previous Post Quoting You']:
|
||||||
|
QuoteYou.cb.seek('preceding');
|
||||||
|
break;
|
||||||
|
case Conf['Next Post Quoting You']:
|
||||||
|
QuoteYou.cb.seek('following');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -14679,7 +14724,7 @@
|
|||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
var URL;
|
var URL;
|
||||||
|
|
||||||
if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') {
|
if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
|
||||||
Redirect.init();
|
Redirect.init();
|
||||||
pathname = location.pathname.split('/');
|
pathname = location.pathname.split('/');
|
||||||
URL = Redirect.to('file', {
|
URL = Redirect.to('file', {
|
||||||
|
|||||||
@ -372,7 +372,9 @@
|
|||||||
'Next reply': ['j', 'Select next reply.'],
|
'Next reply': ['j', 'Select next reply.'],
|
||||||
'Previous reply': ['k', 'Select previous reply.'],
|
'Previous reply': ['k', 'Select previous reply.'],
|
||||||
'Deselect reply': ['Shift+d', 'Deselect reply.'],
|
'Deselect reply': ['Shift+d', 'Deselect reply.'],
|
||||||
'Hide': ['x', 'Hide thread.']
|
'Hide': ['x', 'Hide thread.'],
|
||||||
|
'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'],
|
||||||
|
'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.']
|
||||||
},
|
},
|
||||||
updater: {
|
updater: {
|
||||||
checkbox: {
|
checkbox: {
|
||||||
@ -6503,6 +6505,38 @@
|
|||||||
$.addClass(this.nodes.root, 'quotesYou');
|
$.addClass(this.nodes.root, 'quotesYou');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
cb: {
|
||||||
|
seek: function(type) {
|
||||||
|
var post, posts, result, str;
|
||||||
|
|
||||||
|
if (!QuoteYou.lastRead) {
|
||||||
|
if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
|
||||||
|
new Notification('warning', 'No posts are currently quoting you, loser.', 20);
|
||||||
|
}
|
||||||
|
if (QuoteYou.cb.scroll(post)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = "" + type + "::div[contains(@class,'quotesYou')]";
|
||||||
|
result = $.X(str, QuoteYou.lastRead);
|
||||||
|
while (post = result.snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {
|
||||||
|
if (QuoteYou.cb.scroll(post)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
posts = $$('.quotesYou');
|
||||||
|
return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);
|
||||||
|
},
|
||||||
|
scroll: function(post) {
|
||||||
|
QuoteYou.lastRead = post;
|
||||||
|
if (Get.postFromRoot(post).isHidden) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Header.scrollToPost(post);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -10286,6 +10320,11 @@
|
|||||||
bottom = post.nodes.root.getBoundingClientRect().bottom;
|
bottom = post.nodes.root.getBoundingClientRect().bottom;
|
||||||
if (bottom < height) {
|
if (bottom < height) {
|
||||||
ID = post.ID;
|
ID = post.ID;
|
||||||
|
if (Conf['Mark Quotes of You']) {
|
||||||
|
if (post.info.yours) {
|
||||||
|
QuoteYou.lastRead = post.nodes.root;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (Conf['Quote Threading']) {
|
if (Conf['Quote Threading']) {
|
||||||
posts.splice(i, 1);
|
posts.splice(i, 1);
|
||||||
continue;
|
continue;
|
||||||
@ -12911,6 +12950,12 @@
|
|||||||
ThreadHiding.toggle(thread);
|
ThreadHiding.toggle(thread);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Conf['Previous Post Quoting You']:
|
||||||
|
QuoteYou.cb.seek('preceding');
|
||||||
|
break;
|
||||||
|
case Conf['Next Post Quoting You']:
|
||||||
|
QuoteYou.cb.seek('following');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -14659,7 +14704,7 @@
|
|||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
var URL;
|
var URL;
|
||||||
|
|
||||||
if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') {
|
if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) {
|
||||||
Redirect.init();
|
Redirect.init();
|
||||||
pathname = location.pathname.split('/');
|
pathname = location.pathname.split('/');
|
||||||
URL = Redirect.to('file', {
|
URL = Redirect.to('file', {
|
||||||
|
|||||||
@ -993,6 +993,14 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);
|
|||||||
'x'
|
'x'
|
||||||
'Hide thread.'
|
'Hide thread.'
|
||||||
]
|
]
|
||||||
|
'Previous Post Quoting You': [
|
||||||
|
'Alt+Up'
|
||||||
|
'Scroll to the previous post that quotes you.'
|
||||||
|
]
|
||||||
|
'Next Post Quoting You': [
|
||||||
|
'Alt+Down'
|
||||||
|
'Scroll to the next post that quotes you.'
|
||||||
|
]
|
||||||
|
|
||||||
updater:
|
updater:
|
||||||
checkbox:
|
checkbox:
|
||||||
|
|||||||
@ -80,7 +80,7 @@ Main =
|
|||||||
return
|
return
|
||||||
when 'images.4chan.org'
|
when 'images.4chan.org'
|
||||||
$.ready ->
|
$.ready ->
|
||||||
if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found'
|
if Conf['404 Redirect'] and ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains d.title
|
||||||
Redirect.init()
|
Redirect.init()
|
||||||
pathname = location.pathname.split '/'
|
pathname = location.pathname.split '/'
|
||||||
URL = Redirect.to 'file',
|
URL = Redirect.to 'file',
|
||||||
|
|||||||
@ -583,8 +583,8 @@ a.hide-announcement {
|
|||||||
.qphl {
|
.qphl {
|
||||||
outline: 2px solid rgba(216, 94, 49, .7);
|
outline: 2px solid rgba(216, 94, 49, .7);
|
||||||
}
|
}
|
||||||
:root.highlight-own .yourPost>.reply,
|
:root.highlight-own .yourPost > .reply,
|
||||||
:root.highlight-you .quotesYou>.reply {
|
:root.highlight-you .quotesYou > .reply {
|
||||||
border-left: 2px solid rgba(221,0,0,.5);
|
border-left: 2px solid rgba(221,0,0,.5);
|
||||||
}
|
}
|
||||||
/* Quote Threading */
|
/* Quote Threading */
|
||||||
|
|||||||
@ -113,6 +113,10 @@ Keybinds =
|
|||||||
Keybinds.hl 0, threadRoot
|
Keybinds.hl 0, threadRoot
|
||||||
when Conf['Hide']
|
when Conf['Hide']
|
||||||
ThreadHiding.toggle thread if g.VIEW is 'index'
|
ThreadHiding.toggle thread if g.VIEW is 'index'
|
||||||
|
when Conf['Previous Post Quoting You']
|
||||||
|
QuoteYou.cb.seek 'preceding'
|
||||||
|
when Conf['Next Post Quoting You']
|
||||||
|
QuoteYou.cb.seek 'following'
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
do e.preventDefault
|
do e.preventDefault
|
||||||
|
|||||||
@ -126,6 +126,9 @@ Unread =
|
|||||||
{bottom} = post.nodes.root.getBoundingClientRect()
|
{bottom} = post.nodes.root.getBoundingClientRect()
|
||||||
if bottom < height # post is completely read
|
if bottom < height # post is completely read
|
||||||
{ID} = post
|
{ID} = post
|
||||||
|
if Conf['Mark Quotes of You']
|
||||||
|
if post.info.yours
|
||||||
|
QuoteYou.lastRead = post.nodes.root
|
||||||
if Conf['Quote Threading']
|
if Conf['Quote Threading']
|
||||||
posts.splice i, 1
|
posts.splice i, 1
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -14,6 +14,7 @@ QuoteYou =
|
|||||||
Post::callbacks.push
|
Post::callbacks.push
|
||||||
name: 'Mark Quotes of You'
|
name: 'Mark Quotes of You'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
# Stop there if it's a clone.
|
# Stop there if it's a clone.
|
||||||
return if @isClone
|
return if @isClone
|
||||||
@ -28,4 +29,28 @@ QuoteYou =
|
|||||||
if QR.db.get Get.postDataFromLink quotelink
|
if QR.db.get Get.postDataFromLink quotelink
|
||||||
$.add quotelink, $.tn '\u00A0(You)'
|
$.add quotelink, $.tn '\u00A0(You)'
|
||||||
$.addClass @nodes.root, 'quotesYou'
|
$.addClass @nodes.root, 'quotesYou'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
cb:
|
||||||
|
seek: (type) ->
|
||||||
|
unless QuoteYou.lastRead
|
||||||
|
unless post = QuoteYou.lastRead = $ '.quotesYou'
|
||||||
|
new Notification 'warning', 'No posts are currently quoting you, loser.', 20
|
||||||
|
return if QuoteYou.cb.scroll post
|
||||||
|
|
||||||
|
str = "#{type}::div[contains(@class,'quotesYou')]"
|
||||||
|
|
||||||
|
result = $.X(str, QuoteYou.lastRead)
|
||||||
|
while post = result.snapshotItem(if type is 'preceding' then result.snapshotLength - 1 else 0)
|
||||||
|
return if QuoteYou.cb.scroll post
|
||||||
|
|
||||||
|
posts = $$ '.quotesYou'
|
||||||
|
QuoteYou.cb.scroll posts[if type is 'following' then 0 else posts.length - 1]
|
||||||
|
|
||||||
|
scroll: (post) ->
|
||||||
|
QuoteYou.lastRead = post
|
||||||
|
if Get.postFromRoot(post).isHidden
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
Header.scrollToPost post
|
||||||
|
return true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user