23 lines
642 B
CoffeeScript
23 lines
642 B
CoffeeScript
ReportLink =
|
|
init: ->
|
|
return if !Conf['Menu'] or !Conf['Report Link']
|
|
|
|
a = $.el 'a',
|
|
className: 'report-link'
|
|
href: 'javascript:;'
|
|
textContent: 'Report this post'
|
|
$.on a, 'click', ReportLink.report
|
|
$.event 'AddMenuEntry',
|
|
type: 'post'
|
|
el: a
|
|
order: 10
|
|
open: (post) ->
|
|
ReportLink.post = post
|
|
!post.isDead
|
|
report: ->
|
|
{post} = ReportLink
|
|
url = "//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}"
|
|
id = Date.now()
|
|
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"
|
|
window.open url, id, set
|