function fatalError(code, msg, ext_info) {
try {
- if (!ext_info) ext_info = "N/A";
-
if (code == 6) {
window.location.href = "tt-rss.php";
} else if (code == 5) {
if (msg == "") msg = "Unknown error";
- var ebc = $("xebContent");
-
- if (ebc) {
-
- Element.show("dialog_overlay");
- Element.show("errorBoxShadow");
- Element.hide("xebBtn");
-
- if (ext_info) {
- if (ext_info.responseText) {
- ext_info = ext_info.responseText;
- }
+ if (ext_info) {
+ if (ext_info.responseText) {
+ ext_info = ext_info.responseText;
}
+ }
+
+ if (ERRORS && ERRORS[code] && !msg) {
+ msg = ERRORS[code];
+ }
- ebc.innerHTML =
- "<div><b>Error message:</b></div>" +
- "<pre>" + msg + "</pre>" +
- "<div><b>Additional information:</b></div>" +
- "<textarea readonly=\"1\">" + ext_info + "</textarea>";
+ var content = "<div><b>Error code:</b> " + code + "</div>" +
+ "<p>" + msg + "</p>";
+
+ if (ext_info) {
+ content = content + "<div><b>Additional information:</b></div>" +
+ "<textarea style='width: 100%' readonly=\"1\">" +
+ ext_info + "</textarea>";
}
+
+ var dialog = new dijit.Dialog({
+ title: "Fatal error",
+ style: "width: 600px",
+ content: content});
+
+ dialog.show();
+
}
+ return false;
+
} catch (e) {
exception_error("fatalError", e);
}
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- handle_rpc_reply(transport);
- var response = transport.responseXML;
+ var reply = JSON.parse(transport.responseText);
- if (response) {
- var s = response.getElementsByTagName("status")[0].firstChild.nodeValue;
-
+ if (reply) {
notify('');
- if (s == "INVALID") {
+ if (!reply['status']) {
alert("Match regular expression seems to be invalid.");
return;
} else {
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- var new_link = transport.responseXML.getElementsByTagName("link")[0];
+ var reply = JSON.parse(transport.responseText);
+ var new_link = reply.link;
var e = $('gen_feed_url');
if (new_link) {
- new_link = new_link.firstChild.nodeValue;
-
e.innerHTML = e.innerHTML.replace(/\&key=.*$/,
"&key=" + new_link);
parameters: dojo.objectToQuery(dialog.attr('value')),
onComplete: function(transport) {
dialog.hide();
+ notify('');
updateFeedList();
}})
}