From 7719618b297400f5bdc44b1be47f969ec582fb47 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 26 Nov 2005 11:06:56 +0100 Subject: exception handling in some code blocks --- prefs.js | 54 +++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) (limited to 'prefs.js') diff --git a/prefs.js b/prefs.js index 404602c33..b69369ba1 100644 --- a/prefs.js +++ b/prefs.js @@ -28,8 +28,8 @@ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { } function feedlist_callback() { - var container = document.getElementById('prefContent'); if (xmlhttp.readyState == 4) { + var container = document.getElementById('prefContent'); container.innerHTML=xmlhttp.responseText; if (active_feed) { var row = document.getElementById("FEEDR-" + active_feed); @@ -1146,45 +1146,25 @@ function selectTab(id) { function init() { - // IE kludge - - if (!xmlhttp) { - document.getElementById("prefContent").innerHTML = - "Fatal error: This program needs XmlHttpRequest " + - "to function properly. Your browser doesn't seem to support it."; - return; + try { + + // IE kludge + if (!xmlhttp) { + document.getElementById("prefContent").innerHTML = + "Fatal error: This program needs XmlHttpRequest " + + "to function properly. Your browser doesn't seem to support it."; + return; + } + + selectTab("genConfig"); + + document.onkeydown = hotkey_handler; + notify(""); + } catch (e) { + exception_error("init", e); } - - selectTab("genConfig"); - - document.onkeydown = hotkey_handler; - notify(""); - } -/* -var help_topic_id = false; - -function do_dispOptionHelp() { - - if (!xmlhttp_ready(xmlhttp)) - return; - - xmlhttp.open("GET", "backend.php?op=pref-prefs&subop=getHelp&pn=" + - param_escape(help_topic_id), true); - xmlhttp.onreadystatechange=gethelp_callback; - xmlhttp.send(null); - -} - -function dispOptionHelp(event, sender) { - - help_topic_id = sender.id; - -// document.setTimeout("do_dispOptionHelp()", 100); - -} */ - function closeInfoBox() { var box = document.getElementById('infoBox'); var shadow = document.getElementById('infoBoxShadow'); -- cgit v1.2.3