summaryrefslogtreecommitdiff
path: root/js/watch.js
diff options
context:
space:
mode:
authorSimon McFarlane <simon@piston.pw>2015-06-01 16:08:19 -0700
committerSimon McFarlane <simon@piston.pw>2015-06-01 16:08:19 -0700
commit209bc5400144e448e95a68e01d842c6fab53ae71 (patch)
treeab4cc6ad241e8daccb546514330d3a5f2906e846 /js/watch.js
parentd1c1e5a589f30d640f5eb6303e7059105a6297f8 (diff)
parent7ab9cc43d101ed002bce392beefe1c435ab2d5b1 (diff)
Merge pull request #18 from lainchan/vichan-merge
Merge with the latest upstream vichan
Diffstat (limited to 'js/watch.js')
-rw-r--r--js/watch.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/watch.js b/js/watch.js
index a202130f..07c6942a 100644
--- a/js/watch.js
+++ b/js/watch.js
@@ -98,6 +98,9 @@ $(function(){
else {
bc.threads = bc.threads || {};
bc.threads[thread] = Date.now();
+
+ bc.slugs = bc.slugs || {};
+ bc.slugs[thread] = document.location.pathname + document.location.search;
}
st[board] = bc;
storage_save(st);
@@ -121,7 +124,7 @@ $(function(){
var tag;
if (variant == 'desktop') {
- tag = $("<a href='"+modRoot+board+"/res/"+tid+".html'><span>#"+tid+"</span><span class='cb-uri watch-remove'>"+newposts+"</span>");
+ tag = $("<a href='"+((storage()[board].slugs && storage()[board].slugs[tid]) || (modRoot+board+"/res/"+tid+".html"))+"'><span>#"+tid+"</span><span class='cb-uri watch-remove'>"+newposts+"</span>");
tag.find(".watch-remove").mouseenter(function() {
this.oldval = $(this).html();
$(this).css("min-width", $(this).width());
@@ -132,7 +135,7 @@ $(function(){
})
}
else if (variant == 'mobile') {
- tag = $("<a href='"+modRoot+board+"/res/"+tid+".html'><span>#"+tid+"</span><span class='cb-uri'>"+newposts+"</span>"
+ tag = $("<a href='"+((storage()[board].slugs && storage()[board].slugs[tid]) || (modRoot+board+"/res/"+tid+".html"))+"'><span>#"+tid+"</span><span class='cb-uri'>"+newposts+"</span>"
+"<span class='cb-uri watch-remove'><i class='fa fa-minus'></i></span>");
}
@@ -245,7 +248,7 @@ $(function(){
var st = storage();
var sched = 0;
- var sched_diff = 300;
+ var sched_diff = 2000;
for (var i in st) {
if (st[i].watched) {