3 var active_feed = false;
4 var active_feed_cat = false;
5 var active_filter = false;
6 var active_label = false;
7 var active_user = false;
9 var active_tab = false;
12 /*@if (@_jscript_version >= 5)
13 // JScript gives us Conditional compilation, we can cope with old IE versions.
14 // and security blocked creation of the objects.
16 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
19 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
26 if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
27 xmlhttp = new XMLHttpRequest();
30 function feedlist_callback() {
31 if (xmlhttp.readyState == 4) {
33 var container = document.getElementById('prefContent');
34 container.innerHTML=xmlhttp.responseText;
36 var row = document.getElementById("FEEDR-" + active_feed);
38 if (!row.className.match("Selected")) {
39 row.className = row.className + "Selected";
42 var checkbox = document.getElementById("FRCHK-" + active_feed);
44 checkbox.checked = true;
49 exception_error("feedlist_callback", e);
54 function filterlist_callback() {
55 var container = document.getElementById('prefContent');
56 if (xmlhttp.readyState == 4) {
58 container.innerHTML=xmlhttp.responseText;
61 var row = document.getElementById("FILRR-" + active_filter);
63 if (!row.className.match("Selected")) {
64 row.className = row.className + "Selected";
67 var checkbox = document.getElementById("FICHK-" + active_filter);
70 checkbox.checked = true;
77 function labellist_callback() {
78 var container = document.getElementById('prefContent');
79 if (xmlhttp.readyState == 4) {
80 container.innerHTML=xmlhttp.responseText;
83 var row = document.getElementById("LILRR-" + active_label);
85 if (!row.className.match("Selected")) {
86 row.className = row.className + "Selected";
89 var checkbox = document.getElementById("LICHK-" + active_label);
92 checkbox.checked = true;
99 function userlist_callback() {
100 var container = document.getElementById('prefContent');
101 if (xmlhttp.readyState == 4) {
102 container.innerHTML=xmlhttp.responseText;
105 var row = document.getElementById("UMRR-" + active_user);
107 if (!row.className.match("Selected")) {
108 row.className = row.className + "Selected";
111 var checkbox = document.getElementById("UMCHK-" + active_user);
114 checkbox.checked = true;
122 function infobox_callback() {
123 if (xmlhttp.readyState == 4) {
124 var box = document.getElementById('infoBox');
125 var shadow = document.getElementById('infoBoxShadow');
128 box.innerHTML=xmlhttp.responseText;
130 shadow.style.display = "block";
132 box.style.display = "block";
139 function prefslist_callback() {
140 var container = document.getElementById('prefContent');
141 if (xmlhttp.readyState == 4) {
143 container.innerHTML=xmlhttp.responseText;
149 function gethelp_callback() {
150 var container = document.getElementById('prefHelpBox');
151 if (xmlhttp.readyState == 4) {
153 container.innerHTML = xmlhttp.responseText;
154 container.style.display = "block";
160 function notify_callback() {
161 var container = document.getElementById('notify');
162 if (xmlhttp.readyState == 4) {
163 container.innerHTML=xmlhttp.responseText;
167 function updateFeedList(sort_key) {
169 if (!xmlhttp_ready(xmlhttp)) {
174 // document.getElementById("prefContent").innerHTML = "Loading feeds, please wait...";
176 p_notify("Loading, please wait...");
178 var feed_search = document.getElementById("feed_search");
180 if (feed_search) { search = feed_search.value; }
182 xmlhttp.open("GET", "backend.php?op=pref-feeds" +
183 "&sort=" + param_escape(sort_key) +
184 "&search=" + param_escape(search), true);
185 xmlhttp.onreadystatechange=feedlist_callback;
190 function updateUsersList() {
192 if (!xmlhttp_ready(xmlhttp)) {
197 // document.getElementById("prefContent").innerHTML = "Loading feeds, please wait...";
199 p_notify("Loading, please wait...");
201 xmlhttp.open("GET", "backend.php?op=pref-users", true);
202 xmlhttp.onreadystatechange=userlist_callback;
207 function addLabel() {
209 if (!xmlhttp_ready(xmlhttp)) {
214 var sqlexp = document.getElementById("ladd_expr");
216 if (sqlexp.value.length == 0) {
217 notify("Missing SQL expression.");
219 notify("Adding label...");
221 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=add&exp=" +
222 param_escape(sqlexp.value), true);
224 xmlhttp.onreadystatechange=labellist_callback;
232 function addFilter() {
234 if (!xmlhttp_ready(xmlhttp)) {
239 var regexp = document.getElementById("fadd_regexp");
240 var match = document.getElementById("fadd_match");
241 var feed = document.getElementById("fadd_feed");
242 var action = document.getElementById("fadd_action");
244 if (regexp.value.length == 0) {
245 notify("Missing filter expression.");
247 notify("Adding filter...");
249 var v_match = match[match.selectedIndex].text;
250 var feed_id = feed[feed.selectedIndex].id;
251 var action_id = action[action.selectedIndex].id;
253 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=add®exp=" +
254 param_escape(regexp.value) + "&match=" + v_match +
255 "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
257 xmlhttp.onreadystatechange=filterlist_callback;
267 if (!xmlhttp_ready(xmlhttp)) {
272 var link = document.getElementById("fadd_link");
274 if (link.value.length == 0) {
275 notify("Missing feed URL.");
277 notify("Adding feed...");
279 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&link=" +
280 param_escape(link.value), true);
281 xmlhttp.onreadystatechange=feedlist_callback;
290 function addFeedCat() {
292 if (!xmlhttp_ready(xmlhttp)) {
297 var cat = document.getElementById("fadd_cat");
299 if (cat.value.length == 0) {
300 notify("Missing feed category.");
302 notify("Adding feed category...");
304 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" +
305 param_escape(cat.value), true);
306 xmlhttp.onreadystatechange=feedlist_callback;
316 if (!xmlhttp_ready(xmlhttp)) {
321 var sqlexp = document.getElementById("uadd_box");
323 if (sqlexp.value.length == 0) {
324 notify("Missing user login.");
326 notify("Adding user...");
328 xmlhttp.open("GET", "backend.php?op=pref-users&subop=add&login=" +
329 param_escape(sqlexp.value), true);
331 xmlhttp.onreadystatechange=userlist_callback;
339 function editLabel(id) {
341 if (!xmlhttp_ready(xmlhttp)) {
348 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" +
349 param_escape(id), true);
350 xmlhttp.onreadystatechange=labellist_callback;
355 function editUser(id) {
357 if (!xmlhttp_ready(xmlhttp)) {
364 xmlhttp.open("GET", "backend.php?op=pref-users&subop=edit&id=" +
365 param_escape(id), true);
366 xmlhttp.onreadystatechange=userlist_callback;
371 function editFilter(id) {
373 if (!xmlhttp_ready(xmlhttp)) {
380 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" +
381 param_escape(id), true);
382 xmlhttp.onreadystatechange=filterlist_callback;
387 function editFeed(feed) {
389 // notify("Editing feed...");
391 if (!xmlhttp_ready(xmlhttp)) {
398 /* xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=edit&id=" +
399 param_escape(feed), true);
400 xmlhttp.onreadystatechange=feedlist_callback;
401 xmlhttp.send(null); */
403 selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false);
404 // selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-'+feed, 'FRCHK-'+feed,
407 selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
409 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
410 param_escape(active_feed), true);
412 xmlhttp.onreadystatechange=infobox_callback;
417 function editFeedCat(cat) {
419 if (!xmlhttp_ready(xmlhttp)) {
424 active_feed_cat = cat;
426 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" +
427 param_escape(cat), true);
428 xmlhttp.onreadystatechange=feedlist_callback;
433 function getSelectedLabels() {
434 return getSelectedTableRowIds("prefLabelList", "LILRR");
437 function getSelectedUsers() {
438 return getSelectedTableRowIds("prefUserList", "UMRR");
441 function getSelectedFeeds() {
442 return getSelectedTableRowIds("prefFeedList", "FEEDR");
445 function getSelectedFilters() {
446 return getSelectedTableRowIds("prefFilterList", "FILRR");
449 function getSelectedFeedCats() {
450 return getSelectedTableRowIds("prefFeedCatList", "FCATR");
454 function readSelectedFeeds(read) {
456 if (!xmlhttp_ready(xmlhttp)) {
461 var sel_rows = getSelectedFeeds();
463 if (sel_rows.length > 0) {
471 notify("Marking selected feeds as " + op + "...");
473 xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=" + op + "&ids="+
474 param_escape(sel_rows.toString()), true);
475 xmlhttp.onreadystatechange=notify_callback;
480 notify("Please select some feeds first.");
485 function removeSelectedLabels() {
487 if (!xmlhttp_ready(xmlhttp)) {
492 var sel_rows = getSelectedLabels();
494 if (sel_rows.length > 0) {
496 var ok = confirm("Remove selected labels?");
499 notify("Removing selected labels...");
501 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=remove&ids="+
502 param_escape(sel_rows.toString()), true);
503 xmlhttp.onreadystatechange=labellist_callback;
507 notify("Please select some labels first.");
511 function removeSelectedUsers() {
513 if (!xmlhttp_ready(xmlhttp)) {
518 var sel_rows = getSelectedUsers();
520 if (sel_rows.length > 0) {
522 var ok = confirm("Remove selected users?");
525 notify("Removing selected users...");
527 xmlhttp.open("GET", "backend.php?op=pref-users&subop=remove&ids="+
528 param_escape(sel_rows.toString()), true);
529 xmlhttp.onreadystatechange=userlist_callback;
534 notify("Please select some labels first.");
538 function removeSelectedFilters() {
540 if (!xmlhttp_ready(xmlhttp)) {
545 var sel_rows = getSelectedFilters();
547 if (sel_rows.length > 0) {
549 var ok = confirm("Remove selected filters?");
552 notify("Removing selected filters...");
554 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
555 param_escape(sel_rows.toString()), true);
556 xmlhttp.onreadystatechange=filterlist_callback;
560 notify("Please select some filters first.");
565 function removeSelectedFeeds() {
567 if (!xmlhttp_ready(xmlhttp)) {
572 var sel_rows = getSelectedFeeds();
574 if (sel_rows.length > 0) {
576 var ok = confirm("Remove selected feeds?");
580 notify("Removing selected feeds...");
582 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
583 param_escape(sel_rows.toString()), true);
584 xmlhttp.onreadystatechange=feedlist_callback;
590 notify("Please select some feeds first.");
596 function removeSelectedFeedCats() {
598 if (!xmlhttp_ready(xmlhttp)) {
603 var sel_rows = getSelectedFeedCats();
605 if (sel_rows.length > 0) {
607 var ok = confirm("Remove selected categories?");
610 notify("Removing selected categories...");
612 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
613 param_escape(sel_rows.toString()), true);
614 xmlhttp.onreadystatechange=feedlist_callback;
620 notify("Please select some feeds first.");
626 function feedEditCancel() {
628 if (!xmlhttp_ready(xmlhttp)) {
637 notify("Operation cancelled.");
639 /* xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
640 xmlhttp.onreadystatechange=feedlist_callback;
641 xmlhttp.send(null); */
645 function feedCatEditCancel() {
647 if (!xmlhttp_ready(xmlhttp)) {
652 active_feed_cat = false;
654 notify("Operation cancelled.");
656 xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
657 xmlhttp.onreadystatechange=feedlist_callback;
662 function feedEditSave() {
666 var feed = active_feed;
668 if (!xmlhttp_ready(xmlhttp)) {
673 var link = document.getElementById("iedit_link").value;
674 var title = document.getElementById("iedit_title").value;
675 var upd_intl = document.getElementById("iedit_updintl").value;
676 var purge_intl = document.getElementById("iedit_purgintl").value;
677 var fcat = document.getElementById("iedit_fcat");
679 var private = document.getElementById("iedit_private").checked;
684 fcat_id = fcat[fcat.selectedIndex].id;
687 var pfeed = document.getElementById("iedit_parent_feed");
688 var parent_feed_id = pfeed[pfeed.selectedIndex].id;
690 if (link.length == 0) {
691 notify("Feed link cannot be blank.");
695 if (title.length == 0) {
696 notify("Feed title cannot be blank.");
700 var auth_login = document.getElementById("iedit_login").value;
701 var auth_pass = document.getElementById("iedit_pass").value;
705 notify("Saving feed...");
707 var query = "op=pref-feeds&subop=editSave&id=" +
708 feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) +
709 "&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl) +
710 "&catid=" + param_escape(fcat_id) + "&login=" + param_escape(auth_login) +
711 "&pfeed=" + param_escape(parent_feed_id) + "&pass=" + param_escape(auth_pass) +
712 "&private=" + param_escape(private);
714 xmlhttp.open("POST", "backend.php", true);
715 xmlhttp.onreadystatechange=feedlist_callback;
716 xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
720 exception_error("feedEditSave", e);
724 function feedCatEditSave() {
726 if (!xmlhttp_ready(xmlhttp)) {
731 notify("Saving category...");
733 var cat_title = document.getElementById("iedit_title").value;
735 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" +
736 param_escape(active_feed_cat) + "&title=" + param_escape(cat_title),
738 xmlhttp.onreadystatechange=feedlist_callback;
741 active_feed_cat = false;
746 function labelTest() {
748 var sqlexp = document.getElementById("iedit_expr").value;
749 var descr = document.getElementById("iedit_descr").value;
751 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
752 param_escape(sqlexp) + "&descr=" + param_escape(descr), true);
754 xmlhttp.onreadystatechange=infobox_callback;
759 function displayHelpInfobox(topic_id) {
761 xmlhttp.open("GET", "backend.php?op=help&tid=" +
762 param_escape(topic_id) + "&noheaders=1", true);
764 xmlhttp.onreadystatechange=infobox_callback;
769 function labelEditCancel() {
771 if (!xmlhttp_ready(xmlhttp)) {
776 active_label = false;
778 notify("Operation cancelled.");
780 xmlhttp.open("GET", "backend.php?op=pref-labels", true);
781 xmlhttp.onreadystatechange=labellist_callback;
786 function userEditCancel() {
788 if (!xmlhttp_ready(xmlhttp)) {
795 notify("Operation cancelled.");
797 xmlhttp.open("GET", "backend.php?op=pref-users", true);
798 xmlhttp.onreadystatechange=userlist_callback;
803 function filterEditCancel() {
805 if (!xmlhttp_ready(xmlhttp)) {
810 active_filter = false;
812 notify("Operation cancelled.");
814 xmlhttp.open("GET", "backend.php?op=pref-filters", true);
815 xmlhttp.onreadystatechange=filterlist_callback;
820 function labelEditSave() {
822 var label = active_label;
824 if (!xmlhttp_ready(xmlhttp)) {
829 var sqlexp = document.getElementById("iedit_expr").value;
830 var descr = document.getElementById("iedit_descr").value;
832 // notify("Saving label " + sqlexp + ": " + descr);
834 if (sqlexp.length == 0) {
835 notify("SQL expression cannot be blank.");
839 if (descr.length == 0) {
840 notify("Caption cannot be blank.");
844 notify("Saving label...");
846 active_label = false;
848 xmlhttp.open("GET", "backend.php?op=pref-labels&subop=editSave&id=" +
849 label + "&s=" + param_escape(sqlexp) + "&d=" + param_escape(descr),
852 xmlhttp.onreadystatechange=labellist_callback;
857 function userEditSave() {
859 var user = active_user;
861 if (!xmlhttp_ready(xmlhttp)) {
866 var login = document.getElementById("iedit_ulogin").value;
867 var level = document.getElementById("iedit_ulevel").value;
868 var email = document.getElementById("iedit_email").value;
870 if (login.length == 0) {
871 notify("Login cannot be blank.");
875 if (level.length == 0) {
876 notify("User level cannot be blank.");
882 notify("Saving user...");
884 xmlhttp.open("GET", "backend.php?op=pref-users&subop=editSave&id=" +
885 user + "&l=" + param_escape(login) + "&al=" + param_escape(level) +
886 "&e=" + param_escape(email), true);
888 xmlhttp.onreadystatechange=userlist_callback;
894 function filterEditSave() {
896 var filter = active_filter;
898 if (!xmlhttp_ready(xmlhttp)) {
903 var regexp = document.getElementById("iedit_regexp").value;
904 var descr = document.getElementById("iedit_descr").value;
905 var match = document.getElementById("iedit_match");
907 var v_match = match[match.selectedIndex].text;
909 var feed = document.getElementById("iedit_feed");
910 var feed_id = feed[feed.selectedIndex].id;
912 var action = document.getElementById("iedit_filter_action");
913 var action_id = action[action.selectedIndex].id;
915 // notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match);
917 if (regexp.length == 0) {
918 notify("Filter expression cannot be blank.");
922 active_filter = false;
924 xmlhttp.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
925 filter + "&r=" + param_escape(regexp) + "&d=" + param_escape(descr) +
926 "&m=" + param_escape(v_match) + "&fid=" + param_escape(feed_id) +
927 "&aid=" + param_escape(action_id), true);
929 notify("Saving filter...");
931 xmlhttp.onreadystatechange=filterlist_callback;
936 function editSelectedLabel() {
937 var rows = getSelectedLabels();
939 if (rows.length == 0) {
940 notify("No labels are selected.");
944 if (rows.length > 1) {
945 notify("Please select one label.");
955 function editSelectedUser() {
956 var rows = getSelectedUsers();
958 if (rows.length == 0) {
959 notify("No users are selected.");
963 if (rows.length > 1) {
964 notify("Please select one user.");
973 function resetSelectedUserPass() {
974 var rows = getSelectedUsers();
976 if (rows.length == 0) {
977 notify("No users are selected.");
981 if (rows.length > 1) {
982 notify("Please select one user.");
986 var ok = confirm("Reset password of selected user?");
989 notify("Resetting password for selected user...");
993 xmlhttp.open("GET", "backend.php?op=pref-users&subop=resetPass&id=" +
994 param_escape(id), true);
995 xmlhttp.onreadystatechange=userlist_callback;
1000 function selectedUserDetails() {
1002 if (!xmlhttp_ready(xmlhttp)) {
1003 printLockingError();
1007 var rows = getSelectedUsers();
1009 if (rows.length == 0) {
1010 notify("No users are selected.");
1014 if (rows.length > 1) {
1015 notify("Please select one user.");
1023 xmlhttp.open("GET", "backend.php?op=user-details&id=" + id, true);
1024 xmlhttp.onreadystatechange=infobox_callback;
1029 function selectedFeedDetails() {
1031 if (!xmlhttp_ready(xmlhttp)) {
1032 printLockingError();
1036 var rows = getSelectedFeeds();
1038 if (rows.length == 0) {
1039 notify("No feeds are selected.");
1043 // if (rows.length > 1) {
1044 // notify("Please select one feed.");
1048 // var id = rows[0];
1052 xmlhttp.open("GET", "backend.php?op=feed-details&id=" +
1053 param_escape(rows.toString()), true);
1054 xmlhttp.onreadystatechange=infobox_callback;
1059 function editSelectedFilter() {
1060 var rows = getSelectedFilters();
1062 if (rows.length == 0) {
1063 notify("No filters are selected.");
1067 if (rows.length > 1) {
1068 notify("Please select one filter.");
1074 editFilter(rows[0]);
1079 function editSelectedFeed() {
1080 var rows = getSelectedFeeds();
1082 if (rows.length == 0) {
1083 notify("No feeds are selected.");
1087 if (rows.length > 1) {
1088 notify("Please select one feed.");
1098 function editSelectedFeedCat() {
1099 var rows = getSelectedFeedCats();
1101 if (rows.length == 0) {
1102 notify("No categories are selected.");
1106 if (rows.length > 1) {
1107 notify("Please select one category.");
1113 editFeedCat(rows[0]);
1117 function localPiggieFunction(enable) {
1119 piggie.style.display = "block";
1121 notify("I loveded it!!!");
1123 piggie.style.display = "none";
1128 function validateOpmlImport() {
1130 var opml_file = document.getElementById("opml_file");
1132 if (opml_file.value.length == 0) {
1133 notify("Please select OPML file to upload.");
1140 function updateFilterList() {
1142 if (!xmlhttp_ready(xmlhttp)) {
1143 printLockingError();
1147 // document.getElementById("prefContent").innerHTML = "Loading filters, please wait...";
1149 p_notify("Loading, please wait...");
1151 xmlhttp.open("GET", "backend.php?op=pref-filters", true);
1152 xmlhttp.onreadystatechange=filterlist_callback;
1157 function updateLabelList() {
1159 if (!xmlhttp_ready(xmlhttp)) {
1160 printLockingError();
1164 p_notify("Loading, please wait...");
1166 // document.getElementById("prefContent").innerHTML = "Loading labels, please wait...";
1168 xmlhttp.open("GET", "backend.php?op=pref-labels", true);
1169 xmlhttp.onreadystatechange=labellist_callback;
1173 function updatePrefsList() {
1175 if (!xmlhttp_ready(xmlhttp)) {
1176 printLockingError();
1180 p_notify("Loading, please wait...");
1182 xmlhttp.open("GET", "backend.php?op=pref-prefs", true);
1183 xmlhttp.onreadystatechange=prefslist_callback;
1188 function selectTab(id) {
1190 if (!xmlhttp_ready(xmlhttp)) {
1191 printLockingError();
1195 if (id == "feedConfig") {
1197 } else if (id == "filterConfig") {
1199 } else if (id == "labelConfig") {
1201 } else if (id == "genConfig") {
1203 } else if (id == "userConfig") {
1207 var tab = document.getElementById(active_tab + "Tab");
1210 if (tab.className.match("Selected")) {
1211 tab.className = "prefsTab";
1215 tab = document.getElementById(id + "Tab");
1218 if (!tab.className.match("Selected")) {
1219 tab.className = tab.className + "Selected";
1225 setCookie('ttrss_pref_acttab', active_tab);
1235 document.getElementById("prefContent").innerHTML =
1236 "<b>Fatal error:</b> This program needs XmlHttpRequest " +
1237 "to function properly. Your browser doesn't seem to support it.";
1241 active_tab = getCookie("ttrss_pref_acttab");
1242 if (!active_tab) active_tab = "genConfig";
1243 selectTab(active_tab);
1245 document.onkeydown = hotkey_handler;
1248 exception_error("init", e);
1252 function closeInfoBox() {
1253 var box = document.getElementById('infoBox');
1254 var shadow = document.getElementById('infoBoxShadow');
1257 shadow.style.display = "none";
1259 box.style.display = "none";
1263 function categorizeSelectedFeeds() {
1265 if (!xmlhttp_ready(xmlhttp)) {
1266 printLockingError();
1270 var sel_rows = getSelectedFeeds();
1272 var cat_sel = document.getElementById("sfeed_set_fcat");
1273 var cat_id = cat_sel[cat_sel.selectedIndex].id;
1275 if (sel_rows.length > 0) {
1277 notify("Changing category of selected feeds...");
1279 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=categorize&ids="+
1280 param_escape(sel_rows.toString()) + "&cat_id=" + param_escape(cat_id), true);
1281 xmlhttp.onreadystatechange=feedlist_callback;
1286 notify("Please select some feeds first.");
1292 function validatePrefsReset() {
1293 return confirm("Reset to defaults?");
1296 function browseFeeds() {
1298 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=browse", true);
1299 xmlhttp.onreadystatechange=infobox_callback;
1304 function feedBrowserSubscribe() {
1306 var list = document.getElementById("browseFeedList");
1308 var selected = new Array();
1310 for (i = 0; i < list.childNodes.length; i++) {
1311 var child = list.childNodes[i];
1312 if (child.id && child.id.match("FBROW-")) {
1313 var id = child.id.replace("FBROW-", "");
1315 var cb = document.getElementById("FBCHK-" + id);
1323 if (selected.length > 0) {
1325 xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=massSubscribe&ids="+
1326 param_escape(selected.toString()), true);
1327 xmlhttp.onreadystatechange=feedlist_callback;
1330 alert("No feeds are selected.");
1334 exception_error("feedBrowserSubscribe", e);