X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=prefs.js;h=6b772b1cddd7b0a035c95ee5a99d2dff536c4568;hb=729bafaa14466bec1f65caee2dfc3c0638b20f52;hp=626d216a6d9c7892945f9808671bf8f0ac1b3367;hpb=0e317f9d872f538fbf13f81e8a72272ab2c92e84;p=tt-rss.git diff --git a/prefs.js b/prefs.js index 626d216a..6b772b1c 100644 --- a/prefs.js +++ b/prefs.js @@ -31,20 +31,6 @@ function feedlist_callback() { var container = document.getElementById('prefContent'); container.innerHTML=xmlhttp.responseText; selectTab("feedConfig", true); - - if (active_feed_cat) { - var row = document.getElementById("FCATR-" + active_feed_cat); - if (row) { - if (!row.className.match("Selected")) { - row.className = row.className + "Selected"; - } - } - var checkbox = document.getElementById("FCCHK-" + active_feed_cat); - if (checkbox) { - checkbox.checked = true; - } - } - notify(""); } catch (e) { exception_error("feedlist_callback", e); @@ -157,7 +143,7 @@ function updateFeedList(sort_key) { } -function updateUsersList() { +function updateUsersList(sort_key) { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -168,7 +154,8 @@ function updateUsersList() { // p_notify("Loading, please wait..."); - xmlhttp.open("GET", "backend.php?op=pref-users", true); + xmlhttp.open("GET", "backend.php?op=pref-users&sort=" + + param_escape(sort_key), true); xmlhttp.onreadystatechange=userlist_callback; xmlhttp.send(null); @@ -244,9 +231,9 @@ function addFeedCat() { } else { notify("Adding feed category..."); - xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" + + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" + param_escape(cat.value), true); - xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); link.value = ""; @@ -364,9 +351,9 @@ function editFeedCat(cat) { active_feed_cat = cat; - xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" + + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=edit&id=" + param_escape(cat), true); - xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); } @@ -548,9 +535,9 @@ function removeSelectedFeedCats() { if (ok) { notify("Removing selected categories..."); - xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+ + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+ param_escape(sel_rows.toString()), true); - xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); } @@ -588,8 +575,8 @@ function feedCatEditCancel() { // notify("Operation cancelled."); - xmlhttp.open("GET", "backend.php?op=pref-feeds", true); - xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true); + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); return false; @@ -636,7 +623,7 @@ function feedCatEditSave() { var query = Form.serialize("feed_cat_edit_form"); xmlhttp.open("GET", "backend.php?" + query, true); - xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); active_feed_cat = false; @@ -729,7 +716,7 @@ function labelEditSave() { return } - if (!is_opera()) { +/* if (!is_opera()) { var sql_exp = document.forms["label_edit_form"].sql_exp.value; var description = document.forms["label_edit_form"].description.value; @@ -743,7 +730,7 @@ function labelEditSave() { alert("Caption field cannot be blank."); return false; } - } + } */ closeInfoBox(); @@ -795,14 +782,14 @@ function filterEditSave() { return } - if (!is_opera()) { +/* if (!is_opera()) { var reg_exp = document.forms["filter_edit_form"].reg_exp.value; if (reg_exp.length == 0) { alert("Filter expression field cannot be blank."); return; } - } + } */ notify("Saving filter..."); @@ -1083,13 +1070,14 @@ function updateFilterList(sort_key) { // p_notify("Loading, please wait..."); - xmlhttp.open("GET", "backend.php?op=pref-filters&sort=" + param_escape(sort_key), true); + xmlhttp.open("GET", "backend.php?op=pref-filters&sort=" + + param_escape(sort_key), true); xmlhttp.onreadystatechange=filterlist_callback; xmlhttp.send(null); } -function updateLabelList() { +function updateLabelList(sort_key) { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -1100,7 +1088,8 @@ function updateLabelList() { // document.getElementById("prefContent").innerHTML = "Loading labels, please wait..."; - xmlhttp.open("GET", "backend.php?op=pref-labels", true); + xmlhttp.open("GET", "backend.php?op=pref-labels&sort=" + + param_escape(sort_key), true); xmlhttp.onreadystatechange=labellist_callback; xmlhttp.send(null); } @@ -1133,6 +1122,11 @@ function selectTab(id, noupdate) { return } + try { + var c = document.getElementById('prefContent'); + c.scrollTop = 0; + } catch (e) { }; + if (!noupdate) { debug("selectTab: " + id + "(NU: " + noupdate + ")"); @@ -1432,7 +1426,7 @@ function selectPrefRows(kind, select) { } else if (kind == "fcat") { opbarid = "catOpToolbar"; nrow = "FCATR-"; - nchk = "FCHK-"; + nchk = "FCCHK-"; lname = "prefFeedCatList"; } else if (kind == "filter") { opbarid = "filterOpToolbar"; @@ -1534,4 +1528,23 @@ function pref_hotkey_handler(e) { } } +function userSwitch() { + var chooser = document.getElementById("userSwitch"); + var user = chooser[chooser.selectedIndex].value; + window.location = "prefs.php?swu=" + user; +} + +function editFeedCats() { + if (!xmlhttp_ready(xmlhttp)) { + printLockingError(); + return + } + + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true); + xmlhttp.onreadystatechange=infobox_callback; + xmlhttp.send(null); +} +function showFeedsWithErrors() { + displayDlg('feedUpdateErrors'); +}