From a4dbc5247a35661f746f0f012c08a13db65713ee Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 Aug 2006 08:28:10 +0100 Subject: rework label editor from inline to infobox --- prefs.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'prefs.js') diff --git a/prefs.js b/prefs.js index 11743d2cc..28e54ee4f 100644 --- a/prefs.js +++ b/prefs.js @@ -82,6 +82,14 @@ function labellist_callback() { } } +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) { @@ -309,9 +317,12 @@ function editLabel(id) { active_label = id; + selectTableRowsByIdPrefix('prefLabelList', 'LILRR-', 'LICHK-', false); + selectTableRowById('LILRR-'+id, 'LICHK-'+id, true); + xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" + param_escape(id), true); - xmlhttp.onreadystatechange=labellist_callback; + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); } @@ -663,6 +674,10 @@ function feedCatEditSave() { function labelTest() { + var container = document.getElementById('label_test_result'); + container.style.display = "block"; + container.innerHTML = "

Loading, please wait...

"; + var form = document.forms['label_edit_form']; var sql_exp = form.sql_exp.value; @@ -671,7 +686,7 @@ function labelTest() { xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" + param_escape(sql_exp) + "&descr=" + param_escape(description), true); - xmlhttp.onreadystatechange=infobox_callback; + xmlhttp.onreadystatechange=labeltest_callback; xmlhttp.send(null); return false; @@ -696,14 +711,9 @@ function labelEditCancel() { active_label = false; -// notify("Operation cancelled."); - + selectPrefRows('label', false); // cleanup feed selection closeInfoBox(); - xmlhttp.open("GET", "backend.php?op=pref-labels", true); - xmlhttp.onreadystatechange=labellist_callback; - xmlhttp.send(null); - return false; } @@ -1452,7 +1462,7 @@ function selectPrefRows(kind, select) { } else if (kind == "label") { opbarid = "labelOpToolbar"; nrow = "LILRR-"; - nchk = "LCHK-"; + nchk = "LICHK-"; lname = "prefLabelList"; } else if (kind == "user") { opbarid = "userOpToolbar"; -- cgit v1.2.3