From e517b6426ff28104bc01b5ee4b499391f7d01ed2 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 10 May 2015 23:18:58 -0700 Subject: [PATCH] Label reports to archive as to archive, don't redirect rule vio reports. #404 --- src/Menu/ReportLink.coffee | 4 +++- src/Miscellaneous/Report.coffee | 14 ++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Menu/ReportLink.coffee b/src/Menu/ReportLink.coffee index b1c6f5ce7..d9a2a0930 100755 --- a/src/Menu/ReportLink.coffee +++ b/src/Menu/ReportLink.coffee @@ -5,16 +5,18 @@ ReportLink = a = $.el 'a', className: 'report-link' href: 'javascript:;' - textContent: 'Report this post' $.on a, 'click', ReportLink.report + Menu.menu.addEntry el: a order: 10 open: (post) -> unless post.isDead or (post.thread.isDead and not post.thread.isArchived) + a.textContent = 'Report this post' ReportLink.url = "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}" ReportLink.height = 200 else if Conf['Archive Report'] + a.textContent = 'Report to archive' ReportLink.url = Redirect.to 'report', {boardID: post.board.ID, postID: post.ID} ReportLink.height = 350 else diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index 654847352..2ebd665d1 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -31,14 +31,20 @@ Report = return unless url = Redirect.to 'report', {boardID: g.BOARD.ID, postID: Report.postID} if (message = $ 'h3') and /Report submitted!/.test(message.textContent) - $.globalEval 'self.close = function(){};' - window.resizeBy 0, 350 - doc.clientHeight - location.replace url + if location.hash is '#redirect' + $.globalEval 'self.close = function(){};' + window.resizeBy 0, 350 - doc.clientHeight + location.replace url return + link = $.el 'a', href: url - textContent: 'Report to fgts' + textContent: 'Report to archive' $.on link, 'click', (e) -> unless e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0 window.resizeBy 0, 350 - doc.clientHeight $.add d.body, [$.tn(' ['), link, $.tn(']')] + + if types = $.id('reportTypes') + $.on types, 'change', (e) -> + $('form').action = if e.target.value in ['illegal', 'spam'] then '#redirect' else ''