var init_params = new Array();
var caller_subop = false;
-var sanity_check_done = false;
var hotkey_prefix = false;
var hotkey_prefix_pressed = false;
var selection_disabled = false;
var mouse_is_down = false;
+var db = false;
+var store = false;
+
function feedlist_callback2(transport) {
try {
if (sel_rows.length > 0) {
- var ok = confirm(__("Remove selected users?"));
+ var ok = confirm(__("Remove selected users? Neither default admin nor your account will be removed."));
if (ok) {
notify_progress("Removing selected users...");
var query = "?op=pref-feeds&subop=remove&ids="+
param_escape(sel_rows.toString());
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
var query = "?op=rpc&subop=purge&ids="+
param_escape(sel_rows.toString()) + "&days=" + pr;
- debug(query);
+ console.log(query);
new Ajax.Request("prefs.php", {
parameters: query,
function piggie(enable) {
if (enable) {
- debug("I LOVEDED IT!");
+ console.log("I LOVEDED IT!");
var piggie = $("piggie");
Element.show(piggie);
if (!noupdate) {
- debug("selectTab: " + id + "(NU: " + noupdate + ")");
+ console.log("selectTab: " + id + "(NU: " + noupdate + ")");
notify_progress("Loading, please wait...");
}
}
-function backend_sanity_check_callback2(transport) {
-
- try {
-
- if (sanity_check_done) {
- fatalError(11, "Sanity check request received twice. This can indicate "+
- "presence of Firebug or some other disrupting extension. "+
- "Please disable it and try again.");
- return;
- }
-
- if (!transport.responseXML) {
- fatalError(3, "Sanity Check: Received reply is not XML",
- transport.responseText);
- return;
- }
-
- var reply = transport.responseXML.firstChild.firstChild;
-
- if (!reply) {
- fatalError(3, "Sanity Check: Invalid RPC reply", transport.responseText);
- return;
- }
-
- var error_code = reply.getAttribute("error-code");
-
- if (error_code && error_code != 0) {
- return fatalError(error_code, reply.getAttribute("error-msg"));
- }
-
- debug("sanity check ok");
-
- var params = reply.nextSibling;
-
- if (params) {
- debug('reading init-params...');
- var param = params.firstChild;
-
- while (param) {
- var k = param.getAttribute("key");
- var v = param.getAttribute("value");
- debug(k + " => " + v);
- init_params[k] = v;
- param = param.nextSibling;
- }
- }
-
- sanity_check_done = true;
-
- init_second_stage();
-
- } catch (e) {
- exception_error("backend_sanity_check_callback", e);
- }
-}
-
function init_second_stage() {
try {
if (getURLParam('debug')) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
}
loading_set_progress(30);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- backend_sanity_check_callback2(transport);
+ backend_sanity_check_callback(transport);
} });
} catch (e) {
var query = Form.serialize("pref_prefs_form");
query = query + "&subop=reset-config";
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
}
if (!hotkeys_enabled) {
- debug("hotkeys disabled");
+ console.log("hotkeys disabled");
return;
}
cmdline.innerHTML = keychar;
Element.show(cmdline);
- debug("KP: PREFIX=" + keycode + " CHAR=" + keychar);
+ console.log("KP: PREFIX=" + keycode + " CHAR=" + keychar);
return;
}
if (keycode == 68 && shift_key) { // d
if (!Element.visible("debug_output")) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
} else {
Element.hide("debug_output");
}
}
if ($("piggie")) {
-
- if (seq.match("807371717369")) {
+ if (seq.match("8073717369")) {
seq = "";
piggie(true);
} else {
}
if (hotkey_prefix) {
- debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
} else {
- debug("KP: CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: CODE=" + keycode + " CHAR=" + keychar);
}
} catch (e) {
return false;
}
+function opmlRegenKey() {
+
+ try {
+ var ok = confirm(__("Replace current OPML publishing address with a new one?"));
+
+ if (ok) {
+
+ notify_progress("Trying to change address...", true);
+
+ var query = "?op=rpc&subop=regenOPMLKey";
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ var new_link = transport.responseXML.getElementsByTagName("link")[0];
+
+ var e = $('pub_opml_url');
+
+ if (new_link) {
+ e.href = new_link.firstChild.nodeValue;
+ e.innerHTML = new_link.firstChild.nodeValue;
+
+ new Effect.Highlight(e);
+
+ notify('');
+
+ } else {
+ notify_error("Could not change feed URL.");
+ }
+ } });
+ }
+ } catch (e) {
+ exception_error("opmlRegenKey", e);
+ }
+ return false;
+}
function validatePrefsSave() {
try {
var query = Form.serialize("pref_prefs_form");
query = query + "&subop=save-config";
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,