From 7ec2ebdcc857a705d884710606f40d83def82f53 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 26 Apr 2015 23:03:39 -0700 Subject: [PATCH] Fix size of window for reporting to archive. Also fix report menu item for 404'd thread. --- src/Menu/ReportLink.coffee | 14 +++++++++----- src/Miscellaneous/Report.coffee | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Menu/ReportLink.coffee b/src/Menu/ReportLink.coffee index 23621a317..b1c6f5ce7 100755 --- a/src/Menu/ReportLink.coffee +++ b/src/Menu/ReportLink.coffee @@ -11,14 +11,18 @@ ReportLink = el: a order: 10 open: (post) -> - ReportLink.url = unless post.isDead - "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}" + unless post.isDead or (post.thread.isDead and not post.thread.isArchived) + ReportLink.url = "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}" + ReportLink.height = 200 else if Conf['Archive Report'] - Redirect.to 'report', {boardID: post.board.ID, postID: post.ID} + ReportLink.url = Redirect.to 'report', {boardID: post.board.ID, postID: post.ID} + ReportLink.height = 350 + else + ReportLink.url = '' !!ReportLink.url report: -> - {url} = ReportLink + {url, height} = ReportLink id = Date.now() - set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=685,height=200" + set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=700,height=#{height}" window.open url, id, set diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index 7c76af437..b4d8b0793 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -22,7 +22,7 @@ Report = if (message = $ 'h3') and /Report submitted!/.test(message.textContent) $.globalEval 'self.close = function(){};' - window.resizeTo 685, 320 + window.resizeBy 0, 350 - doc.clientHeight location.replace url return link = $.el 'a', @@ -30,5 +30,5 @@ Report = textContent: 'Report to fgts' $.on link, 'click', (e) -> unless e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0 - window.resizeTo 685, 320 + window.resizeBy 0, 350 - doc.clientHeight $.add d.body, [$.tn(' ['), link, $.tn(']')]