var hotkeys_enabled = true;
var notify_silent = false;
-var last_progress_point = 0;
+var loading_progress = 0;
var sanity_check_done = false;
/* add method to remove element from array */
if (!ext_info) ext_info = false;
- disableHotkeys();
-
try {
- var ebc = $("xebContent");
-
- if (ebc) {
-
- Element.show("dialog_overlay");
- Element.show("errorBoxShadow");
-
- if (ext_info) {
- if (ext_info.responseText) {
- ext_info = ext_info.responseText;
- }
+ if (ext_info) {
+ if (ext_info.responseText) {
+ ext_info = ext_info.responseText;
}
-
- ebc.innerHTML =
- "<div><b>Error message:</b></div>" +
- "<pre>" + msg + "</pre>";
+ }
- if (ext_info) {
- ebc.innerHTML += "<div><b>Additional information:</b></div>" +
- "<textarea readonly=\"1\">" + ext_info + "</textarea>";
- }
+ var content = "<div class=\"fatalError\">" +
+ "<pre>" + msg + "</pre>";
- ebc.innerHTML += "<div><b>Stack trace:</b></div>" +
- "<textarea readonly=\"1\">" + e.stack + "</textarea>";
-
- } else {
- alert(msg);
+ if (ext_info) {
+ content += "<div><b>Additional information:</b></div>" +
+ "<textarea readonly=\"1\">" + ext_info + "</textarea>";
}
+ content += "<div><b>Stack trace:</b></div>" +
+ "<textarea readonly=\"1\">" + e.stack + "</textarea>";
+
+// content += "<div style='text-align : center'>" +
+// "<button onclick=\"closeInfoBox()\">" +
+// "Close this window" + "</button></div>";
+
+ content += "</div>";
+
+ // TODO: add code to automatically report errors to tt-rss.org
+
+ var dialog = new dijit.Dialog({
+ title: "Unhandled exception",
+ style: "width: 600px",
+ content: content});
+
+ dialog.show();
+
} catch (e) {
alert(msg);
-
}
}
return toggleSelectRow(sender, row);
}
+/* this is for dijit Checkbox */
+function toggleSelectListRow2(sender) {
+ var row = sender.domNode.parentNode;
+ return toggleSelectRow(sender, row);
+}
+
function tSR(sender, row) {
return toggleSelectRow(sender, row);
}
+/* this is for dijit Checkbox */
+function toggleSelectRow2(sender, row) {
+
+ if (!row) row = sender.domNode.parentNode.parentNode;
+
+ if (sender.checked && !row.hasClassName('Selected'))
+ row.addClassName('Selected');
+ else
+ row.removeClassName('Selected');
+}
+
+
function toggleSelectRow(sender, row) {
if (!row) row = sender.parentNode.parentNode;
}
function closeInfoBox(cleanup) {
-
try {
enableHotkeys();
- if (Element.visible("infoBoxShadow")) {
- Element.hide("dialog_overlay");
- Element.hide("infoBoxShadow");
+ dialog = dijit.byId("infoBox");
+
+ if (dialog) dialog.hide();
- if (cleanup) $("infoBox").innerHTML = " ";
- }
} catch (e) {
- exception_error("closeInfoBox", e);
+ //exception_error("closeInfoBox", e);
}
-
return false;
}
notify_progress("Loading, please wait...", true);
- disableHotkeys();
-
var query = "?op=dlg&id=" +
param_escape(id) + "¶m=" + param_escape(param);
function infobox_callback2(transport) {
try {
+ var dialog = false;
- console.log("infobox_callback2");
+ if (dijit.byId("infoBox")) {
+ dialog = dijit.byId("infoBox");
+ }
- var box = $('infoBox');
-
- if (box) {
+ //console.log("infobox_callback2");
+ notify('');
- if (!getInitParam("infobox_disable_overlay")) {
- Element.show("dialog_overlay");
- }
+ var content;
+ var dtitle = "Dialog";
+
+ if (transport.responseXML) {
+ var dlg = transport.responseXML.getElementsByTagName("dlg")[0];
- box.innerHTML=transport.responseText;
- Element.show("infoBoxShadow");
- //Effect.SlideDown("infoBoxShadow", {duration : 1.0});
+ var title = transport.responseXML.getElementsByTagName("title")[0];
+ if (title)
+ title = title.firstChild.nodeValue;
+ var content = transport.responseXML.getElementsByTagName("content")[0];
+
+ content = content.firstChild.nodeValue;
+
+ } else {
+ content = transport.responseText;
+ }
+ if (!dialog) {
+ dialog = new dijit.Dialog({
+ title: title,
+ id: 'infoBox',
+ style: "width: 600px",
+ onCancel: function() {
+ return true;
+ },
+ onExecute: function() {
+ return true;
+ },
+ onClose: function() {
+ return true;
+ },
+ content: content});
+ } else {
+ dialog.attr('title', title);
+ dialog.attr('content', content);
}
- disableHotkeys();
+ dialog.show();
notify("");
} catch (e) {
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- //dlg_frefresh_callback(transport);
-
try {
if (!transport.responseXML) {
function loading_set_progress(p) {
try {
- if (p < last_progress_point || !Element.visible("overlay")) return;
-
- console.log("loading_set_progress : " + p + " (" + last_progress_point + ")");
-
- var o = $("l_progress_i");
+ loading_progress += p;
-// o.style.width = (p * 2) + "px";
+ if (dijit.byId("loading_bar"))
+ dijit.byId("loading_bar").update({progress: loading_progress});
- new Effect.Scale(o, p, {
- scaleY : false,
- scaleFrom : last_progress_point,
- scaleMode: { originalWidth : 200 },
- queue: { position: 'end', scope: 'LSP-Q', limit: 3 } });
-
- last_progress_point = p;
+ if (loading_progress >= 90)
+ remove_splash();
} catch (e) {
exception_error("loading_set_progress", e);
}
function remove_splash() {
+
if (Element.visible("overlay")) {
console.log("about to remove splash, OMG!");
Element.hide("overlay");
function getSelectedFeedsFromBrowser() {
- var list = $("browseFeedList");
+ var list = $$("#browseFeedList li[id*=FBROW]");
var selected = new Array();
-
- for (i = 0; i < list.childNodes.length; i++) {
- var child = list.childNodes[i];
- if (child.id && child.id.match("FBROW-")) {
- var id = child.id.replace("FBROW-", "");
-
- var cb = $("FBCHK-" + id);
- if (cb.checked) {
- selected.push(id);
- }
- }
- }
+ list.each(function(child) {
+ var id = child.id.replace("FBROW-", "");
+ var cb = $("FBCHK-" + id);
+
+ if (cb.checked) {
+ selected.push(id);
+ }
+ });
return selected;
}
fatalError(3, "Sanity check: Received reply is not XML",
transport.responseText);
return;
- } else {
- init_offline();
- return;
}
}
- if (getURLParam("offline")) {
- return init_offline();
- }
-
var reply = transport.responseXML.getElementsByTagName("error")[0];
if (!reply) {
if (params) {
for (k in params) {
-
var v = params[k];
-
console.log("IP: " + k + " => " + v);
-
- if (db) {
- db.execute("DELETE FROM init_params WHERE key = ?", [k]);
- db.execute("INSERT INTO init_params (key,value) VALUES (?, ?)",
- [k, v]);
- }
}
}