From 68cc8ad5175a19ae58468d8a0e799f54b6264208 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 28 Apr 2011 19:04:45 +0200 Subject: [PATCH 1/2] Fix Post in Title if there is no title or comment. --- 4chan_x.js | 5 +++-- script.coffee | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 109bc2de1..f6b7723ba 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1590,8 +1590,9 @@ titlePost = { init: function() { var tc; - tc = $('span.filetitle').textContent || $('blockquote').textContent; - return d.title = "/" + g.BOARD + "/ - " + tc; + if (tc = $('span.filetitle').textContent || $('blockquote').textContent) { + return d.title = "/" + g.BOARD + "/ - " + tc; + } } }; quickReport = { diff --git a/script.coffee b/script.coffee index 38dc97490..ca6a86b69 100644 --- a/script.coffee +++ b/script.coffee @@ -1245,8 +1245,8 @@ localize = titlePost = init: -> - tc = $('span.filetitle').textContent or $('blockquote').textContent - d.title = "/#{g.BOARD}/ - #{tc}" + if tc = $('span.filetitle').textContent or $('blockquote').textContent + d.title = "/#{g.BOARD}/ - #{tc}" quickReport = init: -> From d6ae45eb5d6763ec652ee115583d3ec3d5c79cd6 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 28 Apr 2011 20:29:09 +0200 Subject: [PATCH 2/2] Actually update the tab title on 404. --- 4chan_x.js | 5 ++--- script.coffee | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index f6b7723ba..353fb8225 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1326,7 +1326,7 @@ } }, update: function(e) { - var arr, body, br, count, id, input, replies, reply, s, timer, _i, _len, _ref, _ref2, _results; + var arr, body, br, count, id, input, replies, reply, timer, _i, _len, _ref, _ref2, _results; count = $('#count'); timer = $('#timer'); if (this.status === 404) { @@ -1340,8 +1340,7 @@ input.disabled = true; input.value = 404; } - s = d.title.match(/.+- /)[0]; - s += '404'; + d.title = d.title.match(/.+- /)[0] + 404; Favicon.update(); return; } diff --git a/script.coffee b/script.coffee index ca6a86b69..a6012e3ed 100644 --- a/script.coffee +++ b/script.coffee @@ -1054,8 +1054,7 @@ updater = for input in $$ 'input[type=submit]' input.disabled = true input.value = 404 - s = d.title.match(/.+- /)[0] - s += '404' + d.title = d.title.match(/.+- /)[0] + 404 Favicon.update() return