From b2caf812fbefca175dc60176084eb296cc0b9aa2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Jun 2006 15:48:46 +0100 Subject: [PATCH] fix preferences for opera --- prefs.js | 113 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 48 deletions(-) diff --git a/prefs.js b/prefs.js index eed755d5..d7396731 100644 --- a/prefs.js +++ b/prefs.js @@ -1112,58 +1112,68 @@ function selectTab(id, noupdate) { // alert(id); - if (!xmlhttp_ready(xmlhttp)) { - printLockingError(); - return - } - - if (!noupdate) { - - notify("Loading, please wait...", true); + if (!id) id = active_tab; - // close active infobox if needed - closeInfoBox(); + try { - // clean up all current selections, just in case - active_feed_cat = false; - active_label = false; - - if (id == "feedConfig") { - updateFeedList(); - } else if (id == "filterConfig") { - updateFilterList(); - } else if (id == "labelConfig") { - updateLabelList(); - } else if (id == "genConfig") { - updatePrefsList(); - } else if (id == "userConfig") { - updateUsersList(); - } else if (id == "feedBrowser") { - updateBigFeedBrowser(); + if (!xmlhttp_ready(xmlhttp)) { + printLockingError(); + return } - } - var tab = document.getElementById(active_tab + "Tab"); + if (!noupdate) { - if (tab) { - if (tab.className.match("Selected")) { - tab.className = "prefsTab"; + debug("selectTab: " + id + "(NU: " + noupdate + ")"); + + notify("Loading, please wait...", true); + + // close active infobox if needed + closeInfoBox(); + + // clean up all current selections, just in case + active_feed_cat = false; + active_label = false; + + if (id == "feedConfig") { + updateFeedList(); + } else if (id == "filterConfig") { + updateFilterList(); + } else if (id == "labelConfig") { + updateLabelList(); + } else if (id == "genConfig") { + updatePrefsList(); + } else if (id == "userConfig") { + updateUsersList(); + } else if (id == "feedBrowser") { + updateBigFeedBrowser(); + } } - } - - tab = document.getElementById(id + "Tab"); - - if (tab) { - if (!tab.className.match("Selected")) { - tab.className = tab.className + "Selected"; + + var tab = document.getElementById(active_tab + "Tab"); + + if (tab) { + if (tab.className.match("Selected")) { + tab.className = "prefsTab"; + } } - } + + tab = document.getElementById(id + "Tab"); + + if (tab) { + if (!tab.className.match("Selected")) { + tab.className = tab.className + "Selected"; + } + } + + if (active_tab != id) { + storeInitParam("prefs_active_tab", id); + } + + active_tab = id; - if (active_tab != id) { - storeInitParam("prefs_active_tab", id); + } catch (e) { + exception_error("selectTab", e); } - - active_tab = id; } function backend_sanity_check_callback() { @@ -1217,12 +1227,19 @@ function backend_sanity_check_callback() { function init_second_stage() { - active_tab = getInitParam("prefs_active_tab"); - if (!active_tab) active_tab = "genConfig"; - selectTab(active_tab); - - notify(""); + try { + active_tab = getInitParam("prefs_active_tab"); + if (!active_tab) active_tab = "genConfig"; + if (navigator.userAgent.match("Opera")) { + setTimeout("selectTab()", 500); + } else { + selectTab(active_tab); + } + notify(""); + } catch (e) { + exception_error("init_second_stage", e); + } } function init() { -- 2.39.5