don't remove encryption without asking
This commit is contained in:
parent
96ee479dd9
commit
49122baa4a
@ -53,7 +53,9 @@ Redirect =
|
|||||||
post: (archive, {boardID, postID}) ->
|
post: (archive, {boardID, postID}) ->
|
||||||
# For fuuka-based archives:
|
# For fuuka-based archives:
|
||||||
# https://github.com/eksopl/fuuka/issues/27
|
# https://github.com/eksopl/fuuka/issues/27
|
||||||
URL = new String "#{Redirect.protocol archive}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}"
|
protocol = Redirect.protocol archive
|
||||||
|
return '' unless protocol is 'https://' or location.protocol is 'http:'
|
||||||
|
URL = new String "#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}"
|
||||||
URL.archive = archive
|
URL.archive = archive
|
||||||
URL
|
URL
|
||||||
|
|
||||||
@ -73,3 +75,13 @@ Redirect =
|
|||||||
else
|
else
|
||||||
"#{boardID}/?task=search2&search_#{if type is 'image' then 'media_hash' else type}=#{value}"
|
"#{boardID}/?task=search2&search_#{if type is 'image' then 'media_hash' else type}=#{value}"
|
||||||
"#{Redirect.protocol archive}#{archive.domain}/#{path}"
|
"#{Redirect.protocol archive}#{archive.domain}/#{path}"
|
||||||
|
|
||||||
|
navigate: (URL, alternative) ->
|
||||||
|
if (
|
||||||
|
/^https:\/\//.test(URL) or
|
||||||
|
location.protocol is 'http:' or
|
||||||
|
confirm "Redirect to #{URL}?\n\nYour connection will not be encrypted."
|
||||||
|
)
|
||||||
|
location.replace URL
|
||||||
|
else if alternative
|
||||||
|
location.replace alternative
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Main =
|
|||||||
URL = Redirect.to 'file',
|
URL = Redirect.to 'file',
|
||||||
boardID: g.BOARD.ID
|
boardID: g.BOARD.ID
|
||||||
filename: pathname[pathname.length - 1]
|
filename: pathname[pathname.length - 1]
|
||||||
location.replace URL if URL
|
Redirect.navigate URL
|
||||||
else if Conf['Loop in New Tab'] and video = $ 'video'
|
else if Conf['Loop in New Tab'] and video = $ 'video'
|
||||||
Video.configure video
|
Video.configure video
|
||||||
$.on video, 'click', ->
|
$.on video, 'click', ->
|
||||||
@ -121,7 +121,7 @@ Main =
|
|||||||
boardID: g.BOARD.ID
|
boardID: g.BOARD.ID
|
||||||
threadID: g.THREADID
|
threadID: g.THREADID
|
||||||
postID: +location.hash.match /\d+/ # post number or 0
|
postID: +location.hash.match /\d+/ # post number or 0
|
||||||
location.replace href or "/#{g.BOARD}/"
|
Redirect.navigate href, "/#{g.BOARD}/"
|
||||||
return
|
return
|
||||||
|
|
||||||
# Something might have gone wrong!
|
# Something might have gone wrong!
|
||||||
|
|||||||
@ -180,6 +180,7 @@ Gallery =
|
|||||||
filename: src[src.length - 1]
|
filename: src[src.length - 1]
|
||||||
if URL
|
if URL
|
||||||
thumb.href = URL
|
thumb.href = URL
|
||||||
|
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
|
||||||
return unless Gallery.nodes.current is file
|
return unless Gallery.nodes.current is file
|
||||||
file.src = URL
|
file.src = URL
|
||||||
return
|
return
|
||||||
|
|||||||
@ -207,7 +207,7 @@ ImageExpand =
|
|||||||
URL = Redirect.to 'file',
|
URL = Redirect.to 'file',
|
||||||
boardID: src[3]
|
boardID: src[3]
|
||||||
filename: src[src.length - 1]
|
filename: src[src.length - 1]
|
||||||
if URL
|
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
|
||||||
setTimeout ImageExpand.expand, 10000, post, URL
|
setTimeout ImageExpand.expand, 10000, post, URL
|
||||||
return
|
return
|
||||||
if g.DEAD or post.isDead or post.file.isDead
|
if g.DEAD or post.isDead or post.file.isDead
|
||||||
|
|||||||
@ -53,7 +53,7 @@ ImageHover =
|
|||||||
URL = Redirect.to 'file',
|
URL = Redirect.to 'file',
|
||||||
boardID: src[3]
|
boardID: src[3]
|
||||||
filename: src[src.length - 1].replace /\?.+$/, ''
|
filename: src[src.length - 1].replace /\?.+$/, ''
|
||||||
if URL
|
if URL and (/^https:\/\//.test(URL) or location.protocol is 'http:')
|
||||||
@src = URL
|
@src = URL
|
||||||
return
|
return
|
||||||
if g.DEAD or post.isDead or post.file.isDead
|
if g.DEAD or post.isDead or post.file.isDead
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user