Support setting reports endpoint through archive JSON data. #1260
This commit is contained in:
parent
c0f7bf14cc
commit
16e28677e3
@ -24,14 +24,14 @@ Redirect =
|
|||||||
for data in Conf['archives']
|
for data in Conf['archives']
|
||||||
for key in ['boards', 'files']
|
for key in ['boards', 'files']
|
||||||
data[key] = [] unless data[key] instanceof Array
|
data[key] = [] unless data[key] instanceof Array
|
||||||
{uid, name, boards, files, software} = data
|
{uid, name, boards, files, software, report} = data
|
||||||
continue unless software in ['fuuka', 'foolfuuka']
|
continue unless software in ['fuuka', 'foolfuuka']
|
||||||
archives[JSON.stringify(uid ? name)] = data
|
archives[JSON.stringify(uid ? name)] = data
|
||||||
for boardID in boards
|
for boardID in boards
|
||||||
o.thread[boardID] = data unless boardID of o.thread
|
o.thread[boardID] = data unless boardID of o.thread
|
||||||
o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka'
|
o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka'
|
||||||
o.file[boardID] = data unless boardID of o.file or boardID not in files
|
o.file[boardID] = data unless boardID of o.file or boardID not in files
|
||||||
o.report[boardID] = data if name is 'fgts'
|
o.report[boardID] = data unless boardID of o.report or not report
|
||||||
|
|
||||||
for boardID, record of Conf['selectedArchives']
|
for boardID, record of Conf['selectedArchives']
|
||||||
for type, id of record when (archive = archives[JSON.stringify id])
|
for type, id of record when (archive = archives[JSON.stringify id])
|
||||||
@ -155,7 +155,9 @@ Redirect =
|
|||||||
"#{Redirect.protocol archive}#{archive.domain}/#{path}"
|
"#{Redirect.protocol archive}#{archive.domain}/#{path}"
|
||||||
|
|
||||||
report: (archive, {boardID, postID}) ->
|
report: (archive, {boardID, postID}) ->
|
||||||
"https://so.fgts.jp/report/?board=#{boardID}&no=#{postID}"
|
{report} = archive
|
||||||
|
return '' unless /^https?:\/\//.test(report)
|
||||||
|
"#{report}?board=#{boardID}&no=#{postID}"
|
||||||
|
|
||||||
securityCheck: (url) ->
|
securityCheck: (url) ->
|
||||||
/^https:\/\//.test(url) or
|
/^https:\/\//.test(url) or
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Report =
|
|||||||
if location.hash is '#redirect'
|
if location.hash is '#redirect'
|
||||||
$.globalEval 'self.close = function(){};'
|
$.globalEval 'self.close = function(){};'
|
||||||
window.resizeTo 700, 475
|
window.resizeTo 700, 475
|
||||||
location.replace url
|
Redirect.navigate 'report', {boardID: g.BOARD.ID, postID: Report.postID}
|
||||||
return
|
return
|
||||||
|
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user