From 22a93ad8b2aa86be9330c4002715e17c8bcea608 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 8 Sep 2005 06:36:28 +0100 Subject: [PATCH] more cookie magic, basic sanity checks on init() --- tt-rss.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tt-rss.js b/tt-rss.js index edfd1069..4f532d60 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -274,17 +274,35 @@ function localHotkeyHandler(keycode) { } -function init() { - - disableContainerChildren("headlinesToolbar", true); +function genericSanityCheck() { if (!xmlhttp) { document.getElementById("headlines").innerHTML = "Fatal error: This program requires XmlHttpRequest " + "to function properly. Your browser doesn't seem to support it."; - return; + return false; } + setCookie("ttrss_vf_test", "TEST"); + if (getCookie("ttrss_vf_test") != "TEST") { + + document.getElementById("headlines").innerHTML = + "Fatal error: This program requires cookies " + + "to function properly. Your browser doesn't seem to support them."; + + return false; + } + + return true; +} + +function init() { + + disableContainerChildren("headlinesToolbar", true); + + if (!genericSanityCheck()) + return; + updateFeedList(false, false); document.onkeydown = hotkey_handler;