Label reports to archive as to archive, don't redirect rule vio reports. #404
This commit is contained in:
parent
b7d9a617ca
commit
e517b6426f
@ -5,16 +5,18 @@ ReportLink =
|
|||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
className: 'report-link'
|
className: 'report-link'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
textContent: 'Report this post'
|
|
||||||
$.on a, 'click', ReportLink.report
|
$.on a, 'click', ReportLink.report
|
||||||
|
|
||||||
Menu.menu.addEntry
|
Menu.menu.addEntry
|
||||||
el: a
|
el: a
|
||||||
order: 10
|
order: 10
|
||||||
open: (post) ->
|
open: (post) ->
|
||||||
unless post.isDead or (post.thread.isDead and not post.thread.isArchived)
|
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.url = "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}"
|
||||||
ReportLink.height = 200
|
ReportLink.height = 200
|
||||||
else if Conf['Archive Report']
|
else if Conf['Archive Report']
|
||||||
|
a.textContent = 'Report to archive'
|
||||||
ReportLink.url = 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
|
ReportLink.height = 350
|
||||||
else
|
else
|
||||||
|
|||||||
@ -31,14 +31,20 @@ Report =
|
|||||||
return unless url = Redirect.to 'report', {boardID: g.BOARD.ID, postID: Report.postID}
|
return unless url = Redirect.to 'report', {boardID: g.BOARD.ID, postID: Report.postID}
|
||||||
|
|
||||||
if (message = $ 'h3') and /Report submitted!/.test(message.textContent)
|
if (message = $ 'h3') and /Report submitted!/.test(message.textContent)
|
||||||
$.globalEval 'self.close = function(){};'
|
if location.hash is '#redirect'
|
||||||
window.resizeBy 0, 350 - doc.clientHeight
|
$.globalEval 'self.close = function(){};'
|
||||||
location.replace url
|
window.resizeBy 0, 350 - doc.clientHeight
|
||||||
|
location.replace url
|
||||||
return
|
return
|
||||||
|
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
href: url
|
href: url
|
||||||
textContent: 'Report to fgts'
|
textContent: 'Report to archive'
|
||||||
$.on link, 'click', (e) ->
|
$.on link, 'click', (e) ->
|
||||||
unless e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
unless e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||||
window.resizeBy 0, 350 - doc.clientHeight
|
window.resizeBy 0, 350 - doc.clientHeight
|
||||||
$.add d.body, [$.tn(' ['), link, $.tn(']')]
|
$.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 ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user