summaryrefslogtreecommitdiff
path: root/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-18 09:28:42 +0100
committerAndrew Dolgov <[email protected]>2009-01-18 09:28:42 +0100
commitceb30ba49d300d53a0693aba7e1f0e4c523aeedc (patch)
treef914db574e5d19af48c997eaf26dc5ff69de7a64 /prefs.js
parentabd9b16507fd517dc56af1be0d11d7043063ddc5 (diff)
new style labels (bump schema)
Diffstat (limited to 'prefs.js')
-rw-r--r--prefs.js72
1 files changed, 39 insertions, 33 deletions
diff --git a/prefs.js b/prefs.js
index 88ebc3ee3..d78e3b9d7 100644
--- a/prefs.js
+++ b/prefs.js
@@ -135,28 +135,36 @@ function filterlist_callback() {
}
function labellist_callback() {
- var container = document.getElementById('prefContent');
- if (xmlhttp.readyState == 4) {
- closeInfoBox();
- container.innerHTML=xmlhttp.responseText;
- if (active_label) {
- var row = document.getElementById("LILRR-" + active_label);
- if (row) {
- if (!row.className.match("Selected")) {
- row.className = row.className + "Selected";
- }
+
+ try {
+
+ var container = document.getElementById('prefContent');
+ if (xmlhttp.readyState == 4) {
+ closeInfoBox();
+ container.innerHTML=xmlhttp.responseText;
+
+ if (document.getElementById("prefLabelList")) {
+ var elems = document.getElementById("prefLabelList").getElementsByTagName("SPAN");
+
+ for (var i = 0; i < elems.length; i++) {
+ if (elems[i].id && elems[i].id.match("LILT-")) {
+
+ var id = elems[i].id.replace("LILT-", "");
+ new Ajax.InPlaceEditor(elems[i],
+ 'backend.php?op=pref-labels&subop=save&id=' + id);
+ }
+ }
}
- var checkbox = document.getElementById("LICHK-" + active_label);
-
- if (checkbox) {
- checkbox.checked = true;
+
+ if (typeof correctPNG != 'undefined') {
+ correctPNG();
}
+ notify("");
+ remove_splash();
}
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
- notify("");
- remove_splash();
+
+ } catch (e) {
+ exception_error("labellist_callback", e);
}
}
@@ -304,34 +312,32 @@ function updateUsersList(sort_key) {
function addLabel() {
+ try {
+
if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
- var form = document.forms['label_edit_form'];
+ var caption = prompt(__("Please enter label caption:"), "");
- var sql_exp = form.sql_exp.value;
- var description = form.description.value;
-
- if (sql_exp == "") {
- alert(__("Can't create label: missing SQL expression."));
- return false;
- }
-
- if (description == "") {
+ if (caption == "") {
alert(__("Can't create label: missing caption."));
return false;
}
- var query = Form.serialize("label_edit_form");
-
// we can be called from some other tab
active_tab = "labelConfig";
+ var query = "caption=" + param_escape(caption);
+
xmlhttp.open("GET", "backend.php?op=pref-labels&subop=add&" + query, true);
xmlhttp.onreadystatechange=infobox_submit_callback;
xmlhttp.send(null);
+
+ } catch (e) {
+ exception_error("addLabel", e);
+ }
}
function addFeed() {
@@ -1834,10 +1840,10 @@ function pref_hotkey_handler(e) {
return false;
}
- if (keycode == 76) { // l
+/* if (keycode == 76) { // l
displayDlg("quickAddLabel");
return false;
- }
+ } */
if (keycode == 85) { // u
// no-op