diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9b09c5d..973ad4b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ - **New feature**: `Linkify` and `Clean Links`, enabled by default - Linkify will turn text URLs into working links. - Clean Links will get rid of spoiler and code tags in linkified URLs used to bypass spam blocks. +- New desktop notification: + - The QR will now warn you when you are running low on cached captchas while auto-posting. ## 3.9.0 - *2013-08-18* diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 9c31a2dd2..fdcbc7f16 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -106,7 +106,7 @@ Unread = window.focus() setTimeout -> notif.close() - , 5 * $.SECOND + , 7 * $.SECOND onUpdate: (e) -> if e.detail[404] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index f3526edf1..5a5d62219 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -125,7 +125,7 @@ QR = setTimeout -> notif.onclose = null notif.close() - , 5 * $.SECOND + , 7 * $.SECOND <% } %> notifications: [] cleanNotifications: -> @@ -1101,7 +1101,16 @@ QR = } # Enable auto-posting if we have stuff to post, disable it otherwise. - QR.cooldown.auto = QR.posts.length > 1 and isReply + postsCount = QR.posts.length + QR.cooldown.auto = postsCount > 1 and isReply + if QR.cooldown.auto and QR.captcha.isEnabled and (captchasCount = QR.captcha.captchas.length) < 3 and captchasCount < postsCount + notif = new Notification 'Quick reply warning', + body: "You are running low on cached captchas. Cache count: #{captchasCount}." + icon: Favicon.logo + notif.onclick = -> window.focus() + setTimeout -> + notif.close() + , 7 * $.SECOND unless Conf['Persistent QR'] or QR.cooldown.auto QR.close()