diff --git a/4chan_x.user.js b/4chan_x.user.js index 44b6e9aa3..ab5b191f4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -5286,11 +5286,15 @@ } Post.prototype.kill = function(img) { - var now, quotelink, _i, _len, _ref; - now = Date.now(); + var now, quotelink, strong, _i, _len, _ref; + now = new Date(); if (this.file && !this.file.isDead) { this.file.isDead = true; this.file.timeOfDeath = now; + $.after($('input', this.nodes.info), $.el('strong', { + className: 'warning', + textContent: '[File deleted]' + })); } if (img) { return; @@ -5298,6 +5302,14 @@ this.isDead = true; this.timeOfDeath = now; $.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); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quotelink = _ref[_i]; diff --git a/src/main.coffee b/src/main.coffee index fda82dc75..4edb6d432 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -16,12 +16,6 @@ class Thread @fullID = "#{@board}.#{@ID}" @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[@] = @ kill: -> @@ -152,15 +146,23 @@ class Post @kill() if that.isArchived kill: (img) -> - now = Date.now() + now = new Date() if @file and !@file.isDead @file.isDead = true @file.timeOfDeath = now + $.after $('input', @nodes.info), $.el 'strong', + className: 'warning' + textContent: '[File deleted]' return if img @isDead = true @timeOfDeath = now $.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 # and paint them (Dead).