return navigator.userAgent.match("Opera");
}
+function is_khtml() {
+ return navigator.userAgent.match("KHTML");
+}
+
+function is_safari() {
+ return navigator.userAgent.match("Safari");
+}
+
function exception_error(location, e, silent) {
var msg;
return obj.readyState == 4 || obj.readyState == 0 || !obj.readyState;
}
+function logout_callback() {
+ var container = document.getElementById('notify');
+ if (xmlhttp.readyState == 4) {
+ try {
+ window.location.reload(true);
+ } catch (e) {
+ exception_error("logout_callback", e);
+ }
+ }
+}
+
function notify_callback() {
var container = document.getElementById('notify');
if (xmlhttp.readyState == 4) {
if (new_feed) viewfeed(new_feed, '');
}
- if (keycode == 78 || keycode == 40) { // n, down
+ if (!is_safari() && (keycode == 78 || keycode == 40)) { // n, down
if (typeof moveToPost != 'undefined') {
return moveToPost('next');
}
}
- if (keycode == 80 || keycode == 38) { // p, up
+ if (!is_safari() && (keycode == 80 || keycode == 38)) { // p, up
if (typeof moveToPost != 'undefined') {
return moveToPost('prev');
}
viewFeedGoPage(0);
}
- if (keycode == 69 && shift_key) {
+ if (keycode == 69 && shift_key) { // e
return editFeedDlg(getActiveFeedId());
}
+ if (keycode == 70 && shift_key) { // f
+ if (getActiveFeedId()) {
+ return catchupCurrentFeed();
+ }
+ }
+
+ if (keycode == 80 && shift_key) { // p
+ if (getActiveFeedId()) {
+ return catchupPage();
+ }
+ }
+
if (typeof localHotkeyHandler != 'undefined') {
try {
return localHotkeyHandler(e);
debug("update_all_counters QUERY: " + query);
+ var date = new Date();
+ var timestamp = Math.round(date.getTime() / 1000);
+ query = query + "&ts=" + timestamp
+
xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null);
function fatalError(code, message) {
try {
- if (code != 6) {
-
+ if (code == 6) {
+ //window.location.href = "login.php?rt=none";
+ } else if (code == 5) {
+ window.location.href = "update.php";
+ } else {
var fe = document.getElementById("fatal_error");
var fc = document.getElementById("fatal_error_msg");
fc.innerHTML = "Code " + code + ": " + message;
fe.style.display = "block";
- } else {
- window.location.href = "login.php?rt=none";
}
} catch (e) {
function explainError(code) {
return displayDlg("explainError", code);
}
+
+function logoutUser() {
+ try {
+ if (xmlhttp_ready(xmlhttp_rpc)) {
+ xmlhttp_rpc.open("GET", "backend.php?op=rpc&subop=logout", true);
+ xmlhttp_rpc.onreadystatechange=logout_callback;
+ xmlhttp_rpc.send(null);
+ } else {
+ printLockingError();
+ }
+ } catch (e) {
+ exception_error("logoutUser", e);
+ }
+}