commit
d90d3f1be8
37
4chan_x.js
37
4chan_x.js
@ -59,7 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, Favicon, NAMESPACE, Recaptcha, anonymize, config, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, localize, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, sauce, threadHiding, threading, titlePost, ui, unread, updater, watcher, _config, _ref;
|
var $, $$, Favicon, NAMESPACE, Recaptcha, anonymize, config, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, localize, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref;
|
||||||
var __slice = Array.prototype.slice;
|
var __slice = Array.prototype.slice;
|
||||||
if (typeof console !== "undefined" && console !== null) {
|
if (typeof console !== "undefined" && console !== null) {
|
||||||
log = function(arg) {
|
log = function(arg) {
|
||||||
@ -72,6 +72,7 @@
|
|||||||
'Thread Updater': [true, 'Update threads'],
|
'Thread Updater': [true, 'Update threads'],
|
||||||
'Unread Count': [true, 'Show unread post count in tab title'],
|
'Unread Count': [true, 'Show unread post count in tab title'],
|
||||||
'Post in Title': [true, 'Show the op\'s post in the tab title'],
|
'Post in Title': [true, 'Show the op\'s post in the tab title'],
|
||||||
|
'Thread Stats': [true, 'Display reply and image count'],
|
||||||
'Thread Watcher': [true, 'Bookmark threads'],
|
'Thread Watcher': [true, 'Bookmark threads'],
|
||||||
'Auto Watch': [true, 'Automatically watch threads that you start'],
|
'Auto Watch': [true, 'Automatically watch threads that you start'],
|
||||||
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
||||||
@ -1967,6 +1968,33 @@
|
|||||||
return input.click();
|
return input.click();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
threadStats = {
|
||||||
|
init: function() {
|
||||||
|
var html;
|
||||||
|
html = "<div class=move>Replies: <span id=rcount>0</span> Images: <span id=icount>1</span></div>";
|
||||||
|
$.append(d.body, ui.dialog('stats', {
|
||||||
|
bottom: '0px',
|
||||||
|
left: '0px'
|
||||||
|
}, html));
|
||||||
|
threadStats.replies = 0;
|
||||||
|
threadStats.images = $('.op img[md5]') ? 1 : 0;
|
||||||
|
return g.callbacks.push(threadStats.node);
|
||||||
|
},
|
||||||
|
node: function(root) {
|
||||||
|
if (root.className) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
threadStats.replies++;
|
||||||
|
if ($('img[md5]', root)) {
|
||||||
|
threadStats.images++;
|
||||||
|
if (threadStats.images > 151) {
|
||||||
|
$('#icount').className = 'error';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#rcount').textContent = threadStats.replies;
|
||||||
|
return $('#icount').textContent = threadStats.images;
|
||||||
|
}
|
||||||
|
};
|
||||||
unread = {
|
unread = {
|
||||||
init: function() {
|
init: function() {
|
||||||
unread.replies = [];
|
unread.replies = [];
|
||||||
@ -2425,6 +2453,9 @@
|
|||||||
if ($.config('Post in Title')) {
|
if ($.config('Post in Title')) {
|
||||||
titlePost.init();
|
titlePost.init();
|
||||||
}
|
}
|
||||||
|
if ($.config('Thread Stats')) {
|
||||||
|
threadStats.init();
|
||||||
|
}
|
||||||
if ($.config('Unread Count')) {
|
if ($.config('Unread Count')) {
|
||||||
unread.init();
|
unread.init();
|
||||||
}
|
}
|
||||||
@ -2598,6 +2629,10 @@
|
|||||||
#updater:not(:hover) > div:not(.move) {\
|
#updater:not(:hover) > div:not(.move) {\
|
||||||
display: none;\
|
display: none;\
|
||||||
}\
|
}\
|
||||||
|
\
|
||||||
|
#stats {\
|
||||||
|
position: fixed;\
|
||||||
|
}\
|
||||||
\
|
\
|
||||||
#watcher {\
|
#watcher {\
|
||||||
position: absolute;\
|
position: absolute;\
|
||||||
|
|||||||
@ -15,6 +15,7 @@ config =
|
|||||||
'Thread Updater': [true, 'Update threads']
|
'Thread Updater': [true, 'Update threads']
|
||||||
'Unread Count': [true, 'Show unread post count in tab title']
|
'Unread Count': [true, 'Show unread post count in tab title']
|
||||||
'Post in Title': [true, 'Show the op\'s post in the tab title']
|
'Post in Title': [true, 'Show the op\'s post in the tab title']
|
||||||
|
'Thread Stats': [true, 'Display reply and image count']
|
||||||
'Thread Watcher': [true, 'Bookmark threads']
|
'Thread Watcher': [true, 'Bookmark threads']
|
||||||
'Auto Watch': [true, 'Automatically watch threads that you start']
|
'Auto Watch': [true, 'Automatically watch threads that you start']
|
||||||
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
||||||
@ -1544,6 +1545,23 @@ reportButton =
|
|||||||
$('input[value="Report"]').click()
|
$('input[value="Report"]').click()
|
||||||
input.click()
|
input.click()
|
||||||
|
|
||||||
|
threadStats =
|
||||||
|
init: ->
|
||||||
|
html = "<div class=move>Replies: <span id=rcount>0</span> Images: <span id=icount>1</span></div>"
|
||||||
|
$.append d.body, (ui.dialog 'stats', bottom: '0px', left: '0px', html)
|
||||||
|
threadStats.replies = 0
|
||||||
|
threadStats.images = if $ '.op img[md5]' then 1 else 0
|
||||||
|
g.callbacks.push threadStats.node
|
||||||
|
node: (root) ->
|
||||||
|
return if root.className
|
||||||
|
threadStats.replies++
|
||||||
|
if $ 'img[md5]', root
|
||||||
|
threadStats.images++
|
||||||
|
if threadStats.images > 151
|
||||||
|
$('#icount').className = 'error'
|
||||||
|
$('#rcount').textContent = threadStats.replies
|
||||||
|
$('#icount').textContent = threadStats.images
|
||||||
|
|
||||||
unread =
|
unread =
|
||||||
init: ->
|
init: ->
|
||||||
unread.replies = []
|
unread.replies = []
|
||||||
@ -1881,6 +1899,9 @@ main =
|
|||||||
if $.config 'Post in Title'
|
if $.config 'Post in Title'
|
||||||
titlePost.init()
|
titlePost.init()
|
||||||
|
|
||||||
|
if $.config 'Thread Stats'
|
||||||
|
threadStats.init()
|
||||||
|
|
||||||
if $.config 'Unread Count'
|
if $.config 'Unread Count'
|
||||||
unread.init()
|
unread.init()
|
||||||
|
|
||||||
@ -2043,6 +2064,10 @@ main =
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#stats {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
#watcher {
|
#watcher {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user