1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 17:31:00 +01:00

Merge pull request #196 from Pashe/thread-watcher

Thread watcher
This commit is contained in:
Fredrick Brennan 2014-11-02 06:44:51 +08:00
commit 4332956f3e
2 changed files with 17 additions and 11 deletions

View File

@ -28,10 +28,10 @@ watchlist.render = function(reset) {
JSON.parse(localStorage.watchlist).forEach(function(e, i) {
//look at line 69, that's what (e) is here.
threads.push('<div class="watchlist-inner" id="watchlist-'+i+'">' +
'<span>Board: '+e[0]+'</span>&nbsp' +
'<span>Thread: '+'<a href="'+e[3]+'">'+e[1]+'</a></span>&nbsp' +
'<span>Replies: '+e[2]+'</span>&nbsp' +
'<a class="watchlist-remove">[Unwatch]</a>'+
'<span>/'+e[0]+'/ - ' +
'<a href="'+e[3]+'">'+e[1].replace("thread_", "Thread #")+'</a>' +
' ('+e[2]+') </span>' +
'<a class="watchlist-remove">X</a>'+
'</div>');
});
if ($('#watchlist').length) {
@ -40,6 +40,7 @@ watchlist.render = function(reset) {
$('#watchlist').append(threads.join(''));
} else {
//If the watchlist has not yet been rendered, create it.
var menuStyle = getComputedStyle($('.boardlist')[0]);
$('form[name="post"]').before(
$('<div id="watchlist">'+
'<div class="watchlist-controls">'+
@ -47,10 +48,7 @@ watchlist.render = function(reset) {
'<span><a id="clearGhosts">[Clear Ghosts]</a></span>'+
'</div>'+
threads.join('')+
'</div>').css({
background: $('.reply').css('background'),
borderColor : $('.reply').css('border-color')
}));
'</div>').css("background-color", menuStyle.backgroundColor).css("border", menuStyle.borderBottomWidth+" "+menuStyle.borderBottomStyle+" "+menuStyle.borderBottomColor));
}
return this;
};

View File

@ -974,10 +974,18 @@ span.pln {
margin-bottom: 10px;
}
#watchlist {
font-size: 8pt;
width: 15%;
position: fixed;
right: 0pt;
bottom: 0pt;
margin: 0pt;
padding: 0pt;
}
.watchlist-inner, .watchlist-controls {
margin: 0 auto;
margin-top: 10px;
margin-bottom: 10px;
margin: 0pt;
text-align: center;
}