Conflicts: builds/4chan-X-beta.crx builds/4chan-X-beta.meta.js builds/4chan-X-beta.user.js builds/4chan-X-noupdate.crx builds/4chan-X-noupdate.user.js builds/4chan-X.crx builds/4chan-X.meta.js builds/4chan-X.user.js builds/4chan-X.zip builds/updates-beta.xml builds/updates.xml package.json src/Menu/ReportLink.coffee
25 lines
785 B
CoffeeScript
Executable File
25 lines
785 B
CoffeeScript
Executable File
ReportLink =
|
|
init: ->
|
|
return unless g.VIEW in ['index', 'thread'] and Conf['Menu'] and Conf['Report Link']
|
|
|
|
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) ->
|
|
ReportLink.url = unless post.isDead
|
|
"//sys.4chan.org/#{post.board}/imgboard.php?mode=report&no=#{post}"
|
|
else if Conf['Archive Report']
|
|
Redirect.to 'report', {boardID: post.board.ID, postID: post.ID}
|
|
!!ReportLink.url
|
|
|
|
report: ->
|
|
{url} = ReportLink
|
|
id = Date.now()
|
|
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=675"
|
|
window.open url, id, set
|