Improve markings on file 404. #545
This commit is contained in:
parent
487285428e
commit
578091f7bb
12
Makefile
12
Makefile
@ -36,8 +36,7 @@ sources_Config := \
|
||||
sources_API := \
|
||||
src/General/$$.coffee \
|
||||
src/General/$$$$.coffee \
|
||||
src/General/CrossOrigin.coffee \
|
||||
src/Images/ImageCommon.coffee
|
||||
src/General/CrossOrigin.coffee
|
||||
|
||||
sources_classes := $(call sort_dir,classes)
|
||||
|
||||
@ -47,16 +46,9 @@ sources_General := \
|
||||
,$(call sort_dir,General))
|
||||
|
||||
$(foreach d, \
|
||||
Archive Filtering \
|
||||
Archive Filtering Images Linkification Menu Miscellaneous Monitoring Posting Quotelinks \
|
||||
,$(eval sources_$(d) := $(call sort_dir,$(d))))
|
||||
|
||||
sources_Images := \
|
||||
$(filter-out %/ImageCommon.coffee,$(call sort_dir,Images))
|
||||
|
||||
$(foreach d, \
|
||||
Linkification Menu Miscellaneous Monitoring Posting Quotelinks \
|
||||
S ,$(eval sources_$(d) := $(call sort_dir,$(d))))
|
||||
|
||||
sources_Main := \
|
||||
src/General/Main.coffee
|
||||
|
||||
|
||||
@ -50,20 +50,8 @@ ImageCommon =
|
||||
clearTimeout timeoutID if delay?
|
||||
cb URL
|
||||
|
||||
<% if (type === 'crx') { %>
|
||||
$.ajax post.file.url,
|
||||
onloadend: ->
|
||||
if @status is 200
|
||||
URL = post.file.url
|
||||
else
|
||||
post.kill true if @status is 404
|
||||
redirect()
|
||||
,
|
||||
type: 'head'
|
||||
<% } else { %>
|
||||
# XXX CORS for i.4cdn.org WHEN?
|
||||
$.ajax "//a.4cdn.org/#{post.board}/thread/#{post.thread}.json", onload: ->
|
||||
post.kill() if @status is 404
|
||||
post.kill !post.isClone if @status is 404
|
||||
return redirect() if @status isnt 200
|
||||
for postObj in @response.posts
|
||||
break if postObj.no is post.ID
|
||||
@ -75,7 +63,6 @@ ImageCommon =
|
||||
redirect()
|
||||
else
|
||||
URL = post.file.url
|
||||
<% } %>
|
||||
|
||||
# Add controls, but not until the mouse is moved over the video.
|
||||
addControls: (video) ->
|
||||
|
||||
@ -207,18 +207,18 @@ class Post
|
||||
|
||||
kill: (file) ->
|
||||
if file
|
||||
return if @file.isDead
|
||||
return if @isDead or @file.isDead
|
||||
@file.isDead = true
|
||||
$.addClass @nodes.root, 'deleted-file'
|
||||
else
|
||||
return if @isDead
|
||||
@isDead = true
|
||||
$.rmClass @nodes.root, 'deleted-file'
|
||||
$.addClass @nodes.root, 'deleted-post'
|
||||
|
||||
unless strong = $ 'strong.warning', @nodes.info
|
||||
unless (strong = $ 'strong.warning', @nodes.info)
|
||||
strong = $.el 'strong',
|
||||
className: 'warning'
|
||||
textContent: if @isReply then '[Deleted]' else '[Dead]'
|
||||
className: 'warning'
|
||||
$.after $('input', @nodes.info), strong
|
||||
strong.textContent = if file then '[File deleted]' else '[Deleted]'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user