From 54fdd54e8953c49fc2360af082f8ba3c4f5fc2a2 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Mon, 5 May 2014 20:51:51 +0100 Subject: Make the delays configurable in settings.js --- js/settings.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/settings.js') diff --git a/js/settings.js b/js/settings.js index 6db9df9f..cb6bf770 100644 --- a/js/settings.js +++ b/js/settings.js @@ -51,3 +51,15 @@ tb_settings['wpaint'] = { // Canvas height height: 250 }; + +// auto-reload.js +tb_settings['auto-reload'] = { + // Minimum delay before reloading the page when at the bottom + min_delay_bottom: 3000, + // Minimum delay before reloading the page when not at the bottom + min_delay_top: 10000, + // Maximum delay before reloading the page + max_delay: 600000, + //Delay to wait before reloading when the user scrolls to the bottom + quick_delay: 100 +}; -- cgit v1.3 From abaf80fd8ae1b7eea39894339e2af76e7d6c82d3 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Mon, 5 May 2014 20:54:40 +0100 Subject: Reset the delay to the minimum upon focussing the window (configurable) --- js/auto-reload.js | 7 +++++++ js/settings.js | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'js/settings.js') diff --git a/js/auto-reload.js b/js/auto-reload.js index fa856bd9..4a872024 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -56,6 +56,13 @@ $(document).ready(function(){ $(window).focus(function() { window_active = true; recheck_activated(); + + // Reset the delay if needed + if(settings.get('reset_focus', true)) { + poll_interval_delay = end_of_page + ? poll_interval_mindelay_bottom + : poll_interval_mindelay_top; + } }); $(window).blur(function() { window_active = false; diff --git a/js/settings.js b/js/settings.js index cb6bf770..02d5658d 100644 --- a/js/settings.js +++ b/js/settings.js @@ -61,5 +61,7 @@ tb_settings['auto-reload'] = { // Maximum delay before reloading the page max_delay: 600000, //Delay to wait before reloading when the user scrolls to the bottom - quick_delay: 100 + quick_delay: 100, + // Reset the delay to the minimum upon focussing the window. + reset_focus: true }; -- cgit v1.3