make hidden replies / threads local to board
This commit is contained in:
parent
6c0ed290bc
commit
e2ac09ddbb
@ -133,8 +133,8 @@ if not favicon: $('link[rel="shortcut icon"]', head)#/f/
|
|||||||
favNormal: favicon.href
|
favNormal: favicon.href
|
||||||
favEmpty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='
|
favEmpty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='
|
||||||
|
|
||||||
hiddenThreads: JSON.parse(GM_getValue('hiddenThreads', '[]'))
|
hiddenThreads: JSON.parse(GM_getValue("hiddenThreads/$BOARD/", '[]'))
|
||||||
hiddenReplies: JSON.parse(GM_getValue('hiddenReplies', '[]'))
|
hiddenReplies: JSON.parse(GM_getValue("hiddenReplies/$BOARD/", '[]'))
|
||||||
|
|
||||||
lastChecked: GM_getValue('lastChecked', 0)
|
lastChecked: GM_getValue('lastChecked', 0)
|
||||||
now: getTime()
|
now: getTime()
|
||||||
@ -151,8 +151,8 @@ if lastChecked < now - day
|
|||||||
break
|
break
|
||||||
hiddenReplies.shift()
|
hiddenReplies.shift()
|
||||||
|
|
||||||
GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads))
|
GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads))
|
||||||
GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies))
|
GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies))
|
||||||
GM_setValue('lastChecked', now)
|
GM_setValue('lastChecked', now)
|
||||||
|
|
||||||
GM_addStyle('
|
GM_addStyle('
|
||||||
@ -281,7 +281,7 @@ showThread: ->
|
|||||||
hide(this)
|
hide(this)
|
||||||
id: div.id
|
id: div.id
|
||||||
slice(hiddenThreads, id)
|
slice(hiddenThreads, id)
|
||||||
GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads))
|
GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads))
|
||||||
|
|
||||||
|
|
||||||
hideThread: (div) ->
|
hideThread: (div) ->
|
||||||
@ -291,7 +291,7 @@ hideThread: (div) ->
|
|||||||
id: div.id
|
id: div.id
|
||||||
timestamp: getTime()
|
timestamp: getTime()
|
||||||
})
|
})
|
||||||
GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads))
|
GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads))
|
||||||
hide(div)
|
hide(div)
|
||||||
if getValue('Show Stubs')
|
if getValue('Show Stubs')
|
||||||
a: tag('a')
|
a: tag('a')
|
||||||
@ -300,7 +300,6 @@ hideThread: (div) ->
|
|||||||
n: Number(span.textContent.match(/\d+/)[0])
|
n: Number(span.textContent.match(/\d+/)[0])
|
||||||
else
|
else
|
||||||
n: 0
|
n: 0
|
||||||
console.log(n)
|
|
||||||
n += $$('table', div).length
|
n += $$('table', div).length
|
||||||
text: if n is 1 then "1 reply" else "$n replies"
|
text: if n is 1 then "1 reply" else "$n replies"
|
||||||
name: $('span.postername', div).textContent
|
name: $('span.postername', div).textContent
|
||||||
@ -345,7 +344,7 @@ showReply: ->
|
|||||||
remove(div)
|
remove(div)
|
||||||
id: $('td.reply, td.replyhl', table).id
|
id: $('td.reply, td.replyhl', table).id
|
||||||
slice(hiddenReplies, id)
|
slice(hiddenReplies, id)
|
||||||
GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies))
|
GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies))
|
||||||
|
|
||||||
|
|
||||||
hideReply: (reply) ->
|
hideReply: (reply) ->
|
||||||
@ -355,7 +354,7 @@ hideReply: (reply) ->
|
|||||||
id: reply.id
|
id: reply.id
|
||||||
timestamp: getTime()
|
timestamp: getTime()
|
||||||
})
|
})
|
||||||
GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies))
|
GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies))
|
||||||
|
|
||||||
name: $('span.commentpostername', reply).textContent
|
name: $('span.commentpostername', reply).textContent
|
||||||
trip: $('span.postertrip', reply)?.textContent || ''
|
trip: $('span.postertrip', reply)?.textContent || ''
|
||||||
|
|||||||
@ -168,8 +168,8 @@
|
|||||||
}
|
}
|
||||||
favNormal = favicon.href;
|
favNormal = favicon.href;
|
||||||
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==';
|
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==';
|
||||||
hiddenThreads = JSON.parse(GM_getValue('hiddenThreads', '[]'));
|
hiddenThreads = JSON.parse(GM_getValue(("hiddenThreads/" + BOARD + "/"), '[]'));
|
||||||
hiddenReplies = JSON.parse(GM_getValue('hiddenReplies', '[]'));
|
hiddenReplies = JSON.parse(GM_getValue(("hiddenReplies/" + BOARD + "/"), '[]'));
|
||||||
lastChecked = GM_getValue('lastChecked', 0);
|
lastChecked = GM_getValue('lastChecked', 0);
|
||||||
now = getTime();
|
now = getTime();
|
||||||
day = 24 * 60 * 60;
|
day = 24 * 60 * 60;
|
||||||
@ -187,8 +187,8 @@
|
|||||||
}
|
}
|
||||||
hiddenReplies.shift();
|
hiddenReplies.shift();
|
||||||
}
|
}
|
||||||
GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads));
|
GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads));
|
||||||
GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies));
|
GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies));
|
||||||
GM_setValue('lastChecked', now);
|
GM_setValue('lastChecked', now);
|
||||||
}
|
}
|
||||||
GM_addStyle(' \
|
GM_addStyle(' \
|
||||||
@ -321,7 +321,7 @@ cursor: pointer; \
|
|||||||
hide(this);
|
hide(this);
|
||||||
id = div.id;
|
id = div.id;
|
||||||
slice(hiddenThreads, id);
|
slice(hiddenThreads, id);
|
||||||
return GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads));
|
return GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads));
|
||||||
};
|
};
|
||||||
hideThread = function hideThread(div) {
|
hideThread = function hideThread(div) {
|
||||||
var _c, a, n, name, p, span, text, trip;
|
var _c, a, n, name, p, span, text, trip;
|
||||||
@ -331,14 +331,13 @@ cursor: pointer; \
|
|||||||
id: div.id,
|
id: div.id,
|
||||||
timestamp: getTime()
|
timestamp: getTime()
|
||||||
});
|
});
|
||||||
GM_setValue('hiddenThreads', JSON.stringify(hiddenThreads));
|
GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads));
|
||||||
}
|
}
|
||||||
hide(div);
|
hide(div);
|
||||||
if (getValue('Show Stubs')) {
|
if (getValue('Show Stubs')) {
|
||||||
a = tag('a');
|
a = tag('a');
|
||||||
//n: parseInt($('span.omittedposts', div)?.textContent) || 0
|
//n: parseInt($('span.omittedposts', div)?.textContent) || 0
|
||||||
(span = $('.omittedposts', div)) ? (n = Number(span.textContent.match(/\d+/)[0])) : (n = 0);
|
(span = $('.omittedposts', div)) ? (n = Number(span.textContent.match(/\d+/)[0])) : (n = 0);
|
||||||
console.log(n);
|
|
||||||
n += $$('table', div).length;
|
n += $$('table', div).length;
|
||||||
text = n === 1 ? "1 reply" : ("" + n + " replies");
|
text = n === 1 ? "1 reply" : ("" + n + " replies");
|
||||||
name = $('span.postername', div).textContent;
|
name = $('span.postername', div).textContent;
|
||||||
@ -386,7 +385,7 @@ cursor: pointer; \
|
|||||||
remove(div);
|
remove(div);
|
||||||
id = $('td.reply, td.replyhl', table).id;
|
id = $('td.reply, td.replyhl', table).id;
|
||||||
slice(hiddenReplies, id);
|
slice(hiddenReplies, id);
|
||||||
return GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies));
|
return GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies));
|
||||||
};
|
};
|
||||||
hideReply = function hideReply(reply) {
|
hideReply = function hideReply(reply) {
|
||||||
var _c, a, div, name, p, table, trip;
|
var _c, a, div, name, p, table, trip;
|
||||||
@ -396,7 +395,7 @@ cursor: pointer; \
|
|||||||
id: reply.id,
|
id: reply.id,
|
||||||
timestamp: getTime()
|
timestamp: getTime()
|
||||||
});
|
});
|
||||||
GM_setValue('hiddenReplies', JSON.stringify(hiddenReplies));
|
GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies));
|
||||||
}
|
}
|
||||||
name = $('span.commentpostername', reply).textContent;
|
name = $('span.commentpostername', reply).textContent;
|
||||||
trip = ((_c = $('span.postertrip', reply)) == undefined ? undefined : _c.textContent) || '';
|
trip = ((_c = $('span.postertrip', reply)) == undefined ? undefined : _c.textContent) || '';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user