]> git.wh0rd.org - tt-rss.git/commitdiff
more cookie magic, basic sanity checks on init()
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 8 Sep 2005 05:36:28 +0000 (06:36 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 8 Sep 2005 05:36:28 +0000 (06:36 +0100)
tt-rss.js

index edfd10693d76c9a0ff1ff2012007f850f732344d..4f532d60a194100269341bf740aa259833ad7422 100644 (file)
--- 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 = 
                        "<b>Fatal error:</b> 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 = 
+                       "<b>Fatal error:</b> 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;