diff --git a/js/auto-reload.js b/js/auto-reload.js index 3159bfd1..fa856bd9 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -27,20 +27,16 @@ $(document).ready(function(){ var poll_interval; + + // Grab the settings + var settings = new script_settings('auto-reload'); + var poll_interval_mindelay_bottom = settings.get('min_delay_bottom', 3000); + var poll_interval_mindelay_top = settings.get('min_delay_top', 10000); + var poll_interval_maxdelay = settings.get('max_delay', 600000); + var poll_interval_shortdelay = settings.get('quick_delay', 100); + // number of ms to wait before reloading - var poll_interval_delay; - - // If at the bottom of the page, reload more quickly. - var poll_interval_mindelay_bottom = 3000; - var poll_interval_mindelay_top = 10000; - - poll_interval_delay = poll_interval_mindelay_bottom; - - // Don't take longer than this to reload. - var poll_interval_maxdelay = 600000; - - // Upon scrolling to the bottom, reload very quickly. - var poll_interval_shortdelay = 100; + var poll_interval_delay = poll_interval_mindelay_bottom; var end_of_page = false; 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 +};