From d4b73046b92dd7ba05bc7aa207fa283eb7586316 Mon Sep 17 00:00:00 2001 From: topkek Date: Sun, 28 Sep 2014 20:00:43 +0100 Subject: [PATCH 1/4] Error/404 handling --- js/auto-reload.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/auto-reload.js b/js/auto-reload.js index de4326a4..7803a492 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -179,6 +179,21 @@ $(document).ready(function(){ else $('#update_secs').text("No new posts found"); } + }, + error: function(xhr, status_text, error_text) { + if (status_text == "error") { + if (error_text == "Not Found") { + $('#update_secs').text("Thread deleted or pruned"); + $('#auto_update_status').prop('checked', false); + $('#auto_update_status').prop('disabled', true); // disable updates if thread is deleted + } else { + $('#update_secs').text("Error: "+error_text); + } + } else if (status_text) { + $('#update_secs').text("Error: "+status_text); + } else { + $('#update_secs').text("Unknown error"); + } } }); From c9942ab3db4bbac40d41cb48080053c027dd6c9d Mon Sep 17 00:00:00 2001 From: topkek Date: Sun, 28 Sep 2014 20:23:30 +0100 Subject: [PATCH 2/4] Keep trying to update if thread didn't 404 --- js/auto-reload.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 7803a492..26280b0f 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -43,6 +43,7 @@ $(document).ready(function(){ var settings = new script_settings('auto-reload'); var poll_interval_mindelay = settings.get('min_delay_bottom', 5000); var poll_interval_maxdelay = settings.get('max_delay', 600000); + var poll_interval_errordelay = settings.get('error_delay', 30000); // number of ms to wait before reloading var poll_interval_delay = poll_interval_mindelay; @@ -186,6 +187,7 @@ $(document).ready(function(){ $('#update_secs').text("Thread deleted or pruned"); $('#auto_update_status').prop('checked', false); $('#auto_update_status').prop('disabled', true); // disable updates if thread is deleted + return; } else { $('#update_secs').text("Error: "+error_text); } @@ -193,7 +195,13 @@ $(document).ready(function(){ $('#update_secs').text("Error: "+status_text); } else { $('#update_secs').text("Unknown error"); - } + } + + // Keep trying to update + if ($('#auto_update_status').is(':checked')) { + poll_interval_delay = poll_interval_errordelay; + auto_update(poll_interval_delay); + } } }); From 7b8cef24468c2acbcde3ee9751e58ace6e0ab4c2 Mon Sep 17 00:00:00 2001 From: topkek Date: Sun, 28 Sep 2014 20:25:07 +0100 Subject: [PATCH 3/4] Update settings.js --- js/settings.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/settings.js b/js/settings.js index fcc8f508..81e88f7a 100644 --- a/js/settings.js +++ b/js/settings.js @@ -58,6 +58,8 @@ tb_settings['auto-reload'] = { min_delay_bottom: 5000, // Maximum delay before reloading the page max_delay: 600000, + // Delay if there was an error + error_delay: 30000, // Reset the delay to the minimum upon focussing the window. reset_focus: true }; From 200881cfeeeb79676002d026f8c38b7e443ad360 Mon Sep 17 00:00:00 2001 From: topkek Date: Mon, 29 Sep 2014 19:10:18 +0100 Subject: [PATCH 4/4] Use https for youtube thumbnails --- templates/themes/catalog/catalog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index be02a80e..13dd8698 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -48,7 +48,7 @@