commit
8877e4510f
@ -12158,7 +12158,7 @@
|
|||||||
return g.posts.forEach(ImageLoader.prefetch);
|
return g.posts.forEach(ImageLoader.prefetch);
|
||||||
});
|
});
|
||||||
if (Conf['Replace WEBM']) {
|
if (Conf['Replace WEBM']) {
|
||||||
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.quotePreviews);
|
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
|
||||||
}
|
}
|
||||||
if (!Conf['Image Prefetching']) {
|
if (!Conf['Image Prefetching']) {
|
||||||
return;
|
return;
|
||||||
@ -12265,7 +12265,7 @@
|
|||||||
g.BOARD.posts.forEach(ImageLoader.prefetch);
|
g.BOARD.posts.forEach(ImageLoader.prefetch);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
quotePreviews: function() {
|
playVideos: function() {
|
||||||
var qpClone, _ref;
|
var qpClone, _ref;
|
||||||
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
||||||
return g.posts.forEach(function(post) {
|
return g.posts.forEach(function(post) {
|
||||||
@ -13651,7 +13651,7 @@
|
|||||||
},
|
},
|
||||||
markNew: function(post, ipCount) {
|
markNew: function(post, ipCount) {
|
||||||
var counter, suffix;
|
var counter, suffix;
|
||||||
suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
|
suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
|
||||||
counter = $.el('span', {
|
counter = $.el('span', {
|
||||||
className: 'ip-counter',
|
className: 'ip-counter',
|
||||||
textContent: "(" + ipCount + ")"
|
textContent: "(" + ipCount + ")"
|
||||||
@ -14460,7 +14460,8 @@
|
|||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
},
|
},
|
||||||
toggle: function() {
|
toggle: function() {
|
||||||
ThreadWatcher.toggle(Get.threadFromNode(this));
|
var thread;
|
||||||
|
thread = Get.postFromNode(this).thread;
|
||||||
Index.followedThreadID = thread.ID;
|
Index.followedThreadID = thread.ID;
|
||||||
ThreadWatcher.toggle(thread);
|
ThreadWatcher.toggle(thread);
|
||||||
return delete Index.followedThreadID;
|
return delete Index.followedThreadID;
|
||||||
@ -14689,7 +14690,6 @@
|
|||||||
$.on(x, 'click', ThreadWatcher.cb.rm);
|
$.on(x, 'click', ThreadWatcher.cb.rm);
|
||||||
link = $.el('a', {
|
link = $.el('a', {
|
||||||
href: "/" + boardID + "/thread/" + threadID,
|
href: "/" + boardID + "/thread/" + threadID,
|
||||||
textContent: data.excerpt,
|
|
||||||
title: data.excerpt,
|
title: data.excerpt,
|
||||||
className: 'watcher-link'
|
className: 'watcher-link'
|
||||||
});
|
});
|
||||||
@ -14701,7 +14701,7 @@
|
|||||||
$.prepend(link, count);
|
$.prepend(link, count);
|
||||||
}
|
}
|
||||||
title = $.el('span', {
|
title = $.el('span', {
|
||||||
textContent: link.textContent,
|
textContent: data.excerpt,
|
||||||
className: 'watcher-title'
|
className: 'watcher-title'
|
||||||
});
|
});
|
||||||
$.add(link, title);
|
$.add(link, title);
|
||||||
@ -14980,9 +14980,11 @@
|
|||||||
var entry, input;
|
var entry, input;
|
||||||
entry = {
|
entry = {
|
||||||
type: 'thread watcher',
|
type: 'thread watcher',
|
||||||
el: UI.checkbox(name, " " + (name.replace(' Thread Watcher', '')))
|
el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
|
||||||
};
|
};
|
||||||
|
entry.el.title = desc;
|
||||||
input = entry.el.firstElementChild;
|
input = entry.el.firstElementChild;
|
||||||
|
$.on(input, 'change', $.cb.checked);
|
||||||
if (name === 'Current Board' || name === 'Show Unread Count') {
|
if (name === 'Current Board' || name === 'Show Unread Count') {
|
||||||
$.on(input, 'change', ThreadWatcher.refresh);
|
$.on(input, 'change', ThreadWatcher.refresh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12181,7 +12181,7 @@
|
|||||||
return g.posts.forEach(ImageLoader.prefetch);
|
return g.posts.forEach(ImageLoader.prefetch);
|
||||||
});
|
});
|
||||||
if (Conf['Replace WEBM']) {
|
if (Conf['Replace WEBM']) {
|
||||||
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.quotePreviews);
|
$.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos);
|
||||||
}
|
}
|
||||||
if (!Conf['Image Prefetching']) {
|
if (!Conf['Image Prefetching']) {
|
||||||
return;
|
return;
|
||||||
@ -12288,7 +12288,7 @@
|
|||||||
g.BOARD.posts.forEach(ImageLoader.prefetch);
|
g.BOARD.posts.forEach(ImageLoader.prefetch);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
quotePreviews: function() {
|
playVideos: function() {
|
||||||
var qpClone, _ref;
|
var qpClone, _ref;
|
||||||
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0;
|
||||||
return g.posts.forEach(function(post) {
|
return g.posts.forEach(function(post) {
|
||||||
@ -13674,7 +13674,7 @@
|
|||||||
},
|
},
|
||||||
markNew: function(post, ipCount) {
|
markNew: function(post, ipCount) {
|
||||||
var counter, suffix;
|
var counter, suffix;
|
||||||
suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
|
suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
|
||||||
counter = $.el('span', {
|
counter = $.el('span', {
|
||||||
className: 'ip-counter',
|
className: 'ip-counter',
|
||||||
textContent: "(" + ipCount + ")"
|
textContent: "(" + ipCount + ")"
|
||||||
@ -14483,7 +14483,8 @@
|
|||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
},
|
},
|
||||||
toggle: function() {
|
toggle: function() {
|
||||||
ThreadWatcher.toggle(Get.threadFromNode(this));
|
var thread;
|
||||||
|
thread = Get.postFromNode(this).thread;
|
||||||
Index.followedThreadID = thread.ID;
|
Index.followedThreadID = thread.ID;
|
||||||
ThreadWatcher.toggle(thread);
|
ThreadWatcher.toggle(thread);
|
||||||
return delete Index.followedThreadID;
|
return delete Index.followedThreadID;
|
||||||
@ -14712,7 +14713,6 @@
|
|||||||
$.on(x, 'click', ThreadWatcher.cb.rm);
|
$.on(x, 'click', ThreadWatcher.cb.rm);
|
||||||
link = $.el('a', {
|
link = $.el('a', {
|
||||||
href: "/" + boardID + "/thread/" + threadID,
|
href: "/" + boardID + "/thread/" + threadID,
|
||||||
textContent: data.excerpt,
|
|
||||||
title: data.excerpt,
|
title: data.excerpt,
|
||||||
className: 'watcher-link'
|
className: 'watcher-link'
|
||||||
});
|
});
|
||||||
@ -14724,7 +14724,7 @@
|
|||||||
$.prepend(link, count);
|
$.prepend(link, count);
|
||||||
}
|
}
|
||||||
title = $.el('span', {
|
title = $.el('span', {
|
||||||
textContent: link.textContent,
|
textContent: data.excerpt,
|
||||||
className: 'watcher-title'
|
className: 'watcher-title'
|
||||||
});
|
});
|
||||||
$.add(link, title);
|
$.add(link, title);
|
||||||
@ -15003,9 +15003,11 @@
|
|||||||
var entry, input;
|
var entry, input;
|
||||||
entry = {
|
entry = {
|
||||||
type: 'thread watcher',
|
type: 'thread watcher',
|
||||||
el: UI.checkbox(name, " " + (name.replace(' Thread Watcher', '')))
|
el: UI.checkbox(name, name.replace(' Thread Watcher', ''))
|
||||||
};
|
};
|
||||||
|
entry.el.title = desc;
|
||||||
input = entry.el.firstElementChild;
|
input = entry.el.firstElementChild;
|
||||||
|
$.on(input, 'change', $.cb.checked);
|
||||||
if (name === 'Current Board' || name === 'Show Unread Count') {
|
if (name === 'Current Board' || name === 'Show Unread Count') {
|
||||||
$.on(input, 'change', ThreadWatcher.refresh);
|
$.on(input, 'change', ThreadWatcher.refresh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ ImageLoader =
|
|||||||
g.posts.forEach ImageLoader.prefetch
|
g.posts.forEach ImageLoader.prefetch
|
||||||
|
|
||||||
if Conf['Replace WEBM']
|
if Conf['Replace WEBM']
|
||||||
$.on d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', @quotePreviews
|
$.on d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', @playVideos
|
||||||
|
|
||||||
return unless Conf['Image Prefetching']
|
return unless Conf['Image Prefetching']
|
||||||
|
|
||||||
@ -85,11 +85,11 @@ ImageLoader =
|
|||||||
g.BOARD.posts.forEach ImageLoader.prefetch
|
g.BOARD.posts.forEach ImageLoader.prefetch
|
||||||
return
|
return
|
||||||
|
|
||||||
quotePreviews: ->
|
playVideos: ->
|
||||||
# Special case: Quote previews are off screen when inserted into document, but quickly moved on screen.
|
# Special case: Quote previews are off screen when inserted into document, but quickly moved on screen.
|
||||||
qpClone = $.id('qp')?.firstElementChild
|
qpClone = $.id('qp')?.firstElementChild
|
||||||
g.posts.forEach (post) ->
|
g.posts.forEach (post) ->
|
||||||
for post in [post, post.clones...] when post.file?.videoThumb
|
for post in [post, post.clones...] when post.file?.videoThumb
|
||||||
{thumb} = post.file
|
{thumb} = post.file
|
||||||
if Header.isNodeVisible(thumb) or post.nodes.root is qpClone then thumb.play() else thumb.pause()
|
if Header.isNodeVisible(thumb) or post.nodes.root is qpClone then thumb.play() else thumb.pause()
|
||||||
return
|
return
|
||||||
|
|||||||
@ -32,7 +32,10 @@ MarkNewIPs =
|
|||||||
MarkNewIPs.postIDs = postIDs
|
MarkNewIPs.postIDs = postIDs
|
||||||
|
|
||||||
markNew: (post, ipCount) ->
|
markNew: (post, ipCount) ->
|
||||||
suffix = ['st', 'nd', 'rd'][ipCount % 10] or 'th' # fuck switches
|
suffix = if (ipCount // 10) % 10 is 1
|
||||||
|
'th'
|
||||||
|
else
|
||||||
|
['st', 'nd', 'rd'][ipCount % 10 - 1] or 'th' # fuck switches
|
||||||
counter = $.el 'span',
|
counter = $.el 'span',
|
||||||
className: 'ip-counter'
|
className: 'ip-counter'
|
||||||
textContent: "(#{ipCount})"
|
textContent: "(#{ipCount})"
|
||||||
|
|||||||
@ -108,7 +108,7 @@ ThreadWatcher =
|
|||||||
ThreadWatcher.refresh()
|
ThreadWatcher.refresh()
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
toggle: ->
|
toggle: ->
|
||||||
ThreadWatcher.toggle Get.threadFromNode @
|
{thread} = Get.postFromNode @
|
||||||
Index.followedThreadID = thread.ID
|
Index.followedThreadID = thread.ID
|
||||||
ThreadWatcher.toggle thread
|
ThreadWatcher.toggle thread
|
||||||
delete Index.followedThreadID
|
delete Index.followedThreadID
|
||||||
@ -253,7 +253,6 @@ ThreadWatcher =
|
|||||||
|
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
href: "/#{boardID}/thread/#{threadID}"
|
href: "/#{boardID}/thread/#{threadID}"
|
||||||
textContent: data.excerpt
|
|
||||||
title: data.excerpt
|
title: data.excerpt
|
||||||
className: 'watcher-link'
|
className: 'watcher-link'
|
||||||
|
|
||||||
@ -264,7 +263,7 @@ ThreadWatcher =
|
|||||||
$.prepend link, count
|
$.prepend link, count
|
||||||
|
|
||||||
title = $.el 'span',
|
title = $.el 'span',
|
||||||
textContent: link.textContent
|
textContent: data.excerpt
|
||||||
className: 'watcher-title'
|
className: 'watcher-title'
|
||||||
$.add link, title
|
$.add link, title
|
||||||
|
|
||||||
@ -431,8 +430,10 @@ ThreadWatcher =
|
|||||||
createSubEntry: (name, desc) ->
|
createSubEntry: (name, desc) ->
|
||||||
entry =
|
entry =
|
||||||
type: 'thread watcher'
|
type: 'thread watcher'
|
||||||
el: UI.checkbox name, " #{name.replace ' Thread Watcher', ''}"
|
el: UI.checkbox name, name.replace(' Thread Watcher', '')
|
||||||
|
entry.el.title = desc
|
||||||
input = entry.el.firstElementChild
|
input = entry.el.firstElementChild
|
||||||
|
$.on input, 'change', $.cb.checked
|
||||||
$.on input, 'change', ThreadWatcher.refresh if name in ['Current Board', 'Show Unread Count']
|
$.on input, 'change', ThreadWatcher.refresh if name in ['Current Board', 'Show Unread Count']
|
||||||
$.on input, 'change', ThreadWatcher.fetchAuto if name in ['Show Unread Count', 'Auto Update Thread Watcher']
|
$.on input, 'change', ThreadWatcher.fetchAuto if name in ['Show Unread Count', 'Auto Update Thread Watcher']
|
||||||
entry
|
entry
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user