var loading_progress = 0;
var sanity_check_done = false;
var init_params = {};
+var _label_base_index = -1024;
Ajax.Base.prototype.initialize = Ajax.Base.prototype.initialize.wrap(
function (callOriginal, options) {
*/
- if (typeof __ != 'undefined') {
- msg = __(msg);
- }
+ msg = __(msg);
if (n_type == 1) {
n.className = "notify";
} else if (n_type == 2) {
- n.className = "notifyProgress";
+ n.className = "notify progress";
msg = "<img src='images/indicator_white.gif'> " + msg;
} else if (n_type == 3) {
- n.className = "notifyError";
+ n.className = "notify error";
msg = "<img src='images/sign_excl.svg'> " + msg;
} else if (n_type == 4) {
- n.className = "notifyInfo";
+ n.className = "notify info";
msg = "<img src='images/sign_info.svg'> " + msg;
}
-// msg = "<img src='images/live_com_loading.gif'> " + msg;
-
if (no_hide) {
- msg += " (<a href='#' onclick=\"notify('')\">X</a>)";
+ msg += " <span>(<a href='#' onclick=\"notify('')\">" +
+ __("close") + "</a>)</span>";
}
+// msg = "<img src='images/live_com_loading.gif'> " + msg;
+
nb.innerHTML = msg;
if (!no_hide) {
}
-function displayDlg(id, param, callback) {
+function displayDlg(title, id, param, callback) {
notify_progress("Loading, please wait...", true);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function (transport) {
- infobox_callback2(transport);
+ infobox_callback2(transport, title);
if (callback) callback(transport);
} });
return false;
}
-function infobox_callback2(transport) {
+function infobox_callback2(transport, title) {
try {
var dialog = false;
//console.log("infobox_callback2");
notify('');
- var title = transport.responseXML.getElementsByTagName("title")[0];
- if (title)
- title = title.firstChild.nodeValue;
-
- var content = transport.responseXML.getElementsByTagName("content")[0];
-
- content = content.firstChild.nodeValue;
+ var content = transport.responseText;
if (!dialog) {
dialog = new dijit.Dialog({
}
function explainError(code) {
- return displayDlg("explainError", code);
+ return displayDlg(__("Error explained"), "explainError", code);
}
function loading_set_progress(p) {
}
}
-function hideAuxDlg() {
- try {
- Element.hide('auxDlg');
- } catch (e) {
- exception_error("hideAuxDlg", e);
- }
-}
-
-
function uploadIconHandler(rc) {
try {
switch (rc) {
for (k in params) {
var v = params[k];
console.log("IP: " + k + " => " + v);
+
+ if (k == "label_base_index") _label_base_index = parseInt(v);
}
}
return string;
}
+
+
+function label_to_feed_id(label) {
+ return _label_base_index - 1 - Math.abs(label);
+}
+
+function feed_to_label_id(feed) {
+ return _label_base_index - 1 + Math.abs(feed);
+}
+