diff --git a/4chan_x.user.js b/4chan_x.user.js index edd86f445..61fabbcc0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -183,7 +183,8 @@ 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], 'Scroll BG': [false, 'Auto-scroll background tabs.'], - 'Auto Update': [true, 'Automatically fetch new posts.'] + 'Auto Update': [true, 'Automatically fetch new posts.'], + 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] }, 'Interval': 30 } @@ -5648,7 +5649,7 @@ }, interval: function() { var val; - val = Math.max(5, parseInt(this.value, 10)); + val = parseInt(this.value, 10); ThreadUpdater.interval = this.value = val; return $.cb.value.call(this); }, @@ -5695,7 +5696,7 @@ if (!d.hidden) { j = Math.min(j, 7); } - return ThreadUpdater.seconds = Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]); + return ThreadUpdater.seconds = Conf['Optional Increase'] ? Math.max(i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j]) : i; }, set: function(name, text, klass) { var el, node; diff --git a/src/config.coffee b/src/config.coffee index 171224b92..f936b8535 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -465,4 +465,8 @@ http://www.google.com/searchbyimage?image_url=%turl true 'Automatically fetch new posts.' ] + 'Optional Increase': [ + false + 'Increase the intervals between updates on threads without new posts.' + ] 'Interval': 30 diff --git a/src/features.coffee b/src/features.coffee index f9a197a5d..4d8848ee8 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -3815,7 +3815,7 @@ ThreadUpdater = else clearTimeout ThreadUpdater.timeoutID interval: -> - val = Math.max 5, parseInt @value, 10 + val = parseInt @value, 10 ThreadUpdater.interval = @value = val $.cb.value.call @ load: -> @@ -3857,7 +3857,11 @@ ThreadUpdater = unless d.hidden # Lower the max refresh rate limit on visible tabs. j = Math.min j, 7 - ThreadUpdater.seconds = Math.max i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j] + ThreadUpdater.seconds = + if Conf['Optional Increase'] + Math.max i, [0, 5, 10, 15, 20, 30, 60, 90, 120, 240, 300][j] + else + i set: (name, text, klass) -> el = ThreadUpdater[name]