refactor
This commit is contained in:
parent
16b3a8cbd9
commit
a784a608ec
@ -1881,19 +1881,13 @@
|
||||
watch: function(thread, id) {
|
||||
var el, props, watched, _name;
|
||||
el = $('span.filetitle', thread);
|
||||
props = {
|
||||
href: "/" + g.BOARD + "/res/" + id
|
||||
};
|
||||
if (!el.textContent) {
|
||||
el = $('blockquote', thread);
|
||||
if (el.textContent) {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
} else {
|
||||
props.textContent = d.title;
|
||||
}
|
||||
} else {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
}
|
||||
props = {
|
||||
href: "/" + g.BOARD + "/res/" + id,
|
||||
textContent: el.textContent ? "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25)) : d.title
|
||||
};
|
||||
watched = $.get('watched', {});
|
||||
watched[_name = g.BOARD] || (watched[_name] = {});
|
||||
watched[g.BOARD][id] = props;
|
||||
|
||||
@ -1541,16 +1541,11 @@ watcher =
|
||||
|
||||
watch: (thread, id) ->
|
||||
el = $ 'span.filetitle', thread
|
||||
props =
|
||||
href: "/#{g.BOARD}/res/#{id}"
|
||||
if not el.textContent
|
||||
el = $ 'blockquote', thread
|
||||
if el.textContent
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
else
|
||||
props.textContent = d.title
|
||||
else
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
props =
|
||||
href: "/#{g.BOARD}/res/#{id}"
|
||||
textContent: if el.textContent then "/#{g.BOARD}/ - #{$.innerText(el)[...25]}" else d.title
|
||||
|
||||
watched = $.get 'watched', {}
|
||||
watched[g.BOARD] or= {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user