element.style.left = (pw/2) - (w/2) - Position.deltaX + "px";
}
+function labeltest_callback() {
+ var container = document.getElementById('label_test_result');
+ if (xmlhttp.readyState == 4) {
+ container.innerHTML=xmlhttp.responseText;
+ notify("");
+ }
+}
+
+function labelTest() {
+
+ var container = document.getElementById('label_test_result');
+ container.style.display = "block";
+ container.innerHTML = "<p>Loading, please wait...</p>";
+
+ var form = document.forms['label_edit_form'];
+
+ var sql_exp = form.sql_exp.value;
+ var description = form.description.value;
+
+ xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
+ param_escape(sql_exp) + "&descr=" + param_escape(description), true);
+
+ xmlhttp.onreadystatechange=labeltest_callback;
+ xmlhttp.send(null);
+
+ return false;
+}
+
}
}
-function labeltest_callback() {
- var container = document.getElementById('label_test_result');
- if (xmlhttp.readyState == 4) {
- container.innerHTML=xmlhttp.responseText;
- notify("");
- }
-}
-
function feed_browser_callback() {
var container = document.getElementById('prefContent');
if (xmlhttp.readyState == 4) {
}
-function labelTest() {
-
- var container = document.getElementById('label_test_result');
- container.style.display = "block";
- container.innerHTML = "<p>Loading, please wait...</p>";
-
- var form = document.forms['label_edit_form'];
-
- var sql_exp = form.sql_exp.value;
- var description = form.description.value;
-
- xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
- param_escape(sql_exp) + "&descr=" + param_escape(description), true);
-
- xmlhttp.onreadystatechange=labeltest_callback;
- xmlhttp.send(null);
-
- return false;
-}
function displayHelpInfobox(topic_id) {
return;
}
- if (feed <= 0 || activeFeedIsCat() || tagsAreDisplayed()) {
+ if ((feed <= 0 && feed > -10) || activeFeedIsCat() || tagsAreDisplayed()) {
alert(__("You can't edit this kind of feed."));
return;
}
if (xmlhttp_ready(xmlhttp)) {
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
- param_escape(feed), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
+
+ if (feed > 0) {
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
+ param_escape(feed), true);
+ xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.send(null);
+ } else {
+ xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" +
+ param_escape(-feed-11), true);
+ xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.send(null);
+ }
} else {
printLockingError();
}
}
}
+function labelEditCancel() {
+ closeInfoBox();
+ return false;
+}
+
+function labelEditSave() {
+
+ try {
+
+ if (!xmlhttp_ready(xmlhttp)) {
+ printLockingError();
+ return
+ }
+
+ closeInfoBox();
+
+ notify_progress("Saving label...");
+
+ query = Form.serialize("label_edit_form");
+
+ xmlhttp.open("GET", "backend.php?" + query, true);
+ xmlhttp.onreadystatechange=dlg_frefresh_callback;
+ xmlhttp.send(null);
+
+ return false;
+
+ } catch (e) {
+ exception_error("feedEditSave (main)", e);
+ }
+
+}