Improve markings on file 404. #545

This commit is contained in:
ccd0 2016-04-15 20:01:13 -07:00
parent 487285428e
commit 578091f7bb
3 changed files with 7 additions and 28 deletions

View File

@ -36,8 +36,7 @@ sources_Config := \
sources_API := \ sources_API := \
src/General/$$.coffee \ src/General/$$.coffee \
src/General/$$$$.coffee \ src/General/$$$$.coffee \
src/General/CrossOrigin.coffee \ src/General/CrossOrigin.coffee
src/Images/ImageCommon.coffee
sources_classes := $(call sort_dir,classes) sources_classes := $(call sort_dir,classes)
@ -47,16 +46,9 @@ sources_General := \
,$(call sort_dir,General)) ,$(call sort_dir,General))
$(foreach d, \ $(foreach d, \
Archive Filtering \ Archive Filtering Images Linkification Menu Miscellaneous Monitoring Posting Quotelinks \
,$(eval sources_$(d) := $(call sort_dir,$(d)))) ,$(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 := \ sources_Main := \
src/General/Main.coffee src/General/Main.coffee

View File

@ -50,20 +50,8 @@ ImageCommon =
clearTimeout timeoutID if delay? clearTimeout timeoutID if delay?
cb URL 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: -> $.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 return redirect() if @status isnt 200
for postObj in @response.posts for postObj in @response.posts
break if postObj.no is post.ID break if postObj.no is post.ID
@ -75,7 +63,6 @@ ImageCommon =
redirect() redirect()
else else
URL = post.file.url URL = post.file.url
<% } %>
# Add controls, but not until the mouse is moved over the video. # Add controls, but not until the mouse is moved over the video.
addControls: (video) -> addControls: (video) ->

View File

@ -207,18 +207,18 @@ class Post
kill: (file) -> kill: (file) ->
if file if file
return if @file.isDead return if @isDead or @file.isDead
@file.isDead = true @file.isDead = true
$.addClass @nodes.root, 'deleted-file' $.addClass @nodes.root, 'deleted-file'
else else
return if @isDead return if @isDead
@isDead = true @isDead = true
$.rmClass @nodes.root, 'deleted-file'
$.addClass @nodes.root, 'deleted-post' $.addClass @nodes.root, 'deleted-post'
unless strong = $ 'strong.warning', @nodes.info unless (strong = $ 'strong.warning', @nodes.info)
strong = $.el 'strong', strong = $.el 'strong',
className: 'warning' className: 'warning'
textContent: if @isReply then '[Deleted]' else '[Dead]'
$.after $('input', @nodes.info), strong $.after $('input', @nodes.info), strong
strong.textContent = if file then '[File deleted]' else '[Deleted]' strong.textContent = if file then '[File deleted]' else '[Deleted]'