Prevent post submission in a sticky thread. Close #664

This commit is contained in:
Nicolas Stepien 2013-02-23 15:56:44 +01:00
parent 4fc349d996
commit a796597108
3 changed files with 12 additions and 6 deletions

View File

@ -2512,9 +2512,10 @@
},
cooldown: {
start: function(e) {
var fullID, seconds;
seconds = g.BOARD.ID === 'q' ? 600 : 30;
fullID = "" + g.BOARD + "." + e.detail.postID;
var board, fullID, postID, seconds, _ref;
_ref = e.detail, board = _ref.board, postID = _ref.postID;
seconds = board.ID === 'q' ? 600 : 30;
fullID = "" + board + "." + postID;
return DeleteLink.cooldown.count(fullID, seconds, seconds);
},
count: function(fullID, seconds, length) {
@ -6339,6 +6340,8 @@
} else if (g.BOARD.ID === 'f' && filetag === '9999') {
err = 'Invalid tag specified.';
}
} else if (g.BOARD.threads[threadID].isSticky) {
err = 'You can\'t reply to this thread anymore.';
} else if (!(reply.com || reply.file)) {
err = 'No file selected.';
}

View File

@ -1341,12 +1341,13 @@ DeleteLink =
cooldown:
start: (e) ->
{board, postID} = e.detail
seconds =
if g.BOARD.ID is 'q'
if board.ID is 'q'
600
else
30
fullID = "#{g.BOARD}.#{e.detail.postID}"
fullID = "#{board}.#{postID}"
DeleteLink.cooldown.count fullID, seconds, seconds
count: (fullID, seconds, length) ->
return unless 0 <= seconds <= length

View File

@ -647,8 +647,10 @@ QR =
err = 'No file selected.'
else if g.BOARD.ID is 'f' and filetag is '9999'
err = 'Invalid tag specified.'
else if g.BOARD.threads[threadID].isSticky
err = 'You can\'t reply to this thread anymore.'
else unless reply.com or reply.file
err = 'No file selected.'
err = 'No file selected.'
if QR.captcha.isEnabled and !err
# get oldest valid captcha