diff --git a/4chan_x.user.js b/4chan_x.user.js index 4156d45f3..73bee6fa0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1875,18 +1875,19 @@ return watcher.refresh(); }, watch: function(thread, id) { - var el, props, watched, _name; + var el, watched, _name; el = $('span.filetitle', thread); + props.href = "/" + g.BOARD + "/res/" + id; if (!el.textContent) { el = $('blockquote', thread); - if (!el.textContent) { - return; + 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 = { - textContent: "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25)), - href: "/" + g.BOARD + "/res/" + id - }; watched = $.get('watched', {}); watched[_name = g.BOARD] || (watched[_name] = {}); watched[g.BOARD][id] = props; diff --git a/script.coffee b/script.coffee index b1c99dd5b..2bcb43d8d 100644 --- a/script.coffee +++ b/script.coffee @@ -1539,13 +1539,15 @@ watcher = watch: (thread, id) -> el = $ 'span.filetitle', thread + props.href = "/#{g.BOARD}/res/#{id}" if not el.textContent el = $ 'blockquote', thread - if not el.textContent - return - props = - textContent: "/#{g.BOARD}/ - #{$.innerText(el)[...25]}" - href: "/#{g.BOARD}/res/#{id}" + if el.textContent + props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}" + else + props.textContent = d.title + else + props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}" watched = $.get 'watched', {} watched[g.BOARD] or= {}