Make the delays configurable in settings.js

This commit is contained in:
Michael Walker 2014-05-05 20:51:51 +01:00
parent 97cfec836b
commit 54fdd54e89
2 changed files with 21 additions and 13 deletions

View File

@ -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;

View File

@ -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
};