From af21becff600c8d8d2307d3a5a68ea229c1a26b4 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 25 Nov 2013 13:21:37 +0100 Subject: [PATCH 1/3] Fix #1347. --- CHANGELOG.md | 3 +++ src/Posting/QR.coffee | 16 ++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10d6cb3b..bf858f7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +- Minor cooldown fix: + - You cannot post an image reply immediately after a non-image reply anymore. + ## 3.14.0 - *2013-11-21* - **New option**: `Auto-hide header on scroll`. diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 7f850868b..698d1bf8a 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -262,11 +262,11 @@ QR = if delay cooldown = {delay} else - if hasFile = !!post.file + if post.file upSpd = post.file.size / ((start - req.uploadStartTime) / $.SECOND) QR.cooldown.upSpdAccuracy = ((upSpd > QR.cooldown.upSpd * .9) + QR.cooldown.upSpdAccuracy) / 2 QR.cooldown.upSpd = upSpd - cooldown = {isReply, hasFile, threadID} + cooldown = {isReply, threadID} QR.cooldown.cooldowns[start] = cooldown $.set "cooldown.#{g.BOARD}", QR.cooldown.cooldowns QR.cooldown.start() @@ -308,16 +308,12 @@ QR = # reply cooldown with a reply, thread cooldown with a thread elapsed = Math.floor (now - start) / $.SECOND continue if elapsed < 0 # clock changed since then? - unless isReply - type = 'thread' + type = unless isReply + 'thread' else if hasFile - # You can post an image reply immediately after a non-image reply. - unless cooldown.hasFile - seconds = Math.max seconds, 0 - continue - type = 'image' + 'image' else - type = 'reply' + 'reply' maxTimer = Math.max types[type] or 0, types[type + '_intra'] or 0 unless start <= now <= start + maxTimer * $.SECOND QR.cooldown.unset start From 266d06d7b333630be7685e591ed079d50b3a7fbc Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 25 Nov 2013 13:43:29 +0100 Subject: [PATCH 2/3] Domain-shard the thumbnail URLs for faster index load. --- src/General/Build.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 1536bb30f..28b66a699 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -9,6 +9,9 @@ Build = "#{filename[...threshold - 5]}(...).#{filename[-3..]}" else filename + thumbRotate: do -> + n = 0 + -> n = (n + 1) % 2 postFromObject: (data, boardID) -> o = # id @@ -43,7 +46,7 @@ Build = width: data.w MD5: data.md5 size: data.fsize - turl: "//t.4cdn.org/#{boardID}/thumb/#{data.tim}s.jpg" + turl: "//#{Build.thumbRotate()}.t.4cdn.org/#{boardID}/thumb/#{data.tim}s.jpg" theight: data.tn_h twidth: data.tn_w isSpoiler: !!data.spoiler From 6a9b1a01507f59f0ba2c400515479be4fee5a78b Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 25 Nov 2013 13:44:43 +0100 Subject: [PATCH 3/3] Release 4chan X v3.14.1. --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf858f7d7..c505b232b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### 3.14.1 - *2013-11-25* + - Minor cooldown fix: - You cannot post an image reply immediately after a non-image reply anymore. diff --git a/package.json b/package.json index 4325fef20..ba2bcc342 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "3.14.0", + "version": "3.14.1", "description": "Cross-browser extension for productive lurking on 4chan.", "meta": { "name": "4chan X",