header("Content-Type: application/xml");
print_error_xml(7); exit;
}
-
+
if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds"
&& $op != "rss" && $op != "getUnread") {
container.innerHTML = "<div class=\"loadingPrompt\"><img src=\"images/indicator_white.gif\"> " +
"Loading, please wait...</div>"; */
- notify("Loading, please wait...", true);
+ notify_progress("Loading, please wait...", true);
// xmlhttp.abort();
}
var notify_hide_timerid = false;
-var notify_last_doc = false;
-
-var notify_effect = false;
function hide_notify() {
- if (notify_last_doc) {
- var n = notify_last_doc.getElementById("notify");
+ var n = document.getElementById("notify");
+ if (n) {
n.style.display = "none";
-
-/* if (browser_has_opacity()) {
- if (notify_opacity >= 0) {
- notify_opacity = notify_opacity - 0.1;
- n.style.opacity = notify_opacity;
- notify_hide_timerid = window.setTimeout("hide_notify()", 20);
- } else {
- n.style.display = "none";
- n.style.opacity = 1;
- }
- } else {
- n.style.display = "none";
- } */
}
}
-function notify_real(msg, doc, no_hide, is_err) {
+function notify_real(msg, no_hide, n_type) {
- var n = doc.getElementById("notify");
- var nb = doc.getElementById("notify_body");
+ var n = document.getElementById("notify");
+ var nb = document.getElementById("notify_body");
if (!n || !nb) return;
window.clearTimeout(notify_hide_timerid);
}
- notify_last_doc = doc;
- notify_opacity = 1;
-
if (msg == "") {
if (n.style.display == "block") {
notify_hide_timerid = window.setTimeout("hide_notify()", 0);
n.style.display = "block";
}
- if (is_err) {
+ /* types:
+
+ 1 - generic
+ 2 - progress
+ 3 - error
+ 4 - info
+
+ */
+
+ if (n_type == 1) {
+ n.className = "notify";
+ } else if (n_type == 2) {
+ n.className = "notifyProgress";
+ msg = "<img src='images/indicator_white.gif'> " + msg;
+ } else if (n_type == 3) {
n.className = "notifyError";
-// n.style.backgroundColor = "#ffcccc";
-// n.style.color = "black";
-// n.style.borderColor = "#ff0000";
msg = "<img src='images/sign_excl.png'> " + msg;
- } else {
- n.className = "notify";
-// n.style.backgroundColor = "#fff7d5";
-// n.style.borderColor = "#d7c47a";
-// n.style.color = "black";
+ } else if (n_type == 4) {
+ n.className = "notifyInfo";
msg = "<img src='images/sign_info.png'> " + msg;
}
}
}
-function p_notify(msg, no_hide, is_err) {
- notify_real(msg, document, no_hide, is_err);
+function notify(msg, no_hide) {
+ notify_real(msg, no_hide, 1);
}
-function notify(msg, no_hide, is_err) {
- notify_real(msg, document, no_hide, is_err);
+function notify_progress(msg, no_hide) {
+ notify_real(msg, no_hide, 2);
+}
+
+function notify_error(msg, no_hide) {
+ notify_real(msg, no_hide, 3);
+
+}
+
+function notify_info(msg, no_hide) {
+ notify_real(msg, no_hide, 4);
}
function printLockingError() {
- notify("Please wait until operation finishes");}
+ notify_info("Please wait until operation finishes.");
+}
function hotkey_handler(e) {
function parse_counters_reply(xmlhttp, scheduled_call) {
if (!xmlhttp.responseXML) {
- notify("refetch_callback: backend did not return valid XML", true, true);
+ notify_error("Backend did not return valid XML", true);
return;
}
var reply = xmlhttp.responseXML.firstChild;
if (!reply) {
- notify("refetch_callback: backend did not return expected XML object", true, true);
+ notify_error("Backend did not return expected XML object", true);
updateTitle("");
return;
}
}
} catch (e) { }
- notify(xmlhttp.responseText);
+// notify_info(xmlhttp.responseText);
}
}
return false;
}
- notify("Adding feed...", true);
+ notify_progress("Adding feed...");
closeInfoBox();
var fe = document.getElementById("fatal_error");
var fc = document.getElementById("fatal_error_msg");
- fc.innerHTML = "Code " + code + ": " + message;
+ if (message == "") message = "Unknown error";
+
+ fc.innerHTML = "<img src='images/sign_excl.png'> " + message + " (Code " + code + ")";
fe.style.display = "block";
}
try {
if (xmlhttp_ready(xmlhttp_rpc)) {
- notify("Logging out, please wait...");
+ notify_progress("Logging out, please wait...", true);
xmlhttp_rpc.open("GET", "backend.php?op=rpc&subop=logout", true);
xmlhttp_rpc.onreadystatechange=logout_callback;
function notify_callback() {
- var container = document.getElementById('notify');
if (xmlhttp.readyState == 4) {
- container.innerHTML=xmlhttp.responseText;
- }
+ notify_info(xmlhttp.responseText);
+ }
}
function updateFeedList(sort_key) {
} else if (!isValidURL(link.value)) {
alert("Error: Invalid feed URL.");
} else {
- notify("Adding feed...");
+ notify_progress("Adding feed...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&from=tt-rss&feed_url=" +
param_escape(link.value), true);
if (cat.value.length == 0) {
alert("Can't add category: no name specified.");
} else {
- notify("Adding feed category...");
+ notify_progress("Adding feed category...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" +
param_escape(cat.value), true);
if (sqlexp.value.length == 0) {
alert("Can't add user: no login specified.");
} else {
- notify("Adding user...");
+ notify_progress("Adding user...");
xmlhttp.open("GET", "backend.php?op=pref-users&subop=add&login=" +
param_escape(sqlexp.value), true);
var ok = confirm("Remove selected labels?");
if (ok) {
- notify("Removing selected labels...");
+ notify_progress("Removing selected labels...");
xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
param_escape(sel_rows.toString()), true);
var ok = confirm("Remove selected users?");
if (ok) {
- notify("Removing selected users...");
+ notify_progress("Removing selected users...");
xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
param_escape(sel_rows.toString()), true);
var ok = confirm("Remove selected filters?");
if (ok) {
- notify("Removing selected filters...");
+ notify_progress("Removing selected filters...");
xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
param_escape(sel_rows.toString()), true);
if (ok) {
- notify("Unsubscribing from selected feeds...");
+ notify_progress("Unsubscribing from selected feeds...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
param_escape(sel_rows.toString()), true);
var ok = confirm("Remove selected categories?");
if (ok) {
- notify("Removing selected categories...");
+ notify_progress("Removing selected categories...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+
param_escape(sel_rows.toString()), true);
var query = Form.serialize("edit_feed_form");
- notify("Saving feed...");
+ notify_progress("Saving feed...");
xmlhttp.open("POST", "backend.php", true);
xmlhttp.onreadystatechange=feedlist_callback;
return
}
- notify("Saving category...");
+ notify_progress("Saving category...");
var query = Form.serialize("feed_cat_edit_form");
closeInfoBox();
- notify("Saving label...");
+ notify_progress("Saving label...");
active_label = false;
return;
}
- notify("Saving user...");
+ notify_progress("Saving user...");
closeInfoBox();
}
} */
- notify("Saving filter...");
+ notify_progress("Saving filter...");
var query = Form.serialize("filter_edit_form");
var ok = confirm("Reset password of selected user?");
if (ok) {
- notify("Resetting password for selected user...");
+ notify_progress("Resetting password for selected user...");
var id = rows[0];
}
if (rows.length > 1) {
- notify("Please select only one feed.");
+ alert("Please select only one feed.");
return;
}
var rows = getSelectedFeeds();
if (rows.length == 0) {
- notify("No feeds are selected.");
+ alert("No feeds are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one feed.");
+ alert("Please select one feed.");
return;
}
debug("selectTab: " + id + "(NU: " + noupdate + ")");
-// notify("Loading, please wait...", true);
+ notify_progress("Loading, please wait...", true);
// close active infobox if needed
closeInfoBox();
if (sel_rows.length > 0) {
- notify("Changing category of selected feeds...");
+ notify_progress("Changing category of selected feeds...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
param_escape(sel_rows.toString()) + "&cat_id=" + param_escape(cat_id), true);
vertical-align : middle;
}
+.notifyProgress {
+ border-color : #d7c47a;
+ background-color : #fff7d5;
+ color : black;
+}
+
+.notifyInfo {
+ border-color : #7AD78E;
+ background-color : #D5FFDB;
+ color : black;
+}
+
.notify {
border-color : #d7c47a;
background-color : #fff7d5;
}
#fatal_error_msg {
- border : 1px solid #c0c0c0;
- background-color : #f0f0f0;
color : black;
padding : 10px;
font-weight : normal;
+ background-color : #ffcccc;
+ border : 1px solid #ff0000;
}
#fatal_error_msg a {
text-decoration : underline;
}
+#fatal_error_msg img {
+ vertical-align : middle;
+}
+
#noDaemonWarning {
position : absolute;
background-color : #ecf4ff;
p.innerHTML = "display tags";
}
- notify("Loading, please wait...");
+ notify_progress("Loading, please wait...");
updateFeedList();
}
debug("refetch_callback: done");
if (!daemon_enabled && !daemon_refresh_only) {
- notify("All feeds updated.");
+ notify_info("All feeds updated.");
updateTitle("");
} else {
//notify("");
function scheduleFeedUpdate(force) {
if (!daemon_enabled && !daemon_refresh_only) {
- notify("Updating feeds, please wait.", true);
+ notify_progress("Updating feeds, please wait.", true);
updateTitle("Updating");
}
var query_str = "backend.php?op=feeds&subop=catchupAll";
- notify("Marking all feeds as read...");
+ notify_progress("Marking all feeds as read...");
debug("catchupAllFeeds Q=" + query_str);
function qfdDelete(feed_id) {
- notify("Removing feed...");
+ notify_progress("Removing feed...");
if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
}
if (k == "daemon_is_running" && v != 1) {
- notify("<span onclick=\"javascript:explainError(1)\">Update daemon is not runing.</span>", true, true);
+ notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not runing.</span>");
}
/* var w = document.getElementById("noDaemonWarning");
var query = Form.serialize("edit_feed_form");
- notify("Saving feed...");
+ notify_progress("Saving feed...");
xmlhttp.open("POST", "backend.php", true);
xmlhttp.onreadystatechange=dlg_frefresh_callback;
}
} else {
- notify("No operation to undo");
+ notify_error("No operation to undo");
}
return false;
printLockingError();
}
- notify("Saving article tags...");
+ notify_progress("Saving article tags...");
var form = document.forms["tag_edit_form"];