return window.opera;
}
-function exception_error(location, e, silent) {
+function exception_error(location, e, ext_info) {
+ var msg = format_exception_error(location, e);
+
+ disableHotkeys();
+
+ try {
+
+ var ebc = document.getElementById("xebContent");
+
+ if (ebc) {
+
+ Element.show("dialog_overlay");
+ Element.show("errorBoxShadow");
+
+ if (ext_info) {
+ if (ext_info.responseText) {
+ ext_info = ext_info.responseText;
+ }
+ }
+
+ ebc.innerHTML =
+ "<div><b>Error message:</b></div>" +
+ "<pre>" + msg + "</pre>" +
+ "<div><b>Additional information:</b></div>" +
+ "<textarea readonly=\"1\">" + ext_info + "</textarea>";
+
+ } else {
+ alert(msg);
+ }
+
+ } catch (e) {
+ alert(msg);
+
+ }
+
+}
+
+function format_exception_error(location, e) {
var msg;
if (e.fileName) {
debug("<b>EXCEPTION: " + msg + "</b>");
- if (!silent) {
- alert(msg);
- }
+ return msg;
}
+
function disableHotkeys() {
hotkeys_enabled = false;
}
debug("<b>all_counters_callback2 OUT: " + transport + "</b>");
} catch (e) {
- exception_error("all_counters_callback2", e);
+ exception_error("all_counters_callback2", e, transport);
}
}
try {
return parseInt(document.getElementById("FEEDU-" + id).innerHTML);
} catch (e) {
- exception_error("get_feed_unread", e, true);
return -1;
}
}
ctr = ctr.replace(")", "");
return parseInt(ctr);
} catch (e) {
- exception_error("get_feed_unread", e, true);
return -1;
}
}
return s;
}
-function closeInfoBox(cleanup) {
-
- Element.hide("dialog_overlay");
+function closeErrorBox() {
- var box = document.getElementById('infoBox');
- var shadow = document.getElementById('infoBoxShadow');
+ if (Element.visible("errorBoxShadow")) {
+ Element.hide("dialog_overlay");
+ Element.hide("errorBoxShadow");
- if (shadow) {
- shadow.style.display = "none";
- } else if (box) {
- box.style.display = "none";
+ enableHotkeys();
}
- if (cleanup) box.innerHTML = " ";
+ return false;
+}
+
+function closeInfoBox(cleanup) {
+
+ if (Element.visible("infoBoxShadow")) {
+ Element.hide("dialog_overlay");
+
+ var shadow = document.getElementById('infoBoxShadow');
+ var box = document.getElementById('infoBoxShadow');
- enableHotkeys();
+ Element.hide(shadow);
+
+ if (cleanup) box.innerHTML = " ";
+
+ enableHotkeys();
+ }
return false;
}
init_params[key] = value;
}
-function fatalError(code, message) {
+function fatalError(code, msg, ext_info) {
try {
if (code == 6) {
} else if (code == 5) {
window.location.href = "update.php";
} else {
- var fe = document.getElementById("fatal_error");
- var fc = document.getElementById("fatal_error_msg");
- if (message == "") message = "Unknown error";
+ if (msg == "") msg = "Unknown error";
- fc.innerHTML = "<img src='images/sign_excl.gif'> " + message + " (Code " + code + ")";
+ var ebc = document.getElementById("xebContent");
- fe.style.display = "block";
+ if (ebc) {
+
+ Element.show("dialog_overlay");
+ Element.show("errorBoxShadow");
+ Element.hide("xebBtn");
+
+ if (ext_info) {
+ if (ext_info.responseText) {
+ ext_info = ext_info.responseText;
+ }
+ }
+
+ ebc.innerHTML =
+ "<div><b>Error message:</b></div>" +
+ "<pre>" + msg + "</pre>" +
+ "<div><b>Additional information:</b></div>" +
+ "<textarea readonly=\"1\">" + ext_info + "</textarea>";
+ }
}
} catch (e) {
}
// if selected action supports parameters, enable params field
- if (action == 4 || action == 6) {
+ if (action == 4 || action == 6 || action == 7) {
Element.show(action_param);
+ if (action != 7) {
+ Element.show(form.action_param);
+ Element.hide(form.action_param_label);
+ } else {
+ Element.show(form.action_param_label);
+ Element.hide(form.action_param);
+ }
} else {
Element.hide(action_param);
}