Display [Deleted] or [File deleted] when we catch deleted posts/files. Close #915.
This commit is contained in:
parent
c5b2539bc0
commit
9136d7f643
@ -5286,11 +5286,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Post.prototype.kill = function(img) {
|
Post.prototype.kill = function(img) {
|
||||||
var now, quotelink, _i, _len, _ref;
|
var now, quotelink, strong, _i, _len, _ref;
|
||||||
now = Date.now();
|
now = new Date();
|
||||||
if (this.file && !this.file.isDead) {
|
if (this.file && !this.file.isDead) {
|
||||||
this.file.isDead = true;
|
this.file.isDead = true;
|
||||||
this.file.timeOfDeath = now;
|
this.file.timeOfDeath = now;
|
||||||
|
$.after($('input', this.nodes.info), $.el('strong', {
|
||||||
|
className: 'warning',
|
||||||
|
textContent: '[File deleted]'
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
if (img) {
|
if (img) {
|
||||||
return;
|
return;
|
||||||
@ -5298,6 +5302,14 @@
|
|||||||
this.isDead = true;
|
this.isDead = true;
|
||||||
this.timeOfDeath = now;
|
this.timeOfDeath = now;
|
||||||
$.addClass(this.nodes.root, 'dead');
|
$.addClass(this.nodes.root, 'dead');
|
||||||
|
if (strong = $('strong.warning', this.nodes.info)) {
|
||||||
|
strong.textContent = '[Deleted]';
|
||||||
|
} else {
|
||||||
|
$.after($('input', this.nodes.info), $.el('strong', {
|
||||||
|
className: 'warning',
|
||||||
|
textContent: '[Deleted]'
|
||||||
|
}));
|
||||||
|
}
|
||||||
_ref = Get.allQuotelinksLinkingTo(this);
|
_ref = Get.allQuotelinksLinkingTo(this);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
quotelink = _ref[_i];
|
quotelink = _ref[_i];
|
||||||
|
|||||||
@ -16,12 +16,6 @@ class Thread
|
|||||||
@fullID = "#{@board}.#{@ID}"
|
@fullID = "#{@board}.#{@ID}"
|
||||||
@posts = {}
|
@posts = {}
|
||||||
|
|
||||||
# XXX Can't check when parsing single posts
|
|
||||||
# move to Post constructor? unless @isReply
|
|
||||||
# postInfo = $ '.postInfo', root.firstElementChild
|
|
||||||
# @isClosed = !!$ 'img[title=Closed]', postInfo
|
|
||||||
# @isSticky = !!$ 'img[title=Sticky]', postInfo
|
|
||||||
|
|
||||||
g.threads["#{board}.#{@}"] = board.threads[@] = @
|
g.threads["#{board}.#{@}"] = board.threads[@] = @
|
||||||
|
|
||||||
kill: ->
|
kill: ->
|
||||||
@ -152,15 +146,23 @@ class Post
|
|||||||
@kill() if that.isArchived
|
@kill() if that.isArchived
|
||||||
|
|
||||||
kill: (img) ->
|
kill: (img) ->
|
||||||
now = Date.now()
|
now = new Date()
|
||||||
if @file and !@file.isDead
|
if @file and !@file.isDead
|
||||||
@file.isDead = true
|
@file.isDead = true
|
||||||
@file.timeOfDeath = now
|
@file.timeOfDeath = now
|
||||||
|
$.after $('input', @nodes.info), $.el 'strong',
|
||||||
|
className: 'warning'
|
||||||
|
textContent: '[File deleted]'
|
||||||
return if img
|
return if img
|
||||||
@isDead = true
|
@isDead = true
|
||||||
@timeOfDeath = now
|
@timeOfDeath = now
|
||||||
$.addClass @nodes.root, 'dead'
|
$.addClass @nodes.root, 'dead'
|
||||||
# XXX style dead posts.
|
if strong = $ 'strong.warning', @nodes.info
|
||||||
|
strong.textContent = '[Deleted]'
|
||||||
|
else
|
||||||
|
$.after $('input', @nodes.info), $.el 'strong',
|
||||||
|
className: 'warning'
|
||||||
|
textContent: '[Deleted]'
|
||||||
|
|
||||||
# Get quotelinks/backlinks to this post
|
# Get quotelinks/backlinks to this post
|
||||||
# and paint them (Dead).
|
# and paint them (Dead).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user