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