# HG changeset patch # User neko259 # Date 2015-05-06 12:11:25 # Node ID 3a63bd27458ba78d0eea890cb289d69ae2770ed6 # Parent cbb60bdaed26284ac7cc221a61d5851677068928 If we are over https, use old plain periodic thread update instead of websockets diff --git a/boards/static/js/thread_update.js b/boards/static/js/thread_update.js --- a/boards/static/js/thread_update.js +++ b/boards/static/js/thread_update.js @@ -28,6 +28,8 @@ var CLASS_POST = '.post' var POST_ADDED = 0; var POST_UPDATED = 1; +var JS_AUTOUPDATE_PERIOD = 20000; + var wsUser = ''; var unreadPosts = 0; @@ -193,8 +195,17 @@ function isPageBottom() { return scroll == 1 } +function enableJsUpdate() { + setInterval(getThreadDiff, JS_AUTOUPDATE_PERIOD); + return true; +} + function initAutoupdate() { - return connectWebsocket(); + if (location.protocol === 'https:') { + return enableJsUpdate(); + } else { + return connectWebsocket(); + } } function getReplyCount() {